1 | SUBROUTINE callradite(icount,ngrid,nlayer,nq,zday,ls,pq,albedo, |
---|
2 | $ emis,mu0,pplev,pplay,pt,tsurf,fract,dist_sol,igout, |
---|
3 | $ dtlw,dtsw,fluxsurf_lw,fluxsurf_sw,fluxtop_lw,fluxtop_sw, |
---|
4 | & tauref,tau,aerosol,tauscaling,rdust,rice,nuice,co2ice) |
---|
5 | |
---|
6 | IMPLICIT NONE |
---|
7 | c======================================================================= |
---|
8 | c subject: |
---|
9 | c -------- |
---|
10 | c Subroutine designed to call the main canonic |
---|
11 | c radiative transfer subroutine "lwmain" et "swmain" |
---|
12 | c to compute radiative heating and cooling rate and |
---|
13 | c radiative fluxes to the surface. |
---|
14 | c |
---|
15 | c These calculations are only valid on the part of the atmosphere |
---|
16 | c where Local Thermal Equilibrium (NLTE) is verified. In practice |
---|
17 | c The calculations are only performed for the first "nlaylte" |
---|
18 | c parameters (nlaylte is calculated by subroutine "nlthermeq" |
---|
19 | c and stored in common "yomlw.h"). |
---|
20 | c |
---|
21 | c The purpose of this subroutine is to: |
---|
22 | c 1) Make some initial calculation at first call |
---|
23 | c 2) Split the calculation in several sub-grid |
---|
24 | c ("sub-domain") to save memory and |
---|
25 | c be able run on a workstation at high resolution |
---|
26 | c The sub-grid size is defined in dimradmars.h |
---|
27 | c 3) Compute the 3D scattering parameters depending on the |
---|
28 | c size distribution of the different tracers (added by JBM) |
---|
29 | c 4) call "lwmain" and "swmain" |
---|
30 | c |
---|
31 | c |
---|
32 | c authors: |
---|
33 | c ------ |
---|
34 | c Francois Forget / Christophe Hourdin / J.-B. Madeleine (2009) |
---|
35 | c |
---|
36 | c |
---|
37 | c 3D scattering scheme user's guide (J.-B. Madeleine) |
---|
38 | c --------------------------------- |
---|
39 | c |
---|
40 | c This routine has been modified to take into account 3D, time |
---|
41 | c dependent scattering properties of the aerosols. |
---|
42 | c---- The look-up tables that contain the scattering parameters |
---|
43 | c of a given tracer, for different sizes, are read by SUAER.F90. |
---|
44 | c The names of the corresponding ASCII files have to be set in |
---|
45 | c this subroutine (file_id variable), and files must be in the |
---|
46 | c directory specified in datafile.h. Please make sure that the |
---|
47 | c ASCII files are correctly written, and that the range |
---|
48 | c of particle sizes is consistent with what you would expect. |
---|
49 | c---- SUAER.F90 is in charge of reading the ASCII files and averaging |
---|
50 | c the scattering parameters in each GCM channel, using the three last |
---|
51 | c equations of Forget et al. 1998 (GRL 25, No.7, p.1105-1108). |
---|
52 | c---- These look-up tables, loaded during the firstcall, are then |
---|
53 | c constantly used by the subroutine "aeroptproperties.F" to compute, |
---|
54 | c online, the 3D scattering parameters, based on the size distribution |
---|
55 | c (reffrad and nueffrad) of the different tracers, in each grid box. |
---|
56 | c These 3D size distributions are loaded by the "updatereffrad.F" |
---|
57 | c subroutine. A log-normal distribution is then assumed in |
---|
58 | c "aeroptproperties.F", along with a Gauss-Legendre integration. |
---|
59 | c---- The optical depth at the visible reference wavelength (set in |
---|
60 | c SUAER.F90, after the file_id variable) is then computed by |
---|
61 | c the subroutine "aeropacity.F", by using the size and spatial |
---|
62 | c distribution of the corresponding tracer. This connection has to |
---|
63 | c be implemented in "aeropacity.F" when adding a new tracer. To do so, |
---|
64 | c one can use equation 2 of Forget et al. 1998 (Icarus 131, p.302-316). |
---|
65 | c---- The resulting variables "aerosol", "QVISsQREF3d", "omegaVIS3d" and |
---|
66 | c "gVIS3d" (same in the infrared) are finally used by lwmain.F and |
---|
67 | c swmain.F to solve the radiative transfer equation. |
---|
68 | c |
---|
69 | c changes: |
---|
70 | c ------- |
---|
71 | c |
---|
72 | c > SRL 7/2000 |
---|
73 | c |
---|
74 | c This version has been modified to only calculate radiative tendencies |
---|
75 | c over layers 1..NFLEV (set in dimradmars.h). Returns zero for higher |
---|
76 | c layers, if any. |
---|
77 | c In other routines, nlayermx -> nflev. |
---|
78 | c Routines affected: lwflux, lwi, lwmain, lwxb, lwxd, lwxn. |
---|
79 | c |
---|
80 | c > J.-B. Madeleine 10W12 |
---|
81 | c This version uses the variable's splitting, which can be usefull |
---|
82 | c when performing very high resolution simulation like LES. |
---|
83 | c |
---|
84 | c ---------- |
---|
85 | c Here, solar band#1 is spectral interval between "long1vis" and "long2vis" |
---|
86 | c set in dimradmars.h |
---|
87 | c Here, solar band#2 is spectral interval between "long2vis" and "long3vis" |
---|
88 | c set in dimradmars.h |
---|
89 | c |
---|
90 | c input: |
---|
91 | c ----- |
---|
92 | c icount counter of call to subroutine physic by gcm |
---|
93 | c ngrid number of gridpoint of horizontal grid |
---|
94 | c nlayer Number of layer |
---|
95 | c nq Number of tracer |
---|
96 | c ls Solar longitude (Ls) , radian |
---|
97 | c zday Date (time since Ls=0, in martian days) |
---|
98 | c pq(ngrid,nlayer,nq) Advected fields |
---|
99 | c |
---|
100 | c albedo (ngrid,2) hemispheric surface albedo |
---|
101 | c albedo (i,1) : mean albedo for solar band#1 |
---|
102 | c (see below) |
---|
103 | c albedo (i,2) : mean albedo for solar band#2 |
---|
104 | c (see below) |
---|
105 | c emis Thermal IR surface emissivity (no unit) |
---|
106 | c mu0(ngridmx) cos of solar zenith angle |
---|
107 | c (=1 when sun at zenith) |
---|
108 | c pplay(ngrid,nlayer) pressure (Pa) in the middle of each layer |
---|
109 | c pplev(ngrid,nlayer+1) pressure (Pa) at boundaries of each layer |
---|
110 | c pt(ngrid,nlayer) atmospheric temperature in each layer (K) |
---|
111 | c tsurf(ngrid) surface temperature (K) |
---|
112 | c fract(ngridmx) day fraction of the time interval |
---|
113 | c =1 during the full day ; =0 during the night |
---|
114 | c declin latitude of subsolar point |
---|
115 | c dist_sol sun-Mars distance (AU) |
---|
116 | c igout coordinate of analysed point for debugging |
---|
117 | c reffrad(ngrid,nlayer,naerkind) Aerosol effective radius |
---|
118 | c nueffrad(ngrid,nlayer,naerkind) Aerosol effective variance |
---|
119 | |
---|
120 | c |
---|
121 | c output: |
---|
122 | c ------- |
---|
123 | c dtlw (ngrid,nlayer) longwave (IR) heating rate (K/s) |
---|
124 | c dtsw(ngrid,nlayer) shortwave (Solar) heating rate (K/s) |
---|
125 | c fluxsurf_lw(ngrid) surface downward flux tota LW (thermal IR) (W.m-2) |
---|
126 | c fluxsurf_sw(ngrid,1) surface downward flux SW for solar band#1 (W.m-2) |
---|
127 | c fluxsurf_sw(ngrid,2) surface downward flux SW for solar band#2 (W.m-2) |
---|
128 | c |
---|
129 | c fluxtop_lw(ngrid) outgoing upward flux tota LW (thermal IR) (W.m-2) |
---|
130 | c fluxtop_sw(ngrid,1) outgoing upward flux SW for solar band#1 (W.m-2) |
---|
131 | c fluxtop_sw(ngrid,2) outgoing upward flux SW for solar band#2 (W.m-2) |
---|
132 | |
---|
133 | c tauref Prescribed mean column optical depth at 700 Pa |
---|
134 | c tau Column total visible dust optical depth at each point |
---|
135 | c aerosol(ngrid,nlayer,naerkind) aerosol extinction optical depth |
---|
136 | c at reference wavelength "longrefvis" set |
---|
137 | c in dimradmars.h , in each layer, for one of |
---|
138 | c the "naerkind" kind of aerosol optical |
---|
139 | c properties. |
---|
140 | |
---|
141 | c======================================================================= |
---|
142 | c |
---|
143 | c Declarations : |
---|
144 | c ------------- |
---|
145 | c |
---|
146 | #include "dimensions.h" |
---|
147 | #include "dimphys.h" |
---|
148 | #include "dimradmars.h" |
---|
149 | #include "comcstfi.h" |
---|
150 | #include "callkeys.h" |
---|
151 | #include "yomlw.h" |
---|
152 | #include "aerkind.h" |
---|
153 | |
---|
154 | c----------------------------------------------------------------------- |
---|
155 | c Input/Output |
---|
156 | c ------------ |
---|
157 | INTEGER icount |
---|
158 | INTEGER ngrid,nlayer,nq |
---|
159 | INTEGER igout |
---|
160 | |
---|
161 | REAL pq(ngrid,nlayer,nq) |
---|
162 | REAL tauscaling(ngridmx) ! Conversion factor for |
---|
163 | ! qdust and Ndust |
---|
164 | REAL albedo(ngrid,2),emis(ngrid) |
---|
165 | REAL ls,zday |
---|
166 | |
---|
167 | REAL pplev(ngrid,nlayer+1),pplay(ngrid,nlayer) |
---|
168 | REAL pt(ngrid,nlayer) |
---|
169 | REAL tsurf(ngrid) |
---|
170 | REAL dist_sol,mu0(ngrid),fract(ngrid) |
---|
171 | REAL dtlw(ngridmx,nlayermx),dtsw(ngridmx,nlayermx) |
---|
172 | REAL fluxsurf_lw(ngridmx), fluxtop_lw(ngridmx) |
---|
173 | REAL fluxsurf_sw(ngridmx,2), fluxtop_sw(ngridmx,2) |
---|
174 | |
---|
175 | REAL tauref(ngrid), tau(ngrid,naerkind) |
---|
176 | REAL aerosol(ngrid,nlayer,naerkind) |
---|
177 | REAL rdust(ngridmx,nlayermx) ! Dust geometric mean radius (m) |
---|
178 | REAL rice(ngridmx,nlayermx) ! Ice geometric mean radius (m) |
---|
179 | REAL nuice(ngridmx,nlayermx) ! Estimated effective variance |
---|
180 | REAL co2ice(ngridmx) ! co2 ice surface layer (kg.m-2) |
---|
181 | |
---|
182 | c |
---|
183 | c Local variables : |
---|
184 | c ----------------- |
---|
185 | |
---|
186 | INTEGER j,l,ig,n,ich |
---|
187 | INTEGER aer_count,iaer |
---|
188 | INTEGER jd,ig0,nd |
---|
189 | |
---|
190 | real cste_mars ! solar constant on Mars (Wm-2) |
---|
191 | REAL ptlev(ngridmx,nlayermx+1) |
---|
192 | |
---|
193 | INTEGER ndomain |
---|
194 | parameter (ndomain = (ngridmx-1) / ndomainsz + 1) |
---|
195 | |
---|
196 | c Thermal IR net radiative budget (W m-2) |
---|
197 | |
---|
198 | real znetrad(ndomainsz,nflev) |
---|
199 | |
---|
200 | real zfluxd_sw(ndomainsz,nflev+1,2) |
---|
201 | real zfluxu_sw(ndomainsz,nflev+1,2) |
---|
202 | |
---|
203 | REAL zplev(ndomainsz,nflev+1) |
---|
204 | REAL zztlev(ndomainsz,nflev+1) |
---|
205 | REAL zplay(ndomainsz,nflev) |
---|
206 | REAL zt(ndomainsz,nflev) |
---|
207 | REAL zaerosol(ndomainsz,nflev,naerkind) |
---|
208 | REAL zalbedo(ndomainsz,2) |
---|
209 | REAL zdp(ndomainsz,nflev) |
---|
210 | REAL zdt0(ndomainsz) |
---|
211 | |
---|
212 | REAL zzdtlw(ndomainsz,nflev) |
---|
213 | REAL zzdtsw(ndomainsz,nflev) |
---|
214 | REAL zzflux(ndomainsz,6) |
---|
215 | real zrmuz |
---|
216 | |
---|
217 | REAL :: zQVISsQREF3d(ndomainsz,nflev,nsun,naerkind) |
---|
218 | REAL :: zomegaVIS3d(ndomainsz,nflev,nsun,naerkind) |
---|
219 | REAL :: zgVIS3d(ndomainsz,nflev,nsun,naerkind) |
---|
220 | |
---|
221 | REAL :: zQIRsQREF3d(ndomainsz,nflev,nir,naerkind) |
---|
222 | REAL :: zomegaIR3d(ndomainsz,nflev,nir,naerkind) |
---|
223 | REAL :: zgIR3d(ndomainsz,nflev,nir,naerkind) |
---|
224 | |
---|
225 | c Aerosol size distribution |
---|
226 | REAL :: reffrad(ngrid,nlayer,naerkind) |
---|
227 | REAL :: nueffrad(ngrid,nlayer,naerkind) |
---|
228 | c Aerosol optical properties |
---|
229 | REAL :: QVISsQREF3d(ngridmx,nlayermx,nsun,naerkind) |
---|
230 | REAL :: omegaVIS3d(ngridmx,nlayermx,nsun,naerkind) |
---|
231 | REAL :: gVIS3d(ngridmx,nlayermx,nsun,naerkind) |
---|
232 | |
---|
233 | REAL :: QIRsQREF3d(ngridmx,nlayermx,nir,naerkind) |
---|
234 | REAL :: omegaIR3d(ngridmx,nlayermx,nir,naerkind) |
---|
235 | REAL :: gIR3d(ngridmx,nlayermx,nir,naerkind) |
---|
236 | |
---|
237 | REAL :: QREFvis3d(ngridmx,nlayermx,naerkind) |
---|
238 | REAL :: QREFir3d(ngridmx,nlayermx,naerkind) |
---|
239 | |
---|
240 | REAL :: omegaREFvis3d(ngridmx,nlayermx,naerkind) |
---|
241 | REAL :: omegaREFir3d(ngridmx,nlayermx,naerkind) |
---|
242 | |
---|
243 | c local saved variables |
---|
244 | c --------------------- |
---|
245 | |
---|
246 | real pview(ngridmx) |
---|
247 | save pview |
---|
248 | |
---|
249 | real zco2 ! volume fraction of CO2 in Mars atmosphere |
---|
250 | DATA zco2/0.95/ |
---|
251 | SAVE zco2 |
---|
252 | |
---|
253 | LOGICAL firstcall |
---|
254 | DATA firstcall/.true./ |
---|
255 | SAVE firstcall |
---|
256 | |
---|
257 | c---------------------------------------------------------------------- |
---|
258 | |
---|
259 | c Initialisation |
---|
260 | c -------------- |
---|
261 | |
---|
262 | IF (firstcall) THEN |
---|
263 | |
---|
264 | c Please name the different scatterers here ---------------- |
---|
265 | c PLEASE MAKE SURE that you set up the right number of |
---|
266 | c scatterers in dimradmars.h (naerkind); |
---|
267 | name_iaer(1) = "dust_conrath" !! default choice is good old Conrath profile |
---|
268 | IF (doubleq.AND.active) name_iaer(1) = "dust_doubleq" !! two-moment scheme |
---|
269 | if (nqmx.gt.1) then |
---|
270 | ! trick to avoid problems compiling with 1 tracer |
---|
271 | ! and picky compilers who know name_iaer(2) is out of bounds |
---|
272 | j=2 |
---|
273 | IF (water.AND.activice) name_iaer(j) = "h2o_ice" !! radiatively-active clouds |
---|
274 | IF (submicron.AND.active) name_iaer(j) = "dust_submicron" !! JBM experimental stuff |
---|
275 | endif ! of if (nqmx.gt.1) |
---|
276 | c ---------------------------------------------------------- |
---|
277 | |
---|
278 | c Assign a number to the different scatterers |
---|
279 | c ------------------------------------------- |
---|
280 | |
---|
281 | iaer_dust_conrath=0 |
---|
282 | iaer_dust_doubleq=0 |
---|
283 | iaer_dust_submicron=0 |
---|
284 | iaer_h2o_ice=0 |
---|
285 | |
---|
286 | aer_count=0 |
---|
287 | if (.NOT.active) then |
---|
288 | do iaer=1,naerkind |
---|
289 | if (name_iaer(iaer).eq."dust_conrath") then |
---|
290 | iaer_dust_conrath = iaer |
---|
291 | aer_count = aer_count + 1 |
---|
292 | endif |
---|
293 | enddo |
---|
294 | endif |
---|
295 | if (doubleq.AND.active) then |
---|
296 | do iaer=1,naerkind |
---|
297 | if (name_iaer(iaer).eq."dust_doubleq") then |
---|
298 | iaer_dust_doubleq = iaer |
---|
299 | aer_count = aer_count + 1 |
---|
300 | endif |
---|
301 | enddo |
---|
302 | endif |
---|
303 | if (submicron.AND.active) then |
---|
304 | do iaer=1,naerkind |
---|
305 | if (name_iaer(iaer).eq."dust_submicron") then |
---|
306 | iaer_dust_submicron = iaer |
---|
307 | aer_count = aer_count + 1 |
---|
308 | endif |
---|
309 | enddo |
---|
310 | endif |
---|
311 | if (water.AND.activice) then |
---|
312 | do iaer=1,naerkind |
---|
313 | if (name_iaer(iaer).eq."h2o_ice") then |
---|
314 | iaer_h2o_ice = iaer |
---|
315 | aer_count = aer_count + 1 |
---|
316 | endif |
---|
317 | enddo |
---|
318 | endif |
---|
319 | |
---|
320 | c Check that we identified all tracers: |
---|
321 | if (aer_count.ne.naerkind) then |
---|
322 | write(*,*) "callradite: found only ",aer_count," scatterers" |
---|
323 | write(*,*) " expected ",naerkind |
---|
324 | write(*,*) "please make sure that the number of" |
---|
325 | write(*,*) "scatterers in dimradmars.h, the names" |
---|
326 | write(*,*) "in callradite.F, and the flags in" |
---|
327 | write(*,*) "callphys.def are all consistent!" |
---|
328 | do iaer=1,naerkind |
---|
329 | write(*,*)' ',iaer,' ',trim(name_iaer(iaer)) |
---|
330 | enddo |
---|
331 | stop |
---|
332 | else |
---|
333 | write(*,*) "callradite: found all scatterers, namely:" |
---|
334 | do iaer=1,naerkind |
---|
335 | write(*,*)' ',iaer,' ',trim(name_iaer(iaer)) |
---|
336 | enddo |
---|
337 | endif |
---|
338 | c ------------------------------------------- |
---|
339 | |
---|
340 | DO ig=1,ngrid |
---|
341 | pview(ig)=1.66 ! cosecant of viewing angle |
---|
342 | ENDDO |
---|
343 | gcp = g/cpp |
---|
344 | |
---|
345 | c Logical tests for radiatively active water-ice clouds: |
---|
346 | IF ( (activice.AND.(.NOT.water)).OR. |
---|
347 | & (activice.AND.(naerkind.LT.2)) ) THEN |
---|
348 | WRITE(*,*) 'If activice is TRUE, water has to be set' |
---|
349 | WRITE(*,*) 'to TRUE, and "naerkind" must be at least' |
---|
350 | WRITE(*,*) 'equal to 2 in dimradmars.h.' |
---|
351 | CALL ABORT |
---|
352 | ELSE IF ( (.NOT.activice).AND.(naerkind.GT.1) ) THEN |
---|
353 | WRITE(*,*) 'naerkind is greater than unity, but' |
---|
354 | WRITE(*,*) 'activice has not been set to .true.' |
---|
355 | WRITE(*,*) 'in callphys.def; this is not logical!' |
---|
356 | CALL ABORT |
---|
357 | ENDIF |
---|
358 | |
---|
359 | c Loading the optical properties in external look-up tables: |
---|
360 | CALL SUAER |
---|
361 | CALL SULW |
---|
362 | |
---|
363 | write(*,*) 'Splitting radiative calculations: ', |
---|
364 | $ ' ngridmx,ngrid,ndomainsz,ndomain', |
---|
365 | $ ngridmx,ngrid,ndomainsz,ndomain |
---|
366 | if (ngridmx .EQ. 1) then |
---|
367 | if (ndomainsz .NE. 1) then |
---|
368 | print* |
---|
369 | print*,'ATTENTION !!!' |
---|
370 | print*,'pour tourner en 1D, ' |
---|
371 | print*,'fixer ndomainsz=1 dans phymars/dimradmars.h' |
---|
372 | print* |
---|
373 | call exit(1) |
---|
374 | endif |
---|
375 | endif |
---|
376 | firstcall=.false. |
---|
377 | END IF |
---|
378 | |
---|
379 | c Computing aerosol optical properties and opacity |
---|
380 | c ------------------------------------------------ |
---|
381 | |
---|
382 | c Updating aerosol size distributions: |
---|
383 | CALL updatereffrad(ngrid,nlayer, |
---|
384 | & rdust,rice,nuice, |
---|
385 | & reffrad,nueffrad, |
---|
386 | & pq) |
---|
387 | |
---|
388 | c Computing 3D scattering parameters: |
---|
389 | CALL aeroptproperties(ngrid,nlayer,reffrad,nueffrad, |
---|
390 | & QVISsQREF3d,omegaVIS3d,gVIS3d, |
---|
391 | & QIRsQREF3d,omegaIR3d,gIR3d, |
---|
392 | & QREFvis3d,QREFir3d, |
---|
393 | & omegaREFvis3d,omegaREFir3d) |
---|
394 | |
---|
395 | c Computing aerosol optical depth in each layer: |
---|
396 | CALL aeropacity(ngrid,nlayer,nq,zday,pplay,pplev,ls, |
---|
397 | & pq,tauscaling,tauref,tau,aerosol,reffrad,nueffrad, |
---|
398 | & QREFvis3d,QREFir3d,omegaREFvis3d,omegaREFir3d) |
---|
399 | |
---|
400 | c Starting loop on sub-domain |
---|
401 | c ---------------------------- |
---|
402 | |
---|
403 | DO jd=1,ndomain |
---|
404 | ig0=(jd-1)*ndomainsz |
---|
405 | if (jd.eq.ndomain) then |
---|
406 | nd=ngridmx-ig0 |
---|
407 | else |
---|
408 | nd=ndomainsz |
---|
409 | endif |
---|
410 | |
---|
411 | c Spliting input variable in sub-domain input variables |
---|
412 | c --------------------------------------------------- |
---|
413 | |
---|
414 | do l=1,nlaylte |
---|
415 | do ig = 1,nd |
---|
416 | do iaer = 1, naerkind |
---|
417 | do ich = 1, nsun |
---|
418 | zQVISsQREF3d(ig,l,ich,iaer) = |
---|
419 | & QVISsQREF3d(ig0+ig,l,ich,iaer) |
---|
420 | zomegaVIS3d(ig,l,ich,iaer) = |
---|
421 | & omegaVIS3d(ig0+ig,l,ich,iaer) |
---|
422 | zgVIS3d(ig,l,ich,iaer) = |
---|
423 | & gVIS3d(ig0+ig,l,ich,iaer) |
---|
424 | enddo |
---|
425 | do ich = 1, nir |
---|
426 | zQIRsQREF3d(ig,l,ich,iaer) = |
---|
427 | & QIRsQREF3d(ig0+ig,l,ich,iaer) |
---|
428 | zomegaIR3d(ig,l,ich,iaer) = |
---|
429 | & omegaIR3d(ig0+ig,l,ich,iaer) |
---|
430 | zgIR3d(ig,l,ich,iaer) = |
---|
431 | & gIR3d(ig0+ig,l,ich,iaer) |
---|
432 | enddo |
---|
433 | enddo |
---|
434 | enddo |
---|
435 | enddo |
---|
436 | |
---|
437 | do l=1,nlaylte+1 |
---|
438 | do ig = 1,nd |
---|
439 | zplev(ig,l) = pplev(ig0+ig,l) |
---|
440 | enddo |
---|
441 | enddo |
---|
442 | |
---|
443 | do l=1,nlaylte |
---|
444 | do ig = 1,nd |
---|
445 | zplay(ig,l) = pplay(ig0+ig,l) |
---|
446 | zt(ig,l) = pt(ig0+ig,l) |
---|
447 | c Thickness of each layer (Pa) : |
---|
448 | zdp(ig,l)= pplev(ig0+ig,l) - pplev(ig0+ig,l+1) |
---|
449 | enddo |
---|
450 | enddo |
---|
451 | |
---|
452 | do n=1,naerkind |
---|
453 | do l=1,nlaylte |
---|
454 | do ig=1,nd |
---|
455 | zaerosol(ig,l,n) = aerosol(ig0+ig,l,n) |
---|
456 | enddo |
---|
457 | enddo |
---|
458 | enddo |
---|
459 | |
---|
460 | do j=1,2 |
---|
461 | do ig = 1,nd |
---|
462 | zalbedo(ig,j) = albedo(ig0+ig,j) |
---|
463 | enddo |
---|
464 | enddo |
---|
465 | |
---|
466 | c Intermediate levels: (computing tlev) |
---|
467 | c --------------------------------------- |
---|
468 | c Extrapolation for the air temperature above the surface |
---|
469 | DO ig=1,nd |
---|
470 | zztlev(ig,1)=zt(ig,1)+ |
---|
471 | s (zplev(ig,1)-zplay(ig,1))* |
---|
472 | s (zt(ig,1)-zt(ig,2))/(zplay(ig,1)-zplay(ig,2)) |
---|
473 | |
---|
474 | zdt0(ig) = tsurf(ig0+ig) - zztlev(ig,1) |
---|
475 | ENDDO |
---|
476 | |
---|
477 | DO l=2,nlaylte |
---|
478 | DO ig=1, nd |
---|
479 | zztlev(ig,l)=0.5*(zt(ig,l-1)+zt(ig,l)) |
---|
480 | ENDDO |
---|
481 | ENDDO |
---|
482 | |
---|
483 | DO ig=1, nd |
---|
484 | zztlev(ig,nlaylte+1)=zt(ig,nlaylte) |
---|
485 | ENDDO |
---|
486 | |
---|
487 | |
---|
488 | c Longwave ("lw") radiative transfer (= thermal infrared) |
---|
489 | c ------------------------------------------------------- |
---|
490 | call lwmain (ig0,icount,nd,nflev |
---|
491 | . ,zdp,zdt0,emis(ig0+1),zplev,zztlev,zt |
---|
492 | . ,zaerosol,zzdtlw |
---|
493 | . ,fluxsurf_lw(ig0+1),fluxtop_lw(ig0+1) |
---|
494 | . ,znetrad |
---|
495 | & ,zQIRsQREF3d,zomegaIR3d,zgIR3d |
---|
496 | & ,co2ice(ig0+1)) |
---|
497 | |
---|
498 | c Shortwave ("sw") radiative transfer (= solar radiation) |
---|
499 | c ------------------------------------------------------- |
---|
500 | c Mars solar constant (W m-2) |
---|
501 | c 1370 W.m-2 is the solar constant at 1 AU. |
---|
502 | cste_mars=1370./(dist_sol*dist_sol) |
---|
503 | |
---|
504 | call swmain ( nd, nflev, |
---|
505 | S cste_mars, zalbedo, |
---|
506 | S mu0(ig0+1), zdp, zplev, zaerosol, fract(ig0+1), |
---|
507 | S zzdtsw, zfluxd_sw, zfluxu_sw, |
---|
508 | & zQVISsQREF3d,zomegaVIS3d,zgVIS3d) |
---|
509 | |
---|
510 | c ------------------------------------------------------------ |
---|
511 | c Un-spliting output variable from sub-domain input variables |
---|
512 | c ------------------------------------------------------------ |
---|
513 | |
---|
514 | do l=1,nlaylte |
---|
515 | do ig = 1,nd |
---|
516 | dtlw(ig0+ig,l) = zzdtlw(ig,l) |
---|
517 | dtsw(ig0+ig,l) = zzdtsw(ig,l) |
---|
518 | enddo |
---|
519 | enddo |
---|
520 | |
---|
521 | do l=1,nlaylte+1 |
---|
522 | do ig = 1,nd |
---|
523 | ptlev(ig0+ig,l) = zztlev(ig,l) |
---|
524 | enddo |
---|
525 | enddo |
---|
526 | |
---|
527 | do ig = 1,nd |
---|
528 | fluxsurf_sw(ig0+ig,1) = zfluxd_sw(ig,1,1) |
---|
529 | fluxsurf_sw(ig0+ig,2) = zfluxd_sw(ig,1,2) |
---|
530 | fluxtop_sw(ig0+ig,1) = zfluxu_sw(ig,nlaylte+1,1) |
---|
531 | fluxtop_sw(ig0+ig,2) = zfluxu_sw(ig,nlaylte+1,2) |
---|
532 | enddo |
---|
533 | |
---|
534 | ENDDO ! (boucle jd=1, ndomain) |
---|
535 | |
---|
536 | c Zero tendencies for any remaining layers between nlaylte and nlayer |
---|
537 | if (nlayer.gt.nlaylte) then |
---|
538 | do l = nlaylte+1, nlayer |
---|
539 | do ig = 1, ngrid |
---|
540 | dtlw(ig, l) = 0. |
---|
541 | dtsw(ig, l) = 0. |
---|
542 | enddo |
---|
543 | enddo |
---|
544 | endif |
---|
545 | |
---|
546 | c Output for debugging if lwrite=T |
---|
547 | c -------------------------------- |
---|
548 | c Write all nlayer layers, even though only nlaylte layers may have |
---|
549 | c non-zero tendencies. |
---|
550 | |
---|
551 | IF(lwrite) THEN |
---|
552 | PRINT*,'Diagnotique for the radiation' |
---|
553 | PRINT*,'albedo, emissiv, mu0,fract,fluxsurf_lw,fluxsurf_sw' |
---|
554 | PRINT*,albedo(igout,1),emis(igout),mu0(igout), |
---|
555 | s fract(igout), fluxsurf_lw(igout), |
---|
556 | $ fluxsurf_sw(igout,1)+fluxsurf_sw(igout,2) |
---|
557 | PRINT*,'Tlay Tlev Play Plev dT/dt SW dT/dt LW (K/s)' |
---|
558 | PRINT*,'daysec',daysec |
---|
559 | DO l=1,nlayer |
---|
560 | PRINT*,pt(igout,l),ptlev(igout,l), |
---|
561 | s pplay(igout,l),pplev(igout,l), |
---|
562 | s dtsw(igout,l),dtlw(igout,l) |
---|
563 | ENDDO |
---|
564 | ENDIF |
---|
565 | |
---|
566 | |
---|
567 | return |
---|
568 | end |
---|