summarized multiple logicals into one

This commit is contained in:
Philip Eisenlohr 2018-01-18 10:47:52 -05:00
parent f0511e1ecb
commit 93073ed661
1 changed files with 20 additions and 20 deletions

View File

@ -128,7 +128,7 @@ subroutine homogenization_init
integer(pInt), dimension(:) , pointer :: thisNoutput integer(pInt), dimension(:) , pointer :: thisNoutput
character(len=64), dimension(:,:), pointer :: thisOutput character(len=64), dimension(:,:), pointer :: thisOutput
character(len=32) :: outputName !< name of output, intermediate fix until HDF5 output is ready character(len=32) :: outputName !< name of output, intermediate fix until HDF5 output is ready
logical :: knownHomogenization, knownThermal, knownDamage, knownVacancyflux, knownPorosity, knownHydrogenflux logical :: valid
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
@ -199,7 +199,7 @@ subroutine homogenization_init
do p = 1,material_Nhomogenization do p = 1,material_Nhomogenization
if (any(material_homog == p)) then if (any(material_homog == p)) then
i = homogenization_typeInstance(p) ! which instance of this homogenization type i = homogenization_typeInstance(p) ! which instance of this homogenization type
knownHomogenization = .true. ! assume valid valid = .true. ! assume valid
select case(homogenization_type(p)) ! split per homogenization type select case(homogenization_type(p)) ! split per homogenization type
case (HOMOGENIZATION_NONE_ID) case (HOMOGENIZATION_NONE_ID)
outputName = HOMOGENIZATION_NONE_label outputName = HOMOGENIZATION_NONE_label
@ -217,10 +217,10 @@ subroutine homogenization_init
thisOutput => homogenization_RGC_output thisOutput => homogenization_RGC_output
thisSize => homogenization_RGC_sizePostResult thisSize => homogenization_RGC_sizePostResult
case default case default
knownHomogenization = .false. valid = .false.
end select end select
write(FILEUNIT,'(/,a,/)') '['//trim(homogenization_name(p))//']' write(FILEUNIT,'(/,a,/)') '['//trim(homogenization_name(p))//']'
if (knownHomogenization) then if (valid) then
write(FILEUNIT,'(a)') '(type)'//char(9)//trim(outputName) write(FILEUNIT,'(a)') '(type)'//char(9)//trim(outputName)
write(FILEUNIT,'(a,i4)') '(ngrains)'//char(9),homogenization_Ngrains(p) write(FILEUNIT,'(a,i4)') '(ngrains)'//char(9),homogenization_Ngrains(p)
if (homogenization_type(p) /= HOMOGENIZATION_NONE_ID) then if (homogenization_type(p) /= HOMOGENIZATION_NONE_ID) then
@ -230,7 +230,7 @@ subroutine homogenization_init
endif endif
endif endif
i = thermal_typeInstance(p) ! which instance of this thermal type i = thermal_typeInstance(p) ! which instance of this thermal type
knownThermal = .true. ! assume valid valid = .true. ! assume valid
select case(thermal_type(p)) ! split per thermal type select case(thermal_type(p)) ! split per thermal type
case (THERMAL_isothermal_ID) case (THERMAL_isothermal_ID)
outputName = THERMAL_isothermal_label outputName = THERMAL_isothermal_label
@ -248,9 +248,9 @@ subroutine homogenization_init
thisOutput => thermal_conduction_output thisOutput => thermal_conduction_output
thisSize => thermal_conduction_sizePostResult thisSize => thermal_conduction_sizePostResult
case default case default
knownThermal = .false. valid = .false.
end select end select
if (knownThermal) then if (valid) then
write(FILEUNIT,'(a)') '(thermal)'//char(9)//trim(outputName) write(FILEUNIT,'(a)') '(thermal)'//char(9)//trim(outputName)
if (thermal_type(p) /= THERMAL_isothermal_ID) then if (thermal_type(p) /= THERMAL_isothermal_ID) then
do e = 1,thisNoutput(i) do e = 1,thisNoutput(i)
@ -259,7 +259,7 @@ subroutine homogenization_init
endif endif
endif endif
i = damage_typeInstance(p) ! which instance of this damage type i = damage_typeInstance(p) ! which instance of this damage type
knownDamage = .true. ! assume valid valid = .true. ! assume valid
select case(damage_type(p)) ! split per damage type select case(damage_type(p)) ! split per damage type
case (DAMAGE_none_ID) case (DAMAGE_none_ID)
outputName = DAMAGE_none_label outputName = DAMAGE_none_label
@ -277,9 +277,9 @@ subroutine homogenization_init
thisOutput => damage_nonlocal_output thisOutput => damage_nonlocal_output
thisSize => damage_nonlocal_sizePostResult thisSize => damage_nonlocal_sizePostResult
case default case default
knownDamage = .false. valid = .false.
end select end select
if (knownDamage) then if (valid) then
write(FILEUNIT,'(a)') '(damage)'//char(9)//trim(outputName) write(FILEUNIT,'(a)') '(damage)'//char(9)//trim(outputName)
if (damage_type(p) /= DAMAGE_none_ID) then if (damage_type(p) /= DAMAGE_none_ID) then
do e = 1,thisNoutput(i) do e = 1,thisNoutput(i)
@ -288,7 +288,7 @@ subroutine homogenization_init
endif endif
endif endif
i = vacancyflux_typeInstance(p) ! which instance of this vacancy flux type i = vacancyflux_typeInstance(p) ! which instance of this vacancy flux type
knownVacancyflux = .true. ! assume valid valid = .true. ! assume valid
select case(vacancyflux_type(p)) ! split per vacancy flux type select case(vacancyflux_type(p)) ! split per vacancy flux type
case (VACANCYFLUX_isoconc_ID) case (VACANCYFLUX_isoconc_ID)
outputName = VACANCYFLUX_isoconc_label outputName = VACANCYFLUX_isoconc_label
@ -306,9 +306,9 @@ subroutine homogenization_init
thisOutput => vacancyflux_cahnhilliard_output thisOutput => vacancyflux_cahnhilliard_output
thisSize => vacancyflux_cahnhilliard_sizePostResult thisSize => vacancyflux_cahnhilliard_sizePostResult
case default case default
knownVacancyflux = .false. valid = .false.
end select end select
if (knownVacancyflux) then if (valid) then
write(FILEUNIT,'(a)') '(vacancyflux)'//char(9)//trim(outputName) write(FILEUNIT,'(a)') '(vacancyflux)'//char(9)//trim(outputName)
if (vacancyflux_type(p) /= VACANCYFLUX_isoconc_ID) then if (vacancyflux_type(p) /= VACANCYFLUX_isoconc_ID) then
do e = 1,thisNoutput(i) do e = 1,thisNoutput(i)
@ -317,7 +317,7 @@ subroutine homogenization_init
endif endif
endif endif
i = porosity_typeInstance(p) ! which instance of this porosity type i = porosity_typeInstance(p) ! which instance of this porosity type
knownPorosity = .true. ! assume valid valid = .true. ! assume valid
select case(porosity_type(p)) ! split per porosity type select case(porosity_type(p)) ! split per porosity type
case (POROSITY_none_ID) case (POROSITY_none_ID)
outputName = POROSITY_none_label outputName = POROSITY_none_label
@ -330,9 +330,9 @@ subroutine homogenization_init
thisOutput => porosity_phasefield_output thisOutput => porosity_phasefield_output
thisSize => porosity_phasefield_sizePostResult thisSize => porosity_phasefield_sizePostResult
case default case default
knownPorosity = .false. valid = .false.
end select end select
if (knownPorosity) then if (valid) then
write(FILEUNIT,'(a)') '(porosity)'//char(9)//trim(outputName) write(FILEUNIT,'(a)') '(porosity)'//char(9)//trim(outputName)
if (porosity_type(p) /= POROSITY_none_ID) then if (porosity_type(p) /= POROSITY_none_ID) then
do e = 1,thisNoutput(i) do e = 1,thisNoutput(i)
@ -341,7 +341,7 @@ subroutine homogenization_init
endif endif
endif endif
i = hydrogenflux_typeInstance(p) ! which instance of this hydrogen flux type i = hydrogenflux_typeInstance(p) ! which instance of this hydrogen flux type
knownHydrogenflux = .true. ! assume valid valid = .true. ! assume valid
select case(hydrogenflux_type(p)) ! split per hydrogen flux type select case(hydrogenflux_type(p)) ! split per hydrogen flux type
case (HYDROGENFLUX_isoconc_ID) case (HYDROGENFLUX_isoconc_ID)
outputName = HYDROGENFLUX_isoconc_label outputName = HYDROGENFLUX_isoconc_label
@ -354,9 +354,9 @@ subroutine homogenization_init
thisOutput => hydrogenflux_cahnhilliard_output thisOutput => hydrogenflux_cahnhilliard_output
thisSize => hydrogenflux_cahnhilliard_sizePostResult thisSize => hydrogenflux_cahnhilliard_sizePostResult
case default case default
knownHydrogenflux = .false. valid = .false.
end select end select
if (knownHydrogenflux) then if (valid) then
write(FILEUNIT,'(a)') '(hydrogenflux)'//char(9)//trim(outputName) write(FILEUNIT,'(a)') '(hydrogenflux)'//char(9)//trim(outputName)
if (hydrogenflux_type(p) /= HYDROGENFLUX_isoconc_ID) then if (hydrogenflux_type(p) /= HYDROGENFLUX_isoconc_ID) then
do e = 1,thisNoutput(i) do e = 1,thisNoutput(i)