 |
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
PaulLaidler Site Admin

Joined: 21 Feb 2005 Posts: 7332 Location: Salford, UK
|
Posted: Sat Aug 06, 2022 8:01 am Post subject: |
|
|
Dan
I will add NORM2 to the list of missing features from the 2008 standard.
Regarding afivo-pic, please provide a short working program that illustrates the what is missing from FTN95. |
|
Back to top |
|
 |
JohnCampbell
Joined: 16 Feb 2006 Posts: 2394 Location: Sydney
|
Posted: Sat Aug 06, 2022 10:03 am Post subject: |
|
|
I am not familiar with the history of NORM2, but I do use a similar RMS function, which I thought was more often used ? |
|
Back to top |
|
 |
Kenneth_Smith

Joined: 18 May 2012 Posts: 520 Location: Hamilton, Lanarkshire, Scotland.
|
Posted: Sat Aug 06, 2022 10:21 am Post subject: |
|
|
If adding NORM2 to FTN95, then perhaps also consider HYPOT?
hypot(x,y) = sqrt(x*x + y*y) = abs(complex(x,y)) |
|
Back to top |
|
 |
PaulLaidler Site Admin

Joined: 21 Feb 2005 Posts: 7332 Location: Salford, UK
|
Posted: Sat Aug 06, 2022 1:26 pm Post subject: |
|
|
I have added HYPOT to the list. |
|
Back to top |
|
 |
DanRRight

Joined: 10 Mar 2008 Posts: 2559 Location: South Pole, Antarctica
|
Posted: Sun Aug 07, 2022 10:29 am Post subject: Re: |
|
|
PaulLaidler wrote: | Regarding afivo-pic, please provide a short working program that illustrates the what is missing from FTN95. |
Paul,
OK, here is an example of module m_af_types which has no other modules to USE but it has #include "cpp_macros.h". I further simplified both by shortening of them and removing mentioning GFortran there
m_af_types.f90:
Code: | #include "cpp_macros.h"
module m_af_types
use iso_c_binding, only: c_ptr
implicit none
public
integer, parameter :: dp = kind(0.0d0)
end module m_af_types
|
cpp_macros.h:
Code: | !#ifdef __GFORTRAN__
!#define PASTE(a) a
!#define CONCAT(a,b) PASTE(a)b
!#else
#define PASTE(a) a ## b
#define CONCAT(a,b) PASTE(a,b)
!#endif
#if NDIM == 1
#define DTIMES(TXT) TXT
#define DINDEX(TXT) TXT(1)
#define DSLICE(lo,hi) lo(1):hi(1)
#define KJI_DO(lo,hi) i = lo, hi
#define CLOSE_DO
#define IJK i
#define IJK_(s) CONCAT(i_,s)
#define DIMNAME "1d"
#elif NDIM == 2
#define DTIMES(TXT) TXT, TXT
#define DINDEX(TXT) TXT(1), TXT(2)
#define DSLICE(lo,hi) lo(1):hi(1), lo(2):hi(2)
#define KJI_DO(lo,hi) j = lo, hi; do i = lo, hi
#define CLOSE_DO end do
#define IJK i, j
#define IJK_(s) CONCAT(i_,s), CONCAT(j_,s)
#define DIMNAME "2d"
#elif NDIM == 3
#define DTIMES(TXT) TXT, TXT, TXT
#define DINDEX(TXT) TXT(1), TXT(2), TXT(3)
#define DSLICE(lo,hi) lo(1):hi(1), lo(2):hi(2), lo(3):hi(3)
#define KJI_DO(lo,hi) k = lo, hi; do j = lo, hi; do i = lo, hi
#define CLOSE_DO end do; end do
#define IJK i, j, k
#define IJK_(s) CONCAT(i_,s), CONCAT(j_,s), CONCAT(k_,s)
#define DIMNAME "3d"
#endif |
The compilation (i gather result of compilation in the file Z ):
Code: | FTN95 m_af_types.f90 /CFPP NDIM 2 >Z |
The file Z:
Code: | *** More than one source file specified with names m_af_types.f90 and NDIM
1 ERROR [m_af_types.f90] - Compilation failed. |
Additionally this piece also looks very unusual
Code: | #define PASTE(a) a ## b |
|
|
Back to top |
|
 |
PaulLaidler Site Admin

Joined: 21 Feb 2005 Posts: 7332 Location: Salford, UK
|
Posted: Sun Aug 07, 2022 4:13 pm Post subject: |
|
|
Dan
Some of the #define's illustrated here are not currently supported by FTN95.
Preprocessing instructions, such as these that are common to the language C, are not Fortran standard conforming.
Our first priority is to add useful features from the 200x Fortran standards that are not currently supported. |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|