Changeset 202
- Timestamp:
- 05/24/11 17:47:01 (13 years ago)
- Location:
- XMLIO_V2/dev/dev_rv
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
XMLIO_V2/dev/dev_rv/Makefile.wk
r196 r202 16 16 GUI = no 17 17 NPROC = 6 18 CSUITE = gnu18 CSUITE = intel 19 19 PFORME = fedora-wk 20 20 FORTEXT = .f90 -
XMLIO_V2/dev/dev_rv/src/xmlio/calendar.cpp
r152 r202 52 52 { this->timestep = duration; } 53 53 54 CDate & CCalendar::update( void)55 { return (this->getCurrentDate() = this->getCurrentDate() + this->timestep); }54 CDate & CCalendar::update(int step) 55 { return (this->getCurrentDate() = this->getCurrentDate() + step * this->timestep); } 56 56 57 57 //----------------------------------------------------------------- -
XMLIO_V2/dev/dev_rv/src/xmlio/calendar.hpp
r189 r202 54 54 55 55 /// Traitemants /// 56 CDate & update( void);56 CDate & update(int step); 57 57 58 58 /// Accesseurs /// -
XMLIO_V2/dev/dev_rv/src/xmlio/config/field_attribute.conf
r201 r202 18 18 DECLARE_ATTRIBUTE(StdString, field_ref) 19 19 20 DECLARE_ATTRIBUTE(double, default_value)20 DECLARE_ATTRIBUTE(double, default_value) -
XMLIO_V2/dev/dev_rv/src/xmlio/data_output.cpp
r189 r202 2 2 3 3 #include "attribute_template_impl.hpp" 4 #include "context.hpp" 4 5 5 6 namespace xmlioserver … … 65 66 (const boost::shared_ptr<tree::CField> field) 66 67 { 68 boost::shared_ptr<tree::CContext> context = 69 CObjectFactory::GetObject<tree::CContext>(CObjectFactory::GetCurrentContextId()); 70 boost::shared_ptr<date::CCalendar> calendar = context->getCalendar(); 71 67 72 this->writeField_(field); 73 this->writeTimeAxis_(field, calendar); 74 68 75 } 69 76 -
XMLIO_V2/dev/dev_rv/src/xmlio/data_output.hpp
r189 r202 42 42 void writeGrid(const boost::shared_ptr<tree::CDomain> domain); 43 43 44 virtual void writeFile_ (const boost::shared_ptr<tree::CFile> file) = 0; 45 virtual void writeField_ (const boost::shared_ptr<tree::CField> field) = 0; 46 virtual void writeFieldData_ (const boost::shared_ptr<tree::CField> field) = 0; 47 virtual void writeDomain_ (const boost::shared_ptr<tree::CDomain> domain) = 0; 48 virtual void writeAxis_ (const boost::shared_ptr<tree::CAxis> axis) = 0; 44 virtual void writeFile_ (const boost::shared_ptr<tree::CFile> file) = 0; 45 virtual void writeField_ (const boost::shared_ptr<tree::CField> field) = 0; 46 virtual void writeFieldData_ (const boost::shared_ptr<tree::CField> field) = 0; 47 virtual void writeDomain_ (const boost::shared_ptr<tree::CDomain> domain) = 0; 48 virtual void writeAxis_ (const boost::shared_ptr<tree::CAxis> axis) = 0; 49 virtual void writeTimeAxis_ (const boost::shared_ptr<tree::CField> field, 50 const boost::shared_ptr<date::CCalendar> cal) = 0; 49 51 50 52 /// Propriétés protégées /// -
XMLIO_V2/dev/dev_rv/src/xmlio/fake_client/fake_nemo.f90
r201 r202 63 63 ftype = GFIELD, & 64 64 unit_ = "SI", & 65 default_value_ = 10E-10_8, &65 default_value_ = 10E-10_8, & 66 66 prec_ = 8) 67 67 … … 120 120 standard_name_ = "lechamp3", & 121 121 long_name_ = "le champ 3", & 122 grid_ref_ = "simple_grille")122 grid_ref_ = "simple_grille") 123 123 124 124 CALL xml_tree_add(parent_hdl = temp_mod, & … … 135 135 standard_name_ = "lechamp4", & 136 136 long_name_ = "le champ 4", & 137 grid_ref_ = "simple_grille")137 grid_ref_ = "simple_grille") 138 138 139 139 CALL xml_tree_add(parent_hdl = temp_mod, & … … 150 150 standard_name_ = "lechamp5", & 151 151 long_name_ = "le champ 5", & 152 grid_ref_ = "simple_grille_zoom")152 grid_ref_ = "simple_grille_zoom") 153 153 154 154 CALL xml_tree_add(parent_hdl = temp_mod_, & … … 361 361 child_id = "simple_grille_zoom") 362 362 363 CALL set_grid_attributes(grid_hdl = temp_mod_, &364 ftype = EGRID, &365 name_ = "grille2", &366 description_ = "la grille 2", &363 CALL set_grid_attributes(grid_hdl = temp_mod_, & 364 ftype = EGRID, & 365 name_ = "grille2", & 366 description_ = "la grille 2", & 367 367 domain_ref_ = "simple_domaine0_zoom", & 368 368 axis_ref_ = "simple_axe") -
XMLIO_V2/dev/dev_rv/src/xmlio/functor.hpp
r157 r202 12 12 { 13 13 /// ////////////////////// Déclarations ////////////////////// /// 14 class CFunctor : p rivateCObject14 class CFunctor : public CObject 15 15 { 16 16 /// Définition de type /// -
XMLIO_V2/dev/dev_rv/src/xmlio/iface/interface.cpp.in
r201 r202 292 292 //------------------------------------------------------------------- 293 293 294 void xios_dtreatment_start(XPtr const _context, XFileType filetype, MPIComm comm_client_server) 295 { 296 try 297 { 294 void xios_dtreatment_start 295 (XPtr const _context, XFileType filetype, MPIComm comm_client_server) 296 { 297 try 298 { 299 CContext * __context = (CContext *) _context; 300 boost::shared_ptr<CContext> context = 301 CObjectFactory::GetObject<CContext>(__context); 298 302 StdOStringStream oss; 299 303 //~ oss << StdString("data/def/def_client_next.") … … 302 306 //~ oss.str(""); 303 307 304 CDataTreatment dt; 308 boost::shared_ptr<CDataTreatment> dt(new CDataTreatment (context)); 309 context->setDataTreatment(dt); 310 305 311 oss << StdString("data/def/def_client_end.") 306 312 << CMPIManager::GetCommRank(CMPIManager::GetCommWorld()); … … 330 336 else 331 337 { 332 dt .createDataOutput<CNc4DataOutput>();338 dt->createDataOutput<CNc4DataOutput>(); 333 339 } 334 340 } -
XMLIO_V2/dev/dev_rv/src/xmlio/manager/xios_manager.cpp
r194 r202 73 73 tree::CTreeManager::DomainsFromBinary(main_data_tree); 74 74 } 75 76 data::CDataTreatment dt; 77 75 76 { // Traitement de tous les contextes 77 StdString currentContextId = CObjectFactory::GetCurrentContextId(); 78 std::vector<boost::shared_ptr<CContext> > def_vector = 79 CContext::GetContextGroup()->getChildList(); 80 std::vector<boost::shared_ptr<CContext> >::iterator 81 it = def_vector.begin(), end = def_vector.end(); 82 83 for (; it != end; it++) 84 { 85 boost::shared_ptr<CContext> context = *it; 86 boost::shared_ptr<data::CDataTreatment> dt(new data::CDataTreatment (context)); 87 context->setDataTreatment(dt); 88 dt->createDataOutput<io::CNc4DataOutput>(); 89 } 90 CTreeManager::SetCurrentContextId(currentContextId); 91 } 92 78 93 StdOStringStream oss; 79 94 oss << StdString("data/def/def_server_end.") 80 95 << CMPIManager::GetCommRank(CMPIManager::GetCommWorld()); 81 CTreeManager::PrintTreeToFile(oss.str()); 82 83 dt.createDataOutput<io::CNc4DataOutput>(); 96 CTreeManager::PrintTreeToFile(oss.str()); 97 84 98 } 85 99 -
XMLIO_V2/dev/dev_rv/src/xmlio/node/context.cpp
r188 r202 8 8 9 9 #include "calendar_type.hpp" 10 11 #include "data_treatment.hpp" 10 12 11 13 namespace xmlioserver { … … 43 45 44 46 //---------------------------------------------------------------- 45 47 void CContext::setDataTreatment(boost::shared_ptr<data::CDataTreatment> ndatat) 48 { 49 this->datat = ndatat; 50 } 51 52 //---------------------------------------------------------------- 53 boost::shared_ptr<data::CDataTreatment> CContext::getDataTreatment(void) const 54 { 55 return (this->datat); 56 } 57 58 //---------------------------------------------------------------- 59 46 60 boost::shared_ptr<date::CCalendar> CContext::getCalendar(void) const 47 61 { -
XMLIO_V2/dev/dev_rv/src/xmlio/node/context.hpp
r188 r202 8 8 9 9 #include "declare_group.hpp" 10 11 namespace xmlioserver { 12 namespace data { 13 class CDataTreatment; 14 } // namespace tree 15 } // namespace xmlioserver 10 16 11 17 namespace xmlioserver { … … 58 64 /// Mutateurs /// 59 65 void setCalendar(boost::shared_ptr<date::CCalendar> newCalendar); 66 void setDataTreatment(boost::shared_ptr<data::CDataTreatment> datat); 60 67 61 68 /// Accesseurs /// 62 boost::shared_ptr<date::CCalendar> getCalendar(void) const; 69 boost::shared_ptr<date::CCalendar> getCalendar(void) const; 70 boost::shared_ptr<data::CDataTreatment> getDataTreatment(void) const; 63 71 64 72 /// Accesseurs statiques /// … … 93 101 private : 94 102 95 boost::shared_ptr<date::CCalendar> calendar; 103 boost::shared_ptr<date::CCalendar> calendar; 104 boost::shared_ptr<data::CDataTreatment> datat; 96 105 97 106 }; // class CContext -
XMLIO_V2/dev/dev_rv/src/xmlio/node/field.cpp
r189 r202 194 194 #define DECLARE_FUNCTOR(MType, mtype) \ 195 195 if (operation.getValue().compare(#mtype) == 0) \ 196 { return; } 197 //this->foperation = boost::shared_ptr<func::CFunctor>(new C##MType()); 196 { /*this->foperation = boost::shared_ptr<func::CFunctor>(new C##MType()); */ \ 197 return; } 198 198 199 199 200 #include "functor_type.conf" -
XMLIO_V2/dev/dev_rv/src/xmlio/output/nc4_data_output.cpp
r201 r202 5 5 6 6 #include "file.hpp" 7 #include "calendar.hpp" 7 8 8 9 namespace xmlioserver … … 231 232 ( field->operation.getValue().compare("once") == 0)); 232 233 233 if (wtime) dims.push_back(timeid); 234 if (wtime) 235 { 236 StdOStringStream oss; 237 oss << "time_" << field->operation.getValue() 238 << "_" << field->getRelFile()->output_freq.getValue(); 239 240 coodinates.push_back(oss.str()); 241 dims.push_back(timeid); 242 } 234 243 235 244 if (!grid->axis_ref.isEmpty()) … … 385 394 386 395 //--------------------------------------------------------------- 396 397 void CNc4DataOutput::writeTimeAxis_ 398 (const boost::shared_ptr<tree::CField> field, 399 const boost::shared_ptr<date::CCalendar> cal) 400 { 401 StdOStringStream oss; 402 oss << "time_" << field->operation.getValue() 403 << "_" << field->getRelFile()->output_freq.getValue(); 404 405 std::vector<StdString> dims; 406 StdString axisid = oss.str(); 407 StdString timeid = StdString("time_counter"); 408 409 dims.push_back(timeid); 410 if (!SuperClassWriter::varExist(axisid)) 411 { 412 SuperClassWriter::addVariable(axisid, NC_DOUBLE, dims); 413 this->writeTimeAxisAttributes(axisid, 414 cal->getId(), 415 "lol", 416 "lol"); 417 } 418 419 } 420 421 //--------------------------------------------------------------- 422 423 void CNc4DataOutput::writeTimeAxisAttributes(const StdString & axis_name, 424 const StdString & calendar, 425 const StdString & units, 426 const StdString & time_origin, 427 const StdString & standard_name, 428 const StdString & long_name, 429 const StdString & title) 430 { 431 SuperClassWriter::addAttribute("standard_name", standard_name, &axis_name); 432 SuperClassWriter::addAttribute("long_name", long_name , &axis_name); 433 SuperClassWriter::addAttribute("title", title , &axis_name); 434 SuperClassWriter::addAttribute("calendar", calendar , &axis_name); 435 SuperClassWriter::addAttribute("units", units , &axis_name); 436 SuperClassWriter::addAttribute("time_origin", time_origin , &axis_name); 437 } 438 439 //--------------------------------------------------------------- 440 387 441 void CNc4DataOutput::writeAxisAttributes(const StdString & axis_name, 388 442 const StdString & axis, -
XMLIO_V2/dev/dev_rv/src/xmlio/output/nc4_data_output.hpp
r201 r202 43 43 44 44 /// Ecriture /// 45 virtual void writeDomain_ (const boost::shared_ptr<tree::CDomain> domain); 46 virtual void writeAxis_ (const boost::shared_ptr<tree::CAxis> axis); 47 virtual void writeField_ (const boost::shared_ptr<tree::CField> field); 48 virtual void writeFieldData_ (const boost::shared_ptr<tree::CField> field); 49 virtual void writeFile_ (const boost::shared_ptr<tree::CFile> file); 50 45 virtual void writeDomain_ (const boost::shared_ptr<tree::CDomain> domain); 46 virtual void writeAxis_ (const boost::shared_ptr<tree::CAxis> axis); 47 virtual void writeField_ (const boost::shared_ptr<tree::CField> field); 48 virtual void writeFieldData_ (const boost::shared_ptr<tree::CField> field); 49 virtual void writeFile_ (const boost::shared_ptr<tree::CFile> file); 50 virtual void writeTimeAxis_ (const boost::shared_ptr<tree::CField> field, 51 const boost::shared_ptr<date::CCalendar> cal); 51 52 52 53 protected : 53 54 54 55 void writeLocalAttributes(int ibegin, int ni, int jbegin, int nj, StdString domid); 56 57 void writeTimeAxisAttributes(const StdString & axis_name, 58 const StdString & calendar, 59 const StdString & units, 60 const StdString & time_origin, 61 const StdString & standard_name = StdString("time"), 62 const StdString & long_name = StdString("Time axis"), 63 const StdString & title = StdString("Time")); 55 64 56 65 void writeFileAttributes(const StdString & name, -
XMLIO_V2/dev/dev_rv/src/xmlio/output/onetcdf4.cpp
r189 r202 356 356 } 357 357 358 //--------------------------------------------------------------- 359 360 bool CONetCDF4::varExist(const StdString & varname) 361 { 362 int varid = 0; 363 int grpid = this->getCurrentGroup(); 364 return (nc_inq_varid (grpid, varname.c_str(), &varid) == NC_NOERR); 365 } 366 358 367 ///-------------------------------------------------------------- 359 368 } // namespace io -
XMLIO_V2/dev/dev_rv/src/xmlio/output/onetcdf4.hpp
r201 r202 92 92 std::vector<StdSize> getDimensions(const StdString & varname); 93 93 int getUnlimitedDimension(void); 94 94 95 bool varExist(const StdString & varname); 96 95 97 //---------------------------------------------------------------- 96 98
Note: See TracChangeset
for help on using the changeset viewer.