NCL Home > Documentation > Functions > CESM

pres_hybrid_ccm_se

Calculates pressure at each hybrid level using spectral element grid structure.

Prototype

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"  ; This library is automatically loaded
                                                             ; from NCL V6.2.0 onward.
                                                             ; No need for user to explicitly load.

	function pres_hybrid_ccm_se (
		ps      : numeric,  
		p0  [1] : numeric,  
		hya [*] : numeric,  
		hyb [*] : numeric   
	)

	return_val  :  numeric

Arguments

ps

An array with surface pressure data in Pa or hPa (mb). The rightmost dimension must be a 'location': ps(time,ncol) or ps(ncol).

p0

Scalar numeric value equal to the surface reference pressure. Must have the same units as ps. Usually, 1000hPa or 100000Pa.

hya

A one-dimensional array equal to the hybrid A coefficients. Must be unitless.

hyb

A one-dimensional array equal to the hybrid B coefficients. Must be unitless.

Return value

If the dimensionality of ps is ps(time,ncol) or ps(ncol), the the return array will have an additional level dimension: (time,lev,ncol) or (lev). The size of the lev dimension is the same as the size of hya. The returned type will be double if ps is double, float otherwise.

Description

Calculates pressure at the hybrid levels using the formula p = a(k)*p0 + b(k)*ps.

Some models output a hybrid component, ap(k) [=a(k)*p0], which has units of pressure. This must be made dimensionless prior to use.

See Also

dpres_plevel, dpres_plevel_Wrap, dpres_hybrid_ccm_se

Examples

Example 1

Let hyam(nlev) and hybm(nlev) and ps(time,ncol). The derived pm will be returned (ntim,nlev,ncol).

  hyam = f->hyam ; read from a file the mid-layer coef
  hybm = f->hybm ; read from a file
  ps   = f->PS   ; surface pressure [Pa]
  p0   = 100000. ; since ps is in Pa or [ f->P0]

  pm = pres_hybrid_ccm_se(ps,p0,hyam,hybm)  ; (time,lev,ncol)  
  printVarSummary(pm)
  printMinMax(pm,0)

A sample printout of two grid points (one over the ocean, the other over the Rocky Mountains) at a particular time step follows. Sample temperature values are printed adjacent to the pressure values (Pa). sprintf allows format control of the output:

         nt = 0
         ml = 70
         nl = 90
   print( sprintf("%8.1f",pm(nt,:,ml))+"  " \
        + sprintf("%7.2f", T(nt,:,ml))+"  " \
        + sprintf("%8.1f",pm(nt,:,nl))+"  " \   ; 2nd grid point
        + sprintf("%7.2f", T(nt,:,nl)))

         -----ocean------   ----mountain----
            pm       T         pm       T
(0)        364.3   236.12     364.3   237.13    [top level]
(1)        759.5   231.25     759.5   231.92
(2)       1435.7   229.49    1435.7   228.98
(3)       2461.2   227.34    2461.2   225.49
(4)       3826.8   222.29    3826.8   218.21
(5)       5459.5   218.09    5459.5   213.41
(6)       7201.2   213.01    7201.2   210.53
(7)       8782.1   210.24    8782.1   208.60
(8)      10331.7   207.58   10331.7   207.89
   .
   .
   .
(26)     95769.6   288.61   75612.6   286.83
(27)     97958.9   290.18   77233.2   288.69
(28)     99896.6   291.21   78667.4   290.15
(29)    101562.0   292.29   79935.8   290.50    [bottom (near surface) level]
Example 2

Similar to example 1, but calculates the interface pressure levels at each grid point.

  hyai = f->hyai ; read from a file the interface coef
  hybi = f->hybi ; read from a file
  nlevi= dimsizes(hyai)  ; number of interface levels
  ps   = f->PS   ; surface pressure [Pa]    ; (time,ncol)
  p0   = 100000. ; since ps is in Pa   or [  f->P0  ]

  pi   = pres_hybrid_ccm_se(ps,p0,hyai,hybi)  
The returned variable is dimensioned: pi(ntim, nlevi, ncol)

Example 3

Similar to example 1, but the first hybrid component is has units of pressure.

  p0   = 100000. ; since ps is in Pa or [ f->P0]
  ap   = f->ap   ; read from a file the pressure component
  hya  = ap/p0   ; make dimensionless
  hyb  = f->hyb  ; read from a file
  ps   = f->PS   ; surface pressure [Pa]

  pm = pres_hybrid_ccm_se(ps,p0,hya,hyb)   ; pm(time,lev,ncol)  
  printVarSummary(pm)
  printMinMax(pm,0)