removed parameter check complaining about unknown keyword as default case. there are just too many keywords that do not trigger a variable assignment to cope with them (e.g. /nonlocal/, constitution, etc.)

I suggest to kill similar logic from other files if present somewhere...
This commit is contained in:
Philip Eisenlohr 2012-02-13 23:30:59 +00:00
parent c786336af3
commit 9b73cb3c65
6 changed files with 73 additions and 109 deletions

View File

@ -161,15 +161,12 @@ end function
implicit none implicit none
integer(pInt), intent(in) :: unit integer(pInt), intent(in) :: unit
character(len=*), intent(in) :: relPath character(len=*), intent(in) :: relPath
integer stat character(len=1024) path
character path integer(pInt) stat
IO_open_file_stat = .false.
path = trim(getSolverWorkingDirectoryName())//relPath path = trim(getSolverWorkingDirectoryName())//relPath
open(unit,status='old',iostat=stat,file=path) open(unit,status='old',iostat=stat,file=path)
if (stat == 0) then IO_open_file_stat = (stat == 0_pInt)
IO_open_file_stat = .true.
endif
endfunction endfunction
@ -186,14 +183,12 @@ end function
implicit none implicit none
integer(pInt), intent(in) :: unit integer(pInt), intent(in) :: unit
character(len=*), intent(in) :: relPath character(len=*), intent(in) :: relPath
character path character(len=1024) path
integer(pInt) stat integer(pInt) stat
path = trim(getSolverWorkingDirectoryName())//relPath path = trim(getSolverWorkingDirectoryName())//relPath
open(unit,status='old',iostat=stat,file=path) open(unit,status='old',iostat=stat,file=path)
if (stat /= 0) then if (stat /= 0_pInt) call IO_error(100_pInt,ext_msg=path)
call IO_error(100_pInt,ext_msg=path)
endif
endsubroutine endsubroutine
@ -212,34 +207,28 @@ end function
integer(pInt), intent(in) :: unit integer(pInt), intent(in) :: unit
character(len=*), intent(in) :: model character(len=*), intent(in) :: model
character(len=1024) path
integer(pInt) stat integer(pInt) stat
character path
if (FEsolver == 'Abaqus') then if (FEsolver == 'Abaqus') then
path = trim(getSolverWorkingDirectoryName())//trim(model)//InputFileExtension path = trim(getSolverWorkingDirectoryName())//trim(model)//InputFileExtension
open(unit+1,status='old',iostat=stat,file=path) open(unit+1,status='old',iostat=stat,file=path)
if (stat /= 0) then if (stat /= 0_pInt) call IO_error(100_pInt,ext_msg=path)
call IO_error(100_pInt,ext_msg=path)
endif
path = trim(getSolverWorkingDirectoryName())//trim(model)//InputFileExtension//'_assembly' path = trim(getSolverWorkingDirectoryName())//trim(model)//InputFileExtension//'_assembly'
open(unit,iostat=stat,file=path) open(unit,iostat=stat,file=path)
if (stat /= 0) then if (stat /= 0_pInt) call IO_error(100_pInt,ext_msg=path)
call IO_error(100_pInt,ext_msg=path) if (IO_abaqus_assembleInputFile(unit,unit+1_pInt)) call IO_error(103_pInt) ! strip comments and concatenate any "include"s
endif
if (IO_abaqus_assembleInputFile(unit,unit+1_pInt)) then ! strip comments and concatenate any "include"s
call IO_error(103_pInt)
endif
close(unit+1_pInt) close(unit+1_pInt)
else else
path = trim(getSolverWorkingDirectoryName())//trim(model)//InputFileExtension path = trim(getSolverWorkingDirectoryName())//trim(model)//InputFileExtension
open(unit,status='old',iostat=stat,file=path) open(unit,status='old',iostat=stat,file=path)
if (stat /= 0) then if (stat /= 0_pInt) call IO_error(100_pInt,ext_msg=path)
call IO_error(100_pInt,ext_msg=path)
endif
endif endif
endsubroutine endsubroutine
@ -254,15 +243,13 @@ end function
use DAMASK_interface use DAMASK_interface
implicit none implicit none
character path
integer(pInt) stat
integer(pInt), intent(in) :: unit integer(pInt), intent(in) :: unit
character(len=1024) path
integer(pInt) stat
path = trim(getSolverWorkingDirectoryName())//trim(getSolverJobName())//LogFileExtension path = trim(getSolverWorkingDirectoryName())//trim(getSolverJobName())//LogFileExtension
open(unit,status='old',iostat=stat,file=path) open(unit,status='old',iostat=stat,file=path)
if (stat /= 0) then if (stat /= 0) call IO_error(100_pInt,ext_msg=path)
call IO_error(100_pInt,ext_msg=path)
endif
endsubroutine endsubroutine
@ -278,16 +265,13 @@ end function
implicit none implicit none
integer(pInt), intent(in) :: unit integer(pInt), intent(in) :: unit
character(*), intent(in) :: newExt character(len=*), intent(in) :: newExt
character path character(len=1024) path
integer stat integer(pInt) stat
IO_open_jobFile_stat = .false.
path = trim(getSolverWorkingDirectoryName())//trim(getSolverJobName())//'.'//newExt path = trim(getSolverWorkingDirectoryName())//trim(getSolverJobName())//'.'//newExt
open(unit,status='old',iostat=stat,file=path) open(unit,status='old',iostat=stat,file=path)
if (stat == 0) then IO_open_jobFile_stat = (stat == 0_pInt)
IO_open_jobFile_stat = .true.
endif
endfunction endfunction
@ -303,15 +287,13 @@ end function
implicit none implicit none
integer(pInt), intent(in) :: unit integer(pInt), intent(in) :: unit
character(*), intent(in) :: newExt character(len=*), intent(in) :: newExt
character path character(len=1024) path
integer(pInt) stat integer(pInt) stat
path = trim(getSolverWorkingDirectoryName())//trim(getSolverJobName())//'.'//newExt path = trim(getSolverWorkingDirectoryName())//trim(getSolverJobName())//'.'//newExt
open(unit,status='old',iostat=stat,file=path) open(unit,status='old',iostat=stat,file=path)
if (stat /= 0) then if (stat /= 0_pInt) call IO_error(100_pInt,ext_msg=path)
call IO_error(100_pInt,ext_msg=path)
endif
endsubroutine endsubroutine
@ -327,15 +309,13 @@ end function
implicit none implicit none
integer(pInt), intent(in) :: unit integer(pInt), intent(in) :: unit
character(*), intent(in) :: newExt character(len=*), intent(in) :: newExt
character path character(len=1024) path
integer(pInt) stat integer(pInt) stat
path = trim(getSolverWorkingDirectoryName())//trim(getSolverJobName())//'.'//newExt path = trim(getSolverWorkingDirectoryName())//trim(getSolverJobName())//'.'//newExt
open(unit,status='replace',iostat=stat,file=path) open(unit,status='replace',iostat=stat,file=path)
if (stat /= 0) then if (stat /= 0_pInt) call IO_error(100_pInt,ext_msg=path)
call IO_error(100_pInt,ext_msg=path)
endif
endsubroutine endsubroutine
@ -352,8 +332,8 @@ end function
integer(pInt), intent(in) :: unit integer(pInt), intent(in) :: unit
integer(pInt), intent(in), optional :: recMultiplier integer(pInt), intent(in), optional :: recMultiplier
character(*), intent(in) :: newExt character(len=*), intent(in) :: newExt
character path character(len=1024) path
integer(pInt) stat integer(pInt) stat
path = trim(getSolverWorkingDirectoryName())//trim(getSolverJobName())//'.'//newExt path = trim(getSolverWorkingDirectoryName())//trim(getSolverJobName())//'.'//newExt
@ -362,9 +342,7 @@ end function
else else
open(unit,status='replace',form='unformatted',access='direct',recl=pReal,iostat=stat,file=path) open(unit,status='replace',form='unformatted',access='direct',recl=pReal,iostat=stat,file=path)
endif endif
if (stat /= 0) then if (stat /= 0_pInt) call IO_error(100_pInt,ext_msg=path)
call IO_error(100_pInt,ext_msg=path)
endif
endsubroutine endsubroutine
@ -381,8 +359,8 @@ end function
integer(pInt), intent(in) :: unit integer(pInt), intent(in) :: unit
integer(pInt), intent(in), optional :: recMultiplier integer(pInt), intent(in), optional :: recMultiplier
character(*), intent(in) :: newExt, jobName character(len=*), intent(in) :: newExt, jobName
character path character(len=1024) path
integer(pInt) stat integer(pInt) stat
path = trim(getSolverWorkingDirectoryName())//trim(jobName)//'.'//newExt path = trim(getSolverWorkingDirectoryName())//trim(jobName)//'.'//newExt
@ -1251,38 +1229,28 @@ endfunction
case (205_pInt) case (205_pInt)
msg = 'unknown lattice structure encountered' msg = 'unknown lattice structure encountered'
case (210_pInt)
msg = 'unknown material parameter for j2 constitutive phase:'
case (211_pInt) case (211_pInt)
msg = 'material parameter for j2 constitutive phase out of bounds:' msg = 'material parameter for j2 constitutive phase out of bounds:'
case (212_pInt) case (212_pInt)
msg = 'unknown constitutive output for j2 constitution:' msg = 'unknown constitutive output for j2 constitution:'
case (220_pInt)
msg = 'unknown material parameter for phenopowerlaw constitutive phase:'
case (221_pInt) case (221_pInt)
msg = 'material parameter for phenopowerlaw constitutive phase out of bounds:' msg = 'material parameter for phenopowerlaw constitutive phase out of bounds:'
case (222_pInt) case (222_pInt)
msg = 'unknown constitutive output for phenopowerlaw constitution:' msg = 'unknown constitutive output for phenopowerlaw constitution:'
case (230_pInt)
msg = 'unknown material parameter for titanmod constitutive phase:'
case (231_pInt) case (231_pInt)
msg = 'material parameter for titanmod constitutive phase out of bounds:' msg = 'material parameter for titanmod constitutive phase out of bounds:'
case (232_pInt) case (232_pInt)
msg = 'unknown constitutive output for titanmod constitution:' msg = 'unknown constitutive output for titanmod constitution:'
case (240_pInt)
msg = 'unknown material parameter for dislotwin constitutive phase:'
case (241_pInt) case (241_pInt)
msg = 'material parameter for dislotwin constitutive phase out of bounds:' msg = 'material parameter for dislotwin constitutive phase out of bounds:'
case (242_pInt) case (242_pInt)
msg = 'unknown constitutive output for dislotwin constitution:' msg = 'unknown constitutive output for dislotwin constitution:'
case (243_pInt) case (243_pInt)
msg = 'zero stackin fault energy' msg = 'zero stacking fault energy'
case (250_pInt)
msg = 'unknown material parameter for nonlocal constitutive phase:'
case (251_pInt) case (251_pInt)
msg = 'material parameter for nonlocal constitutive phase out of bounds:' msg = 'material parameter for nonlocal constitutive phase out of bounds:'
case (252_pInt) case (252_pInt)

