cleaning of source modules:

- offset and instance are only used locally
- output names are needed only temporarly
- HDF5 is always enabled
This commit is contained in:
Martin Diehl 2019-12-21 07:55:42 +01:00
parent 41650cdd11
commit 19a45d9c2b
6 changed files with 17 additions and 56 deletions

View File

@ -18,12 +18,9 @@ module source_damage_anisoBrittle
implicit none implicit none
private private
integer, dimension(:), allocatable, public, protected :: & integer, dimension(:), allocatable :: &
source_damage_anisoBrittle_offset, & !< which source is my current source mechanism? source_damage_anisoBrittle_offset, & !< which source is my current source mechanism?
source_damage_anisoBrittle_instance !< instance of source mechanism source_damage_anisoBrittle_instance !< instance of source mechanism
character(len=64), dimension(:,:), allocatable :: &
source_damage_anisoBrittle_output !< name of each post result output
integer, dimension(:,:), allocatable :: & integer, dimension(:,:), allocatable :: &
source_damage_anisoBrittle_Ncleavage !< number of cleavage systems per family source_damage_anisoBrittle_Ncleavage !< number of cleavage systems per family
@ -82,7 +79,7 @@ subroutine source_damage_anisoBrittle_init
character(len=65536), dimension(:), allocatable :: & character(len=65536), dimension(:), allocatable :: &
outputs outputs
write(6,'(/,a)') ' <<<+- source_'//SOURCE_DAMAGE_ANISOBRITTLE_LABEL//' init -+>>>' write(6,'(/,a)') ' <<<+- source_'//SOURCE_DAMAGE_ANISOBRITTLE_LABEL//' init -+>>>'; flush(6)
Ninstance = count(phase_source == SOURCE_damage_anisoBrittle_ID) Ninstance = count(phase_source == SOURCE_damage_anisoBrittle_ID)
if (Ninstance == 0) return if (Ninstance == 0) return
@ -100,9 +97,6 @@ subroutine source_damage_anisoBrittle_init
enddo enddo
enddo enddo
allocate(source_damage_anisoBrittle_output(maxval(phase_Noutput),Ninstance))
source_damage_anisoBrittle_output = ''
allocate(source_damage_anisoBrittle_Ncleavage(lattice_maxNcleavageFamily,Ninstance), source=0) allocate(source_damage_anisoBrittle_Ncleavage(lattice_maxNcleavageFamily,Ninstance), source=0)
allocate(param(Ninstance)) allocate(param(Ninstance))
@ -151,7 +145,6 @@ subroutine source_damage_anisoBrittle_init
select case(outputs(i)) select case(outputs(i))
case ('anisobrittle_drivingforce') case ('anisobrittle_drivingforce')
source_damage_anisoBrittle_output(i,source_damage_anisoBrittle_instance(p)) = outputs(i)
prm%outputID = [prm%outputID, damage_drivingforce_ID] prm%outputID = [prm%outputID, damage_drivingforce_ID]
end select end select
@ -266,8 +259,7 @@ end subroutine source_damage_anisoBrittle_getRateAndItsTangent
subroutine source_damage_anisoBrittle_results(phase,group) subroutine source_damage_anisoBrittle_results(phase,group)
integer, intent(in) :: phase integer, intent(in) :: phase
character(len=*), intent(in) :: group character(len=*), intent(in) :: group
#if defined(PETSc) || defined(DAMASK_HDF5)
integer :: sourceOffset, o, instance integer :: sourceOffset, o, instance
instance = source_damage_anisoBrittle_instance(phase) instance = source_damage_anisoBrittle_instance(phase)
@ -281,7 +273,6 @@ subroutine source_damage_anisoBrittle_results(phase,group)
end select end select
enddo outputsLoop enddo outputsLoop
end associate end associate
#endif
end subroutine source_damage_anisoBrittle_results end subroutine source_damage_anisoBrittle_results

View File

