Skip to content

Commit

Permalink
+Changed the units of minimum_forcing_depth to [H]
Browse files Browse the repository at this point in the history
  Changed the units of minimum_forcing_depth passed to applyBoundaryFluxesInOut
and applyTracerBoundaryFluxesInOut to [H].  All answers are bitwise identical.
  • Loading branch information
Hallberg-NOAA committed Nov 15, 2019
1 parent 05b136b commit 6e115b7
Show file tree
Hide file tree
Showing 16 changed files with 36 additions and 30 deletions.
4 changes: 2 additions & 2 deletions src/parameterizations/vertical/MOM_diabatic_aux.F90
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ subroutine applyBoundaryFluxesInOut(CS, G, GV, US, dt, fluxes, optics, nsw, h, t
real, intent(in) :: evap_CFL_limit !< The largest fraction of a layer that
!! can be evaporated in one time-step [nondim].
real, intent(in) :: minimum_forcing_depth !< The smallest depth over which
!! heat and freshwater fluxes is applied [m].
!! heat and freshwater fluxes is applied [H ~> m or kg m-2].
real, dimension(SZI_(G),SZJ_(G),SZK_(G)), &
optional, intent(out) :: cTKE !< Turbulent kinetic energy requirement to mix
!! forcing through each layer [R Z3 T-2 ~> J m-2]
Expand Down Expand Up @@ -1168,7 +1168,7 @@ subroutine applyBoundaryFluxesInOut(CS, G, GV, US, dt, fluxes, optics, nsw, h, t
! Place forcing into this layer if this layer has nontrivial thickness.
! For layers thin relative to 1/IforcingDepthScale, then distribute
! forcing into deeper layers.
IforcingDepthScale = 1. / max(GV%H_subroundoff, minimum_forcing_depth*GV%m_to_H - netMassOut(i) )
IforcingDepthScale = 1. / max(GV%H_subroundoff, minimum_forcing_depth - netMassOut(i) )
! fractionOfForcing = 1.0, unless h2d is less than IforcingDepthScale.
fractionOfForcing = min(1.0, h2d(i,k)*IforcingDepthScale)

Expand Down
20 changes: 10 additions & 10 deletions src/parameterizations/vertical/MOM_diabatic_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ module MOM_diabatic_driver
real :: Kd_min_tr !< A minimal diffusivity that should always be
!! applied to tracers, especially in massless layers
!! near the bottom [Z2 T-1 ~> m2 s-1].
real :: minimum_forcing_depth = 0.001 !< The smallest depth over which heat and freshwater
!! fluxes are applied [m].
real :: minimum_forcing_depth !< The smallest depth over which heat and freshwater
!! fluxes are applied [H ~> m or kg m-2].
real :: evap_CFL_limit = 0.8 !< The largest fraction of a layer that can be
!! evaporated in one time-step [nondim].
integer :: halo_TS_diff = 0 !< The temperature, salinity and thickness halo size that
Expand Down Expand Up @@ -1136,7 +1136,7 @@ subroutine diabatic_ALE_legacy(u, v, h, tv, Hml, fluxes, visc, ADp, CDp, dt, Tim
call call_tracer_column_fns(h_prebound, h, ea_s, eb_s, fluxes, Hml, dt, G, GV, US, tv, &
CS%optics, CS%tracer_flow_CSp, CS%debug, &
evap_CFL_limit = CS%evap_CFL_limit, &
minimum_forcing_depth = CS%minimum_forcing_depth)
minimum_forcing_depth=CS%minimum_forcing_depth)

elseif (associated(visc%Kd_extra_S)) then ! extra diffusivity for passive tracers

Expand Down Expand Up @@ -1165,13 +1165,13 @@ subroutine diabatic_ALE_legacy(u, v, h, tv, Hml, fluxes, visc, ADp, CDp, dt, Tim
call call_tracer_column_fns(h_prebound, h, eatr, ebtr, fluxes, Hml, dt, G, GV, US, tv, &
CS%optics, CS%tracer_flow_CSp, CS%debug,&
evap_CFL_limit = CS%evap_CFL_limit, &
minimum_forcing_depth = CS%minimum_forcing_depth)
minimum_forcing_depth=CS%minimum_forcing_depth)
else
! For passive tracers, the changes in thickness due to boundary fluxes has yet to be applied
call call_tracer_column_fns(h_prebound, h, eatr, ebtr, fluxes, Hml, dt, G, GV, US, tv, &
CS%optics, CS%tracer_flow_CSp, CS%debug, &
evap_CFL_limit = CS%evap_CFL_limit, &
minimum_forcing_depth = CS%minimum_forcing_depth)
minimum_forcing_depth=CS%minimum_forcing_depth)
endif ! (CS%mix_boundary_tracers)

call cpu_clock_end(id_clock_tracers)
Expand Down Expand Up @@ -1810,7 +1810,7 @@ subroutine diabatic_ALE(u, v, h, tv, Hml, fluxes, visc, ADp, CDp, dt, Time_end,
call call_tracer_column_fns(h_prebound, h, ea_s, eb_s, fluxes, Hml, dt, G, GV, US, tv, &
CS%optics, CS%tracer_flow_CSp, CS%debug, &
evap_CFL_limit = CS%evap_CFL_limit, &
minimum_forcing_depth = CS%minimum_forcing_depth)
minimum_forcing_depth=CS%minimum_forcing_depth)

elseif (associated(visc%Kd_extra_S)) then ! extra diffusivity for passive tracers

Expand All @@ -1834,13 +1834,13 @@ subroutine diabatic_ALE(u, v, h, tv, Hml, fluxes, visc, ADp, CDp, dt, Time_end,
call call_tracer_column_fns(h_prebound, h, eatr, ebtr, fluxes, Hml, dt, G, GV, US, tv, &
CS%optics, CS%tracer_flow_CSp, CS%debug,&
evap_CFL_limit = CS%evap_CFL_limit, &
minimum_forcing_depth = CS%minimum_forcing_depth)
minimum_forcing_depth=CS%minimum_forcing_depth)
else
! For passive tracers, the changes in thickness due to boundary fluxes has yet to be applied
call call_tracer_column_fns(h_prebound, h, eatr, ebtr, fluxes, Hml, dt, G, GV, US, tv, &
CS%optics, CS%tracer_flow_CSp, CS%debug, &
evap_CFL_limit = CS%evap_CFL_limit, &
minimum_forcing_depth = CS%minimum_forcing_depth)
minimum_forcing_depth=CS%minimum_forcing_depth)
endif ! (CS%mix_boundary_tracers)

