Changeset 1020 for trunk/LMDZ.MARS/libf/aeronomars
- Timestamp:
- Aug 27, 2013, 9:22:40 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/libf/aeronomars/moldiff_red.F90
r1013 r1020 36 36 37 37 integer,dimension(nqmx) :: indic_diff 38 integer ig, nz,l,k,n,nn,p,ij038 integer ig,iq,nz,l,k,n,nn,p,ij0 39 39 integer istep,il,gcn,ntime,nlraf 40 40 real*8 masse … … 47 47 real*8 tt(nlayermx),tnew(nlayermx),tint(nlayermx) 48 48 real*8 zz(nlayermx) 49 real*8,dimension(:,:),allocatable :: qq,qnew,qint,FacMass50 real*8,dimension(:,:),allocatable :: rhoK,rhokinit49 real*8,dimension(:,:),allocatable,save :: qq,qnew,qint,FacMass 50 real*8,dimension(:,:),allocatable,save :: rhoK,rhokinit 51 51 real*8 rhoT(nlayermx) 52 52 real*8 dmmeandz(nlayermx) … … 60 60 real*8,dimension(:),allocatable :: Atri,Btri,Ctri,Dtri,Xtri,Tad,Dad,Zad,rhoad 61 61 real*8,dimension(:),allocatable :: alpha,beta,gama,delta,eps 62 real*8,dimension(:),allocatable :: wi,Wad,Uthermal,Lambdaexo,Hspecie63 real*8,dimension(:),allocatable :: Mtot1,Mtot2,Mraf1,Mraf262 real*8,dimension(:),allocatable,save :: wi,Wad,Uthermal,Lambdaexo,Hspecie 63 real*8,dimension(:),allocatable,save :: Mtot1,Mtot2,Mraf1,Mraf2 64 64 character(len=20),dimension(14) :: ListeDiff 65 65 !ccccccccccccccccccccccccccccccccccccccccccccccccccccccc … … 140 140 enddo 141 141 if (indic_diff(nn) .eq. 1) then 142 print*,'specie ', noms(nn), 'diffused in moldiff_red'142 print*,'specie ', noms(nn), 'diffused in moldiff_red' 143 143 ncompdiff=ncompdiff+1 144 144 endif … … 172 172 call moldiffcoeff_red(dij,indic_diff,gcmind,ncompdiff) 173 173 print*,'MOLDIFF EXO' 174 175 ! allocatation des tableaux dependants du nombre d especes diffusees 176 allocate(qq(nlayermx,ncompdiff)) 177 allocate(qnew(nlayermx,ncompdiff)) 178 allocate(qint(nlayermx,ncompdiff)) 179 allocate(FacMass(nlayermx,ncompdiff)) 180 allocate(rhok(nlayermx,ncompdiff)) 181 allocate(rhokinit(nlayermx,ncompdiff)) 182 183 allocate(wi(ncompdiff)) 184 allocate(wad(ncompdiff)) 185 allocate(uthermal(ncompdiff)) 186 allocate(lambdaexo(ncompdiff)) 187 allocate(Hspecie(ncompdiff)) 188 allocate(Mtot1(ncompdiff)) 189 allocate(Mtot2(ncompdiff)) 190 allocate(Mraf1(ncompdiff)) 191 allocate(Mraf2(ncompdiff)) 174 192 175 193 firstcall= .false. … … 191 209 invsgmu=1d0/g/masseU 192 210 193 ! allocatation des tableaux dependants du nombre d especes diffusees194 allocate(qq(nlayermx,ncompdiff))195 allocate(qnew(nlayermx,ncompdiff))196 allocate(qint(nlayermx,ncompdiff))197 allocate(FacMass(nlayermx,ncompdiff))198 allocate(rhok(nlayermx,ncompdiff))199 allocate(rhokinit(nlayermx,ncompdiff))200 201 allocate(wi(ncompdiff))202 allocate(wad(ncompdiff))203 allocate(uthermal(ncompdiff))204 allocate(lambdaexo(ncompdiff))205 allocate(Hspecie(ncompdiff))206 allocate(Mtot1(ncompdiff))207 allocate(Mtot2(ncompdiff))208 allocate(Mraf1(ncompdiff))209 allocate(Mraf2(ncompdiff))210 211 211 ! print*,'moldiff',i_h2,i_h,ncompdiff 212 212 do ig=1,ngridmx … … 215 215 ! Update the temperature 216 216 217 CALL TMNEW(pt(ig,:),pdt(ig,:),pdtconduc(ig,:),pdteuv(ig,:) & 218 & ,tt,ptimestep,nlayermx,ig) 217 ! CALL TMNEW(pt(ig,:),pdt(ig,:),pdtconduc(ig,:),pdteuv(ig,:) & 218 ! & ,tt,ptimestep,nlayermx,ig) 219 do l=1,nlayermx 220 tt(l)=pt(ig,l)*1D0+(pdt(ig,l)*dble(ptimestep)+ & 221 pdtconduc(ig,l)*dble(ptimestep)+ & 222 pdteuv(ig,l)*dble(ptimestep)) 223 ! to cach Nans... 224 if (tt(l).ne.tt(l)) then 225 print*,'Err TMNEW',ig,l,tt(l),pt(ig,l), & 226 pdt(ig,l),pdtconduc(ig,l),pdteuv(ig,l),dble(ptimestep) 227 endif 228 enddo ! of do l=1,nlayermx 219 229 220 230 ! Update the mass mixing ratios modified by other processes 221 231 222 CALL QMNEW(pq(ig,:,:),pdq(ig,:,:),qq,ptimestep,nlayermx, & 223 & ncompdiff,gcmind,ig) 232 ! CALL QMNEW(pq(ig,:,:),pdq(ig,:,:),qq,ptimestep,nlayermx, & 233 ! & ncompdiff,gcmind,ig) 234 do iq=1,ncompdiff 235 do l=1,nlayermx 236 qq(l,iq)=pq(ig,l,gcmind(iq))*1D0+( & 237 pdq(ig,l,gcmind(iq))*dble(ptimestep)) 238 qq(l,iq)=max(qq(l,iq),1d-30) 239 enddo ! of do l=1,nlayermx 240 enddo ! of do iq=1,ncompdiff 224 241 225 242 ! Compute the Pressure scale height … … 282 299 283 300 ! if (nlraf .ge. 200) print*,ig,nlraf,Zmin,Zmax 284 285 ! allocation for arrays 286 287 allocate(Praf(nlraf),Traf(nlraf),Rraf(nlraf),Mraf(nlraf)) 288 allocate(Nraf(nlraf),Draf(nlraf),Hraf(nlraf),Wraf(nlraf)) 289 allocate(Zraf(nlraf),Tdiffraf(nlraf)) 290 allocate(Prafold(nlraf),Mrafold(nlraf)) 291 allocate(Qraf(nlraf,ncompdiff),Rrafk(nlraf,ncompdiff),Nrafk(nlraf,ncompdiff)) 292 allocate(Rrafkold(nlraf,ncompdiff)) 293 allocate(Drafmol(nlraf,ncompdiff),Hrafmol(nlraf,ncompdiff)) 294 allocate(Wrafmol(nlraf,ncompdiff),Tdiffrafmol(nlraf,ncompdiff)) 295 allocate(Atri(nlraf),Btri(nlraf),Ctri(nlraf),Dtri(nlraf),Xtri(nlraf)) 296 allocate(Tad(nlraf),Dad(nlraf),Zad(nlraf),rhoad(nlraf)) 297 allocate(alpha(nlraf),beta(nlraf),gama(nlraf),delta(nlraf),eps(nlraf)) 301 302 ! allocate arrays: 303 allocate(Praf(nlraf),Traf(nlraf),Rraf(nlraf),Mraf(nlraf)) 304 allocate(Nraf(nlraf),Draf(nlraf),Hraf(nlraf),Wraf(nlraf)) 305 allocate(Zraf(nlraf),Tdiffraf(nlraf)) 306 allocate(Prafold(nlraf),Mrafold(nlraf)) 307 allocate(Qraf(nlraf,ncompdiff),Rrafk(nlraf,ncompdiff),Nrafk(nlraf,ncompdiff)) 308 allocate(Rrafkold(nlraf,ncompdiff)) 309 allocate(Drafmol(nlraf,ncompdiff),Hrafmol(nlraf,ncompdiff)) 310 allocate(Wrafmol(nlraf,ncompdiff),Tdiffrafmol(nlraf,ncompdiff)) 311 allocate(Atri(nlraf),Btri(nlraf),Ctri(nlraf),Dtri(nlraf),Xtri(nlraf)) 312 allocate(Tad(nlraf),Dad(nlraf),Zad(nlraf),rhoad(nlraf)) 313 allocate(alpha(nlraf),beta(nlraf),gama(nlraf),delta(nlraf),eps(nlraf)) 298 314 299 315 ! before beginning, I use a better vertical resolution above il0, … … 610 626 enddo ! ig loop 611 627 612 deallocate(qq,qnew,qint)613 deallocate(FacMass)614 deallocate(rhok,rhokinit)615 deallocate(wi,wad,uthermal,lambdaexo)616 deallocate(Hspecie)617 deallocate(Mtot1,Mtot2,Mraf1,Mraf2)618 628 619 629 return … … 1162 1172 H(nl)=-1D0/H(nl) 1163 1173 1164 do l=1,nl1165 if (abs(H(l)) .lt. 100.) then1174 ! do l=1,nl 1175 ! if (abs(H(l)) .lt. 100.) then 1166 1176 ! print*,'H',l,H(l),Nk(l,nn),nn 1167 endif1168 enddo1177 ! endif 1178 ! enddo 1169 1179 1170 1180 END
Note: See TracChangeset
for help on using the changeset viewer.