diff --git a/code/IO.f90 b/code/IO.f90 index 21ff74327..72f0e0258 100644 --- a/code/IO.f90 +++ b/code/IO.f90 @@ -161,15 +161,12 @@ end function implicit none integer(pInt), intent(in) :: unit character(len=*), intent(in) :: relPath - integer stat - character path + character(len=1024) path + integer(pInt) stat - IO_open_file_stat = .false. path = trim(getSolverWorkingDirectoryName())//relPath open(unit,status='old',iostat=stat,file=path) - if (stat == 0) then - IO_open_file_stat = .true. - endif + IO_open_file_stat = (stat == 0_pInt) endfunction @@ -186,14 +183,12 @@ end function implicit none integer(pInt), intent(in) :: unit character(len=*), intent(in) :: relPath - character path + character(len=1024) path integer(pInt) stat path = trim(getSolverWorkingDirectoryName())//relPath open(unit,status='old',iostat=stat,file=path) - if (stat /= 0) then - call IO_error(100_pInt,ext_msg=path) - endif + if (stat /= 0_pInt) call IO_error(100_pInt,ext_msg=path) endsubroutine @@ -212,34 +207,28 @@ end function integer(pInt), intent(in) :: unit character(len=*), intent(in) :: model + character(len=1024) path integer(pInt) stat - character path if (FEsolver == 'Abaqus') then + path = trim(getSolverWorkingDirectoryName())//trim(model)//InputFileExtension open(unit+1,status='old',iostat=stat,file=path) - if (stat /= 0) then - call IO_error(100_pInt,ext_msg=path) - endif + if (stat /= 0_pInt) call IO_error(100_pInt,ext_msg=path) path = trim(getSolverWorkingDirectoryName())//trim(model)//InputFileExtension//'_assembly' open(unit,iostat=stat,file=path) - if (stat /= 0) then - call IO_error(100_pInt,ext_msg=path) - endif - - if (IO_abaqus_assembleInputFile(unit,unit+1_pInt)) then ! strip comments and concatenate any "include"s - call IO_error(103_pInt) - endif + if (stat /= 0_pInt) 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 close(unit+1_pInt) else + path = trim(getSolverWorkingDirectoryName())//trim(model)//InputFileExtension open(unit,status='old',iostat=stat,file=path) - if (stat /= 0) then - call IO_error(100_pInt,ext_msg=path) - endif + if (stat /= 0_pInt) call IO_error(100_pInt,ext_msg=path) + endif endsubroutine @@ -254,15 +243,13 @@ end function use DAMASK_interface implicit none - character path - integer(pInt) stat integer(pInt), intent(in) :: unit + character(len=1024) path + integer(pInt) stat path = trim(getSolverWorkingDirectoryName())//trim(getSolverJobName())//LogFileExtension open(unit,status='old',iostat=stat,file=path) - if (stat /= 0) then - call IO_error(100_pInt,ext_msg=path) - endif + if (stat /= 0) call IO_error(100_pInt,ext_msg=path) endsubroutine @@ -278,16 +265,13 @@ end function implicit none integer(pInt), intent(in) :: unit - character(*), intent(in) :: newExt - character path - integer stat + character(len=*), intent(in) :: newExt + character(len=1024) path + integer(pInt) stat - IO_open_jobFile_stat = .false. path = trim(getSolverWorkingDirectoryName())//trim(getSolverJobName())//'.'//newExt open(unit,status='old',iostat=stat,file=path) - if (stat == 0) then - IO_open_jobFile_stat = .true. - endif + IO_open_jobFile_stat = (stat == 0_pInt) endfunction @@ -303,15 +287,13 @@ end function implicit none integer(pInt), intent(in) :: unit - character(*), intent(in) :: newExt - character path + character(len=*), intent(in) :: newExt + character(len=1024) path integer(pInt) stat path = trim(getSolverWorkingDirectoryName())//trim(getSolverJobName())//'.'//newExt open(unit,status='old',iostat=stat,file=path) - if (stat /= 0) then - call IO_error(100_pInt,ext_msg=path) - endif + if (stat /= 0_pInt) call IO_error(100_pInt,ext_msg=path) endsubroutine @@ -327,15 +309,13 @@ end function implicit none integer(pInt), intent(in) :: unit - character(*), intent(in) :: newExt - character path + character(len=*), intent(in) :: newExt + character(len=1024) path integer(pInt) stat path = trim(getSolverWorkingDirectoryName())//trim(getSolverJobName())//'.'//newExt open(unit,status='replace',iostat=stat,file=path) - if (stat /= 0) then - call IO_error(100_pInt,ext_msg=path) - endif + if (stat /= 0_pInt) call IO_error(100_pInt,ext_msg=path) endsubroutine @@ -352,8 +332,8 @@ end function integer(pInt), intent(in) :: unit integer(pInt), intent(in), optional :: recMultiplier - character(*), intent(in) :: newExt - character path + character(len=*), intent(in) :: newExt + character(len=1024) path integer(pInt) stat path = trim(getSolverWorkingDirectoryName())//trim(getSolverJobName())//'.'//newExt @@ -362,9 +342,7 @@ end function else open(unit,status='replace',form='unformatted',access='direct',recl=pReal,iostat=stat,file=path) endif - if (stat /= 0) then - call IO_error(100_pInt,ext_msg=path) - endif + if (stat /= 0_pInt) call IO_error(100_pInt,ext_msg=path) endsubroutine @@ -381,8 +359,8 @@ end function integer(pInt), intent(in) :: unit integer(pInt), intent(in), optional :: recMultiplier - character(*), intent(in) :: newExt, jobName - character path + character(len=*), intent(in) :: newExt, jobName + character(len=1024) path integer(pInt) stat path = trim(getSolverWorkingDirectoryName())//trim(jobName)//'.'//newExt @@ -1251,38 +1229,28 @@ endfunction case (205_pInt) msg = 'unknown lattice structure encountered' - case (210_pInt) - msg = 'unknown material parameter for j2 constitutive phase:' case (211_pInt) msg = 'material parameter for j2 constitutive phase out of bounds:' case (212_pInt) msg = 'unknown constitutive output for j2 constitution:' - case (220_pInt) - msg = 'unknown material parameter for phenopowerlaw constitutive phase:' case (221_pInt) msg = 'material parameter for phenopowerlaw constitutive phase out of bounds:' case (222_pInt) msg = 'unknown constitutive output for phenopowerlaw constitution:' - case (230_pInt) - msg = 'unknown material parameter for titanmod constitutive phase:' case (231_pInt) msg = 'material parameter for titanmod constitutive phase out of bounds:' case (232_pInt) msg = 'unknown constitutive output for titanmod constitution:' - case (240_pInt) - msg = 'unknown material parameter for dislotwin constitutive phase:' case (241_pInt) msg = 'material parameter for dislotwin constitutive phase out of bounds:' case (242_pInt) msg = 'unknown constitutive output for dislotwin constitution:' 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) msg = 'material parameter for nonlocal constitutive phase out of bounds:' case (252_pInt) diff --git a/code/constitutive_dislotwin.f90 b/code/constitutive_dislotwin.f90 index 37de1eb92..bf566aa56 100644 --- a/code/constitutive_dislotwin.f90 +++ b/code/constitutive_dislotwin.f90 @@ -284,14 +284,15 @@ enddo do ! read thru sections of phase part read(file,'(a1024)',END=100) line - if (IO_isBlank(line)) cycle ! skip empty lines - if (IO_getTag(line,'<','>') /= '') exit ! stop at next part - if (IO_getTag(line,'[',']') /= '') then ! next section - section = section + 1_pInt - output = 0_pInt ! reset output counter + if (IO_isBlank(line)) cycle ! skip empty lines + if (IO_getTag(line,'<','>') /= '') exit ! stop at next part + if (IO_getTag(line,'[',']') /= '') then ! next section + section = section + 1_pInt ! advance section counter + output = 0_pInt ! reset output counter + cycle endif 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) tag = IO_lc(IO_stringValue(line,positions,1)) ! extract key select case(tag) @@ -393,8 +394,6 @@ do ! read thru sections of constitutive_dislotwin_sbResistance(i) = IO_floatValue(line,positions,2_pInt) case ('shearbandvelocity') constitutive_dislotwin_sbVelocity(i) = IO_floatValue(line,positions,2_pInt) - case default - call IO_error(240_pInt,ext_msg=tag) end select endif enddo diff --git a/code/constitutive_j2.f90 b/code/constitutive_j2.f90 index 4eb8c5d56..ebce4b2a8 100644 --- a/code/constitutive_j2.f90 +++ b/code/constitutive_j2.f90 @@ -126,29 +126,30 @@ subroutine constitutive_j2_init(file) 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_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 rewind(file) line = '' section = 0 - do while (IO_lc(IO_getTag(line,'<','>')) /= 'phase') ! wind forward to + do while (IO_lc(IO_getTag(line,'<','>')) /= 'phase') ! wind forward to read(file,'(a1024)',END=100) line enddo - - do ! read thru sections of phase part + + do ! read thru sections of phase part read(file,'(a1024)',END=100) line - if (IO_isBlank(line)) cycle ! skip empty lines - if (IO_getTag(line,'<','>') /= '') exit ! stop at next part - if (IO_getTag(line,'[',']') /= '') then ! next section - section = section + 1 - output = 0 ! reset output counter + if (IO_isBlank(line)) cycle ! skip empty lines + if (IO_getTag(line,'<','>') /= '') exit ! stop at next part + if (IO_getTag(line,'[',']') /= '') then ! next section + section = section + 1_pInt ! advance section counter + output = 0_pInt ! reset output counter + cycle endif - if (section > 0 .and. phase_constitution(section) == constitutive_j2_label) then ! one of my sections - i = phase_constitutionInstance(section) ! which instance of my constitution is present phase + 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 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) case ('(output)') output = output + 1 @@ -257,7 +258,7 @@ integer(pInt), intent(in) :: myInstance ! number specifyin !*** output variables 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 diff --git a/code/constitutive_nonlocal.f90 b/code/constitutive_nonlocal.f90 index 6f136e867..3686412ca 100644 --- a/code/constitutive_nonlocal.f90 +++ b/code/constitutive_nonlocal.f90 @@ -331,23 +331,23 @@ rewind(file) line = '' section = 0_pInt -do while (IO_lc(IO_getTag(line,'<','>')) /= 'phase') ! wind forward to +do while (IO_lc(IO_getTag(line,'<','>')) /= 'phase') ! wind forward to read(file,'(a1024)',END=100) line enddo -do ! read thru sections of phase part +do ! read thru sections of phase part read(file,'(a1024)',END=100) line - if (IO_isBlank(line)) cycle ! skip empty lines - if (IO_getTag(line,'<','>') /= '') exit ! stop at next part - if (IO_getTag(line,'[',']') /= '') then ! next section - section = section + 1_pInt - output = 0_pInt ! reset output counter + if (IO_isBlank(line)) cycle ! skip empty lines + if (IO_getTag(line,'<','>') /= '') exit ! stop at next part + if (IO_getTag(line,'[',']') /= '') then ! next section + section = section + 1_pInt ! advance section counter + output = 0_pInt ! reset output counter cycle endif - 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 + 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 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) case('constitution','/nonlocal/') cycle @@ -440,8 +440,6 @@ do constitutive_nonlocal_rhoSglScatter(i) = IO_floatValue(line,positions,2_pInt) case('surfacetransmissivity') constitutive_nonlocal_surfaceTransmissivity(i) = IO_floatValue(line,positions,2_pInt) - case default - call IO_error(250_pInt,ext_msg=tag) end select endif enddo diff --git a/code/constitutive_phenopowerlaw.f90 b/code/constitutive_phenopowerlaw.f90 index f6d0b629d..e9c23124f 100644 --- a/code/constitutive_phenopowerlaw.f90 +++ b/code/constitutive_phenopowerlaw.f90 @@ -263,13 +263,14 @@ subroutine constitutive_phenopowerlaw_init(file) if (IO_isBlank(line)) cycle ! skip empty lines if (IO_getTag(line,'<','>') /= '') exit ! stop at next part if (IO_getTag(line,'[',']') /= '') then ! next section - section = section + 1_pInt - output = 0_pInt ! reset output counter + section = section + 1_pInt ! advance section counter + output = 0_pInt ! reset output counter + cycle ! skip to next line endif 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 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) case ('(output)') output = output + 1_pInt @@ -345,8 +346,6 @@ subroutine constitutive_phenopowerlaw_init(file) case ('interaction_twintwin') forall (j = 1_pInt:lattice_maxNinteraction) & 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 endif enddo diff --git a/code/constitutive_titanmod.f90 b/code/constitutive_titanmod.f90 index b3343b7ab..bb99f5f5e 100644 --- a/code/constitutive_titanmod.f90 +++ b/code/constitutive_titanmod.f90 @@ -384,18 +384,19 @@ do while (IO_lc(IO_getTag(line,'<','>')) /= 'phase') ! wind forward to ') /= '') exit ! stop at next part if (IO_getTag(line,'[',']') /= '') then ! next section - section = section + 1_pInt - output = 0_pInt ! reset output counter + section = section + 1_pInt ! advance section counter + output = 0_pInt ! reset output counter + cycle ! skip to next line endif 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) - 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) case ('(output)') output = output + 1_pInt @@ -583,8 +584,6 @@ do ! read thru sections of forall (j = 1_pInt:lattice_maxNinteraction) & constitutive_titanmod_interactionTwinTwin(j,i) = IO_floatValue(line,positions,1_pInt+j) write(6,*) tag - case default - call IO_error(230_pInt,ext_msg=tag) end select endif enddo