OOPS
qg_change_var_interface.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 
10 
11 use iso_c_binding
13 use qg_fields_mod
14 use qg_geom_mod
16 
17 implicit none
18 
19 private
20 ! ------------------------------------------------------------------------------
21 contains
22 ! ------------------------------------------------------------------------------
23 !> Change of variable
24 subroutine qg_change_var_c(c_key_fld_in,c_key_fld_out) bind (c,name='qg_change_var_f90')
25 
26 implicit none
27 
28 ! Passed variables
29 integer(c_int),intent(in) :: c_key_fld_in !< Input field
30 integer(c_int),intent(in) :: c_key_fld_out !< Output field
31 
32 ! Local variables
33 type(qg_fields),pointer :: fld_in,fld_out
34 
35 ! Interface
36 call qg_fields_registry%get(c_key_fld_in,fld_in)
37 call qg_fields_registry%get(c_key_fld_out,fld_out)
38 
39 ! Call Fortran
40 call qg_change_var(fld_in,fld_out)
41 
42 end subroutine qg_change_var_c
43 ! ------------------------------------------------------------------------------
44 !> Change of variable - tangent linear
45 subroutine qg_change_var_tl_c(c_key_fld_in,c_key_fld_out) bind (c,name='qg_change_var_tl_f90')
46 
47 implicit none
48 
49 ! Passed variables
50 integer(c_int),intent(in) :: c_key_fld_in !< Input field
51 integer(c_int),intent(in) :: c_key_fld_out !< Output field
52 
53 ! Local variables
54 type(qg_fields),pointer :: fld_in,fld_out
55 
56 ! Interface
57 call qg_fields_registry%get(c_key_fld_in,fld_in)
58 call qg_fields_registry%get(c_key_fld_out,fld_out)
59 
60 ! Call Fortran
61 call qg_change_var_tl(fld_in,fld_out)
62 
63 end subroutine qg_change_var_tl_c
64 ! ------------------------------------------------------------------------------
65 !> Change of variable - adjoint
66 subroutine qg_change_var_ad_c(c_key_fld_in,c_key_fld_out) bind (c,name='qg_change_var_ad_f90')
67 
68 implicit none
69 
70 ! Passed variables
71 integer(c_int),intent(in) :: c_key_fld_in !< Input field
72 integer(c_int),intent(in) :: c_key_fld_out !< Output field
73 
74 ! Local variables
75 type(qg_fields),pointer :: fld_in,fld_out
76 
77 ! Interface
78 call qg_fields_registry%get(c_key_fld_in,fld_in)
79 call qg_fields_registry%get(c_key_fld_out,fld_out)
80 
81 ! Call Fortran
82 call qg_change_var_ad(fld_in,fld_out)
83 
84 end subroutine qg_change_var_ad_c
85 ! ------------------------------------------------------------------------------
86 end module qg_change_var_interface
Fortran interface to Variables.
subroutine qg_change_var_c(c_key_fld_in, c_key_fld_out)
Change of variable.
subroutine qg_change_var_ad_c(c_key_fld_in, c_key_fld_out)
Change of variable - adjoint.
subroutine qg_change_var_tl_c(c_key_fld_in, c_key_fld_out)
Change of variable - tangent linear.
subroutine, public qg_change_var(fld_in, fld_out)
Change of variable.
subroutine, public qg_change_var_tl(fld_in, fld_out)
Change of variable.
subroutine, public qg_change_var_ad(fld_in, fld_out)
Change of variable - adjoint.
type(registry_t), public qg_fields_registry
Linked list interface - defines registry_t type.