cavity_count_zero_f Function

public pure function cavity_count_zero_f(f_cor, cover_frac, wet_mask, nx, ny) result(n_zero)

Count ice-covered WET columns sitting at exactly f = 0 — the configure-time domain check for exchange_law = "hj99".

Exactly zero, not “small”: the law’s failure at f = 0 is a division and a logarithm, not a loss of accuracy, and a small |f| is a legitimate (if strongly suppressed) answer.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: f_cor(nx,ny)

Cell-centred Coriolis parameter (1/s).

real(kind=wp), intent(in) :: cover_frac(nx,ny)

Ice-cover fraction.

real(kind=wp), intent(in) :: wet_mask(nx,ny)

Static wet/land mask.

integer, intent(in) :: nx

First dimension.

integer, intent(in) :: ny

Second dimension.

Return Value integer


Called by

proc~~cavity_count_zero_f~~CalledByGraph proc~cavity_count_zero_f cavity_count_zero_f proc~configure_ocean_cavity_melt configure_ocean_cavity_melt proc~configure_ocean_cavity_melt->proc~cavity_count_zero_f proc~engine_setup engine_setup proc~engine_setup->proc~configure_ocean_cavity_melt proc~complete_ocean_create complete_ocean_create proc~complete_ocean_create->proc~engine_setup proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~engine_setup proc~driver_validate driver_validate proc~driver_validate->proc~engine_setup proc~driver_run driver_run proc~driver_run->proc~driver_run_ocean proc~rdb_ocean_create_finalize rdb_ocean_create_finalize proc~rdb_ocean_create_finalize->proc~complete_ocean_create proc~rdb_ocean_create_from_string rdb_ocean_create_from_string proc~rdb_ocean_create_from_string->proc~complete_ocean_create

Variables

Type Visibility Attributes Name Initial
integer, private :: i
integer, private :: j

Source Code

   pure function cavity_count_zero_f(f_cor, cover_frac, wet_mask, nx, ny) result(n_zero)
      !! Count ice-covered WET columns sitting at exactly `f = 0` — the
      !! configure-time domain check for `exchange_law = "hj99"`.
      !!
      !! Exactly zero, not "small": the law's failure at `f = 0` is a
      !! division and a logarithm, not a loss of accuracy, and a small
      !! `|f|` is a legitimate (if strongly suppressed) answer.
      integer, intent(in) :: nx
         !! First dimension.
      integer, intent(in) :: ny
         !! Second dimension.
      real(wp), intent(in) :: f_cor(nx, ny)
         !! Cell-centred Coriolis parameter (1/s).
      real(wp), intent(in) :: cover_frac(nx, ny)
         !! Ice-cover fraction.
      real(wp), intent(in) :: wet_mask(nx, ny)
         !! Static wet/land mask.
      integer :: n_zero
      integer :: i, j
      n_zero = 0
      do j = 1, ny
         do i = 1, nx
            if (cover_frac(i, j) > 0.5_wp .and. wet_mask(i, j) > 0.5_wp) then
               if (f_cor(i, j) == 0.0_wp) n_zero = n_zero + 1
            end if
         end do
      end do
   end function cavity_count_zero_f