Changeset 138 for XMLIO_V2/dev/dev_rv


Ignore:
Timestamp:
12/10/10 16:04:54 (13 years ago)
Author:
hozdoba
Message:

Mise à jour

Location:
XMLIO_V2/dev/dev_rv/src/XMLIO
Files:
26 edited

Legend:

Unmodified
Added
Removed
  • XMLIO_V2/dev/dev_rv/src/XMLIO/NetCDF4_data_output.hpp

    r137 r138  
    77namespace XMLIOSERVER 
    88{ 
    9  
    109   static const char* TimeName = "time"; 
    1110 
     
    8180         } 
    8281 
    83          void writeCoords(const string& id, const Array<double, 1>& cdata) 
     82         void writeCoords(const string& id, const Array<double, 1>& cdata, const CDomain * dom = NULL) 
    8483         { 
    8584            NcVar *cVar = dataFile->get_var(id.c_str()); 
    8685 
    87             if (!cVar->put(cdata.dataFirst(), cdata.size())) 
    88                throw XMLIOUndefinedValueException 
    89                   ("Impossible d'écrire les valeurs de coordonnées "+ id +" !"); 
     86            if (dom == NULL) 
     87            { 
     88               if (!cVar->put(cdata.dataFirst(), cdata.size())) 
     89                  XMLIOError 
     90                     ("Impossible d'écrire les valeurs de coordonnées "+ id +" !"); 
     91            } 
     92            else 
     93            { 
     94               if( dom->lonvalue.getValueConst()->size() == (dom->ni * dom->nj)) 
     95               { // curvilineaire 
     96                  if (!cVar->put(cdata.dataFirst(), dom->nj, dom->ni)) 
     97                     XMLIOError 
     98                        ("Impossible d'écrire les valeurs de coordonnées "+ id +" !"); 
     99               } 
     100               else 
     101               { // rectilineaire 
     102                  if (!cVar->put(cdata.dataFirst(), cdata.size())) 
     103                     XMLIOError 
     104                        ("Impossible d'écrire les valeurs de coordonnées "+ id +" !"); 
     105               } 
     106            } 
    90107         } 
    91108 
     
    108125 
    109126               if (!(oVar = dataFile->add_var(cid.c_str(), ncDouble, dataFile->get_dim(TimeName)))) 
    110                   throw XMLIOUndefinedValueException 
     127                  XMLIOError 
    111128                     ("Impossible d'ajouter la coordonnée temporelle "+cid+" !"); 
    112129 
     
    131148            dataFile = new NcFile(filename.c_str(), NcFile::Replace); 
    132149            if(!dataFile->is_valid()) 
    133                throw XMLIOUndefinedValueException 
     150               XMLIOError 
    134151                  ("Impossible d'ouvrir le fichier '"+ filename +"' pour l'écriture des données' !"); 
    135152 
     
    152169            for (it = allDim.begin() ; it != allDim.end(); it++) 
    153170               if (NULL == dataFile->add_dim((*it).first.c_str(), (*it).second)) 
    154                   throw XMLIOUndefinedValueException("Impossible d'ajouter la dimension "+ (*it).first +" !"); 
     171                  XMLIOError("Impossible d'ajouter la dimension "+ (*it).first +" !"); 
    155172 
    156173            // Ajout de la dimension temporelle non limitée. 
    157174            if (withTime) 
    158175               if (NULL == dataFile->add_dim(TimeName)) 
    159                   throw XMLIOUndefinedValueException("Impossible d'ajouter la dimension temporelle !"); 
     176                  XMLIOError("Impossible d'ajouter la dimension temporelle !"); 
    160177         } 
    161178 
     
    175192            for ( itt = sdom.begin() ; itt != sdom.end(); itt++ ) 
    176193            { 
    177                string domid = ((*itt)->name.hasValue()) ? (string)(*itt)->name : (*itt)->getId(); 
    178                string lonid = (sdom.size() == 1)? string("lon"): string("lon_").append(domid); 
    179                string latid = (sdom.size() == 1)? string("lat"): string("lat_").append(domid); 
    180  
    181                if (!(latVar = dataFile->add_var(latid.c_str(), ncFloat, dataFile->get_dim(latid.c_str())))) 
    182                   throw XMLIOUndefinedValueException("Impossible d'ajouter la variable de latitude !"); 
    183  
    184                if (!(lonVar = dataFile->add_var(lonid.c_str(), ncFloat, dataFile->get_dim(lonid.c_str())))) 
    185                   throw XMLIOUndefinedValueException("Impossible d'ajouter la variable de longitude !"); 
     194               string domid = (*itt)->name.hasValue() 
     195                              ? (string)(*itt)->name : (*itt)->getId(); 
     196               string lonid = (sdom.size() == 1) 
     197                              ? string("lon"): string("lon_").append(domid); 
     198               string latid = (sdom.size() == 1) 
     199                              ? string("lat"): string("lat_").append(domid); 
     200 
     201 
     202               if( (*itt)->lonvalue.getValueConst()->size() == ((*itt)->ni * (*itt)->nj)) 
     203               { // cas curvilinéaire 
     204 
     205                  string clonid = (sdom.size() == 1) 
     206                                  ? string("nav_lon"): string("nav_lon_").append(domid); 
     207                  string clatid = (sdom.size() == 1) 
     208                                  ? string("nav_lat"): string("nav_lat_").append(domid); 
     209                  if (!(latVar = dataFile->add_var(clatid.c_str(), ncFloat, 
     210                                 dataFile->get_dim(latid.c_str()), dataFile->get_dim(lonid.c_str())))) 
     211                     XMLIOError("Impossible d'ajouter la variable de latitude !"); 
     212 
     213                  if (!(lonVar = dataFile->add_var(clonid.c_str(), ncFloat, 
     214                                 dataFile->get_dim(latid.c_str()), dataFile->get_dim(lonid.c_str())))) 
     215                     XMLIOError("Impossible d'ajouter la variable de longitude !"); 
     216 
     217                  lonid = clonid; // beurk 
     218                  latid = clatid; 
     219               } 
     220               else 
     221               { // cas rectilineaire 
     222                  if (!(latVar = dataFile->add_var(latid.c_str(), ncFloat, dataFile->get_dim(latid.c_str())))) 
     223                     XMLIOError("Impossible d'ajouter la variable de latitude !"); 
     224 
     225                  if (!(lonVar = dataFile->add_var(lonid.c_str(), ncFloat, dataFile->get_dim(lonid.c_str())))) 
     226                     XMLIOError("Impossible d'ajouter la variable de longitude !"); 
     227               } 
    186228 
    187229               // Attribut de latitude. 
     
    218260 
    219261               if ((*itt)->lonvalue.hasValue()) 
    220                   this->writeCoords(lonid, (*itt)->lonvalue); 
    221                else throw XMLIOUndefinedValueException 
     262                  this->writeCoords(lonid, (*itt)->lonvalue, *itt); 
     263               else XMLIOError 
    222264                  ("Les coordonnées de longitude (xvalue) ne sont pas définies pour le domaine \""+domid+"\"."); 
    223265 
    224266               if ((*itt)->latvalue.hasValue()) 
    225                   this->writeCoords(latid, (*itt)->latvalue); 
    226                else throw XMLIOUndefinedValueException 
     267                  this->writeCoords(latid, (*itt)->latvalue, *itt); 
     268               else XMLIOError 
    227269                  ("Les coordonnées de latitude (yvalue) ne sont pas définies pour le domaine \""+domid+"\"."); 
    228270            } 
     
    234276               string axisid = ((*it)->name.hasValue()) ? (string)(*it)->name : (*it)->getId(); 
    235277               if (!(othvar = dataFile->add_var(axisid.c_str(), ncFloat, dataFile->get_dim(axisid.c_str())))) 
    236                   throw XMLIOUndefinedValueException("Impossible d'ajouter la variable "+ (*it)->getId() +" !"); 
     278                  XMLIOError("Impossible d'ajouter la variable "+ (*it)->getId() +" !"); 
    237279 
    238280               hm["axis"]     = "Z" ; 
     
    255297               if ((*it)->zvalue.hasValue()) 
    256298                  this->writeCoords(axisid, (*it)->zvalue); 
    257                else throw XMLIOUndefinedValueException 
     299               else XMLIOError 
    258300                  ("Les coordonnées de l'axe \""+axisid+"\" (value) ne sont pas définies."); 
    259301            } 
     
    317359                                 dataFile->get_dim(latid.c_str()), 
    318360                                 dataFile->get_dim(lonid.c_str())))) 
    319                         throw XMLIOUndefinedValueException("Impossible d'ajouter le champ "+ field->getId() +" !"); 
     361                        XMLIOError("Impossible d'ajouter le champ "+ field->getId() +" !"); 
    320362                  } 
    321363                  else // 3D spatio + temps 
     
    326368                                 dataFile->get_dim(latid.c_str()), 
    327369                                 dataFile->get_dim(lonid.c_str())))) 
    328                         throw XMLIOUndefinedValueException("Impossible d'ajouter le champ "+ field->getId() +" !"); 
     370                        XMLIOError("Impossible d'ajouter le champ "+ field->getId() +" !"); 
    329371                  } 
    330372               } 
     
    336378                                 dataFile->get_dim(latid.c_str()), 
    337379                                 dataFile->get_dim(lonid.c_str())))) 
    338                         throw XMLIOUndefinedValueException("Impossible d'ajouter le champ "+ field->getId() +" !"); 
     380                        XMLIOError("Impossible d'ajouter le champ "+ field->getId() +" !"); 
    339381                  } 
    340382                  else // 3D spatio sans temps 
     
    344386                                 dataFile->get_dim(latid.c_str()), 
    345387                                 dataFile->get_dim(lonid.c_str())))) 
    346                         throw XMLIOUndefinedValueException("Impossible d'ajouter le champ "+ field->getId() +" !"); 
     388                        XMLIOError("Impossible d'ajouter le champ "+ field->getId() +" !"); 
    347389                  } 
    348390               } 
     
    377419            for ( it = attr.begin() ; it != attr.end(); it++ ) 
    378420               if (!var->add_att((*it).first.c_str(), (*it).second)) 
    379                   throw XMLIOUndefinedValueException 
     421                  XMLIOError 
    380422                     ("Impossible d'ajouter l'attribut' "+ (*it).first +" à la variable "+ var->name() +" !"); 
    381423         } 
     
    387429            for ( it = attr.begin() ; it != attr.end(); it++ ) 
    388430               if (!var->add_att((*it).first.c_str(), (*it).second.c_str())) 
    389                   throw XMLIOUndefinedValueException 
     431                  XMLIOError 
    390432                     ("Impossible d'ajouter l'attribut' "+ (*it).first +" à la variable "+ var->name() +" !"); 
    391433         } 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/abstract_calendar.hpp

    r131 r138  
    11#ifndef __XMLIO_ABSTRACT_CALENDAR__ 
    22#define __XMLIO_ABSTRACT_CALENDAR__ 
     3 
     4#include "abstract_object.hpp" 
    35 
    46namespace XMLIOSERVER 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/abstract_object.hpp

    r126 r138  
    88      public : 
    99 
    10          const std::string& getId(void) const throw (XMLIOUndefinedValueException) 
     10         const std::string& getId(void) const 
    1111         { 
    1212            if (!hasId()) // Si l'identifiant de l'objet n'est pas défini. 
    13                throw XMLIOSERVER::XMLIOUndefinedValueException("Appel de la méthode AbstractObject::getId invalide."); 
     13               XMLIOError("Appel de la méthode AbstractObject::getId invalide."); 
    1414            return (id); 
    1515         } 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/attribut.hpp

    r137 r138  
    55 
    66using XMLIOSERVER::BaseAttribut; 
    7 using XMLIOSERVER::XMLIOUndefinedValueException; 
    87using std::ostringstream; 
    98using namespace blitz ; 
     
    3837         { 
    3938            if (!_hasValue) 
    40                throw XMLIOUndefinedValueException("L'attribut \"" + this->getName() + "\" est invalide !"); 
     39               XMLIOError("L'attribut \"" + this->getName() + "\" est invalide !"); 
    4140            return (value) ; 
    4241         } 
    4342 
    4443         Ctype* getValue(void) 
     44         { 
     45            //if (!_hasValue) return(NULL); // REVOIR: 4 h de debug à cause de ça !!! 
     46            return (&value); 
     47         } 
     48 
     49         const Ctype * getValueConst(void) const 
    4550         { 
    4651            //if (!_hasValue) return(NULL); // REVOIR: 4 h de debug à cause de ça !!! 
     
    8186         virtual void getValue(Ctype & value_) const 
    8287         { 
    83             if (!_hasValue) throw XMLIOUndefinedValueException("L'attribut \"" + this->getName() + "\" est invalide !"); 
     88            if (!_hasValue) XMLIOError("L'attribut \"" + this->getName() + "\" est invalide !"); 
    8489            value_ = value ; 
    8590         } 
     
    160165                  iss >> c >> d; 
    161166                  if (c != ',') 
    162                      throw XMLIOUndefinedValueException("Le tableau de valeur est mal défini !"); 
     167                     XMLIOError("Le tableau de valeur est mal défini !"); 
    163168                  vect.push_back(d); 
    164169               } 
     
    171176                  iss >> size >> c >> d; 
    172177                  if ((c != ')') || (size <= 0)) 
    173                      throw XMLIOUndefinedValueException("Le tableau de valeur est mal défini !"); 
     178                     XMLIOError("Le tableau de valeur est mal défini !"); 
    174179                  valsup = d; 
    175180               } 
     
    179184               break; 
    180185            default : 
    181                throw XMLIOUndefinedValueException("Le tableau de valeur est mal défini !"); 
     186               XMLIOError("Le tableau de valeur est mal défini !"); 
    182187         } 
    183188      } 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/attribut_registrar.hpp

    r126 r138  
    3030         const StrHashMap<BaseAttribut>& getAttrList(void) const { return (attrList); } 
    3131 
    32          BaseAttribut* getAttribut(const string& _id) throw (XMLIOUndefinedValueException) { return (attrList[_id]); } 
     32         BaseAttribut* getAttribut(const string& _id) { return (attrList[_id]); } 
    3333 
    3434         friend ostream& operator<< (ostream& out, const AttributRegistrar& c) 
     
    6565         { 
    6666            if (hasAttribut(att_name)) getAttribut(att_name)->setFromString(value); 
    67             else throw XMLIOUndefinedValueException("Impossible de trouver l'attribut nommé \"" 
     67            else XMLIOError("Impossible de trouver l'attribut nommé \"" 
    6868               + att_name +"\" dans la liste des attributs enregistrés !"); 
    6969         } 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/base_attribut.hpp

    r126 r138  
    44using std::ostream; 
    55using namespace blitz ; 
    6  
    7 using XMLIOSERVER::XMLIOIncompatibleTypeException; 
    86 
    97namespace XMLIOSERVER 
     
    6260 
    6361         static void error_set(void) 
    64          { throw XMLIOIncompatibleTypeException 
     62         { XMLIOError 
    6563           ("BaseAttribut::set<type> > Setting value type is incompatible with attribut type"); } 
    6664 
    6765         static void error_get(void) 
    68          { throw XMLIOIncompatibleTypeException 
     66         { XMLIOError 
    6967           ("BaseAttribut::set<type> >Getting value type is incompatible with attribut type"); } 
    7068 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/c_interface.cpp

    r137 r138  
    4444void xios_xml_parse_file(const XString _filename, XSize _filename_len) 
    4545{ 
    46    MAKE_STRING(__filename, _filename, _filename_len); 
    47    std::ifstream __istr( __filename.c_str() , std::ifstream::in ); 
    48  
    49    // On commence la lecture du flux de donnée xml. 
    50    XMLNode node = XMLNode::CreateNode(__istr, Context::GetRootName()); 
    51    // On parse le fichier xml noeud par noeud 
    52    // (ie on construit dynamiquement notre arbre d'objets). 
    53    XMLParser::Parse(node); 
    54  
     46 
     47      MAKE_STRING(__filename, _filename, _filename_len); 
     48      std::ifstream __istr( __filename.c_str() , std::ifstream::in ); 
     49 
     50      // On commence la lecture du flux de donnée xml. 
     51      XMLNode node = XMLNode::CreateNode(__istr, Context::GetRootName()); 
     52      // On parse le fichier xml noeud par noeud 
     53      // (ie on construit dynamiquement notre arbre d'objets). 
     54      XMLParser::Parse(node); 
    5555} 
    5656 
     
    7676 
    7777void xios_context_create (XPtr * _ctx, const XString _ctx_id, 
    78                           XSize _ctx_id_len, XCalendarType _calType) 
     78                          XSize _ctx_id_len, XCalendarType _calType, 
     79                          XInt yr, XInt mth, XInt dd, 
     80                          XInt hr, XInt min, XInt sec) 
    7981{ 
    8082   MAKE_STRING(__ctx_id, _ctx_id, _ctx_id_len); 
     
    9294   { 
    9395      case (D360) : 
    94          context->setCalendar(new D360Calendar());      return; 
     96         context->setCalendar(new D360Calendar(yr, mth, dd, hr, min, sec)); 
     97         return; 
    9598      case (ALLLEAP) : 
    96          context->setCalendar(new AllLeapCalendar());   return; 
     99         context->setCalendar(new AllLeapCalendar(yr, mth, dd, hr, min, sec)); 
     100         return; 
    97101      case (NOLEAP) : 
    98          context->setCalendar(new NoLeapCalendar());    return; 
     102         context->setCalendar(new NoLeapCalendar(yr, mth, dd, hr, min, sec)); 
     103         return; 
    99104      case (JULIAN) : 
    100          context->setCalendar(new JulianCalendar());    return; 
     105         context->setCalendar(new JulianCalendar(yr, mth, dd, hr, min, sec)); 
     106         return; 
    101107      case (GREGORIAN) : 
    102          context->setCalendar(new GregorianCalendar()); return; 
     108         context->setCalendar(new GregorianCalendar(yr, mth, dd, hr, min, sec)); 
     109         return; 
    103110      default: 
    104111         std::cerr << "[context_create] Type de calendrier invalide [0-5]" << std::endl; 
     
    149156         CFile * _file = (CFile *) _parent; 
    150157         FieldGroup * _field_group = _file->createVirtualFieldGroup(_file->getId()); 
    151          xios_xml_tree_add (_field_group, GFIELD, _child, _child_type, _child_id, _child_id_len); 
     158         xios_xml_tree_add (_field_group, GFIELD, 
     159                            _child, _child_type, _child_id, _child_id_len); 
    152160         return; 
    153161      } 
     
    279287XML_SET_STRING(Axis, axis, unit, unit) 
    280288 
    281 void xios_xml_set_axis_value(XPtr const _axis, XDType _dtype, double value[], XSize value_size) 
     289void xios_xml_set_axis_value(XPtr const _axis, XDType _dtype, 
     290                             double value[], XSize value_size) 
    282291{ 
    283292   Array<double, 1> __arr(value, shape(value_size), neverDeleteData, FortranArray<1>()); 
     
    312321XML_SET(Domain, domain, int, nj, nj) 
    313322 
    314 void xios_xml_set_domain_mask(XPtr const _domain, XDType _dtype, bool * _mask , XSize _maskXsize, XSize _maskYsize) 
     323void xios_xml_set_domain_mask(XPtr const _domain, XDType _dtype, bool * _mask , 
     324                              XSize _maskXsize, XSize _maskYsize) 
    315325{ 
    316326   Array<bool, 2> __arr(_mask, shape(_maskXsize, _maskYsize), neverDeleteData, FortranArray<2>()); 
     
    336346XML_SET(Domain, domain, int, dnindex, data_n_index) 
    337347 
    338 void xios_xml_set_domain_diindex(XPtr const _domain, XDType _dtype, int _diindex[], XSize _diindex_size) 
     348void xios_xml_set_domain_diindex(XPtr const _domain, XDType _dtype, 
     349                                 int _diindex[], XSize _diindex_size) 
    339350{ 
    340351   Array<int, 1> __arr(_diindex, shape(_diindex_size), neverDeleteData, FortranArray<1>()); 
     
    351362} 
    352363 
    353 void xios_xml_set_domain_djindex(XPtr const _domain, XDType _dtype, int _djindex[], XSize _djindex_size) 
     364void xios_xml_set_domain_djindex(XPtr const _domain, XDType _dtype, 
     365                                 int _djindex[], XSize _djindex_size) 
    354366{ 
    355367   Array<int, 1> __arr(_djindex, shape(_djindex_size), neverDeleteData, FortranArray<1>()); 
     
    366378} 
    367379 
    368 void xios_xml_set_domain_lonvalue(XPtr const _domain, XDType _dtype, double _lonvalue[], XSize _lonvalue_Xsize, XSize _lonvalue_Ysize) 
     380void xios_xml_set_domain_lonvalue(XPtr const _domain, XDType _dtype, double _lonvalue[], 
     381                                  XSize _lonvalue_Xsize, XSize _lonvalue_Ysize) 
    369382{ 
    370383   XSize __size = (_lonvalue_Ysize == -1) 
     
    383396} 
    384397 
    385 void xios_xml_set_domain_latvalue(XPtr const _domain, XDType _dtype, double _latvalue[], XSize _latvalue_Xsize, XSize _latvalue_Ysize) 
     398void xios_xml_set_domain_latvalue(XPtr const _domain, XDType _dtype, double _latvalue[], 
     399                                  XSize _latvalue_Xsize, XSize _latvalue_Ysize) 
    386400{ 
    387401   XSize __size = (_latvalue_Ysize == -1) 
     
    428442         called = true; 
    429443      } 
    430    } 
     444      switch(filetype) 
     445      { 
     446         case (NETCDF4): 
     447            __dtrt->createDataOutput<NetCDF4DataOutput>(); 
     448            return; 
     449         // Autres formats de fichiers si disponibles... 
     450         default: 
     451            return; 
     452      } 
     453   } 
     454} 
     455 
     456void xios_dtreatment_end(void) 
     457{ 
     458 
     459 
     460} 
     461 
     462void xios_write_data(const XString _field_id, XSize _field_id_len, double * data_k8, 
     463                     XSize data_Xsize, XSize data_Ysize, XSize data_Zsize) 
     464{ 
     465   MAKE_STRING(__field_id, _field_id, _field_id_len); 
     466 
     467   Context          * const __ctxt = Context::GetCurrentContext(); 
     468   DataTreatment    * __dtrt = __ctxt->getDataTreatment(); 
     469   AbstractCalendar * __cald = __ctxt->getCalendar(); 
     470   if (__dtrt != NULL) 
     471   { 
     472      std::cout << "> Itération de calcul effectuée à  la date t = " << __cald->getCurrentDate() 
     473                << " (soit aprÚs " << (Time)__cald->getCurrentDate() << " sec.)." << std::endl; 
     474      std::cout << __field_id << " : " 
     475                << data_Xsize << " : " 
     476                << data_Ysize << " : " 
     477                << data_Zsize << std::endl; 
     478      if ((data_Zsize == -1) && (data_Ysize == -1)) 
     479      { // cas 1D 
     480         Array<double, 1> __arr(data_k8, shape(data_Xsize), 
     481                                neverDeleteData, FortranArray<1>()); 
     482         __dtrt->writeData<Array<double, 1> >(__field_id, __arr); 
     483      } 
     484      else if (data_Zsize == -1) 
     485      { // cas 2D 
     486         Array<double, 2> __arr(data_k8, shape(data_Xsize, data_Ysize), 
     487                                neverDeleteData, FortranArray<2>()); 
     488         __dtrt->writeData<Array<double, 2> >(__field_id, __arr); 
     489      } 
     490      else 
     491      { // cas 3D 
     492         Array<double, 3> __arr(data_k8, shape(data_Xsize, data_Ysize, data_Zsize), 
     493                                neverDeleteData, FortranArray<3>()); 
     494         __dtrt->writeData<Array<double, 3> >(__field_id, __arr); 
     495      } 
     496   } 
     497} 
     498 
     499/* ********************************************************** */ 
     500/*                      CALENDAR INTERFACE                    */ 
     501/* ********************************************************** */ 
     502 
     503void xios_update_calendar(int step) 
     504{ 
     505   Context * current = Context::GetCurrentContext(); 
     506   AbstractCalendar * calendar =  current->getCalendar(); 
     507   if (current->getDataTreatment() == NULL) 
     508   { 
     509      std::cerr << "Error : Le traitement n'a pas été effectué" << std::endl; 
     510      return; 
     511   } 
     512   calendar->update(); 
     513} 
     514 
     515void xios_set_timestep(double ts_year, double ts_month, double ts_day, 
     516                       double ts_hour, double ts_minute, double ts_second) 
     517{ 
     518   Context * current = Context::GetCurrentContext(); 
     519   AbstractCalendar * calendar =  current->getCalendar(); 
     520   struct _duration dr = { ts_year, ts_month , ts_day, 
     521                           ts_hour, ts_minute, ts_second }; 
     522   if (current->getDataTreatment() == NULL) 
     523   { 
     524      std::cerr << "Error : Le traitement n'a pas été effectué" << std::endl; 
     525      return; 
     526   } 
     527   calendar->setTimeStep(dr); 
    431528} 
    432529 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/c_interface.f03

    r137 r138  
    2323   INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99 
    2424 
    25       SUBROUTINE xios_handle_create(ret, dtype, idt, idt_size) bind(C) 
     25      SUBROUTINE xios_handle_create(ret, dtype, idt, idt_size) BIND(C) 
    2626         import C_CHAR, C_INT 
    2727         INTEGER  (kind = C_INT)                :: ret 
     
    7171   END TYPE XDuration 
    7272 
     73   INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99 
     74 
     75      SUBROUTINE xios_set_timestep(ts_year, ts_month, ts_day,          & 
     76                                   ts_hour, ts_minute, ts_second) BIND(C) 
     77         import C_DOUBLE 
     78         REAL (kind = C_DOUBLE), VALUE :: ts_year, ts_month, ts_day,   & 
     79                                          ts_hour, ts_minute, ts_second 
     80      END SUBROUTINE xios_set_timestep 
     81 
     82      SUBROUTINE xios_update_calendar(step) BIND(C) 
     83         import C_INT 
     84         INTEGER  (kind = C_INT), VALUE :: step 
     85      END SUBROUTINE xios_update_calendar 
     86 
     87   END INTERFACE 
     88 
     89   CONTAINS ! Fonctions disponibles pour les utilisateurs. 
     90 
     91   SUBROUTINE set_timestep(timestep) 
     92      TYPE(XDuration), INTENT(IN):: timestep 
     93 
     94      CALL xios_set_timestep(timestep%year, timestep%month , timestep%day,   & 
     95                             timestep%hour, timestep%minute, timestep%second) 
     96   END SUBROUTINE set_timestep 
     97 
     98   SUBROUTINE update_calendar(step) 
     99      INTEGER, INTENT(IN):: step 
     100      IF (step < 1) THEN 
     101         PRINT *, "L'argument 'step' ne peut être négatif ou nul" 
     102         STOP 
     103      END IF 
     104      CALL xios_update_calendar(step) 
     105   END SUBROUTINE update_calendar 
     106 
    73107END MODULE ICALENDAR 
    74108 
     
    82116   INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99 
    83117 
    84       SUBROUTINE xios_xml_tree_add(parent_, parent_type, child_, child_type, child_id, child_id_size) bind(C) 
     118      SUBROUTINE xios_xml_tree_add(parent_, parent_type, child_, child_type, child_id, child_id_size) BIND(C) 
    85119         import C_CHAR, C_INT 
    86120         INTEGER  (kind = C_INT), VALUE         :: parent_ 
     
    92126      END SUBROUTINE xios_xml_tree_add 
    93127 
    94       SUBROUTINE  xios_xml_tree_show(filename, filename_size) bind(C) 
     128      SUBROUTINE  xios_xml_tree_show(filename, filename_size) BIND(C) 
    95129         import C_CHAR, C_INT 
    96130         CHARACTER(kind = C_CHAR), DIMENSION(*) :: filename 
     
    101135      ! Attribut des éléments de type field et field_group ! 
    102136      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
    103       SUBROUTINE  xios_xml_set_field_name(field, ftype, fname, fname_size) bind(C) 
     137      SUBROUTINE  xios_xml_set_field_name(field, ftype, fname, fname_size) BIND(C) 
    104138         import C_CHAR, C_INT 
    105139         INTEGER  (kind = C_INT), VALUE         :: field, ftype 
     
    108142      END SUBROUTINE xios_xml_set_field_name 
    109143 
    110       SUBROUTINE  xios_xml_set_field_sname(field, ftype, fsname, fsname_size) bind(C) 
     144      SUBROUTINE  xios_xml_set_field_sname(field, ftype, fsname, fsname_size) BIND(C) 
    111145         import C_CHAR, C_INT 
    112146         INTEGER  (kind = C_INT), VALUE         :: field, ftype 
     
    115149      END SUBROUTINE xios_xml_set_field_sname 
    116150 
    117       SUBROUTINE  xios_xml_set_field_lname(field, ftype, flname, flname_size) bind(C) 
     151      SUBROUTINE  xios_xml_set_field_lname(field, ftype, flname, flname_size) BIND(C) 
    118152         import C_CHAR, C_INT 
    119153         INTEGER  (kind = C_INT), VALUE         :: field, ftype 
     
    122156      END SUBROUTINE xios_xml_set_field_lname 
    123157 
    124       SUBROUTINE  xios_xml_set_field_unit(field, ftype, funit, funit_size) bind(C) 
     158      SUBROUTINE  xios_xml_set_field_unit(field, ftype, funit, funit_size) BIND(C) 
    125159         import C_CHAR, C_INT 
    126160         INTEGER  (kind = C_INT), VALUE         :: field, ftype 
     
    129163      END SUBROUTINE xios_xml_set_field_unit 
    130164 
    131       SUBROUTINE  xios_xml_set_field_operation(field, ftype, foperation, foperation_size) bind(C) 
     165      SUBROUTINE  xios_xml_set_field_operation(field, ftype, foperation, foperation_size) BIND(C) 
    132166         import C_CHAR, C_INT 
    133167         INTEGER  (kind = C_INT), VALUE         :: field, ftype 
     
    136170      END SUBROUTINE xios_xml_set_field_operation 
    137171 
    138       SUBROUTINE  xios_xml_set_field_freq_op(field, ftype, year, month, day, hour, minute, second) bind(C) 
     172      SUBROUTINE  xios_xml_set_field_freq_op(field, ftype, year, month, day, hour, minute, second) BIND(C) 
    139173         import C_DOUBLE, C_INT 
    140174         INTEGER (kind = C_INT), VALUE  :: field, ftype 
     
    142176      END SUBROUTINE xios_xml_set_field_freq_op 
    143177 
    144       SUBROUTINE  xios_xml_set_field_level(field, ftype, flevel) bind(C) 
     178      SUBROUTINE  xios_xml_set_field_level(field, ftype, flevel) BIND(C) 
    145179         import C_INT 
    146180         INTEGER (kind = C_INT), VALUE  :: field, ftype 
     
    148182      END SUBROUTINE xios_xml_set_field_level 
    149183 
    150       SUBROUTINE  xios_xml_set_field_prec(field, ftype, fprec) bind(C) 
     184      SUBROUTINE  xios_xml_set_field_prec(field, ftype, fprec) BIND(C) 
    151185         import C_INT 
    152186         INTEGER (kind = C_INT), VALUE  :: field, ftype 
     
    154188      END SUBROUTINE xios_xml_set_field_prec 
    155189 
    156       SUBROUTINE  xios_xml_set_field_enabled(field, ftype, fenabled) bind(C) 
     190      SUBROUTINE  xios_xml_set_field_enabled(field, ftype, fenabled) BIND(C) 
    157191         import C_INT, C_BOOL 
    158192         INTEGER (kind = C_INT), VALUE  :: field, ftype 
     
    160194      END SUBROUTINE xios_xml_set_field_enabled 
    161195 
    162       SUBROUTINE  xios_xml_set_field_dref(field, ftype, fdref, fdref_size) bind(C) 
     196      SUBROUTINE  xios_xml_set_field_dref(field, ftype, fdref, fdref_size) BIND(C) 
    163197         import C_CHAR, C_INT 
    164198         INTEGER  (kind = C_INT), VALUE         :: field, ftype 
     
    167201      END SUBROUTINE xios_xml_set_field_dref 
    168202 
    169       SUBROUTINE  xios_xml_set_field_aref(field, ftype, faref, faref_size) bind(C) 
     203      SUBROUTINE  xios_xml_set_field_aref(field, ftype, faref, faref_size) BIND(C) 
    170204         import C_CHAR, C_INT 
    171205         INTEGER  (kind = C_INT), VALUE         :: field, ftype 
     
    174208      END SUBROUTINE xios_xml_set_field_aref 
    175209 
    176       SUBROUTINE  xios_xml_set_field_gref(field, ftype, fgref, fgref_size) bind(C) 
     210      SUBROUTINE  xios_xml_set_field_gref(field, ftype, fgref, fgref_size) BIND(C) 
    177211         import C_CHAR, C_INT 
    178212         INTEGER  (kind = C_INT), VALUE         :: field, ftype 
     
    181215      END SUBROUTINE xios_xml_set_field_gref 
    182216 
    183       SUBROUTINE  xios_xml_set_field_zref(field, ftype, fzref, fzref_size) bind(C) 
     217      SUBROUTINE  xios_xml_set_field_zref(field, ftype, fzref, fzref_size) BIND(C) 
    184218         import C_CHAR, C_INT 
    185219         INTEGER  (kind = C_INT), VALUE         :: field, ftype 
     
    188222      END SUBROUTINE xios_xml_set_field_zref 
    189223 
    190       SUBROUTINE  xios_xml_set_field_fref(field, ftype, ffref, ffref_size) bind(C) 
     224      SUBROUTINE  xios_xml_set_field_fref(field, ftype, ffref, ffref_size) BIND(C) 
    191225         import C_CHAR, C_INT 
    192226         INTEGER  (kind = C_INT), VALUE         :: field, ftype 
     
    199233      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
    200234 
    201       SUBROUTINE  xios_xml_set_file_name(file_, ftype, fname, fname_size) bind(C) 
     235      SUBROUTINE  xios_xml_set_file_name(file_, ftype, fname, fname_size) BIND(C) 
    202236         import C_CHAR, C_INT 
    203237         INTEGER  (kind = C_INT), VALUE         :: file_, ftype 
     
    206240      END SUBROUTINE xios_xml_set_file_name 
    207241 
    208       SUBROUTINE  xios_xml_set_file_description(file_, ftype, fdescription, fdescription_size) bind(C) 
     242      SUBROUTINE  xios_xml_set_file_description(file_, ftype, fdescription, fdescription_size) BIND(C) 
    209243         import C_CHAR, C_INT 
    210244         INTEGER  (kind = C_INT), VALUE         :: file_, ftype 
     
    213247      END SUBROUTINE xios_xml_set_file_description 
    214248 
    215       SUBROUTINE  xios_xml_set_file_output_freq(file_, ftype, year, month, day, hour, minute, second) bind(C) 
     249      SUBROUTINE  xios_xml_set_file_output_freq(file_, ftype, year, month, day, hour, minute, second) BIND(C) 
    216250         import C_DOUBLE, C_INT 
    217251         INTEGER (kind = C_INT), VALUE :: file_, ftype 
     
    219253      END SUBROUTINE xios_xml_set_file_output_freq 
    220254 
    221       SUBROUTINE  xios_xml_set_file_olevel(file_, ftype, folevel) bind(C) 
     255      SUBROUTINE  xios_xml_set_file_olevel(file_, ftype, folevel) BIND(C) 
    222256         import C_INT 
    223257         INTEGER (kind = C_INT), VALUE :: file_, ftype 
     
    225259      END SUBROUTINE xios_xml_set_file_olevel 
    226260 
    227       SUBROUTINE  xios_xml_set_file_enabled(file_, ftype, fenabled) bind(C) 
     261      SUBROUTINE  xios_xml_set_file_enabled(file_, ftype, fenabled) BIND(C) 
    228262         import C_INT, C_BOOL 
    229263         INTEGER (kind = C_INT), VALUE  :: file_, ftype 
     
    234268      ! Attribut des éléments de type grid et grid_group ! 
    235269      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
    236       SUBROUTINE  xios_xml_set_grid_name(grid, ftype, gname, gname_size) bind(C) 
     270      SUBROUTINE  xios_xml_set_grid_name(grid, ftype, gname, gname_size) BIND(C) 
    237271         import C_CHAR, C_INT 
    238272         INTEGER  (kind = C_INT), VALUE         :: grid, ftype 
     
    241275      END SUBROUTINE xios_xml_set_grid_name 
    242276 
    243       SUBROUTINE  xios_xml_set_grid_description(grid, ftype, gdescription, gdescription_size) bind(C) 
     277      SUBROUTINE  xios_xml_set_grid_description(grid, ftype, gdescription, gdescription_size) BIND(C) 
    244278         import C_CHAR, C_INT 
    245279         INTEGER  (kind = C_INT), VALUE         :: grid, ftype 
     
    248282      END SUBROUTINE xios_xml_set_grid_description 
    249283 
    250       SUBROUTINE  xios_xml_set_grid_dref(grid, ftype, dref, dref_size) bind(C) 
     284      SUBROUTINE  xios_xml_set_grid_dref(grid, ftype, dref, dref_size) BIND(C) 
    251285         import C_CHAR, C_INT 
    252286         INTEGER  (kind = C_INT), VALUE         :: grid, ftype 
     
    255289      END SUBROUTINE xios_xml_set_grid_dref 
    256290 
    257       SUBROUTINE  xios_xml_set_grid_aref(grid, ftype, aref, aref_size) bind(C) 
     291      SUBROUTINE  xios_xml_set_grid_aref(grid, ftype, aref, aref_size) BIND(C) 
    258292         import C_CHAR, C_INT 
    259293         INTEGER  (kind = C_INT), VALUE         :: grid, ftype 
     
    265299      ! Attribut des éléments de type axis et axis_group ! 
    266300      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
    267       SUBROUTINE  xios_xml_set_axis_name(axis, ftype, aname, aname_size) bind(C) 
     301      SUBROUTINE  xios_xml_set_axis_name(axis, ftype, aname, aname_size) BIND(C) 
    268302         import C_CHAR, C_INT 
    269303         INTEGER  (kind = C_INT), VALUE         :: axis, ftype 
     
    272306      END SUBROUTINE xios_xml_set_axis_name 
    273307 
    274       SUBROUTINE  xios_xml_set_axis_sname(axis, ftype, asname, asname_size) bind(C) 
     308      SUBROUTINE  xios_xml_set_axis_sname(axis, ftype, asname, asname_size) BIND(C) 
    275309         import C_CHAR, C_INT 
    276310         INTEGER  (kind = C_INT), VALUE         :: axis, ftype 
     
    279313      END SUBROUTINE xios_xml_set_axis_sname 
    280314 
    281       SUBROUTINE  xios_xml_set_axis_lname(axis, ftype, alname, alname_size) bind(C) 
     315      SUBROUTINE  xios_xml_set_axis_lname(axis, ftype, alname, alname_size) BIND(C) 
    282316         import C_CHAR, C_INT 
    283317         INTEGER  (kind = C_INT), VALUE         :: axis, ftype 
     
    286320      END SUBROUTINE xios_xml_set_axis_lname 
    287321 
    288       SUBROUTINE  xios_xml_set_axis_unit(axis, ftype, aunit, aunit_size) bind(C) 
     322      SUBROUTINE  xios_xml_set_axis_unit(axis, ftype, aunit, aunit_size) BIND(C) 
    289323         import C_CHAR, C_INT 
    290324         INTEGER  (kind = C_INT), VALUE         :: axis, ftype 
     
    293327      END SUBROUTINE xios_xml_set_axis_unit 
    294328 
    295       SUBROUTINE  xios_xml_set_axis_value(axis, ftype, avalue, avalue_size) bind(C) 
     329      SUBROUTINE  xios_xml_set_axis_value(axis, ftype, avalue, avalue_size) BIND(C) 
    296330         import C_DOUBLE, C_INT 
    297331         INTEGER  (kind = C_INT), VALUE      :: axis, ftype 
     
    304338      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
    305339 
    306       SUBROUTINE  xios_xml_set_domain_name(domain, ftype, dname, dname_size) bind(C) 
     340      SUBROUTINE  xios_xml_set_domain_name(domain, ftype, dname, dname_size) BIND(C) 
    307341         import C_CHAR, C_INT 
    308342         INTEGER  (kind = C_INT), VALUE         :: domain, ftype 
     
    311345      END SUBROUTINE xios_xml_set_domain_name 
    312346 
    313       SUBROUTINE  xios_xml_set_domain_sname(domain, ftype, dsname, dsname_size) bind(C) 
     347      SUBROUTINE  xios_xml_set_domain_sname(domain, ftype, dsname, dsname_size) BIND(C) 
    314348         import C_CHAR, C_INT 
    315349         INTEGER  (kind = C_INT), VALUE         :: domain, ftype 
     
    318352      END SUBROUTINE xios_xml_set_domain_sname 
    319353 
    320       SUBROUTINE  xios_xml_set_domain_lname(domain, ftype, dlname, dlname_size) bind(C) 
     354      SUBROUTINE  xios_xml_set_domain_lname(domain, ftype, dlname, dlname_size) BIND(C) 
    321355         import C_CHAR, C_INT 
    322356         INTEGER  (kind = C_INT), VALUE         :: domain, ftype 
     
    325359      END SUBROUTINE xios_xml_set_domain_lname 
    326360 
    327       SUBROUTINE  xios_xml_set_domain_niglo(domain, ftype, niglo) bind(C) 
     361      SUBROUTINE  xios_xml_set_domain_niglo(domain, ftype, niglo) BIND(C) 
    328362         import C_INT 
    329363         INTEGER  (kind = C_INT), VALUE :: domain, ftype, niglo 
    330364      END SUBROUTINE xios_xml_set_domain_niglo 
    331365 
    332       SUBROUTINE  xios_xml_set_domain_njglo(domain, ftype, njglo) bind(C) 
     366      SUBROUTINE  xios_xml_set_domain_njglo(domain, ftype, njglo) BIND(C) 
    333367         import C_INT 
    334368         INTEGER  (kind = C_INT), VALUE :: domain, ftype, njglo 
    335369      END SUBROUTINE xios_xml_set_domain_njglo 
    336370 
    337       SUBROUTINE  xios_xml_set_domain_ibegin(domain, ftype, ibegin) bind(C) 
     371      SUBROUTINE  xios_xml_set_domain_ibegin(domain, ftype, ibegin) BIND(C) 
    338372         import C_INT 
    339373         INTEGER  (kind = C_INT), VALUE :: domain, ftype, ibegin 
    340374      END SUBROUTINE xios_xml_set_domain_ibegin 
    341375 
    342       SUBROUTINE  xios_xml_set_domain_iend(domain, ftype, iend) bind(C) 
     376      SUBROUTINE  xios_xml_set_domain_iend(domain, ftype, iend) BIND(C) 
    343377         import C_INT 
    344378         INTEGER  (kind = C_INT), VALUE :: domain, ftype, iend 
    345379      END SUBROUTINE xios_xml_set_domain_iend 
    346380 
    347       SUBROUTINE  xios_xml_set_domain_ni(domain, ftype, ni) bind(C) 
     381      SUBROUTINE  xios_xml_set_domain_ni(domain, ftype, ni) BIND(C) 
    348382         import C_INT 
    349383         INTEGER  (kind = C_INT), VALUE :: domain, ftype, ni 
    350384      END SUBROUTINE xios_xml_set_domain_ni 
    351385 
    352       SUBROUTINE  xios_xml_set_domain_jbegin(domain, ftype, jbegin) bind(C) 
     386      SUBROUTINE  xios_xml_set_domain_jbegin(domain, ftype, jbegin) BIND(C) 
    353387         import C_INT 
    354388         INTEGER  (kind = C_INT), VALUE :: domain, ftype, jbegin 
    355389      END SUBROUTINE xios_xml_set_domain_jbegin 
    356390 
    357       SUBROUTINE  xios_xml_set_domain_jend(domain, ftype, jend) bind(C) 
     391      SUBROUTINE  xios_xml_set_domain_jend(domain, ftype, jend) BIND(C) 
    358392         import C_INT 
    359393         INTEGER  (kind = C_INT), VALUE :: domain, ftype, jend 
    360394      END SUBROUTINE xios_xml_set_domain_jend 
    361395 
    362       SUBROUTINE  xios_xml_set_domain_nj(domain, ftype, nj) bind(C) 
     396      SUBROUTINE  xios_xml_set_domain_nj(domain, ftype, nj) BIND(C) 
    363397         import C_INT 
    364398         INTEGER  (kind = C_INT), VALUE :: domain, ftype, nj 
    365399      END SUBROUTINE xios_xml_set_domain_nj 
    366400 
    367       SUBROUTINE  xios_xml_set_domain_mask(domain, ftype, mask, maskXsize, maskYsize) bind(C) 
     401      SUBROUTINE  xios_xml_set_domain_mask(domain, ftype, mask, maskXsize, maskYsize) BIND(C) 
    368402         import C_BOOL, C_INT 
    369403         INTEGER  (kind = C_INT), VALUE       :: domain, ftype 
     
    372406      END SUBROUTINE xios_xml_set_domain_mask 
    373407 
    374       SUBROUTINE  xios_xml_set_domain_ddim(domain, ftype, dadim) bind(C) 
     408      SUBROUTINE  xios_xml_set_domain_ddim(domain, ftype, dadim) BIND(C) 
    375409         import C_INT 
    376410         INTEGER  (kind = C_INT), VALUE :: domain, ftype, dadim 
    377411      END SUBROUTINE xios_xml_set_domain_ddim 
    378412 
    379       SUBROUTINE  xios_xml_set_domain_dni(domain, ftype, dni) bind(C) 
     413      SUBROUTINE  xios_xml_set_domain_dni(domain, ftype, dni) BIND(C) 
    380414         import C_INT 
    381415         INTEGER  (kind = C_INT), VALUE :: domain, ftype, dni 
    382416      END SUBROUTINE xios_xml_set_domain_dni 
    383417 
    384       SUBROUTINE  xios_xml_set_domain_dnj(domain, ftype, dnj) bind(C) 
     418      SUBROUTINE  xios_xml_set_domain_dnj(domain, ftype, dnj) BIND(C) 
    385419         import C_INT 
    386420         INTEGER  (kind = C_INT), VALUE :: domain, ftype, dnj 
    387421      END SUBROUTINE xios_xml_set_domain_dnj 
    388422 
    389       SUBROUTINE  xios_xml_set_domain_dibegin(domain, ftype, dibegin) bind(C) 
     423      SUBROUTINE  xios_xml_set_domain_dibegin(domain, ftype, dibegin) BIND(C) 
    390424         import C_INT 
    391425         INTEGER  (kind = C_INT), VALUE :: domain, ftype, dibegin 
    392426      END SUBROUTINE xios_xml_set_domain_dibegin 
    393427 
    394       SUBROUTINE  xios_xml_set_domain_djbegin(domain, ftype, djbegin) bind(C) 
     428      SUBROUTINE  xios_xml_set_domain_djbegin(domain, ftype, djbegin) BIND(C) 
    395429         import C_INT 
    396430         INTEGER  (kind = C_INT), VALUE :: domain, ftype, djbegin 
    397431      END SUBROUTINE xios_xml_set_domain_djbegin 
    398432 
    399       SUBROUTINE  xios_xml_set_domain_dnindex(domain, ftype, dnindex) bind(C) 
     433      SUBROUTINE  xios_xml_set_domain_dnindex(domain, ftype, dnindex) BIND(C) 
    400434         import C_INT 
    401435         INTEGER  (kind = C_INT), VALUE :: domain, ftype, dnindex 
    402436      END SUBROUTINE xios_xml_set_domain_dnindex 
    403437 
    404       SUBROUTINE  xios_xml_set_domain_diindex(domain, ftype, diindex, diindex_size) bind(C) 
     438      SUBROUTINE  xios_xml_set_domain_diindex(domain, ftype, diindex, diindex_size) BIND(C) 
    405439         import C_INT 
    406440         INTEGER  (kind = C_INT), VALUE      :: domain, ftype 
     
    409443      END SUBROUTINE xios_xml_set_domain_diindex 
    410444 
    411       SUBROUTINE  xios_xml_set_domain_djindex(domain, ftype, djindex, djindex_size) bind(C) 
     445      SUBROUTINE  xios_xml_set_domain_djindex(domain, ftype, djindex, djindex_size) BIND(C) 
    412446         import C_INT 
    413447         INTEGER  (kind = C_INT), VALUE      :: domain, ftype 
     
    416450      END SUBROUTINE xios_xml_set_domain_djindex 
    417451 
    418       SUBROUTINE  xios_xml_set_domain_lonvalue(domain, ftype, lonvalue, lonvalue_xsize, lonvalue_ysize) bind(C) 
     452      SUBROUTINE  xios_xml_set_domain_lonvalue(domain, ftype, lonvalue, lonvalue_xsize, lonvalue_ysize) BIND(C) 
    419453         import C_DOUBLE, C_INT 
    420454         INTEGER  (kind = C_INT), VALUE      :: domain, ftype 
     
    423457      END SUBROUTINE xios_xml_set_domain_lonvalue 
    424458 
    425       SUBROUTINE  xios_xml_set_domain_latvalue(domain, ftype, latvalue, latvalue_xsize, lonvalue_ysize) bind(C) 
     459      SUBROUTINE  xios_xml_set_domain_latvalue(domain, ftype, latvalue, latvalue_xsize, lonvalue_ysize) BIND(C) 
    426460         import C_DOUBLE, C_INT 
    427461         INTEGER  (kind = C_INT), VALUE      :: domain, ftype 
     
    430464      END SUBROUTINE xios_xml_set_domain_latvalue 
    431465 
    432       SUBROUTINE  xios_xml_set_domain_domtype(domain, ftype, domtype, domtype_size) bind(C) 
     466      SUBROUTINE  xios_xml_set_domain_domtype(domain, ftype, domtype, domtype_size) BIND(C) 
    433467         import C_CHAR, C_INT 
    434468         INTEGER  (kind = C_INT), VALUE         :: domain, ftype 
     
    829863   INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99 
    830864 
    831       SUBROUTINE xios_xml_Parse_File(filename, filename_size) bind(C) 
     865      SUBROUTINE xios_xml_Parse_File(filename, filename_size) BIND(C) 
    832866         import C_CHAR, C_INT 
    833867         CHARACTER(kind = C_CHAR), DIMENSION(*) :: filename 
     
    835869      END SUBROUTINE xios_xml_Parse_File 
    836870 
    837       SUBROUTINE xios_xml_Parse_String(xmlcontent, xmlcontent_size) bind(C) 
     871      SUBROUTINE xios_xml_Parse_String(xmlcontent, xmlcontent_size) BIND(C) 
    838872         import C_CHAR, C_INT 
    839873         CHARACTER(kind = C_CHAR), DIMENSION(*) :: xmlcontent 
     
    868902   INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99 
    869903 
    870       SUBROUTINE xios_context_set_current(context, withswap) bind(C) 
     904      SUBROUTINE xios_context_set_current(context, withswap) BIND(C) 
    871905         import C_BOOL, C_INT 
    872906         INTEGER  (kind = C_INT), VALUE :: context 
     
    874908      END SUBROUTINE xios_context_set_current 
    875909 
    876       SUBROUTINE xios_context_create(context, context_id, context_id_size, calendar_type) bind(C) 
     910      SUBROUTINE xios_context_create(context, context_id, context_id_size, calendar_type, & 
     911                                     year, month, day, hour, minute, second) BIND(C) 
    877912         import C_CHAR, C_INT 
    878913         INTEGER  (kind = C_INT)                :: context 
    879914         CHARACTER(kind = C_CHAR), DIMENSION(*) :: context_id 
    880915         INTEGER  (kind = C_INT), VALUE         :: context_id_size 
    881          INTEGER  (kind = C_INT), VALUE         :: calendar_type 
     916         INTEGER  (kind = C_INT), VALUE         :: calendar_type, year, month, day, hour, minute, second 
    882917      END SUBROUTINE xios_context_create 
    883918 
     
    905940 
    906941   ! Créer un nouveau contexte à partir d'un id, d'un type de calendrier et d'une date. 
    907    SUBROUTINE context_create(context_hdl, context_id, calendar_type) 
    908       USE IXHANDLE 
    909       TYPE(XHandle), INTENT(OUT)     :: context_hdl 
    910       CHARACTER(len = *), INTENT(IN) :: context_id 
    911       INTEGER, INTENT(IN)            :: calendar_type 
    912       CALL xios_context_create(context_hdl%daddr, context_id, len(context_id), calendar_type) 
     942   SUBROUTINE context_create(context_hdl, context_id, calendar_type, init_date) 
     943      USE IXHANDLE 
     944      USE ICALENDAR 
     945      TYPE(XHandle), INTENT(OUT)        :: context_hdl 
     946      CHARACTER(len = *), INTENT(IN)    :: context_id 
     947      INTEGER, INTENT(IN)               :: calendar_type 
     948      TYPE(XDate), INTENT(IN), OPTIONAL :: init_date 
     949      IF (PRESENT(init_date)) THEN 
     950         CALL xios_context_create(context_hdl%daddr, context_id, len(context_id), calendar_type, & 
     951                                  init_date%year, init_date%month, init_date%day,                & 
     952                                  init_date%hour, init_date%minute, init_date%second) 
     953      ELSE 
     954         CALL xios_context_create(context_hdl%daddr, context_id, len(context_id), calendar_type, & 
     955                                  0, 1, 1, 0, 0, 0) 
     956      END IF 
    913957      IF (context_hdl%daddr .EQ. 0) THEN 
    914958         PRINT *, "(F2003 interface) Impossible de créer le context !" 
     
    934978   INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99 
    935979 
    936       SUBROUTINE xios_dtreatment_start(context_hdl, filetype) bind(C) 
     980      SUBROUTINE xios_dtreatment_start(context_hdl, filetype) BIND(C) 
    937981         import C_INT 
    938982         INTEGER  (kind = C_INT), VALUE  :: context_hdl 
    939983         INTEGER  (kind = C_INT), VALUE  :: filetype 
    940984      END SUBROUTINE xios_dtreatment_start 
     985 
     986      SUBROUTINE xios_dtreatment_end() BIND(C) 
     987         ! Sans argument 
     988      END SUBROUTINE xios_dtreatment_end 
     989 
     990      SUBROUTINE xios_write_data(fieldid, fieldid_size, data_k8, data_Xsize, data_Ysize, data_Zsize) BIND(C) 
     991         import C_INT, C_CHAR, C_PTR, C_FLOAT, C_DOUBLE, C_BOOL 
     992         CHARACTER(kind = C_CHAR), DIMENSION(*) :: fieldid 
     993         INTEGER  (kind = C_INT),  VALUE        :: fieldid_size 
     994         REAL(kind = C_DOUBLE), DIMENSION(*)    :: data_k8 
     995         INTEGER  (kind = C_INT), VALUE         :: data_Xsize, data_Ysize, data_Zsize 
     996      END SUBROUTINE xios_write_data 
    941997 
    942998   END INTERFACE 
     
    9631019   END SUBROUTINE dtreatment_start 
    9641020 
     1021   SUBROUTINE dtreatment_end(context_hdl) 
     1022      USE ICONTEXT 
     1023      USE IXHANDLE 
     1024      TYPE(XHandle), INTENT(IN), VALUE :: context_hdl 
     1025      IF ((context_hdl%dtype .NE. ECONTEXT) .OR. (context_hdl%daddr .EQ. 0)) THEN 
     1026         PRINT *, "(F2003 interface) Impossible de traiter un contexte invalide !" 
     1027         STOP 
     1028      END IF 
     1029      CALL context_set_current(context_hdl) 
     1030      CALL xios_dtreatment_end() 
     1031   END SUBROUTINE dtreatment_end 
     1032 
     1033   SUBROUTINE write_data (fieldid,                         & 
     1034                          data1d_k8, data2d_k8, data3d_k8) 
     1035      CHARACTER(len = *), INTENT(IN)                     :: fieldid 
     1036      REAL(kind = 8), DIMENSION(*), OPTIONAL, INTENT(IN) :: data1d_k8(:), data2d_k8(:,:), data3d_k8(:,:,:) 
     1037      IF((.NOT. PRESENT(data1d_k8)) .AND. & 
     1038         (.NOT. PRESENT(data2d_k8)) .AND. & 
     1039         (.NOT. PRESENT(data3d_k8))) THEN 
     1040         PRINT *, "(F2003 interface) Veuillez spécifier des données à écrire !" 
     1041         STOP 
     1042      END IF 
     1043      IF (PRESENT (data1d_k8)) THEN 
     1044         CALL xios_write_data(fieldid, len(fieldid), data1d_k8, & 
     1045                              size(data1d_k8, 1), -1, -1) 
     1046      ELSE IF (PRESENT (data2d_k8)) THEN 
     1047         CALL xios_write_data(fieldid, len(fieldid), data2d_k8, & 
     1048                              size(data2d_k8, 1), size(data2d_k8, 2), -1) 
     1049      ELSE IF (PRESENT (data3d_k8)) THEN 
     1050         CALL xios_write_data(fieldid, len(fieldid), data3d_k8, & 
     1051                              size(data3d_k8, 1), size(data3d_k8, 2), size(data3d_k8, 3)) 
     1052      END IF 
     1053   END SUBROUTINE 
     1054 
    9651055END MODULE IDATATREATMENT 
    9661056 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/c_interface.hpp

    r137 r138  
    5858/* ******************** CONTEXT INTERFACE ******************* */ 
    5959void xios_context_set_current (XPtr const _ctx, bool _wswap); 
    60 void xios_context_create (XPtr * _ctx, const XString _ctx_id, XSize _ctx_id_len, XCalendarType _calType); 
     60void xios_context_create (XPtr * _ctx, const XString _ctx_id, 
     61                          XSize _ctx_id_len, XCalendarType _calType, 
     62                          XInt yr, XInt mth, XInt dd, 
     63                          XInt hr, XInt min, XInt sec); 
    6164 
    6265/* ******************  XML TREE INTERFACE ******************* */ 
     
    146149XML_SET_STRING(domain, domtype, domtype) ; 
    147150 
    148 /* ******************  DATA TREATMENT INTERFACE ******************* */ 
     151/* ******************* DATA TREATMENT INTERFACE ******************* */ 
    149152void xios_dtreatment_start(XPtr const _context, XFileType filetype); 
     153void xios_dtreatment_end(void); 
     154 
     155void xios_write_data(const XString _field_id, XSize _field_id_len, double * data_k8, 
     156                     XSize data_Xsize, XSize data_Ysize, XSize data_Zsize); 
     157 
     158/* ********************** CALENDAR INTERFACE ********************* */ 
     159 
     160void xios_update_calendar(int step); 
     161void xios_set_timestep(double ts_year, double ts_month, double ts_day, 
     162                       double ts_hour, double ts_minute, double ts_second); 
     163 
     164 
    150165 
    151166#ifdef __cplusplus 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/calendar.hpp

    r131 r138  
    88      public : 
    99 
    10          JulianCalendar(void) 
    11             : AbstractCalendar("Julian") 
     10         JulianCalendar(const string& _dateStr) 
     11            : AbstractCalendar("Julian", _dateStr) 
    1212         { /* Ne rien faire de plus */ } 
    1313 
    14          JulianCalendar(const string& _dateStr) 
    15             : AbstractCalendar("Julian", _dateStr) 
     14         JulianCalendar(int yr = 0, int mth = 1, int d   = 1, 
     15                        int hr = 0, int min = 0, int sec = 0) 
     16             : AbstractCalendar("Julian", yr, mth, d, hr, min, sec) 
    1617         { /* Ne rien faire de plus */ } 
    1718 
     
    3637         } 
    3738 
    38          virtual string getType(void) const { return (string("julian")); } 
     39         virtual string getType(void) const 
     40         { return (string("julian")); } 
    3941 
    4042         virtual ~JulianCalendar(void) 
    41          {/* Ne rien faire de plus */} 
     43         { /* Ne rien faire de plus */ } 
    4244 
    4345   }; // class JulianCalendar 
     
    4749      public : 
    4850 
    49          GregorianCalendar(void) 
    50             : AbstractCalendar("Gregorian") 
    51          {/* Ne rien faire de plus */} 
     51         GregorianCalendar(int yr = 0, int mth = 1, int d   = 1, 
     52                           int hr = 0, int min = 0, int sec = 0) 
     53             : AbstractCalendar("Gregorian", yr, mth, d, hr, min, sec) 
     54         { /* Ne rien faire de plus */ } 
    5255 
    5356         GregorianCalendar(const string& dateStr) 
    5457            : AbstractCalendar("Gregorian", dateStr) 
    55          {/* Ne rien faire de plus */} 
     58         { /* Ne rien faire de plus */ } 
    5659 
    5760      public : /* virtual */ 
     
    5962         virtual int getYearTotalLength(const Date& d) const 
    6063         { // Retourne la durée d'une année en seconde. 
    61             if ((d.getYear() % 4 == 0) && (d.getYear() % 100 != 0 || d.getYear() % 400 == 0)) return (366 * 86400); 
     64            if ((d.getYear() % 4   == 0) && 
     65               ((d.getYear() % 100 != 0)  || 
     66                (d.getYear() % 400 == 0)  )) 
     67               return (366 * 86400); 
    6268            return (365 * 86400); 
    6369         } 
     
    7682         } 
    7783 
    78          virtual string getType(void) const { return (string("gregorian")); } 
     84         virtual string getType(void) const 
     85         { return (string("gregorian")); } 
    7986 
    8087         virtual ~GregorianCalendar(void) 
    81          {/* Ne rien faire de plus */} 
     88         { /* Ne rien faire de plus */ } 
    8289 
    8390   }; // class GregorianCalendar 
     
    8794      public : 
    8895 
    89          NoLeapCalendar(void) 
    90             : AbstractCalendar("NoLeap") 
    91          {/* Ne rien faire de plus */} 
     96         NoLeapCalendar(int yr = 0, int mth = 1, int d   = 1, 
     97                        int hr = 0, int min = 0, int sec = 0) 
     98             : AbstractCalendar("NoLeap", yr, mth, d, hr, min, sec) 
     99         { /* Ne rien faire de plus */ } 
    92100 
    93101         NoLeapCalendar(const string& dateStr) 
    94102            : AbstractCalendar("NoLeap", dateStr) 
    95          {/* Ne rien faire de plus */} 
     103         { /* Ne rien faire de plus */ } 
    96104 
    97105      public : /* virtual */ 
     
    101109 
    102110         virtual ~NoLeapCalendar(void) 
    103          {/* Ne rien faire de plus */} 
     111         { /* Ne rien faire de plus */ } 
    104112 
    105113   }; // class NoLeapCalendar 
     
    109117      public : 
    110118 
    111          AllLeapCalendar(void) 
    112             : AbstractCalendar("AllLeap") 
    113          {/* Ne rien faire de plus */} 
     119         AllLeapCalendar(int yr = 0, int mth = 1, int d   = 1, 
     120                         int hr = 0, int min = 0, int sec = 0) 
     121             : AbstractCalendar("AllLeap", yr, mth, d, hr, min, sec) 
     122         { /* Ne rien faire de plus */ } 
    114123 
    115124         AllLeapCalendar(const string& dateStr) 
    116125            : AbstractCalendar("AllLeap", dateStr) 
    117          {/* Ne rien faire de plus */} 
     126         { /* Ne rien faire de plus */ } 
    118127 
    119128      public : /* virtual */ 
     
    133142 
    134143         virtual ~AllLeapCalendar(void) 
    135          {/* Ne rien faire de plus */} 
     144         { /* Ne rien faire de plus */ } 
    136145 
    137146   }; // class NoLeapCalendar 
     
    141150      public : 
    142151 
    143          D360Calendar(void) 
    144             : AbstractCalendar("D360") 
    145          {/* Ne rien faire de plus */} 
     152         D360Calendar(int yr = 0, int mth = 1, int d   = 1, 
     153                      int hr = 0, int min = 0, int sec = 0) 
     154             : AbstractCalendar("D360", yr, mth, d, hr, min, sec) 
     155         { /* Ne rien faire de plus */ } 
    146156 
    147157         D360Calendar(const string& dateStr) 
    148158            : AbstractCalendar("D360", dateStr) 
    149          {/* Ne rien faire de plus */} 
     159         { /* Ne rien faire de plus */ } 
    150160 
    151161      public : /* virtual */ 
     
    161171 
    162172         virtual ~D360Calendar(void) 
    163          {/* Ne rien faire de plus */} 
     173         { /* Ne rien faire de plus */ } 
    164174 
    165175   }; // class D360Calendar 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/container.hpp

    r131 r138  
    1717 
    1818         Mapped* operator[] (const Key& kval) 
    19                      throw (XMLIOUndefinedValueException) 
    2019         { 
    2120            if(!hasMappedValue(kval)) 
    22                throw XMLIOSERVER::XMLIOUndefinedValueException 
     21               XMLIOError 
    2322                  ("Appel de la méthode ExHashMap::operator["+kval+"] invalide."); 
    2423            return (find(kval)->second); 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/context.hpp

    r137 r138  
    2626         { 
    2727            if (hasChild()) return false; 
    28             this->fieldDef  = 
    29                (FieldDefinition*) FieldDefinition ::CreateObject(FieldDefinition ::GetDefName()); 
    30             this->fileDef   = 
    31                (FileDefinition*)  FileDefinition  ::CreateObject(FileDefinition  ::GetDefName()); 
    32             this->axisDef   = 
    33                (AxisDefinition*)  AxisDefinition  ::CreateObject(AxisDefinition  ::GetDefName()); 
    34             this->gridDef   = 
    35                (GridDefinition*)  GridDefinition  ::CreateObject(GridDefinition  ::GetDefName()); 
    36             this->domainDef = 
    37                (DomainDefinition*)DomainDefinition::CreateObject(DomainDefinition::GetDefName()); 
     28            this->fieldDef  = (FieldDefinition*) 
     29               FieldDefinition ::CreateObject(FieldDefinition ::GetDefName()); 
     30            this->fileDef   = (FileDefinition*) 
     31               FileDefinition  ::CreateObject(FileDefinition  ::GetDefName()); 
     32            this->axisDef   = (AxisDefinition*) 
     33               AxisDefinition  ::CreateObject(AxisDefinition  ::GetDefName()); 
     34            this->gridDef   = (GridDefinition*) 
     35               GridDefinition  ::CreateObject(GridDefinition  ::GetDefName()); 
     36            this->domainDef = (DomainDefinition*) 
     37               DomainDefinition::CreateObject(DomainDefinition::GetDefName()); 
    3838            return (true); 
    3939         } 
     
    7272         template <class T> 
    7373            DataTreatment * setDataTreatment(void) 
    74          { return (dtreatment = (ccalendar == NULL)? NULL : new T(this)); } 
     74         { return (dtreatment = (ccalendar == NULL) ? NULL : new T(this)); } 
    7575 
    7676      public : /* virtual */ 
     
    111111                  if (name.compare(FieldDefinition::GetDefName())  == 0) 
    112112                  // Parsing pour la définition des champs. 
    113                   { fieldDef  = CreateInstanceAndParse<FieldDefinition > 
     113                  { fieldDef  = CreateInstanceAndParse<FieldDefinition> 
    114114                                 (_node, FieldDefinition::GetDefName().c_str()); continue; } 
    115115 
    116116                  if (name.compare(FileDefinition::GetDefName())  == 0) 
    117117                  // Parsing pour la définition des fichiers. 
    118                   { fileDef   = CreateInstanceAndParse<FileDefinition  > 
     118                  { fileDef   = CreateInstanceAndParse<FileDefinition> 
    119119                                 (_node, FileDefinition  ::GetDefName().c_str()); continue; } 
    120120 
    121121                  if (name.compare(AxisDefinition::GetDefName())  == 0) 
    122122                  // Parsing pour la définition des axes. 
    123                   { axisDef   = CreateInstanceAndParse<AxisDefinition  > 
     123                  { axisDef   = CreateInstanceAndParse<AxisDefinition> 
    124124                                 (_node, AxisDefinition  ::GetDefName().c_str()); continue; } 
    125125 
    126126                  if (name.compare(GridDefinition::GetDefName())  == 0) 
    127127                  // Parsing pour la définition des grilles. 
    128                   { gridDef   = CreateInstanceAndParse<GridDefinition  > 
     128                  { gridDef   = CreateInstanceAndParse<GridDefinition> 
    129129                                 (_node, GridDefinition  ::GetDefName().c_str()); continue; } 
    130130 
     
    165165         } 
    166166 
     167         virtual std::string getXmlExtraAttributes(void) const 
     168         { 
     169            std::ostringstream oss; 
     170            oss << " calendar_type=\""<< ccalendar->getId() <<"\"" 
     171                << " start_date=\""   << ccalendar->getInitDate() <<"\""; 
     172            return (oss.str()); 
     173         } 
     174 
    167175      public : /* static */ 
    168176 
     
    173181         static void ShowTree(ostream& os = std::clog) 
    174182         { 
     183            std::string __curCtxt = Context::GetCurrentContext()->getId(); 
     184 
    175185            os << NIndent << "<?xml version=\"1.0\"?>" << std::endl; 
    176186            os << NIndent << "<" << Context::GetRootName() << ">" << std::endl; 
     
    189199            os << NIndent << std::endl; 
    190200            os << NIndent << "</" << Context::GetRootName() << ">" << std::endl  ; 
     201            Context::SetCurrentContext(__curCtxt); 
    191202         } 
    192203 
     
    196207            Poco::HashMap<string, StrHashMap<Context> >::Iterator it; 
    197208 
    198             for (it = AllListContext.begin(); it != AllListContext.end(); it++) 
    199             { Context::SetCurrentContext((*it).first); delete ((*it).second)[(*it).first]; } 
     209            for (it  = AllListContext.begin(); 
     210                 it != AllListContext.end(); it++) 
     211            { 
     212               Context::SetCurrentContext((*it).first); 
     213               delete ((*it).second)[(*it).first]; 
     214            } 
    200215         } 
    201216 
     
    223238 
    224239         static bool HasContext(const string& id) 
    225          { return (Context::GetAllListObject().find(id) != Context::GetAllListObject().end()); } 
     240         { 
     241            return (Context::GetAllListObject().find(id) != 
     242                    Context::GetAllListObject().end()); 
     243         } 
    226244 
    227245         static Context* GetContext(const string& id) 
     
    250268 
    251269            if (!Context::HasContext(id) && withcheck) 
    252                throw new XMLIOUndefinedValueException 
     270               XMLIOError 
    253271                     ("Impossible de se placer dans le contexte "+id+" car celui-ci n'existe pas dans l'arborescence!"); 
    254272 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/data_treatment.hpp

    r134 r138  
    103103         } 
    104104 
    105          std::vector<CFile*> enabledFiles; // Liste des fichiers à créer dans un context donné. 
     105         std::vector<CFile *> enabledFiles; // Liste des fichiers à créer dans un context donné. 
    106106 
    107107      private : 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/declare_attribut.hpp

    r137 r138  
    2525   };                                                                               \ 
    2626                                                                                    \ 
    27    const Attr_##att_name& getAttr_##att_name(void) const { return (att_name); }     \ 
     27   const Attr_##att_name& get_##att_name(void) const { return (att_name); }     \ 
    2828   void set_##att_name (const Attr_##att_name& _newattr) { att_name = _newattr; }   \ 
    2929   void set_##att_name (const att_type& _newattr) { att_name.setValue(_newattr); }  \ 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/domain.hpp

    r137 r138  
    3535      if ((!ni_glo.hasValue() || ni_glo <= 0 ) || 
    3636          (!nj_glo.hasValue() || nj_glo <= 0 )) 
    37         ERROR("Le domaine global est mal défini, vérifiez les valeurs de \'ni_glo\' et \'nj_glo\' !") ; 
     37         ERROR("Le domaine global est mal défini, vérifiez les valeurs de \'ni_glo\' et \'nj_glo\' !") ; 
    3838 
    3939      // Domaine local en i // 
    40       if (ni.hasValue() && ibegin.hasValue() && !iend.hasValue()) 
     40           if (ni.hasValue() && ibegin.hasValue() && !iend.hasValue()) 
    4141         iend = ibegin + ni - 1 ; 
    4242      else if (ni.hasValue() && iend.hasValue() && !ibegin.hasValue()) 
     
    5555 
    5656      // Domaine local en j // 
    57       if (nj.hasValue() && jbegin.hasValue() && !jend.hasValue()) 
     57           if (nj.hasValue() && jbegin.hasValue() && !jend.hasValue()) 
    5858         jend = jbegin + nj - 1 ; 
    5959      else if (nj.hasValue() && jend.hasValue() && !jbegin.hasValue()) 
     
    8787 
    8888      // Données du domaine // 
    89       if (!data_jbegin.hasValue()) data_jbegin = 0 ; 
    90       if (!data_ibegin.hasValue()) data_ibegin = 0 ; 
     89      if (!data_ibegin.hasValue()) 
     90           data_ibegin = 0 ; 
     91      if (!data_jbegin.hasValue() && (data_dim == 2)) 
     92           data_jbegin = 0 ; 
    9193 
    9294      if (data_dim.hasValue() && 
    93         !(data_dim==1 || data_dim==2)) 
     95        !(data_dim == 1 || data_dim == 2)) 
    9496         ERROR("Dimension des données non comptatible (doit être 1 ou 2) !") ; 
    9597      else if (! data_dim.hasValue()) 
     
    101103         data_ni = (data_dim == 1) ? (ni * nj) : (int) ni; 
    102104 
    103       if (data_nj.hasValue() && (data_nj <= 0)) 
    104          ERROR("Dimension des données négative (data_nj).") ; 
    105       else if (!data_nj.hasValue()) 
    106          data_nj = (int) nj ; 
     105      if (data_dim == 2) 
     106      { 
     107         if (data_nj.hasValue() && (data_nj <= 0) ) 
     108            ERROR("Dimension des données négative (data_nj).") ; 
     109         else if (!data_nj.hasValue()) 
     110            data_nj = (int) nj ; 
     111      } 
    107112 
    108113      // Gestion de la compression // 
     
    132137 
    133138      if (!data_n_index.hasValue()) 
    134       { // -> bloc re-vérfié OK 
     139      { // -> bloc re-vérifié OK 
    135140         if (data_dim == 1) 
    136141         { 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/exception.hpp

    r137 r138  
    1010namespace XMLIOSERVER 
    1111{ 
    12    class XMLIOException : public Exception 
     12 
     13   class XMLIOError : public std::ostringstream 
    1314   { 
     15      private : 
     16 
     17         class XMLIOException : public Exception 
     18         { 
     19            public : 
     20 
     21               XMLIOException(int _code) 
     22                  : Exception(_code) 
     23               { /* Ne rien faire de plus */ } 
     24 
     25               XMLIOException(const std::string& _msg, int _code = 0) 
     26                  : Exception(_msg, _code) 
     27               { /* Ne rien faire de plus */ } 
     28 
     29               XMLIOException(const std::string& _msg, const std::string& _arg, int _code) 
     30                  : Exception(_msg, _arg, _code) 
     31               { /* Ne rien faire de plus */ } 
     32 
     33               XMLIOException(const std::string& _msg, const Poco::Exception& _exc, int _code) 
     34                  : Exception(_msg, _exc, _code) 
     35               { /* Ne rien faire de plus */ } 
     36 
     37               XMLIOException(const XMLIOException& _exc) 
     38                  : Exception(_exc) 
     39               { /* Ne rien faire de plus */ } 
     40 
     41               ~XMLIOException(void) throw() 
     42               { std::cerr << displayText() << std::endl; } 
     43 
     44               XMLIOException& operator = (const XMLIOException& _exc) 
     45               { Exception::operator = (_exc); return *this; } 
     46 
     47            public : /* virtual */ 
     48 
     49               virtual const char* name(void) const throw() { return ("XMLIO>XMLIOException"); } 
     50               virtual const char* className(void) const throw() { return (typeid(*this).name()); } 
     51 
     52               virtual Exception* clone(void) const { return new XMLIOException(*this); } 
     53               virtual void rethrow(void) const { throw *this; } 
     54 
     55         }; // class XMLIOException 
     56 
    1457      public : 
    1558 
    16          XMLIOException(int _code) 
    17             : Exception(_code) 
     59         XMLIOError(const std::string _msg) 
     60            : msg(_msg) 
    1861         { /* Ne rien faire de plus */ } 
    1962 
    20          XMLIOException(const std::string& _msg, int _code) 
    21             : Exception(_msg, _code) 
    22          { /* Ne rien faire de plus */ } 
     63         ~XMLIOError(void) 
     64         { throw  XMLIOException(msg); } 
    2365 
    24          XMLIOException(const std::string& _msg, const std::string& _arg, int _code) 
    25             : Exception(_msg, _arg, _code) 
    26          { /* Ne rien faire de plus */ } 
     66      private : 
    2767 
    28          XMLIOException(const std::string& _msg, const Poco::Exception& _exc, int _code) 
    29             : Exception(_msg, _exc, _code) 
    30          { /* Ne rien faire de plus */ } 
    31  
    32          XMLIOException(const XMLIOException& _exc) 
    33             : Exception(_exc) 
    34          { /* Ne rien faire de plus */ } 
    35  
    36          ~XMLIOException(void) throw() 
    37          { std::cerr << displayText() << std::endl; } 
    38  
    39          XMLIOException& operator = (const XMLIOException& _exc) 
    40          { Exception::operator = (_exc); return *this; } 
    41  
    42          virtual const char* name(void) const throw() { return ("XMLIO>XMLIOException"); } 
    43          virtual const char* className(void) const throw() { return (typeid(*this).name()); } 
    44  
    45          virtual Exception* clone(void) const { return new XMLIOException(*this); } 
    46          virtual void rethrow(void) const { throw *this; } 
     68         std::string msg; 
    4769 
    4870   }; // class XMLIOException 
    49  
    50    class XMLIOUndefinedValueException : public XMLIOException 
    51    { 
    52       public : 
    53          XMLIOUndefinedValueException(const std::string& _msg) 
    54             : XMLIOException(_msg, 1001) 
    55          { /* Ne rien faire de plus */ } 
    56  
    57          const char* name(void) const throw() 
    58          { return ("XMLIO>UndefinedValueException"); } 
    59  
    60          ~XMLIOUndefinedValueException(void) throw() 
    61          { std::cerr << displayText() << std::endl; } 
    62  
    63    }; //class XMLIOUndefinedException 
    64  
    65    class XMLIOStreamException : public XMLIOException 
    66    { 
    67       public : 
    68          XMLIOStreamException(const std::string& _msg) 
    69             : XMLIOException(_msg, 1002) 
    70          { /* Ne rien faire de plus */ } 
    71  
    72          const char* name(void) const throw() 
    73          { return ("XMLIO>StreamException"); } 
    74  
    75    }; //class XMLIOStreamException 
    76  
    77    class XMLParsingException : public XMLIOException 
    78    { 
    79       public : 
    80          XMLParsingException(const std::string& _msg) 
    81             : XMLIOException(_msg, 1003) 
    82          { /* Ne rien faire de plus */ } 
    83  
    84          const char* name(void) const throw() 
    85          { return ("XMLIO>XMLParsingException"); } 
    86  
    87    }; //class XMLParsingException 
    88  
    89    class XMLIOIncompatibleTypeException : public XMLIOException 
    90    { 
    91       public : 
    92          XMLIOIncompatibleTypeException(const std::string& _msg) 
    93             : XMLIOException(_msg, 1003) 
    94          { /* Ne rien faire de plus */ } 
    95  
    96          const char* name(void) const throw() 
    97          { return ("XMLIO>XMLIOIncompatibeTypeException"); } 
    98  
    99    }; //class XMLIOIncompatibleTypeException 
    100  
    101    // A compléter. 
    10271 
    10372}// namespace XMLIOSERVER 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/field.hpp

    r131 r138  
    112112   { 
    113113      if (!_ori->hasId()) 
    114          throw (new XMLIOUndefinedValueException 
    115             ("Impossible de créer une référence à un élément sans identifiant !")); 
     114         XMLIOError 
     115            ("Impossible de créer une référence à un élément sans identifiant !"); 
    116116 
    117117      CField& obj = *ObjectTemplate<CField>::CreateObject(); 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/field_gridrefsolver.hpp

    r124 r138  
    1212      { 
    1313         if (CDomain::HasObject(domain_ref)) domain = CDomain::GetObject(domain_ref) ; 
    14          else throw XMLIOSERVER::XMLIOUndefinedValueException("Référence au domaine nommé \'"+ (string)domain_ref +"\' incorrecte") ; 
     14         else XMLIOError("Référence au domaine nommé \'"+ (string)domain_ref +"\' incorrecte") ; 
    1515      } 
    1616 
     
    1818      { 
    1919         if (CAxis::HasObject(axis_ref)) axis = CAxis::GetObject(axis_ref) ; 
    20          else throw XMLIOSERVER::XMLIOUndefinedValueException("Référence à l'axe nommé \'"+ (string)axis_ref +"\' incorrecte") ; 
     20         else XMLIOError("Référence à l'axe nommé \'"+ (string)axis_ref +"\' incorrecte") ; 
    2121      } 
    2222 
     
    2424      { 
    2525         if (CGrid::HasObject(grid_ref)) grid = CGrid::GetObject(grid_ref) ; 
    26          else throw XMLIOSERVER::XMLIOUndefinedValueException("Référence à la grille nommée \'"+ (string)grid_ref +"\' incorrecte"); 
     26         else XMLIOError("Référence à la grille nommée \'"+ (string)grid_ref +"\' incorrecte"); 
    2727      } 
    2828 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/file.hpp

    r137 r138  
    3535         { 
    3636            if (_output != NULL) output = _output; 
    37             else throw XMLIOSERVER::XMLIOUndefinedValueException 
     37            else XMLIOError 
    3838               ("Impossible d'initialiser la sortie de données pour le fichier nommé '"+ getId() +"'.") ; 
    3939         } 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/grid.hpp

    r127 r138  
    7878         static string GetDefName(void) { return (CGrid::GetName()); } 
    7979 
    80          static CGrid* CreateObject(const CDomain* const a_domain, const CAxis* const a_axis) 
    81          { 
    82             string new_id = string("___") + a_domain->getId() + string("_") + a_axis->getId() + string("__") ; 
     80         static CGrid* CreateObject(const CDomain * const a_domain, 
     81                                    const CAxis   * const a_axis) 
     82         { 
     83            string new_id = string("___") + a_domain->getId() + 
     84                            string("_") + a_axis->getId() + string("__") ; 
    8385            CGrid* const grid = ObjectTemplate<CGrid>::CreateObject(new_id) ; 
    8486 
     
    124126   void CGrid::computeIndex(void) 
    125127   { 
    126       int ni = domain->ni ; 
    127       int nj = domain->nj ; 
    128       int size = (hasAxis) ? (int)axis->size : 1 ; 
    129       int data_dim = domain->data_dim ; 
    130       int data_n_index = domain->data_n_index ; 
    131       int data_ibegin  = domain->data_ibegin ; 
    132       int data_jbegin  = (data_dim == 2) ? (int)domain->data_jbegin : -1; 
    133  
    134       Array<int, 1>& data_i_index =* domain->data_i_index ; 
    135       Array<int, 1>& data_j_index =* domain->data_j_index ; 
    136       Array<bool, 2>& mask =* domain->mask ; 
    137       int i, j, l, n ; 
    138       int count, indexCount ; 
    139  
    140       for(indexCount=0, l=0; l<size ; l++) 
     128      const int ni   = domain->ni , 
     129                nj   = domain->nj , 
     130                size = (hasAxis) ? (int)axis->size : 1 ; 
     131 
     132      /*std::cout << ni   << " : " 
     133                  << nj   << " : " 
     134                  << size << std::endl;*/ 
     135 
     136      const int data_dim     = domain->data_dim , 
     137                data_n_index = domain->data_n_index , 
     138                data_ibegin  = domain->data_ibegin , 
     139                data_jbegin  = (data_dim == 2) ? (int)domain->data_jbegin : -1; 
     140 
     141      Array<int, 1>& data_i_index =* domain->data_i_index , 
     142                     data_j_index =* domain->data_j_index ; 
     143 
     144      /*std::cout << data_n_index        << " : " 
     145                  << data_i_index.size() << " : " 
     146                  << data_j_index.size()  << std::endl;*/ 
     147 
     148      Array<bool, 2>& mask = *domain->mask ; 
     149 
     150      int indexCount = 0; 
     151 
     152      for(int l = 0; l < size ; l++) 
    141153      { 
    142          for(n=0; n<data_n_index; n++) 
    143          { 
    144             if (data_dim == 1) 
    145             { 
    146                i = (data_i_index(n) + data_ibegin) % ni ; 
    147                j = (data_i_index(n) + data_ibegin) / ni ; 
    148                //cout<<i<<" "<<j<<" "<<mask(i,j)<<endl ; 
    149             } 
    150             else 
    151             { 
    152                i = data_i_index(n) + data_ibegin ; 
    153                j = data_j_index(n) + data_jbegin ; 
    154                //cout<<i<<" "<<j<<" "<<mask(i,j)<<endl ; 
    155             } 
    156  
    157             if (i>=0 && i<ni && j>=0 && j<nj && mask(i,j) ) indexCount++ ; 
     154         for(int n = 0, i = 0, j = 0; n < data_n_index; n++) 
     155         { 
     156            int temp_i = data_i_index(n) + data_ibegin, 
     157                temp_j = (data_dim == 1) ? -1 
     158                       : data_j_index(n) + data_jbegin; 
     159            i = (data_dim == 1) ? (temp_i - 2) % ni 
     160                                : (temp_i - 1) ; 
     161            j = (data_dim == 1) ? (temp_i - 2) / ni 
     162                                : (temp_j - 1) ; 
     163 
     164            if ((i >= 0 && i < ni) && 
     165                (j >= 0 && j < nj) && mask(i, j)) 
     166               indexCount++ ; 
    158167         } 
    159168      } 
    160169 
    161       storeIndex.resize(indexCount) ; 
     170      //std::cout << indexCount  << std::endl; 
     171 
     172       storeIndex.resize(indexCount) ; 
    162173      out_l_index.resize(indexCount) ; 
    163174      out_i_index.resize(indexCount) ; 
    164175      out_j_index.resize(indexCount) ; 
    165176 
    166       for(count=0, indexCount=0, l=0; l<size; l++) 
     177      for(int count = 0, indexCount = 0,  l = 0; l < size; l++) 
    167178      { 
    168          for(n=0; n<data_n_index; n++, count++) 
    169          { 
    170             if (data_dim == 1) 
     179         for(int n = 0, i = 0, j = 0; n < data_n_index; n++, count++) 
     180         { 
     181            int temp_i = data_i_index(n) + data_ibegin, 
     182                temp_j = (data_dim == 1) ? -1 
     183                       : data_j_index(n) + data_jbegin; 
     184            i = (data_dim == 1) ? (temp_i - 2) % ni 
     185                                : (temp_i - 1) ; 
     186            j = (data_dim == 1) ? (temp_i - 2) / ni 
     187                                : (temp_j - 1) ; 
     188 
     189            if ((i >= 0 && i < ni) && 
     190                (j >= 0 && j < nj) && mask(i, j)) 
    171191            { 
    172                i = (data_i_index(n) + data_ibegin) % ni ; 
    173                j = (data_i_index(n) + data_ibegin) / ni ; 
    174             } 
    175             else // (dat_dim == 2) 
    176             { 
    177                i = data_i_index(n) + data_ibegin ; 
    178                j = data_j_index(n) + data_jbegin ; 
    179             } 
    180  
    181             if (i>=0 && i<ni && j>=0 && j<nj && mask(i,j)) 
    182             { 
    183                storeIndex(indexCount) = count ; 
     192               storeIndex(indexCount)  = count ; 
    184193               out_l_index(indexCount) = l ; 
    185194               out_i_index(indexCount) = i ; 
     
    192201 
    193202   template<> 
    194       void CGrid::outputField(const Array<double, 1>& stored, Array<double, 2>& outField) const 
     203      void CGrid::outputField(const Array<double, 1>& stored, 
     204                                    Array<double, 2>& outField) const 
    195205   { 
    196206      for(int n = 0; n < storeIndex.size(); n++) 
     
    199209 
    200210   template<> 
    201       void CGrid::outputField(const Array<double, 1>& stored, Array<double, 3>& outField) const 
     211      void CGrid::outputField(const Array<double, 1>& stored, 
     212                                    Array<double, 3>& outField) const 
    202213   { 
    203214      for(int n = 0; n < storeIndex.size(); n++) 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/group_template.hpp

    r137 r138  
    99      public: 
    1010 
    11          DECLARE_ATTR(group_ref, string) ; // Attribut présent uniqument dans les groupes. 
     11         // Attribut présent uniqument dans les groupes. 
     12         DECLARE_ATTR(group_ref, string) ; 
    1213 
    1314         GroupTemplate(void) 
     
    2223 
    2324         GroupTemplate<T, U>& createGroup(const string& _id) 
    24             throw (XMLIOUndefinedValueException) 
     25 
    2526         { 
    2627            GroupTemplate<T, U> &obj = *GroupTemplate<T, U>::CreateObject(_id); 
     
    3940 
    4041         GroupTemplate<T, U>& getGroup(const string& _id) const 
    41             throw (XMLIOUndefinedValueException) 
     42 
    4243         { return (*groupList[_id]); } 
    4344 
    44          bool hasGroup(const string& _id) const { return (groupList.hasMappedValue(_id)); } 
     45         bool hasGroup(const string& _id) const 
     46         { return (groupList.hasMappedValue(_id)); } 
    4547 
    4648         const StrHashMap<GroupTemplate<T, U>* >& getGroupList(void) const { return (groupList); } 
     
    5153 
    5254         T& createChild(const string& _id) 
    53             throw (XMLIOUndefinedValueException) 
     55 
    5456         { 
    5557            T& obj = *ObjectTemplate<T>::CreateObject(_id); 
     
    6971 
    7072         T& getChild(const string& _id) const 
    71             throw (XMLIOUndefinedValueException) 
     73 
    7274         { return (*childList[_id]); } 
    7375 
    74          bool hasChild(const string& _id) const { return (childList.hasMappedValue(_id)); } 
     76         bool hasChild(const string& _id) const 
     77         { return (childList.hasMappedValue(_id)); } 
    7578 
    7679         const StrHashMap<T*> & getCurrentListChild  (void) const { return (childList); } 
     
    8285         { 
    8386            const vector<GroupTemplate<T, U>*>& groupvect = groupList.getVector(); 
    84             _allc.insert (_allc.end(), getCurrentVectorChild().begin(), getCurrentVectorChild().end()); 
     87            _allc.insert (_allc.end(), getCurrentVectorChild().begin(), 
     88                                       getCurrentVectorChild().end()); 
    8589 
    8690            for(unsigned int i = 0; i < groupvect.size() ; i++) 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/logger.hpp

    r137 r138  
    7474         ~ILogger(void) { this->flush(); } 
    7575 
    76    }; // class XMLIOLogger 
     76   }; // class ILogger 
    7777 
    7878   // Initialisation de la classe de Logging 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/main.f90

    r137 r138  
    44 
    55PROGRAM MAIN 
     6 
    67   USE IXHANDLE 
    78   USE IXML 
     
    1314 
    1415   INTEGER       :: compt = 0 
    15  
    1616   TYPE(XHandle) :: nemo_style_ctxt     = NULLHANDLE, & 
    1717                    orchidee_style_ctxt = NULLHANDLE, & 
    1818                    lmdz_style_ctxt     = NULLHANDLE 
    19  
    2019   TYPE(XHandle) :: temp_mod  = NULLHANDLE, & 
    2120                    temp_mod_ = NULLHANDLE 
    22  
    23    ! Axes verticaux 
     21   ! Les axes verticaux 
    2422   REAL(kind = 8), DIMENSION(10) :: vaxis  = (/(i, i=1, 10)/) 
    2523                                    !vvaxis = (/(i, i=1, 5)/) 
    26  
    27    ! Domaines horizontaux 
    28    REAL(kind = 8), DIMENSION(20) :: lonrect_orch0  = (/(i, i=11, 30)/),& 
    29                                     latrect_orch0  = (/(i, i=11, 30)/) 
    30  
     24   ! Les domaines horizontaux 
     25   REAL(kind = 8), DIMENSION(20)    :: lonrect_orch0  = (/(i, i=11, 30)/),& 
     26                                       latrect_orch0  = (/(i, i=11, 30)/) 
    3127   REAL(kind = 8), DIMENSION(10,10) :: loncurv_nemo0  = 1, & 
    3228                                       latcurv_nemo0  = 1 
    33  
    3429   ! Les durées 
    3530   TYPE(XDuration) :: timestep_1h = XDuration(0., 0., 0., 1., 0., 0.) 
    3631                      !timestep_2h = XDuration(0., 0., 0., 2., 0., 0.) 
    37  
     32   ! Les dates 
     33   TYPE(XDate) :: init_date_orchidee = XDate(1985, 03, 15, 17, 35, 00) 
    3834   ! Les masques 
    3935   LOGICAL(kind = 1), DIMENSION(20, 20) :: mask0  = .TRUE._1 
    4036 
    41    CHARACTER(len = *), PARAMETER :: filename = & 
    42             "/local/XMLIOSERVER_DEV/dev_rv/test/iodef_simple_test.xml" 
     37   ! Les données 
     38   REAL(kind = 8), DIMENSION(400, 10)    :: orchdata  = 2.0 
     39   REAL(kind = 8), DIMENSION(10, 10, 20) :: nemodata  = 3.0 
    4340 
    4441   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
    4542 
    4643   ! Parsing du document xml depuis un fichier situé sur le disque. 
    47    CALL xml_Parse_File(filename) 
     44   CALL xml_Parse_File("/local/XMLIOSERVER_DEV/dev_rv/test/iodef_simple_test.xml") 
    4845 
    4946   ! Création de handle sur les contextes exstants dans lequels on souhaite travailler. 
     
    6461   CALL context_create(context_hdl   = orchidee_style_ctxt, & 
    6562                       context_id    = "orchidee_style",    & 
    66                        calendar_type = GREGORIAN) 
    67  
    68    ! ---------> field_définition 
     63                       calendar_type = GREGORIAN,           & 
     64                       init_date     = init_date_orchidee) 
     65 
     66   ! ---------> field_definition 
    6967   CALL handle_create(temp_mod, GFIELD,  "field_definition") 
    7068      CALL xml_tree_add(parent_hdl = temp_mod,        & 
     
    8886                                    ffreq_op       = timestep_1h,    & 
    8987                                    fgrid_ref      = "grid0") 
    90    ! ---------> axis_définition 
     88 
     89   ! ---------> axis_definition 
    9190   CALL handle_create(temp_mod, GAXIS,   "axis_definition") 
    9291      CALL xml_tree_add(parent_hdl = temp_mod,        & 
     
    106105                                   avalue         = vaxis) 
    107106 
    108    ! ---------> domain_définition 
     107   ! ---------> domain_definition 
    109108   CALL handle_create(temp_mod, GDOMAIN, "domain_definition") 
    110109      CALL xml_tree_add(parent_hdl = temp_mod,        & 
     
    135134                                     domtype        = "rectilinear") 
    136135 
    137    ! ---------> file_définition 
     136   ! ---------> file_definition 
    138137   CALL handle_create(temp_mod, GFILE,   "file_definition") 
    139138      CALL xml_tree_add(parent_hdl = temp_mod,        & 
     
    181180 
    182181   ! ----------- Début du traitement ----------- ! 
    183    ! On choisit le context dans lequel on va travailler et on commence le traitement des données. 
     182 
     183   ! <<<------------- orchidée 
     184   PRINT *, "Style Orchydée" 
     185   ! On choisit le context dans lequel on va travailler 
     186   ! et on commence le traitement des données. 
    184187   CALL dtreatment_start(orchidee_style_ctxt, NETCDF4) 
     188   CALL set_timestep(XDuration(0., 0., 0., 1., 0., 0.)) ! UNE heure 
    185189 
    186190   ! Exécution de la boucle de calcul-écriture. 
    187    DO compt = 0, 9 
    188  
     191   DO compt = 1, 9 
     192      CALL update_calendar(compt) 
     193         CALL write_data("field0", data2d_k8 = orchdata) 
    189194   END DO 
     195   CALL dtreatment_end(orchidee_style_ctxt) 
     196 
     197   ! <<<------------- lmdz 
     198   PRINT *, "Style Lmdz" 
     199   CALL dtreatment_start(lmdz_style_ctxt, NETCDF4) 
     200   CALL set_timestep(XDuration(0., 0., 0., 1., 0., 0.)) ! UNE heure 
     201 
     202   ! Exécution de la boucle de calcul-écriture. 
     203   DO compt = 1, 9 
     204      CALL update_calendar(compt) 
     205 
     206   END DO 
     207   CALL dtreatment_end(lmdz_style_ctxt) 
     208 
     209   ! <<<------------- nemo 
     210   PRINT *, "Style Nemo" 
     211   CALL dtreatment_start(nemo_style_ctxt, NETCDF4) 
     212   CALL set_timestep(XDuration(0., 0., 0., 1., 0., 0.)) ! UNE heure 
     213 
     214   ! Exécution de la boucle de calcul-écriture. 
     215   DO compt = 1, 9 
     216      CALL update_calendar(compt) 
     217      CALL write_data("champ0",  data3d_k8 = nemodata) 
     218   END DO 
     219   CALL dtreatment_end(nemo_style_ctxt) 
    190220 
    191221   ! Affichage de l'arbre xml au niveau de la sortie. 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/object_template.hpp

    r137 r138  
    2525         { 
    2626            const AttributRegistrar &ar = c; 
     27            std::string extraAttributes = c.getXmlExtraAttributes(); 
    2728 
    2829            if (c.baseObject != NULL) 
     
    3233            if (c.isDefinition()) 
    3334            { 
    34                out << NIndent << std::endl; 
    35                out << NIndent << "<!-- Groupe de définition dans le contexte \"" << ObjectTemplate<T>::GetCurrentContextId() << "\" courant -->" << std::endl; 
     35               out << NIndent << std::endl 
     36                   << NIndent << "<!-- Groupe de définition dans le contexte \"" 
     37                   << ObjectTemplate<T>::GetCurrentContextId() << "\" courant -->" 
     38                   << std::endl; 
    3639            } 
    3740 
    3841            if (c.hasChild()) 
    3942            { 
    40                out << IncIndent  << "<"  << c.getName()  << c.printId() << ar << ">" << std::endl; 
    41                c.printChild(out); // << Ecriture des objets enfants ici. 
    42                if (c.hasId() && (c.getName().compare("context") == 0)) 
    43                   out << NIndent << std::endl; 
     43               bool __isContext = false; 
     44               if (c.hasId() && 
     45                  (c.getName().compare("context") == 0)) 
     46               { 
     47                  out << IncIndent       << "<" << c.getName() << c.printId() 
     48                      << extraAttributes << ">" << std::endl; 
     49                  __isContext = true; 
     50               } 
     51               else 
     52                  out << IncIndent   << "<"  << c.getName() 
     53                      << c.printId() << ar << ">" << std::endl; 
     54               c.printChild(out); 
     55               if (__isContext) out << NIndent << std::endl; 
    4456               out << NIndent    << "</" << c.getName()  << ">" << DecEndl; 
    4557            } 
    4658            else 
    47                out << IncIndent << "<" << c.getName()  << c.printId() << ar << "/>" << DecEndl; 
     59            { 
     60               out << IncIndent << "<" << c.getName() << c.printId() 
     61                   << extraAttributes << ar << "/>" << DecEndl; 
     62            } 
    4863 
    4964            return (out); 
     
    5671         } 
    5772 
    58          string getName(void) const 
     73         std::string getName(void) const 
    5974         { 
    6075            if (this->hasId()) 
     
    98113         } 
    99114 
     115         virtual std::string getXmlExtraAttributes(void) const 
     116         { return (std::string("")); } 
     117 
    100118         virtual void parse (XMLNode& _node) 
    101119         { 
     
    117135      public : /* static */ 
    118136 
    119          static T* CreateObject(const string& _id) throw (XMLIOUndefinedValueException) 
     137         static T* CreateObject(const string& _id) 
    120138         { 
    121139            // Si l'identifiant est répertorié, on retourne l'élément existant. 
     
    136154         } 
    137155 
    138          static T* GetObject(const string& _id) throw (XMLIOUndefinedValueException) 
     156         static T* GetObject(const string& _id) 
    139157         { return (ObjectTemplate<T>::AllListObj[CurrContext][_id]); } 
    140158 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/xml_node.hpp

    r137 r138  
    9797                  node.setCNode(node.pDoc->documentElement()); 
    9898                  if (node.getElementName().compare(_rootName) != 0) // << A passer en avertissement. 
    99                      throw XMLParsingException("L'élément racine doit avoir pour valeur <" + _rootName + "> (\"" + node.getElementName() + "\" lue)"); 
     99                     XMLIOError("L'élément racine doit avoir pour valeur <" + _rootName + "> (\"" + node.getElementName() + "\" lue)"); 
    100100               } 
    101101               else 
    102                   throw XMLIOStreamException("Impossible de lire le flux en entrée pour le parsing XML !"); 
     102                  XMLIOError("Impossible de lire le flux en entrée pour le parsing XML !"); 
    103103 
    104104               return (node); 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/xml_parser.hpp

    r132 r138  
    2929 
    3030                  if (attributes.end() == attributes.find("id")) 
    31                   { WARNING("Le context ne sera pas traité car il n'est pas identifié !"); continue; } 
     31                  { 
     32                     WARNING("Le context ne sera pas traité car il n'est pas identifié !"); 
     33                     continue; 
     34                  } 
    3235 
    3336                  if( Context::GetAllListObject().find(attributes["id"]) != 
    3437                      Context::GetAllListObject().end()) 
    35                   { WARNING("Le context ne sera pas traité car il existe déjà un autre context possédant le même nom !"); continue; } 
     38                  { 
     39                     WARNING("Le context ne sera pas traité car il existe déjà un autre context possédant le même nom !"); 
     40                     continue; 
     41                  } 
    3642 
    3743                  Context::SetCurrentContext(attributes["id"], false, false); 
     
    4046                  if ((attributes.end() != attributes.find("calendar_type")) && 
    4147                      (attributes.end() != attributes.find("start_date"))) 
    42                      context.setCalendar(attributes["calendar_type"], attributes["start_date"]); 
     48                     context.setCalendar(attributes["calendar_type"], 
     49                                         attributes["start_date"]); 
    4350 
    4451                  context.parse(_node); 
Note: See TracChangeset for help on using the changeset viewer.