FV3 Bundle
ModelTrajectory.cc
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2009-2016 ECMWF.
3  *
4  * This software is licensed under the terms of the Apache Licence Version 2.0
5  * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6  * In applying this licence, ECMWF does not waive the privileges and immunities
7  * granted to it by virtue of its status as an intergovernmental organisation nor
8  * does it submit to any jurisdiction.
9  */
10 
12 
13 #include "eckit/exception/Exceptions.h"
14 #include "lorenz95/FieldL95.h"
15 
16 // -----------------------------------------------------------------------------
17 namespace lorenz95 {
18 // -----------------------------------------------------------------------------
19 ModelTrajectory::ModelTrajectory(const bool ltraj) : ltraj_(ltraj), traj_() {}
20 // -----------------------------------------------------------------------------
22 // -----------------------------------------------------------------------------
23 void ModelTrajectory::set(const FieldL95 & xx) {
24  if (ltraj_) traj_.push_back(new FieldL95(xx));
25 }
26 // -----------------------------------------------------------------------------
27 const FieldL95 & ModelTrajectory::get(const int ii) const {
28  ASSERT(ltraj_);
29  ASSERT(traj_.size() == 4);
30  ASSERT(1 <= ii && ii <= 4);
31  return traj_[ii-1];
32 }
33 // -----------------------------------------------------------------------------
34 
35 } // namespace lorenz95
36 
ModelTrajectory(const bool ltraj=true)
Constructor, destructor.
const FieldL95 & get(const int) const
Get trajectory.
The namespace for the L95 model.
boost::ptr_vector< FieldL95 > traj_
void set(const FieldL95 &)
Save trajectory.
Class to represent fields for the L95 model.
Definition: FieldL95.h:36