Changeset 418 for XIOS/trunk


Ignore:
Timestamp:
01/25/13 18:02:36 (11 years ago)
Author:
ymipsl
Message:

Change inheritance order when mixed grid_ref, domain_ref and axis_ref (pour les boués du p'tit Sébastien)

YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/node/field.cpp

    r379 r418  
    478478                  << "Référence à la grille nommée \'" 
    479479                  << grid_ref.getValue() << "\' incorrecte"); 
    480          if (!domain_ref.isEmpty()) 
    481             DEBUG(<< "Définition conjointe de la grille " 
    482                   << "et du domaine, la grille prévaut..." ); 
    483          if (!axis_ref.isEmpty()) 
    484             DEBUG(<< "Définition conjointe de la grille " 
    485                   << "et de l'axe vertical, la grille prévaut...") ; 
    486       } 
    487       else 
    488       { 
    489          if (!domain_ref.isEmpty()) 
    490          { 
    491             if (!axis_ref.isEmpty()) 
    492             { 
    493                this->grid = CGrid::createGrid(domain, axis) ; 
    494                this->grid_ref.setValue(this->grid->getId()); 
    495             } 
    496             else 
    497             { 
    498                this->grid = CGrid::createGrid(domain) ; 
    499                this->grid_ref.setValue(this->grid->getId()); 
    500             } 
    501          } 
    502          else 
    503          { 
     480      } 
     481       
     482      if (grid_ref.isEmpty() &&  domain_ref.isEmpty()) 
     483      { 
    504484            ERROR("CField::solveGridReference(void)", 
    505485                  << "Le domaine horizontal pour le champ X n'est pas défini"); 
    506          } 
    507       } 
    508       grid->solveReference() ; 
     486 
     487     } 
     488      
     489     CType<string> goodDomain ; 
     490     CType<string> goodAxis ; 
     491     if (!grid_ref.isEmpty()) 
     492     { 
     493       if (!grid->domain_ref.isEmpty()) goodDomain=grid->domain_ref ; 
     494       if (!grid->axis_ref.isEmpty()) goodAxis=grid->axis_ref ; 
     495     } 
     496     if (!domain_ref.isEmpty()) goodDomain=domain_ref ; 
     497     if (!axis_ref.isEmpty()) goodAxis=axis_ref ; 
     498      
     499      
     500     if (goodDomain.isEmpty())  
     501     { 
     502       ERROR("CField::solveGridReference(void)", << "Le domaine horizontal pour le champ X n'est pas défini"); 
     503     } 
     504     else  
     505     { 
     506       if (CDomain::has(goodDomain)) domain = CDomain::get(goodDomain) ; 
     507       else ERROR("CField::solveGridReference(void)",<< "Référence au domaine nommé \'"<<goodDomain.get() << "\' incorrecte") ; 
     508     } 
     509  
     510     if (!goodAxis.isEmpty()) 
     511     { 
     512       if (CAxis::has(goodAxis))  axis = CAxis::get(goodAxis) ; 
     513       else  ERROR("CField::solveGridReference(void)", << "Référence à l'axe nommé \'" 
     514                  << goodAxis.get() <<"\' incorrecte") ; 
     515     }  
     516     
     517     bool nothingToDo=false ; 
     518      
     519     if (!grid_ref.isEmpty()) 
     520     { 
     521       if (!grid->domain_ref.isEmpty() && goodDomain.get() == grid->domain_ref.get()) 
     522         if (goodAxis.isEmpty()) nothingToDo=true ; 
     523         else if (!grid->axis_ref.isEmpty())  
     524                 if (grid->axis_ref.get()==goodAxis.get()) nothingToDo=true ; 
     525     } 
     526      
     527     if (!nothingToDo) 
     528     { 
     529       if (!goodAxis.isEmpty()) 
     530       { 
     531         this->grid = CGrid::createGrid(domain, axis) ; 
     532         this->grid_ref.setValue(this->grid->getId()); 
     533       } 
     534       else 
     535       { 
     536         this->grid = CGrid::createGrid(domain) ; 
     537         this->grid_ref.setValue(this->grid->getId()); 
     538       }     
     539     } 
     540 
     541     grid->solveReference() ; 
    509542   } 
    510543 
Note: See TracChangeset for help on using the changeset viewer.