re: vibeta

From: Uma S. Bhatt (bhatt AT XXXXXX)
Date: Mon Aug 11 2003 - 17:54:10 MDT


Hi,

  I am trying to vertically integrate moisture transport (u*q and v*q)
from a CCM output file, which are in hybrid coordinates. I have
followed example 3 under the vibeta documentation which can be found
on the following web page:
http://ngwww.ucar.edu/ngdoc/ng/ref/ncl/functions/vibeta.html . At
this point I am stuck because the call to vibeta is bombing at
follows:

fatal:vibeta: The last element of 'p' must be greater than or equal to ptop
fatal:Execute: Error occurred at or near line 55

  I have used the same pbot & ptop as in example 3 namely, pbot =
110000 & ptop = 1000. My vertical pressure values for a given point
are printed out as follows:

Variable: pm (subsection)
Type: float
Total Size: 72 bytes
             18 values
Number of Dimensions: 1
Dimensions and sizes: [lev | 18]
Coordinates:
             lev: [4.8093..992.528]
Number Of Attributes: 5
   lon : 84.375
   lat : -4.18592
   time : 1674.5
   long_name : pressure
   units : Pa
(0) 480.93
(1) 1307.31
(2) 3255.91
(3) 6394.709
(4) 9910.963
(5) 13893.23
(6) 18960.52
(7) 25189.3
(8) 32578.46
(9) 41021.71
(10) 50289.31
(11) 60024.02
(12) 69753.5
(13) 78922.75
(14) 86943.27
(15) 93254.42
(16) 97387.3
(17) 99603.77

I assume 'p' (from the error message) refers to the pm array and
topmost value of pm is 480.93Pa (the levels are reversed in the
vibeta call). I am somewhat confused as to how that can be greater
than or equal to ptop (1000 Pa). It seems that it must be less than
or higher in the atmosphere than ptop. So I am confused. Any help is
appreciated!

Thanks,
Uma Bhatt

p.s. The code I am using is given below:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
;*************************************************
; CSM Graphics: integrate.ncl
;************************************************
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
;************************************************
begin
;************************************************
; read in netCDF file
;************************************************
;************************************************
    fn = "ha-0005-08.nc"
    in = addfile(fn,"r")
    u = in->U
    v = in->V
    q = in->Q
    hyam = in->hyam ; read from a file the mid-layer coef
    hybm = in->hybm ; read from a file
    psfc = in->PS ; surface pressure [Pa]
    p0 = 100000. ; since ps is in Pa or [ f->P0]
   
    pm = u ; simple way to create a variable with
                   ; appropriate meta data
    pm = pres_hybrid_ccm (psfc, p0, hyam, hybm) ; pm(ntim,klvl,nlat,mlon)
                                               ; note pm goes from top to
                                               ; bottom
    pm@long_name = "pressure"
    pm@units = "Pa"

    pbot = 110000.
    ptop = 1000. ; what ever u want as your upper level 10Pa
                      ; appropriate meta data
    printVarSummary(pm)
    printVarSummary(u)
;multiply u and q

     qu = u ; create a variable with meta data
     qv = v ; create a variable with meta data

     qu = q*u
     qv = q*v
     printVarSummary(qu)

    vintu = u(time|:,lat|:,lon|:,lev|0) ; create a variable with meta data
    vintv = v(time|:,lat|:,lon|:,lev|0) ; create a variable with meta data

; vertically integrate qu and qv
; reverse pressure order via ::-1 syntax
    linlog = 1 ; linear interpolation
    print(ptop)
    print(pm(5,:,30,30))
    printVarSummary(vintu)
    vintu = vibeta (pm(time|:,lat|:,lon|:,lev|::-1), \
                    qu(time|:,lat|:,lon|:,lev|::-1),linlog,psfc,pbot,ptop)
    vintv = vibeta (pm(time|:,lat|:,lon|:,lev|::-1), \
                    qv(time|:,lat|:,lon|:,lev|::-1),linlog,psfc,pbot,ptop)

; create plot

lines deleted....

end

-- 
Uma S. Bhatt
International Arctic Research Center, Room 408H    
Frontier Research System for Global Change
University of Alaska Fairbanks
930 Koyukuk Dr.                           
Fairbanks, Alaska  99775-7335 
tel: (907) 474-2662  fax: (907) 474-2643
bhatt@iarc.uaf.edu
http://www.frontier.iarc.uaf.edu/~bhatt/
_______________________________________________
ncl-talk mailing list
ncl-talk@ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk



This archive was generated by hypermail 2b29 : Mon Aug 11 2003 - 20:37:33 MDT