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