Changeset 810 for XIOS/trunk/src/node/domain.cpp
 Timestamp:
 01/07/16 09:18:30 (8 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

XIOS/trunk/src/node/domain.cpp
r809 r810 503 503 bounds_lon_end=lon(ni_glo1) + lonStepEnd/2; 504 504 double errorBoundsLon = std::abs(360std::abs(bounds_lon_endbounds_lon_start)); 505 if (errorBoundsLon > NumTraits<double>::epsilon()) bounds_lon_end=bounds_lon_start+360; 505 506 // if errorBoundsLon is reasonably small (0.1 x cell size) consider it as closed in longitude 507 if (errorBoundsLon < std::abs(lonStepStart)*1e1  errorBoundsLon < std::abs(lonStepEnd)*1e1 ) 508 { 509 bounds_lon_start= (lon(0) + lon(ni_glo1)360)/2 ; 510 bounds_lon_end= (lon(0) +360 + lon(ni_glo1))/2 ; 511 } 512 506 513 for(j=0;j<nj;++j) 507 514 for(i=0;i<ni;++i) … … 516 523 517 524 boundsLat.resize(nvertexValue,nj*ni); 518 bool isNorthPole, isSouthPole ; 525 bool isNorthPole=false ; 526 bool isSouthPole=false ; 519 527 if (std::abs(90  std::abs(lat(0))) < NumTraits<double>::epsilon()) isNorthPole = true; 520 528 if (std::abs(90  std::abs(lat(nj_glo1))) < NumTraits<double>::epsilon()) isSouthPole = true; 521 529 530 // lat boundaries beyond pole the assimilate it to pole 531 // lat boundarie is relativelly close to pole (0.1 x cell size) assimilate it to pole 522 532 double latStepStart = lat(1)lat(0); 523 533 if (isNorthPole) bounds_lat_start=lat(0); 524 else bounds_lat_start=lat(0)latStepStart/2; 525 534 else 535 { 536 bounds_lat_start=lat(0)latStepStart/2; 537 if (bounds_lat_start >= 90 ) bounds_lat_start=90 ; 538 else if (bounds_lat_start <= 90 ) bounds_lat_start=90 ; 539 else if (bounds_lat_start <= 90 && bounds_lat_start >= lon(0)) 540 { 541 if ( 90bounds_lat_start <= 0.1*std::abs(latStepStart)) bounds_lat_start=90 ; 542 } 543 else if (bounds_lat_start >= 90 && bounds_lat_start <= lon(0)) 544 { 545 if ( 90 + bounds_lat_start <= 0.1*std::abs(latStepStart)) bounds_lat_start=90 ; 546 } 547 } 548 526 549 double latStepEnd = lat(nj_glo1)lat(nj_glo2); 527 550 if (isSouthPole) bounds_lat_end=lat(nj_glo1); 528 else bounds_lat_end=lat(nj_glo1)+latStepEnd/2; 529 530 // Work arround for small value close to pole, not too good for remapping 531 if (bounds_lat_start > 90.1e3) bounds_lat_start=90 ; 532 if (bounds_lat_start < 90.+1e3) bounds_lat_start=90 ; 533 if (bounds_lat_end > 90.1e3) bounds_lat_end=90 ; 534 if (bounds_lat_end < 90.+1e3) bounds_lat_end=90 ; 551 else 552 { 553 bounds_lat_end=lat(nj_glo1)+latStepEnd/2; 554 555 if (bounds_lat_end >= 90 ) bounds_lat_end=90 ; 556 else if (bounds_lat_end <= 90 ) bounds_lat_end=90 ; 557 else if (bounds_lat_end <= 90 && bounds_lat_end >= lon(nj_glo1)) 558 { 559 if ( 90bounds_lat_end <= 0.1*std::abs(latStepEnd)) bounds_lat_end=90 ; 560 } 561 else if (bounds_lat_end >= 90 && bounds_lat_end <= lon(nj_glo1)) 562 { 563 if ( 90 + bounds_lat_end <= 0.1*std::abs(latStepEnd)) bounds_lat_end=90 ; 564 } 565 } 535 566 536 567 for(j=0;j<nj;++j)
Note: See TracChangeset
for help on using the changeset viewer.