engine_step_ice Subroutine

public subroutine engine_step_ice(engine, cfg, dt, t, ierr)

P2.4b: sea-ice per-step physics — ocean-side frazil accumulation, EVP dynamics (every outer step, independent of the thermo cadence: the ice’s own fast/slow split) plus the resulting ice->ocean stress coupling, and, at thermo cadence (engine%state%dyn%is_thermo_step()), category transport followed by the atmospheric-forcing / basal-flux / frazil-uptake / column-thermo / snowfall / brine / heat / shortwave / ITD chain. Transcribed VERBATIM from driver_run_ocean’s former inline sea-ice block — the internal call order is load-bearing (see the “MANDATED ORDER” comment below, itself carried over unchanged) and is NOT reordered here. Returns immediately, a no-op, when &ocean_ice_nml enable = .false. — bit-identical to before this phase.

Call between engine_step and engine_step_finalize — the surface-flux assembler the finalize call runs reads the salt/heat components this routine writes (the driver’s own “PR-12 … MUST sit here” comment), so it must run AFTER this returns. cfg is threaded through (unlike engine_step) because the thermo-forcing knobs this block reads every thermo-cadence step (air_temp/restore_lambda/sw_down/ snowfall/transport/adv_substeps/roll_factor) are read straight from &ocean_ice_nml in the driver too, not cached at setup (unlike evp_params/ic_par, which the config builds once, up front).

Arguments

Type IntentOptional Attributes Name
type(ocean_engine_t), intent(inout) :: engine
type(config_t), intent(in) :: cfg
real(kind=wp), intent(in) :: dt
real(kind=wp), intent(in) :: t

Unused today (the sea-ice block has no direct time dependence — only dt and the therm_dt/thermo-cadence machinery derived from it); present for signature symmetry with engine_step/engine_step_finalize.

integer, intent(out), optional :: ierr

Present for signature symmetry; no failure path in this routine sets it today — ice_transport_step’s conservation/positivity check still error stops, matching the pre-existing driver behaviour verbatim.


Calls

