Changeset 643 for XIOS/trunk/src/node/field.cpp
- Timestamp:
- 07/17/15 13:58:13 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/node/field.cpp
r642 r643 21 21 #include "filter_expr_node.hpp" 22 22 #include "lex_parser.hpp" 23 #include "temporal_filter.hpp" 23 24 24 25 namespace xios{ … … 810 811 { 811 812 fileWriterFilter = boost::shared_ptr<CFileWriterFilter>(new CFileWriterFilter(gc, this)); 812 instantDataFilter->connectOutput(fileWriterFilter, 0);813 getTemporalDataFilter(gc, file->output_freq)->connectOutput(fileWriterFilter, 0); 813 814 } 814 815 } … … 834 835 835 836 return clientSourceFilter; 837 } 838 839 /*! 840 * Returns the temporal filter corresponding to the field's temporal operation 841 * for the specified operation frequency. The filter is created if it does not 842 * exist, otherwise it is reused. 843 * 844 * \param gc the garbage collector to use 845 * \param outFreq the operation frequency, i.e. the frequency at which the output data will be computed 846 * \return the output pin corresponding to the requested temporal filter 847 */ 848 boost::shared_ptr<COutputPin> CField::getTemporalDataFilter(CGarbageCollector& gc, CDuration outFreq) 849 { 850 std::map<CDuration, boost::shared_ptr<COutputPin> >::iterator it = temporalDataFilters.find(outFreq); 851 852 if (it == temporalDataFilters.end()) 853 { 854 if (operation.isEmpty()) 855 ERROR("void CField::getTemporalDataFilter(CGarbageCollector& gc, CDuration outFreq)", 856 << "An operation must be defined for field \"" << getId() << "\"."); 857 858 if (freq_op.isEmpty()) 859 freq_op.setValue(TimeStep); 860 if (freq_offset.isEmpty()) 861 freq_offset.setValue(NoneDu); 862 863 const bool ignoreMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 864 865 boost::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation, 866 CContext::getCurrent()->getCalendar()->getInitDate(), 867 freq_op, freq_offset, outFreq, 868 ignoreMissingValue, ignoreMissingValue ? default_value : 0.0)); 869 instantDataFilter->connectOutput(temporalFilter, 0); 870 871 it = temporalDataFilters.insert(std::make_pair(outFreq, temporalFilter)).first; 872 } 873 874 return it->second; 836 875 } 837 876
Note: See TracChangeset
for help on using the changeset viewer.