AMBER Archive (2009)

Subject: Re: [AMBER] bintraj and amber 10

From: Naser Alijabbari (na3m_at_virginia.edu)
Date: Sat Apr 25 2009 - 13:47:34 CDT


Dr. Walker and Moth, thanks for the help. Typing "ncdump -v coordinates -p
20 Imaged.mdcrd" gives the following:
  19.957183837890625, 1.9846684932708740234, 13.903683662414550781,
  20.08087158203125, 1.0455718040466308594, 13.7657318115234375,
  20.18518829345703125, 2.1238019466400146484, 14.822861671447753906 ;

So netcdf trajectory output uses double precision float (but this is 20
digit precision so I am not sure I completely understand what is going on.
Maybe the this has to do with the internal 80 bit floating point
calculation http://archive.ambermd.org/200310/0133.html)<http://archive.ambermd.org/200310/0133.html>

On Thu, Apr 23, 2009 at 8:37 PM, Naser Alijabbari <na3m_at_virginia.edu> wrote:

> Hi Chris, just going from three digit of precision to 6 digits of
> precision using Netcdf files makes my results different. Is there any way
> of increasing “float coordinates(frame, atom, spatial)” to “double” or
> “long double” just to see what the limit of this value does to my results.
> This is what I was looking through so please bear with me:
>
>
> “Trajectory files shall use 64 bit offsets
>
> This can be accomplished by setting a flag during file creation; refer to
> API docs for details."
>
>
>
> So I google 64 bit offset. This gives
> http://www.unidata.ucar.edu/software/netcdf/docs/netcdf/NetCDF-64-bit-Offset-Format-Limitations.html
>
> “A 64-bit offset format netCDF file can have up to 2^32 - 1 fixed sized
> variables, each under 4GiB in size. If there are no record variables in the
> file the last fixed variable can be any size.”
>
>
>
> So I look up record variable:
>
>
> https://www.unidata.ucar.edu/software/netcdf-java/formats/RecordsInNetcdf3.html
>
> “In the NetCDF version 3 data model, *record variables* are ones that use
> the *unlimited dimension* (also known as the *record dimension*). These
> are laid out on disk differently than non-record variables. All of the data
> for a non-record variable is stored contiguously on disk. Record variables,
> in contrast, are divided up into*records*, and each record contains the
> data for all record variables for the ith record dimension index. You can
> append an unlimited number of records to a NetCDF file.”
>
> I am still not sure what “If there are no record variables in the file the
> last fixed variable can be any size.” means.
>
>
>
> This is my float.h:
>
> #define FLT_RADIX 2
>
> /* Number of base-FLT_RADIX digits in the significand of a float */
>
> #define FLT_MANT_DIG 24
>
> /* Number of decimal digits of precision in a float */
>
> #define FLT_DIG 6
>
> /* Addition rounds to 0: zero, 1: nearest, 2: +inf, 3: -inf, -1:
> unknown */
>
> #define FLT_ROUNDS 1
>
> /* Difference between 1.0 and the minimum float greater than 1.0 */
>
> #define FLT_EPSILON 1.19209290e-07F
>
> /* Minimum int x such that FLT_RADIX**(x-1) is a normalised float */
>
> #define FLT_MIN_EXP (-125)
>
> /* Minimum normalised float */
>
> #define FLT_MIN 1.17549435e-38F
>
> /* Minimum int x such that 10**x is a normalised float */
>
> #define FLT_MIN_10_EXP (-37)
>
> /* Maximum int x such that FLT_RADIX**(x-1) is a representable float */
>
> #define FLT_MAX_EXP 128
>
> /* Maximum float */
>
> #define FLT_MAX 3.40282347e+38F
>
> /* Maximum int x such that 10**x is a representable float */
>
> #define FLT_MAX_10_EXP 38
>
>
>
> /* Number of base-FLT_RADIX digits in the significand of a double */
>
> #define DBL_MANT_DIG 53
>
> /* Number of decimal digits of precision in a double */
>
> #define DBL_DIG 15
>
> /* Difference between 1.0 and the minimum double greater than 1.0 */
>
> #define DBL_EPSILON 2.2204460492503131e-16
>
> /* Minimum int x such that FLT_RADIX**(x-1) is a normalised double */
>
> #define DBL_MIN_EXP (-1021)
>
> /* Minimum normalised double */
>
> #define DBL_MIN 2.2250738585072014e-308
>
> /* Minimum int x such that 10**x is a normalised double */
>
> #define DBL_MIN_10_EXP (-307)
>
> /* Maximum int x such that FLT_RADIX**(x-1) is a representable double
> */
>
> #define DBL_MAX_EXP 1024
>
> /* Maximum double */
>
> #define DBL_MAX 1.7976931348623157e+308
>
> /* Maximum int x such that 10**x is a representable double */
>
> #define DBL_MAX_10_EXP 308
>
>
>
> /* Number of base-FLT_RADIX digits in the significand of a long double
> */
>
> #define LDBL_MANT_DIG 64
>
> /* Number of decimal digits of precision in a long double */
>
> #define LDBL_DIG 18
>
> /* Difference between 1.0 and the minimum long double greater than 1.0
> */
>
> #define LDBL_EPSILON 1.08420217248550443401e-19L
>
> /* Minimum int x such that FLT_RADIX**(x-1) is a normalised long double
> */
>
> #define LDBL_MIN_EXP (-16381)
>
> /* Minimum normalised long double */
>
> #define LDBL_MIN 3.36210314311209350626e-4932L
>
> /* Minimum int x such that 10**x is a normalised long double */
>
> #define LDBL_MIN_10_EXP (-4931)
>
> /* Maximum int x such that FLT_RADIX**(x-1) is a representable long
> double */
>
> #define LDBL_MAX_EXP 16384
>
> /* Maximum long double */
>
> #define LDBL_MAX 1.18973149535723176502e+4932L
>
> /* Maximum int x such that 10**x is a representable long double */
>
> #define LDBL_MAX_10_EXP 4932
>
>
> Is “float coordinates(frame, atom, spatial)” is float because of the “64
> bit offset”? Is there a way of increasing this to something else? Thanks
>
> On Thu, Apr 23, 2009 at 1:46 PM, Chris Moth <chris.moth_at_vanderbilt.edu>wrote:
>
>> > Is there any way to see the precision of what is written in the netcdf
>> > file?
>>
>> Google gives this
>>
>> http://ambermd.org/netcdf/nctraj.html
>>
>> And, the ncdump tool which comes with netcd gives some clues.
>>
>> mycomputer> ncdump -h 16301-16400.crd
>> netcdf 16301-16400 {
>> dimensions:
>> frame = UNLIMITED ; // (63 currently)
>> spatial = 3 ;
>> atom = 35196 ;
>> label = 5 ;
>> cell_spatial = 3 ;
>> cell_angular = 3 ;
>> variables:
>> char spatial(spatial) ;
>> float time(frame) ;
>> time:units = "picosecond" ;
>> float coordinates(frame, atom, spatial) ;
>> coordinates:units = "angstrom" ;
>> char cell_spatial(cell_spatial) ;
>> char cell_angular(cell_angular, label) ;
>> double cell_lengths(frame, cell_spatial) ;
>> cell_lengths:units = "angstrom" ;
>> double cell_angles(frame, cell_angular) ;
>> cell_angles:units = "degree" ;
>>
>> // global attributes:
>> :title = "" ;
>> :application = "AMBER" ;
>> :program = "pmemd" ;
>> :programVersion = "10.0" ;
>> :Conventions = "AMBER" ;
>> :ConventionVersion = "1.0" ;
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> AMBER mailing list
>> AMBER_at_ambermd.org
>> http://lists.ambermd.org/mailman/listinfo/amber
>>
>
>
_______________________________________________
AMBER mailing list
AMBER_at_ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber