Changeset 537 for XIOS/trunk/src/interface/c_attr/iccontext_attr.cpp
- Timestamp:
- 12/11/14 14:32:37 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/interface/c_attr/iccontext_attr.cpp
r532 r537 146 146 147 147 148 void cxios_set_context_timestep(context_Ptr context_hdl, c onst char * timestep, int timestep_size)148 void cxios_set_context_timestep(context_Ptr context_hdl, cxios_duration timestep_c) 149 149 { 150 std::string timestep_str; 151 if(!cstr2string(timestep, timestep_size, timestep_str)) return; 152 CTimer::get("XIOS").resume(); 153 context_hdl->timestep.setValue(timestep_str); 154 CTimer::get("XIOS").suspend(); 150 CTimer::get("XIOS").resume(); 151 context_hdl->timestep.allocate(); 152 CDuration& timestep = context_hdl->timestep.get(); 153 timestep.year = timestep_c.year; 154 timestep.month = timestep_c.month; 155 timestep.day = timestep_c.day; 156 timestep.hour = timestep_c.hour; 157 timestep.minute = timestep_c.minute; 158 timestep.second = timestep_c.second; 159 timestep.timestep = timestep_c.timestep; 160 CTimer::get("XIOS").suspend(); 155 161 } 156 162 157 void cxios_get_context_timestep(context_Ptr context_hdl, c har * timestep, int timestep_size)163 void cxios_get_context_timestep(context_Ptr context_hdl, cxios_duration* timestep_c) 158 164 { 159 CTimer::get("XIOS").resume(); 160 if(!string_copy(context_hdl->timestep.getInheritedValue(),timestep , timestep_size)) 161 ERROR("void cxios_get_context_timestep(context_Ptr context_hdl, char * timestep, int timestep_size)", <<"Input string is to short"); 162 CTimer::get("XIOS").suspend(); 165 CTimer::get("XIOS").resume(); 166 CDuration timestep = context_hdl->timestep.getInheritedValue(); 167 timestep_c->year = timestep.year; 168 timestep_c->month = timestep.month; 169 timestep_c->day = timestep.day; 170 timestep_c->hour = timestep.hour; 171 timestep_c->minute = timestep.minute; 172 timestep_c->second = timestep.second; 173 timestep_c->timestep = timestep.timestep; 174 CTimer::get("XIOS").suspend(); 163 175 } 164 176
Note: See TracChangeset
for help on using the changeset viewer.