call cpu_clock_end(id_clock_tracers)
Expand Down Expand Up @@ -2869,7 +2869,7 @@ subroutine extract_diabatic_member(CS, opacity_CSp, optics_CSp, &
real, optional, intent( out) :: evap_CFL_limit !<The largest fraction of a layer that can be
!! evaporated in one time-step [nondim].
real, optional, intent( out) :: minimum_forcing_depth !< The smallest depth over which heat
!! and freshwater fluxes are applied [m].
!! and freshwater fluxes are applied [H ~> m or kg m-2].
type(diabatic_aux_CS), optional, pointer :: diabatic_aux_CSp !< A pointer to be set to the diabatic_aux
!! control structure

Expand Down Expand Up @@ -3349,7 +3349,7 @@ subroutine diabatic_driver_init(Time, G, GV, US, param_file, useALEalgorithm, di
"only takes effect when near-surface layers become thin "//&
"relative to this scale, in which case the forcing tendencies "//&
"scaled down by distributing the forcing over this depth scale.", &
units="m", default=0.001)
units="m", default=0.001, scale=GV%m_to_H)
call get_param(param_file, mdl, "EVAP_CFL_LIMIT", CS%evap_CFL_limit, &
"The largest fraction of a layer than can be lost to forcing "//&
"(e.g. evaporation, sea-ice formation) in one time-step. The unused "//&
Expand Down
3 changes: 1 addition & 2 deletions src/tracer/DOME_tracer.F90
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ subroutine initialize_DOME_tracer(restart, day, G, GV, US, h, diag, OBC, CS, &
real, pointer :: tr_ptr(:,:,:) => NULL()
real :: PI ! 3.1415926... calculated as 4*atan(1)
real :: tr_y ! Initial zonally uniform tracer concentrations.
real :: dist2 ! The distance squared from a line [m2].
real :: h_neglect ! A thickness that is so small it is usually lost
! in roundoff and can be neglected [H ~> m or kg m-2].
real :: e(SZK_(G)+1), e_top, e_bot ! Heights [Z ~> m].
Expand Down Expand Up @@ -308,7 +307,7 @@ subroutine DOME_tracer_column_physics(h_old, h_new, ea, eb, fluxes, dt, G, GV,
real, optional, intent(in) :: evap_CFL_limit !< Limit on the fraction of the water that can
!! be fluxed out of the top layer in a timestep [nondim]
real, optional, intent(in) :: minimum_forcing_depth !< The smallest depth over which
!! fluxes can be applied [m]
!! fluxes can be applied [H ~> m or kg m-2]

! Local variables
real :: b1(SZI_(G)) ! b1 and c1 are variables used by the
Expand Down
2 changes: 1 addition & 1 deletion src/tracer/ISOMIP_tracer.F90
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ subroutine ISOMIP_tracer_column_physics(h_old, h_new, ea, eb, fluxes, dt, G, G
real, optional, intent(in) :: evap_CFL_limit !< Limit on the fraction of the water that can
!! be fluxed out of the top layer in a timestep [nondim]
real, optional, intent(in) :: minimum_forcing_depth !< The smallest depth over which
!! fluxes can be applied [m]
!! fluxes can be applied [H ~> m or kg m-2]

! The arguments to this subroutine are redundant in that
! h_new(k) = h_old(k) + ea(k) - eb(k-1) + eb(k) - ea(k+1)
Expand Down
2 changes: 1 addition & 1 deletion src/tracer/MOM_OCMIP2_CFC.F90
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ subroutine OCMIP2_CFC_column_physics(h_old, h_new, ea, eb, fluxes, dt, G, GV, US
real, optional, intent(in) :: evap_CFL_limit !< Limit on the fraction of the water that can
!! be fluxed out of the top layer in a timestep [nondim]
real, optional, intent(in) :: minimum_forcing_depth !< The smallest depth over which
!! fluxes can be applied [m]
!! fluxes can be applied [H ~> m or kg m-2]
! This subroutine applies diapycnal diffusion and any other column
! tracer physics or chemistry to the tracers from this file.
! CFCs are relatively simple, as they are passive tracers. with only a surface
Expand Down
3 changes: 2 additions & 1 deletion src/tracer/MOM_generic_tracer.F90
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,8 @@ subroutine MOM_generic_tracer_column_physics(h_old, h_new, ea, eb, fluxes, Hml,
real, optional, intent(in) :: evap_CFL_limit !< Limits how much water can be fluxed out of
!! the top layer Stored previously in diabatic CS.
real, optional, intent(in) :: minimum_forcing_depth !< The smallest depth over which fluxes
!! can be applied Stored previously in diabatic CS.
!! can be applied [H ~> m or kg m-2]
! Stored previously in diabatic CS.
! The arguments to this subroutine are redundant in that
! h_new(k) = h_old(k) + ea(k) - eb(k-1) + eb(k) - ea(k+1)

Expand Down
12 changes: 9 additions & 3 deletions src/tracer/MOM_offline_main.F90
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,12 @@ module MOM_offline_main
integer :: off_ale_mod !< Sets how frequently the ALE step is done during the advection
real :: dt_offline !< Timestep used for offline tracers [T ~> s]
real :: dt_offline_vertical !< Timestep used for calls to tracer vertical physics [T ~> s]
real :: evap_CFL_limit !< Copied from diabatic_CS controlling how tracers follow freshwater fluxes
real :: minimum_forcing_depth !< Copied from diabatic_CS controlling how tracers follow freshwater fluxes
real :: evap_CFL_limit !< Limit on the fraction of the water that can be fluxed out of the top
!! layer in a timestep [nondim]. This is Copied from diabatic_CS controlling
!! how tracers follow freshwater fluxes
real :: minimum_forcing_depth !< The smallest depth over which fluxes can be applied [H ~> m or kg m-2].
!! This is copied from diabatic_CS controlling how tracers follow freshwater fluxes

real :: Kd_max !< Runtime parameter specifying the maximum value of vertical diffusivity
real :: min_residual !< The minimum amount of total mass flux before exiting the main advection routine
!>@{ Diagnostic manager IDs for some fields that may be of interest when doing offline transport
Expand Down Expand Up @@ -242,7 +246,9 @@ subroutine offline_advection_ale(fluxes, Time_start, time_interval, CS, id_clock
integer :: isv, iev, jsv, jev ! The valid range of the indices.
integer :: IsdB, IedB, JsdB, JedB
logical :: z_first, x_before_y
real :: evap_CFL_limit, minimum_forcing_depth
real :: evap_CFL_limit ! Limit on the fraction of the water that can be fluxed out of the
! top layer in a timestep [nondim]
real :: minimum_forcing_depth ! The smallest depth over which fluxes can be applied [H ~> m or kg m-2]
real :: dt_iter ! The timestep to use for each iteration [T ~> s]

integer :: nstocks
Expand Down
4 changes: 2 additions & 2 deletions src/tracer/MOM_tracer_diabatic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ subroutine applyTracerBoundaryFluxesInOut(G, GV, Tr, dt, fluxes, h, evap_CFL_lim
!! water that can be fluxed out of the top
!! layer in a timestep [nondim]
real, intent(in ) :: minimum_forcing_depth !< The smallest depth over
!! which fluxes can be applied [m]
!! which fluxes can be applied [H ~> m or kg m-2]
real, dimension(SZI_(G),SZJ_(G)), optional, intent(in ) :: in_flux_optional !< The total time-integrated
!! amount of tracer that enters with freshwater
real, dimension(SZI_(G),SZJ_(G)), optional, intent(in) :: out_flux_optional !< The total time-integrated
Expand Down Expand Up @@ -366,7 +366,7 @@ subroutine applyTracerBoundaryFluxesInOut(G, GV, Tr, dt, fluxes, h, evap_CFL_lim
! Place forcing into this layer if this layer has nontrivial thickness.
! For layers thin relative to 1/IforcingDepthScale, then distribute
! forcing into deeper layers.
IforcingDepthScale = 1. / max(GV%H_subroundoff, minimum_forcing_depth*GV%m_to_H - netMassOut(i) )
IforcingDepthScale = 1. / max(GV%H_subroundoff, minimum_forcing_depth - netMassOut(i) )
! fractionOfForcing = 1.0, unless h2d is less than IforcingDepthScale.
fractionOfForcing = min(1.0, h2d(i,k)*IforcingDepthScale)

Expand Down
2 changes: 1 addition & 1 deletion src/tracer/RGC_tracer.F90
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ subroutine RGC_tracer_column_physics(h_old, h_new, ea, eb, fluxes, dt, G, GV,
real, optional, intent(in) :: evap_CFL_limit !< Limit on the fraction of the water that can be
!! fluxed out of the top layer in a timestep [nondim].
real, optional, intent(in) :: minimum_forcing_depth !< The smallest depth over which fluxes
!! can be applied [m].
!! can be applied [H ~> m or kg m-2].

! The arguments to this subroutine are redundant in that
! h_new[k] = h_old[k] + ea[k] - eb[k-1] + eb[k] - ea[k+1]
Expand Down
2 changes: 1 addition & 1 deletion src/tracer/advection_test_tracer.F90
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ subroutine advection_test_tracer_column_physics(h_old, h_new, ea, eb, fluxes,
real, optional, intent(in) :: evap_CFL_limit !< Limit on the fraction of the water that can
!! be fluxed out of the top layer in a timestep [nondim]
real, optional, intent(in) :: minimum_forcing_depth !< The smallest depth over which
!! fluxes can be applied [m]
!! fluxes can be applied [H ~> m or kg m-2]
! This subroutine applies diapycnal diffusion and any other column
! tracer physics or chemistry to the tracers from this file.
! This is a simple example of a set of advected passive tracers.
Expand Down
2 changes: 1 addition & 1 deletion src/tracer/boundary_impulse_tracer.F90
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ subroutine boundary_impulse_tracer_column_physics(h_old, h_new, ea, eb, fluxes,
real, optional, intent(in) :: evap_CFL_limit !< Limit on the fraction of the water that can
!! be fluxed out of the top layer in a timestep [nondim]
real, optional, intent(in) :: minimum_forcing_depth !< The smallest depth over which
!! fluxes can be applied [m]
!! fluxes can be applied [H ~> m or kg m-2]

! This subroutine applies diapycnal diffusion and any other column
! tracer physics or chemistry to the tracers from this file.
Expand Down
2 changes: 1 addition & 1 deletion src/tracer/dye_example.F90
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ subroutine dye_tracer_column_physics(h_old, h_new, ea, eb, fluxes, dt, G, GV, US
real, optional, intent(in) :: evap_CFL_limit !< Limit on the fraction of the water that can
!! be fluxed out of the top layer in a timestep [nondim]
real, optional, intent(in) :: minimum_forcing_depth !< The smallest depth over which
!! fluxes can be applied [m]
!! fluxes can be applied [H ~> m or kg m-2]

! Local variables
real, dimension(SZI_(G),SZJ_(G),SZK_(G)) :: h_work ! Used so that h can be modified
Expand Down
2 changes: 1 addition & 1 deletion src/tracer/dyed_obc_tracer.F90
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ subroutine dyed_obc_tracer_column_physics(h_old, h_new, ea, eb, fluxes, dt, G,
real, optional, intent(in) :: evap_CFL_limit !< Limit on the fraction of the water that can
!! be fluxed out of the top layer in a timestep [nondim]
real, optional, intent(in) :: minimum_forcing_depth !< The smallest depth over which
!! fluxes can be applied [m]
!! fluxes can be applied [H ~> m or kg m-2]

! Local variables
real :: b1(SZI_(G)) ! b1 and c1 are variables used by the
Expand Down
2 changes: 1 addition & 1 deletion src/tracer/ideal_age_example.F90
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ subroutine ideal_age_tracer_column_physics(h_old, h_new, ea, eb, fluxes, dt, G,
real, optional, intent(in) :: evap_CFL_limit !< Limit on the fraction of the water that can
!! be fluxed out of the top layer in a timestep [nondim]
real, optional, intent(in) :: minimum_forcing_depth !< The smallest depth over which
!! fluxes can be applied [m]
!! fluxes can be applied [H ~> m or kg m-2]
! This subroutine applies diapycnal diffusion and any other column
! tracer physics or chemistry to the tracers from this file.
! This is a simple example of a set of advected passive tracers.
Expand Down
2 changes: 1 addition & 1 deletion src/tracer/oil_tracer.F90
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ subroutine oil_tracer_column_physics(h_old, h_new, ea, eb, fluxes, dt, G, GV, US
real, optional, intent(in) :: evap_CFL_limit !< Limit on the fraction of the water that can
!! be fluxed out of the top layer in a timestep [nondim]
real, optional, intent(in) :: minimum_forcing_depth !< The smallest depth over which
!! fluxes can be applied [m]
!! fluxes can be applied [H ~> m or kg m-2]
! This subroutine applies diapycnal diffusion and any other column
! tracer physics or chemistry to the tracers from this file.
! This is a simple example of a set of advected passive tracers.
Expand Down
2 changes: 1 addition & 1 deletion src/tracer/pseudo_salt_tracer.F90
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ subroutine pseudo_salt_tracer_column_physics(h_old, h_new, ea, eb, fluxes, dt, G
real, optional, intent(in) :: evap_CFL_limit !< Limit on the fraction of the water that can
!! be fluxed out of the top layer in a timestep [nondim]
real, optional, intent(in) :: minimum_forcing_depth !< The smallest depth over which
!! fluxes can be applied [m]
!! fluxes can be applied [H ~> m or kg m-2]

! This subroutine applies diapycnal diffusion and any other column
! tracer physics or chemistry to the tracers from this file.
Expand Down

0 comments on commit 6e115b7

Please sign in to comment.