Skip to content

Commit ecd5e76

Browse files
committed
Re-add src/tracer/MOM_generic_tracer.F90 (#8, #21)
In mom-ocean#1664, src/tracer/MOM_generic_tracer.F90 was moved to config_src/external/GFDL_ocean_BGC/MOM_generic_tracer.F90. This was done to simplify COBALT v3 development. However, having MOM_generic_tracer.F90 in the generic_tracers codebase doesnt work when compiling generic_tracers as a library, so we maintain MOM_generic_tracer.F90 in the MOM6 codebase. This reverts commits 2208dd7 and fcf5fff.
1 parent dfac1b3 commit ecd5e76

5 files changed

Lines changed: 1490 additions & 294 deletions

File tree

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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

Comments
 (0)