|
| 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 | + integer, intent(in) :: ilb !< Lower bounds |
| 15 | + integer, intent(in) :: jlb !< Lower bounds |
| 16 | + real, dimension(ilb:,jlb:),intent(out) :: array_out !< The array being filled with the input values |
| 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 | + |
| 26 | + array_out(:,:) = -1. |
| 27 | +end subroutine extract_coupler_values |
| 28 | + |
| 29 | +!> Set element and index of a boundary condition |
| 30 | +subroutine set_coupler_values(array_in, BC_struc, BC_index, BC_element, ilb, jlb,& |
| 31 | + is, ie, js, je, conversion) |
| 32 | + integer, intent(in) :: ilb !< Lower bounds |
| 33 | + integer, intent(in) :: jlb !< Lower bounds |
| 34 | + real, dimension(ilb:,jlb:), intent(in) :: array_in !< The array containing the values to load into the BC |
| 35 | + type(coupler_2d_bc_type), intent(inout) :: BC_struc !< The type into which the data is being loaded |
| 36 | + integer, intent(in) :: BC_index !< The boundary condition number being set |
| 37 | + integer, intent(in) :: BC_element !< The element of the boundary condition being set |
| 38 | + integer, optional, intent(in) :: is !< The i- limits of array_out to be filled |
| 39 | + integer, optional, intent(in) :: ie !< The i- limits of array_out to be filled |
| 40 | + integer, optional, intent(in) :: js !< The j- limits of array_out to be filled |
| 41 | + integer, optional, intent(in) :: je !< The j- limits of array_out to be filled |
| 42 | + real, optional, intent(in) :: conversion !< A number that every element is multiplied by |
| 43 | +end subroutine set_coupler_values |
| 44 | + |
| 45 | +end module FMS_coupler_util |
0 commit comments