deallocating config, simplifying

This commit is contained in:
Martin Diehl 2018-06-26 20:50:06 +02:00
parent bb415e8a02
commit ea80e04ea8
3 changed files with 20 additions and 10 deletions

View File

@ -60,12 +60,12 @@ module config
MATERIAL_partHomogenization = 'homogenization', & !< keyword for homogenization part
MATERIAL_partCrystallite = 'crystallite', & !< keyword for crystallite part
MATERIAL_partPhase = 'phase', & !< keyword for phase part
MATERIAL_partMicrostructure = 'microstructure', & !< keyword for microstructure part
MATERIAL_partMicrostructure = 'microstructure' !< keyword for microstructure part
character(len=*), parameter, private :: &
MATERIAL_partTexture = 'texture' !< keyword for texture part
! ToDo: Remove, use size(phaseConfig) etc
integer(pInt), public, protected :: &
material_Ntexture, & !< number of textures
material_Nphase, & !< number of phases
material_Nhomogenization, & !< number of homogenizations
material_Nmicrostructure, & !< number of microstructures
@ -165,8 +165,7 @@ subroutine config_init()
if (material_Ncrystallite < 1_pInt) call IO_error(160_pInt,ext_msg=material_partCrystallite)
material_Nphase = size(phaseConfig)
if (material_Nphase < 1_pInt) call IO_error(160_pInt,ext_msg=material_partPhase)
material_Ntexture = size(textureConfig)
if (material_Ntexture < 1_pInt) call IO_error(160_pInt,ext_msg=material_partTexture)
if (size(textureConfig) < 1_pInt) call IO_error(160_pInt,ext_msg=material_partTexture)
end subroutine config_init

View File

@ -100,8 +100,13 @@ subroutine homogenization_init
use crystallite, only: &
crystallite_maxSizePostResults
#endif
use config, only: &
config_deallocate, &
material_configFile, &
material_localFileExt, &
homogenizationConfig, &
homogenization_name
use material
use config
use homogenization_none
use homogenization_isostrain
use homogenization_RGC
@ -197,7 +202,7 @@ subroutine homogenization_init
! write description file for homogenization output
mainProcess2: if (worldrank == 0) then
call IO_write_jobFile(FILEUNIT,'outputHomogenization')
do p = 1,material_Nhomogenization
do p = 1,size(homogenizationConfig)
if (any(material_homog == p)) then
i = homogenization_typeInstance(p) ! which instance of this homogenization type
valid = .true. ! assume valid
@ -370,6 +375,8 @@ subroutine homogenization_init
close(FILEUNIT)
endif mainProcess2
call config_deallocate('material.config/homogenization')
!--------------------------------------------------------------------------------------------------
! allocate and initialize global variables
allocate(materialpoint_dPdF(3,3,3,3,mesh_maxNips,mesh_NcpElems), source=0.0_pReal)
@ -395,7 +402,7 @@ subroutine homogenization_init
vacancyflux_maxSizePostResults = 0_pInt
porosity_maxSizePostResults = 0_pInt
hydrogenflux_maxSizePostResults = 0_pInt
do p = 1,material_Nhomogenization
do p = 1,size(homogenizationConfig)
homogenization_maxSizePostResults = max(homogenization_maxSizePostResults,homogState (p)%sizePostResults)
thermal_maxSizePostResults = max(thermal_maxSizePostResults, thermalState (p)%sizePostResults)
damage_maxSizePostResults = max(damage_maxSizePostResults ,damageState (p)%sizePostResults)

View File

@ -360,7 +360,8 @@ subroutine material_init()
homogenization_name, &
microstructure_name, &
phase_name, &
texture_name
texture_name, &
config_deallocate
use mesh, only: &
mesh_maxNips, &
mesh_NcpElems, &
@ -468,6 +469,7 @@ subroutine material_init()
endif debugOut
call material_populateGrains
call config_deallocate('material.config/microstructure')
allocate(phaseAt ( homogenization_maxNgrains,mesh_maxNips,mesh_NcpElems),source=0_pInt)
allocate(phasememberAt ( homogenization_maxNgrains,mesh_maxNips,mesh_NcpElems),source=0_pInt)
@ -918,7 +920,8 @@ subroutine material_parseTexture
IO_floatValue, &
IO_stringValue
use config, only: &
textureConfig
textureConfig, &
config_deallocate
use math, only: &
inRad, &
math_sampleRandomOri, &
@ -1056,7 +1059,8 @@ subroutine material_parseTexture
enddo
endif
enddo
call config_deallocate('material.config/texture')
end subroutine material_parseTexture