NCL script for Idealized cases

From: Guan Song <gs6r_at_nyahnyahspammersnyahnyah>
Date: Tue, 16 Oct 2007 19:57:43 +0000

Hi,all
 
I am running newest WRF with idealized cases (such as 2dhill). Does anyone have the NCL scripts for wrf output?
 
I looked at a website, which supposes to have scripts for all idealized cases.
 
http://www.mmm.ucar.edu/mm5/WRF_post/WRF_NCL/b_wave.html
 
however,it does not have any link for this script.

I found the old version of NCL scripts for WRF output, however, it did not work due to Z variable is available anymore from WRF output.

The old script (show as follows) to plot standard 2dhill show undefined variable Z (grid point height) so it cannot plot anything. Does anyone know what
variables we probably need to replace Z and let the script work for WRF output? or do you have any other scripts which should
work in this case.

; Script to produce standard plots for a WRF hill2d run

load "WRFOptions.ncl"
;load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "gsn_code.ncl"
load "WRFPlot.ncl"
load "WRFUserARW.ncl"

begin
;
; The WRF ARW input file.
; This needs to have a ".nc" appended, so just do it.

  a = addfile("../WRFV2/run/wrfout_d01_0001-01-01_00:00:00.nc","r")

; We generate plots, but what kind do we prefer?

   type = "x11"
; type = "pdf"
; type = "ps"
; type = "ncgm"

  wks = gsn_open_wks(type,"wrf_hill2d")

; Debug information.

  debug = False
; debug = True
  icount = 0

; Basic Plot options, including header information

    res_at_MainTitle = "WRF HILL2x"

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; What times and how many time steps are in the data set?

  times = wrf_user_list_times(a) ; get times in the file
  ntimes = dimsizes(times) ; number of times in the file

; The specific plane we want to plot data on

  plane = (/ 20., 0./) ; (x,y) point for vertical plane
  angle = 90.0
  pii = 3.14159
  aspect_ratio = .7

; This is the big loop over all of the time periods to process.

  do it = 0,ntimes-1,30

    time = it
    res_at_TimeLabel = times(it)
    res_at_AspectRatio = aspect_ratio
    res_at_PlotOrientation = "(" + plane(0)+","+plane(1) + ")" + " angle " + angle

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; First get the variables we will need

  u_in = wrf_user_getvar(a,"ua",time) ; ua is u averaged to mass points
  v_in = wrf_user_getvar(a,"va",time) ; va is v averaged to mass points
  w_in = wrf_user_getvar(a,"wa",time) ; vertical velocity
  th_in = wrf_user_getvar(a,"th",time) ; get temperature (C)
  z_in = wrf_user_getvar(a, "Z",time) ; grid point height
  ter = wrf_user_getvar(a,"HGT",time) ; need terrain height sometimes

  u = u_in(0:34,:,:)
  v = v_in(0:34,:,:)
  w = w_in(0:34,:,:)
  th = th_in(0:34,:,:)
  z = z_in(0:34,:,:)

  u_plane = wrf_user_intrp3d( u,z,ter,"v",plane,angle)
  v_plane = wrf_user_intrp3d( v,z,ter,"v",plane,angle)
  w_plane = wrf_user_intrp3d( w,z,ter,"v",plane,angle)
  th_plane = wrf_user_intrp3d(th,z,ter,"v",plane,angle)

  vel_normal = u_plane*cos(2.*pii*angle/360.) - v_plane*sin(2.*pii*angle/360.)
  vel_tangent = u_plane*sin(2.*pii*angle/360.) + v_plane*cos(2.*pii*angle/360.)
  vel_tangent = vel_tangent - 10.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 ; Theta
      opts_th = res
      opts_th_at_FieldTitle = th_in_at_description
      opts_th_at_cnFillOn = True
      opts_th_at_gsnSpreadColorEnd = -10
      contour_th = wrf_contour(a,wks,th_plane,opts_th)
      print_opts("opts_th", opts_th, debug)

 ; Vertical Velocity
      opts_w = res
      opts_w_at_FieldTitle = w_in_at_description
      contour_w = wrf_contour(a,wks, w_plane,opts_w)
      print_opts("opts_w", opts_w, debug)

 ; Vel Tangent
      opts_vt = res
      opts_vt_at_FieldTitle = "Perturbation u"
      opts_vt_at_UnitLabel = "m/s"
      contour_vt = wrf_contour(a,wks,vel_tangent,opts_vt)
      print_opts("opts_vt", opts_vt, debug)

      wrf_overlay(wks,(/contour_th, contour_vt/),False)
      print_header(icount,debug)
      wrf_overlay(wks,(/contour_th, contour_w/),False)
      print_header(icount,debug)

  ; ************************************************************

  end do ; end of the time loop

