preparing removal of old output data

This commit is contained in:
Martin Diehl 2019-12-21 10:31:19 +01:00
parent 4dc5dac831
commit 91ad5092f4
2 changed files with 34 additions and 4 deletions

View File

@ -26,6 +26,15 @@ module thermal_adiabatic
enumerator :: undefined_ID, & enumerator :: undefined_ID, &
temperature_ID temperature_ID
end enum end enum
type :: tParameters
integer(kind(undefined_ID)), dimension(:), allocatable :: &
outputID
end type tParameters
type(tparameters), dimension(:), allocatable :: &
param
integer(kind(undefined_ID)), dimension(:,:), allocatable :: & integer(kind(undefined_ID)), dimension(:,:), allocatable :: &
thermal_adiabatic_outputID !< ID of each post result output thermal_adiabatic_outputID !< ID of each post result output
@ -51,11 +60,13 @@ subroutine thermal_adiabatic_init
character(len=65536), dimension(0), parameter :: emptyStringArray = [character(len=65536)::] character(len=65536), dimension(0), parameter :: emptyStringArray = [character(len=65536)::]
character(len=65536), dimension(:), allocatable :: outputs character(len=65536), dimension(:), allocatable :: outputs
write(6,'(/,a)') ' <<<+- thermal_'//THERMAL_ADIABATIC_label//' init -+>>>' write(6,'(/,a)') ' <<<+- thermal_'//THERMAL_ADIABATIC_label//' init -+>>>'; flush(6)
maxNinstance = count(thermal_type == THERMAL_adiabatic_ID) maxNinstance = count(thermal_type == THERMAL_adiabatic_ID)
if (maxNinstance == 0) return if (maxNinstance == 0) return
allocate(param(maxNinstance))
allocate(thermal_adiabatic_output (maxval(homogenization_Noutput),maxNinstance)) allocate(thermal_adiabatic_output (maxval(homogenization_Noutput),maxNinstance))
thermal_adiabatic_output = '' thermal_adiabatic_output = ''
allocate(thermal_adiabatic_outputID (maxval(homogenization_Noutput),maxNinstance),source=undefined_ID) allocate(thermal_adiabatic_outputID (maxval(homogenization_Noutput),maxNinstance),source=undefined_ID)
@ -64,6 +75,9 @@ subroutine thermal_adiabatic_init
initializeInstances: do section = 1, size(thermal_type) initializeInstances: do section = 1, size(thermal_type)
if (thermal_type(section) /= THERMAL_adiabatic_ID) cycle if (thermal_type(section) /= THERMAL_adiabatic_ID) cycle
associate(prm => param(thermal_typeInstance(section)), &
config => config_homogenization(section))
NofMyHomog=count(material_homogenizationAt==section) NofMyHomog=count(material_homogenizationAt==section)
instance = thermal_typeInstance(section) instance = thermal_typeInstance(section)
outputs = config_homogenization(section)%getStrings('(output)',defaultVal=emptyStringArray) outputs = config_homogenization(section)%getStrings('(output)',defaultVal=emptyStringArray)
@ -90,6 +104,7 @@ subroutine thermal_adiabatic_init
deallocate(temperatureRate(section)%p) deallocate(temperatureRate(section)%p)
allocate (temperatureRate(section)%p(NofMyHomog), source=0.0_pReal) allocate (temperatureRate(section)%p(NofMyHomog), source=0.0_pReal)
end associate
enddo initializeInstances enddo initializeInstances
end subroutine thermal_adiabatic_init end subroutine thermal_adiabatic_init

View File

@ -25,6 +25,15 @@ module thermal_conduction
enumerator :: undefined_ID, & enumerator :: undefined_ID, &
temperature_ID temperature_ID
end enum end enum
type :: tParameters
integer(kind(undefined_ID)), dimension(:), allocatable :: &
outputID
end type tParameters
type(tparameters), dimension(:), allocatable :: &
param
integer(kind(undefined_ID)), dimension(:,:), allocatable, private :: & integer(kind(undefined_ID)), dimension(:,:), allocatable, private :: &
thermal_conduction_outputID !< ID of each post result output thermal_conduction_outputID !< ID of each post result output
@ -54,11 +63,13 @@ subroutine thermal_conduction_init
character(len=65536), dimension(0), parameter :: emptyStringArray = [character(len=65536)::] character(len=65536), dimension(0), parameter :: emptyStringArray = [character(len=65536)::]
character(len=65536), dimension(:), allocatable :: outputs character(len=65536), dimension(:), allocatable :: outputs
write(6,'(/,a)') ' <<<+- thermal_'//THERMAL_CONDUCTION_label//' init -+>>>' write(6,'(/,a)') ' <<<+- thermal_'//THERMAL_CONDUCTION_label//' init -+>>>'; flush(6)
maxNinstance = count(thermal_type == THERMAL_conduction_ID) maxNinstance = count(thermal_type == THERMAL_conduction_ID)
if (maxNinstance == 0) return if (maxNinstance == 0) return
allocate(param(maxNinstance))
allocate(thermal_conduction_output (maxval(homogenization_Noutput),maxNinstance)) allocate(thermal_conduction_output (maxval(homogenization_Noutput),maxNinstance))
thermal_conduction_output = '' thermal_conduction_output = ''
allocate(thermal_conduction_outputID (maxval(homogenization_Noutput),maxNinstance),source=undefined_ID) allocate(thermal_conduction_outputID (maxval(homogenization_Noutput),maxNinstance),source=undefined_ID)
@ -67,6 +78,9 @@ subroutine thermal_conduction_init
initializeInstances: do section = 1, size(thermal_type) initializeInstances: do section = 1, size(thermal_type)
if (thermal_type(section) /= THERMAL_conduction_ID) cycle if (thermal_type(section) /= THERMAL_conduction_ID) cycle
associate(prm => param(thermal_typeInstance(section)), &
config => config_homogenization(section))
NofMyHomog=count(material_homogenizationAt==section) NofMyHomog=count(material_homogenizationAt==section)
instance = thermal_typeInstance(section) instance = thermal_typeInstance(section)
outputs = config_homogenization(section)%getStrings('(output)',defaultVal=emptyStringArray) outputs = config_homogenization(section)%getStrings('(output)',defaultVal=emptyStringArray)
@ -94,6 +108,7 @@ subroutine thermal_conduction_init
deallocate(temperatureRate(section)%p) deallocate(temperatureRate(section)%p)
allocate (temperatureRate(section)%p(NofMyHomog), source=0.0_pReal) allocate (temperatureRate(section)%p(NofMyHomog), source=0.0_pReal)
end associate
enddo initializeInstances enddo initializeInstances
end subroutine thermal_conduction_init end subroutine thermal_conduction_init