ice_pass_x Subroutine

private pure subroutine ice_pass_x(grid, metrics, ice, dt_adv, wall_w, wall_e, ok)

One zonal pass: total-mass PPM + proportionate ice-flux split, the snow twin + co-located mask, PCM tracer riding (gather then cell update), the mass update (AFTER every ride reads the pre-update mass), and the post-pass validity reduction.

Arguments

Type IntentOptional Attributes Name
type(hgrid_t), intent(in) :: grid
type(ocean_metrics_t), intent(in) :: metrics
type(ocean_sea_ice_t), intent(inout) :: ice
real(kind=wp), intent(in) :: dt_adv
logical, intent(in) :: wall_w

Zero the west / east tile-edge face (a physical, non-periodic edge); a seam face is an ordinary face.

logical, intent(in) :: wall_e

Zero the west / east tile-edge face (a physical, non-periodic edge); a seam face is an ordinary face.

logical, intent(out) :: ok

Calls

proc~~ice_pass_x~~CallsGraph proc~ice_pass_x ice_pass_x proc~ice_cat_flux_x_impl ice_cat_flux_x_impl proc~ice_pass_x->proc~ice_cat_flux_x_impl proc~ice_gather_flux_x_impl ice_gather_flux_x_impl proc~ice_pass_x->proc~ice_gather_flux_x_impl proc~ice_gather_flux_x_layer_impl ice_gather_flux_x_layer_impl proc~ice_pass_x->proc~ice_gather_flux_x_layer_impl proc~ice_mask_snow_by_ice_impl ice_mask_snow_by_ice_impl proc~ice_pass_x->proc~ice_mask_snow_by_ice_impl proc~ice_mass_update_x_impl ice_mass_update_x_impl proc~ice_pass_x->proc~ice_mass_update_x_impl proc~ice_ride_update_x_impl ice_ride_update_x_impl proc~ice_pass_x->proc~ice_ride_update_x_impl proc~ice_ride_update_x_layer_impl ice_ride_update_x_layer_impl proc~ice_pass_x->proc~ice_ride_update_x_layer_impl proc~ice_validity_reduce_impl ice_validity_reduce_impl proc~ice_pass_x->proc~ice_validity_reduce_impl local local proc~ice_cat_flux_x_impl->local proc~ppm_cell_limiter ppm_cell_limiter proc~ice_cat_flux_x_impl->proc~ppm_cell_limiter proc~ppm_limit_pos ppm_limit_pos proc~ice_cat_flux_x_impl->proc~ppm_limit_pos proc~ppm_limited_slope ppm_limited_slope proc~ice_cat_flux_x_impl->proc~ppm_limited_slope proc~ppm_mirror_h ppm_mirror_h proc~ice_cat_flux_x_impl->proc~ppm_mirror_h proc~volcfl_face volcfl_face proc~ice_cat_flux_x_impl->proc~volcfl_face proc~ice_ride_update_x_impl->local proc~ice_ride_update_x_layer_impl->local reduce reduce proc~ice_validity_reduce_impl->reduce

Called by

proc~~ice_pass_x~~CalledByGraph proc~ice_pass_x ice_pass_x proc~ice_transport_step ice_transport_step proc~ice_transport_step->proc~ice_pass_x proc~engine_step_ice engine_step_ice proc~engine_step_ice->proc~ice_transport_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

Variables

Type Visibility Attributes Name Initial
integer, private :: l
integer, private :: nghost
integer, private :: nx
integer, private :: ny

