engine_step Subroutine

public 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).

Arguments

Type IntentOptional 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

Calls

proc~~engine_step~~CallsGraph proc~engine_step engine_step proc~constant_update ocean_boundary_data_constant_t%constant_update proc~engine_step->proc~constant_update proc~ocean_data_forcing_apply ocean_data_forcing_apply proc~engine_step->proc~ocean_data_forcing_apply proc~ocean_data_input_update_all ocean_data_input_update_all proc~engine_step->proc~ocean_data_input_update_all proc~ocean_dyn_step ocean_dyn_step proc~engine_step->proc~ocean_dyn_step proc~ocean_dyn_step_split ocean_dyn_step_split proc~engine_step->proc~ocean_dyn_step_split proc~ocean_porous_refresh ocean_porous_refresh proc~engine_step->proc~ocean_porous_refresh proc~ocean_sponge_refresh_target ocean_sponge_refresh_target proc~engine_step->proc~ocean_sponge_refresh_target proc~profiler_start profiler_start proc~engine_step->proc~profiler_start proc~profiler_stop profiler_stop proc~engine_step->proc~profiler_stop proc~ocean_data_input_update_2d ocean_data_input_update_2d proc~ocean_data_forcing_apply->proc~ocean_data_input_update_2d proc~ocean_seam_refresh_surface_stress ocean_seam_refresh_surface_stress proc~ocean_data_forcing_apply->proc~ocean_seam_refresh_surface_stress proc~data_input_refresh_brackets data_input_refresh_brackets proc~ocean_data_input_update_all->proc~data_input_refresh_brackets proc~apply_velocity_truncation apply_velocity_truncation proc~ocean_dyn_step->proc~apply_velocity_truncation proc~check_h_positive_or_die check_h_positive_or_die proc~ocean_dyn_step->proc~check_h_positive_or_die proc~continuity_tracer_drain continuity_tracer_drain proc~ocean_dyn_step->proc~continuity_tracer_drain proc~copy_field_3d copy_field_3d proc~ocean_dyn_step->proc~copy_field_3d proc~mask_layer_velocities mask_layer_velocities proc~ocean_dyn_step->proc~mask_layer_velocities proc~ocean_dyn_is_thermo_step ocean_dyn_t%ocean_dyn_is_thermo_step proc~ocean_dyn_step->proc~ocean_dyn_is_thermo_step proc~ocean_dyn_is_tracer_advect_step ocean_dyn_t%ocean_dyn_is_tracer_advect_step proc~ocean_dyn_step->proc~ocean_dyn_is_tracer_advect_step proc~ocean_ideal_age_reset_surface ocean_ideal_age_reset_surface proc~ocean_dyn_step->proc~ocean_ideal_age_reset_surface proc~ocean_ideal_age_young_val ocean_ideal_age_young_val proc~ocean_dyn_step->proc~ocean_ideal_age_young_val proc~rk2_average rk2_average proc~ocean_dyn_step->proc~rk2_average proc~rk2_average_field_3d rk2_average_field_3d proc~ocean_dyn_step->proc~rk2_average_field_3d proc~run_stage run_stage proc~ocean_dyn_step->proc~run_stage proc~save_state save_state proc~ocean_dyn_step->proc~save_state proc~vdiff_set_viscous_bbl vdiff_set_viscous_bbl proc~ocean_dyn_step->proc~vdiff_set_viscous_bbl proc~ocean_dyn_step_split->proc~profiler_start proc~ocean_dyn_step_split->proc~profiler_stop interface~ocean_halo_centre ocean_halo_centre proc~ocean_dyn_step_split->interface~ocean_halo_centre proc~ocean_dyn_step_split->proc~apply_velocity_truncation proc~ocean_dyn_step_split->proc~check_h_positive_or_die proc~check_remap_preconditions_or_die check_remap_preconditions_or_die proc~ocean_dyn_step_split->proc~check_remap_preconditions_or_die proc~check_vanished_invariant_or_die check_vanished_invariant_or_die proc~ocean_dyn_step_split->proc~check_vanished_invariant_or_die proc~chksum_state chksum_state proc~ocean_dyn_step_split->proc~chksum_state proc~ocean_dyn_step_split->proc~continuity_tracer_drain proc~ocean_dyn_step_split->proc~copy_field_3d proc~gm_refreshes_varmix gm_refreshes_varmix proc~ocean_dyn_step_split->proc~gm_refreshes_varmix proc~isopycnal_vanish_tol isopycnal_vanish_tol proc~ocean_dyn_step_split->proc~isopycnal_vanish_tol proc~ocean_dyn_step_split->proc~mask_layer_velocities proc~mask_time_mean_velocities mask_time_mean_velocities proc~ocean_dyn_step_split->proc~mask_time_mean_velocities proc~mle_compute_transports mle_compute_transports proc~ocean_dyn_step_split->proc~mle_compute_transports proc~multilayer_enforce_vanished_content multilayer_state_t%multilayer_enforce_vanished_content proc~ocean_dyn_step_split->proc~multilayer_enforce_vanished_content proc~ocean_apply_ale_remap_step ocean_apply_ale_remap_step proc~ocean_dyn_step_split->proc~ocean_apply_ale_remap_step proc~ocean_dyn_step_split->proc~ocean_dyn_is_thermo_step proc~ocean_dyn_step_split->proc~ocean_dyn_is_tracer_advect_step proc~ocean_dyn_therm_dt ocean_dyn_t%ocean_dyn_therm_dt proc~ocean_dyn_step_split->proc~ocean_dyn_therm_dt proc~ocean_dyn_step_split->proc~ocean_ideal_age_reset_surface proc~ocean_dyn_step_split->proc~ocean_ideal_age_young_val proc~ocean_obc_refill_ghost_ssh ocean_obc_refill_ghost_ssh proc~ocean_dyn_step_split->proc~ocean_obc_refill_ghost_ssh proc~ocean_poison_ghost_bands ocean_poison_ghost_bands proc~ocean_dyn_step_split->proc~ocean_poison_ghost_bands proc~ocean_slopes_compute ocean_slopes_compute proc~ocean_dyn_step_split->proc~ocean_slopes_compute proc~p_surf_update_seam p_surf_update_seam proc~ocean_dyn_step_split->proc~p_surf_update_seam proc~probe_ds probe_dS proc~ocean_dyn_step_split->proc~probe_ds proc~redi_calc_coeffs redi_calc_coeffs proc~ocean_dyn_step_split->proc~redi_calc_coeffs proc~reset_vanished_layer_velocities reset_vanished_layer_velocities proc~ocean_dyn_step_split->proc~reset_vanished_layer_velocities proc~restore_state restore_state proc~ocean_dyn_step_split->proc~restore_state proc~ocean_dyn_step_split->proc~rk2_average proc~ocean_dyn_step_split->proc~rk2_average_field_3d proc~run_gm_step run_gm_step proc~ocean_dyn_step_split->proc~run_gm_step proc~run_meke_step run_meke_step proc~ocean_dyn_step_split->proc~run_meke_step proc~run_stage_split run_stage_split proc~ocean_dyn_step_split->proc~run_stage_split proc~ocean_dyn_step_split->proc~save_state proc~tides_update_eta_eq tides_update_eta_eq proc~ocean_dyn_step_split->proc~tides_update_eta_eq proc~tides_update_eta_sal tides_update_eta_sal proc~ocean_dyn_step_split->proc~tides_update_eta_sal proc~varmix_compute varmix_compute proc~ocean_dyn_step_split->proc~varmix_compute proc~ocean_dyn_step_split->proc~vdiff_set_viscous_bbl proc~wavespeed_compute wavespeed_compute proc~ocean_dyn_step_split->proc~wavespeed_compute proc~closed_faces_update_bt_widths closed_faces_update_bt_widths proc~ocean_porous_refresh->proc~closed_faces_update_bt_widths proc~porous_update_face_areas porous_update_face_areas proc~ocean_porous_refresh->proc~porous_update_face_areas proc~refresh_linear_z_impl refresh_linear_z_impl proc~ocean_sponge_refresh_target->proc~refresh_linear_z_impl proc~find_or_create_region find_or_create_region proc~profiler_start->proc~find_or_create_region proc~get_wall_time get_wall_time proc~profiler_start->proc~get_wall_time proc~nvtx_range_push nvtx_range_push proc~profiler_start->proc~nvtx_range_push proc~profiler_stop->proc~get_wall_time proc~nvtx_range_pop nvtx_range_pop proc~profiler_stop->proc~nvtx_range_pop proc~ocean_halo_centre_2d ocean_halo_centre_2d interface~ocean_halo_centre->proc~ocean_halo_centre_2d proc~ocean_halo_centre_3d ocean_halo_centre_3d interface~ocean_halo_centre->proc~ocean_halo_centre_3d local local proc~apply_velocity_truncation->local proc~apply_maxvel_clamp apply_maxvel_clamp proc~apply_velocity_truncation->proc~apply_maxvel_clamp error error proc~check_remap_preconditions_or_die->error proc~ocean_remap_scan_preconditions ocean_remap_scan_preconditions proc~check_remap_preconditions_or_die->proc~ocean_remap_scan_preconditions proc~check_vanished_invariant_or_die->error proc~multilayer_scan_vanished_content multilayer_state_t%multilayer_scan_vanished_content proc~check_vanished_invariant_or_die->proc~multilayer_scan_vanished_content interface~rdb_debug_chksum rdb_debug_chksum proc~chksum_state->interface~rdb_debug_chksum proc~chksum_active chksum_active proc~chksum_state->proc~chksum_active proc~closed_faces_update_bt_widths->local proc~drain_avail_limit drain_avail_limit proc~continuity_tracer_drain->proc~drain_avail_limit proc~drain_avail_scale_x drain_avail_scale_x proc~continuity_tracer_drain->proc~drain_avail_scale_x proc~drain_avail_scale_y drain_avail_scale_y proc~continuity_tracer_drain->proc~drain_avail_scale_y proc~drain_copy_3d drain_copy_3d proc~continuity_tracer_drain->proc~drain_copy_3d proc~drain_fill_conc drain_fill_conc proc~continuity_tracer_drain->proc~drain_fill_conc proc~drain_limit_x drain_limit_x proc~continuity_tracer_drain->proc~drain_limit_x proc~drain_limit_y drain_limit_y proc~continuity_tracer_drain->proc~drain_limit_y proc~drain_parabola_x drain_parabola_x proc~continuity_tracer_drain->proc~drain_parabola_x proc~drain_parabola_y drain_parabola_y proc~continuity_tracer_drain->proc~drain_parabola_y proc~drain_reconstruct_hprev drain_reconstruct_hprev proc~continuity_tracer_drain->proc~drain_reconstruct_hprev proc~drain_rescale_htr drain_rescale_hTr proc~continuity_tracer_drain->proc~drain_rescale_htr proc~drain_rescale_htr_budget drain_rescale_hTr_budget proc~continuity_tracer_drain->proc~drain_rescale_htr_budget proc~drain_subtract_3d drain_subtract_3d proc~continuity_tracer_drain->proc~drain_subtract_3d proc~drain_swept_flux_x drain_swept_flux_x proc~continuity_tracer_drain->proc~drain_swept_flux_x proc~drain_swept_flux_x_weno drain_swept_flux_x_weno proc~continuity_tracer_drain->proc~drain_swept_flux_x_weno proc~drain_swept_flux_y drain_swept_flux_y proc~continuity_tracer_drain->proc~drain_swept_flux_y proc~drain_swept_flux_y_weno drain_swept_flux_y_weno proc~continuity_tracer_drain->proc~drain_swept_flux_y_weno proc~drain_update_h_x drain_update_h_x proc~continuity_tracer_drain->proc~drain_update_h_x proc~drain_update_h_y drain_update_h_y proc~continuity_tracer_drain->proc~drain_update_h_y proc~drain_update_tracer_x drain_update_tracer_x proc~continuity_tracer_drain->proc~drain_update_tracer_x proc~drain_update_tracer_x_budget drain_update_tracer_x_budget proc~continuity_tracer_drain->proc~drain_update_tracer_x_budget proc~drain_update_tracer_y drain_update_tracer_y proc~continuity_tracer_drain->proc~drain_update_tracer_y proc~drain_update_tracer_y_budget drain_update_tracer_y_budget proc~continuity_tracer_drain->proc~drain_update_tracer_y_budget proc~drain_wrap_centre drain_wrap_centre proc~continuity_tracer_drain->proc~drain_wrap_centre proc~drain_wrap_face_x drain_wrap_face_x proc~continuity_tracer_drain->proc~drain_wrap_face_x proc~drain_wrap_face_y drain_wrap_face_y proc~continuity_tracer_drain->proc~drain_wrap_face_y proc~drain_zero_3d drain_zero_3d proc~continuity_tracer_drain->proc~drain_zero_3d proc~ocean_halo_is_decomposed_x ocean_halo_is_decomposed_x proc~continuity_tracer_drain->proc~ocean_halo_is_decomposed_x proc~ocean_halo_is_decomposed_y ocean_halo_is_decomposed_y proc~continuity_tracer_drain->proc~ocean_halo_is_decomposed_y reduce reduce proc~continuity_tracer_drain->reduce proc~data_input_refresh_brackets->error info info proc~data_input_refresh_brackets->info proc~data_input_locate data_input_locate proc~data_input_refresh_brackets->proc~data_input_locate proc~data_input_read_slab_impl data_input_read_slab_impl proc~data_input_refresh_brackets->proc~data_input_read_slab_impl to_string to_string proc~data_input_refresh_brackets->to_string warning warning proc~data_input_refresh_brackets->warning proc~gm_refreshes_varmix->proc~ocean_dyn_is_thermo_step proc~mle_compute_transports->local proc~mle_bodner_timescale mle_bodner_timescale proc~mle_compute_transports->proc~mle_bodner_timescale proc~mle_face_ustar_x mle_face_ustar_x proc~mle_compute_transports->proc~mle_face_ustar_x proc~mle_face_ustar_y mle_face_ustar_y proc~mle_compute_transports->proc~mle_face_ustar_y proc~mle_layer_weights mle_layer_weights proc~mle_compute_transports->proc~mle_layer_weights proc~mle_timescale mle_timescale proc~mle_compute_transports->proc~mle_timescale rdb_vl_is_live rdb_vl_is_live proc~mle_compute_transports->rdb_vl_is_live proc~enforce_vanished_one_impl enforce_vanished_one_impl proc~multilayer_enforce_vanished_content->proc~enforce_vanished_one_impl proc~ocean_apply_ale_remap_step->local proc~build_ts_concentration build_ts_concentration proc~ocean_apply_ale_remap_step->proc~build_ts_concentration proc~ocean_remap_tracer_field ocean_remap_tracer_field proc~ocean_apply_ale_remap_step->proc~ocean_remap_tracer_field proc~ocean_vcoord_compute_target_h ocean_vcoord_t%ocean_vcoord_compute_target_h proc~ocean_apply_ale_remap_step->proc~ocean_vcoord_compute_target_h proc~ocean_vcoord_compute_target_h_rho ocean_vcoord_t%ocean_vcoord_compute_target_h_rho proc~ocean_apply_ale_remap_step->proc~ocean_vcoord_compute_target_h_rho proc~remap_x_face_velocity remap_x_face_velocity proc~ocean_apply_ale_remap_step->proc~remap_x_face_velocity proc~remap_y_face_velocity remap_y_face_velocity proc~ocean_apply_ale_remap_step->proc~remap_y_face_velocity proc~check_fresh check_fresh proc~ocean_data_input_update_2d->proc~check_fresh proc~check_registered check_registered proc~ocean_data_input_update_2d->proc~check_registered proc~data_input_blend_2d_impl data_input_blend_2d_impl proc~ocean_data_input_update_2d->proc~data_input_blend_2d_impl proc~ocean_ideal_age_reset_step ocean_ideal_age_reset_step proc~ocean_ideal_age_reset_surface->proc~ocean_ideal_age_reset_step proc~fill_tracer_ghosts_zerograd fill_tracer_ghosts_zerograd proc~ocean_obc_refill_ghost_ssh->proc~fill_tracer_ghosts_zerograd proc~is_open_ish is_open_ish proc~ocean_obc_refill_ghost_ssh->proc~is_open_ish proc~refill_h_ghost_scaled refill_h_ghost_scaled proc~ocean_obc_refill_ghost_ssh->proc~refill_h_ghost_scaled proc~poison_centre_2d poison_centre_2d proc~ocean_poison_ghost_bands->proc~poison_centre_2d proc~poison_centre_3d poison_centre_3d proc~ocean_poison_ghost_bands->proc~poison_centre_3d proc~poison_face_x_2d poison_face_x_2d proc~ocean_poison_ghost_bands->proc~poison_face_x_2d proc~poison_face_x_3d poison_face_x_3d proc~ocean_poison_ghost_bands->proc~poison_face_x_3d proc~poison_face_y_2d poison_face_y_2d proc~ocean_poison_ghost_bands->proc~poison_face_y_2d proc~poison_face_y_3d poison_face_y_3d proc~ocean_poison_ghost_bands->proc~poison_face_y_3d proc~ocean_seam_refresh_surface_stress->proc~profiler_start proc~ocean_seam_refresh_surface_stress->proc~profiler_stop interface~ocean_halo_face_x ocean_halo_face_x proc~ocean_seam_refresh_surface_stress->interface~ocean_halo_face_x interface~ocean_halo_face_y ocean_halo_face_y proc~ocean_seam_refresh_surface_stress->interface~ocean_halo_face_y proc~ocean_fold_wrap_stress ocean_fold_wrap_stress proc~ocean_seam_refresh_surface_stress->proc~ocean_fold_wrap_stress proc~ocean_seam_refresh_surface_stress->proc~ocean_halo_is_decomposed_x proc~ocean_seam_refresh_surface_stress->proc~ocean_halo_is_decomposed_y proc~ocean_periodic_wrap_face_x_2d ocean_periodic_wrap_face_x_2d proc~ocean_seam_refresh_surface_stress->proc~ocean_periodic_wrap_face_x_2d proc~ocean_periodic_wrap_face_y_2d ocean_periodic_wrap_face_y_2d proc~ocean_seam_refresh_surface_stress->proc~ocean_periodic_wrap_face_y_2d proc~ocean_surface_stress_set_derived ocean_surface_stress_set_derived proc~ocean_seam_refresh_surface_stress->proc~ocean_surface_stress_set_derived proc~oh_count_suppress_off oh_count_suppress_off proc~ocean_seam_refresh_surface_stress->proc~oh_count_suppress_off proc~oh_count_suppress_on oh_count_suppress_on proc~ocean_seam_refresh_surface_stress->proc~oh_count_suppress_on proc~ocean_slopes_compute_impl ocean_slopes_compute_impl proc~ocean_slopes_compute->proc~ocean_slopes_compute_impl proc~p_surf_update_seam_impl p_surf_update_seam_impl proc~p_surf_update_seam->proc~p_surf_update_seam_impl proc~porous_update_face_areas->local proc~clamp_fraction clamp_fraction proc~porous_update_face_areas->proc~clamp_fraction proc~porous_cum_area porous_cum_area proc~porous_update_face_areas->proc~porous_cum_area proc~porous_eta_face porous_eta_face proc~porous_update_face_areas->proc~porous_eta_face proc~redi_calc_coeffs_x redi_calc_coeffs_x proc~redi_calc_coeffs->proc~redi_calc_coeffs_x proc~redi_calc_coeffs_y redi_calc_coeffs_y proc~redi_calc_coeffs->proc~redi_calc_coeffs_y proc~redi_open_windows_x redi_open_windows_x proc~redi_calc_coeffs->proc~redi_open_windows_x proc~redi_open_windows_y redi_open_windows_y proc~redi_calc_coeffs->proc~redi_open_windows_y proc~refresh_linear_z_impl->local proc~run_gm_step->proc~profiler_start proc~run_gm_step->proc~profiler_stop proc~run_gm_step->proc~check_h_positive_or_die proc~run_gm_step->proc~probe_ds proc~compute_w_from_continuity compute_w_from_continuity proc~run_gm_step->proc~compute_w_from_continuity proc~continuity_gm_apply continuity_gm_apply proc~run_gm_step->proc~continuity_gm_apply proc~gm_compute_transports gm_compute_transports proc~run_gm_step->proc~gm_compute_transports proc~ocean_budget_stage_weight ocean_budget_stage_weight proc~run_gm_step->proc~ocean_budget_stage_weight proc~ocean_fold_wrap_state ocean_fold_wrap_state proc~run_gm_step->proc~ocean_fold_wrap_state proc~ocean_halo_exchange_ml_state ocean_halo_exchange_ml_state proc~run_gm_step->proc~ocean_halo_exchange_ml_state proc~run_gm_step->proc~ocean_halo_is_decomposed_x proc~run_gm_step->proc~ocean_halo_is_decomposed_y proc~ocean_periodic_wrap_state ocean_periodic_wrap_state proc~run_gm_step->proc~ocean_periodic_wrap_state proc~tracer_advect_vertical tracer_advect_vertical proc~run_gm_step->proc~tracer_advect_vertical proc~meke_step meke_step proc~run_meke_step->proc~meke_step proc~run_stage->proc~ocean_dyn_is_thermo_step proc~run_stage->proc~ocean_dyn_therm_dt proc~run_stage->proc~ocean_slopes_compute proc~apply_sw_and_restore apply_sw_and_restore proc~run_stage->proc~apply_sw_and_restore proc~run_stage->proc~compute_w_from_continuity proc~continuity_tracer_step_split continuity_tracer_step_split proc~run_stage->proc~continuity_tracer_step_split proc~coriolis_adv_apply_tendencies coriolis_adv_apply_tendencies proc~run_stage->proc~coriolis_adv_apply_tendencies proc~coriolis_adv_compute_tendencies coriolis_adv_compute_tendencies proc~run_stage->proc~coriolis_adv_compute_tendencies proc~ocean_accumulate_mass_out ocean_accumulate_mass_out proc~run_stage->proc~ocean_accumulate_mass_out proc~ocean_bottom_drag_apply_tendencies ocean_bottom_drag_apply_tendencies proc~run_stage->proc~ocean_bottom_drag_apply_tendencies proc~ocean_bottom_drag_compute_tendencies ocean_bottom_drag_compute_tendencies proc~run_stage->proc~ocean_bottom_drag_compute_tendencies proc~ocean_cavity_mass_step ocean_cavity_mass_step proc~run_stage->proc~ocean_cavity_mass_step proc~ocean_channel_drag_apply_tendencies ocean_channel_drag_apply_tendencies proc~run_stage->proc~ocean_channel_drag_apply_tendencies proc~ocean_channel_drag_compute_tendencies ocean_channel_drag_compute_tendencies proc~run_stage->proc~ocean_channel_drag_compute_tendencies proc~ocean_eos_compute ocean_eos_compute proc~run_stage->proc~ocean_eos_compute proc~ocean_geothermal_apply_tracers ocean_geothermal_apply_tracers proc~run_stage->proc~ocean_geothermal_apply_tracers proc~ocean_horizontal_viscosity_apply_tendencies ocean_horizontal_viscosity_apply_tendencies proc~run_stage->proc~ocean_horizontal_viscosity_apply_tendencies proc~ocean_horizontal_viscosity_compute_ke_diss ocean_horizontal_viscosity_compute_ke_diss proc~run_stage->proc~ocean_horizontal_viscosity_compute_ke_diss proc~ocean_horizontal_viscosity_compute_tendencies ocean_horizontal_viscosity_compute_tendencies proc~run_stage->proc~ocean_horizontal_viscosity_compute_tendencies proc~ocean_ideal_age_apply ocean_ideal_age_apply proc~run_stage->proc~ocean_ideal_age_apply proc~ocean_lateral_mix_compute ocean_lateral_mix_compute proc~run_stage->proc~ocean_lateral_mix_compute proc~ocean_pressure_force_apply ocean_pressure_force_apply proc~run_stage->proc~ocean_pressure_force_apply proc~ocean_pressure_force_compute ocean_pressure_force_compute proc~run_stage->proc~ocean_pressure_force_compute proc~ocean_surface_flux_apply_tracers ocean_surface_flux_apply_tracers proc~run_stage->proc~ocean_surface_flux_apply_tracers proc~ocean_surface_stress_apply_tendencies ocean_surface_stress_apply_tendencies proc~run_stage->proc~ocean_surface_stress_apply_tendencies proc~ocean_surface_stress_compute_tendencies ocean_surface_stress_compute_tendencies proc~run_stage->proc~ocean_surface_stress_compute_tendencies proc~ocean_top_drag_apply_tendencies ocean_top_drag_apply_tendencies proc~run_stage->proc~ocean_top_drag_apply_tendencies proc~ocean_top_drag_compute_tendencies ocean_top_drag_compute_tendencies proc~run_stage->proc~ocean_top_drag_compute_tendencies proc~run_stage->proc~tracer_advect_vertical proc~tracer_hdiff tracer_hdiff proc~run_stage->proc~tracer_hdiff proc~vmix_apply_in_stage vmix_apply_in_stage proc~run_stage->proc~vmix_apply_in_stage proc~run_stage_split->proc~profiler_start proc~run_stage_split->proc~profiler_stop proc~run_stage_split->interface~ocean_halo_centre proc~run_stage_split->proc~chksum_state proc~run_stage_split->proc~isopycnal_vanish_tol proc~run_stage_split->proc~mask_layer_velocities proc~run_stage_split->proc~ocean_dyn_is_thermo_step proc~run_stage_split->proc~ocean_dyn_therm_dt proc~run_stage_split->proc~probe_ds proc~run_stage_split->proc~reset_vanished_layer_velocities proc~run_stage_split->interface~ocean_halo_face_x proc~run_stage_split->interface~ocean_halo_face_y proc~accel_visc_rem_reweight accel_visc_rem_reweight proc~run_stage_split->proc~accel_visc_rem_reweight proc~accel_visc_rem_snapshot accel_visc_rem_snapshot proc~run_stage_split->proc~accel_visc_rem_snapshot proc~add_top_drag_into_f_slow add_top_drag_into_F_slow proc~run_stage_split->proc~add_top_drag_into_f_slow proc~apply_bt_correction apply_bt_correction proc~run_stage_split->proc~apply_bt_correction proc~run_stage_split->proc~apply_sw_and_restore proc~barotropic_substep_nonlinear_interior barotropic_substep_nonlinear_interior proc~run_stage_split->proc~barotropic_substep_nonlinear_interior proc~bt_wide_copy_in bt_wide_t%bt_wide_copy_in proc~run_stage_split->proc~bt_wide_copy_in proc~bt_wide_copy_out bt_wide_t%bt_wide_copy_out proc~run_stage_split->proc~bt_wide_copy_out proc~bt_wide_entry_exchange bt_wide_t%bt_wide_entry_exchange proc~run_stage_split->proc~bt_wide_entry_exchange proc~bt_wide_substep bt_wide_substep proc~run_stage_split->proc~bt_wide_substep proc~chksum_bt chksum_bt proc~run_stage_split->proc~chksum_bt proc~chksum_hotface chksum_hotface proc~run_stage_split->proc~chksum_hotface proc~compute_bt_rem compute_bt_rem proc~run_stage_split->proc~compute_bt_rem proc~compute_bt_rem_from_visc_rem compute_bt_rem_from_visc_rem proc~run_stage_split->proc~compute_bt_rem_from_visc_rem proc~compute_bt_rem_wave_drag compute_bt_rem_wave_drag proc~run_stage_split->proc~compute_bt_rem_wave_drag proc~compute_e_anom compute_e_anom proc~run_stage_split->proc~compute_e_anom proc~compute_gtot_faces compute_gtot_faces proc~run_stage_split->proc~compute_gtot_faces proc~compute_h_face_upstream compute_h_face_upstream proc~run_stage_split->proc~compute_h_face_upstream proc~compute_pbce compute_pbce proc~run_stage_split->proc~compute_pbce proc~run_stage_split->proc~coriolis_adv_apply_tendencies proc~run_stage_split->proc~coriolis_adv_compute_tendencies proc~derive_bt_from_layers derive_bt_from_layers proc~run_stage_split->proc~derive_bt_from_layers proc~face_depth_mean_rem_u face_depth_mean_rem_u proc~run_stage_split->proc~face_depth_mean_rem_u proc~face_depth_mean_rem_v face_depth_mean_rem_v proc~run_stage_split->proc~face_depth_mean_rem_v proc~face_depth_mean_u face_depth_mean_u proc~run_stage_split->proc~face_depth_mean_u proc~face_depth_mean_v face_depth_mean_v proc~run_stage_split->proc~face_depth_mean_v proc~ke_probe_sample ke_probe_sample proc~run_stage_split->proc~ke_probe_sample proc~lateral_mix_uses_resoln lateral_mix_uses_resoln proc~run_stage_split->proc~lateral_mix_uses_resoln proc~mask_bt_rem mask_bt_rem proc~run_stage_split->proc~mask_bt_rem proc~meke_backscatter_apply meke_backscatter_apply proc~run_stage_split->proc~meke_backscatter_apply proc~ocean_bc_outer_face_tag ocean_bc_outer_face_tag proc~run_stage_split->proc~ocean_bc_outer_face_tag proc~run_stage_split->proc~ocean_bottom_drag_apply_tendencies proc~run_stage_split->proc~ocean_bottom_drag_compute_tendencies proc~run_stage_split->proc~ocean_cavity_mass_step proc~run_stage_split->proc~ocean_channel_drag_apply_tendencies proc~run_stage_split->proc~ocean_channel_drag_compute_tendencies proc~run_stage_split->proc~ocean_eos_compute proc~run_stage_split->proc~ocean_fold_wrap_state proc~ocean_fold_wrap_time_means ocean_fold_wrap_time_means proc~run_stage_split->proc~ocean_fold_wrap_time_means proc~run_stage_split->proc~ocean_geothermal_apply_tracers proc~ocean_halo_bt_group_2d ocean_halo_bt_group_2d proc~run_stage_split->proc~ocean_halo_bt_group_2d proc~run_stage_split->proc~ocean_halo_exchange_ml_state proc~run_stage_split->proc~ocean_halo_is_decomposed_x proc~run_stage_split->proc~ocean_halo_is_decomposed_y proc~run_stage_split->proc~ocean_horizontal_viscosity_apply_tendencies proc~run_stage_split->proc~ocean_horizontal_viscosity_compute_ke_diss proc~run_stage_split->proc~ocean_horizontal_viscosity_compute_tendencies proc~run_stage_split->proc~ocean_ideal_age_apply proc~run_stage_split->proc~ocean_lateral_mix_compute proc~ocean_obc_any_open_edge ocean_obc_any_open_edge proc~run_stage_split->proc~ocean_obc_any_open_edge proc~ocean_obc_apply_baroclinic ocean_obc_apply_baroclinic proc~run_stage_split->proc~ocean_obc_apply_baroclinic proc~ocean_periodic_wrap_centre_3d ocean_periodic_wrap_centre_3d proc~run_stage_split->proc~ocean_periodic_wrap_centre_3d proc~ocean_periodic_wrap_face_x_3d ocean_periodic_wrap_face_x_3d proc~run_stage_split->proc~ocean_periodic_wrap_face_x_3d proc~ocean_periodic_wrap_face_y_3d ocean_periodic_wrap_face_y_3d proc~run_stage_split->proc~ocean_periodic_wrap_face_y_3d proc~run_stage_split->proc~ocean_periodic_wrap_state proc~run_stage_split->proc~ocean_pressure_force_apply proc~run_stage_split->proc~ocean_pressure_force_compute proc~ocean_sponge_apply ocean_sponge_apply proc~run_stage_split->proc~ocean_sponge_apply proc~ocean_sponge_apply_maps ocean_sponge_apply_maps proc~run_stage_split->proc~ocean_sponge_apply_maps proc~ocean_sponge_apply_tracers ocean_sponge_apply_tracers proc~run_stage_split->proc~ocean_sponge_apply_tracers proc~run_stage_split->proc~ocean_surface_flux_apply_tracers proc~run_stage_split->proc~ocean_surface_stress_apply_tendencies proc~run_stage_split->proc~ocean_surface_stress_compute_tendencies proc~run_stage_split->proc~ocean_top_drag_apply_tendencies proc~run_stage_split->proc~ocean_top_drag_compute_tendencies proc~pgf_free_surface_gravity pgf_free_surface_gravity proc~run_stage_split->proc~pgf_free_surface_gravity proc~print_bt_budget print_bt_budget proc~run_stage_split->proc~print_bt_budget proc~probe_h_vs_eta_residual probe_h_vs_eta_residual proc~run_stage_split->proc~probe_h_vs_eta_residual proc~refresh_tracer_ghosts refresh_tracer_ghosts proc~run_stage_split->proc~refresh_tracer_ghosts proc~reset_bt_rem reset_bt_rem proc~run_stage_split->proc~reset_bt_rem proc~run_continuity_chain run_continuity_chain proc~run_stage_split->proc~run_continuity_chain proc~set_cor_ref_velocity set_cor_ref_velocity proc~run_stage_split->proc~set_cor_ref_velocity proc~set_fast_forcing_eta_pf set_fast_forcing_eta_pf proc~run_stage_split->proc~set_fast_forcing_eta_pf proc~set_local_bt_cont_types set_local_BT_cont_types proc~run_stage_split->proc~set_local_bt_cont_types proc~snapshot_eta_pf snapshot_eta_PF proc~run_stage_split->proc~snapshot_eta_pf proc~subtract_fast_cor_ref subtract_fast_cor_ref proc~run_stage_split->proc~subtract_fast_cor_ref proc~sum_slow_tendencies_into_f_slow sum_slow_tendencies_into_F_slow proc~run_stage_split->proc~sum_slow_tendencies_into_f_slow proc~visc_rem_precompute visc_rem_precompute proc~run_stage_split->proc~visc_rem_precompute proc~run_stage_split->proc~vmix_apply_in_stage proc~tides_update_eta_eq_impl tides_update_eta_eq_impl proc~tides_update_eta_eq->proc~tides_update_eta_eq_impl proc~tides_update_eta_sal_impl tides_update_eta_sal_impl proc~tides_update_eta_sal->proc~tides_update_eta_sal_impl proc~varmix_compute_impl varmix_compute_impl proc~varmix_compute->proc~varmix_compute_impl proc~bbl_column_conc_impl bbl_column_conc_impl proc~vdiff_set_viscous_bbl->proc~bbl_column_conc_impl proc~bbl_faces_impl bbl_faces_impl proc~vdiff_set_viscous_bbl->proc~bbl_faces_impl proc~wavespeed_compute_impl wavespeed_compute_impl proc~wavespeed_compute->proc~wavespeed_compute_impl

Called by

proc~~engine_step~~CalledByGraph proc~engine_step engine_step proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~engine_step proc~rdb_ocean_step rdb_ocean_step proc~rdb_ocean_step->proc~engine_step proc~driver_run driver_run proc~driver_run->proc~driver_run_ocean

Source Code

   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