<div><div dir="auto">hi, there is a whole lot of messages on cdo mailing lists about cdo’s inability to work with wrf output because of the way wrf writes files. This has something to do with the latitude, longitude or more specifically how Grid is defined in wrf. You need to regrid wrf output on a stencil grid to get it to work with cdo or grads. You can find how a ctl file for grads should be written to read files if you can get the grads netcdf thing to work. </div><div dir="auto"><br></div><div dir="auto"><br></div><br><div class="gmail_quote"><div>On Tue, 10 Apr 2018 at 12:23 pm, Lyndz <<a href="mailto:olagueralyndonmark429@gmail.com">olagueralyndonmark429@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Dear WRF-experts,<div><br></div><div>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.</div><div><br></div><div><br></div><div>Here is the script that I am using:</div><div><br></div><div><div>a = addfile("<a href="http://wrfout_d01_2013-08-16_00_00_00.nc" target="_blank">wrfout_d01_2013-08-16_00_00_00.nc</a>","r")</div><div><br></div><div>ctt = wrf_user_getvar(a,"ctt",-1) ; Time X Lat X Lon</div><div><br></div><div>Lat = wrf_user_getvar(a,"XLAT",0)</div><div>Lon = wrf_user_getvar(a,"XLONG",0)</div><div><br></div><div>printVarSummary(ctt)</div><div><br></div><div>system("/bin/rm -f <a href="http://test.nc" target="_blank">test.nc</a>") ; remove any pre-existing file</div><div> ncdf = addfile("<a href="http://test.nc" target="_blank">test.nc</a>" ,"c") ; open output netCDF file</div><div> fAtt = True ; assign file attributes</div><div> fAtt@title = "Cloud Top Temperature degC"</div><div> fAtt@source_file = "wrfoutfile"</div><div> fAtt@Conventions = "None"</div><div> fAtt@creation_date = systemfunc ("date")</div><div> fileattdef( ncdf, fAtt ) ; copy file attributes</div><div> filedimdef(ncdf,"time",-1,True)</div><div><br></div><div>ncdf->ctt = ctt</div><div>ncdf->Lat = Lat</div><div>ncdf->Lon = Lon</div></div><div><br></div><div><br></div><div><br></div><div><b>Problem</b></div><div><b>[1] </b>The output file cannot be read by GRADS/CDO. Am I missing something important when writing out the variable?</div><div><br></div><div><b>[2]</b> Any suggestion on how to do this correctly?</div><div><br></div><div><br></div><div>I'll appreciate any help.</div><div><br></div><div>Sincerely,</div><div><br></div><div><br></div><div><br clear="all"><div><div class="m_4754549509624898940gmail_signature"><div><div><div><div><div><div><div><div><div><div><div><font face="comic sans ms, sans-serif"><b><u>Lyndon Mark P. Olaguera</u></b></font><div>PhD Student </div><div>Laboratory of Climatology</div><div>Department of Geography</div><div>Faculty of Urban Environmental Science</div><div><span style="font-size:12.8px">Minami-Osawa Campus</span><br></div><div>Tokyo Metropolitan University</div><div>Hachioji Tokyo, Japan</div><div><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</div></div>
_______________________________________________<br>
Wrf-users mailing list<br>
<a href="mailto:Wrf-users@ucar.edu" target="_blank">Wrf-users@ucar.edu</a><br>
<a href="http://mailman.ucar.edu/mailman/listinfo/wrf-users" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/wrf-users</a><br>
</blockquote></div></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><font face="monospace, monospace">Regards<br></font></div><div><font face="monospace, monospace"><br></font></div><font face="monospace, monospace">Nikhil </font></div><div dir="ltr"><font face="monospace, monospace"><br></font></div><div dir="ltr"><font face="monospace, monospace">*****************************************<br></font><div><font face="monospace, monospace"><span style="color:rgb(37,37,37);font-size:14px;line-height:22.4px">When the present determines the future, but the approximate present does not approximately determine the future - Edward Lorenz</span><br></font></div><div><span style="font-size:12.8px"><font face="monospace, monospace">*****************************************</font></span><span style="color:rgb(37,37,37);font-family:sans-serif;font-size:14px;line-height:22.4px"><br></span></div></div></div></div></div></div></div></div></div></div></div>