proc~~engine_step_ice~~CallsGraph proc~engine_step_ice engine_step_ice error error proc~engine_step_ice->error proc~halo_allreduce_sum_i8 halo_allreduce_sum_i8 proc~engine_step_ice->proc~halo_allreduce_sum_i8 proc~ice_adjust_categories ice_adjust_categories proc~engine_step_ice->proc~ice_adjust_categories proc~ice_atm_forcing_restoring ice_atm_forcing_restoring proc~engine_step_ice->proc~ice_atm_forcing_restoring proc~ice_compute_basal_flux ice_compute_basal_flux proc~engine_step_ice->proc~ice_compute_basal_flux proc~ice_evp_step ice_evp_step proc~engine_step_ice->proc~ice_evp_step proc~ice_frazil_accumulate ice_frazil_accumulate proc~engine_step_ice->proc~ice_frazil_accumulate proc~ice_frazil_uptake ice_frazil_uptake proc~engine_step_ice->proc~ice_frazil_uptake proc~ice_ocean_brine_flux ice_ocean_brine_flux proc~engine_step_ice->proc~ice_ocean_brine_flux proc~ice_ocean_heat_flux ice_ocean_heat_flux proc~engine_step_ice->proc~ice_ocean_heat_flux proc~ice_ocean_stress_flux ice_ocean_stress_flux proc~engine_step_ice->proc~ice_ocean_stress_flux proc~ice_ocean_sw_flux ice_ocean_sw_flux proc~engine_step_ice->proc~ice_ocean_sw_flux proc~ice_snowfall_ocean_share ice_snowfall_ocean_share proc~engine_step_ice->proc~ice_snowfall_ocean_share proc~ice_thermo_driver_step ice_thermo_driver_step proc~engine_step_ice->proc~ice_thermo_driver_step proc~ice_transport_step ice_transport_step proc~engine_step_ice->proc~ice_transport_step proc~ocean_dyn_is_thermo_step ocean_dyn_t%ocean_dyn_is_thermo_step proc~engine_step_ice->proc~ocean_dyn_is_thermo_step proc~ocean_dyn_therm_dt ocean_dyn_t%ocean_dyn_therm_dt proc~engine_step_ice->proc~ocean_dyn_therm_dt proc~ocean_halo_exchange_ice_fluxes ocean_halo_exchange_ice_fluxes proc~engine_step_ice->proc~ocean_halo_exchange_ice_fluxes proc~ocean_halo_exchange_ice_state ocean_halo_exchange_ice_state proc~engine_step_ice->proc~ocean_halo_exchange_ice_state proc~ocean_halo_is_decomposed ocean_halo_is_decomposed proc~engine_step_ice->proc~ocean_halo_is_decomposed proc~profiler_start profiler_start proc~engine_step_ice->proc~profiler_start proc~profiler_stop profiler_stop proc~engine_step_ice->proc~profiler_stop to_string to_string proc~engine_step_ice->to_string warning warning proc~engine_step_ice->warning allreduce allreduce proc~halo_allreduce_sum_i8->allreduce proc~comm_env_compute_comm comm_env_compute_comm proc~halo_allreduce_sum_i8->proc~comm_env_compute_comm proc~ice_adjust_categories_impl ice_adjust_categories_impl proc~ice_adjust_categories->proc~ice_adjust_categories_impl proc~ice_atm_forcing_restoring_impl ice_atm_forcing_restoring_impl proc~ice_atm_forcing_restoring->proc~ice_atm_forcing_restoring_impl proc~ice_compute_basal_flux_impl ice_compute_basal_flux_impl proc~ice_compute_basal_flux->proc~ice_compute_basal_flux_impl proc~ice_cell_concentration_impl ice_cell_concentration_impl proc~ice_evp_step->proc~ice_cell_concentration_impl proc~ice_evp_dynamics ice_evp_dynamics proc~ice_evp_step->proc~ice_evp_dynamics proc~ocean_halo_is_decomposed_x ocean_halo_is_decomposed_x proc~ice_evp_step->proc~ocean_halo_is_decomposed_x proc~ocean_halo_is_decomposed_y ocean_halo_is_decomposed_y proc~ice_evp_step->proc~ocean_halo_is_decomposed_y proc~ice_frazil_accumulate_impl ice_frazil_accumulate_impl proc~ice_frazil_accumulate->proc~ice_frazil_accumulate_impl proc~ice_frazil_uptake_impl ice_frazil_uptake_impl proc~ice_frazil_uptake->proc~ice_frazil_uptake_impl proc~ice_frazil_uptake_multicat_impl ice_frazil_uptake_multicat_impl proc~ice_frazil_uptake->proc~ice_frazil_uptake_multicat_impl proc~ice_ocean_brine_flux_components_impl ice_ocean_brine_flux_components_impl proc~ice_ocean_brine_flux->proc~ice_ocean_brine_flux_components_impl proc~ice_ocean_brine_flux_impl ice_ocean_brine_flux_impl proc~ice_ocean_brine_flux->proc~ice_ocean_brine_flux_impl proc~ice_ocean_heat_flux_components_impl ice_ocean_heat_flux_components_impl proc~ice_ocean_heat_flux->proc~ice_ocean_heat_flux_components_impl proc~ice_ocean_heat_flux_impl ice_ocean_heat_flux_impl proc~ice_ocean_heat_flux->proc~ice_ocean_heat_flux_impl proc~ice_ocean_stress_flux->proc~ice_cell_concentration_impl proc~ice_ocean_stress_flux_impl ice_ocean_stress_flux_impl proc~ice_ocean_stress_flux->proc~ice_ocean_stress_flux_impl proc~ice_tau_mirror_impl ice_tau_mirror_impl proc~ice_ocean_stress_flux->proc~ice_tau_mirror_impl proc~ocean_seam_refresh_surface_stress ocean_seam_refresh_surface_stress proc~ice_ocean_stress_flux->proc~ocean_seam_refresh_surface_stress proc~ocean_surface_stress_refresh_mag ocean_surface_stress_refresh_mag proc~ice_ocean_stress_flux->proc~ocean_surface_stress_refresh_mag proc~stress_scratch_ensure stress_scratch_ensure proc~ice_ocean_stress_flux->proc~stress_scratch_ensure proc~ice_ocean_sw_flux_add_impl ice_ocean_sw_flux_add_impl proc~ice_ocean_sw_flux->proc~ice_ocean_sw_flux_add_impl proc~ice_ocean_sw_flux_components_impl ice_ocean_sw_flux_components_impl proc~ice_ocean_sw_flux->proc~ice_ocean_sw_flux_components_impl proc~ice_snowfall_ocean_share_impl ice_snowfall_ocean_share_impl proc~ice_snowfall_ocean_share->proc~ice_snowfall_ocean_share_impl proc~ice_fb_part_sum_fill_impl ice_fb_part_sum_fill_impl proc~ice_thermo_driver_step->proc~ice_fb_part_sum_fill_impl proc~ice_snow_part_ocn_fill_impl ice_snow_part_ocn_fill_impl proc~ice_thermo_driver_step->proc~ice_snow_part_ocn_fill_impl proc~ice_thermo_columns ice_thermo_columns proc~ice_thermo_driver_step->proc~ice_thermo_columns proc~ice_thermo_driver_reduce_impl ice_thermo_driver_reduce_impl proc~ice_thermo_driver_step->proc~ice_thermo_driver_reduce_impl proc~ice_thermo_driver_reduce_multicat_impl ice_thermo_driver_reduce_multicat_impl proc~ice_thermo_driver_step->proc~ice_thermo_driver_reduce_multicat_impl proc~ice_transport_step->proc~ice_adjust_categories proc~ice_transport_step->proc~ocean_halo_is_decomposed proc~halo_allreduce_max halo_allreduce_max proc~ice_transport_step->proc~halo_allreduce_max proc~ice_cas_to_ist_impl ice_cas_to_ist_impl proc~ice_transport_step->proc~ice_cas_to_ist_impl proc~ice_compress_impl ice_compress_impl proc~ice_transport_step->proc~ice_compress_impl proc~ice_ist_to_cas_impl ice_ist_to_cas_impl proc~ice_transport_step->proc~ice_ist_to_cas_impl proc~ice_max_speed_impl ice_max_speed_impl proc~ice_transport_step->proc~ice_max_speed_impl proc~ice_pass_x ice_pass_x proc~ice_transport_step->proc~ice_pass_x proc~ice_pass_y ice_pass_y proc~ice_transport_step->proc~ice_pass_y proc~ice_sample_velocity_impl ice_sample_velocity_impl proc~ice_transport_step->proc~ice_sample_velocity_impl proc~ocean_halo_exchange_ice_transport ocean_halo_exchange_ice_transport proc~ice_transport_step->proc~ocean_halo_exchange_ice_transport proc~ocean_halo_is_init ocean_halo_is_init proc~ice_transport_step->proc~ocean_halo_is_init proc~ok_all_ranks ok_all_ranks proc~ice_transport_step->proc~ok_all_ranks proc~ocean_halo_exchange_ice_fluxes->proc~profiler_start proc~ocean_halo_exchange_ice_fluxes->proc~profiler_stop interface~ocean_halo_centre ocean_halo_centre proc~ocean_halo_exchange_ice_fluxes->interface~ocean_halo_centre proc~ocean_fold_wrap_centre_flat ocean_fold_wrap_centre_flat proc~ocean_halo_exchange_ice_fluxes->proc~ocean_fold_wrap_centre_flat proc~oh_count_suppress_off oh_count_suppress_off proc~ocean_halo_exchange_ice_fluxes->proc~oh_count_suppress_off proc~oh_count_suppress_on oh_count_suppress_on proc~ocean_halo_exchange_ice_fluxes->proc~oh_count_suppress_on proc~ocean_halo_exchange_ice_state->proc~profiler_start proc~ocean_halo_exchange_ice_state->proc~profiler_stop proc~ice_halo_centre_flat ice_halo_centre_flat proc~ocean_halo_exchange_ice_state->proc~ice_halo_centre_flat proc~ocean_halo_exchange_ice_state->proc~ocean_fold_wrap_centre_flat proc~ocean_halo_exchange_ice_state->proc~oh_count_suppress_off proc~ocean_halo_exchange_ice_state->proc~oh_count_suppress_on 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 comm_world comm_world proc~comm_env_compute_comm->comm_world proc~halo_allreduce_max->allreduce proc~halo_allreduce_max->proc~comm_env_compute_comm local local proc~ice_adjust_categories_impl->local proc~ice_cas_to_ist_impl->local proc~ice_cell_concentration_impl->local proc~ice_compress_impl->local proc~ice_compress_cell_inline ice_compress_cell_inline proc~ice_compress_impl->proc~ice_compress_cell_inline reduce reduce proc~ice_compress_impl->reduce proc~ice_compute_basal_flux_impl->local proc~eos_freezing_point eos_freezing_point proc~ice_compute_basal_flux_impl->proc~eos_freezing_point proc~ice_evp_dynamics_impl ice_evp_dynamics_impl proc~ice_evp_dynamics->proc~ice_evp_dynamics_impl proc~ice_fb_part_sum_fill_impl->local proc~ice_frazil_accumulate_impl->local proc~ice_frazil_accumulate_impl->proc~eos_freezing_point proc~ice_frazil_uptake_impl->local proc~ice_frazil_uptake_impl->proc~eos_freezing_point proc~ice_frazil_uptake_column ice_frazil_uptake_column proc~ice_frazil_uptake_impl->proc~ice_frazil_uptake_column proc~ice_frazil_uptake_multicat_impl->local proc~ice_frazil_uptake_multicat_impl->proc~eos_freezing_point proc~ice_frazil_uptake_multicat_impl->proc~ice_frazil_uptake_column proc~ice_halo_centre_flat->interface~ocean_halo_centre proc~ice_max_speed_impl->reduce proc~ice_ocean_stress_flux_impl->local proc~ice_cat_flux_x_impl ice_cat_flux_x_impl proc~ice_pass_x->proc~ice_cat_flux_x_impl proc~ice_gather_flux_x_impl ice_gather_flux_x_impl proc~ice_pass_x->proc~ice_gather_flux_x_impl proc~ice_gather_flux_x_layer_impl ice_gather_flux_x_layer_impl proc~ice_pass_x->proc~ice_gather_flux_x_layer_impl proc~ice_mask_snow_by_ice_impl ice_mask_snow_by_ice_impl proc~ice_pass_x->proc~ice_mask_snow_by_ice_impl proc~ice_mass_update_x_impl ice_mass_update_x_impl proc~ice_pass_x->proc~ice_mass_update_x_impl proc~ice_ride_update_x_impl ice_ride_update_x_impl proc~ice_pass_x->proc~ice_ride_update_x_impl proc~ice_ride_update_x_layer_impl ice_ride_update_x_layer_impl proc~ice_pass_x->proc~ice_ride_update_x_layer_impl proc~ice_validity_reduce_impl ice_validity_reduce_impl proc~ice_pass_x->proc~ice_validity_reduce_impl proc~ice_cat_flux_y_impl ice_cat_flux_y_impl proc~ice_pass_y->proc~ice_cat_flux_y_impl proc~ice_gather_flux_y_impl ice_gather_flux_y_impl proc~ice_pass_y->proc~ice_gather_flux_y_impl proc~ice_gather_flux_y_layer_impl ice_gather_flux_y_layer_impl proc~ice_pass_y->proc~ice_gather_flux_y_layer_impl proc~ice_pass_y->proc~ice_mask_snow_by_ice_impl proc~ice_mass_update_y_impl ice_mass_update_y_impl proc~ice_pass_y->proc~ice_mass_update_y_impl proc~ice_ride_update_y_impl ice_ride_update_y_impl proc~ice_pass_y->proc~ice_ride_update_y_impl proc~ice_ride_update_y_layer_impl ice_ride_update_y_layer_impl proc~ice_pass_y->proc~ice_ride_update_y_layer_impl proc~ice_pass_y->proc~ice_validity_reduce_impl proc~ice_snow_part_ocn_fill_impl->local proc~ice_snowfall_ocean_share_impl->local proc~ice_enthalpy_liquid ice_enthalpy_liquid proc~ice_snowfall_ocean_share_impl->proc~ice_enthalpy_liquid proc~ice_thermo_columns->local proc~ice_column_step ice_column_step proc~ice_thermo_columns->proc~ice_column_step proc~ice_thermo_driver_reduce_impl->local proc~ice_thermo_driver_reduce_multicat_impl->local interface~fold_north_centre fold_north_centre proc~ocean_fold_wrap_centre_flat->interface~fold_north_centre interface~ocean_fold_pack ocean_fold_pack proc~ocean_fold_wrap_centre_flat->interface~ocean_fold_pack interface~ocean_fold_unpack ocean_fold_unpack proc~ocean_fold_wrap_centre_flat->interface~ocean_fold_unpack proc~ocean_fold_begin ocean_fold_begin proc~ocean_fold_wrap_centre_flat->proc~ocean_fold_begin proc~ocean_fold_end ocean_fold_end proc~ocean_fold_wrap_centre_flat->proc~ocean_fold_end proc~ocean_fold_exchange ocean_fold_exchange proc~ocean_fold_wrap_centre_flat->proc~ocean_fold_exchange proc~ocean_fold_is_distributed ocean_fold_is_distributed proc~ocean_fold_wrap_centre_flat->proc~ocean_fold_is_distributed proc~ocean_halo_exchange_ice_transport->proc~profiler_start proc~ocean_halo_exchange_ice_transport->proc~profiler_stop proc~ocean_halo_exchange_ice_transport->proc~ice_halo_centre_flat proc~ocean_halo_exchange_ice_transport->proc~ocean_fold_wrap_centre_flat proc~ocean_halo_exchange_ice_transport->proc~oh_count_suppress_off proc~ocean_halo_exchange_ice_transport->proc~oh_count_suppress_on proc~ocean_seam_refresh_surface_stress->proc~profiler_start proc~ocean_seam_refresh_surface_stress->proc~profiler_stop 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_seam_refresh_surface_stress->proc~oh_count_suppress_off proc~ocean_seam_refresh_surface_stress->proc~oh_count_suppress_on 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_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~ocean_surfstress_derived_impl ocean_surfstress_derived_impl proc~ocean_surface_stress_refresh_mag->proc~ocean_surfstress_derived_impl proc~ok_all_ranks->proc~ocean_halo_is_decomposed proc~halo_allreduce_min halo_allreduce_min proc~ok_all_ranks->proc~halo_allreduce_min proc~ice_ocean_stress_cleanup ice_ocean_stress_cleanup proc~stress_scratch_ensure->proc~ice_ocean_stress_cleanup proc~fold_north_centre_2d fold_north_centre_2d interface~fold_north_centre->proc~fold_north_centre_2d proc~fold_north_centre_3d fold_north_centre_3d interface~fold_north_centre->proc~fold_north_centre_3d proc~ocean_fold_pack_2d ocean_fold_pack_2d interface~ocean_fold_pack->proc~ocean_fold_pack_2d proc~ocean_fold_pack_3d ocean_fold_pack_3d interface~ocean_fold_pack->proc~ocean_fold_pack_3d proc~ocean_fold_unpack_2d ocean_fold_unpack_2d interface~ocean_fold_unpack->proc~ocean_fold_unpack_2d proc~ocean_fold_unpack_3d ocean_fold_unpack_3d interface~ocean_fold_unpack->proc~ocean_fold_unpack_3d proc~ocean_halo_face_x_2d ocean_halo_face_x_2d interface~ocean_halo_face_x->proc~ocean_halo_face_x_2d proc~ocean_halo_face_x_3d ocean_halo_face_x_3d interface~ocean_halo_face_x->proc~ocean_halo_face_x_3d proc~ocean_halo_face_y_2d ocean_halo_face_y_2d interface~ocean_halo_face_y->proc~ocean_halo_face_y_2d proc~ocean_halo_face_y_3d ocean_halo_face_y_3d interface~ocean_halo_face_y->proc~ocean_halo_face_y_3d proc~halo_allreduce_min->allreduce proc~halo_allreduce_min->proc~comm_env_compute_comm proc~ice_cat_flux_x_impl->local proc~ppm_cell_limiter ppm_cell_limiter proc~ice_cat_flux_x_impl->proc~ppm_cell_limiter proc~ppm_limit_pos ppm_limit_pos proc~ice_cat_flux_x_impl->proc~ppm_limit_pos proc~ppm_limited_slope ppm_limited_slope proc~ice_cat_flux_x_impl->proc~ppm_limited_slope proc~ppm_mirror_h ppm_mirror_h proc~ice_cat_flux_x_impl->proc~ppm_mirror_h proc~volcfl_face volcfl_face proc~ice_cat_flux_x_impl->proc~volcfl_face proc~ice_cat_flux_y_impl->local proc~ice_cat_flux_y_impl->proc~ppm_cell_limiter proc~ice_cat_flux_y_impl->proc~ppm_limit_pos proc~ice_cat_flux_y_impl->proc~ppm_limited_slope proc~ice_cat_flux_y_impl->proc~ppm_mirror_h proc~ice_cat_flux_y_impl->proc~volcfl_face proc~ice_column_step->proc~ice_enthalpy_liquid proc~ice_bottom_freeze ice_bottom_freeze proc~ice_column_step->proc~ice_bottom_freeze proc~ice_bottom_melt_peel ice_bottom_melt_peel proc~ice_column_step->proc~ice_bottom_melt_peel proc~ice_enth_from_ts ice_enth_from_ts proc~ice_column_step->proc~ice_enth_from_ts proc~ice_optics_csim4 ice_optics_csim4 proc~ice_column_step->proc~ice_optics_csim4 proc~ice_rebalance_layers ice_rebalance_layers proc~ice_column_step->proc~ice_rebalance_layers proc~ice_snow_accumulate ice_snow_accumulate proc~ice_column_step->proc~ice_snow_accumulate proc~ice_snow_ice_flood ice_snow_ice_flood proc~ice_column_step->proc~ice_snow_ice_flood proc~ice_temp_from_en_s ice_temp_from_en_s proc~ice_column_step->proc~ice_temp_from_en_s proc~ice_temp_sis2 ice_temp_sis2 proc~ice_column_step->proc~ice_temp_sis2 proc~ice_top_melt_peel ice_top_melt_peel proc~ice_column_step->proc~ice_top_melt_peel proc~ice_evp_dynamics_impl->interface~ocean_halo_face_x proc~ice_evp_dynamics_impl->interface~ocean_halo_face_y proc~ice_evp_dynamics_impl->proc~ocean_periodic_wrap_face_x_2d proc~ice_evp_dynamics_impl->proc~ocean_periodic_wrap_face_y_2d proc~evp_average_stress_impl evp_average_stress_impl proc~ice_evp_dynamics_impl->proc~evp_average_stress_impl proc~evp_build_masks_impl evp_build_masks_impl proc~ice_evp_dynamics_impl->proc~evp_build_masks_impl proc~evp_copy_u_impl evp_copy_u_impl proc~ice_evp_dynamics_impl->proc~evp_copy_u_impl proc~evp_fill_cell_fields_impl evp_fill_cell_fields_impl proc~ice_evp_dynamics_impl->proc~evp_fill_cell_fields_impl proc~evp_mi_face_impl evp_mi_face_impl proc~ice_evp_dynamics_impl->proc~evp_mi_face_impl proc~evp_pres_mice_impl evp_pres_mice_impl proc~ice_evp_dynamics_impl->proc~evp_pres_mice_impl proc~evp_project_ci_impl evp_project_ci_impl proc~ice_evp_dynamics_impl->proc~evp_project_ci_impl proc~evp_q_and_mi_ratio_impl evp_q_and_mi_ratio_impl proc~ice_evp_dynamics_impl->proc~evp_q_and_mi_ratio_impl proc~evp_sh_dd_dt_impl evp_sh_dd_dt_impl proc~ice_evp_dynamics_impl->proc~evp_sh_dd_dt_impl proc~evp_sh_ds_impl evp_sh_ds_impl proc~ice_evp_dynamics_impl->proc~evp_sh_ds_impl proc~evp_str_s_relax_impl evp_str_s_relax_impl proc~ice_evp_dynamics_impl->proc~evp_str_s_relax_impl proc~evp_stress_relax_impl evp_stress_relax_impl proc~ice_evp_dynamics_impl->proc~evp_stress_relax_impl proc~evp_truncate_final_impl evp_truncate_final_impl proc~ice_evp_dynamics_impl->proc~evp_truncate_final_impl proc~evp_truncate_velocity_impl evp_truncate_velocity_impl proc~ice_evp_dynamics_impl->proc~evp_truncate_velocity_impl proc~evp_u_momentum_impl evp_u_momentum_impl proc~ice_evp_dynamics_impl->proc~evp_u_momentum_impl proc~evp_v_momentum_impl evp_v_momentum_impl proc~ice_evp_dynamics_impl->proc~evp_v_momentum_impl proc~evp_wrap_corner_impl evp_wrap_corner_impl proc~ice_evp_dynamics_impl->proc~evp_wrap_corner_impl proc~evp_zero_massless_velocity_impl evp_zero_massless_velocity_impl proc~ice_evp_dynamics_impl->proc~evp_zero_massless_velocity_impl proc~evp_zero_stress_impl evp_zero_stress_impl proc~ice_evp_dynamics_impl->proc~evp_zero_stress_impl proc~evp_zeta_impl evp_zeta_impl proc~ice_evp_dynamics_impl->proc~evp_zeta_impl proc~ice_limit_stresses ice_limit_stresses proc~ice_evp_dynamics_impl->proc~ice_limit_stresses proc~ocean_periodic_wrap_centre_2d ocean_periodic_wrap_centre_2d proc~ice_evp_dynamics_impl->proc~ocean_periodic_wrap_centre_2d proc~ice_frazil_uptake_column->proc~ice_enthalpy_liquid proc~ice_frazil_uptake_column->proc~ice_enth_from_ts proc~ice_frazil_uptake_column->proc~ice_rebalance_layers proc~ice_t_freeze ice_t_freeze proc~ice_frazil_uptake_column->proc~ice_t_freeze proc~ice_ride_update_x_impl->local proc~ice_ride_update_x_layer_impl->local proc~ice_ride_update_y_impl->local proc~ice_ride_update_y_layer_impl->local proc~ice_validity_reduce_impl->reduce proc~ocean_fold_begin->to_string proc~ocean_fold_begin->warning proc~grow_buffers grow_buffers proc~ocean_fold_begin->proc~grow_buffers proc~ocean_fold_exchange->proc~comm_env_compute_comm comm_irecv_real_sp_array_n comm_irecv_real_sp_array_n proc~ocean_fold_exchange->comm_irecv_real_sp_array_n comm_isend_real_sp_array_n comm_isend_real_sp_array_n proc~ocean_fold_exchange->comm_isend_real_sp_array_n waitall waitall proc~ocean_fold_exchange->waitall proc~ocean_fold_wrap_stress->interface~ocean_fold_pack proc~ocean_fold_wrap_stress->interface~ocean_fold_unpack proc~ocean_fold_wrap_stress->proc~ocean_fold_begin proc~ocean_fold_wrap_stress->proc~ocean_fold_end proc~ocean_fold_wrap_stress->proc~ocean_fold_exchange proc~ocean_fold_wrap_stress->proc~ocean_fold_is_distributed interface~fold_north_u_face fold_north_u_face proc~ocean_fold_wrap_stress->interface~fold_north_u_face interface~fold_north_v_face fold_north_v_face proc~ocean_fold_wrap_stress->interface~fold_north_v_face proc~ocean_halo_centre_2d_impl ocean_halo_centre_2d_impl proc~ocean_halo_centre_2d->proc~ocean_halo_centre_2d_impl proc~oh_count_centre_2d oh_count_centre_2d proc~ocean_halo_centre_2d->proc~oh_count_centre_2d proc~ocean_halo_centre_3d->proc~comm_env_compute_comm proc~ocean_halo_centre_3d->comm_irecv_real_sp_array_n proc~ocean_halo_centre_3d->comm_isend_real_sp_array_n proc~ew_rank_east ew_rank_east proc~ocean_halo_centre_3d->proc~ew_rank_east proc~ew_rank_west ew_rank_west proc~ocean_halo_centre_3d->proc~ew_rank_west proc~needs_flags needs_flags proc~ocean_halo_centre_3d->proc~needs_flags proc~ns_rank_north ns_rank_north proc~ocean_halo_centre_3d->proc~ns_rank_north proc~ns_rank_south ns_rank_south proc~ocean_halo_centre_3d->proc~ns_rank_south proc~ocean_halo_buffers_ensure_nz ocean_halo_buffers_ensure_nz proc~ocean_halo_centre_3d->proc~ocean_halo_buffers_ensure_nz proc~ocean_periodic_wrap_centre_3d ocean_periodic_wrap_centre_3d proc~ocean_halo_centre_3d->proc~ocean_periodic_wrap_centre_3d proc~oh_count_centre_3d oh_count_centre_3d proc~ocean_halo_centre_3d->proc~oh_count_centre_3d proc~oh_count_msgs oh_count_msgs proc~ocean_halo_centre_3d->proc~oh_count_msgs proc~ocean_halo_centre_3d->waitall proc~ocean_surface_stress_set_derived->proc~ocean_surface_stress_refresh_mag proc~ocean_surface_stress_apply_cover ocean_surface_stress_apply_cover proc~ocean_surface_stress_set_derived->proc~ocean_surface_stress_apply_cover proc~ocean_surfstress_derived_impl->local proc~fold_north_u_face_2d fold_north_u_face_2d interface~fold_north_u_face->proc~fold_north_u_face_2d proc~fold_north_u_face_3d fold_north_u_face_3d interface~fold_north_u_face->proc~fold_north_u_face_3d proc~fold_north_v_face_2d fold_north_v_face_2d interface~fold_north_v_face->proc~fold_north_v_face_2d proc~fold_north_v_face_3d fold_north_v_face_3d interface~fold_north_v_face->proc~fold_north_v_face_3d proc~evp_build_masks_impl->local proc~evp_build_masks_impl->proc~ocean_periodic_wrap_centre_2d proc~evp_pres_mice_impl->local proc~evp_project_ci_impl->local proc~evp_q_and_mi_ratio_impl->local proc~ice_evp_mi_ratio_point ice_evp_mi_ratio_point proc~evp_q_and_mi_ratio_impl->proc~ice_evp_mi_ratio_point proc~evp_sh_ds_impl->local proc~evp_str_s_relax_impl->local proc~evp_truncate_final_impl->local proc~evp_truncate_final_impl->reduce proc~evp_truncate_velocity_impl->local proc~evp_u_momentum_impl->local proc~evp_v_momentum_impl->local proc~evp_zero_massless_velocity_impl->local proc~evp_zeta_impl->local proc~decomp_rank_from_coords decomp_rank_from_coords proc~ew_rank_east->proc~decomp_rank_from_coords proc~ew_rank_west->proc~decomp_rank_from_coords proc~ice_enthalpy_liquid_freeze ice_enthalpy_liquid_freeze proc~ice_bottom_melt_peel->proc~ice_enthalpy_liquid_freeze proc~ice_limit_stresses->local proc~ice_optics_csim4->proc~ice_t_freeze proc~ice_temp_sis2->proc~ice_enth_from_ts proc~ice_temp_sis2->proc~ice_t_freeze proc~ice_temp_sis2->proc~ice_temp_from_en_s proc~laytemp_sis2 laytemp_sis2 proc~ice_temp_sis2->proc~laytemp_sis2 proc~update_lay_enth update_lay_enth proc~ice_temp_sis2->proc~update_lay_enth proc~ice_top_melt_peel->proc~ice_enthalpy_liquid_freeze proc~ns_rank_north->proc~decomp_rank_from_coords proc~ns_rank_south->proc~decomp_rank_from_coords proc~ocean_fold_pack_2d->proc~ocean_fold_pack_3d proc~fold_stagger_family fold_stagger_family proc~ocean_fold_pack_3d->proc~fold_stagger_family proc~fold_stagger_nrows fold_stagger_nrows proc~ocean_fold_pack_3d->proc~fold_stagger_nrows proc~ocean_fold_unpack_2d->proc~ocean_fold_unpack_3d proc~ocean_fold_unpack_3d->proc~fold_stagger_family proc~ocean_fold_unpack_3d->proc~fold_stagger_nrows proc~ocean_halo_buffers_ensure_nz->to_string proc~ocean_halo_buffers_ensure_nz->warning proc~ocean_halo_centre_2d_impl->proc~comm_env_compute_comm proc~ocean_halo_centre_2d_impl->comm_irecv_real_sp_array_n proc~ocean_halo_centre_2d_impl->comm_isend_real_sp_array_n proc~ocean_halo_centre_2d_impl->proc~ew_rank_east proc~ocean_halo_centre_2d_impl->proc~ew_rank_west proc~ocean_halo_centre_2d_impl->proc~needs_flags proc~ocean_halo_centre_2d_impl->proc~ns_rank_north proc~ocean_halo_centre_2d_impl->proc~ns_rank_south proc~ocean_halo_centre_2d_impl->proc~ocean_periodic_wrap_centre_2d proc~ocean_halo_centre_2d_impl->proc~oh_count_msgs proc~ocean_halo_centre_2d_impl->waitall proc~ocean_halo_face_x_2d_impl ocean_halo_face_x_2d_impl proc~ocean_halo_face_x_2d->proc~ocean_halo_face_x_2d_impl proc~oh_count_face_x_2d oh_count_face_x_2d proc~ocean_halo_face_x_2d->proc~oh_count_face_x_2d proc~ocean_halo_face_x_3d->proc~comm_env_compute_comm proc~ocean_halo_face_x_3d->comm_irecv_real_sp_array_n proc~ocean_halo_face_x_3d->comm_isend_real_sp_array_n proc~ocean_halo_face_x_3d->proc~ew_rank_east proc~ocean_halo_face_x_3d->proc~ew_rank_west proc~ocean_halo_face_x_3d->proc~needs_flags proc~ocean_halo_face_x_3d->proc~ns_rank_north proc~ocean_halo_face_x_3d->proc~ns_rank_south proc~ocean_halo_face_x_3d->proc~ocean_halo_buffers_ensure_nz proc~ocean_halo_face_x_3d->proc~oh_count_msgs proc~ocean_halo_face_x_3d->waitall proc~ocean_periodic_wrap_face_x_3d ocean_periodic_wrap_face_x_3d proc~ocean_halo_face_x_3d->proc~ocean_periodic_wrap_face_x_3d proc~oh_count_face_x_3d oh_count_face_x_3d proc~ocean_halo_face_x_3d->proc~oh_count_face_x_3d proc~ocean_halo_face_y_2d_impl ocean_halo_face_y_2d_impl proc~ocean_halo_face_y_2d->proc~ocean_halo_face_y_2d_impl proc~oh_count_face_y_2d oh_count_face_y_2d proc~ocean_halo_face_y_2d->proc~oh_count_face_y_2d proc~ocean_halo_face_y_3d->proc~comm_env_compute_comm proc~ocean_halo_face_y_3d->comm_irecv_real_sp_array_n proc~ocean_halo_face_y_3d->comm_isend_real_sp_array_n proc~ocean_halo_face_y_3d->proc~ew_rank_east proc~ocean_halo_face_y_3d->proc~ew_rank_west proc~ocean_halo_face_y_3d->proc~needs_flags proc~ocean_halo_face_y_3d->proc~ns_rank_north proc~ocean_halo_face_y_3d->proc~ns_rank_south proc~ocean_halo_face_y_3d->proc~ocean_halo_buffers_ensure_nz proc~ocean_halo_face_y_3d->proc~oh_count_msgs proc~ocean_halo_face_y_3d->waitall proc~ocean_periodic_wrap_face_y_3d ocean_periodic_wrap_face_y_3d proc~ocean_halo_face_y_3d->proc~ocean_periodic_wrap_face_y_3d proc~oh_count_face_y_3d oh_count_face_y_3d proc~ocean_halo_face_y_3d->proc~oh_count_face_y_3d proc~ocean_surface_stress_apply_cover->proc~ocean_surface_stress_refresh_mag proc~ocean_surfstress_cover_impl ocean_surfstress_cover_impl proc~ocean_surface_stress_apply_cover->proc~ocean_surfstress_cover_impl