@ -17,14 +17,10 @@ module source_damage_anisoDuctile
implicit none implicit none
private private
integer, dimension(:), allocatable, public, protected :: & integer, dimension(:), allocatable :: &
source_damage_anisoDuctile_offset, & !< which source is my current damage mechanism? source_damage_anisoDuctile_offset, & !< which source is my current damage mechanism?
source_damage_anisoDuctile_instance !< instance of damage source mechanism source_damage_anisoDuctile_instance !< instance of damage source mechanism
character(len=64), dimension(:,:), allocatable, target, public :: &
source_damage_anisoDuctile_output !< name of each post result output
enum, bind(c) enum, bind(c)
enumerator :: undefined_ID, & enumerator :: undefined_ID, &
damage_drivingforce_ID damage_drivingforce_ID
@ -76,7 +72,7 @@ subroutine source_damage_anisoDuctile_init
character(len=65536), dimension(:), allocatable :: & character(len=65536), dimension(:), allocatable :: &
outputs outputs
write(6,'(/,a)') ' <<<+- source_'//SOURCE_DAMAGE_ANISODUCTILE_LABEL//' init -+>>>' write(6,'(/,a)') ' <<<+- source_'//SOURCE_DAMAGE_ANISODUCTILE_LABEL//' init -+>>>'; flush(6)
Ninstance = count(phase_source == SOURCE_damage_anisoDuctile_ID) Ninstance = count(phase_source == SOURCE_damage_anisoDuctile_ID)
if (Ninstance == 0) return if (Ninstance == 0) return
@ -93,10 +89,6 @@ subroutine source_damage_anisoDuctile_init
source_damage_anisoDuctile_offset(phase) = source source_damage_anisoDuctile_offset(phase) = source
enddo enddo
enddo enddo
allocate(source_damage_anisoDuctile_output(maxval(phase_Noutput),Ninstance))
source_damage_anisoDuctile_output = ''
allocate(param(Ninstance)) allocate(param(Ninstance))
@ -136,7 +128,6 @@ subroutine source_damage_anisoDuctile_init
select case(outputs(i)) select case(outputs(i))
case ('anisoductile_drivingforce') case ('anisoductile_drivingforce')
source_damage_anisoDuctile_output(i,source_damage_anisoDuctile_instance(p)) = outputs(i)
prm%outputID = [prm%outputID, damage_drivingforce_ID] prm%outputID = [prm%outputID, damage_drivingforce_ID]
end select end select
@ -227,7 +218,6 @@ subroutine source_damage_anisoDuctile_results(phase,group)
integer, intent(in) :: phase integer, intent(in) :: phase
character(len=*), intent(in) :: group character(len=*), intent(in) :: group
#if defined(PETSc) || defined(DAMASK_HDF5)
integer :: sourceOffset, o, instance integer :: sourceOffset, o, instance
instance = source_damage_anisoDuctile_instance(phase) instance = source_damage_anisoDuctile_instance(phase)
@ -241,7 +231,6 @@ subroutine source_damage_anisoDuctile_results(phase,group)
end select end select
enddo outputsLoop enddo outputsLoop
end associate end associate
#endif
end subroutine source_damage_anisoDuctile_results end subroutine source_damage_anisoDuctile_results

View File

@ -16,11 +16,9 @@ module source_damage_isoBrittle
implicit none implicit none
private private
integer, dimension(:), allocatable, public, protected :: & integer, dimension(:), allocatable :: &
source_damage_isoBrittle_offset, & source_damage_isoBrittle_offset, &
source_damage_isoBrittle_instance source_damage_isoBrittle_instance
character(len=64), dimension(:,:), allocatable :: &
source_damage_isoBrittle_output
enum, bind(c) enum, bind(c)
enumerator :: & enumerator :: &
@ -67,7 +65,7 @@ subroutine source_damage_isoBrittle_init
character(len=65536), dimension(:), allocatable :: & character(len=65536), dimension(:), allocatable :: &
outputs outputs
write(6,'(/,a)') ' <<<+- source_'//SOURCE_DAMAGE_ISOBRITTLE_LABEL//' init -+>>>' write(6,'(/,a)') ' <<<+- source_'//SOURCE_DAMAGE_ISOBRITTLE_LABEL//' init -+>>>'; flush(6)
Ninstance = count(phase_source == SOURCE_damage_isoBrittle_ID) Ninstance = count(phase_source == SOURCE_damage_isoBrittle_ID)
if (Ninstance == 0) return if (Ninstance == 0) return
@ -84,9 +82,6 @@ subroutine source_damage_isoBrittle_init
source_damage_isoBrittle_offset(phase) = source source_damage_isoBrittle_offset(phase) = source
enddo enddo
enddo enddo
allocate(source_damage_isoBrittle_output(maxval(phase_Noutput),Ninstance))
source_damage_isoBrittle_output = ''
allocate(param(Ninstance)) allocate(param(Ninstance))
@ -120,7 +115,6 @@ subroutine source_damage_isoBrittle_init
select case(outputs(i)) select case(outputs(i))
case ('isobrittle_drivingforce') case ('isobrittle_drivingforce')
source_damage_isoBrittle_output(i,source_damage_isoBrittle_instance(p)) = outputs(i)
prm%outputID = [prm%outputID, damage_drivingforce_ID] prm%outputID = [prm%outputID, damage_drivingforce_ID]
end select end select
@ -218,8 +212,7 @@ end subroutine source_damage_isoBrittle_getRateAndItsTangent
subroutine source_damage_isoBrittle_results(phase,group) subroutine source_damage_isoBrittle_results(phase,group)
integer, intent(in) :: phase integer, intent(in) :: phase
character(len=*), intent(in) :: group character(len=*), intent(in) :: group
#if defined(PETSc) || defined(DAMASK_HDF5)
integer :: sourceOffset, o, instance integer :: sourceOffset, o, instance
instance = source_damage_isoBrittle_instance(phase) instance = source_damage_isoBrittle_instance(phase)
@ -233,7 +226,6 @@ subroutine source_damage_isoBrittle_results(phase,group)
end select end select
enddo outputsLoop enddo outputsLoop
end associate end associate
#endif
end subroutine source_damage_isoBrittle_results end subroutine source_damage_isoBrittle_results

View File