View File

@ -284,14 +284,15 @@ enddo
do ! read thru sections of phase part do ! read thru sections of phase part
read(file,'(a1024)',END=100) line read(file,'(a1024)',END=100) line
if (IO_isBlank(line)) cycle ! skip empty lines if (IO_isBlank(line)) cycle ! skip empty lines
if (IO_getTag(line,'<','>') /= '') exit ! stop at next part if (IO_getTag(line,'<','>') /= '') exit ! stop at next part
if (IO_getTag(line,'[',']') /= '') then ! next section if (IO_getTag(line,'[',']') /= '') then ! next section
section = section + 1_pInt section = section + 1_pInt ! advance section counter
output = 0_pInt ! reset output counter output = 0_pInt ! reset output counter
cycle
endif endif
if (section > 0_pInt .and. phase_constitution(section) == constitutive_dislotwin_label) then ! one of my sections if (section > 0_pInt .and. phase_constitution(section) == constitutive_dislotwin_label) then ! one of my sections
i = phase_constitutionInstance(section) ! which instance of my constitution is present phase i = phase_constitutionInstance(section) ! which instance of my constitution is present phase
positions = IO_stringPos(line,maxNchunks) positions = IO_stringPos(line,maxNchunks)
tag = IO_lc(IO_stringValue(line,positions,1)) ! extract key tag = IO_lc(IO_stringValue(line,positions,1)) ! extract key
select case(tag) select case(tag)
@ -393,8 +394,6 @@ do ! read thru sections of
constitutive_dislotwin_sbResistance(i) = IO_floatValue(line,positions,2_pInt) constitutive_dislotwin_sbResistance(i) = IO_floatValue(line,positions,2_pInt)
case ('shearbandvelocity') case ('shearbandvelocity')
constitutive_dislotwin_sbVelocity(i) = IO_floatValue(line,positions,2_pInt) constitutive_dislotwin_sbVelocity(i) = IO_floatValue(line,positions,2_pInt)
case default
call IO_error(240_pInt,ext_msg=tag)
end select end select
endif endif
enddo enddo

