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.
> Hello unidata people! > > > > The other times you helped me a lot. So I will ask you two more > questions: > > > > 1----I want to read a variable, for instante: (in fortran 77) > > > > parameter(lon=2,lat=2,theta2,time4) > > u(lon,lat,theta,time) > > > > Have I to define the lon,lat,.....first?. But if you don't know the > dimensions, can you define a maximun value to lon,lat... Not if you are reading it; the person who write the file has to define lat and lon. Take a look at the F77 examples: http://www.unidata.ucar.edu/software/netcdf/examples/programs/ > > for example: > > > > parameter(lon=10,lat=10,theta=10,time=10) > > u(lon,lat,theta,time) > > > > I tried it but the variable wasn't read correctly > > 2----I want to read a variable with 4 dimensions u(x,y,z,t). I have had > some problems because the 4 dimensions variable is too big. > > The program reads the variable fast but I have problems writing > them. > > That I wanted to do is: > > Read for t=1 u(x,y,z) > > t=2 u(x,y,z) > > .... > > I have read the variable with nf_get_var_real but it reads all the > variable completely. And I have also tried with nf_get_vara_real but it > doesn't work. > > Do you know if is it possible? Yes, this is possible, and nf_get_vara_real is what you want to use. Take a look at this example: http://www.unidata.ucar.edu/software/netcdf/examples/programs/pres_temp_4D_rd.f > > > > > > Thank you very much. You helped me always. You do a great work!! > Thanks! Keep on netCDFing! Ed Ticket Details =================== Ticket ID: MVE-325018 Department: Support netCDF Priority: Normal Status: Closed