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

Annotation of /trunk/phylmd/suphec.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 266 - (hide annotations)
Thu Apr 19 17:54:55 2018 UTC (6 years, 1 month ago) by guez
File size: 4278 byte(s)
Define macros of the preprocessor CPP_IIM, CPP_JJM, CPP_LLM so we can
control the resolution from the compilation command, and automate
compilation for several resolutions.

In module yoethf_m, transform variables into named constants. So we do
not need procedure yoethf any longer.

Bug fix in program test_inter_barxy, missing calls to fyhyp and fxhyp,
and definition of rlatu.

Remove variable iecri of module conf_gcm_m. The files dyn_hist*.nc are
written every time step. We are simplifying the output system, pending
replacement by a whole new system.

Modify possible value of vert_sampling from "param" to
"strato_custom", following LMDZ. Default values of corresponding
namelist variables are now the values used for LMDZ CMIP6.

1 guez 3 module suphec_m
2    
3 guez 169 use nr_util, only: pi
4    
5 guez 3 implicit none
6    
7 guez 38 ! A1.0 Fundamental constants
8 guez 169 real, parameter:: RCLUM = 299792458. ! speed of light, m s-1
9     real, parameter:: RHPLA = 6.6260755E-34 ! Planck constant, J s
10 guez 70 real, parameter:: KBOL = 1.380658E-23 ! Boltzmann constant, in J K-1
11     real, parameter:: NAVO = 6.0221367E23 ! Avogadro number, in mol-1
12 guez 38
13     ! A1.1 Astronomical constants
14 guez 171
15     REAL ROMEGA
16 guez 40 real, parameter:: RDAY = 86400.
17 guez 38
18 guez 171 REAL, parameter:: RSIYEA = 365.25 * RDAY * 2. * PI / 6.283076
19     ! sideral year, in s
20    
21     REAL, parameter:: RSIDAY = RDAY / (1. + RDAY / RSIYEA) ! sideral day, in s
22    
23 guez 38 ! A1.2 Geoide
24 guez 47 real, parameter:: RG = 9.80665 ! acceleration of gravity, in m s-2
25 guez 40 real, parameter:: RA = 6371229.
26 guez 38
27     ! A1.3 Radiation
28 guez 169 REAL, parameter:: rsigma = 2. * pi**5 * (kbol / rhpla)**3 * kbol / rclum**2 &
29     / 15.
30 guez 38
31     ! A1.4 Thermodynamic gas phase
32 guez 70 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 guez 47
35 guez 70 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 guez 47 ! specific ideal gas constant for dry air, in J K-1 kg-1
43 guez 70 ! (factor 1e3: conversion from g to kg)
44 guez 47
45 guez 201 real, parameter:: RCPV = 4. * RV
46     ! specific heat capacity at constant pressure of water vapor, in J K-1 kg-1
47 guez 70
48 guez 201 real, save:: RCVD
49     real, save:: RCVV
50 guez 198
51 guez 53 real, parameter:: RCPD = 7. / 2 * RD
52 guez 201 ! specific heat capacity at constant pressure of dry air, in J K-1 kg-1
53 guez 53
54 guez 40 real, parameter:: RMO3 = 47.9942
55 guez 53 REAL, parameter:: RKAPPA = RD/RCPD
56 guez 266 real, parameter:: RETV = RV / RD - 1.
57 guez 38
58 guez 40 ! A1.5, 6 Thermodynamic liquid, solid phases
59 guez 38
60 guez 198 REAL, parameter:: RCW = RCPV ! LIQUID PHASE Cw
61     real, save:: RCS
62    
63 guez 38 ! A1.7 Thermodynamic transition of phase
64 guez 169 REAL, save:: RLMLT
65 guez 40 real, parameter:: RTT = 273.16
66 guez 201
67     real, parameter:: RLVTT = 2.5008E+6
68     ! specific latent heat of vaporization of water at triple point, in J kg-1
69    
70 guez 40 real, parameter:: RLSTT = 2.8345E+6
71 guez 88 real, parameter:: RATM = 1e5
72 guez 38
73     ! A1.8 Curve of saturation
74 guez 169 REAL, save:: RALPW, RBETW, RGAMW, RALPS, RBETS, RGAMS
75 guez 40 real, parameter:: RESTT = 611.14
76 guez 169 REAL, save:: RALPD, RBETD, RGAMD
77 guez 38
78 guez 169 private pi
79 guez 38
80 guez 3 contains
81    
82     SUBROUTINE suphec
83    
84 guez 53 ! From phylmd/suphec.F, version 1.2 2005/06/06 13:16:33
85     ! Initialise certaines constantes et certains paramètres physiques.
86 guez 3
87     !------------------------------------------
88    
89 guez 37 PRINT *, 'Call sequence information: suphec'
90 guez 17
91 guez 37 ! 2. DEFINE ASTRONOMICAL CONSTANTS
92 guez 17
93 guez 169 ROMEGA = 2.*PI/RSIDAY
94 guez 17
95 guez 37 print *, 'Astronomical constants '
96 guez 40 print '('' omega = '', E13.7, '' s-1'')', ROMEGA
97 guez 17
98 guez 40 ! 3. DEFINE GEOIDE.
99 guez 17
100 guez 40 print *, ' Geoide '
101     print '('' Gravity = '', E13.7, '' m s-2'')', RG
102     print '('' Earth radius = '', E13.7, '' m'')', RA
103 guez 17
104 guez 40 ! 4. DEFINE RADIATION CONSTANTS.
105 guez 17
106 guez 40 print *, ' Radiation '
107     print '('' Stefan-Bol. = '', E13.7, '' W m-2 K-4'')', RSIGMA
108 guez 3
109 guez 40 ! 5. DEFINE THERMODYNAMIC CONSTANTS, GAS PHASE.
110 guez 17
111 guez 40 RCVD = RCPD-RD
112     RCVV = RCPV-RV
113 guez 70 print *, 'Thermodynamics, gas'
114     print *, "rd = ", RD, "J K-1 kg-1"
115     print *, "rv = ", RV, "J K-1 kg-1"
116 guez 40 print '('' Cpd = '', e13.7)', RCPD
117     print '('' Cvd = '', e13.7)', RCVD
118     print '('' Cvv = '', e13.7)', RCVV
119     print '('' Rd/Cpd = '', e13.7)', RKAPPA
120 guez 70 print '('' Rv / Rd - 1 = '', e13.7)', RETV
121 guez 17
122 guez 40 ! 7. DEFINE THERMODYNAMIC CONSTANTS, SOLID PHASE.
123 guez 17
124 guez 40 RCS = RCPV
125 guez 37 print *, 'thermodynamic, solid'
126 guez 40 print '('' Cs = '', E13.7)', RCS
127 guez 17
128 guez 40 ! 8. DEFINE THERMODYNAMIC CONSTANTS, TRANSITION OF PHASE.
129 guez 17
130 guez 40 RLMLT = RLSTT-RLVTT
131 guez 88 print *, 'Thermodynamic, transition of phase:'
132 guez 40 print '('' Fusion point = '', E13.7)', RTT
133     print '('' RLsTt = '', E13.7)', RLSTT
134     print '('' RLMlt = '', E13.7)', RLMLT
135 guez 88 print '('' Normal pressure = '', E13.7)', RATM
136 guez 17
137 guez 40 ! 9. SATURATED VAPOUR PRESSURE.
138 guez 17
139 guez 40 RGAMW = (RCW-RCPV)/RV
140     RBETW = RLVTT/RV+RGAMW*RTT
141     RALPW = LOG(RESTT)+RBETW/RTT+RGAMW*LOG(RTT)
142     RGAMS = (RCS-RCPV)/RV
143     RBETS = RLSTT/RV+RGAMS*RTT
144     RALPS = LOG(RESTT)+RBETS/RTT+RGAMS*LOG(RTT)
145     RGAMD = RGAMS-RGAMW
146     RBETD = RBETS-RBETW
147     RALPD = RALPS-RALPW
148 guez 17
149 guez 3 END SUBROUTINE suphec
150    
151     end module suphec_m

  ViewVC Help
Powered by ViewVC 1.1.21