View File

@ -126,29 +126,30 @@ subroutine constitutive_j2_init(file)
allocate(constitutive_j2_n(maxNinstance)) ; constitutive_j2_n = 0.0_pReal allocate(constitutive_j2_n(maxNinstance)) ; constitutive_j2_n = 0.0_pReal
allocate(constitutive_j2_h0(maxNinstance)) ; constitutive_j2_h0 = 0.0_pReal allocate(constitutive_j2_h0(maxNinstance)) ; constitutive_j2_h0 = 0.0_pReal
allocate(constitutive_j2_tausat(maxNinstance)) ; constitutive_j2_tausat = 0.0_pReal allocate(constitutive_j2_tausat(maxNinstance)) ; constitutive_j2_tausat = 0.0_pReal
allocate(constitutive_j2_a(maxNinstance)) ; constitutive_j2_a = 0.0_pReal allocate(constitutive_j2_a(maxNinstance)) ; constitutive_j2_a = 0.0_pReal
allocate(constitutive_j2_aTolResistance(maxNinstance)) ; constitutive_j2_aTolResistance = 0.0_pReal allocate(constitutive_j2_aTolResistance(maxNinstance)) ; constitutive_j2_aTolResistance = 0.0_pReal
rewind(file) rewind(file)
line = '' line = ''
section = 0 section = 0
do while (IO_lc(IO_getTag(line,'<','>')) /= 'phase') ! wind forward to <phase> do while (IO_lc(IO_getTag(line,'<','>')) /= 'phase') ! wind forward to <phase>
read(file,'(a1024)',END=100) line read(file,'(a1024)',END=100) line
enddo enddo
do ! read thru sections of phase part do ! read thru sections of phase part
read(file,'(a1024)',END=100) line read(file,'(a1024)',END=100) line
if (IO_isBlank(line)) cycle ! skip empty lines if (IO_isBlank(line)) cycle ! skip empty lines
if (IO_getTag(line,'<','>') /= '') exit ! stop at next part if (IO_getTag(line,'<','>') /= '') exit ! stop at next part
if (IO_getTag(line,'[',']') /= '') then ! next section if (IO_getTag(line,'[',']') /= '') then ! next section
section = section + 1 section = section + 1_pInt ! advance section counter
output = 0 ! reset output counter output = 0_pInt ! reset output counter
cycle
endif endif
if (section > 0 .and. phase_constitution(section) == constitutive_j2_label) then ! one of my sections if (section > 0_pInt .and. phase_constitution(section) == constitutive_j2_label) then ! one of my sections
i = phase_constitutionInstance(section) ! which instance of my constitution is present phase i = phase_constitutionInstance(section) ! which instance of my constitution is present phase
positions = IO_stringPos(line,maxNchunks) positions = IO_stringPos(line,maxNchunks)
tag = IO_lc(IO_stringValue(line,positions,1)) ! extract key tag = IO_lc(IO_stringValue(line,positions,1_pInt)) ! extract key
select case(tag) select case(tag)
case ('(output)') case ('(output)')
output = output + 1 output = output + 1
@ -257,7 +258,7 @@ integer(pInt), intent(in) :: myInstance ! number specifyin
!*** output variables !*** output variables
real(pReal), dimension(constitutive_j2_sizeState(myInstance)) :: & real(pReal), dimension(constitutive_j2_sizeState(myInstance)) :: &
constitutive_j2_aTolState ! relevant state values for the current instance of this constitution constitutive_j2_aTolState ! relevant state values for the current instance of this constitution
!*** local variables !*** local variables

