1 | subroutine lwmain (ig0,icount,kdlon,kflev |
---|
2 | . ,dp,dt0,emis |
---|
3 | . ,plev,tlev,tlay,aerosol,coolrate |
---|
4 | . ,fluxground,fluxtop |
---|
5 | . ,netrad |
---|
6 | & ,QIRsQREF3d,omegaIR3d,gIR3d |
---|
7 | & ,co2ice) |
---|
8 | |
---|
9 | c---------------------------------------------------------------------- |
---|
10 | c LWMAIN organizes the LTE longwave calculations |
---|
11 | c for layer 1 to layer "nlaylte" (stored in "yomlw_h") |
---|
12 | c---------------------------------------------------------------------- |
---|
13 | |
---|
14 | use dimradmars_mod, only: ndlo2, nflev, nir, ndlon, nuco2 |
---|
15 | use dimradmars_mod, only: naerkind |
---|
16 | use yomlw_h, only: nlaylte, xi |
---|
17 | implicit none |
---|
18 | |
---|
19 | #include "callkeys.h" |
---|
20 | #include "comg1d.h" |
---|
21 | |
---|
22 | c---------------------------------------------------------------------- |
---|
23 | c 0.1 arguments |
---|
24 | c --------- |
---|
25 | c inputs: |
---|
26 | c ------- |
---|
27 | integer ig0 |
---|
28 | integer icount |
---|
29 | integer kdlon ! part of ngrid |
---|
30 | integer kflev ! part of nlayer |
---|
31 | |
---|
32 | real dp (ndlo2,kflev) ! layer pressure thickness (Pa) |
---|
33 | real dt0 (ndlo2) ! surface temperature discontinuity (K) |
---|
34 | real emis (ndlo2) ! surface emissivity |
---|
35 | real plev (ndlo2,kflev+1) ! level pressure (Pa) |
---|
36 | real tlev (ndlo2,kflev+1) ! level temperature (K) |
---|
37 | real tlay (ndlo2,kflev) ! layer temperature (K) |
---|
38 | real aerosol(ndlo2,kflev,naerkind) ! aerosol extinction optical |
---|
39 | c depth at reference wavelength "longrefvis" set |
---|
40 | c in dimradmars_mod , in each layer, for one of |
---|
41 | c the "naerkind" kind of aerosol optical properties. |
---|
42 | |
---|
43 | |
---|
44 | c outputs: |
---|
45 | c -------- |
---|
46 | real coolrate(ndlo2,kflev) ! cooling rate (K/s) |
---|
47 | real fluxground(ndlo2) ! downward ground flux (W/m2) |
---|
48 | real fluxtop(ndlo2) ! outgoing upward flux (W/m2) ("OLR") |
---|
49 | real netrad (ndlo2,kflev) ! radiative budget (W/m2) |
---|
50 | c Aerosol optical properties |
---|
51 | REAL :: QIRsQREF3d(ndlo2,kflev,nir,naerkind) |
---|
52 | REAL :: omegaIR3d(ndlo2,kflev,nir,naerkind) |
---|
53 | REAL :: gIR3d(ndlo2,kflev,nir,naerkind) |
---|
54 | |
---|
55 | c---------------------------------------------------------------------- |
---|
56 | c 0.2 local arrays |
---|
57 | c ------------ |
---|
58 | |
---|
59 | real aer_t (ndlon,nuco2,nflev+1) ! transmission (aer) |
---|
60 | real co2_u (ndlon,nuco2,nflev+1) ! absorber amounts (co2) |
---|
61 | real co2_up (ndlon,nuco2,nflev+1) ! idem scaled by the pressure (co2) |
---|
62 | |
---|
63 | real bsurf (ndlon,nir) ! surface spectral planck function |
---|
64 | real btop (ndlon,nir) ! top spectral planck function |
---|
65 | real blev (ndlon,nir,nflev+1) ! level spectral planck function |
---|
66 | real blay (ndlon,nir,nflev) ! layer spectral planck function |
---|
67 | real dblay (ndlon,nir,nflev) ! layer gradient spectral planck function |
---|
68 | real dbsublay (ndlon,nir,2*nflev) ! layer gradient spectral planck function |
---|
69 | ! in sub layers |
---|
70 | |
---|
71 | real tautotal(ndlon,nflev,nir) ! \ Total single scattering |
---|
72 | real omegtotal(ndlon,nflev,nir) ! > properties (Addition of the |
---|
73 | real gtotal(ndlon,nflev,nir) ! / NAERKIND aerosols prop.) |
---|
74 | |
---|
75 | real newcoolrate(ndlon,nflev) ! cooling rate (K/s) / with implicite scheme |
---|
76 | |
---|
77 | REAL co2ice(ndlo2) ! co2 ice surface layer (kg.m-2) |
---|
78 | REAL emis_gaz(ndlo2) ! emissivity for gaz computations |
---|
79 | |
---|
80 | integer jk,jkk,ja,jl |
---|
81 | |
---|
82 | |
---|
83 | c---------------------------------------------------------------------- |
---|
84 | c 0.3 Initialisation |
---|
85 | c -------------- |
---|
86 | |
---|
87 | DO jl=1 , kdlon |
---|
88 | IF(co2ice(jl) .GT. 20.e-3) THEN |
---|
89 | emis_gaz(jl)=1. |
---|
90 | ELSE |
---|
91 | emis_gaz(jl)=emis(jl) |
---|
92 | ENDIF |
---|
93 | ENDDO |
---|
94 | |
---|
95 | c---------------------------------------------------------------------- |
---|
96 | c 1.0 planck function |
---|
97 | c --------------- |
---|
98 | |
---|
99 | call lwb ( kdlon, kflev, tlev, tlay, dt0 |
---|
100 | . , bsurf, btop, blay, blev, dblay, dbsublay) |
---|
101 | |
---|
102 | c---------------------------------------------------------------------- |
---|
103 | c 2.0 absorber amounts |
---|
104 | c ---------------- |
---|
105 | |
---|
106 | call lwu ( kdlon, kflev |
---|
107 | . , dp, plev, tlay, aerosol |
---|
108 | & , QIRsQREF3d,omegaIR3d,gIR3d |
---|
109 | . , aer_t, co2_u, co2_up |
---|
110 | . , tautotal,omegtotal,gtotal) |
---|
111 | |
---|
112 | c---------------------------------------------------------------------- |
---|
113 | c 3.0 transmission functions / exchange coefficiants |
---|
114 | c ---------------------------------------------- |
---|
115 | |
---|
116 | c distants |
---|
117 | c -------- |
---|
118 | if( mod(icount-1,ilwd).eq.0) then |
---|
119 | |
---|
120 | c print*, 'CALL of DISTANTS' |
---|
121 | call lwxd ( ig0, kdlon, kflev, emis_gaz |
---|
122 | . , aer_t, co2_u, co2_up) |
---|
123 | |
---|
124 | endif |
---|
125 | c neighbours |
---|
126 | c ---------- |
---|
127 | if( mod(icount-1,ilwn).eq.0) then |
---|
128 | |
---|
129 | c print*, 'CALL of NEIGHBOURS' |
---|
130 | call lwxn ( ig0, kdlon, kflev |
---|
131 | . , dp |
---|
132 | . , aer_t, co2_u, co2_up) |
---|
133 | |
---|
134 | endif |
---|
135 | c boundaries |
---|
136 | c ---------- |
---|
137 | if( mod(icount-1,ilwb).eq.0) then |
---|
138 | |
---|
139 | c print*, 'CALL of BOUNDARIES' |
---|
140 | call lwxb ( ig0, kdlon, kflev, emis_gaz |
---|
141 | . , aer_t, co2_u, co2_up) |
---|
142 | |
---|
143 | endif |
---|
144 | |
---|
145 | c---------------------------------------------------------------------- |
---|
146 | c 4.0 cooling rate |
---|
147 | c ------------ |
---|
148 | |
---|
149 | call lwflux ( ig0, kdlon, kflev, dp |
---|
150 | . , bsurf, btop, blev, blay, dbsublay |
---|
151 | . , tlay, tlev, dt0 ! pour sortie dans g2d uniquement |
---|
152 | . , emis |
---|
153 | . , tautotal,omegtotal,gtotal |
---|
154 | . , coolrate, fluxground, fluxtop |
---|
155 | . , netrad) |
---|
156 | |
---|
157 | c do jk = 1, nlaylte |
---|
158 | c print*,coolrate(1,jk) |
---|
159 | c enddo |
---|
160 | |
---|
161 | c do jkk = 0 , nlaylte+1 |
---|
162 | c do jk = 0 , nlaylte+1 |
---|
163 | c do ja = 1 , nuco2 |
---|
164 | c do jl = 1 , ngrid |
---|
165 | c if (xi (jl,ja,jk,jkk) .LT. 0 |
---|
166 | c . .OR. xi (jl,ja,jk,jkk) .GT. 1 ) then |
---|
167 | c print*,'xi bande',ja,jk,jkk,xi (jl,ja,jk,jkk) |
---|
168 | c endif |
---|
169 | c enddo |
---|
170 | c enddo |
---|
171 | c enddo |
---|
172 | c enddo |
---|
173 | |
---|
174 | c---------------------------------------------------------------------- |
---|
175 | c |
---|
176 | c 5. shema semi-implicite (lwi) |
---|
177 | c --------------------------- |
---|
178 | c |
---|
179 | c |
---|
180 | call lwi (ig0,kdlon,kflev,netrad,dblay,dp |
---|
181 | . , newcoolrate) |
---|
182 | c |
---|
183 | c Verif que (X sol,space) + somme(X i,sol) = 1 |
---|
184 | c |
---|
185 | do jkk = 1 , nlaylte |
---|
186 | do jl = 1 , kdlon |
---|
187 | c print*,'NEW et OLD coolrate :',jkk,newcoolrate(jl,jkk) |
---|
188 | c . ,coolrate(jl,jkk) |
---|
189 | coolrate(jl,jkk) = newcoolrate(jl,jkk) |
---|
190 | enddo |
---|
191 | enddo |
---|
192 | c |
---|
193 | c---------------------------------------------------------------------- |
---|
194 | |
---|
195 | return |
---|
196 | end |
---|