end

 ;*****************************************************************8
Thanks in advance.
 
 Guan Song
Environmental sciences department
University of virginia
Charlottesville,VA,

> From: ncl-talk-request_at_ucar.edu
> Subject: ncl-talk Digest, Vol 47, Issue 19
> To: ncl-talk_at_ucar.edu
> Date: Tue, 16 Oct 2007 12:00:06 -0600
>
> Send ncl-talk mailing list submissions to
> ncl-talk_at_ucar.edu
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> or, via email, send a message with subject or body 'help' to
> ncl-talk-request_at_ucar.edu
>
> You can reach the person managing the list at
> ncl-talk-owner_at_ucar.edu
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of ncl-talk digest..."
>
>
> Today's Topics:
>
> 1. newbie documentation and julian date question (Mary Jo Brodzik)
> 2. Re: newbie documentation and julian date question (Dennis Shea)
> 3. Re: newbie documentation and julian date question
> (Mary Jo Brodzik)
> 4. Floattoint truncating issue. (Wang, Yi)
> 5. Re: ncl error (Bernie Baer)
> 6. Re: ncl error (bbaer_at_internode.on.net)
> 7. Re: Problems with Stereographic projection plots (Mary Haley)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 15 Oct 2007 12:35:15 -0600 (MDT)
> From: Mary Jo Brodzik <brodzik_at_wuzzles.colorado.edu>
> Subject: newbie documentation and julian date question
> To: ncl-talk_at_ucar.edu
> Message-ID: <Pine.LNX.4.64.0710151210300.24524_at_wuzzles.colorado.edu>
> Content-Type: TEXT/PLAIN; charset=US-ASCII
>
>
> Hello, everyone,
>
> I'm new to NCL, and with Dennis Shea's help (thanks, Dennis!) I've gotten
> a little script working that converts a couple of flat binary files into
> netCDF. I have three questions:
>
> 1) I'll bet that there are julian date format convertors out there,
> somewhere. Can someone let me know where they are?
>
> 2) As a general logistical question, is there some way to query for help
> on a general topic at the command line? Something like "help date"
> If not, then how do NCL users find out about routines they might be
> looking for, and/or how to call those routines once they know they're
> there?
>
> 3) I'm an emacs user, and have found and installed the ncl.el file for
> formatting, but I'm wondering if there's anything like an
> ncl-shell-mode, where I can do line-by-line debugging with the script
> in one window, tied to an ncl execution shell in the other?
>
> Thanks,
> Mary Jo Brodzik
>
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> Mary Jo Brodzik, Lead Scientific Programmer, 303-492-8263
> NSIDC/CIRES, Univ. of Colo. at Boulder, 449 UCB, Boulder, CO 80309-0449
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
>
>
> ------------------------------
>
> Message: 2
> Date: Mon, 15 Oct 2007 14:08:41 -0600
> From: Dennis Shea <shea_at_ucar.edu>
> Subject: Re: newbie documentation and julian date question
> To: brodzik_at_nsidc.org
> Cc: ncl-talk_at_ucar.edu
> Message-ID: <4713C8C9.7050104_at_ucar.edu>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Mary Jo Brodzik wrote:
> > Hello, everyone,
> >
> > I'm new to NCL, and with Dennis Shea's help (thanks, Dennis!) I've gotten
> > a little script working that converts a couple of flat binary files into
> > netCDF. I have three questions:
> >
> > 1) I'll bet that there are julian date format convertors out there,
> > somewhere. Can someone let me know where they are?
> >
> [a] http://www.ncl.ucar.edu/
> [b1] Click "Documentation"; Click "Functions";
> Under "Earth Science" Click "Date"
>
> greg2jul,
> <http://www.ncl.ucar.edu/Document/Functions/Built-in/greg2jul.shtml>
> jul2greg, day_of_year, ut_calendar, ut_inv_calendar
> <http://www.ncl.ucar.edu/Document/Functions/Built-in/jul2greg.shtml>
>
> [b2] In the upper left of *any* NCL page type what you want
> in the Search box. eg: julian
> <http://www.ncl.ucar.edu/Document/Functions/Built-in/jul2greg.shtml>
> > 2) As a general logistical question, is there some way to query for help
> > on a general topic at the command line? Something like "help date"
> >
> Nope .... bummer
>
> > If not, then how do NCL users find out about routines they might be
> > looking for, and/or how to call those routines once they know they're
> > there?
> >
> use the "search" box in the upper left. Usually, there are examples of
> usage at the bottom of the page.
>
>
>
> > 3) I'm an emacs user, and have found and installed the ncl.el file for
> > formatting, but I'm wondering if there's anything like an
> > ncl-shell-mode, where I can do line-by-line debugging with the script
> > in one window, tied to an ncl execution shell in the other?
> >
>
> I don't use EMACS ... somebody else must answer.
>
> Regards
> D
>
> > Thanks,
> > Mary Jo Brodzik
> >
> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > Mary Jo Brodzik, Lead Scientific Programmer, 303-492-8263
> > NSIDC/CIRES, Univ. of Colo. at Boulder, 449 UCB, Boulder, CO 80309-0449
> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> >
> > _______________________________________________
> > ncl-talk mailing list
> > ncl-talk_at_ucar.edu
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> >
>
>
> --
> ======================================================
> Dennis J. Shea tel: 303-497-1361 |
> P.O. Box 3000 fax: 303-497-1333 |
> Climate Analysis Section |
> Climate & Global Dynamics Div. |
> National Center for Atmospheric Research |
> Boulder, CO 80307 |
> USA email: shea 'at' ucar.edu |
> ======================================================
>
>
>
> ------------------------------
>
> Message: 3
> Date: Mon, 15 Oct 2007 14:28:25 -0600 (MDT)
> From: Mary Jo Brodzik <brodzik_at_wuzzles.colorado.edu>
> Subject: Re: newbie documentation and julian date question
> To: Dennis Shea <shea_at_ucar.edu>
> Cc: ncl-talk_at_ucar.edu
> Message-ID: <Pine.LNX.4.64.0710151423570.24524_at_wuzzles.colorado.edu>
> Content-Type: TEXT/PLAIN; charset=US-ASCII
>
>
> Thanks, Dennis, the search facility and documentation pages are exactly
> what I'm looking for.
>
> (Now *that's* embarrassing: I've been using the red nav bar on the left
> side of those pages, and never saw the yellow nav across the top. I don't
> think there's such a thing as "red-yellow" color-blind that I could even
> use as an excuse! Thank you for being so polite about it, too. ;-) )
>
> --Mary Jo
>
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> Mary Jo Brodzik, Lead Scientific Programmer, 303-492-8263
> NSIDC/CIRES, Univ. of Colo. at Boulder, 449 UCB, Boulder, CO 80309-0449
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
>
>
> ------------------------------
>
> Message: 4
> Date: Mon, 15 Oct 2007 14:01:27 -0700
> From: "Wang, Yi" <yi.wang_at_pnl.gov>
> Subject: Floattoint truncating issue.
> To: "ncl-talk_at_ucar.edu" <ncl-talk_at_ucar.edu>
> Message-ID: <C3392337.5AC8%yi.wang_at_pnl.gov>
> Content-Type: text/plain; charset="US-ASCII"
>
> Hi Folks:
>
> For example, I have a time series from 19961010 to 19961020.
>
> When reading in as float, I get this (print-out):
>
> (0) 1.996101e+07
> (1) 1.996101e+07
> (2) 1.996101e+07
> (3) 1.996101e+07
> (4) 1.996101e+07
> (5) 1.996102e+07
> (6) 1.996102e+07
> (7) 1.996102e+07
> (8) 1.996102e+07
> (9) 1.996102e+07
> (10) 1.996102e+07
>
>
> To do a "floattoint" on above series, I get this (print-out):
>
> (0) 19961010
> (1) 19961012 "" (should be 19961011)""
> (2) 19961012
> (3) 19961012 ""(should be 19961013)""
> (4) 19961014
> (5) 19961016
> (6) 19961016
> (7) 19961016
> (8) 19961018
> (9) 19961020
> (10) 19961020
>
> The actual date should go from 19961010 to 19961020. How do I fix this
> floattoint trancating issue?
>
> Thanks,
>
> Yi
>
>
> ------------------------------
>
> Message: 5
> Date: Tue, 16 Oct 2007 07:27:41 +1000
> From: "Bernie Baer" <bbaer_at_internode.on.net>
> Subject: Re: ncl error
> To: "Mary Haley" <haley_at_ucar.edu>
> Cc: ncl-talk_at_ucar.edu
> Message-ID: <01f001c80f72$386e24d0$6400a8c0_at_amd>
> Content-Type: text/plain; format=flowed; charset="iso-8859-1";
> reply-type=response
>
> Hi Mary,
> thanks for your response. The script is part of a suite I got from here:
> http://www.drjack.info/RASP/DOWNLOAD/
> and the original version is WRF/NCL/skewt_func.ncl from the tarball
> rasp_ncl.tar.gz (I have to double check that is the
> tarball when I get to work) and the failing line was at 770 in the original.
> I'm not sure of the NCL version right now.
> I'm not an NCL programmer, just a Unix hacker! :-)
> More info: I am trying to plot three meteorological soundings, the first
> one, Camden, plots OK but the next two do not.
> Hope this is sufficient info if not please let me know.
> Kind regards, Bernie in Australia.
>
>
>
>
> ------------------------------
>
> Message: 6
> Date: Tue, 16 Oct 2007 14:00:00 +0930
> From: "bbaer_at_internode.on.net" <bbaer_at_internode.on.net>
> Subject: Re: ncl error
> To: ncl-talk_at_ucar.edu
> Message-ID: <47143e48.53.11fe.10128_at_internode.on.net>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Mary et al,
> my problem has been fixed by DrJack :
>
> http://www.drjack.info/twiki/bin/view/RASPop/AlternateVersions
>
> Thank you for your help!
> Regards, Bernie.
>
>
> ------------------------------
>
> Message: 7
> Date: Tue, 16 Oct 2007 09:17:50 -0600 (MDT)
> From: Mary Haley <haley_at_ucar.edu>
> Subject: Re: Problems with Stereographic projection plots
> To: ncl-talk_at_ucar.edu
> Message-ID: <Pine.SOC.4.61.0710160906290.20660_at_windom.ucar.edu>
> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
>
>
> If you are using the wrf_xxxx scripts to do the plotting, then a fix
> was issued in which the wrong value was being used for the center
> latitude for the stereographic projection case. It was changed from
> TRUELAT1 to CEN_LAT (both attributes of the variable on the WRF file).
>
> This fix should make it into the next release of NCL, hopefully
> the end of this month.
>
> If you have V4.3.1, you can easily make the change yourself. You may
> need "root" permissions to do this:
>
> 1. Edit the file $NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl
>
> 2. Change the line:
> opts_at_mpCenterLatF = get_res_value_keep(opts, "mpCenterLatF", in_file_at_TRUELAT1)
>
> to:
> opts_at_mpCenterLatF = get_res_value_keep(opts, "mpCenterLatF", in_file_at_CEN_LAT)
>
> --Mary
>
>
> On Fri, 12 Oct 2007, Andrea Hahmann wrote:
>
> > Hi!
> >
> > I have been having problems trying to plot a land mask (or land use)
> > field on a stereographic projection. The data comes from a WRF "geo"
> > file. When I use res_at_tfDoNDCOverlay = True, then the coastline of the
> > data does not match the drawn geographic coastline. When I turn it off,
> > the coastlines line up but I get a strange white band on the right side
> > of the plot (also a small one on the bottom). I have experimented with
> > various parameters to set the projection (CEN_LAT, CEN_LON, and
> > STAND_LON), but nothing seems to help.
> >
> > Any other ideas of what might be going wrong?
> >
> > The data is on an ftp site
> > (ftp://ftp.rap.ucar.edu/pub/hahmann/geo_em.d01.nc) if anybody is
> > interested in trying the script. The script and plot are attached.
> >
> > Thank you so much!
> > Andrea
> >
> > --
> > ----------------------------------------------------------------
> > Andrea N. Hahmann, Ph.D.
> > Research Applications Laboratory
> > Natl. Center for Atmospheric Research Phone: 1-303-497-8383
> > PO BOX 3000 Fax: 1-303-497-8401
> > Boulder, CO 80301 hahmann_at_ucar.edu
> > ----------------------------------------------------------------
> >
> >
> >
>
>
> ------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
> End of ncl-talk Digest, Vol 47, Issue 19
> ****************************************

_________________________________________________________________
Boo! Scare away worms, viruses and so much more! Try Windows Live OneCare!
http://onecare.live.com/standard/en-us/purchase/trial.aspx?s_cid=wl_hotmailnews

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Oct 16 2007 - 13:57:43 MDT

This archive was generated by hypermail 2.2.0 : Mon Oct 22 2007 - 14:48:45 MDT