constants_base.f90
Go to the documentation of this file.
1!#############################################################################
2!# #
3!# fosite - 3D hydrodynamical simulation program #
4!# module: constants_generic.f90 #
5!# #
6!# Copyright (C) 2007-2008,2011 #
7!# Tobias Illenseer <tillense@astrophysik.uni-kiel.de> #
8!# #
9!# This program is free software; you can redistribute it and/or modify #
10!# it under the terms of the GNU General Public License as published by #
11!# the Free Software Foundation; either version 2 of the License, or (at #
12!# your option) any later version. #
13!# #
14!# This program is distributed in the hope that it will be useful, but #
15!# WITHOUT ANY WARRANTY; without even the implied warranty of #
16!# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or #
17!# NON INFRINGEMENT. See the GNU General Public License for more #
18!# details. #
19!# #
20!# You should have received a copy of the GNU General Public License #
21!# along with this program; if not, write to the Free Software #
22!# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #
23!# #
24!#############################################################################
29!----------------------------------------------------------------------------!
32!----------------------------------------------------------------------------!
38!----------------------------------------------------------------------------!
41 IMPLICIT NONE
42 !--------------------------------------------------------------------------!
43 PRIVATE
44 INTEGER, PARAMETER :: si = 1
45 INTEGER, PARAMETER :: cgs = 2
46 INTEGER, PARAMETER :: geometrical = 3
52 TYPE, EXTENDS(logging_base) :: constants_base
55 REAL :: c
56 REAL :: gn
57 REAL :: kb
58 REAL :: na
59 REAL :: sb
60 REAL :: rg
61 REAL :: ke
63 REAL :: au
64 REAL :: msun
65 REAL :: mjupiter
66 REAL :: mearth
67 REAL :: rsun
68 REAL :: rjupiter
69 REAL :: rearth
70 REAL :: day
72 REAL :: pi
75 REAL :: cf_time
76 REAL :: cf_mass
77 REAL :: cf_momentum
78 REAL :: cf_energy
79 REAL :: cf_power
80 REAL :: cf_temperature
81 REAL :: cf_density
82 REAL :: cf_opacity
83 CONTAINS
84 PROCEDURE :: initconstants
85 END TYPE constants_base
86 !--------------------------------------------------------------------------!
87 PUBLIC :: &
88 ! types
90 ! constant flags
92 !--------------------------------------------------------------------------!
93
94CONTAINS
95
96 SUBROUTINE initconstants(this,units,units_name)
97 IMPLICIT NONE
98 !------------------------------------------------------------------------!
99 CLASS(constants_base),INTENT(INOUT) :: this
100 INTEGER :: units
101 CHARACTER(LEN=*) :: units_name
102 !------------------------------------------------------------------------!
103 INTENT(IN) :: units
104 !------------------------------------------------------------------------!
105 CALL this%InitLogging(units,units_name)
106
107 ! derived constants
108 this%RG = this%KB * this%NA ![J/mol/K] universal gas constant !
109
110 ! print some information
111 CALL this%Info(" CONSTANTS> physical units: " // trim(this%GetName()))
112 END SUBROUTINE initconstants
113
114END MODULE constants_base_mod
generic module for units and physical constants
integer, parameter, public cgs
integer, parameter, public si
subroutine initconstants(this, units, units_name)
integer, parameter, public geometrical
Basic fosite module.
physical constants data structure
common data structure