MOM6
FMS_coupler_util.F90
1 module fms_coupler_util
2 
3 use coupler_types_mod, only : coupler_2d_bc_type
4 
5 implicit none ; private
6 
7 public :: extract_coupler_values, set_coupler_values
8 
9 contains
10 
11 !> Get element and index of a boundary condition
12 subroutine extract_coupler_values(BC_struc, BC_index, BC_element, array_out, ilb, jlb, &
13  is, ie, js, je, conversion)
14  real, dimension(ilb:,jlb:),intent(out) :: array_out !< The array being filled with the input values
15  integer, intent(in) :: ilb !< Lower bounds
16  integer, intent(in) :: jlb !< Lower bounds
17  type(coupler_2d_bc_type), intent(in) :: BC_struc !< The type from which the data is being extracted
18  integer, intent(in) :: BC_index !< The boundary condition number being extracted
19  integer, intent(in) :: BC_element !< The element of the boundary condition being extracted
20  integer, optional, intent(in) :: is !< The i- limits of array_out to be filled
21  integer, optional, intent(in) :: ie !< The i- limits of array_out to be filled
22  integer, optional, intent(in) :: js !< The j- limits of array_out to be filled
23  integer, optional, intent(in) :: je !< The j- limits of array_out to be filled
24  real, optional, intent(in) :: conversion !< A number that every element is multiplied by
25 end subroutine extract_coupler_values
26 
27 !> Set element and index of a boundary condition
28 subroutine set_coupler_values(array_in, BC_struc, BC_index, BC_element, ilb, jlb,&
29  is, ie, js, je, conversion)
30  real, dimension(ilb:,jlb:), intent(in) :: array_in !< The array containing the values to load into the BC
31  integer, intent(in) :: ilb !< Lower bounds
32  integer, intent(in) :: jlb !< Lower bounds
33  type(coupler_2d_bc_type), intent(inout) :: BC_struc !< The type into which the data is being loaded
34  integer, intent(in) :: BC_index !< The boundary condition number being set
35  integer, intent(in) :: BC_element !< The element of the boundary condition being set
36  integer, optional, intent(in) :: is !< The i- limits of array_out to be filled
37  integer, optional, intent(in) :: ie !< The i- limits of array_out to be filled
38  integer, optional, intent(in) :: js !< The j- limits of array_out to be filled
39  integer, optional, intent(in) :: je !< The j- limits of array_out to be filled
40  real, optional, intent(in) :: conversion !< A number that every element is multiplied by
41 end subroutine set_coupler_values
42 
43 end module fms_coupler_util