begin fn = "uvwtz_Dec2016.nc" ; define filename in = addfile(fn,"r") ; open netcdf file final_2 fn1 = "cicldSPHR_Dec2016.nc" in1 = addfile(fn1,"r") itStrt = 9 itLast = 12 lonStrt = 20 lonLast = 100 u = short2flt(in->u(itStrt:itLast,:,::-1,lonStrt:lonLast)) SPH = short2flt(in1->q(itStrt:itLast,:,::-1,lonStrt:lonLast)) printVarSummary(u) ;===> NO: lat=in->latitude(::-1) Do not explicitly read from file ;===> NO: lon=in->longitude(20:100) NCL does the book keeping ;===> NO: time=in->time(09:12) as part of data structure/object input u&level = u&level*100 ; over write with new values u&level@units = "Pa" printVarSummary(u) ; LOOK at this ;--- Zonal moisture transport --------------------------------------------------------------------- ZMT=u*SPH ; not appropriate to use monthly means for ; for a non-linear quantity ZMT@long_name = "zonal moisture transport" ZMT@units="(m/s)(kg/kg)" copy_VarCoords(u, ZMT) printVarSummary(ZMT) ;---Use Method 1 to write netCDF ... easier filo = "example.nc" ; Output file system("/bin/rm -f example.nc") ; remove any pre-existing file fout = addfile (filo, "c") ; open output file ;=================================================================== ; create global attributes of the file fAtt = True ; assign file attributes fAtt@title = "NCL Simple Approach to netCDF Creation" fAtt@source_file = "uvwtz_Dec2016.nc" fAtt@Conventions = "None" fAtt@creation_date = systemfunc ("date") fileattdef( fout, fAtt ) ; copy file attributes ;=================================================================== ; make time an UNLIMITED dimension; recommended for most applications ;=================================================================== filedimdef(ncdf,"time",-1,True) fout->ZMT = ZMT end