Skip to content

Commit

Permalink
Merge pull request #1438 from Hallberg-NOAA/adiabatic_checks
Browse files Browse the repository at this point in the history
Flag inconsistent parameters if ADIABATIC = True
  • Loading branch information
adcroft authored Jul 28, 2021
2 parents bf0b9cd + d76af84 commit 9267708
Showing 1 changed file with 31 additions and 5 deletions.
36 changes: 31 additions & 5 deletions src/parameterizations/vertical/MOM_diabatic_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2745,8 +2745,8 @@ subroutine adiabatic_driver_init(Time, G, param_file, diag, CS, &
type(tracer_flow_control_CS), pointer :: tracer_flow_CSp !< pointer to control structure of the
!! tracer flow control module

! This "include" declares and sets the variable "version".
#include "version_variable.h"
! This "include" declares and sets the variable "version".
# include "version_variable.h"
character(len=40) :: mdl = "MOM_diabatic_driver" ! This module's name.

if (associated(CS)) then
Expand All @@ -2758,10 +2758,35 @@ subroutine adiabatic_driver_init(Time, G, param_file, diag, CS, &
CS%diag => diag
if (associated(tracer_flow_CSp)) CS%tracer_flow_CSp => tracer_flow_CSp

! Set default, read and log parameters
! Set default, read and log parameters
call log_version(param_file, mdl, version, &
"The following parameters are used for diabatic processes.")

! Check for any subsidiary parameters that are inconsistent with the adiabatic mode.
call get_param(param_file, mdl, "SPONGE", CS%use_sponge, &
"If true, sponges may be applied anywhere in the domain. "//&
"The exact location and properties of those sponges are "//&
"specified via calls to initialize_sponge and possibly "//&
"set_up_sponge_field.", default=.false., do_not_log=.true.)
call get_param(param_file, mdl, "ENERGETICS_SFC_PBL", CS%use_energetic_PBL, &
"If true, use an implied energetics planetary boundary "//&
"layer scheme to determine the diffusivity and viscosity "//&
"in the surface boundary layer.", default=.false., do_not_log=.true.)
call get_param(param_file, mdl, "USE_KPP", CS%use_KPP, &
"If true, turns on the [CVMix] KPP scheme of Large et al., 1994, "//&
"to calculate diffusivities and non-local transport in the OBL.", &
default=.false., do_not_log=.true.)

if (CS%use_sponge) call MOM_error(WARNING, &
"When ADIABATIC = True, it is inconsistent to set SPONGE = True.")
if (CS%use_energetic_PBL) call MOM_error(WARNING, &
"When ADIABATIC = True, it is inconsistent to set ENERGETICS_SFC_PBL = True.")
if (CS%use_KPP) call MOM_error(WARNING, &
"When ADIABATIC = True, it is inconsistent to set USE_KPP = True.")

if (CS%use_sponge .or. CS%use_energetic_PBL .or. CS%use_KPP) &
call MOM_error(FATAL, "adiabatic_driver_init is aborting due to inconsistent parameter settings.")

end subroutine adiabatic_driver_init


Expand All @@ -2785,13 +2810,14 @@ subroutine diabatic_driver_init(Time, G, GV, US, param_file, useALEalgorithm, di
type(sponge_CS), pointer :: sponge_CSp !< pointer to the sponge module control structure
type(ALE_sponge_CS), pointer :: ALE_sponge_CSp !< pointer to the ALE sponge module control structure

! Local variables
real :: Kd ! A diffusivity used in the default for other tracer diffusivities, in MKS units [m2 s-1]
integer :: num_mode
logical :: use_temperature
character(len=20) :: EN1, EN2, EN3

! This "include" declares and sets the variable "version".
#include "version_variable.h"
! This "include" declares and sets the variable "version".
# include "version_variable.h"
character(len=40) :: mdl = "MOM_diabatic_driver" ! This module's name.
character(len=48) :: thickness_units
character(len=40) :: var_name
Expand Down

0 comments on commit 9267708

Please sign in to comment.