From 4086f40a1661ef56fd0a792baa9ebb85ef15dbcc Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Sat, 22 Jul 2023 14:01:53 -0400 Subject: [PATCH] pull "constants" out of inner loops --- src/phase_thermal_source_dissipation.f90 | 4 ++-- src/phase_thermal_source_externalheat.f90 | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/phase_thermal_source_dissipation.f90 b/src/phase_thermal_source_dissipation.f90 index c42e4a817..4713fb809 100644 --- a/src/phase_thermal_source_dissipation.f90 +++ b/src/phase_thermal_source_dissipation.f90 @@ -49,8 +49,9 @@ module function source_dissipation_init(source_length) result(mySources) allocate(param(phases%length)) do ph = 1, phases%length - phase => phases%get_dict(ph) if (count(mySources(:,ph)) == 0) cycle !ToDo: error if > 1 + Nmembers = count(material_ID_phase == ph) + phase => phases%get_dict(ph) thermal => phase%get_dict('thermal') sources => thermal%get_list('source') do so = 1, sources%length @@ -62,7 +63,6 @@ module function source_dissipation_init(source_length) result(mySources) if (len(refs) > 0) print'(/,1x,a)', refs prm%kappa = src%get_asReal('kappa') - Nmembers = count(material_ID_phase == ph) call phase_allocateState(thermalState(ph)%p(so),Nmembers,0,0,0) end associate diff --git a/src/phase_thermal_source_externalheat.f90 b/src/phase_thermal_source_externalheat.f90 index f86880e62..24a5ea7f8 100644 --- a/src/phase_thermal_source_externalheat.f90 +++ b/src/phase_thermal_source_externalheat.f90 @@ -52,8 +52,9 @@ module function source_externalheat_init(source_length) result(mySources) allocate(source_ID(phases%length), source=0) do ph = 1, phases%length - phase => phases%get_dict(ph) if (count(mySources(:,ph)) == 0) cycle + Nmembers = count(material_ID_phase == ph) + phase => phases%get_dict(ph) thermal => phase%get_dict('thermal') sources => thermal%get_list('source') do so = 1, sources%length @@ -66,8 +67,6 @@ module function source_externalheat_init(source_length) result(mySources) if (len(refs) > 0) print'(/,1x,a)', refs prm%f = table(src,'t','f') - - Nmembers = count(material_ID_phase == ph) call phase_allocateState(thermalState(ph)%p(so),Nmembers,1,1,0) end associate end if