Changeset 5202 for LMDZ6/branches/cirrus/libf/phylmd/lmdz_lscp.F90
- Timestamp:
- Sep 20, 2024, 12:32:04 PM (7 weeks ago)
- Location:
- LMDZ6/branches/cirrus
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/cirrus
- Property svn:mergeinfo changed
-
LMDZ6/branches/cirrus/libf/phylmd/lmdz_lscp.F90
r5163 r5202 7 7 !++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 8 8 SUBROUTINE lscp(klon,klev,dtime,missing_val, & 9 paprs,pplay,temp,qt, ptconv,ratqs,&9 paprs,pplay,temp,qt,qice_save,ptconv,ratqs, & 10 10 d_t, d_q, d_ql, d_qi, rneb, rneblsvol, & 11 pfraclr,pfracld, & 11 pfraclr, pfracld, & 12 cldfraliq, sigma2_icefracturb,mean_icefracturb, & 12 13 radocond, radicefrac, rain, snow, & 13 14 frac_impa, frac_nucl, beta, & 14 prfl, psfl, rhcl, qta, fraca, & 15 tv, pspsk, tla, thl, iflag_cld_th, & 16 iflag_ice_thermo, distcltop, temp_cltop, cell_area,& 17 cf_seri, rvc_seri, u_seri, v_seri, pbl_eps, & 15 prfl, psfl, rhcl, qta, fraca, & 16 tv, pspsk, tla, thl, iflag_cld_th, & 17 iflag_ice_thermo, distcltop, temp_cltop, & 18 tke, tke_dissip, & 19 cell_area, & 20 cf_seri, rvc_seri, u_seri, v_seri, & 18 21 qsub, qissr, qcld, subfra, issrfra, gamma_cond, & 19 22 ratio_qi_qtot, dcf_sub, dcf_con, dcf_mix, & … … 100 103 ! USE de modules contenant des fonctions. 101 104 USE lmdz_cloudth, ONLY : cloudth, cloudth_v3, cloudth_v6, cloudth_mpc 102 USE lmdz_lscp_tools, ONLY : calc_qsat_ecmwf, icefrac_lscp, calc_gammasat 105 USE lmdz_lscp_tools, ONLY : calc_qsat_ecmwf, calc_gammasat 106 USE lmdz_lscp_tools, ONLY : icefrac_lscp, icefrac_lscp_turb 103 107 USE lmdz_lscp_tools, ONLY : fallice_velocity, distance_to_cloud_top 104 108 USE lmdz_lscp_condensation, ONLY : condensation_lognormal, condensation_ice_supersat … … 115 119 USE lmdz_lscp_ini, ONLY : RCPD, RLSTT, RLVTT, RLMLT, RVTMP2, RTT, RD, RG 116 120 USE lmdz_lscp_ini, ONLY : ok_poprecip 117 USE lmdz_lscp_ini, ONLY : ok_external_lognormal, ok_ice_supersat, ok_unadjusted_clouds 121 USE lmdz_lscp_ini, ONLY : ok_external_lognormal, ok_ice_supersat, ok_unadjusted_clouds, iflag_icefrac 118 122 119 123 IMPLICIT NONE … … 134 138 REAL, DIMENSION(klon,klev), INTENT(IN) :: temp ! temperature (K) 135 139 REAL, DIMENSION(klon,klev), INTENT(IN) :: qt ! total specific humidity (in vapor phase in input) [kg/kg] 140 REAL, DIMENSION(klon,klev), INTENT(IN) :: qice_save ! ice specific from previous time step [kg/kg] 136 141 INTEGER, INTENT(IN) :: iflag_cld_th ! flag that determines the distribution of convective clouds 137 142 INTEGER, INTENT(IN) :: iflag_ice_thermo! flag to activate the ice thermodynamics … … 141 146 !Inputs associated with thermal plumes 142 147 143 REAL, DIMENSION(klon,klev), INTENT(IN) :: tv ! virtual potential temperature [K] 144 REAL, DIMENSION(klon,klev), INTENT(IN) :: qta ! specific humidity within thermals [kg/kg] 145 REAL, DIMENSION(klon,klev), INTENT(IN) :: fraca ! fraction of thermals within the mesh [-] 146 REAL, DIMENSION(klon,klev), INTENT(IN) :: pspsk ! exner potential (p/100000)**(R/cp) 147 REAL, DIMENSION(klon,klev), INTENT(IN) :: tla ! liquid temperature within thermals [K] 148 REAL, DIMENSION(klon,klev), INTENT(IN) :: tv ! virtual potential temperature [K] 149 REAL, DIMENSION(klon,klev), INTENT(IN) :: qta ! specific humidity within thermals [kg/kg] 150 REAL, DIMENSION(klon,klev), INTENT(IN) :: fraca ! fraction of thermals within the mesh [-] 151 REAL, DIMENSION(klon,klev), INTENT(IN) :: pspsk ! exner potential (p/100000)**(R/cp) 152 REAL, DIMENSION(klon,klev), INTENT(IN) :: tla ! liquid temperature within thermals [K] 153 REAL, DIMENSION(klon,klev+1), INTENT(IN) :: tke !--turbulent kinetic energy [m2/s2] 154 REAL, DIMENSION(klon,klev+1), INTENT(IN) :: tke_dissip !--TKE dissipation [m2/s3] 148 155 149 156 ! INPUT/OUTPUT variables 150 157 !------------------------ 151 158 152 REAL, DIMENSION(klon,klev), INTENT(INOUT) :: thl ! liquid potential temperature [K]153 REAL, DIMENSION(klon,klev), INTENT(INOUT) :: ratqs ! function of pressure that sets the large-scale159 REAL, DIMENSION(klon,klev), INTENT(INOUT) :: thl ! liquid potential temperature [K] 160 REAL, DIMENSION(klon,klev), INTENT(INOUT) :: ratqs ! function of pressure that sets the large-scale 154 161 155 162 ! INPUT/OUTPUT condensation and ice supersaturation … … 160 167 REAL, DIMENSION(klon,klev), INTENT(IN) :: u_seri ! eastward wind [m/s] 161 168 REAL, DIMENSION(klon,klev), INTENT(IN) :: v_seri ! northward wind [m/s] 162 REAL, DIMENSION(klon,klev+1), INTENT(IN) :: pbl_eps ! TKE dissipation [?]163 169 REAL, DIMENSION(klon), INTENT(IN) :: cell_area ! area of each cell [m2] 164 170 … … 179 185 REAL, DIMENSION(klon,klev), INTENT(OUT) :: pfraclr ! precip fraction clear-sky part [-] 180 186 REAL, DIMENSION(klon,klev), INTENT(OUT) :: pfracld ! precip fraction cloudy part [-] 187 REAL, DIMENSION(klon,klev), INTENT(OUT) :: cldfraliq ! liquid fraction of cloud [-] 188 REAL, DIMENSION(klon,klev), INTENT(OUT) :: sigma2_icefracturb ! Variance of the diagnostic supersaturation distribution (icefrac_turb) [-] 189 REAL, DIMENSION(klon,klev), INTENT(OUT) :: mean_icefracturb ! Mean of the diagnostic supersaturation distribution (icefrac_turb) [-] 181 190 REAL, DIMENSION(klon,klev), INTENT(OUT) :: radocond ! condensed water used in the radiation scheme [kg/kg] 182 191 REAL, DIMENSION(klon,klev), INTENT(OUT) :: radicefrac ! ice fraction of condensed water for radiation scheme … … 190 199 REAL, DIMENSION(klon,klev), INTENT(OUT) :: beta ! conversion rate of condensed water 191 200 192 ! fraction of aerosol scavenging through impaction and nucleation (for on-line)201 ! fraction of aerosol scavenging through impaction and nucleation (for on-line) 193 202 194 REAL, DIMENSION(klon,klev), INTENT(OUT) :: frac_impa ! scavenging fraction due tu impaction [-]195 REAL, DIMENSION(klon,klev), INTENT(OUT) :: frac_nucl ! scavenging fraction due tu nucleation [-]203 REAL, DIMENSION(klon,klev), INTENT(OUT) :: frac_impa ! scavenging fraction due tu impaction [-] 204 REAL, DIMENSION(klon,klev), INTENT(OUT) :: frac_nucl ! scavenging fraction due tu nucleation [-] 196 205 197 206 ! for condensation and ice supersaturation … … 255 264 ! LOCAL VARIABLES: 256 265 !---------------- 257 258 REAL,DIMENSION(klon) :: qsl, qsi 266 REAL,DIMENSION(klon) :: qsl, qsi ! saturation threshold at current vertical level 259 267 REAL :: zct, zcl,zexpo 260 268 REAL, DIMENSION(klon,klev) :: ctot … … 263 271 REAL :: zdelta, zcor, zcvm5 264 272 REAL, DIMENSION(klon) :: zdqsdT_raw 265 REAL, DIMENSION(klon) :: gammasat,dgammasatdt ! coefficient to make cold condensation at the correct RH and derivative wrt T266 REAL, DIMENSION(klon) :: Tbef,qlbef,DT 273 REAL, DIMENSION(klon) :: gammasat,dgammasatdt ! coefficient to make cold condensation at the correct RH and derivative wrt T 274 REAL, DIMENSION(klon) :: Tbef,qlbef,DT ! temperature, humidity and temp. variation during lognormal iteration 267 275 REAL :: num,denom 268 276 REAL :: cste 269 REAL, DIMENSION(klon) :: zpdf_sig,zpdf_k,zpdf_delta 270 REAL, DIMENSION(klon) :: Zpdf_a,zpdf_b,zpdf_e1,zpdf_e2 277 REAL, DIMENSION(klon) :: zpdf_sig,zpdf_k,zpdf_delta ! lognormal parameters 278 REAL, DIMENSION(klon) :: Zpdf_a,zpdf_b,zpdf_e1,zpdf_e2 ! lognormal intermediate variables 271 279 REAL :: erf 272 280 REAL, DIMENSION(klon) :: zfice_th … … 285 293 REAL :: zmelt,zrain,zsnow,zprecip 286 294 REAL, DIMENSION(klon) :: dzfice 295 REAL, DIMENSION(klon) :: zfice_turb, dzfice_turb 287 296 REAL :: zsolid 288 297 REAL, DIMENSION(klon) :: qtot, qzero … … 315 324 REAL, DIMENSION(klon,klev) :: radocondi, radocondl 316 325 REAL :: effective_zneb 317 REAL, DIMENSION(klon) :: distcltop1D, temp_cltop1D 326 REAL, DIMENSION(klon) :: zdistcltop, ztemp_cltop 327 REAL, DIMENSION(klon) :: zqliq, zqice, zqvapcl ! for icefrac_lscp_turb 318 328 319 329 ! for condensation and ice supersaturation … … 328 338 REAL :: min_qParent, min_ratio 329 339 330 331 340 INTEGER i, k, n, kk, iter 332 341 INTEGER, DIMENSION(klon) :: n_i … … 382 391 pfraclr(:,:)=0.0 383 392 pfracld(:,:)=0.0 393 cldfraliq(:,:)=0. 394 sigma2_icefracturb(:,:)=0. 395 mean_icefracturb(:,:)=0. 384 396 radocond(:,:) = 0.0 385 397 radicefrac(:,:) = 0.0 … … 391 403 zfice(:)=0.0 392 404 dzfice(:)=0.0 405 zfice_turb(:)=0.0 406 dzfice_turb(:)=0.0 393 407 zqprecl(:)=0.0 394 408 zqpreci(:)=0.0 … … 405 419 d_tot_zneb(:) = 0.0 406 420 qzero(:) = 0.0 407 distcltop1D(:)=0.0408 temp_cltop1D(:) = 0.0421 zdistcltop(:)=0.0 422 ztemp_cltop(:) = 0.0 409 423 ztupnew(:)=0.0 410 424 … … 459 473 460 474 461 462 475 !c_iso: variable initialisation for iso 463 476 … … 478 491 479 492 ! Initialisation temperature and specific humidity 493 ! temp(klon,klev) is not modified by the routine, instead all changes in temperature are made on zt 494 ! at the end of the klon loop, a temperature incremtent d_t due to all processes 495 ! (thermalization, evap/sub incoming precip, cloud formation, precipitation processes) is calculated 496 ! d_t = temperature tendency due to lscp 497 ! The temperature of the overlying layer is updated here because needed for thermalization 480 498 DO i = 1, klon 481 499 zt(i)=temp(i,k) … … 812 830 ELSEIF (iflag_cloudth_vert .EQ. 7) THEN 813 831 ! Updated version of Arnaud Jam (correction by E. Vignon) + adapted treatment 814 ! for boundary-layer mixed phase clouds following Vignon et al.832 ! for boundary-layer mixed phase clouds 815 833 CALL cloudth_mpc(klon,klev,k,mpc_bl_points,zt,zq,qta(:,k),fraca(:,k), & 816 834 pspsk(:,k),paprs(:,k+1),paprs(:,k),pplay(:,k), tla(:,k), & … … 834 852 835 853 ! lognormal 836 lognormale = .TRUE.854 lognormale(:) = .TRUE. 837 855 838 856 ELSEIF (iflag_cld_th .GE. 6) THEN 839 857 840 858 ! lognormal distribution when no thermals 841 lognormale = fraca(:,k) < min_frac_th_cld859 lognormale(:) = fraca(:,k) < min_frac_th_cld 842 860 843 861 ELSE 844 862 ! When iflag_cld_th=5, we always assume 845 863 ! bi-gaussian distribution 846 lognormale = .FALSE.864 lognormale(:) = .FALSE. 847 865 848 866 ENDIF … … 900 918 IF (iflag_t_glace.GE.4) THEN 901 919 ! For iflag_t_glace GE 4 the phase partition function dependends on temperature AND distance to cloud top 902 CALL distance_to_cloud_top(klon,klev,k,temp,pplay,paprs,rneb, distcltop1D,temp_cltop1D)920 CALL distance_to_cloud_top(klon,klev,k,temp,pplay,paprs,rneb,zdistcltop,ztemp_cltop) 903 921 ENDIF 904 CALL icefrac_lscp(klon, zt(:), iflag_ice_thermo, distcltop1D(:),temp_cltop1D(:),zfice(:),dzfice(:)) 905 922 923 CALL icefrac_lscp(klon, zt(:), iflag_ice_thermo, zdistcltop(:),ztemp_cltop(:),zfice(:),dzfice(:)) 906 924 907 925 !--AB Activates a condensation scheme that allows for … … 938 956 pplay(:,k), paprs(:,k), paprs(:,k+1), & 939 957 cf_seri(:,k), rvc_seri(:,k), ratio_qi_qtot(:,k), & 940 shear(:), pbl_eps(:,k), cell_area(:), &958 shear(:), tke_dissip(:,k), cell_area(:), & 941 959 Tbef(:), zq(:), zqs(:), gammasat(:), ratqs(:,k), keepgoing(:), & 942 960 rneb(:,k), zqn(:), qvc(:), issrfra(:,k), qissr(:,k), & … … 1017 1035 cste=RLSTT 1018 1036 ENDIF 1019 1037 1038 ! LEA_R : check formule 1020 1039 IF ( ok_unadjusted_clouds ) THEN 1021 1040 !--AB We relax the saturation adjustment assumption … … 1059 1078 ! For iflag_t_glace GE 4 the phase partition function dependends on temperature AND distance to cloud top 1060 1079 IF (iflag_t_glace.GE.4) THEN 1061 CALL distance_to_cloud_top(klon,klev,k,temp,pplay,paprs,rneb,distcltop1D,temp_cltop1D) 1062 distcltop(:,k)=distcltop1D(:) 1063 temp_cltop(:,k)=temp_cltop1D(:) 1064 ENDIF 1065 ! Partition function in stratiform clouds (will be overwritten in boundary-layer MPCs) 1066 CALL icefrac_lscp(klon,zt,iflag_ice_thermo,distcltop1D,temp_cltop1D,zfice,dzfice) 1067 1080 CALL distance_to_cloud_top(klon,klev,k,temp,pplay,paprs,rneb,zdistcltop,ztemp_cltop) 1081 distcltop(:,k)=zdistcltop(:) 1082 temp_cltop(:,k)=ztemp_cltop(:) 1083 ENDIF 1084 1085 ! Partition function depending on temperature 1086 CALL icefrac_lscp(klon, zt, iflag_ice_thermo, zdistcltop, ztemp_cltop, zfice, dzfice) 1087 1088 ! Partition function depending on tke for non shallow-convective clouds 1089 IF (iflag_icefrac .GE. 1) THEN 1090 1091 CALL icefrac_lscp_turb(klon, dtime, Tbef, pplay(:,k), paprs(:,k), paprs(:,k+1), qice_save(:,k), ziflcld, zqn, & 1092 rneb(:,k), tke(:,k), tke_dissip(:,k), zqliq, zqvapcl, zqice, zfice_turb, dzfice_turb, cldfraliq(:,k),sigma2_icefracturb(:,k), mean_icefracturb(:,k)) 1093 1094 ENDIF 1068 1095 1069 1096 ! Water vapor update, Phase determination and subsequent latent heat exchange 1070 1097 DO i=1, klon 1071 1098 ! Overwrite phase partitioning in boundary layer mixed phase clouds when the 1099 ! iflag_cloudth_vert=7 and specific param is activated 1072 1100 IF (mpc_bl_points(i,k) .GT. 0) THEN 1073 1074 1101 zcond(i) = MAX(0.0,qincloud_mpc(i))*rneb(i,k) 1075 1102 ! following line is very strange and probably wrong … … 1078 1105 zq(i) = zq(i) - zcond(i) 1079 1106 zfice(i)=zfice_th(i) 1080 1081 1107 ELSE 1082 1083 1108 ! Checks on rneb, rhcl and zqn 1084 1109 IF (rneb(i,k) .LE. 0.0) THEN … … 1108 1133 ! following line is very strange and probably wrong: 1109 1134 rhcl(i,k)=(zqs(i)+zq(i))/2./zqs(i) 1135 ! Overwrite partitioning for non shallow-convective clouds if iflag_icefrac>1 (icefrac turb param) 1136 IF (iflag_icefrac .GE. 1) THEN 1137 IF (lognormale(i)) THEN 1138 zcond(i) = zqliq(i) + zqice(i) 1139 zfice(i)=zfice_turb(i) 1140 rhcl(i,k) = zqvapcl(i) * rneb(i,k) + (zq(i) - zqn(i)) * (1.-rneb(i,k)) 1141 ENDIF 1142 ENDIF 1110 1143 ENDIF 1111 1144 … … 1493 1526 znebprecipcld(i)=0.0 1494 1527 ENDIF 1495 1528 !IF ( ((1-zfice(i))*zoliq(i) .GT. 0.) .AND. (zt(i) .LE. 233.15) ) THEN 1529 !print*,'WARNING LEA OLIQ A <-40°C ' 1530 !print*,'zt,Tbef,oliq,oice,cldfraliq,icefrac,rneb',zt(i),Tbef(i),(1-zfice(i))*zoliq(i),zfice(i)*zoliq(i),cldfraliq(i,k),zfice(i),rneb(i,k) 1531 !ENDIF 1496 1532 ENDDO 1497 1533
Note: See TracChangeset
for help on using the changeset viewer.