1 | SUBROUTINE nirco2abs(ngrid,nlayer,pplay,dist_sol,nq,pq, |
---|
2 | $ mu0,fract,declin,pdtnirco2) |
---|
3 | |
---|
4 | use tracer_mod, only: igcm_co2, igcm_o |
---|
5 | use comgeomfi_h, only: sinlon, coslon, sinlat, coslat |
---|
6 | USE comcstfi_h |
---|
7 | IMPLICIT NONE |
---|
8 | c======================================================================= |
---|
9 | c subject: |
---|
10 | c -------- |
---|
11 | c Computing heating rate due to |
---|
12 | c absorption by CO2 in the near-infrared |
---|
13 | c This version includes NLTE effects |
---|
14 | c |
---|
15 | c (Scheme to be described in Forget et al., JGR, 2003) |
---|
16 | c (old Scheme described in Forget et al., JGR, 1999) |
---|
17 | c |
---|
18 | c This version updated with a new functional fit, |
---|
19 | c see NLTE correction-factor of Lopez-Valverde et al (1998) |
---|
20 | c Stephen Lewis 2000 |
---|
21 | c |
---|
22 | c jul 2011 malv+fgg New corrections for NLTE implemented |
---|
23 | c 08/2002 : correction for bug when running with diurnal=F |
---|
24 | c |
---|
25 | c author: Frederic Hourdin 1996 |
---|
26 | c ------ |
---|
27 | c Francois Forget 1999 |
---|
28 | c |
---|
29 | c input: |
---|
30 | c ----- |
---|
31 | c ngrid number of gridpoint of horizontal grid |
---|
32 | c nlayer Number of layer |
---|
33 | c dist_sol sun-Mars distance (AU) |
---|
34 | c mu0(ngrid) |
---|
35 | c fract(ngrid) day fraction of the time interval |
---|
36 | c declin latitude of subslar point |
---|
37 | c |
---|
38 | c output: |
---|
39 | c ------- |
---|
40 | c |
---|
41 | c pdtnirco2(ngrid,nlayer) Heating rate (K/s) |
---|
42 | c |
---|
43 | c |
---|
44 | c======================================================================= |
---|
45 | c |
---|
46 | c 0. Declarations : |
---|
47 | c ------------------ |
---|
48 | c |
---|
49 | !#include "dimensions.h" |
---|
50 | !#include "dimphys.h" |
---|
51 | #include "callkeys.h" |
---|
52 | !#include "comdiurn.h" |
---|
53 | #include "nirdata.h" |
---|
54 | !#include "tracer.h" |
---|
55 | |
---|
56 | c----------------------------------------------------------------------- |
---|
57 | c Input/Output |
---|
58 | c ------------ |
---|
59 | integer,intent(in) :: ngrid ! number of (horizontal) grid points |
---|
60 | integer,intent(in) :: nlayer ! number of atmospheric layers |
---|
61 | real,intent(in) :: pplay(ngrid,nlayer) ! Pressure |
---|
62 | real,intent(in) :: dist_sol ! Sun-Mars distance (in AU) |
---|
63 | integer,intent(in) :: nq ! number of tracers |
---|
64 | real,intent(in) :: pq(ngrid,nlayer,nq) ! tracers |
---|
65 | real,intent(in) :: mu0(ngrid) ! solar angle |
---|
66 | real,intent(in) :: fract(ngrid) ! day fraction of the time interval |
---|
67 | real,intent(in) :: declin ! latitude of sub-solar point |
---|
68 | |
---|
69 | real,intent(out) :: pdtnirco2(ngrid,nlayer) ! heating rate (K/s) |
---|
70 | c |
---|
71 | c Local variables : |
---|
72 | c ----------------- |
---|
73 | INTEGER l,ig, n, nstep,i |
---|
74 | REAL co2heat0, zmu(ngrid) |
---|
75 | |
---|
76 | c special diurnal=F |
---|
77 | real mu0_int(ngrid),fract_int(ngrid),zday_int |
---|
78 | real ztim1,ztim2,ztim3,step |
---|
79 | |
---|
80 | c |
---|
81 | c local saved variables |
---|
82 | c --------------------- |
---|
83 | logical,save :: firstcall=.true. |
---|
84 | integer,save :: ico2=0 ! index of "co2" tracer |
---|
85 | integer,save :: io=0 ! index of "o" tracer |
---|
86 | c p0noonlte is a pressure below which non LTE effects are significant. |
---|
87 | c REAL p0nonlte |
---|
88 | c DATA p0nonlte/7.5e-3/ |
---|
89 | c SAVE p0nonlte |
---|
90 | |
---|
91 | c parameters for CO2 heating fit |
---|
92 | real n_a, n_p0, n_b |
---|
93 | parameter (n_a=1.1956475) |
---|
94 | parameter (n_b=1.9628251) |
---|
95 | parameter (n_p0=0.0015888279) |
---|
96 | |
---|
97 | c Variables added to implement NLTE correction factor (feb 2011) |
---|
98 | real pyy(nlayer) |
---|
99 | real cor1(nlayer),oldoco2(nlayer),alfa2(nlayer) |
---|
100 | real p2011,cociente1,merge |
---|
101 | real cor0,oco2gcm |
---|
102 | |
---|
103 | c---------------------------------------------------------------------- |
---|
104 | |
---|
105 | c Initialisation |
---|
106 | c -------------- |
---|
107 | if (firstcall) then |
---|
108 | if (nircorr.eq.1) then |
---|
109 | ! we will need co2 and o tracers |
---|
110 | ico2=igcm_co2 |
---|
111 | if (ico2==0) then |
---|
112 | write(*,*) "nirco2abs error: I need a CO2 tracer" |
---|
113 | write(*,*) " when running with nircorr==1" |
---|
114 | stop |
---|
115 | endif |
---|
116 | io=igcm_o |
---|
117 | if (io==0) then |
---|
118 | write(*,*) "nirco2abs error: I need an O tracer" |
---|
119 | write(*,*) " when running with nircorr==1" |
---|
120 | stop |
---|
121 | endif |
---|
122 | endif |
---|
123 | firstcall=.false. |
---|
124 | endif |
---|
125 | |
---|
126 | |
---|
127 | c co2heat is the heating by CO2 at 700Pa for a zero zenithal angle. |
---|
128 | co2heat0=n_a*(1.52/dist_sol)**2/daysec |
---|
129 | |
---|
130 | c Simple calcul for a given sun incident angle (if diurnal=T) |
---|
131 | c -------------------------------------------- |
---|
132 | |
---|
133 | IF (diurnal) THEN |
---|
134 | do ig=1,ngrid |
---|
135 | zmu(ig)=sqrt(1224.*mu0(ig)*mu0(ig)+1.)/35. |
---|
136 | |
---|
137 | if(nircorr.eq.1) then |
---|
138 | do l=1,nlayer |
---|
139 | pyy(l)=pplay(ig,l) |
---|
140 | enddo |
---|
141 | |
---|
142 | call interpnir(cor1,pyy,nlayer,corgcm,pres1d,npres) |
---|
143 | call interpnir(oldoco2,pyy,nlayer,oco21d,pres1d,npres) |
---|
144 | call interpnir(alfa2,pyy,nlayer,alfa,pres1d,npres) |
---|
145 | endif |
---|
146 | |
---|
147 | do l=1,nlayer |
---|
148 | ! Calculations for the O/CO2 correction |
---|
149 | if(nircorr.eq.1) then |
---|
150 | cor0=1./(1.+n_p0/pplay(ig,l))**n_b |
---|
151 | if(pq(ig,l,ico2).gt.1.e-6) then |
---|
152 | oco2gcm=pq(ig,l,io)/pq(ig,l,ico2) |
---|
153 | else |
---|
154 | oco2gcm=1.e6 |
---|
155 | endif |
---|
156 | cociente1=oco2gcm/oldoco2(l) |
---|
157 | merge=alog10(cociente1)*alfa2(l)+alog10(cor0)* |
---|
158 | $ (1.-alfa2(l)) |
---|
159 | merge=10**merge |
---|
160 | p2011=sqrt(merge)*cor0 |
---|
161 | else if (nircorr.eq.0) then |
---|
162 | p2011=1. |
---|
163 | cor1(l)=1. |
---|
164 | endif |
---|
165 | |
---|
166 | if(fract(ig).gt.0.) pdtnirco2(ig,l)= |
---|
167 | & co2heat0*sqrt((700.*zmu(ig))/pplay(ig,l)) |
---|
168 | & /(1.+n_p0/pplay(ig,l))**n_b |
---|
169 | ! Corrections from tabulation |
---|
170 | $ * cor1(l) * p2011 |
---|
171 | c OLD SCHEME (forget et al. 1999) |
---|
172 | c s co2heat0*sqrt((700.*zmu(ig))/pplay(ig,l)) |
---|
173 | c s / (1+p0nonlte/pplay(ig,l)) |
---|
174 | enddo |
---|
175 | enddo |
---|
176 | |
---|
177 | |
---|
178 | c Averaging over diurnal cycle (if diurnal=F) |
---|
179 | c ------------------------------------------- |
---|
180 | c NIR CO2 abs is slightly non linear. To remove the diurnal |
---|
181 | c cycle, it is better to average the heating rate over 1 day rather |
---|
182 | c than using the mean mu0 computed by mucorr in physiq.F (FF, 1998) |
---|
183 | |
---|
184 | ELSE ! if (.not.diurnal) then |
---|
185 | |
---|
186 | nstep = 20 ! number of integration step /sol |
---|
187 | do n=1,nstep |
---|
188 | zday_int = (n-1)/float(nstep) |
---|
189 | ztim2=COS(declin)*COS(2.*pi*(zday_int-.5)) |
---|
190 | ztim3=-COS(declin)*SIN(2.*pi*(zday_int-.5)) |
---|
191 | CALL solang(ngrid,sinlon,coslon,sinlat,coslat, |
---|
192 | s ztim1,ztim2,ztim3, |
---|
193 | s mu0_int,fract_int) |
---|
194 | do ig=1,ngrid |
---|
195 | zmu(ig)=sqrt(1224.*mu0_int(ig)*mu0_int(ig)+1.)/35. |
---|
196 | |
---|
197 | if(nircorr.eq.1) then |
---|
198 | do l=1,nlayer |
---|
199 | pyy(l)=pplay(ig,l) |
---|
200 | enddo |
---|
201 | call interpnir(cor1,pyy,nlayer,corgcm,pres1d,npres) |
---|
202 | call interpnir(oldoco2,pyy,nlayer,oco21d,pres1d,npres) |
---|
203 | call interpnir(alfa2,pyy,nlayer,alfa,pres1d,npres) |
---|
204 | endif |
---|
205 | |
---|
206 | do l=1,nlayer |
---|
207 | if(nircorr.eq.1) then |
---|
208 | cor0=1./(1.+n_p0/pplay(ig,l))**n_b |
---|
209 | oco2gcm=pq(ig,l,io)/pq(ig,l,ico2) |
---|
210 | cociente1=oco2gcm/oldoco2(l) |
---|
211 | merge=alog10(cociente1)*alfa2(l)+alog10(cor0)* |
---|
212 | $ (1.-alfa2(l)) |
---|
213 | merge=10**merge |
---|
214 | p2011=sqrt(merge)*cor0 |
---|
215 | else if (nircorr.eq.0) then |
---|
216 | p2011=1. |
---|
217 | cor1(l)=1. |
---|
218 | endif |
---|
219 | |
---|
220 | if(fract_int(ig).gt.0.) pdtnirco2(ig,l)= |
---|
221 | & pdtnirco2(ig,l) + (1/float(nstep))* |
---|
222 | & co2heat0*sqrt((700.*zmu(ig))/pplay(ig,l)) |
---|
223 | & /(1.+n_p0/pplay(ig,l))**n_b |
---|
224 | ! Corrections from tabulation |
---|
225 | $ * cor1(l) * p2011 |
---|
226 | enddo |
---|
227 | enddo |
---|
228 | end do |
---|
229 | END IF |
---|
230 | |
---|
231 | return |
---|
232 | end |
---|
233 | |
---|
234 | |
---|
235 | |
---|
236 | subroutine interpnir(escout,p,nlayer,escin,pin,nl) |
---|
237 | C |
---|
238 | C subroutine to perform linear interpolation in pressure from 1D profile |
---|
239 | C escin(nl) sampled on pressure grid pin(nl) to profile |
---|
240 | C escout(nlayer) on pressure grid p(nlayer). |
---|
241 | C |
---|
242 | real escout(nlayer),p(nlayer) |
---|
243 | real escin(nl),pin(nl),wm,wp |
---|
244 | integer nl,nlayer,n1,n,nm,np |
---|
245 | do n1=1,nlayer |
---|
246 | if(p(n1) .gt. 1500. .or. p(n1) .lt. 1.0e-13) then |
---|
247 | escout(n1) = 0.0 |
---|
248 | else |
---|
249 | do n = 1,nl-1 |
---|
250 | if (p(n1).le.pin(n).and.p(n1).ge.pin(n+1)) then |
---|
251 | nm=n |
---|
252 | np=n+1 |
---|
253 | wm=abs(pin(np)-p(n1))/(pin(nm)-pin(np)) |
---|
254 | wp=1.0 - wm |
---|
255 | endif |
---|
256 | enddo |
---|
257 | escout(n1) = escin(nm)*wm + escin(np)*wp |
---|
258 | endif |
---|
259 | enddo |
---|
260 | return |
---|
261 | end |
---|