source: XIOS/dev/dev_trunk_omp/src/node/field_impl.hpp @ 1678

Last change on this file since 1678 was 1677, checked in by yushan, 5 years ago

MARK: Dynamic workflow graph developement. Branch up to date with trunk @1663.

  • Property copyright set to
    Software name : XIOS (Xml I/O Server)
    http://forge.ipsl.jussieu.fr/ioserver
    Creation date : January 2009
    Licence : CeCCIL version2
    see license file in root directory : Licence_CeCILL_V2-en.txt
    or http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
    Holder : CEA/LSCE (Laboratoire des Sciences du CLimat et de l'Environnement)
    CNRS/IPSL (Institut Pierre Simon Laplace)
    Project Manager : Yann Meurdesoif
    yann.meurdesoif@cea.fr
File size: 1.7 KB
Line 
1
2#ifndef __FIELD_IMPL_HPP__
3#define __FIELD_IMPL_HPP__
4
5#include "xios_spl.hpp"
6#include "field.hpp"
7#include "context.hpp"
8#include "grid.hpp"
9#include "timer.hpp"
10#include "array_new.hpp"
11#include "source_filter.hpp"
12#include "store_filter.hpp"
13
14
15namespace xios {
16
17  template <int N>
18  void CField::setData(const CArray<double, N>& _data)
19  TRY
20  {
21    if (clientSourceFilter)
22    {
23      if (check_if_active.isEmpty() || (!check_if_active.isEmpty() && (!check_if_active) || isActive(true)))
24        // clientSourceFilter->streamData(CContext::getCurrent()->getCalendar()->getCurrentDate(), _data);
25        clientSourceFilter->streamData(CContext::getCurrent()->getCalendar()->getCurrentDate(), _data, this->getId());
26    }
27    else if (instantDataFilter)
28      ERROR("void CField::setData(const CArray<double, N>& _data)",
29            << "Impossible to receive data from the model for a field [ id = " << getId() << " ] with a reference or an arithmetic operation.");
30  }
31  CATCH_DUMP_ATTR
32
33  template <int N>
34  void CField::getData(CArray<double, N>& _data) const
35  TRY
36  {
37    if (storeFilter)
38    {
39      CDataPacket::StatusCode status = storeFilter->getData(CContext::getCurrent()->getCalendar()->getCurrentDate(), _data);
40
41      if (status == CDataPacket::END_OF_STREAM)
42        ERROR("void CField::getData(CArray<double, N>& _data) const",
43              << "Impossible to access field data, all the records of the field [ id = " << getId() << " ] have been already read.");
44    }
45    else
46    {
47      ERROR("void CField::getData(CArray<double, N>& _data) const",
48            << "Impossible to access field data, the field [ id = " << getId() << " ] does not have read access.");
49    }
50  }
51  CATCH
52} // namespace xios
53
54#endif
Note: See TracBrowser for help on using the repository browser.