1 |
module suphec_m |
module suphec_m |
2 |
|
|
3 |
|
use nr_util, only: pi |
4 |
|
|
5 |
implicit none |
implicit none |
6 |
|
|
7 |
contains |
! 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 |
SUBROUTINE suphec |
! A1.1 Astronomical constants |
14 |
|
|
15 |
! From phylmd/suphec.F,v 1.2 2005/06/06 13:16:33 |
REAL ROMEGA |
16 |
|
real, parameter:: RDAY = 86400. |
17 |
|
|
18 |
! Initialise certaines constantes et parametres physiques. |
REAL, parameter:: RSIYEA = 365.25 * RDAY * 2. * PI / 6.283076 |
19 |
|
! sideral year, in s |
20 |
|
|
21 |
use YOMCST, only: rpi, rclum, rhpla, rkbol, rnavo, rday, rea, repsm, & |
REAL, parameter:: RSIDAY = RDAY / (1. + RDAY / RSIYEA) ! sideral day, in s |
|
rsiyea, rsiday,romega, rg, ra, r1sa, rsigma, r, rmd, rmo3, rmv, rd, & |
|
|
rv, rcpd, rcvd, rcpv, rcvv, rkappa, retv, rcw, rcs, rtt, rlvtt, & |
|
|
rlstt, rlmlt, ratm, restt, rgamw, rbetw, ralpw, rgams, rbets, ralps, & |
|
|
rgamd, rbetd, ralpd |
|
|
use yoethf, only: r2es, r3ies, r3les, r4ies, r4les, r5ies, r5les, rhoh2o, & |
|
|
rvtmp2 |
|
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 |
PRINT *, 'Call sequence information: suphec' |
! 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 |
46 |
|
! specific heat capacity at constant pressure of water vapor, in J K-1 kg-1 |
47 |
|
|
48 |
|
real, save:: RCVD |
49 |
|
real, save:: RCVV |
50 |
|
|
51 |
|
real, parameter:: RCPD = 7. / 2 * RD |
52 |
|
! specific heat capacity at constant pressure of dry air, in J K-1 kg-1 |
53 |
|
|
54 |
|
real, parameter:: RMO3 = 47.9942 |
55 |
|
REAL, parameter:: RKAPPA = RD/RCPD |
56 |
|
real, save:: RETV |
57 |
|
|
58 |
|
! A1.5, 6 Thermodynamic liquid, solid phases |
59 |
|
|
60 |
|
REAL, parameter:: RCW = RCPV ! LIQUID PHASE Cw |
61 |
|
real, save:: RCS |
62 |
|
|
63 |
|
! A1.7 Thermodynamic transition of phase |
64 |
|
REAL, save:: RLMLT |
65 |
|
real, parameter:: RTT = 273.16 |
66 |
|
|
67 |
|
real, parameter:: RLVTT = 2.5008E+6 |
68 |
|
! specific latent heat of vaporization of water at triple point, in J kg-1 |
69 |
|
|
70 |
! 1. DEFINE FUNDAMENTAL CONSTANTS |
real, parameter:: RLSTT = 2.8345E+6 |
71 |
|
real, parameter:: RATM = 1e5 |
72 |
|
|
73 |
print *, 'Constants of the ICM' |
! A1.8 Curve of saturation |
74 |
RPI=2.*ASIN(1.) |
REAL, save:: RALPW, RBETW, RGAMW, RALPS, RBETS, RGAMS |
75 |
RCLUM=299792458. |
real, parameter:: RESTT = 611.14 |
76 |
RHPLA=6.6260755E-34 |
REAL, save:: RALPD, RBETD, RGAMD |
77 |
RKBOL=1.380658E-23 |
|
78 |
RNAVO=6.0221367E+23 |
private pi |
79 |
print *, 'Fundamental constants ' |
|
80 |
print '('' PI = '',E13.7,'' -'')', RPI |
contains |
81 |
print '('' c = '',E13.7,''m s-1'')', RCLUM |
|
82 |
print '('' h = '',E13.7,''J s'')', RHPLA |
SUBROUTINE suphec |
83 |
print '('' K = '',E13.7,''J K-1'')', RKBOL |
|
84 |
print '('' N = '',E13.7,''mol-1'')', RNAVO |
! From phylmd/suphec.F, version 1.2 2005/06/06 13:16:33 |
85 |
|
! Initialise certaines constantes et certains paramètres physiques. |
86 |
|
|
87 |
|
!------------------------------------------ |
88 |
|
|
89 |
|
PRINT *, 'Call sequence information: suphec' |
90 |
|
|
91 |
! 2. DEFINE ASTRONOMICAL CONSTANTS |
! 2. DEFINE ASTRONOMICAL CONSTANTS |
92 |
|
|
93 |
RDAY=86400. |
ROMEGA = 2.*PI/RSIDAY |
|
REA=149597870000. |
|
|
REPSM=0.409093 |
|
|
|
|
|
RSIYEA=365.25*RDAY*2.*RPI/6.283076 |
|
|
RSIDAY=RDAY/(1.+RDAY/RSIYEA) |
|
|
ROMEGA=2.*RPI/RSIDAY |
|
94 |
|
|
95 |
print *, 'Astronomical constants ' |
print *, 'Astronomical constants ' |
96 |
print '('' day = '',E13.7,'' s'')', RDAY |
print '('' omega = '', E13.7, '' s-1'')', ROMEGA |
97 |
print '('' half g. axis = '',E13.7,'' m'')', REA |
|
98 |
print '('' mean anomaly = '',E13.7,'' -'')', REPSM |
! 3. DEFINE GEOIDE. |
99 |
print '('' sideral year = '',E13.7,'' s'')', RSIYEA |
|
100 |
print '('' sideral day = '',E13.7,'' s'')', RSIDAY |
print *, ' Geoide ' |
101 |
print '('' omega = '',E13.7,'' s-1'')', ROMEGA |
print '('' Gravity = '', E13.7, '' m s-2'')', RG |
102 |
|
print '('' Earth radius = '', E13.7, '' m'')', RA |
103 |
! 3. DEFINE GEOIDE. |
|
104 |
|
! 4. DEFINE RADIATION CONSTANTS. |
105 |
RG=9.80665 |
|
106 |
RA=6371229. |
print *, ' Radiation ' |
107 |
R1SA=SNGL(1.D0/DBLE(RA)) |
print '('' Stefan-Bol. = '', E13.7, '' W m-2 K-4'')', RSIGMA |
108 |
print *, ' Geoide ' |
|
109 |
print '('' Gravity = '',E13.7,'' m s-2'')', RG |
! 5. DEFINE THERMODYNAMIC CONSTANTS, GAS PHASE. |
110 |
print '('' Earth radius = '',E13.7,'' m'')', RA |
|
111 |
print '('' Inverse E.R. = '',E13.7,'' m'')', R1SA |
RCVD = RCPD-RD |
112 |
|
RCVV = RCPV-RV |
113 |
! 4. DEFINE RADIATION CONSTANTS. |
RETV = RV / RD - 1. |
114 |
|
print *, 'Thermodynamics, gas' |
115 |
rsigma = 2.*rpi**5 * (rkbol/rhpla)**3 * rkbol/rclum/rclum/15. |
print *, "rd = ", RD, "J K-1 kg-1" |
116 |
print *, ' Radiation ' |
print *, "rv = ", RV, "J K-1 kg-1" |
117 |
print '('' Stefan-Bol. = '',E13.7,'' W m-2 K-4'')', RSIGMA |
print '('' Cpd = '', e13.7)', RCPD |
118 |
|
print '('' Cvd = '', e13.7)', RCVD |
119 |
! 5. DEFINE THERMODYNAMIC CONSTANTS, GAS PHASE. |
print '('' Cvv = '', e13.7)', RCVV |
120 |
|
print '('' Rd/Cpd = '', e13.7)', RKAPPA |
121 |
R=RNAVO*RKBOL |
print '('' Rv / Rd - 1 = '', e13.7)', RETV |
|
RMD=28.9644 |
|
|
RMO3=47.9942 |
|
|
RMV=18.0153 |
|
|
RD=1000.*R/RMD |
|
|
RV=1000.*R/RMV |
|
|
RCPD=3.5*RD |
|
|
RCVD=RCPD-RD |
|
|
RCPV=4. *RV |
|
|
RCVV=RCPV-RV |
|
|
RKAPPA=RD/RCPD |
|
|
RETV=RV/RD-1. |
|
|
print *, 'Thermodynamic, gas ' |
|
|
print '('' Perfect gas = '',e13.7)', R |
|
|
print '('' Dry air mass = '',e13.7)', RMD |
|
|
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 |
RTT=273.16 |
RLMLT = RLSTT-RLVTT |
132 |
RLVTT=2.5008E+6 |
print *, 'Thermodynamic, transition of phase:' |
133 |
RLSTT=2.8345E+6 |
print '('' Fusion point = '', E13.7)', RTT |
134 |
RLMLT=RLSTT-RLVTT |
print '('' RLsTt = '', E13.7)', RLSTT |
135 |
RATM=100000. |
print '('' RLMlt = '', E13.7)', RLMLT |
136 |
print *, 'Thermodynamic, trans. ' |
print '('' Normal pressure = '', E13.7)', RATM |
137 |
print '('' Fusion point = '',E13.7)', RTT |
|
138 |
print '('' RLvTt = '',E13.7)', RLVTT |
! 9. SATURATED VAPOUR PRESSURE. |
139 |
print '('' RLsTt = '',E13.7)', RLSTT |
|
140 |
print '('' RLMlt = '',E13.7)', RLMLT |
RGAMW = (RCW-RCPV)/RV |
141 |
print '('' Normal press. = '',E13.7)', RATM |
RBETW = RLVTT/RV+RGAMW*RTT |
142 |
|
RALPW = LOG(RESTT)+RBETW/RTT+RGAMW*LOG(RTT) |
143 |
! 9. SATURATED VAPOUR PRESSURE. |
RGAMS = (RCS-RCPV)/RV |
144 |
|
RBETS = RLSTT/RV+RGAMS*RTT |
145 |
RESTT=611.14 |
RALPS = LOG(RESTT)+RBETS/RTT+RGAMS*LOG(RTT) |
146 |
RGAMW=(RCW-RCPV)/RV |
RGAMD = RGAMS-RGAMW |
147 |
RBETW=RLVTT/RV+RGAMW*RTT |
RBETD = RBETS-RBETW |
148 |
RALPW=LOG(RESTT)+RBETW/RTT+RGAMW*LOG(RTT) |
RALPD = RALPS-RALPW |
|
RGAMS=(RCS-RCPV)/RV |
|
|
RBETS=RLSTT/RV+RGAMS*RTT |
|
|
RALPS=LOG(RESTT)+RBETS/RTT+RGAMS*LOG(RTT) |
|
|
RGAMD=RGAMS-RGAMW |
|
|
RBETD=RBETS-RBETW |
|
|
RALPD=RALPS-RALPW |
|
|
|
|
|
! calculer les constantes pour les fonctions thermodynamiques |
|
|
|
|
|
RVTMP2=RCPV/RCPD-1. |
|
|
RHOH2O=RATM/100. |
|
|
R2ES=RESTT*RD/RV |
|
|
R3LES=17.269 |
|
|
R3IES=21.875 |
|
|
R4LES=35.86 |
|
|
R4IES=7.66 |
|
|
R5LES=R3LES*(RTT-R4LES) |
|
|
R5IES=R3IES*(RTT-R4IES) |
|
149 |
|
|
150 |
END SUBROUTINE suphec |
END SUBROUTINE suphec |
151 |
|
|