[ncl-talk] ncl CODE BUG IN CONVERTING NETCDF FILE IN INTERMEDIATE FORMAT
jayanti pal
jiban_samudra18 at yahoo.com
Wed Nov 16 04:26:37 MST 2022
Sir,
I am tryin to convert netcdf file to intermediate format usinf following code
f=addfile("gfs_2020160512.nc", "r")TT=f->timesst=f->t_2lat=f->latlon=f->lonprintVarSummary(sst)sst=sst(0,::-1,:)printVarSummary(sst)utc_d=cd_calendar(TT,0)ymdh=cd_calendar(TT,-3)yyyy=tointeger(utc_d(:,0))mm=tointeger(utc_d(:,1))dd=tointeger(utc_d(:,2))hh=tointeger(utc_d(:,3))date=yyyy+"-0"+mm+"-"+dd+"_0"+hhWPS_IM_root_name="SST"output_file_name=WPS_IM_root_name+":"+dateField="sst"units="degC"desc="Sea Surface Temperature"sst=sst(0,:,:)print(sst&lat(0))opt = Trueopt at projection = 0opt at date = dateopt at startloc = "SWCORNER"opt at startlon = sst&lon(0)opt at startlat = sst&lat(0)opt at deltalon = sst&lon(1)-sst&lon(0)opt at deltalat = sst&lat(1)-sst&lat(0)opt at is_wind_earth_relative = Falseopt at level = 1opt at source = "NOAA High-resolution Blended Analysis"printVarSummary(sst)wrf_wps_write_int(WPS_IM_root_name,Field,units,desc,sst(0,:,:),opt)
The above successfully run and create intermediate format which content is as follow================================================ FIELD = TTUNITS = k DESCRIPTION = TemperatureDATE = 2020-05-16_012 FCST = 0.000000SOURCE = Unknown data sourceLEVEL = 1.000000I,J DIMS = 1440, 721IPROJ = 0 PROJECTION = LAT LON REF_X, REF_Y = 1.000000, 1.000000 REF_LAT, REF_LON = 0.000000, 0.000000 DLAT, DLON = 0.000000, 0.000000 EARTH_RADIUS = 6367.470215DATA(1,1)=230.716217
Errors line is marked in red. ref lat, ref lon are thought to be start lat and lon and lat lon interval (dlat, dlon are -0.25 and 0.25 respectively)
Using ungrib in WRF when same file is used, the folowing content is thereFIELD = TTUNITS = K DESCRIPTION = TemperatureDATE = 2020-05-16_12:00:00 FCST = 0.000000SOURCE = NCEP GFS ModelLEVEL = 200100.000000I,J DIMS = 1440, 721IPROJ = 0 PROJECTION = LAT LON REF_X, REF_Y = 1.000000, 1.000000 REF_LAT, REF_LON = 90.000000, 0.000000 DLAT, DLON = -0.250000, 0.250000 EARTH_RADIUS = 6371.229492DATA(1,1)=271.702606
pLEASE HELP ME TO RECTIFY THE ncl SCRIPT.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20221116/a3b3d49e/attachment-0001.htm>
More information about the ncl-talk
mailing list