Skip to content

Commit

Permalink
Implement FB_LTS local time-stepping scheme for single layer MPAS-O
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy-lilly committed Mar 1, 2024
1 parent c8208a4 commit 5263736
Show file tree
Hide file tree
Showing 9 changed files with 2,010 additions and 8 deletions.
16 changes: 15 additions & 1 deletion components/mpas-ocean/src/Registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@
/>
<nml_option name="config_time_integrator" type="character" default_value="split_explicit_ab2"
description="Time integration method."
possible_values="'split_explicit', 'RK4', 'unsplit_explicit', 'split_implicit', 'LTS', 'split_explicit_ab2'"
possible_values="'split_explicit', 'RK4', 'unsplit_explicit', 'split_implicit', 'LTS', 'FB_LTS', 'split_explicit_ab2'"
/>
<nml_option name="config_number_of_time_levels" type="integer" default_value="2"
description="The number of time levels in the time-stepping scheme. This is used for array allocation."
Expand Down Expand Up @@ -1196,6 +1196,20 @@
possible_values="Any positive integer greater than or equal to one. A value of one employs the same dt in all regions."
/>
</nml_record>
<nml_record name="forward_backward" mode="forward">
<nml_option name="config_fb_weight_1" type="real" default_value="0.531"
description="The forward-backward weight for the first stage of FB-RK(3,2), used in FB_LTS."
possible_values="Any positive real number less than or equal to one."
/>
<nml_option name="config_fb_weight_2" type="real" default_value="0.531"
description="The forward-backward weight for the second stage of FB-RK(3,2), used in FB_LTS."
possible_values="Any positive real number less than or equal to one."
/>
<nml_option name="config_fb_weight_3" type="real" default_value="0.313"
description="The forward-backward weight for the third stage of FB-RK(3,2), used in FB_LTS."
possible_values="Any positive real number less than or equal to one."
/>
</nml_record>
<nml_record name="pressure_gradient" mode="forward">
<nml_option name="config_pressure_gradient_type" type="character" default_value="pressure_and_zmid"
description="Form of pressure gradient terms in momentum equation. For most applications, the gradient of pressure and layer mid-depth are appropriate. For isopycnal coordinates, one may use the gradient of the Montgomery potential. The sea surface height gradient (ssh_gradient) option is for barotropic, depth-averaged pressure."
Expand Down
9 changes: 8 additions & 1 deletion components/mpas-ocean/src/mode_forward/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@ OBJS = mpas_ocn_forward_mode.o \
mpas_ocn_time_integration_si.o \
mpas_ocn_time_integration_split.o \
mpas_ocn_time_integration_lts.o \
mpas_ocn_time_integration_fblts.o \
mpas_ocn_time_integration_split_ab2.o

all: forward_mode

forward_mode: $(OBJS)

mpas_ocn_time_integration.o: mpas_ocn_time_integration_rk4.o mpas_ocn_time_integration_si.o mpas_ocn_time_integration_split.o mpas_ocn_time_integration_lts.o mpas_ocn_time_integration_split_ab2.o
mpas_ocn_time_integration.o: mpas_ocn_time_integration_rk4.o \
mpas_ocn_time_integration_si.o \
mpas_ocn_time_integration_split.o \
mpas_ocn_time_integration_lts.o \
mpas_ocn_time_integration_fblts.o \
mpas_ocn_time_integration_split_ab2.o

mpas_ocn_time_integration_rk4.o:

Expand All @@ -27,6 +33,7 @@ mpas_ocn_forward_mode.o: mpas_ocn_time_integration.o \
mpas_ocn_time_integration_si.o \
mpas_ocn_time_integration_split.o \
mpas_ocn_time_integration_lts.o \
mpas_ocn_time_integration_fblts.o \
mpas_ocn_time_integration_split_ab2.o

clean:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ module ocn_time_integration
use ocn_time_integration_split
use ocn_time_integration_si
use ocn_time_integration_lts
use ocn_time_integration_fblts
use ocn_time_integration_split_ab2


Expand Down Expand Up @@ -72,7 +73,8 @@ module ocn_time_integration
timeIntSemiImplicit = 3, &! Semi-implicit
timeIntRK4 = 4, &! 4th-order Runge-Kutta
timeIntLTS = 5, &! local time-stepping
timeIntSplitExplicitAB2 = 6 ! split-explicit AB2 baroclinic
timeIntFBLTS = 6, &! forward-backward lts
timeIntSplitExplicitAB2 = 7 ! split-explicit AB2 baroclinic

!***********************************************************************

Expand Down Expand Up @@ -136,6 +138,8 @@ subroutine ocn_timestep(domain, dt, timeStamp)!{{{
call ocn_time_integrator_rk4(domain, dt)
case (timeIntLTS)
call ocn_time_integrator_lts(domain, dt)
case (timeIntFBLTS)
call ocn_time_integrator_fblts(domain, dt)
case (timeIntSplitExplicitAB2)
call ocn_time_integrator_split_ab2(domain, dt)
end select
Expand Down Expand Up @@ -232,6 +236,10 @@ subroutine ocn_timestep_init(domain, dt, err)!{{{
case ('LTS')
timeIntegratorChoice = timeIntLTS
call ocn_time_integration_lts_init(domain)

case ('FB_LTS')
timeIntegratorChoice = timeIntFBLTS
call ocn_time_integration_fblts_init(domain)

case ('split_explicit_ab2')
timeIntegratorChoice = timeIntSplitExplicitAB2
Expand Down
Loading

0 comments on commit 5263736

Please sign in to comment.