pull "constants" out of inner loops

This commit is contained in:
Philip Eisenlohr 2023-07-22 14:01:53 -04:00
parent 1fdc5443b2
commit 4086f40a16
2 changed files with 4 additions and 5 deletions

View File

@ -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

View File

@ -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