Changeset 688 for XIOS/trunk/src/node/domain.cpp
- Timestamp:
- 09/15/15 17:31:06 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/node/domain.cpp
r687 r688 215 215 else 216 216 { 217 float njGlo = nj_glo.getValue(); 218 float niGlo = ni_glo.getValue(); 219 int nbProcOnX, nbProcOnY, range; 220 217 221 // Compute (approximately) number of segment on x and y axis 218 float yOverXRatio = (nj_glo.getValue())/(ni_glo.getValue());219 int nbProcOnX, nbProcOnY, range; 222 float yOverXRatio = njGlo/niGlo; 223 220 224 nbProcOnX = std::ceil(std::sqrt(nbLocalDomain/yOverXRatio)); 221 225 nbProcOnY = std::ceil(((float)nbLocalDomain)/nbProcOnX); … … 266 270 // Now fill other attributes 267 271 fillInRectilinearLonLat(); 272 // fillInRectilinearBoundLonLat(); 268 273 } 269 274 } … … 280 285 lonvalue_1d.resize(ni); 281 286 latvalue_1d.resize(nj); 287 282 288 double lonStep = double(360/ni_glo.getValue()); 283 289 double latStep = double(180/nj_glo.getValue()); … … 286 292 for (int i = 0; i < ni; ++i) 287 293 { 288 lonvalue_1d(i) = static_cast<double>(ibegin + i) * lonStep ;294 lonvalue_1d(i) = static_cast<double>(ibegin + i) * lonStep -180 + lonStep/2; 289 295 } 290 296 291 297 for (int j = 0; j < nj; ++j) 292 298 { 293 latvalue_1d(j) = static_cast<double>(jbegin + j) * latStep - 90; 294 } 299 latvalue_1d(j) = static_cast<double>(jbegin + j) * latStep - 90 + latStep/2; 300 } 301 } 302 303 void CDomain::fillInRectilinearBoundLonLat(CArray<double,2>& boundsLon, CArray<double,2>& boundsLat) 304 { 305 int i,j,k; 306 const int nvertexValue = 4; 307 308 boundsLon.resize(nvertexValue,ni*nj); 309 boundsLat.resize(nvertexValue,nj*ni); 310 311 double lonStep = double(360/ni_glo.getValue()); 312 double latStep = double(180/nj_glo.getValue()); 313 314 for(j=0;j<nj;++j) 315 for(i=0;i<ni;++i) 316 { 317 k=j*ni+i; 318 boundsLon(0,k) = boundsLon(1,k) = (0 != (ibegin + i)) ? (ibegin + i) * lonStep -180 319 : -180; 320 boundsLon(2,k) = boundsLon(3,k) = ((ibegin + i + 1) != ni_glo) ? (ibegin + i +1) * lonStep -180 321 : 180; 322 323 boundsLat(1,k) = boundsLat(2,k) = (0 != (jbegin + j)) ? (jbegin + j) * latStep - 90 324 : -90; 325 boundsLat(0,k) = boundsLat(3,k) = ((jbegin + j +1) != nj_glo) ? (jbegin + j +1) * latStep - 90 326 : +90; 327 } 295 328 } 296 329 … … 625 658 } 626 659 } 660 lonvalue_1d.free(); 627 661 } 628 662 … … 666 700 } 667 701 } 702 lonvalue_2d.free(); 668 703 } 669 704
Note: See TracChangeset
for help on using the changeset viewer.