Changeset 1491


Ignore:
Timestamp:
04/23/18 11:18:05 (6 years ago)
Author:
yushan
Message:

Branch EP merged with Dev_cmip6 @r1490

Location:
XIOS/dev/branch_openmp
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_openmp/inputs/COMPLETE/context_atmosphere.xml

    r1134 r1491  
    1212      <field field_ref="field_A_atm" /> 
    1313    </file> 
    14     <file id="output_atmosphere_zoom" name="output_atmosphere_zoom"> 
     14    <file id="output_atmosphere_zoom" name="output_atmosphere_zoom" > 
    1515      <field field_ref="field_A_atm_zoom" name="field_A_atm_zoom" /> 
    1616    </file> 
  • XIOS/dev/branch_openmp/src/config/file_attribute.conf

    r1460 r1491  
    2121DECLARE_ATTRIBUTE(bool,      append) 
    2222DECLARE_ENUM2(mode,          read, write) 
     23DECLARE_ATTRIBUTE(bool,      read_metadata_par) 
    2324DECLARE_ENUM7(time_counter,  centered, instant, record, exclusive, centered_exclusive, instant_exclusive, none) 
    2425DECLARE_ATTRIBUTE(StdString, time_counter_name) 
  • XIOS/dev/branch_openmp/src/io/inetcdf4.cpp

    r1463 r1491  
    77namespace xios 
    88{ 
    9   CINetCDF4::CINetCDF4(const StdString& filename, const ep_lib::MPI_Comm* comm /*= NULL*/, bool multifile /*= true*/, const StdString& timeCounterName /*= "time_counter"*/) 
     9  //CINetCDF4::CINetCDF4(const StdString& filename, const ep_lib::MPI_Comm* comm /*= NULL*/, bool multifile /*= true*/, const StdString& timeCounterName /*= "time_counter"*/) 
     10  CINetCDF4::CINetCDF4(const StdString& filename, const ep_lib::MPI_Comm* comm /*= NULL*/, bool multifile /*= true*/, 
     11                       bool readMetaDataPar /*= false*/, const StdString& timeCounterName /*= "time_counter"*/) 
    1012  { 
    1113    // Don't use parallel mode if there is only one process 
     
    1719        comm = NULL; 
    1820    } 
    19     mpi = comm && !multifile; 
     21    //mpi = comm && !multifile; 
     22    mpi = comm && !multifile && readMetaDataPar; 
    2023    ep_lib::MPI_Info info_null; 
    2124 
  • XIOS/dev/branch_openmp/src/io/inetcdf4.hpp

    r1460 r1491  
    2323      /// Constructors /// 
    2424      CINetCDF4(const StdString& filename, const ep_lib::MPI_Comm* comm = NULL, bool multifile = true, 
    25                 const StdString& timeCounterName = "time_counter"); 
     25                bool readMetaDataPar = false, const StdString& timeCounterName = "time_counter"); 
     26                //const StdString& timeCounterName = "time_counter"); 
    2627      CINetCDF4(const CINetCDF4& inetcdf4);       // Not implemented. 
    2728      CINetCDF4(const CINetCDF4* const inetcdf4); // Not implemented. 
  • XIOS/dev/branch_openmp/src/io/nc4_data_input.cpp

    r1482 r1491  
    1010namespace xios 
    1111{ 
    12   CNc4DataInput::CNc4DataInput(const StdString& filename, ep_lib::MPI_Comm comm_file, bool multifile, bool isCollective /*= true*/, const StdString& timeCounterName /*= "time_counter"*/) 
     12  //CNc4DataInput::CNc4DataInput(const StdString& filename, ep_lib::MPI_Comm comm_file, bool multifile, bool isCollective /*= true*/, const StdString& timeCounterName /*= "time_counter"*/) 
     13  CNc4DataInput::CNc4DataInput(const StdString& filename, ep_lib::MPI_Comm comm_file, bool multifile, bool isCollective /*= true*/, 
     14                               bool readMetaDataPar /*= false*/, bool ugridConvention /*= false*/, const StdString& timeCounterName /*= "time_counter"*/) 
    1315    : SuperClass() 
    14     , SuperClassWriter(filename, &comm_file, multifile, timeCounterName) 
     16    , SuperClassWriter(filename, &comm_file, multifile, readMetaDataPar, timeCounterName) 
     17    //, SuperClassWriter(filename, &comm_file, multifile, timeCounterName) 
    1518    , comm_file(comm_file) 
    1619    , filename(filename) 
    1720    , isCollective(isCollective) 
     21    , ugridConvention(ugridConvention) 
    1822    , readMetaDataDomains_(), readValueDomains_() 
    1923    , readMetaDataAxis_(), readValueAxis_() 
     
    422426      StdString boundsLonName = this->getBoundsId(lonName); 
    423427 
    424       int nbVertex = this->getNbVertex(fieldId); 
     428      if (ugridConvention && domain->nvertex.isEmpty()) 
     429      { 
     430        ERROR("void CNc4DataInput::readDomainAttributeValueFromFile(...)", 
     431          << " Attribute nvertex must be specified for domain " << domain->getDomainOutputName() 
     432          << " read from UGRID file " << this->filename << " ."<< std::endl); 
     433      } 
     434//      int nbVertex = this->getNbVertex(fieldId); 
     435      int nbVertex = (ugridConvention) ? domain->nvertex : this->getNbVertex(fieldId); 
     436       
    425437      if (!domain->nvertex.isEmpty() && (domain->nvertex != nbVertex)) 
    426438      { 
  • XIOS/dev/branch_openmp/src/io/nc4_data_input.hpp

    r1328 r1491  
    2525    /// Constructors /// 
    2626    CNc4DataInput(const StdString& filename, ep_lib::MPI_Comm comm_file, bool multifile, bool isCollective = true, 
    27                   const StdString& timeCounterName = "time_counter"); 
     27                  bool readMetaDataPar = false, bool ugridConvention = false, const StdString& timeCounterName = "time_counter"); 
     28                  //const StdString& timeCounterName = "time_counter"); 
    2829    CNc4DataInput(const CNc4DataInput& dataInput);       // Not implemented. 
    2930    CNc4DataInput(const CNc4DataInput* const dataInput); // Not implemented. 
     
    7475    const StdString filename; 
    7576    bool isCollective; 
     77    bool ugridConvention; 
    7678  }; // class CNc4DataInput 
    7779 
  • XIOS/dev/branch_openmp/src/node/context.cpp

    r1468 r1491  
    891891            if (allFiles[i]->enabled.getValue()) // Si l'attribut 'enabled' est fixé à vrai. 
    892892            { 
     893              if (allFiles[i]->output_freq.isEmpty()) 
     894              { 
     895                 ERROR("CContext::findEnabledFiles()", 
     896                     << "Mandatory attribute output_freq must be defined for file \""<<allFiles[i]->getFileOutputName() 
     897                     <<" \".") 
     898              } 
    893899              if ((initDate + allFiles[i]->output_freq.getValue()) < (initDate + this->getCalendar()->getTimeStep())) 
    894900              { 
     
    903909         else 
    904910         { 
     911           if (allFiles[i]->output_freq.isEmpty()) 
     912           { 
     913              ERROR("CContext::findEnabledFiles()", 
     914                  << "Mandatory attribute output_freq must be defined for file \""<<allFiles[i]->getFileOutputName() 
     915                  <<" \".") 
     916           } 
    905917           if ( (initDate + allFiles[i]->output_freq.getValue()) < (initDate + this->getCalendar()->getTimeStep())) 
    906918           { 
  • XIOS/dev/branch_openmp/src/node/domain.cpp

    r1460 r1491  
    15101510         ERROR("CDomain::checkBounds(void)", 
    15111511               << "Since 'bounds_lat_2d' is defined, 'latvalue_2d' must be defined too." << std::endl); 
    1512  
    1513        hasBounds = true; 
     1512       
     1513       // In case of reading UGRID bounds values are not required 
     1514       hasBounds = (!bounds_lat_1d.isEmpty() || !bounds_lat_2d.isEmpty() ); 
    15141515     } 
    15151516     else if (hasBoundValues) 
  • XIOS/dev/branch_openmp/src/node/file.cpp

    r1460 r1491  
    657657 
    658658      bool isCollective = par_access.isEmpty() || par_access == par_access_attr::collective; 
    659       #ifdef _usingEP 
    660         if (isOpen) data_out->closeFile(); 
    661         if (time_counter_name.isEmpty()) data_in = boost::shared_ptr<CDataInput>(new CNc4DataInput(oss.str(), readComm, multifile, isCollective)); 
    662         else data_in = boost::shared_ptr<CDataInput>(new CNc4DataInput(oss.str(), readComm, multifile, isCollective, time_counter_name)); 
    663         isOpen = true; 
    664       #elif _usingMPI 
    665         if (isOpen) data_out->closeFile(); 
    666         if (time_counter_name.isEmpty()) data_in = boost::shared_ptr<CDataInput>(new CNc4DataInput(oss.str(), readComm, multifile, isCollective)); 
    667         else data_in = boost::shared_ptr<CDataInput>(new CNc4DataInput(oss.str(), readComm, multifile, isCollective, time_counter_name)); 
    668         isOpen = true; 
    669       #endif 
     659      bool  readMetaDataPar = true; 
     660      if (!context->hasServer) readMetaDataPar = (read_metadata_par.isEmpty()) ? false : read_metadata_par; 
     661       
     662      if (isOpen) data_out->closeFile(); 
     663      //if (time_counter_name.isEmpty()) data_in = boost::shared_ptr<CDataInput>(new CNc4DataInput(oss.str(), readComm, multifile, isCollective)); 
     664      //else data_in = boost::shared_ptr<CDataInput>(new CNc4DataInput(oss.str(), readComm, multifile, isCollective, time_counter_name)); 
     665      bool ugridConvention = !convention.isEmpty() ? (convention == convention_attr::UGRID) : false; 
     666      if (time_counter_name.isEmpty()) 
     667        data_in = boost::shared_ptr<CDataInput>(new CNc4DataInput(oss.str(), readComm, multifile, isCollective, readMetaDataPar, ugridConvention)); 
     668      else 
     669        data_in = boost::shared_ptr<CDataInput>(new CNc4DataInput(oss.str(), readComm, multifile, isCollective, readMetaDataPar, ugridConvention, time_counter_name)); 
     670 
     671      isOpen = true; 
    670672    } 
    671673  } 
  • XIOS/dev/branch_openmp/src/test/test_remap_omp.f90

    r1468 r1491  
    144144  ENDDO 
    145145 
    146   print*, "ID = ", rank, "src_ni = ", "src_nvertex = ", src_nvertex, "src_ni_glo = ", src_ni_glo 
     146  print*, "ID = ", rank, "src_ni = ", src_ni, "src_nvertex = ", src_nvertex, "src_ni_glo = ", src_ni_glo 
    147147 
    148148  ierr=NF90_OPEN(dst_file, NF90_NOWRITE, ncid) 
     
    228228   
    229229  DO ts=1,1 
    230     CALL xios_recv_field("src_field_regular", tmp_field_0) 
    231     !CALL xios_recv_field("src_field_curvilinear", tmp_field_1) 
    232     !CALL xios_recv_field("src_field_unstructured", tmp_field_2) 
    233230    CALL xios_recv_field("src_field_regular", tmp_field_0) 
    234231    !CALL xios_recv_field("src_field_curvilinear", tmp_field_1) 
Note: See TracChangeset for help on using the changeset viewer.