Advance one outer step at fixed dt, starting from simulation
time t (consumed by tide/astro forcing inside
ocean_dyn_step_split; the caller advances its own
t_current by dt afterwards — see the module docstring for
what stays caller-side). Wraps ocean_dyn_step_split
(rdb_ocean_dyn.F90:1986) plus the per-step halves of the
setup stages that must run BEFORE the dyn-core advance:
file-forcing update/apply, boundary-data refresh, porous-area
refresh.
Split from engine_step_finalize (surface-flux component
assembly + the diag-manager step) because
driver_run_ocean’s sea-ice block sits, in the driver’s own
per-step sequence, BETWEEN the dyn-core advance and
ocean_surface_flux_assemble — the assembler reads the
ice-written salt/heat components, so it must run AFTER the ice
block closes (the driver’s own “PR-12 … MUST sit here”
comment). Since engine_step does not itself run the
sea-ice per-step physics, a caller calls engine_step, then
engine_step_ice (P2.4b — no-op when ice is disabled), THEN
engine_step_finalize — exactly driver_run_ocean’s order
(both driver_run_ocean and the C ABI’s rdb_ocean_step
do this now).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(ocean_engine_t), | intent(inout) | :: | engine | |||
| real(kind=wp), | intent(in) | :: | dt | |||
| real(kind=wp), | intent(in) | :: | t | |||
| integer, | intent(out), | optional | :: | ierr |
subroutine engine_step(engine, dt, t, ierr) !! Advance one outer step at fixed `dt`, starting from simulation !! time `t` (consumed by tide/astro forcing inside !! `ocean_dyn_step_split`; the caller advances its own !! `t_current` by `dt` afterwards — see the module docstring for !! what stays caller-side). Wraps `ocean_dyn_step_split` !! (`rdb_ocean_dyn.F90:1986`) plus the per-step halves of the !! setup stages that must run BEFORE the dyn-core advance: !! file-forcing update/apply, boundary-data refresh, porous-area !! refresh. !! !! Split from `engine_step_finalize` (surface-flux component !! assembly + the diag-manager step) because !! `driver_run_ocean`'s sea-ice block sits, in the driver's own !! per-step sequence, BETWEEN the dyn-core advance and !! `ocean_surface_flux_assemble` — the assembler reads the !! ice-written salt/heat components, so it must run AFTER the ice !! block closes (the driver's own "PR-12 ... MUST sit here" !! comment). Since `engine_step` does not itself run the !! sea-ice per-step physics, a caller calls `engine_step`, then !! `engine_step_ice` (P2.4b — no-op when ice is disabled), THEN !! `engine_step_finalize` — exactly `driver_run_ocean`'s order !! (both `driver_run_ocean` and the C ABI's `rdb_ocean_step` !! do this now). type(ocean_engine_t), intent(inout) :: engine real(wp), intent(in) :: dt real(wp), intent(in) :: t integer, intent(out), optional :: ierr if (present(ierr)) ierr = OCEAN_STATUS_OK #ifndef RDB_NO_NETCDF call ocean_data_input_update_all(engine%state%data_input, t) call ocean_data_forcing_apply(engine%state%data_forcing, engine%state%data_input, & engine%grid, engine%state%surface_stress, & engine%state%surface_flux, engine%state%bc, t) #endif call engine%bc_source%update(t, engine%state%bc) call ocean_porous_refresh(engine%grid, engine%state%metrics, engine%state%multilayer) ! PR-23b: rebuild the ANALYTIC sponge target on the live layer ! geometry, once per outer step, beside the porous refresh and ! before the dyn step -- so the whole step relaxes toward the ! geopotential profile that was asked for rather than toward the ! t = 0 layer positions. No-op unless `&ocean_sponge_nml ! target_source = "linear_z"`, so every other configuration is ! bit-identical. call ocean_sponge_refresh_target(engine%grid, engine%state%sponge, & engine%state%multilayer) if (engine%n_inner >= 1) then call ocean_dyn_step_split(engine%grid, engine%state%metrics, engine%state%dyn, & engine%state%eos, & engine%state%coriolis_adv, engine%state%continuity, & engine%state%pressure_force, engine%state%hvisc, & engine%state%bdrag, engine%state%surface_stress, & engine%state%vert_advect, engine%state%hdiff_tracer, & engine%state%vdiff, engine%state%vmix, & engine%state%multilayer, dt, engine%n_inner, & sf=engine%state%surface_flux, & geo=engine%geo, & vcoord=engine%state%vcoord, t=t, & bc=engine%state%bc, sp=engine%state%sponge, & lateral_mix=engine%state%lateral_mix, & epbl=engine%state%epbl, kshear=engine%state%kshear, & mle=engine%state%mle, slopes=engine%state%slopes, & gm=engine%state%gm, varmix=engine%state%varmix, & wavespeed=engine%state%wavespeed, & redi=engine%state%redi, meke=engine%state%meke, & vmix_tidal=engine%state%vmix_tidal, & tides=engine%state%tides, & psurf=engine%state%p_surf, & td=engine%state%tdrag, & cav=engine%state%cavity_flux) else call profiler_start("ocean_dyn_step") call ocean_dyn_step(engine%grid, engine%state%metrics, engine%state%dyn, engine%state%eos, & engine%state%coriolis_adv, engine%state%continuity, & engine%state%pressure_force, engine%state%hvisc, & engine%state%bdrag, engine%state%surface_stress, & engine%state%vert_advect, engine%state%hdiff_tracer, & engine%state%vdiff, engine%state%vmix, & engine%state%multilayer, dt, sf=engine%state%surface_flux, & geo=engine%geo, & lateral_mix=engine%state%lateral_mix, & epbl=engine%state%epbl, kshear=engine%state%kshear, & slopes=engine%state%slopes, & vmix_tidal=engine%state%vmix_tidal, & bc=engine%state%bc, t=t, td=engine%state%tdrag, & cav=engine%state%cavity_flux) call profiler_stop("ocean_dyn_step") end if end subroutine engine_step