Changeset 414 for trunk/LMDZ.MARS/libf/aeronomars
- Timestamp:
- Nov 23, 2011, 10:14:21 AM (13 years ago)
- Location:
- trunk/LMDZ.MARS/libf/aeronomars
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/libf/aeronomars/moldiff.F
r38 r414 32 32 c Local 33 33 c 34 real hco2(ncomptot),ho 34 35 integer,parameter :: ncompmoldiff = 14 36 real hco2(ncompmoldiff),ho 35 37 36 38 integer ig,nz,l,n,nn,iq … … 39 41 real hp(nlayermx) 40 42 real tt(nlayermx) 41 real qq(nlayermx,ncomp tot)43 real qq(nlayermx,ncompmoldiff) 42 44 real dmmeandz(nlayermx) 43 real qnew(nlayermx,ncomp tot)45 real qnew(nlayermx,ncompmoldiff) 44 46 real zlocal(nlayermx) 45 real alf(ncomp tot-1,ncomptot-1)46 real alfinv(nlayermx,ncomp tot-1,ncomptot-1)47 real indx(ncomp tot-1)48 real b(nlayermx,ncomp tot-1)49 real y(ncomp tot-1,ncomptot-1)50 real aa(nlayermx,ncomp tot-1,ncomptot-1)51 real bb(nlayermx,ncomp tot-1,ncomptot-1)52 real cc(nlayermx,ncomp tot-1,ncomptot-1)47 real alf(ncompmoldiff-1,ncompmoldiff-1) 48 real alfinv(nlayermx,ncompmoldiff-1,ncompmoldiff-1) 49 real indx(ncompmoldiff-1) 50 real b(nlayermx,ncompmoldiff-1) 51 real y(ncompmoldiff-1,ncompmoldiff-1) 52 real aa(nlayermx,ncompmoldiff-1,ncompmoldiff-1) 53 real bb(nlayermx,ncompmoldiff-1,ncompmoldiff-1) 54 real cc(nlayermx,ncompmoldiff-1,ncompmoldiff-1) 53 55 real atri(nlayermx-2) 54 56 real btri(nlayermx-2) … … 56 58 real rtri(nlayermx-2) 57 59 real qtri(nlayermx-2) 58 real alfdiag(ncomp tot-1)59 real wi(ncomp tot), flux(ncomptot), pote60 real alfdiag(ncompmoldiff-1) 61 real wi(ncompmoldiff), flux(ncompmoldiff), pote 60 62 61 63 cccccccccccccccccccccccccccccccccccccccccccccccccccccccc … … 95 97 integer,save :: g_h2o=0 96 98 97 integer,save :: gcmind(ncomp tot) ! array of GCM indexes99 integer,save :: gcmind(ncompmoldiff) ! array of GCM indexes 98 100 integer ierr 99 101 100 102 logical,save :: firstcall=.true. 101 real abfac(ncomp tot)102 real,save :: dij(ncomp tot,ncomptot)103 real abfac(ncompmoldiff) 104 real,save :: dij(ncompmoldiff,ncompmoldiff) 103 105 104 106 ! Initializations at first call … … 215 217 & +pdtconduc(ig,l)*ptimestep 216 218 217 do nn=1,ncomp tot219 do nn=1,ncompmoldiff 218 220 qq(l,nn)=pq(ig,l,gcmind(nn))+pdq(ig,l,gcmind(nn))*ptimestep 219 221 qq(l,nn)=max(qq(l,nn),1.e-30) … … 230 232 & +pdtconduc(ig,nz)*ptimestep 231 233 232 do nn=1,ncomp tot234 do nn=1,ncompmoldiff 233 235 qq(1,nn)=pq(ig,1,gcmind(nn))+pdq(ig,1,gcmind(nn))*ptimestep 234 236 qq(nz,nn)=pq(ig,nz,gcmind(nn))+pdq(ig,nz,gcmind(nn))*ptimestep … … 251 253 ntot=pplay(ig,l)/(1.381e-23*tt(l)) ! in #/m3 252 254 253 do nn=1,ncomp tot-1 ! rows255 do nn=1,ncompmoldiff-1 ! rows 254 256 alfdiag(nn)=0. 255 257 dcoef1=dij(nn,i_o)*ptfac 256 do n=1,ncomp tot-1 ! columns258 do n=1,ncompmoldiff-1 ! columns 257 259 y(nn,n)=0. 258 260 dcoef=dij(nn,n)*ptfac … … 277 279 c Inverting the alfa matrix 278 280 c 279 call ludcmp(alf,ncomp tot-1,ncomptot-1,indx,d,ierr)281 call ludcmp(alf,ncompmoldiff-1,ncompmoldiff-1,indx,d,ierr) 280 282 281 283 c TEMPORAIRE ***************************** … … 291 293 end if 292 294 c ******************************************* 293 do n=1,ncomp tot-1294 call lubksb(alf,ncomp tot-1,ncomptot-1,indx,y(1,n))295 do nn=1,ncomp tot-1295 do n=1,ncompmoldiff-1 296 call lubksb(alf,ncompmoldiff-1,ncompmoldiff-1,indx,y(1,n)) 297 do nn=1,ncompmoldiff-1 296 298 alfinv(l,nn,n)=y(nn,n)/hh 297 299 enddo … … 309 311 del1=hp(l)*pplay(ig,l)/(g*ptimestep) 310 312 del2=(hp(l)/2)**2*pplay(ig,l)/(g*ptimestep) 311 do nn=1,ncomp tot-1312 do n=1,ncomp tot-1313 do nn=1,ncompmoldiff-1 314 do n=1,ncompmoldiff-1 313 315 dalfinvdz=(alfinv(l+1,nn,n)-alfinv(l-1,nn,n))/hp(l) 314 316 aa(l,nn,n)=-dalfinvdz/del1+alfinv(l,nn,n)/del2 … … 336 338 c (Hunten 1973, eq. 5) 337 339 338 do n=1,ncomp tot340 do n=1,ncompmoldiff 339 341 wi(n)=1. 340 342 flux(n)=0. … … 379 381 c 380 382 381 do nn=1,ncomp tot-1383 do nn=1,ncompmoldiff-1 382 384 do l=2,nz-1 383 385 atri(l-1)=aa(l,nn,nn) … … 385 387 ctri(l-1)=cc(l,nn,nn) 386 388 rtri(l-1)=qq(l,nn) 387 do n=1,ncomp tot-1389 do n=1,ncompmoldiff-1 388 390 rtri(l-1)=rtri(l-1)-(aa(l,nn,n)*qq(l-1,n) 389 391 & +bb(l,nn,n)*qq(l,n) … … 434 436 if(zlocal(l).gt.65000.)then 435 437 pdqdiff(ig,l,g_o)=0. 436 do n=1,ncomp tot-1438 do n=1,ncompmoldiff-1 437 439 pdqdiff(ig,l,gcmind(n))=(qnew(l,n)-qq(l,n)) 438 440 pdqdiff(ig,l,g_o)=pdqdiff(ig,l,g_o)-(qnew(l,n)-qq(l,n)) -
trunk/LMDZ.MARS/libf/aeronomars/moldiffcoeff.F
r38 r414 22 22 c Input/Output 23 23 c ------------ 24 real dij(ncomptot,ncomptot) 24 integer,parameter :: ncompmoldiff = 14 25 real dij(ncompmoldiff,ncompmoldiff) 25 26 26 27 c Local variables: … … 63 64 integer,save :: g_h2o=0 64 65 65 integer,save :: gcmind(ncomp tot)66 integer,save :: gcmind(ncompmoldiff) 66 67 67 68 real dnh … … 187 188 print*,'moldiffcoef: COEFF CALC' 188 189 open(56,file='coeffs.dat',status='unknown') 189 do n=1,ncomp tot190 do n=1,ncompmoldiff 190 191 if (dij(i_h2,n).gt.0.0) then 191 do nn=n,ncomp tot192 do nn=n,ncompmoldiff 192 193 dij(nn,n)=dij(i_h2,n) 193 194 & *sqrt(mmol(g_h2)/mmol(gcmind(nn))) … … 198 199 if (dij(i_h2,n).eq.0.0) then 199 200 dnh=dij(i_h,i_o)*sqrt(mmol(g_o)/mmol(gcmind(n))) 200 do nn=n,ncomp tot201 do nn=n,ncompmoldiff 201 202 dij(nn,n)=dnh*sqrt(mmol(g_h)/mmol(gcmind(nn))) 202 203 if(n.eq.nn) dij(nn,n)=1.0 … … 206 207 enddo 207 208 208 do n=1,ncomp tot209 do nn=n,ncomp tot209 do n=1,ncompmoldiff 210 do nn=n,ncompmoldiff 210 211 write(56,*) n,nn,dij(n,nn) !*1.e5/1.381e-23/(273**1.75) 211 212 enddo
Note: See TracChangeset
for help on using the changeset viewer.