Go to the documentation of this file.
31 use coupler_types_mod,
only : coupler_type_set_data, ind_csurf
34 implicit none ;
private
36 #include <MOM_memory.h>
42 integer,
parameter ::
ntr = 1
46 logical :: coupled_tracers = .false.
47 character(len = 200) :: tracer_ic_file
48 type(time_type),
pointer :: time
50 real,
pointer :: tr(:,:,:,:) => null()
51 real :: land_val(
ntr) = -1.0
54 integer,
dimension(NTR) :: ind_tr
78 character(len=80) :: name, longname
80 #include "version_variable.h"
81 character(len=40) :: mdl =
"ISOMIP_tracer"
82 character(len=200) :: inputdir
83 character(len=48) :: flux_units
85 real,
pointer :: tr_ptr(:,:,:) => null()
87 integer :: isd, ied, jsd, jed, nz, m
88 isd = hi%isd ; ied = hi%ied ; jsd = hi%jsd ; jed = hi%jed ; nz = gv%ke
90 if (
associated(cs))
then
91 call mom_error(warning,
"ISOMIP_register_tracer called with an "// &
92 "associated control structure.")
99 call get_param(param_file, mdl,
"ISOMIP_TRACER_IC_FILE", cs%tracer_IC_file, &
100 "The name of a file from which to read the initial "//&
101 "conditions for the ISOMIP tracers, or blank to initialize "//&
102 "them internally.", default=
" ")
103 if (len_trim(cs%tracer_IC_file) >= 1)
then
104 call get_param(param_file, mdl,
"INPUTDIR", inputdir, default=
".")
105 inputdir = slasher(inputdir)
106 cs%tracer_IC_file = trim(inputdir)//trim(cs%tracer_IC_file)
107 call log_param(param_file, mdl,
"INPUTDIR/ISOMIP_TRACER_IC_FILE", &
110 call get_param(param_file, mdl,
"SPONGE", cs%use_sponge, &
111 "If true, sponges may be applied anywhere in the domain. "//&
112 "The exact location and properties of those sponges are "//&
113 "specified from MOM_initialization.F90.", default=.false.)
115 allocate(cs%tr(isd:ied,jsd:jed,nz,
ntr)) ; cs%tr(:,:,:,:) = 0.0
118 if (m < 10)
then ;
write(name,
'("tr_D",I1.1)') m
119 else ;
write(name,
'("tr_D",I2.2)') m ;
endif
120 write(longname,
'("Concentration of ISOMIP Tracer ",I2.2)') m
121 cs%tr_desc(m) =
var_desc(name, units=
"kg kg-1", longname=longname, caller=mdl)
122 if (gv%Boussinesq)
then ; flux_units =
"kg kg-1 m3 s-1"
123 else ; flux_units =
"kg s-1" ;
endif
127 tr_ptr => cs%tr(:,:,:,m)
130 name=name, longname=longname, units=
"kg kg-1", &
131 registry_diags=.true., flux_units=flux_units, &
132 restart_cs=restart_cs)
137 if (cs%coupled_tracers) &
139 flux_type=
' ', implementation=
' ', caller=
"register_ISOMIP_tracer")
153 logical,
intent(in) :: restart
155 type(time_type),
target,
intent(in) :: day
156 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)),
intent(in) :: h
157 type(
diag_ctrl),
target,
intent(in) :: diag
168 real,
allocatable :: temp(:,:,:)
169 real,
pointer,
dimension(:,:,:) :: &
170 obc_tr1_u => null(), &
174 character(len=16) :: name
175 character(len=72) :: longname
176 character(len=48) :: units
177 character(len=48) :: flux_units
179 real,
pointer :: tr_ptr(:,:,:) => null()
182 real :: e(szk_(g)+1), e_top, e_bot, d_tr
183 integer :: i, j, k, is, ie, js, je, isd, ied, jsd, jed, nz, m
184 integer :: isdb, iedb, jsdb, jedb
186 if (.not.
associated(cs))
return
187 is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec ; nz = g%ke
188 isd = g%isd ; ied = g%ied ; jsd = g%jsd ; jed = g%jed
189 isdb = g%IsdB ; iedb = g%IedB ; jsdb = g%JsdB ; jedb = g%JedB
190 h_neglect = gv%H_subroundoff
195 if (.not.restart)
then
196 if (len_trim(cs%tracer_IC_file) >= 1)
then
198 if (.not.
file_exists(cs%tracer_IC_file, g%Domain)) &
199 call mom_error(fatal,
"ISOMIP_initialize_tracer: Unable to open "// &
202 call query_vardesc(cs%tr_desc(m), name, caller=
"initialize_ISOMIP_tracer")
203 call mom_read_data(cs%tracer_IC_file, trim(name), cs%tr(:,:,:,m), g%Domain)
207 do k=1,nz ;
do j=js,je ;
do i=is,ie
209 enddo ;
enddo ;
enddo
248 subroutine isomip_tracer_column_physics(h_old, h_new, ea, eb, fluxes, dt, G, GV, US, CS, &
249 evap_CFL_limit, minimum_forcing_depth)
252 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)), &
254 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)), &
256 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)), &
260 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)), &
264 type(
forcing),
intent(in) :: fluxes
266 real,
intent(in) :: dt
270 real,
optional,
intent(in) :: evap_cfl_limit
272 real,
optional,
intent(in) :: minimum_forcing_depth
281 real :: c1(szi_(g),szk_(g))
282 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)) :: h_work
283 real :: melt(szi_(g),szj_(g))
285 character(len=256) :: mesg
286 integer :: i, j, k, is, ie, js, je, nz, m
287 is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec ; nz = g%ke
289 if (.not.
associated(cs))
return
291 melt(:,:) = fluxes%iceshelf_melt
294 mmax = maxval(melt(is:ie,js:je))
295 call max_across_pes(mmax)
300 do j=js,je ;
do i=is,ie
301 if (melt(i,j) > 0.0)
then
302 cs%tr(i,j,1:2,m) = melt(i,j)/mmax
304 cs%tr(i,j,1:2,m) = 0.0
309 if (
present(evap_cfl_limit) .and.
present(minimum_forcing_depth))
then
311 do k=1,nz ;
do j=js,je ;
do i=is,ie
312 h_work(i,j,k) = h_old(i,j,k)
313 enddo ;
enddo ;
enddo
315 evap_cfl_limit, minimum_forcing_depth)
331 type(
surface),
intent(inout) :: state
333 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)), &
341 integer :: m, is, ie, js, je, isd, ied, jsd, jed
342 is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec
343 isd = g%isd ; ied = g%ied ; jsd = g%jsd ; jed = g%jed
345 if (.not.
associated(cs))
return
347 if (cs%coupled_tracers)
then
351 call coupler_type_set_data(cs%tr(:,:,1,m), cs%ind_tr(m), ind_csurf, &
352 state%tr_fields, idim=(/isd, is, ie, ied/), &
353 jdim=(/jsd, js, je, jed/) )
365 if (
associated(cs))
then
366 if (
associated(cs%tr))
deallocate(cs%tr)
Wraps the FMS time manager functions.
subroutine, public register_tracer(tr_ptr, Reg, param_file, HI, GV, name, longname, units, cmor_name, cmor_units, cmor_longname, tr_desc, OBC_inflow, OBC_in_u, OBC_in_v, ad_x, ad_y, df_x, df_y, ad_2d_x, ad_2d_y, df_2d_x, df_2d_y, advection_xy, registry_diags, flux_nameroot, flux_longname, flux_units, flux_scale, convergence_units, convergence_scale, cmor_tendprefix, diag_form, restart_CS, mandatory)
This subroutine registers a tracer to be advected and laterally diffused.
Pointers to various fields which may be used describe the surface state of MOM, and which will be ret...
type(vardesc) function, public var_desc(name, units, longname, hor_grid, z_grid, t_grid, cmor_field_name, cmor_units, cmor_longname, conversion, caller)
Returns a vardesc type whose elements have been filled with the provided fields. The argument name is...
subroutine, public query_vardesc(vd, name, units, longname, hor_grid, z_grid, t_grid, cmor_field_name, cmor_units, cmor_longname, conversion, caller)
This routine queries vardesc.
Provides a transparent vertical ocean grid type and supporting routines.
subroutine, public applytracerboundaryfluxesinout(G, GV, Tr, dt, fluxes, h, evap_CFL_limit, minimum_forcing_depth, in_flux_optional, out_flux_optional, update_h_opt)
This routine is modeled after applyBoundaryFluxesInOut in MOM_diabatic_aux.F90 NOTE: Please note that...
An overloaded interface to log version information about modules.
A dummy version of atmos_ocean_fluxes_mod module for use when the vastly larger FMS package is not ne...
ALE sponge control structure.
integer, parameter ntr
ntr is the number of tracers in this module.
subroutine, public isomip_tracer_column_physics(h_old, h_new, ea, eb, fluxes, dt, G, GV, US, CS, evap_CFL_limit, minimum_forcing_depth)
This subroutine applies diapycnal diffusion, including the surface boundary conditions and any other ...
This module contains the tracer_registry_type and the subroutines that handle registration of tracers...
A structure that can be parsed to read and document run-time parameters.
An overloaded interface to read and log the values of various types of parameters.
Defines the horizontal index type (hor_index_type) used for providing index ranges.
This module contains the routines used to apply sponge layers when using the ALE mode.
This module contains I/O framework code.
A restart registry and the control structure for restarts.
Describes various unit conversion factors.
This module contains routines that implement physical fluxes of tracers (e.g. due to surface fluxes o...
Interfaces to non-domain-oriented communication subroutines, including the MOM6 reproducing sums faci...
This module implements boundary forcing for MOM6.
Store the reference profile at h points for a variable.
subroutine, public tracer_vertdiff(h_old, ea, eb, dt, tr, G, GV, sfc_flux, btm_flux, btm_reservoir, sink_rate, convert_flux_in)
This subroutine solves a tridiagonal equation for the final tracer concentrations after the dual-entr...
Describes the vertical ocean grid, including unit conversion factors.
The MOM6 facility for reading and writing restart files, and querying what has been read.
Provides transparent structures with groups of MOM6 variables and supporting routines.
Read a data field from a file.
Controls where open boundary conditions are applied.
The MOM6 facility to parse input files for runtime parameters.
Type to carry basic tracer information.
Container for horizontal index ranges for data, computational and global domains.
Provides the ocean grid type.
logical function, public register_isomip_tracer(HI, GV, param_file, CS, tr_Reg, restart_CS)
This subroutine is used to register tracer fields.
ISOMIP tracer package control structure.
Provides a transparent unit rescaling type to facilitate dimensional consistency testing.
Structure that contains pointers to the boundary forcing used to drive the liquid ocean simulated by ...
Type for describing a variable, typically a tracer.
Indicate whether a file exists, perhaps with domain decomposition.
subroutine, public mom_error(level, message, all_print)
This provides a convenient interface for writing an mpp_error message with run-time filter based on a...
integer function, public aof_set_coupler_flux(name, flux_type, implementation, atm_tr_index, param, flag, mol_wt, ice_restart_file, ocean_restart_file, units, caller, verbosity)
This subroutine duplicates an interface used by the FMS coupler, but only returns a value of -1....
subroutine, public isomip_tracer_end(CS)
Deallocate any memory used by the ISOMIP tracer package.
subroutine, public isomip_tracer_surface_state(state, h, G, CS)
This subroutine extracts the surface fields from this tracer package that are to be shared with the a...
An overloaded interface to log the values of various types of parameters.
Routines used to set up and use a set of (one for now) dynamically passive tracers in the ISOMIP conf...
subroutine, public initialize_isomip_tracer(restart, day, G, GV, h, diag, OBC, CS, ALE_sponge_CSp)
Initializes the NTR tracer fields in tr(:,:,:,:)
Routines for error handling and I/O management.
Ocean grid type. See mom_grid for details.