marbl_interface.F90
1! This file is part of MOM6, the Modular Ocean Model version 6.
2! See the LICENSE file for licensing information.
3! SPDX-License-Identifier: Apache-2.0
4
5!> A non-functioning template of the MARBL interface
6module marbl_interface
7
8 use mom_error_handler, only : mom_error, fatal
9 use marbl_logging, only : marbl_log_type
10 use marbl_interface_public_types, only : marbl_forcing_fields_type
11 use marbl_interface_public_types, only : marbl_tracer_metadata_type
12 use marbl_interface_public_types, only : marbl_saved_state_type
13 use marbl_interface_public_types, only : marbl_diagnostics_type
14 use marbl_interface_public_types, only : marbl_domain_type
15 use marbl_interface_public_types, only : marbl_output_for_gcm_type
16 implicit none
17 private ! Only want marbl_interface_class to be public, not supporting functions
18
19 !> A non-functioning template of the MARBL_interface class
20 !!
21 !> All variables are dummy representations of actual members of the real marbl_interface_class
22 !! that are used in the MARBL tracer routines.
23 type, public :: marbl_interface_class
24 type(marbl_log_type) :: statuslog !< dummy log
25 type(marbl_forcing_fields_type), allocatable :: surface_flux_forcings(:) !< dummy forcing array
26 type(marbl_forcing_fields_type), allocatable :: interior_tendency_forcings(:) !< dummy forcing array
27 type(marbl_tracer_metadata_type), allocatable :: tracer_metadata(:) !< dummy metadata array
28 type(marbl_domain_type) :: domain !< dummy domain
29 type(marbl_saved_state_type) :: surface_flux_saved_state !< dummy saved state
30 type(marbl_saved_state_type) :: interior_tendency_saved_state !< dummy saved state
31 type(marbl_diagnostics_type) :: surface_flux_diags !< dummy diagnostics
32 type(marbl_diagnostics_type) :: interior_tendency_diags !< dummy diagnostics
33 type(marbl_output_for_gcm_type) :: surface_flux_output !< dummy output
34 type(marbl_output_for_gcm_type) :: interior_tendency_output !< dummy output
35 real, allocatable :: tracers(:,:) !< dummy tracer array
36 real, allocatable :: tracers_at_surface(:,:) !< dummy tracer surface array
37 real, allocatable :: bot_flux_to_tend(:) !< dummy array for bot flux to tendency wgts
38 real, allocatable :: surface_fluxes(:,:) !< dummy fluxes
39 real, allocatable :: interior_tendencies(:,:) !< dummy tendencies
40 contains
41 procedure, public :: put_setting !< dummy put_setting routine
42 procedure, public :: get_setting !< dummy get_setting routine
43 procedure, public :: init !< dummy init routine
44 procedure, public :: autotroph_tracer_consistency_enforce !< dummy consistency enforcement
45 procedure, public :: compute_totchl !< dummy routine to compute total Chlorophyll
46 procedure, public :: surface_flux_compute !< dummy surface flux routine
47 procedure, public :: interior_tendency_compute !< dummy interior tendency routine
48 procedure, public :: add_output_for_gcm !< dummy add_output_for_GCM routine
49 procedure, public :: shutdown !< dummy shutdown routine
50 end type marbl_interface_class
51
52 !> Error message that appears if the dummy interface is called
53 character(len=*), parameter :: error_msg = "MOM6 built the MARBL stubs rather than the full library"
54
55contains
56
57 !> Dummy version of MARBL's put_setting() function
58 subroutine put_setting(self, str_in)
59 class(marbl_interface_class), intent(in) :: self
60 character(len=*), intent(in) :: str_in
61
62 call mom_error(fatal, error_msg)
63 end subroutine put_setting
64
65 !> Dummy version of MARBL's get_setting() function
66 subroutine get_setting(self, str_in, log_out)
67 class(marbl_interface_class), intent(in) :: self
68 character(len=*), intent(in) :: str_in
69 logical, intent(out) :: log_out
70
71 log_out = .false.
72 call mom_error(fatal, error_msg)
73 end subroutine get_setting
74
75 !> Dummy version of MARBL's init() function
76 subroutine init(self, &
77 gcm_num_levels, &
78 gcm_num_PAR_subcols, &
79 gcm_num_elements_surface_flux, &
80 gcm_delta_z, &
81 gcm_zw, &
82 gcm_zt, &
83 unit_system_opt, &
84 lgcm_has_global_ops)
85
86 class(marbl_interface_class), intent(inout) :: self
87 integer, intent(in) :: gcm_num_levels
88 integer, intent(in) :: gcm_num_PAR_subcols
89 integer, intent(in) :: gcm_num_elements_surface_flux
90 real, intent(in) :: gcm_delta_z(gcm_num_levels)
91 real, intent(in) :: gcm_zw(gcm_num_levels)
92 real, intent(in) :: gcm_zt(gcm_num_levels)
93 character(len=*), intent(in) :: unit_system_opt
94 logical, intent(in) :: lgcm_has_global_ops
95
96 call mom_error(fatal, error_msg)
97 end subroutine init
98
99 !> Dummy version of MARBL's autotroph_tracer_consistency_enforce() function
100 subroutine autotroph_tracer_consistency_enforce(self)
101
102 class(marbl_interface_class), intent(inout) :: self
103
104 call mom_error(fatal, error_msg)
105
106 end subroutine autotroph_tracer_consistency_enforce
107
108 !> Dummy version of MARBL's compute_totChl() function
109 subroutine compute_totchl(self)
110
111 class(marbl_interface_class), intent(inout) :: self
112
113 call mom_error(fatal, error_msg)
114
115 end subroutine compute_totchl
116
117 !> Dummy version of MARBL's surface_flux_compute() function
118 subroutine surface_flux_compute(self)
119
120 class(marbl_interface_class), intent(inout) :: self
121
122 call mom_error(fatal, error_msg)
123
124 end subroutine surface_flux_compute
125
126 !> Dummy version of MARBL's interior_tendency_compute() function
127 subroutine interior_tendency_compute(self)
128
129 class(marbl_interface_class), intent(inout) :: self
130
131 call mom_error(fatal, error_msg)
132
133 end subroutine interior_tendency_compute
134
135 !> Dummy version of MARBL's add_output_for_GCM() function
136 subroutine add_output_for_gcm(self, num_elements, field_name, output_id, field_source, num_levels)
137
138 class(marbl_interface_class), intent(inout) :: self
139 integer, intent(in) :: num_elements
140 character(len=*), intent(in) :: field_name
141 integer, intent(out) :: output_id
142 character(len=*), intent(out) :: field_source
143 integer, optional, intent(in) :: num_levels
144
145 output_id = 0
146 field_source = ""
147
148 end subroutine add_output_for_gcm
149
150 !> Dummy version of MARBL's shutdown() function
151 subroutine shutdown(self)
152
153 class(marbl_interface_class), intent(inout) :: self
154
155 call mom_error(fatal, error_msg)
156
157 end subroutine shutdown
158
159end module marbl_interface