View File

@ -331,23 +331,23 @@ rewind(file)
line = '' line = ''
section = 0_pInt section = 0_pInt
do while (IO_lc(IO_getTag(line,'<','>')) /= 'phase') ! wind forward to <phase> do while (IO_lc(IO_getTag(line,'<','>')) /= 'phase') ! wind forward to <phase>
read(file,'(a1024)',END=100) line read(file,'(a1024)',END=100) line
enddo enddo
do ! read thru sections of phase part do ! read thru sections of phase part
read(file,'(a1024)',END=100) line read(file,'(a1024)',END=100) line
if (IO_isBlank(line)) cycle ! skip empty lines if (IO_isBlank(line)) cycle ! skip empty lines
if (IO_getTag(line,'<','>') /= '') exit ! stop at next part if (IO_getTag(line,'<','>') /= '') exit ! stop at next part
if (IO_getTag(line,'[',']') /= '') then ! next section if (IO_getTag(line,'[',']') /= '') then ! next section
section = section + 1_pInt section = section + 1_pInt ! advance section counter
output = 0_pInt ! reset output counter output = 0_pInt ! reset output counter
cycle cycle
endif endif
if (section > 0_pInt .and. phase_constitution(section) == constitutive_nonlocal_label) then ! one of my sections if (section > 0_pInt .and. phase_constitution(section) == constitutive_nonlocal_label) then ! one of my sections
i = phase_constitutionInstance(section) ! which instance of my constitution is present phase i = phase_constitutionInstance(section) ! which instance of my constitution is present phase
positions = IO_stringPos(line,maxNchunks) positions = IO_stringPos(line,maxNchunks)
tag = IO_lc(IO_stringValue(line,positions,1_pInt)) ! extract key tag = IO_lc(IO_stringValue(line,positions,1_pInt)) ! extract key
select case(tag) select case(tag)
case('constitution','/nonlocal/') case('constitution','/nonlocal/')
cycle cycle
@ -440,8 +440,6 @@ do
constitutive_nonlocal_rhoSglScatter(i) = IO_floatValue(line,positions,2_pInt) constitutive_nonlocal_rhoSglScatter(i) = IO_floatValue(line,positions,2_pInt)
case('surfacetransmissivity') case('surfacetransmissivity')
constitutive_nonlocal_surfaceTransmissivity(i) = IO_floatValue(line,positions,2_pInt) constitutive_nonlocal_surfaceTransmissivity(i) = IO_floatValue(line,positions,2_pInt)
case default
call IO_error(250_pInt,ext_msg=tag)
end select end select
endif endif
enddo enddo

