Ignore:
Timestamp:
08/24/21 13:48:12 (3 years ago)
Author:
ymipsl
Message:

New feature : when can now use the syntax :
fieldId:domainId[n], in domain reference inside the workflow (XML). Same for axis and scalar.

YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.cpp

    r2203 r2206  
    327327  CATCH 
    328328 
    329   CDomain* CField::getAssociatedDomain(const string& domainId) const 
    330   { 
    331     if (grid_==nullptr) ERROR("CDomain* CField::getAssociatedDomain(const string& domainId)", <<" field with id="<<getId()<<" has no associated grid, " 
     329  CDomain* CField::getAssociatedDomain(const string& domainId, bool noError) const 
     330  { 
     331    if (grid_==nullptr) 
     332    {  
     333      if (noError) return nullptr ; 
     334      else ERROR("CDomain* CField::getAssociatedDomain(const string& domainId)", <<" field with id="<<getId()<<" has no associated grid, " 
    332335                              <<"check if the worklfow is enabled for this field"); 
    333     grid_->getAssociatedDomain(domainId) ; 
    334   } 
    335  
    336   CAxis* CField::getAssociatedAxis(const string& axisId) const 
    337   { 
    338     if (grid_==nullptr) ERROR("CAxis* CField::getAssociatedAxis(const string& axisId)", <<" field with id="<<getId()<<" has no associated grid, " 
     336    } 
     337    return grid_->getAssociatedDomain(domainId, noError) ; 
     338  } 
     339 
     340  CAxis* CField::getAssociatedAxis(const string& axisId, bool noError) const 
     341  { 
     342    if (grid_==nullptr)  
     343    { 
     344      if (noError) return nullptr ; 
     345      else  ERROR("CAxis* CField::getAssociatedAxis(const string& axisId)", <<" field with id="<<getId()<<" has no associated grid, " 
    339346                              <<"check if the worklfow is enabled for this field"); 
    340     grid_->getAssociatedAxis(axisId) ; 
    341   } 
    342  
    343   CScalar* CField::getAssociatedScalar(const string& scalarId) const 
    344   { 
    345     if (grid_==nullptr) ERROR("CScalar* CField::getAssociatedScalar(const string& scalarId)", <<" field with id="<<getId()<<" has no associated grid, " 
     347    } 
     348    return grid_->getAssociatedAxis(axisId, noError) ; 
     349  } 
     350 
     351  CScalar* CField::getAssociatedScalar(const string& scalarId, bool noError) const 
     352  { 
     353    if (grid_==nullptr)  
     354    {  
     355      if (noError) return nullptr ; 
     356      else ERROR("CScalar* CField::getAssociatedScalar(const string& scalarId)", <<" field with id="<<getId()<<" has no associated grid, " 
    346357                              <<"check if the worklfow is enabled for this field"); 
    347     grid_->getAssociatedScalar(scalarId) ; 
     358    } 
     359    return grid_->getAssociatedScalar(scalarId, noError) ; 
    348360  } 
    349361 
     
    618630    solveGridReference() ; // grid_ is now defined 
    619631    if (!isGridCompleted()) return false; 
     632    if (grid_->activateFieldWorkflow(gc)==false) return false; // workflow graph cannot be built at this stage 
    620633 
    621634    // Check if we have an expression to parse 
     
    11811194      if (!domain_ref.isEmpty()) 
    11821195      { 
    1183         StdString tmp = domain_ref.getValue(); 
     1196        CField* field=CDomain::getFieldFromId(domain_ref) ; 
     1197        if (field!=nullptr) field->solveGridReference() ; 
    11841198        if (CDomain::has(domain_ref)) 
    11851199        { 
     
    11951209      if (!axis_ref.isEmpty()) 
    11961210      { 
     1211        CField* field=CAxis::getFieldFromId(axis_ref) ; 
     1212        if (field!=nullptr) field->solveGridReference() ; 
    11971213        if (CAxis::has(axis_ref)) 
    11981214        { 
     
    12081224      if (!scalar_ref.isEmpty()) 
    12091225      { 
     1226        CField* field=CScalar::getFieldFromId(scalar_ref) ; 
     1227        if (field!=nullptr) field->solveGridReference() ; 
    12101228        if (CScalar::has(scalar_ref)) 
    12111229        { 
Note: See TracChangeset for help on using the changeset viewer.