Changeset 727 for XIOS/trunk/src/node/domain.cpp
- Timestamp:
- 10/09/15 14:51:28 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/node/domain.cpp
r720 r727 174 174 if (type_attr::rectilinear == type) 175 175 { 176 this->isRedistributed_ = true; 177 176 178 CContext* context = CContext::getCurrent(); 177 179 CContextClient* client = context->client; … … 271 273 // Now fill other attributes 272 274 fillInRectilinearLonLat(); 273 this->isRedistributed_ = true;274 275 } 275 276 } … … 287 288 latvalue_1d.resize(nj); 288 289 289 double lonStep = double(360/ni_glo.getValue()); 290 double latStep = double(180/nj_glo.getValue()); 290 double lonRange = lon_end - lon_start; 291 double latRange = lat_end - lat_start; 292 293 double lonStep = lonRange/double(ni_glo.getValue()); 294 double latStep = latRange/double(nj_glo.getValue()); 291 295 292 296 // Assign lon value 293 297 for (int i = 0; i < ni; ++i) 294 298 { 295 lonvalue_1d(i) = static_cast<double>(ibegin + i) * lonStep -180 + lonStep/2; 299 if (0 == (ibegin + i)) 300 { 301 lonvalue_1d(i) = lon_start; 302 } 303 else if (ni_glo == (ibegin + i + 1)) 304 { 305 lonvalue_1d(i) = lon_end; 306 } 307 else 308 { 309 lonvalue_1d(i) = (ibegin + i) * lonStep + lon_start; 310 } 296 311 } 297 312 298 313 for (int j = 0; j < nj; ++j) 299 314 { 300 latvalue_1d(j) = static_cast<double>(jbegin + j) * latStep - 90 + latStep/2; 315 if (0 == (jbegin + j)) 316 { 317 latvalue_1d(j) = lat_start; 318 } 319 else if (nj_glo == (jbegin + j + 1)) 320 { 321 latvalue_1d(j) = lat_end; 322 } 323 else 324 { 325 latvalue_1d(j) = (jbegin + j) * latStep + lat_start; 326 } 301 327 } 302 328 } … … 307 333 const int nvertexValue = 4; 308 334 335 double boundsLonRange = bounds_lon_end - bounds_lon_start; 336 double boundsLatRange = bounds_lat_end - bounds_lat_start; 337 309 338 boundsLon.resize(nvertexValue,ni*nj); 310 339 boundsLat.resize(nvertexValue,nj*ni); 311 340 312 double lonStep = double(360/ni_glo.getValue());313 double latStep = double(180/nj_glo.getValue());341 double lonStep = boundsLonRange/double(ni_glo.getValue()); 342 double latStep = boundsLatRange/double(nj_glo.getValue()); 314 343 315 344 for(j=0;j<nj;++j) … … 317 346 { 318 347 k=j*ni+i; 319 boundsLon(0,k) = boundsLon(1,k) = (0 != (ibegin + i)) ? (ibegin + i) * lonStep -180320 : -180;321 boundsLon(2,k) = boundsLon(3,k) = ((ibegin + i + 1) != ni_glo) ? (ibegin + i +1) * lonStep -180322 : 180;323 324 boundsLat(1,k) = boundsLat(2,k) = (0 != (jbegin + j)) ? (jbegin + j) * latStep - 90325 : -90;326 boundsLat(0,k) = boundsLat(3,k) = ((jbegin + j +1) != nj_glo) ? (jbegin + j +1) * latStep - 90327 : +90;348 boundsLon(0,k) = boundsLon(1,k) = (0 != (ibegin + i)) ? (ibegin + i) * lonStep + bounds_lon_start 349 : bounds_lon_start; 350 boundsLon(2,k) = boundsLon(3,k) = ((ibegin + i + 1) != ni_glo) ? (ibegin + i +1) * lonStep + bounds_lon_start 351 : bounds_lon_end; 352 353 boundsLat(1,k) = boundsLat(2,k) = (0 != (jbegin + j)) ? (jbegin + j) * latStep + bounds_lat_start 354 : bounds_lat_start; 355 boundsLat(0,k) = boundsLat(3,k) = ((jbegin + j +1) != nj_glo) ? (jbegin + j +1) * latStep + bounds_lat_start 356 : bounds_lat_end; 328 357 } 329 358 }
Note: See TracChangeset
for help on using the changeset viewer.