[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 20000309: Another Cray problem with netcdf f90 module

This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.


  • Subject: Re: 20000309: Another Cray problem with netcdf f90 module
  • Date: Thu, 09 Mar 2000 08:37:34 -0700

Martin,

> To: address@hidden
> From: Martin Dix <address@hidden>
> Subject: Another Cray problem with netcdf f90 module
> Organization: .
> Keywords: 200003080429.VAA07033

In the above message, you wrote:

> We have a Cray J90 that uses the Cray floating point format rather
> than IEEE.
> 
> typeSizes.f90 defines
> 
>   integer, parameter ::                                          &
>                         FourByteReal = selected_real_kind(P =  6, R =  37), &
>                        EightByteReal = selected_real_kind(P = 15, R = 307)
> 
> The problem is that on the Cray neither of these matches the default
> real type. On the Cray the real kinds are
> 
>  Kind   Precision     Range
>     4           6      2465
>     8          13      2465
>    16          28      2465
> 
> so FourByteReal is kind 4 and EightByteReal is kind 16. The default
> real is kind 8.
> 
> One way around this is something like.
> 
>    integer, parameter :: FourByteReal = selected_real_kind(P =  6, R =  37)
>    real(kind=FourByteReal), parameter, private :: xxx = 1.0
>    integer, parameter :: EightByteReal = 
> selected_real_kind(P=precision(xxx)+1)
> 
> This works for IEEE and the Cray but I'm not sure if it's the most
> portable solution. Another possibility is something like
> 
>    integer, parameter :: SingleReal = kind(1.0)
>    integer, parameter :: DoubleReal = selected_real_kind(P=precision(1.0)+1)
> 
> Both these ideas are from messages to the comp-fortran90 mailing list.
> 
> Regards
> 
> Martin Dix

Thanks for sending this in.  We'll see about incorporating it in the
next release.

Regards,
Steve Emmerson   <http://www.unidata.ucar.edu>