ice_thermo_driver_step Subroutine

public pure subroutine ice_thermo_driver_step(grid, eos, ms, ice, dt_therm)

Outer shim (outer-shim + flat-impl pattern): ms/eos are accepted for call-site parity with the other thermo-cadence kernels (ice_compute_basal_flux, ice_frazil_uptake) even though this step reads its ocean-surface sample from the ice%sst_seam/ssurf_seam/tfw_seam scratch (filled by ice_compute_basal_flux earlier in the same window) rather than re-deriving it from ms/eos directly — eos is unused here but kept in the signature so a future revision that DOES need a fresh EOS evaluation does not have to change every call site.

Arguments

Type IntentOptional Attributes Name
type(hgrid_t), intent(in) :: grid
type(eos_t), intent(in) :: eos
type(multilayer_state_t), intent(in) :: ms
type(ocean_sea_ice_t), intent(inout) :: ice
real(kind=wp), intent(in) :: dt_therm

Effective thermo timestep (s) — ocean_dyn_t%therm_dt(dt).


Calls

proc~~ice_thermo_driver_step~~CallsGraph proc~ice_thermo_driver_step ice_thermo_driver_step 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 local local proc~ice_fb_part_sum_fill_impl->local proc~ice_snow_part_ocn_fill_impl->local 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 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_enthalpy_liquid ice_enthalpy_liquid proc~ice_column_step->proc~ice_enthalpy_liquid 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_enthalpy_liquid_freeze ice_enthalpy_liquid_freeze proc~ice_bottom_melt_peel->proc~ice_enthalpy_liquid_freeze proc~ice_t_freeze ice_t_freeze proc~ice_optics_csim4->proc~ice_t_freeze proc~ice_temp_sis2->proc~ice_enth_from_ts proc~ice_temp_sis2->proc~ice_temp_from_en_s proc~ice_temp_sis2->proc~ice_t_freeze 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~update_lay_enth->proc~ice_enth_from_ts proc~update_lay_enth->proc~ice_enthalpy_liquid proc~update_lay_enth->proc~ice_enthalpy_liquid_freeze proc~update_lay_enth->proc~ice_t_freeze

Called by

proc~~ice_thermo_driver_step~~CalledByGraph proc~ice_thermo_driver_step ice_thermo_driver_step proc~engine_step_ice engine_step_ice proc~engine_step_ice->proc~ice_thermo_driver_step 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

Source Code

   pure subroutine ice_thermo_driver_step(grid, eos, ms, ice, dt_therm)
      !! Outer shim (outer-shim + flat-impl pattern): `ms`/`eos` are
      !! accepted for call-site parity with the other thermo-cadence
      !! kernels (`ice_compute_basal_flux`, `ice_frazil_uptake`) even
      !! though this step reads its ocean-surface sample from the
      !! `ice%sst_seam`/`ssurf_seam`/`tfw_seam` scratch (filled by
      !! `ice_compute_basal_flux` earlier in the same window) rather
      !! than re-deriving it from `ms`/`eos` directly — `eos` is unused
      !! here but kept in the signature so a future revision that DOES
      !! need a fresh EOS evaluation does not have to change every call
      !! site.
      type(hgrid_t), intent(in) :: grid
      type(eos_t), intent(in) :: eos
      type(multilayer_state_t), intent(in) :: ms
      type(ocean_sea_ice_t), intent(inout) :: ice
      real(wp), intent(in) :: dt_therm
         !! Effective thermo timestep (s) — `ocean_dyn_t%therm_dt(dt)`.

      associate (unused => eos)
      end associate

      if (ice%ncat > 1) then
         call ice_fb_part_sum_fill_impl(ms%wet_mask, ice%part_size, ice%m_ice, ice%fb_part_sum, &
                                        grid%nghost, ice%ncat, grid%nx_total, grid%ny_total)
      end if

      if (ice%has_snowfall) then
         call ice_snow_part_ocn_fill_impl(ms%wet_mask, ice%part_size, ice%m_ice, &
                                          ice%snow_part_ocn, grid%nghost, ice%ncat, &
                                          grid%nx_total, grid%ny_total)
      end if

      call ice_thermo_columns(grid%nghost, grid%nx_total, grid%ny_total, &
                              ice%ncat, ice%nk_ice, dt_therm, ice%snow_ice, ms%wet_mask, &
                              ice%m_ice, ice%m_snow, ice%enth_ice, ice%enth_snow, &
                              ice%sal_ice, ice%atm_sf0, ice%atm_dsfdt, ice%atm_sw_dn, &
                              ice%atm_fprec, ice%tfw_seam, ice%fb, ice%sst_seam, &
                              ice%ssurf_seam, ice%tsurf_out, ice%h2o_ocn_to_ice, &
                              ice%h2o_ice_to_ocn, ice%heat_to_ocn, ice%sw_thru, &
                              ice%snow_to_ice)

      if (ice%ncat == 1) then
         call ice_thermo_driver_reduce_impl(ms%wet_mask, ice%h2o_ocn_to_ice, &
                                            ice%h2o_ice_to_ocn, ice%heat_to_ocn, &
                                            ice%sw_thru, ice%ssurf_seam, ice%fb, &
                                            ice%heat_flux_diag, ice%sw_thru_diag, &
                                            ice%m_melt_diag, &
                                            ice%salt_flux_diag, dt_therm, grid%nghost, &
                                            ice%ncat, grid%nx_total, grid%ny_total)
      else
         call ice_thermo_driver_reduce_multicat_impl(ms%wet_mask, ice%part_size, &
                                                     ice%h2o_ocn_to_ice, ice%h2o_ice_to_ocn, &
                                                     ice%heat_to_ocn, ice%sw_thru, &
                                                     ice%ssurf_seam, ice%fb, &
                                                     ice%fb_part_sum, &
                                                     ice%heat_flux_diag, ice%sw_thru_diag, &
                                                     ice%m_melt_diag, &
                                                     ice%salt_flux_diag, dt_therm, grid%nghost, &
                                                     ice%ncat, grid%nx_total, grid%ny_total)
      end if
   end subroutine ice_thermo_driver_step