Skip to content

Commit

Permalink
Only add runoff tracer flux to surface flux if it has not already bee…
Browse files Browse the repository at this point in the history
…n added
  • Loading branch information
andrew-c-ross authored and Hallberg-NOAA committed Dec 16, 2022
1 parent 8ddd854 commit 5ef380c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Expand Up @@ -28,6 +28,7 @@ module g_tracer_utils
character(len=fm_string_len) :: obc_src_file_name !< Boundary condition tracer source filename
character(len=fm_string_len) :: obc_src_field_name !< Boundary condition tracer source fieldname
integer :: src_var_record !< Unknown
logical :: runoff_added_to_stf = .false. !< Has flux in from runoff been added to stf?
logical :: requires_src_info = .false. !< Unknown
real :: src_var_unit_conversion = 1.0 !< This factor depends on the tracer. Ask Jasmin
real :: src_var_valid_min = 0.0 !< Unknown
Expand Down
3 changes: 2 additions & 1 deletion src/tracer/MOM_generic_tracer.F90
Expand Up @@ -512,7 +512,7 @@ subroutine MOM_generic_tracer_column_physics(h_old, h_new, ea, eb, fluxes, Hml,
!
g_tracer=>CS%g_tracer_list
do
if (_ALLOCATED(g_tracer%trunoff)) then
if (_ALLOCATED(g_tracer%trunoff) .and. (.NOT. g_tracer%runoff_added_to_stf)) then
call g_tracer_get_alias(g_tracer,g_tracer_name)
call g_tracer_get_pointer(g_tracer,g_tracer_name,'stf', stf_array)
call g_tracer_get_pointer(g_tracer,g_tracer_name,'trunoff',trunoff_array)
Expand All @@ -521,6 +521,7 @@ subroutine MOM_generic_tracer_column_physics(h_old, h_new, ea, eb, fluxes, Hml,
runoff_tracer_flux_array(:,:) = trunoff_array(:,:) * &
US%RZ_T_to_kg_m2s*fluxes%lrunoff(:,:)
stf_array = stf_array + runoff_tracer_flux_array
g_tracer%runoff_added_to_stf = .true.
endif

!traverse the linked list till hit NULL
Expand Down

0 comments on commit 5ef380c

Please sign in to comment.