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

Re: unlimited time as 3rd dimension for 2d arrays



Hi Mike:

Mike Mueller wrote:
> 
> Dear John,
> 
> I am working for while with netCDF and FORTRAN.
> So far I used the PUT_VAR_type to put all the variables at ones.
> Now I would like to have the time as the unlimited dimension. Every time
> step of my model run I have a bunch of 2d arrays which I would like to
> write into a netCDF file ordered by time
> 
> As far as I understand I have to create 3d arrays with time as first
> dimension and then use PUT_VARA_type. Doing this, I get an unknown error.

make sure you also declare time as the UNLIMITED dimension, eg
  time = unlimited
if you are using CDL. Then use the NF_PUT_VARA_<type> Fortran routine. 

This should work as you want. send me the actual error message if not.

> 
> Is there any other way to this?
> I am not sure if understood the philosophy of the unlimited dimension.

unlimited just means that you can write an arbitrary number of steps
along that dimesnion, and the file keeps expanding as you do so.

> Is there a short example like this:
> 
> data:
> time = 0
> value, value
> value, value
> 
> time = 1
> value, value
> value, value
> 
> time = 2
> value, value
> value, value
> 
> etc.
> 
> you could point me to.
> 
> This seems to be an trivial problem. Actually if had the FORTRAN code that
> produced the example CDL output in the FORTRAN-User's-Guide (2.1.2) just
> with several time steps, each step written extra rather than at once, my
> problem might be solved.

you should upgrade to netcdf 3 if possible.
i cant find any examples. send me your code and i'll have a look.

> 
> Thanks.
> Mike
> 
> ---------------------------------------------------------
>         Dipl.-Ing. Mike Mueller, M.Sc.
>         Dresden Groundwater Research Center
>         Meraner Str. 10
>         D-01217 Dresden
>         Germany
> Tel.:   +49 351/4050675
> Fax.:   +49 351/4050679
> e-mail: address@hidden
> http://www.dgfz.de
> ----------------------------------------------------------