Routines to determine and process grid dependencies in the multi-grid wave model. More...
Functions/Subroutines | |
| subroutine | scrip_wrapper (ID_SRC, ID_DST, MAPSTA_SRC, MAPST2_SRC, FLAGLL, GRIDSHIFT, L_MASTER, L_READ, L_TEST) |
| Compute grid information required by SCRIP. More... | |
| subroutine | get_scrip_info_unstructured (ID_GRD, GRID_CENTER_LON, GRID_CENTER_LAT, GRID_CORNER_LON, GRID_CORNER_LAT, GRID_MASK, GRID_DIMS, GRID_SIZE, GRID_CORNERS, GRID_RANK) |
| Compute grid arrays for scrip for a specific unstructured grid. More... | |
| subroutine | get_scrip_info_structured (ID_GRD, GRID_CENTER_LON, GRID_CENTER_LAT, GRID_CORNER_LON, GRID_CORNER_LAT, GRID_MASK, GRID_DIMS, GRID_SIZE, GRID_CORNERS, GRID_RANK) |
| Compute grid arrays needed for scrip for a specific structured grid. More... | |
| subroutine | get_scrip_info (ID_GRD, GRID_CENTER_LON, GRID_CENTER_LAT, GRID_CORNER_LON, GRID_CORNER_LAT, GRID_MASK, GRID_DIMS, GRID_SIZE, GRID_CORNERS, GRID_RANK) |
| Compute grid for scrip for a specific structured grid. More... | |
| subroutine | scrip_info_renormalization (GRID_CENTER_LON, GRID_CENTER_LAT, GRID_CORNER_LON, GRID_CORNER_LAT, GRID_MASK, GRID_DIMS, GRID_SIZE, GRID_CORNERS, GRID_RANK, CONV_DX, CONV_DY, OFFSET, GRIDSHIFT) |
| Rescale according to whether the grid is spherical or not. More... | |
| subroutine | triang_indexes (I, INEXT, IPREV) |
| Desc not available. More... | |
| subroutine | get_unstructured_vertex_degree (MNP, MNE, TRIGP, TRIGINCD) |
| This function returns the list of incidences. More... | |
| subroutine | get_boundary (MNP, MNE, TRIGP, IOBP, NEIGHBOR_PREV, NEIGHBOR_NEXT) |
| Returns neighbor of a boundary node. More... | |
| subroutine | fix_periodcity (PT) |
| Adjust element longitude coordinates for elements straddling the dateline with distance of ~360 degrees. More... | |
Routines to determine and process grid dependencies in the multi-grid wave model.
| subroutine wmscrpmd::fix_periodcity | ( | real*8, dimension(3,2), intent(inout) | PT | ) |
Adjust element longitude coordinates for elements straddling the dateline with distance of ~360 degrees.
Detect if element has nodes on both sides of dateline and adjust coordinates so that all nodes have the same sign.
| [in,out] | PT |
Definition at line 1711 of file wmscrpmd.F90.
Referenced by get_scrip_info(), and get_scrip_info_unstructured().
| subroutine wmscrpmd::get_boundary | ( | integer, intent(in) | MNP, |
| integer, intent(in) | MNE, | ||
| integer, dimension(3,mne), intent(in) | TRIGP, | ||
| integer, dimension(mnp), intent(inout) | IOBP, | ||
| integer, dimension(mnp), intent(inout) | NEIGHBOR_PREV, | ||
| integer, dimension(mnp), intent(inout) | NEIGHBOR_NEXT | ||
| ) |
Returns neighbor of a boundary node.
If a node belong to a boundary, the function returns the neighbor of this point on one side. If the point is interior then the value 0 is set.
| [in] | MNP | Number of nodes. |
| [in] | MNE | Number of triangles. |
| [in] | TRIGP | List of nodes. |
| [in,out] | IOBP | |
| [in,out] | NEIGHBOR_PREV | |
| [in,out] | NEIGHBOR_NEXT |
Definition at line 1502 of file wmscrpmd.F90.
References w3servmd::extcde(), and triang_indexes().
Referenced by get_scrip_info_unstructured().
| subroutine wmscrpmd::get_scrip_info | ( | integer, intent(in) | ID_GRD, |
| real*8, dimension(:), intent(out), allocatable | GRID_CENTER_LON, | ||
| real*8, dimension(:), intent(out), allocatable | GRID_CENTER_LAT, | ||
| real*8, dimension(:,:), intent(out), allocatable | GRID_CORNER_LON, | ||
| real*8, dimension(:,:), intent(out), allocatable | GRID_CORNER_LAT, | ||
| logical, dimension(:), intent(out), allocatable | GRID_MASK, | ||
| integer, dimension(:), intent(out), allocatable | GRID_DIMS, | ||
| integer, intent(out) | GRID_SIZE, | ||
| integer, intent(out) | GRID_CORNERS, | ||
| integer, intent(out) | GRID_RANK | ||
| ) |
Compute grid for scrip for a specific structured grid.
This is adapted from Erick Rogers code by making it cleaner.
| [in] | ID_GRD | |
| [out] | GRID_CENTER_LON | |
| [out] | GRID_CENTER_LAT | |
| [out] | GRID_CORNER_LON | |
| [out] | GRID_CORNER_LAT | |
| [out] | GRID_MASK | |
| [out] | GRID_DIMS | |
| [out] | GRID_SIZE | |
| [out] | GRID_CORNERS | |
| [out] | GRID_RANK |
Definition at line 1165 of file wmscrpmd.F90.
References w3servmd::extcde(), fix_periodcity(), get_scrip_info_structured(), get_scrip_info_unstructured(), w3gdatmd::grids, and w3gdatmd::ungtype.
Referenced by scrip_wrapper().
| subroutine wmscrpmd::get_scrip_info_structured | ( | integer, intent(in) | ID_GRD, |
| real*8, dimension(:), intent(out), allocatable | GRID_CENTER_LON, | ||
| real*8, dimension(:), intent(out), allocatable | GRID_CENTER_LAT, | ||
| real*8, dimension(:,:), intent(out), allocatable | GRID_CORNER_LON, | ||
| real*8, dimension(:,:), intent(out), allocatable | GRID_CORNER_LAT, | ||
| logical, dimension(:), intent(out), allocatable | GRID_MASK, | ||
| integer, dimension(:), intent(out), allocatable | GRID_DIMS, | ||
| integer, intent(out) | GRID_SIZE, | ||
| integer, intent(out) | GRID_CORNERS, | ||
| integer, intent(out) | GRID_RANK | ||
| ) |
Compute grid arrays needed for scrip for a specific structured grid.
This is adapted from Erick Rogers original code by splitting the original scrip_wrapper function.
| [in] | ID_GRD | |
| [out] | GRID_CENTER_LON | |
| [out] | GRID_CENTER_LAT | |
| [out] | GRID_CORNER_LON | |
| [out] | GRID_CORNER_LAT | |
| [out] | GRID_MASK | |
| [out] | GRID_DIMS | |
| [out] | GRID_SIZE | |
| [out] | GRID_CORNERS | |
| [out] | GRID_RANK |
Definition at line 974 of file wmscrpmd.F90.
References w3servmd::extcde(), w3gdatmd::grids, and scrip_constants::half.
Referenced by get_scrip_info().
| subroutine wmscrpmd::get_scrip_info_unstructured | ( | integer, intent(in) | ID_GRD, |
| real*8, dimension(:), intent(out), allocatable | GRID_CENTER_LON, | ||
| real*8, dimension(:), intent(out), allocatable | GRID_CENTER_LAT, | ||
| real*8, dimension(:,:), intent(out), allocatable | GRID_CORNER_LON, | ||
| real*8, dimension(:,:), intent(out), allocatable | GRID_CORNER_LAT, | ||
| logical, dimension(:), intent(out), allocatable | GRID_MASK, | ||
| integer, dimension(:), intent(out), allocatable | GRID_DIMS, | ||
| integer, intent(out) | GRID_SIZE, | ||
| integer, intent(out) | GRID_CORNERS, | ||
| integer, intent(out) | GRID_RANK | ||
| ) |
Compute grid arrays for scrip for a specific unstructured grid.
For interior vertices, we select for every triangle the barycenter of the triangle. So to every node contained in N triangles we associate a domain with N corners. Every one of those corners is contained in 3 different domains.
For nodes that are on the boundary, we have to proceed differently. For every such node, we have NEIGHBOR_PREV and NEIGHBOR_NEXT which are the neighbor on each side of the boundary. We put a corner on the middle of the edge. We also put a corner on the node itself.
Note that instead of taking barycenters, we could have taken Voronoi vertices, but this carries danger since Voronoi vertices can be outside of the triangle. And it leaves open how to treat the boundary.
| [in] | ID_GRD | |
| [out] | GRID_CENTER_LON | |
| [out] | GRID_CENTER_LAT | |
| [out] | GRID_CORNER_LON | |
| [out] | GRID_CORNER_LAT | |
| [out] | GRID_MASK | |
| [out] | GRID_DIMS | |
| [out] | GRID_SIZE | |
| [out] | GRID_CORNERS | |
| [out] | GRID_RANK |
Definition at line 551 of file wmscrpmd.F90.
References w3servmd::extcde(), fix_periodcity(), get_boundary(), get_unstructured_vertex_degree(), w3gdatmd::grids, and triang_indexes().
Referenced by get_scrip_info().
| subroutine wmscrpmd::get_unstructured_vertex_degree | ( | integer, intent(in) | MNP, |
| integer, intent(in) | MNE, | ||
| integer, dimension(:,:), intent(in) | TRIGP, | ||
| integer, dimension(:), intent(out) | TRIGINCD | ||
| ) |
This function returns the list of incidences.
Output: TrigIncd - number of triangles contained by vertices.
| [in] | MNP | Number of nodes |
| [in] | MNE | List of nodes |
| [in] | TRIGP | Number of triangles |
| [out] | TRIGINCD | Number of triangles contained by vertices. |
Definition at line 1448 of file wmscrpmd.F90.
Referenced by get_scrip_info_unstructured().
| subroutine wmscrpmd::scrip_info_renormalization | ( | real*8, dimension(:), intent(inout) | GRID_CENTER_LON, |
| real*8, dimension(:), intent(inout) | GRID_CENTER_LAT, | ||
| real*8, dimension(:,:), intent(inout) | GRID_CORNER_LON, | ||
| real*8, dimension(:,:), intent(inout) | GRID_CORNER_LAT, | ||
| logical, dimension(:), intent(in) | GRID_MASK, | ||
| integer, dimension(:), intent(in) | GRID_DIMS, | ||
| integer, intent(in) | GRID_SIZE, | ||
| integer, intent(in) | GRID_CORNERS, | ||
| integer, intent(in) | GRID_RANK, | ||
| real*8 | CONV_DX, | ||
| real*8 | CONV_DY, | ||
| real*8 | OFFSET, | ||
| real*8 | GRIDSHIFT | ||
| ) |
Rescale according to whether the grid is spherical or not.
This is adapted from Erick Rogers scrip_wrapper.
Purpose is to rescale according to whether the grid is spherical or not and to adjust by some small shift to keep SCRIP happy in situations where nodes of different grids overlay.
We apply various transformations to the longitude latitude following here the transformations that were done only in finite difference meshes.
| [in,out] | GRID_CENTER_LON | |
| [in,out] | GRID_CENTER_LAT | |
| [in,out] | GRID_CORNER_LON | |
| [in,out] | GRID_CORNER_LAT | |
| [in] | GRID_MASK | |
| [in] | GRID_DIMS | |
| [in] | GRID_SIZE | |
| [in] | GRID_CORNERS | |
| [in] | GRID_RANK | |
| CONV_DX | ||
| CONV_DY | ||
| OFFSET | ||
| GRIDSHIFT |
Definition at line 1313 of file wmscrpmd.F90.
Referenced by scrip_wrapper().
| subroutine wmscrpmd::scrip_wrapper | ( | integer(scrip_i4), intent(in) | ID_SRC, |
| integer(scrip_i4), intent(in) | ID_DST, | ||
| integer(scrip_i4), dimension(:,:), intent(in) | MAPSTA_SRC, | ||
| integer(scrip_i4), dimension(:,:), intent(in) | MAPST2_SRC, | ||
| logical(scrip_logical), intent(in) | FLAGLL, | ||
| real (scrip_r8), intent(in) | GRIDSHIFT, | ||
| logical(scrip_logical), intent(in) | L_MASTER, | ||
| logical(scrip_logical), intent(in) | L_READ, | ||
| logical(scrip_logical), intent(in) | L_TEST | ||
| ) |
Compute grid information required by SCRIP.
| [in] | ID_SRC | |
| [in] | ID_DST | |
| [in] | MAPSTA_SRC | |
| [in] | MAPST2_SRC | |
| [in] | FLAGLL | |
| [in] | GRIDSHIFT | |
| [in] | L_MASTER | |
| [in] | L_READ | |
| [in] | L_TEST |
Definition at line 115 of file wmscrpmd.F90.
References w3servmd::extcde(), scrip_remap_vars::frac_highest, scrip_remap_vars::frac_lowest, get_scrip_info(), scrip_remap_vars::grid1_add_map1, scrip_grids::grid1_center_lat, scrip_grids::grid1_center_lon, scrip_grids::grid1_corner_lat, scrip_grids::grid1_corner_lon, scrip_grids::grid1_corners, scrip_grids::grid1_dims, scrip_grids::grid1_frac, scrip_grids::grid1_mask, scrip_grids::grid1_name, scrip_grids::grid1_rank, scrip_grids::grid1_size, scrip_grids::grid1_units, scrip_remap_vars::grid2_add_map1, scrip_grids::grid2_center_lat, scrip_grids::grid2_center_lon, scrip_grids::grid2_corner_lat, scrip_grids::grid2_corner_lon, scrip_grids::grid2_corners, scrip_grids::grid2_dims, scrip_grids::grid2_frac, scrip_grids::grid2_mask, scrip_grids::grid2_name, scrip_grids::grid2_rank, scrip_grids::grid2_size, scrip_grids::grid2_units, scrip_remap_vars::max_links_map1, scrip_remap_vars::num_wts, scrip_constants::one, scrip_interface::scrip(), scrip_interface::scrip_clear(), scrip_info_renormalization(), scrip_interface::wgtdata, scrip_remap_vars::wt_highest, scrip_remap_vars::wt_lowest, scrip_remap_vars::wts_map1, and scrip_constants::zero.
Referenced by wmgridmd::wmghgh().
| subroutine wmscrpmd::triang_indexes | ( | integer, intent(in) | I, |
| integer, intent(out) | INEXT, | ||
| integer, intent(out) | IPREV | ||
| ) |
Desc not available.
| [in] | I | |
| [out] | INEXT | |
| [out] | IPREV |
Definition at line 1413 of file wmscrpmd.F90.
Referenced by get_boundary(), and get_scrip_info_unstructured().