134 class(ImsLinearSettingsType) :: this
135 type(BlockParserType) :: parser
136 integer(I4B) :: iout
137
138 logical(LGP) :: block_found, end_of_block
139 integer(I4B) :: ierr
140 character(len=LINELENGTH) :: errmsg
141 character(len=LINELENGTH) :: keyword
142 integer(I4B) :: iscaling, iordering
143
144 call parser%GetBlock('LINEAR', block_found, ierr, supportopenclose=.true., &
145 blockrequired=.false.)
146
147 if (block_found) then
148 write (iout, '(/1x,a)') 'PROCESSING LINEAR DATA'
149 do
150 call parser%GetNextLine(end_of_block)
151 if (end_of_block) exit
152 call parser%GetStringCaps(keyword)
153
154 select case (keyword)
155 case ('INNER_DVCLOSE')
156 this%dvclose = parser%GetDouble()
157 case ('INNER_RCLOSE')
158 this%rclose = parser%GetDouble()
159
160 call parser%GetStringCaps(keyword)
161 if (keyword == 'STRICT') then
162 this%icnvgopt = 1
163 else if (keyword == 'L2NORM_RCLOSE') then
164 this%icnvgopt = 2
165 else if (keyword == 'RELATIVE_RCLOSE') then
166 this%icnvgopt = 3
167 else if (keyword == 'L2NORM_RELATIVE_RCLOSE') then
168 this%icnvgopt = 4
169 end if
170 case ('INNER_MAXIMUM')
171 this%iter1 = parser%GetInteger()
172 case ('LINEAR_ACCELERATION')
173 call parser%GetStringCaps(keyword)
174 if (keyword .eq. 'CG') then
175 this%ilinmeth = 1
176 else if (keyword .eq. 'BICGSTAB') then
177 this%ilinmeth = 2
178 else
179 this%ilinmeth = 0
180 write (errmsg, '(3a)') &
181 'Unknown IMSLINEAR LINEAR_ACCELERATION method (', &
182 trim(keyword), ').'
183 call store_error(errmsg)
184 end if
185 case ('SCALING_METHOD')
186 call parser%GetStringCaps(keyword)
187 iscaling = 0
188 if (keyword .eq. 'NONE') then
189 iscaling = 0
190 else if (keyword .eq. 'DIAGONAL') then
191 iscaling = 1
192 else if (keyword .eq. 'L2NORM') then
193 iscaling = 2
194 else
195 write (errmsg, '(3a)') &
196 'Unknown IMSLINEAR SCALING_METHOD (', trim(keyword), ').'
197 call store_error(errmsg)
198 end if
199 this%iscl = iscaling
200 case ('RED_BLACK_ORDERING')
201 iordering = 0
202 case ('REORDERING_METHOD')
203 call parser%GetStringCaps(keyword)
204 iordering = 0
205 if (keyword == 'NONE') then
206 iordering = 0
207 else if (keyword == 'RCM') then
208 iordering = 1
209 else if (keyword == 'MD') then
210 iordering = 2
211 else
212 write (errmsg, '(3a)') &
213 'Unknown IMSLINEAR REORDERING_METHOD (', trim(keyword), ').'
214 call store_error(errmsg)
215 end if
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', &
226 'or equal to zero'
227 call store_error(errmsg)
228 end if
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'
235 call store_error(errmsg)
236 end if
237
238
239 case default
240 write (errmsg, '(3a)') &
241 'Unknown IMSLINEAR keyword (', trim(keyword), ').'
242 call store_error(errmsg)
243 end select
244 end do
245 write (iout, '(1x,a)') 'END OF LINEAR DATA'
246 else
247 if (this%ifdparam == 0) THEN
248 write (errmsg, '(a)') 'NO LINEAR block detected.'
249 call store_error(errmsg)
250 end if
251 end if
252