Changeset 1119
- Timestamp:
- 05/05/17 08:58:33 (8 years ago)
- Location:
- XIOS/trunk/src
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/filter/file_writer_filter.cpp
r1018 r1119 33 33 field->sendUpdateData(data[0]->data); 34 34 } 35 36 bool CFileWriterFilter::isDataExpected(const CDate& date) const 37 { 38 return true; 39 } 35 40 } // namespace xios -
XIOS/trunk/src/filter/file_writer_filter.hpp
r639 r1119 23 23 CFileWriterFilter(CGarbageCollector& gc, CField* field); 24 24 25 /*! 26 * Tests whether data is expected for the specified date. 27 * 28 * \param date the date associated to the data 29 */ 30 bool virtual isDataExpected(const CDate& date) const; 31 25 32 protected: 26 33 /*! -
XIOS/trunk/src/filter/filter.cpp
r1006 r1119 40 40 return (CInputPin::canBeTriggered() || COutputPin::canBeTriggered()); 41 41 } 42 43 bool CFilter::isDataExpected(const CDate& date) const 44 { 45 return COutputPin::isDataExpected(date); 46 } 42 47 } // namespace xios -
XIOS/trunk/src/filter/filter.hpp
r1006 r1119 48 48 bool virtual canBeTriggered() const; 49 49 50 /*! 51 * Tests whether data is expected for the specified date. 52 * 53 * \param date the date associated to the data 54 */ 55 bool virtual isDataExpected(const CDate& date) const; 56 50 57 protected: 51 58 IFilterEngine* engine; //!< The filter engine, might be the filter itself -
XIOS/trunk/src/filter/input_pin.hpp
r1006 r1119 60 60 61 61 /*! 62 * Tests whether data is expected for the specified date. 63 * 64 * \param date the date associated to the data 65 */ 66 bool virtual isDataExpected(const CDate& date) const = 0; 67 68 /*! 62 69 * Removes all pending packets which are older than the specified timestamp. 63 70 * -
XIOS/trunk/src/filter/output_pin.cpp
r1006 r1119 73 73 } 74 74 75 bool COutputPin::isDataExpected(const CDate& date) const 76 { 77 std::vector<std::pair<boost::shared_ptr<CInputPin>, size_t> >::const_iterator it, itEnd; 78 for (it = outputs.begin(), itEnd = outputs.end(); it != itEnd; ++it) 79 { 80 if (it->first->isDataExpected(date)) 81 return true; 82 } 83 84 return false; 85 } 86 75 87 void COutputPin::invalidate(Time timestamp) 76 88 { -
XIOS/trunk/src/filter/output_pin.hpp
r1006 r1119 46 46 47 47 /*! 48 * Tests whether data is expected for the specified date. 49 * 50 * \param date the date associated to the data 51 */ 52 bool virtual isDataExpected(const CDate& date) const; 53 54 /*! 48 55 * Removes all pending packets which are older than the specified timestamp. 49 56 * -
XIOS/trunk/src/filter/store_filter.cpp
r1029 r1119 81 81 } 82 82 83 bool CStoreFilter::isDataExpected(const CDate& date) const 84 { 85 return true; 86 } 87 83 88 void CStoreFilter::invalidate(Time timestamp) 84 89 { -
XIOS/trunk/src/filter/store_filter.hpp
r1006 r1119 50 50 51 51 /*! 52 * Tests whether data is expected for the specified date. 53 * 54 * \param date the date associated to the data 55 */ 56 bool virtual isDataExpected(const CDate& date) const; 57 58 /*! 52 59 * Removes all pending packets which are older than the specified timestamp. 53 60 * -
XIOS/trunk/src/filter/temporal_filter.cpp
r1018 r1119 75 75 return packet; 76 76 } 77 78 bool CTemporalFilter::isDataExpected(const CDate& date) const 79 { 80 return isOnceOperation ? isFirstOperation : (date >= nextSamplingDate || date + samplingFreq > nextOperationDate); 81 } 77 82 } // namespace xios -
XIOS/trunk/src/filter/temporal_filter.hpp
r643 r1119 40 40 CDataPacketPtr virtual apply(std::vector<CDataPacketPtr> data); 41 41 42 /*! 43 * Tests whether data is expected for the specified date. 44 * 45 * \param date the date associated to the data 46 */ 47 bool virtual isDataExpected(const CDate& date) const; 48 42 49 private: 43 50 boost::scoped_ptr<func::CFunctor> functor; //!< The functor corresponding to the temporal operation -
XIOS/trunk/src/interface/c/icfield.cpp
r943 r1119 76 76 // ----------------------------------------------------------------------------------------------------- 77 77 78 void cxios_field_is_active (XFieldPtr field_hdl, bool * ret)78 void cxios_field_is_active (XFieldPtr field_hdl, bool at_current_timestep, bool* ret) 79 79 { 80 80 CTimer::get("XIOS").resume() ; 81 *ret = field_hdl->isActive( );81 *ret = field_hdl->isActive(at_current_timestep); 82 82 CTimer::get("XIOS").suspend() ; 83 83 } -
XIOS/trunk/src/interface/fortran/field_interface.f90
r943 r1119 18 18 END SUBROUTINE cxios_field_valid_id 19 19 20 SUBROUTINE cxios_field_is_active(field_hdl, ret) BIND(C)20 SUBROUTINE cxios_field_is_active(field_hdl, at_current_timestep, ret) BIND(C) 21 21 USE ISO_C_BINDING 22 22 INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl 23 LOGICAL (kind = C_BOOL), VALUE :: at_current_timestep 23 24 LOGICAL (kind = C_BOOL) :: ret 24 25 END SUBROUTINE cxios_field_is_active -
XIOS/trunk/src/interface/fortran/ifield.F90
r943 r1119 142 142 END FUNCTION xios(is_valid_fieldgroup) 143 143 144 LOGICAL FUNCTION xios(field_is_active_id (field_id))144 LOGICAL FUNCTION xios(field_is_active_id)(field_id, at_current_timestep_arg) 145 145 IMPLICIT NONE 146 CHARACTER(len = *) 147 LOGICAL (kind = 1) :: val148 TYPE(txios(field)) 149 146 CHARACTER(len = *) , INTENT(IN) :: field_id 147 LOGICAL, OPTIONAL , INTENT(IN) :: at_current_timestep_arg 148 TYPE(txios(field)) :: field_hdl 149 150 150 CALL xios(get_field_handle)(field_id,field_hdl) 151 xios(field_is_active_id) =xios(field_is_active_hdl(field_hdl))151 xios(field_is_active_id) = xios(field_is_active_hdl)(field_hdl, at_current_timestep_arg) 152 152 153 END FUNCTION xios(field_is_active_id) 154 155 156 LOGICAL FUNCTION xios(field_is_active_hdl(field_hdl)) 153 END FUNCTION xios(field_is_active_id) 154 155 LOGICAL FUNCTION xios(field_is_active_hdl)(field_hdl, at_current_timestep_arg) 157 156 IMPLICIT NONE 158 TYPE(txios(field)),INTENT(IN) :: field_hdl 159 LOGICAL (kind = 1) :: ret 160 161 CALL cxios_field_is_active(field_hdl%daddr, ret); 157 TYPE(txios(field)) , INTENT(IN) :: field_hdl 158 LOGICAL, OPTIONAL , INTENT(IN) :: at_current_timestep_arg 159 LOGICAL(kind = C_BOOL) :: at_current_timestep 160 LOGICAL(kind = C_BOOL) :: ret 161 162 IF (PRESENT(at_current_timestep_arg)) THEN 163 at_current_timestep = at_current_timestep_arg 164 ELSE 165 at_current_timestep = .FALSE. 166 ENDIF 167 168 CALL cxios_field_is_active(field_hdl%daddr, at_current_timestep, ret); 162 169 xios(field_is_active_hdl) = ret 163 170 164 END FUNCTION xios(field_is_active_hdl)171 END FUNCTION xios(field_is_active_hdl) 165 172 166 167 173 END MODULE IFIELD -
XIOS/trunk/src/node/field.cpp
r1018 r1119 518 518 //---------------------------------------------------------------- 519 519 520 bool CField::isActive(void) const 521 { 522 return (instantDataFilter != NULL); 520 bool CField::isActive(bool atCurrentTimestep /*= false*/) const 521 { 522 if (atCurrentTimestep && clientSourceFilter) 523 return clientSourceFilter->isDataExpected(CContext::getCurrent()->getCalendar()->getCurrentDate()); 524 else 525 return (instantDataFilter != NULL); 523 526 } 524 527 -
XIOS/trunk/src/node/field.hpp
r1017 r1119 97 97 98 98 public: 99 bool isActive( void) const;99 bool isActive(bool atCurrentTimestep = false) const; 100 100 bool hasOutputFile; 101 101
Note: See TracChangeset
for help on using the changeset viewer.