Re: Cross Section setting "z" range (Claiborne Tompkins)

From: Claiborne Tompkins <tompkinc_at_nyahnyahspammersnyahnyah>
Date: Tue Feb 02 2010 - 08:29:05 MST

That was my attempt of trying to set the range of "Z" from 0 -> 4,000 m.

F. Tompkins

On Tue, Feb 2, 2010 at 9:38 AM, Li, Yongzuo <yongzuo.li@ou.edu> wrote:

> What is the meaning for
>
> Z(0,4000)
>
> Yongzuo
> ________________________________________
> From: ncl-talk-bounces@ucar.edu [ncl-talk-bounces@ucar.edu] on behalf of
> ncl-talk-request@ucar.edu [ncl-talk-request@ucar.edu]
> Sent: Tuesday, February 02, 2010 8:25 AM
> To: ncl-talk@ucar.edu
> Subject: ncl-talk Digest, Vol 75, Issue 4
>
> Send ncl-talk mailing list submissions to
> ncl-talk@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@ucar.edu
>
> You can reach the person managing the list at
> ncl-talk-owner@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. Cross Section setting "z" range (Claiborne Tompkins)
> 2. CCSM conversion of Geoptential Height (Vijayaraghavan Srivatsan)
> 3. Re: CCSM conversion of Geoptential Height (Dennis Shea)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 2 Feb 2010 01:49:46 -0500
> From: Claiborne Tompkins <tompkinc@my.fit.edu>
> Subject: Cross Section setting "z" range
> To: ncl-talk@ucar.edu
> Message-ID:
> <e5e8b7c61002012249j241a541fyf26588133411fb5@mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> I've been making cross sections and wanted to put a limit on "z" instead of
> plotting up to the vertical max within my WRF output, but have been
> unsuccessful when trying to set a range for z. Right now I read "z" in
> through
>
> z = wrf_user_getvar(a, "z",it) ; grid point height
>
> and tried to set a range when creating my pv_plane
>
> pv_plane = wrf_user_intrp3d(pvo,z(0,4000),"v",plane,0,opts)
>
> but keep receiving the error
>
> fatal:Number of subscripts do not match number of dimensions of
> variable,(2)
> Subscripts used, (3) Subscripts expected
> fatal:Execute: Error occurred at or near line 110 in file
> PotVort_CrossS.ncl
>
> Does anyone know the proper format for declaring the range of "z"?
>
> Thanks,
>
> F. Tompkins
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20100202/afe8dcfa/attachment.html
>
> ------------------------------
>
> Message: 2
> Date: Tue, 2 Feb 2010 17:27:53 +0800
> From: "Vijayaraghavan Srivatsan" <tmsvs@nus.edu.sg>
> Subject: CCSM conversion of Geoptential Height
> To: <ncl-talk@ucar.edu>
> Message-ID:
> <82D169AB2230FA459E2832C4BD0C7A590AFCFBD0@MBX03.stf.nus.edu.sg>
> Content-Type: text/plain; charset="us-ascii"
>
> Hi all,
>
>
>
> I am using the vert_1.ncl to convert CCSM data (for WRF) from hybrid to
> pressure.
>
>
>
> Although, T, U, V and Humidity were successful, there is a problem with
> conversion of geopotential heights, despite using surface geopotential
> and surface pressure.
>
>
>
> I use vinth2p_ecmwf, since I need values upto 1000mb .( ie
> extrapolation).
>
>
>
> My code is below
>
>
>
> Any help in conversion please..
>
>
>
> Thanks a lot
>
>
>
> Sri
>
>
>
> ---------------------------
>
>
>
> ;*************************************************
>
> ; NCL tutorial script: vert_1.ncl
>
> ;************************************************
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>
> ;************************************************
>
> begin
>
>
>
> Ntime = 1
>
>
>
> ;************************************************
>
> ; file handling
>
> ;************************************************
>
>
>
> fn1 =
> "b30.042e.cam2.h3.Z3.60E-150E_50S-50N.2000-01-01_cat_2000-12-31.nc<http://b30.042e.cam2.h3.z3.60e-150e_50s-50n.2000-01-01_cat_2000-12-31.nc/>"
> ;
> define filename
>
> in1 = addfile(fn1,"r") ; open netcdf file
>
>
>
> Z3 = in1->Z3 ; select variable to
> ave
>
>
>
> P0mb =1000.
>
> hyam = in1->hyam ; get a coefficiants
>
> hybm = in1->hybm ; get b coefficiants
>
>
>
> fn2 =
> "b30.042e.cam2.h3.PS.60E-150E_50S-50N.2000-01-01_cat_2009-12-31.nc<http://b30.042e.cam2.h3.ps.60e-150e_50s-50n.2000-01-01_cat_2009-12-31.nc/>"
> ;
> define filename
>
> in2 = addfile(fn2,"r") ; open netcdf file
>
>
>
> PS = in2->PS
>
>
>
> fn3 =
> "b30.042e.cam2.h3.PHIS.60E-150E_50S-50N.2000-01-01_cat_2009-12-31.nc<http://b30.042e.cam2.h3.phis.60e-150e_50s-50n.2000-01-01_cat_2009-12-31.nc/>"
> ;
> define filename
>
> in3 = addfile(fn3,"r") ; open netcdf file
>
>
>
> PHIS = in3->PHIS
>
>
>
> fn4 =
> "b30.042e.cam2.h3.TS.60E-150E_50S-50N.2000-01-01_cat_2009-12-31.nc<http://b30.042e.cam2.h3.ts.60e-150e_50s-50n.2000-01-01_cat_2009-12-31.nc/>"
> ;
> define filename
>
> in4 = addfile(fn4,"r") ; open netcdf file
>
>
>
> TS = in4->TS
>
>
>
>
>
> ;************************************************
>
> ; define other arguments required by vinth2p
>
> ;************************************************
>
> ; type of interpolation: 1 = linear, 2 = log, 3 = loglog
>
> interp = 2
>
>
>
> ; is extrapolation desired if data is outside the range of PS
>
> extrap = True
>
>
>
> ; create an array of desired pressure levels:
>
> pnew =
> (/1000,950,900,850,800,750,700,650,600,550,500,450,400,350,300,250,200,1
> 50,100/)
>
>
>
> ;************************************************
>
> ; calculate T on pressure levels
>
> ;************************************************
>
> ; note, the 7th argument is not used, and so is set to 1.
>
> ;************************************************
>
> ; VARonP =
> vinth2p(Z3(0:Ntime,:,:,:),hyam,hybm,pnew,PS(0:Ntime,:,:),interp,P0mb,1,e
> xtrap)
>
>
>
> VARonP =
> vinth2p_ecmwf(Z3(0:Ntime,:,:,:),hyam,hybm,pnew,PS(0:Ntime,:,:),interp,P0
> mb,1,extrap,-1,TS(0:Ntime,:,:),PHIS(0:Ntime,:,:))
>
>
>
> ;output in nc file
>
> system("/bin/rm -f ./Z3_pressure.nc") ; remove any pre-existing
> file
>
> ncdf = addfile("./Z3_pressure.nc" ,"c") ; open output netCDF file
>
> filedimdef(ncdf,"time",-1,True)
>
>
>
> VARonP!0 = "time" ; assign named dimensions
>
> VARonP!1 = "lev"
>
> VARonP!2 = "lat"
>
> VARonP!3 = "lon"
>
>
>
> VARonP&time = in1&time(0:Ntime)
>
> VARonP&lev = pnew
>
> VARonP&lat = in1&lat
>
> VARonP&lon = in1&lon
>
>
>
> VARonP@long_name = "Geopotential Height on plevel" ; assign
> name
>
> VARonP@units = "m"
>
>
>
> ncdf->Z3_pres = VARonP
>
>
>
> print("finish convert Z3 to pressure level")
>
> print("output .nc: ./Z3_pressure.nc")
>
>
>
>
>
> end
>
>
>
>
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20100202/3c0f75ff/attachment.html
>
> ------------------------------
>
> Message: 3
> Date: Tue, 02 Feb 2010 07:25:24 -0700
> From: Dennis Shea <shea@ucar.edu>
> Subject: Re: CCSM conversion of Geoptential Height
> To: Vijayaraghavan Srivatsan <tmsvs@nus.edu.sg>
> Cc: ncl-talk@ucar.edu
> Message-ID: <4B6835D4.8030607@ucar.edu>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> You do not indicate what the
> "problem with conversion of geopotential heights"
> actually is.
>
> *Extrapolation is always dangerous.*
> EG: over the Himalaya the function uses the sfc T
> and assumes a constant lapse rate. The (say) 1000hPa
> hgt is based on the assumed lapse rate and the
> hydrostatic equation. Sometimes this yields non realistic values.
>
> See Example 3 at
> http://www.ncl.ucar.edu/Applications/grid_fill.shtml
>
> This does not use geopotential heights but I might suggest
> using vinh2p or vinth2p_ecmwf *without* extrapolation.
> Then use poisson_grid_fill to file out the levels.
>
> Good luck
>
>
>
>
> Vijayaraghavan Srivatsan wrote:
> > Hi all,
> >
> >
> >
> > I am using the vert_1.ncl to convert CCSM data (for WRF) from hybrid to
> > pressure.
> >
> >
> >
> > Although, T, U, V and Humidity were successful, there is a problem with
> > conversion of geopotential heights, despite using surface geopotential
> > and surface pressure.
> >
> >
> >
> > I use vinth2p_ecmwf, since I need values upto 1000mb .( ie
> extrapolation).
> >
> >
> >
> > My code is below
> >
> >
> >
> > Any help in conversion please..
> >
> >
> >
> > Thanks a lot
> >
> >
> >
> > Sri
> >
> >
> >
> > ---------------------------
> >
> >
> >
> > ;*************************************************
> >
> > ; NCL tutorial script: vert_1.ncl
> >
> > ;************************************************
> >
> > load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> >
> > load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> >
> > ;************************************************
> >
> > begin
> >
> >
> >
> > Ntime = 1
> >
> >
> >
> > ;************************************************
> >
> > ; file handling
> >
> > ;************************************************
> >
> >
> >
> > fn1 =
> > "b30.042e.cam2.h3.Z3.60E-150E_50S-50N.2000-01-01_cat_2000-12-31.nc<http://b30.042e.cam2.h3.z3.60e-150e_50s-50n.2000-01-01_cat_2000-12-31.nc/>"
> ;
> > define filename
> >
> > in1 = addfile(fn1,"r") ; open netcdf file
> >
> >
> >
> > Z3 = in1->Z3 ; select variable to
> ave
> >
> >
> >
> > P0mb =1000.
> >
> > hyam = in1->hyam ; get a coefficiants
> >
> > hybm = in1->hybm ; get b coefficiants
> >
> >
> >
> > fn2 =
> > "b30.042e.cam2.h3.PS.60E-150E_50S-50N.2000-01-01_cat_2009-12-31.nc<http://b30.042e.cam2.h3.ps.60e-150e_50s-50n.2000-01-01_cat_2009-12-31.nc/>"
> ;
> > define filename
> >
> > in2 = addfile(fn2,"r") ; open netcdf file
> >
> >
> >
> > PS = in2->PS
> >
> >
> >
> > fn3 =
> > "b30.042e.cam2.h3.PHIS.60E-150E_50S-50N.2000-01-01_cat_2009-12-31.nc<http://b30.042e.cam2.h3.phis.60e-150e_50s-50n.2000-01-01_cat_2009-12-31.nc/>"
> ;
> > define filename
> >
> > in3 = addfile(fn3,"r") ; open netcdf file
> >
> >
> >
> > PHIS = in3->PHIS
> >
> >
> >
> > fn4 =
> > "b30.042e.cam2.h3.TS.60E-150E_50S-50N.2000-01-01_cat_2009-12-31.nc<http://b30.042e.cam2.h3.ts.60e-150e_50s-50n.2000-01-01_cat_2009-12-31.nc/>"
> ;
> > define filename
> >
> > in4 = addfile(fn4,"r") ; open netcdf file
> >
> >
> >
> > TS = in4->TS
> >
> >
> >
> >
> >
> > ;************************************************
> >
> > ; define other arguments required by vinth2p
> >
> > ;************************************************
> >
> > ; type of interpolation: 1 = linear, 2 = log, 3 = loglog
> >
> > interp = 2
> >
> >
> >
> > ; is extrapolation desired if data is outside the range of PS
> >
> > extrap = True
> >
> >
> >
> > ; create an array of desired pressure levels:
> >
> > pnew =
> >
> (/1000,950,900,850,800,750,700,650,600,550,500,450,400,350,300,250,200,150,100/)
> >
> >
> >
> > ;************************************************
> >
> > ; calculate T on pressure levels
> >
> > ;************************************************
> >
> > ; note, the 7th argument is not used, and so is set to 1.
> >
> > ;************************************************
> >
> > ; VARonP =
> >
> vinth2p(Z3(0:Ntime,:,:,:),hyam,hybm,pnew,PS(0:Ntime,:,:),interp,P0mb,1,extrap)
> >
> >
> >
> > VARonP =
> >
> vinth2p_ecmwf(Z3(0:Ntime,:,:,:),hyam,hybm,pnew,PS(0:Ntime,:,:),interp,P0mb,1,extrap,-1,TS(0:Ntime,:,:),PHIS(0:Ntime,:,:))
> >
> >
> >
> > ;output in nc file
> >
> > system("/bin/rm -f ./Z3_pressure.nc") ; remove any pre-existing file
> >
> > ncdf = addfile("./Z3_pressure.nc" ,"c") ; open output netCDF file
> >
> > filedimdef(ncdf,"time",-1,True)
> >
> >
> >
> > VARonP!0 = "time" ; assign named dimensions
> >
> > VARonP!1 = "lev"
> >
> > VARonP!2 = "lat"
> >
> > VARonP!3 = "lon"
> >
> >
> >
> > VARonP&time = in1&time(0:Ntime)
> >
> > VARonP&lev = pnew
> >
> > VARonP&lat = in1&lat
> >
> > VARonP&lon = in1&lon
> >
> >
> >
> > VARonP@long_name = "Geopotential Height on plevel" ; assign
> name
> >
> > VARonP@units = "m"
> >
> >
> >
> > ncdf->Z3_pres = VARonP
> >
> >
> >
> > print("finish convert Z3 to pressure level")
> >
> > print("output .nc: ./Z3_pressure.nc")
> >
> >
> >
> >
> >
> > end
> >
> >
> >
> >
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > ncl-talk mailing list
> > List instructions, subscriber options, unsubscribe:
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
> ------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk@ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
> End of ncl-talk Digest, Vol 75, Issue 4
> ***************************************
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Feb 2 08:29:19 2010

This archive was generated by hypermail 2.1.8 : Sun Feb 07 2010 - 15:37:25 MST