Hi Hailin, > I read the doc page of NF90_GET_VAR, which link is as below, and found > that the values of count in the sample code are confusing. > > http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-f90/NF90_005fGET_005fVAR.html > > The following is the sample code in the page. > > use netcdf > implicit none > integer :: ncId, rhVarId, status > integer, parameter :: numLons = 10, numLats = 5, numTimes = 3 > real, dimension(numLons, numLats, numTimes) & > :: rhValues > ... > status = nf90_open("foo.nc", nf90_NoWrite, ncid) > if(status /= nf90_NoErr) call handle_err(status) > ... > status = nf90_inq_varid(ncid, "rh", rhVarId) > if(status /= nf90_NoErr) call handle_err(status) > !Read the values at the last time by passing an array section > status = nf90_get_var(ncid, rhVarId, rhValues(:, :, 3), & > start = (/ 1, 1, numTimes /), & > count = (/ numLats, numLons, 1 /)) > if(status /= nf90_NoErr) call handle_err(status) > > > In the code hilighted above, the values of count should be (/numLons, > numLats, 1/) to conform to declaration of the array. Thanks for reporting the problem and the fix. I've updated the documentation in the latest snapshot, so it should be corrected in the next beta release. --Russ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu Ticket Details =================== Ticket ID: RSG-568287 Department: Support netCDF Priority: Normal Status: Closed
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.