Changeset 689
- Timestamp:
- 09/15/15 17:31:13 (9 years ago)
- Location:
- XIOS/trunk
- Files:
-
- 2 added
- 2 deleted
- 14 edited
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/inputs/REMAP/iodef.xml
r688 r689 9 9 <field id="src_field" operation="instant" grid_ref="src_grid"/> 10 10 <field id="dst_field" operation="instant" field_ref="src_field" grid_ref="dst_grid"/> 11 <field id="dst_field_regular" operation="instant" field_ref="src_field" grid_ref="dst_grid_regular"/> 11 12 </field_definition> 12 13 … … 14 15 <file_definition type="multiple_file" par_access="collective" output_freq="1ts" output_level="10" enabled=".TRUE."> 15 16 <file id="output" name="output"> 16 <!-- <field field_ref="src_field" name="field" />-->17 <field field_ref="src_field" name="field" /> 17 18 </file> 18 19 <file id="output_dst" name="output_dst"> 19 20 <field field_ref="dst_field" name="field" /> 21 </file> 22 <file id="output_dst_regular" name="output_dst_regular"> 23 <field field_ref="dst_field_regular" name="field" /> 20 24 </file> 21 25 </file_definition> … … 28 32 <domain id="src_domain" /> 29 33 <domain id="dst_domain" domain_src="src_domain"> 34 <interpolate_domain file="weight.nc"/> 35 </domain> 36 <domain id="dst_domain_regular" domain_src="src_domain"> 30 37 <generate_rectilinear_domain /> 31 <interpolate_ from_file_domain file="weight.nc"/>38 <interpolate_domain/> 32 39 </domain> 33 40 </domain_definition> … … 36 43 <grid id="dst_grid"> 37 44 <domain domain_ref="dst_domain" /> 45 </grid> 46 <grid id="dst_grid_regular"> 47 <domain domain_ref="dst_domain_regular" /> 38 48 </grid> 39 49 <grid id="src_grid"> -
XIOS/trunk/src/config/interpolate_domain_attribute.conf
r688 r689 1 1 /* GLOBAL */ 2 2 DECLARE_ATTRIBUTE(StdString, file) 3 DECLARE_ATTRIBUTE(int, order) -
XIOS/trunk/src/config/node_type.conf
r687 r689 47 47 #endif //__XIOS_CZoomDomain__ 48 48 49 #ifdef __XIOS_CInterpolate FromFileDomain__50 DECLARE_NODE(Interpolate FromFileDomain, interpolate_from_file_domain)51 #endif //__XIOS_CInterpolate FromFileDomain__49 #ifdef __XIOS_CInterpolateDomain__ 50 DECLARE_NODE(InterpolateDomain, interpolate_domain) 51 #endif //__XIOS_CInterpolateDomain__ 52 52 53 53 #ifdef __XIOS_CGenerateRectilinearDomain__ -
XIOS/trunk/src/group_factory_decl.cpp
r687 r689 29 29 macro(CInterpolateAxisGroup) 30 30 macro(CZoomDomainGroup) 31 macro(CInterpolate FromFileDomainGroup)31 macro(CInterpolateDomainGroup) 32 32 macro(CGenerateRectilinearDomainGroup) 33 33 } -
XIOS/trunk/src/group_template_decl.cpp
r687 r689 18 18 macro(InterpolateAxis) 19 19 macro(ZoomDomain) 20 macro(Interpolate FromFileDomain)20 macro(InterpolateDomain) 21 21 macro(GenerateRectilinearDomain) 22 22 -
XIOS/trunk/src/node/domain.cpp
r688 r689 19 19 #include "client_server_mapping_distributed.hpp" 20 20 #include "zoom_domain.hpp" 21 #include "interpolate_ from_file_domain.hpp"21 #include "interpolate_domain.hpp" 22 22 #include "generate_rectilinear_domain.hpp" 23 23 … … 1782 1782 StdString zoomDomainDefRoot("zoom_domain_definition"); 1783 1783 StdString zoom("zoom_domain"); 1784 StdString interp FromFileDomainDefRoot("interpolate_from_file_domain_definition");1785 StdString interpFromFile("interpolate_ from_file_domain");1784 StdString interpDomainDefRoot("interpolate_domain_definition"); 1785 StdString interpFromFile("interpolate_domain"); 1786 1786 StdString generateRectilinearDefRoot("generate_rectilinear_domain_definition"); 1787 1787 StdString generateRectilinear("generate_rectilinear_domain"); … … 1795 1795 else if (node.getElementName() == interpFromFile) 1796 1796 { 1797 CInterpolate FromFileDomain* tmp = (CInterpolateFromFileDomainGroup::get(interpFromFileDomainDefRoot))->createChild();1797 CInterpolateDomain* tmp = (CInterpolateDomainGroup::get(interpDomainDefRoot))->createChild(); 1798 1798 tmp->parse(node); 1799 transformationMap_.push_back(std::make_pair(TRANS_INTERPOLATE_DOMAIN _FROM_FILE,tmp));1799 transformationMap_.push_back(std::make_pair(TRANS_INTERPOLATE_DOMAIN,tmp)); 1800 1800 } 1801 1801 else if (node.getElementName() == generateRectilinear) -
XIOS/trunk/src/node/interpolate_domain.hpp
r688 r689 1 #ifndef __XIOS_CInterpolate FromFileDomain__2 #define __XIOS_CInterpolate FromFileDomain__1 #ifndef __XIOS_CInterpolateDomain__ 2 #define __XIOS_CInterpolateDomain__ 3 3 4 4 /// xios headers /// … … 16 16 namespace xios { 17 17 /// ////////////////////// Déclarations ////////////////////// /// 18 class CInterpolate FromFileDomainGroup;19 class CInterpolate FromFileDomainAttributes;20 class CInterpolate FromFileDomain;18 class CInterpolateDomainGroup; 19 class CInterpolateDomainAttributes; 20 class CInterpolateDomain; 21 21 class CDomain; 22 22 … … 24 24 25 25 // Declare/Define CFileAttribute 26 BEGIN_DECLARE_ATTRIBUTE_MAP(CInterpolate FromFileDomain)27 #include "interpolate_ from_file_domain_attribute.conf"28 END_DECLARE_ATTRIBUTE_MAP(CInterpolate FromFileDomain)26 BEGIN_DECLARE_ATTRIBUTE_MAP(CInterpolateDomain) 27 #include "interpolate_domain_attribute.conf" 28 END_DECLARE_ATTRIBUTE_MAP(CInterpolateDomain) 29 29 30 30 ///-------------------------------------------------------------- 31 31 /*! 32 \class CInterpolate FromFileDomain32 \class CInterpolateDomain 33 33 This class describes interpolate_from_file_domain in xml file. 34 34 */ 35 class CInterpolate FromFileDomain36 : public CObjectTemplate<CInterpolate FromFileDomain>37 , public CInterpolate FromFileDomainAttributes35 class CInterpolateDomain 36 : public CObjectTemplate<CInterpolateDomain> 37 , public CInterpolateDomainAttributes 38 38 , public CTransformation<CDomain> 39 39 { 40 40 public : 41 typedef CObjectTemplate<CInterpolate FromFileDomain> SuperClass;42 typedef CInterpolate FromFileDomainAttributes SuperClassAttribute;41 typedef CObjectTemplate<CInterpolateDomain> SuperClass; 42 typedef CInterpolateDomainAttributes SuperClassAttribute; 43 43 44 44 public : 45 45 /// Constructeurs /// 46 CInterpolate FromFileDomain(void);47 explicit CInterpolate FromFileDomain(const StdString& id);46 CInterpolateDomain(void); 47 explicit CInterpolateDomain(const StdString& id); 48 48 49 49 /// Destructeur /// 50 virtual ~CInterpolate FromFileDomain(void);50 virtual ~CInterpolateDomain(void); 51 51 52 52 virtual void checkValid(CDomain* axisDest); … … 58 58 private: 59 59 60 }; // class CInterpolate FromFileDomain60 }; // class CInterpolateDomain 61 61 62 DECLARE_GROUP(CInterpolate FromFileDomain);62 DECLARE_GROUP(CInterpolateDomain); 63 63 } // namespace xios 64 64 65 #endif // __XIOS_CInterpolate FromFileDomain__65 #endif // __XIOS_CInterpolateDomain__ -
XIOS/trunk/src/node/node_enum.hpp
r687 r689 24 24 eInterpolateAxis, 25 25 eZoomDomain, 26 eInterpolate FromFileDomain,26 eInterpolateDomain, 27 27 eGenerateRectilinearDomain 28 28 -
XIOS/trunk/src/node/node_type.hpp
r687 r689 14 14 #include "interpolate_axis.hpp" 15 15 #include "zoom_domain.hpp" 16 #include "interpolate_ from_file_domain.hpp"16 #include "interpolate_domain.hpp" 17 17 #include "generate_rectilinear_domain.hpp" 18 18 -
XIOS/trunk/src/node/transformation_enum.hpp
r687 r689 11 11 TRANS_INTERPOLATE_AXIS, 12 12 TRANS_ZOOM_DOMAIN, 13 TRANS_INTERPOLATE_DOMAIN _FROM_FILE,13 TRANS_INTERPOLATE_DOMAIN, 14 14 TRANS_GENERATE_RECTILINEAR_DOMAIN 15 15 } ETranformationType; -
XIOS/trunk/src/object_factory_decl.cpp
r687 r689 28 28 macro(CInterpolateAxis) 29 29 macro(CZoomDomain) 30 macro(CInterpolate FromFileDomain)30 macro(CInterpolateDomain) 31 31 macro(CGenerateRectilinearDomain) 32 32 … … 42 42 macro(CInterpolateAxisGroup) 43 43 macro(CZoomDomainGroup) 44 macro(CInterpolate FromFileDomainGroup)44 macro(CInterpolateDomainGroup) 45 45 macro(CGenerateRectilinearDomainGroup) 46 46 } -
XIOS/trunk/src/object_template_decl.cpp
r687 r689 17 17 template class CObjectTemplate<CInterpolateAxis>; 18 18 template class CObjectTemplate<CZoomDomain>; 19 template class CObjectTemplate<CInterpolate FromFileDomain>;19 template class CObjectTemplate<CInterpolateDomain>; 20 20 template class CObjectTemplate<CGenerateRectilinearDomain>; 21 21 … … 31 31 template class CObjectTemplate<CInterpolateAxisGroup>; 32 32 template class CObjectTemplate<CZoomDomainGroup>; 33 template class CObjectTemplate<CInterpolate FromFileDomainGroup>;33 template class CObjectTemplate<CInterpolateDomainGroup>; 34 34 template class CObjectTemplate<CGenerateRectilinearDomainGroup>; 35 35 } -
XIOS/trunk/src/test/test_remap.f90
r688 r689 115 115 bounds_lon_1D=src_boundslon, bounds_lat_1D=src_boundslat, nvertex=src_nvertex) 116 116 117 !CALL xios_set_domain_attr("dst_domain", ni_glo=dst_ni_glo, ibegin=dst_ibegin, ni=dst_ni, type="unstructured")117 CALL xios_set_domain_attr("dst_domain", ni_glo=dst_ni_glo, ibegin=dst_ibegin, ni=dst_ni, type="unstructured") 118 118 CALL xios_set_domain_attr("dst_domain", lonvalue_1D=dst_lon, latvalue_1D=dst_lat, & 119 119 bounds_lon_1D=dst_boundslon, bounds_lat_1D=dst_boundslat, nvertex=dst_nvertex) 120 120 121 CALL xios_set_domain_attr("dst_domain_regular", ni_glo=180, nj_glo=90, type="rectilinear") 121 122 122 123 dtime%second = 3600 -
XIOS/trunk/src/transformation/domain_algorithm_interpolate.cpp
r688 r689 3 3 \author Ha NGUYEN 4 4 \since 09 Jul 2015 5 \date 1 1Sep 20155 \date 15 Sep 2015 6 6 7 7 \brief Algorithm for interpolation on a domain. 8 8 */ 9 #include "domain_algorithm_interpolate _from_file.hpp"9 #include "domain_algorithm_interpolate.hpp" 10 10 #include <boost/unordered_map.hpp> 11 11 #include "context.hpp" … … 18 18 namespace xios { 19 19 20 CDomainAlgorithmInterpolate FromFile::CDomainAlgorithmInterpolateFromFile(CDomain* domainDestination, CDomain* domainSource, CInterpolateFromFileDomain* interpDomain)20 CDomainAlgorithmInterpolate::CDomainAlgorithmInterpolate(CDomain* domainDestination, CDomain* domainSource, CInterpolateDomain* interpDomain) 21 21 : CDomainAlgorithmTransformation(domainDestination, domainSource), interpDomain_(interpDomain) 22 22 { … … 25 25 } 26 26 27 void CDomainAlgorithmInterpolateFromFile::computeRemap() 27 /*! 28 Compute remap with integrated remap calculation module 29 */ 30 void CDomainAlgorithmInterpolate::computeRemap() 28 31 { 29 32 using namespace sphereRemap; … … 33 36 int clientRank = client->clientRank; 34 37 int i, j, k, idx; 35 double srcPole[] = {0, 0, 0}; 36 double dstPole[] = {0, 0, 1}; 37 int orderInterp = 2; 38 std::vector<double> srcPole(3,0), dstPole(3,0); 39 int orderInterp = interpDomain_->order.getValue(); 38 40 39 41 int constNVertex = 4; // Value by default number of vertex for rectangular domain … … 49 51 CArray<double,2> boundsLatSrc(nVertexSrc,localDomainSrcSize); 50 52 53 if (CDomain::type_attr::rectilinear == domainSrc_->type) srcPole[2] = 1; 51 54 if (hasBoundSrc) // Suppose that domain source is curvilinear or unstructured 52 55 { … … 82 85 CArray<double,2> boundsLatDest(nVertexDest,localDomainDestSize); 83 86 87 if (CDomain::type_attr::rectilinear == domainDest_->type) dstPole[2] = 1; 84 88 if (hasBoundDest) 85 89 { … … 107 111 // Ok, fill in boundary values for rectangular domain 108 112 domainDest_->fillInRectilinearBoundLonLat(boundsLonDest, boundsLatDest); 109 nVertexDest = 4;113 nVertexDest = constNVertex; 110 114 } 111 115 … … 115 119 Mapper mapper(client->intraComm); 116 120 mapper.setVerbosity(PROGRESS) ; 117 mapper.setSourceMesh(boundsLonSrc.dataFirst(), boundsLatSrc.dataFirst(), nVertexSrc, nSrcLocal, srcPole);118 mapper.setTargetMesh(boundsLonDest.dataFirst(), boundsLatDest.dataFirst(), nVertexDest, nDstLocal, dstPole);121 mapper.setSourceMesh(boundsLonSrc.dataFirst(), boundsLatSrc.dataFirst(), nVertexSrc, nSrcLocal, &srcPole[0]); 122 mapper.setTargetMesh(boundsLonDest.dataFirst(), boundsLatDest.dataFirst(), nVertexDest, nDstLocal, &dstPole[0]); 119 123 std::vector<double> timings = mapper.computeWeights(orderInterp); 120 124 … … 126 130 } 127 131 128 void CDomainAlgorithmInterpolateFromFile::computeIndexSourceMapping()129 {130 computeRemap();131 }132 133 134 132 /*! 135 133 Compute the index mapping between domain on grid source and one on grid destination 136 134 */ 137 void CDomainAlgorithmInterpolateFromFile::readRemapInfo() 135 void CDomainAlgorithmInterpolate::computeIndexSourceMapping() 136 { 137 if (!interpDomain_->file.isEmpty()) 138 readRemapInfo(); 139 else 140 computeRemap(); 141 } 142 143 /*! 144 Read remap information from file then distribute it among clients 145 */ 146 void CDomainAlgorithmInterpolate::readRemapInfo() 138 147 { 139 148 CContext* context = CContext::getCurrent(); … … 312 321 corresponding global index of domain and associated weight value on grid source 313 322 */ 314 void CDomainAlgorithmInterpolate FromFile::readInterpolationInfo(std::string& filename,323 void CDomainAlgorithmInterpolate::readInterpolationInfo(std::string& filename, 315 324 std::map<int,std::vector<std::pair<int,double> > >& interpMapValue) 316 325 { -
XIOS/trunk/src/transformation/grid_transformation.cpp
r688 r689 12 12 #include "axis_algorithm_interpolate.hpp" 13 13 #include "domain_algorithm_zoom.hpp" 14 #include "domain_algorithm_interpolate _from_file.hpp"14 #include "domain_algorithm_interpolate.hpp" 15 15 #include "context.hpp" 16 16 #include "context_client.hpp" … … 276 276 277 277 CZoomDomain* zoomDomain = 0; 278 CInterpolate FromFileDomain* interpFileDomain = 0;278 CInterpolateDomain* interpFileDomain = 0; 279 279 CGenericAlgorithmTransformation* algo = 0; 280 280 switch (transType) 281 281 { 282 case TRANS_INTERPOLATE_DOMAIN _FROM_FILE:283 interpFileDomain = dynamic_cast<CInterpolate FromFileDomain*> (it->second);284 algo = new CDomainAlgorithmInterpolate FromFile(domainListDestP[domainIndex], domainListSrcP[domainIndex],interpFileDomain);282 case TRANS_INTERPOLATE_DOMAIN: 283 interpFileDomain = dynamic_cast<CInterpolateDomain*> (it->second); 284 algo = new CDomainAlgorithmInterpolate(domainListDestP[domainIndex], domainListSrcP[domainIndex],interpFileDomain); 285 285 break; 286 286 case TRANS_ZOOM_DOMAIN: … … 312 312 switch (transType) 313 313 { 314 case TRANS_INTERPOLATE_DOMAIN _FROM_FILE:314 case TRANS_INTERPOLATE_DOMAIN: 315 315 case TRANS_ZOOM_DOMAIN: 316 316 domainIndex = elementPosition2DomainPositionInGrid_[elementPositionInGrid]; … … 494 494 if (searchCurrentSrc.search(itbIndex, iteIndex, globalIndexOfCurrentGridSourceToSend[idx], itIndex)) 495 495 { 496 // int index = std::distance(itbArr, itArr); 497 sendBuff[idx+currentBuffPosition] = globalIndexOfOriginalGridSource_[*itIndex]; //[index]; 496 sendBuff[idx+currentBuffPosition] = globalIndexOfOriginalGridSource_[*itIndex]; 498 497 } 499 498 } -
XIOS/trunk/src/type/type_util.hpp
r687 r689 28 28 class CZoomDomain; 29 29 class CZoomDomainGroup; 30 class CInterpolate FromFileDomain;31 class CInterpolate FromFileDomainGroup;30 class CInterpolateDomain; 31 class CInterpolateDomainGroup; 32 32 class CGenerateRectilinearDomain; 33 33 class CGenerateRectilinearDomainGroup; … … 76 76 macro(CZoomDomain) 77 77 macro(CZoomDomainGroup) 78 macro(CInterpolate FromFileDomain)79 macro(CInterpolate FromFileDomainGroup)78 macro(CInterpolateDomain) 79 macro(CInterpolateDomainGroup) 80 80 macro(CGenerateRectilinearDomain) 81 81 macro(CGenerateRectilinearDomainGroup) -
XIOS/trunk/src/xml_parser_decl.cpp
r687 r689 23 23 macro( InterpolateAxis ) 24 24 macro( ZoomDomain ) 25 macro( Interpolate FromFileDomain )25 macro( InterpolateDomain ) 26 26 macro( GenerateRectilinearDomain ) 27 27 }
Note: See TracChangeset
for help on using the changeset viewer.