FV3 Bundle
c_qg_bstddev.f90
Go to the documentation of this file.
1 ! (C) Copyright 2009-2016 ECMWF.
2 !
3 ! This software is licensed under the terms of the Apache Licence Version 2.0
4 ! which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
5 ! In applying this licence, ECMWF does not waive the privileges and immunities
6 ! granted to it by virtue of its status as an intergovernmental organisation nor
7 ! does it submit to any jurisdiction.
8 
9 ! ------------------------------------------------------------------------------
10 
11 !> Setup for the QG model's background error standard deviation matrix
12 
13 subroutine c_qg_bstddev_setup(c_key_self, c_conf) bind (c,name='qg_bstddev_setup_f90')
14 
15 use iso_c_binding
17 
18 implicit none
19 integer(c_int), intent(inout) :: c_key_self !< The background std dev structure
20 type(c_ptr), intent(in) :: c_conf !< The configuration
21 type(qg_3d_bstddev_config), pointer :: self
22 
23 call qg_3d_bstddev_registry%init()
24 call qg_3d_bstddev_registry%add(c_key_self)
25 call qg_3d_bstddev_registry%get(c_key_self, self)
26 
27 call qg_3d_bstddev_setup(c_conf, self)
28 
29 end subroutine c_qg_bstddev_setup
30 
31 ! ------------------------------------------------------------------------------
32 !> Delete for the QG model's background error std dev matrix
33 
34 subroutine c_qg_bstddev_delete(c_key_self) bind (c,name='qg_bstddev_delete_f90')
35 
36 use iso_c_binding
38 
39 implicit none
40 integer(c_int), intent(inout) :: c_key_self !< The background std dev structure
41 type(qg_3d_bstddev_config), pointer :: self
42 
43 call qg_3d_bstddev_registry%get(c_key_self,self)
44 call qg_3d_bstddev_delete(self)
45 call qg_3d_bstddev_registry%remove(c_key_self)
46 
47 end subroutine c_qg_bstddev_delete
48 
49 ! ------------------------------------------------------------------------------
50 
51 !> Multiply streamfunction by inverse of std dev
52 
53 subroutine c_qg_bstddev_inv_mult(c_key_conf, c_key_in, c_key_out) bind(c,name='qg_bstddev_invmult_f90')
54 
55 use iso_c_binding
57 use qg_fields
58 use kinds
59 
60 implicit none
61 integer(c_int), intent(in) :: c_key_conf !< stddev config structure
62 integer(c_int), intent(in) :: c_key_in !< Streamfunction: psi
63 integer(c_int), intent(in) :: c_key_out !< Streamfunction: psi
64 type(qg_3d_bstddev_config), pointer :: conf
65 type(qg_field), pointer :: xin
66 type(qg_field), pointer :: xout
67 
68 call qg_3d_bstddev_registry%get(c_key_conf,conf)
69 call qg_field_registry%get(c_key_in,xin)
70 call qg_field_registry%get(c_key_out,xout)
71 
72 call zeros(xout)
73 call qg_3d_bstddev_inv_mult(xin,xout,conf)
74 
75 end subroutine c_qg_bstddev_inv_mult
76 
77 ! ------------------------------------------------------------------------------
78 
79 !> Multiply streamfunction by std dev
80 
81 subroutine c_qg_bstddev_mult(c_key_conf, c_key_in, c_key_out) bind(c,name='qg_bstddev_mult_f90')
82 
83 use iso_c_binding
85 use qg_fields
86 use kinds
87 
88 implicit none
89 integer(c_int), intent(in) :: c_key_conf !< stddev config structure
90 integer(c_int), intent(in) :: c_key_in !< Streamfunction: psi
91 integer(c_int), intent(in) :: c_key_out !< Streamfunction: psi
92 type(qg_3d_bstddev_config), pointer :: conf
93 type(qg_field), pointer :: xin
94 type(qg_field), pointer :: xout
95 
96 call qg_3d_bstddev_registry%get(c_key_conf,conf)
97 call qg_field_registry%get(c_key_in,xin)
98 call qg_field_registry%get(c_key_out,xout)
99 
100 call zeros(xout)
101 call qg_3d_bstddev_mult(xin,xout,conf)
102 
103 end subroutine c_qg_bstddev_mult
104 
105 ! ------------------------------------------------------------------------------
type(registry_t) qg_3d_bstddev_registry
Linked list interface - defines registry_t type.
type(registry_t), public qg_field_registry
Linked list interface - defines registry_t type.
Definition: qg_fields.F90:65
subroutine qg_3d_bstddev_inv_mult(xin, xout, config)
Multiply by inverse of std dev matrix.
subroutine c_qg_bstddev_delete(c_key_self)
Delete for the QG model&#39;s background error std dev matrix.
Definition: conf.py:1
subroutine c_qg_bstddev_mult(c_key_conf, c_key_in, c_key_out)
Multiply streamfunction by std dev.
Structure holding configuration variables for the 3d error std dev matrices of the QG analysis...
subroutine qg_3d_bstddev_mult(xin, xout, config)
Multiply by std dev matrix.
Handle fields for the QG model.
Definition: qg_fields.F90:11
subroutine, public zeros(self)
Definition: qg_fields.F90:151
subroutine c_qg_bstddev_inv_mult(c_key_conf, c_key_in, c_key_out)
Multiply streamfunction by inverse of std dev.
subroutine qg_3d_bstddev_setup(c_model, config)
Linked list implementation.
subroutine qg_3d_bstddev_delete(self)
Delete for the QG model&#39;s 3d error std dev matrices.
subroutine c_qg_bstddev_setup(c_key_self, c_conf)
Setup for the QG model&#39;s background error standard deviation matrix.