Skip to content

Commit

Permalink
Merge branch 'mark-petersen/ocn/redi-closure-equal-gm' into next (PR #…
Browse files Browse the repository at this point in the history
…4904)

Add ocean option for Redi kappa to be set equal to GM

Brings in a new option to config_Redi_closure, 'equalGM', that sets
RediKappa equal to gmBolusKappa everywhere.
Default remains config_Redi_closure = 'constant'.

[BFB]
  • Loading branch information
jonbob committed Jun 1, 2022
2 parents 9b1361f + 015f392 commit d533b43
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -404,9 +404,9 @@ Default: Defined in namelist_defaults.xml

<entry id="config_Redi_closure" type="char*1024"
category="Redi_isopycnal_mixing" group="Redi_isopycnal_mixing">
Control what type of function is used for Redi $\kappa$.
Control what type of function is used for Redi $\kappa$. For 'equalGM', RediKappa is set to gmBolusKappa, so picks up the closure used by GM. Note that equalGM should only be used with 2D GM schemes (e.g. config_GM_closure=constant or Visbeck), not with EdenGreatbatch.

Valid values: 'constant', 'data'
Valid values: 'constant', 'equalGM', 'data'
Default: Defined in namelist_defaults.xml
</entry>

Expand Down
4 changes: 2 additions & 2 deletions components/mpas-ocean/src/Registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,8 @@
possible_values=".true. or .false."
/>
<nml_option name="config_Redi_closure" type="character" default_value="constant" units="unitless"
description="Control what type of function is used for Redi $\kappa$."
possible_values="'constant', 'data'"
description="Control what type of function is used for Redi $\kappa$. For 'equalGM', RediKappa is set to gmBolusKappa, so picks up the closure used by GM. Note that equalGM should only be used with 2D GM schemes (e.g. config_GM_closure=constant or Visbeck), not with EdenGreatbatch."
possible_values="'constant', 'equalGM', 'data'"
/>
<nml_option name="config_Redi_constant_kappa" type="real" default_value="600.0" units="m^2 s^{-1}"
description="The Redi diffusion coefficient. Only used when config_Redi_closure = 'constant'."
Expand Down
14 changes: 13 additions & 1 deletion components/mpas-ocean/src/shared/mpas_ocn_gm.F
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,19 @@ subroutine ocn_GM_compute_Bolus_velocity(statePool, &
deallocate (RossbyRadiusTaper)
end if

if (config_Redi_closure == 'constant'.and. &
if (config_Redi_closure == 'equalGM') then
! Set Redi closure to be the same as the GM closure, i.e. if
! config_GM_closure is EdenGreatbatch or Visbeck, you will see those
! same closure fields in RediKappa. The horizontal tapering still
! comes from the config_Redi_horizontal_taper flag, not GM.
!$omp parallel
!$omp do schedule(runtime)
do iEdge=1, nEdges
RediKappa(iEdge) = gmHorizontalTaper(iEdge) * gmBolusKappa(iEdge)
end do
!$omp end do
!$omp end parallel
else if (config_Redi_closure == 'constant'.and. &
config_Redi_horizontal_taper == 'RossbyRadius') then
!$omp parallel
!$omp do schedule(runtime)
Expand Down
5 changes: 4 additions & 1 deletion components/mpas-ocean/src/shared/mpas_ocn_tracer_hmix_redi.F
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,10 @@ subroutine ocn_tracer_hmix_Redi_init(domain, err)!{{{


! initialize Redi kappa array
if (config_Redi_closure == 'constant') then
if (config_Redi_closure == 'constant'.or. &
config_Redi_closure == 'equalGM') then
! For 'equalGM' RediKappa is updated every step. Just
! initialize here.
!$omp parallel
!$omp do schedule(runtime)
do iEdge = 1, nEdges
Expand Down

0 comments on commit d533b43

Please sign in to comment.