metrics_fill_tripolar_whole Subroutine

private subroutine metrics_fill_tripolar_whole(this, grid, lon_west, lat_south, dlat_deg, rad_earth, phi_join, lon_pole)

The undecomposed tripolar build behind metrics_fill_tripolar: grid must hold the WHOLE grid (its local extents are the global ones), so the fold and the periodic seam are both local.

Arguments

Type IntentOptional Attributes Name
type(ocean_metrics_t), intent(inout) :: this
type(hgrid_t), intent(in) :: grid
real(kind=wp), intent(in) :: lon_west
real(kind=wp), intent(in) :: lat_south
real(kind=wp), intent(in) :: dlat_deg
real(kind=wp), intent(in) :: rad_earth
real(kind=wp), intent(in) :: phi_join
real(kind=wp), intent(in) :: lon_pole

Calls

proc~~metrics_fill_tripolar_whole~~CallsGraph proc~metrics_fill_tripolar_whole metrics_fill_tripolar_whole proc~metrics_assemble_from_supergrid_arrays metrics_assemble_from_supergrid_arrays proc~metrics_fill_tripolar_whole->proc~metrics_assemble_from_supergrid_arrays proc~metrics_fold_periodic_ghosts metrics_fold_periodic_ghosts proc~metrics_fill_tripolar_whole->proc~metrics_fold_periodic_ghosts proc~supergrid_angle_dx_from_geography supergrid_angle_dx_from_geography proc~metrics_fill_tripolar_whole->proc~supergrid_angle_dx_from_geography proc~tripolar_supergrid_arrays tripolar_supergrid_arrays proc~metrics_fill_tripolar_whole->proc~tripolar_supergrid_arrays proc~supergrid_ghost_fill_2d supergrid_ghost_fill_2d proc~metrics_assemble_from_supergrid_arrays->proc~supergrid_ghost_fill_2d proc~supergrid_ghost_fill_bu supergrid_ghost_fill_bu proc~metrics_assemble_from_supergrid_arrays->proc~supergrid_ghost_fill_bu proc~supergrid_ghost_fill_cu supergrid_ghost_fill_cu proc~metrics_assemble_from_supergrid_arrays->proc~supergrid_ghost_fill_cu proc~supergrid_ghost_fill_cv supergrid_ghost_fill_cv proc~metrics_assemble_from_supergrid_arrays->proc~supergrid_ghost_fill_cv interface~fold_north_centre fold_north_centre proc~metrics_fold_periodic_ghosts->interface~fold_north_centre proc~metrics_fold_north_faces metrics_fold_north_faces proc~metrics_fold_periodic_ghosts->proc~metrics_fold_north_faces proc~metrics_periodic_x_all metrics_periodic_x_all proc~metrics_fold_periodic_ghosts->proc~metrics_periodic_x_all proc~great_circle great_circle proc~tripolar_supergrid_arrays->proc~great_circle proc~spherical_quad_area spherical_quad_area proc~tripolar_supergrid_arrays->proc~spherical_quad_area proc~tripolar_node_latlon tripolar_node_latlon proc~tripolar_supergrid_arrays->proc~tripolar_node_latlon proc~fold_north_centre_2d fold_north_centre_2d interface~fold_north_centre->proc~fold_north_centre_2d proc~fold_north_centre_3d fold_north_centre_3d interface~fold_north_centre->proc~fold_north_centre_3d 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~metrics_periodic_x_2d metrics_periodic_x_2d proc~metrics_periodic_x_all->proc~metrics_periodic_x_2d proc~metrics_periodic_x_bu metrics_periodic_x_bu proc~metrics_periodic_x_all->proc~metrics_periodic_x_bu proc~metrics_periodic_x_cu metrics_periodic_x_cu proc~metrics_periodic_x_all->proc~metrics_periodic_x_cu proc~metrics_periodic_x_cv metrics_periodic_x_cv proc~metrics_periodic_x_all->proc~metrics_periodic_x_cv proc~spherical_tri_area spherical_tri_area proc~spherical_quad_area->proc~spherical_tri_area proc~bipolar_corner_latlon bipolar_corner_latlon proc~tripolar_node_latlon->proc~bipolar_corner_latlon proc~fold_north_corner_2d fold_north_corner_2d interface~fold_north_corner->proc~fold_north_corner_2d proc~spherical_tri_area->proc~great_circle local local proc~fold_north_corner_2d->local

Called by

proc~~metrics_fill_tripolar_whole~~CalledByGraph proc~metrics_fill_tripolar_whole metrics_fill_tripolar_whole proc~metrics_fill_tripolar metrics_fill_tripolar proc~metrics_fill_tripolar->proc~metrics_fill_tripolar_whole proc~configure_ocean_metrics configure_ocean_metrics proc~configure_ocean_metrics->proc~metrics_fill_tripolar proc~engine_setup engine_setup proc~engine_setup->proc~configure_ocean_metrics 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
real(kind=wp), private, allocatable :: sg_area(:,:)
real(kind=wp), private, allocatable :: sg_dx(:,:)
real(kind=wp), private, allocatable :: sg_dy(:,:)
real(kind=wp), private, allocatable :: sg_x(:,:)
real(kind=wp), private, allocatable :: sg_y(:,:)

Source Code

   subroutine metrics_fill_tripolar_whole(this, grid, lon_west, lat_south, &
                                          dlat_deg, rad_earth, phi_join, lon_pole)
      !! The undecomposed tripolar build behind `metrics_fill_tripolar`:
      !! `grid` must hold the WHOLE grid (its local extents are the global
      !! ones), so the fold and the periodic seam are both local.
      type(ocean_metrics_t), intent(inout) :: this
      type(hgrid_t), intent(in) :: grid
      real(wp), intent(in) :: lon_west, lat_south, dlat_deg
      real(wp), intent(in) :: rad_earth, phi_join, lon_pole

      real(wp), allocatable :: sg_x(:, :), sg_y(:, :)
      real(wp), allocatable :: sg_dx(:, :), sg_dy(:, :), sg_area(:, :)

      call tripolar_supergrid_arrays(grid, lon_west, lat_south, dlat_deg, rad_earth, &
                                     phi_join, lon_pole, sg_x, sg_y, sg_dx, sg_dy, sg_area)

      call metrics_assemble_from_supergrid_arrays(this, grid, &
                                                  sg_x, sg_y, sg_dx, sg_dy, sg_area, &
                                                  periodic_x=.true., &
                                                  sg_angle_dx=supergrid_angle_dx_from_geography(sg_x, sg_y))

      ! Replace the assembler's constant-extrapolation ghosts on the seam
      ! edges with the physically-correct fold (north) + periodic (east-west)
      ! values.  Every metric/geography array is a SCALAR under the fold
      ! reflection (lengths/areas invariant; geography reads the conjugate
      ! point's stored coordinate), so all fold ops use negate=.false.
      call metrics_fold_periodic_ghosts(this, grid)

      deallocate (sg_x, sg_y, sg_dx, sg_dy, sg_area)
   end subroutine metrics_fill_tripolar_whole