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.
>From: "linx" <address@hidden> >Organization: ? >Keywords: 200312201636.hBKGavp2008288 netCDF Fortran PC Jordan (:-) >Hi,very glad to receive your reply and be thankful for your advice. > >Watching or Playing a basketball game is one of my hobbies and M.Jordan >is no doubt one of the greatest basketball player in my eye.So I use >his name, then add my surname to register this email box. > >Although I just start to use netcdf a short time before,I have the >basic knowledge of it.So I certainly know its ablity to "hyperslab" >the data and do some basic program in fortran,but I'm not familiar >with some other cases. OK. >In fact,I use a ordinary PC with a OS of windows2000 and do some data >analysis in climatology. When I deal with a nc file only containing >one level's data,I defined a array of 3 dimension, hgt(144,73,671) for >example,and use the following fortran code to read it. > > real*4 hgt(144,73,671) > ....... > start(1)=1;start(2)=1;start(3)=1 > count(1)=144;count(2)=73;count(3)=671 > ......... > STATUS = NF_GET_VARA_real(NCID, varid,start,count,hgt) > if ( status/=nf_noerr ) write (*,*) nf_strerror(status) > ..... > >and these code work well . OK. This means that you should be able to define your array similarly and read a single level at a time. >When I meet one nc file containing all 17 levels' data,I make the >similar codes.But this time it can't be compiled,maybe because of the >limit of my memory size(396MB) > > real*4 hgt(144,73,17,671) > ....... > start(1)=1;start(2)=1;start(3)=5;star(4)=1 > count(1)=144;count(2)=73;count(3)=1;count(4)=671 > ......... > STATUS = NF_GET_VARA_real(NCID, varid,start,count,hgt) > if ( status/=nf_noerr ) write (*,*) nf_strerror(status) > >Can you tell me how to modify the codes or other methods to resolve >such problem. If you want to read a single level, change your declaration for 'hgt' to: real*4 hgt(144,73,1,671) and then read in a single level. If you want to read all levels for a single month, change your declaration for 'hgt' to: real*4 hgt(144,73,17,1) and then read in a single level. And so on. >Thanks a lot! No worries. Best of luck. Tom Yoksas >From address@hidden Wed Dec 24 14:54:39 2003 Thank you for your help.I've already resolve this problem. Now I have a better understanding for the 'superslab' ability of Netcdf. Merry Christmas! J.L