- Timestamp:
- 12/11/18 13:22:07 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/transformation/domain_algorithm_interpolate.cpp
r1617 r1622 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; … … 418 425 419 426 } 427 CATCH 420 428 421 429 void CDomainAlgorithmInterpolate::processPole(std::map<int,std::vector<std::pair<int,double> > >& interMapValuePole, 422 430 int nbGlobalPointOnPole) 431 TRY 423 432 { 424 433 CContext* context = CContext::getCurrent(); … … 487 496 488 497 } 498 CATCH 489 499 490 500 /*! … … 492 502 */ 493 503 void CDomainAlgorithmInterpolate::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 504 TRY 494 505 { 495 506 if (readFromFile_) … … 500 511 } 501 512 } 513 CATCH 502 514 503 515 void CDomainAlgorithmInterpolate::writeRemapInfo(std::map<int,std::vector<std::pair<int,double> > >& interpMapValue) 516 TRY 504 517 { 505 518 writeInterpolationInfo(fileToReadWrite_, interpMapValue); 506 519 } 520 CATCH 507 521 508 522 void CDomainAlgorithmInterpolate::readRemapInfo() 523 TRY 509 524 { 510 525 std::map<int,std::vector<std::pair<int,double> > > interpMapValue; … … 513 528 exchangeRemapInfo(interpMapValue); 514 529 } 530 CATCH 515 531 516 532 void CDomainAlgorithmInterpolate::convertRemapInfo(std::map<int,std::vector<std::pair<int,double> > >& interpMapValue) 533 TRY 517 534 { 518 535 CContext* context = CContext::getCurrent(); … … 539 556 } 540 557 } 558 CATCH 541 559 542 560 /*! … … 544 562 */ 545 563 void CDomainAlgorithmInterpolate::exchangeRemapInfo(std::map<int,std::vector<std::pair<int,double> > >& interpMapValue) 564 TRY 546 565 { 547 566 CContext* context = CContext::getCurrent(); … … 723 742 delete [] recvBuff; 724 743 } 744 CATCH 725 745 726 746 /*! Redefined some functions of CONetCDF4 to make use of them */ … … 729 749 int CDomainAlgorithmInterpolate::WriteNetCdf::addDimensionWrite(const StdString& name, 730 750 const StdSize size) 751 TRY 731 752 { 732 753 return CONetCDF4::addDimension(name, size); 733 754 } 755 CATCH 734 756 735 757 int CDomainAlgorithmInterpolate::WriteNetCdf::addVariableWrite(const StdString& name, nc_type type, 736 758 const std::vector<StdString>& dim) 759 TRY 737 760 { 738 761 return CONetCDF4::addVariable(name, type, dim); 739 762 } 763 CATCH 740 764 741 765 void CDomainAlgorithmInterpolate::WriteNetCdf::endDefinition() 766 TRY 742 767 { 743 768 CONetCDF4::definition_end(); 744 769 } 770 CATCH 745 771 746 772 void CDomainAlgorithmInterpolate::WriteNetCdf::writeDataIndex(const CArray<int,1>& data, const StdString& name, … … 748 774 const std::vector<StdSize>* start, 749 775 const std::vector<StdSize>* count) 776 TRY 750 777 { 751 778 CONetCDF4::writeData<int,1>(data, name, collective, record, start, count); 752 779 } 780 CATCH 753 781 754 782 void CDomainAlgorithmInterpolate::WriteNetCdf::writeDataIndex(const CArray<double,1>& data, const StdString& name, … … 756 784 const std::vector<StdSize>* start, 757 785 const std::vector<StdSize>* count) 786 TRY 758 787 { 759 788 CONetCDF4::writeData<double,1>(data, name, collective, record, start, count); 760 789 } 790 CATCH 761 791 762 792 /* … … 767 797 void CDomainAlgorithmInterpolate::writeInterpolationInfo(std::string& filename, 768 798 std::map<int,std::vector<std::pair<int,double> > >& interpMapValue) 799 TRY 769 800 { 770 801 CContext* context = CContext::getCurrent(); … … 846 877 netCdfWriter.closeFile(); 847 878 } 879 CATCH 848 880 849 881 /*! … … 855 887 void CDomainAlgorithmInterpolate::readInterpolationInfo(std::string& filename, 856 888 std::map<int,std::vector<std::pair<int,double> > >& interpMapValue) 889 TRY 857 890 { 858 891 int ncid ; … … 913 946 interpMapValue[dstIndex[ind]-indexOffset].push_back(make_pair(srcIndex[ind]-indexOffset,weight[ind])); 914 947 } 948 CATCH 915 949 916 950 void CDomainAlgorithmInterpolate::apply(const std::vector<std::pair<int,double> >& localIndex, … … 919 953 std::vector<bool>& flagInitial, 920 954 bool ignoreMissingValue, bool firstPass ) 955 TRY 921 956 { 922 957 int nbLocalIndex = localIndex.size(); … … 960 995 } 961 996 } 997 CATCH 962 998 963 999 void CDomainAlgorithmInterpolate::updateData(CArray<double,1>& dataOut) 1000 TRY 964 1001 { 965 1002 if (detectMissingValue) … … 983 1020 } 984 1021 } 985 986 } 1022 CATCH 1023 1024 }
Note: See TracChangeset
for help on using the changeset viewer.