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) :: warnmsg
142 character(len=LINELENGTH) :: keyword
143 integer(I4B) :: iscaling, iordering
145 call parser%GetBlock(
'LINEAR', block_found, ierr, supportopenclose=.true., &
146 blockrequired=.false.)
148 if (block_found)
then
149 write (iout,
'(/1x,a)')
'PROCESSING LINEAR DATA'
151 call parser%GetNextLine(end_of_block)
152 if (end_of_block)
exit
153 call parser%GetStringCaps(keyword)
155 select case (keyword)
156 case (
'INNER_DVCLOSE')
157 this%dvclose = parser%GetDouble()
158 case (
'INNER_RCLOSE')
159 this%rclose = parser%GetDouble()
161 call parser%GetStringCaps(keyword)
162 if (keyword ==
'STRICT')
then
164 else if (keyword ==
'L2NORM_RCLOSE')
then
166 else if (keyword ==
'RELATIVE_RCLOSE')
then
168 else if (keyword ==
'L2NORM_RELATIVE_RCLOSE')
then
171 case (
'INNER_MAXIMUM')
172 this%iter1 = parser%GetInteger()
173 case (
'LINEAR_ACCELERATION')
174 call parser%GetStringCaps(keyword)
175 if (keyword .eq.
'CG')
then
177 else if (keyword .eq.
'BICGSTAB')
then
181 write (errmsg,
'(3a)') &
182 'Unknown IMSLINEAR LINEAR_ACCELERATION method (', &
186 case (
'SCALING_METHOD')
187 call parser%GetStringCaps(keyword)
189 if (keyword .eq.
'NONE')
then
191 else if (keyword .eq.
'DIAGONAL')
then
193 else if (keyword .eq.
'L2NORM')
then
196 write (errmsg,
'(3a)') &
197 'Unknown IMSLINEAR SCALING_METHOD (', trim(keyword),
').'
201 case (
'RED_BLACK_ORDERING')
203 case (
'REORDERING_METHOD')
204 call parser%GetStringCaps(keyword)
206 if (keyword ==
'NONE')
then
208 else if (keyword ==
'RCM')
then
210 else if (keyword ==
'MD')
then
213 write (errmsg,
'(3a)') &
214 'Unknown IMSLINEAR REORDERING_METHOD (', trim(keyword),
').'
217 this%iord = iordering
218 case (
'NUMBER_ORTHOGONALIZATIONS')
219 this%north = parser%GetInteger()
220 case (
'RELAXATION_FACTOR')
221 this%relax = parser%GetDouble()
222 case (
'PRECONDITIONER_LEVELS')
223 this%level = parser%GetInteger()
224 if (this%level < 0)
then
225 write (errmsg,
'(a,1x,a)') &
226 'IMSLINEAR PRECONDITIONER_LEVELS must be greater than', &
230 case (
'PRECONDITIONER_DROP_TOLERANCE')
231 this%droptol = parser%GetDouble()
232 if (this%droptol <
dzero)
then
233 write (errmsg,
'(a,1x,a)') &
234 'IMSLINEAR PRECONDITIONER_DROP_TOLERANCE', &
235 'must be greater than or equal to zero'
240 case (
'INNER_HCLOSE')
241 this%dvclose = parser%GetDouble()
244 write (warnmsg,
'(a)') &
245 'SETTING INNER_DVCLOSE TO INNER_HCLOSE VALUE'
249 warnmsg, parser%GetUnit())
253 write (errmsg,
'(3a)') &
254 'Unknown IMSLINEAR keyword (', trim(keyword),
').'
258 write (iout,
'(1x,a)')
'END OF LINEAR DATA'
260 if (this%ifdparam == 0)
THEN
261 write (errmsg,
'(a)')
'NO LINEAR block detected.'
273 character(len=LINELENGTH) :: warnmsg
275 if (this%level == 0 .and. this%droptol > 0.0_dp)
then
276 write (warnmsg,
'(a)')
"PRECONDITIONER_DROP_TOLERANCE is ignored because &
277 &PRECONDITIONER_LEVELS equals zero."
312 integer(I4B),
intent(in) :: level
313 real(dp),
intent(in) :: relax
319 if (relax >
dzero)
then
325 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.