<p><b>duda</b> 2010-05-10 18:31:59 -0600 (Mon, 10 May 2010)</p><p>BRANCH COMMIT<br>
<br>
The MPAS_DYN_RUN routine should actually advance the dynamical state by one *physics*<br>
timestep rather than by one dynamics timestep. Accordingly, add a dynamics subcycling<br>
loop around the calls in MPAS_DYN_RUN. The number of dynamics timesteps per physics<br>
timestep is computed based on the supplied physics timestep and the dynamics timestep<br>
from the namelist as<br>
<br>
n_subcycle_steps = ceiling(dt_physics / config_dt)<br>
<br>
and the dynamics timestep is (possibly) adjusted to evenly divide the physics timestep<br>
while not exceeding the namelist value using<br>
<br>
dt_dynamics = dt_physics / n_subcycle_steps<br>
<br>
Also, in the test driver, set dt_physics = 1800, which is a typical value used by CAM.<br>
<br>
<br>
M src/driver_cam_interface/module_mpas_cam_interface.F<br>
M src/driver_cam_interface/test_driver.F<br>
</p><hr noshade><pre><font color="gray">Modified: branches/mpas_cam_coupling/src/driver_cam_interface/module_mpas_cam_interface.F
===================================================================
--- branches/mpas_cam_coupling/src/driver_cam_interface/module_mpas_cam_interface.F        2010-05-10 20:43:52 UTC (rev 262)
+++ branches/mpas_cam_coupling/src/driver_cam_interface/module_mpas_cam_interface.F        2010-05-11 00:31:59 UTC (rev 263)
@@ -10,8 +10,8 @@
type (dm_info), pointer :: dminfo
type (domain_type), pointer :: domain
- real (kind=RKIND) :: dt, dt_physics, p0
- integer :: itimestep
+ real (kind=RKIND) :: dt_dynamics, dt_physics, p0
+ integer :: itimestep, n_subcycle_steps
contains
@@ -54,10 +54,8 @@
! Set physics timestep and verify that it is evenly divided by dynamics timestep
!
dt_physics = phys_dt
- if (mod(dt_physics, config_dt) /= 0.) then
- write(0,*) 'Error: physics timestep does not evenly divide dynamics timestep'
- return
- end if
+ dt_dynamics = dt_physics / ceiling(dt_physics / config_dt)
+ n_subcycle_steps = ceiling(dt_physics / config_dt)
call allocate_domain(domain, dminfo)
@@ -577,13 +575,12 @@
type (block_type), pointer :: block_ptr
- dt = config_dt
! Compute diagnostic fields needed in solve loop, and initialize
! simulation time to 0 for all blocks
block_ptr => domain % blocklist
do while (associated(block_ptr))
- call mpas_init(block_ptr, block_ptr % mesh, dt)
+ call mpas_init(block_ptr, block_ptr % mesh, dt_dynamics)
block_ptr => block_ptr % next
end do
@@ -837,14 +834,19 @@
implicit none
+ integer :: idynstep
+
write(0,*) 'Called MPAS_DYN_RUN'
itimestep = 1
- call mpas_timestep(domain, itimestep, dt)
- ! Move time level 2 fields back into time level 1 for next time step
- call shift_time_levels(domain)
+ do idynstep=1,n_subcycle_steps
+ call mpas_timestep(domain, itimestep, dt_dynamics)
+ ! Move time level 2 fields back into time level 1 for next time step
+ call shift_time_levels(domain)
+ end do
+
end subroutine mpas_dyn_run
Modified: branches/mpas_cam_coupling/src/driver_cam_interface/test_driver.F
===================================================================
--- branches/mpas_cam_coupling/src/driver_cam_interface/test_driver.F        2010-05-10 20:43:52 UTC (rev 262)
+++ branches/mpas_cam_coupling/src/driver_cam_interface/test_driver.F        2010-05-11 00:31:59 UTC (rev 263)
@@ -47,7 +47,7 @@
0.620120200, 0.723535500, 0.817676800, 0.896215300, &
0.953476103, 0.985112200, 1.000000000 /
- phys_dt = 10800.
+ phys_dt = 1800.
do k=1,26
Ac(k) = 0.5*(Ae(k) + Ae(k+1))
</font>
</pre>