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

Diff of /trunk/Sources/phylmd/suphec.f

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

revision 17 by guez, Tue Aug 5 13:31:32 2008 UTC revision 70 by guez, Mon Jun 24 15:39:52 2013 UTC
# Line 2  module suphec_m Line 2  module suphec_m
2    
3    implicit none    implicit none
4    
5      ! 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 = 100000.
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      save
64    
65  contains  contains
66    
67    SUBROUTINE suphec    SUBROUTINE suphec
68    
69      ! 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
70        ! Initialise certaines constantes et certains paramètres physiques.
     ! Initialise certaines constantes et parametres physiques.  
71    
72      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  
73    
74      LOGICAL:: firstcall = .TRUE.      PRINT *, 'Call sequence information: suphec'
75    
76      !------------------------------------------      ! 1. DEFINE FUNDAMENTAL CONSTANTS
77    
78      IF (firstcall) THEN      print *, 'Constants of the ICM'
79         PRINT *, 'suphec initialise les constantes du GCM'      RPI = 2.*ASIN(1.)
80         firstcall = .FALSE.      print *, 'Fundamental constants '
81        print '('' PI = '', E13.7, '' -'')', RPI
82         !*       1.    DEFINE FUNDAMENTAL CONSTANTS.      print '('' c = '', E13.7, ''m s-1'')', RCLUM
83        print '('' h = '', E13.7, ''J s'')', RHPLA
84         WRITE(UNIT=6,FMT='(''0*** Constants of the ICM   ***'')')  
85         RPI=2.*ASIN(1.)      ! 2. DEFINE ASTRONOMICAL CONSTANTS
86         RCLUM=299792458.  
87         RHPLA=6.6260755E-34      RSIYEA = 365.25*RDAY*2.*RPI/6.283076
88         RKBOL=1.380658E-23      RSIDAY = RDAY/(1.+RDAY/RSIYEA)
89         RNAVO=6.0221367E+23      ROMEGA = 2.*RPI/RSIDAY
90         WRITE(UNIT=6,FMT='('' *** Fundamental constants ***'')')  
91         WRITE(UNIT=6,FMT='(''           PI = '',E13.7,'' -'')')RPI      print *, 'Astronomical constants '
92         WRITE(UNIT=6,FMT='(''            c = '',E13.7,''m s-1'')') &      print '('' day = '', E13.7, '' s'')', RDAY
93              RCLUM      print '('' half g. axis = '', E13.7, '' m'')', REA
94         WRITE(UNIT=6,FMT='(''            h = '',E13.7,''J s'')') &      print '('' mean anomaly = '', E13.7, '' -'')', REPSM
95              RHPLA      print '('' sideral year = '', E13.7, '' s'')', RSIYEA
96         WRITE(UNIT=6,FMT='(''            K = '',E13.7,''J K-1'')') &      print '('' sideral day = '', E13.7, '' s'')', RSIDAY
97              RKBOL      print '('' omega = '', E13.7, '' s-1'')', ROMEGA
98         WRITE(UNIT=6,FMT='(''            N = '',E13.7,''mol-1'')') &  
99              RNAVO      ! 3. DEFINE GEOIDE.
100    
101         !*       2.    DEFINE ASTRONOMICAL CONSTANTS.      print *, ' Geoide '
102        print '('' Gravity = '', E13.7, '' m s-2'')', RG
103         RDAY=86400.      print '('' Earth radius = '', E13.7, '' m'')', RA
104         REA=149597870000.  
105         REPSM=0.409093      ! 4. DEFINE RADIATION CONSTANTS.
106    
107         RSIYEA=365.25*RDAY*2.*RPI/6.283076      rsigma = 2.*rpi**5 * (kbol/rhpla)**3 * kbol/rclum/rclum/15.
108         RSIDAY=RDAY/(1.+RDAY/RSIYEA)      print *, ' Radiation '
109         ROMEGA=2.*RPI/RSIDAY      print '('' Stefan-Bol. = '', E13.7, '' W m-2 K-4'')', RSIGMA
110    
111         WRITE(UNIT=6,FMT='('' *** Astronomical constants ***'')')      ! 5. DEFINE THERMODYNAMIC CONSTANTS, GAS PHASE.
112         WRITE(UNIT=6,FMT='(''          day = '',E13.7,'' s'')')RDAY  
113         WRITE(UNIT=6,FMT='('' half g. axis = '',E13.7,'' m'')')REA      RCVD = RCPD-RD
114         WRITE(UNIT=6,FMT='('' mean anomaly = '',E13.7,'' -'')')REPSM      RCPV = 4. * RV
115         WRITE(UNIT=6,FMT='('' sideral year = '',E13.7,'' s'')')RSIYEA      RCVV = RCPV-RV
116         WRITE(UNIT=6,FMT='(''  sideral day = '',E13.7,'' s'')')RSIDAY      RETV = RV / RD - 1.
117         WRITE(UNIT=6,FMT='(''        omega = '',E13.7,'' s-1'')') &      print *, 'Thermodynamics, gas'
118              ROMEGA      print '('' Ozone mass = '', e13.7)', RMO3
119        print *, "rd = ", RD, "J K-1 kg-1"
120         !*       3.    DEFINE GEOIDE.      print *, "rv = ", RV, "J K-1 kg-1"
121        print '('' Cpd = '', e13.7)', RCPD
122         RG=9.80665      print '('' Cvd = '', e13.7)', RCVD
123         RA=6371229.      print '('' Cpv = '', e13.7)', RCPV
124         R1SA=SNGL(1.D0/DBLE(RA))      print '('' Cvv = '', e13.7)', RCVV
125         WRITE(UNIT=6,FMT='('' ***         Geoide         ***'')')      print '('' Rd/Cpd = '', e13.7)', RKAPPA
126         WRITE(UNIT=6,FMT='(''      Gravity = '',E13.7,'' m s-2'')') &      print '('' Rv / Rd - 1 = '', e13.7)', RETV
127              RG  
128         WRITE(UNIT=6,FMT='('' Earth radius = '',E13.7,'' m'')')RA      ! 6. DEFINE THERMODYNAMIC CONSTANTS, LIQUID PHASE.
129         WRITE(UNIT=6,FMT='('' Inverse E.R. = '',E13.7,'' m'')')R1SA  
130        RCW = RCPV
131         !*       4.    DEFINE RADIATION CONSTANTS.      print *, 'Thermodynamic, liquid '
132        print '('' Cw = '', E13.7)', RCW
133         rsigma = 2.*rpi**5 * (rkbol/rhpla)**3 * rkbol/rclum/rclum/15.  
134         !IM init. dans conf_phys.F90   RI0=1365.      ! 7. DEFINE THERMODYNAMIC CONSTANTS, SOLID PHASE.
135         WRITE(UNIT=6,FMT='('' ***        Radiation       ***'')')  
136         WRITE(UNIT=6,FMT='('' Stefan-Bol.  = '',E13.7,'' W m-2 K-4'')')  RSIGMA      RCS = RCPV
137        print *, 'thermodynamic, solid'
138         !*       5.    DEFINE THERMODYNAMIC CONSTANTS, GAS PHASE.      print '('' Cs = '', E13.7)', RCS
139    
140         R=RNAVO*RKBOL      ! 8. DEFINE THERMODYNAMIC CONSTANTS, TRANSITION OF PHASE.
141         RMD=28.9644  
142         RMO3=47.9942      RLMLT = RLSTT-RLVTT
143         RMV=18.0153      print *, 'Thermodynamic, trans. '
144         RD=1000.*R/RMD      print '('' Fusion point = '', E13.7)', RTT
145         RV=1000.*R/RMV      print '('' RLvTt = '', E13.7)', RLVTT
146         RCPD=3.5*RD      print '('' RLsTt = '', E13.7)', RLSTT
147         RCVD=RCPD-RD      print '('' RLMlt = '', E13.7)', RLMLT
148         RCPV=4. *RV      print '('' Normal press. = '', E13.7)', RATM
149         RCVV=RCPV-RV  
150         RKAPPA=RD/RCPD      ! 9. SATURATED VAPOUR PRESSURE.
151         RETV=RV/RD-1.  
152         WRITE(UNIT=6,FMT='('' *** Thermodynamic, gas     ***'')')      RGAMW = (RCW-RCPV)/RV
153         WRITE(UNIT=6,FMT='('' Perfect gas  = '',e13.7)') R      RBETW = RLVTT/RV+RGAMW*RTT
154         WRITE(UNIT=6,FMT='('' Dry air mass = '',e13.7)') RMD      RALPW = LOG(RESTT)+RBETW/RTT+RGAMW*LOG(RTT)
155         WRITE(UNIT=6,FMT='('' Ozone   mass = '',e13.7)') RMO3      RGAMS = (RCS-RCPV)/RV
156         WRITE(UNIT=6,FMT='('' Vapour  mass = '',e13.7)') RMV      RBETS = RLSTT/RV+RGAMS*RTT
157         WRITE(UNIT=6,FMT='('' Dry air cst. = '',e13.7)') RD      RALPS = LOG(RESTT)+RBETS/RTT+RGAMS*LOG(RTT)
158         WRITE(UNIT=6,FMT='('' Vapour  cst. = '',e13.7)') RV      RGAMD = RGAMS-RGAMW
159         WRITE(UNIT=6,FMT='(''         Cpd  = '',e13.7)') RCPD      RBETD = RBETS-RBETW
160         WRITE(UNIT=6,FMT='(''         Cvd  = '',e13.7)') RCVD      RALPD = RALPS-RALPW
        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  
161    
162    END SUBROUTINE suphec    END SUBROUTINE suphec
163    

Legend:
Removed from v.17  
changed lines
  Added in v.70

  ViewVC Help
Powered by ViewVC 1.1.21