NCL Home > Documentation > Functions > Meteorology

pslec

Computes sea level pressure using the ECMWF formulation.

Prototype

	function pslec (
		t           : numeric,  
		phis [*][*] : numeric,  
		ps   [*][*] : numeric,  
		pres        : numeric   
	)

	return_val [dimsizes(ps)] :  numeric

Arguments

t

A multi-dimensional array or scalar value equal to the temperature in K.

phis

A two-dimensional array equal to the surface geopotential in m^2/s^2. The rightmost two dimensions must be lat and lon.

ps

A two-dimensional array equal to the surface pressure in Pa. Must be the same size as phis.

pres

A multi-dimensional array or scalar value equal to the pressure in Pa. Should correspond to the lowest vertical level. Must be at least two dimensions. The rightmost two dimensions must be lat and lon.

Return value

A multi-dimensional array of the same size as ps. Double if any of the input arguments is double, float otherwise. Contains three attributes, long_name, short_name, and units. You access attributes through the @ operator.

print(return_val@long_name)

Description

Computes sea level pressure using the ECMWF formulation.

See Also

pslhyp, pslhor

Examples

Example 1

Assume the input arrays are four-dimensional with dimensions time, level, lat, lon, and the 0-index being the lowest level.

 
  PSL = pslec (t(:,0,:,:),phis,ps,pres(:,0,:,:))
; PSL is dimensioned time, lat, lon.
Example 2

begin
  nlat  =  64              ; T42 gaussian grid
  mlon  = 128
 
  fname  = "pslecT42.hsl"              ; sequential fortran file
  nrec   = fbinnumrec (fname)          ; number of records

  t      = fbinrecread(fname, 0 ,(/nlat,mlon/), "float" )
  phis   = fbinrecread(fname, 1 ,(/nlat,mlon/), "float" )
  ps     = fbinrecread(fname, 2 ,(/nlat,mlon/), "float" )
  pres   = fbinrecread(fname, 3 ,(/nlat,mlon/), "float" )  
  psl    = pslec(t,phis,ps,pres)
  print(psl)
  print(psl@long_name)
  print(psl@short_name)
  print(psl@units)
end