finalize_energy Subroutine

public subroutine finalize_energy(energy)

Deallocate all energy arrays.

Arguments

Type IntentOptional Attributes Name
type(energy_fields_t), intent(inout) :: energy

Source Code

   subroutine finalize_energy(energy)
      type(energy_fields_t), intent(inout) :: energy

      if (allocated(energy%T)) deallocate(energy%T)
      if (allocated(energy%T_old)) deallocate(energy%T_old)
      if (allocated(energy%h)) deallocate(energy%h)
      if (allocated(energy%h_old)) deallocate(energy%h_old)
      if (allocated(energy%rhs_old)) deallocate(energy%rhs_old)
      if (allocated(energy%qrad)) deallocate(energy%qrad)
      if (allocated(energy%cp)) deallocate(energy%cp)
      if (allocated(energy%lambda)) deallocate(energy%lambda)
      if (allocated(energy%rho_thermo)) deallocate(energy%rho_thermo)
      if (allocated(energy%operator_consistent_rho_h)) deallocate(energy%operator_consistent_rho_h)
      if (allocated(energy%species_enthalpy_diffusion)) deallocate(energy%species_enthalpy_diffusion)
      if (allocated(energy%chem_heat_release_rate)) deallocate(energy%chem_heat_release_rate)
      if (allocated(energy%chem_dT_dt)) deallocate(energy%chem_dT_dt)
      if (allocated(energy%chem_dY_max_dt)) deallocate(energy%chem_dY_max_dt)
      if (allocated(energy%chem_rel_rho_change_dt)) deallocate(energy%chem_rel_rho_change_dt)
      if (allocated(energy%chem_source_alpha)) deallocate(energy%chem_source_alpha)
      if (allocated(energy%chem_active)) deallocate(energy%chem_active)

      energy%operator_consistent_rho_h_available = 0
      energy%rhs_old_valid = .false.
      energy%initialized = .false.
   end subroutine finalize_energy