CKVBLE
Function: If variable-name VNAME is in
VLIST, increment file-header variables-count NVARS3D and
put the indicated name, type, units, and description into
FDESC3.EXT file header data structures.
Sets VFLAG true iff VNAME is in VLIST.
FMTOPTS
Function: Puts values of the MM5
configuration flags from param2.incl into
namelist format ("NAME=<value>;")
in the array of strings LINES( N ).
Note that "=" and ";" are always present as delimiters
for the value stored. Checks against N for overflow.
GETVBLEFunction: Open file VFILE (MB2_VARS, etc.) containing an input list of variable-names, read it, check the names it contains against VLIST, save the matches in VNAMES and count them in NVARS. Set VFLAG true iff there are matches between the file and VLIST (i.e., iff NVARS is positive. Log warning message for each mis-match.
MM2BDYFunction: Extract/reorder/convert the boundary data structure BOUT for the AQM grid starting at offset <COL0,ROW0,LAY0> and having dimensions <NCOLS,NROWS,NLAYS> and perimeter thickness NTHIK. Apply units-conversion FACTOR.
MM2BMPFunction: Extract/reorder/decouple/compute the cross-point sea level pressure, using the Benjamin-Miller (1990) algorithm, for the window specified in terms of given grid-window bounds and put it in I/O API order in SLP, in terms of temperature array TA, specific humidity array QV, pressure perturbation array PP, PSTAR-array PM, and geopotential height array HT, found in standard MM5 subscript order.
MM2DP2Function: Extract/reorder/decouple/compute the cross point 2D density, pressure, virtual temperature and relative humidity for the window specified in terms of the given grid-window bounds. Also transforms surface fluxes to kinematic units. Put the result into I/O API order, using the specified TA, QV, Pprime, Pstar, SIGH, and Ptop from MM5.
MM2DP3Function: Extract/reorder/decouple/compute the cross point 3D density, pressure, virtual temperature, potential temperature and relative humidity for the window specified in terms of the given grid-window bounds. Put the result into I/O API order, using the specified TA, QV, Pprime, Pstar, SIGH, and Ptop from MM5.
MM2INTFunction: Extract/reorder/convert the INTEGER array IAM for the AQM grid starting at offset <COL0,ROW0,LAY0> and having dimensions <NCOLS,NROWS,NLAYS>. Apply units-conversion FACTOR, and round to INTEGER and put the result into INTEGER array IAOUT.
MM2IOFunction: Extract/reorder/convert the array AOUT for the AQM grid starting at offset <COL0,ROW0,LAY0> and having dimensions <NCOLS,NROWS,NLAYS>. Apply units-conversion FACTOR.
MM2MOLFunction: Extract/reorder/compute the inverse Monin-Obukhov length for the AQM grid starting at offset <COL0,ROW0,LAY0> and having dimensions <NCOLS,NROWS,NLAYS>. Works in terms of MM5 variables HOL = PBL height/MOL and PBL
MM2MSQFunction: Extract/reorder/compute the gridded map scale factor squared for the AQM grid starting at offset <COL0,ROW0,LAY0> and having dimensions <NCOLS,NROWS,NLAYS> from the MM5 array MSF(D|X) of (dot|cross-point) inverse map scale factors.
MM2RADFunction: Extract/reorder/compute net (albedo-corrected) ground radiation for the AQM grid starting at offset <COL0,ROW0,LAY0> and having dimensions <NCOLS,NROWS,NLAYS>. Works in terms of MM5 variables for gross ground radiation and albedo, according to the formula Rout = RAD/(1-ALB)
MM2REFFunction: Extract/reorder/compute reference atmosphere: surface temperature and pressure, 3D half-level density and half and full level temperature and pressure, for the AQM grid starting at offset <COL0,ROW0,LAY0> and having dimensions <NCOLS,NROWS,NLAYS>.
MM2SDVFunction: Extract/reorder/decouple/compute the cross-point wind-speed, divergence, and relative vorticity for the window specified in terms of given grid-window bounds and put it in I/O API order in WSPD, DIV, and VOR, in terms of wind component arrays UM and VM, and PSTAR-array PM found in standard MM5 subscript order.
MM2SDVVFunction: Extract/reorder/decouple/compute the cross-point wind-speed, divergence, and both relative and absolute vorticity for the window specified in terms of given grid-window bounds and put it in I/O API order in WSPD, DIV, and VOR, in terms of wind component arrays UM and VM, and PSTAR-array PM found in standard MM5 subscript order.
MM2SLPFunction: Extract/reorder/decouple/compute the cross-point sea level pressure, using the INTERP algorithm, for the window specified in terms of given grid-window bounds and put it in I/O API order in SLP, in terms of temperature array TA, pressure perturbation array PP, PSTAR-array PM, and geopotential height array HT, found in standard MM5 subscript order.
MM2THERM2Function: Extract/reorder/decouple/compute the cross-point layer 1 density, pressure, virtual temperature, relative humidity (three versions), potential temperature, and sensible and latent heat fluxes for the window specified in terms of given grid-window bounds and put it in I/O API order in in terms of temperature array TA, specific humidity array QV, pressure perturbation array PP, PSTAR-array PM, sensible and latent heat flux arrays HFX and QFX, found in standard MM5 subscript order.
MM2THERM3Function: Extract/reorder/decouple/compute the cross-point layer 1 density, pressure, virtual temperature, relative humidity (three versions), and potential temperature for the window specified in terms of given grid-window bounds and put it in I/O API order in in terms of temperature array TA, specific humidity array QV, pressure perturbation array PP, PSTAR-array PM, found in standard MM5 subscript order.
MM2WSTFunction: Extract/reorder/compute vertical friction velocity WSTAR from MM5 UST and HOL, for the window specified in terms of grid-window bounds.
MMBDCPLFunction: Extract/reorder/compute/decouple the boundary data structure BOUT for the cross-point variable AM for the AQM grid starting at offset <COL0,ROW0,LAY0> and having dimensions <NCOLS,NROWS,NLAYS>, using MM5 cross point array PSTAR for the decoupling and applying FACTOR for units conversion.
MMBDPTFunction: Extract/reorder/compute/decouple the boundary density, pressure, virtual temperature and relative humidity arrays for the AQM grid starting at offset <COL0,ROW0,LAY0> and having dimensions <NCOLS,NROWS,NLAYS> from the MM5 cross-point arrays TA, QV, PPRIME, using MM5 cross point array PSTAR for the decoupling, and SIGMAH and PTOP for vertical layer structure.
MMBMSQFunction: Extract/reorder/compute the boundary map scale factor squared for the AQM grid starting at offset <COL0,ROW0,LAY0> and having dimensions <NCOLS,NROWS,NLAYS> from the MM5 cross-point array MSFX of inverse map scale factors.
MMBREFFunction: Extract/reorder/compute reference atmosphere: surface temperature and pressure, 3D half-level density and half and full level temperature and pressure, for the boundary of the AQM grid starting at offset <COL0,ROW0,LAY0> and having dimensions <NCOLS,NROWS,NLAYS> and boundary thickness NTHIK.
MMBTHERMOFunction: Extract/reorder/compute/decouple the boundary density, pressure, virtual temperature and relative humidity (three versions: water/ice, liquid water, and mixed-phase as used in KF cloud package) arrays for the AQM grid starting at offset <COL0,ROW0,LAY0> and having dimensions <NCOLS,NROWS,NLAYS> from the MM5 cross-point arrays TA, QV, PPRIME, using MM5 cross point array PSTAR for the decoupling, and SIGMAH and PTOP for vertical layer structure.
MMD2PFunction: Extract/reorder/compute the dot point linear, log, and power pressure-surface interpolation coefficients for the specified window and put the result into standard I/O API order.
NOTE:
Interpolation to pressure level L at column
and row C,R is performed as follows, where
COEF is one of CLIN, CLOG,
or CPOW):
K = PDEX( C,R,L )
PP = COEF( C,R,L )
QQ = 1.0 - PP
FOOP( C,R,L ) = PP*FOO( C,R,K ) + QQ*( C,R,K+1 )
Internals: Internally, at each dot point
C,R,
MMD2P interpolates PPRIME
and computes pressure values PRES for each
sigma-level 1, ..., KM (with subscripts ascending
vertically as in I/O API conventions), and then for each
standard pressure level PVAL(L) searches to find
subscripts M-1 and M such that
PRES(M-1)<=PVAL(L)<PRES(M). Then
MMD2P computes linear-interpolation coefficients
for each of PVAL(L),
PVAL(L)R/CP, and
log(PVAL(L)), relative to the
PRES(M),
PRES(M)R/CP, and
log(PRES(M)), as indicated in the
attached diagram, also
available in PostScript.
MMDDCPLFunction: Extract/reorder/compute/decouple the dot-point variable AM for the AQM grid starting at offset <COL0,ROW0,LAY0> and having dimensions <NCOLS,NROWS,NLAYS>, using MM5 cross point array PSTAR for the decoupling, and applying FACTOR for units conversion.
MMPDDCPLFunction: Extract/reorder/interpolate/decouple the dot-point variable AM to pressure level vertical grid and the AQM horizontal grid starting at offset <COL0,ROW0,LAY0> and having dimensions <NCOLS,NROWS,NLAYS>, using MM5 cross point array PSTAR for the decoupling, and applying FACTOR for units conversion.
NOTES:
MMD2P
MMPDTRHFunction: Extract/reorder/decouple/compute the pressure-level cross point 3D density, temperature, virtual temperature and relative humidity for the specified pressure levels and the window specified in terms of the given grid-window bounds. Put the result into I/O API order, using the specified TA, QV, Pprime, Pstar, SIGH, and Ptop from MM5 and the interpolation index and linear and log interpolation coefficients from MMX2P.
NOTES:
MMX2P
MMPSDVFunction: Interpolate/reorder/decouple/compute the cross-point pressure-level wind-speed, divergence, absolute and relative vorticity, and wind components for the window specified in terms of given grid-window bounds and for the specified pressure level, in terms of wind component arrays UM and VM, and PSTAR-array PM found in standard MM5 subscript order. Put the results in I/O API order in WSPD, DIV, RVOR, AVOR, UWIND, VWIND.
NOTES:
MMD2P
MMPSDVFunction: Interpolate/reorder/decouple/compute the cross-point pressure-level wind-speed, divergence, vorticity, and wind components for the window specified in terms of given grid-window bounds and for the specified pressure level, in terms of wind component arrays UM and VM, and PSTAR-array PM found in standard MM5 subscript order. Put the results in I/O API order in WSPD, DIV, VOR, UWIND, VWIND.
NOTES:
MMD2P
MMPTHETA
Function: Compute 3-D cross-point
pressure-level potential temperature from pressure levels
PLEV (given in Pascals), and pressure level temerature
T from subroutine MMPDTRH. Assumes that all
inputs are already in I/O API.
NOTE: MISSING values (i.e., for below-terrain pressure levels) stored as -9.999
MMPUVFunction: Extract/reorder/interpolate/decouple the cross-point horizontal U and V cross point wind component to pressure level vertical grid specified by PLEV, and the AQM horizontal grid starting at offset <COL0,ROW0,LAY0> and having dimensions <NCOLS,NROWS,NLAYS>, using MM5 cross point array PSTAR for the decoupling.
NOTES:
MMD2P
MMPWFunction: Extract/reorder/interpolate/decouple the cross-point vertical W wind component to pressure level vertical grid specified by PLEV, and the AQM horizontal grid starting at offset <COL0,ROW0,LAY0> and having dimensions <NCOLS,NROWS,NLAYS>, using MM5 cross point array PSTAR for the decoupling.
NOTES:
MMD2P
MMPXDCPLFunction: Extract/reorder/interpolate/decouple the cross-point variable AM to pressure level vertical grid and the AQM horizontal grid starting at offset <COL0,ROW0,LAY0> and having dimensions <NCOLS,NROWS,NLAYS>, using MM5 cross point array PSTAR for the decoupling, and applying FACTOR for units conversion.
NOTES:
MMX2P
MMPZFunction: Compute the cross point pressure-level Z (height above mean sea level) and pressure thicknesses DZ1000_850, DZ1000_500, DZ850_500 for the specified window and specified pressure levels, and put the result into standard I/O API order.
NOTE: LEVS and COEF should be
interpolation indices and coefficients returned from
worker routine MMX2P
MMX2DFunction: Extract/reorder/linear-interpolate AM from the specified dot point array to the specified window of the cross point grid, or vice versa, and put the result into standard I/O API order, scaling the result by FACTOR
MMX2PFunction: Extract/reorder/compute the cross point linear, log, and power pressure-surface interpolation coefficients for the specified window and put the result into standard I/O API order.
NOTE:
Interpolation to pressure level L at column
and row C,R is performed as follows, where
COEF is one of CLIN, CLOG,
or CPOW):
K = PDEX( C,R,L )
PP = COEF( C,R,L )
QQ = 1.0 - PP
FOOP( C,R,L ) = PP*FOO( C,R,K ) + QQ*( C,R,K+1 )
Internals: Internally, at each cross
point MMX2P
first computes pressure values PRES for each
sigma-level 1, ..., KM (with subscripts ascending
vertically as in I/O API conventions), and then for each
standard pressure level PVAL(L) searches to find
subscripts M-1 and M such that
PRES(M-1)<=PVAL(L)<PRES(M). Then
MMX2P computes linear-interpolation coefficients
for each of PVAL(L),
PVAL(L)R/CP, and
log(PVAL(L)), relative to the
PRES(M),
PRES(M)R/CP, and
log(PRES(M)), as indicated in the
attached diagram, also
available in PostScript.
MMXDCPLFunction: Extract/reorder/compute/decouple the cross-point variable AM for the AQM grid starting at offset <COL0,ROW0,LAY0> and having dimensions <NCOLS,NROWS,NLAYS>, using MM5 cross point array PSTAR for the decoupling, and applying FACTOR for units conversion.
MMXUSDVVFunction: Extract/reorder/compute/decouple the cross-point wind components UX, VX, horizontal divergence DIV, absolute and relative vorticity AVOR and RVOR for the AQM grid starting at offset <COL0,ROW0,LAY0> and having dimensions <NCOLS,NROWS,NLAYS>, using MM5 cross point array PSTAR for the decoupling, and applying FACTOR for units conversion.