Debian Codegraph @

src/atlas/trans/ifs/VorDivToUVIFS.h

raw
1 /*
2 * (C) Copyright 2013 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
8 * nor does it submit to any jurisdiction.
9 */
10
11 #pragma once
12
13 #include "atlas/trans/VorDivToUV.h"
14
15 //-----------------------------------------------------------------------------
16 // Forward declarations
17
18 namespace atlas {
19 class FunctionSpace;
20 }
21
22 //-----------------------------------------------------------------------------
23
24 namespace atlas {
25 namespace trans {
26
27 //-----------------------------------------------------------------------------
28
29 class VorDivToUVIFS : public trans::VorDivToUVImpl {
30 public:
31 VorDivToUVIFS(const FunctionSpace&, const eckit::Configuration& = util::NoConfig());
32 VorDivToUVIFS(int truncation, const eckit::Configuration& = util::NoConfig());
33
34 virtual ~VorDivToUVIFS();
35
36 virtual int truncation() const override { return truncation_; }
37
38 // pure virtual interface
39
40 // -- IFS style API --
41 // These fields have special interpretation required. You need to know what
42 // you're doing.
43 // See IFS trans library.
44
45 /*!
46 * @brief Compute spectral wind (U/V) from spectral vorticity/divergence
47 *
48 * U = u*cos(lat)
49 * V = v*cos(lat)
50 *
51 * @param nb_fields [in] Number of fields
52 * @param vorticity [in] Spectral vorticity
53 * @param divergence [in] Spectral divergence
54 * @param U [out] Spectral wind U = u*cos(lat)
55 * @param V [out] Spectral wind V = v*cos(lat)
56 */
57 virtual void execute(const int nb_coeff, const int nb_fields, const double vorticity[], const double divergence[],
58 double U[], double V[], const eckit::Configuration& = util::NoConfig()) const override;
59
60 private:
61 int truncation_;
62 };
63
64 // ------------------------------------------------------------------
65
66 } // namespace trans
67 } // namespace atlas