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