option_transport.F90       coverage:  100.00 %func     90.48 %block


     1) module Option_Transport_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 :: transport_option_type 
    15)   
    16)     PetscInt :: rt_idof
    17)     PetscInt :: reactive_transport_coupling
    18)     PetscInt :: tvd_flux_limiter
    19)     PetscBool :: store_fluxes
    20)     PetscReal :: tran_weight_t0, tran_weight_t1
    21)     
    22)     PetscReal :: inf_rel_update_tol
    23)     PetscReal :: inf_scaled_res_tol
    24)   
    25)     PetscBool :: jumpstart_kinetic_sorption
    26)     PetscBool :: no_checkpoint_kinetic_sorption
    27)     PetscBool :: no_restart_kinetic_sorption
    28)     PetscBool :: no_restart_mineral_vol_frac
    29)     PetscBool :: numerical_derivatives
    30)         
    31)   end type transport_option_type
    32)   
    33)   public :: OptionTransportCreate, &
    34)             OptionTransportInitAll, &
    35)             OptionTransportInitRealization, &
    36)             OptionTransportDestroy
    37) 
    38) contains
    39) 
    40) ! ************************************************************************** !
    41) 
    42) function OptionTransportCreate()
    43)   ! 
    44)   ! Allocates and initializes a new OptionTransport object
    45)   ! 
    46)   ! Author: Glenn Hammond
    47)   ! Date: 10/25/07
    48)   ! 
    49) 
    50)   implicit none
    51)   
    52)   type(transport_option_type), pointer :: OptionTransportCreate
    53)   
    54)   type(transport_option_type), pointer :: option
    55)   
    56)   allocate(option)
    57) 
    58)   ! DO NOT initialize members of the option type here.  One must decide 
    59)   ! whether the member needs initialization once for all stochastic 
    60)   ! simulations or initialization for every realization (e.g. within multiple 
    61)   ! stochastic simulations).  This is done in OptionTransportInitAll() and
    62)   ! OptionTransportInitRealization()
    63)   call OptionTransportInitAll(option)
    64)   OptionTransportCreate => option
    65)   
    66) end function OptionTransportCreate
    67) 
    68) ! ************************************************************************** !
    69) 
    70) subroutine OptionTransportInitAll(option)
    71)   ! 
    72)   ! Initializes all option variables
    73)   ! 
    74)   ! Author: Glenn Hammond
    75)   ! Date: 10/25/07
    76)   ! 
    77) 
    78)   implicit none
    79)   
    80)   type(transport_option_type) :: option
    81)   
    82)   ! These variables should only be initialized once at the beginning of a
    83)   ! PFLOTRAN run (regardless of whether stochastic)
    84)   
    85)  
    86)   call OptionTransportInitRealization(option)
    87) 
    88) end subroutine OptionTransportInitAll
    89) 
    90) ! ************************************************************************** !
    91) 
    92) subroutine OptionTransportInitRealization(option)
    93)   ! 
    94)   ! Initializes option variables specific to a single
    95)   ! realization
    96)   ! 
    97)   ! Author: Glenn Hammond
    98)   ! Date: 10/25/07
    99)   ! 
   100) 
   101)   implicit none
   102)   
   103)   type(transport_option_type) :: option
   104)   
   105)   ! These variables should be initialized once at the beginning of every 
   106)   ! PFLOTRAN realization or simulation of a single realization
   107)     
   108)   option%tvd_flux_limiter = 1
   109)   option%rt_idof = UNINITIALIZED_INTEGER
   110)   option%store_fluxes = PETSC_FALSE
   111)   
   112)   option%reactive_transport_coupling = GLOBAL_IMPLICIT
   113)   option%numerical_derivatives = PETSC_FALSE
   114)   
   115)   option%jumpstart_kinetic_sorption = PETSC_FALSE
   116)   option%no_checkpoint_kinetic_sorption = PETSC_FALSE
   117)   option%no_restart_kinetic_sorption = PETSC_FALSE
   118)   option%no_restart_mineral_vol_frac = PETSC_FALSE
   119)   
   120)   option%tran_weight_t0 = 0.d0
   121)   option%tran_weight_t1 = 0.d0
   122) 
   123)   option%inf_rel_update_tol = UNINITIALIZED_DOUBLE
   124)   option%inf_scaled_res_tol = UNINITIALIZED_DOUBLE 
   125)   
   126) end subroutine OptionTransportInitRealization
   127) 
   128) ! ************************************************************************** !
   129) 
   130) subroutine OptionTransportDestroy(option)
   131)   ! 
   132)   ! Deallocates an option
   133)   ! 
   134)   ! Author: Glenn Hammond
   135)   ! Date: 10/26/07
   136)   ! 
   137) 
   138)   implicit none
   139)   
   140)   type(transport_option_type), pointer :: option
   141)   
   142)   if (.not.associated(option)) return
   143)   ! all kinds of stuff needs to be added here.
   144) 
   145)   ! all the below should be placed somewhere other than option.F90
   146)   
   147)   deallocate(option)
   148)   nullify(option)
   149)   
   150) end subroutine OptionTransportDestroy
   151) 
   152) end module Option_Transport_module

generated by
Intel(R) C++/Fortran Compiler code-coverage tool
Web-Page Owner: Nobody