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
7
8 use mom_error_handler, only : mom_error, fatal
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 :: compute_totchl !< dummy routine to compute total Chlorophyll
45 procedure, public :: surface_flux_compute !< dummy surface flux routine
46 procedure, public :: interior_tendency_compute !< dummy interior tendency routine
47 procedure, public :: add_output_for_gcm !< dummy add_output_for_GCM routine
48 procedure, public :: shutdown !< dummy shutdown routine
50
51 !> Error message that appears if the dummy interface is called
52 character(len=*), parameter :: error_msg = "MOM6 built the MARBL stubs rather than the full library"
53
54contains
55
56 !> Dummy version of MARBL's put_setting() function
57 subroutine put_setting(self, str_in)
58 class(marbl_interface_class), intent(in) :: self
59 character(len=*), intent(in) :: str_in
60
61 call mom_error(fatal, error_msg)
62 end subroutine put_setting
63
64 !> Dummy version of MARBL's get_setting() function
65 subroutine get_setting(self, str_in, log_out)
66 class(marbl_interface_class), intent(in) :: self
67 character(len=*), intent(in) :: str_in
68 logical, intent(out) :: log_out
69
70 log_out = .false.
71 call mom_error(fatal, error_msg)
72 end subroutine get_setting
73
74 !> Dummy version of MARBL's init() function
75 subroutine init(self, &
76 gcm_num_levels, &
77 gcm_num_PAR_subcols, &
78 gcm_num_elements_surface_flux, &
79 gcm_delta_z, &
80 gcm_zw, &
81 gcm_zt, &
82 unit_system_opt, &
83 lgcm_has_global_ops)
84
85 class(marbl_interface_class), intent(inout) :: self
86 integer, intent(in) :: gcm_num_levels
87 integer, intent(in) :: gcm_num_PAR_subcols
88 integer, intent(in) :: gcm_num_elements_surface_flux
89 real, intent(in) :: gcm_delta_z(gcm_num_levels)
90 real, intent(in) :: gcm_zw(gcm_num_levels)
91 real, intent(in) :: gcm_zt(gcm_num_levels)
92 character(len=*), intent(in) :: unit_system_opt
93 logical, intent(in) :: lgcm_has_global_ops
94
95 call mom_error(fatal, error_msg)
96 end subroutine init
97
98 !> Dummy version of MARBL's compute_totChl() function
99 subroutine compute_totchl(self)
100
101 class(marbl_interface_class), intent(inout) :: self
102
103 call mom_error(fatal, error_msg)
104
105 end subroutine compute_totchl
106
107 !> Dummy version of MARBL's surface_flux_compute() function
108 subroutine surface_flux_compute(self)
109
110 class(marbl_interface_class), intent(inout) :: self
111
112 call mom_error(fatal, error_msg)
113
114 end subroutine surface_flux_compute
115
116 !> Dummy version of MARBL's interior_tendency_compute() function
117 subroutine interior_tendency_compute(self)
118
119 class(marbl_interface_class), intent(inout) :: self
120
121 call mom_error(fatal, error_msg)
122
123 end subroutine interior_tendency_compute
124
125 !> Dummy version of MARBL's add_output_for_GCM() function
126 subroutine add_output_for_gcm(self, num_elements, field_name, output_id, field_source, num_levels)
127
128 class(marbl_interface_class), intent(inout) :: self
129 integer, intent(in) :: num_elements
130 character(len=*), intent(in) :: field_name
131 integer, intent(out) :: output_id
132 character(len=*), intent(out) :: field_source
133 integer, optional, intent(in) :: num_levels
134
135 output_id = 0
136 field_source = ""
137
138 end subroutine add_output_for_gcm
139
140 !> Dummy version of MARBL's shutdown() function
141 subroutine shutdown(self)
142
143 class(marbl_interface_class), intent(inout) :: self
144
145 call mom_error(fatal, error_msg)
146
147 end subroutine shutdown
148
149end module marbl_interface