ice_evp_mi_ratio_point Function

public pure function ice_evp_mi_ratio_point(mis_sw, mis_se, mis_nw, mis_ne, mask_u_below, mask_u_above, mask_v_left, mask_v_right, mask_q, area_sw, area_se, area_nw, area_ne, mask_t_sw, mask_t_se, mask_t_nw, mask_t_ne, m_neglect2, m_neglect4) result(mi_ratio)

mi_ratio_A_q at a single corner (SIS2 :926-964), FULL form — all four branches (interior / corner-coast / straight-coast / land). weak_coast_stress=.false. hardwired (SIS2 default): sum_area is the MASKED area sum of the 4 surrounding T-cells. Factored out of the fill kernel so a unit test can pin it directly (SPEC §7 gate 8).

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: mis_sw

Ice+snow mass per cell area at the 4 T-cells around the corner (SW/SE/NW/NE, rdb wet_q convention).

real(kind=wp), intent(in) :: mis_se

Ice+snow mass per cell area at the 4 T-cells around the corner (SW/SE/NW/NE, rdb wet_q convention).

real(kind=wp), intent(in) :: mis_nw

Ice+snow mass per cell area at the 4 T-cells around the corner (SW/SE/NW/NE, rdb wet_q convention).

real(kind=wp), intent(in) :: mis_ne

Ice+snow mass per cell area at the 4 T-cells around the corner (SW/SE/NW/NE, rdb wet_q convention).

real(kind=wp), intent(in) :: mask_u_below

u-face masks below/above the corner (SIS2 mask2dCu(I,j)/mask2dCu(I,j+1)).

real(kind=wp), intent(in) :: mask_u_above

u-face masks below/above the corner (SIS2 mask2dCu(I,j)/mask2dCu(I,j+1)).

real(kind=wp), intent(in) :: mask_v_left

v-face masks left/right of the corner (SIS2 mask2dCv(i,J)/mask2dCv(i+1,J)).

real(kind=wp), intent(in) :: mask_v_right

v-face masks left/right of the corner (SIS2 mask2dCv(i,J)/mask2dCv(i+1,J)).

real(kind=wp), intent(in) :: mask_q

mask2dBu at this corner (1 = genuinely interior ocean point).

real(kind=wp), intent(in) :: area_sw

T-cell areas at the 4 surrounding cells.

real(kind=wp), intent(in) :: area_se

T-cell areas at the 4 surrounding cells.

real(kind=wp), intent(in) :: area_nw

T-cell areas at the 4 surrounding cells.

real(kind=wp), intent(in) :: area_ne

T-cell areas at the 4 surrounding cells.

real(kind=wp), intent(in) :: mask_t_sw

T-cell wet masks at the 4 surrounding cells (land => 0).

real(kind=wp), intent(in) :: mask_t_se

T-cell wet masks at the 4 surrounding cells (land => 0).

real(kind=wp), intent(in) :: mask_t_nw

T-cell wet masks at the 4 surrounding cells (land => 0).

real(kind=wp), intent(in) :: mask_t_ne

T-cell wet masks at the 4 surrounding cells (land => 0).

real(kind=wp), intent(in) :: m_neglect2
real(kind=wp), intent(in) :: m_neglect4

Return Value real(kind=wp)


Called by

proc~~ice_evp_mi_ratio_point~~CalledByGraph proc~ice_evp_mi_ratio_point ice_evp_mi_ratio_point proc~evp_q_and_mi_ratio_impl evp_q_and_mi_ratio_impl proc~evp_q_and_mi_ratio_impl->proc~ice_evp_mi_ratio_point proc~ice_evp_dynamics_impl ice_evp_dynamics_impl proc~ice_evp_dynamics_impl->proc~evp_q_and_mi_ratio_impl proc~ice_evp_dynamics ice_evp_dynamics proc~ice_evp_dynamics->proc~ice_evp_dynamics_impl proc~ice_evp_step ice_evp_step proc~ice_evp_step->proc~ice_evp_dynamics proc~engine_step_ice engine_step_ice proc~engine_step_ice->proc~ice_evp_step

