orog_mask_tools  1.13.0
module_gsl_oro_data_lg_scale.f90 File Reference

Calculates large-scale GWD orographic stats for FV3GFS grids. More...

Go to the source code of this file.

Functions/Subroutines

subroutine gsl_oro_data_lg_scale::calc_gsl_oro_data_lg_scale (tile_num, res_indx, halo)
 Subroutine to compute orographic statistics needed for large-scale orograhic drag (gravity wave and blocking) schemes. More...
 
subroutine gsl_oro_data_lg_scale::calc_mean_hgt (s_ii, e_ii, s_jj, e_jj, HGT)
 Calculates average terrain height within coarse grid cell ("block") More...
 
subroutine gsl_oro_data_lg_scale::hgt_interpolate (lat, lon_in, lat_blk, lon_blk, HGT_coarse, HGT_coarse_on_fine)
 Interpolates height from coarse grid on to fine grid points. More...
 
real(kind=real_kind) function gsl_oro_data_lg_scale::interp_1d (x, x1, x2, y1, y2)
 Interpolates (or extrapolates) linear function y = y(x) More...
 
integer function gsl_oro_data_lg_scale::nearest_i_east (lon_in)
 Finds nearest fine-grid i index to the east of a given longitude. More...
 
integer function gsl_oro_data_lg_scale::nearest_i_west (lon_in)
 Finds nearest fine-grid i index to the west of a given longitude. More...
 
integer function gsl_oro_data_lg_scale::nearest_j_north (lat_in)
 Calculates nearest fine-grid j index to the north of a given latitude. More...
 
integer function gsl_oro_data_lg_scale::nearest_j_south (lat_in)
 Calculates nearest fine-grid j index to the south of a given latitude. More...
 
subroutine gsl_oro_data_lg_scale::netcdf_err (err, string)
 Returns netCDF error given input err code. More...
 

Variables

integer, parameter gsl_oro_data_lg_scale::dbl_kind = selected_real_kind(13)
 double precision More...
 
integer gsl_oro_data_lg_scale::dimx_fine
 x-dimension of fine grid More...
 
integer gsl_oro_data_lg_scale::dimy_fine
 y-dimension of fine grid More...
 
real(kind=real_kind), dimension(:,:), allocatable gsl_oro_data_lg_scale::hgt_m_fine
 Height of fine grid pts (m) More...
 
real(kind=real_kind), parameter gsl_oro_data_lg_scale::hgt_missing = 1.E+10
 Flag for missing data. More...
 
real(kind=real_kind), dimension(:), allocatable gsl_oro_data_lg_scale::lat1d_fine
 latitude of fine grid pts More...
 
real(kind=real_kind), dimension(:), allocatable gsl_oro_data_lg_scale::lon1d_fine
 longitude of fine grid pts More...
 
real(kind=real_kind), parameter gsl_oro_data_lg_scale::p5 = 0.5_real_kind
 one half More...
 
real, parameter gsl_oro_data_lg_scale::pi = 3.1415926535897_real_kind
 pi More...
 
integer, parameter gsl_oro_data_lg_scale::real_kind = selected_real_kind(6)
 single precision More...
 

Detailed Description

Calculates large-scale GWD orographic stats for FV3GFS grids.

Author
Michael Toy, NOAA/GSL
Date
2021-03-12

This module calculates the parameters required for the subgrid- scale orographic gravity-wave drag (GWDO) scheme on the FV3 grid. These parameters are for the large-scale GWDO and blocking schemes of the GSL drag suite. 2.5minute (~5km) global topography is used. The topographic data comes from the 'fix' file geo_em.d01.lat-lon.2.5m.HGT_M.nc. The output fields are:

  • stddev standard deviation of subgrid-scale topograpy
  • convexity convexity (kurtosis) of subgrid-scale topography
  • ol{1,2,3,4} orographic effective lengths of subgrid-scale topography for 4 orientations: 1-westerly, 2-southerly, 3-southwesterly, 4-northwesterly
  • oa{1,2,3,4} orographic asymmetries of subgrid-scale topography for 4 orientations: 1-westerly, 2-southerly, 3-southwesterly, 4-northwesterly

