option_flow.F90 coverage: 100.00 %func 90.48 %block
1) module Option_Flow_module
2)
3) ! IMPORTANT NOTE: This module can have no dependencies on other modules!!!
4)
5) use PFLOTRAN_Constants_module
6)
7) implicit none
8)
9) private
10)
11) #include "petsc/finclude/petscsys.h"
12)
13)
14) type, public :: flow_option_type
15)
16) PetscBool :: store_fluxes
17) PetscBool :: transient_porosity
18) PetscBool :: only_vertical_flow
19) PetscBool :: density_depends_on_salinity
20) PetscBool :: quasi_3d
21) PetscBool :: numerical_derivatives
22) PetscBool :: only_energy_eq
23)
24) end type flow_option_type
25)
26) public :: OptionFlowCreate, &
27) OptionFlowInitAll, &
28) OptionFlowInitRealization, &
29) OptionFlowDestroy
30)
31) contains
32)
33) ! ************************************************************************** !
34)
35) function OptionFlowCreate()
36) !
37) ! Allocates and initializes a new Option object
38) !
39) ! Author: Glenn Hammond
40) ! Date: 10/25/07
41) !
42)
43) implicit none
44)
45) type(flow_option_type), pointer :: OptionFlowCreate
46)
47) type(flow_option_type), pointer :: option
48)
49) allocate(option)
50)
51) ! DO NOT initialize members of the option type here. One must decide
52) ! whether the member needs initialization once for all stochastic
53) ! simulations or initialization for every realization (e.g. within multiple
54) ! stochastic simulations). This is done in OptionInitAll() and
55) ! OptionInitRealization()
56) call OptionFlowInitAll(option)
57) OptionFlowCreate => option
58)
59) end function OptionFlowCreate
60)
61) ! ************************************************************************** !
62)
63) subroutine OptionFlowInitAll(option)
64) !
65) ! Initializes all option variables
66) !
67) ! Author: Glenn Hammond
68) ! Date: 10/25/07
69) !
70)
71) implicit none
72)
73) type(flow_option_type) :: option
74)
75) ! These variables should only be initialized once at the beginning of a
76) ! PFLOTRAN run (regardless of whether stochastic)
77)
78) call OptionFlowInitRealization(option)
79)
80) end subroutine OptionFlowInitAll
81)
82) ! ************************************************************************** !
83)
84) subroutine OptionFlowInitRealization(option)
85) !
86) ! Initializes option variables specific to a single
87) ! realization
88) !
89) ! Author: Glenn Hammond
90) ! Date: 10/25/07
91) !
92)
93) implicit none
94)
95) type(flow_option_type) :: option
96)
97) ! These variables should be initialized once at the beginning of every
98) ! PFLOTRAN realization or simulation of a single realization
99)
100) option%store_fluxes = PETSC_FALSE
101) option%transient_porosity = PETSC_FALSE
102) option%only_vertical_flow = PETSC_FALSE
103) option%density_depends_on_salinity = PETSC_FALSE
104) option%quasi_3d = PETSC_FALSE
105) option%numerical_derivatives = PETSC_FALSE
106) option%only_energy_eq = PETSC_FALSE
107)
108) end subroutine OptionFlowInitRealization
109)
110) ! ************************************************************************** !
111)
112) subroutine OptionFlowDestroy(option)
113) !
114) ! Deallocates an option
115) !
116) ! Author: Glenn Hammond
117) ! Date: 10/26/07
118) !
119)
120) implicit none
121)
122) type(flow_option_type), pointer :: option
123)
124) if (.not.associated(option)) return
125) ! all kinds of stuff needs to be added here.
126)
127) ! all the below should be placed somewhere other than option.F90
128) deallocate(option)
129) nullify(option)
130)
131) end subroutine OptionFlowDestroy
132)
133) end module Option_Flow_module