Changeset 526 for XIOS/trunk
- Timestamp:
- 12/02/14 15:18:09 (9 years ago)
- Location:
- XIOS/trunk/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/config/calendar_type.conf
r501 r526 1 1 #ifdef __XMLIO_CAllLeapCalendar__ 2 DECLARE_CALENDAR(AllLeap ,AllLeap)2 DECLARE_CALENDAR(AllLeap, calendar_type_attr::AllLeap) 3 3 #endif //__XMLIO_CAllLeapCalendar__ 4 4 5 5 #ifdef __XMLIO_CD360Calendar__ 6 DECLARE_CALENDAR(D360 ,D360)6 DECLARE_CALENDAR(D360, calendar_type_attr::D360) 7 7 #endif //__XMLIO_CD360Calendar__ 8 8 9 9 #ifdef __XMLIO_CGregorianCalendar__ 10 DECLARE_CALENDAR(Gregorian ,Gregorian)10 DECLARE_CALENDAR(Gregorian, calendar_type_attr::Gregorian) 11 11 #endif //__XMLIO_CGregorianCalendar__ 12 12 13 13 #ifdef __XMLIO_CJulianCalendar__ 14 DECLARE_CALENDAR(Julian ,Julian)14 DECLARE_CALENDAR(Julian, calendar_type_attr::Julian) 15 15 #endif //__XMLIO_CJulianCalendar__ 16 16 17 17 #ifdef __XMLIO_CNoLeapCalendar__ 18 DECLARE_CALENDAR(NoLeap ,NoLeap)18 DECLARE_CALENDAR(NoLeap, calendar_type_attr::NoLeap) 19 19 #endif //__XMLIO_CNoLeapCalendar__ 20 21 #undef DECLARE_CALENDAR -
XIOS/trunk/src/config/context_attribute.conf
r501 r526 1 DECLARE_ ATTRIBUTE(StdString, calendar_type)1 DECLARE_ENUM5(calendar_type, D360, AllLeap, NoLeap, Julian, Gregorian) 2 2 DECLARE_ATTRIBUTE(StdString, start_date) 3 3 DECLARE_ATTRIBUTE(StdString, time_origin) -
XIOS/trunk/src/config/file_attribute.conf
r517 r526 13 13 DECLARE_ENUM2(type,one_file,multiple_file) 14 14 DECLARE_ENUM2(format, netcdf4, netcdf4_classic) 15 DECLARE_ ATTRIBUTE(StdString, par_access)15 DECLARE_ENUM2(par_access, collective, independent) 16 16 17 17 // DECLARE_ATTRIBUTE_DEF(bool, enabled, true) -
XIOS/trunk/src/interface/c_attr/iccontext_attr.cpp
r509 r526 22 22 if(!cstr2string(calendar_type, calendar_type_size, calendar_type_str)) return; 23 23 CTimer::get("XIOS").resume(); 24 context_hdl->calendar_type. setValue(calendar_type_str);24 context_hdl->calendar_type.fromString(calendar_type_str); 25 25 CTimer::get("XIOS").suspend(); 26 26 } … … 29 29 { 30 30 CTimer::get("XIOS").resume(); 31 if(!string_copy(context_hdl->calendar_type.getInherited Value(),calendar_type , calendar_type_size))31 if(!string_copy(context_hdl->calendar_type.getInheritedStringValue(),calendar_type , calendar_type_size)) 32 32 ERROR("void cxios_get_context_calendar_type(context_Ptr context_hdl, char * calendar_type, int calendar_type_size)", <<"Input string is to short"); 33 33 CTimer::get("XIOS").suspend(); -
XIOS/trunk/src/interface/c_attr/icfile_attr.cpp
r517 r526 215 215 if(!cstr2string(par_access, par_access_size, par_access_str)) return; 216 216 CTimer::get("XIOS").resume(); 217 file_hdl->par_access. setValue(par_access_str);217 file_hdl->par_access.fromString(par_access_str); 218 218 CTimer::get("XIOS").suspend(); 219 219 } … … 222 222 { 223 223 CTimer::get("XIOS").resume(); 224 if(!string_copy(file_hdl->par_access.getInherited Value(),par_access , par_access_size))224 if(!string_copy(file_hdl->par_access.getInheritedStringValue(),par_access , par_access_size)) 225 225 ERROR("void cxios_get_file_par_access(file_Ptr file_hdl, char * par_access, int par_access_size)", <<"Input string is to short"); 226 226 CTimer::get("XIOS").suspend(); -
XIOS/trunk/src/interface/c_attr/icfilegroup_attr.cpp
r517 r526 241 241 if(!cstr2string(par_access, par_access_size, par_access_str)) return; 242 242 CTimer::get("XIOS").resume(); 243 filegroup_hdl->par_access. setValue(par_access_str);243 filegroup_hdl->par_access.fromString(par_access_str); 244 244 CTimer::get("XIOS").suspend(); 245 245 } … … 248 248 { 249 249 CTimer::get("XIOS").resume(); 250 if(!string_copy(filegroup_hdl->par_access.getInherited Value(),par_access , par_access_size))250 if(!string_copy(filegroup_hdl->par_access.getInheritedStringValue(),par_access , par_access_size)) 251 251 ERROR("void cxios_get_filegroup_par_access(filegroup_Ptr filegroup_hdl, char * par_access, int par_access_size)", <<"Input string is to short"); 252 252 CTimer::get("XIOS").suspend(); -
XIOS/trunk/src/node/context.cpp
r511 r526 73 73 { 74 74 this->calendar = newCalendar; 75 calendar_type. setValue(this->calendar->getId());75 calendar_type.fromString(this->calendar->getId()); 76 76 start_date.setValue(this->calendar->getInitDate().toString()); 77 77 } … … 87 87 << "Impossible to define a calendar (an attribute is missing)."); 88 88 89 #define DECLARE_CALENDAR(MType , mtype)\90 if (calendar_type.getValue() .compare(#mtype) == 0)\91 { \92 if (time_origin.isEmpty()) \93 this->calendar = boost::shared_ptr<CCalendar>\94 (new C##MType##Calendar(start_date.getValue()));\95 else this->calendar = boost::shared_ptr<CCalendar>\96 (new C##MType##Calendar(start_date.getValue(),time_origin.getValue()));\97 if (!this->timestep.isEmpty()) \98 this->calendar->setTimeStep\99 (CDuration::FromString(this->timestep.getValue()));\100 return; \89 #define DECLARE_CALENDAR(MType, eType) \ 90 if (calendar_type.getValue() == eType) \ 91 { \ 92 if (time_origin.isEmpty()) \ 93 this->calendar = boost::shared_ptr<CCalendar> \ 94 (new C##MType##Calendar(start_date.getValue())); \ 95 else this->calendar = boost::shared_ptr<CCalendar> \ 96 (new C##MType##Calendar(start_date.getValue(),time_origin.getValue())); \ 97 if (!this->timestep.isEmpty()) \ 98 this->calendar->setTimeStep \ 99 (CDuration::FromString(this->timestep.getValue())); \ 100 return; \ 101 101 } 102 102 #include "calendar_type.conf" 103 #undef DECLARE_CALENDAR 103 104 104 105 ERROR("CContext::solveCalendar(void)", 105 << "[ calendar_type = " << calendar_type.get Value() << " ] "106 << "The calendar is not defined!");106 << "[ calendar_type = " << calendar_type.getStringValue() << " ] " 107 << "The calendar is not properly handled!"); 107 108 } 108 109 -
XIOS/trunk/src/node/file.cpp
r518 r526 358 358 oss << ".nc"; 359 359 360 if (isOpen) data_out->closeFile() ; 361 bool isCollective=true ; 362 if (!par_access.isEmpty()) 363 { 364 if (par_access.getValue()=="independent") isCollective=false ; 365 else if (par_access.getValue()=="collective") isCollective=true ; 366 else 367 { 368 ERROR("void Context::createDataOutput(void)", 369 "incorrect file <par_access> attribut : must be <collective> or <indepedent>, " 370 <<"having : <"<<type.getValue()<<">") ; 371 } 372 } 360 bool isCollective = par_access.isEmpty() || par_access == par_access_attr::collective; 361 362 if (isOpen) data_out->closeFile(); 363 373 364 data_out=shared_ptr<CDataOutput>(new CNc4DataOutput(oss.str(), false, useClassicFormat, 374 365 fileComm, multifile, isCollective));
Note: See TracChangeset
for help on using the changeset viewer.