26 character(len=LENMEMPATH) :: memory_path
27 real(dp),
pointer :: dvclose => null()
28 real(dp),
pointer :: rclose => null()
29 integer(I4B),
pointer :: icnvgopt => null()
30 integer(I4B),
pointer :: iter1 => null()
31 integer(I4B),
pointer :: ilinmeth => null()
32 integer(I4B),
pointer :: iscl => null()
33 integer(I4B),
pointer :: iord => null()
34 integer(I4B),
pointer :: north => null()
35 real(dp),
pointer :: relax => null()
36 integer(I4B),
pointer :: level => null()
37 real(dp),
pointer :: droptol => null()
38 integer(I4B),
pointer :: ifdparam => null()
49 subroutine init(this, mem_path)
52 character(len=LENMEMPATH) :: mem_path
56 call mem_allocate(this%dvclose,
'DVCLOSE', this%memory_path)
57 call mem_allocate(this%rclose,
'RCLOSE', this%memory_path)
58 call mem_allocate(this%icnvgopt,
'ICNVGOPT', this%memory_path)
60 call mem_allocate(this%ilinmeth,
'ILINMETH', this%memory_path)
66 call mem_allocate(this%droptol,
'DROPTOL', this%memory_path)
67 call mem_allocate(this%ifdparam,
'IDFPARAM', this%memory_path)
89 integer(I4B) :: idfparam
91 this%ifdparam = idfparam
93 select case (idfparam)
138 logical(LGP) :: block_found, end_of_block
140 character(len=LINELENGTH) :: errmsg
141 character(len=LINELENGTH) :: keyword
142 integer(I4B) :: iscaling, iordering
144 call parser%GetBlock(
'LINEAR', block_found, ierr, supportopenclose=.true., &
145 blockrequired=.false.)
147 if (block_found)
then
148 write (iout,
'(/1x,a)')
'PROCESSING LINEAR DATA'
150 call parser%GetNextLine(end_of_block)
151 if (end_of_block)
exit
152 call parser%GetStringCaps(keyword)
154 select case (keyword)
155 case (
'INNER_DVCLOSE')
156 this%dvclose = parser%GetDouble()
157 case (
'INNER_RCLOSE')
158 this%rclose = parser%GetDouble()
160 call parser%GetStringCaps(keyword)
161 if (keyword ==
'STRICT')
then
163 else if (keyword ==
'L2NORM_RCLOSE')
then
165 else if (keyword ==
'RELATIVE_RCLOSE')
then
167 else if (keyword ==
'L2NORM_RELATIVE_RCLOSE')
then
170 case (
'INNER_MAXIMUM')
171 this%iter1 = parser%GetInteger()
172 case (
'LINEAR_ACCELERATION')
173 call parser%GetStringCaps(keyword)
174 if (keyword .eq.
'CG')
then
176 else if (keyword .eq.
'BICGSTAB')
then
180 write (errmsg,
'(3a)') &
181 'Unknown IMSLINEAR LINEAR_ACCELERATION method (', &
185 case (
'SCALING_METHOD')
186 call parser%GetStringCaps(keyword)
188 if (keyword .eq.
'NONE')
then
190 else if (keyword .eq.
'DIAGONAL')
then
192 else if (keyword .eq.
'L2NORM')
then
195 write (errmsg,
'(3a)') &
196 'Unknown IMSLINEAR SCALING_METHOD (', trim(keyword),
').'
200 case (
'RED_BLACK_ORDERING')
202 case (
'REORDERING_METHOD')
203 call parser%GetStringCaps(keyword)
205 if (keyword ==
'NONE')
then
207 else if (keyword ==
'RCM')
then
209 else if (keyword ==
'MD')
then
212 write (errmsg,
'(3a)') &
213 'Unknown IMSLINEAR REORDERING_METHOD (', trim(keyword),
').'
216 this%iord = iordering
217 case (
'NUMBER_ORTHOGONALIZATIONS')
218 this%north = parser%GetInteger()
219 case (
'RELAXATION_FACTOR')
220 this%relax = parser%GetDouble()
221 case (
'PRECONDITIONER_LEVELS')
222 this%level = parser%GetInteger()
223 if (this%level < 0)
then
224 write (errmsg,
'(a,1x,a)') &
225 'IMSLINEAR PRECONDITIONER_LEVELS must be greater than', &
229 case (
'PRECONDITIONER_DROP_TOLERANCE')
230 this%droptol = parser%GetDouble()
231 if (this%droptol <
dzero)
then
232 write (errmsg,
'(a,1x,a)') &
233 'IMSLINEAR PRECONDITIONER_DROP_TOLERANCE', &
234 'must be greater than or equal to zero'
240 write (errmsg,
'(3a)') &
241 'Unknown IMSLINEAR keyword (', trim(keyword),
').'
245 write (iout,
'(1x,a)')
'END OF LINEAR DATA'
247 if (this%ifdparam == 0)
THEN
248 write (errmsg,
'(a)')
'NO LINEAR block detected.'
260 character(len=LINELENGTH) :: warnmsg
262 if (this%level == 0 .and. this%droptol > 0.0_dp)
then
263 write (warnmsg,
'(a)')
"PRECONDITIONER_DROP_TOLERANCE is ignored because &
264 &PRECONDITIONER_LEVELS equals zero."
299 integer(I4B),
intent(in) :: level
300 real(dp),
intent(in) :: relax
306 if (relax >
dzero)
then
312 if (relax >
dzero)
then
This module contains block parser methods.
This module contains simulation constants.
real(dp), parameter dem1
real constant 1e-1
real(dp), parameter dem3
real constant 1e-3
real(dp), parameter dem4
real constant 1e-4
real(dp), parameter dzero
real constant zero
real(dp), parameter dem2
real constant 1e-2
integer(i4b), parameter, public cg_method
subroutine read_from_file(this, parser, iout)
Read the settings for the linear solver from the .ims file,.
subroutine preset_config(this, idfparam)
Set solver pre-configured settings based on complexity option.
@, public ipc_ilu0
ILU0 (incomplete LU, zero fill)
@, public ipc_milut
modified ILUT
subroutine check_settings(this)
Check the settings after reading the configuration from file.
@, public ipc_unknown
preconditioner type not set
integer(i4b), parameter, public bcgs_method
@, public ipc_milu0
modified ILU0
pure integer(i4b) function, public resolve_ipc(level, relax)
Resolve the preconditioner enum from the ILU controls.
@, public ipc_ilut
ILUT (incomplete LU with threshold)
This module defines variable data types.
character(len=lenmempath) function create_mem_path(component, subcomponent, context)
returns the path to the memory object
This module contains simulation methods.
subroutine, public store_warning(msg, substring)
Store warning message.
subroutine, public store_error(msg, terminate)
Store an error message.
subroutine, public deprecation_warning(cblock, cvar, cver, endmsg, iunit)
Store deprecation warning message.