Changeset 5117 for LMDZ6/branches/Amaury_dev/libf/phylmd/cv3_routines.F90
- Timestamp:
- Jul 24, 2024, 4:23:34 PM (4 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/Amaury_dev/libf/phylmd/cv3_routines.F90
r5116 r5117 8 8 9 9 USE lmdz_ioipsl_getin_p, ONLY: getin_p 10 uselmdz_phys_para10 USE lmdz_phys_para 11 11 IMPLICIT NONE 12 12 … … 554 554 !@ do 290 k=minorig,nl 555 555 !@ do 280 i=1,len 556 !@ if((k.ge.(nk(i)+1)). and.(p(i,k).lt.plcl(i)))556 !@ if((k.ge.(nk(i)+1)).AND.(p(i,k).lt.plcl(i))) 557 557 !@ & icb(i)=min(icb(i),k) 558 558 !@ 280 continue … … 560 560 !@c 561 561 !@ do 300 i=1,len 562 !@ if((icb(i).ge.nlm). and.(iflag(i).eq.0))iflag(i)=9562 !@ if((icb(i).ge.nlm).AND.(iflag(i).EQ.0))iflag(i)=9 563 563 !@ 300 continue 564 564 … … 582 582 583 583 DO i = 1, len 584 !@ if((icb(i).ge.nlm). and.(iflag(i).eq.0))iflag(i)=9584 !@ if((icb(i).ge.nlm).AND.(iflag(i).EQ.0))iflag(i)=9 585 585 IF ((icb(i)==nlm) .AND. (iflag(i)==0)) iflag(i) = 9 586 586 END DO … … 942 942 ! oct3 ath = th(i,icb(i)-1) - dttrig 943 943 ! oct3 944 ! oct3 if (tdif.lt.dtcrit . or. ath.gt.ath1) THEN944 ! oct3 if (tdif.lt.dtcrit .OR. ath.gt.ath1) THEN 945 945 ! oct3 do 60 k=1,nl 946 946 ! oct3 sig(i,k) = beta*sig(i,k) - 2.*alpha*tdif*tdif … … 1063 1063 !AC! nn=0 1064 1064 !AC! do 101 i=1,len 1065 !AC! IF(iflag1(i). eq.0)THEN1065 !AC! IF(iflag1(i).EQ.0)THEN 1066 1066 !AC! nn=nn+1 1067 1067 !AC! tra(nn,k,j)=tra1(i,k,j) … … 1874 1874 ! ENDDO 1875 1875 1876 endif1876 ENDIF 1877 1877 1878 1878 ! -- end convect3 … … 1947 1947 ! ori do 520 i=1,ncum 1948 1948 ! ori IF(cape(i).lt.0.0)lcape(i)=.FALSE. 1949 ! ori if((k.ge.(icb(i)+1)). and.lcape(i))THEN1949 ! ori if((k.ge.(icb(i)+1)).AND.lcape(i))THEN 1950 1950 ! ori by=(tvp(i,k)-tv(i,k))*dph(i,k)/p(i,k) 1951 1951 ! ori byp(i)=(tvp(i,k+1)-tv(i,k+1))*dph(i,k+1)/p(i,k+1) … … 2230 2230 ! c do k= 1,nl 2231 2231 ! c do i = 1,ncum 2232 ! c IF (k .ge. icb(i) . and. k .le. inb(i)) THEN2232 ! c IF (k .ge. icb(i) .AND. k .le. inb(i)) THEN 2233 2233 ! c cbmflast(i) = cbmflast(i)+M(i,k) 2234 2234 ! c ENDIF … … 2446 2446 !AC! do j=minorig,nl 2447 2447 !AC! do il=1,ncum 2448 !AC! IF( (i.ge.icb(il)). and.(i.le.inb(il)).and.2449 !AC! : (j.ge.(icb(il)-1)). and.(j.le.inb(il)))THEN2448 !AC! IF( (i.ge.icb(il)).AND.(i.le.inb(il)).AND. 2449 !AC! : (j.ge.(icb(il)-1)).AND.(j.le.inb(il)))THEN 2450 2450 !AC! traent(il,i,j,k)=sij(il,i,j)*tra(il,i,k) 2451 2451 !AC! : +(1.-sij(il,i,j))*tra(il,nk(il),k) … … 2464 2464 DO il = 1, ncum 2465 2465 IF ((i>=icb(il)) .AND. (i<=inb(il)) .AND. (nent(il,i)==0)) THEN 2466 ! @ IF(nent(il,i). eq.0)THEN2466 ! @ IF(nent(il,i).EQ.0)THEN 2467 2467 ment(il, i, i) = m(il, i) 2468 2468 qent(il, i, i) = qnk(il) - ep(il, i)*clw(il, i) … … 2479 2479 !AC! do i=minorig+1,nl 2480 2480 !AC! do il=1,ncum 2481 !AC! if (i.ge.icb(il) . and. i.le.inb(il) .and. nent(il,i).eq.0) THEN2481 !AC! if (i.ge.icb(il) .AND. i.le.inb(il) .AND. nent(il,i).EQ.0) THEN 2482 2482 !AC! traent(il,i,i,j)=tra(il,nk(il),j) 2483 2483 !AC! endif … … 2662 2662 !AC! do j=1,ntra 2663 2663 !AC! do il=1,ncum 2664 !AC! if ( i.ge.icb(il) . and. i.le.inb(il) .and. lwork(il)2665 !AC! : . and. csum(il,i).lt.m(il,i) ) THEN2664 !AC! if ( i.ge.icb(il) .AND. i.le.inb(il) .AND. lwork(il) 2665 !AC! : .AND. csum(il,i).lt.m(il,i) ) THEN 2666 2666 !AC! traent(il,i,i,j)=tra(il,nk(il),j) 2667 2667 !AC! endif … … 3108 3108 !JYG---- Correction : si c6 <= 0, water(il,i)=0. 3109 3109 ! prec(il,i)=0. 3110 ! endif3110 ! END IF 3111 3111 3112 3112 !JYG--- Dans tous les cas, evaporation = [tt ce qui entre dans la couche i] … … 3181 3181 3182 3182 END IF 3183 END IF !(i.le.inb(il) . and. lwork(il))3183 END IF !(i.le.inb(il) .AND. lwork(il)) 3184 3184 END DO 3185 3185 ! ---------------------------------------------------------------- … … 3222 3222 END IF 3223 3223 3224 END IF !(i.le.inb(il) . and. lwork(il) .and. i.ne.1)3224 END IF !(i.le.inb(il) .AND. lwork(il) .AND. i.NE.1) 3225 3225 IF (prt_level >= 20) THEN 3226 3226 PRINT *,'cv3_unsat, mp hydrostatic ', i, mp(il,i) … … 3343 3343 !>jyg 3344 3344 3345 END IF ! (i.le.inb(il) . and. lwork(il) .and. i.ne.1)3345 END IF ! (i.le.inb(il) .AND. lwork(il) .AND. i.NE.1) 3346 3346 END DO 3347 3347 ! ---------------------------------------------------------------- … … 3357 3357 IF (i<inb(il) .AND. lwork(il)) THEN 3358 3358 mplus(il) = mp(il, i) > mp(il, i+1) 3359 END IF ! (i.lt.inb(il) . and. lwork(il))3359 END IF ! (i.lt.inb(il) .AND. lwork(il)) 3360 3360 END DO 3361 3361 … … 3393 3393 vp(il, i) = vp(il, i+1) 3394 3394 END IF ! (mp(il,i+1).gt.1.0e-16) 3395 END IF ! (mplus(il)) else if (.not.mplus(il))3395 END IF ! (mplus(il)) ELSE IF (.NOT.mplus(il)) 3396 3396 3397 3397 rp(il, i) = amin1(rp(il,i), rs(il,i)) 3398 3398 rp(il, i) = max(rp(il,i), 0.0) 3399 3399 3400 END IF ! (i.lt.inb(il) . and. lwork(il))3400 END IF ! (i.lt.inb(il) .AND. lwork(il)) 3401 3401 END DO 3402 3402 ! ---------------------------------------------------------------- … … 3406 3406 !AC! do j=1,ntra 3407 3407 !AC! do il = 1,ncum 3408 !AC! if (i.lt.inb(il) . and. lwork(il)) THEN3408 !AC! if (i.lt.inb(il) .AND. lwork(il)) THEN 3409 3409 !AC!c 3410 3410 !AC! IF(mplus(il))THEN … … 3416 3416 !AC! trap(il,i,j)=trap(il,i+1,j) 3417 3417 !AC! endif 3418 !AC! endif ! (mplus(il)) else if (.not.mplus(il))3418 !AC! endif ! (mplus(il)) ELSE IF (.NOT.mplus(il)) 3419 3419 !AC!c 3420 !AC! endif ! (i.lt.inb(il) . and. lwork(il))3420 !AC! endif ! (i.lt.inb(il) .AND. lwork(il)) 3421 3421 !AC! enddo 3422 3422 !AC! END DO … … 3822 3822 !AC! do j=2,nl 3823 3823 !AC! do il=1,ncum 3824 !AC! if (j.le.inb(il) . and. iflag(il) .le. 1) THEN3824 !AC! if (j.le.inb(il) .AND. iflag(il) .le. 1) THEN 3825 3825 !AC! 3826 3826 !AC! if (cvflag_grav) THEN … … 4170 4170 !AC! do k=1,ntra 4171 4171 !AC! do il=1,ncum 4172 !AC! if (i.le.inb(il) . and. iflag(il) .le. 1) THEN4172 !AC! if (i.le.inb(il) .AND. iflag(il) .le. 1) THEN 4173 4173 !AC! dpinv=1.0/(ph(il,i)-ph(il,i+1)) 4174 4174 !AC! cpinv=1.0/cpn(il,i) … … 4228 4228 !AC! do k=1,i-1 4229 4229 !AC! do il=1,ncum 4230 !AC! if (i.le.inb(il) . and. iflag(il) .le. 1) THEN4230 !AC! if (i.le.inb(il) .AND. iflag(il) .le. 1) THEN 4231 4231 !AC! dpinv=1.0/(ph(il,i)-ph(il,i+1)) 4232 4232 !AC! cpinv=1.0/cpn(il,i) … … 4276 4276 !AC! do k=i,nl+1 4277 4277 !AC! do il=1,ncum 4278 !AC! if (i.le.inb(il) . and. k.le.inb(il)4279 !AC! $ . and. iflag(il) .le. 1) THEN4278 !AC! if (i.le.inb(il) .AND. k.le.inb(il) 4279 !AC! $ .AND. iflag(il) .le. 1) THEN 4280 4280 !AC! dpinv=1.0/(ph(il,i)-ph(il,i+1)) 4281 4281 !AC! cpinv=1.0/cpn(il,i) … … 4345 4345 !AC! do j=1,ntra 4346 4346 !AC! do il=1,ncum 4347 !AC! if (i.le.inb(il) . and. iflag(il) .le. 1) THEN4347 !AC! if (i.le.inb(il) .AND. iflag(il) .le. 1) THEN 4348 4348 !AC! dpinv=1.0/(ph(il,i)-ph(il,i+1)) 4349 4349 !AC! cpinv=1.0/cpn(il,i) … … 4726 4726 DO k = i, nl 4727 4727 DO il = 1, ncum 4728 ! test if (i.ge.icb(il). and.i.le.inb(il).and.k.le.inb(il)) THEN4728 ! test if (i.ge.icb(il).AND.i.le.inb(il).AND.k.le.inb(il)) THEN 4729 4729 IF (i<=inb(il) .AND. k<=inb(il)) THEN 4730 4730 upwd(il, i) = upwd(il, i) + up1(il, k, i) … … 4989 4989 DO i = 1, ncum 4990 4990 IF (k>=icb(i) .AND. k<=inb(i) .AND. & 4991 !!jyg j.ge.k. and.j.le.inb(i)) THEN4991 !!jyg j.ge.k.AND.j.le.inb(i)) THEN 4992 4992 !!jyg epm(i,j,k)=1.-(1.-ep(i,j))*clw(i,j)/elij(i,k,j) 4993 4993 j>k .AND. j<=inb(i)) THEN … … 5159 5159 5160 5160 ! local 5161 integer i,k5161 INTEGER i,k 5162 5162 ! real hp_bak(nloc,nd) 5163 5163 ! real ep_bak(nloc,nd) 5164 realm_loc(nloc,nd)5165 realsig_loc(nloc,nd)5166 realw0_loc(nloc,nd)5167 integeriflag_loc(nloc)5168 realcape(nloc)5164 REAL m_loc(nloc,nd) 5165 REAL sig_loc(nloc,nd) 5166 REAL w0_loc(nloc,nd) 5167 INTEGER iflag_loc(nloc) 5168 REAL cape(nloc) 5169 5169 5170 if(coef_epmax_cape>1e-12) THEN5170 IF (coef_epmax_cape>1e-12) THEN 5171 5171 ! il faut calculer la cape: on fait un calcule simple car tant qu'on ne 5172 5172 ! connait pas ep, on ne connait pas les mélanges, ddfts etc... qui sont … … 5221 5221 do k=minorig+1,nl 5222 5222 do i=1,ncum 5223 if((k>=icb(i)).and.(k<=inb(i)))THEN5223 IF((k>=icb(i)).AND.(k<=inb(i)))THEN 5224 5224 hp(i, k) = hnk(i) + (lv(i,k)+(cpd-cpv)*t(i,k)+frac(i,k)*lf(i,k))* & 5225 5225 ep(i, k)*clw(i, k) … … 5241 5241 ! do i=1,ncum 5242 5242 ! do k=1,nl 5243 ! if ((abs(hp_bak(i,k)-hp(i,k))/hp_bak(i,k).gt.1e-1). or. &5244 ! ((abs(hp_bak(i,k)-hp(i,k))/hp_bak(i,k).gt.1e-4). and. &5243 ! if ((abs(hp_bak(i,k)-hp(i,k))/hp_bak(i,k).gt.1e-1).OR. & 5244 ! ((abs(hp_bak(i,k)-hp(i,k))/hp_bak(i,k).gt.1e-4).AND. & 5245 5245 ! (ep(i,k)-ep_bak(i,k).lt.1e-4))) THEN 5246 5246 ! WRITE(*,*) 'i,k=',i,k
Note: See TracChangeset
for help on using the changeset viewer.