Changeset 4951 for LMDZ6/branches/cirrus/libf/phylmd
- Timestamp:
- May 23, 2024, 12:02:33 PM (8 months ago)
- Location:
- LMDZ6/branches/cirrus/libf/phylmd
- Files:
-
- 1 added
- 1 deleted
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/cirrus/libf/phylmd/clesphys.h
r4773 r4951 94 94 LOGICAL :: ok_airs 95 95 INTEGER :: ip_ebil_phy, iflag_rrtm, iflag_ice_thermo, NSW, iflag_albedo 96 LOGICAL :: ok_ice_su rsat, ok_plane_h2o, ok_plane_contrail96 LOGICAL :: ok_ice_supersat, ok_plane_h2o, ok_plane_contrail 97 97 LOGICAL :: ok_chlorophyll 98 98 LOGICAL :: ok_strato … … 154 154 & , ok_lic_melt, ok_lic_cond, aer_type & 155 155 & , iflag_rrtm, ok_strato,ok_hines, ok_qch4 & 156 & , iflag_ice_thermo, ok_ice_su rsat&156 & , iflag_ice_thermo, ok_ice_supersat & 157 157 & , ok_plane_h2o, ok_plane_contrail & 158 158 & , ok_gwd_rando, NSW, iflag_albedo & -
LMDZ6/branches/cirrus/libf/phylmd/conf_phys_m.F90
r4843 r4951 173 173 INTEGER,SAVE :: iflag_clw_omp 174 174 INTEGER,SAVE :: iflag_ice_thermo_omp 175 LOGICAL,SAVE :: ok_ice_su rsat_omp175 LOGICAL,SAVE :: ok_ice_supersat_omp 176 176 LOGICAL,SAVE :: ok_plane_h2o_omp, ok_plane_contrail_omp 177 177 REAL,SAVE :: rad_froid_omp, rad_chau1_omp, rad_chau2_omp … … 1347 1347 1348 1348 ! 1349 !Config Key = ok_ice_su rsat1350 !Config Desc = 1351 !Config Def = 01352 !Config Help = 1353 ! 1354 ok_ice_su rsat_omp = 01355 CALL getin('ok_ice_su rsat',ok_ice_sursat_omp)1349 !Config Key = ok_ice_supersat 1350 !Config Desc = include ice supersaturation for cold clouds 1351 !Config Def = .FALSE. 1352 !Config Help = 1353 ! 1354 ok_ice_supersat_omp = .FALSE. 1355 CALL getin('ok_ice_supersat',ok_ice_supersat_omp) 1356 1356 1357 1357 !Config Key = ok_plane_h2o 1358 !Config Desc = 1359 !Config Def = 01358 !Config Desc = include H2O emissions from aviation 1359 !Config Def = .FALSE. 1360 1360 !Config Help = 1361 1361 ! … … 1364 1364 1365 1365 !Config Key = ok_plane_contrail 1366 !Config Desc = 1367 !Config Def = 01366 !Config Desc = include the formation of contrail cirrus clouds 1367 !Config Def = .FALSE. 1368 1368 !Config Help = 1369 1369 ! … … 2345 2345 rad_chau2 = rad_chau2_omp 2346 2346 iflag_ice_thermo = iflag_ice_thermo_omp 2347 ok_ice_su rsat = ok_ice_sursat_omp2347 ok_ice_supersat = ok_ice_supersat_omp 2348 2348 ok_plane_h2o = ok_plane_h2o_omp 2349 2349 ok_plane_contrail = ok_plane_contrail_omp … … 2770 2770 WRITE(lunout,*) ' rad_chau2 = ',rad_chau2 2771 2771 WRITE(lunout,*) ' iflag_ice_thermo = ',iflag_ice_thermo 2772 WRITE(lunout,*) ' ok_ice_su rsat = ',ok_ice_sursat2772 WRITE(lunout,*) ' ok_ice_supersat = ',ok_ice_supersat 2773 2773 WRITE(lunout,*) ' ok_plane_h2o = ',ok_plane_h2o 2774 2774 WRITE(lunout,*) ' ok_plane_contrail = ',ok_plane_contrail -
LMDZ6/branches/cirrus/libf/phylmd/create_etat0_unstruct_mod.F90
r4856 r4951 258 258 prw_ancien = 0. 259 259 agesno = 0. 260 261 ! LSCP condensation and ice supersaturation 262 cf_ancien = 0. 263 rvc_ancien = 0. 260 264 261 265 wake_delta_pbl_TKE(:,:,:)=0 … … 310 314 END IF 311 315 ratqs_inter_ = 0.002 312 rneb_ancien = 0.313 316 314 317 CALL gather_omp(cell_area,cell_area_mpi) -
LMDZ6/branches/cirrus/libf/phylmd/lmdz_lscp.F90
r4915 r4951 8 8 SUBROUTINE lscp(klon,klev,dtime,missing_val, & 9 9 paprs,pplay,temp,qt,ptconv,ratqs, & 10 d_t, d_q, d_ql, d_qi, rneb, rneblsvol, rneb_seri,&10 d_t, d_q, d_ql, d_qi, rneb, rneblsvol, & 11 11 pfraclr,pfracld, & 12 12 radocond, radicefrac, rain, snow, & … … 14 14 prfl, psfl, rhcl, qta, fraca, & 15 15 tv, pspsk, tla, thl, iflag_cld_th, & 16 iflag_ice_thermo, ok_ice_sursat, qsatl, qsats, & 17 distcltop,temp_cltop, & 18 qclr, qcld, qss, qvc, rnebclr, rnebss, gamma_ss, & 19 Tcontr, qcontr, qcontr2, fcontrN, fcontrP, & 16 iflag_ice_thermo, distcltop, temp_cltop, cell_area,& 17 cf_seri, rvc_seri, u_seri, v_seri, pbl_eps, & 18 qsub, qissr, qcld, subfra, issrfra, gamma_cond, & 19 ratio_qi_qtot, dcf_sub, dcf_con, dcf_mix, & 20 dqi_adj, dqi_sub, dqi_con, dqi_mix, dqvc_adj, & 21 dqvc_sub, dqvc_con, dqvc_mix, qsatl, qsati, & 22 Tcontr, qcontr, qcontr2, fcontrN, fcontrP, dcf_avi,& 23 dqi_avi, dqvc_avi, flight_dist, flight_h2o, & 20 24 cloudth_sth,cloudth_senv,cloudth_sigmath,cloudth_sigmaenv, & 21 25 qraindiag, qsnowdiag, dqreva, dqssub, dqrauto, & … … 98 102 USE lmdz_lscp_tools, ONLY : calc_qsat_ecmwf, icefrac_lscp, calc_gammasat 99 103 USE lmdz_lscp_tools, ONLY : fallice_velocity, distance_to_cloud_top 100 USE ice_sursat_mod, ONLY : ice_sursat104 USE lmdz_lscp_condensation, ONLY : condensation_lognormal, condensation_ice_supersat 101 105 USE lmdz_lscp_poprecip, ONLY : poprecip_precld, poprecip_postcld 102 106 103 107 ! Use du module lmdz_lscp_ini contenant les constantes 104 USE lmdz_lscp_ini, ONLY : prt_level, lunout 108 USE lmdz_lscp_ini, ONLY : prt_level, lunout, eps 105 109 USE lmdz_lscp_ini, ONLY : seuil_neb, niter_lscp, iflag_evap_prec, t_coup, DDT0, ztfondue, rain_int_min 106 110 USE lmdz_lscp_ini, ONLY : ok_radocond_snow, a_tr_sca, cld_expo_con, cld_expo_lsc … … 111 115 USE lmdz_lscp_ini, ONLY : RCPD, RLSTT, RLVTT, RLMLT, RVTMP2, RTT, RD, RG 112 116 USE lmdz_lscp_ini, ONLY : ok_poprecip 117 USE lmdz_lscp_ini, ONLY : ok_external_lognormal, ok_ice_supersat, ok_unadjusted_clouds 113 118 114 119 IMPLICIT NONE … … 132 137 INTEGER, INTENT(IN) :: iflag_ice_thermo! flag to activate the ice thermodynamics 133 138 ! CR: if iflag_ice_thermo=2, only convection is active 134 LOGICAL, INTENT(IN) :: ok_ice_sursat ! flag to determine if ice sursaturation is activated135 136 139 LOGICAL, DIMENSION(klon,klev), INTENT(IN) :: ptconv ! grid points where deep convection scheme is active 137 140 … … 150 153 REAL, DIMENSION(klon,klev), INTENT(INOUT) :: ratqs ! function of pressure that sets the large-scale 151 154 152 153 ! Input sursaturation en glace 154 REAL, DIMENSION(klon,klev), INTENT(INOUT):: rneb_seri ! fraction nuageuse en memoire 155 ! INPUT/OUTPUT condensation and ice supersaturation 156 !-------------------------------------------------- 157 REAL, DIMENSION(klon,klev), INTENT(INOUT):: cf_seri ! cloud fraction [-] 158 REAL, DIMENSION(klon,klev), INTENT(INOUT):: ratio_qi_qtot ! solid specific water to total specific water ratio [-] 159 REAL, DIMENSION(klon,klev), INTENT(INOUT):: rvc_seri ! cloudy water vapor to total water vapor ratio [-] 160 REAL, DIMENSION(klon,klev), INTENT(IN) :: u_seri ! eastward wind [m/s] 161 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 REAL, DIMENSION(klon), INTENT(IN) :: cell_area ! area of each cell [m2] 164 165 ! INPUT/OUTPUT aviation 166 !-------------------------------------------------- 167 REAL, DIMENSION(klon,klev), INTENT(IN) :: flight_dist ! Aviation distance flown within the mesh [m/s/mesh] 168 REAL, DIMENSION(klon,klev), INTENT(IN) :: flight_h2o ! Aviation H2O emitted within the mesh [kg H2O/s/mesh] 155 169 156 170 ! OUTPUT variables … … 170 184 REAL, DIMENSION(klon), INTENT(OUT) :: rain ! surface large-scale rainfall [kg/s/m2] 171 185 REAL, DIMENSION(klon), INTENT(OUT) :: snow ! surface large-scale snowfall [kg/s/m2] 172 REAL, DIMENSION(klon,klev), INTENT(OUT) :: qsatl ! saturation specific humidity wrt liquid [kg/kg]173 REAL, DIMENSION(klon,klev), INTENT(OUT) :: qsats ! saturation specific humidity wrt ice [kg/kg]174 186 REAL, DIMENSION(klon,klev+1), INTENT(OUT) :: prfl ! large-scale rainfall flux in the column [kg/s/m2] 175 187 REAL, DIMENSION(klon,klev+1), INTENT(OUT) :: psfl ! large-scale snowfall flux in the column [kg/s/m2] … … 183 195 REAL, DIMENSION(klon,klev), INTENT(OUT) :: frac_nucl ! scavenging fraction due tu nucleation [-] 184 196 185 ! for supersaturation and contrails parameterisation 186 187 REAL, DIMENSION(klon,klev), INTENT(OUT) :: qclr ! specific total water content in clear sky region [kg/kg] 188 REAL, DIMENSION(klon,klev), INTENT(OUT) :: qcld ! specific total water content in cloudy region [kg/kg] 189 REAL, DIMENSION(klon,klev), INTENT(OUT) :: qss ! specific total water content in supersat region [kg/kg] 190 REAL, DIMENSION(klon,klev), INTENT(OUT) :: qvc ! specific vapor content in clouds [kg/kg] 191 REAL, DIMENSION(klon,klev), INTENT(OUT) :: rnebclr ! mesh fraction of clear sky [-] 192 REAL, DIMENSION(klon,klev), INTENT(OUT) :: rnebss ! mesh fraction of ISSR [-] 193 REAL, DIMENSION(klon,klev), INTENT(OUT) :: gamma_ss ! coefficient governing the ice nucleation RHi threshold [-] 194 REAL, DIMENSION(klon,klev), INTENT(OUT) :: Tcontr ! threshold temperature for contrail formation [K] 195 REAL, DIMENSION(klon,klev), INTENT(OUT) :: qcontr ! threshold humidity for contrail formation [kg/kg] 196 REAL, DIMENSION(klon,klev), INTENT(OUT) :: qcontr2 ! // (2nd expression more consistent with LMDZ expression of q) 197 REAL, DIMENSION(klon,klev), INTENT(OUT) :: fcontrN ! fraction of grid favourable to non-persistent contrails 198 REAL, DIMENSION(klon,klev), INTENT(OUT) :: fcontrP ! fraction of grid favourable to persistent contrails 199 REAL, DIMENSION(klon,klev), INTENT(OUT) :: cloudth_sth ! mean saturation deficit in thermals 200 REAL, DIMENSION(klon,klev), INTENT(OUT) :: cloudth_senv ! mean saturation deficit in environment 201 REAL, DIMENSION(klon,klev), INTENT(OUT) :: cloudth_sigmath ! std of saturation deficit in thermals 202 REAL, DIMENSION(klon,klev), INTENT(OUT) :: cloudth_sigmaenv ! std of saturation deficit in environment 197 ! for condensation and ice supersaturation 198 199 REAL, DIMENSION(klon,klev), INTENT(OUT) :: qsub !--specific total water content in sub-saturated clear sky region [kg/kg] 200 REAL, DIMENSION(klon,klev), INTENT(OUT) :: qissr !--specific total water content in supersat region [kg/kg] 201 REAL, DIMENSION(klon,klev), INTENT(OUT) :: qcld !--specific total water content in cloudy region [kg/kg] 202 REAL, DIMENSION(klon,klev), INTENT(OUT) :: subfra !--mesh fraction of subsaturated clear sky [-] 203 REAL, DIMENSION(klon,klev), INTENT(OUT) :: issrfra !--mesh fraction of ISSR [-] 204 REAL, DIMENSION(klon,klev), INTENT(OUT) :: gamma_cond !--coefficient governing the ice nucleation RHi threshold [-] 205 REAL, DIMENSION(klon,klev), INTENT(OUT) :: dcf_sub !--cloud fraction tendency because of sublimation [s-1] 206 REAL, DIMENSION(klon,klev), INTENT(OUT) :: dcf_con !--cloud fraction tendency because of condensation [s-1] 207 REAL, DIMENSION(klon,klev), INTENT(OUT) :: dcf_mix !--cloud fraction tendency because of cloud mixing [s-1] 208 REAL, DIMENSION(klon,klev), INTENT(OUT) :: dqi_adj !--specific ice content tendency because of temperature adjustment [kg/kg/s] 209 REAL, DIMENSION(klon,klev), INTENT(OUT) :: dqi_sub !--specific ice content tendency because of sublimation [kg/kg/s] 210 REAL, DIMENSION(klon,klev), INTENT(OUT) :: dqi_con !--specific ice content tendency because of condensation [kg/kg/s] 211 REAL, DIMENSION(klon,klev), INTENT(OUT) :: dqi_mix !--specific ice content tendency because of cloud mixing [kg/kg/s] 212 REAL, DIMENSION(klon,klev), INTENT(OUT) :: dqvc_adj !--specific cloud water vapor tendency because of temperature adjustment [kg/kg/s] 213 REAL, DIMENSION(klon,klev), INTENT(OUT) :: dqvc_sub !--specific cloud water vapor tendency because of sublimation [kg/kg/s] 214 REAL, DIMENSION(klon,klev), INTENT(OUT) :: dqvc_con !--specific cloud water vapor tendency because of condensation [kg/kg/s] 215 REAL, DIMENSION(klon,klev), INTENT(OUT) :: dqvc_mix !--specific cloud water vapor tendency because of cloud mixing [kg/kg/s] 216 REAL, DIMENSION(klon,klev), INTENT(OUT) :: qsatl !--saturation specific humidity wrt liquid [kg/kg] 217 REAL, DIMENSION(klon,klev), INTENT(OUT) :: qsati !--saturation specific humidity wrt ice [kg/kg] 218 219 ! for contrails and aviation 220 221 REAL, DIMENSION(klon,klev), INTENT(OUT) :: Tcontr !--threshold temperature for contrail formation [K] 222 REAL, DIMENSION(klon,klev), INTENT(OUT) :: qcontr !--threshold humidity for contrail formation [kg/kg] 223 REAL, DIMENSION(klon,klev), INTENT(OUT) :: qcontr2 !--// (2nd expression more consistent with LMDZ expression of q) 224 REAL, DIMENSION(klon,klev), INTENT(OUT) :: fcontrN !--fraction of grid favourable to non-persistent contrails 225 REAL, DIMENSION(klon,klev), INTENT(OUT) :: fcontrP !--fraction of grid favourable to persistent contrails 226 REAL, DIMENSION(klon,klev), INTENT(OUT) :: dcf_avi !--cloud fraction tendency because of aviation [s-1] 227 REAL, DIMENSION(klon,klev), INTENT(OUT) :: dqi_avi !--specific ice content tendency because of aviation [kg/kg/s] 228 REAL, DIMENSION(klon,klev), INTENT(OUT) :: dqvc_avi !--specific cloud water vapor tendency because of aviation [kg/kg/s] 229 203 230 204 231 ! for POPRECIP … … 217 244 REAL, DIMENSION(klon,klev), INTENT(OUT) :: dqsfreez !--snow tendency due to freezing [kg/kg/s] 218 245 REAL, DIMENSION(klon,klev), INTENT(OUT) :: dqrfreez !--rain tendency due to freezing [kg/kg/s] 246 247 ! for thermals 248 249 REAL, DIMENSION(klon,klev), INTENT(OUT) :: cloudth_sth !--mean saturation deficit in thermals 250 REAL, DIMENSION(klon,klev), INTENT(OUT) :: cloudth_senv !--mean saturation deficit in environment 251 REAL, DIMENSION(klon,klev), INTENT(OUT) :: cloudth_sigmath !--std of saturation deficit in thermals 252 REAL, DIMENSION(klon,klev), INTENT(OUT) :: cloudth_sigmaenv !--std of saturation deficit in environment 219 253 220 254 … … 282 316 REAL :: effective_zneb 283 317 REAL, DIMENSION(klon) :: distcltop1D, temp_cltop1D 318 319 ! for condensation and ice supersaturation 320 REAL, DIMENSION(klon) :: qvc, shear 321 REAL :: delta_z 322 !--Added for ice supersaturation (ok_ice_supersat) and contrails (ok_plane_contrails) 323 ! Constants used for calculating ratios that are advected (using a parent-child 324 ! formalism). This is not done in the dynamical core because at this moment, 325 ! only isotopes can use this parent-child formalism. Note that the two constants 326 ! are the same as the one use in the dynamical core, being also defined in 327 ! dyn3d_common/infotrac.F90 328 REAL :: min_qParent, min_ratio 284 329 285 330 … … 363 408 temp_cltop1D(:) = 0.0 364 409 ztupnew(:)=0.0 365 !--ice supersaturation 366 gamma_ss(:,:) = 1.0 367 qss(:,:) = 0.0 368 rnebss(:,:) = 0.0 369 Tcontr(:,:) = missing_val 370 qcontr(:,:) = missing_val 371 qcontr2(:,:) = missing_val 372 fcontrN(:,:) = 0.0 373 fcontrP(:,:) = 0.0 410 374 411 distcltop(:,:)=0. 375 412 temp_cltop(:,:)=0. 413 414 !--Ice supersaturation 415 gamma_cond(:,:) = 1. 416 qissr(:,:) = 0. 417 issrfra(:,:) = 0. 418 dcf_sub(:,:) = 0. 419 dcf_con(:,:) = 0. 420 dcf_mix(:,:) = 0. 421 dqi_adj(:,:) = 0. 422 dqi_sub(:,:) = 0. 423 dqi_con(:,:) = 0. 424 dqi_mix(:,:) = 0. 425 dqvc_adj(:,:) = 0. 426 dqvc_sub(:,:) = 0. 427 dqvc_con(:,:) = 0. 428 dqvc_mix(:,:) = 0. 429 fcontrN(:,:) = 0. 430 fcontrP(:,:) = 0. 431 Tcontr(:,:) = missing_val 432 qcontr(:,:) = missing_val 433 qcontr2(:,:) = missing_val 434 dcf_avi(:,:) = 0. 435 dqi_avi(:,:) = 0. 436 dqvc_avi(:,:) = 0. 437 qvc(:) = 0. 438 shear(:) = 0. 439 min_qParent = 1.e-30 440 min_ratio = 1.e-16 441 376 442 !-- poprecip 377 443 qraindiag(:,:)= 0. … … 759 825 rneblsvol(i,k)=ctot_vol(i,k) 760 826 zqn(i)=qcloud(i) 827 !--AB grid-mean vapor in the cloud - we assume saturation adjustment 828 qvc(i) = rneb(i,k) * zqs(i) 761 829 ENDDO 762 830 … … 794 862 DO iter=1,iflag_fisrtilp_qsat+1 795 863 864 keepgoing(:) = .FALSE. 865 796 866 DO i=1,klon 797 867 798 868 ! keepgoing = .true. while convergence is not satisfied 799 keepgoing(i)=ABS(DT(i)).GT.DDT0 800 801 IF ((keepgoing(i) .OR. (n_i(i) .EQ. 0)) .AND. lognormale(i)) THEN 869 870 IF (((ABS(DT(i)).GT.DDT0) .OR. (n_i(i) .EQ. 0)) .AND. lognormale(i)) THEN 802 871 803 872 ! if not convergence: 873 ! we calculate a new iteration 874 keepgoing(i) = .TRUE. 804 875 805 876 ! P2.2.1> cloud fraction and condensed water mass calculation … … 833 904 CALL icefrac_lscp(klon, zt(:), iflag_ice_thermo, distcltop1D(:),temp_cltop1D(:),zfice(:),dzfice(:)) 834 905 906 907 !--AB Activates a condensation scheme that allows for 908 !--ice supersaturation and contrails evolution from aviation 909 IF (ok_ice_supersat) THEN 910 911 !--Calculate the shear value (input for condensation and ice supersat) 912 DO i = 1, klon 913 !--Cell thickness [m] 914 delta_z = ( paprs(i,k) - paprs(i,k+1) ) / RG / pplay(i,k) * Tbef(i) * RD 915 IF ( iftop ) THEN 916 ! top 917 shear(i) = SQRT( ( (u_seri(i,k) - u_seri(i,k-1)) / delta_z )**2. & 918 + ( (v_seri(i,k) - v_seri(i,k-1)) / delta_z )**2. ) 919 ELSEIF ( k .EQ. 1 ) THEN 920 ! surface 921 shear(i) = SQRT( ( (u_seri(i,k+1) - u_seri(i,k)) / delta_z )**2. & 922 + ( (v_seri(i,k+1) - v_seri(i,k)) / delta_z )**2. ) 923 ELSE 924 ! other layers 925 shear(i) = SQRT( ( ( (u_seri(i,k+1) + u_seri(i,k)) / 2. & 926 - (u_seri(i,k) + u_seri(i,k-1)) / 2. ) / delta_z )**2. & 927 + ( ( (v_seri(i,k+1) + v_seri(i,k)) / 2. & 928 - (v_seri(i,k) + v_seri(i,k-1)) / 2. ) / delta_z )**2. ) 929 ENDIF 930 ENDDO 931 932 !--------------------------------------------- 933 !-- CONDENSATION AND ICE SUPERSATURATION -- 934 !--------------------------------------------- 935 936 CALL condensation_ice_supersat( & 937 klon, dtime, missing_val, & 938 pplay(:,k), paprs(:,k), paprs(:,k+1), & 939 cf_seri(:,k), rvc_seri(:,k), ratio_qi_qtot(:,k), & 940 shear(:), pbl_eps(:,k), cell_area(:), & 941 Tbef(:), zq(:), zqs(:), gammasat(:), ratqs(:,k), keepgoing(:), & 942 rneb(:,k), zqn(:), qvc(:), issrfra(:,k), qissr(:,k), & 943 dcf_sub(:,k), dcf_con(:,k), dcf_mix(:,k), & 944 dqi_adj(:,k), dqi_sub(:,k), dqi_con(:,k), dqi_mix(:,k), & 945 dqvc_adj(:,k), dqvc_sub(:,k), dqvc_con(:,k), dqvc_mix(:,k), & 946 Tcontr(:,k), qcontr(:,k), qcontr2(:,k), fcontrN(:,k), fcontrP(:,k), & 947 flight_dist(:,k), flight_h2o(:,k), & 948 dcf_avi(:,k), dqi_avi(:,k), dqvc_avi(:,k)) 949 950 951 !--If .TRUE., calls an externalised version of the generalised 952 !--lognormal condensation scheme (Bony and Emanuel 2001) 953 !--Numerically, convergence is conserved with this option 954 !--The objective is to simplify LSCP 955 ELSEIF ( ok_external_lognormal ) THEN 956 957 CALL condensation_lognormal( & 958 klon, Tbef(:), zq(:), zqs(:), gammasat(:), ratqs(:,k), & 959 keepgoing(:), rneb(:,k), zqn(:), qvc(:)) 960 961 962 ELSE !--Generalised lognormal (Bony and Emanuel 2001) 963 835 964 DO i=1,klon !todoan : check if loop in i is needed 836 965 837 IF ( (keepgoing(i) .OR. (n_i(i) .EQ. 0)) .AND. lognormale(i)) THEN966 IF (keepgoing(i)) THEN 838 967 839 968 zpdf_sig(i)=ratqs(i,k)*zq(i) … … 849 978 zpdf_e2(i)=1.-erf(zpdf_e2(i)) 850 979 851 IF ((.NOT.ok_ice_sursat).OR.(Tbef(i).GT.t_glace_min)) THEN852 853 980 IF (zpdf_e1(i).LT.1.e-10) THEN 854 981 rneb(i,k)=0. 855 zqn(i)=gammasat(i)*zqs(i) 982 zqn(i)=zqs(i) 983 !--AB grid-mean vapor in the cloud - we assume saturation adjustment 984 qvc(i) = 0. 856 985 ELSE 857 986 rneb(i,k)=0.5*zpdf_e1(i) 858 987 zqn(i)=zq(i)*zpdf_e2(i)/zpdf_e1(i) 988 !--AB grid-mean vapor in the cloud - we assume saturation adjustment 989 qvc(i) = rneb(i,k) * zqs(i) 859 990 ENDIF 860 991 861 rnebss(i,k)=0.0 !--added by OB (needed because of the convergence loop on time) 862 fcontrN(i,k)=0.0 !--idem 863 fcontrP(i,k)=0.0 !--idem 864 qss(i,k)=0.0 !--idem 865 866 ELSE ! in case of ice supersaturation by Audran 867 868 !------------------------------------ 869 ! ICE SUPERSATURATION 870 !------------------------------------ 871 872 CALL ice_sursat(pplay(i,k), paprs(i,k)-paprs(i,k+1), dtime, i, k, temp(i,k), zq(i), & 873 gamma_ss(i,k), zqs(i), Tbef(i), rneb_seri(i,k), ratqs(i,k), & 874 rneb(i,k), zqn(i), rnebss(i,k), qss(i,k), & 875 Tcontr(i,k), qcontr(i,k), qcontr2(i,k), fcontrN(i,k), fcontrP(i,k) ) 876 877 ENDIF ! ((flag_ice_sursat.eq.0).or.(Tbef(i).gt.t_glace_min)) 992 ENDIF ! keepgoing 993 ENDDO ! loop on klon 994 995 ENDIF ! .NOT. ok_ice_supersat 996 997 DO i=1,klon 998 IF (keepgoing(i)) THEN 878 999 879 1000 ! If vertical heterogeneity, change fraction by volume as well … … 958 1079 zqn(i) = zq(i) 959 1080 rneb(i,k) = 1.0 960 zcond(i) = MAX(0.0,zqn(i)-zqs(i)) 1081 IF ( ok_unadjusted_clouds ) THEN 1082 !--AB We relax the saturation adjustment assumption 1083 !-- qvc (grid-mean vapor in cloud) is calculated by the condensation scheme 1084 zcond(i) = MAX(0., zqn(i) - qvc(i)) 1085 ELSE 1086 zcond(i) = MAX(0.0,zqn(i)-zqs(i)) 1087 ENDIF 961 1088 rhcl(i,k)=1.0 962 1089 ELSE 963 zcond(i) = MAX(0.0,zqn(i)-zqs(i))*rneb(i,k) 1090 IF ( ok_unadjusted_clouds ) THEN 1091 !--AB We relax the saturation adjustment assumption 1092 !-- qvc (grid-mean vapor in cloud) is calculated by the condensation scheme 1093 zcond(i) = MAX(0., zqn(i) * rneb(i,k) - qvc(i)) 1094 ELSE 1095 zcond(i) = MAX(0.0,zqn(i)-zqs(i))*rneb(i,k) 1096 ENDIF 964 1097 ! following line is very strange and probably wrong: 965 1098 rhcl(i,k)=(zqs(i)+zq(i))/2./zqs(i) … … 985 1118 rneblsvol(1:klon,k)=ctot_vol(1:klon,k) 986 1119 ENDIF 1120 1121 !--AB Write diagnostics and tracers for ice supersaturation 1122 IF ( ok_ice_supersat ) THEN 1123 CALL calc_qsat_ecmwf(klon,zt,qzero,pplay(:,k),RTT,1,.false.,qsatl(:,k),zdqs) 1124 CALL calc_qsat_ecmwf(klon,zt,qzero,pplay(:,k),RTT,2,.false.,qsati(:,k),zdqs) 1125 1126 DO i = 1, klon 1127 1128 cf_seri(i,k) = rneb(i,k) 1129 1130 IF ( .NOT. ok_unadjusted_clouds ) THEN 1131 qvc(i) = zqs(i) * rneb(i,k) 1132 ENDIF 1133 IF ( zq(i) .GT. min_qParent ) THEN 1134 rvc_seri(i,k) = qvc(i) / zq(i) 1135 ELSE 1136 rvc_seri(i,k) = min_ratio 1137 ENDIF 1138 !--The MIN barrier is NEEDED because of: 1139 !-- 1) very rare pathological cases of the lsc scheme (rvc = 1. + 1e-16 sometimes) 1140 !-- 2) the thermal scheme does NOT guarantee that qvc <= qvap (or even qincld <= qtot) 1141 !--The MAX barrier is a safeguard that should not be activated 1142 rvc_seri(i,k) = MIN(MAX(rvc_seri(i,k), 0.), 1.) 1143 1144 !--Diagnostics 1145 gamma_cond(i,k) = gammasat(i) 1146 IF ( issrfra(i,k) .LT. eps ) THEN 1147 issrfra(i,k) = 0. 1148 qissr(i,k) = 0. 1149 ENDIF 1150 subfra(i,k) = 1. - cf_seri(i,k) - issrfra(i,k) 1151 qsub(i,k) = zq(i) - qvc(i) - qissr(i,k) 1152 IF ( subfra(i,k) .LT. eps ) THEN 1153 subfra(i,k) = 0. 1154 qsub(i,k) = 0. 1155 ENDIF 1156 qcld(i,k) = qvc(i) + zcond(i) 1157 IF ( cf_seri(i,k) .LT. eps ) THEN 1158 qcld(i,k) = 0. 1159 ENDIF 1160 ENDDO 1161 ENDIF 1162 987 1163 988 1164 ! ---------------------------------------------------------------- … … 1407 1583 ENDDO 1408 1584 1409 !--save some variables for ice supersaturation1410 !1411 DO i = 1, klon1412 ! for memory1413 rneb_seri(i,k) = rneb(i,k)1414 1415 ! for diagnostics1416 rnebclr(i,k) = 1.0 - rneb(i,k) - rnebss(i,k)1417 1418 qvc(i,k) = zqs(i) * rneb(i,k)1419 qclr(i,k) = MAX(1.e-10,zq(i) - qvc(i,k) - qss(i,k)) !--added by OB because of pathologic cases with the lognormal1420 qcld(i,k) = qvc(i,k) + zcond(i)1421 ENDDO1422 !q_sat1423 CALL calc_qsat_ecmwf(klon,Tbef(:),qzero(:),pplay(:,k),RTT,1,.false.,qsatl(:,k),zdqs(:))1424 CALL calc_qsat_ecmwf(klon,Tbef(:),qzero(:),pplay(:,k),RTT,2,.false.,qsats(:,k),zdqs(:))1425 1426 1427 1428 1585 ! Outputs: 1429 1586 !------------------------------- -
LMDZ6/branches/cirrus/libf/phylmd/lmdz_lscp_ini.F90
r4915 r4951 6 6 !-------------------- 7 7 8 REAL RCPD, RLSTT, RLVTT, RLMLT, RVTMP2, RTT, RD, R G, RPI9 !$OMP THREADPRIVATE(RCPD, RLSTT, RLVTT, RLMLT, RVTMP2, RTT, RD, R G, RPI)8 REAL RCPD, RLSTT, RLVTT, RLMLT, RVTMP2, RTT, RD, RV, RG, RPI, EPS_W 9 !$OMP THREADPRIVATE(RCPD, RLSTT, RLVTT, RLMLT, RVTMP2, RTT, RD, RV, RG, RPI, EPS_W) 10 10 11 11 REAL, SAVE, PROTECTED :: seuil_neb=0.001 ! cloud fraction threshold: a cloud can precipitate when exceeded … … 136 136 !$OMP THREADPRIVATE(dist_liq) 137 137 138 REAL, SAVE, PROTECTED 138 REAL, SAVE, PROTECTED :: tresh_cl=0.0 ! cloud fraction threshold for cloud top search 139 139 !$OMP THREADPRIVATE(tresh_cl) 140 141 !--Parameters for condensation and ice supersaturation 142 LOGICAL, SAVE, PROTECTED :: ok_external_lognormal=.FALSE. ! if True, the lognormal condensation scheme is calculated in the lmdz_lscp_condensation routine 143 !$OMP THREADPRIVATE(ok_external_lognormal) 144 145 LOGICAL, SAVE, PROTECTED :: ok_ice_supersat=.FALSE. ! activates the condensation scheme that allows for ice supersaturation 146 !$OMP THREADPRIVATE(ok_ice_supersat) 147 148 LOGICAL, SAVE, PROTECTED :: ok_unadjusted_clouds=.FALSE. ! if True, relax the saturation adjustment assumption for ice clouds 149 !$OMP THREADPRIVATE(ok_unadjusted_clouds) 150 151 LOGICAL, SAVE, PROTECTED :: ok_weibull_warm_clouds=.FALSE. ! if True, the weibull condensation scheme replaces the lognormal condensation scheme at positive temperatures 152 !$OMP THREADPRIVATE(ok_weibull_warm_clouds) 153 154 INTEGER, SAVE, PROTECTED :: iflag_cloud_sublim_pdf=3 ! iflag for the distribution of water inside ice clouds 155 !$OMP THREADPRIVATE(iflag_cloud_sublim_pdf) 156 157 REAL, SAVE, PROTECTED :: mu_subl_pdf_lscp=1./3. ! [-] shape factor of the gamma distribution of water inside ice clouds 158 !$OMP THREADPRIVATE(mu_subl_pdf_lscp) 159 160 REAL, SAVE, PROTECTED :: beta_pdf_lscp=2.8e-3 ! [] 161 !$OMP THREADPRIVATE(beta_pdf_lscp) 162 163 REAL, SAVE, PROTECTED :: temp_thresh_pdf_lscp=188. ! [K] below this temperature, water vapor is homoegeneously distributed in the clear sky region 164 !$OMP THREADPRIVATE(temp_thresh_pdf_lscp) 165 166 REAL, SAVE, PROTECTED :: rhlmid_pdf_lscp=57.6 ! [%] 167 !$OMP THREADPRIVATE(rhlmid_pdf_lscp) 168 169 REAL, SAVE, PROTECTED :: k0_pdf_lscp=1.75 ! [-] minimum value of the shape parameter for the weibull law 170 !$OMP THREADPRIVATE(k0_pdf_lscp) 171 172 REAL, SAVE, PROTECTED :: kappa_pdf_lscp=0.0147 ! [] 173 !$OMP THREADPRIVATE(kappa_pdf_lscp) 174 175 REAL, SAVE, PROTECTED :: rhl0_pdf_lscp=81.5 ! [%] 176 !$OMP THREADPRIVATE(rhl0_pdf_lscp) 177 178 REAL, SAVE, PROTECTED :: cond_thresh_pdf_lscp=1.E-7 ! [-] 179 !$OMP THREADPRIVATE(cond_thresh_pdf_lscp) 180 181 REAL, SAVE, PROTECTED :: a_homofreez=2.349 ! [-] 182 !$OMP THREADPRIVATE(a_homofreez) 183 184 REAL, SAVE, PROTECTED :: b_homofreez=259. ! [K] 185 !$OMP THREADPRIVATE(b_homofreez) 186 187 REAL, SAVE, PROTECTED :: delta_hetfreez=1. ! [-] value between 0 and 1 to simulate for heterogeneous freezing. 188 !$OMP THREADPRIVATE(delta_hetfreez) 189 190 REAL, SAVE, PROTECTED :: coef_mixing_lscp=1e-7 ! [-] 191 !$OMP THREADPRIVATE(coef_mixing_lscp) 192 193 REAL, SAVE, PROTECTED :: coef_shear_lscp=0.1 ! [-] 194 !$OMP THREADPRIVATE(coef_shear_lscp) 195 196 REAL, SAVE, PROTECTED :: chi_mixing_lscp=1.1 ! [-] 197 !$OMP THREADPRIVATE(chi_mixing_lscp) 198 199 ! REAL, SAVE, PROTECTED :: contrail_cross_section=200000. 200 ! !$OMP THREADPRIVATE(contrail_cross_section) 201 !--End of the parameters for condensation and ice supersaturation 140 202 141 203 !--Parameters for poprecip … … 225 287 CONTAINS 226 288 227 SUBROUTINE lscp_ini(dtime,lunout_in,prt_level_in,ok_ice_sursat, iflag_ratqs, fl_cor_ebil_in, RCPD_in, RLSTT_in, RLVTT_in, RLMLT_in, & 228 RVTMP2_in, RTT_in,RD_in,RG_in,RPI_in) 289 SUBROUTINE lscp_ini(dtime,lunout_in,prt_level_in,ok_ice_supersat_in, iflag_ratqs, fl_cor_ebil_in, & 290 RCPD_in, RLSTT_in, RLVTT_in, RLMLT_in, RVTMP2_in, & 291 RTT_in, RD_in, RV_in, RG_in, RPI_in, EPS_W_in) 229 292 230 293 231 294 USE ioipsl_getin_p_mod, ONLY : getin_p 232 USE ice_sursat_mod, ONLY: ice_sursat_init233 295 USE lmdz_cloudth_ini, ONLY : cloudth_ini 234 296 235 297 REAL, INTENT(IN) :: dtime 236 298 INTEGER, INTENT(IN) :: lunout_in,prt_level_in,iflag_ratqs,fl_cor_ebil_in 237 LOGICAL, INTENT(IN) :: ok_ice_su rsat299 LOGICAL, INTENT(IN) :: ok_ice_supersat_in 238 300 239 301 REAL, INTENT(IN) :: RCPD_in, RLSTT_in, RLVTT_in, RLMLT_in 240 REAL, INTENT(IN) :: RVTMP2_in, RTT_in, RD_in, RG_in, RPI_in302 REAL, INTENT(IN) :: RVTMP2_in, RTT_in, RD_in, RV_in, RG_in, RPI_in, EPS_W_in 241 303 character (len=20) :: modname='lscp_ini_mod' 242 304 character (len=80) :: abort_message … … 247 309 fl_cor_ebil=fl_cor_ebil_in 248 310 311 ok_ice_supersat=ok_ice_supersat_in 312 249 313 RG=RG_in 250 314 RD=RD_in 315 RV=RV_in 251 316 RCPD=RCPD_in 252 317 RLVTT=RLVTT_in … … 257 322 RVTMP2=RVTMP2_in 258 323 RPI=RPI_in 324 EPS_W=EPS_W_in 259 325 260 326 … … 297 363 CALL getin_p('tresh_cl',tresh_cl) 298 364 CALL getin_p('iflag_oldbug_fisrtilp',iflag_oldbug_fisrtilp) 365 ! for poprecip 299 366 CALL getin_p('ok_poprecip',ok_poprecip) 300 367 CALL getin_p('ok_corr_vap_evasub',ok_corr_vap_evasub) … … 316 383 CALL getin_p('snow_fallspeed_clr',snow_fallspeed_clr) 317 384 CALL getin_p('snow_fallspeed_cld',snow_fallspeed_cld) 385 ! for condensation and ice supersaturation 386 CALL getin_p('ok_external_lognormal',ok_external_lognormal) 387 CALL getin_p('ok_unadjusted_clouds',ok_unadjusted_clouds) 388 CALL getin_p('ok_weibull_warm_clouds',ok_weibull_warm_clouds) 389 CALL getin_p('iflag_cloud_sublim_pdf',iflag_cloud_sublim_pdf) 390 CALL getin_p('mu_subl_pdf_lscp',mu_subl_pdf_lscp) 391 CALL getin_p('beta_pdf_lscp',beta_pdf_lscp) 392 CALL getin_p('temp_thresh_pdf_lscp',temp_thresh_pdf_lscp) 393 CALL getin_p('rhlmid_pdf_lscp',rhlmid_pdf_lscp) 394 CALL getin_p('k0_pdf_lscp',k0_pdf_lscp) 395 CALL getin_p('kappa_pdf_lscp',kappa_pdf_lscp) 396 CALL getin_p('rhl0_pdf_lscp',rhl0_pdf_lscp) 397 CALL getin_p('cond_thresh_pdf_lscp',cond_thresh_pdf_lscp) 398 CALL getin_p('a_homofreez',a_homofreez) 399 CALL getin_p('b_homofreez',b_homofreez) 400 CALL getin_p('delta_hetfreez',delta_hetfreez) 401 CALL getin_p('coef_mixing_lscp',coef_mixing_lscp) 402 CALL getin_p('coef_shear_lscp',coef_shear_lscp) 403 CALL getin_p('chi_mixing_lscp',chi_mixing_lscp) 404 !CALL getin_p('contrail_cross_section',contrail_cross_section) 318 405 319 406 … … 354 441 WRITE(lunout,*) 'lscp_ini, iflag_oldbug_fisrtilp', iflag_oldbug_fisrtilp 355 442 WRITE(lunout,*) 'lscp_ini, fl_cor_ebil', fl_cor_ebil 443 ! for poprecip 356 444 WRITE(lunout,*) 'lscp_ini, ok_poprecip', ok_poprecip 357 445 WRITE(lunout,*) 'lscp_ini, ok_corr_vap_evasub', ok_corr_vap_evasub … … 367 455 WRITE(lunout,*) 'lscp_ini, snow_fallspeed_clr:', snow_fallspeed_clr 368 456 WRITE(lunout,*) 'lscp_ini, snow_fallspeed_cld:', snow_fallspeed_cld 457 ! for condensation and ice supersaturation 458 WRITE(lunout,*) 'lscp_ini, ok_external_lognormal:', ok_external_lognormal 459 WRITE(lunout,*) 'lscp_ini, ok_ice_supersat:', ok_ice_supersat 460 WRITE(lunout,*) 'lscp_ini, ok_unadjusted_clouds:', ok_unadjusted_clouds 461 WRITE(lunout,*) 'lscp_ini, ok_weibull_warm_clouds:', ok_weibull_warm_clouds 462 WRITE(lunout,*) 'lscp_ini, iflag_cloud_sublim_pdf:', iflag_cloud_sublim_pdf 463 WRITE(lunout,*) 'lscp_ini, mu_subl_pdf_lscp:', mu_subl_pdf_lscp 464 WRITE(lunout,*) 'lscp_ini, beta_pdf_lscp:', beta_pdf_lscp 465 WRITE(lunout,*) 'lscp_ini, temp_thresh_pdf_lscp:', temp_thresh_pdf_lscp 466 WRITE(lunout,*) 'lscp_ini, rhlmid_pdf_lscp:', rhlmid_pdf_lscp 467 WRITE(lunout,*) 'lscp_ini, k0_pdf_lscp:', k0_pdf_lscp 468 WRITE(lunout,*) 'lscp_ini, kappa_pdf_lscp:', kappa_pdf_lscp 469 WRITE(lunout,*) 'lscp_ini, rhl0_pdf_lscp:', rhl0_pdf_lscp 470 WRITE(lunout,*) 'lscp_ini, a_homofreez:', a_homofreez 471 WRITE(lunout,*) 'lscp_ini, b_homofreez:', b_homofreez 472 WRITE(lunout,*) 'lscp_ini, delta_hetfreez', delta_hetfreez 473 WRITE(lunout,*) 'lscp_ini, coef_mixing_lscp:', coef_mixing_lscp 474 WRITE(lunout,*) 'lscp_ini, coef_shear_lscp:', coef_shear_lscp 475 WRITE(lunout,*) 'lscp_ini, chi_mixing_lscp:', chi_mixing_lscp 476 ! WRITE(lunout,*) 'lscp_ini, contrail_cross_section:', contrail_cross_section 369 477 370 478 … … 389 497 390 498 499 !--Check flags for condensation and ice supersaturation 500 IF ( ok_external_lognormal .AND. ok_ice_supersat ) THEN 501 abort_message = 'in lscp, ok_external_lognormal=y is incompatible with ok_ice_supersat=y' 502 CALL abort_physic (modname,abort_message,1) 503 ENDIF 504 505 IF ( ok_weibull_warm_clouds .AND. .NOT. ok_ice_supersat ) THEN 506 abort_message = 'in lscp, ok_weibull_warm_clouds=y needs ok_ice_supersat=y' 507 CALL abort_physic (modname,abort_message,1) 508 ENDIF 509 510 IF ( ok_unadjusted_clouds .AND. .NOT. ok_ice_supersat ) THEN 511 abort_message = 'in lscp, ok_unadjusted_clouds=y needs ok_ice_supersat=y' 512 CALL abort_physic (modname,abort_message,1) 513 ENDIF 514 515 391 516 !AA Temporary initialisation 392 517 a_tr_sca(1) = -0.5 … … 395 520 a_tr_sca(4) = -0.5 396 521 397 IF (ok_ice_sursat) CALL ice_sursat_init()398 399 522 CALL cloudth_ini(iflag_cloudth_vert,iflag_ratqs) 400 523 -
LMDZ6/branches/cirrus/libf/phylmd/lmdz_lscp_tools.F90
r4818 r4951 311 311 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 312 312 313 use lmdz_lscp_ini, only: iflag_gammasat, t_glace_min, RTT 313 use lmdz_lscp_ini, only: iflag_gammasat, temp_nowater, RTT 314 use lmdz_lscp_ini, only: a_homofreez, b_homofreez, delta_hetfreez 314 315 315 316 IMPLICIT NONE … … 326 327 327 328 REAL, DIMENSION(klon) :: qsi,qsl,dqsl,dqsi 328 REAL fcirrus, fac 329 REAL, PARAMETER :: acirrus=2.349 330 REAL, PARAMETER :: bcirrus=259.0 329 REAL f_homofreez, fac 331 330 332 331 INTEGER i … … 342 341 dgammasatdt(i)=0. 343 342 344 ELSEIF ((temp(i) .LT. RTT) .AND. (temp(i) .GT. t _glace_min)) THEN343 ELSEIF ((temp(i) .LT. RTT) .AND. (temp(i) .GT. temp_nowater)) THEN 345 344 346 345 IF (iflag_gammasat .GE. 2) THEN … … 355 354 356 355 IF (iflag_gammasat .GE.1) THEN 357 ! homogeneous freezing of aerosols, according to358 ! Koop, 2000 and Karcher 2008, QJRMS359 ! 'Cirrus regime'360 f cirrus=acirrus-temp(i)/bcirrus361 IF (f cirrus.GT. qsl(i)/qsi(i)) THEN356 ! homogeneous freezing of aerosols, according to 357 ! Koop, 2000 and Ren and MacKenzie, 2005 (QJRMS) 358 ! 'Cirrus regime' 359 f_homofreez=a_homofreez-temp(i)/b_homofreez 360 IF (f_homofreez .GT. qsl(i)/qsi(i)) THEN 362 361 gammasat(i)=qsl(i)/qsi(i) 363 362 dgammasatdt(i)=(dqsl(i)*qsi(i)-dqsi(i)*qsl(i))/qsi(i)/qsi(i) 364 363 ELSE 365 gammasat(i)= fcirrus366 dgammasatdt(i)=- 1.0/bcirrus364 gammasat(i)= (1.-delta_hetfreez) + delta_hetfreez * f_homofreez 365 dgammasatdt(i)=-delta_hetfreez/b_homofreez 367 366 ENDIF 368 367 … … 452 451 !++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 453 452 453 !++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 454 FUNCTION GAMMAINC ( p, x ) 455 456 !*****************************************************************************80 457 ! 458 !! GAMMAINC computes the regularized lower incomplete Gamma Integral 459 ! 460 ! Modified: 461 ! 462 ! 20 January 2008 463 ! 464 ! Author: 465 ! 466 ! Original FORTRAN77 version by B Shea. 467 ! FORTRAN90 version by John Burkardt. 468 ! 469 ! Reference: 470 ! 471 ! B Shea, 472 ! Algorithm AS 239: 473 ! Chi-squared and Incomplete Gamma Integral, 474 ! Applied Statistics, 475 ! Volume 37, Number 3, 1988, pages 466-473. 476 ! 477 ! Parameters: 478 ! 479 ! Input, real X, P, the parameters of the incomplete 480 ! gamma ratio. 0 <= X, and 0 < P. 481 ! 482 ! Output, real GAMMAINC, the value of the incomplete 483 ! Gamma integral. 484 ! 485 IMPLICIT NONE 486 487 REAL A 488 REAL AN 489 REAL ARG 490 REAL B 491 REAL C 492 REAL, PARAMETER :: ELIMIT = - 88.0E+00 493 REAL GAMMAINC 494 REAL, PARAMETER :: OFLO = 1.0E+37 495 REAL P 496 REAL, PARAMETER :: PLIMIT = 1000.0E+00 497 REAL PN1 498 REAL PN2 499 REAL PN3 500 REAL PN4 501 REAL PN5 502 REAL PN6 503 REAL RN 504 REAL, PARAMETER :: TOL = 1.0E-14 505 REAL X 506 REAL, PARAMETER :: XBIG = 1.0E+08 507 508 GAMMAINC = 0.0E+00 509 510 IF ( X == 0.0E+00 ) THEN 511 GAMMAINC = 0.0E+00 512 RETURN 513 END IF 514 ! 515 ! IF P IS LARGE, USE A NORMAL APPROXIMATION. 516 ! 517 IF ( PLIMIT < P ) THEN 518 519 PN1 = 3.0E+00 * SQRT ( P ) * ( ( X / P )**( 1.0E+00 / 3.0E+00 ) & 520 + 1.0E+00 / ( 9.0E+00 * P ) - 1.0E+00 ) 521 522 GAMMAINC = 0.5E+00 * ( 1. + ERF ( PN1 ) ) 523 RETURN 524 525 END IF 526 ! 527 ! IF X IS LARGE SET GAMMAD = 1. 528 ! 529 IF ( XBIG < X ) THEN 530 GAMMAINC = 1.0E+00 531 RETURN 532 END IF 533 ! 534 ! USE PEARSON'S SERIES EXPANSION. 535 ! (NOTE THAT P IS NOT LARGE ENOUGH TO FORCE OVERFLOW IN ALOGAM). 536 ! 537 IF ( X <= 1.0E+00 .OR. X < P ) THEN 538 539 ARG = P * LOG ( X ) - X - LOG_GAMMA ( P + 1.0E+00 ) 540 C = 1.0E+00 541 GAMMAINC = 1.0E+00 542 A = P 543 544 DO 545 546 A = A + 1.0E+00 547 C = C * X / A 548 GAMMAINC = GAMMAINC + C 549 550 IF ( C <= TOL ) THEN 551 EXIT 552 END IF 553 554 END DO 555 556 ARG = ARG + LOG ( GAMMAINC ) 557 558 IF ( ELIMIT <= ARG ) THEN 559 GAMMAINC = EXP ( ARG ) 560 ELSE 561 GAMMAINC = 0.0E+00 562 END IF 563 ! 564 ! USE A CONTINUED FRACTION EXPANSION. 565 ! 566 ELSE 567 568 ARG = P * LOG ( X ) - X - LOG_GAMMA ( P ) 569 A = 1.0E+00 - P 570 B = A + X + 1.0E+00 571 C = 0.0E+00 572 PN1 = 1.0E+00 573 PN2 = X 574 PN3 = X + 1.0E+00 575 PN4 = X * B 576 GAMMAINC = PN3 / PN4 577 578 DO 579 580 A = A + 1.0E+00 581 B = B + 2.0E+00 582 C = C + 1.0E+00 583 AN = A * C 584 PN5 = B * PN3 - AN * PN1 585 PN6 = B * PN4 - AN * PN2 586 587 IF ( PN6 /= 0.0E+00 ) THEN 588 589 RN = PN5 / PN6 590 591 IF ( ABS ( GAMMAINC - RN ) <= MIN ( TOL, TOL * RN ) ) THEN 592 EXIT 593 END IF 594 595 GAMMAINC = RN 596 597 END IF 598 599 PN1 = PN3 600 PN2 = PN4 601 PN3 = PN5 602 PN4 = PN6 603 ! 604 ! RE-SCALE TERMS IN CONTINUED FRACTION IF TERMS ARE LARGE. 605 ! 606 IF ( OFLO <= ABS ( PN5 ) ) THEN 607 PN1 = PN1 / OFLO 608 PN2 = PN2 / OFLO 609 PN3 = PN3 / OFLO 610 PN4 = PN4 / OFLO 611 END IF 612 613 END DO 614 615 ARG = ARG + LOG ( GAMMAINC ) 616 617 IF ( ELIMIT <= ARG ) THEN 618 GAMMAINC = 1.0E+00 - EXP ( ARG ) 619 ELSE 620 GAMMAINC = 1.0E+00 621 END IF 622 623 END IF 624 625 RETURN 626 END FUNCTION GAMMAINC 627 !++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 628 454 629 END MODULE lmdz_lscp_tools 455 630 -
LMDZ6/branches/cirrus/libf/phylmd/phyetat0_mod.F90
r4744 r4951 21 21 du_gwd_rando, du_gwd_front, entr_therm, f0, fm_therm, & 22 22 falb_dir, falb_dif, prw_ancien, prlw_ancien, prsw_ancien, prbsw_ancien, & 23 ftsol, pbl_tke, pctsrf, q_ancien, ql_ancien, qs_ancien, qbs_ancien, rneb_ancien, radpas, radsol, rain_fall, ratqs, & 23 ftsol, pbl_tke, pctsrf, q_ancien, ql_ancien, qs_ancien, qbs_ancien, & 24 cf_ancien, rvc_ancien, radpas, radsol, rain_fall, ratqs, & 24 25 rnebcon, rugoro, sig1, snow_fall, bs_fall, solaire_etat0, sollw, sollwdown, & 25 26 solsw, solswfdiff, t_ancien, u_ancien, v_ancien, w01, wake_cstar, wake_deltaq, & … … 397 398 ancien_ok=ancien_ok.AND.phyetat0_get(ql_ancien,"QLANCIEN","QLANCIEN",0.) 398 399 ancien_ok=ancien_ok.AND.phyetat0_get(qs_ancien,"QSANCIEN","QSANCIEN",0.) 399 ancien_ok=ancien_ok.AND.phyetat0_get(rneb_ancien,"RNEBANCIEN","RNEBANCIEN",0.)400 400 ancien_ok=ancien_ok.AND.phyetat0_get(u_ancien,"UANCIEN","UANCIEN",0.) 401 401 ancien_ok=ancien_ok.AND.phyetat0_get(v_ancien,"VANCIEN","VANCIEN",0.) … … 412 412 prbsw_ancien(:)=0. 413 413 ENDIF 414 415 ! cas specifique des variables de la sursaturation par rapport a la glace 416 IF ( ok_ice_supersat ) THEN 417 ancien_ok=ancien_ok.AND.phyetat0_get(cf_ancien,"CFANCIEN","CFANCIEN",0.) 418 ancien_ok=ancien_ok.AND.phyetat0_get(rvc_ancien,"RVCANCIEN","RVCANCIEN",0.) 419 ELSE 420 cf_ancien(:,:)=0. 421 rvc_ancien(:,:)=0. 422 ENDIF 414 423 415 424 ! Ehouarn: addtional tests to check if t_ancien, q_ancien contain … … 419 428 (maxval(ql_ancien).EQ.minval(ql_ancien)) .OR. & 420 429 (maxval(qs_ancien).EQ.minval(qs_ancien)) .OR. & 421 (maxval(rneb_ancien).EQ.minval(rneb_ancien)) .OR. &422 430 (maxval(prw_ancien).EQ.minval(prw_ancien)) .OR. & 423 431 (maxval(prlw_ancien).EQ.minval(prlw_ancien)) .OR. & … … 432 440 ancien_ok=.false. 433 441 ENDIF 442 ENDIF 443 444 IF ( ok_ice_supersat ) THEN 445 IF ( (maxval(cf_ancien).EQ.minval(cf_ancien)) .OR. & 446 (maxval(rvc_ancien).EQ.minval(rvc_ancien)) ) THEN 447 ancien_ok=.false. 448 ENDIF 434 449 ENDIF 435 450 -
LMDZ6/branches/cirrus/libf/phylmd/phyredem.F90
r4744 r4951 19 19 zval, rugoro, t_ancien, q_ancien, & 20 20 prw_ancien, prlw_ancien, prsw_ancien, prbsw_ancien, & 21 ql_ancien, qs_ancien, qbs_ancien, rneb_ancien, u_ancien, & 22 v_ancien, clwcon, rnebcon, ratqs, pbl_tke, & 21 ql_ancien, qs_ancien, qbs_ancien, cf_ancien, & 22 rvc_ancien, u_ancien, v_ancien, & 23 clwcon, rnebcon, ratqs, pbl_tke, & 23 24 wake_delta_pbl_tke, zmax0, f0, sig1, w01, & 24 25 wake_deltat, wake_deltaq, wake_s, awake_s, & … … 252 253 ENDIF 253 254 254 CALL put_field(pass,"RNEBANCIEN", "RNEBANCIEN", rneb_ancien) 255 IF ( ok_ice_supersat ) THEN 256 CALL put_field(pass,"CFANCIEN", "CFANCIEN", cf_ancien) 257 CALL put_field(pass,"RVCANCIEN", "RVCANCIEN", rvc_ancien) 258 ENDIF 255 259 256 260 CALL put_field(pass,"PRWANCIEN", "PRWANCIEN", prw_ancien) -
LMDZ6/branches/cirrus/libf/phylmd/phys_local_var_mod.F90
r4926 r4951 18 18 REAL, SAVE, ALLOCATABLE :: u_seri(:,:), v_seri(:,:) 19 19 !$OMP THREADPRIVATE(u_seri, v_seri) 20 REAL, SAVE, ALLOCATABLE :: rneb_seri(:,:) 21 !$OMP THREADPRIVATE(rneb_seri) 22 REAL, SAVE, ALLOCATABLE :: d_rneb_dyn(:,:) 23 !$OMP THREADPRIVATE(d_rneb_dyn) 20 REAL, SAVE, ALLOCATABLE :: cf_seri(:,:), rvc_seri(:,:) 21 !$OMP THREADPRIVATE(cf_seri, rvc_seri) 24 22 REAL, SAVE, ALLOCATABLE :: l_mixmin(:,:,:),l_mix(:,:,:),wprime(:,:,:) 25 23 !$OMP THREADPRIVATE(l_mixmin, l_mix, wprime) … … 38 36 REAL, SAVE, ALLOCATABLE :: d_u_dyn(:,:), d_v_dyn(:,:) 39 37 !$OMP THREADPRIVATE(d_u_dyn, d_v_dyn) 38 REAL, SAVE, ALLOCATABLE :: d_cf_dyn(:,:), d_rvc_dyn(:,:) 39 !$OMP THREADPRIVATE(d_cf_dyn, d_rvc_dyn) 40 40 REAL, SAVE, ALLOCATABLE :: d_tr_dyn(:,:,:) 41 41 !$OMP THREADPRIVATE(d_tr_dyn) … … 494 494 !$OMP THREADPRIVATE(zn2mout) 495 495 496 REAL, SAVE, ALLOCATABLE :: qclr(:,:) 497 !$OMP THREADPRIVATE(qclr) 498 REAL, SAVE, ALLOCATABLE :: qcld(:,:) 499 !$OMP THREADPRIVATE(qcld) 500 REAL, SAVE, ALLOCATABLE :: qss(:,:) 501 !$OMP THREADPRIVATE(qss) 502 REAL, SAVE, ALLOCATABLE :: qvc(:,:) 503 !$OMP THREADPRIVATE(qvc) 504 REAL, SAVE, ALLOCATABLE :: rnebclr(:,:) 505 !$OMP THREADPRIVATE(rnebclr) 506 REAL, SAVE, ALLOCATABLE :: rnebss(:,:) 507 !$OMP THREADPRIVATE(rnebss) 508 REAL, SAVE, ALLOCATABLE :: gamma_ss(:,:) 509 !$OMP THREADPRIVATE(gamma_ss) 510 REAL, SAVE, ALLOCATABLE :: N1_ss(:,:) 511 !$OMP THREADPRIVATE(N1_ss) 512 REAL, SAVE, ALLOCATABLE :: N2_ss(:,:) 513 !$OMP THREADPRIVATE(N2_ss) 514 REAL, SAVE, ALLOCATABLE :: drneb_sub(:,:) 515 !$OMP THREADPRIVATE(drneb_sub) 516 REAL, SAVE, ALLOCATABLE :: drneb_con(:,:) 517 !$OMP THREADPRIVATE(drneb_con) 518 REAL, SAVE, ALLOCATABLE :: drneb_tur(:,:) 519 !$OMP THREADPRIVATE(drneb_tur) 520 REAL, SAVE, ALLOCATABLE :: drneb_avi(:,:) 521 !$OMP THREADPRIVATE(drneb_avi) 522 REAL, SAVE, ALLOCATABLE :: zqsatl(:,:) 523 !$OMP THREADPRIVATE(zqsatl) 524 REAL, SAVE, ALLOCATABLE :: zqsats(:,:) 525 !$OMP THREADPRIVATE(zqsats) 526 REAL, SAVE, ALLOCATABLE :: Tcontr(:,:) 527 !$OMP THREADPRIVATE(Tcontr) 528 REAL, SAVE, ALLOCATABLE :: qcontr(:,:) 529 !$OMP THREADPRIVATE(qcontr) 530 REAL, SAVE, ALLOCATABLE :: qcontr2(:,:) 531 !$OMP THREADPRIVATE(qcontr2) 532 REAL, SAVE, ALLOCATABLE :: fcontrN(:,:) 533 !$OMP THREADPRIVATE(fcontrN) 534 REAL, SAVE, ALLOCATABLE :: fcontrP(:,:) 535 !$OMP THREADPRIVATE(fcontrP) 496 !-- LSCP - condensation and ice supersaturation variables 497 REAL, SAVE, ALLOCATABLE :: qsub(:,:), qissr(:,:), qcld(:,:) 498 !$OMP THREADPRIVATE(qsub, qissr, qcld) 499 REAL, SAVE, ALLOCATABLE :: subfra(:,:), issrfra(:,:) 500 !$OMP THREADPRIVATE(subfra, issrfra) 501 REAL, SAVE, ALLOCATABLE :: gamma_cond(:,:) 502 !$OMP THREADPRIVATE(gamma_cond) 503 REAL, SAVE, ALLOCATABLE :: ratio_qi_qtot(:,:) 504 !$OMP THREADPRIVATE(ratio_qi_qtot) 505 REAL, SAVE, ALLOCATABLE :: dcf_sub(:,:), dcf_con(:,:), dcf_mix(:,:) 506 !$OMP THREADPRIVATE(dcf_sub, dcf_con, dcf_mix) 507 REAL, SAVE, ALLOCATABLE :: dqi_adj(:,:), dqi_sub(:,:), dqi_con(:,:), dqi_mix(:,:) 508 !$OMP THREADPRIVATE(dqi_adj, dqi_sub, dqi_con, dqi_mix) 509 REAL, SAVE, ALLOCATABLE :: dqvc_adj(:,:), dqvc_sub(:,:), dqvc_con(:,:), dqvc_mix(:,:) 510 !$OMP THREADPRIVATE(dqvc_adj, dqvc_sub, dqvc_con, dqvc_mix) 511 REAL, SAVE, ALLOCATABLE :: qsatliq(:,:), qsatice(:,:) 512 !$OMP THREADPRIVATE(qsatliq, qsatice) 513 514 !-- LSCP - aviation and contrails variables 515 REAL, SAVE, ALLOCATABLE :: Tcontr(:,:), qcontr(:,:), qcontr2(:,:) 516 !$OMP THREADPRIVATE(Tcontr, qcontr, qcontr2) 517 REAL, SAVE, ALLOCATABLE :: fcontrN(:,:), fcontrP(:,:) 518 !$OMP THREADPRIVATE(fcontrN, fcontrP) 519 REAL, SAVE, ALLOCATABLE :: dcf_avi(:,:), dqi_avi(:,:), dqvc_avi(:,:) 520 !$OMP THREADPRIVATE(dcf_avi, dqi_avi, dqvc_avi) 521 REAL, SAVE, ALLOCATABLE :: flight_dist(:,:), flight_h2o(:,:) 522 !$OMP THREADPRIVATE(flight_dist, flight_h2o) 523 524 !-- LSCP - mixed phase clouds variables 536 525 REAL, SAVE, ALLOCATABLE :: distcltop(:,:) 537 526 !$OMP THREADPRIVATE(distcltop) … … 539 528 !$OMP THREADPRIVATE(temp_cltop) 540 529 541 542 !--POPRECIP variables 530 !-- LSCP - POPRECIP variables 543 531 REAL, SAVE, ALLOCATABLE :: qraindiag(:,:) 544 532 !$OMP THREADPRIVATE(qraindiag) … … 668 656 ALLOCATE(t_seri(klon,klev),q_seri(klon,klev),ql_seri(klon,klev),qs_seri(klon,klev), qbs_seri(klon,klev)) 669 657 ALLOCATE(u_seri(klon,klev),v_seri(klon,klev)) 658 ALLOCATE(cf_seri(klon,klev),rvc_seri(klon,klev)) 670 659 ALLOCATE(l_mixmin(klon,klev+1,nbsrf),l_mix(klon,klev+1,nbsrf),wprime(klon,klev+1,nbsrf)) 671 660 ALLOCATE(pbl_eps(klon,klev+1,nbsrf+1)) … … 678 667 ALLOCATE(d_q_dyn2d(klon),d_ql_dyn2d(klon),d_qs_dyn2d(klon), d_qbs_dyn2d(klon)) 679 668 ALLOCATE(d_u_dyn(klon,klev),d_v_dyn(klon,klev)) 669 ALLOCATE(d_cf_dyn(klon,klev),d_rvc_dyn(klon,klev)) 680 670 ALLOCATE(d_tr_dyn(klon,klev,nbtr)) !RomP 681 671 ALLOCATE(d_t_con(klon,klev),d_q_con(klon,klev),d_q_con_zmasse(klon,klev)) … … 954 944 ALLOCATE(zn2mout(klon,6)) 955 945 956 ! Supersaturation 957 ALLOCATE(rneb_seri(klon,klev)) 958 ALLOCATE(d_rneb_dyn(klon,klev)) 959 ALLOCATE(qclr(klon,klev), qcld(klon,klev), qss(klon,klev), qvc(klon,klev)) 960 ALLOCATE(rnebclr(klon,klev), rnebss(klon,klev), gamma_ss(klon,klev)) 961 ALLOCATE(N1_ss(klon,klev), N2_ss(klon,klev)) 962 ALLOCATE(drneb_sub(klon,klev), drneb_con(klon,klev), drneb_tur(klon,klev), drneb_avi(klon,klev)) 963 ALLOCATE(zqsatl(klon,klev), zqsats(klon,klev)) 964 ALLOCATE(Tcontr(klon,klev), qcontr(klon,klev), qcontr2(klon,klev), fcontrN(klon,klev), fcontrP(klon,klev)) 965 966 !--POPRECIP variables 946 !-- LSCP - condensation and ice supersaturation variables 947 ALLOCATE(qsub(klon,klev), qissr(klon,klev), qcld(klon,klev)) 948 ALLOCATE(subfra(klon,klev), issrfra(klon,klev)) 949 ALLOCATE(gamma_cond(klon,klev), ratio_qi_qtot(klon,klev)) 950 ALLOCATE(dcf_sub(klon,klev), dcf_con(klon,klev), dcf_mix(klon,klev)) 951 ALLOCATE(dqi_adj(klon,klev), dqi_sub(klon,klev), dqi_con(klon,klev), dqi_mix(klon,klev)) 952 ALLOCATE(dqvc_adj(klon,klev), dqvc_sub(klon,klev), dqvc_con(klon,klev), dqvc_mix(klon,klev)) 953 ALLOCATE(qsatliq(klon,klev), qsatice(klon,klev)) 954 955 !-- LSCP - aviation and contrails variables 956 ALLOCATE(Tcontr(klon,klev), qcontr(klon,klev), qcontr2(klon,klev)) 957 ALLOCATE(fcontrN(klon,klev), fcontrP(klon,klev)) 958 ALLOCATE(dcf_avi(klon,klev), dqi_avi(klon,klev), dqvc_avi(klon,klev)) 959 ALLOCATE(flight_dist(klon,klev), flight_h2o(klon,klev)) 960 961 !-- LSCP - POPRECIP variables 967 962 ALLOCATE(qraindiag(klon,klev), qsnowdiag(klon,klev)) 968 963 ALLOCATE(dqreva(klon,klev), dqssub(klon,klev)) … … 1022 1017 DEALLOCATE(t_seri,q_seri,ql_seri,qs_seri, qbs_seri) 1023 1018 DEALLOCATE(u_seri,v_seri) 1019 DEALLOCATE(cf_seri,rvc_seri) 1024 1020 DEALLOCATE(l_mixmin,l_mix,wprime) 1025 1021 DEALLOCATE(pbl_eps) … … 1030 1026 DEALLOCATE(d_q_dyn2d,d_ql_dyn2d,d_qs_dyn2d, d_qbs_dyn2d) 1031 1027 DEALLOCATE(d_u_dyn,d_v_dyn) 1028 DEALLOCATE(d_cf_dyn,d_rvc_dyn) 1032 1029 DEALLOCATE(d_tr_dyn) !RomP 1033 1030 DEALLOCATE(d_t_con,d_q_con,d_q_con_zmasse) … … 1270 1267 DEALLOCATE(zn2mout) 1271 1268 1272 ! Supersaturation 1273 DEALLOCATE(rneb_seri) 1274 DEALLOCATE(d_rneb_dyn) 1275 DEALLOCATE(qclr, qcld, qss, qvc) 1276 DEALLOCATE(rnebclr, rnebss, gamma_ss) 1277 DEALLOCATE(N1_ss, N2_ss) 1278 DEALLOCATE(drneb_sub, drneb_con, drneb_tur, drneb_avi) 1279 DEALLOCATE(zqsatl, zqsats) 1280 DEALLOCATE(Tcontr, qcontr, qcontr2, fcontrN, fcontrP) 1281 1282 !--POPRECIP variables 1269 !-- LSCP - condensation and ice supersaturation variables 1270 DEALLOCATE(qsub, qissr, qcld) 1271 DEALLOCATE(subfra, issrfra) 1272 DEALLOCATE(gamma_cond, ratio_qi_qtot) 1273 DEALLOCATE(dcf_sub, dcf_con, dcf_mix) 1274 DEALLOCATE(dqi_adj, dqi_sub, dqi_con, dqi_mix) 1275 DEALLOCATE(dqvc_adj, dqvc_sub, dqvc_con, dqvc_mix) 1276 DEALLOCATE(qsatliq, qsatice) 1277 1278 !-- LSCP - aviation and contrails variables 1279 DEALLOCATE(Tcontr, qcontr, qcontr2) 1280 DEALLOCATE(fcontrN, fcontrP) 1281 DEALLOCATE(dcf_avi, dqi_avi, dqvc_avi) 1282 DEALLOCATE(flight_dist, flight_h2o) 1283 1284 !-- LSCP - POPRECIP variables 1283 1285 DEALLOCATE(qraindiag, qsnowdiag) 1284 1286 DEALLOCATE(dqreva, dqssub) -
LMDZ6/branches/cirrus/libf/phylmd/phys_output_ctrlout_mod.F90
r4887 r4951 450 450 TYPE(ctrl_out), SAVE :: o_SWdn200clr = ctrl_out((/ 10, 1, 10, 10, 10, 10, 11, 11, 11, 11/), & 451 451 'SWdn200clr', 'SWdn clear sky at 200mb', 'W/m2', (/ ('', i=1, 10) /)) 452 453 ! arajouter 454 ! type(ctrl_out),save :: o_LWupTOA = ctrl_out((/ 1, 4, 10, 10, 10, 10, 11, 11, 11, 11/),'LWupTOA', & 455 ! (/ ('', i=1, 10) /)) 456 ! type(ctrl_out),save :: o_LWupTOAclr = ctrl_out((/ 1, 4, 10, 10, 10, 10, 11, 11, 11, 11/),'LWupTOAclr', & 457 ! (/ ('', i=1, 10) /)) 452 TYPE(ctrl_out), SAVE :: o_LWupTOA = ctrl_out((/ 1, 4, 10, 10, 10, 10, 11, 11, 11, 11/), & 453 'LWupTOA', 'LWup at TOA', 'W/m2', (/ ('', i=1, 10) /)) 454 TYPE(ctrl_out), SAVE :: o_LWupTOAclr = ctrl_out((/ 1, 4, 10, 10, 10, 10, 11, 11, 11, 11/), & 455 'LWupTOAclr', 'LWup clear sky at TOA', 'W/m2', (/ ('', i=1, 10) /)) 458 456 ! type(ctrl_out),save :: o_LWdnTOA = ctrl_out((/ 1, 4, 10, 10, 10, 10, 11, 11, 11, 11/),'LWdnTOA', & 459 457 ! (/ ('', i=1, 10) /)) … … 2069 2067 'albslw3', 'Surface albedo LW3', '-', (/ ('', i=1, 10) /)) 2070 2068 2071 !--aviation & supersaturation 2072 TYPE(ctrl_out), SAVE :: o_oclr = ctrl_out((/ 1, 1, 1, 1, 10, 10, 11, 11, 11, 11/), & 2073 'oclr', 'Clear sky total water', 'kg/kg', (/ ('', i=1, 10) /)) 2074 TYPE(ctrl_out), SAVE :: o_ocld = ctrl_out((/ 1, 1, 1, 1, 10, 10, 11, 11, 11, 11/), & 2075 'ocld', 'Cloudy sky total water', 'kg/kg', (/ ('', i=1, 10) /)) 2076 TYPE(ctrl_out), SAVE :: o_oss = ctrl_out((/ 1, 1, 1, 1, 10, 10, 11, 11, 11, 11/), & 2077 'oss', 'ISSR total water', 'kg/kg', (/ ('', i=1, 10) /)) 2078 TYPE(ctrl_out), SAVE :: o_ovc = ctrl_out((/ 1, 1, 1, 1, 10, 10, 11, 11, 11, 11/), & 2079 'ovc', 'In-cloup vapor', 'kg/kg', (/ ('', i=1, 10) /)) 2080 TYPE(ctrl_out), SAVE :: o_rnebclr = ctrl_out((/ 1, 1, 1, 1, 10, 10, 11, 11, 11, 11/), & 2081 'rnebclr', 'Clear sky fraction', '-', (/ ('', i=1, 10) /)) 2082 TYPE(ctrl_out), SAVE :: o_rnebss = ctrl_out((/ 1, 1, 1, 1, 10, 10, 11, 11, 11, 11/), & 2083 'rnebss', 'ISSR fraction', '-', (/ ('', i=1, 10) /)) 2084 TYPE(ctrl_out), SAVE :: o_rnebseri = ctrl_out((/ 1, 1, 1, 1, 10, 10, 11, 11, 11, 11/), & 2085 'rnebseri', 'Cloud fraction', '-', (/ ('', i=1, 10) /)) 2086 TYPE(ctrl_out), SAVE :: o_gammass = ctrl_out((/ 1, 1, 1, 1, 10, 10, 11, 11, 11, 11/), & 2087 'gammass', 'Gamma supersaturation', '', (/ ('', i=1, 10) /)) 2088 TYPE(ctrl_out), SAVE :: o_N1_ss = ctrl_out((/ 1, 1, 1, 1, 10, 10, 11, 11, 11, 11/), & 2089 'N1ss', 'N1', '', (/ ('', i=1, 10) /)) 2090 TYPE(ctrl_out), SAVE :: o_N2_ss = ctrl_out((/ 1, 1, 1, 1, 10, 10, 11, 11, 11, 11/), & 2091 'N2ss', 'N2', '', (/ ('', i=1, 10) /)) 2092 TYPE(ctrl_out), SAVE :: o_drnebsub = ctrl_out((/ 1, 1, 1, 1, 10, 10, 11, 11, 11, 11/), & 2093 'drnebsub', 'Cloud fraction change because of sublimation', 's-1', (/ ('', i=1, 10) /)) 2094 TYPE(ctrl_out), SAVE :: o_drnebcon = ctrl_out((/ 1, 1, 1, 1, 10, 10, 11, 11, 11, 11/), & 2095 'drnebcon', 'Cloud fraction change because of condensation', 's-1', (/ ('', i=1, 10) /)) 2096 TYPE(ctrl_out), SAVE :: o_drnebtur = ctrl_out((/ 1, 1, 1, 1, 10, 10, 11, 11, 11, 11/), & 2097 'drnebtur', 'Cloud fraction change because of turbulence', 's-1', (/ ('', i=1, 10) /)) 2098 TYPE(ctrl_out), SAVE :: o_drnebavi = ctrl_out((/ 1, 1, 1, 1, 10, 10, 11, 11, 11, 11/), & 2099 'drnebavi', 'Cloud fraction change because of aviation', 's-1', (/ ('', i=1, 10) /)) 2100 TYPE(ctrl_out), SAVE :: o_qsatl = ctrl_out((/ 1, 1, 1, 1, 10, 10, 11, 11, 11, 11/), & 2101 'qsatl', 'Saturation with respect to liquid water', '', (/ ('', i=1, 10) /)) 2102 TYPE(ctrl_out), SAVE :: o_qsats = ctrl_out((/ 1, 1, 1, 1, 10, 10, 11, 11, 11, 11/), & 2103 'qsats', 'Saturation with respect to solid water', '', (/ ('', i=1, 10) /)) 2104 TYPE(ctrl_out), SAVE :: o_flight_m = ctrl_out((/ 1, 1, 1, 1, 10, 10, 11, 11, 11, 11/), & 2105 'flightm', 'Flown meters', 'm/s/mesh', (/ ('', i=1, 10) /)) 2106 TYPE(ctrl_out), SAVE :: o_flight_h2o = ctrl_out((/ 1, 1, 1, 1, 10, 10, 11, 11, 11, 11/), & 2107 'flighth2o', 'H2O flight emission', 'kg H2O/s/mesh', (/ ('', i=1, 10) /)) 2108 TYPE(ctrl_out), SAVE :: o_Tcontr = ctrl_out((/ 1, 1, 1, 1, 11, 11, 11, 11, 11, 11/),& 2069 !-- LSCP - condensation and ice supersaturation variables 2070 TYPE(ctrl_out), SAVE :: o_cfseri = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), & 2071 'cfseri', 'Cloud fraction', '-', (/ ('', i=1, 10) /)) 2072 TYPE(ctrl_out), SAVE :: o_dcfdyn = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), & 2073 'dcfdyn', 'Dynamics cloud fraction tendency', 's-1', (/ ('', i=1, 10) /)) 2074 TYPE(ctrl_out), SAVE :: o_rvcseri = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), & 2075 'rvcseri', 'Cloudy water vapor to total water vapor ratio', '-', (/ ('', i=1, 10) /)) 2076 TYPE(ctrl_out), SAVE :: o_drvcdyn = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), & 2077 'drvcdyn', 'Dynamics cloudy water vapor to total water vapor ratio tendency', 's-1', (/ ('', i=1, 10) /)) 2078 TYPE(ctrl_out), SAVE :: o_qsub = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), & 2079 'qsub', 'Subsaturated clear sky total water', 'kg/kg', (/ ('', i=1, 10) /)) 2080 TYPE(ctrl_out), SAVE :: o_qissr = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), & 2081 'qissr', 'Supersaturated clear sky total water', 'kg/kg', (/ ('', i=1, 10) /)) 2082 TYPE(ctrl_out), SAVE :: o_qcld = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), & 2083 'qcld', 'Cloudy sky total water', 'kg/kg', (/ ('', i=1, 10) /)) 2084 TYPE(ctrl_out), SAVE :: o_subfra = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), & 2085 'subfra', 'Subsaturated clear sky fraction', '-', (/ ('', i=1, 10) /)) 2086 TYPE(ctrl_out), SAVE :: o_issrfra = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), & 2087 'issrfra', 'Supersaturated clear sky fraction', '-', (/ ('', i=1, 10) /)) 2088 TYPE(ctrl_out), SAVE :: o_gammacond = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), & 2089 'gammacond', 'Condensation threshold w.r.t. saturation', '-', (/ ('', i=1, 10) /)) 2090 TYPE(ctrl_out), SAVE :: o_dcfsub = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), & 2091 'dcfsub', 'Sublimation cloud fraction tendency', 's-1', (/ ('', i=1, 10) /)) 2092 TYPE(ctrl_out), SAVE :: o_dcfcon = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), & 2093 'dcfcon', 'Condensation cloud fraction tendency', 's-1', (/ ('', i=1, 10) /)) 2094 TYPE(ctrl_out), SAVE :: o_dcfmix = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), & 2095 'dcfmix', 'Cloud mixing cloud fraction tendency', 's-1', (/ ('', i=1, 10) /)) 2096 TYPE(ctrl_out), SAVE :: o_dqiadj = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), & 2097 'dqiadj', 'Temperature adjustment ice tendency', 'kg/kg/s', (/ ('', i=1, 10) /)) 2098 TYPE(ctrl_out), SAVE :: o_dqisub = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), & 2099 'dqisub', 'Sublimation ice tendency', 'kg/kg/s', (/ ('', i=1, 10) /)) 2100 TYPE(ctrl_out), SAVE :: o_dqicon = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), & 2101 'dqicon', 'Condensation ice tendency', 'kg/kg/s', (/ ('', i=1, 10) /)) 2102 TYPE(ctrl_out), SAVE :: o_dqimix = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), & 2103 'dqimix', 'Cloud mixing ice tendency', 'kg/kg/s', (/ ('', i=1, 10) /)) 2104 TYPE(ctrl_out), SAVE :: o_dqvcadj = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), & 2105 'dqvcadj', 'Temperature adjustment cloudy water vapor tendency', 'kg/kg/s', (/ ('', i=1, 10) /)) 2106 TYPE(ctrl_out), SAVE :: o_dqvcsub = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), & 2107 'dqvcsub', 'Sublimation cloudy water vapor tendency', 'kg/kg/s', (/ ('', i=1, 10) /)) 2108 TYPE(ctrl_out), SAVE :: o_dqvccon = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), & 2109 'dqvccon', 'Condensation cloudy water vapor tendency', 'kg/kg/s', (/ ('', i=1, 10) /)) 2110 TYPE(ctrl_out), SAVE :: o_dqvcmix = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), & 2111 'dqvcmix', 'Cloud mixing cloudy water vapor tendency', 'kg/kg/s', (/ ('', i=1, 10) /)) 2112 TYPE(ctrl_out), SAVE :: o_qsatl = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), & 2113 'qsatl', 'Saturation with respect to liquid', 'kg/kg', (/ ('', i=1, 10) /)) 2114 TYPE(ctrl_out), SAVE :: o_qsati = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), & 2115 'qsati', 'Saturation with respect to ice', 'kg/kg', (/ ('', i=1, 10) /)) 2116 2117 !-- LSCP - aviation variables 2118 TYPE(ctrl_out), SAVE :: o_Tcontr = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/),& 2109 2119 'Tcontr', 'Temperature threshold for contrail formation', 'K', (/ ('',i=1,10) /)) 2110 TYPE(ctrl_out), SAVE :: o_qcontr = ctrl_out((/ 1 , 1, 1,1, 11, 11, 11, 11, 11, 11/),&2111 'qcontr', 'Specific humidity threshold for contrail formation', 'Pa', (/ ('', i=1, 10) /))2112 TYPE(ctrl_out), SAVE :: o_qcontr2 = ctrl_out((/ 1 , 1, 1,1, 11, 11, 11, 11, 11, 11/),&2113 'qcontr2', 'Specific humidity threshold for contrail formation', 'kg/kg', (/ ('', i=1, 10) /))2114 TYPE(ctrl_out), SAVE :: o_fcontrN = ctrl_out((/ 2, 2, 2, 2, 2, 2, 11, 11, 11, 11/),&2120 TYPE(ctrl_out), SAVE :: o_qcontr = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/),& 2121 'qcontr', 'Specific humidity threshold for contrail formation', 'Pa', (/ ('', i=1, 10) /)) 2122 TYPE(ctrl_out), SAVE :: o_qcontr2 = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/),& 2123 'qcontr2', 'Specific humidity threshold for contrail formation', 'kg/kg', (/ ('', i=1, 10) /)) 2124 TYPE(ctrl_out), SAVE :: o_fcontrN = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/),& 2115 2125 'fcontrN', 'Fraction with non-persistent contrail in clear-sky', '-', (/ ('', i=1,10)/)) 2116 TYPE(ctrl_out), SAVE :: o_fcontrP = ctrl_out((/ 2, 2, 2, 2, 2, 2, 11, 11, 11, 11/),&2126 TYPE(ctrl_out), SAVE :: o_fcontrP = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/),& 2117 2127 'fcontrP', 'Fraction with persistent contrail in ISSR', '-', (/ ('', i=1,10)/)) 2128 TYPE(ctrl_out), SAVE :: o_dcfavi = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), & 2129 'dcfavi', 'Aviation cloud fraction tendency', 's-1', (/ ('', i=1, 10) /)) 2130 TYPE(ctrl_out), SAVE :: o_dqiavi = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), & 2131 'dqiavi', 'Aviation ice tendency', 'kg/kg/s', (/ ('', i=1, 10) /)) 2132 TYPE(ctrl_out), SAVE :: o_dqvcavi = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), & 2133 'dqvcavi', 'Aviation cloudy water vapor tendency', 'kg/kg/s', (/ ('', i=1, 10) /)) 2134 TYPE(ctrl_out), SAVE :: o_flight_dist = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), & 2135 'flightdist', 'Aviation flown distance', 'm/s/mesh', (/ ('', i=1, 10) /)) 2136 TYPE(ctrl_out), SAVE :: o_flight_h2o = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), & 2137 'flighth2o', 'Aviation H2O flight emission', 'kg H2O/s/mesh', (/ ('', i=1, 10) /)) 2118 2138 2119 2139 !!!!!!!!!!!!! Sorties niveaux standards de pression NMC -
LMDZ6/branches/cirrus/libf/phylmd/phys_output_write_mod.F90
r4887 r4951 54 54 o_SWdnTOAclr, o_nettop, o_SWup200, & 55 55 o_SWup200clr, o_SWdn200, o_SWdn200clr, & 56 o_LWupTOA, o_LWupTOAclr, & 56 57 o_LWup200, o_LWup200clr, o_LWdn200, & 57 58 o_LWdn200clr, o_sols, o_sols0, & … … 216 217 o_p_tropopause, o_z_tropopause, o_t_tropopause, & 217 218 o_col_O3_strato, o_col_O3_tropo, & 218 !--aviation & supersaturation 219 o_oclr, o_ocld, o_oss, o_ovc, o_rnebss, o_rnebclr, o_rnebseri, o_gammass, & 220 o_N1_ss, o_N2_ss, o_qsatl, o_qsats, & 221 o_drnebsub, o_drnebcon, o_drnebtur, o_drnebavi, o_flight_m, o_flight_h2o, & 219 !-- LSCP - condensation and ice supersaturation variables 220 o_cfseri, o_dcfdyn, o_rvcseri, o_drvcdyn, & 221 o_qsub, o_qissr, o_qcld, o_subfra, o_issrfra, o_gammacond, & 222 o_dcfsub, o_dcfcon, o_dcfmix, o_dqiadj, o_dqisub, o_dqicon, o_dqimix, & 223 o_dqvcadj, o_dqvcsub, o_dqvccon, o_dqvcmix, o_qsatl, o_qsati, & 224 !-- LSCP - aviation variables 222 225 o_Tcontr, o_qcontr, o_qcontr2, o_fcontrN, o_fcontrP, & 226 o_dcfavi, o_dqiavi, o_dqvcavi, o_flight_dist, o_flight_h2o, & 223 227 !--interactive CO2 224 228 o_flx_co2_ocean, o_flx_co2_ocean_cor, & … … 258 262 #endif 259 263 260 USE ice_sursat_mod, ONLY: flight_m, flight_h2o261 264 USE lmdz_lscp_ini, ONLY: ok_poprecip 262 265 … … 323 326 cldq, flwp, fiwp, ue, ve, uq, vq, & 324 327 uwat, vwat, & 325 rneb_seri, d_rneb_dyn, &326 328 plcl, plfc, wbeff, convoccur, upwd, dnwd, dnwd0, prw, prlw, prsw, prbsw, water_budget, & 327 329 s_pblh, s_pblt, s_lcl, s_therm, uwriteSTD, & … … 337 339 wdtrainA, wdtrainS, wdtrainM, n2, s2, strig, zcong, zlcl_th, proba_notrig, & 338 340 random_notrig, & 339 qclr, qcld, qss, qvc, rnebclr, rnebss, gamma_ss, & 340 N1_ss, N2_ss, zqsatl, zqsats, & 341 cf_seri, d_cf_dyn, rvc_seri, d_rvc_dyn, & 342 qsub, qissr, qcld, subfra, issrfra, gamma_cond, & 343 dcf_sub, dcf_con, dcf_mix, & 344 dqi_adj, dqi_sub, dqi_con, dqi_mix, & 345 dqvc_adj, dqvc_sub, dqvc_con, dqvc_mix, & 346 qsatliq, qsatice, & 341 347 Tcontr, qcontr, qcontr2, fcontrN, fcontrP, & 342 d rneb_sub, drneb_con, drneb_tur, drneb_avi, &348 dcf_avi, dqi_avi, dqvc_avi, flight_dist, flight_h2o, & 343 349 alp_bl_det, alp_bl_fluct_m, alp_bl_conv, & 344 350 alp_bl_stat, alp_bl_fluct_tke, slab_wfbils, & … … 1066 1072 CALL histwrite_phy(o_LWupSFCclr, zx_tmp_fi2d) 1067 1073 CALL histwrite_phy(o_LWdnSFCclr, sollwdownclr) 1074 1075 IF (vars_defined) THEN 1076 zx_tmp_fi2d(:) = lwup(:,klevp1) 1077 ENDIF 1078 CALL histwrite_phy(o_LWupTOA, zx_tmp_fi2d) 1079 1080 IF (vars_defined) THEN 1081 zx_tmp_fi2d(:) = lwup0(:,klevp1) 1082 ENDIF 1083 CALL histwrite_phy(o_LWupTOAclr, zx_tmp_fi2d) 1068 1084 1069 1085 IF (type_trac/='inca' .OR. config_inca=='aeNP') THEN … … 2006 2022 ENDIF 2007 2023 2008 !--aviation & supersaturation 2009 IF (ok_ice_sursat) THEN 2010 CALL histwrite_phy(o_oclr, qclr) 2011 CALL histwrite_phy(o_ocld, qcld) 2012 CALL histwrite_phy(o_oss, qss) 2013 CALL histwrite_phy(o_ovc, qvc) 2014 CALL histwrite_phy(o_rnebclr, rnebclr) 2015 CALL histwrite_phy(o_rnebss, rnebss) 2016 CALL histwrite_phy(o_rnebseri, rneb_seri) 2017 CALL histwrite_phy(o_gammass, gamma_ss) 2018 CALL histwrite_phy(o_N1_ss, N1_ss) 2019 CALL histwrite_phy(o_N2_ss, N2_ss) 2020 CALL histwrite_phy(o_drnebsub, drneb_sub) 2021 CALL histwrite_phy(o_drnebcon, drneb_con) 2022 CALL histwrite_phy(o_drnebtur, drneb_tur) 2023 CALL histwrite_phy(o_drnebavi, drneb_avi) 2024 CALL histwrite_phy(o_qsatl, zqsatl) 2025 CALL histwrite_phy(o_qsats, zqsats) 2024 !-- LSCP - condensation and supersaturation variables 2025 IF (ok_ice_supersat) THEN 2026 CALL histwrite_phy(o_cfseri, cf_seri) 2027 CALL histwrite_phy(o_dcfdyn, d_cf_dyn) 2028 CALL histwrite_phy(o_rvcseri, rvc_seri) 2029 CALL histwrite_phy(o_drvcdyn, d_rvc_dyn) 2030 CALL histwrite_phy(o_qsub, qsub) 2031 CALL histwrite_phy(o_qissr, qissr) 2032 CALL histwrite_phy(o_qcld, qcld) 2033 CALL histwrite_phy(o_subfra, subfra) 2034 CALL histwrite_phy(o_issrfra, issrfra) 2035 CALL histwrite_phy(o_gammacond, gamma_cond) 2036 CALL histwrite_phy(o_dcfsub, dcf_sub) 2037 CALL histwrite_phy(o_dcfcon, dcf_con) 2038 CALL histwrite_phy(o_dcfmix, dcf_mix) 2039 CALL histwrite_phy(o_dqiadj, dqi_adj) 2040 CALL histwrite_phy(o_dqisub, dqi_sub) 2041 CALL histwrite_phy(o_dqicon, dqi_con) 2042 CALL histwrite_phy(o_dqimix, dqi_mix) 2043 CALL histwrite_phy(o_dqvcadj, dqvc_adj) 2044 CALL histwrite_phy(o_dqvcsub, dqvc_sub) 2045 CALL histwrite_phy(o_dqvccon, dqvc_con) 2046 CALL histwrite_phy(o_dqvcmix, dqvc_mix) 2047 CALL histwrite_phy(o_qsatl, qsatliq) 2048 CALL histwrite_phy(o_qsati, qsatice) 2049 ENDIF 2050 !-- LSCP - aviation variables 2051 IF (ok_plane_contrail) THEN 2026 2052 CALL histwrite_phy(o_Tcontr, Tcontr) 2027 2053 CALL histwrite_phy(o_qcontr, qcontr) … … 2029 2055 CALL histwrite_phy(o_fcontrN, fcontrN) 2030 2056 CALL histwrite_phy(o_fcontrP, fcontrP) 2031 ENDIF 2032 IF (ok_plane_contrail) THEN 2033 CALL histwrite_phy(o_flight_m, flight_m) 2057 CALL histwrite_phy(o_dcfavi, dcf_avi) 2058 CALL histwrite_phy(o_dqiavi, dqi_avi) 2059 CALL histwrite_phy(o_dqvcavi, dqvc_avi) 2060 CALL histwrite_phy(o_flight_dist, flight_dist) 2034 2061 ENDIF 2035 2062 IF (ok_plane_h2o) THEN -
LMDZ6/branches/cirrus/libf/phylmd/phys_state_var_mod.F90
r4933 r4951 92 92 REAL, ALLOCATABLE, SAVE :: u_ancien(:,:), v_ancien(:,:) 93 93 !$OMP THREADPRIVATE(u_ancien, v_ancien) 94 REAL, ALLOCATABLE, SAVE :: cf_ancien(:,:), rvc_ancien(:,:) 95 !$OMP THREADPRIVATE(cf_ancien, rvc_ancien) 94 96 !!! RomP >>> 95 97 REAL, ALLOCATABLE, SAVE :: tr_ancien(:,:,:) … … 100 102 REAL, ALLOCATABLE, SAVE :: clwcon(:,:),rnebcon(:,:) 101 103 !$OMP THREADPRIVATE(clwcon,rnebcon) 102 REAL, ALLOCATABLE, SAVE :: rneb_ancien(:,:)103 !$OMP THREADPRIVATE(rneb_ancien)104 104 REAL, ALLOCATABLE, SAVE :: qtc_cv(:,:),sigt_cv(:,:),detrain_cv(:,:),fm_cv(:,:) 105 105 !$OMP THREADPRIVATE(qtc_cv,sigt_cv,detrain_cv,fm_cv) … … 586 586 ALLOCATE(prw_ancien(klon), prlw_ancien(klon), prsw_ancien(klon), prbsw_ancien(klon)) 587 587 ALLOCATE(u_ancien(klon,klev), v_ancien(klon,klev)) 588 ALLOCATE(cf_ancien(klon,klev), rvc_ancien(klon,klev)) 588 589 !!! Rom P >>> 589 590 ALLOCATE(tr_ancien(klon,klev,nbtr)) 590 591 !!! Rom P <<< 591 592 ALLOCATE(clwcon(klon,klev),rnebcon(klon,klev)) 592 ALLOCATE(rneb_ancien(klon,klev))593 593 ALLOCATE(qtc_cv(klon,klev),sigt_cv(klon,klev),detrain_cv(klon,klev),fm_cv(klon,klev)) 594 594 ALLOCATE(ratqs(klon,klev)) … … 809 809 DEALLOCATE(zthe, zpic, zval) 810 810 DEALLOCATE(rugoro, t_ancien, q_ancien, clwcon, rnebcon) 811 DEALLOCATE(qs_ancien, ql_ancien, qbs_ancien , rneb_ancien)811 DEALLOCATE(qs_ancien, ql_ancien, qbs_ancien) 812 812 DEALLOCATE(prw_ancien, prlw_ancien, prsw_ancien, prbsw_ancien) 813 813 DEALLOCATE(qtc_cv,sigt_cv,detrain_cv,fm_cv) 814 814 DEALLOCATE(u_ancien, v_ancien) 815 DEALLOCATE(cf_ancien, rvc_ancien) 815 816 DEALLOCATE(tr_ancien) !RomP 816 817 DEALLOCATE(ratqs, pbl_tke,coefh,coefm) -
LMDZ6/branches/cirrus/libf/phylmd/physiq_mod.F90
r4887 r4951 73 73 USE tracinca_mod, ONLY: config_inca 74 74 USE tropopause_m, ONLY: dyn_tropopause 75 USE ice_sursat_mod, ONLY: flight_init, airplane76 75 USE vampir 77 76 USE write_field_phy … … 157 156 ! [Variables internes non sauvegardees de la physique] 158 157 ! Variables locales pour effectuer les appels en serie 159 t_seri,q_seri,ql_seri,qs_seri,qbs_seri,u_seri,v_seri,tr_seri,rneb_seri, & 158 t_seri,q_seri,ql_seri,qs_seri,qbs_seri, & 159 u_seri,v_seri,cf_seri,rvc_seri,tr_seri, & 160 160 rhcl, & 161 161 ! Dynamic tendencies (diagnostics) 162 d_t_dyn,d_q_dyn,d_ql_dyn,d_qs_dyn,d_qbs_dyn,d_u_dyn,d_v_dyn,d_tr_dyn,d_rneb_dyn, & 162 d_t_dyn,d_q_dyn,d_ql_dyn,d_qs_dyn,d_qbs_dyn, & 163 d_u_dyn,d_v_dyn,d_cf_dyn,d_rvc_dyn,d_tr_dyn, & 163 164 d_q_dyn2d,d_ql_dyn2d,d_qs_dyn2d,d_qbs_dyn2d, & 164 165 ! Physic tendencies … … 334 335 pfraclr,pfracld, & 335 336 distcltop,temp_cltop, & 336 zqsatl, zqsats, & 337 qclr, qcld, qss, qvc, rnebclr, rnebss, gamma_ss, & 337 !-- LSCP - condensation and ice supersaturation variables 338 qsub, qissr, qcld, subfra, issrfra, gamma_cond, ratio_qi_qtot, & 339 dcf_sub, dcf_con, dcf_mix, dqi_adj, dqi_sub, dqi_con, dqi_mix, & 340 dqvc_adj, dqvc_sub, dqvc_con, dqvc_mix, qsatliq, qsatice, & 341 !-- LSCP - aviation and contrails variables 338 342 Tcontr, qcontr, qcontr2, fcontrN, fcontrP, & 343 dcf_avi, dqi_avi, dqvc_avi, flight_dist, flight_h2o, & 344 ! 339 345 cldemi, & 340 346 cldfra, cldtau, fiwc, & … … 511 517 ! 512 518 ! indices de traceurs eau vapeur, liquide, glace, fraction nuageuse LS (optional), blowing snow (optional) 513 INTEGER,SAVE :: ivap, iliq, isol, i rneb, ibs514 !$OMP THREADPRIVATE(ivap, iliq, isol, i rneb, ibs)519 INTEGER,SAVE :: ivap, iliq, isol, ibs, icf, irvc 520 !$OMP THREADPRIVATE(ivap, iliq, isol, ibs, icf, irvc) 515 521 ! 516 522 ! … … 1362 1368 iliq = strIdx(tracers(:)%name, addPhase('H2O', 'l')) 1363 1369 isol = strIdx(tracers(:)%name, addPhase('H2O', 's')) 1364 irneb= strIdx(tracers(:)%name, addPhase('H2O', 'r'))1365 1370 ibs = strIdx(tracers(:)%name, addPhase('H2O', 'b')) 1371 icf = strIdx(tracers(:)%name, addPhase('H2O', 'f')) 1372 irvc = strIdx(tracers(:)%name, addPhase('H2O', 'c')) 1366 1373 ! CALL init_etat0_limit_unstruct 1367 1374 ! IF (.NOT. create_etat0_limit) CALL init_limit_read(days_elapsed) … … 1416 1423 ENDIF 1417 1424 1418 IF (ok_ice_su rsat.AND.(iflag_ice_thermo.EQ.0)) THEN1419 WRITE (lunout, *) ' ok_ice_su rsat=y requires iflag_ice_thermo=1 as well'1425 IF (ok_ice_supersat.AND.(iflag_ice_thermo.EQ.0)) THEN 1426 WRITE (lunout, *) ' ok_ice_supersat=y requires iflag_ice_thermo=1 as well' 1420 1427 abort_message='see above' 1421 1428 CALL abort_physic(modname,abort_message,1) 1422 1429 ENDIF 1423 1430 1424 IF (ok_ice_su rsat.AND.(nqo.LT.4)) THEN1425 WRITE (lunout, *) ' ok_ice_su rsat=y requires 4H2O tracers ', &1426 '(H2O_g, H2O_l, H2O_s, H2O_ r) but nqo=', nqo, '. Might as well stop here.'1431 IF (ok_ice_supersat.AND.(nqo.LT.5)) THEN 1432 WRITE (lunout, *) ' ok_ice_supersat=y requires 5 H2O tracers ', & 1433 '(H2O_g, H2O_l, H2O_s, H2O_f, H2O_c) but nqo=', nqo, '. Might as well stop here.' 1427 1434 abort_message='see above' 1428 1435 CALL abort_physic(modname,abort_message,1) 1429 1436 ENDIF 1430 1437 1431 IF (ok_plane_h2o.AND..NOT.ok_ice_su rsat) THEN1432 WRITE (lunout, *) ' ok_plane_h2o=y requires ok_ice_su rsat=y '1438 IF (ok_plane_h2o.AND..NOT.ok_ice_supersat) THEN 1439 WRITE (lunout, *) ' ok_plane_h2o=y requires ok_ice_supersat=y ' 1433 1440 abort_message='see above' 1434 1441 CALL abort_physic(modname,abort_message,1) 1435 1442 ENDIF 1436 1443 1437 IF (ok_plane_contrail.AND..NOT.ok_ice_su rsat) THEN1438 WRITE (lunout, *) ' ok_plane_contrail=y requires ok_ice_su rsat=y '1444 IF (ok_plane_contrail.AND..NOT.ok_ice_supersat) THEN 1445 WRITE (lunout, *) ' ok_plane_contrail=y requires ok_ice_supersat=y ' 1439 1446 abort_message='see above' 1440 1447 CALL abort_physic(modname,abort_message,1) … … 1442 1449 1443 1450 IF (ok_bs) THEN 1444 IF ((ok_ice_su rsat.AND.nqo .LT.5).OR.(.NOT.ok_ice_sursat.AND.nqo.LT.4)) THEN1451 IF ((ok_ice_supersat.AND.nqo .LT.6).OR.(.NOT.ok_ice_supersat.AND.nqo.LT.4)) THEN 1445 1452 WRITE (lunout, *) 'activation of blowing snow needs a specific H2O tracer', & 1446 1453 'but nqo=', nqo … … 1870 1877 & RG,RD,RCPD,RKAPPA,RLVTT,RETV) 1871 1878 CALL ratqs_ini(klon,klev,iflag_thermals,lunout,nbsrf,is_lic,is_ter,RG,RV,RD,RCPD,RLSTT,RLVTT,RTT) 1872 CALL lscp_ini(pdtphys,lunout,prt_level,ok_ice_sursat,iflag_ratqs,fl_cor_ebil,RCPD,RLSTT,RLVTT,RLMLT,RVTMP2,RTT,RD,RG,RPI) 1879 CALL lscp_ini(pdtphys,lunout,prt_level,ok_ice_supersat,iflag_ratqs,fl_cor_ebil, & 1880 RCPD,RLSTT,RLVTT,RLMLT,RVTMP2,RTT,RD,RV,RG,RPI,EPS_W) 1873 1881 CALL blowing_snow_ini(RCPD, RLSTT, RLVTT, RLMLT, & 1874 1882 RVTMP2, RTT,RD,RG, RV, RPI) … … 2342 2350 sollwdown(:)) 2343 2351 2352 !--Init for LSCP - condensation 2353 ratio_qi_qtot(:,:) = 0. 2344 2354 2345 2355 … … 2439 2449 q_seri(i,k) = qx(i,k,ivap) 2440 2450 ql_seri(i,k) = qx(i,k,iliq) 2441 qbs_seri(i,k) = 0. 2451 qbs_seri(i,k)= 0. 2452 cf_seri(i,k) = 0. 2453 rvc_seri(i,k)= 0. 2442 2454 !CR: ATTENTION, on rajoute la variable glace 2443 2455 IF (nqo.EQ.2) THEN !--vapour and liquid only 2444 2456 qs_seri(i,k) = 0. 2445 rneb_seri(i,k) = 0.2446 2457 ELSE IF (nqo.EQ.3) THEN !--vapour, liquid and ice 2447 2458 qs_seri(i,k) = qx(i,k,isol) 2448 rneb_seri(i,k) = 0. 2449 ELSE IF (nqo.GE.4) THEN !--vapour, liquid, ice and rneb and blowing snow 2459 ELSE IF (nqo.GE.4) THEN !--vapour, liquid, ice, blowing snow, cloud fraction and cloudy water vapor to total water vapor ratio 2450 2460 qs_seri(i,k) = qx(i,k,isol) 2451 IF (ok_ice_sursat) THEN 2452 rneb_seri(i,k) = qx(i,k,irneb) 2461 IF (ok_ice_supersat) THEN 2462 cf_seri(i,k) = qx(i,k,icf) 2463 rvc_seri(i,k) = qx(i,k,irvc) 2453 2464 ENDIF 2454 2465 IF (ok_bs) THEN … … 2526 2537 d_ql_dyn(:,:) = (ql_seri(:,:)-ql_ancien(:,:))/phys_tstep 2527 2538 d_qs_dyn(:,:) = (qs_seri(:,:)-qs_ancien(:,:))/phys_tstep 2528 d_qbs_dyn(:,:) = (qbs_seri(:,:)-qbs_ancien(:,:))/phys_tstep 2539 d_qbs_dyn(:,:)= (qbs_seri(:,:)-qbs_ancien(:,:))/phys_tstep 2540 d_cf_dyn(:,:) = (cf_seri(:,:)-cf_ancien(:,:))/phys_tstep 2541 d_rvc_dyn(:,:)= (rvc_seri(:,:)-rvc_ancien(:,:))/phys_tstep 2529 2542 CALL water_int(klon,klev,q_seri,zmasse,zx_tmp_fi2d) 2530 2543 d_q_dyn2d(:)=(zx_tmp_fi2d(:)-prw_ancien(:))/phys_tstep … … 2538 2551 IF (nqtot > nqo) d_tr_dyn(:,:,:)=(tr_seri(:,:,:)-tr_ancien(:,:,:))/phys_tstep 2539 2552 ! !! RomP <<< 2540 !!d_rneb_dyn(:,:)=(rneb_seri(:,:)-rneb_ancien(:,:))/phys_tstep2541 d_rneb_dyn(:,:)=0.02542 2553 ELSE 2543 2554 d_u_dyn(:,:) = 0.0 … … 2547 2558 d_ql_dyn(:,:) = 0.0 2548 2559 d_qs_dyn(:,:) = 0.0 2560 d_qbs_dyn(:,:)= 0.0 2561 d_cf_dyn(:,:) = 0.0 2562 d_rvc_dyn(:,:)= 0.0 2549 2563 d_q_dyn2d(:) = 0.0 2550 2564 d_ql_dyn2d(:) = 0.0 … … 2554 2568 IF (nqtot > nqo) d_tr_dyn(:,:,:)= 0.0 2555 2569 ! !! RomP <<< 2556 d_rneb_dyn(:,:)=0.02557 d_qbs_dyn(:,:)=0.02558 2570 ancien_ok = .TRUE. 2559 2571 ENDIF … … 2664 2676 ENDIF 2665 2677 ENDIF 2678 2679 !-- Needed for LSCP - condensation and ice supersaturation 2680 IF (ok_ice_supersat) THEN 2681 DO k = 1, klev 2682 DO i = 1, klon 2683 IF ( ( q_seri(i,k) + ql_seri(i,k) + qs_seri(i,k) ) .GT. 0. ) THEN 2684 ratio_qi_qtot(i,k) = qs_seri(i,k) / ( q_seri(i,k) + ql_seri(i,k) + qs_seri(i,k) ) 2685 rvc_seri(i,k) = rvc_seri(i,k) * q_seri(i,k) / ( q_seri(i,k) + ql_seri(i,k) + qs_seri(i,k) ) 2686 ELSE 2687 ratio_qi_qtot(i,k) = 0. 2688 rvc_seri(i,k) = 0. 2689 ENDIF 2690 ENDDO 2691 ENDDO 2692 ENDIF 2693 2666 2694 ! 2667 2695 ! Re-evaporer l'eau liquide nuageuse … … 3888 3916 3889 3917 !--mise à jour de flight_m et flight_h2o dans leur module 3890 IF (ok_plane_h2o .OR. ok_plane_contrail) THEN3891 CALL airplane(debut,pphis,pplay,paprs,t_seri)3892 ENDIF3918 !IF (ok_plane_h2o .OR. ok_plane_contrail) THEN 3919 ! CALL airplane(debut,pphis,pplay,paprs,t_seri) 3920 !ENDIF 3893 3921 3894 3922 CALL lscp(klon,klev,phys_tstep,missing_val,paprs,pplay, & 3895 3923 t_seri, q_seri,ptconv,ratqs, & 3896 d_t_lsc, d_q_lsc, d_ql_lsc, d_qi_lsc, rneb, rneblsvol, rneb_seri,&3924 d_t_lsc, d_q_lsc, d_ql_lsc, d_qi_lsc, rneb, rneblsvol, & 3897 3925 pfraclr,pfracld, & 3898 3926 radocond, picefra, rain_lsc, snow_lsc, & … … 3900 3928 prfl, psfl, rhcl, & 3901 3929 zqasc, fraca,ztv,zpspsk,ztla,zthl,iflag_cld_th, & 3902 iflag_ice_thermo, ok_ice_sursat, zqsatl, zqsats, distcltop, temp_cltop, & 3903 qclr, qcld, qss, qvc, rnebclr, rnebss, gamma_ss, & 3904 Tcontr, qcontr, qcontr2, fcontrN, fcontrP , & 3930 iflag_ice_thermo, distcltop, temp_cltop, cell_area, & 3931 cf_seri, rvc_seri, u_seri, v_seri, pbl_eps(:,:,is_ave), & 3932 qsub, qissr, qcld, subfra, issrfra, gamma_cond, ratio_qi_qtot, & 3933 dcf_sub, dcf_con, dcf_mix, dqi_adj, dqi_sub, dqi_con, dqi_mix, & 3934 dqvc_adj, dqvc_sub, dqvc_con, dqvc_mix, qsatliq, qsatice, & 3935 Tcontr, qcontr, qcontr2, fcontrN, fcontrP, & 3936 dcf_avi, dqi_avi, dqvc_avi, flight_dist, flight_h2o, & 3905 3937 cloudth_sth,cloudth_senv,cloudth_sigmath,cloudth_sigmaenv, & 3906 3938 qraindiag, qsnowdiag, dqreva, dqssub, dqrauto, dqrcol, dqrmelt, & … … 5623 5655 d_qx(i,k,isol) = ( qs_seri(i,k) - qx(i,k,isol) ) / phys_tstep 5624 5656 ENDIF 5625 !--ice_sursat: nqo=4, on ajoute rneb 5626 IF (nqo.ge.4 .and. ok_ice_sursat) THEN 5627 d_qx(i,k,irneb) = ( rneb_seri(i,k) - qx(i,k,irneb) ) / phys_tstep 5657 !--ice_supersat: nqo=5, we add cloud fraction and cloudy water vapor to total water vapor ratio 5658 IF (nqo.ge.5 .and. ok_ice_supersat) THEN 5659 d_qx(i,k,icf) = ( cf_seri(i,k) - qx(i,k,icf) ) / phys_tstep 5660 d_qx(i,k,irvc) = ( rvc_seri(i,k) - qx(i,k,irvc) ) / phys_tstep 5628 5661 ENDIF 5629 5662 … … 5659 5692 ql_ancien(:,:) = ql_seri(:,:) 5660 5693 qs_ancien(:,:) = qs_seri(:,:) 5661 qbs_ancien(:,:) = qbs_seri(:,:) 5662 rneb_ancien(:,:) = rneb_seri(:,:) 5694 qbs_ancien(:,:)= qbs_seri(:,:) 5695 cf_ancien(:,:) = cf_seri(:,:) 5696 rvc_ancien(:,:)= rvc_seri(:,:) 5663 5697 CALL water_int(klon,klev,q_ancien,zmasse,prw_ancien) 5664 5698 CALL water_int(klon,klev,ql_ancien,zmasse,prlw_ancien)
Note: See TracChangeset
for help on using the changeset viewer.