[Wrf-users] Saving one variable from a wrfout file to a separate netcdf file.
Lyndz
olagueralyndonmark429 at gmail.com
Sun Apr 8 01:29:07 MDT 2018
Dear WRF-experts,
I am trying to calculate cloud top temperature from a raw wrfout file and
save it as a separate netcdf file that can be processed by GRADS and CDO.
Here is the script that I am using:
a = addfile("wrfout_d01_2013-08-16_00_00_00.nc","r")
ctt = wrf_user_getvar(a,"ctt",-1) ; Time X Lat X Lon
Lat = wrf_user_getvar(a,"XLAT",0)
Lon = wrf_user_getvar(a,"XLONG",0)
printVarSummary(ctt)
system("/bin/rm -f test.nc") ; remove any pre-existing file
ncdf = addfile("test.nc" ,"c") ; open output netCDF file
fAtt = True ; assign file attributes
fAtt at title = "Cloud Top Temperature degC"
fAtt at source_file = "wrfoutfile"
fAtt at Conventions = "None"
fAtt at creation_date = systemfunc ("date")
fileattdef( ncdf, fAtt ) ; copy file attributes
filedimdef(ncdf,"time",-1,True)
ncdf->ctt = ctt
ncdf->Lat = Lat
ncdf->Lon = Lon
*Problem*
*[1] *The output file cannot be read by GRADS/CDO. Am I missing something
important when writing out the variable?
*[2]* Any suggestion on how to do this correctly?
I'll appreciate any help.
Sincerely,
*Lyndon Mark P. Olaguera*
PhD Student
Laboratory of Climatology
Department of Geography
Faculty of Urban Environmental Science
Minami-Osawa Campus
Tokyo Metropolitan University
Hachioji Tokyo, Japan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/wrf-users/attachments/20180408/0b7919f9/attachment.html>
More information about the Wrf-users
mailing list