ocean_kappa_shear_init_vertex Subroutine

private subroutine ocean_kappa_shear_init_vertex(this, grid, nz_ml)

Allocate the vertex-mode corner fields and set at_vertex. Called at CONFIGURE time (after init, before enter_data) — deliberately NOT from init, so the (nx+1,ny+1,nz+1) corner carrier is only ever allocated when the vertex form is actually selected (~327 MB at 1000x800x50).

Type Bound

ocean_kappa_shear_t

Arguments

Type IntentOptional Attributes Name
class(ocean_kappa_shear_t), intent(inout) :: this
type(hgrid_t), intent(in) :: grid
integer, intent(in) :: nz_ml

Called by

proc~~ocean_kappa_shear_init_vertex~~CalledByGraph proc~ocean_kappa_shear_init_vertex ocean_kappa_shear_t%ocean_kappa_shear_init_vertex proc~configure_ocean_kappa_shear configure_ocean_kappa_shear proc~configure_ocean_kappa_shear->proc~ocean_kappa_shear_init_vertex proc~engine_setup engine_setup proc~engine_setup->proc~ocean_kappa_shear_init_vertex proc~configure_ocean_lateral configure_ocean_lateral proc~engine_setup->proc~configure_ocean_lateral proc~complete_ocean_create complete_ocean_create proc~complete_ocean_create->proc~engine_setup proc~configure_ocean_lateral->proc~configure_ocean_kappa_shear 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 :: nx
integer, private :: ny

Source Code

   subroutine ocean_kappa_shear_init_vertex(this, grid, nz_ml)
      !! Allocate the vertex-mode corner fields and set `at_vertex`.
      !! Called at CONFIGURE time (after `init`, before `enter_data`) —
      !! deliberately NOT from `init`, so the (nx+1,ny+1,nz+1) corner
      !! carrier is only ever allocated when the vertex form is actually
      !! selected (~327 MB at 1000x800x50).
      class(ocean_kappa_shear_t), intent(inout) :: this
      type(hgrid_t), intent(in) :: grid
      integer, intent(in) :: nz_ml
      integer :: nx, ny

      nx = grid%nx_total
      ny = grid%ny_total
      this%at_vertex = .true.
      if (.not. allocated(this%f_corner)) then
         allocate (this%f_corner(nx + 1, ny + 1), source=0.0_wp)
      end if
      if (.not. allocated(this%kd_corner)) then
         allocate (this%kd_corner(nx + 1, ny + 1, nz_ml + 1), source=0.0_wp)
      end if
   end subroutine ocean_kappa_shear_init_vertex