/[lmdze]/trunk/phylmd/suphec.f
ViewVC logotype

Diff of /trunk/phylmd/suphec.f

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

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

Legend:
Removed from v.37  
changed lines
  Added in v.134

  ViewVC Help
Powered by ViewVC 1.1.21