Changeset 4435
- Timestamp:
- Feb 13, 2023, 4:45:52 PM (23 months ago)
- Location:
- LMDZ6/branches/Portage_acc/libf/phylmd
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/Portage_acc/libf/phylmd/thermcell_env.F90
r4185 r4435 40 40 !$acc kernels default(none) async 41 41 mask(:,:)=.true. 42 !$acc end kernels 43 42 !$acc end kernels 44 43 ! 45 44 ! calcul des caracteristiques de l environnement … … 57 56 !--------------- 58 57 ! Calcul de l'humidite a saturation et de la condensation 59 60 58 call thermcell_qsat(ngrid*nlay,mask,pplev,pt,po,pqsat) 61 59 !$acc kernels default(none) async … … 92 90 !!! temporary for GPU port !!!$acc update self(zo, zl, zh, ztv, zthl,zpspsk, zu, zv, pqsat) 93 91 !!! temporary for GPU port include "dump_param.h" ! replay automatic include 94 !$acc end data 92 !!! !$acc update self(zo, zl, zh, ztv, zthl,zpspsk, zu, zv, pqsat) 93 !$acc end data 95 94 RETURN 96 95 END -
LMDZ6/branches/Portage_acc/libf/phylmd/thermcell_qsat.F90
r3035 r4435 1 1 subroutine thermcell_qsat(klon,active,pplev,ztemp,zqta,zqsat) 2 implicit none 2 USE thermcell_ini_mod, ONLY : RLvCp,RETV, RCPD, RLVTT, RTT 3 implicit none 3 4 4 #include "YOMCST.h"5 !!#include "YOMCST.h" 5 6 #include "YOETHF.h" 6 7 #include "FCTTRE.h" … … 12 13 13 14 ! Arguments 14 INTEGER klon 15 REAL zpspsk(klon),pplev(klon) 16 REAL ztemp(klon),zqta(klon),zqsat(klon) 17 LOGICAL active(klon) 15 INTEGER, INTENT(IN) :: klon 16 !REAL zpspsk(klon),pplev(klon) 17 !REAL ztemp(klon),zqta(klon),zqsat(klon) 18 REAL, INTENT(IN) :: pplev(klon) 19 REAL, INTENT(IN) :: ztemp(klon),zqta(klon) 20 REAL, INTENT(OUT) :: zqsat(klon) 21 LOGICAL, INTENT(IN) :: active(klon) 18 22 19 23 ! Variables locales … … 22 26 REAL tdelta,qsatbef,zcor,qlbef,zdelta,zcvm5,dqsat,num,denom,dqsat_dT 23 27 logical Zsat 24 REAL RLvCp28 !REAL RLvCp 25 29 26 30 REAL, SAVE :: DDT0=.01 27 31 !$OMP THREADPRIVATE(DDT0) 28 32 29 LOGICAL afaire(klon),tout_converge 33 !$acc data create (dt, tbef) & 34 !$acc present(pplev, ztemp, zqta, active) & 35 !$acc present(zqsat) & 36 !$acc & 30 37 31 38 !==================================================================== … … 33 40 !==================================================================== 34 41 35 RLvCp = RLVTT/RCPD 36 tout_converge=.false. 37 afaire(:)=.false. 42 !RLvCp = RLVTT/RCPD 43 !$acc kernels default(none) 38 44 DT(:)=0. 39 45 !!LF !$acc end kernels 40 46 41 47 !==================================================================== … … 45 51 !==================================================================== 46 52 53 !!LF !$acc kernels default(none) 47 54 do ig=1,klon 48 55 if (active(ig)) then … … 58 65 endif 59 66 enddo 67 !!LF !$acc end kernels 60 68 61 69 ! Traitement du cas ou il y a condensation mais faible 62 70 ! On ne condense pas mais on dit que le qsat est le qta 71 !!LF !$acc kernels default(none) 63 72 do ig=1,klon 64 73 if (active(ig)) then … … 68 77 endif 69 78 enddo 79 !!LF !$acc end kernels 70 80 81 !!LF !$acc kernels default(none) 82 !! !$acc parallel loop private(tbef,dt,zqsat) 71 83 do iter=1,10 72 afaire(:)=abs(DT(:)).gt.DDT073 84 do ig=1,klon 74 if (afaire(ig)) then75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 85 if (abs(DT(ig)).gt.DDT0) then 86 Tbef(ig)=Tbef(ig)+DT(ig) 87 zdelta=MAX(0.,SIGN(1.,RTT-Tbef(ig))) 88 qsatbef= R2ES * FOEEW(Tbef(ig),zdelta)/pplev(ig) 89 qsatbef=MIN(0.5,qsatbef) 90 zcor=1./(1.-retv*qsatbef) 91 qsatbef=qsatbef*zcor 92 qlbef=zqta(ig)-qsatbef 93 zdelta=MAX(0.,SIGN(1.,RTT-Tbef(ig))) 94 zcvm5=R5LES*(1.-zdelta) + R5IES*zdelta 95 zcor=1./(1.-retv*qsatbef) 96 dqsat_dT=FOEDE(Tbef(ig),zdelta,zcvm5,qsatbef,zcor) 97 num=-Tbef(ig)+ztemp(ig)+RLvCp*qlbef 98 denom=1.+RLvCp*dqsat_dT 99 zqsat(ig) = qsatbef 100 DT(ig)=num/denom 101 endif 91 102 enddo 92 103 enddo 104 !$acc end kernels 105 106 107 !$acc end data 93 108 94 109 return
Note: See TracChangeset
for help on using the changeset viewer.