orog_mask_tools
1.13.0
|
Module containing utilites used by the orog program. More...
Functions/Subroutines | |
subroutine, public | find_nearest_pole_points (i_north_pole, j_north_pole, i_south_pole, j_south_pole, im, jm, is_north_pole, is_south_pole) |
Find the point on the model grid tile closest to the north and south pole. More... | |
subroutine, public | find_poles (geolat, nx, ny, i_north_pole, j_north_pole, i_south_pole, j_south_pole) |
Find the point on the model grid tile closest to the north and south pole. More... | |
subroutine, public | 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, public | get_lat_angle (dy) |
Convert the 'y' direction distance of a cubed-sphere grid point to the corresponding distance in latitude. More... | |
real function, public | get_lon_angle (dx, lat_in) |
Convert the 'x' direction distance of a cubed-sphere grid point to the corresponding distance in longitude. More... | |
real function, public | 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, public | 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, public | 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, public | inside_a_polygon (lon1, lat1, npts, lon2, lat2) |
Check if a point is inside a polygon. More... | |
subroutine, public | latlon2xyz (siz, lon, lat, x, y, z) |
Convert from latitude and longitude to x,y,z coordinates. More... | |
subroutine, public | minmax (im, jm, a, title, imax, jmax) |
Print out the maximum and minimum values of an array and optionally pass back the i/j location of the maximum. More... | |
subroutine, public | remove_isolated_pts (im, jm, slm, oro, var, var4, oa, ol) |
Remove isolated model points. More... | |
real function | spherical_angle (v1, v2, v3) |
Compute spherical angle. More... | |
real function, public | timef () |
Get the date/time from the system clock. More... | |
subroutine, public | transpose_mask (imn, jmn, mask) |
Transpose the global landmask by flipping the poles and moving the starting longitude to Greenwich. More... | |
subroutine, public | transpose_orog (imn, jmn, glob) |
Transpose the global orography data by flipping the poles and moving the starting longitude to Greenwich. More... | |
Variables | |
real, parameter | deg2rad = 3.14159265358979/180. |
degrees per radians. More... | |
real, parameter | earth_radius = 6371200. |
earth radius in meters. More... | |
real, parameter | pi =3.1415926535897931 |
pi. More... | |
real, parameter | rad2deg = 180./3.14159265358979 |
radians per degrees. More... | |
Module containing utilites used by the orog program.
subroutine, public orog_utils::find_nearest_pole_points | ( | integer, intent(in) | i_north_pole, |
integer, intent(in) | j_north_pole, | ||
integer, intent(in) | i_south_pole, | ||
integer, intent(in) | j_south_pole, | ||
integer, intent(in) | im, | ||
integer, intent(in) | jm, | ||
logical, dimension(im,jm), intent(out) | is_north_pole, | ||
logical, dimension(im,jm), intent(out) | is_south_pole | ||
) |
Find the point on the model grid tile closest to the north and south pole.
[in] | i_north_pole | 'i' index of north pole. '0' if pole is outside of grid. |
[in] | j_north_pole | 'j' index of north pole. '0' if pole is outside of grid. |
[in] | i_south_pole | 'i' index of south pole. '0' if pole is outside of grid. |
[in] | j_south_pole | 'j' index of south pole. '0' if pole is outside of grid. |
[in] | im | i-dimension of model tile |
[in] | jm | j-dimension of model tile |
[out] | is_north_pole | 'true' for points surrounding the north pole. |
[out] | is_south_pole | 'true' for points surrounding the south pole. |
Definition at line 487 of file orog_utils.F90.
Referenced by io_utils::read_mdl_grid_file().
subroutine, public orog_utils::find_poles | ( | real, dimension(nx+1,ny+1), intent(in) | geolat, |
integer, intent(in) | nx, | ||
integer, intent(in) | ny, | ||
integer, intent(out) | i_north_pole, | ||
integer, intent(out) | j_north_pole, | ||
integer, intent(out) | i_south_pole, | ||
integer, intent(out) | j_south_pole | ||
) |
Find the point on the model grid tile closest to the north and south pole.
[in] | geolat | Latitude on the supergrid. |
[in] | nx | i-dimension of the supergrid. |
[in] | ny | j-dimension of the supergrid. |
[out] | i_north_pole | 'i' index of north pole. '0' if pole is outside of grid. |
[out] | j_north_pole | 'j' index of north pole. '0' if pole is outside of grid. |
[out] | i_south_pole | 'i' index of south pole. '0' if pole is outside of grid. |
[out] | j_south_pole | 'j' index of south pole. '0' if pole is outside of grid. |
Definition at line 411 of file orog_utils.F90.
Referenced by io_utils::read_mdl_grid_file().
subroutine, public orog_utils::get_index | ( | integer, intent(in) | imn, |
integer, intent(in) | jmn, | ||
integer, intent(in) | 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. Must range from 0 - 360. |
[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 691 of file orog_utils.F90.
Referenced by make_mask(), makemt2(), makeoa2(), and makepc2().
real function, public orog_utils::get_lat_angle | ( | real, intent(in) | dy | ) |
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 meters. |
Definition at line 128 of file orog_utils.F90.
References earth_radius, and rad2deg.
Referenced by makeoa2().
real function, public orog_utils::get_lon_angle | ( | real, intent(in) | dx, |
real, intent(in) | lat_in | ||
) |
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 meters. |
[in] | lat_in | Latitude of the cubed-sphere point in degrees. |
Definition at line 152 of file orog_utils.F90.
References deg2rad, earth_radius, and rad2deg.
Referenced by makeoa2().
real function, public orog_utils::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 793 of file orog_utils.F90.
Referenced by makeoa2().
subroutine, public orog_utils::get_xnsum2 | ( | 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, | ||
real, intent(in) | 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 904 of file orog_utils.F90.
Referenced by makeoa2().
subroutine, public orog_utils::get_xnsum3 | ( | 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, | ||
real, intent(in) | delxn, | ||
real, intent(out) | xnsum1, | ||
real, intent(out) | xnsum2, | ||
real, intent(in) | 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 1006 of file orog_utils.F90.
Referenced by makeoa2().
logical function, public orog_utils::inside_a_polygon | ( | real, intent(in) | lon1, |
real, intent(in) | lat1, | ||
integer, intent(in) | npts, | ||
real, dimension(npts), intent(in) | lon2, | ||
real, dimension(npts), intent(in) | 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 318 of file orog_utils.F90.
References latlon2xyz(), pi, and spherical_angle().
Referenced by make_mask(), makemt2(), makeoa2(), and makepc2().
subroutine, public orog_utils::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 (radians) of points to convert. |
[in] | lat | Latitude (radians) 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 101 of file orog_utils.F90.
Referenced by inside_a_polygon().
subroutine, public orog_utils::minmax | ( | integer, intent(in) | im, |
integer, intent(in) | jm, | ||
real, dimension(im,jm), intent(in) | a, | ||
character(len=8), intent(in) | title, | ||
integer, intent(out), optional | imax, | ||
integer, intent(out), optional | jmax | ||
) |
Print out the maximum and minimum values of an array and optionally pass back the i/j location of the maximum.
[in] | im | The 'i' dimension of the array. |
[in] | jm | The 'j' dimension of the array. |
[in] | a | The array to check. |
[in] | title | Name of the data to be checked. |
[out] | imax | The 'i' location of the maximum. |
[out] | jmax | The 'j' location of the maximum. |
Definition at line 50 of file orog_utils.F90.
Referenced by tersub().
subroutine, public orog_utils::remove_isolated_pts | ( | integer, intent(in) | im, |
integer, intent(in) | jm, | ||
real, dimension(im,jm), intent(inout) | slm, | ||
real, dimension(im,jm), intent(inout) | oro, | ||
real, dimension(im,jm), intent(inout) | var, | ||
real, dimension(im,jm), intent(inout) | var4, | ||
real, dimension(im,jm,4), intent(inout) | oa, | ||
real, dimension(im,jm,4), intent(inout) | ol | ||
) |
Remove isolated model points.
[in] | im | 'i' dimension of a model grid tile. |
[in] | jm | 'j' dimension of a model grid tile. |
[in,out] | slm | Land-mask on the model tile. |
[in,out] | oro | Orography on the model tile. |
[in,out] | var | Standard deviation of orography on the model tile. |
[in,out] | var4 | Convexity on the model tile. |
[in,out] | oa | Orographic asymmetry on the model tile. |
[in,out] | ol | Orographic length scale on the model tile. |
Definition at line 561 of file orog_utils.F90.
Referenced by tersub().
|
private |
Compute spherical angle.
[in] | v1 | Vector 1. |
[in] | v2 | Vector 2. |
[in] | v3 | Vector 3. |
Definition at line 262 of file orog_utils.F90.
References pi.
Referenced by inside_a_polygon().
real function, public orog_utils::timef | ( | ) |
Get the date/time from the system clock.
Definition at line 1064 of file orog_utils.F90.
Referenced by tersub().
subroutine, public orog_utils::transpose_mask | ( | integer, intent(in) | imn, |
integer, intent(in) | jmn, | ||
integer(1), dimension(imn,jmn), intent(inout) | mask | ||
) |
Transpose the global landmask by flipping the poles and moving the starting longitude to Greenwich.
[in] | imn | i-dimension of landmask data. |
[in] | jmn | j-dimension of landmask data. |
[in,out] | mask | The global landmask data. |
Definition at line 177 of file orog_utils.F90.
Referenced by io_utils::read_global_mask().
subroutine, public orog_utils::transpose_orog | ( | integer, intent(in) | imn, |
integer, intent(in) | jmn, | ||
integer(2), dimension(imn,jmn), intent(inout) | glob | ||
) |
Transpose the global orography data by flipping the poles and moving the starting longitude to Greenwich.
[in] | imn | i-dimension of orography data. |
[in] | jmn | j-dimension of orography data. |
[in,out] | glob | The global orography data. |
Definition at line 220 of file orog_utils.F90.
Referenced by io_utils::read_global_orog().
|
private |
|
private |
earth radius in meters.
Definition at line 14 of file orog_utils.F90.
Referenced by get_lat_angle(), and get_lon_angle().
|
private |
pi.
Definition at line 15 of file orog_utils.F90.
Referenced by inside_a_polygon(), and spherical_angle().
|
private |
radians per degrees.
Definition at line 16 of file orog_utils.F90.
Referenced by get_lat_angle(), and get_lon_angle().