Skip to content

Commit

Permalink
Introduce MARBL_IC_MIN_VAL for testing
Browse files Browse the repository at this point in the history
The dimensional scaling tests fail if the MARBL tracer concentrations are very
very small (O(1e-300)); this can be avoided by setting the minimum tracer value
to be 1e-100 instead of 0. We don't want to do this for production runs,
though, so the default for this parameter is still 0.
  • Loading branch information
mnlevy1981 committed Apr 11, 2024
1 parent e70b913 commit 1dae9e0
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/tracer/MARBL_tracers.F90
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ module MARBL_tracers
logical :: use_ice_category_fields !< Forcing will include multiple ice categories for ice_frac and shortwave
logical :: request_Chl_from_MARBL !< MARBL can provide Chl to use in set_pen_shortwave()
integer :: ice_ncat !< Number of ice categories when use_ice_category_fields = True
real :: IC_min !< Minimum value for tracer initial conditions
character(len=200) :: IC_file !< The file in which the age-tracer initial values cam be found.
logical :: ongrid !< True if IC_file is already interpolated to MOM grid
type(tracer_registry_type), pointer :: tr_Reg => NULL() !< A pointer to the tracer registry
Expand Down Expand Up @@ -309,9 +310,11 @@ subroutine configure_MARBL_tracers(GV, US, param_file, CS)

! (1) Read parameters necessary for general setup of MARBL
call log_version(param_file, mdl, version, "")
call get_param(param_file, mdl, "DEBUG", CS%debug, &
"If true, write out verbose debugging data.", &
default=.false., debuggingParam=.true.)
call get_param(param_file, mdl, "DEBUG", CS%debug, "If true, write out verbose debugging data.", &
default=.false., debuggingParam=.true.)
call get_param(param_file, mdl, "MARBL_IC_MIN_VAL", CS%IC_min, &
"Minimum value of tracer initial conditions (set to 1e-100 for dim scaling tests)", &
default=0., units="tracer units")
call get_param(param_file, mdl, "MARBL_SETTINGS_FILE", CS%marbl_settings_file, &
"The name of a file from which to read the run-time settings for MARBL.", default="marbl_in")
call get_param(param_file, mdl, "BOT_FLUX_MIX_THICKNESS", CS%bot_flux_mix_thickness, &
Expand Down Expand Up @@ -902,8 +905,8 @@ subroutine initialize_MARBL_tracers(restart, day, G, GV, US, h, param_file, diag
do k=1,GV%ke
do j=G%jsc, G%jec
do i=G%isc, G%iec
! Set negative tracer concentrations to 0
if (CS%tracer_data(m)%tr(i,j,k) < 0) CS%tracer_data(m)%tr(i,j,k) = 0.
! Ensure tracer concentrations are at / above minimum value
if (CS%tracer_data(m)%tr(i,j,k) < CS%IC_min) CS%tracer_data(m)%tr(i,j,k) = CS%IC_min
enddo
enddo
enddo
Expand Down

0 comments on commit 1dae9e0

Please sign in to comment.