- Timestamp:
- 11/23/18 14:48:14 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_olga/src/transformation/domain_algorithm_interpolate.cpp
r1542 r1612 31 31 std::map<int, int>& elementPositionInGridDst2AxisPosition, 32 32 std::map<int, int>& elementPositionInGridDst2DomainPosition) 33 TRY 33 34 { 34 35 std::vector<CDomain*> domainListDestP = gridDst->getDomains(); … … 41 42 return (new CDomainAlgorithmInterpolate(domainListDestP[domainDstIndex], domainListSrcP[domainSrcIndex], interpolateDomain)); 42 43 } 44 CATCH 43 45 44 46 bool CDomainAlgorithmInterpolate::registerTrans() 47 TRY 45 48 { 46 49 CGridTransformationFactory<CDomain>::registerTransformation(TRANS_INTERPOLATE_DOMAIN, create); 47 50 } 51 CATCH 48 52 49 53 CDomainAlgorithmInterpolate::CDomainAlgorithmInterpolate(CDomain* domainDestination, CDomain* domainSource, CInterpolateDomain* interpDomain) 50 54 : CDomainAlgorithmTransformation(domainDestination, domainSource), interpDomain_(interpDomain), writeToFile_(false), readFromFile_(false) 55 TRY 51 56 { 52 57 CContext* context = CContext::getCurrent(); … … 93 98 94 99 } 100 CATCH 95 101 96 102 /*! … … 98 104 */ 99 105 void CDomainAlgorithmInterpolate::computeRemap() 106 TRY 100 107 { 101 108 using namespace sphereRemap; … … 399 406 400 407 } 408 CATCH 401 409 402 410 void CDomainAlgorithmInterpolate::processPole(std::map<int,std::vector<std::pair<int,double> > >& interMapValuePole, 403 411 int nbGlobalPointOnPole) 412 TRY 404 413 { 405 414 CContext* context = CContext::getCurrent(); … … 468 477 469 478 } 479 CATCH 470 480 471 481 /*! … … 473 483 */ 474 484 void CDomainAlgorithmInterpolate::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 485 TRY 475 486 { 476 487 if (readFromFile_) … … 481 492 } 482 493 } 494 CATCH 483 495 484 496 void CDomainAlgorithmInterpolate::writeRemapInfo(std::map<int,std::vector<std::pair<int,double> > >& interpMapValue) 497 TRY 485 498 { 486 499 writeInterpolationInfo(fileToReadWrite_, interpMapValue); 487 500 } 501 CATCH 488 502 489 503 void CDomainAlgorithmInterpolate::readRemapInfo() 504 TRY 490 505 { 491 506 std::map<int,std::vector<std::pair<int,double> > > interpMapValue; … … 494 509 exchangeRemapInfo(interpMapValue); 495 510 } 511 CATCH 496 512 497 513 void CDomainAlgorithmInterpolate::convertRemapInfo(std::map<int,std::vector<std::pair<int,double> > >& interpMapValue) 514 TRY 498 515 { 499 516 CContext* context = CContext::getCurrent(); … … 520 537 } 521 538 } 539 CATCH 522 540 523 541 /*! … … 525 543 */ 526 544 void CDomainAlgorithmInterpolate::exchangeRemapInfo(std::map<int,std::vector<std::pair<int,double> > >& interpMapValue) 545 TRY 527 546 { 528 547 CContext* context = CContext::getCurrent(); … … 704 723 delete [] recvBuff; 705 724 } 725 CATCH 706 726 707 727 /*! Redefined some functions of CONetCDF4 to make use of them */ … … 710 730 int CDomainAlgorithmInterpolate::WriteNetCdf::addDimensionWrite(const StdString& name, 711 731 const StdSize size) 732 TRY 712 733 { 713 734 return CONetCDF4::addDimension(name, size); 714 735 } 736 CATCH 715 737 716 738 int CDomainAlgorithmInterpolate::WriteNetCdf::addVariableWrite(const StdString& name, nc_type type, 717 739 const std::vector<StdString>& dim) 740 TRY 718 741 { 719 742 return CONetCDF4::addVariable(name, type, dim); 720 743 } 744 CATCH 721 745 722 746 void CDomainAlgorithmInterpolate::WriteNetCdf::endDefinition() 747 TRY 723 748 { 724 749 CONetCDF4::definition_end(); 725 750 } 751 CATCH 726 752 727 753 void CDomainAlgorithmInterpolate::WriteNetCdf::writeDataIndex(const CArray<int,1>& data, const StdString& name, … … 729 755 const std::vector<StdSize>* start, 730 756 const std::vector<StdSize>* count) 757 TRY 731 758 { 732 759 CONetCDF4::writeData<int,1>(data, name, collective, record, start, count); 733 760 } 761 CATCH 734 762 735 763 void CDomainAlgorithmInterpolate::WriteNetCdf::writeDataIndex(const CArray<double,1>& data, const StdString& name, … … 737 765 const std::vector<StdSize>* start, 738 766 const std::vector<StdSize>* count) 767 TRY 739 768 { 740 769 CONetCDF4::writeData<double,1>(data, name, collective, record, start, count); 741 770 } 771 CATCH 742 772 743 773 /* … … 748 778 void CDomainAlgorithmInterpolate::writeInterpolationInfo(std::string& filename, 749 779 std::map<int,std::vector<std::pair<int,double> > >& interpMapValue) 780 TRY 750 781 { 751 782 CContext* context = CContext::getCurrent(); … … 827 858 netCdfWriter.closeFile(); 828 859 } 860 CATCH 829 861 830 862 /*! … … 836 868 void CDomainAlgorithmInterpolate::readInterpolationInfo(std::string& filename, 837 869 std::map<int,std::vector<std::pair<int,double> > >& interpMapValue) 870 TRY 838 871 { 839 872 int ncid ; … … 894 927 interpMapValue[dstIndex[ind]-indexOffset].push_back(make_pair(srcIndex[ind]-indexOffset,weight[ind])); 895 928 } 929 CATCH 896 930 897 931 void CDomainAlgorithmInterpolate::apply(const std::vector<std::pair<int,double> >& localIndex, … … 900 934 std::vector<bool>& flagInitial, 901 935 bool ignoreMissingValue, bool firstPass ) 936 TRY 902 937 { 903 938 int nbLocalIndex = localIndex.size(); … … 941 976 } 942 977 } 978 CATCH 943 979 944 980 void CDomainAlgorithmInterpolate::updateData(CArray<double,1>& dataOut) 981 TRY 945 982 { 946 983 if (detectMissingValue) … … 961 998 } 962 999 } 963 964 } 1000 CATCH 1001 1002 }
Note: See TracChangeset
for help on using the changeset viewer.