orog_mask_tools  1.13.0
mtnlm7_oclsm.F90 File Reference

Terrain maker for the ufs weather model. More...

Go to the source code of this file.

Functions/Subroutines

program __mtnlm7_oclsm.f90__
 This program creates landmask, land fraction, terrain and and fields required for the model's gravity wave drag (GWD) scheme. More...
 
subroutine make_mask (zslm, slm, land_frac, im, jm, imn, jmn, lon_c, lat_c)
 Create the land-mask, land fraction. More...
 
subroutine makemt2 (ZAVG, ZSLM, ORO, SLM, VAR, VAR4, IM, JM, IMN, JMN, lon_c, lat_c, lake_frac, land_frac)
 Create the orography, standard deviation of orography and the convexity on a model tile. More...
 
subroutine makeoa2 (ZAVG, zslm, VAR, OA4, OL, ELVMAX, ORO, IM, JM, IMN, JMN, lon_c, lat_c, lon_t, lat_t, dx, dy, is_south_pole, is_north_pole)
 Create orographic asymmetry and orographic length scale on the model grid. More...
 
subroutine makepc2 (ZAVG, ZSLM, THETA, GAMMA, SIGMA, IM, JM, IMN, JMN, lon_c, lat_c, SLM)
 Make the principle coordinates - slope of orography, anisotropy, angle of mountain range with respect to east. More...
 
subroutine tersub (IM, JM, EFAC, OUTGRID, MASK_ONLY, EXTERNAL_MASK_FILE)
 Driver routine to compute terrain. More...
 

Detailed Description

Terrain maker for the ufs weather model.

Author
Mark Iredell
Date
92-04-16

Definition in file mtnlm7_oclsm.F90.

Function/Subroutine Documentation

◆ __mtnlm7_oclsm.f90__()

program __mtnlm7_oclsm.f90__ ( )

This program creates landmask, land fraction, terrain and and fields required for the model's gravity wave drag (GWD) scheme.

Specifically:

  • Land mask (yes/no flag)
  • Land fraction
  • Terrain (orography)
  • Maximum elevation
  • Standard deviation of terrain
  • Convexity
  • Orographic Asymetry - W/S/SW/NW directional components.
  • Orographic Length Scale - W/S/SW/NW directional components.
  • Anisotropy
  • Slope of terrain
  • Angle of mountain range with respect to East.

This program operates on a single cubed-sphere tile.

Optionally, the program can compute and output only the land mask and land fraction. Or, it can read in the mask and fraction from an external file, then compute the terrain and GWD fields using that mask. These options are used to support coupled (atm/oceann) runs of the UFS. The process is:

  • Run this program and output the mask/fraction only.
  • Adjust or merge the mask/fraction with the ocean mask (using another program).
  • Read in this 'merged' mask/fraction and compute the terrain and GWD fields.

PROGRAM HISTORY LOG:

  • 92-04-16 IREDELL
  • 98-02-02 IREDELL FILTER
  • 98-05-31 HONG Modified for subgrid orography used in Kim's scheme
  • 98-12-31 HONG Modified for high-resolution GTOPO orography
  • 99-05-31 HONG Modified for getting OL4 (mountain fraction)
    • 00-02-10 Moorthi's modifications
  • 00-04-11 HONG Modified for reduced grids
  • 00-04-12 Iredell Modified for reduced grids
  • 02-01-07 (j) modified for principal axes of orography There are now 14 files, 4 additional for lm mb
    • 04-04-04 (j) re-Test on IST/ilen calc for sea-land mask(j)
    • 04-09-04 minus sign here in MAKEOA IST and IEN as in MAKEMT!
    • 05-09-05 if test on HK and HLPRIM for GAMMA SQRT
    • 07-08-07 replace 8' with 30" incl GICE, conintue w/ S-Y. lake slm - 08-08-07 All input 30", UMD option, and filter as described below
    • 24-08-15 Remove old code used by spectral GFS.

      INPUT FILES:

    • UNIT5 - PROGRAM CONTROL NAMELIST.
    • NCID - MODEL 'GRID' FILE
    • NCID - GMTED2010 USGS orography (NetCDF)
    • NCID - 30" UMD land cover mask. (NetCDF) - NCID - GICE Grumbine 30" RAMP Antarctica orog. (NetCDF)
    • NCID - MERGE FILE. CONTAINS LAND MASK, FRACTION AND LAKE FRACTION THAT HAS BEEN MERGED WITH AN OCEAN GRID. (NetCDF)

      OUTPUT FILES (ALL ON A SINGLE CUBED-SPHERE TILE) :

    • NCID - OROGRAPHY FILE (NetCDF) IF MASK_ONLY=FALSE
    • NCID - MASK FILE (NetCDF) IF MASK_ONLY=TRUE
    • CONTAINS ONLY LAND MASK AND FRACTION.
