OASIS map (interpolation) data and methods. More...
Data Types | |
type | prism_mapper_type |
Mapper data for interpolating data between grids. More... | |
Public Member Functions | |
subroutine, public | oasis_map_genmap (mapid, namid) |
Routine to generate mapping weights data via a direct SCRIP call. More... | |
subroutine, public | oasis_map_smatreaddnc_orig (sMat, SgsMap, DgsMap, newdom, fileName, mytask, mpicom, nwgts, areasrc, areadst, ni_i, nj_i, ni_o, nj_o) |
Read in mapping matrix data from a SCRIP netCDF weights file. More... | |
subroutine, public | oasis_map_smatreaddnc_ceg (sMat, SgsMap, DgsMap, newdom, fileName, mytask, mpicom, nwgts, areasrc, areadst, ni_i, nj_i, ni_o, nj_o) |
Read in mapping matrix data from a SCRIP netCDF file using smart scatter (ceg) More... | |
Public Attributes | |
integer(kind=ip_i4_p), public | prism_mmapper |
max mappers More... | |
integer(kind=ip_i4_p), public | prism_nmapper = 0 |
mapper counter More... | |
type(prism_mapper_type), dimension(:), pointer, public | prism_mapper |
list of defined mappers More... | |
Private Member Functions | |
logical function | check_myindex (index, starti, counti) |
Function that checks whether an index is part of a start and count list. More... | |
subroutine | augment_arrays (cnt, reclen, bsize, nwgts) |
integer function | get_cegindex (index, starti, counti, peloci) |
Private Attributes | |
integer, parameter, private | r8 = ip_double_p |
integer, parameter, private | in = ip_i4_p |
real(r8), dimension(:,:), allocatable, private | snew |
real(r8), dimension(:,:), allocatable, private | sold |
integer, dimension(:), allocatable, private | rnew |
integer, dimension(:), allocatable, private | rold |
integer, dimension(:), allocatable, private | cnew |
integer, dimension(:), allocatable, private | cold |
OASIS map (interpolation) data and methods.
Definition at line 5 of file mod_oasis_map.F90.
|
private |
Definition at line 1528 of file mod_oasis_map.F90.
|
private |
Function that checks whether an index is part of a start and count list.
Does a binary search on a sorted start and count list to determine whether index is a value in the list. The list values consist of the values start(i):start(i)+count(i)-1 for all i.
index | index to search |
starti | start list |
counti | count list |
Definition at line 845 of file mod_oasis_map.F90.
|
private |
index | index to search |
starti | start list |
counti | count list |
peloci | pe list |
Definition at line 1585 of file mod_oasis_map.F90.
subroutine, public mod_oasis_map::oasis_map_genmap | ( | integer(ip_i4_p), intent(in) | mapid, |
integer(ip_i4_p), intent(in) | namid | ||
) |
Routine to generate mapping weights data via a direct SCRIP call.
This routine reads in grid data from files and passes that data to SCRIP. Mapping weights are generated and written to a file. This entire operation is done on a single task.
[in] | mapid | map id |
[in] | namid | namcouple id |
Definition at line 78 of file mod_oasis_map.F90.
subroutine, public mod_oasis_map::oasis_map_smatreaddnc_ceg | ( | type(mct_smat), dimension(:), intent(out), pointer | sMat, |
type(mct_gsmap), intent(in), target | SgsMap, | ||
type(mct_gsmap), intent(in), target | DgsMap, | ||
character(*), intent(in) | newdom, | ||
character(*), intent(in) | fileName, | ||
integer(in), intent(in) | mytask, | ||
integer(in), intent(in) | mpicom, | ||
integer(in), intent(out) | nwgts, | ||
type(mct_avect), intent(out), optional | areasrc, | ||
type(mct_avect), intent(out), optional | areadst, | ||
integer(in), intent(out), optional | ni_i, | ||
integer(in), intent(out), optional | nj_i, | ||
integer(in), intent(out), optional | ni_o, | ||
integer(in), intent(out), optional | nj_o | ||
) |
Read in mapping matrix data from a SCRIP netCDF file using smart scatter (ceg)
Read in mapping matrix data from a SCRIP netCDF data file using a low memory method and then scatter to all pes using a smart method where only select data is sent to tasks. Based on the sMatReaddnc method from CESM1.0.3 This routine leverages gsmaps to determine scatter pattern
The scatter is implemented via the root task reading the data and then determining which task gets which weights from the gsmap. The root the sends specific data to each task.
The algorithm to determine which task a weigth belongs to involves checking the task ownership for a given global index.
The local buffer sizes are estimated up front based on ngridcell/npes plus 20% (see 1.2 below). If the local buffer size fills up, then the buffer is reallocated 50% larger (see 1.5 below) and the fill continues. The idea is to trade off memory reallocation and copy with memory usage. 1.2 and 1.5 are arbitary, other values may result in better performance.
Once all the matrix weights have been read, the sMat is initialized, the values from the buffers are copied in, and everything is deallocated.
[out] | smat | mapping data |
[in] | sgsmap | src gsmap |
[in] | dgsmap | dst gsmap |
[in] | newdom | type of sMat (src or dst) src = rearrange and map (bfb), dst = map and rearrange (partial sums) |
[in] | filename | netCDF file to read |
[in] | mytask | processor id |
[in] | mpicom | mpi communicator |
[out] | nwgts | number of weights |
[out] | areasrc | area of src grid from mapping file |
[out] | areadst | area of dst grid from mapping file |
[out] | ni_i | number of lons on input grid |
[out] | nj_i | number of lats on input grid |
[out] | ni_o | number of lons on output grid |
[out] | nj_o | number of lats on output grid |
Definition at line 941 of file mod_oasis_map.F90.
subroutine, public mod_oasis_map::oasis_map_smatreaddnc_orig | ( | type(mct_smat), dimension(:), intent(out), pointer | sMat, |
type(mct_gsmap), intent(in), target | SgsMap, | ||
type(mct_gsmap), intent(in), target | DgsMap, | ||
character(*), intent(in) | newdom, | ||
character(*), intent(in) | fileName, | ||
integer(in), intent(in) | mytask, | ||
integer(in), intent(in) | mpicom, | ||
integer(in), intent(out) | nwgts, | ||
type(mct_avect), intent(out), optional | areasrc, | ||
type(mct_avect), intent(out), optional | areadst, | ||
integer(in), intent(out), optional | ni_i, | ||
integer(in), intent(out), optional | nj_i, | ||
integer(in), intent(out), optional | ni_o, | ||
integer(in), intent(out), optional | nj_o | ||
) |
Read in mapping matrix data from a SCRIP netCDF weights file.
Read in mapping matrix data from a SCRIP netCDF data file using a low memory method and then scatter to all pes. Based on the sMatReaddnc method from CESM1.0.3. This routine leverages gsmaps to determine scatter pattern.
The scatter is implemented as a broadcast of all weights then a local computation on each pe to determine with weights to keep based on gsmap information.
The algorithm to determine whether a weight belongs on a pe involves creating a couple local arrays (lsstart and lscount) which are the local values of start and length from the gsmap. These are sorted via a bubble sort and then searched via a binary search to check whether a global index is on the local pe.
The local buffer sizes are estimated up front based on ngridcell/npes plus 20% (search for 1.2 below). If the local buffer size fills up, then the buffer is reallocated 50% larger (search for 1.5 below) and the fill continues. The idea is to trade off memory reallocation and copy with memory usage. 1.2 and 1.5 are arbitary, other values may result in better performance.
Once all the matrix weights have been read, the sMat is initialized, the values from the buffers are copied in, and everything is deallocated.
[out] | smat | mapping data |
[in] | sgsmap | src gsmap |
[in] | dgsmap | dst gsmap |
[in] | newdom | type of sMat (src or dst) src = rearrange and map (bfb), dst = map and rearrange (partial sums) |
[in] | filename | netCDF file to read |
[in] | mytask | processor id |
[in] | mpicom | mpi communicator |
[out] | nwgts | number of weights |
[out] | areasrc | area of src grid from mapping file |
[out] | areadst | area of dst grid from mapping file |
[out] | ni_i | number of lons on input grid |
[out] | nj_i | number of lats on input grid |
[out] | ni_o | number of lons on output grid |
[out] | nj_o | number of lats on output grid |
Definition at line 368 of file mod_oasis_map.F90.
|
private |
Definition at line 64 of file mod_oasis_map.F90.
|
private |
Definition at line 64 of file mod_oasis_map.F90.
|
private |
Definition at line 58 of file mod_oasis_map.F90.
type(prism_mapper_type), dimension(:), pointer, public mod_oasis_map::prism_mapper |
list of defined mappers
Definition at line 53 of file mod_oasis_map.F90.
integer(kind=ip_i4_p), public mod_oasis_map::prism_mmapper |
max mappers
Definition at line 51 of file mod_oasis_map.F90.
integer(kind=ip_i4_p), public mod_oasis_map::prism_nmapper = 0 |
mapper counter
Definition at line 52 of file mod_oasis_map.F90.
|
private |
Definition at line 57 of file mod_oasis_map.F90.
|
private |
Definition at line 63 of file mod_oasis_map.F90.
|
private |
Definition at line 63 of file mod_oasis_map.F90.
|
private |
Definition at line 62 of file mod_oasis_map.F90.
|
private |
Definition at line 62 of file mod_oasis_map.F90.