From a9572f81a1077fb2f5ce0b133bab63fe402a80e7 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 29 Feb 2020 09:52:33 +0100 Subject: [PATCH] bugfix: array access out of bounds this now uses always the first (source) entry of a particular type. Needs clearer structure in the future --- src/source_damage_anisoBrittle.f90 | 4 +++- src/source_damage_anisoDuctile.f90 | 4 +++- src/source_damage_isoBrittle.f90 | 4 +++- src/source_damage_isoDuctile.f90 | 4 +++- src/source_thermal_dissipation.f90 | 4 +++- src/source_thermal_externalheat.f90 | 4 +++- 6 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/source_damage_anisoBrittle.f90 b/src/source_damage_anisoBrittle.f90 index 7473524e7..3f8f4b13d 100644 --- a/src/source_damage_anisoBrittle.f90 +++ b/src/source_damage_anisoBrittle.f90 @@ -75,8 +75,10 @@ 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 sourceOffset = 1, phase_Nsources(p) - if (phase_source(sourceOffset,p) == SOURCE_DAMAGE_ANISOBRITTLE_ID) & + if (phase_source(sourceOffset,p) == SOURCE_DAMAGE_ANISOBRITTLE_ID) then source_damage_anisoBrittle_offset(p) = sourceOffset + exit + endif enddo if (all(phase_source(:,p) /= SOURCE_DAMAGE_ANISOBRITTLE_ID)) cycle diff --git a/src/source_damage_anisoDuctile.f90 b/src/source_damage_anisoDuctile.f90 index c4df0f686..b09b5404d 100644 --- a/src/source_damage_anisoDuctile.f90 +++ b/src/source_damage_anisoDuctile.f90 @@ -70,8 +70,10 @@ 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 sourceOffset = 1, phase_Nsources(p) - if (phase_source(sourceOffset,p) == SOURCE_DAMAGE_ANISODUCTILE_ID) & + if (phase_source(sourceOffset,p) == SOURCE_DAMAGE_ANISODUCTILE_ID) then source_damage_anisoDuctile_offset(p) = sourceOffset + exit + endif enddo if (all(phase_source(:,p) /= SOURCE_DAMAGE_ANISODUCTILE_ID)) cycle diff --git a/src/source_damage_isoBrittle.f90 b/src/source_damage_isoBrittle.f90 index b2f83a0f3..6e0e4d3fd 100644 --- a/src/source_damage_isoBrittle.f90 +++ b/src/source_damage_isoBrittle.f90 @@ -65,8 +65,10 @@ 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 sourceOffset = 1, phase_Nsources(p) - if (phase_source(sourceOffset,p) == SOURCE_DAMAGE_ISOBRITTLE_ID) & + if (phase_source(sourceOffset,p) == SOURCE_DAMAGE_ISOBRITTLE_ID) then source_damage_isoBrittle_offset(p) = sourceOffset + exit + endif enddo if (all(phase_source(:,p) /= SOURCE_DAMAGE_ISOBRITTLE_ID)) cycle diff --git a/src/source_damage_isoDuctile.f90 b/src/source_damage_isoDuctile.f90 index f891faa81..a92b2cf91 100644 --- a/src/source_damage_isoDuctile.f90 +++ b/src/source_damage_isoDuctile.f90 @@ -64,8 +64,10 @@ 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 sourceOffset = 1, phase_Nsources(p) - if (phase_source(sourceOffset,p) == SOURCE_DAMAGE_ISODUCTILE_ID) & + if (phase_source(sourceOffset,p) == SOURCE_DAMAGE_ISODUCTILE_ID) then source_damage_isoDuctile_offset(p) = sourceOffset + exit + endif enddo if (all(phase_source(:,p) /= SOURCE_DAMAGE_ISODUCTILE_ID)) cycle diff --git a/src/source_thermal_dissipation.f90 b/src/source_thermal_dissipation.f90 index 3efd9a762..acaf30068 100644 --- a/src/source_thermal_dissipation.f90 +++ b/src/source_thermal_dissipation.f90 @@ -54,8 +54,10 @@ 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 sourceOffset = 1, phase_Nsources(p) - if (phase_source(sourceOffset,p) == SOURCE_THERMAL_DISSIPATION_ID) & + if (phase_source(sourceOffset,p) == SOURCE_THERMAL_DISSIPATION_ID) then source_thermal_dissipation_offset(p) = sourceOffset + exit + endif enddo if (all(phase_source(:,p) /= SOURCE_THERMAL_DISSIPATION_ID)) cycle diff --git a/src/source_thermal_externalheat.f90 b/src/source_thermal_externalheat.f90 index 3cd4f9b32..1cf69b8a5 100644 --- a/src/source_thermal_externalheat.f90 +++ b/src/source_thermal_externalheat.f90 @@ -58,8 +58,10 @@ 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 sourceOffset = 1, phase_Nsources(p) - if (phase_source(sourceOffset,p) == SOURCE_thermal_externalheat_ID) & + if (phase_source(sourceOffset,p) == SOURCE_thermal_externalheat_ID) then source_thermal_externalheat_offset(p) = sourceOffset + exit + endif enddo if (all(phase_source(:,p) /= SOURCE_thermal_externalheat_ID)) cycle