About portable programming in fortran
yuanliu1_at_gmail.com
Date: 03/29/05
- Next message: Steven G. Kargl: "Re: About portable programming in fortran"
- Previous message: James Giles: "Re: Namelist Internal Read"
- Next in thread: Steven G. Kargl: "Re: About portable programming in fortran"
- Reply: Steven G. Kargl: "Re: About portable programming in fortran"
- Reply: James Van Buskirk: "Re: About portable programming in fortran"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 28 Mar 2005 16:05:13 -0800
I have a fortran code, I want it to work both under single precision
and double precision mode. I made it partly work.
first I define the kind parameter,
integer, parameter :: myprec = selected_real_kind(*) //* can be 6 for
single precision and 15 for double precision.
then everything is declared in this way.
real (myprec) a, b, c
if I want my code to work under double precision, I just set * to 15,
and so on.
but still, this is not perfect. Since for double precision variables, I
have dabs, dsqrt, zsqrt, zexp, dexp. For single precision, I have abs,
sqrt, csqrt, exp...
how to make the intrinsic function portable?? I suppose one way is to
conditionally compile. Am I right?
- Next message: Steven G. Kargl: "Re: About portable programming in fortran"
- Previous message: James Giles: "Re: Namelist Internal Read"
- Next in thread: Steven G. Kargl: "Re: About portable programming in fortran"
- Reply: Steven G. Kargl: "Re: About portable programming in fortran"
- Reply: James Van Buskirk: "Re: About portable programming in fortran"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|