Changeset 2635 for LMDZ5/trunk
- Timestamp:
- Sep 27, 2016, 6:02:46 PM (8 years ago)
- Location:
- LMDZ5/trunk/libf/phylmd
- Files:
-
- 1 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/trunk/libf/phylmd/YOETHF.h
r2043 r2635 24 24 & RALFDCP,RTWAT,RTBER,RTBERCU, & 25 25 & RTICE,RTICECU,RTWAT_RTICE_R,RTWAT_RTICECU_R,RKOOP1,& 26 & 26 & RKOOP2 27 27 28 28 !$OMP THREADPRIVATE(/YOETHF/) -
LMDZ5/trunk/libf/phylmd/calwake.F90
r2346 r2635 2 2 ! $Id$ 3 3 4 SUBROUTINE calwake(paprs, pplay, dtime, t, q, omgb, dt_dwn, dq_dwn, m_dwn, & 5 m_up, dt_a, dq_a, sigd, wdt_pbl, wdq_pbl, udt_pbl, udq_pbl, wake_deltat, & 6 wake_deltaq, wake_dth, wake_h, wake_s, wake_dens, wake_pe, wake_fip, & 7 wake_gfl, dt_wake, dq_wake, wake_k, undi_t, undi_q, wake_omgbdth, & 8 wake_dp_omgb, wake_dtke, wake_dqke, wake_dtpbl, wake_dqpbl, wake_omg, & 9 wake_dp_deltomg, wake_spread, wake_cstar, wake_d_deltat_gw, wake_ddeltat, & 10 wake_ddeltaq) 4 SUBROUTINE calwake(iflag_wake_tend, paprs, pplay, dtime, & 5 t, q, omgb, & 6 dt_dwn, dq_dwn, m_dwn, m_up, dt_a, dq_a, & 7 sigd, & 8 wake_deltat, wake_deltaq, wake_s, wake_dens, & 9 wake_dth, wake_h, & 10 wake_pe, wake_fip, wake_gfl, & 11 dt_wake, dq_wake, wake_k, t_x, q_x, wake_omgbdth, & 12 wake_dp_omgb, & 13 wake_dtke, wake_dqke, & 14 wake_omg, wake_dp_deltomg, & 15 wake_spread, wake_cstar, wake_d_deltat_gw, & 16 wake_ddeltat, wake_ddeltaq, wake_ds, wake_ddens) 11 17 ! ************************************************************** 12 18 ! * … … 26 32 ! Arguments 27 33 ! ---------- 28 29 INTEGER i, l, ktopw(klon) 30 REAL dtime 31 32 REAL paprs(klon, klev+1), pplay(klon, klev) 33 REAL t(klon, klev), q(klon, klev), omgb(klon, klev) 34 REAL dt_dwn(klon, klev), dq_dwn(klon, klev), m_dwn(klon, klev) 35 REAL m_up(klon, klev) 36 REAL dt_a(klon, klev), dq_a(klon, klev) 37 REAL wdt_pbl(klon, klev), wdq_pbl(klon, klev) 38 REAL udt_pbl(klon, klev), udq_pbl(klon, klev) 39 REAL wake_deltat(klon, klev), wake_deltaq(klon, klev) 40 REAL dt_wake(klon, klev), dq_wake(klon, klev) 41 REAL wake_d_deltat_gw(klon, klev) 42 REAL wake_h(klon), wake_s(klon) 43 REAL wake_dth(klon, klev) 44 REAL wake_pe(klon), wake_fip(klon), wake_gfl(klon) 45 REAL undi_t(klon, klev), undi_q(klon, klev) 46 REAL wake_omgbdth(klon, klev), wake_dp_omgb(klon, klev) 47 REAL wake_dtke(klon, klev), wake_dqke(klon, klev) 48 REAL wake_dtpbl(klon, klev), wake_dqpbl(klon, klev) 49 REAL wake_omg(klon, klev), wake_dp_deltomg(klon, klev) 50 REAL wake_spread(klon, klev), wake_cstar(klon) 51 REAL wake_ddeltat(klon, klev), wake_ddeltaq(klon, klev) 52 REAL d_deltatw(klon, klev), d_deltaqw(klon, klev) 53 INTEGER wake_k(klon) 54 REAL sigd(klon) 55 REAL wake_dens(klon) 34 ! Input 35 ! ---- 36 INTEGER, INTENT (IN) :: iflag_wake_tend 37 REAL, INTENT (IN) :: dtime 38 REAL, DIMENSION(klon, klev), INTENT (IN) :: pplay 39 REAL, DIMENSION(klon, klev+1), INTENT (IN) :: paprs 40 REAL, DIMENSION(klon, klev), INTENT (IN) :: t, q, omgb 41 REAL, DIMENSION(klon, klev), INTENT (IN) :: dt_dwn, dq_dwn 42 REAL, DIMENSION(klon, klev), INTENT (IN) :: m_up, m_dwn 43 REAL, DIMENSION(klon, klev), INTENT (IN) :: dt_a, dq_a 44 REAL, DIMENSION(klon), INTENT (IN) :: sigd 45 ! Input/Output 46 ! ------------ 47 REAL, DIMENSION(klon, klev), INTENT (INOUT) :: wake_deltat, wake_deltaq 48 REAL, DIMENSION(klon), INTENT (INOUT) :: wake_s 49 REAL, DIMENSION(klon), INTENT (INOUT) :: wake_dens 50 ! Output 51 ! ------ 52 REAL, DIMENSION(klon, klev), INTENT (OUT) :: dt_wake, dq_wake 53 INTEGER, DIMENSION(klon), INTENT (OUT) :: wake_k 54 REAL, DIMENSION(klon, klev), INTENT (OUT) :: wake_d_deltat_gw 55 REAL, DIMENSION(klon), INTENT (OUT) :: wake_h 56 REAL, DIMENSION(klon, klev), INTENT (OUT) :: wake_dth 57 REAL, DIMENSION(klon), INTENT (OUT) :: wake_pe, wake_fip, wake_gfl 58 REAL, DIMENSION(klon, klev), INTENT (OUT) :: t_x, q_x 59 REAL, DIMENSION(klon, klev), INTENT (OUT) :: wake_omgbdth, wake_dp_omgb 60 REAL, DIMENSION(klon, klev), INTENT (OUT) :: wake_dtke, wake_dqke 61 REAL, DIMENSION(klon, klev), INTENT (OUT) :: wake_omg, wake_dp_deltomg 62 REAL, DIMENSION(klon, klev), INTENT (OUT) :: wake_spread 63 REAL, DIMENSION(klon), INTENT (OUT) :: wake_cstar 64 REAL, DIMENSION(klon, klev), INTENT (OUT) :: wake_ddeltat, wake_ddeltaq 65 REAL, DIMENSION(klon), INTENT (OUT) :: wake_ds, wake_ddens 66 56 67 57 68 ! Variable internes 58 69 ! ----------------- 59 60 REAL aire 61 REAL p(klon, klev), ph(klon, klev+1), pi(klon, klev) 62 REAL te(klon, klev), qe(klon, klev), omgbe(klon, klev+1) 63 REAL dtdwn(klon, klev), dqdwn(klon, klev) 64 REAL dta(klon, klev), dqa(klon, klev) 65 REAL wdtpbl(klon, klev), wdqpbl(klon, klev) 66 REAL udtpbl(klon, klev), udqpbl(klon, klev) 67 REAL amdwn(klon, klev), amup(klon, klev) 68 REAL dtw(klon, klev), dqw(klon, klev), dth(klon, klev) 69 REAL d_deltat_gw(klon, klev) 70 REAL dtls(klon, klev), dqls(klon, klev) 71 REAL tu(klon, klev), qu(klon, klev) 72 REAL hw(klon), sigmaw(klon), wape(klon), fip(klon), gfl(klon) 73 REAL omgbdth(klon, klev+1), dp_omgb(klon, klev) 74 REAL dtke(klon, klev), dqke(klon, klev) 75 REAL dtpbl(klon, klev), dqpbl(klon, klev) 76 REAL omg(klon, klev+1), dp_deltomg(klon, klev), spread(klon, klev) 77 REAL cstar(klon) 78 REAL sigd0(klon), wdens(klon) 79 80 REAL rdcp 70 INTEGER :: i, l 71 REAL :: aire 72 REAL, DIMENSION(klon, klev) :: p, pi 73 REAL, DIMENSION(klon, klev+1) :: ph, omgbe 74 REAL, DIMENSION(klon, klev) :: te, qe 75 REAL, DIMENSION(klon, klev) :: dtdwn, dqdwn 76 REAL, DIMENSION(klon, klev) :: dta, dqa 77 REAL, DIMENSION(klon, klev) :: amdwn, amup 78 REAL, DIMENSION(klon, klev) :: dtw, dqw, dth 79 REAL, DIMENSION(klon, klev) :: dtls, dqls 80 REAL, DIMENSION(klon, klev) :: tx, qx 81 REAL, DIMENSION(klon) :: hw, wape, fip, gfl 82 REAL, DIMENSION(klon) :: sigmaw, wdens 83 REAL, DIMENSION(klon, klev+1) :: omgbdth 84 REAL, DIMENSION(klon, klev) :: dp_omgb 85 REAL, DIMENSION(klon, klev) :: dtke, dqke 86 REAL, DIMENSION(klon, klev+1) :: omg 87 REAL, DIMENSION(klon, klev) :: dp_deltomg, spread 88 REAL, DIMENSION(klon) :: cstar 89 REAL, DIMENSION(klon) :: sigd0 90 INTEGER, DIMENSION(klon) :: ktopw 91 REAL, DIMENSION(klon, klev) :: d_deltat_gw 92 REAL, DIMENSION(klon, klev) :: d_deltatw, d_deltaqw 93 REAL, DIMENSION(klon) :: d_sigmaw, d_wdens 94 95 REAL :: rdcp 96 81 97 82 98 ! print *, '-> calwake, wake_s ', wake_s(1) … … 104 120 dta(i, l) = dt_a(i, l) 105 121 dqa(i, l) = dq_a(i, l) 106 wdtpbl(i, l) = wdt_pbl(i, l)107 wdqpbl(i, l) = wdq_pbl(i, l)108 udtpbl(i, l) = udt_pbl(i, l)109 udqpbl(i, l) = udq_pbl(i, l)110 122 END DO 111 123 END DO … … 125 137 END DO 126 138 139 DO i = 1, klon 140 hw(i) = wake_h(i) 141 END DO 142 ! 143 ! Make a copy of state variables 127 144 DO l = 1, klev 128 145 DO i = 1, klon … … 132 149 END DO 133 150 134 DO l = 1, klev 135 DO i = 1, klon 136 dtls(i, l) = dt_wake(i, l) 137 dqls(i, l) = dq_wake(i, l) 138 END DO 139 END DO 140 141 DO i = 1, klon 142 hw(i) = wake_h(i) 151 DO i = 1, klon 143 152 sigmaw(i) = wake_s(i) 153 END DO 154 155 DO i = 1, klon 156 wdens(i) = wake_dens(i) 144 157 END DO 145 158 … … 166 179 END DO 167 180 168 CALL wake(p, ph, pi, dtime, sigd0, te, qe, omgbe, dtdwn, dqdwn, amdwn, & 169 amup, dta, dqa, wdtpbl, wdqpbl, udtpbl, udqpbl, dtw, dqw, dth, hw, & 170 sigmaw, wape, fip, gfl, dtls, dqls, ktopw, omgbdth, dp_omgb, wdens, tu, & 171 qu, dtke, dqke, dtpbl, dqpbl, omg, dp_deltomg, spread, cstar, & 172 d_deltat_gw, d_deltatw, d_deltaqw) 173 181 CALL wake(p, ph, pi, dtime, & 182 te, qe, omgbe, & 183 dtdwn, dqdwn, amdwn, amup, dta, dqa, & 184 sigd0, & 185 dtw, dqw, sigmaw, wdens, & ! state variables 186 dth, hw, wape, fip, gfl, & 187 dtls, dqls, ktopw, omgbdth, dp_omgb, tx, qx, & 188 dtke, dqke, omg, dp_deltomg, spread, cstar, & 189 d_deltat_gw, & 190 d_deltatw, d_deltaqw, d_sigmaw, d_wdens) ! tendencies 191 192 ! 174 193 DO l = 1, klev 175 194 DO i = 1, klon 176 195 IF (ktopw(i)>0) THEN 177 wake_deltat(i, l) = dtw(i, l)178 wake_deltaq(i, l) = dqw(i, l)179 196 wake_d_deltat_gw(i, l) = d_deltat_gw(i, l) 180 197 wake_omgbdth(i, l) = omgbdth(i, l) … … 182 199 wake_dtke(i, l) = dtke(i, l) 183 200 wake_dqke(i, l) = dqke(i, l) 184 wake_dtpbl(i, l) = dtpbl(i, l)185 wake_dqpbl(i, l) = dqpbl(i, l)186 201 wake_omg(i, l) = omg(i, l) 187 202 wake_dp_deltomg(i, l) = dp_deltomg(i, l) 188 203 wake_spread(i, l) = spread(i, l) 189 204 wake_dth(i, l) = dth(i, l) 190 dt_wake(i, l) = dtls(i, l) 191 dq_wake(i, l) = dqls(i, l) 192 undi_t(i, l) = tu(i, l) 193 undi_q(i, l) = qu(i, l) 194 wake_ddeltat(i, l) = d_deltatw(i, l) 195 wake_ddeltaq(i, l) = d_deltaqw(i, l) 205 dt_wake(i, l) = dtls(i, l)*dtime ! derivative -> tendency 206 dq_wake(i, l) = dqls(i, l)*dtime ! derivative -> tendency 207 t_x(i, l) = tx(i, l) 208 q_x(i, l) = qx(i, l) 196 209 ELSE 197 wake_deltat(i, l) = 0.198 wake_deltaq(i, l) = 0.199 210 wake_d_deltat_gw(i, l) = 0. 200 211 wake_omgbdth(i, l) = 0. … … 202 213 wake_dtke(i, l) = 0. 203 214 wake_dqke(i, l) = 0. 204 wake_dtpbl(i, l) = 0.205 wake_dqpbl(i, l) = 0.206 215 wake_omg(i, l) = 0. 207 216 wake_dp_deltomg(i, l) = 0. … … 210 219 dt_wake(i, l) = 0. 211 220 dq_wake(i, l) = 0. 212 undi_t(i, l) = te(i, l) 213 undi_q(i, l) = qe(i, l) 214 wake_ddeltat(i, l) = 0. 215 wake_ddeltaq(i, l) = 0. 221 t_x(i, l) = te(i, l) 222 q_x(i, l) = qe(i, l) 216 223 END IF 217 224 END DO … … 220 227 DO i = 1, klon 221 228 wake_h(i) = hw(i) 222 wake_s(i) = sigmaw(i)223 229 wake_pe(i) = wape(i) 224 230 wake_fip(i) = fip(i) … … 226 232 wake_k(i) = ktopw(i) 227 233 wake_cstar(i) = cstar(i) 228 wake_dens(i) = wdens(i) 229 END DO 234 END DO 235 236 ! Tendencies of state variables 237 DO l = 1, klev 238 DO i = 1, klon 239 IF (ktopw(i)>0) THEN 240 wake_ddeltat(i, l) = d_deltatw(i, l)*dtime 241 wake_ddeltaq(i, l) = d_deltaqw(i, l)*dtime 242 ELSE 243 wake_ddeltat(i, l) = -wake_deltat(i, l) 244 wake_ddeltaq(i, l) = -wake_deltaq(i, l) 245 END IF 246 END DO 247 END DO 248 DO i = 1, klon 249 IF (ktopw(i)>0) THEN 250 wake_ds(i) = d_sigmaw(i)*dtime 251 wake_ddens(i) = d_wdens(i)*dtime 252 ELSE 253 wake_ds(i) = -wake_s(i) 254 wake_ddens(i)= -wake_dens(i) 255 END IF 256 END DO 257 258 !jyg< 259 IF (iflag_wake_tend .EQ. 0) THEN 260 ! Update State variables 261 DO l = 1, klev 262 DO i = 1, klon 263 IF (ktopw(i)>0) THEN 264 wake_deltat(i, l) = dtw(i, l) 265 wake_deltaq(i, l) = dqw(i, l) 266 ELSE 267 wake_deltat(i, l) = 0. 268 wake_deltaq(i, l) = 0. 269 END IF 270 END DO 271 END DO 272 DO i = 1, klon 273 wake_s(i) = sigmaw(i) 274 wake_dens(i) = wdens(i) 275 END DO 276 ENDIF 277 !>jyg 230 278 231 279 RETURN 232 280 END SUBROUTINE calwake 281 -
LMDZ5/trunk/libf/phylmd/dyn1d/lmdz1d.F90
r2611 r2635 16 16 ftsol, pbl_tke, pctsrf, radsol, rain_fall, snow_fall, ratqs, & 17 17 rnebcon, rugoro, sig1, w01, solaire_etat0, sollw, sollwdown, & 18 solsw, t_ancien, q_ancien, u_ancien, v_ancien, wake_cstar, wake_deltaq,&19 wake_delta t, wake_delta_pbl_TKE, delta_tsurf, wake_fip, wake_pe, &20 wake_ s, zgam, &21 z max0, zmea, zpic, zsig, &18 solsw, t_ancien, q_ancien, u_ancien, v_ancien, wake_cstar, & 19 wake_delta_pbl_TKE, delta_tsurf, wake_fip, wake_pe, & 20 wake_deltaq, wake_deltat, wake_s, wake_dens, & 21 zgam, zmax0, zmea, zpic, zsig, & 22 22 zstd, zthe, zval, ale_bl, ale_bl_trig, alp_bl 23 usedimphy24 usesurface_data, only : type_ocean,ok_veget25 use pbl_surface_mod, only : ftsoil, pbl_surface_init,&26 &pbl_surface_final27 usefonte_neige_mod, only : fonte_neige_init, fonte_neige_final28 29 useinfotrac ! new30 usecontrol_mod23 USE dimphy 24 USE surface_data, only : type_ocean,ok_veget 25 USE pbl_surface_mod, only : ftsoil, pbl_surface_init, & 26 pbl_surface_final 27 USE fonte_neige_mod, only : fonte_neige_init, fonte_neige_final 28 29 USE infotrac ! new 30 USE control_mod 31 31 USE indice_sol_mod 32 32 USE phyaqua_mod … … 787 787 wake_pe = 0. 788 788 wake_s = 0. 789 wake_dens = 0. 789 790 ale_bl = 0. 790 791 ale_bl_trig = 0. … … 810 811 ! t_ancien,q_ancien,,frugs(:,is_oce),clwcon(:,1),rnebcon(:,1),ratqs(:,1) 811 812 ! run_off_lic_0,pbl_tke(:,1:klev,nsrf), zmax0,f0,sig1,w01 812 ! wake_deltat,wake_deltaq,wake_s,wake_cstar,wake_fip,wake_delta_pbl_tke(:,1:klev,nsrf) 813 ! wake_deltat,wake_deltaq,wake_s,wake_dens,wake_cstar, 814 ! wake_fip,wake_delta_pbl_tke(:,1:klev,nsrf) 813 815 ! 814 816 ! NB2: The content of the startphy.nc file depends on some flags defined in -
LMDZ5/trunk/libf/phylmd/phyetat0.F90
r2569 r2635 17 17 solsw, t_ancien, u_ancien, v_ancien, w01, wake_cstar, wake_deltaq, & 18 18 wake_deltat, wake_delta_pbl_TKE, delta_tsurf, wake_fip, wake_pe, & 19 wake_s, zgam, zmax0, zmea, zpic, zsig, &19 wake_s, wake_dens, zgam, zmax0, zmea, zpic, zsig, & 20 20 zstd, zthe, zval, ale_bl, ale_bl_trig, alp_bl, u10m, v10m 21 21 USE geometry_mod, ONLY : longitude_deg, latitude_deg … … 377 377 found=phyetat0_get(klev,wake_deltat,"WAKE_DELTAT","Delta T wake/env",0.) 378 378 found=phyetat0_get(klev,wake_deltaq,"WAKE_DELTAQ","Delta hum. wake/env",0.) 379 found=phyetat0_get(1,wake_s,"WAKE_S","WAKE_S",0.) 379 found=phyetat0_get(1,wake_s,"WAKE_S","Wake frac. area",0.) 380 found=phyetat0_get(1,wake_dens,"WAKE_DENS","Wake num. /unit area",0.) 380 381 found=phyetat0_get(1,wake_cstar,"WAKE_CSTAR","WAKE_CSTAR",0.) 381 382 found=phyetat0_get(1,wake_pe,"WAKE_PE","WAKE_PE",0.) -
LMDZ5/trunk/libf/phylmd/phyredem.F90
r2569 r2635 18 18 v_ancien, clwcon, rnebcon, ratqs, pbl_tke, & 19 19 wake_delta_pbl_tke, zmax0, f0, sig1, w01, & 20 wake_deltat, wake_deltaq, wake_s, wake_cstar,& 20 wake_deltat, wake_deltaq, wake_s, wake_dens, & 21 wake_cstar, & 21 22 wake_pe, wake_fip, fm_therm, entr_therm, & 22 23 detr_therm, Ale_bl, Ale_bl_trig, Alp_bl, & … … 258 259 CALL put_field("WAKE_DELTAQ", "WAKE_DELTAQ", wake_deltaq) 259 260 260 CALL put_field("WAKE_S", "WAKE_S", wake_s) 261 CALL put_field("WAKE_S", "Wake frac. area", wake_s) 262 263 CALL put_field("WAKE_DENS", "Wake num. /unit area", wake_dens) 261 264 262 265 CALL put_field("WAKE_CSTAR", "WAKE_CSTAR", wake_cstar) -
LMDZ5/trunk/libf/phylmd/phys_local_var_mod.F90
r2607 r2635 253 253 REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: sens, flwp, fiwp 254 254 !$OMP THREADPRIVATE(sens, flwp, fiwp) 255 REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: ale_wake, alp_wake, bils 256 !$OMP THREADPRIVATE(ale_wake, alp_wake, bils) 255 !! 256 !! Wake variables 257 REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: ale_wake, alp_wake 258 !$OMP THREADPRIVATE(ale_wake, alp_wake) 259 REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: wake_h 260 !$OMP THREADPRIVATE(wake_h) 261 REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: wake_omg 262 !$OMP THREADPRIVATE(wake_omg) 263 REAL, SAVE, ALLOCATABLE,DIMENSION(:,:) :: d_deltat_wk, d_deltaq_wk 264 !$OMP THREADPRIVATE(d_deltat_wk, d_deltaq_wk) 265 REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: d_s_wk, d_dens_wk 266 !$OMP THREADPRIVATE(d_s_wk, d_dens_wk) 267 REAL, SAVE, ALLOCATABLE,DIMENSION(:,:) :: d_deltat_wk_gw, d_deltaq_wk_gw 268 !$OMP THREADPRIVATE(d_deltat_wk_gw, d_deltaq_wk_gw) 269 REAL, SAVE, ALLOCATABLE,DIMENSION(:,:) :: d_deltat_vdf, d_deltaq_vdf 270 !$OMP THREADPRIVATE(d_deltat_vdf, d_deltaq_vdf) 271 !!! REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: d_s_vdf, d_dens_vdf 272 !!!OMP THREADPRIVATE(d_s_vdf, d_dens_vdf) 273 REAL, SAVE, ALLOCATABLE,DIMENSION(:,:) :: d_deltat_the, d_deltaq_the 274 !$OMP THREADPRIVATE(d_deltat_the, d_deltaq_the) 275 !!! REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: d_s_the, d_dens_the 276 !!!OMP THREADPRIVATE(d_s_the, d_dens_the) 277 REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: d_deltat_ajs_cv, d_deltaq_ajs_cv 278 !$OMP THREADPRIVATE(d_deltat_ajs_cv, d_deltaq_ajs_cv) 279 !! End of Wake variables 280 !! 281 REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: bils 282 !$OMP THREADPRIVATE(bils) 257 283 REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: cdragm, cdragh 258 284 !$OMP THREADPRIVATE(cdragm, cdragh) … … 312 338 REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: dqvdf_x, dqvdf_w 313 339 !$OMP THREADPRIVATE(dqvdf_x, dqvdf_w) 314 REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: undi_tke, wake_tke315 !$OMP THREADPRIVATE(undi_tke, wake_tke)316 340 ! Variables supplémentaires dans physiq.F relative au splitting de la surface 317 341 REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: pbl_tke_input … … 330 354 !>jyg+nrlmd 331 355 ! 332 REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: w ake_h, wbeff, zmax_th, zq2m, zt2m333 !$OMP THREADPRIVATE(w ake_h, wbeff, zmax_th, zq2m, zt2m)356 REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: wbeff, zmax_th, zq2m, zt2m 357 !$OMP THREADPRIVATE(wbeff, zmax_th, zq2m, zt2m) 334 358 REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zt2m_min_mon, zt2m_max_mon 335 359 !$OMP THREADPRIVATE(zt2m_min_mon, zt2m_max_mon) … … 365 389 REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: ref_liq_pi, ref_ice_pi 366 390 !$OMP THREADPRIVATE(ref_liq_pi, ref_ice_pi) 367 REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: wake_omg,zx_rh368 !$OMP THREADPRIVATE( wake_omg,zx_rh)391 REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: zx_rh 392 !$OMP THREADPRIVATE(zx_rh) 369 393 REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: pmflxr, pmflxs, prfl, psfl, fraca 370 394 !$OMP THREADPRIVATE(pmflxr, pmflxs, prfl, psfl, fraca) … … 530 554 ALLOCATE(tal1(klon), pal1(klon), pab1(klon), pab2(klon)) 531 555 ALLOCATE(ptstar(klon),pt0(klon),slp(klon)) 532 ALLOCATE(ale_wake(klon), alp_wake(klon), bils(klon)) 556 !! 557 !! Wake variables 558 ALLOCATE(ale_wake(klon), alp_wake(klon)) 559 ALLOCATE(wake_h(klon)) 560 ALLOCATE(wake_omg(klon, klev)) 561 ALLOCATE(d_deltat_wk(klon, klev), d_deltaq_wk(klon, klev)) 562 ALLOCATE(d_s_wk(klon), d_dens_wk(klon)) 563 ALLOCATE(d_deltat_wk_gw(klon, klev), d_deltaq_wk_gw(klon, klev)) 564 ALLOCATE(d_deltat_vdf(klon, klev), d_deltaq_vdf(klon, klev)) 565 !! ALLOCATE( d_s_vdf(klon), d_dens_vdf(klon)) 566 ALLOCATE(d_deltat_the(klon, klev), d_deltaq_the(klon, klev)) 567 !! ALLOCATE( d_s_the(klon), d_dens_the(klon)) 568 ALLOCATE(d_deltat_ajs_cv(klon, klev), d_deltaq_ajs_cv(klon, klev)) 569 !! End of wake variables 570 !! 571 ALLOCATE(bils(klon)) 533 572 ALLOCATE(cdragm(klon), cdragh(klon), cldh(klon), cldl(klon)) 534 573 ALLOCATE(cldm(klon), cldq(klon), cldt(klon), qsat2m(klon)) … … 561 600 ALLOCATE(dtvdf_x(klon,klev), dtvdf_w(klon,klev)) 562 601 ALLOCATE(dqvdf_x(klon,klev), dqvdf_w(klon,klev)) 563 ALLOCATE(undi_tke(klon,klev), wake_tke(klon,klev))564 602 ALLOCATE(pbl_tke_input(klon,klev+1,nbsrf)) 565 603 ALLOCATE(t_therm(klon,klev), q_therm(klon,klev),u_therm(klon,klev), v_therm(klon,klev)) … … 568 606 ALLOCATE(kh(klon), kh_x(klon), kh_w(klon)) 569 607 ! 570 ALLOCATE(w ake_h(klon), wbeff(klon), zmax_th(klon))608 ALLOCATE(wbeff(klon), zmax_th(klon)) 571 609 ALLOCATE(zq2m(klon), zt2m(klon), weak_inversion(klon)) 572 610 ALLOCATE(zt2m_min_mon(klon), zt2m_max_mon(klon)) … … 589 627 ALLOCATE(ref_liq(klon, klev), ref_ice(klon, klev), theta(klon, klev)) 590 628 ALLOCATE(ref_liq_pi(klon, klev), ref_ice_pi(klon, klev)) 591 ALLOCATE(zphi(klon, klev), wake_omg(klon, klev),zx_rh(klon, klev))629 ALLOCATE(zphi(klon, klev), zx_rh(klon, klev)) 592 630 ALLOCATE(pmfd(klon, klev), pmfu(klon, klev)) 593 631 … … 741 779 DEALLOCATE(tal1, pal1, pab1, pab2) 742 780 DEALLOCATE(ptstar, pt0, slp) 743 DEALLOCATE(ale_wake, alp_wake, bils) 781 ! 782 DEALLOCATE(ale_wake, alp_wake) 783 DEALLOCATE(wake_h) 784 DEALLOCATE(wake_omg) 785 DEALLOCATE(d_deltat_wk, d_deltaq_wk) 786 DEALLOCATE(d_s_wk, d_dens_wk) 787 DEALLOCATE(d_deltat_wk_gw, d_deltaq_wk_gw) 788 DEALLOCATE(d_deltat_vdf, d_deltaq_vdf) 789 !! DEALLOCATE( d_s_vdf, d_dens_vdf) 790 DEALLOCATE(d_deltat_the, d_deltaq_the) 791 !! DEALLOCATE( d_s_the, d_dens_the) 792 DEALLOCATE(d_deltat_ajs_cv, d_deltaq_ajs_cv) 793 ! 794 DEALLOCATE(bils) 744 795 DEALLOCATE(cdragm, cdragh, cldh, cldl) 745 796 DEALLOCATE(cldm, cldq, cldt, qsat2m) … … 770 821 DEALLOCATE(dtvdf_x, dtvdf_w) 771 822 DEALLOCATE(dqvdf_x, dqvdf_w) 772 DEALLOCATE(undi_tke, wake_tke)773 823 DEALLOCATE(pbl_tke_input) 774 824 DEALLOCATE(t_therm, q_therm, u_therm, v_therm) … … 777 827 DEALLOCATE(kh, kh_x, kh_w) 778 828 ! 779 DEALLOCATE(w ake_h, wbeff, zmax_th)829 DEALLOCATE(wbeff, zmax_th) 780 830 DEALLOCATE(zq2m, zt2m, weak_inversion) 781 831 DEALLOCATE(zt2m_min_mon, zt2m_max_mon) … … 798 848 DEALLOCATE(ref_liq, ref_ice, theta) 799 849 DEALLOCATE(ref_liq_pi, ref_ice_pi) 800 DEALLOCATE(zphi, wake_omg,zx_rh)850 DEALLOCATE(zphi, zx_rh) 801 851 DEALLOCATE(pmfd, pmfu) 802 852 -
LMDZ5/trunk/libf/phylmd/phys_state_var_mod.F90
r2499 r2635 203 203 REAL,ALLOCATABLE,SAVE :: cin(:) 204 204 !$OMP THREADPRIVATE(cin) 205 ! ftd : differential heating between wake and environment205 ! ftd : convective heating due to unsaturated downdraughts 206 206 REAL,ALLOCATABLE,SAVE :: ftd(:,:) 207 207 !$OMP THREADPRIVATE(ftd) 208 ! fqd : differential moistening between wake and environment208 ! fqd : convective moistening due to unsaturated downdraughts 209 209 REAL,ALLOCATABLE,SAVE :: fqd(:,:) 210 210 !$OMP THREADPRIVATE(fqd) … … 232 232 ! wake_deltat : ecart de temperature avec la zone non perturbee 233 233 ! wake_deltaq : ecart d'humidite avec la zone non perturbee 234 ! wake_s : fraction surfacique occupee par la poche froide 235 ! wake_dens : number of wakes per unit area 236 ! wake_occ : occurence of wakes (= 1 if wakes occur, =0 otherwise) 234 237 ! wake_Cstar : vitesse d'etalement de la poche 235 ! wake_s : fraction surfacique occupee par la poche froide236 238 ! wake_pe : wake potential energy - WAPE 237 239 ! wake_fip : Gust Front Impinging power - ALP 238 ! dt_wake, dq_wake: LS tendencies due to wake239 240 REAL,ALLOCATABLE,SAVE :: wake_deltat(:,:) 240 241 !$OMP THREADPRIVATE(wake_deltat) 241 242 REAL,ALLOCATABLE,SAVE :: wake_deltaq(:,:) 242 243 !$OMP THREADPRIVATE(wake_deltaq) 244 REAL,ALLOCATABLE,SAVE :: wake_s(:) 245 !$OMP THREADPRIVATE(wake_s) 246 REAL,ALLOCATABLE,SAVE :: wake_dens(:) 247 !$OMP THREADPRIVATE(wake_dens) 243 248 REAL,ALLOCATABLE,SAVE :: wake_Cstar(:) 244 249 !$OMP THREADPRIVATE(wake_Cstar) 245 REAL,ALLOCATABLE,SAVE :: wake_s(:)246 !$OMP THREADPRIVATE(wake_s)247 250 REAL,ALLOCATABLE,SAVE :: wake_pe(:) 248 251 !$OMP THREADPRIVATE(wake_pe) 249 252 REAL,ALLOCATABLE,SAVE :: wake_fip(:) 250 253 !$OMP THREADPRIVATE(wake_fip) 251 REAL,ALLOCATABLE,SAVE :: dt_wake(:,:)252 !$OMP THREADPRIVATE(dt_wake)253 REAL,ALLOCATABLE,SAVE :: dq_wake(:,:)254 !$OMP THREADPRIVATE(dq_wake)255 254 ! 256 255 !jyg< … … 524 523 ALLOCATE(wght_th(klon,klev)) 525 524 ALLOCATE(wake_deltat(klon,klev), wake_deltaq(klon,klev)) 526 ALLOCATE(wake_Cstar(klon), wake_s(klon)) 525 ALLOCATE(wake_s(klon), wake_dens(klon)) 526 ALLOCATE(wake_Cstar(klon)) 527 527 ALLOCATE(wake_pe(klon), wake_fip(klon)) 528 ALLOCATE(dt_wake(klon,klev), dq_wake(klon,klev))529 528 !jyg< 530 529 ALLOCATE(wake_delta_pbl_TKE(klon,klev+1,nbsrf+1)) … … 664 663 deallocate(lalim_conv, wght_th) 665 664 deallocate(wake_deltat, wake_deltaq) 666 deallocate(wake_ Cstar, wake_s, wake_pe, wake_fip)667 deallocate( dt_wake, dq_wake)665 deallocate(wake_s, wake_dens) 666 deallocate(wake_Cstar, wake_pe, wake_fip) 668 667 !jyg< 669 668 deallocate(wake_delta_pbl_TKE) -
LMDZ5/trunk/libf/phylmd/physiq_mod.F90
r2630 r2635 133 133 dtvdf_x, dtvdf_w, & 134 134 dqvdf_x, dqvdf_w, & 135 undi_tke, wake_tke, &136 135 pbl_tke_input, & 137 136 t_therm, q_therm, u_therm, v_therm, & … … 141 140 ! 142 141 ale_wake, alp_wake, & 143 wake_h, wbeff, zmax_th, & 142 wake_h, wake_omg, & 143 ! tendencies of delta T and delta q: 144 d_deltat_wk, d_deltaq_wk, & ! due to wakes 145 d_deltat_wk_gw, d_deltaq_wk_gw, & ! due to wake induced gravity waves 146 d_deltat_vdf, d_deltaq_vdf, & ! due to vertical diffusion 147 d_deltat_the, d_deltaq_the, & ! due to thermals 148 d_deltat_ajs_cv, d_deltaq_ajs_cv, & ! due to dry adjustment of (w) before convection 149 ! tendencies of wake fractional area and wake number per unit area: 150 d_s_wk, d_dens_wk, & ! due to wakes 151 !!! d_s_vdf, d_dens_vdf, & ! due to vertical diffusion 152 !!! d_s_the, d_dens_the, & ! due to thermals 153 ! 154 wbeff, zmax_th, & 144 155 sens, flwp, fiwp, & 145 156 ale_bl_stat,alp_bl_conv,alp_bl_det, & … … 157 168 ref_liq, ref_ice, theta, & 158 169 ref_liq_pi, ref_ice_pi, & 159 zphi, wake_omg,zx_rh, &170 zphi, zx_rh, & 160 171 pmfd, pmfu, & 161 172 ! … … 529 540 !RC 530 541 ! Variables li\'ees \`a la poche froide (jyg et rr) 531 ! Version diagnostique pour l'instant : pas de r\'etroaction sur 532 ! la convection 533 534 REAL t_wake(klon,klev),q_wake(klon,klev) ! wake pour la convection 542 543 INTEGER, SAVE :: iflag_wake_tend ! wake: if =0, then wake state variables are 544 ! updated within calwake 545 !$OMP THREADPRIVATE(iflag_wake_tend) 546 REAL t_w(klon,klev),q_w(klon,klev) ! temperature and moisture profiles in the wake region 547 REAL t_x(klon,klev),q_x(klon,klev) ! temperature and moisture profiles in the off-wake region 535 548 536 549 REAL wake_dth(klon,klev) ! wake : temp pot difference 537 550 538 REAL wake_d_deltat_gw(klon,klev)! wake : delta T tendency due to539 ! Gravity Wave (/s)540 551 REAL wake_omgbdth(klon,klev) ! Wake : flux of Delta_Theta 541 552 ! transported by LS omega … … 546 557 REAL wake_dqKE(klon,klev) ! Wake : differential moistening 547 558 ! (wake - unpertubed) CONV 548 REAL wake_dtPBL(klon,klev) ! Wake : differential heating549 ! (wake - unpertubed) PBL550 REAL wake_dqPBL(klon,klev) ! Wake : differential moistening551 ! (wake - unpertubed) PBL552 REAL wake_ddeltat(klon,klev),wake_ddeltaq(klon,klev)553 559 REAL wake_dp_deltomg(klon,klev) ! Wake : gradient vertical de wake_omg 554 560 REAL wake_spread(klon,klev) ! spreading term in wake_delt … … 557 563 ! 558 564 INTEGER wake_k(klon) ! Wake sommet 559 !560 REAL t_undi(klon,klev) ! temperature moyenne dans la zone561 ! non perturbee562 REAL q_undi(klon,klev) ! humidite moyenne dans la zone563 ! non perturbee564 565 ! 565 566 !jyg< … … 568 569 569 570 REAL wake_gfl(klon) ! Gust Front Length 570 REAL wake_dens(klon) 571 !!! REAL wake_dens(klon) ! moved to phys_state_var_mod 571 572 ! 572 573 ! 573 574 REAL dt_dwn(klon,klev) 574 575 REAL dq_dwn(klon,klev) 575 REAL wdt_PBL(klon,klev)576 REAL udt_PBL(klon,klev)577 REAL wdq_PBL(klon,klev)578 REAL udq_PBL(klon,klev)579 576 REAL M_dwn(klon,klev) 580 577 REAL M_up(klon,klev) … … 589 586 REAL, SAVE :: alp_offset 590 587 !$OMP THREADPRIVATE(alp_offset) 591 592 ! !!593 !=================================================================594 ! PROVISOIRE : DECOUPLAGE PBL/WAKE595 ! --------------------------------596 REAL wake_deltat_sav(klon,klev)597 REAL wake_deltaq_sav(klon,klev)598 !=================================================================599 588 600 589 ! … … 815 804 ! tendance nulles 816 805 REAL, dimension(klon,klev):: du0, dv0, dt0, dq0, dql0, dqi0 806 REAL, dimension(klon) :: dsig0, ddens0 807 INTEGER, dimension(klon) :: wkoccur1 817 808 ! 818 809 ! Flag pour pouvoir ne pas ajouter les tendances. … … 1209 1200 CALL getin_p('ratqsp0',ratqsp0) 1210 1201 CALL getin_p('ratqsdp',ratqsdp) 1202 iflag_wake_tend = 0 1203 CALL getin_p('iflag_wake_tend',iflag_wake_tend) 1211 1204 ENDIF 1212 1205 … … 1698 1691 dql0(:,:)=0. 1699 1692 dqi0(:,:)=0. 1693 dsig0(:) = 0. 1694 ddens0(:) = 0. 1695 wkoccur1(:)=1 1700 1696 ! 1701 1697 ! Mettre a zero des variables de sortie (pour securite) … … 2135 2131 ENDIF 2136 2132 ! !! 2137 !=================================================================2138 ! PROVISOIRE : DECOUPLAGE PBL/WAKE2139 ! --------------------------------2140 !2141 !! wake_deltat_sav(:,:)=wake_deltat(:,:)2142 !! wake_deltaq_sav(:,:)=wake_deltaq(:,:)2143 !! wake_deltat(:,:)=0.2144 !! wake_deltaq(:,:)=0.2145 !=================================================================2146 2133 !>jyg+nrlmd 2147 2134 ! … … 2218 2205 ) 2219 2206 ! 2220 !=================================================================2221 ! PROVISOIRE : DECOUPLAGE PBL/WAKE2222 ! --------------------------------2223 !2224 !! wake_deltat(:,:)=wake_deltat_sav(:,:)2225 !! wake_deltaq(:,:)=wake_deltaq_sav(:,:)2226 !=================================================================2227 !2228 2207 ! Add turbulent diffusion tendency to the wake difference variables 2229 2208 IF (mod(iflag_pbl_split,2) .NE. 0) THEN 2230 wake_deltat(:,:) = wake_deltat(:,:) + (d_t_vdf_w(:,:)-d_t_vdf_x(:,:)) 2231 wake_deltaq(:,:) = wake_deltaq(:,:) + (d_q_vdf_w(:,:)-d_q_vdf_x(:,:)) 2209 !jyg< 2210 d_deltat_vdf(:,:) = d_t_vdf_w(:,:)-d_t_vdf_x(:,:) 2211 d_deltaq_vdf(:,:) = d_q_vdf_w(:,:)-d_q_vdf_x(:,:) 2212 CALL add_wake_tend & 2213 (d_deltat_vdf, d_deltaq_vdf, dsig0, ddens0, wkoccur1, 'vdf', abortphy) 2214 ELSE 2215 d_deltat_vdf(:,:) = 0. 2216 d_deltaq_vdf(:,:) = 0. 2217 !>jyg 2232 2218 ENDIF 2233 2219 … … 2404 2390 !======================================================================= 2405 2391 !ajout pour la parametrisation des poches froides: calcul de 2406 !t_w ake et t_undi: si pas de poches froides, t_wake=t_undi=t_seri2407 do k=1,klev2408 do i=1,klon2409 if (iflag_wake>=1) then2410 t_w ake(i,k) = t_seri(i,k) &2392 !t_w et t_x: si pas de poches froides, t_w=t_x=t_seri 2393 if (iflag_wake>=1) then 2394 do k=1,klev 2395 do i=1,klon 2396 t_w(i,k) = t_seri(i,k) & 2411 2397 +(1-wake_s(i))*wake_deltat(i,k) 2412 q_w ake(i,k) = q_seri(i,k) &2398 q_w(i,k) = q_seri(i,k) & 2413 2399 +(1-wake_s(i))*wake_deltaq(i,k) 2414 t_ undi(i,k) = t_seri(i,k) &2400 t_x(i,k) = t_seri(i,k) & 2415 2401 -wake_s(i)*wake_deltat(i,k) 2416 q_ undi(i,k) = q_seri(i,k) &2402 q_x(i,k) = q_seri(i,k) & 2417 2403 -wake_s(i)*wake_deltaq(i,k) 2418 else2419 t_wake(i,k) = t_seri(i,k)2420 q_wake(i,k) = q_seri(i,k)2421 t_ undi(i,k) = t_seri(i,k)2422 q_ undi(i,k) = q_seri(i,k)2423 endif2424 enddo2425 end do2404 enddo 2405 enddo 2406 else 2407 t_w(:,:) = t_seri(:,:) 2408 q_w(:,:) = q_seri(:,:) 2409 t_x(:,:) = t_seri(:,:) 2410 q_x(:,:) = q_seri(:,:) 2411 endif 2426 2412 ! 2427 2413 !jyg< … … 2432 2418 IF (ok_adjwk) THEN 2433 2419 limbas(:) = 1 2434 CALL ajsec(paprs, pplay, t_w ake, q_wake, limbas, &2420 CALL ajsec(paprs, pplay, t_w, q_w, limbas, & 2435 2421 d_t_adjwk, d_q_adjwk) 2436 2422 ENDIF … … 2439 2425 DO i=1,klon 2440 2426 IF (wake_s(i) .GT. 1.e-3) THEN 2441 t_wake(i,k) = t_wake(i,k) + d_t_adjwk(i,k) 2442 q_wake(i,k) = q_wake(i,k) + d_q_adjwk(i,k) 2443 wake_deltat(i,k) = wake_deltat(i,k) + d_t_adjwk(i,k) 2444 wake_deltaq(i,k) = wake_deltaq(i,k) + d_q_adjwk(i,k) 2427 t_w(i,k) = t_w(i,k) + d_t_adjwk(i,k) 2428 q_w(i,k) = q_w(i,k) + d_q_adjwk(i,k) 2429 d_deltat_ajs_cv(i,k) = d_t_adjwk(i,k) 2430 d_deltaq_ajs_cv(i,k) = d_q_adjwk(i,k) 2431 ELSE 2432 d_deltat_ajs_cv(i,k) = 0. 2433 d_deltaq_ajs_cv(i,k) = 0. 2445 2434 ENDIF 2446 2435 ENDDO 2447 2436 ENDDO 2437 CALL add_wake_tend & 2438 (d_deltat_ajs_cv, d_deltaq_ajs_cv, dsig0, ddens0, wkoccur1, 'ajs_cv', abortphy) 2448 2439 ENDIF ! (iflag_wake>=1) 2449 2440 !>jyg … … 2486 2477 !jyg iflag_con est dans clesphys 2487 2478 !c CALL concvl (iflag_con,iflag_clos, 2488 clw=0.2489 2479 CALL concvl (iflag_clos, & 2490 dtime, paprs, pplay, k_upper_cv, t_ undi,q_undi, &2491 t_w ake,q_wake,wake_s, &2480 dtime, paprs, pplay, k_upper_cv, t_x,q_x, & 2481 t_w,q_w,wake_s, & 2492 2482 u_seri,v_seri,tr_seri,nbtr_tmp, & 2493 2483 ALE,ALP, & … … 2705 2695 ENDDO 2706 2696 ENDDO 2707 !nrlmd+jyg<2708 DO k=1,klev2709 DO i=1,klon2710 wdt_PBL(i,k) = 0.2711 wdq_PBL(i,k) = 0.2712 udt_PBL(i,k) = 0.2713 udq_PBL(i,k) = 0.2714 ENDDO2715 ENDDO2716 !2717 IF (mod(iflag_pbl_split,2) .EQ. 1) THEN2718 DO k=1,klev2719 DO i=1,klon2720 wdt_PBL(i,k) = wdt_PBL(i,k) + d_t_vdf_w(i,k)/dtime2721 wdq_PBL(i,k) = wdq_PBL(i,k) + d_q_vdf_w(i,k)/dtime2722 udt_PBL(i,k) = udt_PBL(i,k) + d_t_vdf_x(i,k)/dtime2723 udq_PBL(i,k) = udq_PBL(i,k) + d_q_vdf_x(i,k)/dtime2724 !! dt_dwn(i,k) = dt_dwn(i,k) + d_t_vdf_w(i,k)/dtime2725 !! dq_dwn(i,k) = dq_dwn(i,k) + d_q_vdf_w(i,k)/dtime2726 !! dt_a (i,k) = dt_a(i,k) + d_t_vdf_x(i,k)/dtime2727 !! dq_a (i,k) = dq_a(i,k) + d_q_vdf_x(i,k)/dtime2728 ENDDO2729 ENDDO2730 ENDIF2731 IF (mod(iflag_pbl_split/2,2) .EQ. 1) THEN2732 DO k=1,klev2733 DO i=1,klon2734 !! dt_dwn(i,k) = dt_dwn(i,k) + 0.2735 !! dq_dwn(i,k) = dq_dwn(i,k) + 0.2736 !! dt_a(i,k) = dt_a(i,k) + d_t_ajs(i,k)/dtime2737 !! dq_a(i,k) = dq_a(i,k) + d_q_ajs(i,k)/dtime2738 udt_PBL(i,k) = udt_PBL(i,k) + d_t_ajs(i,k)/dtime2739 udq_PBL(i,k) = udq_PBL(i,k) + d_q_ajs(i,k)/dtime2740 ENDDO2741 ENDDO2742 ENDIF2743 !>nrlmd+jyg2744 2697 2745 2698 IF (iflag_wake==2) THEN … … 2770 2723 ! 2771 2724 !calcul caracteristiques de la poche froide 2772 call calWAKE (paprs,pplay,dtime & 2773 ,t_seri,q_seri,omega & 2774 ,dt_dwn,dq_dwn,M_dwn,M_up & 2775 ,dt_a,dq_a,sigd & 2776 ,wdt_PBL,wdq_PBL & 2777 ,udt_PBL,udq_PBL & 2778 ,wake_deltat,wake_deltaq,wake_dth & 2779 ,wake_h,wake_s,wake_dens & 2780 ,wake_pe,wake_fip,wake_gfl & 2781 ,dt_wake,dq_wake & 2782 ,wake_k, t_undi,q_undi & 2783 ,wake_omgbdth,wake_dp_omgb & 2784 ,wake_dtKE,wake_dqKE & 2785 ,wake_dtPBL,wake_dqPBL & 2786 ,wake_omg,wake_dp_deltomg & 2787 ,wake_spread,wake_Cstar,wake_d_deltat_gw & 2788 ,wake_ddeltat,wake_ddeltaq) 2725 call calWAKE (iflag_wake_tend, paprs, pplay, dtime, & 2726 t_seri, q_seri, omega, & 2727 dt_dwn, dq_dwn, M_dwn, M_up, & 2728 dt_a, dq_a, & 2729 sigd, & 2730 wake_deltat, wake_deltaq, wake_s, wake_dens, & 2731 wake_dth, wake_h, & 2732 wake_pe, wake_fip, wake_gfl, & 2733 d_t_wake, d_q_wake, & 2734 wake_k, t_x, q_x, & 2735 wake_omgbdth, wake_dp_omgb, & 2736 wake_dtKE, wake_dqKE, & 2737 wake_omg, wake_dp_deltomg, & 2738 wake_spread, wake_Cstar, d_deltat_wk_gw, & 2739 d_deltat_wk, d_deltaq_wk, d_s_wk, d_dens_wk) 2789 2740 ! 2790 2741 !----------------------------------------------------------------------- 2791 2742 ! ajout des tendances des poches froides 2792 ! Faire rapidement disparaitre l'ancien dt_wake pour garder un d_t_wake2793 ! coherent avec les autres d_t_...2794 d_t_wake(:,:)=dt_wake(:,:)*dtime2795 d_q_wake(:,:)=dq_wake(:,:)*dtime2796 2743 CALL add_phys_tend(du0,dv0,d_t_wake,d_q_wake,dql0,dqi0,paprs,'wake', & 2797 2744 abortphy,flag_inhib_tend) 2798 2745 !------------------------------------------------------------------------ 2746 2747 ! Increment Wake state variables 2748 IF (iflag_wake_tend .GT. 0.) THEN 2749 2750 CALL add_wake_tend & 2751 (d_deltat_wk, d_deltaq_wk, d_s_wk, d_dens_wk, wake_k, & 2752 'wake', abortphy) 2753 2754 ENDIF ! (iflag_wake_tend .GT. 0.) 2799 2755 2800 2756 endif ! (iflag_wake>=1) … … 2919 2875 DO i=1,klon 2920 2876 ! 2921 wake_deltat(i,k) = wake_deltat(i,k) - d_t_ajs(i,k) 2922 wake_deltaq(i,k) = wake_deltaq(i,k) - d_q_ajs(i,k) 2923 ! 2924 !!!t_seri(i,k) = t_therm(i,k) + wake_s(i)*wake_deltat(i,k) 2925 !!!q_seri(i,k) = q_therm(i,k) + wake_s(i)*wake_deltaq(i,k) 2877 d_deltat_the(i,k) = - d_t_ajs(i,k) 2878 d_deltaq_the(i,k) = - d_q_ajs(i,k) 2926 2879 ! 2927 2880 d_u_ajs(i,k) = d_u_ajs(i,k)*(1.-wake_s(i)) … … 2932 2885 ENDDO 2933 2886 ENDDO 2934 !!! ELSE2935 !!! DO k=1,klev2936 !!! DO i=1,klon2937 !!! t_seri(i,k) = t_therm(i,k)2938 !!! q_seri(i,k) = q_therm(i,k)2939 !!! ENDDO2940 !!! ENDDO2941 2887 ENDIF 2888 ! 2889 CALL add_wake_tend & 2890 (d_deltat_the, d_deltaq_the, dsig0, ddens0, wkoccur1, 'the', abortphy) 2891 ! 2942 2892 ! 2943 2893 CALL add_phys_tend(d_u_ajs,d_v_ajs,d_t_ajs,d_q_ajs, & 2944 2894 dql0,dqi0,paprs,'thermals', abortphy,flag_inhib_tend) 2945 2895 ! 2946 !>jyg2947 !jyg<2948 2896 ! 2949 2897 CALL alpale_th( dtime, lmax_th, t_seri, cell_area, & … … 2952 2900 alp_bl, alp_bl_stat, & 2953 2901 proba_notrig, random_notrig) 2902 !>jyg 2954 2903 2955 2904 ! ------------------------------------------------------------------ -
LMDZ5/trunk/libf/phylmd/wake.F90
r2495 r2635 2 2 ! $Id$ 3 3 4 SUBROUTINE wake(p, ph, pi, dtime, sigd_con,&4 SUBROUTINE wake(p, ph, pi, dtime, & 5 5 te0, qe0, omgb, & 6 6 dtdwn, dqdwn, amdwn, amup, dta, dqa, & 7 wdtpbl, wdqpbl, udtpbl, udqpbl, & 8 deltatw, deltaqw, dth, hw, sigmaw, wape, fip, gfl, & 9 dtls, dqls, ktopw, omgbdth, dp_omgb, wdens, tu, qu, & 10 dtke, dqke, dtpbl, dqpbl, omg, dp_deltomg, spread, cstar, & 11 d_deltat_gw, d_deltatw2, d_deltaqw2) 7 sigd_con, & 8 deltatw, deltaqw, sigmaw, wdens, & ! state variables 9 dth, hw, wape, fip, gfl, & 10 dtls, dqls, ktopw, omgbdth, dp_omgb, tu, qu, & 11 dtke, dqke, omg, dp_deltomg, spread, cstar, & 12 d_deltat_gw, & 13 d_deltatw2, d_deltaqw2, d_sigmaw2, d_wdens2) ! tendencies 12 14 13 15 … … 33 35 ! le declenchement de nouvelles colonnes convectives. 34 36 35 ! Variables d'etat : deltatw : ecart de temperature wake-undisturbed 36 ! area 37 ! deltaqw : ecart d'humidite wake-undisturbed area 38 ! sigmaw : fraction d'aire occupee par la poche. 37 ! State variables : 38 ! deltatw : temperature difference between wake and off-wake regions 39 ! deltaqw : specific humidity difference between wake and off-wake regions 40 ! sigmaw : fractional area covered by wakes. 41 ! wdens : number of wakes per unit area 39 42 40 43 ! Variable de sortie : … … 53 56 ! omg : Delta_omg =vertical velocity diff. wake-undist. (Pa/s) 54 57 ! dp_deltomg : vertical gradient of omg (s-1) 55 ! spread : spreading term in d t_wake and dq_wake58 ! spread : spreading term in d_t_wake and d_q_wake 56 59 ! deltatw : updated temperature difference (T_w-T_u). 57 60 ! deltaqw : updated humidity difference (q_w-q_u). … … 126 129 REAL, DIMENSION (klon, klev), INTENT(IN) :: te0, qe0 127 130 REAL, DIMENSION (klon, klev), INTENT(IN) :: dtdwn, dqdwn 128 REAL, DIMENSION (klon, klev), INTENT(IN) :: wdtpbl, wdqpbl, udtpbl, udqpbl ! UNUSED129 131 REAL, DIMENSION (klon, klev), INTENT(IN) :: amdwn, amup 130 132 REAL, DIMENSION (klon, klev), INTENT(IN) :: dta, dqa … … 133 135 ! 134 136 ! Input/Output 137 ! State variables 135 138 REAL, DIMENSION (klon, klev), INTENT(INOUT) :: deltatw, deltaqw 136 139 REAL, DIMENSION (klon), INTENT(INOUT) :: sigmaw 140 REAL, DIMENSION (klon), INTENT(INOUT) :: wdens 137 141 138 142 ! Sorties … … 143 147 REAL, DIMENSION (klon, klev), INTENT(OUT) :: dtls, dqls 144 148 REAL, DIMENSION (klon, klev), INTENT(OUT) :: dtke, dqke 145 REAL, DIMENSION (klon, klev), INTENT(OUT) :: dtpbl, dqpbl146 149 REAL, DIMENSION (klon, klev), INTENT(OUT) :: spread 147 REAL, DIMENSION (klon, klev), INTENT(OUT) :: d_deltatw2, d_deltaqw2148 150 REAL, DIMENSION (klon, klev+1), INTENT(OUT) :: omgbdth, omg 149 151 REAL, DIMENSION (klon, klev), INTENT(OUT) :: dp_omgb, dp_deltomg 150 152 REAL, DIMENSION (klon, klev), INTENT(OUT) :: d_deltat_gw 151 153 REAL, DIMENSION (klon), INTENT(OUT) :: hw, wape, fip, gfl, cstar 152 REAL, DIMENSION (klon), INTENT(OUT) :: wdens153 154 INTEGER, DIMENSION (klon), INTENT(OUT) :: ktopw 155 ! Tendencies of state variables 156 REAL, DIMENSION (klon, klev), INTENT(OUT) :: d_deltatw2, d_deltaqw2 157 REAL, DIMENSION (klon), INTENT(OUT) :: d_sigmaw2, d_wdens2 154 158 155 159 ! Variables internes … … 157 161 158 162 ! Variables à fixer 159 REAL alon160 LOGICAL, SAVE :: first = .TRUE.163 REAL :: alon 164 LOGICAL, SAVE :: first = .TRUE. 161 165 !$OMP THREADPRIVATE(first) 162 REAL, SAVE :: stark, wdens_ref, coefgw, alpk, crep_upper, crep_sol 166 REAL, SAVE :: stark, wdens_ref, coefgw, alpk 167 REAL, SAVE :: crep_upper, crep_sol 163 168 !$OMP THREADPRIVATE(stark, wdens_ref, coefgw, alpk, crep_upper, crep_sol) 164 169 165 REAL delta_t_min166 INTEGER nsub167 REAL dtimesub168 REAL sigmad, hwmin, wapecut169 REAL :: sigmaw_max170 REAL :: dens_rate171 REAL wdens0170 REAL :: delta_t_min 171 INTEGER :: nsub 172 REAL :: dtimesub 173 REAL :: sigmad, hwmin, wapecut 174 REAL :: sigmaw_max 175 REAL :: dens_rate 176 REAL :: wdens0 172 177 ! IM 080208 173 LOGICAL, DIMENSION (klon) :: gwake178 LOGICAL, DIMENSION (klon) :: gwake 174 179 175 180 ! Variables de sauvegarde 176 REAL, DIMENSION (klon, klev) :: deltatw0177 REAL, DIMENSION (klon, klev) :: deltaqw0178 REAL, DIMENSION (klon, klev) :: te, qe179 REAL, DIMENSION (klon) :: sigmaw0, sigmaw1181 REAL, DIMENSION (klon, klev) :: deltatw0 182 REAL, DIMENSION (klon, klev) :: deltaqw0 183 REAL, DIMENSION (klon, klev) :: te, qe 184 REAL, DIMENSION (klon) :: sigmaw0, sigmaw1 180 185 181 186 ! Variables pour les GW 182 REAL, DIMENSION (klon) :: ll183 REAL, DIMENSION (klon, klev) :: n2184 REAL, DIMENSION (klon, klev) :: cgw185 REAL, DIMENSION (klon, klev) :: tgw187 REAL, DIMENSION (klon) :: ll 188 REAL, DIMENSION (klon, klev) :: n2 189 REAL, DIMENSION (klon, klev) :: cgw 190 REAL, DIMENSION (klon, klev) :: tgw 186 191 187 192 ! Variables liées au calcul de hw 188 REAL, DIMENSION (klon) :: ptop_provis, ptop, ptop_new189 REAL, DIMENSION (klon) :: sum_dth190 REAL, DIMENSION (klon) :: dthmin191 REAL, DIMENSION (klon) :: z, dz, hw0192 INTEGER, DIMENSION (klon) :: ktop, kupper193 REAL, DIMENSION (klon) :: ptop_provis, ptop, ptop_new 194 REAL, DIMENSION (klon) :: sum_dth 195 REAL, DIMENSION (klon) :: dthmin 196 REAL, DIMENSION (klon) :: z, dz, hw0 197 INTEGER, DIMENSION (klon) :: ktop, kupper 193 198 194 199 ! Sub-timestep tendencies and related variables 195 REAL d_deltatw(klon, klev), d_deltaqw(klon, klev) 196 REAL d_te(klon, klev), d_qe(klon, klev) 197 REAL d_sigmaw(klon), alpha(klon) 198 REAL q0_min(klon), q1_min(klon) 199 LOGICAL wk_adv(klon), ok_qx_qw(klon) 200 REAL epsilon 200 REAL, DIMENSION (klon, klev) :: d_deltatw, d_deltaqw 201 REAL, DIMENSION (klon, klev) :: d_te, d_qe 202 REAL, DIMENSION (klon) :: d_sigmaw, alpha 203 REAL, DIMENSION (klon) :: q0_min, q1_min 204 LOGICAL, DIMENSION (klon) :: wk_adv, ok_qx_qw 205 REAL, SAVE :: epsilon 206 !$OMP THREADPRIVATE(epsilon) 201 207 DATA epsilon/1.E-15/ 202 208 203 209 ! Autres variables internes 204 INTEGER isubstep, k, i205 206 REAL , DIMENSION (klon) :: sum_thu, sum_tu, sum_qu, sum_thvu207 REAL, DIMENSION (klon) :: sum_dq, sum_rho 208 REAL, DIMENSION (klon) :: sum_dtdwn, sum_dqdwn209 REAL, DIMENSION (klon) :: av_thu, av_tu, av_qu, av_thvu210 REAL, DIMENSION (klon) :: av_dth, av_dq, av_rho211 REAL, DIMENSION (klon) :: av_dtdwn, av_dqdwn212 213 REAL, DIMENSION (klon , klev) :: rho, rhow214 REAL, DIMENSION (klon, klev+1) :: rhoh 215 REAL, DIMENSION (klon, klev) :: rhow_moyen216 REAL, DIMENSION (klon, klev ) :: zh217 REAL, DIMENSION (klon, klev +1) :: zhh218 REAL, DIMENSION (klon, klev) :: epaisseur1, epaisseur2219 220 REAL, DIMENSION (klon, klev) :: the, thu221 222 ! REAL, DIMENSION(klon,klev) :: d_deltatw, d_deltaqw223 224 REAL, DIMENSION (klon, klev+1) :: omgbw225 REAL, DIMENSION (klon) :: pupper226 REAL, DIMENSION (klon) :: omgtop227 REAL, DIMENSION (klon, klev) :: dp_omgbw228 REAL, DIMENSION (klon) :: ztop, dztop229 REAL, DIMENSION (klon, klev) :: alpha_up230 231 REAL, DIMENSION (klon) :: rre1, rre2232 REAL :: rrd1, rrd2233 REAL, DIMENSION (klon, klev) :: th1, th2, q1, q2234 REAL, DIMENSION (klon, klev) :: d_th1, d_th2, d_dth235 REAL, DIMENSION (klon, klev) :: d_q1, d_q2, d_dq236 REAL, DIMENSION (klon, klev) :: omgbdq237 238 REAL, DIMENSION (klon) :: ff, gg239 REAL, DIMENSION (klon) :: wape2, cstar2, heff240 241 REAL, DIMENSION (klon, klev) :: crep242 243 REAL, DIMENSION (klon, klev) :: ppi210 INTEGER ::isubstep, k, i 211 212 REAL :: sigmaw_targ 213 214 REAL, DIMENSION (klon) :: sum_thu, sum_tu, sum_qu, sum_thvu 215 REAL, DIMENSION (klon) :: sum_dq, sum_rho 216 REAL, DIMENSION (klon) :: sum_dtdwn, sum_dqdwn 217 REAL, DIMENSION (klon) :: av_thu, av_tu, av_qu, av_thvu 218 REAL, DIMENSION (klon) :: av_dth, av_dq, av_rho 219 REAL, DIMENSION (klon) :: av_dtdwn, av_dqdwn 220 221 REAL, DIMENSION (klon, klev) :: rho, rhow 222 REAL, DIMENSION (klon, klev+1) :: rhoh 223 REAL, DIMENSION (klon, klev) :: rhow_moyen 224 REAL, DIMENSION (klon, klev) :: zh 225 REAL, DIMENSION (klon, klev+1) :: zhh 226 REAL, DIMENSION (klon, klev) :: epaisseur1, epaisseur2 227 228 REAL, DIMENSION (klon, klev) :: the, thu 229 230 REAL, DIMENSION (klon, klev+1) :: omgbw 231 REAL, DIMENSION (klon) :: pupper 232 REAL, DIMENSION (klon) :: omgtop 233 REAL, DIMENSION (klon, klev) :: dp_omgbw 234 REAL, DIMENSION (klon) :: ztop, dztop 235 REAL, DIMENSION (klon, klev) :: alpha_up 236 237 REAL, DIMENSION (klon) :: rre1, rre2 238 REAL :: rrd1, rrd2 239 REAL, DIMENSION (klon, klev) :: th1, th2, q1, q2 240 REAL, DIMENSION (klon, klev) :: d_th1, d_th2, d_dth 241 REAL, DIMENSION (klon, klev) :: d_q1, d_q2, d_dq 242 REAL, DIMENSION (klon, klev) :: omgbdq 243 244 REAL, DIMENSION (klon) :: ff, gg 245 REAL, DIMENSION (klon) :: wape2, cstar2, heff 246 247 REAL, DIMENSION (klon, klev) :: crep 248 249 REAL, DIMENSION (klon, klev) :: ppi 244 250 245 251 ! cc nrlmd 246 REAL, DIMENSION (klon) :: death_rate, nat_rate 247 REAL, DIMENSION (klon, klev) :: entr 248 REAL, DIMENSION (klon, klev) :: detr 252 REAL, DIMENSION (klon) :: death_rate, nat_rate 253 REAL, DIMENSION (klon, klev) :: entr 254 REAL, DIMENSION (klon, klev) :: detr 255 256 REAL, DIMENSION(klon) :: sigmaw_in ! pour les prints 249 257 250 258 ! ------------------------------------------------------------------------- … … 312 320 ! Les densites peuvent evoluer si les poches debordent 313 321 ! (voir au tout debut de la boucle sur les substeps) 314 wdens = wdens_ref322 wdens(:) = wdens_ref 315 323 316 324 ! print*,'stark',stark … … 347 355 END DO 348 356 END DO 357 DO i = 1, klon 358 sigmaw_in(i) = sigmaw(i) 359 END DO 349 360 ! sigmaw1=sigmaw 350 361 ! IF (sigd_con.GT.sigmaw1) THEN … … 353 364 DO i = 1, klon 354 365 ! c sigmaw(i) = amax1(sigmaw(i),sigd_con(i)) 355 sigmaw(i) = amax1(sigmaw(i), sigmad) 356 sigmaw(i) = amin1(sigmaw(i), 0.99) 366 !jyg< 367 !! sigmaw(i) = amax1(sigmaw(i), sigmad) 368 !! sigmaw(i) = amin1(sigmaw(i), 0.99) 369 sigmaw_targ = min(max(sigmaw(i), sigmad),0.99) 370 d_sigmaw2(i) = sigmaw_targ - sigmaw(i) 371 sigmaw(i) = sigmaw_targ 372 !>jyg 357 373 sigmaw0(i) = sigmaw(i) 358 374 wape(i) = 0. 359 375 wape2(i) = 0. 360 376 d_sigmaw(i) = 0. 377 d_wdens2(i) = 0. 361 378 ktopw(i) = 0 362 379 END DO … … 433 450 n2(i, k) = 0 434 451 ELSE 435 n2(i, k) = amax1(0., -rg**2/the(i,k)*rho(i,k)*(the(i,k+1)-the(i, &436 k-1))/(p(i,k+1)-p(i,k-1)))452 n2(i, k) = amax1(0., -rg**2/the(i,k)*rho(i,k)*(the(i,k+1)-the(i,k-1))/ & 453 (p(i,k+1)-p(i,k-1))) 437 454 END IF 438 455 zh(i, k) = (zhh(i,k)+zhh(i,k+1))/2 … … 504 521 IF (dth(i,k)>-delta_t_min .AND. dth(i,k-1)<-delta_t_min .AND. & 505 522 ptop_provis(i)==ph(i,1)) THEN 506 ptop_provis(i) = ((dth(i,k)+delta_t_min)*p(i,k-1)- (dth(i,&507 k-1)+delta_t_min)*p(i,k))/(dth(i,k)-dth(i,k-1))523 ptop_provis(i) = ((dth(i,k)+delta_t_min)*p(i,k-1)- & 524 (dth(i,k-1)+delta_t_min)*p(i,k))/(dth(i,k)-dth(i,k-1)) 508 525 END IF 509 526 END DO … … 602 619 deltatw(i, k) = 0. 603 620 deltaqw(i, k) = 0. 621 d_deltatw2(i,k) = -deltatw0(i,k) 622 d_deltaqw2(i,k) = -deltaqw0(i,k) 604 623 END IF 605 624 END DO … … 671 690 av_dqdwn(i) = sum_dqdwn(i)/hw0(i) 672 691 673 wape(i) = -rg*hw0(i)*(av_dth(i)+epsim1*(av_thu(i)*av_dq(i)+av_dth(i)*av_qu(i & 674 )+av_dth(i)*av_dq(i)))/av_thvu(i) 692 wape(i) = -rg*hw0(i)*(av_dth(i)+ & 693 epsim1*(av_thu(i)*av_dq(i)+av_dth(i)*av_qu(i)+av_dth(i)*av_dq(i)))/av_thvu(i) 694 675 695 END DO 676 696 … … 686 706 deltaqw(i, k) = 0. 687 707 dth(i, k) = 0. 708 d_deltatw2(i,k) = -deltatw0(i,k) 709 d_deltaqw2(i,k) = -deltaqw0(i,k) 688 710 END IF 689 711 END DO … … 695 717 cstar(i) = 0. 696 718 hw(i) = hwmin 697 sigmaw(i) = amax1(sigmad, sigd_con(i)) 719 !jyg< 720 !! sigmaw(i) = amax1(sigmad, sigd_con(i)) 721 sigmaw_targ = max(sigmad, sigd_con(i)) 722 d_sigmaw2(i) = d_sigmaw2(i) + sigmaw_targ - sigmaw(i) 723 sigmaw(i) = sigmaw_targ 724 !>jyg 698 725 fip(i) = 0. 699 726 gwake(i) = .FALSE. … … 708 735 ! -------------------------- 709 736 DO i = 1, klon 710 q0_min(i) = min((qe(i,1)-sigmaw(i)*deltaqw(i,1)), (qe(i,&711 1)+(1.-sigmaw(i))*deltaqw(i,1)))737 q0_min(i) = min((qe(i,1)-sigmaw(i)*deltaqw(i,1)), & 738 (qe(i,1)+(1.-sigmaw(i))*deltaqw(i,1))) 712 739 END DO 713 740 DO k = 2, klev 714 741 DO i = 1, klon 715 q1_min(i) = min((qe(i,k)-sigmaw(i)*deltaqw(i,k)), (qe(i,&716 k)+(1.-sigmaw(i))*deltaqw(i,k)))742 q1_min(i) = min((qe(i,k)-sigmaw(i)*deltaqw(i,k)), & 743 (qe(i,k)+(1.-sigmaw(i))*deltaqw(i,k))) 717 744 IF (q1_min(i)<=q0_min(i)) THEN 718 745 q0_min(i) = q1_min(i) … … 752 779 IF (wk_adv(i) .AND. cstar(i)>0.01) THEN 753 780 omg(i, kupper(i)+1) = -rg*amdwn(i, kupper(i)+1)/sigmaw(i) + & 754 rg*amup(i, kupper(i)+1)/(1.-sigmaw(i))755 wdens0 = (sigmaw(i)/(4.*3.14))* ((1.-sigmaw(i))*omg(i,kupper(i)+1)/((&756 ph(i,1)-pupper(i))*cstar(i)))**(2)781 rg*amup(i, kupper(i)+1)/(1.-sigmaw(i)) 782 wdens0 = (sigmaw(i)/(4.*3.14))* & 783 ((1.-sigmaw(i))*omg(i,kupper(i)+1)/((ph(i,1)-pupper(i))*cstar(i)))**(2) 757 784 IF (wdens(i)<=wdens0*1.1) THEN 758 785 wdens(i) = wdens0 … … 770 797 IF (wk_adv(i)) THEN 771 798 gfl(i) = 2.*sqrt(3.14*wdens(i)*sigmaw(i)) 772 sigmaw(i) = amin1(sigmaw(i), sigmaw_max) 773 END IF 774 END DO 799 !jyg< 800 !! sigmaw(i) = amin1(sigmaw(i), sigmaw_max) 801 sigmaw_targ = min(sigmaw(i), sigmaw_max) 802 d_sigmaw2(i) = d_sigmaw2(i) + sigmaw_targ - sigmaw(i) 803 sigmaw(i) = sigmaw_targ 804 !>jyg 805 END IF 806 END DO 807 775 808 DO i = 1, klon 776 809 IF (wk_adv(i)) THEN … … 783 816 death_rate(i) = 0. 784 817 END IF 818 785 819 d_sigmaw(i) = gfl(i)*cstar(i)*dtimesub - death_rate(i)*sigmaw(i)* & 786 820 dtimesub … … 798 832 END IF 799 833 END DO 800 801 834 802 835 ! calcul de la difference de vitesse verticale poche - zone non perturbee … … 1006 1039 1007 1040 d_deltatw(i, k) = dtimesub/(ph(i,k)-ph(i,k+1))* & 1008 (rrd1*omg(i,k)*sigmaw(i)*d_th1(i,k)-rrd2*omg(i,k+1)*(1.-sigmaw( & 1009 i))*d_th2(i,k+1)-(1.-alpha_up(i,k))*omgbdth(i,k)-alpha_up(i,k+1)* & 1010 omgbdth(i,k+1))*ppi(i, k) 1041 (rrd1*omg(i,k)*sigmaw(i)*d_th1(i,k) - & 1042 rrd2*omg(i,k+1)*(1.-sigmaw(i))*d_th2(i,k+1)- & 1043 (1.-alpha_up(i,k))*omgbdth(i,k)- & 1044 alpha_up(i,k+1)*omgbdth(i,k+1))*ppi(i, k) 1011 1045 ! print*,'d_deltatw=',d_deltatw(i,k) 1012 1046 1013 1047 d_deltaqw(i, k) = dtimesub/(ph(i,k)-ph(i,k+1))* & 1014 (rrd1*omg(i,k)*sigmaw(i)*d_q1(i,k)-rrd2*omg(i,k+1)*(1.-sigmaw( & 1015 i))*d_q2(i,k+1)-(1.-alpha_up(i,k))*omgbdq(i,k)-alpha_up(i,k+1)* & 1016 omgbdq(i,k+1)) 1048 (rrd1*omg(i,k)*sigmaw(i)*d_q1(i,k)- & 1049 rrd2*omg(i,k+1)*(1.-sigmaw(i))*d_q2(i,k+1)- & 1050 (1.-alpha_up(i,k))*omgbdq(i,k)- & 1051 alpha_up(i,k+1)*omgbdq(i,k+1)) 1017 1052 ! print*,'d_deltaqw=',d_deltaqw(i,k) 1018 1053 … … 1024 1059 ! C 1025 1060 ! ----------------------------------------------------------------- 1026 d_te(i, k) = dtimesub*((rre1(i)*omg(i,k)*sigmaw(i)*d_th1(i, & 1027 k)-rre2(i)*omg(i,k+1)*(1.-sigmaw(i))*d_th2(i,k+1))/(ph(i,k)-ph(i, & 1028 k+1)) & ! cc nrlmd $ 1029 ! -sigmaw(i)*(1.-sigmaw(i))*dth(i,k)*dp_deltomg(i,k) 1030 -sigmaw(i)*(1.-sigmaw(i))*dth(i,k)*(omg(i,k)-omg(i,k+1))/(ph(i, & 1031 k)-ph(i,k+1)) & ! cc 1032 )*ppi(i, k) 1033 1034 d_qe(i, k) = dtimesub*((rre1(i)*omg(i,k)*sigmaw(i)*d_q1(i, & 1035 k)-rre2(i)*omg(i,k+1)*(1.-sigmaw(i))*d_q2(i,k+1))/(ph(i,k)-ph(i, & 1036 k+1)) & ! cc nrlmd $ 1037 ! -sigmaw(i)*(1.-sigmaw(i))*deltaqw(i,k)*dp_deltomg(i,k) 1038 -sigmaw(i)*(1.-sigmaw(i))*deltaqw(i,k)*(omg(i,k)-omg(i, & 1039 k+1))/(ph(i,k)-ph(i,k+1)) & ! cc 1040 ) 1041 ! cc nrlmd 1061 d_te(i, k) = dtimesub*((rre1(i)*omg(i,k)*sigmaw(i)*d_th1(i,k)- & 1062 rre2(i)*omg(i,k+1)*(1.-sigmaw(i))*d_th2(i,k+1))/ & 1063 (ph(i,k)-ph(i,k+1)) & 1064 -sigmaw(i)*(1.-sigmaw(i))*dth(i,k)*(omg(i,k)-omg(i,k+1))/ & 1065 (ph(i,k)-ph(i,k+1)) )*ppi(i, k) 1066 1067 d_qe(i, k) = dtimesub*((rre1(i)*omg(i,k)*sigmaw(i)*d_q1(i,k)- & 1068 rre2(i)*omg(i,k+1)*(1.-sigmaw(i))*d_q2(i,k+1))/ & 1069 (ph(i,k)-ph(i,k+1)) & 1070 -sigmaw(i)*(1.-sigmaw(i))*deltaqw(i,k)*(omg(i,k)-omg(i,k+1))/ & 1071 (ph(i,k)-ph(i,k+1)) ) 1042 1072 ELSE IF (wk_adv(i) .AND. k==kupper(i)) THEN 1043 d_te(i, k) = dtimesub*((rre1(i)*omg(i,k)*sigmaw(i)*d_th1(i, & 1044 k)/(ph(i,k)-ph(i,k+1))))*ppi(i, k) 1045 1046 d_qe(i, k) = dtimesub*((rre1(i)*omg(i,k)*sigmaw(i)*d_q1(i, & 1047 k)/(ph(i,k)-ph(i,k+1)))) 1073 d_te(i, k) = dtimesub*(rre1(i)*omg(i,k)*sigmaw(i)*d_th1(i,k)/(ph(i,k)-ph(i,k+1)))*ppi(i, k) 1074 1075 d_qe(i, k) = dtimesub*(rre1(i)*omg(i,k)*sigmaw(i)*d_q1(i,k)/(ph(i,k)-ph(i,k+1))) 1048 1076 1049 1077 END IF … … 1067 1095 crep(i, k) = crep_sol*(ph(i,kupper(i))-ph(i,k))/ & 1068 1096 (ph(i,kupper(i))-ph(i,1)) 1069 crep(i, k) = crep(i, k) + crep_upper*(ph(i,1)-ph(i,k))/ (p(i,1)-ph(i&1070 ,kupper(i)))1097 crep(i, k) = crep(i, k) + crep_upper*(ph(i,1)-ph(i,k))/ & 1098 (p(i,1)-ph(i,kupper(i))) 1071 1099 1072 1100 … … 1091 1119 ! print*,'dtKE= ',dtKE(i,k),' dqKE= ',dqKE(i,k) 1092 1120 1093 !jyg<1094 !!1095 !!---------------------------------------------------------------1096 !! The change of delta_T due to PBL (vertical diffusion plus thermal plumes)1097 !! is accounted for by the PBL and the Thermals schemes. It is now set to zero1098 !! within the Wake scheme.1099 !!---------------------------------------------------------------1100 dtPBL(i,k) = 0.1101 dqPBL(i,k) = 0.1102 !1103 !! dtPBL(i,k)=wdtPBL(i,k) - udtPBL(i,k)1104 !! dqPBL(i,k)=wdqPBL(i,k) - udqPBL(i,k)1105 !1106 !! dtpbl(i, k) = (wdtpbl(i,k)/sigmaw(i)-udtpbl(i,k)/(1.-sigmaw(i)))1107 !! dqpbl(i, k) = (wdqpbl(i,k)/sigmaw(i)-udqpbl(i,k)/(1.-sigmaw(i)))1108 ! print*,'dtPBL= ',dtPBL(i,k),' dqPBL= ',dqPBL(i,k)1109 !>jyg1110 1121 ! 1111 1122 … … 1145 1156 1146 1157 IF (dtimesub*tgw(i,k)<1.E-10) THEN 1147 d_deltatw(i, k) = dtimesub*(ff(i)+dtke(i,k)+dtpbl(i,k) & ! cc 1148 ! $ 1149 ! -spread(i,k)*deltatw(i,k) 1150 -entr(i,k)*deltatw(i,k)/sigmaw(i)-(death_rate(i)*sigmaw( & 1151 i)+detr(i,k))*deltatw(i,k)/(1.-sigmaw(i)) & ! cc 1152 -tgw(i,k)*deltatw(i,k)) 1158 d_deltatw(i, k) = dtimesub*(ff(i)+dtke(i,k) - & 1159 entr(i,k)*deltatw(i,k)/sigmaw(i) - & 1160 (death_rate(i)*sigmaw(i)+detr(i,k))*deltatw(i,k)/(1.-sigmaw(i)) - & ! cc 1161 tgw(i,k)*deltatw(i,k) ) 1153 1162 ELSE 1154 d_deltatw(i, k) = 1/tgw(i, k)*(1-exp(-dtimesub*tgw(i, & 1155 k)))*(ff(i)+dtke(i,k)+dtpbl(i,k) & ! cc $ 1156 ! -spread(i,k)*deltatw(i,k) 1157 -entr(i,k)*deltatw(i,k)/sigmaw(i)-(death_rate(i)*sigmaw( & 1158 i)+detr(i,k))*deltatw(i,k)/(1.-sigmaw(i)) & ! cc 1159 -tgw(i,k)*deltatw(i,k)) 1163 d_deltatw(i, k) = 1/tgw(i, k)*(1-exp(-dtimesub*tgw(i,k)))* & 1164 (ff(i)+dtke(i,k) - & 1165 entr(i,k)*deltatw(i,k)/sigmaw(i) - & 1166 (death_rate(i)*sigmaw(i)+detr(i,k))*deltatw(i,k)/(1.-sigmaw(i)) - & 1167 tgw(i,k)*deltatw(i,k) ) 1160 1168 END IF 1161 1169 … … 1164 1172 gg(i) = d_deltaqw(i, k)/dtimesub 1165 1173 1166 d_deltaqw(i, k) = dtimesub*(gg(i)+dqke(i,k)+dqpbl(i,k) & ! cc $ 1167 ! -spread(i,k)*deltaqw(i,k)) 1168 -entr(i,k)*deltaqw(i,k)/sigmaw(i)-(death_rate(i)*sigmaw(i)+detr( & 1169 i,k))*deltaqw(i,k)/(1.-sigmaw(i))) 1174 d_deltaqw(i, k) = dtimesub*(gg(i)+dqke(i,k) - & 1175 entr(i,k)*deltaqw(i,k)/sigmaw(i) - & 1176 (death_rate(i)*sigmaw(i)+detr(i,k))*deltaqw(i,k)/(1.-sigmaw(i))) 1170 1177 ! cc 1171 1178 … … 1239 1246 IF (wk_adv(i)) THEN 1240 1247 sigmaw(i) = sigmaw(i) + d_sigmaw(i) 1248 !jyg< 1249 d_sigmaw2(i) = d_sigmaw2(i) + d_sigmaw(i) 1250 !>jyg 1241 1251 END IF 1242 1252 END DO … … 1258 1268 IF (wk_adv(i) .AND. ptop_provis(i)==ph(i,1) .AND. & 1259 1269 dth(i,k)>-delta_t_min .AND. dth(i,k-1)<-delta_t_min) THEN 1260 ptop_provis(i) = ((dth(i,k)+delta_t_min)*p(i,k-1) -(dth(i,&1261 k-1)+delta_t_min)*p(i,k))/(dth(i,k)-dth(i,k-1))1270 ptop_provis(i) = ((dth(i,k)+delta_t_min)*p(i,k-1) - & 1271 (dth(i,k-1)+delta_t_min)*p(i,k))/(dth(i,k)-dth(i,k-1)) 1262 1272 END IF 1263 1273 END DO … … 1331 1341 IF (wk_adv(i) .AND. k<=ktop(i) .AND. ptop_new(i)==ptop(i) .AND. & 1332 1342 dth(i,k)>-delta_t_min .AND. dth(i,k-1)<-delta_t_min) THEN 1333 ptop_new(i) = ((dth(i,k)+delta_t_min)*p(i,k-1) -(dth(i,&1334 k-1)+delta_t_min)*p(i,k))/(dth(i,k)-dth(i,k-1))1343 ptop_new(i) = ((dth(i,k)+delta_t_min)*p(i,k-1) - & 1344 (dth(i,k-1)+delta_t_min)*p(i,k))/(dth(i,k)-dth(i,k-1)) 1335 1345 END IF 1336 1346 END DO … … 1359 1369 deltatw(i, k) = 0. 1360 1370 deltaqw(i, k) = 0. 1371 d_deltatw2(i,k) = -deltatw0(i,k) 1372 d_deltaqw2(i,k) = -deltaqw0(i,k) 1361 1373 END IF 1362 1374 END DO … … 1449 1461 av_dqdwn(i) = sum_dqdwn(i)/hw0(i) 1450 1462 1451 wape(i) = -rg*hw0(i)*(av_dth(i)+epsim1*(av_thu(i)*av_dq(i) +av_dth(i)*&1452 av_qu(i)+av_dth(i)*av_dq(i)))/av_thvu(i)1463 wape(i) = -rg*hw0(i)*(av_dth(i)+epsim1*(av_thu(i)*av_dq(i) + & 1464 av_dth(i)*av_qu(i)+av_dth(i)*av_dq(i)))/av_thvu(i) 1453 1465 END IF 1454 1466 END DO … … 1463 1475 deltaqw(i, k) = 0. 1464 1476 dth(i, k) = 0. 1477 d_deltatw2(i,k) = -deltatw0(i,k) 1478 d_deltaqw2(i,k) = -deltaqw0(i,k) 1465 1479 END IF 1466 1480 END IF … … 1474 1488 cstar(i) = 0. 1475 1489 hw(i) = hwmin 1476 sigmaw(i) = max(sigmad, sigd_con(i)) 1490 !jyg< 1491 !! sigmaw(i) = max(sigmad, sigd_con(i)) 1492 sigmaw_targ = max(sigmad, sigd_con(i)) 1493 d_sigmaw2(i) = d_sigmaw2(i) + sigmaw_targ - sigmaw(i) 1494 sigmaw(i) = sigmaw_targ 1495 !>jyg 1477 1496 fip(i) = 0. 1478 1497 gwake(i) = .FALSE. … … 1486 1505 END DO ! end sub-timestep loop 1487 1506 1488 ! -----------------------------------------------------------------1489 ! Get back to tendencies per second1490 1491 DO k = 1, klev1492 DO i = 1, klon1493 1494 ! cc nrlmd IF ( wk_adv(i) .AND. k .LE. kupper(i)) THEN1495 IF (ok_qx_qw(i) .AND. k<=kupper(i)) THEN1496 ! cc1497 dtls(i, k) = dtls(i, k)/dtime1498 dqls(i, k) = dqls(i, k)/dtime1499 d_deltatw2(i, k) = d_deltatw2(i, k)/dtime1500 d_deltaqw2(i, k) = d_deltaqw2(i, k)/dtime1501 d_deltat_gw(i, k) = d_deltat_gw(i, k)/dtime1502 ! c print*,'k,dqls,omg,entr,detr',k,dqls(i,k),omg(i,k),entr(i,k)1503 ! c $ ,death_rate(i)*sigmaw(i)1504 END IF1505 END DO1506 END DO1507 1507 1508 1508 … … 1632 1632 av_dqdwn(i) = sum_dqdwn(i)/hw0(i) 1633 1633 1634 wape2(i) = -rg*hw0(i)*(av_dth(i)+epsim1*(av_thu(i)*av_dq(i) +av_dth(i)*&1635 av_qu(i)+av_dth(i)*av_dq(i)))/av_thvu(i)1634 wape2(i) = -rg*hw0(i)*(av_dth(i)+epsim1*(av_thu(i)*av_dq(i) + & 1635 av_dth(i)*av_qu(i)+av_dth(i)*av_dq(i)))/av_thvu(i) 1636 1636 END IF 1637 1637 END DO 1638 1639 1638 1640 1639 1641 ! Prognostic variable update … … 1650 1652 deltaqw(i, k) = 0. 1651 1653 dth(i, k) = 0. 1654 d_deltatw2(i,k) = -deltatw0(i,k) 1655 d_deltaqw2(i,k) = -deltaqw0(i,k) 1652 1656 END IF 1653 1657 END DO … … 1663 1667 cstar2(i) = 0. 1664 1668 hw(i) = hwmin 1665 sigmaw(i) = amax1(sigmad, sigd_con(i)) 1669 !jyg< 1670 !! sigmaw(i) = amax1(sigmad, sigd_con(i)) 1671 sigmaw_targ = max(sigmad, sigd_con(i)) 1672 d_sigmaw2(i) = d_sigmaw2(i) + sigmaw_targ - sigmaw(i) 1673 sigmaw(i) = sigmaw_targ 1674 !>jyg 1666 1675 fip(i) = 0. 1667 1676 gwake(i) = .FALSE. … … 1726 1735 deltatw(i, k) = 0. 1727 1736 deltaqw(i, k) = 0. 1737 d_deltatw2(i,k) = -deltatw0(i,k) 1738 d_deltaqw2(i,k) = -deltaqw0(i,k) 1728 1739 END IF 1729 1740 END DO … … 1734 1745 IF (((wape(i)>=wape2(i)) .AND. (wape2(i)<=1.0)) .OR. (ktopw(i)<=2) .OR. & 1735 1746 .NOT. ok_qx_qw(i)) THEN 1747 ktopw(i) = 0 1736 1748 wape(i) = 0. 1737 1749 cstar(i) = 0. … … 1749 1761 ! c $ wape(i),wape2(i),ktopw(i),OK_qx_qw(i) 1750 1762 END DO 1763 1764 ! ----------------------------------------------------------------- 1765 ! Get back to tendencies per second 1766 1767 DO k = 1, klev 1768 DO i = 1, klon 1769 1770 ! cc nrlmd IF ( wk_adv(i) .AND. k .LE. kupper(i)) THEN 1771 IF (ok_qx_qw(i) .AND. k<=kupper(i)) THEN 1772 ! cc 1773 dtls(i, k) = dtls(i, k)/dtime 1774 dqls(i, k) = dqls(i, k)/dtime 1775 d_deltatw2(i, k) = d_deltatw2(i, k)/dtime 1776 d_deltaqw2(i, k) = d_deltaqw2(i, k)/dtime 1777 d_deltat_gw(i, k) = d_deltat_gw(i, k)/dtime 1778 ! c print*,'k,dqls,omg,entr,detr',k,dqls(i,k),omg(i,k),entr(i,k) 1779 ! c $ ,death_rate(i)*sigmaw(i) 1780 END IF 1781 END DO 1782 END DO 1783 !jyg< 1784 DO i = 1, klon 1785 d_sigmaw2(i) = d_sigmaw2(i)/dtime 1786 d_wdens2(i) = d_wdens2(i)/dtime 1787 ENDDO 1788 !>jyg 1789 1751 1790 1752 1791 … … 1792 1831 IF (wk_adv(i)) THEN 1793 1832 x = qe(i, k) + (zeta(i,k)-sigmaw(i))*deltaqw(i, k) + d_qe(i, k) + & 1794 (zeta(i,k)-sigmaw(i))*d_deltaqw(i, k) - d_sigmaw(i) *(deltaqw(i,k)+&1795 d_deltaqw(i,k))1833 (zeta(i,k)-sigmaw(i))*d_deltaqw(i, k) - d_sigmaw(i) * & 1834 (deltaqw(i,k)+d_deltaqw(i,k)) 1796 1835 a = -d_sigmaw(i)*d_deltaqw(i, k) 1797 1836 b = d_qe(i, k) + (zeta(i,k)-sigmaw(i))*d_deltaqw(i, k) - & … … 1807 1846 ELSE 1808 1847 IF (a>0.) THEN 1809 alpha1(i) = 0.9*min( (2.*c)/(-b+sqrt(discrim)), (-b+sqrt(discrim&1810 ))/(2.*a))1848 alpha1(i) = 0.9*min( (2.*c)/(-b+sqrt(discrim)), & 1849 (-b+sqrt(discrim))/(2.*a) ) 1811 1850 ELSE IF (a==0.) THEN 1812 1851 alpha1(i) = 0.9*(-c/b) 1813 1852 ELSE 1814 1853 ! print*,'a,b,c discrim',a,b,c discrim 1815 alpha1(i) = 0.9*max( (2.*c)/(-b+sqrt(discrim)), (-b+sqrt(discrim&1816 ))/(2.*a))1854 alpha1(i) = 0.9*max( (2.*c)/(-b+sqrt(discrim)), & 1855 (-b+sqrt(discrim))/(2.*a)) 1817 1856 END IF 1818 1857 END IF … … 1827 1866 1828 1867 1868 1869
Note: See TracChangeset
for help on using the changeset viewer.