UFO
VertInterp.interface.F90
Go to the documentation of this file.
1 ! (C) Copyright 2017-2019 UCAR
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 
6 !> Fortran sfcpcorrected module for functions on the interface between C++ and Fortran
7 ! to handle observation operators
8 
10 
11  use iso_c_binding
12  use vert_interp_mod
13  implicit none
14  private
15 
16 contains
17 
18 ! ------------------------------------------------------------------------------
19 
20 subroutine vert_interp_weights_c(c_nlev, c_obl, c_vec, c_wi, c_wf) &
21  bind(c,name='vert_interp_weights_f90')
22 
23 implicit none
24 integer(c_int), intent(in ) :: c_nlev !Number of model levels
25 real(c_double), intent(in ) :: c_obl !Observation location
26 real(c_double), intent(in ) :: c_vec(c_nlev) !Structured vector of grid points
27 integer(c_int), intent(out) :: c_wi !Index for interpolation
28 real(c_double), intent(out) :: c_wf !Weight for interpolation
29 
30 call vert_interp_weights(c_nlev, c_obl, c_vec, c_wi, c_wf)
31 
32 end subroutine vert_interp_weights_c
33 
34 ! ------------------------------------------------------------------------------
35 
36 subroutine vert_interp_apply_c(c_nlev, c_fvec, c_f, c_wi, c_wf) &
37  bind(c,name='vert_interp_apply_f90')
38 
39 implicit none
40 integer(c_int), intent(in ) :: c_nlev !Number of model levels
41 real(c_double), intent(in ) :: c_fvec(c_nlev) !Field at grid points
42 real(c_double), intent(out) :: c_f !Output at obs location using linear interp
43 integer(c_int), intent(in ) :: c_wi !Index for interpolation
44 real(c_double), intent(in ) :: c_wf !Weight for interpolation
45 
46 call vert_interp_apply(c_nlev, c_fvec, c_f, c_wi, c_wf)
47 
48 end subroutine vert_interp_apply_c
49 
50 ! ------------------------------------------------------------------------------
51 
52 end module vert_interp_mod_c
Fortran sfcpcorrected module for functions on the interface between C++ and Fortran.
subroutine vert_interp_weights_c(c_nlev, c_obl, c_vec, c_wi, c_wf)
subroutine vert_interp_apply_c(c_nlev, c_fvec, c_f, c_wi, c_wf)
Fortran module to perform linear interpolation.
Definition: vert_interp.F90:8
subroutine vert_interp_weights(nlev, obl, vec, wi, wf)
Definition: vert_interp.F90:22
subroutine vert_interp_apply(nlev, fvec, f, wi, wf)
Definition: vert_interp.F90:73