allow defaultVal string of variable length
This commit is contained in:
parent
4470ecfe4a
commit
9f2559baf5
13
src/list.f90
13
src/list.f90
|
@ -295,7 +295,7 @@ character(len=65536) function getString(this,key,defaultVal,raw)
|
||||||
implicit none
|
implicit none
|
||||||
class(tPartitionedStringList), target, intent(in) :: this
|
class(tPartitionedStringList), target, intent(in) :: this
|
||||||
character(len=*), intent(in) :: key
|
character(len=*), intent(in) :: key
|
||||||
character(len=65536), intent(in), optional :: defaultVal
|
character(len=*), intent(in), optional :: defaultVal
|
||||||
logical, intent(in), optional :: raw
|
logical, intent(in), optional :: raw
|
||||||
type(tPartitionedStringList), pointer :: item
|
type(tPartitionedStringList), pointer :: item
|
||||||
logical :: found, &
|
logical :: found, &
|
||||||
|
@ -308,8 +308,8 @@ character(len=65536) function getString(this,key,defaultVal,raw)
|
||||||
|
|
||||||
found = present(defaultVal)
|
found = present(defaultVal)
|
||||||
if (found) then
|
if (found) then
|
||||||
|
if (len_trim(defaultVal) > len(getString)) call IO_error(0,ext_msg='getString')
|
||||||
getString = trim(defaultVal)
|
getString = trim(defaultVal)
|
||||||
if (len_trim(getString) /= len_trim(defaultVal)) call IO_error(0,ext_msg='getString')
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
item => this
|
item => this
|
||||||
|
@ -447,7 +447,7 @@ function getStrings(this,key,defaultVal,raw)
|
||||||
character(len=65536),dimension(:), allocatable :: getStrings
|
character(len=65536),dimension(:), allocatable :: getStrings
|
||||||
class(tPartitionedStringList),target, intent(in) :: this
|
class(tPartitionedStringList),target, intent(in) :: this
|
||||||
character(len=*), intent(in) :: key
|
character(len=*), intent(in) :: key
|
||||||
character(len=65536),dimension(:), intent(in), optional :: defaultVal
|
character(len=*), dimension(:), intent(in), optional :: defaultVal
|
||||||
logical, intent(in), optional :: raw
|
logical, intent(in), optional :: raw
|
||||||
type(tPartitionedStringList), pointer :: item
|
type(tPartitionedStringList), pointer :: item
|
||||||
character(len=65536) :: str
|
character(len=65536) :: str
|
||||||
|
@ -499,7 +499,12 @@ function getStrings(this,key,defaultVal,raw)
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
if (.not. found) then
|
if (.not. found) then
|
||||||
if (present(defaultVal)) then; getStrings = defaultVal; else; call IO_error(140,ext_msg=key); endif
|
if (present(defaultVal)) then
|
||||||
|
if (len(defaultVal) > len(getStrings)) call IO_error(0,ext_msg='getStrings')
|
||||||
|
getStrings = defaultVal
|
||||||
|
else
|
||||||
|
call IO_error(140,ext_msg=key)
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
end function getStrings
|
end function getStrings
|
||||||
|
|
|
@ -9,8 +9,7 @@
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
module plastic_isotropic
|
module plastic_isotropic
|
||||||
use prec, only: &
|
use prec, only: &
|
||||||
pReal, &
|
pReal
|
||||||
pInt
|
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
private
|
private
|
||||||
|
|
Loading…
Reference in New Issue