geomechanics_auxiliary.F90 coverage: 100.00 %func 86.00 %block
1) module Geomechanics_Auxiliary_module
2)
3) use Geomechanics_Global_Aux_module
4) use PFLOTRAN_Constants_module
5)
6) implicit none
7)
8) private
9)
10) #include "petsc/finclude/petscsys.h"
11)
12) type, public :: geomech_auxiliary_type
13) type(geomech_global_type), pointer :: GeomechGlobal
14) type(geomech_parameter_type), pointer :: GeomechParam
15) end type geomech_auxiliary_type
16)
17) type, public :: geomech_parameter_type
18) PetscReal, pointer :: youngs_modulus(:)
19) PetscReal, pointer :: poissons_ratio(:)
20) PetscReal, pointer :: biot_coef(:)
21) PetscReal, pointer :: thermal_exp_coef(:)
22) PetscReal, pointer :: density(:)
23) end type geomech_parameter_type
24)
25) public :: GeomechAuxInit, &
26) GeomechAuxDestroy
27)
28) contains
29)
30) ! ************************************************************************** !
31)
32) subroutine GeomechAuxInit(geomech_aux)
33) !
34) ! Nullifies pointers in geomech auxiliary type
35) !
36) ! Author: Satish Karra, LANL
37) ! Date: 06/14/13
38) !
39)
40) implicit none
41)
42) type(geomech_auxiliary_type) :: geomech_aux
43)
44) nullify(geomech_aux%GeomechGlobal)
45) allocate(geomech_aux%GeomechParam)
46) nullify(geomech_aux%GeomechParam%youngs_modulus)
47) nullify(geomech_aux%GeomechParam%poissons_ratio)
48) nullify(geomech_aux%GeomechParam%biot_coef)
49) nullify(geomech_aux%GeomechParam%thermal_exp_coef)
50) nullify(geomech_aux%GeomechParam%density)
51)
52) end subroutine GeomechAuxInit
53)
54) ! ************************************************************************** !
55)
56) subroutine GeomechAuxDestroy(geomech_aux)
57) !
58) ! Strips a geomech auxiliary type
59) !
60) ! Author: Satish Karra, LANL
61) ! Date: 06/14/13
62) !
63)
64) implicit none
65)
66) type(geomech_auxiliary_type) :: geomech_aux
67)
68) call GeomechGlobalAuxDestroy(geomech_aux%GeomechGlobal)
69)
70) nullify(geomech_aux%GeomechGlobal)
71)
72) if (associated(geomech_aux%GeomechParam)) then
73) if (associated(geomech_aux%GeomechParam%youngs_modulus)) &
74) deallocate(geomech_aux%GeomechParam%youngs_modulus)
75) nullify(geomech_aux%GeomechParam%youngs_modulus)
76) if (associated(geomech_aux%GeomechParam%poissons_ratio)) &
77) deallocate(geomech_aux%GeomechParam%poissons_ratio)
78) nullify(geomech_aux%GeomechParam%poissons_ratio)
79) if (associated(geomech_aux%GeomechParam%biot_coef)) &
80) deallocate(geomech_aux%GeomechParam%biot_coef)
81) nullify(geomech_aux%GeomechParam%biot_coef)
82) if (associated(geomech_aux%GeomechParam%thermal_exp_coef)) &
83) deallocate(geomech_aux%GeomechParam%thermal_exp_coef)
84) nullify(geomech_aux%GeomechParam%thermal_exp_coef)
85) if (associated(geomech_aux%GeomechParam%density)) &
86) deallocate(geomech_aux%GeomechParam%density)
87) nullify(geomech_aux%GeomechParam%density)
88) endif
89)
90) if (associated(geomech_aux%GeomechParam)) then
91) deallocate(geomech_aux%GeomechParam)
92) endif
93) nullify(geomech_aux%GeomechParam)
94)
95) end subroutine GeomechAuxDestroy
96)
97) end module Geomechanics_Auxiliary_module