orog_mask_tools
1.13.0
|
Terrain maker for global spectral model. More...
Go to the source code of this file.
Functions/Subroutines | |
program | __mtnlm7_oclsm.f__ |
This program creates 7 terrain-related files computed from the GMTED2010 terrain dataset. More... | |
subroutine | get_index (IMN, JMN, npts, lonO, latO, DELXN, jst, jen, ilist, numx) |
Determine the location of a cubed-sphere point within the high-resolution orography data. More... | |
real function | get_lat_angle (dy, DEGRAD) |
Convert the 'y' direction distance of a cubed-sphere grid point to the corresponding distance in latitude. More... | |
real function | get_lon_angle (dx, lat, DEGRAD) |
Convert the 'x' direction distance of a cubed-sphere grid point to the corresponding distance in longitude. More... | |
subroutine | get_mismatch_index (im_in, jm_in, geolon_in, geolat_in, bitmap_in, num_out, lon_out, lat_out, iindx, jindx) |
For unmapped land points, find the nearest land point on the input data and pass back its i/j index. More... | |
real function | get_xnsum (lon1, lat1, lon2, lat2, IMN, JMN, glat, zavg, zslm, delxn) |
Count the number of high-resolution orography points that are higher than the model grid box average orography height. More... | |
subroutine | get_xnsum2 (lon1, lat1, lon2, lat2, IMN, JMN, glat, zavg, delxn, xnsum1, xnsum2, HC) |
Count the number of high-resolution orography points that are higher than a critical value inside a model grid box (or a portion of a model grid box). More... | |
subroutine | get_xnsum3 (lon1, lat1, lon2, lat2, IMN, JMN, glat, zavg, delxn, xnsum1, xnsum2, HC) |
Count the number of high-resolution orography points that are higher than a critical value inside a model grid box (or a portion of a model grid box). More... | |
logical function | inside_a_polygon (lon1, lat1, npts, lon2, lat2) |
Check if a point is inside a polygon. More... | |
subroutine | interpolate_mismatch (im_in, jm_in, data_in, num_out, data_out, iindx, jindx) |
Replace unmapped model land points with the nearest land point on the input grid. More... | |
subroutine | latlon2xyz (siz, lon, lat, x, y, z) |
Convert from latitude and longitude to x,y,z coordinates. More... | |
subroutine | make_mask (zslm, SLM, land_frac, GLAT, IM, JM, IMN, JMN, lon_c, lat_c) |
Create the land-mask, land fraction. More... | |
subroutine | makemt (ZAVG, ZSLM, ORO, SLM, VAR, VAR4, GLAT, IST, IEN, JST, JEN, IM, JM, IMN, JMN, XLAT, numi) |
Create the orography, land-mask, standard deviation of orography and the convexity on a model gaussian grid. More... | |
subroutine | makemt2 (ZAVG, ZSLM, ORO, SLM, VAR, VAR4, GLAT, IM, JM, IMN, JMN, lon_c, lat_c, lake_frac, land_frac) |
Create the orography, land-mask, land fraction, standard deviation of orography and the convexity on a model cubed-sphere tile. More... | |
subroutine | makeoa (ZAVG, VAR, GLAT, OA4, OL, IOA4, ELVMAX, ORO, oro1, XNSUM, XNSUM1, XNSUM2, XNSUM3, XNSUM4, IST, IEN, JST, JEN, IM, JM, IMN, JMN, XLAT, numi) |
Create orographic asymmetry and orographic length scale on the model grid. More... | |
subroutine | makeoa2 (ZAVG, zslm, VAR, GLAT, OA4, OL, IOA4, ELVMAX, ORO, oro1, XNSUM, XNSUM1, XNSUM2, XNSUM3, XNSUM4, 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 | makeoa3 (ZAVG, VAR, GLAT, OA4, OL, IOA4, ELVMAX, ORO, SLM, oro1, XNSUM, XNSUM1, XNSUM2, XNSUM3, XNSUM4, IM, JM, IMN, JMN, lon_c, lat_c, lon_t, lat_t, IMI, JMI, OA_IN, OL_IN, slm_in, lon_in, lat_in) |
Create orographic asymmetry and orographic length scale on the model grid. More... | |
subroutine | makepc (ZAVG, ZSLM, THETA, GAMMA, SIGMA, GLAT, IST, IEN, JST, JEN, IM, JM, IMN, JMN, XLAT, numi) |
Make the principle coordinates - slope of orography, anisotropy, angle of mountain range with respect to east. More... | |
subroutine | makepc2 (ZAVG, ZSLM, THETA, GAMMA, SIGMA, GLAT, 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 | maxmin (ia, len, tile) |
Print the maximum, mininum, mean and standard deviation of an array. More... | |
subroutine | minmaxj (IM, JM, A, title) |
Print out the maximum and minimum values of an array and their i/j location. More... | |
subroutine | minmxj (IM, JM, A, title) |
Print out the maximum and minimum values of an array. More... | |
subroutine | mnmxja (IM, JM, A, imax, jmax, title) |
Print out the maximum and minimum values of an array. More... | |
subroutine | read_g (glob) |
Read input global 30-arc second orography data. More... | |
real function | spherical_angle (v1, v2, v3) |
Compute spherical angle. More... | |
real function | spherical_distance (theta1, phi1, theta2, phi2) |
Compute a great circle distance between two points. More... | |
subroutine | tersub (IMN, JMN, IM, JM, NM, NR, NF0, NF1, NW, EFAC, OUTGRID, INPUTOROG, MASK_ONLY, MERGE_FILE) |
Driver routine to compute terrain. More... | |
real function | timef () |
Get the date/time for the system clock. More... | |
program __mtnlm7_oclsm.f__ | ( | ) |
This program creates 7 terrain-related files computed from the GMTED2010 terrain dataset.
The model physics grid parameters and spectral truncation and filter parameters are read by this program as input.
The 7 files produced are:
The orography is only filtered for wavenumbers greater than nf0. For wavenumbers n between nf0 and nf1, the orography is filtered by the factor 1-((n-nf0)/(nf1-nf0))**2. The filtered orography will not have information beyond wavenumber nf1.
PROGRAM HISTORY LOG:
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 Quadratic filter applied by default. NF0 is normally set to an even value beyond the previous truncation, for example, for jcap=382, NF0=254+2 NF1 is set as jcap+2 (and/or nearest even), eg., for t382, NF1=382+2=384 if no filter is desired then NF1=NF0=0 and ORF=ORO but if no filter but spectral to grid (with gibbs) then NF1=jcap+2, and NF1=jcap+1
INPUT FILES:
UNIT57 - GRIB GRIDDED OROGRAPHY (IM,JM)
SUBPROGRAMS CALLED:
Definition at line 74 of file mtnlm7_oclsm.F.
References netcdf_err(), and tersub().
subroutine get_index | ( | integer, intent(in) | IMN, |
integer, intent(in) | JMN, | ||
integer | npts, | ||
real, dimension(npts), intent(in) | lonO, | ||
real, dimension(npts), intent(in) | latO, | ||
real, intent(in) | DELXN, | ||
integer, intent(out) | jst, | ||
integer, intent(out) | jen, | ||
integer, dimension(imn), intent(out) | ilist, | ||
integer, intent(out) | numx | ||
) |
Determine the location of a cubed-sphere point within the high-resolution orography data.
The location is described by the range of i/j indices on the high-res grid.
[in] | imn | 'i' dimension of the high-resolution orography data set. |
[in] | jmn | 'j' dimension of the high-resolution orography data set. |
[in] | npts | Number of vertices to describe the cubed-sphere point. |
[in] | lonO | The longitudes of the cubed-sphere vertices. |
[in] | latO | The latitudes of the cubed-sphere vertices. |
[in] | delxn | Resolution of the high-resolution orography data set. |
[out] | jst | Starting 'j' index on the high-resolution grid. |
[out] | jen | Ending 'j' index on the high-resolution grid. |
[out] | ilist | List of 'i' indices on the high-resolution grid. |
[out] | numx | The number of 'i' indices on the high-resolution grid. |
Definition at line 1482 of file mtnlm7_oclsm.F.
Referenced by make_mask(), makemt2(), makeoa2(), makeoa3(), and makepc2().
real function get_lat_angle | ( | real | dy, |
real | DEGRAD | ||
) |
Convert the 'y' direction distance of a cubed-sphere grid point to the corresponding distance in latitude.
[in] | dy | Distance along the 'y' direction of a cubed-sphere point. |
[in] | degrad | Conversion from radians to degrees. |
Definition at line 2830 of file mtnlm7_oclsm.F.
real function get_lon_angle | ( | real | dx, |
real | lat, | ||
real | DEGRAD | ||
) |
Convert the 'x' direction distance of a cubed-sphere grid point to the corresponding distance in longitude.
[in] | dx | Distance along the 'x' direction of a cubed-sphere grid point. |
[in] | lat | Latitude of the cubed-sphere point. |
[in] | degrad | Conversion from radians to degrees. |
Definition at line 2811 of file mtnlm7_oclsm.F.
subroutine get_mismatch_index | ( | integer, intent(in) | im_in, |
integer, intent(in) | jm_in, | ||
real, dimension(im_in,jm_in), intent(in) | geolon_in, | ||
real, dimension(im_in,jm_in), intent(in) | geolat_in, | ||
logical*1, dimension(im_in,jm_in), intent(in) | bitmap_in, | ||
integer, intent(in) | num_out, | ||
real, dimension(num_out), intent(in) | lon_out, | ||
real, dimension(num_out), intent(in) | lat_out, | ||
integer, dimension(num_out), intent(out) | iindx, | ||
integer, dimension(num_out), intent(out) | jindx | ||
) |
For unmapped land points, find the nearest land point on the input data and pass back its i/j index.
[in] | im_in | 'i' dimension of input data. |
[in] | jm_in | 'j' dimension of input data. |
[in] | geolon_in | Longitude of input data. |
[in] | geolat_in | Latitude of input data. |
[in] | bitmap_in | Bitmap (mask) of input data. |
[in] | num_out | Number of unmapped points. |
[in] | lon_out | Longitude of unmapped points. |
[in] | lat_out | Latitude of unmapped points. |
[out] | iindx | 'i' indices of nearest land points on the input data. |
[out] | jindx | 'j' indices of nearest land points on the input data. |
Definition at line 3306 of file mtnlm7_oclsm.F.
References spherical_distance().
Referenced by makeoa3().
real function get_xnsum | ( | real, intent(in) | lon1, |
real, intent(in) | lat1, | ||
real, intent(in) | lon2, | ||
real, intent(in) | lat2, | ||
integer, intent(in) | IMN, | ||
integer, intent(in) | JMN, | ||
real, dimension(jmn), intent(in) | glat, | ||
integer, dimension(imn,jmn), intent(in) | zavg, | ||
integer, dimension(imn,jmn), intent(in) | zslm, | ||
real, intent(in) | delxn | ||
) |
Count the number of high-resolution orography points that are higher than the model grid box average orography height.
[in] | lon1 | Longitude of corner point 1 of the model grid box. |
[in] | lat1 | Latitude of corner point 1 of the model grid box. |
[in] | lon2 | Longitude of corner point 2 of the model grid box. |
[in] | lat2 | Latitude of corner point 2 of the model grid box. |
[in] | imn | 'i' dimension of the high-resolution orography data. |
[in] | jmn | 'j' dimension of the high-resolution orography data. |
[in] | glat | Latitude of each row of the high-resolution orography data. |
[in] | zavg | The high-resolution orography. |
[in] | zslm | The high-resolution land mask. |
[in] | delxn | Resolution of the high-res orography data. |
Definition at line 4209 of file mtnlm7_oclsm.F.
subroutine get_xnsum2 | ( | real | lon1, |
real | lat1, | ||
real | lon2, | ||
real | lat2, | ||
integer | IMN, | ||
integer | JMN, | ||
real, dimension(jmn) | glat, | ||
integer, dimension(imn,jmn) | zavg, | ||
real | delxn, | ||
real, intent(out) | xnsum1, | ||
real, intent(out) | xnsum2, | ||
real, intent(out) | HC | ||
) |
Count the number of high-resolution orography points that are higher than a critical value inside a model grid box (or a portion of a model grid box).
The critical value is a function of the standard deviation of orography.
[in] | lon1 | Longitude of corner point 1 of the model grid box. |
[in] | lat1 | Latitude of corner point 1 of the model grid box. |
[in] | lon2 | Longitude of corner point 2 of the model grid box. |
[in] | lat2 | Latitude of corner point 2 of the model grid box. |
[in] | imn | 'i' dimension of the high-resolution orography data. |
[in] | jmn | 'j' dimension of the high-resolution orography data. |
[in] | glat | Latitude of each row of the high-resolution orography data. |
[in] | zavg | The high-resolution orography. |
[in] | delxn | Resolution of the high-res orography data. |
[out] | xnsum1 | The number of high-resolution orography above the critical value inside a model grid box. |
[out] | xnsum2 | The number of high-resolution orography points inside a model grid box. |
[out] | hc | Critical height. |
Definition at line 4312 of file mtnlm7_oclsm.F.
Referenced by makeoa2().
subroutine get_xnsum3 | ( | real | lon1, |
real | lat1, | ||
real | lon2, | ||
real | lat2, | ||
integer | IMN, | ||
integer | JMN, | ||
real, dimension(jmn) | glat, | ||
integer, dimension(imn,jmn) | zavg, | ||
real | delxn, | ||
real, intent(out) | xnsum1, | ||
real, intent(out) | xnsum2, | ||
real | HC | ||
) |
Count the number of high-resolution orography points that are higher than a critical value inside a model grid box (or a portion of a model grid box).
Unlike routine get_xnsum2(), this routine does not compute the critical value. Rather, it is passed in.
[in] | lon1 | Longitude of corner point 1 of the model grid box. |
[in] | lat1 | Latitude of corner point 1 of the model grid box. |
[in] | lon2 | Longitude of corner point 2 of the model grid box. |
[in] | lat2 | Latitude of corner point 2 of the model grid box. |
[in] | imn | 'i' dimension of the high-resolution orography data. |
[in] | jmn | 'j' dimension of the high-resolution orography data. |
[in] | glat | Latitude of each row of the high-resolution orography data. |
[in] | zavg | The high-resolution orography. |
[in] | delxn | Resolution of the high-res orography data. |
[out] | xnsum1 | The number of high-resolution orography above the critical value inside a model grid box. |
[out] | xnsum2 | The number of high-resolution orography points inside a model grid box. |
[in] | hc | Critical height. |
Definition at line 4405 of file mtnlm7_oclsm.F.
Referenced by makeoa2().
logical function inside_a_polygon | ( | real | lon1, |
real | lat1, | ||
integer | npts, | ||
real, dimension(npts) | lon2, | ||
real, dimension(npts) | lat2 | ||
) |
Check if a point is inside a polygon.
[in] | lon1 | Longitude of the point to check. |
[in] | lat1 | Latitude of the point to check. |
[in] | npts | Number of polygon vertices. |
[in] | lon2 | Longitude of the polygon vertices. |
[in] | lat2 | Latitude of the polygon vertices. |
Definition at line 4113 of file mtnlm7_oclsm.F.
References latlon2xyz(), and spherical_angle().
subroutine interpolate_mismatch | ( | integer, intent(in) | im_in, |
integer, intent(in) | jm_in, | ||
real, dimension(im_in,jm_in), intent(in) | data_in, | ||
integer, intent(in) | num_out, | ||
real, dimension(num_out), intent(out) | data_out, | ||
integer, dimension(num_out), intent(in) | iindx, | ||
integer, dimension(num_out), intent(in) | jindx | ||
) |
Replace unmapped model land points with the nearest land point on the input grid.
[in] | im_in | 'i' dimension of input grid. |
[in] | jm_in | 'j' dimension of input grid. |
[in] | data_in | Input grid data. |
[in] | num_out | Number of unmapped model points. |
[out] | data_out | Data on the model tile. |
[in] | iindx | 'i' indices of the nearest land points on the input grid. |
[in] | jindx | 'j' indices of the nearest land points on the input grid. |
Definition at line 3388 of file mtnlm7_oclsm.F.
Referenced by makeoa3().
subroutine latlon2xyz | ( | integer, intent(in) | siz, |
real, dimension(siz), intent(in) | lon, | ||
real, dimension(siz), intent(in) | lat, | ||
real, dimension(siz), intent(out) | x, | ||
real, dimension(siz), intent(out) | y, | ||
real, dimension(siz), intent(out) | z | ||
) |
Convert from latitude and longitude to x,y,z coordinates.
[in] | siz | Number of points to convert. |
[in] | lon | Longitude of points to convert. |
[in] | lat | Latitude of points to convert. |
[out] | x | 'x' coordinate of the converted points. |
[out] | y | 'y' coordinate of the converted points. |
[out] | z | 'z' coordinate of the converted points. |
Definition at line 4041 of file mtnlm7_oclsm.F.
Referenced by inside_a_polygon().
subroutine make_mask | ( | integer, dimension(imn,jmn) | zslm, |
real, dimension(im,jm) | SLM, | ||
real, dimension(im,jm) | land_frac, | ||
real, dimension(jmn) | GLAT, | ||
integer | IM, | ||
integer | JM, | ||
integer | IMN, | ||
integer | JMN, | ||
real, dimension(im+1,jm+1) | lon_c, | ||
real, dimension(im+1,jm+1) | lat_c | ||
) |
Create the land-mask, land fraction.
This routine is used for the FV3GFS model.
[in] | zslm | The high-resolution input land-mask dataset. |
[out] | slm | Land-mask on the model tile. |
[out] | land_frac | Land fraction on the model tile. |
[out] | glat | Latitude of each row of the high-resolution orography and land-mask datasets. |
[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_c | Longitude of the model grid corner points. |
[in] | lat_c | Latitude on the model grid corner points. |
Definition at line 1571 of file mtnlm7_oclsm.F.
References get_index().
Referenced by tersub().
subroutine makemt | ( | integer, dimension(imn,jmn) | ZAVG, |
integer, dimension(imn,jmn) | ZSLM, | ||
dimension(im,jm) | ORO, | ||
dimension(im,jm) | SLM, | ||
dimension(im,jm) | VAR, | ||
dimension(im,jm) | VAR4, | ||
dimension(jmn) | GLAT, | ||
dimension(im,jm) | IST, | ||
dimension(im,jm) | IEN, | ||
dimension(jm) | JST, | ||
dimension(jm) | JEN, | ||
IM, | |||
JM, | |||
IMN, | |||
JMN, | |||
dimension(jm) | XLAT, | ||
dimension(jm) | numi | ||
) |
Create the orography, land-mask, standard deviation of orography and the convexity on a model gaussian grid.
This routine was used for the spectral GFS model.
[in] | zavg | The high-resolution input orography dataset. |
[in] | zslm | The high-resolution input land-mask dataset. |
[out] | oro | Orography on the model grid. |
[out] | slm | Land-mask on the model grid. |
[out] | var | Standard deviation of orography on the model grid. |
[out] | var4 | Convexity on the model grid. |
[out] | glat | Latitude of each row of the high-resolution orography and land-mask datasets. |
[out] | ist | This is the 'i' index of high-resolution data set at the east edge of the model grid cell. the high-resolution dataset with respect to the 'east' edge |
[out] | ien | This is the 'i' index of high-resolution data set at the west edge of the model grid cell. |
[out] | jst | This is the 'j' index of high-resolution data set at the south edge of the model grid cell. |
[out] | jen | This is the 'j' index of high-resolution data set at the north edge of the model grid cell. |
[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 dataset. |
[in] | jmn | "j" dimension of the hi-res input orog/mask dataset. |
[in] | xlat | The latitude of each row of the model grid. |
[in] | numi | For reduced gaussian grids, the number of 'i' points for each 'j' row. |
Definition at line 1321 of file mtnlm7_oclsm.F.
Referenced by tersub().
subroutine makemt2 | ( | integer, dimension(imn,jmn) | ZAVG, |
integer, dimension(imn,jmn) | ZSLM, | ||
real, dimension(im,jm) | ORO, | ||
real, dimension(im,jm), intent(in) | SLM, | ||
real, dimension(im,jm) | VAR, | ||
real, dimension(im,jm) | VAR4, | ||
real, dimension(jmn) | GLAT, | ||
integer | IM, | ||
integer | JM, | ||
integer | IMN, | ||
integer | JMN, | ||
real, dimension(im+1,jm+1) | lon_c, | ||
real, dimension(im+1,jm+1) | lat_c, | ||
real, dimension(im,jm), intent(in) | lake_frac, | ||
real, dimension(im,jm), intent(in) | land_frac | ||
) |
Create the orography, land-mask, land fraction, standard deviation of orography and the convexity on a model cubed-sphere tile.
This routine is used for the FV3GFS model.
[in] | zavg | The high-resolution input orography dataset. |
[in] | zslm | The high-resolution input land-mask dataset. |
[out] | oro | Orography on the model tile. |
[in] | slm | Land-mask on the model tile. |
[out] | var | Standard deviation of orography on the model tile. |
[out] | var4 | Convexity on the model tile. |
[out] | glat | Latitude of each row of the high-resolution orography and land-mask datasets. |
[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_c | Longitude of the model grid corner points. |
[in] | lat_c | Latitude on the model grid corner points. |
[in] | lake_frac | Fractional lake within the grid |
[in] | land_frac | Fractional land within the grid |
Definition at line 1706 of file mtnlm7_oclsm.F.
References get_index().
Referenced by tersub().
subroutine makeoa | ( | integer, dimension(imn,jmn) | ZAVG, |
dimension(im,jm) | VAR, | ||
dimension(jmn) | GLAT, | ||
dimension(im,jm,4) | OA4, | ||
dimension(im,jm,4) | OL, | ||
dimension(im,jm,4) | IOA4, | ||
dimension(im,jm) | ELVMAX, | ||
dimension(im,jm) | ORO, | ||
dimension(im,jm) | oro1, | ||
dimension(im,jm) | XNSUM, | ||
dimension(im,jm) | XNSUM1, | ||
dimension(im,jm) | XNSUM2, | ||
dimension(im,jm) | XNSUM3, | ||
dimension(im,jm) | XNSUM4, | ||
dimension(im,jm) | IST, | ||
dimension(im,jm) | IEN, | ||
dimension(jm) | JST, | ||
dimension(jm) | JEN, | ||
IM, | |||
JM, | |||
IMN, | |||
JMN, | |||
dimension(jm) | XLAT, | ||
dimension(jm) | numi | ||
) |
Create orographic asymmetry and orographic length scale on the model grid.
This routine is used for the spectral GFS gaussian grid.
[in] | zavg | The high-resolution input orography dataset. |
[in] | var | Standard deviation of orography on the model grid. |
[out] | glat | Latitude of each row of input terrain dataset. |
[out] | oa4 | Orographic asymmetry on the model grid. Four directional components - W/S/SW/NW |
[out] | ol | Orographic length scale on the model grid. Four directional components - W/S/SW/NW |
[out] | ioa4 | Count of oa4 values between certain thresholds. |
[out] | elvmax | Maximum elevation on the model grid. |
[in] | oro | Orography on the model grid. |
[out] | oro1 | Save array for model grid orography. |
[out] | xnsum | Number of high-resolution orography points higher than the model grid box average. |
[out] | xnsum1 | Number of high-resolution orography points higher than the critical height. |
[out] | xnsum2 | Total number of high-resolution orography points within a model grid box. |
[out] | xnsum3 | Same as xnsum1, except shifted by half a model grid box. |
[out] | xnsum4 | Same as xnsum2, except shifted by half a model grid box. |
[out] | ist | This is the 'i' index of high-resolution data set at the east edge of the model grid cell. |
[out] | ien | This is the 'i' index of high-resolution data set at the west edge of the model grid cell. |
[out] | jst | This is the 'j' index of high-resolution data set at the south edge of the model grid cell. |
[out] | jen | This is the 'j' index of high-resolution data set at the north edge of the model grid cell. |
[in] | im | "i" dimension of the model grid. |
[in] | jm | "j" dimension of the model grid. |
[in] | imn | "i" dimension of the input terrain dataset. |
[in] | jmn | "j" dimension of the input terrain dataset. |
[in] | xlat | The latitude of each row of the model grid. |
[in] | numi | For reduced gaussian grids, the number of 'i' points for each 'j' row. |
Definition at line 2485 of file mtnlm7_oclsm.F.
Referenced by tersub().
subroutine makeoa2 | ( | integer, dimension(imn,jmn) | ZAVG, |
integer, dimension(imn,jmn) | zslm, | ||
real, dimension(im,jm) | VAR, | ||
real, dimension(jmn) | GLAT, | ||
real, dimension(im,jm,4) | OA4, | ||
real, dimension(im,jm,4) | OL, | ||
integer, dimension(im,jm,4) | IOA4, | ||
real, dimension(im,jm) | ELVMAX, | ||
real, dimension(im,jm) | ORO, | ||
real, dimension(im,jm) | oro1, | ||
real, dimension(im,jm) | XNSUM, | ||
real, dimension(im,jm) | XNSUM1, | ||
real, dimension(im,jm) | XNSUM2, | ||
real, dimension(im,jm) | XNSUM3, | ||
real, dimension(im,jm) | XNSUM4, | ||
integer | IM, | ||
integer | JM, | ||
integer | IMN, | ||
integer | JMN, | ||
real, dimension(im+1,jm+1) | lon_c, | ||
real, dimension(im+1,jm+1) | lat_c, | ||
real, dimension(im,jm) | lon_t, | ||
real, dimension(im,jm) | lat_t, | ||
real, dimension(im,jm) | dx, | ||
real, dimension(im,jm) | dy, | ||
logical, dimension(im,jm) | is_south_pole, | ||
logical, dimension(im,jm) | is_north_pole | ||
) |
Create orographic asymmetry and orographic length scale on the model grid.
This routine is used for the cubed-sphere grid.
[in] | zavg | High-resolution orography data. |
[in] | zslm | High-resolution land-mask data. |
[in] | var | Standard deviation of orography on the model grid. |
[out] | glat | Latitude of each row of input terrain dataset. |
[out] | oa4 | Orographic asymmetry on the model grid. Four directional components - W/S/SW/NW |
[out] | ol | Orographic length scale on the model grid. Four directional components - W/S/SW/NW |
[out] | ioa4 | Count of oa4 values between certain thresholds. |
[out] | elvmax | Maximum elevation within a model grid box. |
[in] | oro | Orography on the model grid. |
[out] | oro1 | Save array for model grid orography. |
[out] | xnsum | Not used. |
[out] | xnsum1 | Not used. |
[out] | xnsum2 | Not used. |
[out] | xnsum3 | Not used. |
[out] | xnsum4 | Not used. |
[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_c | Corner point longitudes of the model grid points. |
[in] | lat_c | Corner point latitudes of the model grid points. |
[in] | lon_t | Center point longitudes of the model grid points. |
[in] | lat_t | Center point latitudes of the model grid points. |
[in] | dx | Length of model grid points in the 'x' direction. |
[in] | dy | Length of model grid points in the 'y' direction. |
[in] | is_south_pole | Is the model point at the south pole? |
[in] | is_north_pole | is the model point at the north pole? |
Definition at line 2880 of file mtnlm7_oclsm.F.
References get_index(), get_xnsum2(), and get_xnsum3().
Referenced by tersub().
subroutine makeoa3 | ( | integer, dimension(imn,jmn) | ZAVG, |
real, dimension(im,jm) | VAR, | ||
real, dimension(jmn) | GLAT, | ||
real, dimension(im,jm,4) | OA4, | ||
real, dimension(im,jm,4) | OL, | ||
integer, dimension(im,jm,4) | IOA4, | ||
real, dimension(im,jm) | ELVMAX, | ||
real, dimension(im,jm) | ORO, | ||
real, dimension(im,jm) | SLM, | ||
real, dimension(im,jm) | oro1, | ||
real, dimension(im,jm) | XNSUM, | ||
real, dimension(im,jm) | XNSUM1, | ||
real, dimension(im,jm) | XNSUM2, | ||
real, dimension(im,jm) | XNSUM3, | ||
real, dimension(im,jm) | XNSUM4, | ||
integer | IM, | ||
integer | JM, | ||
integer | IMN, | ||
integer | JMN, | ||
real, dimension(im+1,jm+1) | lon_c, | ||
real, dimension(im+1,jm+1) | lat_c, | ||
real, dimension(im,jm) | lon_t, | ||
real, dimension(im,jm) | lat_t, | ||
integer | IMI, | ||
integer | JMI, | ||
real, dimension(imi,jmi,4) | OA_IN, | ||
real, dimension(imi,jmi,4) | OL_IN, | ||
real, dimension(imi,jmi) | slm_in, | ||
real, dimension(imi,jmi) | lon_in, | ||
real, dimension(imi,jmi) | lat_in | ||
) |
Create orographic asymmetry and orographic length scale on the model grid.
This routine is used for the cubed-sphere grid. The asymmetry and length scales are interpolated from an existing gfs orography file. The maximum elevation is computed from the high-resolution orography data.
[in] | zavg | High-resolution orography data. |
[in] | var | Standard deviation of orography on the model grid. |
[out] | glat | Latitude of each row of input terrain dataset. |
[out] | oa4 | Orographic asymmetry on the model grid. Four directional components - W/S/SW/NW |
[out] | ol | Orographic length scale on the model grid. Four directional components - W/S/SW/NW |
[out] | ioa4 | Count of oa4 values between certain thresholds. |
[out] | elvmax | Maximum elevation within a model grid box. |
[in] | slm | Land-mask on model grid. |
[in] | oro | Orography on the model grid. |
[out] | oro1 | Save array for model grid orography. |
[in] | xnsum | Not used. |
[in] | xnsum1 | Not used. |
[in] | xnsum2 | Not used. |
[in] | xnsum3 | Not used. |
[in] | xnsum4 | Not used. |
[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_c | Corner point longitudes of the model grid points. |
[in] | lat_c | Corner point latitudes of the model grid points. |
[in] | lon_t | Center point longitudes of the model grid points. |
[in] | lat_t | Center point latitudes of the model grid points. |
[in] | imi | 'i' dimension of input gfs orography data. |
[in] | jmi | 'j' dimension of input gfs orography data. |
[in] | oa_in | Asymmetry on the input gfs orography data. |
[in] | ol_in | Length scales on the input gfs orography data. |
[in] | slm_in | Land-sea mask on the input gfs orography data. |
[in] | lon_in | Longitude on the input gfs orography data. |
[in] | lat_in | Latitude on the input gfs orography data. |
Definition at line 3445 of file mtnlm7_oclsm.F.
References get_index(), get_mismatch_index(), and interpolate_mismatch().
Referenced by tersub().
subroutine makepc | ( | integer, dimension(imn,jmn) | ZAVG, |
integer, dimension(imn,jmn) | ZSLM, | ||
dimension(im,jm) | THETA, | ||
dimension(im,jm) | GAMMA, | ||
dimension(im,jm) | SIGMA, | ||
dimension(jmn) | GLAT, | ||
dimension(im,jm) | IST, | ||
dimension(im,jm) | IEN, | ||
dimension(jm) | JST, | ||
dimension(jm) | JEN, | ||
IM, | |||
JM, | |||
IMN, | |||
JMN, | |||
dimension(jm) | XLAT, | ||
dimension(jm) | numi | ||
) |
Make the principle coordinates - slope of orography, anisotropy, angle of mountain range with respect to east.
This routine is used for spectral GFS gaussian grids.
[in] | zavg | The high-resolution input orography dataset. |
[in] | zslm | The high-resolution input land-mask dataset. |
[out] | theta | Angle of mountain range with respect to east for each model point. |
[out] | gamma | Anisotropy for each model point. |
[out] | sigma | Slope of orography for each model point. |
[out] | glat | Latitude of each row of the high-resolution orography and land-mask datasets. |
[out] | ist | This is the 'i' index of high-resolution data set at the east edge of the model grid cell. |
[out] | ien | This is the 'i' index of high-resolution data set at the west edge of the model grid cell. |
[out] | jst | This is the 'j' index of high-resolution data set at the south edge of the model grid cell. |
[out] | jen | This is the 'j' index of high-resolution data set at the north edge of the model grid cell. |
[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] | xlat | The latitude of each row of the model grid. |
[in] | numi | For reduced gaussian grids, the number of 'i' points for each 'j' row. |
Definition at line 1941 of file mtnlm7_oclsm.F.
Referenced by tersub().
subroutine makepc2 | ( | integer, dimension(imn,jmn) | ZAVG, |
integer, dimension(imn,jmn) | ZSLM, | ||
real, dimension(im,jm) | THETA, | ||
real, dimension(im,jm) | GAMMA, | ||
real, dimension(im,jm) | SIGMA, | ||
real, dimension(jmn) | GLAT, | ||
integer | IM, | ||
integer | JM, | ||
integer | IMN, | ||
integer | JMN, | ||
real, dimension(im+1,jm+1) | lon_c, | ||
real, dimension(im+1,jm+1) | 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.
[in] | zavg | The high-resolution input orography dataset. |
[in] | zslm | The high-resolution input land-mask dataset. |
[out] | theta | Angle of mountain range with respect to east for each model point. |
[out] | gamma | Anisotropy for each model point. |
[out] | sigma | Slope of orography for each model point. |
[out] | glat | Latitude of each row of the high-resolution orography and land-mask datasets. |
[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_c | Longitude of model grid corner points. |
[in] | lat_c | Latitude of the model grid corner points. |
[in] | SLM | mask |
Definition at line 2216 of file mtnlm7_oclsm.F.
References get_index().
Referenced by tersub().
subroutine maxmin | ( | integer*2, dimension(len) | ia, |
integer | len, | ||
character*7 | tile | ||
) |
Print the maximum, mininum, mean and standard deviation of an array.
[in] | ia | The array to be checked. |
[in] | len | The number of points to be checked. |
[in] | tile | A name associated with the array. |
Definition at line 3931 of file mtnlm7_oclsm.F.
Referenced by read_g().
subroutine minmaxj | ( | integer | IM, |
integer | JM, | ||
real(kind=4), dimension(im,jm) | A, | ||
character*8 | title | ||
) |
Print out the maximum and minimum values of an array and their i/j location.
Also print out the number of undefined points.
[in] | im | The 'i' dimension of the array. |
[in] | jm | The 'i' dimension of the array. |
[in] | a | The array to check. |
[in] | title | Name of the data to be checked. |
Definition at line 3989 of file mtnlm7_oclsm.F.
subroutine minmxj | ( | integer | IM, |
integer | JM, | ||
real, dimension(im,jm) | A, | ||
character*8 | title | ||
) |
Print out the maximum and minimum values of an array.
[in] | im | The 'i' dimension of the array. |
[in] | jm | The 'i' dimension of the array. |
[in] | a | The array to check. |
[in] | title | Name of the data to be checked. |
Definition at line 3831 of file mtnlm7_oclsm.F.
Referenced by tersub().
subroutine mnmxja | ( | integer | IM, |
integer | JM, | ||
real, dimension(im,jm) | A, | ||
integer | imax, | ||
integer | jmax, | ||
character*8 | title | ||
) |
Print out the maximum and minimum values of an array.
Pass back the i/j location of the maximum value.
[in] | im | The 'i' dimension of the array. |
[in] | jm | The 'i' dimension of the array. |
[in] | a | The array to check. |
[out] | imax | 'i' location of maximum |
[out] | jmax | 'j' location of maximum |
[in] | title | Name of the data to be checked. |
Definition at line 3866 of file mtnlm7_oclsm.F.
Referenced by tersub().
subroutine read_g | ( | integer*2, dimension(360*120,180*120), intent(out) | glob | ) |
Read input global 30-arc second orography data.
[out] | glob | The orography data. |
Definition at line 3898 of file mtnlm7_oclsm.F.
References maxmin(), and netcdf_err().
Referenced by tersub().
real function spherical_angle | ( | real, dimension(3) | v1, |
real, dimension(3) | v2, | ||
real, dimension(3) | v3 | ||
) |
Compute spherical angle.
[in] | v1 | Vector 1. |
[in] | v2 | Vector 2. |
[in] | v3 | Vector 3. |
Definition at line 4063 of file mtnlm7_oclsm.F.
Referenced by inside_a_polygon().
real function spherical_distance | ( | real, intent(in) | theta1, |
real, intent(in) | phi1, | ||
real, intent(in) | theta2, | ||
real, intent(in) | phi2 | ||
) |
Compute a great circle distance between two points.
[in] | theta1 | Longitude of point 1. |
[in] | phi1 | Latitude of point 1. |
[in] | theta2 | Longitude of point 2. |
[in] | phi2 | Latitude of point2. |
Definition at line 3270 of file mtnlm7_oclsm.F.
Referenced by get_mismatch_index().
subroutine tersub | ( | integer | IMN, |
integer | JMN, | ||
integer | IM, | ||
integer | JM, | ||
integer | NM, | ||
integer | NR, | ||
integer | NF0, | ||
integer | NF1, | ||
integer | NW, | ||
integer | EFAC, | ||
character(len=*), intent(in) | OUTGRID, | ||
character(len=*), intent(in) | INPUTOROG, | ||
logical, intent(in) | MASK_ONLY, | ||
character(len=*), intent(in) | MERGE_FILE | ||
) |
Driver routine to compute terrain.
[in] | IMN | "i" dimension of the input terrain dataset. |
[in] | JMN | "j" dimension of the input terrain dataset. |
[in] | IM | "i" dimension of the model grid tile. |
[in] | JM | "j" dimension of the model grid tile. |
[in] | NM | Spectral truncation. |
[in] | NR | Rhomboidal flag. |
[in] | NF0 | First order spectral filter parameters. |
[in] | NF1 | Second order spectral filter parameters. |
[in] | NW | Number of waves. |
[in] | EFAC | Factor to adjust orography by its variance. |
[in] | OUTGRID | The 'grid' file for the model tile. |
[in] | INPUTOROG | Input orography/GWD file on gaussian grid. When specified, will be interpolated to model tile. When not specified, program will create fields from raw high-resolution topography data. |
[in] | MASK_ONLY | Flag to generate the Land Mask only |
[in] | MERGE_FILE | Ocean merge file |
Definition at line 167 of file mtnlm7_oclsm.F.
References lake_frac(), make_mask(), makemt(), makemt2(), makeoa(), makeoa2(), makeoa3(), makepc(), makepc2(), minmxj(), mnmxja(), netcdf_err(), read_g(), read_mask(), timef(), write_mask_netcdf(), and write_netcdf().
Referenced by __mtnlm7_oclsm.f__().
real function timef | ( | ) |
Get the date/time for the system clock.
Definition at line 4456 of file mtnlm7_oclsm.F.
Referenced by tersub().