source: XIOS/dev/dev_trunk_graph/src/node/field_impl.hpp @ 2263

Last change on this file since 2263 was 2019, checked in by yushan, 4 years ago

Graph intermedia commit to a tmp branch

  • 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.6 KB
RevLine 
[352]1
2#ifndef __FIELD_IMPL_HPP__
3#define __FIELD_IMPL_HPP__
4
[591]5#include "xios_spl.hpp"
[352]6#include "field.hpp"
7#include "context.hpp"
8#include "grid.hpp"
9#include "timer.hpp"
[369]10#include "array_new.hpp"
[352]11
[369]12
[352]13namespace xios {
14
[459]15  template <int N>
16  void CField::setData(const CArray<double, N>& _data)
[1653]17  TRY
[459]18  {
[2019]19    if (modelToClientSourceFilter_)
[1201]20    {
21      if (check_if_active.isEmpty() || (!check_if_active.isEmpty() && (!check_if_active) || isActive(true)))
[2019]22        modelToClientSourceFilter_->streamData(CContext::getCurrent()->getCalendar()->getCurrentDate(), _data);
[1201]23    }
[1021]24    else if (instantDataFilter)
[640]25      ERROR("void CField::setData(const CArray<double, N>& _data)",
26            << "Impossible to receive data from the model for a field [ id = " << getId() << " ] with a reference or an arithmetic operation.");
[459]27  }
[1653]28  CATCH_DUMP_ATTR
[459]29
[593]30  template <int N>
31  void CField::getData(CArray<double, N>& _data) const
[1653]32  TRY
[593]33  {
[2019]34    if (clientToModelStoreFilter_)
[593]35    {
[2019]36      CDataPacket::StatusCode status = clientToModelStoreFilter_->getData(CContext::getCurrent()->getCalendar()->getCurrentDate(), _data);
[640]37
38      if (status == CDataPacket::END_OF_STREAM)
39        ERROR("void CField::getData(CArray<double, N>& _data) const",
40              << "Impossible to access field data, all the records of the field [ id = " << getId() << " ] have been already read.");
[593]41    }
42    else
43    {
44      ERROR("void CField::getData(CArray<double, N>& _data) const",
45            << "Impossible to access field data, the field [ id = " << getId() << " ] does not have read access.");
46    }
47  }
[1653]48  CATCH
[352]49} // namespace xios
50
51#endif
Note: See TracBrowser for help on using the repository browser.