1 | SUBROUTINE nirco2abs(nlon,nlev,nplay,dist_sol,nq,pq, |
---|
2 | $ mu0,fract,pdtnirco2) |
---|
3 | |
---|
4 | use dimphy |
---|
5 | use geometry_mod, only: longitude_deg, latitude_deg |
---|
6 | use chemparam_mod, only: i_co2, i_o |
---|
7 | c use compo_hedin83_mod2 |
---|
8 | |
---|
9 | |
---|
10 | IMPLICIT NONE |
---|
11 | c======================================================================= |
---|
12 | c subject: |
---|
13 | c -------- |
---|
14 | c Computing heating rate due to |
---|
15 | c absorption by CO2 in the near-infrared |
---|
16 | c This version includes NLTE effects |
---|
17 | c |
---|
18 | c (Scheme to be described in Forget et al., JGR, 2003) |
---|
19 | c (old Scheme described in Forget et al., JGR, 1999) |
---|
20 | c |
---|
21 | c This version updated with a new functional fit, |
---|
22 | c see NLTE correction-factor of Lopez-Valverde et al (1998) |
---|
23 | c Stephen Lewis 2000 |
---|
24 | c |
---|
25 | c apr 2019 d.quirino Improving NLTE params, SOIR/SPICAV Temp comparison |
---|
26 | c oct 2014 g.gilli Coupling with photochemical model |
---|
27 | C jan 2014 g.gilli Revision (following martian non-lte param) |
---|
28 | C jun 2013 l.salmi First adaptation to Venus and NIR NLTE param |
---|
29 | c jul 2011 malv+fgg New corrections for NLTE implemented |
---|
30 | c 08/2002 : correction for bug when running with diurnal=F |
---|
31 | c |
---|
32 | c author: Frederic Hourdin 1996 |
---|
33 | c ------ |
---|
34 | c Francois Forget 1999 |
---|
35 | c |
---|
36 | c input: |
---|
37 | c ----- |
---|
38 | c nlon number of gridpoint of horizontal grid |
---|
39 | c nlev Number of layer |
---|
40 | c dist_sol sun-Venus distance (AU) |
---|
41 | c mu0(nlon) |
---|
42 | c fract(nlon) day fraction of the time interval |
---|
43 | c declin latitude of subslar point |
---|
44 | c |
---|
45 | c output: |
---|
46 | c ------- |
---|
47 | c |
---|
48 | c pdtnirco2(nlon,nlev) Heating rate (K/sec) |
---|
49 | c |
---|
50 | c |
---|
51 | c======================================================================= |
---|
52 | c |
---|
53 | c 0. Declarations : |
---|
54 | c ------------------ |
---|
55 | c |
---|
56 | |
---|
57 | #include "YOMCST.h" |
---|
58 | #include "clesphys.h" |
---|
59 | c#include "comdiurn.h" |
---|
60 | #include "nirdata.h" |
---|
61 | c#include "tracer.h" |
---|
62 | #include "mmol.h" |
---|
63 | c----------------------------------------------------------------------- |
---|
64 | c Input/Output |
---|
65 | c ------------ |
---|
66 | integer,intent(in) :: nlon ! number of (horizontal) grid points |
---|
67 | integer,intent(in) :: nlev ! number of atmospheric layers |
---|
68 | |
---|
69 | real,intent(in) :: nplay(nlon,nlev) ! Pressure |
---|
70 | real,intent(in) :: dist_sol ! Sun-Venus distance (in AU) |
---|
71 | integer,intent(in) :: nq ! number of tracers |
---|
72 | real,intent(in) :: pq(nlon,nlev,nq) ! mass mixing ratio tracers |
---|
73 | real,intent(in) :: mu0(nlon) ! solar angle |
---|
74 | real,intent(in) :: fract(nlon) ! day fraction of the time interval |
---|
75 | c real,intent(in) :: declin ! latitude of sub-solar point |
---|
76 | real :: co2vmr_gcm(nlon,nlev), o3pvmr_gcm(nlon,nlev) |
---|
77 | |
---|
78 | real,intent(out) :: pdtnirco2(nlon,nlev) ! heating rate (K/sec) |
---|
79 | |
---|
80 | c |
---|
81 | c Local variables : |
---|
82 | c ----------------- |
---|
83 | INTEGER l,ig, n, nstep,i |
---|
84 | REAL co2heat0, zmu(nlon) |
---|
85 | |
---|
86 | c special diurnal=F |
---|
87 | real mu0_int(nlon),fract_int(nlon),zday_int |
---|
88 | real ztim1,ztim2,ztim3,step |
---|
89 | |
---|
90 | c |
---|
91 | c local saved variables |
---|
92 | c --------------------- |
---|
93 | logical,save :: firstcall=.true. |
---|
94 | integer,save :: ico2=0 ! index of "co2" tracer |
---|
95 | integer,save :: io=0 ! index of "o" tracer |
---|
96 | |
---|
97 | cccc parameters for CO2 heating fit |
---|
98 | c |
---|
99 | c n_a = heating rate for Venusian day at p0, r0, mu =0 [K day-1] |
---|
100 | c Here p0 = p_cloud top [Pa] |
---|
101 | c n_p0 = is a pressure below which non LTE effects are significant [Pa] |
---|
102 | c n_a Solar heating [K/Eday] at the cloud top, taken from Crisps table |
---|
103 | |
---|
104 | real n_a, n_p0, n_b, p_ctop |
---|
105 | |
---|
106 | |
---|
107 | cc "Nominal" values used in Gilli+2'17 |
---|
108 | c parameter (n_a = 18.13/86400.0) !c K/Eday ---> K/sec |
---|
109 | c parameter (p_ctop=13.2e2) |
---|
110 | c parameter (n_p0=0.008) |
---|
111 | |
---|
112 | cc "New" values used to improve SPICAV/SOIR Temperature comparision (D.Quirino) |
---|
113 | parameter (n_a = 15.92/86400.0) !c K/Eday ---> K/sec |
---|
114 | parameter (p_ctop=19.85e2) |
---|
115 | parameter (n_p0=0.1) |
---|
116 | parameter (n_b=1.362) |
---|
117 | |
---|
118 | c -- NLTE Param v2 -- |
---|
119 | C parameter (n_p0=0.01) |
---|
120 | c parameter (n_b = 1.3) |
---|
121 | |
---|
122 | |
---|
123 | c Variables added to implement NLTE correction factor (feb 2011) |
---|
124 | real pyy(nlev) |
---|
125 | real cor1(nlev),oldoco2(nlev),alfa2(nlev) |
---|
126 | real p2011,cociente1,merge |
---|
127 | real cor0,oco2gcm |
---|
128 | !!!! |
---|
129 | c real :: pic27(nlon,nlev), pic27b(nlon,nlev) |
---|
130 | c real :: pic43(nlon,nlev), picnir(nlon,nlev) |
---|
131 | |
---|
132 | c co2heat is the heating by CO2 at p_ctop=13.2e2 for a zero zenithal angle. |
---|
133 | |
---|
134 | co2heat0=n_a*(0.72/dist_sol)**2 |
---|
135 | |
---|
136 | CCCCCC TEST: reduce by X% nir Heating |
---|
137 | c co2heat0 = co2heat0 * 0.8 |
---|
138 | |
---|
139 | c---------------------------------------------------------------------- |
---|
140 | |
---|
141 | c Initialisation |
---|
142 | c -------------- |
---|
143 | if (firstcall) then |
---|
144 | if (nircorr.eq.1) then |
---|
145 | c ! we will need co2 and o tracers |
---|
146 | ico2= i_co2 |
---|
147 | if (ico2==0) then |
---|
148 | write(*,*) "nirco2abs error: I need a CO2 tracer" |
---|
149 | write(*,*) " when running with nircorr==1" |
---|
150 | stop |
---|
151 | endif |
---|
152 | io=i_o |
---|
153 | if (io==0) then |
---|
154 | write(*,*) "nirco2abs error: I need an O tracer" |
---|
155 | write(*,*) " when running with nircorr==1" |
---|
156 | stop |
---|
157 | endif |
---|
158 | endif |
---|
159 | firstcall=.false. |
---|
160 | endif |
---|
161 | |
---|
162 | |
---|
163 | c |
---|
164 | c Simple calcul for a given sun incident angle (if cycle_diurne=T) |
---|
165 | c -------------------------------------------- |
---|
166 | |
---|
167 | IF (cycle_diurne) THEN |
---|
168 | |
---|
169 | do ig=1,nlon |
---|
170 | zmu(ig)=sqrt(1224.*mu0(ig)*mu0(ig)+1.)/35. |
---|
171 | |
---|
172 | |
---|
173 | if(nircorr.eq.1) then |
---|
174 | do l=1,nlev |
---|
175 | pyy(l)=nplay(ig,l) |
---|
176 | enddo |
---|
177 | |
---|
178 | call interpnir(cor1,pyy,nlev,corgcm,pres1d,npres) |
---|
179 | call interpnir(oldoco2,pyy,nlev,oco21d,pres1d,npres) |
---|
180 | call interpnir(alfa2,pyy,nlev,alfa,pres1d,npres) |
---|
181 | |
---|
182 | endif |
---|
183 | |
---|
184 | do l=1,nlev |
---|
185 | |
---|
186 | c Calculations for the O/CO2 correction |
---|
187 | if(nircorr.eq.1) then |
---|
188 | cor0=1./(1.+n_p0/nplay(ig,l))**n_b |
---|
189 | if(pq(ig,l,ico2) .gt. 1.e-6) then |
---|
190 | oco2gcm=pq(ig,l,io)/pq(ig,l,ico2) |
---|
191 | |
---|
192 | else |
---|
193 | oco2gcm=1.e6 |
---|
194 | endif |
---|
195 | cociente1=oco2gcm/oldoco2(l) |
---|
196 | |
---|
197 | c WRITE(*,*) "nirco2abs line 211", l, cociente1 |
---|
198 | |
---|
199 | merge=alog10(cociente1)*alfa2(l)+alog10(cor0)* |
---|
200 | $ (1.-alfa2(l)) |
---|
201 | merge=10**merge |
---|
202 | p2011=sqrt(merge)*cor0 |
---|
203 | |
---|
204 | else if (nircorr.eq.0) then |
---|
205 | p2011=1. |
---|
206 | cor1(l)=1. |
---|
207 | endif |
---|
208 | |
---|
209 | if(fract(ig).gt.0.) pdtnirco2(ig,l)= |
---|
210 | & co2heat0*sqrt((p_ctop*zmu(ig))/nplay(ig,l)) |
---|
211 | & /(1.+n_p0/nplay(ig,l))**n_b |
---|
212 | c Corrections from tabulation |
---|
213 | $ * cor1(l) * p2011 |
---|
214 | |
---|
215 | enddo |
---|
216 | enddo |
---|
217 | |
---|
218 | c Averaging over diurnal cycle (if diurnal=F) |
---|
219 | c ------------------------------------------- |
---|
220 | c NIR CO2 abs is slightly non linear. To remove the diurnal |
---|
221 | c cycle, it is better to average the heating rate over 1 day rather |
---|
222 | c than using the mean mu0 computed by mucorr in physiq.F (FF, 1998) |
---|
223 | |
---|
224 | ELSE ! if (.not.diurnal) then |
---|
225 | nstep = 20 ! number of integration step /sol |
---|
226 | do n=1,nstep |
---|
227 | |
---|
228 | zday_int = (n-1)/float(nstep) |
---|
229 | |
---|
230 | CALL zenang(0.,zday_int,RDAY/nstep, |
---|
231 | & latitude_deg,longitude_deg, |
---|
232 | & mu0_int,fract_int) |
---|
233 | |
---|
234 | do ig=1,nlon |
---|
235 | zmu(ig)=sqrt(1224.*mu0_int(ig)*mu0_int(ig)+1.)/35. |
---|
236 | |
---|
237 | if(nircorr.eq.1) then |
---|
238 | do l=1,nlev |
---|
239 | pyy(l)=nplay(ig,l) |
---|
240 | enddo |
---|
241 | call interpnir(cor1,pyy,nlev,corgcm,pres1d,npres) |
---|
242 | call interpnir(oldoco2,pyy,nlev,oco21d,pres1d,npres) |
---|
243 | call interpnir(alfa2,pyy,nlev,alfa,pres1d,npres) |
---|
244 | endif |
---|
245 | c |
---|
246 | |
---|
247 | do l=1,nlev |
---|
248 | c Calculations for the O/CO2 correction |
---|
249 | if(nircorr.eq.1) then |
---|
250 | cor0=1./(1.+n_p0/nplay(ig,l))**n_b |
---|
251 | oco2gcm=pq(ig,l,io)/pq(ig,l,ico2) |
---|
252 | cociente1=oco2gcm/oldoco2(l) |
---|
253 | merge=alog10(cociente1)*alfa2(l)+alog10(cor0)* |
---|
254 | $ (1.-alfa2(l)) |
---|
255 | merge=10**merge |
---|
256 | p2011=sqrt(merge)*cor0 |
---|
257 | |
---|
258 | else if (nircorr.eq.0) then |
---|
259 | p2011=1. |
---|
260 | cor1(l)=1. |
---|
261 | endif |
---|
262 | |
---|
263 | if(fract_int(ig).gt.0.) pdtnirco2(ig,l)= |
---|
264 | & pdtnirco2(ig,l) + (1/float(nstep))* |
---|
265 | & co2heat0*sqrt((p_ctop*zmu(ig))/nplay(ig,l)) |
---|
266 | & /(1.+n_p0/nplay(ig,l))**n_b |
---|
267 | ! Corrections from tabulation |
---|
268 | $ * cor1(l) * p2011 |
---|
269 | |
---|
270 | enddo |
---|
271 | enddo |
---|
272 | end do |
---|
273 | |
---|
274 | |
---|
275 | END IF |
---|
276 | |
---|
277 | return |
---|
278 | end |
---|
279 | |
---|
280 | |
---|
281 | subroutine interpnir(escout,p,nlev,escin,pin,nl) |
---|
282 | C |
---|
283 | C subroutine to perform linear interpolation in pressure from 1D profile |
---|
284 | C escin(nl) sampled on pressure grid pin(nl) to profile |
---|
285 | C escout(nlev) on pressure grid p(nlev). |
---|
286 | C |
---|
287 | real escout(nlev),p(nlev) |
---|
288 | real escin(nl),pin(nl),wm,wp |
---|
289 | integer nl,nlev,n1,n,nm,np |
---|
290 | do n1=1,nlev |
---|
291 | if(p(n1) .gt. 1500. .or. p(n1) .lt. 1.0e-13) then |
---|
292 | c escout(n1) = 0.0 |
---|
293 | escout(n1) = 1.e-15 |
---|
294 | else |
---|
295 | do n = 1,nl-1 |
---|
296 | if (p(n1).le.pin(n).and.p(n1).ge.pin(n+1)) then |
---|
297 | nm=n |
---|
298 | np=n+1 |
---|
299 | wm=abs(pin(np)-p(n1))/(pin(nm)-pin(np)) |
---|
300 | wp=1.0 - wm |
---|
301 | endif |
---|
302 | enddo |
---|
303 | escout(n1) = escin(nm)*wm + escin(np)*wp |
---|
304 | endif |
---|
305 | enddo |
---|
306 | return |
---|
307 | end |
---|