FMS
2024.03
Flexible Modeling System
|
Implements exchange grids for coupled models running on multiple processors. More...
Data Types | |
type | comm_type |
Private type used for exchange grid communication. More... | |
interface | conservation_check |
Returns three numbers which are the global sum of a variable. More... | |
interface | conservation_check_ug |
For an unstructured grid, returns three numbers which are the global sum of a variable (1) on its home model grid, (2) after interpolation to the other side grid(s), and (3) after re_interpolation back onto its home side grid(s). More... | |
interface | get_area_elements |
interface | get_from_xgrid |
Sums data from exchange grid to model grid. More... | |
interface | get_from_xgrid_ug |
get_from_xgrid for unstructured grids. More... | |
interface | get_nest_contact |
type | grid_box_type |
Type to hold pointers for grid boxes. More... | |
type | grid_type |
Private type to hold all data needed from given grid for an exchange grid. More... | |
type | overlap_type |
Private type for overlap exchange grid data. More... | |
interface | put_to_xgrid |
Scatters data from model grid onto exchange grid. More... | |
interface | put_to_xgrid_ug |
put_to_xgrid for unstructured grids. More... | |
interface | set_frac_area |
Sets sub-grid area and numbering in the given exchange grid. More... | |
interface | stock_move |
interface | stock_move_ug |
type | x1_type |
Private type for exchange grid data. More... | |
type | x2_type |
Private type for exchange grid data. More... | |
type | xcell_type |
Private type for cell indices and data in the exchange grid. More... | |
type | xmap_type |
Type for an exchange grid, holds pointers to included grids and any necessary data. More... | |
Functions/Subroutines | |
real(r8_kind) function, dimension(3) | conservation_check_side1 (d, grid_id, xmap, remap_method) |
conservation_check - returns three numbers which are the global sum of a variable (1) on its home model grid, (2) after interpolation to the other side grid(s), and (3) after re_interpolation back onto its home side grid(s). More... | |
real(r8_kind) function, dimension(3) | conservation_check_side2 (d, grid_id, xmap, remap_method) |
conservation_check - returns three numbers which are the global sum of a variable (1) on its home model grid, (2) after interpolation to the other side grid(s), and (3) after re_interpolation back onto its home side grid(s). More... | |
real(r8_kind) function, dimension(3) | conservation_check_ug_side1 (d, grid_id, xmap, remap_method) |
conservation_check_ug - returns three numbers which are the global sum of a variable (1) on its home model grid, (2) after interpolation to the other side grid(s), and (3) after re_interpolation back onto its home side grid(s). More... | |
real(r8_kind) function, dimension(3) | conservation_check_ug_side2 (d, grid_id, xmap, remap_method) |
conservation_check_ug - returns three numbers which are the global sum of a variable (1) on its home model grid, (2) after interpolation to the other side grid(s), and (3) after re_interpolation back onto its home side grid(s). More... | |
subroutine | get_1_from_xgrid (d_addrs, x_addrs, xmap, isize, jsize, xsize, lsize) |
subroutine | get_1_from_xgrid_repro (d_addrs, x_addrs, xmap, xsize, lsize) |
subroutine | get_1_from_xgrid_ug (d_addrs, x_addrs, xmap, isize, xsize, lsize) |
subroutine | get_1_from_xgrid_ug_repro (d_addrs, x_addrs, xmap, xsize, lsize) |
subroutine | get_2_from_xgrid (d, grid, x, xmap) |
subroutine | get_2_from_xgrid_ug (d, grid, x, xmap) |
subroutine | get_area_elements_fms2_io (fileobj, name, get_area_data) |
Read the area elements from NetCDF file. | |
subroutine | get_grid_version1 (grid, grid_id, grid_file) |
read the center point of the grid from version 1 grid file. only the grid at the side 1 is needed, so we only read atm and land grid. | |
subroutine | get_grid_version2 (grid, grid_id, grid_file) |
read the center point of the grid from version 1 grid file. only the grid at the side 1 is needed, so we only read atm and land grid | |
subroutine, public | get_index_range (xmap, grid_index, is, ie, js, je, km) |
integer function | get_nest_contact_fms2_io (fileobj, tile_nest_out, tile_parent_out, is_nest_out, ie_nest_out, js_nest_out, je_nest_out, is_parent_out, ie_parent_out, js_parent_out, je_parent_out) |
currently we are assuming there is only one nest region More... | |
subroutine, public | get_ocean_model_area_elements (domain, grid_file) |
Read Ocean area element data from netCDF file. More... | |
subroutine | get_side1_from_xgrid (d, grid_id, x, xmap, complete) |
subroutine | get_side1_from_xgrid_ug (d, grid_id, x, xmap, complete) |
subroutine | get_side2_from_xgrid (d, grid_id, x, xmap) |
subroutine | get_side2_from_xgrid_ug (d, grid_id, x, xmap) |
subroutine, public | get_xmap_grid_area (id, xmap, area) |
This routine is used to get the grid area of component model with id. | |
real(r8_kind) function, dimension(is:ie, js:je) | grad_merid_latlon (d, lat, is, ie, js, je, isd, jsd) |
This function is used to calculate the gradient along meridinal direction. Maybe need to setup a limit for the gradient. regular lat-lon grid are assumed. More... | |
real(r8_kind) function, dimension(is:ie, js:je) | grad_zonal_latlon (d, lon, lat, is, ie, js, je, isd, jsd) |
This function is used to calculate the gradient along zonal direction. Maybe need to setup a limit for the gradient. The grid is assumeed to be regular lat-lon grid. More... | |
logical function | in_box (i, j, is, ie, js, je) |
logical function | in_box_me (i, j, grid) |
logical function | in_box_nbr (i, j, grid, p) |
subroutine | load_xgrid (xmap, grid, grid_file, grid1_id, grid_id, tile1, tile2, use_higher_order) |
subroutine | put_1_to_xgrid_order_1 (d_addrs, x_addrs, xmap, isize, jsize, xsize, lsize) |
subroutine | put_1_to_xgrid_order_2 (d_addrs, x_addrs, xmap, isize, jsize, xsize, lsize) |
subroutine | put_1_to_xgrid_ug_order_1 (d_addrs, x_addrs, xmap, dsize, xsize, lsize) |
subroutine | put_2_to_xgrid (d, grid, x, xmap) |
subroutine | put_2_to_xgrid_ug (d, grid, x, xmap) |
subroutine | put_side1_to_xgrid (d, grid_id, x, xmap, remap_method, complete) |
Scatters data to exchange grid. More... | |
subroutine | put_side1_to_xgrid_ug (d, grid_id, x, xmap, complete) |
Currently only support first order. | |
subroutine | put_side2_to_xgrid (d, grid_id, x, xmap) |
Scatters data to exchange grid. More... | |
subroutine | put_side2_to_xgrid_ug (d, grid_id, x, xmap) |
subroutine | regen (xmap) |
Regenerate/Update the xmap. More... | |
subroutine | set_comm_get1 (xmap) |
subroutine | set_comm_get1_repro (xmap) |
subroutine | set_comm_put1 (xmap) |
subroutine | set_frac_area_sg (f, grid_id, xmap) |
Changes sub-grid portion areas and/or number. More... | |
subroutine, public | set_frac_area_ug (f, grid_id, xmap) |
Changes sub-grid portion areas and/or number. More... | |
subroutine, public | setup_xmap (xmap, grid_ids, grid_domains, grid_file, atm_grid, lnd_ug_domain) |
Sets up exchange grid connectivity using grid specification file and processor domain decomposition. | |
subroutine, public | some (xmap, some_arr, grid_id) |
Returns logical associating exchange grid cells with given side two grid. More... | |
subroutine | stock_move_3d (from, to, grid_index, stock_data3d, xmap, delta_t, from_side, to_side, radius, verbose, ier) |
this version takes rank 3 data, it can be used to compute the flux on anything but the first grid, which typically is on the atmos side. note that "from" and "to" are optional, the stocks will be subtracted, resp. added, only if these are present. More... | |
integer function, public | xgrid_count (xmap) |
Returns current size of exchange grid variables. More... | |
subroutine, public | xgrid_init (remap_method) |
Initialize the xgrid_mod. More... | |
Variables | |
real(r8_kind), dimension(:,:), allocatable, public | area_atm_model |
Area elements used inside each model. | |
real(r8_kind), dimension(:,:), allocatable, public | area_atm_sphere |
Area elements based on a the spherical model used by the ICE layer. | |
real(r8_kind), dimension(:,:), allocatable | area_lnd_model |
real(r8_kind), dimension(:,:), allocatable | area_lnd_sphere |
real(r8_kind), dimension(:,:), allocatable, public | area_ocn_model |
real(r8_kind), dimension(:,:), allocatable, public | area_ocn_sphere |
logical | debug_stocks = .false. |
logical | do_alltoall = .true. |
logical | do_alltoallv = .false. |
character(len=64) | interp_method = 'first_order' |
Exchange grid interpolation method. It has two options: "first_order", "second_order". | |
logical | make_exchange_reproduce = .false. |
Set to .true. to make xgrid_mod reproduce answers on different numbers of PEs. This option has a considerable performance impact. exactly same on different # PEs. | |
integer, parameter | max_fields = 80 |
logical | monotonic_exchange = .false. |
integer | nsubset = 0 |
Number of processors to read exchange grid information. Those processors that read the exchange grid information will send data to other processors to prepare for flux exchange. Default value is 0. When nsubset is 0, each processor will read part of the exchange grid information. The purpose of this namelist is to improve performance of setup_xmap when running on higher processor count and solve receiving size mismatch issue on high processor count. Try to set nsubset = mpp_npes/MPI_rank_per_node. | |
integer | remapping_method |
xgrid nml | |
integer, parameter, public | second_order = 2 |
logical | use_mpp_io = .false. |
use_mpp_io Default = .false. When true, uses mpp_io for IO. When false, uses fms2_io for IO. | |
integer, parameter | version1 = 1 |
grid spec file | |
integer, parameter | version2 = 2 |
mosaic grid file | |
logical | xgrid_clocks_on = .false. |
Implements exchange grids for coupled models running on multiple processors.
An exchange grid is formed from the union of the bounding lines of the two (logically rectangular) participating grids. The exchange grid is therefore the coarsest grid that is a refinement of both participating grids. Exchange grids are used for two purposes by coupled models:
xgrid_mod
uses a NetCDF grid specification file containing the grid cell overlaps in combination with the ftp://ftp.gfdl.gov/pub/vb/mpp/mpp_domains.F90 domain decomposition information to determine the grid and processor connectivities.xgrid_mod - implements exchange grids. An exchange grid is the grid whose boundary set is the union of the boundaries of the participating grids. The exchange grid is the coarsest grid that is a refinement of each of the participating grids. Every exchange grid cell is a subarea of one and only one cell in each of the participating grids. The exchange grid has two purposes:
(1) The exchange cell areas are used as weights for conservative interpolation between model grids.
(2) Computation of surface fluxes takes place on it, thereby using the finest scale data obtainable.
The exchange cells are the 2D intersections between cells of the participating grids. They are computed elsewhere and are read here from a NetCDF grid file as a sequence of quintuples (i and j on each of two grids and the cell area).
Each processing element (PE) computes a subdomain of each of the participating grids as well as a subset of the exchange cells. The geographic regions corresponding to these subdomains will, in general, not be the same so communication must occur between the PEs. The scheme for doing this is as follows. A distinction is drawn between the participating grids. There is a single "side 1" grid and it does not have partitions (sub-grid surface types). There are one or more "side 2" grids and they may have more than 1 partition. In standard usage, the atmosphere grid is on side 1 and the land and sea ice grids are on side 2. The set of exchange cells computed on a PE corresponds to its side 2 geographic region(s). Communication between the PEs takes place on the side 1 grid. Note: this scheme does not generally allow reproduction of answers across varying PE counts. This is because, in the side 1 "get", exchange cells are first summed locally onto a side 1 grid, then these side 1 contributions are further summed after they have been communicated to their target PE. For the make_exchange_reproduce option, a special side 1 get is used. This get communicates individual exchange cells. The cells are summed in the order they appear in the grid spec. file.
xgrid_mod
reads a NetCDF grid specification file to determine the grid and processor connectivities. The exchange grids are defined by a sequence of quintuples: the i/j
indices of the intersecting cells of the two participating grids and their areal overlap. The names of the five fields are generated automatically from the three character ids of the participating grids. For example, if the side one grid id is "ATM" and the side two grid id is "OCN", xgrid_mod
expects to find the following five fields in the grid specification file: I_ATM_ATMxOCN, J_ATM_ATMxOCN, I_OCN_ATMxOCN, J_OCN_ATMxOCN, and AREA_ATMxOCN
. These fields may be generated by the make_xgrids
utility.
type xgrid_mod::comm_type |
Private Attributes | |
integer | nrecv |
integer | nsend |
type(overlap_type), dimension(:), pointer | recv =>NULL() |
integer | recvsize |
type(overlap_type), dimension(:), pointer | send =>NULL() |
integer | sendsize |
integer, dimension(:), pointer | unpack_ind =>NULL() |
interface xgrid_mod::conservation_check |
Returns three numbers which are the global sum of a variable.
Returns three numbers which are the global sum of a variable (1) on its home model grid, (2) after interpolation to the other side grid(s), and (3) after re_interpolation back onto its home side grid(s). Conservation_check must be called by all PEs to work properly.
d | real(r8_kind) data | |
grid_id | 3 character grid ID | |
[in,out] | xmap | exchange grid |
[out] | global | sum of a variable on home model grid, after side grid interpolation and after reinterpolation |
Example usage:
Private Member Functions | |
real(r8_kind) function, dimension(3) | conservation_check_side1 (d, grid_id, xmap, remap_method) |
conservation_check - returns three numbers which are the global sum of a variable (1) on its home model grid, (2) after interpolation to the other side grid(s), and (3) after re_interpolation back onto its home side grid(s). More... | |
real(r8_kind) function, dimension(3) | conservation_check_side2 (d, grid_id, xmap, remap_method) |
conservation_check - returns three numbers which are the global sum of a variable (1) on its home model grid, (2) after interpolation to the other side grid(s), and (3) after re_interpolation back onto its home side grid(s). More... | |
|
private |
conservation_check - returns three numbers which are the global sum of a variable (1) on its home model grid, (2) after interpolation to the other side grid(s), and (3) after re_interpolation back onto its home side grid(s).
[in] | d | model data to check |
[in] | grid_id | 3 character grid id |
[in,out] | xmap | exchange grid |
|
private |
conservation_check - returns three numbers which are the global sum of a variable (1) on its home model grid, (2) after interpolation to the other side grid(s), and (3) after re_interpolation back onto its home side grid(s).
[in] | d | model data to check |
[in] | grid_id | 3 character grid ID |
[in,out] | xmap | exchange grid |
interface xgrid_mod::conservation_check_ug |
For an unstructured grid, returns three numbers which are the global sum of a variable (1) on its home model grid, (2) after interpolation to the other side grid(s), and (3) after re_interpolation back onto its home side grid(s).
Private Member Functions | |
real(r8_kind) function, dimension(3) | conservation_check_ug_side1 (d, grid_id, xmap, remap_method) |
conservation_check_ug - returns three numbers which are the global sum of a variable (1) on its home model grid, (2) after interpolation to the other side grid(s), and (3) after re_interpolation back onto its home side grid(s). More... | |
real(r8_kind) function, dimension(3) | conservation_check_ug_side2 (d, grid_id, xmap, remap_method) |
conservation_check_ug - returns three numbers which are the global sum of a variable (1) on its home model grid, (2) after interpolation to the other side grid(s), and (3) after re_interpolation back onto its home side grid(s). More... | |
|
private |
conservation_check_ug - returns three numbers which are the global sum of a variable (1) on its home model grid, (2) after interpolation to the other side grid(s), and (3) after re_interpolation back onto its home side grid(s).
[in] | d | model data to check |
[in] | grid_id | 3 character grid ID |
[in,out] | xmap | exchange grid |
|
private |
conservation_check_ug - returns three numbers which are the global sum of a variable (1) on its home model grid, (2) after interpolation to the other side grid(s), and (3) after re_interpolation back onto its home side grid(s).
[in] | d | model data to check |
[in] | grid_id | 3 character grid ID |
[in,out] | xmap | exchange grid |
interface xgrid_mod::get_area_elements |
Private Member Functions | |
subroutine | get_area_elements_fms2_io (fileobj, name, get_area_data) |
Read the area elements from NetCDF file. | |
interface xgrid_mod::get_from_xgrid |
Sums data from exchange grid to model grid.
Example usage:
Private Member Functions | |
subroutine | get_side1_from_xgrid (d, grid_id, x, xmap, complete) |
subroutine | get_side2_from_xgrid (d, grid_id, x, xmap) |
|
private |
|
private |
interface xgrid_mod::get_from_xgrid_ug |
get_from_xgrid for unstructured grids.
Sums data from exchange grid to model grid.
Private Member Functions | |
subroutine | get_side1_from_xgrid_ug (d, grid_id, x, xmap, complete) |
subroutine | get_side2_from_xgrid_ug (d, grid_id, x, xmap) |
interface xgrid_mod::get_nest_contact |
Private Member Functions | |
integer function | get_nest_contact_fms2_io (fileobj, tile_nest_out, tile_parent_out, is_nest_out, ie_nest_out, js_nest_out, je_nest_out, is_parent_out, ie_parent_out, js_parent_out, je_parent_out) |
currently we are assuming there is only one nest region More... | |
|
private |
currently we are assuming there is only one nest region
type xgrid_mod::grid_box_type |
type xgrid_mod::grid_type |
Private type to hold all data needed from given grid for an exchange grid.
Private Attributes | |
real(r8_kind), dimension(:,:), pointer | area =>NULL() |
cell area | |
real(r8_kind), dimension(:,:), pointer | area_inv =>NULL() |
1 / area for normalization | |
type(grid_box_type) | box |
used for second order remapping. | |
type(domain2d) | domain |
used for conservation checks | |
type(domain2d) | domain_with_halo |
used for second order remapping | |
integer | first |
xgrid index range | |
integer | first_get |
xgrid index range for get_2_from_xgrid | |
real(r8_kind), dimension(:,:,:), pointer | frac_area =>NULL() |
partition fractions | |
integer, dimension(:), pointer | ge =>NULL() |
integer, pointer | ge_me =>NULL() |
real(r8_kind), dimension(:,:), pointer | geolat =>NULL() |
geographical grid center | |
real(r8_kind), dimension(:,:), pointer | geolon =>NULL() |
geographical grid center | |
integer, dimension(:), pointer | gs =>NULL() |
integer, pointer | gs_me =>NULL() |
character(len=3) | id |
grid identifier | |
integer, dimension(:), pointer | ie =>NULL() |
domain - i-range (pe index) | |
integer, pointer | ie_me =>NULL() |
my domain - i-range | |
integer | ied_me |
my data domain - i-range | |
integer | im |
global domain range | |
integer, dimension(:), pointer | is =>NULL() |
domain - i-range (pe index) | |
logical | is_latlon |
indicate if the grid is lat-lon grid or not. | |
integer, pointer | is_me =>NULL() |
my domain - i-range | |
logical | is_ug |
integer | isd_me |
my data domain - i-range | |
integer, dimension(:), pointer | je =>NULL() |
domain - j-range (pe index) | |
integer, pointer | je_me =>NULL() |
my domain - j-range | |
integer | jed_me |
my data domain - j-range | |
integer | jm |
global domain range | |
integer, dimension(:), pointer | js =>NULL() |
domain - j-range (pe index) | |
integer, pointer | js_me =>NULL() |
my domain - j-range | |
integer | jsd_me |
my data domain - j-range | |
integer | km |
global domain range | |
integer, dimension(:), pointer | l_index =>NULL() |
integer | last |
xgrid index range | |
integer | last_get |
xgrid index range for get_2_from_xgrid | |
real(r8_kind), dimension(:), pointer | lat =>NULL() |
center of global grids | |
integer, dimension(:), pointer | le =>NULL() |
integer, pointer | le_me =>NULL() |
unstruct domain | |
real(r8_kind), dimension(:), pointer | lon =>NULL() |
center of global grids | |
integer, dimension(:), pointer | ls =>NULL() |
integer, pointer | ls_me =>NULL() |
unstruct domain | |
integer | ni |
max of global size of all the tiles | |
integer | nj |
max of global size of all the tiles | |
integer | npes |
number of processor on this grid. | |
integer | ntile |
number of tiles in mosaic | |
integer | nxc_me |
compute domain size | |
integer | nxd_me |
data domain size | |
integer | nxl_me |
integer | nyc_me |
compute domain size | |
integer | nyd_me |
data domain size | |
logical | on_this_pe |
indicate the domain is defined on this pe | |
integer, dimension(:), pointer | pelist |
pelist of the domain | |
integer | root_pe |
indicate the root pe of the domain | |
integer | size |
integer | size_repro |
integer, dimension(:), pointer | tile =>NULL() |
tile id ( pe index ) | |
integer, pointer | tile_me |
my tile id | |
type(domainug) | ug_domain |
type(xcell_type), dimension(:), pointer | x =>NULL() |
xcell patterns | |
type(xcell_type), dimension(:), pointer | x_repro =>NULL() |
side 1 patterns for repro | |
type xgrid_mod::overlap_type |
interface xgrid_mod::put_to_xgrid |
Scatters data from model grid onto exchange grid.
Example usage:
Private Member Functions | |
subroutine | put_side1_to_xgrid (d, grid_id, x, xmap, remap_method, complete) |
Scatters data to exchange grid. More... | |
subroutine | put_side2_to_xgrid (d, grid_id, x, xmap) |
Scatters data to exchange grid. More... | |
|
private |
|
private |
interface xgrid_mod::put_to_xgrid_ug |
put_to_xgrid for unstructured grids.
Scatters data from unstructured grid onto exchange grid.
Private Member Functions | |
subroutine | put_side1_to_xgrid_ug (d, grid_id, x, xmap, complete) |
Currently only support first order. | |
subroutine | put_side2_to_xgrid_ug (d, grid_id, x, xmap) |
interface xgrid_mod::set_frac_area |
Sets sub-grid area and numbering in the given exchange grid.
Private Member Functions | |
subroutine | set_frac_area_sg (f, grid_id, xmap) |
Changes sub-grid portion areas and/or number. More... | |
subroutine | set_frac_area_ug (f, grid_id, xmap) |
Changes sub-grid portion areas and/or number. More... | |
|
private |
Changes sub-grid portion areas and/or number.
(re)sets the "fraction area" of the side 2 component grid cell. "fraction area" is a dynamic property of the component model (seaice or land) that needs to be updated after each timestep of that component in order for the exhange mechanism to work properly. The input is a 3d array of numbers between 0 and 1. It signifies the fraction of the component grid cell area which has a model-specific property. This property is used for some sub-grid scale parametrization in the component model. E.g., for the seaice component model, the quantity of seaice in each grid cell (i,j) is distibuted into N=gridkm partitions (ice categories) each parametrized with a weight (part_size) that add to 1. E.g., for 6+2 thickness (h) categories used in GFDL seaice models we have given hlim(1, ..., 8) = [1.0e-10, 0.1, 0.3, 0.7, 1.1, 1.5, 2.0, 2.5] (meters) Caterory n=1 : h <= hlim(1), essentially no ice Caterory n=2...7 : hlim(n-1) < h <= hlim(n) Caterory n=8 : hlim(n-1) < h , unlimimitted ice thickness E.g., if seaice in grid cell (i,j) is parameterized as 10 % open water, 0% category 1, 40% category 2 , 50% category 3 then we have f(i,j,1:km) = part_size(i,j,1:8) = [0.1, 0.0, 0.4, 0.5, 0.0, 0.0, 0.0, 0.0]
[in] | f | real(r8_kind) 3D array |
[in] | grid_id | 3 character grid ID |
[in,out] | xmap | exchange grid |
Example usage:
[in] | f | fraction area to be set |
[in] | grid_id | 3 character grid ID |
[in,out] | xmap | exchange grid with given grid ID |
|
private |
interface xgrid_mod::stock_move |
Private Member Functions | |
subroutine | stock_move_2d (from, to, grid_index, stock_data2d, xmap, delta_t, from_side, to_side, radius, verbose, ier) |
this version takes rank 2 data, it can be used to compute the flux on the atmos side note that "from" and "to" are optional, the stocks will be subtracted, resp. added, only if these are present. More... | |
subroutine | stock_move_3d (from, to, grid_index, stock_data3d, xmap, delta_t, from_side, to_side, radius, verbose, ier) |
this version takes rank 3 data, it can be used to compute the flux on anything but the first grid, which typically is on the atmos side. note that "from" and "to" are optional, the stocks will be subtracted, resp. added, only if these are present. More... | |
|
private |
this version takes rank 2 data, it can be used to compute the flux on the atmos side note that "from" and "to" are optional, the stocks will be subtracted, resp. added, only if these are present.
[in] | stock_data2d | data array is 2d |
[in] | from_side | ISTOCK_TOP, ISTOCK_BOTTOM, or ISTOCK_SIDE |
[in] | to_side | ISTOCK_TOP, ISTOCK_BOTTOM, or ISTOCK_SIDE |
[in] | radius | earth radius |
|
private |
this version takes rank 3 data, it can be used to compute the flux on anything but the first grid, which typically is on the atmos side. note that "from" and "to" are optional, the stocks will be subtracted, resp. added, only if these are present.
[in] | grid_index | grid index |
[in] | stock_data3d | data array is 3d |
[in] | from_side | ISTOCK_TOP, ISTOCK_BOTTOM, or ISTOCK_SIDE |
[in] | to_side | ISTOCK_TOP, ISTOCK_BOTTOM, or ISTOCK_SIDE |
[in] | radius | earth radius |
interface xgrid_mod::stock_move_ug |
Private Member Functions | |
subroutine | stock_move_ug_3d (from, to, grid_index, stock_ug_data3d, xmap, delta_t, from_side, to_side, radius, verbose, ier) |
this version takes rank 3 data, it can be used to compute the flux on anything but the first grid, which typically is on the atmos side. note that "from" and "to" are optional, the stocks will be subtracted, resp. added, only if these are present. More... | |
|
private |
this version takes rank 3 data, it can be used to compute the flux on anything but the first grid, which typically is on the atmos side. note that "from" and "to" are optional, the stocks will be subtracted, resp. added, only if these are present.
[in] | grid_index | grid index |
[in] | stock_ug_data3d | data array is 3d |
[in] | from_side | ISTOCK_TOP, ISTOCK_BOTTOM, or ISTOCK_SIDE |
[in] | to_side | ISTOCK_TOP, ISTOCK_BOTTOM, or ISTOCK_SIDE |
[in] | radius | earth radius |
type xgrid_mod::x1_type |
type xgrid_mod::x2_type |
type xgrid_mod::xcell_type |
Private type for cell indices and data in the exchange grid.
Private Attributes | |
real(r8_kind) | area |
geographic area of exchange cell | |
real(r8_kind) | di |
Weight for the gradient of flux. | |
real(r8_kind) | dj |
Weight for the gradient of flux. | |
integer | i1 |
indices of cell in model arrays on both sides | |
integer | i2 |
indices of cell in model arrays on both sides | |
integer | j1 |
indices of cell in model arrays on both sides | |
integer | j2 |
indices of cell in model arrays on both sides | |
integer | l1 |
integer | l2 |
integer | pe |
other side pe that has this cell | |
integer | recv_pos |
position in the receive buffer. | |
real(r8_kind) | scale |
integer | tile |
tile index of side 1 mosaic. | |
type xgrid_mod::xmap_type |
Type for an exchange grid, holds pointers to included grids and any necessary data.
Private Attributes | |
type(comm_type), pointer | get1 =>NULL() |
for get_1_from_xgrid | |
type(comm_type), pointer | get1_repro =>NULL() |
for get_1_from_xgrid_repro | |
type(grid_type), dimension(:), pointer | grids =>NULL() |
1st grid is side 1; rest on side 2 | |
integer, dimension(:), pointer | ind_get1 =>NULL() |
indx for side1 get and side2 put. | |
integer, dimension(:), pointer | ind_put1 =>NULL() |
indx for side1 put and side 2get. | |
integer | me |
integer | npes |
type(comm_type), pointer | put1 =>NULL() |
for put_1_to_xgrid | |
integer, dimension(:), pointer | recv_count_repro =>NULL() |
integer | recv_count_repro_tot |
sum(recv_count_repro) | |
integer | root_pe |
integer, dimension(:), pointer | send_count_repro =>NULL() |
integer | send_count_repro_tot |
sum(send_count_repro) | |
integer | size |
integer | size_get2 |
integer | size_put1 |
integer | version |
version of xgrids. version=VERSION! is for grid_spec file and version=VERSION2 is for mosaic grid. | |
type(x1_type), dimension(:), pointer | x1 =>NULL() |
side 1 info | |
type(x1_type), dimension(:), pointer | x1_put =>NULL() |
side 1 info | |
type(x2_type), dimension(:), pointer | x2 =>NULL() |
side 2 info | |
type(x2_type), dimension(:), pointer | x2_get =>NULL() |
side 2 info | |
logical, dimension(:), pointer | your1my2 =>NULL() |
true if side 1 domain on indexed pe overlaps side 2 domain on this pe | |
logical, dimension(:), pointer | your2my1 =>NULL() |
true if a side 2 domain on indexed pe overlaps side 1 domain on this pe | |
integer, dimension(:), pointer | your2my1_size =>NULL() |
number of exchange grid of a side 2 domain on indexed pe overlaps side 1 domain on this pe | |
|
private |
|
private |
|
private |
conservation_check - returns three numbers which are the global sum of a variable (1) on its home model grid, (2) after interpolation to the other side grid(s), and (3) after re_interpolation back onto its home side grid(s).
[in] | d | model data to check |
[in] | grid_id | 3 character grid id |
[in,out] | xmap | exchange grid |
|
private |
conservation_check - returns three numbers which are the global sum of a variable (1) on its home model grid, (2) after interpolation to the other side grid(s), and (3) after re_interpolation back onto its home side grid(s).
[in] | d | model data to check |
[in] | grid_id | 3 character grid ID |
[in,out] | xmap | exchange grid |
|
private |
conservation_check_ug - returns three numbers which are the global sum of a variable (1) on its home model grid, (2) after interpolation to the other side grid(s), and (3) after re_interpolation back onto its home side grid(s).
[in] | d | model data to check |
[in] | grid_id | 3 character grid ID |
[in,out] | xmap | exchange grid |
|
private |
conservation_check_ug - returns three numbers which are the global sum of a variable (1) on its home model grid, (2) after interpolation to the other side grid(s), and (3) after re_interpolation back onto its home side grid(s).
[in] | d | model data to check |
[in] | grid_id | 3 character grid ID |
[in,out] | xmap | exchange grid |
|
private |
currently we are assuming there is only one nest region
subroutine, public xgrid_mod::get_ocean_model_area_elements | ( | type(domain2d), intent(in) | domain, |
character(len=*), intent(in) | grid_file | ||
) |
Read Ocean area element data from netCDF file.
If available in the NetCDF file, this routine will read the AREA_OCN_MODEL field and load the data into global AREA_OCN_MODEL. If not available, then the array AREA_OCN_MODEL will be left unallocated. Must be called by all PEs.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Regenerate/Update the xmap.
This subroutine basically regenerates the exchange grid via updating the xmap. Practically xmap is the object specifying the exchange grid and has all the relevant information of Xgrid. Particularly note that regenerating the xmap/Xgrid accounts for dynamical changes of the subgrid parametrization of the side 2 components (land and ice-ocean). E.g., for when side 2 is the ice , the xgrid is regenrated so that OCN grid cells that are partially or totally open water contribute to (are side2 parent of) the Xgrid and conversely OCN grid cells that are totally ice covered do not contribute to (are kicked out of) the Xgrid. This makes xmap a dynamical object and a powerful tool for flux exchange calculations.
Things to keep in mind about xmap/xgrid: xgrid contains two sides: side1: This is the side where 2d arrays are put to and get from the Xgrid side2: This is the side where 3d arrays are put to and get from the Xgrid. This was designed to enable exchange along sub-grid-scale (3rd dimension) for component models that have subgrid scale parametrization (e.g., seaice categories and land tiles).
[in,out] | xmap | exchange grid |
|
private |
Changes sub-grid portion areas and/or number.
(re)sets the "fraction area" of the side 2 component grid cell. "fraction area" is a dynamic property of the component model (seaice or land) that needs to be updated after each timestep of that component in order for the exhange mechanism to work properly. The input is a 3d array of numbers between 0 and 1. It signifies the fraction of the component grid cell area which has a model-specific property. This property is used for some sub-grid scale parametrization in the component model. E.g., for the seaice component model, the quantity of seaice in each grid cell (i,j) is distibuted into N=gridkm partitions (ice categories) each parametrized with a weight (part_size) that add to 1. E.g., for 6+2 thickness (h) categories used in GFDL seaice models we have given hlim(1, ..., 8) = [1.0e-10, 0.1, 0.3, 0.7, 1.1, 1.5, 2.0, 2.5] (meters) Caterory n=1 : h <= hlim(1), essentially no ice Caterory n=2...7 : hlim(n-1) < h <= hlim(n) Caterory n=8 : hlim(n-1) < h , unlimimitted ice thickness E.g., if seaice in grid cell (i,j) is parameterized as 10 % open water, 0% category 1, 40% category 2 , 50% category 3 then we have f(i,j,1:km) = part_size(i,j,1:8) = [0.1, 0.0, 0.4, 0.5, 0.0, 0.0, 0.0, 0.0]
[in] | f | real(r8_kind) 3D array |
[in] | grid_id | 3 character grid ID |
[in,out] | xmap | exchange grid |
Example usage:
[in] | f | fraction area to be set |
[in] | grid_id | 3 character grid ID |
[in,out] | xmap | exchange grid with given grid ID |
subroutine, public xgrid_mod::set_frac_area_ug | ( | real(r8_kind), dimension(:,:), intent(in) | f, |
character(len=3), intent(in) | grid_id, | ||
type (xmap_type), intent(inout) | xmap | ||
) |
subroutine, public xgrid_mod::some | ( | type (xmap_type), intent(in) | xmap, |
logical, dimension(:), intent(out) | some_arr, | ||
character(len=3), intent(in), optional | grid_id | ||
) |
|
private |
this version takes rank 3 data, it can be used to compute the flux on anything but the first grid, which typically is on the atmos side. note that "from" and "to" are optional, the stocks will be subtracted, resp. added, only if these are present.
[in] | grid_index | grid index |
[in] | stock_data3d | data array is 3d |
[in] | from_side | ISTOCK_TOP, ISTOCK_BOTTOM, or ISTOCK_SIDE |
[in] | to_side | ISTOCK_TOP, ISTOCK_BOTTOM, or ISTOCK_SIDE |
[in] | radius | earth radius |
integer function, public xgrid_mod::xgrid_count | ( | type (xmap_type), intent(inout) | xmap | ) |
subroutine, public xgrid_mod::xgrid_init | ( | integer, intent(out) | remap_method | ) |
Initialize the xgrid_mod.
Initialization routine for the xgrid module. It reads the xgrid_nml, writes the version information and xgrid_nml to the log file.
[out] | remap_method | exchange grid interpolation method. It has four possible values: FIRST_ORDER (=1), SECOND_ORDER(=2). |