46 #include <MOM_memory.h> 73 #ifdef _USE_GENERIC_TRACER 74 use mom_generic_tracer, only : register_mom_generic_tracer, initialize_mom_generic_tracer
75 use mom_generic_tracer, only : mom_generic_tracer_column_physics, mom_generic_tracer_surface_state
77 use mom_generic_tracer, only : mom_generic_tracer_stock, mom_generic_tracer_min_max, mom_generic_tracer_cs
87 implicit none ;
private 94 logical :: use_user_tracer_example = .false.
95 logical :: use_dome_tracer = .false.
96 logical :: use_isomip_tracer = .false.
97 logical :: use_ideal_age = .false.
98 logical :: use_regional_dyes = .false.
99 logical :: use_oil = .false.
100 logical :: use_advection_test_tracer = .false.
101 logical :: use_ocmip2_cfc = .false.
102 logical :: use_mom_generic_tracer = .false.
103 logical :: use_pseudo_salt_tracer = .false.
104 logical :: use_boundary_impulse_tracer = .false.
113 #ifdef _USE_GENERIC_TRACER 114 type(mom_generic_tracer_cs),
pointer :: mom_generic_tracer_csp => null()
148 #include "version_variable.h" 149 character(len=40) :: mdl =
"MOM_tracer_flow_control" 151 if (
associated(cs))
then 152 call mom_error(warning,
"call_tracer_register called with an associated "// &
153 "control structure.")
155 else ;
allocate(cs) ;
endif 159 call get_param(param_file, mdl,
"USE_USER_TRACER_EXAMPLE", &
160 cs%use_USER_tracer_example, &
161 "If true, use the USER_tracer_example tracer package.", &
163 call get_param(param_file, mdl,
"USE_DOME_TRACER", cs%use_DOME_tracer, &
164 "If true, use the DOME_tracer tracer package.", &
166 call get_param(param_file, mdl,
"USE_ISOMIP_TRACER", cs%use_ISOMIP_tracer, &
167 "If true, use the ISOMIP_tracer tracer package.", &
169 call get_param(param_file, mdl,
"USE_IDEAL_AGE_TRACER", cs%use_ideal_age, &
170 "If true, use the ideal_age_example tracer package.", &
172 call get_param(param_file, mdl,
"USE_REGIONAL_DYES", cs%use_regional_dyes, &
173 "If true, use the regional_dyes tracer package.", &
175 call get_param(param_file, mdl,
"USE_OIL_TRACER", cs%use_oil, &
176 "If true, use the oil_tracer tracer package.", &
178 call get_param(param_file, mdl,
"USE_ADVECTION_TEST_TRACER", cs%use_advection_test_tracer, &
179 "If true, use the advection_test_tracer tracer package.", &
181 call get_param(param_file, mdl,
"USE_OCMIP2_CFC", cs%use_OCMIP2_CFC, &
182 "If true, use the MOM_OCMIP2_CFC tracer package.", &
184 call get_param(param_file, mdl,
"USE_generic_tracer", &
185 cs%use_MOM_generic_tracer, &
186 "If true and _USE_GENERIC_TRACER is defined as a \n"//&
187 "preprocessor macro, use the MOM_generic_tracer packages.", &
189 call get_param(param_file, mdl,
"USE_PSEUDO_SALT_TRACER", cs%use_pseudo_salt_tracer, &
190 "If true, use the pseudo salt tracer, typically run as a diagnostic.", &
192 call get_param(param_file, mdl,
"USE_BOUNDARY_IMPULSE_TRACER", cs%use_boundary_impulse_tracer, &
193 "If true, use the boundary impulse tracer.", &
196 #ifndef _USE_GENERIC_TRACER 197 if (cs%use_MOM_generic_tracer)
call mom_error(fatal, &
198 "call_tracer_register: use_MOM_generic_tracer=.true. BUT not compiled")
204 if (cs%use_USER_tracer_example) cs%use_USER_tracer_example = &
205 user_register_tracer_example(hi, gv, param_file, cs%USER_tracer_example_CSp, &
207 if (cs%use_DOME_tracer) cs%use_DOME_tracer = &
208 register_dome_tracer(hi, gv, param_file, cs%DOME_tracer_CSp, &
210 if (cs%use_ISOMIP_tracer) cs%use_ISOMIP_tracer = &
211 register_isomip_tracer(hi, gv, param_file, cs%ISOMIP_tracer_CSp, &
213 if (cs%use_ideal_age) cs%use_ideal_age = &
214 register_ideal_age_tracer(hi, gv, param_file, cs%ideal_age_tracer_CSp, &
216 if (cs%use_regional_dyes) cs%use_regional_dyes = &
217 register_dye_tracer(hi, gv, param_file, cs%dye_tracer_CSp, &
219 if (cs%use_oil) cs%use_oil = &
220 register_oil_tracer(hi, gv, param_file, cs%oil_tracer_CSp, &
222 if (cs%use_advection_test_tracer) cs%use_advection_test_tracer = &
223 register_advection_test_tracer(hi, gv, param_file, cs%advection_test_tracer_CSp, &
225 if (cs%use_OCMIP2_CFC) cs%use_OCMIP2_CFC = &
226 register_ocmip2_cfc(hi, gv, param_file, cs%OCMIP2_CFC_CSp, &
228 #ifdef _USE_GENERIC_TRACER 229 if (cs%use_MOM_generic_tracer) cs%use_MOM_generic_tracer = &
230 register_mom_generic_tracer(hi, gv, param_file, cs%MOM_generic_tracer_CSp, &
233 if (cs%use_pseudo_salt_tracer) cs%use_pseudo_salt_tracer = &
234 register_pseudo_salt_tracer(hi, gv, param_file, cs%pseudo_salt_tracer_CSp, &
236 if (cs%use_boundary_impulse_tracer) cs%use_boundary_impulse_tracer = &
237 register_boundary_impulse_tracer(hi, gv, param_file, cs%boundary_impulse_tracer_CSp, &
246 CS, sponge_CSp, ALE_sponge_CSp, diag_to_Z_CSp, tv)
247 logical,
intent(in) :: restart
249 type(time_type),
target,
intent(in) :: day
253 real,
dimension(NIMEM_,NJMEM_,NKMEM_),
intent(in) :: h
257 type(
diag_ctrl),
target,
intent(in) :: diag
296 if (.not.
associated(cs))
call mom_error(fatal,
"tracer_flow_control_init: "// &
297 "Module must be initialized via call_tracer_register before it is used.")
300 if (cs%use_USER_tracer_example) &
301 call user_initialize_tracer(restart, day, g, gv, h, diag, obc, cs%USER_tracer_example_CSp, &
302 sponge_csp, diag_to_z_csp)
303 if (cs%use_DOME_tracer) &
304 call initialize_dome_tracer(restart, day, g, gv, h, diag, obc, cs%DOME_tracer_CSp, &
305 sponge_csp, diag_to_z_csp)
306 if (cs%use_ISOMIP_tracer) &
307 call initialize_isomip_tracer(restart, day, g, gv, h, diag, obc, cs%ISOMIP_tracer_CSp, &
308 ale_sponge_csp, diag_to_z_csp)
309 if (cs%use_ideal_age) &
310 call initialize_ideal_age_tracer(restart, day, g, gv, h, diag, obc, cs%ideal_age_tracer_CSp, &
311 sponge_csp, diag_to_z_csp)
312 if (cs%use_regional_dyes) &
313 call initialize_dye_tracer(restart, day, g, gv, h, diag, obc, cs%dye_tracer_CSp, &
314 sponge_csp, diag_to_z_csp)
316 call initialize_oil_tracer(restart, day, g, gv, h, diag, obc, cs%oil_tracer_CSp, &
317 sponge_csp, diag_to_z_csp)
318 if (cs%use_advection_test_tracer) &
319 call initialize_advection_test_tracer(restart, day, g, gv, h, diag, obc, cs%advection_test_tracer_CSp, &
320 sponge_csp, diag_to_z_csp)
321 if (cs%use_OCMIP2_CFC) &
322 call initialize_ocmip2_cfc(restart, day, g, gv, h, diag, obc, cs%OCMIP2_CFC_CSp, &
323 sponge_csp, diag_to_z_csp)
324 #ifdef _USE_GENERIC_TRACER 325 if (cs%use_MOM_generic_tracer) &
326 call initialize_mom_generic_tracer(restart, day, g, gv, h, param_file, diag, obc, &
327 cs%MOM_generic_tracer_CSp, sponge_csp, ale_sponge_csp, diag_to_z_csp)
329 if (cs%use_pseudo_salt_tracer) &
330 call initialize_pseudo_salt_tracer(restart, day, g, gv, h, diag, obc, cs%pseudo_salt_tracer_CSp, &
331 sponge_csp, diag_to_z_csp, tv)
332 if (cs%use_boundary_impulse_tracer) &
333 call initialize_boundary_impulse_tracer(restart, day, g, gv, h, diag, obc, cs%boundary_impulse_tracer_CSp, &
334 sponge_csp, diag_to_z_csp, tv)
340 real,
dimension(NIMEM_,NJMEM_,NKMEM_),
intent(out) :: Chl_array
354 #ifdef _USE_GENERIC_TRACER 355 if (cs%use_MOM_generic_tracer)
then 356 call mom_generic_tracer_get(
'chl',
'field',chl_array, cs%MOM_generic_tracer_CSp)
358 call mom_error(fatal,
"get_chl_from_model was called in a configuration "// &
359 "that is unable to provide a sensible model-based value.\n"// &
360 "CS%use_MOM_generic_tracer is false and no other viable options are on.")
363 call mom_error(fatal,
"get_chl_from_model was called in a configuration "// &
364 "that is unable to provide a sensible model-based value.\n"// &
365 "_USE_GENERIC_TRACER is undefined and no other options "//&
366 "are currently viable.")
375 type(
surface),
intent(inout) :: state
378 type(
forcing),
intent(inout) :: fluxes
381 type(time_type),
intent(in) :: day_start
382 type(time_type),
intent(in) :: day_interval
401 if (.not.
associated(cs))
call mom_error(fatal,
"call_tracer_set_forcing"// &
402 "Module must be initialized via call_tracer_register before it is used.")
411 subroutine call_tracer_column_fns(h_old, h_new, ea, eb, fluxes, Hml, dt, G, GV, tv, optics, CS, &
412 debug, evap_CFL_limit, minimum_forcing_depth)
413 real,
dimension(NIMEM_,NJMEM_,NKMEM_),
intent(in) :: h_old
416 real,
dimension(NIMEM_,NJMEM_,NKMEM_),
intent(in) :: h_new
418 real,
dimension(NIMEM_,NJMEM_,NKMEM_),
intent(in) :: ea
421 real,
dimension(NIMEM_,NJMEM_,NKMEM_),
intent(in) :: eb
424 type(
forcing),
intent(in) :: fluxes
427 real,
dimension(NIMEM_,NJMEM_),
intent(in) :: Hml
428 real,
intent(in) :: dt
435 type(optics_type),
pointer :: optics
440 logical,
intent(in) :: debug
441 real,
optional,
intent(in) :: evap_CFL_limit
444 real,
optional,
intent(in) :: minimum_forcing_depth
475 if (.not.
associated(cs))
call mom_error(fatal,
"call_tracer_column_fns: "// &
476 "Module must be initialized via call_tracer_register before it is used.")
479 if (
present(evap_cfl_limit) .and.
present(minimum_forcing_depth))
then 481 if (cs%use_USER_tracer_example) &
482 call tracer_column_physics(h_old, h_new, ea, eb, fluxes, dt, &
483 g, gv, cs%USER_tracer_example_CSp)
484 if (cs%use_DOME_tracer) &
485 call dome_tracer_column_physics(h_old, h_new, ea, eb, fluxes, dt, &
486 g, gv, cs%DOME_tracer_CSp, &
487 evap_cfl_limit=evap_cfl_limit, &
488 minimum_forcing_depth=minimum_forcing_depth)
489 if (cs%use_ISOMIP_tracer) &
490 call isomip_tracer_column_physics(h_old, h_new, ea, eb, fluxes, dt, &
491 g, gv, cs%ISOMIP_tracer_CSp, &
492 evap_cfl_limit=evap_cfl_limit, &
493 minimum_forcing_depth=minimum_forcing_depth)
494 if (cs%use_ideal_age) &
495 call ideal_age_tracer_column_physics(h_old, h_new, ea, eb, fluxes, dt, &
496 g, gv, cs%ideal_age_tracer_CSp, &
497 evap_cfl_limit=evap_cfl_limit, &
498 minimum_forcing_depth=minimum_forcing_depth)
499 if (cs%use_regional_dyes) &
500 call dye_tracer_column_physics(h_old, h_new, ea, eb, fluxes, dt, &
501 g, gv, cs%dye_tracer_CSp, &
502 evap_cfl_limit=evap_cfl_limit, &
503 minimum_forcing_depth=minimum_forcing_depth)
505 call oil_tracer_column_physics(h_old, h_new, ea, eb, fluxes, dt, &
506 g, gv, cs%oil_tracer_CSp, tv, &
507 evap_cfl_limit=evap_cfl_limit, &
508 minimum_forcing_depth=minimum_forcing_depth)
510 if (cs%use_advection_test_tracer) &
511 call advection_test_tracer_column_physics(h_old, h_new, ea, eb, fluxes, dt, &
512 g, gv, cs%advection_test_tracer_CSp, &
513 evap_cfl_limit=evap_cfl_limit, &
514 minimum_forcing_depth=minimum_forcing_depth)
515 if (cs%use_OCMIP2_CFC) &
516 call ocmip2_cfc_column_physics(h_old, h_new, ea, eb, fluxes, dt, &
517 g, gv, cs%OCMIP2_CFC_CSp, &
518 evap_cfl_limit=evap_cfl_limit, &
519 minimum_forcing_depth=minimum_forcing_depth)
520 #ifdef _USE_GENERIC_TRACER 521 if (cs%use_MOM_generic_tracer) &
522 call mom_generic_tracer_column_physics(h_old, h_new, ea, eb, fluxes, hml, dt, &
523 g, gv, cs%MOM_generic_tracer_CSp, tv, optics, &
524 evap_cfl_limit=evap_cfl_limit, &
525 minimum_forcing_depth=minimum_forcing_depth)
527 if (cs%use_pseudo_salt_tracer) &
528 call pseudo_salt_tracer_column_physics(h_old, h_new, ea, eb, fluxes, dt, &
529 g, gv, cs%pseudo_salt_tracer_CSp, tv, debug,&
530 evap_cfl_limit=evap_cfl_limit, &
531 minimum_forcing_depth=minimum_forcing_depth)
532 if (cs%use_boundary_impulse_tracer) &
533 call boundary_impulse_tracer_column_physics(h_old, h_new, ea, eb, fluxes, dt, &
534 g, gv, cs%boundary_impulse_tracer_CSp, tv, debug,&
535 evap_cfl_limit=evap_cfl_limit, &
536 minimum_forcing_depth=minimum_forcing_depth)
540 if (cs%use_USER_tracer_example) &
541 call tracer_column_physics(h_old, h_new, ea, eb, fluxes, dt, &
542 g, gv, cs%USER_tracer_example_CSp)
543 if (cs%use_DOME_tracer) &
544 call dome_tracer_column_physics(h_old, h_new, ea, eb, fluxes, dt, &
545 g, gv, cs%DOME_tracer_CSp)
546 if (cs%use_ISOMIP_tracer) &
547 call isomip_tracer_column_physics(h_old, h_new, ea, eb, fluxes, dt, &
548 g, gv, cs%ISOMIP_tracer_CSp)
549 if (cs%use_ideal_age) &
550 call ideal_age_tracer_column_physics(h_old, h_new, ea, eb, fluxes, dt, &
551 g, gv, cs%ideal_age_tracer_CSp)
552 if (cs%use_regional_dyes) &
553 call dye_tracer_column_physics(h_old, h_new, ea, eb, fluxes, dt, &
554 g, gv, cs%dye_tracer_CSp)
556 call oil_tracer_column_physics(h_old, h_new, ea, eb, fluxes, dt, &
557 g, gv, cs%oil_tracer_CSp, tv)
558 if (cs%use_advection_test_tracer) &
559 call advection_test_tracer_column_physics(h_old, h_new, ea, eb, fluxes, dt, &
560 g, gv, cs%advection_test_tracer_CSp)
561 if (cs%use_OCMIP2_CFC) &
562 call ocmip2_cfc_column_physics(h_old, h_new, ea, eb, fluxes, dt, &
563 g, gv, cs%OCMIP2_CFC_CSp)
564 #ifdef _USE_GENERIC_TRACER 565 if (cs%use_MOM_generic_tracer) &
566 call mom_generic_tracer_column_physics(h_old, h_new, ea, eb, fluxes, hml, dt, &
567 g, gv, cs%MOM_generic_tracer_CSp, tv, optics)
569 if (cs%use_pseudo_salt_tracer) &
570 call pseudo_salt_tracer_column_physics(h_old, h_new, ea, eb, fluxes, dt, &
571 g, gv, cs%pseudo_salt_tracer_CSp, tv, debug)
572 if (cs%use_boundary_impulse_tracer) &
573 call boundary_impulse_tracer_column_physics(h_old, h_new, ea, eb, fluxes, dt, &
574 g, gv, cs%boundary_impulse_tracer_CSp, tv, debug)
585 num_stocks, stock_index, got_min_max,global_min, global_max,xgmin, &
586 ygmin, zgmin, xgmax, ygmax, zgmax)
587 real,
dimension(NIMEM_,NJMEM_,NKMEM_), &
590 real,
dimension(:),
intent(out) :: stock_values
596 character(len=*),
dimension(:),
optional, &
597 intent(out) :: stock_names
599 character(len=*),
dimension(:),
optional, &
600 intent(out) :: stock_units
603 intent(out) :: num_stocks
606 intent(in) :: stock_index
609 logical,
dimension(:),
optional, &
610 intent(inout) :: got_min_max
611 real,
dimension(:),
optional, &
612 intent(out) :: global_min, global_max
613 real,
dimension(:),
optional, &
614 intent(out) :: xgmin, ygmin, zgmin, xgmax, ygmax, zgmax
631 character(len=200),
dimension(MAX_FIELDS_) :: names, units
632 character(len=200) :: set_pkg_name
633 real,
dimension(MAX_FIELDS_) :: values
634 integer :: max_ns, ns_tot, ns, index, pkg, max_pkgs, nn
636 if (.not.
associated(cs))
call mom_error(fatal,
"call_tracer_stocks: "// &
637 "Module must be initialized via call_tracer_register before it is used.")
639 index = -1 ;
if (
present(stock_index)) index = stock_index
641 max_ns =
size(stock_values)
642 if (
present(stock_names)) max_ns = min(max_ns,
size(stock_names))
643 if (
present(stock_units)) max_ns = min(max_ns,
size(stock_units))
646 if (cs%use_USER_tracer_example)
then 647 ns = user_tracer_stock(h, values, g, gv, cs%USER_tracer_example_CSp, &
648 names, units, stock_index)
649 call store_stocks(
"tracer_example", ns, names, units, values, index, stock_values, &
650 set_pkg_name, max_ns, ns_tot, stock_names, stock_units)
658 if (cs%use_ideal_age)
then 660 names, units, stock_index)
661 call store_stocks(
"ideal_age_example", ns, names, units, values, index, &
662 stock_values, set_pkg_name, max_ns, ns_tot, stock_names, stock_units)
664 if (cs%use_regional_dyes)
then 665 ns =
dye_stock(h, values, g, gv, cs%dye_tracer_CSp, &
666 names, units, stock_index)
667 call store_stocks(
"regional_dyes", ns, names, units, values, index, &
668 stock_values, set_pkg_name, max_ns, ns_tot, stock_names, stock_units)
671 ns =
oil_stock(h, values, g, gv, cs%oil_tracer_CSp, &
672 names, units, stock_index)
673 call store_stocks(
"oil_tracer", ns, names, units, values, index, &
674 stock_values, set_pkg_name, max_ns, ns_tot, stock_names, stock_units)
676 if (cs%use_OCMIP2_CFC)
then 677 ns =
ocmip2_cfc_stock(h, values, g, gv, cs%OCMIP2_CFC_CSp, names, units, stock_index)
678 call store_stocks(
"MOM_OCMIP2_CFC", ns, names, units, values, index, stock_values, &
679 set_pkg_name, max_ns, ns_tot, stock_names, stock_units)
682 if (cs%use_advection_test_tracer)
then 684 names, units, stock_index )
685 call store_stocks(
"advection_test_tracer", ns, names, units, values, index, &
686 stock_values, set_pkg_name, max_ns, ns_tot, stock_names, stock_units)
689 #ifdef _USE_GENERIC_TRACER 690 if (cs%use_MOM_generic_tracer)
then 691 ns = mom_generic_tracer_stock(h, values, g, gv, cs%MOM_generic_tracer_CSp, &
692 names, units, stock_index)
693 call store_stocks(
"MOM_generic_tracer", ns, names, units, values, index, stock_values, &
694 set_pkg_name, max_ns, ns_tot, stock_names, stock_units)
696 nn=mom_generic_tracer_min_max(nn, got_min_max, global_min, global_max, xgmin, ygmin, zgmin, xgmax, ygmax, zgmax ,&
697 g, cs%MOM_generic_tracer_CSp,names, units)
701 if (cs%use_pseudo_salt_tracer)
then 703 names, units, stock_index)
704 call store_stocks(
"pseudo_salt_tracer", ns, names, units, values, index, &
705 stock_values, set_pkg_name, max_ns, ns_tot, stock_names, stock_units)
708 if (cs%use_boundary_impulse_tracer)
then 709 ns = boundary_impulse_stock(h, values, g, gv, cs%boundary_impulse_tracer_CSp, &
710 names, units, stock_index)
711 call store_stocks(
"boundary_impulse_tracer", ns, names, units, values, index, &
712 stock_values, set_pkg_name, max_ns, ns_tot, stock_names, stock_units)
715 if (ns_tot == 0) stock_values(1) = 0.0
717 if (
present(num_stocks)) num_stocks = ns_tot
722 subroutine store_stocks(pkg_name, ns, names, units, values, index, stock_values, &
723 set_pkg_name, max_ns, ns_tot, stock_names, stock_units)
724 character(len=*),
intent(in) :: pkg_name
725 integer,
intent(in) :: ns
726 character(len=*),
dimension(:),
intent(in) :: names, units
727 real,
dimension(:),
intent(in) :: values
728 integer,
intent(in) :: index
729 real,
dimension(:),
intent(inout) :: stock_values
730 character(len=*),
intent(inout) :: set_pkg_name
731 integer,
intent(in) :: max_ns
732 integer,
intent(inout) :: ns_tot
733 character(len=*),
dimension(:),
optional,
intent(inout) :: stock_names, stock_units
736 character(len=16) :: ind_text, ns_text, max_text
739 if ((index > 0) .and. (ns > 0))
then 740 write(ind_text,
'(i8)') index
742 call mom_error(fatal,
"Tracer package "//trim(pkg_name)//&
743 " is not permitted to return more than one value when queried"//&
744 " for specific stock index "//trim(adjustl(ind_text))//
".")
745 elseif (ns+ns_tot > 1)
then 746 call mom_error(fatal,
"Tracer packages "//trim(pkg_name)//
" and "//&
747 trim(set_pkg_name)//
" both attempted to set values for"//&
748 " specific stock index "//trim(adjustl(ind_text))//
".")
750 set_pkg_name = pkg_name
754 if (ns_tot+ns > max_ns)
then 755 write(ns_text,
'(i8)') ns_tot+ns ;
write(max_text,
'(i8)') max_ns
756 call mom_error(fatal,
"Attempted to return more tracer stock values (at least "//&
757 trim(adjustl(ns_text))//
") than the size "//trim(adjustl(max_text))//&
758 "of the smallest value, name, or units array.")
762 stock_values(ns_tot+n) = values(n)
763 if (
present(stock_names)) stock_names(ns_tot+n) = names(n)
764 if (
present(stock_units)) stock_units(ns_tot+n) = units(n)
775 real,
dimension(NIMEM_,NJMEM_,NKMEM_), &
791 if (.not.
associated(cs))
call mom_error(fatal,
"call_tracer_surface_state: "// &
792 "Module must be initialized via call_tracer_register before it is used.")
795 if (cs%use_USER_tracer_example) &
796 call user_tracer_surface_state(state, h, g, cs%USER_tracer_example_CSp)
797 if (cs%use_DOME_tracer) &
798 call dome_tracer_surface_state(state, h, g, cs%DOME_tracer_CSp)
799 if (cs%use_ISOMIP_tracer) &
800 call isomip_tracer_surface_state(state, h, g, cs%ISOMIP_tracer_CSp)
801 if (cs%use_ideal_age) &
802 call ideal_age_tracer_surface_state(state, h, g, cs%ideal_age_tracer_CSp)
803 if (cs%use_regional_dyes) &
804 call dye_tracer_surface_state(state, h, g, cs%dye_tracer_CSp)
806 call oil_tracer_surface_state(state, h, g, cs%oil_tracer_CSp)
807 if (cs%use_advection_test_tracer) &
808 call advection_test_tracer_surface_state(state, h, g, cs%advection_test_tracer_CSp)
809 if (cs%use_OCMIP2_CFC) &
810 call ocmip2_cfc_surface_state(state, h, g, cs%OCMIP2_CFC_CSp)
811 #ifdef _USE_GENERIC_TRACER 812 if (cs%use_MOM_generic_tracer) &
813 call mom_generic_tracer_surface_state(state, h, g, cs%MOM_generic_tracer_CSp)
821 if (cs%use_USER_tracer_example) &
830 #ifdef _USE_GENERIC_TRACER 831 if (cs%use_MOM_generic_tracer)
call end_mom_generic_tracer(cs%MOM_generic_tracer_CSp)
834 if (cs%use_boundary_impulse_tracer)
call boundary_impulse_tracer_end(cs%boundary_impulse_tracer_CSp)
836 if (
associated(cs))
deallocate(cs)
subroutine store_stocks(pkg_name, ns, names, units, values, index, stock_values, set_pkg_name, max_ns, ns_tot, stock_names, stock_units)
This routine stores the stocks and does error handling for call_tracer_stocks.
integer function, public pseudo_salt_stock(h, stocks, G, GV, CS, names, units, stock_index)
logical function, public register_boundary_impulse_tracer(HI, GV, param_file, CS, tr_Reg, restart_CS)
Read in runtime options and add boundary impulse tracer to tracer registry.
The following structure contains pointers to various fields which may be used describe the surface st...
subroutine, public ideal_age_tracer_column_physics(h_old, h_new, ea, eb, fluxes, dt, G, GV, CS, evap_CFL_limit, minimum_forcing_depth)
subroutine, public advection_test_tracer_column_physics(h_old, h_new, ea, eb, fluxes, dt, G, GV, CS, evap_CFL_limit, minimum_forcing_depth)
logical function, public register_dye_tracer(HI, GV, param_file, CS, tr_Reg, restart_CS)
subroutine, public regional_dyes_end(CS)
subroutine, public oil_tracer_column_physics(h_old, h_new, ea, eb, fluxes, dt, G, GV, CS, tv, evap_CFL_limit, minimum_forcing_depth)
subroutine, public ideal_age_tracer_surface_state(state, h, G, CS)
subroutine, public pseudo_salt_tracer_end(CS)
This module implements boundary forcing for MOM6.
subroutine, public initialize_ideal_age_tracer(restart, day, G, GV, h, diag, OBC, CS, sponge_CSp, diag_to_Z_CSp)
subroutine, public user_initialize_tracer(restart, day, G, GV, h, diag, OBC, CS, sponge_CSp, diag_to_Z_CSp)
Ocean grid type. See mom_grid for details.
subroutine, public boundary_impulse_tracer_end(CS)
subroutine, public ideal_age_example_end(CS)
subroutine, public tracer_flow_control_init(restart, day, G, GV, h, param_file, diag, OBC, CS, sponge_CSp, ALE_sponge_CSp, diag_to_Z_CSp, tv)
This subroutine calls all registered tracer initialization subroutines.
Provides the ocean grid type.
integer function, public advection_test_stock(h, stocks, G, GV, CS, names, units, stock_index)
subroutine, public isomip_tracer_column_physics(h_old, h_new, ea, eb, fluxes, dt, G, GV, CS, evap_CFL_limit, minimum_forcing_depth)
This subroutine applies diapycnal diffusion and any other column.
integer function, public dye_stock(h, stocks, G, GV, CS, names, units, stock_index)
subroutine, public dome_tracer_surface_state(state, h, G, CS)
subroutine, public call_tracer_column_fns(h_old, h_new, ea, eb, fluxes, Hml, dt, G, GV, tv, optics, CS, debug, evap_CFL_limit, minimum_forcing_depth)
This subroutine calls all registered tracer column physics subroutines.
subroutine, public pseudo_salt_tracer_column_physics(h_old, h_new, ea, eb, fluxes, dt, G, GV, CS, tv, debug, evap_CFL_limit, minimum_forcing_depth)
This module contains the routines used to set up and use a set of (one for now) dynamically passive t...
subroutine, public call_tracer_register(HI, GV, param_file, CS, tr_Reg, restart_CS)
The following 5 subroutines and associated definitions provide the machinery to register and call the...
Defines the horizontal index type (hor_index_type) used for providing index ranges.
integer function, public user_tracer_stock(h, stocks, G, GV, CS, names, units, stock_index)
logical function, public register_ocmip2_cfc(HI, GV, param_file, CS, tr_Reg, restart_CS)
This module contains the routines used to apply sponge layers when using the ALE mode. Applying sponges requires the following: (1) initialize_ALE_sponge (2) set_up_ALE_sponge_field (tracers) and set_up_ALE_sponge_vel_field (vel) (3) apply_ALE_sponge (4) init_ALE_sponge_diags (not being used for now) (5) ALE_sponge_end (not being used for now)
subroutine, public initialize_oil_tracer(restart, day, G, GV, h, diag, OBC, CS, sponge_CSp, diag_to_Z_CSp)
SPONGE control structure.
Container for horizontal index ranges for data, computational and global domains. ...
subroutine, public initialize_pseudo_salt_tracer(restart, day, G, GV, h, diag, OBC, CS, sponge_CSp, diag_to_Z_CSp, tv)
subroutine, public user_tracer_surface_state(state, h, G, CS)
subroutine, public initialize_isomip_tracer(restart, day, G, GV, h, diag, OBC, CS, ALE_sponge_CSp, diag_to_Z_CSp)
Initializes the NTR tracer fields in tr(:,:,:,:)
integer function, public boundary_impulse_stock(h, stocks, G, GV, CS, names, units, stock_index)
Calculate total inventory of tracer.
Implements a boundary impulse response tracer to calculate Green's functions.
subroutine, public tracer_column_physics(h_old, h_new, ea, eb, fluxes, dt, G, GV, CS)
subroutine, public oil_tracer_surface_state(state, h, G, CS)
This module contains the tracer_registry_type and the subroutines that handle registration of tracers...
subroutine, public call_tracer_surface_state(state, h, G, CS)
This subroutine calls all registered tracer packages to enable them to add to the surface state retur...
subroutine, public call_tracer_stocks(h, stock_values, G, GV, CS, stock_names, stock_units, num_stocks, stock_index, got_min_max, global_min, global_max, xgmin, ygmin, zgmin, xgmax, ygmax, zgmax)
This subroutine calls all registered tracer packages to enable them to add to the surface state retur...
subroutine, public user_tracer_example_end(CS)
subroutine, public dome_tracer_column_physics(h_old, h_new, ea, eb, fluxes, dt, G, GV, CS, evap_CFL_limit, minimum_forcing_depth)
subroutine, public pseudo_salt_tracer_surface_state(state, h, G, CS)
subroutine, public oil_tracer_end(CS)
Type to carry basic tracer information.
subroutine, public call_tracer_set_forcing(state, fluxes, day_start, day_interval, G, CS)
This subroutine calls the individual tracer modules' subroutines to specify or read quantities relate...
subroutine, public tracer_flow_control_end(CS)
subroutine, public boundary_impulse_tracer_column_physics(h_old, h_new, ea, eb, fluxes, dt, G, GV, CS, tv, debug, evap_CFL_limit, minimum_forcing_depth)
integer function, public oil_stock(h, stocks, G, GV, CS, names, units, stock_index)
logical function, public register_isomip_tracer(HI, GV, param_file, CS, tr_Reg, restart_CS)
This subroutine is used to register tracer fields.
Structure that contains pointers to the boundary forcing used to drive the liquid ocean simulated by ...
subroutine, public initialize_boundary_impulse_tracer(restart, day, G, GV, h, diag, OBC, CS, sponge_CSp, diag_to_Z_CSp, tv)
Initialize tracer from restart or set to 1 at surface to initialize.
logical function, public user_register_tracer_example(HI, GV, param_file, CS, tr_Reg, restart_CS)
subroutine, public isomip_tracer_end(CS)
logical function, public register_ideal_age_tracer(HI, GV, param_file, CS, tr_Reg, restart_CS)
logical function, public register_oil_tracer(HI, GV, param_file, CS, tr_Reg, restart_CS)
logical function, public register_advection_test_tracer(HI, GV, param_file, CS, tr_Reg, restart_CS)
subroutine, public initialize_dome_tracer(restart, day, G, GV, h, diag, OBC, CS, sponge_CSp, diag_to_Z_CSp)
The thermo_var_ptrs structure contains pointers to an assortment of thermodynamic fields that may be ...
logical function, public register_dome_tracer(HI, GV, param_file, CS, tr_Reg, restart_CS)
subroutine, public advection_test_tracer_end(CS)
subroutine, public initialize_dye_tracer(restart, day, G, GV, h, diag, OBC, CS, sponge_CSp, diag_to_Z_CSp)
subroutine, public get_chl_from_model(Chl_array, G, CS)
integer function, public ocmip2_cfc_stock(h, stocks, G, GV, CS, names, units, stock_index)
This function calculates the mass-weighted integral of all tracer stocks, returning the number of sto...
subroutine, public ocmip2_cfc_end(CS)
subroutine, public ocmip2_cfc_surface_state(state, h, G, CS)
subroutine, public initialize_advection_test_tracer(restart, day, G, GV, h, diag, OBC, CS, sponge_CSp, diag_to_Z_CSp)
Controls where open boundary conditions are applied.
subroutine, public ocmip2_cfc_column_physics(h_old, h_new, ea, eb, fluxes, dt, G, GV, CS, evap_CFL_limit, minimum_forcing_depth)
This subroutine applies diapycnal diffusion and any other column.
subroutine, public advection_test_tracer_surface_state(state, h, G, CS)
subroutine, public dye_tracer_column_physics(h_old, h_new, ea, eb, fluxes, dt, G, GV, CS, evap_CFL_limit, minimum_forcing_depth)
subroutine, public dome_tracer_end(CS)
subroutine, public boundary_impulse_tracer_surface_state(state, h, G, CS)
Called if returned if coupler needs to know about tracer, currently unused.
subroutine, public initialize_ocmip2_cfc(restart, day, G, GV, h, diag, OBC, CS, sponge_CSp, diag_to_Z_CSp)
This subroutine initializes the NTR tracer fields in tr(:,:,:,:) and it sets up the tracer output...
subroutine, public mom_error(level, message, all_print)
logical function, public register_pseudo_salt_tracer(HI, GV, param_file, CS, tr_Reg, restart_CS)
subroutine, public dye_tracer_surface_state(state, h, G, CS)
integer function, public ideal_age_stock(h, stocks, G, GV, CS, names, units, stock_index)
subroutine, public isomip_tracer_surface_state(state, h, G, CS)
This particular tracer package does not report anything back to the coupler.