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