metrics_fold_north_faces Subroutine

private subroutine metrics_fold_north_faces(this, grid)

North fold of the face and corner metric arrays (the Cu / Cv / Bu part of metrics_fold_periodic_ghosts; the T arrays are folded there).

Arguments

Type IntentOptional Attributes Name
type(ocean_metrics_t), intent(inout) :: this
type(hgrid_t), intent(in) :: grid

Calls

proc~~metrics_fold_north_faces~~CallsGraph proc~metrics_fold_north_faces metrics_fold_north_faces interface~fold_north_corner fold_north_corner proc~metrics_fold_north_faces->interface~fold_north_corner proc~metrics_fold_north_cu_scalar metrics_fold_north_cu_scalar proc~metrics_fold_north_faces->proc~metrics_fold_north_cu_scalar proc~metrics_fold_north_cv_scalar metrics_fold_north_cv_scalar proc~metrics_fold_north_faces->proc~metrics_fold_north_cv_scalar proc~fold_north_corner_2d fold_north_corner_2d interface~fold_north_corner->proc~fold_north_corner_2d local local proc~fold_north_corner_2d->local

Called by

proc~~metrics_fold_north_faces~~CalledByGraph proc~metrics_fold_north_faces metrics_fold_north_faces proc~metrics_fold_periodic_ghosts metrics_fold_periodic_ghosts proc~metrics_fold_periodic_ghosts->proc~metrics_fold_north_faces proc~engine_setup engine_setup proc~engine_setup->proc~metrics_fold_periodic_ghosts proc~configure_ocean_metrics configure_ocean_metrics proc~engine_setup->proc~configure_ocean_metrics proc~metrics_fill_from_supergrid metrics_fill_from_supergrid proc~metrics_fill_from_supergrid->proc~metrics_fold_periodic_ghosts proc~metrics_fill_tripolar_whole metrics_fill_tripolar_whole proc~metrics_fill_tripolar_whole->proc~metrics_fold_periodic_ghosts proc~complete_ocean_create complete_ocean_create proc~complete_ocean_create->proc~engine_setup proc~configure_ocean_metrics->proc~metrics_fill_from_supergrid proc~metrics_fill_tripolar metrics_fill_tripolar proc~configure_ocean_metrics->proc~metrics_fill_tripolar 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~metrics_fill_tripolar->proc~metrics_fill_tripolar_whole 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 :: ng
integer, private :: ni
integer, private :: nj

Source Code

   subroutine metrics_fold_north_faces(this, grid)
      !! North fold of the face and corner metric arrays (the Cu / Cv / Bu
      !! part of `metrics_fold_periodic_ghosts`; the T arrays are folded
      !! there).
      type(ocean_metrics_t), intent(inout) :: this
      type(hgrid_t), intent(in) :: grid
      integer :: ng, ni, nj

      ng = grid%nghost
      ni = grid%nx_phys
      nj = grid%ny_phys
      ! u-stagger (Cu) — scalar copy.  fold_north_u_face NEGATES (it is
      ! built for the vector u-component), so metrics use a local scalar-copy
      ! variant with the same (nx+1,ny) index map.
      call metrics_fold_north_cu_scalar(this%dxCu, grid)
      call metrics_fold_north_cu_scalar(this%dyCu, grid)
      call metrics_fold_north_cu_scalar(this%areaCu, grid)
      call metrics_fold_north_cu_scalar(this%dy_cu, grid)
      ! v-stagger (Cv) — scalar copy on the (nx,ny+1) extent.
      call metrics_fold_north_cv_scalar(this%dxCv, grid)
      call metrics_fold_north_cv_scalar(this%dyCv, grid)
      call metrics_fold_north_cv_scalar(this%areaCv, grid)
      call metrics_fold_north_cv_scalar(this%dx_cv, grid)
      ! corner-stagger (Bu) — scalar copy via the corner op with negate=.false.
      call fold_north_corner(this%dxBu, grid%nx_total + 1, grid%ny_total + 1, &
                             ni, nj, ng, negate=.false.)
      call fold_north_corner(this%dyBu, grid%nx_total + 1, grid%ny_total + 1, &
                             ni, nj, ng, negate=.false.)
      call fold_north_corner(this%areaBu, grid%nx_total + 1, grid%ny_total + 1, &
                             ni, nj, ng, negate=.false.)
      call fold_north_corner(this%geolatBu, grid%nx_total + 1, grid%ny_total + 1, &
                             ni, nj, ng, negate=.false.)
      call fold_north_corner(this%geolonBu, grid%nx_total + 1, grid%ny_total + 1, &
                             ni, nj, ng, negate=.false.)
   end subroutine metrics_fold_north_faces