Changeset 318
- Timestamp:
- 02/21/12 15:34:27 (12 years ago)
- Location:
- XIOS/trunk/src
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/config/file_attribute.conf
r286 r318 6 6 DECLARE_ATTRIBUTE(StdString, output_freq) 7 7 DECLARE_ATTRIBUTE(int, output_level) 8 8 DECLARE_ATTRIBUTE(StdString, sync_freq) 9 DECLARE_ATTRIBUTE(StdString, split_freq) 9 10 DECLARE_ATTRIBUTE(bool, enabled) 10 11 DECLARE_ATTRIBUTE(StdString, type) -
XIOS/trunk/src/fortran_attr_interface/file_interface_attr.f90
r314 r318 95 95 96 96 97 SUBROUTINE cxios_set_file_split_freq(file_hdl, split_freq, split_freq_size) BIND(C) 98 USE ISO_C_BINDING 99 INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 100 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: split_freq 101 INTEGER (kind = C_INT) , VALUE :: split_freq_size 102 END SUBROUTINE cxios_set_file_split_freq 103 104 SUBROUTINE cxios_get_file_split_freq(file_hdl, split_freq, split_freq_size) BIND(C) 105 USE ISO_C_BINDING 106 INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 107 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: split_freq 108 INTEGER (kind = C_INT) , VALUE :: split_freq_size 109 END SUBROUTINE cxios_get_file_split_freq 110 111 112 SUBROUTINE cxios_set_file_sync_freq(file_hdl, sync_freq, sync_freq_size) BIND(C) 113 USE ISO_C_BINDING 114 INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 115 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: sync_freq 116 INTEGER (kind = C_INT) , VALUE :: sync_freq_size 117 END SUBROUTINE cxios_set_file_sync_freq 118 119 SUBROUTINE cxios_get_file_sync_freq(file_hdl, sync_freq, sync_freq_size) BIND(C) 120 USE ISO_C_BINDING 121 INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 122 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: sync_freq 123 INTEGER (kind = C_INT) , VALUE :: sync_freq_size 124 END SUBROUTINE cxios_get_file_sync_freq 125 126 97 127 SUBROUTINE cxios_set_file_type(file_hdl, type, type_size) BIND(C) 98 128 USE ISO_C_BINDING -
XIOS/trunk/src/fortran_attr_interface/filegroup_interface_attr.f90
r314 r318 110 110 111 111 112 SUBROUTINE cxios_set_filegroup_split_freq(filegroup_hdl, split_freq, split_freq_size) BIND(C) 113 USE ISO_C_BINDING 114 INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl 115 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: split_freq 116 INTEGER (kind = C_INT) , VALUE :: split_freq_size 117 END SUBROUTINE cxios_set_filegroup_split_freq 118 119 SUBROUTINE cxios_get_filegroup_split_freq(filegroup_hdl, split_freq, split_freq_size) BIND(C) 120 USE ISO_C_BINDING 121 INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl 122 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: split_freq 123 INTEGER (kind = C_INT) , VALUE :: split_freq_size 124 END SUBROUTINE cxios_get_filegroup_split_freq 125 126 127 SUBROUTINE cxios_set_filegroup_sync_freq(filegroup_hdl, sync_freq, sync_freq_size) BIND(C) 128 USE ISO_C_BINDING 129 INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl 130 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: sync_freq 131 INTEGER (kind = C_INT) , VALUE :: sync_freq_size 132 END SUBROUTINE cxios_set_filegroup_sync_freq 133 134 SUBROUTINE cxios_get_filegroup_sync_freq(filegroup_hdl, sync_freq, sync_freq_size) BIND(C) 135 USE ISO_C_BINDING 136 INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl 137 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: sync_freq 138 INTEGER (kind = C_INT) , VALUE :: sync_freq_size 139 END SUBROUTINE cxios_get_filegroup_sync_freq 140 141 112 142 SUBROUTINE cxios_set_filegroup_type(filegroup_hdl, type, type_size) BIND(C) 113 143 USE ISO_C_BINDING -
XIOS/trunk/src/fortran_attr_interface/icfile_attr.cpp
r314 r318 99 99 100 100 101 void cxios_set_file_split_freq(file_Ptr file_hdl, const char * split_freq, int split_freq_size) 102 { 103 std::string split_freq_str; 104 if(!cstr2string(split_freq, split_freq_size, split_freq_str)) return; 105 file_hdl->split_freq.setValue(split_freq_str); 106 file_hdl->sendAttributToServer(file_hdl->split_freq); 107 } 108 109 void cxios_get_file_split_freq(file_Ptr file_hdl, char * split_freq, int split_freq_size) 110 { 111 if(!string_copy(file_hdl->split_freq.getValue(),split_freq , split_freq_size)) 112 ERROR("void cxios_get_file_split_freq(file_Ptr file_hdl, char * split_freq, int split_freq_size)", <<"Input string is to short"); 113 } 114 115 116 void cxios_set_file_sync_freq(file_Ptr file_hdl, const char * sync_freq, int sync_freq_size) 117 { 118 std::string sync_freq_str; 119 if(!cstr2string(sync_freq, sync_freq_size, sync_freq_str)) return; 120 file_hdl->sync_freq.setValue(sync_freq_str); 121 file_hdl->sendAttributToServer(file_hdl->sync_freq); 122 } 123 124 void cxios_get_file_sync_freq(file_Ptr file_hdl, char * sync_freq, int sync_freq_size) 125 { 126 if(!string_copy(file_hdl->sync_freq.getValue(),sync_freq , sync_freq_size)) 127 ERROR("void cxios_get_file_sync_freq(file_Ptr file_hdl, char * sync_freq, int sync_freq_size)", <<"Input string is to short"); 128 } 129 130 101 131 void cxios_set_file_type(file_Ptr file_hdl, const char * type, int type_size) 102 132 { -
XIOS/trunk/src/fortran_attr_interface/icfilegroup_attr.cpp
r314 r318 114 114 115 115 116 void cxios_set_filegroup_split_freq(filegroup_Ptr filegroup_hdl, const char * split_freq, int split_freq_size) 117 { 118 std::string split_freq_str; 119 if(!cstr2string(split_freq, split_freq_size, split_freq_str)) return; 120 filegroup_hdl->split_freq.setValue(split_freq_str); 121 filegroup_hdl->sendAttributToServer(filegroup_hdl->split_freq); 122 } 123 124 void cxios_get_filegroup_split_freq(filegroup_Ptr filegroup_hdl, char * split_freq, int split_freq_size) 125 { 126 if(!string_copy(filegroup_hdl->split_freq.getValue(),split_freq , split_freq_size)) 127 ERROR("void cxios_get_filegroup_split_freq(filegroup_Ptr filegroup_hdl, char * split_freq, int split_freq_size)", <<"Input string is to short"); 128 } 129 130 131 void cxios_set_filegroup_sync_freq(filegroup_Ptr filegroup_hdl, const char * sync_freq, int sync_freq_size) 132 { 133 std::string sync_freq_str; 134 if(!cstr2string(sync_freq, sync_freq_size, sync_freq_str)) return; 135 filegroup_hdl->sync_freq.setValue(sync_freq_str); 136 filegroup_hdl->sendAttributToServer(filegroup_hdl->sync_freq); 137 } 138 139 void cxios_get_filegroup_sync_freq(filegroup_Ptr filegroup_hdl, char * sync_freq, int sync_freq_size) 140 { 141 if(!string_copy(filegroup_hdl->sync_freq.getValue(),sync_freq , sync_freq_size)) 142 ERROR("void cxios_get_filegroup_sync_freq(filegroup_Ptr filegroup_hdl, char * sync_freq, int sync_freq_size)", <<"Input string is to short"); 143 } 144 145 116 146 void cxios_set_filegroup_type(filegroup_Ptr filegroup_hdl, const char * type, int type_size) 117 147 { -
XIOS/trunk/src/fortran_attr_interface/ifile_attr.F90
r314 r318 12 12 13 13 SUBROUTINE xios(set_file_attr) & 14 ( file_id, description, enabled, name, name_suffix, output_freq, output_level, type ) 14 ( file_id, description, enabled, name, name_suffix, output_freq, output_level, split_freq, sync_freq & 15 , type ) 15 16 16 17 IMPLICIT NONE … … 24 25 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: output_freq 25 26 INTEGER , OPTIONAL, INTENT(IN) :: output_level 27 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: split_freq 28 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: sync_freq 26 29 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type 27 30 28 31 CALL xios(get_file_handle)(file_id,file_hdl) 29 32 CALL xios(set_file_attr_hdl_) & 30 ( file_hdl, description, enabled, name, name_suffix, output_freq, output_level, type ) 33 ( file_hdl, description, enabled, name, name_suffix, output_freq, output_level, split_freq, sync_freq & 34 , type ) 31 35 32 36 END SUBROUTINE xios(set_file_attr) 33 37 34 38 SUBROUTINE xios(set_file_attr_hdl) & 35 ( file_hdl, description, enabled, name, name_suffix, output_freq, output_level, type ) 39 ( file_hdl, description, enabled, name, name_suffix, output_freq, output_level, split_freq, sync_freq & 40 , type ) 36 41 37 42 IMPLICIT NONE … … 44 49 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: output_freq 45 50 INTEGER , OPTIONAL, INTENT(IN) :: output_level 51 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: split_freq 52 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: sync_freq 46 53 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type 47 54 48 55 CALL xios(set_file_attr_hdl_) & 49 ( file_hdl, description, enabled, name, name_suffix, output_freq, output_level, type ) 56 ( file_hdl, description, enabled, name, name_suffix, output_freq, output_level, split_freq, sync_freq & 57 , type ) 50 58 51 59 END SUBROUTINE xios(set_file_attr_hdl) 52 60 53 61 SUBROUTINE xios(set_file_attr_hdl_) & 54 ( file_hdl, description_, enabled_, name_, name_suffix_, output_freq_, output_level_, type_ &55 )62 ( file_hdl, description_, enabled_, name_, name_suffix_, output_freq_, output_level_, split_freq_ & 63 , sync_freq_, type_ ) 56 64 57 65 IMPLICIT NONE … … 64 72 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: output_freq_ 65 73 INTEGER , OPTIONAL, INTENT(IN) :: output_level_ 74 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: split_freq_ 75 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: sync_freq_ 66 76 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type_ 67 77 … … 91 101 ENDIF 92 102 103 IF (PRESENT(split_freq_)) THEN 104 CALL cxios_set_file_split_freq(file_hdl%daddr, split_freq_, len(split_freq_)) 105 ENDIF 106 107 IF (PRESENT(sync_freq_)) THEN 108 CALL cxios_set_file_sync_freq(file_hdl%daddr, sync_freq_, len(sync_freq_)) 109 ENDIF 110 93 111 IF (PRESENT(type_)) THEN 94 112 CALL cxios_set_file_type(file_hdl%daddr, type_, len(type_)) … … 100 118 101 119 SUBROUTINE xios(get_file_attr) & 102 ( file_id, description, enabled, name, name_suffix, output_freq, output_level, type ) 120 ( file_id, description, enabled, name, name_suffix, output_freq, output_level, split_freq, sync_freq & 121 , type ) 103 122 104 123 IMPLICIT NONE … … 112 131 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: output_freq 113 132 INTEGER , OPTIONAL, INTENT(OUT) :: output_level 133 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: split_freq 134 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: sync_freq 114 135 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type 115 136 116 137 CALL xios(get_file_handle)(file_id,file_hdl) 117 138 CALL xios(get_file_attr_hdl_) & 118 ( file_hdl, description, enabled, name, name_suffix, output_freq, output_level, type ) 139 ( file_hdl, description, enabled, name, name_suffix, output_freq, output_level, split_freq, sync_freq & 140 , type ) 119 141 120 142 END SUBROUTINE xios(get_file_attr) 121 143 122 144 SUBROUTINE xios(get_file_attr_hdl) & 123 ( file_hdl, description, enabled, name, name_suffix, output_freq, output_level, type ) 145 ( file_hdl, description, enabled, name, name_suffix, output_freq, output_level, split_freq, sync_freq & 146 , type ) 124 147 125 148 IMPLICIT NONE … … 132 155 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: output_freq 133 156 INTEGER , OPTIONAL, INTENT(OUT) :: output_level 157 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: split_freq 158 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: sync_freq 134 159 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type 135 160 136 161 CALL xios(get_file_attr_hdl_) & 137 ( file_hdl, description, enabled, name, name_suffix, output_freq, output_level, type ) 162 ( file_hdl, description, enabled, name, name_suffix, output_freq, output_level, split_freq, sync_freq & 163 , type ) 138 164 139 165 END SUBROUTINE xios(get_file_attr_hdl) 140 166 141 167 SUBROUTINE xios(get_file_attr_hdl_) & 142 ( file_hdl, description_, enabled_, name_, name_suffix_, output_freq_, output_level_, type_ &143 )168 ( file_hdl, description_, enabled_, name_, name_suffix_, output_freq_, output_level_, split_freq_ & 169 , sync_freq_, type_ ) 144 170 145 171 IMPLICIT NONE … … 152 178 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: output_freq_ 153 179 INTEGER , OPTIONAL, INTENT(OUT) :: output_level_ 180 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: split_freq_ 181 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: sync_freq_ 154 182 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type_ 155 183 … … 179 207 ENDIF 180 208 209 IF (PRESENT(split_freq_)) THEN 210 CALL cxios_get_file_split_freq(file_hdl%daddr, split_freq_, len(split_freq_)) 211 ENDIF 212 213 IF (PRESENT(sync_freq_)) THEN 214 CALL cxios_get_file_sync_freq(file_hdl%daddr, sync_freq_, len(sync_freq_)) 215 ENDIF 216 181 217 IF (PRESENT(type_)) THEN 182 218 CALL cxios_get_file_type(file_hdl%daddr, type_, len(type_)) -
XIOS/trunk/src/fortran_attr_interface/ifilegroup_attr.F90
r314 r318 13 13 SUBROUTINE xios(set_filegroup_attr) & 14 14 ( filegroup_id, description, enabled, group_ref, name, name_suffix, output_freq, output_level & 15 , type )15 , split_freq, sync_freq, type ) 16 16 17 17 IMPLICIT NONE … … 26 26 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: output_freq 27 27 INTEGER , OPTIONAL, INTENT(IN) :: output_level 28 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: split_freq 29 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: sync_freq 28 30 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type 29 31 … … 31 33 CALL xios(set_filegroup_attr_hdl_) & 32 34 ( filegroup_hdl, description, enabled, group_ref, name, name_suffix, output_freq, output_level & 33 , type )35 , split_freq, sync_freq, type ) 34 36 35 37 END SUBROUTINE xios(set_filegroup_attr) … … 37 39 SUBROUTINE xios(set_filegroup_attr_hdl) & 38 40 ( filegroup_hdl, description, enabled, group_ref, name, name_suffix, output_freq, output_level & 39 , type )41 , split_freq, sync_freq, type ) 40 42 41 43 IMPLICIT NONE … … 49 51 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: output_freq 50 52 INTEGER , OPTIONAL, INTENT(IN) :: output_level 53 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: split_freq 54 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: sync_freq 51 55 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type 52 56 53 57 CALL xios(set_filegroup_attr_hdl_) & 54 58 ( filegroup_hdl, description, enabled, group_ref, name, name_suffix, output_freq, output_level & 55 , type )59 , split_freq, sync_freq, type ) 56 60 57 61 END SUBROUTINE xios(set_filegroup_attr_hdl) … … 59 63 SUBROUTINE xios(set_filegroup_attr_hdl_) & 60 64 ( filegroup_hdl, description_, enabled_, group_ref_, name_, name_suffix_, output_freq_, output_level_ & 61 , type_ )65 , split_freq_, sync_freq_, type_ ) 62 66 63 67 IMPLICIT NONE … … 71 75 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: output_freq_ 72 76 INTEGER , OPTIONAL, INTENT(IN) :: output_level_ 77 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: split_freq_ 78 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: sync_freq_ 73 79 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type_ 74 80 … … 102 108 ENDIF 103 109 110 IF (PRESENT(split_freq_)) THEN 111 CALL cxios_set_filegroup_split_freq(filegroup_hdl%daddr, split_freq_, len(split_freq_)) 112 ENDIF 113 114 IF (PRESENT(sync_freq_)) THEN 115 CALL cxios_set_filegroup_sync_freq(filegroup_hdl%daddr, sync_freq_, len(sync_freq_)) 116 ENDIF 117 104 118 IF (PRESENT(type_)) THEN 105 119 CALL cxios_set_filegroup_type(filegroup_hdl%daddr, type_, len(type_)) … … 112 126 SUBROUTINE xios(get_filegroup_attr) & 113 127 ( filegroup_id, description, enabled, group_ref, name, name_suffix, output_freq, output_level & 114 , type )128 , split_freq, sync_freq, type ) 115 129 116 130 IMPLICIT NONE … … 125 139 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: output_freq 126 140 INTEGER , OPTIONAL, INTENT(OUT) :: output_level 141 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: split_freq 142 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: sync_freq 127 143 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type 128 144 … … 130 146 CALL xios(get_filegroup_attr_hdl_) & 131 147 ( filegroup_hdl, description, enabled, group_ref, name, name_suffix, output_freq, output_level & 132 , type )148 , split_freq, sync_freq, type ) 133 149 134 150 END SUBROUTINE xios(get_filegroup_attr) … … 136 152 SUBROUTINE xios(get_filegroup_attr_hdl) & 137 153 ( filegroup_hdl, description, enabled, group_ref, name, name_suffix, output_freq, output_level & 138 , type )154 , split_freq, sync_freq, type ) 139 155 140 156 IMPLICIT NONE … … 148 164 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: output_freq 149 165 INTEGER , OPTIONAL, INTENT(OUT) :: output_level 166 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: split_freq 167 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: sync_freq 150 168 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type 151 169 152 170 CALL xios(get_filegroup_attr_hdl_) & 153 171 ( filegroup_hdl, description, enabled, group_ref, name, name_suffix, output_freq, output_level & 154 , type )172 , split_freq, sync_freq, type ) 155 173 156 174 END SUBROUTINE xios(get_filegroup_attr_hdl) … … 158 176 SUBROUTINE xios(get_filegroup_attr_hdl_) & 159 177 ( filegroup_hdl, description_, enabled_, group_ref_, name_, name_suffix_, output_freq_, output_level_ & 160 , type_ )178 , split_freq_, sync_freq_, type_ ) 161 179 162 180 IMPLICIT NONE … … 170 188 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: output_freq_ 171 189 INTEGER , OPTIONAL, INTENT(OUT) :: output_level_ 190 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: split_freq_ 191 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: sync_freq_ 172 192 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type_ 173 193 … … 201 221 ENDIF 202 222 223 IF (PRESENT(split_freq_)) THEN 224 CALL cxios_get_filegroup_split_freq(filegroup_hdl%daddr, split_freq_, len(split_freq_)) 225 ENDIF 226 227 IF (PRESENT(sync_freq_)) THEN 228 CALL cxios_get_filegroup_sync_freq(filegroup_hdl%daddr, sync_freq_, len(sync_freq_)) 229 ENDIF 230 203 231 IF (PRESENT(type_)) THEN 204 232 CALL cxios_get_filegroup_type(filegroup_hdl%daddr, type_, len(type_)) -
XIOS/trunk/src/node/file.cpp
r300 r318 11 11 #include "context_server.hpp" 12 12 #include "nc4_data_output.hpp" 13 #include "calendar_util.hpp" 14 #include "date.hpp" 13 15 14 16 … … 125 127 126 128 //---------------------------------------------------------------- 127 129 bool CFile::isSyncTime(void) 130 { 131 shared_ptr<CContext> context=CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()) ; 132 date::CDate& currentDate=context->calendar->getCurrentDate() ; 133 if (! sync_freq.isEmpty()) 134 { 135 if (*lastSync+syncFreq < currentDate) 136 { 137 *lastSync=currentDate ; 138 return true ; 139 } 140 } 141 return false ; 142 } 143 128 144 void CFile::createHeader(void) 129 145 { 130 146 shared_ptr<CContext> context=CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()) ; 147 148 if (! sync_freq.isEmpty()) syncFreq = date::CDuration::FromString(sync_freq.getValue()); 149 lastSync=new date::CDate(context->calendar->getCurrentDate()) ; 150 131 151 std::vector<boost::shared_ptr<CField> >::iterator it, end = this->enabledFields.end(); 132 152 133 153 AllDomainEmpty=true ; 154 set<CDomain*> setDomain ; 134 155 for (it = this->enabledFields.begin() ;it != end; it++) 135 156 { 136 157 boost::shared_ptr<CField> field = *it; 137 158 AllDomainEmpty&=field->grid->domain->isEmpty() ; 138 } 139 159 setDomain.insert(field->grid->domain.get()) ; 160 } 161 nbDomain=setDomain.size() ; 162 140 163 if (!AllDomainEmpty || type.getValue()=="one_file") 141 164 { … … 156 179 } 157 180 158 shared_ptr<CContext> context=CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()) ;159 181 CContextServer* server=context->server ; 160 182 … … 188 210 if (!AllDomainEmpty || type.getValue()=="one_file") 189 211 this->data_out->closeFile(); 212 delete lastSync ; 190 213 } 191 214 //---------------------------------------------------------------- -
XIOS/trunk/src/node/file.hpp
r300 r318 7 7 #include "data_output.hpp" 8 8 #include "declare_group.hpp" 9 #include "date.hpp" 9 10 10 11 … … 102 103 void recvAddFieldGroup(CBufferIn& buffer) ; 103 104 static bool dispatchEvent(CEventServer& event) ; 104 105 bool isSyncTime(void) ; 106 date::CDate* lastSync ; 107 date::CDuration syncFreq ; 108 int nbDomain ; 105 109 private : 106 110 -
XIOS/trunk/src/output/nc4_data_output.cpp
r316 r318 70 70 StdString domid = (!domain->name.isEmpty()) 71 71 ? domain->name.getValue() : domain->getId(); 72 StdString lonid = StdString("lon_").append(domid); 73 StdString latid = StdString("lat_").append(domid); 72 StdString appendDomid = (singleDomain) ? "" : "_"+domid ; 73 74 StdString lonid = StdString("lon").append(appendDomid); 75 StdString latid = StdString("lat").append(appendDomid); 74 76 StdString lonid_loc = (server->intraCommSize > 1) 75 ? StdString("lon _").append(domid).append("_local")77 ? StdString("lon").append(appendDomid).append("_local") 76 78 : lonid; 77 79 StdString latid_loc = (server->intraCommSize > 1) 78 ? StdString("lat _").append(domid).append("_local")80 ? StdString("lat").append(appendDomid).append("_local") 79 81 : latid; 80 82 // supress mask StdString maskid = StdString("mask_").append(domid).append("_local"); … … 101 103 { 102 104 dim0.push_back(latid_loc); dim0.push_back(lonid_loc); 103 lonid = StdString("nav_lon _").append(domid);104 latid = StdString("nav_lat _").append(domid);105 lonid = StdString("nav_lon").append(appendDomid); 106 latid = StdString("nav_lat").append(appendDomid); 105 107 } 106 108 else … … 118 120 domain->zoom_jbegin_srv, 119 121 domain->zoom_nj_srv, 120 domid);122 appendDomid); 121 123 } 122 124 … … 172 174 { 173 175 dim0.push_back(latid); dim0.push_back(lonid); 174 lonid = StdString("nav_lon _").append(domid);175 latid = StdString("nav_lat _").append(domid);176 lonid = StdString("nav_lon").append(appendDomid); 177 latid = StdString("nav_lat").append(appendDomid); 176 178 SuperClassWriter::addVariable(latid, NC_FLOAT, dim0); 177 179 SuperClassWriter::addVariable(lonid, NC_FLOAT, dim0); … … 283 285 StdString domid = (!domain->name.isEmpty()) 284 286 ? domain->name.getValue() : domain->getId(); 285 StdString lonid = StdString("lon_").append(domid); 286 StdString latid = StdString("lat_").append(domid); 287 StdString appendDomid = (singleDomain) ? "" : "_"+domid ; 288 289 StdString lonid = StdString("lon").append(appendDomid); 290 StdString latid = StdString("lat").append(appendDomid); 287 291 StdString lonid_loc = (server->intraCommSize > 1) 288 ? StdString("lon _").append(domid).append("_local")292 ? StdString("lon").append(appendDomid).append("_local") 289 293 : lonid; 290 294 StdString latid_loc = (server->intraCommSize > 1) 291 ? StdString("lat _").append(domid).append("_local")295 ? StdString("lat").append(appendDomid).append("_local") 292 296 : latid; 293 297 StdString fieldid = (!field->name.isEmpty()) … … 324 328 if (isCurvilinear) 325 329 { 326 coodinates.push_back(StdString("nav_lat _").append(domid));327 coodinates.push_back(StdString("nav_lon _").append(domid));330 coodinates.push_back(StdString("nav_lat").append(appendDomid)); 331 coodinates.push_back(StdString("nav_lon").append(appendDomid)); 328 332 } 329 333 else … … 426 430 StdString("An IPSL model"), 427 431 this->getTimeStamp()); 432 if (file->nbDomain==1) singleDomain=true ; 433 else singleDomain=false ; 428 434 } 429 435 … … 454 460 { 455 461 shared_ptr<CContext> context=CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()) ; 462 if (field->getRelFile()->isSyncTime()) SuperClassWriter::sync() ; 456 463 457 464 boost::shared_ptr<CGrid> grid = field->grid ; … … 615 622 (int ibegin, int ni, int jbegin, int nj, StdString domid) 616 623 { 617 SuperClassWriter::addAttribute(StdString("ibegin _").append(domid), ibegin);618 SuperClassWriter::addAttribute(StdString("ni _" ).append(domid), ni);619 SuperClassWriter::addAttribute(StdString("jbegin _").append(domid), jbegin);620 SuperClassWriter::addAttribute(StdString("nj _" ).append(domid), nj);624 SuperClassWriter::addAttribute(StdString("ibegin").append(domid), ibegin); 625 SuperClassWriter::addAttribute(StdString("ni" ).append(domid), ni); 626 SuperClassWriter::addAttribute(StdString("jbegin").append(domid), jbegin); 627 SuperClassWriter::addAttribute(StdString("nj" ).append(domid), nj); 621 628 } 622 629 -
XIOS/trunk/src/output/nc4_data_output.hpp
r286 r318 37 37 /// Destructeur /// 38 38 virtual ~CNc4DataOutput(void); 39 39 bool singleDomain ; 40 40 protected : 41 41
Note: See TracChangeset
for help on using the changeset viewer.