Source Code

   pure subroutine ice_pass_x(grid, metrics, ice, dt_adv, wall_w, wall_e, ok)
      !! One zonal pass: total-mass PPM + proportionate ice-flux split,
      !! the snow twin + co-located mask, PCM tracer riding (gather then
      !! cell update), the mass update (AFTER every ride reads the
      !! pre-update mass), and the post-pass validity reduction.
      type(hgrid_t), intent(in) :: grid
      type(ocean_metrics_t), intent(in) :: metrics
      type(ocean_sea_ice_t), intent(inout) :: ice
      real(wp), intent(in) :: dt_adv
      logical, intent(in) :: wall_w, wall_e
         !! Zero the west / east tile-edge face (a physical, non-periodic
         !! edge); a seam face is an ordinary face.
      logical, intent(out) :: ok
      integer :: nx, ny, nghost, l

      nx = grid%nx_total
      ny = grid%ny_total
      nghost = grid%nghost

      call ice_cat_flux_x_impl(metrics%wet_T, metrics%dy_cu, metrics%idxT, ice%u_ice, &
                               ice%mca_ice, ice%htot_work, ice%hl_x_work, ice%hr_x_work, &
                               ice%uhtot_work, ice%uh_ice, dt_adv, nghost, grid%nx_phys, &
                               ice%ncat, nx, ny, wall_w, wall_e)
      call ice_cat_flux_x_impl(metrics%wet_T, metrics%dy_cu, metrics%idxT, ice%u_ice, &
                               ice%mca_snow, ice%htot_work, ice%hl_x_work, ice%hr_x_work, &
                               ice%uhtot_work, ice%uh_snow, dt_adv, nghost, grid%nx_phys, &
                               ice%ncat, nx, ny, wall_w, wall_e)
      call ice_mask_snow_by_ice_impl(ice%uh_ice, ice%uh_snow, nx + 1, ny, ice%ncat)

      ! ---- Tracer riding (Phase 2c), BEFORE the mass update ----
      call ice_gather_flux_x_impl(ice%uh_ice, ice%m_ice, ice%tr_flux_x_work, ice%ncat, nx, ny)
      call ice_ride_update_x_impl(metrics%iareaT, ice%uh_ice, ice%tr_flux_x_work, ice%mca_ice, &
                                  ice%m_ice, dt_adv, ice%ncat, nx, ny)
      do l = 1, ice%nk_ice
         call ice_gather_flux_x_layer_impl(ice%uh_ice, ice%enth_ice, l, ice%tr_flux_x_work, &
                                           ice%ncat, ice%nk_ice, nx, ny)
         call ice_ride_update_x_layer_impl(metrics%iareaT, ice%uh_ice, ice%tr_flux_x_work, &
                                           ice%mca_ice, ice%enth_ice, l, dt_adv, ice%ncat, &
                                           ice%nk_ice, nx, ny)
         call ice_gather_flux_x_layer_impl(ice%uh_ice, ice%sal_ice, l, ice%tr_flux_x_work, &
                                           ice%ncat, ice%nk_ice, nx, ny)
         call ice_ride_update_x_layer_impl(metrics%iareaT, ice%uh_ice, ice%tr_flux_x_work, &
                                           ice%mca_ice, ice%sal_ice, l, dt_adv, ice%ncat, &
                                           ice%nk_ice, nx, ny)
      end do
      call ice_gather_flux_x_layer_impl(ice%uh_snow, ice%enth_snow, 1, ice%tr_flux_x_work, &
                                        ice%ncat, 1, nx, ny)
      call ice_ride_update_x_layer_impl(metrics%iareaT, ice%uh_snow, ice%tr_flux_x_work, &
                                        ice%mca_snow, ice%enth_snow, 1, dt_adv, ice%ncat, &
                                        1, nx, ny)

      ! ---- Mass update (Phase 2d) ----
      call ice_mass_update_x_impl(metrics%iareaT, ice%uh_ice, ice%mca_ice, dt_adv, &
                                  nghost, grid%nx_phys, ice%ncat, nx, ny)
      call ice_mass_update_x_impl(metrics%iareaT, ice%uh_snow, ice%mca_snow, dt_adv, &
                                  nghost, grid%nx_phys, ice%ncat, nx, ny)

      call ice_validity_reduce_impl(ice%mca_ice, ice%mca_snow, nghost, grid%nx_phys, &
                                    grid%ny_phys, ice%ncat, nx, ny, ok)
   end subroutine ice_pass_x