Changeset 620
- Timestamp:
- 06/22/15 13:36:17 (9 years ago)
- Location:
- XIOS/trunk
- Files:
-
- 10 added
- 10 deleted
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/inputs/Version2/iodef.xml
r619 r620 11 11 <field id="field_Axis" operation="average" freq_op="3600s" grid_ref="grid_Axis" /> 12 12 <field id="field_Two_Axis" operation="average" freq_op="3600s" grid_ref="grid_Two_Axis" /> 13 <field id="field_Axis_transformed" operation="average" freq_op="3600s" field_ref="field_ Two_Axis" grid_ref="grid_Axis_tranformed" />13 <field id="field_Axis_transformed" operation="average" freq_op="3600s" field_ref="field_Axis" grid_ref="grid_Axis_tranformed" /> 14 14 <field id="field_All_Axis" operation="average" freq_op="3600s" grid_ref="grid_All_Axis" /> 15 15 <field id="field_Scalar" operation="average" freq_op="3600s" grid_ref="ScalarGrid" /> … … 19 19 <file_definition type="multiple_file" par_access="collective" output_freq="6h" output_level="10" enabled=".TRUE."> 20 20 <file id="output" name="output"> 21 <field field_ref="field_A" />21 <!-- <field field_ref="field_A" />--> 22 22 </file> 23 23 <file id="output_Axis" name="output_Axis" type="one_file"> … … 41 41 <axis id="axis_C" zoom_size="2" zoom_end="2"/> 42 42 <axis id="axis_D" /> 43 <axis id="axis_E" axis_ref="axis_ B">43 <axis id="axis_E" axis_ref="axis_D"> 44 44 <transformation type="inverse" /> 45 45 <!-- <transformation type="zoom" />--> … … 65 65 </grid> 66 66 <grid id="grid_Axis_tranformed"> 67 <axis axis_ref="axis_A" />67 <!-- <axis axis_ref="axis_A" />--> 68 68 <axis axis_ref="axis_E" /> 69 69 </grid> -
XIOS/trunk/src/client_server_mapping_distributed.hpp
r591 r620 37 37 38 38 virtual void computeServerIndexMapping(const CArray<size_t,1>& globalIndexOnClientSendToServer); 39 40 // virtual void computeServerIndexMapping(const CArray<size_t,1>& globalIndexOnClientSendToServer,41 // const CArray<int,1>& localIndexOnClientSendToServer);42 39 43 40 std::vector<int> computeConnectedServerRank(const CArray<size_t,1> globalIndexClient); … … 85 82 void resetReceivingRequestAndCount(); 86 83 87 pr ivate:84 protected: 88 85 //! Mapping of global index to the corresponding server 89 86 boost::unordered_map<size_t,int> globalIndexToServerMapping_; -
XIOS/trunk/src/node/axis.cpp
r619 r620 85 85 } 86 86 else this->ni.setValue(size); 87 87 std::cout << "value " << value << std::endl; 88 88 StdSize true_size = value.numElements(); 89 89 if (this->ni.getValue() != true_size) … … 311 311 } 312 312 313 void CAxis::setTransformations(const std::vector< ETransformationType>& transformations)313 void CAxis::setTransformations(const std::vector<CTransformation*>& transformations) 314 314 { 315 315 transformations_ = transformations; 316 } 317 318 std::vector<CTransformation*> CAxis::getAllTransformations(void) 319 { 320 if (!hasTransformation()) 321 setTransformations(this->getVirtualTransformationGroup()->getAllChildren()); 322 323 return transformations_; 316 324 } 317 325 … … 333 341 if (refer_ptr->hasTransformation()) 334 342 for (int idx = 0; idx < refAxis.size(); ++idx) 335 refAxis[idx]->setTransformations(refer_ptr->get Transformations());343 refAxis[idx]->setTransformations(refer_ptr->getAllTransformations()); 336 344 } 337 345 … … 347 355 if (node.getElementName() == tranformation) { 348 356 this->getVirtualTransformationGroup()->parseChild(node); 349 transformations_.push_back(eInverse);350 357 } 351 358 } while (node.goToNextElement()) ; 352 359 node.goToParentElement(); 353 360 } 354 } 355 356 const std::vector<ETransformationType>& CAxis::getTransformations() 357 { 358 return transformations_; 359 } 360 361 DEFINE_REF_FUNC(Axis,axis) 361 setTransformations(this->getVirtualTransformationGroup()->getAllChildren()); 362 } 363 364 DEFINE_REF_FUNC(Axis,axis) 362 365 363 366 ///--------------------------------------------------------------- -
XIOS/trunk/src/node/axis.hpp
r619 r620 95 95 96 96 bool hasTransformation(); 97 void setTransformations(const std::vector<ETransformationType>&);98 const std::vector<ETransformationType>& getTransformations();99 97 void solveInheritanceTransformation(); 98 std::vector<CTransformation*> getAllTransformations(); 100 99 101 100 public: … … 109 108 110 109 111 void checkTransformation(); 110 111 void setTransformations(const std::vector<CTransformation*>&); 112 112 private: 113 113 bool isChecked; 114 114 bool areClientAttributesChecked_; 115 115 std::set<StdString> relFiles; 116 std::vector< ETransformationType> transformations_;116 std::vector<CTransformation*> transformations_; 117 117 bool isDistributed_; 118 118 -
XIOS/trunk/src/node/field.cpp
r619 r620 549 549 } 550 550 solveGridDomainAxisRef(doSending2Sever); 551 solveCheckMaskIndex(doSending2Sever); 551 552 if (context->hasClient) 552 553 { 553 554 solveTransformedGrid(); 554 555 } 555 solveCheckMaskIndex(doSending2Sever);556 556 } 557 557 … … 804 804 gridRefOfFieldRef->transformGrid(relGridRef); 805 805 filterSources_.push_back(fieldRef); 806 transformations_ = relGridRef->getTransformations(); 807 switch (gridRefOfFieldRef->getGridElementType()) { 808 case CGrid::GRID_ONLY_AXIS: 809 filter = new CAxisFilter(gridRefOfFieldRef, relGridRef); 810 break; 811 default: 812 break; 813 } 814 setAlgorithms(); 806 // transformations_ = relGridRef->getTransformations(); 807 // switch (gridRefOfFieldRef->getGridElementType()) { 808 // case CGrid::GRID_ONLY_AXIS: 809 //// filter = new CAxisFilter(gridRefOfFieldRef, relGridRef); 810 //// break; 811 // default: 812 // filter = new CAxisFilter(gridRefOfFieldRef, relGridRef); 813 // break; 814 // } 815 // setAlgorithms(); 815 816 } 816 817 } … … 818 819 819 820 820 void CField::setAlgorithms() 821 { 822 std::vector<ETransformationType>::iterator itTrans = transformations_.begin(), 823 iteTrans = transformations_.end(); 824 std::set<ETransformationType> tmp; 825 for (; itTrans != iteTrans; ++itTrans) 826 { 827 if (tmp.end() == tmp.find(*itTrans)) 828 { 829 switch (*itTrans) { 830 case eInverse: 831 algorithms_.push_back(new CInvertAlgorithm()); 832 break; 833 default: 834 break; 821 // void CField::setAlgorithms() 822 // { 823 // std::vector<ETransformationType>::iterator itTrans = transformations_.begin(), 824 // iteTrans = transformations_.end(); 825 // std::set<ETransformationType> tmp; 826 // for (; itTrans != iteTrans; ++itTrans) 827 // { 828 // if (tmp.end() == tmp.find(*itTrans)) 829 // { 830 // switch (*itTrans) { 831 // case eInverse: 832 // algorithms_.push_back(new CInvertAlgorithm()); 833 // break; 834 // default: 835 // break; 836 // } 837 // } 838 // tmp.insert(*itTrans); 839 // } 840 // } 841 842 const std::vector<CField*>& CField::getFilterSources() 843 { 844 return filterSources_; 845 } 846 847 void CField::applyFilter(const CArray<double, 1>& dataToSend, CArray<double,1>& dataToReceive) 848 { 849 std::vector<CField*>::iterator itFilterSrc, iteFilterSrc; 850 if (!filterSources_.empty()) 851 { 852 itFilterSrc = filterSources_.begin(); iteFilterSrc = filterSources_.end(); 853 for (; itFilterSrc != iteFilterSrc; ++itFilterSrc) 854 { 855 if (0 != (*itFilterSrc)->grid->getTransformations()) 856 { 857 const std::map<int, CArray<int,1>* >& localIndexToSend = (*itFilterSrc)->grid->getTransformations()->getLocalIndexToSendFromGridSource(); 858 const std::map<int, std::vector<CArray<int,1>* > > localIndexToReceive = (*itFilterSrc)->grid->getTransformations()->getLocalIndexToReceiveOnGridDest(); 859 sendAndReceiveTransformedData(localIndexToSend, dataToSend, 860 localIndexToReceive, dataToReceive); 861 } 862 835 863 } 836 } 837 tmp.insert(*itTrans); 838 } 839 } 840 841 const std::vector<CField*>& CField::getFilterSources() 842 { 843 return filterSources_; 844 } 845 846 void CField::applyFilter() 847 { 848 filter->setInputs(filterSources_); 849 filter->setOutput(this); 850 filter->apply(algorithms_); 851 864 865 // std::cout << "it data " << (*it)->data << std::endl; 866 // std::cout << "it filtered data " << (*it)->filteredData << std::endl; 867 } 868 } 869 870 void CField::sendAndReceiveTransformedData(const std::map<int, CArray<int,1>* >& localIndexToSend, 871 const CArray<double, 1>& dataSrc, 872 const std::map<int, std::vector<CArray<int,1>* > >& localIndexToReceive, 873 CArray<double,1>& dataDest) 874 { 875 CContext* context = CContext::getCurrent(); 876 CContextClient* client=context->client; 877 878 // Sending data from field sources to do transformations 879 std::map<int, CArray<int,1>* >::const_iterator itbSend = localIndexToSend.begin(), itSend, 880 iteSend = localIndexToSend.end(); 881 int sendBuffSize = 0; 882 for (itSend = itbSend; itSend != iteSend; ++itSend) sendBuffSize = (sendBuffSize < (itSend->second)->numElements()) 883 ? (itSend->second)->numElements(): sendBuffSize; 884 double* sendBuff; 885 if (0 != sendBuffSize) sendBuff = new double [sendBuffSize]; 886 for (itSend = itbSend; itSend != iteSend; ++itSend) 887 { 888 int destRank = itSend->first; 889 CArray<int,1>* localIndex_p = itSend->second; 890 int countSize = localIndex_p->numElements(); 891 for (int idx = 0; idx < countSize; ++idx) 892 { 893 sendBuff[idx] = dataSrc((*localIndex_p)(idx)); 894 } 895 MPI_Send(sendBuff, countSize, MPI_DOUBLE, destRank, 12, client->intraComm); 896 } 897 898 // Receiving data on destination fields 899 std::map<int, std::vector<CArray<int,1>* > >::const_iterator itbRecv = localIndexToReceive.begin(), itRecv, 900 iteRecv = localIndexToReceive.end(); 901 int recvBuffSize = 0; 902 for (itRecv = itbRecv; itRecv != iteRecv; ++itRecv) recvBuffSize = (recvBuffSize < (itRecv->second).size()) 903 ? (itRecv->second).size() : recvBuffSize; 904 double* recvBuff; 905 if (0 != recvBuffSize) recvBuff = new double [recvBuffSize]; 906 for (itRecv = itbRecv; itRecv != iteRecv; ++itRecv) 907 { 908 MPI_Status status; 909 int srcRank = itRecv->first; 910 int countSize = (itRecv->second).size(); 911 MPI_Recv(recvBuff, recvBuffSize, MPI_DOUBLE, srcRank, 12, client->intraComm, &status); 912 for (int idx = 0; idx < countSize; ++idx) 913 { 914 CArray<int,1>* localIndex_p = (itRecv->second)[idx]; 915 int numIndex = localIndex_p->numElements(); 916 for (int i = 0; i < numIndex; ++i) 917 { 918 dataDest((*localIndex_p)(i)) = recvBuff[idx]; 919 } 920 } 921 } 922 923 if (0 != sendBuffSize) delete [] sendBuff; 924 if (0 != recvBuffSize) delete [] recvBuff; 852 925 } 853 926 -
XIOS/trunk/src/node/field.hpp
r619 r620 98 98 template <int N> bool updateFilteredData(CArray<double, N>& data); 99 99 template<int N> 100 void updateDataWithoutOperation(const CArray<double, N>& data);100 void updateDataWithoutOperation(const CArray<double, N>& _data, CArray<double,1>& updatedData); 101 101 bool updateDataFromExpression(const CArray<double, 1>& data); 102 102 void setDataFromExpression(const CArray<double, 1>& _data) ; … … 181 181 182 182 const std::vector<CField*>& getFilterSources(); 183 void applyFilter(); 184 void setAlgorithms(); 183 void applyFilter(const CArray<double, 1>& dataToSend, CArray<double,1>& dataToReceive); 184 void sendAndReceiveTransformedData(const std::map<int, CArray<int,1>* >& localIndexToSend, 185 const CArray<double, 1>& dataSrc, 186 const std::map<int, std::vector<CArray<int,1>* > >& localIndexToReceive, 187 CArray<double,1>& dataDest); 185 188 public : 186 189 /// Propriétés privées /// -
XIOS/trunk/src/node/field_impl.hpp
r619 r620 33 33 if (!fieldFilterSources.empty()) 34 34 { 35 itFilterSrc = fieldFilterSources.begin(); iteFilterSrc = fieldFilterSources.end(); 36 for (; itFilterSrc != iteFilterSrc; ++itFilterSrc) (*itFilterSrc)->updateDataWithoutOperation(_data); 37 (*it)->applyFilter(); 38 std::cout << "it data " << (*it)->data << std::endl; 39 std::cout << "it filtered data " << (*it)->filteredData << std::endl; 35 itFilterSrc = fieldFilterSources.begin(); 36 iteFilterSrc = fieldFilterSources.end(); 37 for (; itFilterSrc != iteFilterSrc; ++itFilterSrc) 38 { 39 (*itFilterSrc)->updateDataWithoutOperation(_data, (*itFilterSrc)->data); 40 (*it)->updateDataWithoutOperation(_data, (*it)->filteredData); 41 (*it)->applyFilter((*itFilterSrc)->data, (*it)->filteredData); 42 } 40 43 if ((*it)->hasOutputFile || (*it)->hasFieldOut) (*it)->updateFilteredData((*it)->filteredData); 44 // itFilterSrc = fieldFilterSources.begin(); iteFilterSrc = fieldFilterSources.end(); 45 // for (; itFilterSrc != iteFilterSrc; ++itFilterSrc) (*itFilterSrc)->updateDataWithoutOperation(_data); 46 // (*it)->applyFilter(); 47 // std::cout << "it data " << (*it)->data << std::endl; 48 // std::cout << "it filtered data " << (*it)->filteredData << std::endl; 49 // if ((*it)->hasOutputFile || (*it)->hasFieldOut) (*it)->updateFilteredData((*it)->filteredData); 41 50 } 42 51 else … … 70 79 71 80 template<int N> 72 void CField::updateDataWithoutOperation(const CArray<double, N>& _data )81 void CField::updateDataWithoutOperation(const CArray<double, N>& _data, CArray<double,1>& updatedData) 73 82 { 74 if ( this->data.numElements() != this->grid->storeIndex_client.numElements())83 if (updatedData.numElements() != this->grid->storeIndex_client.numElements()) 75 84 { 76 this->data.resize(this->grid->storeIndex_client.numElements());77 this->grid->inputField(_data, this->data);85 updatedData.resize(this->grid->storeIndex_client.numElements()); 86 this->grid->inputField(_data, updatedData); 78 87 } 79 88 } -
XIOS/trunk/src/node/grid.cpp
r619 r620 14 14 #include "array_new.hpp" 15 15 #include "client_server_mapping_distributed.hpp" 16 #include "invert_algorithm.hpp"17 #include "visitable.hpp"18 16 19 17 namespace xios { … … 26 24 , vDomainGroup_(), vAxisGroup_(), axisList_(), isAxisListSet(false), isDomListSet(false), clientDistribution_(0), isIndexSent(false) 27 25 , serverDistribution_(0), serverDistributionDescription_(0), clientServerMap_(0), writtenDataSize_(0), globalDim_() 28 , connectedDataSize_(), connectedServerRank_(), isDataDistributed_(true), algorithms_(), transformations_(), isTransformed_(false) 26 , connectedDataSize_(), connectedServerRank_(), isDataDistributed_(true), transformations_(0), isTransformed_(false) 27 , axisPositionInGrid_() 29 28 { 30 29 setVirtualDomainGroup(); … … 37 36 , vDomainGroup_(), vAxisGroup_(), axisList_(), isAxisListSet(false), isDomListSet(false), clientDistribution_(0), isIndexSent(false) 38 37 , serverDistribution_(0), serverDistributionDescription_(0), clientServerMap_(0), writtenDataSize_(0), globalDim_() 39 , connectedDataSize_(), connectedServerRank_(), isDataDistributed_(true), algorithms_(), transformations_(), isTransformed_(false) 38 , connectedDataSize_(), connectedServerRank_(), isDataDistributed_(true), transformations_(0), isTransformed_(false) 39 , axisPositionInGrid_() 40 40 { 41 41 setVirtualDomainGroup(); … … 53 53 if (0 != serverDistribution_) delete serverDistribution_; 54 54 if (0 != serverDistributionDescription_) delete serverDistributionDescription_; 55 for (std::vector<CGenericAlgorithm*>::iterator it = algorithms_.begin(); it != algorithms_.end(); ++it) delete *it;55 if (0 != transformations_) delete transformations_; 56 56 } 57 57 … … 324 324 { 325 325 int idx = 0; 326 std::vector<int> axisPositionMap;326 axisPositionInGrid_.resize(0); 327 327 for (int i = 0; i < axis_domain_order.numElements(); ++i) 328 328 { 329 329 if (false == axis_domain_order(i)) 330 330 { 331 axisPosition Map.push_back(idx);331 axisPositionInGrid_.push_back(idx); 332 332 ++idx; 333 333 } … … 339 339 { 340 340 if (sendAtt) 341 axisListP[i]->sendCheckedAttributes(globalDim_,axisPosition Map[i]);341 axisListP[i]->sendCheckedAttributes(globalDim_,axisPositionInGrid_[i]); 342 342 else 343 axisListP[i]->checkAttributesOnClient(globalDim_,axisPosition Map[i]);343 axisListP[i]->checkAttributesOnClient(globalDim_,axisPositionInGrid_[i]); 344 344 ++idx; 345 345 } … … 347 347 } 348 348 } 349 350 std::vector<int> CGrid::getAxisPositionInGrid() const 351 { 352 return axisPositionInGrid_; 353 } 354 349 355 350 356 //--------------------------------------------------------------- … … 759 765 { 760 766 return serverDistribution_; 767 } 768 769 const CDistributionClient* CGrid::getDistributionClient() const 770 { 771 return clientDistribution_; 761 772 } 762 773 … … 1103 1114 } 1104 1115 1105 CGrid::EElementType CGrid::getGridElementType() 1106 { 1107 EElementType gridType = GRID_ONLY_AXIS; 1108 int numElements = axis_domain_order.numElements(); 1109 if (1 == numElements) 1110 { 1111 if (true == axis_domain_order(0)) gridType = GRID_ONLY_DOMAIN; 1112 } 1113 else gridType = GRID_AXIS_DOMAIN; 1114 } 1115 1116 void CGrid::solveTransformations() 1117 { 1118 std::vector<CAxis*> axisPtr = getAxis(); 1119 for (std::vector<CAxis*>::iterator it = axisPtr.begin(); it != axisPtr.end(); ++it) 1120 { 1121 std::vector<ETransformationType> axisTransformation = (*it)->getTransformations(); 1122 std::vector<ETransformationType>::iterator itTrans = axisTransformation.begin(), 1123 iteTrans = axisTransformation.end(); 1124 for (;itTrans != iteTrans; ++ itTrans) 1125 transformations_.push_back(*itTrans); 1126 } 1127 } 1128 1129 void CGrid::setTransformationAlgorithms() 1130 { 1131 std::vector<ETransformationType>::iterator itTrans = transformations_.begin(), 1132 iteTrans = transformations_.end(); 1133 std::set<ETransformationType> tmp; 1134 for (; itTrans != iteTrans; ++itTrans) 1135 { 1136 if (tmp.end() == tmp.find(*itTrans)) 1137 { 1138 switch (*itTrans) { 1139 case eInverse: 1140 algorithms_.push_back(new CInvertAlgorithm()); 1141 break; 1142 default: 1143 break; 1144 } 1145 } 1146 tmp.insert(*itTrans); 1147 } 1148 } 1149 1150 std::vector<ETransformationType> CGrid::getTransformations() 1116 bool CGrid::isTransformed() 1117 { 1118 return isTransformed_; 1119 } 1120 1121 void CGrid::setTransformed() 1122 { 1123 isTransformed_ = true; 1124 } 1125 1126 CGridTransformation* CGrid::getTransformations() 1151 1127 { 1152 1128 return transformations_; 1153 }1154 1155 bool CGrid::isTransformed()1156 {1157 return isTransformed_;1158 }1159 1160 void CGrid::setTransformed()1161 {1162 isTransformed_ = true;1163 }1164 1165 const std::vector<CGenericAlgorithm*>& CGrid::getTransformationAlgo()1166 {1167 return algorithms_;1168 1129 } 1169 1130 … … 1189 1150 } 1190 1151 1191 EElementType gridType = getGridElementType(); 1192 CGenericTransformation* gTransform = 0; 1193 switch (gridType) { 1194 case GRID_ONLY_AXIS: 1195 gTransform = new CAxisTransformation(this->getAxis(), transformedGrid->getAxis()); 1196 break; 1197 case GRID_ONLY_DOMAIN: 1198 break; 1199 case GRID_AXIS_DOMAIN: 1200 break; 1201 default: 1202 break; 1203 } 1204 1205 transformedGrid->solveTransformations(); 1206 transformedGrid->setTransformationAlgorithms(); 1207 gTransform->apply(transformedGrid->algorithms_); 1208 if (0 != gTransform) delete gTransform; 1152 transformations_ = new CGridTransformation(transformedGrid, this); 1153 transformations_->computeTransformationMapping(); 1154 std::cout << "send index " << *(transformations_->getLocalIndexToSendFromGridSource()[0]) << std::endl; 1155 std::cout << "receive index " << *(transformations_->getLocalIndexToReceiveOnGridDest()[0][0]) << std::endl; 1209 1156 } 1210 1157 -
XIOS/trunk/src/node/grid.hpp
- Property svn:executable set to *
r619 r620 17 17 #include "utils.hpp" 18 18 #include "transformation_enum.hpp" 19 #include " visitor.hpp"19 #include "grid_transformation.hpp" 20 20 21 21 namespace xios { … … 32 32 class CServerDistributionDescription; 33 33 class CClientServerMapping; 34 class CGridTransformation; 34 35 35 36 ///-------------------------------------------------------------- … … 176 177 std::vector<int> getGlobalDimension(); 177 178 bool isScalarGrid() const; 179 std::vector<int> getAxisPositionInGrid() const; 178 180 179 181 bool doGridHaveDataToWrite(); … … 182 184 183 185 const CDistributionServer* getDistributionServer() const; 186 const CDistributionClient* getDistributionClient() const; 187 CGridTransformation* getTransformations(); 184 188 185 189 void transformGrid(CGrid* transformedGrid); 186 190 bool isTransformed(); 187 191 void setTransformed(); 188 EElementType getGridElementType();189 190 std::vector<ETransformationType> getTransformations();191 const std::vector<CGenericAlgorithm*>& getTransformationAlgo();192 // EElementType getGridElementType(); 193 // 194 // std::vector<ETransformationType> getTransformations(); 195 // const std::vector<CGenericAlgorithm*>& getTransformationAlgo(); 192 196 193 197 public: … … 207 211 void checkMask(void) ; 208 212 209 std::vector<CGenericAlgorithm*> algorithms_;210 213 private: 211 214 template<int N> … … 252 255 253 256 254 std::vector<ETransformationType> transformations_;257 // std::vector<ETransformationType> transformations_; 255 258 bool isTransformed_; 259 std::vector<int> axisPositionInGrid_; 260 CGridTransformation* transformations_; 256 261 }; // class CGrid 257 262 -
XIOS/trunk/src/test/test_new_features.f90
r619 r620 15 15 CHARACTER(len=15) :: calendar_type 16 16 TYPE(xios_context) :: ctx_hdl 17 INTEGER,PARAMETER :: ni_glo= 10018 INTEGER,PARAMETER :: nj_glo= 10019 INTEGER,PARAMETER :: llm= 1017 INTEGER,PARAMETER :: ni_glo=5 18 INTEGER,PARAMETER :: nj_glo=5 19 INTEGER,PARAMETER :: llm=5 20 20 DOUBLE PRECISION :: lval(llm)=1, tsTemp 21 21 TYPE(xios_field) :: field_hdl … … 25 25 26 26 DOUBLE PRECISION,DIMENSION(ni_glo,nj_glo) :: lon_glo,lat_glo 27 DOUBLE PRECISION :: field_A_glo(ni_glo,nj_glo,llm), lval_ni (ni_glo), lval_nj(nj_glo)28 DOUBLE PRECISION,ALLOCATABLE :: lon(:,:),lat(:,:),field_A(:,:,:), field_All_Axis(:,:,:), lonvalue(:) , field_Axis(:), lvaln(:), field_Two_Axis(:,:)27 DOUBLE PRECISION :: field_A_glo(ni_glo,nj_glo,llm), lval_ni_glo(ni_glo), lval_nj_glo(nj_glo) 28 DOUBLE PRECISION,ALLOCATABLE :: lon(:,:),lat(:,:),field_A(:,:,:), field_All_Axis(:,:,:), lonvalue(:) , field_Axis(:), lvaln(:), lval_ni(:), lval_nj(:), field_Two_Axis(:,:) 29 29 INTEGER :: ni,ibegin,iend,nj,jbegin,jend, nAxis, axisBegin, axisEnd 30 30 INTEGER :: i,j,l,ts,n … … 47 47 lon_glo(i,j)=(i-1)+(j-1)*ni_glo 48 48 lat_glo(i,j)=1000+(i-1)+(j-1)*ni_glo 49 lval_ni (i) = i-149 lval_ni_glo(i) = i-1 50 50 DO l=1,llm 51 51 field_A_glo(i,j,l)=(i-1)+(j-1)*ni_glo+10000*l 52 52 ENDDO 53 53 ENDDO 54 lval_nj (j) = j-154 lval_nj_glo(j) = j-1 55 55 ENDDO 56 56 ni=ni_glo ; ibegin=0 … … 80 80 81 81 82 ALLOCATE(lon(ni,nj),lat(ni,nj),field_A(0:ni+1,-1:nj+2,llm),lonvalue(ni*nj), field_Axis(nAxis), field_All_Axis(1:ni,1:nj,llm), lvaln(nAxis), field_Two_Axis(ni_glo,1:nj))82 ALLOCATE(lon(ni,nj),lat(ni,nj),field_A(0:ni+1,-1:nj+2,llm),lonvalue(ni*nj), field_Axis(nAxis), field_All_Axis(1:ni,1:nj,llm), lvaln(nAxis), lval_ni(ni), lval_nj(nj), field_Two_Axis(ni_glo,1:nj)) 83 83 lon(:,:)=lon_glo(ibegin+1:iend+1,jbegin+1:jend+1) 84 84 lat(:,:)=lat_glo(ibegin+1:iend+1,jbegin+1:jend+1) … … 86 86 field_Axis(1:nAxis) = field_A_glo(1,1,axisBegin+1:axisEnd+1) 87 87 field_All_Axis(1:ni,1:nj,:) = field_A_glo(ibegin+1:iend+1,jbegin+1:jend+1,:) 88 field_Two_Axis(:,1:n Axis) = field_A_glo(:,jbegin+1:jend+1,1)88 field_Two_Axis(:,1:nj) = field_A_glo(:,jbegin+1:jend+1,1) 89 89 lvaln(1:nAxis) = lval(axisBegin+1:axisEnd+1) 90 lval_nj(1:nj) = lval_nj_glo(jbegin+1:jend+1); 91 lval_ni(1:ni) = lval_ni_glo(ibegin+1:iend+1); 90 92 91 93 CALL xios_context_initialize("test",comm) … … 103 105 CALL xios_set_domain_attr("domain_A",data_dim=2, data_ibegin=-1, data_ni=ni+2, data_jbegin=-2, data_nj=nj+4) 104 106 CALL xios_set_domain_attr("domain_A",lonvalue=RESHAPE(lon,(/ni*nj/)),latvalue=RESHAPE(lat,(/ni*nj/))) 105 CALL xios_set_domain_attr("domain_A",zoom_ibegin=40, zoom_ni=20, zoom_jbegin=40, zoom_nj=10)107 ! CALL xios_set_domain_attr("domain_A",zoom_ibegin=40, zoom_ni=20, zoom_jbegin=40, zoom_nj=10) 106 108 CALL xios_set_fieldgroup_attr("field_definition",enabled=.TRUE.) 107 109
Note: See TracChangeset
for help on using the changeset viewer.