string length is not know, avoid overflow

This commit is contained in:
Martin Diehl 2023-01-10 11:54:13 +01:00
parent e9eda1fb18
commit da0a15f63a
9 changed files with 27 additions and 19 deletions

View File

@ -549,8 +549,9 @@ subroutine crystallite_init()
type(tDict), pointer :: & type(tDict), pointer :: &
num_crystallite, & num_crystallite, &
phases phases
character(len=pStringLen) :: & character(len=:), allocatable :: &
extmsg = '' extmsg
num_crystallite => config_numerics%get_dict('crystallite',defaultVal=emptyDict) num_crystallite => config_numerics%get_dict('crystallite',defaultVal=emptyDict)
@ -566,6 +567,7 @@ subroutine crystallite_init()
num%nState = num_crystallite%get_asInt ('nState', defaultVal=20) num%nState = num_crystallite%get_asInt ('nState', defaultVal=20)
num%nStress = num_crystallite%get_asInt ('nStress', defaultVal=40) num%nStress = num_crystallite%get_asInt ('nStress', defaultVal=40)
extmsg = ''
if (num%subStepMinCryst <= 0.0_pReal) extmsg = trim(extmsg)//' subStepMinCryst' if (num%subStepMinCryst <= 0.0_pReal) extmsg = trim(extmsg)//' subStepMinCryst'
if (num%subStepSizeCryst <= 0.0_pReal) extmsg = trim(extmsg)//' subStepSizeCryst' if (num%subStepSizeCryst <= 0.0_pReal) extmsg = trim(extmsg)//' subStepSizeCryst'
if (num%stepIncreaseCryst <= 0.0_pReal) extmsg = trim(extmsg)//' stepIncreaseCryst' if (num%stepIncreaseCryst <= 0.0_pReal) extmsg = trim(extmsg)//' stepIncreaseCryst'

View File

@ -41,7 +41,7 @@ module function anisobrittle_init() result(mySources)
src src
integer :: Nmembers,ph integer :: Nmembers,ph
integer, dimension(:), allocatable :: N_cl integer, dimension(:), allocatable :: N_cl
character(len=pStringLen) :: extmsg = '' character(len=:), allocatable :: extmsg
mySources = source_active('anisobrittle') mySources = source_active('anisobrittle')
@ -53,7 +53,7 @@ module function anisobrittle_init() result(mySources)
phases => config_material%get_dict('phase') phases => config_material%get_dict('phase')
allocate(param(phases%length)) allocate(param(phases%length))
extmsg = ''
do ph = 1, phases%length do ph = 1, phases%length
if (mySources(ph)) then if (mySources(ph)) then
@ -83,7 +83,7 @@ module function anisobrittle_init() result(mySources)
prm%output = src%get_as1dString('output',defaultVal=emptyStringArray) prm%output = src%get_as1dString('output',defaultVal=emptyStringArray)
#endif #endif
! sanity checks ! sanity checks
if (prm%q <= 0.0_pReal) extmsg = trim(extmsg)//' q' if (prm%q <= 0.0_pReal) extmsg = trim(extmsg)//' q'
if (prm%dot_o <= 0.0_pReal) extmsg = trim(extmsg)//' dot_o' if (prm%dot_o <= 0.0_pReal) extmsg = trim(extmsg)//' dot_o'
if (any(prm%g_crit < 0.0_pReal)) extmsg = trim(extmsg)//' g_crit' if (any(prm%g_crit < 0.0_pReal)) extmsg = trim(extmsg)//' g_crit'

View File

@ -39,7 +39,7 @@ module function isobrittle_init() result(mySources)
phase, & phase, &
src src
integer :: Nmembers,ph integer :: Nmembers,ph
character(len=pStringLen) :: extmsg = '' character(len=:), allocatable :: extmsg
mySources = source_active('isobrittle') mySources = source_active('isobrittle')
@ -53,6 +53,7 @@ module function isobrittle_init() result(mySources)
allocate(param(phases%length)) allocate(param(phases%length))
allocate(state(phases%length)) allocate(state(phases%length))
allocate(deltaState(phases%length)) allocate(deltaState(phases%length))
extmsg = ''
do ph = 1, phases%length do ph = 1, phases%length
if (mySources(ph)) then if (mySources(ph)) then

View File

@ -93,8 +93,8 @@ module function plastic_dislotungsten_init() result(myPlasticity)
rho_mob_0, & !< initial dislocation density rho_mob_0, & !< initial dislocation density
rho_dip_0, & !< initial dipole density rho_dip_0, & !< initial dipole density
a !< non-Schmid coefficients a !< non-Schmid coefficients
character(len=pStringLen) :: & character(len=:), allocatable :: &
extmsg = '' extmsg
type(tDict), pointer :: & type(tDict), pointer :: &
phases, & phases, &
phase, & phase, &
@ -116,6 +116,7 @@ module function plastic_dislotungsten_init() result(myPlasticity)
allocate(indexDotState(phases%length)) allocate(indexDotState(phases%length))
allocate(state(phases%length)) allocate(state(phases%length))
allocate(dependentState(phases%length)) allocate(dependentState(phases%length))
extmsg = ''
do ph = 1, phases%length do ph = 1, phases%length
if (.not. myPlasticity(ph)) cycle if (.not. myPlasticity(ph)) cycle

