geomechanics_debug.F90 coverage: 50.00 %func 9.38 %block
1) module Geomechanics_Debug_module
2)
3) use PFLOTRAN_Constants_module
4)
5) implicit none
6)
7) private
8)
9) #include "petsc/finclude/petscsys.h"
10)
11) type, public :: geomech_debug_type
12) PetscBool :: vecview_residual
13) PetscBool :: vecview_solution
14) PetscBool :: matview_Jacobian
15) PetscBool :: matview_Jacobian_detailed
16) PetscBool :: norm_Jacobian
17) PetscBool :: print_numerical_derivatives
18) PetscBool :: print_couplers
19) character(len=MAXSTRINGLENGTH) :: coupler_string
20) PetscBool :: print_waypoints
21) end type geomech_debug_type
22)
23) public :: GeomechDebugCreate, GeomechDebugRead
24)
25) contains
26)
27) ! ************************************************************************** !
28)
29) function GeomechDebugCreate()
30) !
31) ! Create object that stores debugging options
32) ! for geomechanics
33) !
34) ! Author: Satish Karra, LANL
35) ! Date: 06/06/13
36) !
37)
38) implicit none
39)
40) type(geomech_debug_type), pointer :: GeomechDebugCreate
41) type(geomech_debug_type), pointer :: debug
42)
43) allocate(debug)
44)
45) debug%vecview_residual = PETSC_FALSE
46) debug%vecview_solution = PETSC_FALSE
47) debug%matview_Jacobian = PETSC_FALSE
48) debug%matview_Jacobian_detailed = PETSC_FALSE
49) debug%norm_Jacobian = PETSC_FALSE
50) debug%print_numerical_derivatives = PETSC_FALSE
51) debug%print_couplers = PETSC_FALSE
52) debug%coupler_string = ''
53) debug%print_waypoints = PETSC_FALSE
54)
55) GeomechDebugCreate => debug
56)
57) end function GeomechDebugCreate
58)
59) ! ************************************************************************** !
60)
61) subroutine GeomechDebugRead(debug,input,option)
62) !
63) ! Reads debugging data from the input file
64) !
65) ! Author: Satish Karra, LANL
66) ! Date: 06/06/13
67) !
68)
69) use Option_module
70) use Input_Aux_module
71)
72) implicit none
73)
74) type(geomech_debug_type) :: debug
75) type(input_type), pointer :: input
76) type(option_type) :: option
77)
78) character(len=MAXWORDLENGTH) :: keyword
79)
80) input%ierr = 0
81) do
82)
83) call InputReadPflotranString(input,option)
84)
85) if (InputCheckExit(input,option)) exit
86)
87) call InputReadWord(input,option,keyword,PETSC_TRUE)
88) call InputErrorMsg(input,option,'keyword','GEOMECHANICS_DEBUG')
89)
90) select case(trim(keyword))
91)
92) case('PRINT_SOLUTION','VECVIEW_SOLUTION','VIEW_SOLUTION')
93) debug%vecview_solution = PETSC_TRUE
94) case('PRINT_RESIDUAL','VECVIEW_RESIDUAL','VIEW_RESIDUAL')
95) debug%vecview_residual = PETSC_TRUE
96) case('PRINT_JACOBIAN','MATVIEW_JACOBIAN','VIEW_JACOBIAN')
97) debug%matview_Jacobian = PETSC_TRUE
98) case('PRINT_JACOBIAN_NORM','NORM_JACOBIAN')
99) debug%norm_Jacobian = PETSC_TRUE
100) case('PRINT_COUPLERS','PRINT_COUPLER')
101) debug%print_couplers = PETSC_TRUE
102) debug%coupler_string = trim(adjustl(input%buf))
103) case('PRINT_JACOBIAN_DETAILED','MATVIEW_JACOBIAN_DETAILED', &
104) 'VIEW_JACOBIAN_DETAILED')
105) debug%matview_Jacobian_detailed = PETSC_TRUE
106) case('PRINT_NUMERICAL_DERIVATIVES','VIEW_NUMERICAL_DERIVATIVES')
107) debug%print_numerical_derivatives = PETSC_TRUE
108) case('WAYPOINTS')
109) debug%print_waypoints = PETSC_TRUE
110) case default
111) call InputKeywordUnrecognized(keyword,'GEOMECHANICS_DEBUG',option)
112) end select
113)
114) enddo
115)
116) end subroutine GeomechDebugRead
117)
118) end module Geomechanics_Debug_module