Called by

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

Variables

Type Visibility Attributes Name Initial
integer, private :: ice_n_trunc
logical, private :: ice_ok
integer(kind=int64), private :: n_trunc_glob
integer(kind=int64), private :: n_trunc_loc

Source Code

   subroutine engine_step_ice(engine, cfg, dt, t, ierr)
      !! P2.4b: sea-ice per-step physics — ocean-side frazil
      !! accumulation, EVP dynamics (every outer step, independent of
      !! the thermo cadence: the ice's own fast/slow split) plus the
      !! resulting ice->ocean stress coupling, and, at thermo cadence
      !! (`engine%state%dyn%is_thermo_step()`), category transport
      !! followed by the atmospheric-forcing / basal-flux /
      !! frazil-uptake / column-thermo / snowfall / brine / heat /
      !! shortwave / ITD chain. Transcribed VERBATIM from
      !! `driver_run_ocean`'s former inline sea-ice block — the
      !! internal call order is load-bearing (see the "MANDATED ORDER"
      !! comment below, itself carried over unchanged) and is NOT
      !! reordered here. Returns immediately, a no-op, when
      !! `&ocean_ice_nml enable = .false.` — bit-identical to before
      !! this phase.
      !!
      !! Call between `engine_step` and `engine_step_finalize` — the
      !! surface-flux assembler the finalize call runs reads the
      !! salt/heat components this routine writes (the driver's own
      !! "PR-12 ... MUST sit here" comment), so it must run AFTER this
      !! returns. `cfg` is threaded through (unlike `engine_step`)
      !! because the thermo-forcing knobs this block reads every
      !! thermo-cadence step (`air_temp`/`restore_lambda`/`sw_down`/
      !! `snowfall`/`transport`/`adv_substeps`/`roll_factor`) are read
      !! straight from `&ocean_ice_nml` in the driver too, not cached
      !! at setup (unlike `evp_params`/`ic_par`, which the config
      !! builds once, up front).
      type(ocean_engine_t), intent(inout) :: engine
      type(config_t), intent(in) :: cfg
      real(wp), intent(in) :: dt
      real(wp), intent(in) :: t
         !! Unused today (the sea-ice block has no direct time
         !! dependence — only `dt` and the `therm_dt`/thermo-cadence
         !! machinery derived from it); present for signature symmetry
         !! with `engine_step`/`engine_step_finalize`.
      integer, intent(out), optional :: ierr
         !! Present for signature symmetry; no failure path in this
         !! routine sets it today — `ice_transport_step`'s
         !! conservation/positivity check still `error stop`s,
         !! matching the pre-existing driver behaviour verbatim.

      logical :: ice_ok
      integer :: ice_n_trunc
      integer(int64) :: n_trunc_loc, n_trunc_glob

      if (present(ierr)) ierr = OCEAN_STATUS_OK
      if (.not. engine%state%ice%enable) return

      ! Sea-ice PR 1/3b/3c: ocean-side frazil accumulation, then (at thermo
      ! cadence) the atmospheric-forcing seam + basal flux + column
      ! thermodynamics + frazil-bank spend, mediated back to the ocean via
      ! the salt/heat couplers.  ice_frazil_accumulate runs on the FINAL
      ! (post-RK2-average, post-ALE-remap) tracer state of the outer step —
      ! clamping inside the RK2 stages would not bound the averaged result —
      ! so T(k=nz) >= T_f(S) holds at every step boundary the ice model
      ! observes.
      call profiler_start("ice_frazil")
      call ice_frazil_accumulate(engine%grid, engine%state%eos, &
                                 engine%state%multilayer, &
                                 engine%state%ice%frazil_heat, &
                                 engine%state%ice%heat_budget_frazil)
      call profiler_stop("ice_frazil")

      ! Sea-ice PR 5: C-grid EVP dynamics, every outer step (NOT
      ! thermo-cadence gated — EVP is the ice's own fast/slow split,
      ! analogous to the ocean's barotropic/baroclinic split, and runs
      ! every outer step regardless of the thermo cadence).  ice_evp_step
      ! writes ice%u_ice/v_ice directly (replacing the PR-4b transport
      ! sampler, gated off below); ice_ocean_stress_flux immediately
      ! mediates the resulting drag into the ocean's surface-stress field so
      ! the NEXT ocean momentum step feels it (one-step-lagged, same
      ! convention as the frazil/heat couplers).
      if (engine%state%ice%dynamics) then
         call profiler_start("ice_evp")
         ! PR 36: the CFL bound must use the dt TRANSPORT will actually
         ! consume, not this call's outer `dt` -- EVP runs every outer
         ! step, transport at thermo cadence (`engine%state%dyn%therm_dt(dt)`,
         ! the same bound function the transport call below already uses).
         call ice_evp_step(engine%grid, engine%state%metrics, &
                           engine%state%coriolis_adv%f_corner, &
                           engine%state%ice, engine%state%multilayer, dt, &
                           engine%evp_params, engine%state%bc, &
                           dt_transport=engine%state%dyn%therm_dt(dt), &
                           n_trunc=ice_n_trunc)
         ! The truncation count is per tile; the warning reports the whole
         ! domain.  Exact integer sum, and only when the clip is on (the
         ! count is identically 0 otherwise), so the default costs no
         ! collective.  Gated on the RUN's decomposition, not the job's
         ! rank count (a serial reference inside a multi-rank job).
         if (engine%evp_params%cfl_trunc > 0.0_wp .and. ocean_halo_is_decomposed()) then
            n_trunc_loc = int(ice_n_trunc, int64)
            call halo_allreduce_sum_i8(n_trunc_loc, n_trunc_glob)
            ice_n_trunc = int(n_trunc_glob)
         end if
         if (ice_n_trunc > 0 .and. engine%decomp%rx == 0 .and. engine%decomp%ry == 0) then
            call logger%warning("ice_evp_step: ice velocity CFL-truncated at "// &
                                to_string(ice_n_trunc)//" faces "// &
                                "(&ocean_ice_nml cfl_trunc); the ice dynamics is "// &
                                "unstable or the transport step is too long")
         end if
         ! X5 rides inside: the blended tau pair is seam-refreshed
         ! (exchange -> wrap -> fold) before `stress_mag` and the restart
         ! mirror are taken from it.
         call ice_ocean_stress_flux(engine%state%metrics, engine%state%surface_stress, &
                                    engine%state%ice, engine%grid, engine%state%bc)
         call profiler_stop("ice_evp")
      end if

      ! Sea-ice PR 3b/3c: at thermo cadence, drive the column live and spend
      ! the bank.  Post-step, outer_step_count has already incremented, so
      ! is_thermo_step() fires at the END of each thermo window — the rates
      ! written here are integrated by exactly ONE apply (therm_dt) in the
      ! NEXT window (MEKE/frazil one-step-lag convention).  Gated on
      ! enable_thermodynamics too: with thermo off the apply path never
      ! fires, and spending the bank / stepping the column would strand
      ! un-mediated salt/heat.
      !
      ! MANDATED ORDER (PLAN_ICE_PR3c "Driver wiring" + the ordering caution
      ! therein; PR 4a appends the ITD restore; PR 26 inserts the snowfall
      ! ocean-share contributor; PR 31 inserts the shortwave coupler):
      ! forcing -> basal -> frazil uptake -> column driver -> snowfall ocean
      ! share -> brine coupler -> heat coupler -> shortwave coupler ->
      ! adjust categories (ITD restore; ncat=1 short-circuits inside).
      ! Frazil uptake MUST precede the column driver: `ice_frazil_uptake_impl`
      ! OVERWRITES `salt_flux_diag` (unconditional zero, then a gated write),
      ! so if the column ran first its net-melt salt contribution would be
      ! clobbered.  Running frazil first (fresh window) then having the
      ! column driver ADD its net-melt term on top composes correctly — a
      ! cell with no frazil but melting ice starts at 0 and the column adds
      ! its (negative) contribution.  `ice_snowfall_ocean_share` (PR 26,
      ! gated on `has_snowfall`) MUST run AFTER the column driver (which
      ! unconditionally zeroes `heat_flux_diag` — running snowfall first
      ! would have its contribution clobbered) and BEFORE the brine/heat
      ! couplers (which overwrite `Q_salt`/`Q_heat` from
      ! `salt_flux_diag`/`heat_flux_diag` — running it after would never
      ! reach the ocean).  It ADDS to both diags, same contract as the
      ! column driver's net-melt term.  The couplers run next, after every
      ! contributor has written salt_flux_diag/heat_flux_diag for this
      ! window.  `ice_ocean_sw_flux` (PR 31) runs immediately AFTER
      ! `ice_ocean_heat_flux`: in the components-off default it ADDS
      ! `sw_thru_diag` onto the `Q_heat` the heat coupler just
      ! full-overwrote, so it must observe that overwrite first (the
      ! shortwave is deliberately NOT in heat_flux_diag — see
      ! `ice_ocean_sw_flux`, no double count in either component mode).
      ! `ice_adjust_categories` runs LAST: it only reshuffles category
      ! area/mass/enthalpy/salt (no thermodynamics, no diag writes) after
      ! every thermodynamic thickness change this window, so the couplers
      ! (which only READ the per-cell diags written above) are unaffected
      ! by it running after them.
      if (engine%state%dyn%enable_thermodynamics .and. &
          engine%state%dyn%is_thermo_step()) then
         ! Sea-ice PR 4b: category ice/snow transport + compress_ice,
         ! BEFORE the thermo forcing chain (SIS2 slow sequence:
         ! dynamics+transport, then slow thermo).  Cadence = the thermo step
         ! (the ice slow step); gated on `&ocean_ice_nml transport` (default
         ! off => byte-identical).
         if (cfg%ocean%ice%transport) then
            call profiler_start("ice_transport")
            call ice_transport_step(engine%grid, engine%state%metrics, &
                                    engine%state%multilayer, &
                                    engine%state%ice, engine%state%dyn%therm_dt(dt), &
                                    cfg%ocean%ice%adv_substeps, cfg%ocean%ice%roll_factor, &
                                    ice_ok, bc=engine%state%bc)
            call profiler_stop("ice_transport")
            if (.not. ice_ok) then
               call logger%error("ice_transport_step: conservation/positivity "// &
                                 "violation (negative mass, orphan snow, or a "// &
                                 "compress-time consistency failure)")
               error stop "ice_transport_step: conservation/positivity violation"
            end if
         end if
         call profiler_start("ice_thermo")
         call ice_atm_forcing_restoring(engine%state%ice, &
                                        cfg%ocean%ice%air_temp, &
                                        cfg%ocean%ice%restore_lambda, &
                                        cfg%ocean%ice%sw_down, &
                                        cfg%ocean%ice%snowfall)
         call ice_compute_basal_flux(engine%grid, engine%state%eos, &
                                     engine%state%multilayer, engine%state%ice, &
                                     engine%state%dyn%therm_dt(dt))
         call ice_frazil_uptake(engine%grid, engine%state%eos, engine%state%multilayer, &
                                engine%state%ice, engine%state%dyn%therm_dt(dt))
         call ice_thermo_driver_step(engine%grid, engine%state%eos, &
                                     engine%state%multilayer, engine%state%ice, &
                                     engine%state%dyn%therm_dt(dt))
         if (engine%state%ice%has_snowfall) then
            call ice_snowfall_ocean_share(engine%grid, engine%state%ice, &
                                          engine%state%dyn%therm_dt(dt))
         end if
         ! Every contributor above wrote the per-cell flux diags on
         ! PHYSICAL cells; the couplers below copy the FULL array into the
         ! ocean's surface fluxes, whose seam ghosts the ocean reads.
         call ocean_halo_exchange_ice_fluxes(engine%state%ice, engine%grid, engine%state%bc)
         call ice_ocean_brine_flux(engine%state%surface_flux, engine%state%ice)
         call ice_ocean_heat_flux(engine%state%surface_flux, engine%state%ice)
         call ice_ocean_sw_flux(engine%state%surface_flux, engine%state%ice)
         call ice_adjust_categories(engine%grid, engine%state%multilayer, engine%state%ice)
         call profiler_stop("ice_thermo")
         ! X1: the transport compress, the column thermodynamics and the
         ! ITD restore above all write PHYSICAL cells only, and the
         ! category state changes nowhere else — so this one exchange per
         ! thermo window is what keeps the ghosts the next EVP gather and
         ! stress blend read equal to the neighbour's (or, on one rank, to
         ! the periodic partner's) owned cells.
         call ocean_halo_exchange_ice_state(engine%state%ice, engine%grid, engine%state%bc)
      end if
   end subroutine engine_step_ice