ocean_surfflux_dealloc_components Subroutine

private subroutine ocean_surfflux_dealloc_components(this)

Deallocate the component set (no-op on an already-unallocated slot — every deallocate is if (allocated(...))-guarded). Shared by destroy and by set_components re-entry.

Arguments

Type IntentOptional Attributes Name
class(ocean_surface_flux_t), intent(inout) :: this

Called by

proc~~ocean_surfflux_dealloc_components~~CalledByGraph proc~ocean_surfflux_dealloc_components ocean_surfflux_dealloc_components proc~ocean_surfflux_destroy ocean_surface_flux_t%ocean_surfflux_destroy proc~ocean_surfflux_destroy->proc~ocean_surfflux_dealloc_components proc~ocean_surfflux_set_components ocean_surface_flux_t%ocean_surfflux_set_components proc~ocean_surfflux_set_components->proc~ocean_surfflux_dealloc_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

Source Code

   subroutine ocean_surfflux_dealloc_components(this)
      !! Deallocate the component set (no-op on an already-unallocated
      !! slot — every `deallocate` is `if (allocated(...))`-guarded).
      !! Shared by `destroy` and by `set_components` re-entry.
      class(ocean_surface_flux_t), intent(inout) :: this
      if (allocated(this%q_sw)) deallocate (this%q_sw)
      if (allocated(this%q_lw)) deallocate (this%q_lw)
      if (allocated(this%q_lat)) deallocate (this%q_lat)
      if (allocated(this%q_sens)) deallocate (this%q_sens)
      if (allocated(this%heat_added)) deallocate (this%heat_added)
      if (allocated(this%heat_cavity)) deallocate (this%heat_cavity)
      if (allocated(this%evap)) deallocate (this%evap)
      if (allocated(this%lprec)) deallocate (this%lprec)
      if (allocated(this%fprec)) deallocate (this%fprec)
      if (allocated(this%vprec)) deallocate (this%vprec)
      if (allocated(this%lrunoff)) deallocate (this%lrunoff)
      if (allocated(this%frunoff)) deallocate (this%frunoff)
      if (allocated(this%seaice_melt)) deallocate (this%seaice_melt)
      if (allocated(this%heat_content_lprec)) deallocate (this%heat_content_lprec)
      if (allocated(this%heat_content_fprec)) deallocate (this%heat_content_fprec)
      if (allocated(this%heat_content_vprec)) deallocate (this%heat_content_vprec)
      if (allocated(this%heat_content_lrunoff)) deallocate (this%heat_content_lrunoff)
      if (allocated(this%heat_content_frunoff)) deallocate (this%heat_content_frunoff)
      if (allocated(this%heat_content_seaice_melt)) deallocate (this%heat_content_seaice_melt)
      if (allocated(this%heat_content_massin)) deallocate (this%heat_content_massin)
      if (allocated(this%heat_content_massout)) deallocate (this%heat_content_massout)
      if (allocated(this%salt_flux)) deallocate (this%salt_flux)
      if (allocated(this%salt_cavity)) deallocate (this%salt_cavity)
      if (allocated(this%p_surf_atm)) deallocate (this%p_surf_atm)
      if (allocated(this%p_surf)) deallocate (this%p_surf)
   end subroutine ocean_surfflux_dealloc_components