From 5187ee25b62199b74605c038f2ad2a09f9e37d2b Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 19 May 2018 11:20:04 +0200 Subject: [PATCH] destroying unused object causes problem with PETSc 3.9 not clear, why destroying at the end of the program is anyway needed, so removed it --- src/DAMASK_spectral.f90 | 22 ++-------------------- src/spectral_damage.f90 | 18 ++---------------- src/spectral_interface.f90 | 1 - src/spectral_mech_Basic.f90 | 19 +------------------ src/spectral_mech_Polarisation.f90 | 19 +------------------ src/spectral_thermal.f90 | 18 ++---------------- src/spectral_utilities.f90 | 18 ------------------ 7 files changed, 8 insertions(+), 107 deletions(-) diff --git a/src/DAMASK_spectral.f90 b/src/DAMASK_spectral.f90 index c9c1d1fb0..ba7c93144 100644 --- a/src/DAMASK_spectral.f90 +++ b/src/DAMASK_spectral.f90 @@ -72,7 +72,6 @@ program DAMASK_spectral DAMAGE_nonlocal_ID use spectral_utilities, only: & utilities_init, & - utilities_destroy, & tSolutionState, & tLoadCase, & cutBack, & @@ -673,23 +672,12 @@ end program DAMASK_spectral !> stderr. Exit code 3 signals no severe problems, but some increments did not converge !-------------------------------------------------------------------------------------------------- subroutine quit(stop_id) +#include use MPI use prec, only: & pInt - use spectral_mech_Basic, only: & - BasicPETSC_destroy - use spectral_mech_Polarisation, only: & - Polarisation_destroy - use spectral_damage, only: & - spectral_damage_destroy - use spectral_thermal, only: & - spectral_thermal_destroy - use spectral_utilities, only: & - utilities_destroy - - implicit none -#include + implicit none integer(pInt), intent(in) :: stop_id integer, dimension(8) :: dateAndTime ! type default integer integer(pInt) :: error = 0_pInt @@ -699,12 +687,6 @@ subroutine quit(stop_id) external :: & PETScFinalize - call BasicPETSC_destroy() - call Polarisation_destroy() - call spectral_damage_destroy() - call spectral_thermal_destroy() - call utilities_destroy() - call PETScFinalize(ierr) if (ierr /= 0) write(6,'(a)') ' Error in PETScFinalize' #ifdef _OPENMP diff --git a/src/spectral_damage.f90 b/src/spectral_damage.f90 index d35da3f8b..def1af303 100644 --- a/src/spectral_damage.f90 +++ b/src/spectral_damage.f90 @@ -49,8 +49,7 @@ module spectral_damage public :: & spectral_damage_init, & spectral_damage_solution, & - spectral_damage_forward, & - spectral_damage_destroy + spectral_damage_forward external :: & PETScErrorF ! is called in the CHKERRQ macro @@ -383,19 +382,6 @@ subroutine spectral_damage_forward() call MPI_Allreduce(MPI_IN_PLACE,mobility_ref,1,MPI_DOUBLE,MPI_SUM,PETSC_COMM_WORLD,ierr) endif - end subroutine spectral_damage_forward - -!-------------------------------------------------------------------------------------------------- -!> @brief destroy routine -!-------------------------------------------------------------------------------------------------- -subroutine spectral_damage_destroy() - - implicit none - PetscErrorCode :: ierr - - call VecDestroy(solution,ierr); CHKERRQ(ierr) - call SNESDestroy(damage_snes,ierr); CHKERRQ(ierr) - -end subroutine spectral_damage_destroy +end subroutine spectral_damage_forward end module spectral_damage diff --git a/src/spectral_interface.f90 b/src/spectral_interface.f90 index 99717c684..d2adcf9ba 100644 --- a/src/spectral_interface.f90 +++ b/src/spectral_interface.f90 @@ -524,5 +524,4 @@ pure function IIO_stringPos(string) end function IIO_stringPos - end module diff --git a/src/spectral_mech_Basic.f90 b/src/spectral_mech_Basic.f90 index 7d4397e26..8fd2b7d96 100644 --- a/src/spectral_mech_Basic.f90 +++ b/src/spectral_mech_Basic.f90 @@ -67,8 +67,7 @@ module spectral_mech_basic public :: & basicPETSc_init, & basicPETSc_solution, & - BasicPETSc_forward, & - basicPETSc_destroy + BasicPETSc_forward external :: & PETScErrorF ! is called in the CHKERRQ macro @@ -541,20 +540,4 @@ subroutine BasicPETSc_forward(guess,timeinc,timeinc_old,loadCaseTime,deformation end subroutine BasicPETSc_forward -!-------------------------------------------------------------------------------------------------- -!> @brief destroy routine -!-------------------------------------------------------------------------------------------------- -subroutine BasicPETSc_destroy() - use spectral_utilities, only: & - Utilities_destroy - - implicit none - PetscErrorCode :: ierr - - call VecDestroy(solution_vec,ierr); CHKERRQ(ierr) - call SNESDestroy(snes,ierr); CHKERRQ(ierr) - call DMDestroy(da,ierr); CHKERRQ(ierr) - -end subroutine BasicPETSc_destroy - end module spectral_mech_basic diff --git a/src/spectral_mech_Polarisation.f90 b/src/spectral_mech_Polarisation.f90 index 6cf80d73b..9e567f0c9 100644 --- a/src/spectral_mech_Polarisation.f90 +++ b/src/spectral_mech_Polarisation.f90 @@ -73,8 +73,7 @@ module spectral_mech_Polarisation public :: & Polarisation_init, & Polarisation_solution, & - Polarisation_forward, & - Polarisation_destroy + Polarisation_forward external :: & PETScErrorF ! is called in the CHKERRQ macro @@ -675,20 +674,4 @@ subroutine Polarisation_forward(guess,timeinc,timeinc_old,loadCaseTime,deformati end subroutine Polarisation_forward -!-------------------------------------------------------------------------------------------------- -!> @brief destroy routine -!-------------------------------------------------------------------------------------------------- -subroutine Polarisation_destroy() - use spectral_utilities, only: & - Utilities_destroy - - implicit none - PetscErrorCode :: ierr - - call VecDestroy(solution_vec,ierr); CHKERRQ(ierr) - call SNESDestroy(snes,ierr); CHKERRQ(ierr) - call DMDestroy(da,ierr); CHKERRQ(ierr) - -end subroutine Polarisation_destroy - end module spectral_mech_Polarisation diff --git a/src/spectral_thermal.f90 b/src/spectral_thermal.f90 index c3f904939..8e5b95ab9 100644 --- a/src/spectral_thermal.f90 +++ b/src/spectral_thermal.f90 @@ -49,8 +49,7 @@ module spectral_thermal public :: & spectral_thermal_init, & spectral_thermal_solution, & - spectral_thermal_forward, & - spectral_thermal_destroy + spectral_thermal_forward external :: & PETScErrorF ! is called in the CHKERRQ macro @@ -390,19 +389,6 @@ subroutine spectral_thermal_forward() call MPI_Allreduce(MPI_IN_PLACE,mobility_ref,1,MPI_DOUBLE,MPI_SUM,PETSC_COMM_WORLD,ierr) endif - end subroutine spectral_thermal_forward - -!-------------------------------------------------------------------------------------------------- -!> @brief destroy routine -!-------------------------------------------------------------------------------------------------- -subroutine spectral_thermal_destroy() - - implicit none - PetscErrorCode :: ierr - - call VecDestroy(solution,ierr); CHKERRQ(ierr) - call SNESDestroy(thermal_snes,ierr); CHKERRQ(ierr) - -end subroutine spectral_thermal_destroy +end subroutine spectral_thermal_forward end module spectral_thermal diff --git a/src/spectral_utilities.f90 b/src/spectral_utilities.f90 index 46b376d23..2a807f385 100644 --- a/src/spectral_utilities.f90 +++ b/src/spectral_utilities.f90 @@ -140,7 +140,6 @@ module spectral_utilities utilities_constitutiveResponse, & utilities_calculateRate, & utilities_forwardField, & - utilities_destroy, & utilities_updateIPcoords, & FIELD_UNDEFINED_ID, & FIELD_MECH_ID, & @@ -1200,21 +1199,4 @@ subroutine utilities_updateIPcoords(F) end subroutine utilities_updateIPcoords - -!-------------------------------------------------------------------------------------------------- -!> @brief cleans up -!-------------------------------------------------------------------------------------------------- -subroutine utilities_destroy() - implicit none - - call fftw_destroy_plan(planTensorForth) - call fftw_destroy_plan(planTensorBack) - call fftw_destroy_plan(planVectorForth) - call fftw_destroy_plan(planVectorBack) - call fftw_destroy_plan(planScalarForth) - call fftw_destroy_plan(planScalarBack) - -end subroutine utilities_destroy - - end module spectral_utilities