Re: [netcdfgroup] Some more definite clues for Fortran users regarding NF_UNLIMITED and NF_PUT_VAR_type.

  • To: Thomas Orgis <thomas.orgis@xxxxxx>
  • Subject: Re: [netcdfgroup] Some more definite clues for Fortran users regarding NF_UNLIMITED and NF_PUT_VAR_type.
  • From: Russ Rew <russ@xxxxxxxxxxxxxxxx>
  • Date: Mon, 28 Feb 2011 16:53:57 -0700
Hi Thomas.

> a colleague had an issue with the Fortran 77 interface that several other col
> leagues were also stymified by.
> 
> Somehow the documentation didn't make it clear enough that when you define a 
> record dimension with NF_UNLIMITED, that you need to fill that dimension usin
> g the NF_PUT_VARA family, as the NF_PUT_VAR family would simply write nothing
> . After coming to that conclusion by applying some reasoning, I found the hin
> t on http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-f77/NF_005fPUT_0
> 05fVAR_005f-type.html#NF_005fPUT_005fVAR_005f-type about "being careful" with
>  record variables.
> 
> I asked the colleague about what could be improved in the docs so that she wo
> uld have spotted that herself. Mind: she is coding Fortran 90, actually ... s
> o is used to functions that know the extend of their array arguments, so did 
> not think about the array extends of the data variable being irrelevant to th
> e Fortran 77 interface. The effect was "Why does NF_PUT_VAR_REAL(..., data(1:
> endtime)) not write anything when I make the time dimension NF_UNLIMITED?"
> Two suggestions arose:
> 
> 1. Put the token NF_UNLIMITED into the hint about record variables ... someon
> e just browsing the docs and not having read them fully doesn't necessarily c
> onnect the term "record variable" with "unlimited dimension".
> 
> 2. Mention in the page for NF_DEF_DIM that unlimited dimensions need to be fi
> lled with NF_PUT_VARA.
> That would have prevented the fatal combination of the example code for NF_DE
> F_DIM with NF_UNLIMITED and the example code for NF_PUT_VAR that suggested th
> at you can use NF_PUT_VAR to fill also record dimensions. Well, the latter su
> ggestion only arises when you read the doc for NF_DEF_DIM and the doc for NF_
> PUT_VAR right after each other ... and perhaps it would help to prevent that 
> link by using an example not involving a dimension named "time" for NF_PUT_VA
> R ... as "time" has been established as the canonical record dimension.

Thanks, I'm modifying the F77, F90, and C documentation as suggested.
It should be in the upcoming 4.1.2 release.

--Russ

> Alrighty then,
> 
> Thomas.
> 
> PS: The reason for using the Fortran 77 interface is apparently that the Fort
> ran 90 interface is not that readily available in installations. Well, I real
> ized long ago that I have to do my own NetCDF builds, carefully matching the 
> detailed compiler version I am using to make the NetCDF module work. Not ever
> yone does that ... so that might be a hint on continued usage of the somewhat
>  foreign interface even in Fortran 90 programs.
> 
> -- 
> Dipl. Phys. Thomas Orgis
> Atmospheric Modelling
> Alfred-Wegener-Institute for Polar and Marine Research
> Office phone: 049 331 288 2164
> 
> _______________________________________________
> netcdfgroup mailing list
> netcdfgroup@xxxxxxxxxxxxxxxx
> For list information or to unsubscribe,  visit: http://www.unidata.ucar.edu/m
> ailing_lists/ 



  • 2011 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: