OOPS
oops/assimilation/rotmat.h
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
11
#ifndef OOPS_ASSIMILATION_ROTMAT_H_
12
#define OOPS_ASSIMILATION_ROTMAT_H_
13
14
#include <cmath>
15
16
namespace
oops
{
17
18
/*! \file rotmat.h
19
* \brief Compute the Givens rotation matrix parameters
20
*/
21
22
void
rotmat
(
const
double
&
a
,
const
double
& b,
23
double
& c,
double
& s) {
24
if
(b == 0.0) {
25
c = 1.0;
26
s = 0.0;
27
}
else
if
(
a
== 0.0) {
28
c = 0.0;
29
s = 1.0;
30
}
else
if
(std::abs(b) > std::abs(
a
)) {
31
double
temp =
a
/b;
32
s = 1.0/sqrt(1.0 + temp*temp);
33
c = temp*s;
34
}
else
{
35
double
temp = b/
a
;
36
c = 1.0/sqrt(1.0 + temp*temp);
37
s = temp*c;
38
}
39
}
40
41
}
// namespace oops
42
43
#endif // OOPS_ASSIMILATION_ROTMAT_H_
oops::rotmat
void rotmat(const double &a, const double &b, double &c, double &s)
Definition:
oops/assimilation/rotmat.h:22
oops
The namespace for the main oops code.
Definition:
ErrorCovarianceL95.cc:22
dcmip_initial_conditions_test_1_2_3::a
real(8), parameter a
Definition:
dcmip_initial_conditions_test_1_2_3_v5.f90:61
fv3-bundle
oops
src
oops
assimilation
rotmat.h
Generated on Sun Oct 25 2020 12:42:59 for OOPS by
1.8.18