Changeset 1583 for XIOS/dev/dev_olga/src
- Timestamp:
- 10/02/18 11:05:38 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_olga/src/transformation/domain_algorithm_zoom.cpp
r1553 r1583 63 63 // Calculate the size of local domain 64 64 int ind, indLocSrc, indLocDest, iIdxSrc, jIdxSrc, destIBegin = -1, destJBegin = -1, niDest = 0, njDest = 0, ibeginDest, jbeginDest ; 65 int indGloDest, indGloSrc, niGloSrc = domainSrc_->ni_glo, iSrc, jSrc ;65 int indGloDest, indGloSrc, niGloSrc = domainSrc_->ni_glo, iSrc, jSrc, nvertex = 0; 66 66 for (int j = 0; j < domainSrc_->nj.getValue(); j++) 67 67 { … … 119 119 domainDest_->latvalue_1d.resize(niDest); 120 120 } 121 else if (domainDest_->type == CDomain::type_attr::curvilinear) 122 { 123 domainDest_->lonvalue_1d.resize(niDest*njDest); 124 domainDest_->latvalue_1d.resize(niDest*njDest); 125 } 121 126 } 122 127 else if (!domainSrc_->lonvalue_2d.isEmpty()) … … 128 133 if (domainSrc_->hasBounds) 129 134 { 130 if (!domainSrc_->bounds_lon_2d.isEmpty()) 131 { 132 domainDest_->bounds_lon_2d.resize(domainDest_->nvertex, niDest, njDest); 133 domainDest_->bounds_lon_2d.resize(domainDest_->nvertex, niDest, njDest); 134 } 135 else if (!domainSrc_->bounds_lon_1d.isEmpty()) 136 { 137 domainDest_->bounds_lon_1d.resize(domainDest_->nvertex, niDest); 138 domainDest_->bounds_lon_1d.resize(domainDest_->nvertex, niDest); 135 nvertex = domainSrc_->nvertex; 136 domainDest_->nvertex.setValue(nvertex); 137 if (!domainSrc_->bounds_lon_1d.isEmpty()) 138 { 139 if (domainDest_->type == CDomain::type_attr::rectilinear) 140 { 141 domainDest_->bounds_lon_1d.resize(nvertex, niDest); 142 domainDest_->bounds_lat_1d.resize(nvertex, njDest); 143 } 144 else if (domainDest_->type == CDomain::type_attr::unstructured) 145 { 146 domainDest_->bounds_lon_1d.resize(nvertex, niDest); 147 domainDest_->bounds_lat_1d.resize(nvertex, niDest); 148 } 149 else if (domainDest_->type == CDomain::type_attr::curvilinear) 150 { 151 domainDest_->bounds_lon_1d.resize(nvertex, niDest*njDest); 152 domainDest_->bounds_lat_1d.resize(nvertex, niDest*njDest); 153 } 154 } 155 else if (!domainSrc_->bounds_lon_2d.isEmpty()) 156 { 157 domainDest_->bounds_lon_2d.resize(nvertex, niDest, njDest); 158 domainDest_->bounds_lat_2d.resize(nvertex, niDest, njDest); 139 159 } 140 160 } … … 168 188 domainDest_->area(iDest,jDest) = domainSrc_->area(iSrc,jSrc); 169 189 190 if (domainSrc_->hasLonLat) 191 { 192 if (!domainSrc_->latvalue_1d.isEmpty()) 193 { 194 if (domainDest_->type == CDomain::type_attr::rectilinear) 195 { 196 domainDest_->latvalue_1d(jDest) = domainSrc_->latvalue_1d(jSrc); 197 } 198 else 199 { 200 domainDest_->lonvalue_1d(indLocDest) = domainSrc_->lonvalue_1d(ind); 201 domainDest_->latvalue_1d(indLocDest) = domainSrc_->latvalue_1d(ind); 202 } 203 } 204 else if (!domainSrc_->latvalue_2d.isEmpty()) 205 { 206 domainDest_->lonvalue_2d(iDest,jDest) = domainSrc_->lonvalue_2d(iSrc,jSrc); 207 domainDest_->latvalue_2d(iDest,jDest) = domainSrc_->latvalue_2d(iSrc,jSrc); 208 } 209 } 210 170 211 if (domainSrc_->hasBounds) 171 212 { 172 if (!domainSrc_->bounds_lon_2d.isEmpty()) 173 { 174 for (int n = 0; n < domainSrc_->nvertex; ++n) 213 if (!domainSrc_->bounds_lon_1d.isEmpty()) 214 { 215 if (domainDest_->type == CDomain::type_attr::rectilinear) 216 { 217 for (int n = 0; n < nvertex; ++n) 218 domainDest_->bounds_lat_1d(n,jDest) = domainSrc_->bounds_lat_1d(n,jSrc); 219 } 220 else 221 { 222 for (int n = 0; n < nvertex; ++n) 223 { 224 domainDest_->bounds_lon_1d(n,indLocDest) = domainSrc_->bounds_lon_1d(n,ind); 225 domainDest_->bounds_lat_1d(n,indLocDest) = domainSrc_->bounds_lat_1d(n,ind); 226 } 227 } 228 } 229 else if (!domainSrc_->bounds_lon_2d.isEmpty()) 230 { 231 for (int n = 0; n < nvertex; ++n) 175 232 { 176 233 domainDest_->bounds_lon_2d(n,iDest,jDest) = domainSrc_->bounds_lon_2d(n,iSrc,jSrc); … … 178 235 } 179 236 } 180 else if (!domainSrc_->bounds_lon_1d.isEmpty()) 181 { 182 for (int n = 0; n < domainSrc_->nvertex; ++n) 183 { 184 domainDest_->bounds_lon_1d(n,iDest) = domainSrc_->bounds_lon_1d(n,iSrc); 185 domainDest_->bounds_lat_1d(n,iDest) = domainSrc_->bounds_lat_1d(n,iSrc); 186 } 187 } 188 } 189 190 if (domainSrc_->hasLonLat) 191 { 192 if (domainDest_->type == CDomain::type_attr::rectilinear) 193 { 194 domainDest_->latvalue_1d(jDest) = domainSrc_->latvalue_1d(jSrc); 195 } 196 else if (domainDest_->type == CDomain::type_attr::curvilinear) 197 { 198 domainDest_->lonvalue_2d(iDest,jDest) = domainSrc_->lonvalue_2d(iSrc,jSrc); 199 domainDest_->latvalue_2d(iDest,jDest) = domainSrc_->latvalue_2d(iSrc,jSrc); 200 } 237 201 238 } 202 239 203 240 transMap[indGloDest].push_back(indGloSrc); 204 241 transWeight[indGloDest].push_back(1.0); 205 206 } 207 if (domainSrc_->hasLonLat )208 { 209 if (domainDest_->type == CDomain::type_attr:: unstructured)242 } 243 244 if (domainSrc_->hasLonLat && !domainSrc_->latvalue_1d.isEmpty()) 245 { 246 if (domainDest_->type == CDomain::type_attr::rectilinear) 210 247 { 211 248 domainDest_->lonvalue_1d(iDest) = domainSrc_->lonvalue_1d(iSrc); 212 domainDest_->latvalue_1d(iDest) = domainSrc_->latvalue_1d(iSrc); 213 } 214 else if (domainDest_->type == CDomain::type_attr::rectilinear) 215 { 216 domainDest_->lonvalue_1d(iDest) = domainSrc_->lonvalue_1d(iSrc); 249 } 250 } 251 252 if (domainSrc_->hasBounds && !domainSrc_->bounds_lon_1d.isEmpty()) 253 { 254 if (domainDest_->type == CDomain::type_attr::rectilinear) 255 { 256 for (int n = 0; n < nvertex; ++n) 257 domainDest_->bounds_lon_1d(n,iDest) = domainSrc_->bounds_lon_1d(n,iSrc); 217 258 } 218 259 }
Note: See TracChangeset
for help on using the changeset viewer.