@ -15,18 +15,14 @@ module source_damage_isoDuctile
implicit none implicit none
private private
integer, dimension(:), allocatable, public, protected :: & integer, dimension(:), allocatable :: &
source_damage_isoDuctile_offset, & !< which source is my current damage mechanism? source_damage_isoDuctile_offset, & !< which source is my current damage mechanism?
source_damage_isoDuctile_instance !< instance of damage source mechanism source_damage_isoDuctile_instance !< instance of damage source mechanism
character(len=64), dimension(:,:), allocatable, target, public :: &
source_damage_isoDuctile_output !< name of each post result output
enum, bind(c) enum, bind(c)
enumerator :: undefined_ID, & enumerator :: undefined_ID, &
damage_drivingforce_ID damage_drivingforce_ID
end enum !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!11 ToDo end enum !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ToDo
type, private :: tParameters !< container type for internal constitutive parameters type, private :: tParameters !< container type for internal constitutive parameters
real(pReal) :: & real(pReal) :: &
@ -83,9 +79,6 @@ subroutine source_damage_isoDuctile_init
source_damage_isoDuctile_offset(phase) = source source_damage_isoDuctile_offset(phase) = source
enddo enddo
enddo enddo
allocate(source_damage_isoDuctile_output(maxval(phase_Noutput),Ninstance))
source_damage_isoDuctile_output = ''
allocate(param(Ninstance)) allocate(param(Ninstance))
@ -119,7 +112,6 @@ subroutine source_damage_isoDuctile_init
select case(outputs(i)) select case(outputs(i))
case ('isoductile_drivingforce') case ('isoductile_drivingforce')
source_damage_isoDuctile_output(i,source_damage_isoDuctile_instance(p)) = outputs(i)
prm%outputID = [prm%outputID, damage_drivingforce_ID] prm%outputID = [prm%outputID, damage_drivingforce_ID]
end select end select
@ -198,8 +190,7 @@ end subroutine source_damage_isoDuctile_getRateAndItsTangent
subroutine source_damage_isoDuctile_results(phase,group) subroutine source_damage_isoDuctile_results(phase,group)
integer, intent(in) :: phase integer, intent(in) :: phase
character(len=*), intent(in) :: group character(len=*), intent(in) :: group
#if defined(PETSc) || defined(DAMASK_HDF5)
integer :: sourceOffset, o, instance integer :: sourceOffset, o, instance
instance = source_damage_isoDuctile_instance(phase) instance = source_damage_isoDuctile_instance(phase)
@ -213,7 +204,6 @@ subroutine source_damage_isoDuctile_results(phase,group)
end select end select
enddo outputsLoop enddo outputsLoop
end associate end associate
#endif
end subroutine source_damage_isoDuctile_results end subroutine source_damage_isoDuctile_results

View File

@ -14,7 +14,7 @@ module source_thermal_dissipation
implicit none implicit none
private private
integer, dimension(:), allocatable, public, protected :: & integer, dimension(:), allocatable :: &
source_thermal_dissipation_offset, & !< which source is my current thermal dissipation mechanism? source_thermal_dissipation_offset, & !< which source is my current thermal dissipation mechanism?
source_thermal_dissipation_instance !< instance of thermal dissipation source mechanism source_thermal_dissipation_instance !< instance of thermal dissipation source mechanism
@ -39,10 +39,9 @@ contains
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine source_thermal_dissipation_init subroutine source_thermal_dissipation_init
integer :: Ninstance,instance,source,sourceOffset integer :: Ninstance,instance,source,sourceOffset,NofMyPhase,p
integer :: NofMyPhase,p
write(6,'(/,a)') ' <<<+- source_'//SOURCE_thermal_dissipation_label//' init -+>>>' write(6,'(/,a)') ' <<<+- source_'//SOURCE_thermal_dissipation_label//' init -+>>>'; flush(6)
Ninstance = count(phase_source == SOURCE_thermal_dissipation_ID) Ninstance = count(phase_source == SOURCE_thermal_dissipation_ID)

View File

@ -14,7 +14,7 @@ module source_thermal_externalheat
implicit none implicit none
private private
integer, dimension(:), allocatable, public, protected :: & integer, dimension(:), allocatable :: &
source_thermal_externalheat_offset, & !< which source is my current thermal dissipation mechanism? source_thermal_externalheat_offset, & !< which source is my current thermal dissipation mechanism?
source_thermal_externalheat_instance !< instance of thermal dissipation source mechanism source_thermal_externalheat_instance !< instance of thermal dissipation source mechanism
@ -43,9 +43,9 @@ contains
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine source_thermal_externalheat_init subroutine source_thermal_externalheat_init
integer :: maxNinstance,instance,source,sourceOffset,NofMyPhase,p integer :: maxNinstance,instance,source,sourceOffset,NofMyPhase,p
write(6,'(/,a)') ' <<<+- source_'//SOURCE_thermal_externalheat_label//' init -+>>>' write(6,'(/,a)') ' <<<+- source_'//SOURCE_thermal_externalheat_label//' init -+>>>'; flush(6)
maxNinstance = count(phase_source == SOURCE_thermal_externalheat_ID) maxNinstance = count(phase_source == SOURCE_thermal_externalheat_ID)