Changeset 370
- Timestamp:
- Nov 9, 2011, 10:35:32 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/README
r358 r370 1224 1224 is computed from the dust_mass one, and its tendancy before scavenging 1225 1225 must be taken into account to compute its scavenging's tendancy. 1226 1227 == 09/11/11 == AS 1228 1229 Added a more recent version of concentrations.F by FL -
trunk/LMDZ.MARS/libf/aeronomars/concentrations.F
r38 r370 1 1 SUBROUTINE concentrations(pplay,pt,pdt,pq,pdq,ptimestep) 2 2 3 IMPLICIT NONE 3 implicit none 4 5 c======================================================================= 6 c CALCULATION OF MEAN MOLECULAR MASS, Cp, Akk and R 7 c 8 c mmean(ngridmx,nlayermx) amu 9 c cpnew(ngridmx,nlayermx) J/kg/K 10 c rnew(ngridmx,nlayermx) J/kg/K 11 c akknew(ngridmx,nlayermx) coefficient of thermal concduction 12 c 13 c version: March 2011 - Franck Lefevre 4 14 c======================================================================= 5 15 6 c CALCULATION OF MEAN MOLECULAR MASS, Cp, Akk and R 7 c 8 c mmean(ngridmx,nlayermx) amu 9 c cpnew(ngridmx,nlayermx) J/kg/K 10 c rnew(ngridmx,nlayermx) J/kg/K 11 c akknew(ngridmx,nlayermx) coefficient of thermal concduction 12 c 13 c======================================================================= 14 c 0. Declarations : 15 c ------------------ 16 c 16 c Declarations 17 c ------------ 18 17 19 #include "dimensions.h" 18 20 #include "dimphys.h" … … 24 26 #include "conc.h" 25 27 26 c-----------------------------------------------------------------------27 28 c Input/Output 28 29 c ------------ 29 30 30 REALpplay(ngridmx,nlayermx)31 REALpt(ngridmx,nlayermx)32 REALpdt(ngridmx,nlayermx)31 real pplay(ngridmx,nlayermx) 32 real pt(ngridmx,nlayermx) 33 real pdt(ngridmx,nlayermx) 33 34 real pq(ngridmx,nlayermx,nqmx) 34 REALpdq(ngridmx,nlayermx,nqmx)35 REALptimestep35 real pdq(ngridmx,nlayermx,nqmx) 36 real ptimestep 36 37 37 c Local variables : 38 c ----------------- 39 INTEGER,SAVE :: ngrid,nlayer,nq 40 INTEGER iq,l,ig,ll,n,k 41 integer,save :: gind(ncomptot) 42 real ni(ncomptot) 43 real nt, ntot 44 real q2(ngridmx,nlayermx,ncomptot) 45 real zt(ngridmx,nlayermx) 46 real q2tot(ngridmx,nlayermx) 47 real,save :: aki(ncomptot) 48 real,save :: cpi(ncomptot) 38 c Local variables 39 c --------------- 49 40 50 logical,save :: firstcall=.true. 41 integer :: l, ig, n, k 42 integer, save :: gind(ncomp) 43 real :: ni(nqmx), ntot 44 real :: zq(ngridmx,nlayermx,ncomp) 45 real :: zt(ngridmx,nlayermx) 46 real, save :: aki(ncomp) 47 real, save :: cpi(ncomp) 48 49 logical, save :: firstcall = .true. 50 51 51 cccccccccccccccccccccccccccccccccccccccccccccccccccccccc 52 52 c tracer numbering for the thermal conduction and 53 53 c specific heat coefficients 54 54 cccccccccccccccccccccccccccccccccccccccccccccccccccccccc 55 c 55 56 56 integer,parameter :: i_co2 = 1 57 57 integer,parameter :: i_co = 2 … … 65 65 integer,parameter :: i_ho2 = 10 66 66 integer,parameter :: i_h2o2 = 11 67 integer,parameter :: i_n2 = 12 68 integer,parameter :: i_ar = 13 69 integer,parameter :: i_h2o = 14 67 integer,parameter :: i_ch4 = 12 68 integer,parameter :: i_n2 = 13 69 integer,parameter :: i_ar = 14 70 integer,parameter :: i_h2o = 15 70 71 71 ! Tracer indexes in the GCM:72 integer,save :: g_co2=073 integer,save :: g_co=074 integer,save :: g_o=075 integer,save :: g_o1d=076 integer,save :: g_o2=077 integer,save :: g_o3=078 integer,save :: g_h=079 integer,save :: g_h2=080 integer,save :: g_oh=081 integer,save :: g_ho2=082 integer,save :: g_h2o2=083 integer,save :: g_n2=084 integer,save :: g_ar=085 integer,save :: g_h2o_vap=086 87 ! Initializations at first call88 72 if (firstcall) then 89 ! identify the indexes of the tracers we'll need90 g_co2=igcm_co291 if (g_co2.eq.0) then92 write(*,*) "concentrations: Error; no CO2 tracer !!!"93 stop94 endif95 g_co=igcm_co96 if (g_co.eq.0) then97 write(*,*) "concentrations: Error; no CO tracer !!!"98 stop99 endif100 g_o=igcm_o101 if (g_o.eq.0) then102 write(*,*) "concentrations: Error; no O tracer !!!"103 stop104 endif105 g_o1d=igcm_o1d106 if (g_o1d.eq.0) then107 write(*,*) "concentrations: Error; no O1D tracer !!!"108 stop109 endif110 g_o2=igcm_o2111 if (g_o2.eq.0) then112 write(*,*) "concentrations: Error; no O2 tracer !!!"113 stop114 endif115 g_o3=igcm_o3116 if (g_o3.eq.0) then117 write(*,*) "concentrations: Error; no O3 tracer !!!"118 stop119 endif120 g_h=igcm_h121 if (g_h.eq.0) then122 write(*,*) "concentrations: Error; no H tracer !!!"123 stop124 endif125 g_h2=igcm_h2126 if (g_h2.eq.0) then127 write(*,*) "concentrations: Error; no H2 tracer !!!"128 stop129 endif130 g_oh=igcm_oh131 if (g_oh.eq.0) then132 write(*,*) "concentrations: Error; no OH tracer !!!"133 stop134 endif135 g_ho2=igcm_ho2136 if (g_ho2.eq.0) then137 write(*,*) "concentrations: Error; no HO2 tracer !!!"138 stop139 endif140 g_h2o2=igcm_h2o2141 if (g_h2o2.eq.0) then142 write(*,*) "concentrations: Error; no H2O2 tracer !!!"143 stop144 endif145 g_n2=igcm_n2146 if (g_n2.eq.0) then147 write(*,*) "concentrations: Error; no N2 tracer !!!"148 stop149 endif150 g_ar=igcm_ar151 if (g_ar.eq.0) then152 write(*,*) "concentrations: Error; no AR tracer !!!"153 stop154 endif155 g_h2o_vap=igcm_h2o_vap156 if (g_h2o_vap.eq.0) then157 write(*,*) "concentrations: Error; no water vapor tracer !!!"158 stop159 endif160 73 161 74 cccccccccccccccccccccccccccccccccccccccccccccccccccccccc 162 c fill local array of tracer indexes 75 c initializations at first call: 76 c fill local array of tracer indexes 163 77 cccccccccccccccccccccccccccccccccccccccccccccccccccccccc 164 c 165 gind(i_co2) = g_co2 ! co2 166 gind(i_co) = g_co ! co 167 gind(i_o) = g_o ! o 168 gind(i_o1d) = g_o1d ! o1d 169 gind(i_o2) = g_o2 ! o2 170 gind(i_o3) = g_o3 ! o3 171 gind(i_h) = g_h ! h 172 gind(i_h2) = g_h2 ! h2 173 gind(i_oh) = g_oh ! oh 174 gind(i_ho2) = g_ho2 ! ho2 175 gind(i_h2o2) = g_h2o2 ! h2o2 176 gind(i_n2) = g_n2 ! n2 177 gind(i_ar) = g_ar ! ar 178 gind(i_h2o) = g_h2o_vap ! h2o 78 79 gind(i_co2) = igcm_co2 ! co2 80 gind(i_co) = igcm_co ! co 81 gind(i_o) = igcm_o ! o 82 gind(i_o1d) = igcm_o1d ! o1d 83 gind(i_o2) = igcm_o2 ! o2 84 gind(i_o3) = igcm_o3 ! o3 85 gind(i_h) = igcm_h ! h 86 gind(i_h2) = igcm_h2 ! h2 87 gind(i_oh) = igcm_oh ! oh 88 gind(i_ho2) = igcm_ho2 ! ho2 89 gind(i_h2o2) = igcm_h2o2 ! h2o2 90 gind(i_ch4) = igcm_ch4 ! ch4 91 gind(i_n2) = igcm_n2 ! n2 92 gind(i_ar) = igcm_ar ! ar 93 gind(i_h2o) = igcm_h2o_vap ! h2o 179 94 180 95 cccccccccccccccccccccccccccccccccccccccccccccccccccccccc 181 c Thermal conductivity and specific heat coefficients 182 cccccccccccccccccccccccccccccccccccccccccccccccccccccccc 183 c 184 aki(i_co2) = 3.072e-4 185 aki(i_co) = 4.87e-4 186 aki(i_o) = 7.59e-4 187 aki(i_o1d) = 7.59e-4 !? 188 aki(i_o2) = 5.68e-4 189 aki(i_o3) = 3.00e-4 !? 190 aki(i_h) = 0.0 191 aki(i_h2) = 36.314e-4 192 aki(i_oh) = 7.00e-4 !? 193 aki(i_ho2) = 0.0 194 aki(i_h2o2) = 0.0 195 aki(i_n2) = 5.6e-4 196 aki(i_ar) = 0.0 !? 197 aki(i_h2o) = 0.0 198 199 cpi(i_co2) = 0.834e3 200 cpi(i_co) = 1.034e3 201 cpi(i_o) = 1.3e3 202 cpi(i_o1d) = 1.3e3 !? 203 cpi(i_o2) = 0.9194e3 204 cpi(i_o3) = 0.800e3 !? 205 cpi(i_h) = 20.780e3 206 cpi(i_h2) = 14.266e3 207 cpi(i_oh) = 1.045e3 208 cpi(i_ho2) = 1.065e3 !? 209 cpi(i_h2o2) = 1.000e3 !? 210 cpi(i_n2) = 1.034e3 211 cpi(i_ar) = 1.000e3 !? 212 cpi(i_h2o) = 1.870e3 213 c 96 c Thermal conductivity and specific heat coefficients 214 97 cccccccccccccccccccccccccccccccccccccccccccccccccccccccc 215 98 216 nlayer=nlayermx 217 ngrid=ngridmx 218 nq=nqmx 99 aki(i_co2) = 3.072e-4 100 aki(i_co) = 4.87e-4 101 aki(i_o) = 7.59e-4 102 aki(i_o1d) = 7.59e-4 !? 103 aki(i_o2) = 5.68e-4 104 aki(i_o3) = 3.00e-4 !? 105 aki(i_h) = 0.0 106 aki(i_h2) = 36.314e-4 107 aki(i_oh) = 7.00e-4 !? 108 aki(i_ho2) = 0.0 109 aki(i_h2o2) = 0.0 110 aki(i_ch4) = 0.0 !? 111 aki(i_n2) = 5.6e-4 112 aki(i_ar) = 0.0 !? 113 aki(i_h2o) = 0.0 219 114 220 firstcall=.false. 221 endif ! of if (firstcall) 115 cpi(i_co2) = 0.834e3 116 cpi(i_co) = 1.034e3 117 cpi(i_o) = 1.3e3 118 cpi(i_o1d) = 1.3e3 !? 119 cpi(i_o2) = 0.9194e3 120 cpi(i_o3) = 0.800e3 !? 121 cpi(i_h) = 20.780e3 122 cpi(i_h2) = 14.266e3 123 cpi(i_oh) = 1.045e3 124 cpi(i_ho2) = 1.065e3 !? 125 cpi(i_h2o2) = 1.000e3 !? 126 cpi(i_ch4) = 1.000e3 !? 127 cpi(i_n2) = 1.034e3 128 cpi(i_ar) = 1.000e3 !? 129 cpi(i_h2o) = 1.870e3 222 130 223 DO l=1,nlayer 224 DO ig=1,ngrid 225 DO n=1,ncomptot 226 q2(ig,l,n)=max(1.e-30, 227 . pq(ig,l,gind(n))+pdq(ig,l,gind(n))*ptimestep) 228 ENDDO 229 zt(ig,l)=pt(ig,l) +pdt(ig,l)*ptimestep 230 ENDDO 231 ENDDO 232 233 do l=1,nlayermx 234 do ig=1,ngridmx 235 ntot=pplay(ig,l)/(1.381e-23*zt(ig,l))*1.e-6 ! in #/cm3 236 cpnew(ig,l)=0. 237 akknew(ig,l)=0. 238 mmean(ig,l)=0. 239 q2tot(ig,l)=0. 240 nt=0. 241 do n=1,ncomptot 242 ni(n)=0.0 243 do k=1,ncomptot 244 if(k.ne.n) ni(n)=ni(n)+q2(ig,l,k)/mmol(gind(k)) 245 enddo 246 ni(n)=ntot/(1.+mmol(gind(n))/q2(ig,l,n)*ni(n)) 247 cpnew(ig,l)=cpnew(ig,l)+ni(n)*cpi(n) 248 akknew(ig,l)=akknew(ig,l)+ni(n)*aki(n) 249 mmean(ig,l)=mmean(ig,l)+q2(ig,l,n)/mmol(gind(n)) 250 q2tot(ig,l)=q2tot(ig,l)+q2(ig,l,n) 251 c if(ig.eq.1.and.l.eq.1) write(*,*)'q2tot(ig,l)',n,q2tot(ig,l) 252 if(cpi(n) .ne. 0.0) nt=nt+ni(n) 253 enddo 131 firstcall=.false. 254 132 255 c print*,"concentrations rep 3",l,ig,nt,mmean(ig,l),zt(ig+1,l) 133 end if ! of if (firstcall) 134 c 135 c initializations 136 c 137 mmean(:,:) = 0. 138 cpnew(:,:) = 0. 139 akknew(:,:) = 0. 140 c 141 c update temperature 142 c 143 do l = 1,nlayermx 144 do ig = 1,ngridmx 145 zt(ig,l) = pt(ig,l) + pdt(ig,l)*ptimestep 146 end do 147 end do 148 c 149 c update tracers 150 c 151 do l = 1,nlayermx 152 do ig = 1,ngridmx 153 do n = 1,ncomp 154 zq(ig,l,n) = max(1.e-30, pq(ig,l,gind(n)) 155 $ + pdq(ig,l,gind(n))*ptimestep) 156 end do 157 end do 158 end do 159 c 160 c mmean : mean molecular mass 161 c rnew : specific gas constant 162 c 163 do l = 1,nlayermx 164 do ig = 1,ngridmx 165 do n = 1, ncomp 166 mmean(ig,l) = mmean(ig,l) + zq(ig,l,n)/mmol(gind(n)) 167 end do 168 mmean(ig,l) = 1./mmean(ig,l) 169 rnew(ig,l) = 8.314/mmean(ig,l)*1.e3 ! J/kg/K 170 end do 171 end do 172 c 173 c cpnew : specicic heat 174 c akknew : thermal conductivity cofficient 175 c 176 do l = 1,nlayermx 177 do ig = 1,ngridmx 178 ntot = pplay(ig,l)/(1.381e-23*zt(ig,l))*1.e-6 ! in #/cm3 179 do n = 1,ncomp 180 ni(n) = ntot*zq(ig,l,n)*mmean(ig,l)/mmol(gind(n)) 181 cpnew(ig,l) = cpnew(ig,l) + ni(n)*cpi(n) 182 akknew(ig,l) = akknew(ig,l) + ni(n)*aki(n) 183 end do 184 cpnew(ig,l) = cpnew(ig,l)/ntot 185 akknew(ig,l) = akknew(ig,l)/ntot 186 end do 187 c print*, l, mmean(1,l), cpnew(1,l), rnew(1,l) 188 end do 256 189 257 cpnew(ig,l)=cpnew(ig,l)/nt258 akknew(ig,l)=akknew(ig,l)/nt259 mmean(ig,l)=1/mmean(ig,l) ! in amu260 rnew(ig,l)=8.314/mmean(ig,l)*1.e3 ! J/kg/K261 enddo262 c print*,l,mmean(1,l),cpnew(1,l),rnew(1,l)263 c write(228,*),l,pplay(1,l),ntot264 enddo265 190 return 266 191 end -
trunk/LMDZ.MARS/libf/phymars/callradite.F
r358 r370 3 3 $ dtlw,dtsw,fluxsurf_lw,fluxsurf_sw,fluxtop_lw,fluxtop_sw, 4 4 & tauref,tau,aerosol,tauscaling,rdust,rice,nuice,co2ice) 5 & tauref,tau,aerosol,ccn,rdust,rice,nuice,co2ice)6 5 7 6 IMPLICIT NONE
Note: See TracChangeset
for help on using the changeset viewer.