Changeset 5634
- Timestamp:
- Apr 29, 2025, 12:07:04 AM (6 weeks ago)
- Location:
- LMDZ6/branches/contrails/libf/phylmd
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/contrails/libf/phylmd/lmdz_aviation.f90
r5623 r5634 174 174 pdf_loc = rhl_clr - pdf_scale(i) * pdf_gamma(i) 175 175 pdf_x = qcritcont(i) / qsatl(i) * 100. 176 pdf_y = LOG( MAX( pdf_x - pdf_loc, eps ) / pdf_scale(i) ) * pdf_alpha(i)176 pdf_y = LOG( MAX( ( pdf_x - pdf_loc ) / pdf_scale(i), eps) ) * pdf_alpha(i) 177 177 IF ( pdf_y .GT. 10. ) THEN !--Avoid overflows 178 178 pdf_fra_above_qcritcont = 0. … … 191 191 192 192 pdf_x = qsat(i) / qsatl(i) * 100. 193 pdf_y = LOG( MAX( pdf_x - pdf_loc, eps ) / pdf_scale(i) ) * pdf_alpha(i)193 pdf_y = LOG( MAX( ( pdf_x - pdf_loc ) / pdf_scale(i), eps) ) * pdf_alpha(i) 194 194 IF ( pdf_y .GT. 10. ) THEN !--Avoid overflows 195 195 pdf_fra_above_qsat = 0. -
LMDZ6/branches/contrails/libf/phylmd/lmdz_lscp_condensation.f90
r5631 r5634 556 556 !--the old one, it is comprised between 0 and 1 557 557 tauinv_depsub = qiceincld**(1./3.) * kappa_depsub 558 qice_ratio = tauinv_depsub * dtime / 1.5 / qicein mix* ( qsat(i) - qvapincld )558 qice_ratio = tauinv_depsub * dtime / 1.5 / qiceincld * ( qsat(i) - qvapincld ) 559 559 !--The new vapor in the cloud is increased with the 560 560 !--sublimated ice … … 683 683 pdf_gamma(i) = GAMMA(1. + 1. / pdf_alpha(i)) 684 684 !--Barrier to avoid overflows 685 pdf_scale(i) = MAX( 0.01, pdf_std / SQRT( &686 GAMMA(1. + 2. / pdf_alpha(i)) - pdf_gamma(i)**2 )) 685 pdf_scale(i) = MAX(eps, MIN(rhl_clr / pdf_gamma(i), pdf_std / SQRT( & 686 GAMMA(1. + 2. / pdf_alpha(i)) - pdf_gamma(i)**2 ))) 687 687 pdf_loc = rhl_clr - pdf_scale(i) * pdf_gamma(i) 688 688 … … 692 692 693 693 pdf_x = gamma_cond(i) * qsat(i) / qsatl(i) * 100. 694 pdf_y = LOG( MAX( pdf_x - pdf_loc, eps ) / pdf_scale(i) ) * pdf_alpha(i)694 pdf_y = LOG( MAX( ( pdf_x - pdf_loc ) / pdf_scale(i), eps) ) * pdf_alpha(i) 695 695 IF ( pdf_y .GT. 10. ) THEN !--Avoid overflows 696 696 pdf_fra_above_nuc = 0. … … 747 747 pdf_alpha(i) = 1. 748 748 pdf_gamma(i) = 1. 749 pdf_scale(i) = 0.01749 pdf_scale(i) = eps 750 750 ENDIF ! clrfra(i) .GT. eps 751 751 … … 786 786 !--are spherical. 787 787 !-- b / a = bovera = MAX(0.1, cldfra) 788 bovera = MAX(0.1, cldfra(i)) 788 !bovera = MAX(0.1, cldfra(i)) 789 bovera = 0.111111111 789 790 !--P / a is a function of b / a only, that we can calculate 790 791 !-- P / a = RPI * ( 3. * ( 1. + b / a ) - SQRT( (3. + b / a) * (1. + 3. * b / a) ) ) … … 877 878 878 879 rhl_clr = qclr(i) / clrfra(i) / qsatl(i) * 100. 880 pdf_x = qvapinclr_lim / qsatl(i) * 100. 879 881 pdf_loc = rhl_clr - pdf_scale(i) * pdf_gamma(i) 880 pdf_x = q vapinclr_lim/ qsatl(i) * 100.881 pdf_y = LOG( MAX( pdf_x - pdf_loc, eps ) / pdf_scale(i) ) * pdf_alpha(i)882 pdf_x = qsat(i) / qsatl(i) * 100. 883 pdf_y = LOG( MAX( ( pdf_x - pdf_loc ) / pdf_scale(i), eps) ) * pdf_alpha(i) 882 884 IF ( pdf_y .GT. 10. ) THEN !--Avoid overflows 883 885 pdf_fra_above_lim = 0. … … 1034 1036 1035 1037 rhl_clr = qclr(i) / clrfra(i) / qsatl(i) * 100. 1038 pdf_x = qvapinclr_lim / qsatl(i) * 100. 1036 1039 pdf_loc = rhl_clr - pdf_scale(i) * pdf_gamma(i) 1037 pdf_x = q vapinclr_lim/ qsatl(i) * 100.1038 pdf_y = LOG( MAX( pdf_x - pdf_loc, eps ) / pdf_scale(i) ) * pdf_alpha(i)1040 pdf_x = qsat(i) / qsatl(i) * 100. 1041 pdf_y = LOG( MAX( ( pdf_x - pdf_loc ) / pdf_scale(i), eps) ) * pdf_alpha(i) 1039 1042 IF ( pdf_y .GT. 10. ) THEN !--Avoid overflows 1040 1043 pdf_fra_above_lim = 0. … … 1138 1141 1139 1142 rhl_clr = qclr(i) / clrfra(i) / qsatl(i) * 100. 1143 pdf_x = qvapinclr_lim / qsatl(i) * 100. 1140 1144 pdf_loc = rhl_clr - pdf_scale(i) * pdf_gamma(i) 1141 pdf_x = q vapinclr_lim/ qsatl(i) * 100.1142 pdf_y = LOG( MAX( pdf_x - pdf_loc, eps ) / pdf_scale(i) ) * pdf_alpha(i)1145 pdf_x = qsat(i) / qsatl(i) * 100. 1146 pdf_y = LOG( MAX( ( pdf_x - pdf_loc ) / pdf_scale(i), eps) ) * pdf_alpha(i) 1143 1147 IF ( pdf_y .GT. 10. ) THEN !--Avoid overflows 1144 1148 pdf_fra_above_lim = 0. … … 1193 1197 pdf_loc = rhl_clr - pdf_scale(i) * pdf_gamma(i) 1194 1198 pdf_x = qsat(i) / qsatl(i) * 100. 1195 pdf_y = LOG( MAX( pdf_x - pdf_loc, eps ) / pdf_scale(i) ) * pdf_alpha(i)1199 pdf_y = LOG( MAX( ( pdf_x - pdf_loc ) / pdf_scale(i), eps) ) * pdf_alpha(i) 1196 1200 IF ( pdf_y .GT. 10. ) THEN !--Avoid overflows 1197 1201 issrfra(i) = 0. … … 1206 1210 issrfra(i) = EXP( - pdf_y ) * clrfra(i) 1207 1211 qissr(i) = ( pdf_e3 * clrfra(i) + pdf_loc * issrfra(i) ) * qsatl(i) / 100. 1212 ENDIF 1213 IF ( issrfra(i) .LT. eps ) THEN 1214 issrfra(i) = 0. 1215 qissr(i) = 0. 1208 1216 ENDIF 1209 1217 ELSE
Note: See TracChangeset
for help on using the changeset viewer.