1 |
module suphec_m |
2 |
|
3 |
use nr_util, only: pi |
4 |
|
5 |
implicit none |
6 |
|
7 |
! A1.0 Fundamental constants |
8 |
real, parameter:: RCLUM = 299792458. ! speed of light, m s-1 |
9 |
real, parameter:: RHPLA = 6.6260755E-34 ! Planck constant, J s |
10 |
real, parameter:: KBOL = 1.380658E-23 ! Boltzmann constant, in J K-1 |
11 |
real, parameter:: NAVO = 6.0221367E23 ! Avogadro number, in mol-1 |
12 |
|
13 |
! A1.1 Astronomical constants |
14 |
|
15 |
REAL ROMEGA |
16 |
real, parameter:: RDAY = 86400. |
17 |
|
18 |
REAL, parameter:: RSIYEA = 365.25 * RDAY * 2. * PI / 6.283076 |
19 |
! sideral year, in s |
20 |
|
21 |
REAL, parameter:: RSIDAY = RDAY / (1. + RDAY / RSIYEA) ! sideral day, in s |
22 |
|
23 |
! A1.2 Geoide |
24 |
real, parameter:: RG = 9.80665 ! acceleration of gravity, in m s-2 |
25 |
real, parameter:: RA = 6371229. |
26 |
|
27 |
! A1.3 Radiation |
28 |
REAL, parameter:: rsigma = 2. * pi**5 * (kbol / rhpla)**3 * kbol / rclum**2 & |
29 |
/ 15. |
30 |
|
31 |
! A1.4 Thermodynamic gas phase |
32 |
REAL, parameter:: R = NAVO * KBOL ! ideal gas constant, in J K-1 mol-1 |
33 |
real, parameter:: MV = 18.0153 ! molar mass of water, in g mol-1 |
34 |
|
35 |
real, parameter:: RV = 1e3 * R / MV |
36 |
! specific ideal gas constant for water vapor, in J K-1 kg-1 |
37 |
! (factor 1e3: conversion from g to kg) |
38 |
|
39 |
real, parameter:: MD = 28.9644 ! molar mass of dry air, in g mol-1 |
40 |
|
41 |
real, parameter:: RD = 1e3 * R / MD |
42 |
! specific ideal gas constant for dry air, in J K-1 kg-1 |
43 |
! (factor 1e3: conversion from g to kg) |
44 |
|
45 |
real, parameter:: RCPV = 4. * RV ! Cpv, gas phase |
46 |
|
47 |
real, save:: RCVD, RCVV |
48 |
|
49 |
real, parameter:: RCPD = 7. / 2 * RD |
50 |
! specific heat capacity for dry air, in J K-1 kg-1 |
51 |
|
52 |
real, parameter:: RMO3 = 47.9942 |
53 |
REAL, parameter:: RKAPPA = RD/RCPD |
54 |
real, save:: RETV |
55 |
|
56 |
! A1.5, 6 Thermodynamic liquid, solid phases |
57 |
|
58 |
REAL, parameter:: RCW = RCPV ! LIQUID PHASE Cw |
59 |
real, save:: RCS |
60 |
|
61 |
! A1.7 Thermodynamic transition of phase |
62 |
REAL, save:: RLMLT |
63 |
real, parameter:: RTT = 273.16 |
64 |
real, parameter:: RLVTT = 2.5008E+6 |
65 |
real, parameter:: RLSTT = 2.8345E+6 |
66 |
real, parameter:: RATM = 1e5 |
67 |
|
68 |
! A1.8 Curve of saturation |
69 |
REAL, save:: RALPW, RBETW, RGAMW, RALPS, RBETS, RGAMS |
70 |
real, parameter:: RESTT = 611.14 |
71 |
REAL, save:: RALPD, RBETD, RGAMD |
72 |
|
73 |
private pi |
74 |
|
75 |
contains |
76 |
|
77 |
SUBROUTINE suphec |
78 |
|
79 |
! From phylmd/suphec.F, version 1.2 2005/06/06 13:16:33 |
80 |
! Initialise certaines constantes et certains paramètres physiques. |
81 |
|
82 |
!------------------------------------------ |
83 |
|
84 |
PRINT *, 'Call sequence information: suphec' |
85 |
|
86 |
! 2. DEFINE ASTRONOMICAL CONSTANTS |
87 |
|
88 |
ROMEGA = 2.*PI/RSIDAY |
89 |
|
90 |
print *, 'Astronomical constants ' |
91 |
print '('' omega = '', E13.7, '' s-1'')', ROMEGA |
92 |
|
93 |
! 3. DEFINE GEOIDE. |
94 |
|
95 |
print *, ' Geoide ' |
96 |
print '('' Gravity = '', E13.7, '' m s-2'')', RG |
97 |
print '('' Earth radius = '', E13.7, '' m'')', RA |
98 |
|
99 |
! 4. DEFINE RADIATION CONSTANTS. |
100 |
|
101 |
print *, ' Radiation ' |
102 |
print '('' Stefan-Bol. = '', E13.7, '' W m-2 K-4'')', RSIGMA |
103 |
|
104 |
! 5. DEFINE THERMODYNAMIC CONSTANTS, GAS PHASE. |
105 |
|
106 |
RCVD = RCPD-RD |
107 |
RCVV = RCPV-RV |
108 |
RETV = RV / RD - 1. |
109 |
print *, 'Thermodynamics, gas' |
110 |
print '('' Ozone mass = '', e13.7)', RMO3 |
111 |
print *, "rd = ", RD, "J K-1 kg-1" |
112 |
print *, "rv = ", RV, "J K-1 kg-1" |
113 |
print '('' Cpd = '', e13.7)', RCPD |
114 |
print '('' Cvd = '', e13.7)', RCVD |
115 |
print '('' Cvv = '', e13.7)', RCVV |
116 |
print '('' Rd/Cpd = '', e13.7)', RKAPPA |
117 |
print '('' Rv / Rd - 1 = '', e13.7)', RETV |
118 |
|
119 |
! 7. DEFINE THERMODYNAMIC CONSTANTS, SOLID PHASE. |
120 |
|
121 |
RCS = RCPV |
122 |
print *, 'thermodynamic, solid' |
123 |
print '('' Cs = '', E13.7)', RCS |
124 |
|
125 |
! 8. DEFINE THERMODYNAMIC CONSTANTS, TRANSITION OF PHASE. |
126 |
|
127 |
RLMLT = RLSTT-RLVTT |
128 |
print *, 'Thermodynamic, transition of phase:' |
129 |
print '('' Fusion point = '', E13.7)', RTT |
130 |
print '('' RLvTt = '', E13.7)', RLVTT |
131 |
print '('' RLsTt = '', E13.7)', RLSTT |
132 |
print '('' RLMlt = '', E13.7)', RLMLT |
133 |
print '('' Normal pressure = '', E13.7)', RATM |
134 |
|
135 |
! 9. SATURATED VAPOUR PRESSURE. |
136 |
|
137 |
RGAMW = (RCW-RCPV)/RV |
138 |
RBETW = RLVTT/RV+RGAMW*RTT |
139 |
RALPW = LOG(RESTT)+RBETW/RTT+RGAMW*LOG(RTT) |
140 |
RGAMS = (RCS-RCPV)/RV |
141 |
RBETS = RLSTT/RV+RGAMS*RTT |
142 |
RALPS = LOG(RESTT)+RBETS/RTT+RGAMS*LOG(RTT) |
143 |
RGAMD = RGAMS-RGAMW |
144 |
RBETD = RBETS-RBETW |
145 |
RALPD = RALPS-RALPW |
146 |
|
147 |
END SUBROUTINE suphec |
148 |
|
149 |
end module suphec_m |