Re: mapping hybrid atmospheric levels of 3D data at specific pressures

From: Medeiros, Brian <brianpm_at_nyahnyahspammersnyahnyah>
Date: Fri May 06 2011 - 12:16:08 MDT

Madeleine,

Those variables are the hybrid coefficients, and in CAM files they are called hyam and hybm.

Example:
F = addfile("CAM_file.nc","r")
hyam = F->hyam
hybm = F->hybm
PS = F->PS
intp = 2
extp = True

;; Look to see if the reference pressure is specified in the file (usually it is for CAM)
 if isfilevar(F,"P0") then
    P0 = 0.01 * F->P0
  else
    print("Defaulting to 1000mb reference pressure")
    P0 = 1000.
  end if
;;the new pressure levels
pnew = fspan( 100., 1000., 19)
pnew!0 = "lev"
pnew&lev = pnew
pnew@units = "hPa" ;; I like to make sure the units and coordinate is set

X = F->$YOUR_VARIABLE$

Xnew = vinth2p(X,hyam,hybm,pnew,PS,intp,P0,1,extp)

Xnew will be on the pressure levels.

Good luck,

.brian

________________________________________
From: ncl-talk-bounces@ucar.edu [ncl-talk-bounces@ucar.edu] On Behalf Of Madeleine Patterson [madeleine.patterson77@gmail.com]
Sent: Friday, May 06, 2011 12:03 PM
To: ncl-talk
Subject: mapping hybrid atmospheric levels of 3D data at specific pressures

Hello NCL-talkers,

I have some 3D atmospheric CAM model results which are output at 26 'hybrid' levels (sigma levels in the bottom layers of the atmosphere, pressure levels in the top layers of the atmosphere and hybrid levels in the middle of the atmosphere). I want to produce maps of some of these 3D variables (like relative humidty, U, V, omega etc) at certain pressure levels (e.g. 200, 500, 850 hPa).

I had a look at the vinth2p function and it seems like it's what I'm looking for, but I'm a bit stuck on how to implement it - specifically the arguments you need to specify when calling this function.

As I understand it, 'datai' is the 3D variable at n hybrid levels which is the one I want to be output at certain specific pressure levels, 'plevo' is a one-dimensional array of output pressure levels in mb (which I think you can just specify in a script?), and 'psfc' should be 'a multi-dimensional array of surface pressures in Pa...with...the same dimension sizes as the corresponding dimensions of datai (minus the level dimension)' ; this would just be a 2D (x,y) surface pressure variable?

However I'm not exactly sure of what 'hbcofa' and 'hbcofb' are, and where to get this data?

Any advice (as well as on example scripts) would be welcome!

Thanks,
Madeleine
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri May 6 12:16:18 2011

This archive was generated by hypermail 2.1.8 : Fri May 13 2011 - 10:21:56 MDT