14 character(len=LENMEMPATH) :: memory_path
15 real(dp),
pointer :: dvclose => null()
16 real(dp),
pointer :: rclose => null()
17 integer(I4B),
pointer :: icnvgopt => null()
18 integer(I4B),
pointer :: iter1 => null()
19 integer(I4B),
pointer :: ilinmeth => null()
20 integer(I4B),
pointer :: iscl => null()
21 integer(I4B),
pointer :: iord => null()
22 integer(I4B),
pointer :: north => null()
23 real(dp),
pointer :: relax => null()
24 integer(I4B),
pointer :: level => null()
25 real(dp),
pointer :: droptol => null()
26 integer(I4B),
pointer :: ifdparam => null()
37 subroutine init(this, mem_path)
40 character(len=LENMEMPATH) :: mem_path
44 call mem_allocate(this%dvclose,
'DVCLOSE', this%memory_path)
45 call mem_allocate(this%rclose,
'RCLOSE', this%memory_path)
46 call mem_allocate(this%icnvgopt,
'ICNVGOPT', this%memory_path)
48 call mem_allocate(this%ilinmeth,
'ILINMETH', this%memory_path)
54 call mem_allocate(this%droptol,
'DROPTOL', this%memory_path)
55 call mem_allocate(this%ifdparam,
'IDFPARAM', this%memory_path)
77 integer(I4B) :: idfparam
79 this%ifdparam = idfparam
81 select case (idfparam)
126 logical(LGP) :: block_found, end_of_block
128 character(len=LINELENGTH) :: errmsg
129 character(len=LINELENGTH) :: warnmsg
130 character(len=LINELENGTH) :: keyword
131 integer(I4B) :: iscaling, iordering
133 call parser%GetBlock(
'LINEAR', block_found, ierr, supportopenclose=.true., &
134 blockrequired=.false.)
136 if (block_found)
then
137 write (iout,
'(/1x,a)')
'PROCESSING LINEAR DATA'
139 call parser%GetNextLine(end_of_block)
140 if (end_of_block)
exit
141 call parser%GetStringCaps(keyword)
143 select case (keyword)
144 case (
'INNER_DVCLOSE')
145 this%dvclose = parser%GetDouble()
146 case (
'INNER_RCLOSE')
147 this%rclose = parser%GetDouble()
149 call parser%GetStringCaps(keyword)
150 if (keyword ==
'STRICT')
then
152 else if (keyword ==
'L2NORM_RCLOSE')
then
154 else if (keyword ==
'RELATIVE_RCLOSE')
then
156 else if (keyword ==
'L2NORM_RELATIVE_RCLOSE')
then
159 case (
'INNER_MAXIMUM')
160 this%iter1 = parser%GetInteger()
161 case (
'LINEAR_ACCELERATION')
162 call parser%GetStringCaps(keyword)
163 if (keyword .eq.
'CG')
then
165 else if (keyword .eq.
'BICGSTAB')
then
169 write (errmsg,
'(3a)') &
170 'Unknown IMSLINEAR LINEAR_ACCELERATION method (', &
174 case (
'SCALING_METHOD')
175 call parser%GetStringCaps(keyword)
177 if (keyword .eq.
'NONE')
then
179 else if (keyword .eq.
'DIAGONAL')
then
181 else if (keyword .eq.
'L2NORM')
then
184 write (errmsg,
'(3a)') &
185 'Unknown IMSLINEAR SCALING_METHOD (', trim(keyword),
').'
189 case (
'RED_BLACK_ORDERING')
191 case (
'REORDERING_METHOD')
192 call parser%GetStringCaps(keyword)
194 if (keyword ==
'NONE')
then
196 else if (keyword ==
'RCM')
then
198 else if (keyword ==
'MD')
then
201 write (errmsg,
'(3a)') &
202 'Unknown IMSLINEAR REORDERING_METHOD (', trim(keyword),
').'
205 this%iord = iordering
206 case (
'NUMBER_ORTHOGONALIZATIONS')
207 this%north = parser%GetInteger()
208 case (
'RELAXATION_FACTOR')
209 this%relax = parser%GetDouble()
210 case (
'PRECONDITIONER_LEVELS')
211 this%level = parser%GetInteger()
212 if (this%level < 0)
then
213 write (errmsg,
'(a,1x,a)') &
214 'IMSLINEAR PRECONDITIONER_LEVELS must be greater than', &
218 case (
'PRECONDITIONER_DROP_TOLERANCE')
219 this%droptol = parser%GetDouble()
220 if (this%droptol <
dzero)
then
221 write (errmsg,
'(a,1x,a)') &
222 'IMSLINEAR PRECONDITIONER_DROP_TOLERANCE', &
223 'must be greater than or equal to zero'
228 case (
'INNER_HCLOSE')
229 this%dvclose = parser%GetDouble()
232 write (warnmsg,
'(a)') &
233 'SETTING INNER_DVCLOSE TO INNER_HCLOSE VALUE'
237 warnmsg, parser%GetUnit())
241 write (errmsg,
'(3a)') &
242 'Unknown IMSLINEAR keyword (', trim(keyword),
').'
246 write (iout,
'(1x,a)')
'END OF LINEAR DATA'
248 if (this%ifdparam == 0)
THEN
249 write (errmsg,
'(a)')
'NO LINEAR block detected.'
261 character(len=LINELENGTH) :: warnmsg
263 if (this%level == 0 .and. this%droptol > 0.0_dp)
then
264 write (warnmsg,
'(a)')
"PRECONDITIONER_DROP_TOLERANCE is ignored because &
265 &PRECONDITIONER_LEVELS equals zero."
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.
subroutine check_settings(this)
Check the settings after reading the configuration from file.
integer(i4b), parameter, public bcgs_method
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.