View File

@ -263,13 +263,14 @@ subroutine constitutive_phenopowerlaw_init(file)
if (IO_isBlank(line)) cycle ! skip empty lines if (IO_isBlank(line)) cycle ! skip empty lines
if (IO_getTag(line,'<','>') /= '') exit ! stop at next part if (IO_getTag(line,'<','>') /= '') exit ! stop at next part
if (IO_getTag(line,'[',']') /= '') then ! next section if (IO_getTag(line,'[',']') /= '') then ! next section
section = section + 1_pInt section = section + 1_pInt ! advance section counter
output = 0_pInt ! reset output counter output = 0_pInt ! reset output counter
cycle ! skip to next line
endif endif
if (section > 0_pInt .and. phase_constitution(section) == constitutive_phenopowerlaw_label) then ! one of my sections if (section > 0_pInt .and. phase_constitution(section) == constitutive_phenopowerlaw_label) then ! one of my sections
i = phase_constitutionInstance(section) ! which instance of my constitution is present phase i = phase_constitutionInstance(section) ! which instance of my constitution is present phase
positions = IO_stringPos(line,maxNchunks) positions = IO_stringPos(line,maxNchunks)
tag = IO_lc(IO_stringValue(line,positions,1_pInt)) ! extract key tag = IO_lc(IO_stringValue(line,positions,1_pInt)) ! extract key
select case(tag) select case(tag)
case ('(output)') case ('(output)')
output = output + 1_pInt output = output + 1_pInt
@ -345,8 +346,6 @@ subroutine constitutive_phenopowerlaw_init(file)
case ('interaction_twintwin') case ('interaction_twintwin')
forall (j = 1_pInt:lattice_maxNinteraction) & forall (j = 1_pInt:lattice_maxNinteraction) &
constitutive_phenopowerlaw_interaction_twintwin(j,i) = IO_floatValue(line,positions,1_pInt+j) constitutive_phenopowerlaw_interaction_twintwin(j,i) = IO_floatValue(line,positions,1_pInt+j)
case default
call IO_error(220_pInt,ext_msg=tag)
end select end select
endif endif
enddo enddo

