source: LMDZ6/branches/LMDZ-ECRAD/libf/phylmd/ecrad/srtm_kgb16.F90 @ 4115

Last change on this file since 4115 was 3904, checked in by idelkadi, 3 years ago

Implementation of the ECRAD code in LMDZ.
Addition of the data directory and the namelist_ecrad file necessary for ECRAD.

File size: 9.5 KB
Line 
1SUBROUTINE SRTM_KGB16(DIRECTORY)
2
3!     Originally by J.Delamere, Atmospheric & Environmental Research.
4!     Revision: 2.4
5!     BAND 16:  2600-3000 cm-1 (low - H2O,CH4; high - nothing)
6!     Reformatted for F90 by JJMorcrette, ECMWF
7!     R. Elkhatib 12-10-2005 Split for faster and more robust compilation.
8!     G.Mozdzynski March 2011 read constants from files
9!     T. Wilhelmsson and K. Yessad (Oct 2013) Geometry and setup refactoring.
10!     ------------------------------------------------------------------
11
12USE PARKIND1  , ONLY : JPRB
13USE YOMHOOK   , ONLY : LHOOK, DR_HOOK
14USE YOMLUN    , ONLY : NULRAD
15USE YOMMP0    , ONLY : NPROC, MYPROC
16USE MPL_MODULE, ONLY : MPL_BROADCAST
17USE YOMTAG    , ONLY : MTAGRAD
18USE YOESRTA16 , ONLY : KA, KB, KA_D, KB_D, SELFREF, FORREF, SFLUXREF, RAYL, STRRAT1, LAYREFFR
19
20!     ------------------------------------------------------------------
21
22IMPLICIT NONE
23
24CHARACTER(LEN=*), INTENT(IN) :: DIRECTORY
25
26! KURUCZ
27!CHARACTER(LEN = 80) :: CLZZZ
28CHARACTER(LEN = 255) :: CLF1
29REAL(KIND=JPRB) :: ZHOOK_HANDLE
30
31#include "abor1.intfb.h"
32
33IF (LHOOK) CALL DR_HOOK('SRTM_KGB16',0,ZHOOK_HANDLE)
34
35IF( MYPROC==1 )THEN
36  !CALL GETENV("DATA",CLZZZ)
37  !IF(CLZZZ /= " ") THEN
38  !  CLF1=TRIM(CLZZZ)//"/RADSRTM"
39  CLF1 = DIRECTORY // "/RADSRTM"
40  WRITE(0,'(A,A)') 'Reading ',TRIM(CLF1)
41  OPEN(NULRAD,FILE=TRIM(CLF1),FORM="UNFORMATTED",ACTION="READ",ERR=1000,convert='big_endian')
42  !ELSE
43  !  OPEN(NULRAD,FILE='RADSRTM',FORM="UNFORMATTED",ACTION="READ",ERR=1000)
44  !ENDIF
45 READ(NULRAD,ERR=1001) KA_D,KB_D
46  KA = REAL(KA_D,JPRB)
47  KB = REAL(KB_D,JPRB)
48ENDIF
49IF( NPROC>1 )THEN
50  CALL MPL_BROADCAST (KA,MTAGRAD,1,CDSTRING='SRTM_KGB16:')
51  CALL MPL_BROADCAST (KB,MTAGRAD,1,CDSTRING='SRTM_KGB16:')
52ENDIF
53
54SFLUXREF = (/ &
55 & 1.92269_JPRB    , 1.72844_JPRB    , 1.64326_JPRB    , 1.58451_JPRB     &
56 & , 1.44031_JPRB    , 1.25108_JPRB    , 1.02724_JPRB    , 0.776759_JPRB    &
57 & , 0.534444_JPRB   , 5.87755E-02_JPRB, 4.86706E-02_JPRB, 3.87989E-02_JPRB &
58 & , 2.84532E-02_JPRB, 1.82431E-02_JPRB, 6.92320E-03_JPRB, 9.70770E-04_JPRB /) 
59
60!     Rayleigh extinction coefficient at v = 2925 cm-1.
61RAYL = 2.91E-10_JPRB
62
63STRRAT1 = 252.131_JPRB
64
65LAYREFFR = 18
66
67!     ------------------------------------------------------------------
68
69!     The array KA contains absorption coefs at the 16 chosen g-values
70!     for a range of pressure levels> ~100mb, temperatures, and binary
71!     species parameters (see taumol.f for definition).  The first
72!     index in the array, JS, runs from 1 to 9, and corresponds to
73!     different values of the binary species parameter.  For instance,
74!     JS=1 refers to dry air, JS = 2 corresponds to the paramter value 1/8,
75!     JS = 3 corresponds to the parameter value 2/8, etc.  The second index
76!     in the array, JT, which runs from 1 to 5, corresponds to different
77!     temperatures.  More specifically, JT = 3 means that the data are for
78!     the reference temperature TREF for this  pressure level, JT = 2 refers
79!     to TREF-15, JT = 1 is for TREF-30, JT = 4 is for TREF+15, and JT = 5
80!     is for TREF+30.  The third index, JP, runs from 1 to 13 and refers
81!     to the JPth reference pressure level (see taumol.f for these levels
82!     in mb).  The fourth index, IG, goes from 1 to 16, and indicates
83!     which g-interval the absorption coefficients are for.
84!     -----------------------------------------------------------------
85
86!     -----------------------------------------------------------------
87!     The array KB contains absorption coefs at the 16 chosen g-values
88!     for a range of pressure levels < ~100mb and temperatures. The first
89!     index in the array, JT, which runs from 1 to 5, corresponds to
90!     different temperatures.  More specifically, JT = 3 means that the
91!     data are for the reference temperature TREF for this pressure
92!     level, JT = 2 refers to the temperature TREF-15, JT = 1 is for
93!     TREF-30, JT = 4 is for TREF+15, and JT = 5 is for TREF+30. 
94!     The second index, JP, runs from 13 to 59 and refers to the JPth
95!     reference pressure level (see taumol.f for the value of these
96!     pressure levels in mb).  The third index, IG, goes from 1 to 16,
97!     and tells us which g-interval the absorption coefficients are for.
98!     -----------------------------------------------------------------
99
100FORREF(:, 1) = (/ 0.525585E-05_JPRB, 0.527618E-05_JPRB, 0.746929E-04_JPRB /)
101FORREF(:, 2) = (/ 0.794660E-05_JPRB, 0.136902E-04_JPRB, 0.849878E-04_JPRB /)
102FORREF(:, 3) = (/ 0.197099E-04_JPRB, 0.733094E-04_JPRB, 0.121687E-03_JPRB /)
103FORREF(:, 4) = (/ 0.148274E-03_JPRB, 0.169776E-03_JPRB, 0.164848E-03_JPRB /)
104FORREF(:, 5) = (/ 0.230296E-03_JPRB, 0.210384E-03_JPRB, 0.182028E-03_JPRB /)
105FORREF(:, 6) = (/ 0.280575E-03_JPRB, 0.259217E-03_JPRB, 0.196080E-03_JPRB /)
106FORREF(:, 7) = (/ 0.329034E-03_JPRB, 0.291575E-03_JPRB, 0.207044E-03_JPRB /)
107FORREF(:, 8) = (/ 0.349989E-03_JPRB, 0.323471E-03_JPRB, 0.225712E-03_JPRB /)
108FORREF(:, 9) = (/ 0.366097E-03_JPRB, 0.321519E-03_JPRB, 0.253150E-03_JPRB /)
109FORREF(:,10) = (/ 0.383589E-03_JPRB, 0.355314E-03_JPRB, 0.262555E-03_JPRB /)
110FORREF(:,11) = (/ 0.375933E-03_JPRB, 0.372443E-03_JPRB, 0.261313E-03_JPRB /)
111FORREF(:,12) = (/ 0.370652E-03_JPRB, 0.382366E-03_JPRB, 0.250070E-03_JPRB /)
112FORREF(:,13) = (/ 0.375092E-03_JPRB, 0.379542E-03_JPRB, 0.265794E-03_JPRB /)
113FORREF(:,14) = (/ 0.389705E-03_JPRB, 0.384274E-03_JPRB, 0.322135E-03_JPRB /)
114FORREF(:,15) = (/ 0.372084E-03_JPRB, 0.390422E-03_JPRB, 0.370035E-03_JPRB /)
115FORREF(:,16) = (/ 0.437802E-03_JPRB, 0.373406E-03_JPRB, 0.373222E-03_JPRB /)
116
117!     -----------------------------------------------------------------
118!     The array SELFREF contains the coefficient of the water vapor
119!     self-continuum (including the energy term).  The first index
120!     refers to temperature in 7.2 degree increments.  For instance,
121!     JT = 1 refers to a temperature of 245.6, JT = 2 refers to 252.8,
122!     etc.  The second index runs over the g-channel (1 to 16).
123
124SELFREF(:, 1) = (/ &
125 & 0.126758E-02_JPRB, 0.105253E-02_JPRB, 0.873963E-03_JPRB, 0.725690E-03_JPRB, 0.602573E-03_JPRB, &
126 & 0.500344E-03_JPRB, 0.415458E-03_JPRB, 0.344973E-03_JPRB, 0.286447E-03_JPRB, 0.237849E-03_JPRB /) 
127SELFREF(:, 2) = (/ &
128 & 0.144006E-02_JPRB, 0.118514E-02_JPRB, 0.975351E-03_JPRB, 0.802697E-03_JPRB, 0.660606E-03_JPRB, &
129 & 0.543667E-03_JPRB, 0.447429E-03_JPRB, 0.368226E-03_JPRB, 0.303044E-03_JPRB, 0.249400E-03_JPRB /) 
130SELFREF(:, 3) = (/ &
131 & 0.294018E-02_JPRB, 0.227428E-02_JPRB, 0.175920E-02_JPRB, 0.136077E-02_JPRB, 0.105258E-02_JPRB, &
132 & 0.814189E-03_JPRB, 0.629789E-03_JPRB, 0.487153E-03_JPRB, 0.376821E-03_JPRB, 0.291478E-03_JPRB /) 
133SELFREF(:, 4) = (/ &
134 & 0.395290E-02_JPRB, 0.348405E-02_JPRB, 0.307081E-02_JPRB, 0.270658E-02_JPRB, 0.238556E-02_JPRB, &
135 & 0.210261E-02_JPRB, 0.185322E-02_JPRB, 0.163341E-02_JPRB, 0.143967E-02_JPRB, 0.126891E-02_JPRB /) 
136SELFREF(:, 5) = (/ &
137 & 0.419122E-02_JPRB, 0.385638E-02_JPRB, 0.354829E-02_JPRB, 0.326481E-02_JPRB, 0.300398E-02_JPRB, &
138 & 0.276399E-02_JPRB, 0.254317E-02_JPRB, 0.234000E-02_JPRB, 0.215305E-02_JPRB, 0.198104E-02_JPRB /) 
139SELFREF(:, 6) = (/ &
140 & 0.495659E-02_JPRB, 0.456777E-02_JPRB, 0.420945E-02_JPRB, 0.387924E-02_JPRB, 0.357494E-02_JPRB, &
141 & 0.329450E-02_JPRB, 0.303606E-02_JPRB, 0.279790E-02_JPRB, 0.257842E-02_JPRB, 0.237615E-02_JPRB /) 
142SELFREF(:, 7) = (/ &
143 & 0.526981E-02_JPRB, 0.490687E-02_JPRB, 0.456893E-02_JPRB, 0.425426E-02_JPRB, 0.396126E-02_JPRB, &
144 & 0.368844E-02_JPRB, 0.343441E-02_JPRB, 0.319788E-02_JPRB, 0.297764E-02_JPRB, 0.277256E-02_JPRB /) 
145SELFREF(:, 8) = (/ &
146 & 0.575426E-02_JPRB, 0.531597E-02_JPRB, 0.491106E-02_JPRB, 0.453699E-02_JPRB, 0.419141E-02_JPRB, &
147 & 0.387216E-02_JPRB, 0.357722E-02_JPRB, 0.330475E-02_JPRB, 0.305303E-02_JPRB, 0.282048E-02_JPRB /) 
148SELFREF(:, 9) = (/ &
149 & 0.549881E-02_JPRB, 0.514328E-02_JPRB, 0.481074E-02_JPRB, 0.449970E-02_JPRB, 0.420877E-02_JPRB, &
150 & 0.393665E-02_JPRB, 0.368213E-02_JPRB, 0.344406E-02_JPRB, 0.322138E-02_JPRB, 0.301310E-02_JPRB /) 
151SELFREF(:,10) = (/ &
152 & 0.605357E-02_JPRB, 0.561246E-02_JPRB, 0.520349E-02_JPRB, 0.482432E-02_JPRB, 0.447278E-02_JPRB, &
153 & 0.414686E-02_JPRB, 0.384469E-02_JPRB, 0.356453E-02_JPRB, 0.330479E-02_JPRB, 0.306398E-02_JPRB /) 
154SELFREF(:,11) = (/ &
155 & 0.640504E-02_JPRB, 0.587858E-02_JPRB, 0.539540E-02_JPRB, 0.495194E-02_JPRB, 0.454492E-02_JPRB, &
156 & 0.417136E-02_JPRB, 0.382850E-02_JPRB, 0.351382E-02_JPRB, 0.322501E-02_JPRB, 0.295993E-02_JPRB /) 
157SELFREF(:,12) = (/ &
158 & 0.677803E-02_JPRB, 0.615625E-02_JPRB, 0.559152E-02_JPRB, 0.507859E-02_JPRB, 0.461271E-02_JPRB, &
159 & 0.418957E-02_JPRB, 0.380524E-02_JPRB, 0.345617E-02_JPRB, 0.313913E-02_JPRB, 0.285116E-02_JPRB /) 
160SELFREF(:,13) = (/ &
161 & 0.690347E-02_JPRB, 0.627003E-02_JPRB, 0.569472E-02_JPRB, 0.517219E-02_JPRB, 0.469761E-02_JPRB, &
162 & 0.426658E-02_JPRB, 0.387509E-02_JPRB, 0.351953E-02_JPRB, 0.319659E-02_JPRB, 0.290328E-02_JPRB /) 
163SELFREF(:,14) = (/ &
164 & 0.692680E-02_JPRB, 0.632795E-02_JPRB, 0.578087E-02_JPRB, 0.528109E-02_JPRB, 0.482452E-02_JPRB, &
165 & 0.440742E-02_JPRB, 0.402638E-02_JPRB, 0.367828E-02_JPRB, 0.336028E-02_JPRB, 0.306977E-02_JPRB /) 
166SELFREF(:,15) = (/ &
167 & 0.754894E-02_JPRB, 0.681481E-02_JPRB, 0.615207E-02_JPRB, 0.555378E-02_JPRB, 0.501367E-02_JPRB, &
168 & 0.452609E-02_JPRB, 0.408593E-02_JPRB, 0.368857E-02_JPRB, 0.332986E-02_JPRB, 0.300603E-02_JPRB /) 
169SELFREF(:,16) = (/ &
170 & 0.760689E-02_JPRB, 0.709755E-02_JPRB, 0.662232E-02_JPRB, 0.617891E-02_JPRB, 0.576519E-02_JPRB, &
171 & 0.537917E-02_JPRB, 0.501899E-02_JPRB, 0.468293E-02_JPRB, 0.436938E-02_JPRB, 0.407682E-02_JPRB /) 
172
173IF (LHOOK) CALL DR_HOOK('SRTM_KGB16',1,ZHOOK_HANDLE)
174RETURN
175
1761000 CONTINUE
177CALL ABOR1("SRTM_KGB16:ERROR OPENING FILE RADSRTM")
1781001 CONTINUE
179CALL ABOR1("SRTM_KGB16:ERROR READING FILE RADSRTM")
180
181END SUBROUTINE SRTM_KGB16
Note: See TracBrowser for help on using the repository browser.