diff --git a/star/private/eps_mdot.f90 b/star/private/eps_mdot.f90 index 40166c40d9..df2157eea0 100644 --- a/star/private/eps_mdot.f90 +++ b/star/private/eps_mdot.f90 @@ -336,6 +336,10 @@ subroutine leak_control(nz, mass_flux, dm, mesh_intersects, ranges,& end if end do + ! Deallocate arrays + deallocate(i_min, i_max, pf) + deallocate(j_min, j_max) + end subroutine leak_control @@ -467,6 +471,9 @@ subroutine leak(nz, i_start, i_end, i_min, i_max, j_min, j_max, pf,& i = i + direction end do + ! Deallocate array + deallocate(excess) + end subroutine leak subroutine calculate_eps_mdot(s, dt, ierr) @@ -700,6 +707,22 @@ subroutine calculate_eps_mdot(s, dt, ierr) write(*,*) 'Err:', err, err / abs_err, err / delta_m, delta_m / s%m(1), abs_err, s%mdot_acoustic_surface*dt end if + ! Deallocate arrays + deallocate(prev_mesh_dm, dm, change_in_dm) + deallocate(mass_flux) + deallocate(mesh_intersects) + deallocate(ranges) + deallocate(density_weighted_flux) + deallocate(total_mass_through_cell) + deallocate(te) + deallocate(p_bar) + deallocate(rho_bar) + deallocate(te_bar) + deallocate(grad_r_sub_grad_a) + deallocate(thermal_energy) + deallocate(eps_mdot_per_total_mass) + deallocate(leak_frac) + deallocate(accumulated) end subroutine calculate_eps_mdot diff --git a/star/private/pulse_fgong.f90 b/star/private/pulse_fgong.f90 index f9980c9c23..ab21b47b7c 100644 --- a/star/private/pulse_fgong.f90 +++ b/star/private/pulse_fgong.f90 @@ -242,6 +242,7 @@ subroutine get_fgong_data (id, & deallocate(s%atm_structure) end if + deallocate(k_a, k_b) deallocate(dres_dxa) deallocate(xa) diff --git a/star/private/pulse_gyre.f90 b/star/private/pulse_gyre.f90 index ec9725a990..e1167e1fce 100644 --- a/star/private/pulse_gyre.f90 +++ b/star/private/pulse_gyre.f90 @@ -264,6 +264,8 @@ subroutine get_gyre_data (id, & deallocate(s%atm_structure) end if + deallocate(k_a, k_b) + return contains diff --git a/star/private/pulse_osc.f90 b/star/private/pulse_osc.f90 index 87cdc9f510..17719bd22e 100644 --- a/star/private/pulse_osc.f90 +++ b/star/private/pulse_osc.f90 @@ -240,6 +240,8 @@ subroutine get_osc_data (id, & deallocate(s%atm_structure) end if + deallocate(k_a, k_b) + return contains diff --git a/star/private/pulse_saio.f90 b/star/private/pulse_saio.f90 index 6f2e1a4614..545c6ebb87 100644 --- a/star/private/pulse_saio.f90 +++ b/star/private/pulse_saio.f90 @@ -156,6 +156,8 @@ subroutine get_saio_data (id, & deallocate(s%atm_structure) end if + deallocate(k_a, k_b) + return contains