[RegCNET] Re: Clarification about 'postproc.in'
Sara Rauscher
srausche at ictp.it
Tue Feb 28 18:27:51 CET 2006
Hi,
Regarding reading netcdf files produced by postproc in Grads --
("unfortunately, the Netcdf files, which you get from postproc, are not
readable in Grads") -- I have never had problems reading netCDF files
created with postproc with Grads. Svetlana's problem with the "no
discernable X coordinate" may be specific to her files -- Svetlana,
would you send me the netCDF file and/or additional information? Maybe I
can help.
Grads should read these netCDF files in, but the problem is that they
don't contain the correct lat/lon information. You can create a data
descriptor file that will supply the correct lat/lon information for
your netcdf file to Grads.
For example, I created the following file using postproc: ATM200208AVG.nc
If I use the ncdump utility (ncdump -h ATM200208AVG.nc) I can view the
file information:
netcdf ATM200208AVG {
dimensions:
lon = 49 ;
lat = 32 ;
level = 18 ;
time = UNLIMITED ; // (1 currently)
variables:
float lon(lon) ;
lon:long_name = "Longitude" ;
lon:units = "degrees_east" ;
lon:actual_range = -4.888423f, 32.60124f ;
float lat(lat) ;
lat:long_name = "Latitude" ;
lat:units = "degrees_north" ;
lat:actual_range = 37.03973f, 54.29553f ;
float level(level) ;
level:long_name = "Height_Index" ;
level:units = "level" ;
level:actual_range = 1050.f, 0.f ;
double time(time) ;
time:long_name = "Time" ;
time:units = "hours since 1900-1-1 00:00:0.0" ;
time:actual_range = 899544., 899544. ;
float U(time, level, lat, lon) ;
U:long_name = "Zonal Wind" ;
U:units = "m/s" ;
U:missing_value = -1.e+30f ;
float V(time, level, lat, lon) ;
V:long_name = "Meridional Wind" ;
V:units = "m/s" ;
V:missing_value = -1.e+30f ;
float TK(time, level, lat, lon) ;
TK:long_name = "Temperature" ;
TK:units = "K" ;
TK:missing_value = -1.e+30f ;
float QD(time, level, lat, lon) ;
QD:long_name = "Mixing Ratio" ;
QD:units = "kg/kg" ;
QD:missing_value = -1.e+30f ;
float QC(time, level, lat, lon) ;
QC:long_name = "Cloud Mixing Ratio" ;
QC:units = "kg/kg" ;
QC:missing_value = -1.e+30f ;
float MSE(time, level, lat, lon) ;
MSE:long_name = "Moist Static Energy" ;
MSE:units = "m2/s2" ;
MSE:missing_value = -1.e+30f ;
float RH(time, level, lat, lon) ;
RH:long_name = "Relative Humidity" ;
RH:units = "fraction" ;
RH:missing_value = -1.e+30f ;
float HGT(time, level, lat, lon) ;
HGT:long_name = "Geopotential Height" ;
HGT:units = "m" ;
HGT:missing_value = -1.e+30f ;
float PS(time, lat, lon) ;
PS:long_name = "Surface Pressure" ;
PS:units = "hPa" ;
PS:missing_value = -1.e+30f ;
float RT(time, lat, lon) ;
RT:long_name = "Total Precip" ;
RT:units = "mm/day" ;
RT:missing_value = -1.e+30f ;
float TGRND(time, lat, lon) ;
TGRND:long_name = "Ground Temperature" ;
TGRND:units = "K" ;
TGRND:missing_value = -1.e+30f ;
float SMT(time, lat, lon) ;
SMT:long_name = "Total Soil Water" ;
SMT:units = "mm" ;
SMT:missing_value = -1.e+30f ;
float RB(time, lat, lon) ;
RB:long_name = "Base Flow" ;
RB:units = "mm/day" ;
RB:missing_value = -1.e+30f ;
// global attributes:
:domxmin = -4.888423f ;
:domxmax = 32.60124f ;
:domymin = 37.03973f ;
:domymax = 54.29553f ;
:domzmin = 1050.f ;
:domzmax = 0.f ;
With information about the model grid (from OUT_HEAD.CTL), I can take
this information and make a data descriptor file that I can give any
name I like (say, atmavg). Once I write the descriptor file, I can open
the file in grads using "open atmavg", as indicated below:
DSET ^ATM200208AVG.nc
dtype netcdf
undef -1.e+30
pdef 49 32 lcc 45.39 13.48 24.50 16.00 30.00 60.00 13.48 60000. 60000.
xdef 175 linear -9.61 0.2703
ydef 78 linear 34.70 0.2703
zdef 18 levels 74.08 122.24 175.22 237.83 310.08 387.14 464.20 541.26 618.32 695.38 767.62 830.23 883.21 926.56 960.27 984.35 998.80 1008.43
1008.43
tdef 1 linear 0z01aug2002 30dy
vars 13
U=>u 18 t,z,y,x westerly wind
V=>v 18 t,z,y,x southerly wind
TK=>tk 18 t,z,y,x air temperature
QD=>qd 18 t,z,y,x air specific humidity
QC=>qc 18 t,z,y,x cloud water mixing ratio
MSE=>mse 18 t,z,y,x moist static energy
RH=>rh 18 t,z,y,x relative humidity
HGT=>hgt 18 t,z,y,x geopotential height
PSA=>psa 0 t,y,x surface pressure
RT=>rt 0 t,y,x total precipitation
TGRND=>tgrnd 0 t,y,x groud temperature in BATS
SMT=>smt 0 t,y,x total soil water in mm H2O
RB=>rb 0 t,y,x accumulated infiltration
endvars
Note that descriptor files (for netcdf!) work with Grads version 1.9
and above ONLY - you can see the documentation at
http://grads.iges.org/grads/gadoc/descriptorfile.html.
I hope this is helpful, please let me know if you encounter problems or
it doesn't work.
cheers,
sara
Moetasim wrote:
>Hi,
>As far as I know...unfortunately, the Netcdf files, which you get from
>postproc, are not readable in Grads. You have two options:
>1) Use ferret/NCL instead of Grads
>2) Write CTL file for files which you get after postprocessing in Grads format.
>Writing CTL file should not be very tricky. YOu can use ncdump to check the
>contents/list of variables of Netcdf postproc files..The sequence of variables
>in Grads formatted files will be same. You should use any ATM???.CTL file as
>template for ATM postproc file and similarly RAD and SRF CTL files as template
>for writing CTL files for your postprocessed Grads formatted files. Remember
>that you just need to change variable info and time info in CTL files...Rest
>should almost remain same...
>Try writing one.. If you are successful then do post your CTL files at
>RegCNET.
>And if you are not successful then................. you can ask again..or may
>be someone else have already tried for such CTL files so he can post for you...
>I hope you will give a try to any of the options I have mentioned above.
>
>
>Quoting ?????? <dolgikh at meteo.kz>:
>
>
>
>>Dear Moet.
>>
>>Thanks a lot for clarification about cru.param.
>>
>>But we face one more problem and can not go further.
>>
>>We have a problem with opening NetCDF files (ATM199703AVG.nc, etc) in GRads.
>>
>>The error is:
>>ga-> sdfopen ATM199703AVG.nc
>>Scanning self-describing file: ATM199703AVG.nc
>>SDF file has no discernable X coordinate.
>>
>>But when we try to open PRE199703.nc everything is ok.
>>May be it is possible to change parameters in postproc.in to get coordinates
>>
>>for output .nc file?
>>Is there description of postproc.in file anywhere?
>>it is possible to get output files in GRADS format (.dat), but we can't
>>recieve .ctl file with .dat file.
>>
>>I would be very grateful if you agree to help us again.
>>Thank you in advance
>>Best regards
>>Svetlana
>>
>>
>>
>>
>
>_______________________________________________
>RegCNET mailing list
>RegCNET at lists.ictp.it
>https://lists.ictp.it/mailman/listinfo/regcnet
>
>
--
Sara A. Rauscher
Physics of Weather and Climate Section
The Abdus Salam International Centre for Theoretical Physics
Strada Costiera 11
34014 Trieste ITALY
ph: +39 040 2240 225 (please note change) fax: +39 040 2240 449
email: srausche at ictp.it
More information about the RegCNET
mailing list