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.
Dear Chen DS, > To: address@hidden > From: " " <address@hidden> > Subject: help on program reading NetCDF data > Organization: Beijing Univ. of Tech. > Keywords: 200402131117.i1DBHGrW006013 netCDF F90 The above message contained the following: > I am trying to use the netCDF lib to handle file in NetCDF format. > My practice begun with the try to get one variable¡¯s value. > > First, I linked the *mods: > ================================================ > ln -s /home/netcdf-3.5.0/src/f90/typesizes.mod > ln -s /home/netcdf-3.5.0/src/f90/netcdf.mod > ================================================ > But when I compiled the program ---pgf90 ¨Cc read_NC.f90 > it prompts: > > PGF90-S-0034-Syntax error at or near end of line (read_NC.f90: 6) > PGF90-S-0034-Syntax error at or near end of line (read_NC.f90: 10) > PGF90-S-0034-Syntax error at or near end of line (read_NC.f90: 14) > 0 inform, 0 warnings, 3 severes, 0 fatal for MAIN > PGF90/any Linux/x86 4.0-2: compilation completed with severe errors > > Could you tell me what went wrong with my try?Thank you in advance:) > > My program is as follows: > ======================================================= > use netcdf !line 1 > implicit none > integer :: ncId, rhVarId, status > real, dimension(3,6,33,39) :: rhValues > > nf90_open("METDOT3D_test",nf90_NoWrite,ncid) !line 6 > ! status = nf90_open("METDOT3D_test",nf90_NoWrite,ncid) > ! if (status =/ nf90_NoErr) call handle_err(status) > > nf90_inq_varid(ncid,"UWIND",rhVarid) !line 10 > ! status = nf90_inq_varid(ncid,"UWIND",rhVarid) > ! if (status =/ nf90_NoErr) call handle_err(status) > > nf90_get_var(ncid,rhVarid,rhValues) !line 14 > ! status = nf90_get_var(ncid,rhVarid,rhValues) > ! if (status =/ nf90_NoErr) call handle_err(status) > > write(*,*)rhValues(1,1,1,1) > stop > end > ======================================================= I'm sorry, but we're not Fortran-90 experts and we don't have the resources necessary to help with questions of this type. (I don't see anything wrong with the above.) I suggest that you post your question to the netCDF Group mailing-list at <address@hidden>. I suspect that a member of that list will be able to help you. > Yours > Chen DS > ================ > Beijing Univ. of Tech. > address@hidden Regards, Steve Emmerson