[ncl-talk] writing netcdf files similar to wrfout files

Mary Haley haley at ucar.edu
Wed Jun 21 12:29:47 MDT 2017


Hi Ruben,

Sorry for the delay in response.

When you call wrf_map_resources, it is querying your NetCDF file in order
to get all the projection information it needs to correctly plot the data
in the map projection defined by the WRF file. This function does NOT use
the special lat2d/lon2d attributes.  These are what you set when you want
to plot curvilinear data that you don't have the map projection information
for.

If you truly want to be able to plot your data in the same map projection
as what was defined on a WRF output file, then you need to write all the
global attributes that define the map projection of the WRF data AND you
need to write the XLAT and XLONG variables to the file.

When you look at a WRF output file with "ncdump -h" or "ncl_filedump, you
will see lots of global attributes. The ones that have to do with the map
projection look something like this:

      CEN_LAT : 25.99999
      CEN_LON : -94
      TRUELAT1 : 30
      TRUELAT2 : 60
      MAP_PROJ : 3

If you look at the "wrf_map_resources" function in the
$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl file, you will see that
it is looking for many global attributes depending on the map projection
you have.

I think this is a complete list of the global attributes that it will need.
Not all of these will be on the file, as this has to do with whatever map
projection you have:

MAP_PROJ
CEN_LAT
CEN_LON
POLE_LAT
POLE_LON
REF_LAT
REF_LON
STAND_LON
TRUELAT1
TRUELAT2

Plus, it needs to read XLAT and XLONG in order to get the correct corner
information for the map projection.

This seems like a lot of work on your part, trying to reproduce the WRF map
projection information.  Are you sure this is what you need?

--Mary



On Mon, Jun 12, 2017 at 2:00 PM, Behnke, Ruben <ruben.behnke at mso.umt.edu>
wrote:

> Hi,
>
>
>
>    I'm trying to write out netcdf files in a similar way to wrfout files,
> so that the data can be easily plotted (using the attached Temp_Wind.ncl
> script).  Right now, I'm adding the 2d lat and lon variables from the
> wrfout files as two variables ('lat' and 'lon') and as variable attributes
> (lines 967 to 1017 in Summarize_Daily_New_d02.ncl) to the other variables
> (such as albedo), but plotting is still not working.  Is there a correct
> way to do this?  Any help would be greatly appreciated.
>
>
>
> Ruben Behnke
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170621/6352af76/attachment.html 


More information about the ncl-talk mailing list