Returns
0 for success, error code otherwise.

Definition at line 72 of file mtnlm7_oclsm.F90.

References io_utils::read_mdl_dims(), and tersub().

◆ make_mask()

subroutine make_mask ( integer, dimension(imn,jmn), intent(in)  zslm,
real, dimension(im,jm), intent(out)  slm,
real, dimension(im,jm), intent(out)  land_frac,
integer, intent(in)  im,
integer, intent(in)  jm,
integer, intent(in)  imn,
integer, intent(in)  jmn,
real, dimension(im+1,jm+1), intent(in)  lon_c,
real, dimension(im+1,jm+1), intent(in)  lat_c 
)

Create the land-mask, land fraction.

This routine is used for the FV3GFS model.

Parameters
[in]zslmThe high-resolution input land-mask dataset.
[out]slmLand-mask on the model tile.
[out]land_fracLand fraction on the model tile.
[in]im"i" dimension of the model grid.
[in]jm"j" dimension of the model grid.
[in]imn"i" dimension of the hi-res input orog/mask datasets.
[in]jmn"j" dimension of the hi-res input orog/mask datasets.
[in]lon_cLongitude of the model grid corner points.
[in]lat_cLatitude on the model grid corner points.
Author
GFDL Programmer

Definition at line 409 of file mtnlm7_oclsm.F90.

References orog_utils::get_index(), and orog_utils::inside_a_polygon().

Referenced by tersub().

◆ makemt2()

subroutine makemt2 ( integer, dimension(imn,jmn), intent(in)  ZAVG,
integer, dimension(imn,jmn), intent(in)  ZSLM,
real, dimension(im,jm), intent(out)  ORO,
real, dimension(im,jm), intent(in)  SLM,
real, dimension(im,jm), intent(out)  VAR,
real, dimension(im,jm), intent(out)  VAR4,
integer, intent(in)  IM,
integer, intent(in)  JM,
integer, intent(in)  IMN,
integer, intent(in)  JMN,
real, dimension(im+1,jm+1), intent(in)  lon_c,
real, dimension(im+1,jm+1), intent(in)  lat_c,
real, dimension(im,jm), intent(in)  lake_frac,
real, dimension(im,jm), intent(in)  land_frac 
)

Create the orography, standard deviation of orography and the convexity on a model tile.

Parameters
[in]zavgThe high-resolution input orography dataset.
[in]zslmThe high-resolution input land-mask dataset.
[out]oroOrography on the model tile.
[in]slmLand-mask on the model tile.
[out]varStandard deviation of orography on the model tile.
[out]var4Convexity on the model tile.
[in]im"i" dimension of the model grid.
[in]jm"j" dimension of the model grid.
[in]imn"i" dimension of the hi-res input orog/mask datasets.
[in]jmn"j" dimension of the hi-res input orog/mask datasets.
[in]lon_cLongitude of the model grid corner points.
[in]lat_cLatitude on the model grid corner points.
[in]lake_fracFractional lake within the grid
[in]land_fracFractional land within the grid
Author
GFDL Programmer

Definition at line 531 of file mtnlm7_oclsm.F90.

References orog_utils::get_index(), and orog_utils::inside_a_polygon().

Referenced by tersub().

◆ makeoa2()

subroutine makeoa2 ( integer, dimension(imn,jmn), intent(in)  ZAVG,
integer, dimension(imn,jmn), intent(in)  zslm,
real, dimension(im,jm), intent(in)  VAR,
real, dimension(im,jm,4), intent(out)  OA4,
real, dimension(im,jm,4), intent(out)  OL,
real, dimension(im,jm), intent(out)  ELVMAX,
real, dimension(im,jm), intent(in)  ORO,
integer, intent(in)  IM,
integer, intent(in)  JM,
integer, intent(in)  IMN,
integer, intent(in)  JMN,
real, dimension(im+1,jm+1), intent(in)  lon_c,
real, dimension(im+1,jm+1), intent(in)  lat_c,
real, dimension(im,jm), intent(in)  lon_t,
real, dimension(im,jm), intent(in)  lat_t,
real, dimension(im,jm), intent(in)  dx,
real, dimension(im,jm), intent(in)  dy,
logical, dimension(im,jm), intent(in)  is_south_pole,
logical, dimension(im,jm), intent(in)  is_north_pole 
)

Create orographic asymmetry and orographic length scale on the model grid.

This routine is used for the cubed-sphere grid.