View File

@ -140,8 +140,8 @@ module function plastic_dislotwin_init() result(myPlasticity)
real(pReal), allocatable, dimension(:) :: & real(pReal), allocatable, dimension(:) :: &
rho_mob_0, & !< initial unipolar dislocation density per slip system rho_mob_0, & !< initial unipolar dislocation density per slip system
rho_dip_0 !< initial dipole dislocation density per slip system rho_dip_0 !< initial dipole dislocation density per slip system
character(len=pStringLen) :: & character(len=:), allocatable :: &
extmsg = '' extmsg
type(tDict), pointer :: & type(tDict), pointer :: &
phases, & phases, &
phase, & phase, &
@ -170,6 +170,7 @@ module function plastic_dislotwin_init() result(myPlasticity)
allocate(indexDotState(phases%length)) allocate(indexDotState(phases%length))
allocate(state(phases%length)) allocate(state(phases%length))
allocate(dependentState(phases%length)) allocate(dependentState(phases%length))
extmsg = ''
do ph = 1, phases%length do ph = 1, phases%length
if (.not. myPlasticity(ph)) cycle if (.not. myPlasticity(ph)) cycle

View File

@ -54,8 +54,8 @@ module function plastic_isotropic_init() result(myPlasticity)
sizeState, sizeDotState sizeState, sizeDotState
real(pReal) :: & real(pReal) :: &
xi_0 !< initial critical stress xi_0 !< initial critical stress
character(len=pStringLen) :: & character(len=:), allocatable :: &
extmsg = '' extmsg
type(tDict), pointer :: & type(tDict), pointer :: &
phases, & phases, &
phase, & phase, &
@ -75,6 +75,7 @@ module function plastic_isotropic_init() result(myPlasticity)
phases => config_material%get_dict('phase') phases => config_material%get_dict('phase')
allocate(param(phases%length)) allocate(param(phases%length))
allocate(state(phases%length)) allocate(state(phases%length))
extmsg = ''
do ph = 1, phases%length do ph = 1, phases%length
if (.not. myPlasticity(ph)) cycle if (.not. myPlasticity(ph)) cycle

View File

@ -77,8 +77,8 @@ module function plastic_kinehardening_init() result(myPlasticity)
real(pReal), dimension(:), allocatable :: & real(pReal), dimension(:), allocatable :: &
xi_0, & !< initial resistance against plastic flow xi_0, & !< initial resistance against plastic flow
a !< non-Schmid coefficients a !< non-Schmid coefficients
character(len=pStringLen) :: & character(len=:), allocatable :: &
extmsg = '' extmsg
type(tDict), pointer :: & type(tDict), pointer :: &
phases, & phases, &
phase, & phase, &
@ -99,7 +99,7 @@ module function plastic_kinehardening_init() result(myPlasticity)
allocate(indexDotState(phases%length)) allocate(indexDotState(phases%length))
allocate(state(phases%length)) allocate(state(phases%length))
allocate(deltaState(phases%length)) allocate(deltaState(phases%length))
extmsg = ''
do ph = 1, phases%length do ph = 1, phases%length
if (.not. myPlasticity(ph)) cycle if (.not. myPlasticity(ph)) cycle

View File

@ -188,8 +188,8 @@ module function plastic_nonlocal_init() result(myPlasticity)
s, t, l s, t, l
real(pReal), dimension(:), allocatable :: & real(pReal), dimension(:), allocatable :: &
a a
character(len=pStringLen) :: & character(len=:), allocatable :: &
extmsg = '' extmsg
type(tInitialParameters) :: & type(tInitialParameters) :: &
ini ini
type(tDict), pointer :: & type(tDict), pointer :: &
@ -225,6 +225,7 @@ module function plastic_nonlocal_init() result(myPlasticity)
allocate(dotState(phases%length)) allocate(dotState(phases%length))
allocate(deltaState(phases%length)) allocate(deltaState(phases%length))
allocate(dependentState(phases%length)) allocate(dependentState(phases%length))
extmsg = ''
do ph = 1, phases%length do ph = 1, phases%length
if (.not. myPlasticity(ph)) cycle if (.not. myPlasticity(ph)) cycle

View File

@ -90,8 +90,8 @@ module function plastic_phenopowerlaw_init() result(myPlasticity)
xi_0_sl, & !< initial critical shear stress for slip xi_0_sl, & !< initial critical shear stress for slip
xi_0_tw, & !< initial critical shear stress for twin xi_0_tw, & !< initial critical shear stress for twin
a !< non-Schmid coefficients a !< non-Schmid coefficients
character(len=pStringLen) :: & character(len=:), allocatable :: &
extmsg = '' extmsg
type(tDict), pointer :: & type(tDict), pointer :: &
phases, & phases, &
phase, & phase, &
@ -110,6 +110,7 @@ module function plastic_phenopowerlaw_init() result(myPlasticity)
allocate(param(phases%length)) allocate(param(phases%length))
allocate(indexDotState(phases%length)) allocate(indexDotState(phases%length))
allocate(state(phases%length)) allocate(state(phases%length))
extmsg = ''
do ph = 1, phases%length do ph = 1, phases%length
if (.not. myPlasticity(ph)) cycle if (.not. myPlasticity(ph)) cycle