From 2429eee079c14b83b89848467cb2f0b29e0976d5 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 29 Feb 2020 08:03:06 +0100 Subject: [PATCH] no need for 2 variables --- src/source_damage_anisoBrittle.f90 | 10 ++++------ src/source_damage_anisoDuctile.f90 | 10 ++++------ src/source_damage_isoBrittle.f90 | 10 ++++------ src/source_damage_isoDuctile.f90 | 10 ++++------ src/source_thermal_dissipation.f90 | 10 ++++------ src/source_thermal_externalheat.f90 | 10 ++++------ 6 files changed, 24 insertions(+), 36 deletions(-) diff --git a/src/source_damage_anisoBrittle.f90 b/src/source_damage_anisoBrittle.f90 index a532e3e4e..7473524e7 100644 --- a/src/source_damage_anisoBrittle.f90 +++ b/src/source_damage_anisoBrittle.f90 @@ -58,7 +58,7 @@ contains !-------------------------------------------------------------------------------------------------- subroutine source_damage_anisoBrittle_init - integer :: Ninstance,source,sourceOffset,NofMyPhase,p + integer :: Ninstance,sourceOffset,NofMyPhase,p character(len=pStringLen) :: & extmsg = '' @@ -74,9 +74,9 @@ subroutine source_damage_anisoBrittle_init do p = 1, size(config_phase) source_damage_anisoBrittle_instance(p) = count(phase_source(:,1:p) == SOURCE_DAMAGE_ANISOBRITTLE_ID) - do source = 1, phase_Nsources(p) - if (phase_source(source,p) == SOURCE_DAMAGE_ANISOBRITTLE_ID) & - source_damage_anisoBrittle_offset(p) = source + do sourceOffset = 1, phase_Nsources(p) + if (phase_source(sourceOffset,p) == SOURCE_DAMAGE_ANISOBRITTLE_ID) & + source_damage_anisoBrittle_offset(p) = sourceOffset enddo if (all(phase_source(:,p) /= SOURCE_DAMAGE_ANISOBRITTLE_ID)) cycle @@ -116,8 +116,6 @@ subroutine source_damage_anisoBrittle_init prm%output = config%getStrings('(output)',defaultVal=emptyStringArray) NofMyPhase = count(material_phaseAt==p) * discretization_nIP - sourceOffset = source_damage_anisoBrittle_offset(p) - call material_allocateSourceState(p,sourceOffset,NofMyPhase,1,1,0) sourceState(p)%p(sourceOffset)%aTolState=prm%aTol diff --git a/src/source_damage_anisoDuctile.f90 b/src/source_damage_anisoDuctile.f90 index 169543dbd..c4df0f686 100644 --- a/src/source_damage_anisoDuctile.f90 +++ b/src/source_damage_anisoDuctile.f90 @@ -53,7 +53,7 @@ contains !-------------------------------------------------------------------------------------------------- subroutine source_damage_anisoDuctile_init - integer :: Ninstance,source,sourceOffset,NofMyPhase,p + integer :: Ninstance,sourceOffset,NofMyPhase,p character(len=pStringLen) :: & extmsg = '' @@ -69,9 +69,9 @@ subroutine source_damage_anisoDuctile_init do p = 1, size(config_phase) source_damage_anisoDuctile_instance(p) = count(phase_source(:,1:p) == SOURCE_DAMAGE_ANISODUCTILE_ID) - do source = 1, phase_Nsources(p) - if (phase_source(source,p) == SOURCE_DAMAGE_ANISODUCTILE_ID) & - source_damage_anisoDuctile_offset(p) = source + do sourceOffset = 1, phase_Nsources(p) + if (phase_source(sourceOffset,p) == SOURCE_DAMAGE_ANISODUCTILE_ID) & + source_damage_anisoDuctile_offset(p) = sourceOffset enddo if (all(phase_source(:,p) /= SOURCE_DAMAGE_ANISODUCTILE_ID)) cycle @@ -103,8 +103,6 @@ subroutine source_damage_anisoDuctile_init prm%output = config%getStrings('(output)',defaultVal=emptyStringArray) NofMyPhase=count(material_phaseAt==p) * discretization_nIP - sourceOffset = source_damage_anisoDuctile_offset(p) - call material_allocateSourceState(p,sourceOffset,NofMyPhase,1,1,0) sourceState(p)%p(sourceOffset)%aTolState=prm%aTol diff --git a/src/source_damage_isoBrittle.f90 b/src/source_damage_isoBrittle.f90 index d8ae7768c..b2f83a0f3 100644 --- a/src/source_damage_isoBrittle.f90 +++ b/src/source_damage_isoBrittle.f90 @@ -48,7 +48,7 @@ contains !-------------------------------------------------------------------------------------------------- subroutine source_damage_isoBrittle_init - integer :: Ninstance,source,sourceOffset,NofMyPhase,p + integer :: Ninstance,sourceOffset,NofMyPhase,p character(len=pStringLen) :: & extmsg = '' @@ -64,9 +64,9 @@ subroutine source_damage_isoBrittle_init do p = 1, size(config_phase) source_damage_isoBrittle_instance(p) = count(phase_source(:,1:p) == SOURCE_DAMAGE_ISOBRITTLE_ID) - do source = 1, phase_Nsources(p) - if (phase_source(source,p) == SOURCE_DAMAGE_ISOBRITTLE_ID) & - source_damage_isoBrittle_offset(p) = source + do sourceOffset = 1, phase_Nsources(p) + if (phase_source(sourceOffset,p) == SOURCE_DAMAGE_ISOBRITTLE_ID) & + source_damage_isoBrittle_offset(p) = sourceOffset enddo if (all(phase_source(:,p) /= SOURCE_DAMAGE_ISOBRITTLE_ID)) cycle @@ -92,8 +92,6 @@ subroutine source_damage_isoBrittle_init prm%output = config%getStrings('(output)',defaultVal=emptyStringArray) NofMyPhase = count(material_phaseAt==p) * discretization_nIP - sourceOffset = source_damage_isoBrittle_offset(p) - call material_allocateSourceState(p,sourceOffset,NofMyPhase,1,1,1) sourceState(p)%p(sourceOffset)%aTolState=prm%aTol diff --git a/src/source_damage_isoDuctile.f90 b/src/source_damage_isoDuctile.f90 index 736ba1b8d..f891faa81 100644 --- a/src/source_damage_isoDuctile.f90 +++ b/src/source_damage_isoDuctile.f90 @@ -47,7 +47,7 @@ contains !-------------------------------------------------------------------------------------------------- subroutine source_damage_isoDuctile_init - integer :: Ninstance,source,sourceOffset,NofMyPhase,p + integer :: Ninstance,sourceOffset,NofMyPhase,p character(len=pStringLen) :: & extmsg = '' @@ -63,9 +63,9 @@ subroutine source_damage_isoDuctile_init do p = 1, size(config_phase) source_damage_isoDuctile_instance(p) = count(phase_source(:,1:p) == SOURCE_DAMAGE_ISODUCTILE_ID) - do source = 1, phase_Nsources(p) - if (phase_source(source,p) == SOURCE_DAMAGE_ISODUCTILE_ID) & - source_damage_isoDuctile_offset(p) = source + do sourceOffset = 1, phase_Nsources(p) + if (phase_source(sourceOffset,p) == SOURCE_DAMAGE_ISODUCTILE_ID) & + source_damage_isoDuctile_offset(p) = sourceOffset enddo if (all(phase_source(:,p) /= SOURCE_DAMAGE_ISODUCTILE_ID)) cycle @@ -91,8 +91,6 @@ subroutine source_damage_isoDuctile_init prm%output = config%getStrings('(output)',defaultVal=emptyStringArray) NofMyPhase=count(material_phaseAt==p) * discretization_nIP - sourceOffset = source_damage_isoDuctile_offset(p) - call material_allocateSourceState(p,sourceOffset,NofMyPhase,1,1,0) sourceState(p)%p(sourceOffset)%aTolState=prm%aTol diff --git a/src/source_thermal_dissipation.f90 b/src/source_thermal_dissipation.f90 index 1ca77e067..3efd9a762 100644 --- a/src/source_thermal_dissipation.f90 +++ b/src/source_thermal_dissipation.f90 @@ -39,7 +39,7 @@ contains !-------------------------------------------------------------------------------------------------- subroutine source_thermal_dissipation_init - integer :: Ninstance,source,sourceOffset,NofMyPhase,p + integer :: Ninstance,sourceOffset,NofMyPhase,p write(6,'(/,a)') ' <<<+- source_'//SOURCE_thermal_dissipation_label//' init -+>>>'; flush(6) @@ -53,9 +53,9 @@ subroutine source_thermal_dissipation_init do p = 1, size(config_phase) source_thermal_dissipation_instance(p) = count(phase_source(:,1:p) == SOURCE_THERMAL_DISSIPATION_ID) - do source = 1, phase_Nsources(p) - if (phase_source(source,p) == SOURCE_THERMAL_DISSIPATION_ID) & - source_thermal_dissipation_offset(p) = source + do sourceOffset = 1, phase_Nsources(p) + if (phase_source(sourceOffset,p) == SOURCE_THERMAL_DISSIPATION_ID) & + source_thermal_dissipation_offset(p) = sourceOffset enddo if (all(phase_source(:,p) /= SOURCE_THERMAL_DISSIPATION_ID)) cycle @@ -65,8 +65,6 @@ subroutine source_thermal_dissipation_init prm%kappa = config%getFloat('dissipation_coldworkcoeff') NofMyPhase = count(material_phaseAt==p) * discretization_nIP - sourceOffset = source_thermal_dissipation_offset(p) - call material_allocateSourceState(p,sourceOffset,NofMyPhase,0,0,0) end associate diff --git a/src/source_thermal_externalheat.f90 b/src/source_thermal_externalheat.f90 index eae81f2d6..3cd4f9b32 100644 --- a/src/source_thermal_externalheat.f90 +++ b/src/source_thermal_externalheat.f90 @@ -43,7 +43,7 @@ contains !-------------------------------------------------------------------------------------------------- subroutine source_thermal_externalheat_init - integer :: Ninstance,source,sourceOffset,NofMyPhase,p + integer :: Ninstance,sourceOffset,NofMyPhase,p write(6,'(/,a)') ' <<<+- source_'//SOURCE_thermal_externalheat_label//' init -+>>>'; flush(6) @@ -57,9 +57,9 @@ subroutine source_thermal_externalheat_init do p = 1, size(config_phase) source_thermal_externalheat_instance(p) = count(phase_source(:,1:p) == SOURCE_thermal_externalheat_ID) - do source = 1, phase_Nsources(p) - if (phase_source(source,p) == SOURCE_thermal_externalheat_ID) & - source_thermal_externalheat_offset(p) = source + do sourceOffset = 1, phase_Nsources(p) + if (phase_source(sourceOffset,p) == SOURCE_thermal_externalheat_ID) & + source_thermal_externalheat_offset(p) = sourceOffset enddo if (all(phase_source(:,p) /= SOURCE_thermal_externalheat_ID)) cycle @@ -72,8 +72,6 @@ subroutine source_thermal_externalheat_init prm%heat_rate = config%getFloats('externalheat_rate',requiredSize = size(prm%time)) NofMyPhase = count(material_phaseAt==p) * discretization_nIP - sourceOffset = source_thermal_externalheat_offset(p) - call material_allocateSourceState(p,sourceOffset,NofMyPhase,1,1,0) end associate