Re: wrf global plot problem with gWRF_merc.ncl

From: Eddy <eddycarl_at_nyahnyahspammersnyahnyah>
Date: Mon Sep 16 2013 - 14:14:11 MDT

Hello Mary,

Thank you for the information! This is very useful. I can use the gsn_csm_XXXX functions to plot now. So, we can wait to see whether wrfhelp will fix this problem.

Another question: since the wrf_XXX.ncl codes use the map information provided in the wrfoutputs, how do I zoom-in to a region in a global simulation result? I've tried setting "res@mpMinLatF" etc, but it doesn't work ...

Thank you!


At 2013-09-17 01:51:44,"Mary Haley" <> wrote:
Hi Eddy,

There is something wrong with the lat/lon limits on the file or else the code that sets the map projection for the type of file you have (MAP_PROJ=6) is not correct.

I've CC'ed wrfhelp as I think this is something they need to fix. In "set_mp_resources" in WRFUserARW.ncl it looks like the four corners of the projection are being set to:

  mpRightCornerLonF :179.5489
  mpRightCornerLatF : 89.54774
  mpLeftCornerLonF :180.4511
  mpLeftCornerLatF :-89.54774

Note that the right and left corner longitudes are very close to 180, and that the left corner actually goes over 180. I think the left corner should be closer to -180 and not 180.

If you want to try plotting this using gsn_csm_xxxx functions instead, (until a fix is available), then see the "wrf_contour_map_template.ncl" template script at:

You want to set USE_WRF_MAP_PROJECTION to False, so it doesn't try to use the map projection on the file. This example plots HGT, but you should be able to subsitute the QXXX variables.


On Sep 15, 2013, at 11:43 PM, Eddy <> wrote:

Hi Mary,

I've followed your instruction to create a NetCDF file which is a subset of the wrf output (contain only a variable "QCLOUD"). The file name is called "". Please discard the "" as it is not transfered correctly. The ncl code to plot is also uploaded to your FTP called "wrf_Cloud.ncl". Thank you!


At 2013-09-16 12:58:03,"Mary Haley" <> wrote:


The 5 GB file is a bit large. Do you know how to write NetCDF files? Perhaps you could just write out the variables that you are plotting, the XLAT and XLONG arrays (or whatever they are called on the file), and the file attributes.

The file writing code would look something like this:

infile = ""
outfile = ""

;---Open file for reading
fin = addfile(infile,"r")

;---Open file for writing
system("rm " + outfile)
fout = addfile(outfile,"c")

;---Variables to read, and then write
vars_to_write = (/"HLAT","HLON","Times","QVAPOR","QICE"/)

;---Get file global attributes and write these to file.
fatts = getvaratts(fin)
do i=0,dimsizes(fatts)-1
  fout@$fatts(i)$ = fin@$fatts(i)$
end do

;---Write desired variables to file
do i=0,dimsizes(vars_to_write)-1
  fout->$vars_to_write(i)$ = fin->$vars_to_write(i)$
end do

I've CC'ed wrfhelp on this, in case they have any ideas about why this script is not working.


On Sep 15, 2013, at 10:14 PM, Eddy <> wrote:

Hello Mary,

Thanks for your prompt reply!
The gWRF_merc.ncl file is available at
My WRF ARW output information with ncl_filedump is as follows:

      DX : 100310.5
      DY : 100562.5
      GRIDTYPE : C
      DIFF_OPT : 0
      KM_OPT : 0
      DAMP_OPT : 3
      DAMPCOEF : 0.2
      KHDIF : 0
      KVDIF : 0
      SWRAD_SCAT : 1
      GRID_ID : 1
      PARENT_ID : 1
      I_PARENT_START : 1
      J_PARENT_START : 1
      DT : 300
      CEN_LAT : 0
      CEN_LON : 0
      TRUELAT1 : 1e+20
      TRUELAT2 : 1e+20
      MOAD_CEN_LAT : 0
      STAND_LON : 180
      POLE_LAT : 90
      POLE_LON : 0
      GMT : 0
      JULYR : 2009
      JULDAY : 24
      MAP_PROJ : 6
      MAP_PROJ_CHAR : Cylindrical Equidistant
      NUM_LAND_CAT : 24
      ISWATER : 16
      ISLAKE : -1
      ISICE : 24
      ISURBAN : 1
      ISOILWATER : 14

I think cylindrical equidistant map projection should be OK for those scripts, right?
I've made no changes to the wrf_Cloud.ncl script, except for the input filename.
My whole output file is large ~5GB. Is it appropriate to upload the data to your FTP?

Thank you!


At 2013-09-16 10:26:48,"Mary Haley" <> wrote:
Hi Eddy,

I don't know what the "gWRF_merc.ncl" file is.

The wrf_Cloud.ncl and other scripts on that page depend on WRF ARW output files in order to work properly, and especially to have the correct map projectio n information.

Did you look at your WRF ARW output file with "ncdump -c" or "ncl_filedump" to make sure it has valid map projection information via the file's global attributes?

A typical WRF-ARW should have these kind of file attributes:

  . . .
      DX : 0.02
      DY : 0.02
      DT : 5
      CEN_LAT : 25
      CEN_LON : -75
      TRUELAT1 : 1e+20
      TRUELAT2 : 1e+20
      MOAD_CEN_LAT : 0
      STAND_LON : 1e+20
      MAP_PROJ : 203

Did you make any kind of modifications to the wrf_Cloud.ncl script?

If you are unable to solve the problem, it would help if you could provide the script and data via ftp. Please see:


On Sep 15, 2013, at 5:20 PM, Eddy <> wrote:

Hi there,

I found I could not get the correct global lat-lon plot using the gWRF_merc.ncl (or other script, like wrf_Cloud.ncl at The same problem has been found before (however, without solving it), dated back to 2009 (http://, which shows only a thin vertical bar at 180 degree (longitude) instead of the global view.
I've tested using the simple script that Mary Haley suggested ( The 1st frame shows the exact problem described above (see attached figure). The 2nd frame is fine, while the 3rd frame is very large and only part of the map is shown.
I've also tested the same code on regional simulation, which shows no problem. That's very strange. Could you please help on this?
P.S I used ncl version 6.1.2 and WRF v3.5 for a global simulation.



ncl-talk mailing list
List instructions, subscriber options, unsubscribe:

ncl-talk mailing list
List instructions, subscriber options, unsubscribe:

ncl-talk mailing list
List instructions, subscriber options, unsubscribe:

ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
Received on Mon Sep 16 14:14:42 2013

This archive was generated by hypermail 2.1.8 : Wed Sep 18 2013 - 17:07:30 MDT