Changeset 2544 for LMDZ5/branches/testing/libf/phylmd/cloudth.F90
- Timestamp:
- Jun 7, 2016, 8:55:31 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/branches/testing/libf/phylmd/cloudth.F90
r2543 r2544 20 20 #include "FCTTRE.h" 21 21 #include "thermcell.h" 22 23 #include "nuage.h"24 25 26 27 28 22 29 23 INTEGER itap,ind1,ind2 … … 68 62 REAL erf 69 63 70 71 72 ! LOGICAL, SAVE :: first=.true. 64 REAL, SAVE :: iflag_cloudth_vert, iflag_cloudth_vert_omp=0 65 66 67 LOGICAL, SAVE :: first=.true. 73 68 74 69 … … 80 75 ! de converger sur une version nouvelle 81 76 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 82 ! IF (first) THEN 83 ! !$OMP MASTER 84 ! CALL getin('iflag_cloudth_vert',iflag_cloudth_vert_omp) 85 ! !$OMP END MASTER 86 ! !$OMP BARRIER 87 ! iflag_cloudth_vert=iflag_cloudth_vert_omp 88 ! first=.false. 89 ! ENDIF 90 91 IF (iflag_cloudth_vert.GE.1) THEN 92 CALL cloudth_vert(ngrid,klev,ind2, & 77 IF (first) THEN 78 !$OMP MASTER 79 CALL getin('iflag_cloudth_vert',iflag_cloudth_vert_omp) 80 !$OMP END MASTER 81 !$OMP BARRIER 82 iflag_cloudth_vert=iflag_cloudth_vert_omp 83 first=.false. 84 ENDIF 85 IF (iflag_cloudth_vert==1) THEN 86 CALL cloudth_vert(ngrid,klev,ind2, & 93 87 & ztv,po,zqta,fraca, & 94 88 & qcloud,ctot,zpspsk,paprs,ztla,zthl, & 95 89 & ratqs,zqs,t) 96 RETURN97 ENDIF90 RETURN 91 ENDIF 98 92 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 93 99 94 100 95 … … 290 285 #include "thermcell.h" 291 286 292 293 #include "nuage.h"294 295 296 297 287 INTEGER itap,ind1,ind2 298 288 INTEGER ngrid,klev,klon,l,ig … … 448 438 449 439 450 451 452 453 454 455 IF (iflag_cloudth_vert == 1) THEN456 440 !------------------------------------------------------------------------------- 457 441 ! Version 2: Modification selon J.-Louis. On condense ?? partir de qsat-ratqs … … 495 479 qltot(ind1,ind2)=fraca(ind1,ind2)*qlth(ind1,ind2)+(1.-1.*fraca(ind1,ind2))*qlenv(ind1,ind2) 496 480 497 498 499 500 501 ELSE IF (iflag_cloudth_vert == 2) THEN502 503 !-------------------------------------------------------------------------------504 ! Version 3: Modification Jean Jouhaud. On condense a partir de -delta s505 !-------------------------------------------------------------------------------506 ! deltasenv=aenv*ratqs(ind1,ind2)*po(ind1)507 ! deltasth=ath*ratqs(ind1,ind2)*zqta(ind1,ind2)508 ! deltasenv=aenv*ratqs(ind1,ind2)*zqsatenv(ind1,ind2)509 ! deltasth=ath*ratqs(ind1,ind2)*zqsatth(ind1,ind2)510 deltasenv=aenv*0.5*sigma1s511 deltasth=ath*0.5*sigma2s512 513 xenv1=-(senv+deltasenv)/(sqrt(2.)*sigma1s)514 xenv2=-(senv-deltasenv)/(sqrt(2.)*sigma1s)515 xth1=-(sth+deltasth)/(sqrt(2.)*sigma2s)516 xth2=-(sth-deltasth)/(sqrt(2.)*sigma2s)517 ! coeffqlenv=(sigma1s)**2/(2*sqrtpi*deltasenv)518 ! coeffqlth=(sigma2s)**2/(2*sqrtpi*deltasth)519 520 cth(ind1,ind2)=0.5*(1.-1.*erf(xth1))521 cenv(ind1,ind2)=0.5*(1.-1.*erf(xenv1))522 ctot(ind1,ind2)=fraca(ind1,ind2)*cth(ind1,ind2)+(1.-1.*fraca(ind1,ind2))*cenv(ind1,ind2)523 524 IntJ=0.5*senv*(1-erf(xenv2))+(sigma1s/sqrt2pi)*exp(-1.*xenv2**2)525 IntI1=(((senv+deltasenv)**2+(sigma1s)**2)/(8*deltasenv))*(erf(xenv2)-erf(xenv1))526 IntI2=(sigma1s**2/(4*deltasenv*sqrtpi))*(xenv1*exp(-1.*xenv1**2)-xenv2*exp(-1.*xenv2**2))527 IntI3=((sqrt2*sigma1s*(senv+deltasenv))/(4*sqrtpi*deltasenv))*(exp(-1.*xenv1**2)-exp(-1.*xenv2**2))528 529 ! IntI1=0.5*(0.5*sqrtpi*(erf(xenv2)-erf(xenv1))+xenv1*exp(-1.*xenv1**2)-xenv2*exp(-1.*xenv2**2))530 ! IntI2=xenv2*(exp(-1.*xenv2**2)-exp(-1.*xenv1**2))531 ! IntI3=0.5*sqrtpi*xenv2**2*(erf(xenv2)-erf(xenv1))532 533 qlenv(ind1,ind2)=IntJ+IntI1+IntI2+IntI3534 ! qlenv(ind1,ind2)=IntJ535 ! print*, qlenv(ind1,ind2),'VERIF EAU'536 537 IntJ=0.5*sth*(1-erf(xth2))+(sigma2s/sqrt2pi)*exp(-1.*xth2**2)538 IntI1=(((sth+deltasth)**2+(sigma2s)**2)/(8*deltasth))*(erf(xth2)-erf(xth1))539 IntI2=(sigma2s**2/(4*deltasth*sqrtpi))*(xth1*exp(-1.*xth1**2)-xth2*exp(-1.*xth2**2))540 IntI3=((sqrt2*sigma2s*(sth+deltasth))/(4*sqrtpi*deltasth))*(exp(-1.*xth1**2)-exp(-1.*xth2**2))541 542 qlth(ind1,ind2)=IntJ+IntI1+IntI2+IntI3543 ! qlth(ind1,ind2)=IntJ544 ! print*, IntJ,IntI1,IntI2,IntI3,qlth(ind1,ind2),'VERIF EAU2'545 qltot(ind1,ind2)=fraca(ind1,ind2)*qlth(ind1,ind2)+(1.-1.*fraca(ind1,ind2))*qlenv(ind1,ind2)546 547 548 549 550 ENDIF ! of if (iflag_cloudth_vert==1 or 2)551 552 553 554 481 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 555 556 557 558 482 if (cenv(ind1,ind2).lt.1.e-10.or.cth(ind1,ind2).lt.1.e-10) then 559 483 ctot(ind1,ind2)=0.
Note: See TracChangeset
for help on using the changeset viewer.