Skip to content

Commit

Permalink
Merge branch 'dev/ncar' into double_diffusion_cvmix
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavo-marques committed May 22, 2018
2 parents 70d88e4 + 4f5dee8 commit 1e6cb67
Show file tree
Hide file tree
Showing 3 changed files with 1,680 additions and 4 deletions.
18 changes: 16 additions & 2 deletions src/core/MOM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ module MOM
use MOM_ALE, only : ALE_getCoordinate, ALE_getCoordinateUnits, ALE_writeCoordinateFile
use MOM_ALE, only : ALE_updateVerticalGridType, ALE_remap_init_conds, ALE_register_diags
use MOM_boundary_update, only : call_OBC_register, OBC_register_end, update_OBC_CS
use MOM_legacy_diabatic_driver,only : legacy_diabatic
use MOM_diabatic_driver, only : diabatic, diabatic_driver_init, diabatic_CS
use MOM_diabatic_driver, only : adiabatic, adiabatic_driver_init, diabatic_driver_end
use MOM_diagnostics, only : calculate_diagnostic_fields, MOM_diagnostics_init
Expand Down Expand Up @@ -197,6 +198,9 @@ module MOM

logical :: adiabatic !< If true, there are no diapycnal mass fluxes, and no calls
!! to routines to calculate or apply diapycnal fluxes.
logical :: use_legacy_diabatic_driver!< If true (default), use the a legacy version of the
!! diabatic subroutine. This is temporary and is needed
!! to avoid change in answers.
logical :: diabatic_first !< If true, apply diabatic and thermodynamic
!! processes before time stepping the dynamics.
logical :: use_ALE_algorithm !< If true, use the ALE algorithm rather than layered
Expand Down Expand Up @@ -1151,8 +1155,14 @@ subroutine step_MOM_thermo(CS, G, GV, u, v, h, tv, fluxes, dtdia, &
endif

call cpu_clock_begin(id_clock_diabatic)
call diabatic(u, v, h, tv, CS%Hml, fluxes, CS%visc, CS%ADp, CS%CDp, &
dtdia, Time_end_thermo, G, GV, CS%diabatic_CSp, Waves=Waves)
if (CS%use_legacy_diabatic_driver) then
! the following subroutine is legacy and will be deleted in the near future.
call legacy_diabatic(u, v, h, tv, CS%Hml, fluxes, CS%visc, CS%ADp, CS%CDp, &
dtdia, Time_end_thermo, G, GV, CS%diabatic_CSp, Waves=Waves)
else
call diabatic(u, v, h, tv, CS%Hml, fluxes, CS%visc, CS%ADp, CS%CDp, &
dtdia, Time_end_thermo, G, GV, CS%diabatic_CSp, Waves=Waves)
endif
fluxes%fluxes_used = .true.
call cpu_clock_end(id_clock_diabatic)

Expand Down Expand Up @@ -1627,6 +1637,10 @@ subroutine initialize_MOM(Time, Time_init, param_file, dirs, CS, restart_CSp, &
"true. This assumes that KD = KDML = 0.0 and that \n"//&
"there is no buoyancy forcing, but makes the model \n"//&
"faster by eliminating subroutine calls.", default=.false.)
call get_param(param_file, "MOM", "USE_LEGACY_DIABATIC_DRIVER", CS%use_legacy_diabatic_driver, &
"If true, use the a legacy version of the diabatic subroutine. \n"//&
"This is temporary and is needed avoid change in answers.", &
default=.true.)
call get_param(param_file, "MOM", "DO_DYNAMICS", CS%do_dynamics, &
"If False, skips the dynamics calls that update u & v, as well as \n"//&
"the gravity wave adjustment to h. This is a fragile feature and \n"//&
Expand Down
6 changes: 4 additions & 2 deletions src/parameterizations/vertical/MOM_diabatic_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ module MOM_diabatic_driver
public adiabatic_driver_init

!> Control structure for this module
type, public:: diabatic_CS ; private
! GMM, I've made the following type public so it work with the legacy version of
! diabatic. This type should be made private once the legacy code is deleted.
!type, public:: diabatic_CS; private
type, public:: diabatic_CS
logical :: bulkmixedlayer !< If true, a refined bulk mixed layer is used with
!! nkml sublayers (and additional buffer layers).
logical :: use_energetic_PBL !< If true, use the implicit energetics planetary
Expand Down Expand Up @@ -1924,7 +1927,6 @@ subroutine diabatic_driver_init(Time, G, GV, param_file, useALEalgorithm, diag,
! Set default, read and log parameters
call log_version(param_file, mod, version, &
"The following parameters are used for diabatic processes.")

call get_param(param_file, mod, "SPONGE", CS%use_sponge, &
"If true, sponges may be applied anywhere in the domain. \n"//&
"The exact location and properties of those sponges are \n"//&
Expand Down
Loading

0 comments on commit 1e6cb67

Please sign in to comment.