1 | \hypertarget{namespacemod__oasis__map}{}\section{mod\+\_\+oasis\+\_\+map Module Reference} |
---|
2 | \label{namespacemod__oasis__map}\index{mod\+\_\+oasis\+\_\+map@{mod\+\_\+oasis\+\_\+map}} |
---|
3 | |
---|
4 | |
---|
5 | O\+A\+S\+IS map (interpolation) data and methods. |
---|
6 | |
---|
7 | |
---|
8 | \subsection*{Data Types} |
---|
9 | \begin{DoxyCompactItemize} |
---|
10 | \item |
---|
11 | type \hyperlink{structmod__oasis__map_1_1prism__mapper__type}{prism\+\_\+mapper\+\_\+type} |
---|
12 | \begin{DoxyCompactList}\small\item\em Mapper data for interpolating data between grids. \end{DoxyCompactList}\end{DoxyCompactItemize} |
---|
13 | \subsection*{Functions/\+Subroutines} |
---|
14 | \begin{DoxyCompactItemize} |
---|
15 | \item |
---|
16 | subroutine, public \hyperlink{namespacemod__oasis__map_a6f27846fb1dcb2db3095b9ace4fa3c5b}{oasis\+\_\+map\+\_\+genmap} (mapid, namid) |
---|
17 | \begin{DoxyCompactList}\small\item\em Routine to generate mapping weights data via a direct S\+C\+R\+IP call. \end{DoxyCompactList}\item |
---|
18 | subroutine, public \hyperlink{namespacemod__oasis__map_acbe7b9e25c19dbbd2fbebd3895a87d64}{oasis\+\_\+map\+\_\+smatreaddnc\+\_\+orig} (s\+Mat, Sgs\+Map, Dgs\+Map, newdom, file\+Name, mytask, mpicom, nwgts, areasrc, areadst, ni\+\_\+i, nj\+\_\+i, ni\+\_\+o, nj\+\_\+o) |
---|
19 | \begin{DoxyCompactList}\small\item\em Read in mapping matrix data from a S\+C\+R\+IP net\+C\+DF weights file. \end{DoxyCompactList}\item |
---|
20 | subroutine, public \hyperlink{namespacemod__oasis__map_a3345e2fc3d74cc1221d6c6d993233990}{oasis\+\_\+map\+\_\+smatreaddnc\+\_\+ceg} (s\+Mat, Sgs\+Map, Dgs\+Map, newdom, file\+Name, mytask, mpicom, nwgts, areasrc, areadst, ni\+\_\+i, nj\+\_\+i, ni\+\_\+o, nj\+\_\+o) |
---|
21 | \begin{DoxyCompactList}\small\item\em Read in mapping matrix data from a S\+C\+R\+IP net\+C\+DF file using smart scatter (ceg) \end{DoxyCompactList}\item |
---|
22 | subroutine \hyperlink{namespacemod__oasis__map_a84a573c180be2a5dc8a14fd18b2dc4b7}{augment\+\_\+arrays} (cnt, reclen, bsize, nwgts) |
---|
23 | \begin{DoxyCompactList}\small\item\em Function that increases temporary work array size of Snew, Rnew, Cnew. \end{DoxyCompactList}\item |
---|
24 | logical function \hyperlink{namespacemod__oasis__map_a2528f60bde618dd4840d3adb5a569996}{check\+\_\+myindex} (index, starti, counti) |
---|
25 | \begin{DoxyCompactList}\small\item\em Function that checks whether an index is part of a start and count list. \end{DoxyCompactList}\item |
---|
26 | integer function \hyperlink{namespacemod__oasis__map_a8889e0dcab8e1e894d3203c480110bed}{get\+\_\+cegindex} (index, starti, counti, peloci) |
---|
27 | \begin{DoxyCompactList}\small\item\em Function that carrys out a binary search for index in list. \end{DoxyCompactList}\end{DoxyCompactItemize} |
---|
28 | \subsection*{Variables} |
---|
29 | \begin{DoxyCompactItemize} |
---|
30 | \item |
---|
31 | integer(kind=ip\+\_\+i4\+\_\+p), public \hyperlink{namespacemod__oasis__map_ab15f72e9f33a67181edc977c06b951e2}{prism\+\_\+mmapper} |
---|
32 | \begin{DoxyCompactList}\small\item\em max mappers \end{DoxyCompactList}\item |
---|
33 | integer(kind=ip\+\_\+i4\+\_\+p), public \hyperlink{namespacemod__oasis__map_af543b83ec5bed63a4448ff641137b0c5}{prism\+\_\+nmapper} = 0 |
---|
34 | \begin{DoxyCompactList}\small\item\em mapper counter \end{DoxyCompactList}\item |
---|
35 | type(\hyperlink{structmod__oasis__map_1_1prism__mapper__type}{prism\+\_\+mapper\+\_\+type}), dimension(\+:), pointer, public \hyperlink{namespacemod__oasis__map_a00ad53f61b6998938fca792455487f7e}{prism\+\_\+mapper} |
---|
36 | \begin{DoxyCompactList}\small\item\em list of defined mappers \end{DoxyCompactList}\item |
---|
37 | integer, parameter, private \hyperlink{namespacemod__oasis__map_a30ebe320b9e4c06a1ee1f2a0bbacf2c4}{r8} = ip\+\_\+double\+\_\+p |
---|
38 | \item |
---|
39 | integer, parameter, private \hyperlink{namespacemod__oasis__map_aa58997467050224f6db2bc93fe5f7ca1}{in} = ip\+\_\+i4\+\_\+p |
---|
40 | \item |
---|
41 | real(\hyperlink{namespacemod__oasis__map_a30ebe320b9e4c06a1ee1f2a0bbacf2c4}{r8}), dimension(\+:,\+:), allocatable, private \hyperlink{namespacemod__oasis__map_a28b59479c467c58995c6300071ca140a}{snew} |
---|
42 | \item |
---|
43 | real(\hyperlink{namespacemod__oasis__map_a30ebe320b9e4c06a1ee1f2a0bbacf2c4}{r8}), dimension(\+:,\+:), allocatable, private \hyperlink{namespacemod__oasis__map_a1fc7e7f295910352524d442c5d0dbf79}{sold} |
---|
44 | \item |
---|
45 | integer, dimension(\+:), allocatable, private \hyperlink{namespacemod__oasis__map_a2575785d3ea5e1a37c7f6303f00eb727}{rnew} |
---|
46 | \item |
---|
47 | integer, dimension(\+:), allocatable, private \hyperlink{namespacemod__oasis__map_a2931a6f582d0173cc0e6b155b8cb55b7}{rold} |
---|
48 | \item |
---|
49 | integer, dimension(\+:), allocatable, private \hyperlink{namespacemod__oasis__map_a8ae737bd62499fe60ebb48d04ad3b6dd}{cnew} |
---|
50 | \item |
---|
51 | integer, dimension(\+:), allocatable, private \hyperlink{namespacemod__oasis__map_a479ecc5b0be5d1adf3973cb08c40d30a}{cold} |
---|
52 | \item |
---|
53 | logical, parameter \hyperlink{namespacemod__oasis__map_a0d8a50381f5e15cf11c1c845348c5062}{local\+\_\+timers\+\_\+on} = .false. |
---|
54 | \end{DoxyCompactItemize} |
---|
55 | |
---|
56 | |
---|
57 | \subsection{Detailed Description} |
---|
58 | O\+A\+S\+IS map (interpolation) data and methods. |
---|
59 | |
---|
60 | \subsection{Function/\+Subroutine Documentation} |
---|
61 | \mbox{\Hypertarget{namespacemod__oasis__map_a84a573c180be2a5dc8a14fd18b2dc4b7}\label{namespacemod__oasis__map_a84a573c180be2a5dc8a14fd18b2dc4b7}} |
---|
62 | \index{mod\+\_\+oasis\+\_\+map@{mod\+\_\+oasis\+\_\+map}!augment\+\_\+arrays@{augment\+\_\+arrays}} |
---|
63 | \index{augment\+\_\+arrays@{augment\+\_\+arrays}!mod\+\_\+oasis\+\_\+map@{mod\+\_\+oasis\+\_\+map}} |
---|
64 | \subsubsection{\texorpdfstring{augment\+\_\+arrays()}{augment\_arrays()}} |
---|
65 | {\footnotesize\ttfamily subroutine mod\+\_\+oasis\+\_\+map\+::augment\+\_\+arrays (\begin{DoxyParamCaption}\item[{integer, intent(inout)}]{cnt, }\item[{integer, intent(\hyperlink{namespacemod__oasis__map_aa58997467050224f6db2bc93fe5f7ca1}{in})}]{reclen, }\item[{integer, intent(inout)}]{bsize, }\item[{integer, intent(\hyperlink{namespacemod__oasis__map_aa58997467050224f6db2bc93fe5f7ca1}{in})}]{nwgts }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}} |
---|
66 | |
---|
67 | |
---|
68 | |
---|
69 | Function that increases temporary work array size of Snew, Rnew, Cnew. |
---|
70 | |
---|
71 | |
---|
72 | \begin{DoxyParams}[1]{Parameters} |
---|
73 | \mbox{\tt in,out} & {\em cnt} & elements in current array\\ |
---|
74 | \hline |
---|
75 | \mbox{\tt in} & {\em reclen} & elements of new data\\ |
---|
76 | \hline |
---|
77 | \mbox{\tt in,out} & {\em bsize} & max size of current array\\ |
---|
78 | \hline |
---|
79 | \mbox{\tt in} & {\em nwgts} & number of weights in S \\ |
---|
80 | \hline |
---|
81 | \end{DoxyParams} |
---|
82 | |
---|
83 | |
---|
84 | Definition at line 1603 of file mod\+\_\+oasis\+\_\+map.\+F90. |
---|
85 | |
---|
86 | \mbox{\Hypertarget{namespacemod__oasis__map_a2528f60bde618dd4840d3adb5a569996}\label{namespacemod__oasis__map_a2528f60bde618dd4840d3adb5a569996}} |
---|
87 | \index{mod\+\_\+oasis\+\_\+map@{mod\+\_\+oasis\+\_\+map}!check\+\_\+myindex@{check\+\_\+myindex}} |
---|
88 | \index{check\+\_\+myindex@{check\+\_\+myindex}!mod\+\_\+oasis\+\_\+map@{mod\+\_\+oasis\+\_\+map}} |
---|
89 | \subsubsection{\texorpdfstring{check\+\_\+myindex()}{check\_myindex()}} |
---|
90 | {\footnotesize\ttfamily logical function mod\+\_\+oasis\+\_\+map\+::check\+\_\+myindex (\begin{DoxyParamCaption}\item[{integer(\hyperlink{namespacemod__oasis__map_aa58997467050224f6db2bc93fe5f7ca1}{in})}]{index, }\item[{integer(\hyperlink{namespacemod__oasis__map_aa58997467050224f6db2bc93fe5f7ca1}{in}), dimension(\+:)}]{starti, }\item[{integer(\hyperlink{namespacemod__oasis__map_aa58997467050224f6db2bc93fe5f7ca1}{in}), dimension(\+:)}]{counti }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}} |
---|
91 | |
---|
92 | |
---|
93 | |
---|
94 | Function that checks whether an index is part of a start and count list. |
---|
95 | |
---|
96 | 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. |
---|
97 | |
---|
98 | |
---|
99 | \begin{DoxyParams}{Parameters} |
---|
100 | {\em index} & index to search\\ |
---|
101 | \hline |
---|
102 | {\em starti} & start list\\ |
---|
103 | \hline |
---|
104 | {\em counti} & count list \\ |
---|
105 | \hline |
---|
106 | \end{DoxyParams} |
---|
107 | |
---|
108 | |
---|
109 | Definition at line 1663 of file mod\+\_\+oasis\+\_\+map.\+F90. |
---|
110 | |
---|
111 | \mbox{\Hypertarget{namespacemod__oasis__map_a8889e0dcab8e1e894d3203c480110bed}\label{namespacemod__oasis__map_a8889e0dcab8e1e894d3203c480110bed}} |
---|
112 | \index{mod\+\_\+oasis\+\_\+map@{mod\+\_\+oasis\+\_\+map}!get\+\_\+cegindex@{get\+\_\+cegindex}} |
---|
113 | \index{get\+\_\+cegindex@{get\+\_\+cegindex}!mod\+\_\+oasis\+\_\+map@{mod\+\_\+oasis\+\_\+map}} |
---|
114 | \subsubsection{\texorpdfstring{get\+\_\+cegindex()}{get\_cegindex()}} |
---|
115 | {\footnotesize\ttfamily integer function mod\+\_\+oasis\+\_\+map\+::get\+\_\+cegindex (\begin{DoxyParamCaption}\item[{integer(\hyperlink{namespacemod__oasis__map_aa58997467050224f6db2bc93fe5f7ca1}{in})}]{index, }\item[{integer(\hyperlink{namespacemod__oasis__map_aa58997467050224f6db2bc93fe5f7ca1}{in}), dimension(\+:)}]{starti, }\item[{integer(\hyperlink{namespacemod__oasis__map_aa58997467050224f6db2bc93fe5f7ca1}{in}), dimension(\+:)}]{counti, }\item[{integer(\hyperlink{namespacemod__oasis__map_aa58997467050224f6db2bc93fe5f7ca1}{in}), dimension(\+:)}]{peloci }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}} |
---|
116 | |
---|
117 | |
---|
118 | |
---|
119 | Function that carrys out a binary search for index in list. |
---|
120 | |
---|
121 | |
---|
122 | \begin{DoxyParams}{Parameters} |
---|
123 | {\em index} & index to search\\ |
---|
124 | \hline |
---|
125 | {\em starti} & start list\\ |
---|
126 | \hline |
---|
127 | {\em counti} & count list\\ |
---|
128 | \hline |
---|
129 | {\em peloci} & pe list \\ |
---|
130 | \hline |
---|
131 | \end{DoxyParams} |
---|
132 | |
---|
133 | |
---|
134 | Definition at line 1738 of file mod\+\_\+oasis\+\_\+map.\+F90. |
---|
135 | |
---|
136 | \mbox{\Hypertarget{namespacemod__oasis__map_a6f27846fb1dcb2db3095b9ace4fa3c5b}\label{namespacemod__oasis__map_a6f27846fb1dcb2db3095b9ace4fa3c5b}} |
---|
137 | \index{mod\+\_\+oasis\+\_\+map@{mod\+\_\+oasis\+\_\+map}!oasis\+\_\+map\+\_\+genmap@{oasis\+\_\+map\+\_\+genmap}} |
---|
138 | \index{oasis\+\_\+map\+\_\+genmap@{oasis\+\_\+map\+\_\+genmap}!mod\+\_\+oasis\+\_\+map@{mod\+\_\+oasis\+\_\+map}} |
---|
139 | \subsubsection{\texorpdfstring{oasis\+\_\+map\+\_\+genmap()}{oasis\_map\_genmap()}} |
---|
140 | {\footnotesize\ttfamily subroutine, public mod\+\_\+oasis\+\_\+map\+::oasis\+\_\+map\+\_\+genmap (\begin{DoxyParamCaption}\item[{integer(ip\+\_\+i4\+\_\+p), intent(\hyperlink{namespacemod__oasis__map_aa58997467050224f6db2bc93fe5f7ca1}{in})}]{mapid, }\item[{integer(ip\+\_\+i4\+\_\+p), intent(\hyperlink{namespacemod__oasis__map_aa58997467050224f6db2bc93fe5f7ca1}{in})}]{namid }\end{DoxyParamCaption})} |
---|
141 | |
---|
142 | |
---|
143 | |
---|
144 | Routine to generate mapping weights data via a direct S\+C\+R\+IP call. |
---|
145 | |
---|
146 | This routine reads in grid data from files and passes that data to S\+C\+R\+IP. Mapping weights are generated and written to a file. This entire operation is done on a single task. |
---|
147 | |
---|
148 | |
---|
149 | \begin{DoxyParams}[1]{Parameters} |
---|
150 | \mbox{\tt in} & {\em mapid} & map id\\ |
---|
151 | \hline |
---|
152 | \mbox{\tt in} & {\em namid} & namcouple id \\ |
---|
153 | \hline |
---|
154 | \end{DoxyParams} |
---|
155 | |
---|
156 | |
---|
157 | Definition at line 83 of file mod\+\_\+oasis\+\_\+map.\+F90. |
---|
158 | |
---|
159 | \mbox{\Hypertarget{namespacemod__oasis__map_a3345e2fc3d74cc1221d6c6d993233990}\label{namespacemod__oasis__map_a3345e2fc3d74cc1221d6c6d993233990}} |
---|
160 | \index{mod\+\_\+oasis\+\_\+map@{mod\+\_\+oasis\+\_\+map}!oasis\+\_\+map\+\_\+smatreaddnc\+\_\+ceg@{oasis\+\_\+map\+\_\+smatreaddnc\+\_\+ceg}} |
---|
161 | \index{oasis\+\_\+map\+\_\+smatreaddnc\+\_\+ceg@{oasis\+\_\+map\+\_\+smatreaddnc\+\_\+ceg}!mod\+\_\+oasis\+\_\+map@{mod\+\_\+oasis\+\_\+map}} |
---|
162 | \subsubsection{\texorpdfstring{oasis\+\_\+map\+\_\+smatreaddnc\+\_\+ceg()}{oasis\_map\_smatreaddnc\_ceg()}} |
---|
163 | {\footnotesize\ttfamily subroutine, public mod\+\_\+oasis\+\_\+map\+::oasis\+\_\+map\+\_\+smatreaddnc\+\_\+ceg (\begin{DoxyParamCaption}\item[{type(mct\+\_\+smat), dimension(\+:), intent(out), pointer}]{s\+Mat, }\item[{type(mct\+\_\+gsmap), intent(\hyperlink{namespacemod__oasis__map_aa58997467050224f6db2bc93fe5f7ca1}{in}), target}]{Sgs\+Map, }\item[{type(mct\+\_\+gsmap), intent(\hyperlink{namespacemod__oasis__map_aa58997467050224f6db2bc93fe5f7ca1}{in}), target}]{Dgs\+Map, }\item[{character($\ast$), intent(\hyperlink{namespacemod__oasis__map_aa58997467050224f6db2bc93fe5f7ca1}{in})}]{newdom, }\item[{character($\ast$), intent(\hyperlink{namespacemod__oasis__map_aa58997467050224f6db2bc93fe5f7ca1}{in})}]{file\+Name, }\item[{integer(\hyperlink{namespacemod__oasis__map_aa58997467050224f6db2bc93fe5f7ca1}{in}), intent(\hyperlink{namespacemod__oasis__map_aa58997467050224f6db2bc93fe5f7ca1}{in})}]{mytask, }\item[{integer(\hyperlink{namespacemod__oasis__map_aa58997467050224f6db2bc93fe5f7ca1}{in}), intent(\hyperlink{namespacemod__oasis__map_aa58997467050224f6db2bc93fe5f7ca1}{in})}]{mpicom, }\item[{integer(\hyperlink{namespacemod__oasis__map_aa58997467050224f6db2bc93fe5f7ca1}{in}), intent(out)}]{nwgts, }\item[{type(mct\+\_\+avect), intent(out), optional}]{areasrc, }\item[{type(mct\+\_\+avect), intent(out), optional}]{areadst, }\item[{integer(\hyperlink{namespacemod__oasis__map_aa58997467050224f6db2bc93fe5f7ca1}{in}), intent(out), optional}]{ni\+\_\+i, }\item[{integer(\hyperlink{namespacemod__oasis__map_aa58997467050224f6db2bc93fe5f7ca1}{in}), intent(out), optional}]{nj\+\_\+i, }\item[{integer(\hyperlink{namespacemod__oasis__map_aa58997467050224f6db2bc93fe5f7ca1}{in}), intent(out), optional}]{ni\+\_\+o, }\item[{integer(\hyperlink{namespacemod__oasis__map_aa58997467050224f6db2bc93fe5f7ca1}{in}), intent(out), optional}]{nj\+\_\+o }\end{DoxyParamCaption})} |
---|
164 | |
---|
165 | |
---|
166 | |
---|
167 | Read in mapping matrix data from a S\+C\+R\+IP net\+C\+DF file using smart scatter (ceg) |
---|
168 | |
---|
169 | Read in mapping matrix data from a S\+C\+R\+IP net\+C\+DF 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 s\+Mat\+Readdnc method from C\+E\+S\+M1.\+0.\+3 This routine leverages gsmaps to determine scatter pattern |
---|
170 | |
---|
171 | 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. |
---|
172 | |
---|
173 | The algorithm to determine which task a weigth belongs to involves checking the task ownership for a given global index. |
---|
174 | |
---|
175 | 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. |
---|
176 | |
---|
177 | Once all the matrix weights have been read, the s\+Mat is initialized, the values from the buffers are copied in, and everything is deallocated. |
---|
178 | |
---|
179 | |
---|
180 | \begin{DoxyParams}[1]{Parameters} |
---|
181 | \mbox{\tt out} & {\em smat} & mapping data\\ |
---|
182 | \hline |
---|
183 | \mbox{\tt in} & {\em sgsmap} & src gsmap\\ |
---|
184 | \hline |
---|
185 | \mbox{\tt in} & {\em dgsmap} & dst gsmap\\ |
---|
186 | \hline |
---|
187 | \mbox{\tt in} & {\em newdom} & type of s\+Mat (src or dst) src = rearrange and map (bfb), dst = map and rearrange (partial sums)\\ |
---|
188 | \hline |
---|
189 | \mbox{\tt in} & {\em filename} & net\+C\+DF file to read\\ |
---|
190 | \hline |
---|
191 | \mbox{\tt in} & {\em mytask} & processor id\\ |
---|
192 | \hline |
---|
193 | \mbox{\tt in} & {\em mpicom} & mpi communicator\\ |
---|
194 | \hline |
---|
195 | \mbox{\tt out} & {\em nwgts} & number of weights\\ |
---|
196 | \hline |
---|
197 | \mbox{\tt out} & {\em areasrc} & area of src grid from mapping file\\ |
---|
198 | \hline |
---|
199 | \mbox{\tt out} & {\em areadst} & area of dst grid from mapping file\\ |
---|
200 | \hline |
---|
201 | \mbox{\tt out} & {\em ni\+\_\+i} & number of lons on input grid\\ |
---|
202 | \hline |
---|
203 | \mbox{\tt out} & {\em nj\+\_\+i} & number of lats on input grid\\ |
---|
204 | \hline |
---|
205 | \mbox{\tt out} & {\em ni\+\_\+o} & number of lons on output grid\\ |
---|
206 | \hline |
---|
207 | \mbox{\tt out} & {\em nj\+\_\+o} & number of lats on output grid \\ |
---|
208 | \hline |
---|
209 | \end{DoxyParams} |
---|
210 | |
---|
211 | \begin{DoxyItemize} |
---|
212 | \item Open and read the file S\+C\+R\+IP weights size on the root task |
---|
213 | \item Read and load area\+\_\+a on root task |
---|
214 | \item Read and load area\+\_\+b on root task |
---|
215 | \item Broadcast ni and nj if requested |
---|
216 | \item Broadcast array sizes and allocate arrays for local storage |
---|
217 | \item Compute the number of chunks to read, read size is rbuf\+\_\+size |
---|
218 | \item Allocate arrays for local weights plus row and column indices |
---|
219 | \item On the root task |
---|
220 | \begin{DoxyItemize} |
---|
221 | \item Initialize lsstart, lscount, and lspeloc, the sorted list of local indices |
---|
222 | \item Sort via bubble sort or merge sort depending on size of array |
---|
223 | \item Allocate arrays for reading data on the root |
---|
224 | \item Loop over the chunks of weights data |
---|
225 | \item Read chunk of data |
---|
226 | \item Determine which process owns each weight and count them |
---|
227 | \item Determine offsets in the array |
---|
228 | \item Determine which process owns each weight and fill arrays |
---|
229 | \item Send select data from root to other processes |
---|
230 | \item Deallocate memory on root process |
---|
231 | \end{DoxyItemize} |
---|
232 | \item On non-\/root processes |
---|
233 | \begin{DoxyItemize} |
---|
234 | \item Receive data from root |
---|
235 | \item Reallocate local weights arrays if they need to be bigger |
---|
236 | \end{DoxyItemize} |
---|
237 | \item Clean up arrays |
---|
238 | \item Initialize the mct s\+Mat data type |
---|
239 | \item More clean up |
---|
240 | \end{DoxyItemize} |
---|
241 | |
---|
242 | Definition at line 931 of file mod\+\_\+oasis\+\_\+map.\+F90. |
---|
243 | |
---|
244 | \mbox{\Hypertarget{namespacemod__oasis__map_acbe7b9e25c19dbbd2fbebd3895a87d64}\label{namespacemod__oasis__map_acbe7b9e25c19dbbd2fbebd3895a87d64}} |
---|
245 | \index{mod\+\_\+oasis\+\_\+map@{mod\+\_\+oasis\+\_\+map}!oasis\+\_\+map\+\_\+smatreaddnc\+\_\+orig@{oasis\+\_\+map\+\_\+smatreaddnc\+\_\+orig}} |
---|
246 | \index{oasis\+\_\+map\+\_\+smatreaddnc\+\_\+orig@{oasis\+\_\+map\+\_\+smatreaddnc\+\_\+orig}!mod\+\_\+oasis\+\_\+map@{mod\+\_\+oasis\+\_\+map}} |
---|
247 | \subsubsection{\texorpdfstring{oasis\+\_\+map\+\_\+smatreaddnc\+\_\+orig()}{oasis\_map\_smatreaddnc\_orig()}} |
---|
248 | {\footnotesize\ttfamily subroutine, public mod\+\_\+oasis\+\_\+map\+::oasis\+\_\+map\+\_\+smatreaddnc\+\_\+orig (\begin{DoxyParamCaption}\item[{type(mct\+\_\+smat), dimension(\+:), intent(out), pointer}]{s\+Mat, }\item[{type(mct\+\_\+gsmap), intent(\hyperlink{namespacemod__oasis__map_aa58997467050224f6db2bc93fe5f7ca1}{in}), target}]{Sgs\+Map, }\item[{type(mct\+\_\+gsmap), intent(\hyperlink{namespacemod__oasis__map_aa58997467050224f6db2bc93fe5f7ca1}{in}), target}]{Dgs\+Map, }\item[{character($\ast$), intent(\hyperlink{namespacemod__oasis__map_aa58997467050224f6db2bc93fe5f7ca1}{in})}]{newdom, }\item[{character($\ast$), intent(\hyperlink{namespacemod__oasis__map_aa58997467050224f6db2bc93fe5f7ca1}{in})}]{file\+Name, }\item[{integer(\hyperlink{namespacemod__oasis__map_aa58997467050224f6db2bc93fe5f7ca1}{in}), intent(\hyperlink{namespacemod__oasis__map_aa58997467050224f6db2bc93fe5f7ca1}{in})}]{mytask, }\item[{integer(\hyperlink{namespacemod__oasis__map_aa58997467050224f6db2bc93fe5f7ca1}{in}), intent(\hyperlink{namespacemod__oasis__map_aa58997467050224f6db2bc93fe5f7ca1}{in})}]{mpicom, }\item[{integer(\hyperlink{namespacemod__oasis__map_aa58997467050224f6db2bc93fe5f7ca1}{in}), intent(out)}]{nwgts, }\item[{type(mct\+\_\+avect), intent(out), optional}]{areasrc, }\item[{type(mct\+\_\+avect), intent(out), optional}]{areadst, }\item[{integer(\hyperlink{namespacemod__oasis__map_aa58997467050224f6db2bc93fe5f7ca1}{in}), intent(out), optional}]{ni\+\_\+i, }\item[{integer(\hyperlink{namespacemod__oasis__map_aa58997467050224f6db2bc93fe5f7ca1}{in}), intent(out), optional}]{nj\+\_\+i, }\item[{integer(\hyperlink{namespacemod__oasis__map_aa58997467050224f6db2bc93fe5f7ca1}{in}), intent(out), optional}]{ni\+\_\+o, }\item[{integer(\hyperlink{namespacemod__oasis__map_aa58997467050224f6db2bc93fe5f7ca1}{in}), intent(out), optional}]{nj\+\_\+o }\end{DoxyParamCaption})} |
---|
249 | |
---|
250 | |
---|
251 | |
---|
252 | Read in mapping matrix data from a S\+C\+R\+IP net\+C\+DF weights file. |
---|
253 | |
---|
254 | Read in mapping matrix data from a S\+C\+R\+IP net\+C\+DF data file using a low memory method and then scatter to all pes. Based on the s\+Mat\+Readdnc method from C\+E\+S\+M1.\+0.\+3. This routine leverages gsmaps to determine scatter pattern. |
---|
255 | |
---|
256 | 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. |
---|
257 | |
---|
258 | 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. |
---|
259 | |
---|
260 | 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. |
---|
261 | |
---|
262 | Once all the matrix weights have been read, the s\+Mat is initialized, the values from the buffers are copied in, and everything is deallocated. |
---|
263 | |
---|
264 | |
---|
265 | \begin{DoxyParams}[1]{Parameters} |
---|
266 | \mbox{\tt out} & {\em smat} & mapping data\\ |
---|
267 | \hline |
---|
268 | \mbox{\tt in} & {\em sgsmap} & src gsmap\\ |
---|
269 | \hline |
---|
270 | \mbox{\tt in} & {\em dgsmap} & dst gsmap\\ |
---|
271 | \hline |
---|
272 | \mbox{\tt in} & {\em newdom} & type of s\+Mat (src or dst) src = rearrange and map (bfb), dst = map and rearrange (partial sums)\\ |
---|
273 | \hline |
---|
274 | \mbox{\tt in} & {\em filename} & net\+C\+DF file to read\\ |
---|
275 | \hline |
---|
276 | \mbox{\tt in} & {\em mytask} & processor id\\ |
---|
277 | \hline |
---|
278 | \mbox{\tt in} & {\em mpicom} & mpi communicator\\ |
---|
279 | \hline |
---|
280 | \mbox{\tt out} & {\em nwgts} & number of weights\\ |
---|
281 | \hline |
---|
282 | \mbox{\tt out} & {\em areasrc} & area of src grid from mapping file\\ |
---|
283 | \hline |
---|
284 | \mbox{\tt out} & {\em areadst} & area of dst grid from mapping file\\ |
---|
285 | \hline |
---|
286 | \mbox{\tt out} & {\em ni\+\_\+i} & number of lons on input grid\\ |
---|
287 | \hline |
---|
288 | \mbox{\tt out} & {\em nj\+\_\+i} & number of lats on input grid\\ |
---|
289 | \hline |
---|
290 | \mbox{\tt out} & {\em ni\+\_\+o} & number of lons on output grid\\ |
---|
291 | \hline |
---|
292 | \mbox{\tt out} & {\em nj\+\_\+o} & number of lats on output grid \\ |
---|
293 | \hline |
---|
294 | \end{DoxyParams} |
---|
295 | |
---|
296 | \begin{DoxyItemize} |
---|
297 | \item Open and read the file S\+C\+R\+IP weights size on the root task |
---|
298 | \item Read and load area\+\_\+a on root task |
---|
299 | \item Read and load area\+\_\+b on root task |
---|
300 | \item Broadcast ni and nj if requested |
---|
301 | \item Broadcast array sizes and allocate arrays for local storage |
---|
302 | \item Initialize lsstart and lscount, the sorted list of local indices |
---|
303 | \item Compute the number of chunks to read, read size is rbuf\+\_\+size |
---|
304 | \item Allocate arrays for local weights plus row and column indices |
---|
305 | \item Loop over the chunks of weights data |
---|
306 | \begin{DoxyItemize} |
---|
307 | \item Read chunk of data on root pe |
---|
308 | \item Broadcast S, row, col to all tasks |
---|
309 | \item Each task keeps only the data required |
---|
310 | \item Reallocate local weights arrays if they need to be bigger |
---|
311 | \end{DoxyItemize} |
---|
312 | \item Clean up arrays |
---|
313 | \item Initialize the mct s\+Mat data type |
---|
314 | \item More clean up |
---|
315 | \end{DoxyItemize} |
---|
316 | |
---|
317 | Definition at line 377 of file mod\+\_\+oasis\+\_\+map.\+F90. |
---|
318 | |
---|
319 | |
---|
320 | |
---|
321 | \subsection{Variable Documentation} |
---|
322 | \mbox{\Hypertarget{namespacemod__oasis__map_a8ae737bd62499fe60ebb48d04ad3b6dd}\label{namespacemod__oasis__map_a8ae737bd62499fe60ebb48d04ad3b6dd}} |
---|
323 | \index{mod\+\_\+oasis\+\_\+map@{mod\+\_\+oasis\+\_\+map}!cnew@{cnew}} |
---|
324 | \index{cnew@{cnew}!mod\+\_\+oasis\+\_\+map@{mod\+\_\+oasis\+\_\+map}} |
---|
325 | \subsubsection{\texorpdfstring{cnew}{cnew}} |
---|
326 | {\footnotesize\ttfamily integer, dimension(\+:), allocatable, private mod\+\_\+oasis\+\_\+map\+::cnew\hspace{0.3cm}{\ttfamily [private]}} |
---|
327 | |
---|
328 | |
---|
329 | |
---|
330 | Definition at line 66 of file mod\+\_\+oasis\+\_\+map.\+F90. |
---|
331 | |
---|
332 | \mbox{\Hypertarget{namespacemod__oasis__map_a479ecc5b0be5d1adf3973cb08c40d30a}\label{namespacemod__oasis__map_a479ecc5b0be5d1adf3973cb08c40d30a}} |
---|
333 | \index{mod\+\_\+oasis\+\_\+map@{mod\+\_\+oasis\+\_\+map}!cold@{cold}} |
---|
334 | \index{cold@{cold}!mod\+\_\+oasis\+\_\+map@{mod\+\_\+oasis\+\_\+map}} |
---|
335 | \subsubsection{\texorpdfstring{cold}{cold}} |
---|
336 | {\footnotesize\ttfamily integer, dimension(\+:), allocatable, private mod\+\_\+oasis\+\_\+map\+::cold\hspace{0.3cm}{\ttfamily [private]}} |
---|
337 | |
---|
338 | |
---|
339 | |
---|
340 | Definition at line 66 of file mod\+\_\+oasis\+\_\+map.\+F90. |
---|
341 | |
---|
342 | \mbox{\Hypertarget{namespacemod__oasis__map_aa58997467050224f6db2bc93fe5f7ca1}\label{namespacemod__oasis__map_aa58997467050224f6db2bc93fe5f7ca1}} |
---|
343 | \index{mod\+\_\+oasis\+\_\+map@{mod\+\_\+oasis\+\_\+map}!in@{in}} |
---|
344 | \index{in@{in}!mod\+\_\+oasis\+\_\+map@{mod\+\_\+oasis\+\_\+map}} |
---|
345 | \subsubsection{\texorpdfstring{in}{in}} |
---|
346 | {\footnotesize\ttfamily integer, parameter, private mod\+\_\+oasis\+\_\+map\+::in = ip\+\_\+i4\+\_\+p\hspace{0.3cm}{\ttfamily [private]}} |
---|
347 | |
---|
348 | |
---|
349 | |
---|
350 | Definition at line 60 of file mod\+\_\+oasis\+\_\+map.\+F90. |
---|
351 | |
---|
352 | \mbox{\Hypertarget{namespacemod__oasis__map_a0d8a50381f5e15cf11c1c845348c5062}\label{namespacemod__oasis__map_a0d8a50381f5e15cf11c1c845348c5062}} |
---|
353 | \index{mod\+\_\+oasis\+\_\+map@{mod\+\_\+oasis\+\_\+map}!local\+\_\+timers\+\_\+on@{local\+\_\+timers\+\_\+on}} |
---|
354 | \index{local\+\_\+timers\+\_\+on@{local\+\_\+timers\+\_\+on}!mod\+\_\+oasis\+\_\+map@{mod\+\_\+oasis\+\_\+map}} |
---|
355 | \subsubsection{\texorpdfstring{local\+\_\+timers\+\_\+on}{local\_timers\_on}} |
---|
356 | {\footnotesize\ttfamily logical, parameter mod\+\_\+oasis\+\_\+map\+::local\+\_\+timers\+\_\+on = .false.\hspace{0.3cm}{\ttfamily [private]}} |
---|
357 | |
---|
358 | |
---|
359 | |
---|
360 | Definition at line 68 of file mod\+\_\+oasis\+\_\+map.\+F90. |
---|
361 | |
---|
362 | \mbox{\Hypertarget{namespacemod__oasis__map_a00ad53f61b6998938fca792455487f7e}\label{namespacemod__oasis__map_a00ad53f61b6998938fca792455487f7e}} |
---|
363 | \index{mod\+\_\+oasis\+\_\+map@{mod\+\_\+oasis\+\_\+map}!prism\+\_\+mapper@{prism\+\_\+mapper}} |
---|
364 | \index{prism\+\_\+mapper@{prism\+\_\+mapper}!mod\+\_\+oasis\+\_\+map@{mod\+\_\+oasis\+\_\+map}} |
---|
365 | \subsubsection{\texorpdfstring{prism\+\_\+mapper}{prism\_mapper}} |
---|
366 | {\footnotesize\ttfamily type(\hyperlink{structmod__oasis__map_1_1prism__mapper__type}{prism\+\_\+mapper\+\_\+type}), dimension(\+:), pointer, public mod\+\_\+oasis\+\_\+map\+::prism\+\_\+mapper} |
---|
367 | |
---|
368 | |
---|
369 | |
---|
370 | list of defined mappers |
---|
371 | |
---|
372 | |
---|
373 | |
---|
374 | Definition at line 55 of file mod\+\_\+oasis\+\_\+map.\+F90. |
---|
375 | |
---|
376 | \mbox{\Hypertarget{namespacemod__oasis__map_ab15f72e9f33a67181edc977c06b951e2}\label{namespacemod__oasis__map_ab15f72e9f33a67181edc977c06b951e2}} |
---|
377 | \index{mod\+\_\+oasis\+\_\+map@{mod\+\_\+oasis\+\_\+map}!prism\+\_\+mmapper@{prism\+\_\+mmapper}} |
---|
378 | \index{prism\+\_\+mmapper@{prism\+\_\+mmapper}!mod\+\_\+oasis\+\_\+map@{mod\+\_\+oasis\+\_\+map}} |
---|
379 | \subsubsection{\texorpdfstring{prism\+\_\+mmapper}{prism\_mmapper}} |
---|
380 | {\footnotesize\ttfamily integer(kind=ip\+\_\+i4\+\_\+p), public mod\+\_\+oasis\+\_\+map\+::prism\+\_\+mmapper} |
---|
381 | |
---|
382 | |
---|
383 | |
---|
384 | max mappers |
---|
385 | |
---|
386 | |
---|
387 | |
---|
388 | Definition at line 53 of file mod\+\_\+oasis\+\_\+map.\+F90. |
---|
389 | |
---|
390 | \mbox{\Hypertarget{namespacemod__oasis__map_af543b83ec5bed63a4448ff641137b0c5}\label{namespacemod__oasis__map_af543b83ec5bed63a4448ff641137b0c5}} |
---|
391 | \index{mod\+\_\+oasis\+\_\+map@{mod\+\_\+oasis\+\_\+map}!prism\+\_\+nmapper@{prism\+\_\+nmapper}} |
---|
392 | \index{prism\+\_\+nmapper@{prism\+\_\+nmapper}!mod\+\_\+oasis\+\_\+map@{mod\+\_\+oasis\+\_\+map}} |
---|
393 | \subsubsection{\texorpdfstring{prism\+\_\+nmapper}{prism\_nmapper}} |
---|
394 | {\footnotesize\ttfamily integer(kind=ip\+\_\+i4\+\_\+p), public mod\+\_\+oasis\+\_\+map\+::prism\+\_\+nmapper = 0} |
---|
395 | |
---|
396 | |
---|
397 | |
---|
398 | mapper counter |
---|
399 | |
---|
400 | |
---|
401 | |
---|
402 | Definition at line 54 of file mod\+\_\+oasis\+\_\+map.\+F90. |
---|
403 | |
---|
404 | \mbox{\Hypertarget{namespacemod__oasis__map_a30ebe320b9e4c06a1ee1f2a0bbacf2c4}\label{namespacemod__oasis__map_a30ebe320b9e4c06a1ee1f2a0bbacf2c4}} |
---|
405 | \index{mod\+\_\+oasis\+\_\+map@{mod\+\_\+oasis\+\_\+map}!r8@{r8}} |
---|
406 | \index{r8@{r8}!mod\+\_\+oasis\+\_\+map@{mod\+\_\+oasis\+\_\+map}} |
---|
407 | \subsubsection{\texorpdfstring{r8}{r8}} |
---|
408 | {\footnotesize\ttfamily integer, parameter, private mod\+\_\+oasis\+\_\+map\+::r8 = ip\+\_\+double\+\_\+p\hspace{0.3cm}{\ttfamily [private]}} |
---|
409 | |
---|
410 | |
---|
411 | |
---|
412 | Definition at line 59 of file mod\+\_\+oasis\+\_\+map.\+F90. |
---|
413 | |
---|
414 | \mbox{\Hypertarget{namespacemod__oasis__map_a2575785d3ea5e1a37c7f6303f00eb727}\label{namespacemod__oasis__map_a2575785d3ea5e1a37c7f6303f00eb727}} |
---|
415 | \index{mod\+\_\+oasis\+\_\+map@{mod\+\_\+oasis\+\_\+map}!rnew@{rnew}} |
---|
416 | \index{rnew@{rnew}!mod\+\_\+oasis\+\_\+map@{mod\+\_\+oasis\+\_\+map}} |
---|
417 | \subsubsection{\texorpdfstring{rnew}{rnew}} |
---|
418 | {\footnotesize\ttfamily integer, dimension(\+:), allocatable, private mod\+\_\+oasis\+\_\+map\+::rnew\hspace{0.3cm}{\ttfamily [private]}} |
---|
419 | |
---|
420 | |
---|
421 | |
---|
422 | Definition at line 65 of file mod\+\_\+oasis\+\_\+map.\+F90. |
---|
423 | |
---|
424 | \mbox{\Hypertarget{namespacemod__oasis__map_a2931a6f582d0173cc0e6b155b8cb55b7}\label{namespacemod__oasis__map_a2931a6f582d0173cc0e6b155b8cb55b7}} |
---|
425 | \index{mod\+\_\+oasis\+\_\+map@{mod\+\_\+oasis\+\_\+map}!rold@{rold}} |
---|
426 | \index{rold@{rold}!mod\+\_\+oasis\+\_\+map@{mod\+\_\+oasis\+\_\+map}} |
---|
427 | \subsubsection{\texorpdfstring{rold}{rold}} |
---|
428 | {\footnotesize\ttfamily integer, dimension(\+:), allocatable, private mod\+\_\+oasis\+\_\+map\+::rold\hspace{0.3cm}{\ttfamily [private]}} |
---|
429 | |
---|
430 | |
---|
431 | |
---|
432 | Definition at line 65 of file mod\+\_\+oasis\+\_\+map.\+F90. |
---|
433 | |
---|
434 | \mbox{\Hypertarget{namespacemod__oasis__map_a28b59479c467c58995c6300071ca140a}\label{namespacemod__oasis__map_a28b59479c467c58995c6300071ca140a}} |
---|
435 | \index{mod\+\_\+oasis\+\_\+map@{mod\+\_\+oasis\+\_\+map}!snew@{snew}} |
---|
436 | \index{snew@{snew}!mod\+\_\+oasis\+\_\+map@{mod\+\_\+oasis\+\_\+map}} |
---|
437 | \subsubsection{\texorpdfstring{snew}{snew}} |
---|
438 | {\footnotesize\ttfamily real(\hyperlink{namespacemod__oasis__map_a30ebe320b9e4c06a1ee1f2a0bbacf2c4}{r8}), dimension(\+:,\+:), allocatable, private mod\+\_\+oasis\+\_\+map\+::snew\hspace{0.3cm}{\ttfamily [private]}} |
---|
439 | |
---|
440 | |
---|
441 | |
---|
442 | Definition at line 64 of file mod\+\_\+oasis\+\_\+map.\+F90. |
---|
443 | |
---|
444 | \mbox{\Hypertarget{namespacemod__oasis__map_a1fc7e7f295910352524d442c5d0dbf79}\label{namespacemod__oasis__map_a1fc7e7f295910352524d442c5d0dbf79}} |
---|
445 | \index{mod\+\_\+oasis\+\_\+map@{mod\+\_\+oasis\+\_\+map}!sold@{sold}} |
---|
446 | \index{sold@{sold}!mod\+\_\+oasis\+\_\+map@{mod\+\_\+oasis\+\_\+map}} |
---|
447 | \subsubsection{\texorpdfstring{sold}{sold}} |
---|
448 | {\footnotesize\ttfamily real(\hyperlink{namespacemod__oasis__map_a30ebe320b9e4c06a1ee1f2a0bbacf2c4}{r8}), dimension(\+:,\+:), allocatable, private mod\+\_\+oasis\+\_\+map\+::sold\hspace{0.3cm}{\ttfamily [private]}} |
---|
449 | |
---|
450 | |
---|
451 | |
---|
452 | Definition at line 64 of file mod\+\_\+oasis\+\_\+map.\+F90. |
---|
453 | |
---|