View File

@ -384,18 +384,19 @@ do while (IO_lc(IO_getTag(line,'<','>')) /= 'phase') ! wind forward to <phas
read(file,'(a1024)',END=100) line read(file,'(a1024)',END=100) line
enddo enddo
do ! read thru sections of phase part do ! read thru sections of phase part
read(file,'(a1024)',END=100) line read(file,'(a1024)',END=100) line
if (IO_isBlank(line)) cycle ! skip empty lines if (IO_isBlank(line)) cycle ! skip empty lines
if (IO_getTag(line,'<','>') /= '') exit ! stop at next part if (IO_getTag(line,'<','>') /= '') exit ! stop at next part
if (IO_getTag(line,'[',']') /= '') then ! next section if (IO_getTag(line,'[',']') /= '') then ! next section
section = section + 1_pInt section = section + 1_pInt ! advance section counter
output = 0_pInt ! reset output counter output = 0_pInt ! reset output counter
cycle ! skip to next line
endif endif
if (section > 0_pInt .and. phase_constitution(section) == constitutive_titanmod_label) then ! one of my sections if (section > 0_pInt .and. phase_constitution(section) == constitutive_titanmod_label) then ! one of my sections
i = phase_constitutionInstance(section) ! which instance of my constitution is present phase i = phase_constitutionInstance(section) ! which instance of my constitution is present phase
positions = IO_stringPos(line,maxNchunks) positions = IO_stringPos(line,maxNchunks)
tag = IO_lc(IO_stringValue(line,positions,1_pInt)) ! extract key tag = IO_lc(IO_stringValue(line,positions,1_pInt)) ! extract key
select case(tag) select case(tag)
case ('(output)') case ('(output)')
output = output + 1_pInt output = output + 1_pInt
@ -583,8 +584,6 @@ do ! read thru sections of
forall (j = 1_pInt:lattice_maxNinteraction) & forall (j = 1_pInt:lattice_maxNinteraction) &
constitutive_titanmod_interactionTwinTwin(j,i) = IO_floatValue(line,positions,1_pInt+j) constitutive_titanmod_interactionTwinTwin(j,i) = IO_floatValue(line,positions,1_pInt+j)
write(6,*) tag write(6,*) tag
case default
call IO_error(230_pInt,ext_msg=tag)
end select end select
endif endif
enddo enddo