Ignore:
Timestamp:
03/22/22 15:52:41 (2 years ago)
Author:
ymipsl
Message:

fix missing workflow dependcy when using grid_ref with field Id.
YM

File:
1 edited

Legend:

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

    r2311 r2315  
    212212     if (CGrid::get(id,true)==nullptr) return false ; 
    213213     else return true ; 
     214   } 
     215    
     216   CField* CGrid::getFieldFromId(const string& id) 
     217   { 
     218     const regex r("::"); 
     219     smatch m; 
     220     if (regex_search(id, m, r)) 
     221     { 
     222        if (m.size()!=1) ERROR("CField* CGrid::getFieldFromId(const string& id)", <<" id = "<<id<< "  -> bad format id, separator :: append more than one time"); 
     223        string fieldId=m.prefix() ; 
     224        if (fieldId.empty()) ERROR("CField* CGrid::getFieldFromId(const string& id)", <<" id = "<<id<< "  -> bad format id, field name is empty"); 
     225        string suffix=m.suffix() ; 
     226        if (!suffix.empty()) ERROR("CField* CGrid::getFieldFromId(const string& id)", <<" id = "<<id<< "  -> bad format id, suffix is not empty"); 
     227        if (!CField::has(fieldId)) ERROR("CField* CGrid::getFieldFromId(const string& id)", <<" id = "<<id<< "  -> field Id : < "<<fieldId<<" > doesn't exist"); 
     228        return CField::get(fieldId) ; 
     229     }  
     230     else return nullptr ; 
    214231   } 
    215232 
Note: See TracChangeset for help on using the changeset viewer.