Based on code by Michael Duda provided by NCAR/MMM

Definition in file module_gsl_oro_data_lg_scale.f90.

Function/Subroutine Documentation

◆ calc_gsl_oro_data_lg_scale()

subroutine gsl_oro_data_lg_scale::calc_gsl_oro_data_lg_scale ( character(len=2), intent(in)  tile_num,
character(len=7), intent(in)  res_indx,
character(len=4), intent(in)  halo 
)

Subroutine to compute orographic statistics needed for large-scale orograhic drag (gravity wave and blocking) schemes.

Parameters
[in]tile_num(tile number)
[in]res_indx(resolution)
[in]halo(halo number)
Author
Michael Toy, NOAA/GSL

Definition at line 51 of file module_gsl_oro_data_lg_scale.f90.

References netcdf_err().

◆ calc_mean_hgt()

subroutine gsl_oro_data_lg_scale::calc_mean_hgt ( integer  s_ii,
integer  e_ii,
integer  s_jj,
integer  e_jj,
real (kind=real_kind), intent(out)  HGT 
)

Calculates average terrain height within coarse grid cell ("block")

Parameters
[in]s_iiFine grid starting i-index
[in]e_iiFine grid ending i-index
[in]s_jjFine grid starting j-index
[in]e_jjFine grid ending j-index
[out]hgtFine grid height (m)
Author
Michael Toy, NOAA/GSL

Definition at line 1001 of file module_gsl_oro_data_lg_scale.f90.

◆ hgt_interpolate()

subroutine gsl_oro_data_lg_scale::hgt_interpolate ( real (kind = real_kind), intent(in)  lat,
real (kind = real_kind), intent(in)  lon_in,
real (kind = real_kind), dimension(3), intent(in)  lat_blk,
real (kind = real_kind), dimension(3), intent(in)  lon_blk,
real (kind = real_kind), dimension(3,3), intent(in)  HGT_coarse,
real (kind = real_kind), intent(out)  HGT_coarse_on_fine 
)

Interpolates height from coarse grid on to fine grid points.

Parameters
[in]latLatitude of fine grid point.
[in]lon_inLongitude of fine grid point.
[in]lat_blkLatitudes of neighboring coarse grid points.
[in]lon_blkLongitudes of neighboring coarse grid points.
[in]hgt_coarseTopographic heights on coarse grid
[out]hgt_coarse_on_fineCoarse grid heights interpolated on to fine grid
Author
Michael Toy, NOAA/GSL

Definition at line 1063 of file module_gsl_oro_data_lg_scale.f90.

◆ interp_1d()

real (kind=real_kind) function gsl_oro_data_lg_scale::interp_1d ( real (kind=real_kind), intent(in)  x,
real (kind=real_kind), intent(in)  x1,
real (kind=real_kind), intent(in)  x2,
real (kind=real_kind), intent(in)  y1,
real (kind=real_kind), intent(in)  y2 
)

Interpolates (or extrapolates) linear function y = y(x)

Parameters
[in]xInput "x" value
[in]x1Known point 1
[in]x2Known point 2
[in]y1Known y(x1)
[in]y2Known y(x2)
Returns
interp_1d Interpolated y value at x
Author
Michael Toy, NOAA/GSL

Definition at line 1323 of file module_gsl_oro_data_lg_scale.f90.

◆ nearest_i_east()

integer function gsl_oro_data_lg_scale::nearest_i_east ( real (kind=real_kind), intent(in)  lon_in)

Finds nearest fine-grid i index to the east of a given longitude.

Parameters
[in]lon_inlongitude (radians)
Returns
nearest_i_east Nearest grid point i-index east of selected point
Author
Michael Toy, NOAA/GSL

Definition at line 1193 of file module_gsl_oro_data_lg_scale.f90.

◆ nearest_i_west()