Parameters
[in]zavgHigh-resolution orography data.
[in]zslmHigh-resolution land-mask data.
[in]varStandard deviation of orography on the model grid.
[out]oa4Orographic asymmetry on the model grid. Four directional components - W/S/SW/NW
[out]olOrographic length scale on the model grid. Four directional components - W/S/SW/NW
[out]elvmaxMaximum elevation within a model grid box.
[in]oroOrography on the model grid.
[in]im"i" dimension of the model grid tile.
[in]jm"j" dimension of the model grid tile.
[in]imn"i" dimension of the high-resolution orography and mask data.
[in]jmn"j" dimension of the high-resolution orography and mask data.
[in]lon_cCorner point longitudes of the model grid points.
[in]lat_cCorner point latitudes of the model grid points.
[in]lon_tCenter point longitudes of the model grid points.
[in]lat_tCenter point latitudes of the model grid points.
[in]dxLength of model grid points in the 'x' direction.
[in]dyLength of model grid points in the 'y' direction.
[in]is_south_poleIs the model point at the south pole?
[in]is_north_poleis the model point at the north pole?
Author
GFDL Programmer

Definition at line 1026 of file mtnlm7_oclsm.F90.

References orog_utils::get_index(), orog_utils::get_lat_angle(), orog_utils::get_lon_angle(), orog_utils::get_xnsum(), orog_utils::get_xnsum2(), orog_utils::get_xnsum3(), and orog_utils::inside_a_polygon().

Referenced by tersub().

◆ makepc2()

subroutine makepc2 ( integer, dimension(imn,jmn), intent(in)  ZAVG,
integer, dimension(imn,jmn), intent(in)  ZSLM,
real, dimension(im,jm), intent(out)  THETA,
real, dimension(im,jm), intent(out)  GAMMA,
real, dimension(im,jm), intent(out)  SIGMA,
integer, intent(in)  IM,
integer, intent(in)  JM,
integer, intent(in)  IMN,
integer, intent(in)  JMN,
real, dimension(im+1,jm+1), intent(in)  lon_c,
real, dimension(im+1,jm+1), intent(in)  lat_c,
real, dimension(im,jm), intent(in)  SLM 
)

Make the principle coordinates - slope of orography, anisotropy, angle of mountain range with respect to east.

This routine is used for the FV3GFS cubed-sphere grid.

Parameters
[in]zavgThe high-resolution input orography dataset.
[in]zslmThe high-resolution input land-mask dataset.
[out]thetaAngle of mountain range with respect to east for each model point.
[out]gammaAnisotropy for each model point.
[out]sigmaSlope of orography for each model point.
[in]im"i" dimension of the model grid tile.
[in]jm"j" dimension of the model grid tile.
[in]imn"i" dimension of the hi-res input orog/mask datasets.
[in]jmn"j" dimension of the hi-res input orog/mask datasets.
[in]lon_cLongitude of model grid corner points.
[in]lat_cLatitude of the model grid corner points.
[in]SLMmask
Author
GFDL Programmer

Definition at line 770 of file mtnlm7_oclsm.F90.

References orog_utils::get_index(), and orog_utils::inside_a_polygon().

Referenced by tersub().

◆ tersub()

subroutine tersub ( integer, intent(in)  IM,
integer, intent(in)  JM,
integer, intent(in)  EFAC,
character(len=*), intent(in)  OUTGRID,
logical, intent(in)  MASK_ONLY,
character(len=*), intent(in)  EXTERNAL_MASK_FILE 
)

Driver routine to compute terrain.

Parameters
[in]IM"i" dimension of the model grid tile.
[in]JM"j" dimension of the model grid tile.
[in]EFACFactor to adjust orography by its variance.
[in]OUTGRIDThe 'grid' file for the model tile. grid. When specified, will be interpolated to model tile. When not specified, program will create fields from raw high-resolution topography data.
[in]MASK_ONLYFlag to generate the Land Mask only
[in]EXTERNAL_MASK_FILEFile containing an externally generated land mask/fraction.
Author
Jordan Alpert NOAA/EMC

Definition at line 119 of file mtnlm7_oclsm.F90.

References make_mask(), makemt2(), makeoa2(), makepc2(), orog_utils::minmax(), io_utils::qc_orog_by_ramp(), io_utils::read_global_mask(), io_utils::read_global_orog(), io_utils::read_mask(), io_utils::read_mdl_grid_file(), orog_utils::remove_isolated_pts(), orog_utils::timef(), io_utils::write_mask_netcdf(), and io_utils::write_netcdf().

Referenced by __mtnlm7_oclsm.f90__().