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

Diff of /trunk/phylmd/suphec.f90

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

trunk/libf/phylmd/suphec.f90 revision 3 by guez, Wed Feb 27 13:16:39 2008 UTC trunk/phylmd/suphec.f90 revision 328 by guez, Thu Jun 13 14:40:06 2019 UTC
# Line 1  Line 1 
1  module suphec_m  module suphec_m
2    
3      use nr_util, only: pi, twoPI
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      real, parameter:: RDAY = 86400.
16    
17      REAL, parameter:: RSIYEA = 365.25 * RDAY * 2. * PI / 6.283076
18      ! sideral year, in s
19    
20      REAL, parameter:: RSIDAY = RDAY / (1. + RDAY / RSIYEA) ! sideral day, in s
21      REAL, parameter:: ROMEGA = twoPI / RSIDAY
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      ! 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      ! From phylmd/suphec.F,v 1.2 2005/06/06 13:16:33    real, parameter:: RCVV = RCPV - RV
49      ! specific heat capacity at constant volume of water vapor, in J K-1 kg-1
50    
51      ! Initialise certaines constantes et parametres physiques.    real, parameter:: RCPD = 7. / 2 * RD
52      ! specific heat capacity at constant pressure of dry air, in J K-1 kg-1
53    
54      use YOMCST, only: rpi, rclum, rhpla, rkbol, rnavo, rday, rea, repsm, &    real, parameter:: RCVD = RCPD - RD
55           rsiyea, rsiday,romega, rg, ra, r1sa, rsigma, r, rmd, rmo3, rmv, rd, &    ! specific heat capacity at constant volume of dry air, in J K-1 kg-1
56           rv, rcpd, rcvd, rcpv, rcvv, rkappa, retv, rcw, rcs, rtt, rlvtt, &    
57           rlstt, rlmlt, ratm, restt, rgamw, rbetw, ralpw, rgams, rbets, ralps, &    real, parameter:: RMO3 = 47.9942
58           rgamd, rbetd, ralpd    REAL, parameter:: RKAPPA = RD/RCPD
59      use yoethf    real, parameter:: RETV = RV / RD - 1.
60    
61      LOGICAL:: firstcall = .TRUE.    ! A1.5, 6 Thermodynamic liquid, solid phases
62    
63      REAL, parameter:: RCW = RCPV ! LIQUID PHASE Cw
64      real, save:: RCS
65    
66      ! A1.7 Thermodynamic transition of phase
67      REAL, save:: RLMLT
68      real, parameter:: RTT = 273.16
69    
70      real, parameter:: RLVTT = 2.5008E+6
71      ! specific latent heat of vaporization of water at triple point, in J kg-1
72    
73      real, parameter:: RLSTT = 2.8345E+6
74      real, parameter:: RATM = 1e5
75    
76      ! A1.8 Curve of saturation
77      REAL, save:: RALPW, RBETW, RGAMW, RALPS, RBETS, RGAMS
78      real, parameter:: RESTT = 611.14
79      REAL, save:: RALPD, RBETD, RGAMD
80    
81      private pi
82    
83    contains
84    
85      SUBROUTINE suphec
86    
87        ! From phylmd/suphec.F, version 1.2 2005/06/06 13:16:33
88        ! Initialise certaines constantes et certains paramètres physiques.
89    
90      !------------------------------------------      !------------------------------------------
91    
92      IF (firstcall) THEN      PRINT *, 'Call sequence information: suphec'
93         PRINT *, 'suphec initialise les constantes du GCM'  
94         firstcall = .FALSE.      print *, 'Astronomical constants '
95         !      print '('' omega = '', E13.7, '' s-1'')', ROMEGA
96         !*       1.    DEFINE FUNDAMENTAL CONSTANTS.  
97         !      print *, 'Geoid:'
98         WRITE(UNIT=6,FMT='(''0*** Constants of the ICM   ***'')')      print '('' Gravity = '', E13.7, '' m s-2'')', RG
99         RPI=2.*ASIN(1.)      print '('' Earth radius = '', E13.7, '' m'')', RA
100         RCLUM=299792458.  
101         RHPLA=6.6260755E-34      print *, 'Radiation constants:'
102         RKBOL=1.380658E-23      print '('' Stefan-Bol. = '', E13.7, '' W m-2 K-4'')', RSIGMA
103         RNAVO=6.0221367E+23  
104         WRITE(UNIT=6,FMT='('' *** Fundamental constants ***'')')      print *, 'Thermodynamical constants, gas phase:'
105         WRITE(UNIT=6,FMT='(''           PI = '',E13.7,'' -'')')RPI      print *, "rd = ", RD, "J K-1 kg-1"
106         WRITE(UNIT=6,FMT='(''            c = '',E13.7,''m s-1'')') &      print *, "rv = ", RV, "J K-1 kg-1"
107              RCLUM      print '('' Cpd = '', e13.7)', RCPD
108         WRITE(UNIT=6,FMT='(''            h = '',E13.7,''J s'')') &      print '('' Cvd = '', e13.7)', RCVD
109              RHPLA      print '('' Cvv = '', e13.7)', RCVV
110         WRITE(UNIT=6,FMT='(''            K = '',E13.7,''J K-1'')') &      print '('' Rd/Cpd = '', e13.7)', RKAPPA
111              RKBOL      print '('' Rv / Rd - 1 = '', e13.7)', RETV
112         WRITE(UNIT=6,FMT='(''            N = '',E13.7,''mol-1'')') &  
113              RNAVO      ! 7. DEFINE THERMODYNAMIC CONSTANTS, SOLID PHASE.
114         !  
115         !      RCS = RCPV
116         !*       2.    DEFINE ASTRONOMICAL CONSTANTS.      print *, 'thermodynamic, solid'
117         !      print '('' Cs = '', E13.7)', RCS
118         RDAY=86400.  
119         REA=149597870000.      ! 8. DEFINE THERMODYNAMIC CONSTANTS, TRANSITION OF PHASE.
120         REPSM=0.409093  
121         !      RLMLT = RLSTT-RLVTT
122         RSIYEA=365.25*RDAY*2.*RPI/6.283076      print *, 'Thermodynamic, transition of phase:'
123         RSIDAY=RDAY/(1.+RDAY/RSIYEA)      print '('' Fusion point = '', E13.7)', RTT
124         ROMEGA=2.*RPI/RSIDAY      print '('' RLsTt = '', E13.7)', RLSTT
125         !      print '('' RLMlt = '', E13.7)', RLMLT
126         WRITE(UNIT=6,FMT='('' *** Astronomical constants ***'')')      print '('' Normal pressure = '', E13.7)', RATM
127         WRITE(UNIT=6,FMT='(''          day = '',E13.7,'' s'')')RDAY  
128         WRITE(UNIT=6,FMT='('' half g. axis = '',E13.7,'' m'')')REA      ! 9. SATURATED VAPOUR PRESSURE.
129         WRITE(UNIT=6,FMT='('' mean anomaly = '',E13.7,'' -'')')REPSM  
130         WRITE(UNIT=6,FMT='('' sideral year = '',E13.7,'' s'')')RSIYEA      RGAMW = (RCW-RCPV)/RV
131         WRITE(UNIT=6,FMT='(''  sideral day = '',E13.7,'' s'')')RSIDAY      RBETW = RLVTT/RV+RGAMW*RTT
132         WRITE(UNIT=6,FMT='(''        omega = '',E13.7,'' s-1'')') &      RALPW = LOG(RESTT)+RBETW/RTT+RGAMW*LOG(RTT)
133              ROMEGA      RGAMS = (RCS-RCPV)/RV
134         !      RBETS = RLSTT/RV+RGAMS*RTT
135         !*       3.    DEFINE GEOIDE.      RALPS = LOG(RESTT)+RBETS/RTT+RGAMS*LOG(RTT)
136         !      RGAMD = RGAMS-RGAMW
137         RG=9.80665      RBETD = RBETS-RBETW
138         RA=6371229.      RALPD = RALPS-RALPW
        R1SA=SNGL(1.D0/DBLE(RA))  
        WRITE(UNIT=6,FMT='('' ***         Geoide         ***'')')  
        WRITE(UNIT=6,FMT='(''      Gravity = '',E13.7,'' m s-2'')') &  
             RG  
        WRITE(UNIT=6,FMT='('' Earth radius = '',E13.7,'' m'')')RA  
        WRITE(UNIT=6,FMT='('' Inverse E.R. = '',E13.7,'' m'')')R1SA  
        !  
        !  
        !*       4.    DEFINE RADIATION CONSTANTS.  
        !  
        ! z.x.li      RSIGMA=2. * RPI**5 * RKBOL**4 /(15.* RCLUM**2 * RHPLA**3)  
        rsigma = 2.*rpi**5 * (rkbol/rhpla)**3 * rkbol/rclum/rclum/15.  
        !IM init. dans conf_phys.F90   RI0=1365.  
        WRITE(UNIT=6,FMT='('' ***        Radiation       ***'')')  
        WRITE(UNIT=6,FMT='('' Stefan-Bol.  = '',E13.7,'' W m-2 K-4'')')  RSIGMA  
   
        !  
        !*       5.    DEFINE THERMODYNAMIC CONSTANTS, GAS PHASE.  
        !  
        R=RNAVO*RKBOL  
        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.  
        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  
139    
140    END SUBROUTINE suphec    END SUBROUTINE suphec
141    

Legend:
Removed from v.3  
changed lines
  Added in v.328

  ViewVC Help
Powered by ViewVC 1.1.21