ice_ocean_brine_flux Subroutine

public pure subroutine ice_ocean_brine_flux(sf, ice)

Refresh the ocean surface salt-flux field from the ice slot. Components off (default): Q_salt(i,j) = Q_salt_const + salt_flux_diag(i,j) POSITIVE SALINIFIES (TRAP #2 above — matches apply_surface_src_2d_impl’s hTr_S += dt/rho0*Q_salt). This is a FULL OVERWRITE from the configure-time constant plus the last uptake’s rate: no accumulation drift, and a thermo window with no freezing resets the field back to the background (salt_flux_diag == 0 when the bank was empty or the cell was dry/land/vanished — see ice_frazil_uptake_impl’s unconditional diag zeroing). Components on (sf%use_components, PR-12): write the ice’s own COMPONENT instead — sf%salt_flux(i,j) = salt_flux_diag(i,j) (no Q_salt_const term: ocean_surface_flux_assemble adds it). Sets has_salt either way (§13 item 6 of the PR-12 plan: any filler that can produce non-zero net salt must set the latch).

Arguments

Type IntentOptional Attributes Name
type(ocean_surface_flux_t), intent(inout) :: sf
type(ocean_sea_ice_t), intent(in) :: ice

Calls

proc~~ice_ocean_brine_flux~~CallsGraph proc~ice_ocean_brine_flux ice_ocean_brine_flux 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

Called by

proc~~ice_ocean_brine_flux~~CalledByGraph proc~ice_ocean_brine_flux ice_ocean_brine_flux proc~engine_step_ice engine_step_ice proc~engine_step_ice->proc~ice_ocean_brine_flux 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_ocean_brine_flux(sf, ice)
      !! Refresh the ocean surface salt-flux field from the ice slot.
      !! **Components off** (default):
      !!   Q_salt(i,j) = Q_salt_const + salt_flux_diag(i,j)
      !! POSITIVE SALINIFIES (TRAP #2 above — matches
      !! `apply_surface_src_2d_impl`'s `hTr_S += dt/rho0*Q_salt`). This
      !! is a FULL OVERWRITE from the configure-time constant plus the
      !! last uptake's rate: no accumulation drift, and a thermo window
      !! with no freezing resets the field back to the background
      !! (`salt_flux_diag == 0` when the bank was empty or the cell was
      !! dry/land/vanished — see `ice_frazil_uptake_impl`'s unconditional
      !! diag zeroing).
      !! **Components on** (`sf%use_components`, PR-12): write the ice's
      !! own COMPONENT instead — `sf%salt_flux(i,j) = salt_flux_diag(i,j)`
      !! (no `Q_salt_const` term: `ocean_surface_flux_assemble` adds it).
      !! Sets `has_salt` either way (§13 item 6 of the PR-12 plan: any
      !! filler that can produce non-zero net salt must set the latch).
      type(ocean_surface_flux_t), intent(inout) :: sf
      type(ocean_sea_ice_t), intent(in) :: ice

      sf%has_salt = .true.
      if (sf%use_components) then
         call ice_ocean_brine_flux_components_impl(sf%salt_flux, ice%salt_flux_diag, &
                                                   ice%nx_total, ice%ny_total)
      else
         call ice_ocean_brine_flux_impl(sf%Q_salt, ice%salt_flux_diag, &
                                        sf%Q_salt_const, ice%nx_total, ice%ny_total)
      end if
   end subroutine ice_ocean_brine_flux