Variables

Type Visibility Attributes Name Initial
real(kind=wp), private :: muq
real(kind=wp), private :: muq2
real(kind=wp), private :: mvq
real(kind=wp), private :: mvq2
real(kind=wp), private :: sum_area

Source Code

   pure function ice_evp_mi_ratio_point(mis_sw, mis_se, mis_nw, mis_ne, &
                                        mask_u_below, mask_u_above, &
                                        mask_v_left, mask_v_right, &
                                        mask_q, area_sw, area_se, area_nw, area_ne, &
                                        mask_t_sw, mask_t_se, mask_t_nw, mask_t_ne, &
                                        m_neglect2, m_neglect4) result(mi_ratio)
      !! `mi_ratio_A_q` at a single corner (SIS2 :926-964), FULL form —
      !! all four branches (interior / corner-coast / straight-coast /
      !! land). `weak_coast_stress=.false.` hardwired (SIS2 default):
      !! `sum_area` is the MASKED area sum of the 4 surrounding T-cells.
      !! Factored out of the fill kernel so a unit test can pin it
      !! directly (SPEC §7 gate 8).
      real(wp), intent(in) :: mis_sw, mis_se, mis_nw, mis_ne
         !! Ice+snow mass per cell area at the 4 T-cells around the
         !! corner (SW/SE/NW/NE, rdb `wet_q` convention).
      real(wp), intent(in) :: mask_u_below, mask_u_above
         !! u-face masks below/above the corner (SIS2
         !! `mask2dCu(I,j)`/`mask2dCu(I,j+1)`).
      real(wp), intent(in) :: mask_v_left, mask_v_right
         !! v-face masks left/right of the corner (SIS2
         !! `mask2dCv(i,J)`/`mask2dCv(i+1,J)`).
      real(wp), intent(in) :: mask_q
         !! `mask2dBu` at this corner (1 = genuinely interior ocean point).
      real(wp), intent(in) :: area_sw, area_se, area_nw, area_ne
         !! T-cell areas at the 4 surrounding cells.
      real(wp), intent(in) :: mask_t_sw, mask_t_se, mask_t_nw, mask_t_ne
         !! T-cell wet masks at the 4 surrounding cells (land => 0).
      real(wp), intent(in) :: m_neglect2, m_neglect4
      real(wp) :: mi_ratio

      real(wp) :: sum_area, muq2, mvq2, muq, mvq

      sum_area = (mask_t_sw*area_sw + mask_t_ne*area_ne) + &
                 (mask_t_nw*area_nw + mask_t_se*area_se)

      if (sum_area <= 0.0_wp) then
         mi_ratio = 0.0_wp
      else if (mask_q > 0.0_wp) then
         muq2 = 0.25_wp*(mis_sw + mis_se)*(mis_nw + mis_ne)
         mvq2 = 0.25_wp*(mis_sw + mis_nw)*(mis_se + mis_ne)
         mi_ratio = 32.0_wp*muq2*mvq2/((m_neglect4 + (muq2 + mvq2)* &
                                        ((mis_sw + mis_ne) + (mis_nw + mis_se))**2)*sum_area)
      else if ((mask_u_below + mask_u_above) + (mask_v_left + mask_v_right) > 1.5_wp) then
         muq = 0.5_wp*(mask_u_below*(mis_sw + mis_se) + mask_u_above*(mis_nw + mis_ne))
         mvq = 0.5_wp*(mask_v_left*(mis_sw + mis_nw) + mask_v_right*(mis_se + mis_ne))
         mi_ratio = 4.0_wp*muq*mvq/((m_neglect2 + (muq + mvq)**2)*sum_area)
      else
         mi_ratio = 1.0_wp/sum_area
      end if
   end function ice_evp_mi_ratio_point