ice_frazil_accumulate Subroutine

public pure subroutine ice_frazil_accumulate(grid, eos, ms, frazil_heat, heat_budget_frazil)

Outer shim (outer-shim + flat-impl pattern): dereference the tracer registry (ms%tracers(idx)%hTr) on the HOST and forward bare arrays to the device kernel — NVHPC stdpar cannot follow the array-of-derived-types indirection inside a do-concurrent body. No-op when either S or T is unregistered.

Arguments

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

Persistent supercooling bank (J/m²) on the ice slot — ocean_sea_ice_t%frazil_heat, device-mapped by the slot’s enter_data.

real(kind=wp), intent(inout) :: heat_budget_frazil(:,:,:)

Heat-budget contributor accumulator (K·m per cell) — ocean_sea_ice_t%heat_budget_frazil.


Calls

proc~~ice_frazil_accumulate~~CallsGraph proc~ice_frazil_accumulate ice_frazil_accumulate proc~ice_frazil_accumulate_impl ice_frazil_accumulate_impl proc~ice_frazil_accumulate->proc~ice_frazil_accumulate_impl local local proc~ice_frazil_accumulate_impl->local proc~eos_freezing_point eos_freezing_point proc~ice_frazil_accumulate_impl->proc~eos_freezing_point

Called by

proc~~ice_frazil_accumulate~~CalledByGraph proc~ice_frazil_accumulate ice_frazil_accumulate proc~engine_step_ice engine_step_ice proc~engine_step_ice->proc~ice_frazil_accumulate 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 :: idx_S
integer, private :: idx_T

Source Code

   pure subroutine ice_frazil_accumulate(grid, eos, ms, frazil_heat, &
                                         heat_budget_frazil)
      !! Outer shim (outer-shim + flat-impl pattern): dereference the
      !! tracer registry (`ms%tracers(idx)%hTr`) on the HOST and forward
      !! bare arrays to the device kernel — NVHPC stdpar cannot follow
      !! the array-of-derived-types indirection inside a do-concurrent
      !! body.  No-op when either S or T is unregistered.
      type(hgrid_t), intent(in) :: grid
      type(eos_t), intent(in) :: eos
      type(multilayer_state_t), intent(inout) :: ms
      real(wp), intent(inout) :: frazil_heat(:, :)
         !! Persistent supercooling bank (J/m²) on the ice slot —
         !! `ocean_sea_ice_t%frazil_heat`, device-mapped by the slot's
         !! `enter_data`.
      real(wp), intent(inout) :: heat_budget_frazil(:, :, :)
         !! Heat-budget contributor accumulator (K·m per cell) —
         !! `ocean_sea_ice_t%heat_budget_frazil`.

      integer :: idx_T, idx_S

      idx_T = ms%idx_temperature
      idx_S = ms%idx_salinity
      if (idx_T <= 0 .or. idx_S <= 0) return

      call ice_frazil_accumulate_impl(ms%tracers(idx_T)%hTr, &
                                      ms%tracers(idx_S)%hTr, &
                                      ms%h_layer, ms%wet_mask, &
                                      frazil_heat, heat_budget_frazil, &
                                      eos, grid%nghost, &
                                      ms%nz_ml, grid%nx_total, grid%ny_total)
   end subroutine ice_frazil_accumulate