integer function gsl_oro_data_lg_scale::nearest_i_west ( real (kind=real_kind), intent(in)  lon_in)

Finds nearest fine-grid i index to the west of a given longitude.

Parameters
[in]lon_inlongitude (radians)
Returns
nearest_i_west Nearest grid point i-index west of selected point
Author
Michael Toy, NOAA/GSL

Definition at line 1226 of file module_gsl_oro_data_lg_scale.f90.

◆ nearest_j_north()

integer function gsl_oro_data_lg_scale::nearest_j_north ( real (kind=real_kind), intent(in)  lat_in)

Calculates nearest fine-grid j index to the north of a given latitude.

Parameters
[in]lat_inLatitude (radians)
Returns
nearest_j_north Nearest fine-grid j index to the north of a given latitude
Author
Michael Toy, NOAA/GSL

Definition at line 1259 of file module_gsl_oro_data_lg_scale.f90.

◆ nearest_j_south()

integer function gsl_oro_data_lg_scale::nearest_j_south ( real (kind=real_kind), intent(in)  lat_in)

Calculates nearest fine-grid j index to the south of a given latitude.

Parameters
[in]lat_inLatitude (radians)
Returns
nearest_j_south Nearest fine-grid j index to the south of a given latitude
Author
Michael Toy, NOAA/GSL

Definition at line 1288 of file module_gsl_oro_data_lg_scale.f90.

◆ netcdf_err()

subroutine gsl_oro_data_lg_scale::netcdf_err ( integer, intent(in)  err,
character(len=*), intent(in)  string 
)

Returns netCDF error given input err code.

Parameters
[in]errError code from netCDF routine
[in]stringPortion of error message
Author
Michael Toy, NOAA/GSL

Definition at line 1343 of file module_gsl_oro_data_lg_scale.f90.

Variable Documentation

◆ dbl_kind

integer, parameter gsl_oro_data_lg_scale::dbl_kind = selected_real_kind(13)

double precision

Definition at line 27 of file module_gsl_oro_data_lg_scale.f90.

◆ dimx_fine

integer gsl_oro_data_lg_scale::dimx_fine

x-dimension of fine grid

Definition at line 30 of file module_gsl_oro_data_lg_scale.f90.

◆ dimy_fine

integer gsl_oro_data_lg_scale::dimy_fine

y-dimension of fine grid

Definition at line 31 of file module_gsl_oro_data_lg_scale.f90.

◆ hgt_m_fine

real (kind = real_kind), dimension(:,:), allocatable gsl_oro_data_lg_scale::hgt_m_fine

Height of fine grid pts (m)

Definition at line 38 of file module_gsl_oro_data_lg_scale.f90.

◆ hgt_missing

real (kind = real_kind), parameter gsl_oro_data_lg_scale::hgt_missing = 1.E+10

Flag for missing data.

Definition at line 39 of file module_gsl_oro_data_lg_scale.f90.

◆ lat1d_fine

real (kind = real_kind), dimension(:), allocatable gsl_oro_data_lg_scale::lat1d_fine

latitude of fine grid pts

Definition at line 33 of file module_gsl_oro_data_lg_scale.f90.

◆ lon1d_fine

real (kind = real_kind), dimension(:), allocatable gsl_oro_data_lg_scale::lon1d_fine

longitude of fine grid pts

Definition at line 34 of file module_gsl_oro_data_lg_scale.f90.

◆ p5

real (kind = real_kind), parameter gsl_oro_data_lg_scale::p5 = 0.5_real_kind

one half

Definition at line 36 of file module_gsl_oro_data_lg_scale.f90.

◆ pi

real, parameter gsl_oro_data_lg_scale::pi = 3.1415926535897_real_kind

pi

Definition at line 29 of file module_gsl_oro_data_lg_scale.f90.

◆ real_kind

integer, parameter gsl_oro_data_lg_scale::real_kind = selected_real_kind(6)

single precision

Definition at line 26 of file module_gsl_oro_data_lg_scale.f90.