ocean_surfflux_alloc_components Subroutine

private subroutine ocean_surfflux_alloc_components(this, grid)

Allocate the 22-field component set + the two p_surf* fields, all source=0.0_wp, shape (nx_total, ny_total). Private — called only from set_components.

Arguments

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

Called by

proc~~ocean_surfflux_alloc_components~~CalledByGraph proc~ocean_surfflux_alloc_components ocean_surfflux_alloc_components proc~ocean_surfflux_set_components ocean_surface_flux_t%ocean_surfflux_set_components proc~ocean_surfflux_set_components->proc~ocean_surfflux_alloc_components proc~engine_setup engine_setup proc~engine_setup->proc~ocean_surfflux_set_components 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 :: nx
integer, private :: ny

Source Code

   subroutine ocean_surfflux_alloc_components(this, grid)
      !! Allocate the 22-field component set + the two `p_surf*` fields,
      !! all `source=0.0_wp`, shape `(nx_total, ny_total)`.  Private —
      !! called only from `set_components`.
      class(ocean_surface_flux_t), intent(inout) :: this
      type(hgrid_t), intent(in) :: grid
      integer :: nx, ny
      nx = grid%nx_total
      ny = grid%ny_total
      allocate (this%q_sw(nx, ny), source=0.0_wp)
      allocate (this%q_lw(nx, ny), source=0.0_wp)
      allocate (this%q_lat(nx, ny), source=0.0_wp)
      allocate (this%q_sens(nx, ny), source=0.0_wp)
      allocate (this%heat_added(nx, ny), source=0.0_wp)
      allocate (this%heat_cavity(nx, ny), source=0.0_wp)
      allocate (this%evap(nx, ny), source=0.0_wp)
      allocate (this%lprec(nx, ny), source=0.0_wp)
      allocate (this%fprec(nx, ny), source=0.0_wp)
      allocate (this%vprec(nx, ny), source=0.0_wp)
      allocate (this%lrunoff(nx, ny), source=0.0_wp)
      allocate (this%frunoff(nx, ny), source=0.0_wp)
      allocate (this%seaice_melt(nx, ny), source=0.0_wp)
      allocate (this%heat_content_lprec(nx, ny), source=0.0_wp)
      allocate (this%heat_content_fprec(nx, ny), source=0.0_wp)
      allocate (this%heat_content_vprec(nx, ny), source=0.0_wp)
      allocate (this%heat_content_lrunoff(nx, ny), source=0.0_wp)
      allocate (this%heat_content_frunoff(nx, ny), source=0.0_wp)
      allocate (this%heat_content_seaice_melt(nx, ny), source=0.0_wp)
      allocate (this%heat_content_massin(nx, ny), source=0.0_wp)
      allocate (this%heat_content_massout(nx, ny), source=0.0_wp)
      allocate (this%salt_flux(nx, ny), source=0.0_wp)
      allocate (this%salt_cavity(nx, ny), source=0.0_wp)
      allocate (this%p_surf_atm(nx, ny), source=0.0_wp)
      allocate (this%p_surf(nx, ny), source=0.0_wp)
   end subroutine ocean_surfflux_alloc_components