program readfile ! ! ifort -r8 -I/home/tgcm/intel/netcdf-4.1.1/include -L/home/tgcm/intel/netcdf-4.1.1/lib -lnetcdf readfile.F90 ! implicit none #include character(len=1024) :: file integer :: istat,ncid,id,nlon real,allocatable :: lon(:) file = ' ' file = 'gwf_fxyzjtot_jun15_2009.nc' istat = nf_open(file,NF_NOWRITE,ncid) istat = nf_inq_dimid(ncid,"lon",id) istat = nf_inq_dimlen(ncid,id,nlon) if (.not.allocated(lon)) allocate(lon(nlon)) istat = nf_get_var_double(ncid,id,lon) write(6,"('readfile: nlon=',i4,' lon=',/,(6e12.4))") & nlon,lon end program readfile