Changeset 4294
- Timestamp:
- Oct 7, 2022, 12:24:21 AM (2 years ago)
- Location:
- LMDZ6/trunk/libf/phylmd
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/trunk/libf/phylmd/wake.F90
r4231 r4294 7 7 dtdwn, dqdwn, amdwn, amup, dta, dqa, wgen, & 8 8 sigd_con, Cin, & 9 deltatw, deltaqw, sigmaw, awdens, wdens, & ! state variables9 deltatw, deltaqw, sigmaw, awdens, wdens, & 10 10 dth, hw, wape, fip, gfl, & 11 11 dtls, dqls, ktopw, omgbdth, dp_omgb, tu, qu, & … … 31 31 USE wake_ini_mod , ONLY : iflag_wk_act, iflag_wk_check_trgl, iflag_wk_pop_dyn, wdensmin 32 32 USE wake_ini_mod , ONLY : sigmad, hwmin, wapecut, cstart, sigmaw_max, dens_rate, epsilon_loc 33 USE wake_ini_mod , ONLY : iflag_wk_profile 33 34 34 35 … … 189 190 !! REAL, DIMENSION (klon) :: sigmaw1 190 191 191 ! Variables liees a la dynamique de population 192 ! Variables liees a la dynamique de population 1 192 193 REAL, DIMENSION(klon) :: act 193 194 REAL, DIMENSION(klon) :: rad_wk, tau_wk_inv 194 195 REAL, DIMENSION(klon) :: f_shear 195 196 REAL, DIMENSION(klon) :: drdt 197 198 ! Variables liees a la dynamique de population 2 199 REAL, DIMENSION(klon) :: cont_fact 200 196 201 !! REAL, DIMENSION(klon) :: d_sig_gen, d_sig_death, d_sig_col 197 202 REAL, DIMENSION(klon) :: wape1_act, wape2_act … … 200 205 REAL :: tau_wk_inv_min 201 206 ! Some components of the tendencies of state variables 202 REAL, DIMENSION (klon) :: d_sig_gen2, d_sig_death2, d_sig_col2, d_sig_bnd2 203 REAL, DIMENSION (klon) :: d_sig_spread2 207 REAL, DIMENSION (klon) :: d_sig_gen2, d_sig_death2, d_sig_col2, d_sig_spread2, d_sig_bnd2 204 208 REAL, DIMENSION (klon) :: d_dens_gen2, d_dens_death2, d_dens_col2, d_dens_bnd2 209 REAL, DIMENSION (klon) :: d_adens_death2, d_adens_icol2, d_adens_acol2, d_adens_bnd2 205 210 206 211 ! Variables pour les GW … … 227 232 REAL, DIMENSION (klon) :: d_sig_gen, d_sig_death, d_sig_col, d_sig_spread, d_sig_bnd 228 233 REAL, DIMENSION (klon) :: d_dens_gen, d_dens_death, d_dens_col, d_dens_bnd 234 REAL, DIMENSION (klon) :: d_adens_death, d_adens_icol, d_adens_acol, d_adens_bnd 229 235 REAL, DIMENSION (klon) :: alpha, alpha_tot 230 236 REAL, DIMENSION (klon) :: q0_min, q1_min … … 285 291 REAL, DIMENSION(klon) :: awdens_in, wdens_in ! pour les prints 286 292 287 293 write(81) klon,klev,znatsurf,p,pi,ph,omgb,dtime,tenv0,qe0,dtdwn,dqdwn,amdwn,amup,dta,dqa,wgen,sigd_con,cin,deltatw,deltaqw,sigmaw,awdens,wdens 288 294 ! ------------------------------------------------------------------------- 289 295 ! Initialisations … … 313 319 ! alpk = 0.5 314 320 ! alpk = 0.05 315 316 321 print *,'XXXX dtime input ', dtime 317 322 igout = klon/2+1/klon 318 323 … … 403 408 ! print*, 'sigmaw,sigd_con', sigmaw, sigd_con 404 409 ! ENDIF 405 IF (iflag_wk_pop_dyn >= 1) THEN410 IF (iflag_wk_pop_dyn >= 1) THEN 406 411 DO i = 1, klon 407 412 d_dens_gen2(i) = 0. … … 409 414 d_dens_col2(i) = 0. 410 415 d_awdens2(i) = 0. 416 ! 411 417 wdens_targ = max(wdens(i),wdensmin) 412 418 d_dens_bnd2(i) = wdens_targ - wdens(i) … … 414 420 wdens(i) = wdens_targ 415 421 END DO 416 ELSE 422 IF (iflag_wk_pop_dyn == 2) THEN 423 DO i = 1, klon 424 d_adens_death2(i) = 0. 425 d_adens_icol2(i) = 0. 426 d_adens_acol2(i) = 0. 427 ! 428 wdens_targ = min(max(awdens(i),0.),wdens(i)) 429 d_adens_bnd2(i) = wdens_targ - awdens(i) 430 d_awdens2(i) = wdens_targ - awdens(i) 431 awdens(i) = wdens_targ 432 END DO 433 ENDIF ! (iflag_wk_pop_dyn == 2) 434 ELSE 417 435 DO i = 1, klon 418 436 d_awdens2(i) = 0. 419 437 d_wdens2(i) = 0. 420 438 END DO 421 ENDIF ! (iflag_wk_pop_dyn >= 1)439 ENDIF ! (iflag_wk_pop_dyn >= 1) 422 440 ! 423 441 DO i = 1, klon … … 433 451 d_sig_bnd2(i) = sigmaw_targ - sigmaw(i) 434 452 d_sigmaw2(i) = sigmaw_targ - sigmaw(i) 453 print *,'XXXX1 d_sigmaw2(i), sigmaw(i) ', d_sigmaw2(i), sigmaw(i) 435 454 sigmaw(i) = sigmaw_targ 436 455 !>jyg … … 465 484 dp_omgbw(:,:) = 0. 466 485 omgbdq(:,:) = 0. 486 467 487 !>jyg 468 488 ! … … 816 836 d_sig_bnd2(i) = d_sig_bnd2(i) + sigmaw_targ - sigmaw(i) 817 837 d_sigmaw2(i) = d_sigmaw2(i) + sigmaw_targ - sigmaw(i) 838 print *,'XXXX2 d_sigmaw2(i), sigmaw(i) ', d_sigmaw2(i), sigmaw(i) 818 839 sigmaw(i) = sigmaw_targ 819 840 !>jyg … … 898 919 ! c $ isubstep,wk_adv(i),cstar(i),wape(i) 899 920 IF (wk_adv(i) .AND. cstar(i)>0.01) THEN 900 omg(i, kupper(i)+1) = -RG*amdwn(i, kupper(i)+1)/sigmaw(i) + & 921 IF ( iflag_wk_profile == 0 ) THEN 922 omg(i, kupper(i)+1)=-RG*amdwn(i, kupper(i)+1)/sigmaw(i) + & 901 923 RG*amup(i, kupper(i)+1)/(1.-sigmaw(i)) 924 ELSE 925 omg(i, kupper(i)+1)=0. 926 ENDIF 902 927 wdens0 = (sigmaw(i)/(4.*3.14))* & 903 928 ((1.-sigmaw(i))*omg(i,kupper(i)+1)/((ph(i,1)-pupper(i))*cstar(i)))**(2) … … 925 950 d_sig_bnd2(i) = d_sig_bnd2(i) + sigmaw_targ - sigmaw(i) 926 951 d_sigmaw2(i) = d_sigmaw2(i) + sigmaw_targ - sigmaw(i) 952 print *,'XXXX3 d_sigmaw2(i), sigmaw(i) ', d_sigmaw2(i), sigmaw(i) 927 953 sigmaw(i) = sigmaw_targ 928 954 !>jyg … … 946 972 947 973 ELSEIF (iflag_wk_pop_dyn == 2) THEN 948 CALL wake_popdyn_2 ( klon, klev, dtime, cstar, tau_wk_inv, wgen, wdens, awdens, sigmaw, &949 dtimesub, gfl, rad_wk, f_shear, drdt_pos, &950 d_awdens, d_wdens, d_sigmaw, &951 iflag_wk_act, wk_adv, cin, wape, &952 drdt, &953 d_dens_gen, d_dens_death, d_dens_col, d_dens_bnd, &954 d_sig_gen, d_sig_death, d_sig_col, d_sig_spread, d_sig_bnd, &955 d_wdens_targ, d_sigmaw_targ)974 CALL wake_popdyn_2 ( klon, klev, wk_adv, dtimesub, wgen, & 975 sigmaw, wdens, awdens, & !! states variables 976 gfl, cstar, cin, wape, rad_wk, & 977 d_sigmaw, d_wdens, d_awdens, & !! tendences 978 cont_fact, & 979 d_sig_gen, d_sig_death, d_sig_col, d_sig_spread, d_sig_bnd, & 980 d_dens_gen, d_dens_death, d_dens_col, d_dens_bnd, & 981 d_adens_death, d_adens_icol, d_adens_acol, d_adens_bnd ) 956 982 death_rate(:) = 0. 957 983 … … 987 1013 END DO 988 1014 989 ENDIF ! (iflag_wk_pop_dyn >= 1)1015 ENDIF ! (iflag_wk_pop_dyn == 1) 990 1016 991 1017 … … 1067 1093 DO i = 1, klon 1068 1094 IF (wk_adv(i) .AND. kupper(i)>ktop(i)) THEN 1069 omg(i, kupper(i)+1) = -RG*amdwn(i, kupper(i)+1)/sigmaw(i) + & 1095 IF ( iflag_wk_profile == 0 ) THEN 1096 omg(i, kupper(i)+1) =-RG*amdwn(i, kupper(i)+1)/sigmaw(i) + & 1070 1097 RG*amup(i, kupper(i)+1)/(1.-sigmaw(i)) 1098 ELSE 1099 omg(i, kupper(i)+1) = 0. 1100 ENDIF 1071 1101 dp_deltomg(i, kupper(i)) = (omgtop(i)-omg(i,kupper(i)+1))/ & 1072 1102 (ptop(i)-pupper(i)) … … 1466 1496 sigmaw(i) = sigmaw(i) + d_sigmaw(i) 1467 1497 d_sigmaw2(i) = d_sigmaw2(i) + d_sigmaw(i) 1498 print *,'XXXX4 d_sigmaw2(i), sigmaw(i) ', d_sigmaw2(i), sigmaw(i) 1468 1499 END IF 1469 1500 END DO 1470 1501 !jyg< 1471 1502 IF (iflag_wk_pop_dyn >= 1) THEN 1503 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! sigmaw !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1504 ! Cumulatives 1472 1505 DO i = 1, klon 1473 1506 IF (wk_adv(i)) THEN … … 1479 1512 END IF 1480 1513 END DO 1514 ! Bounds 1481 1515 DO i = 1, klon 1482 1516 IF (wk_adv(i)) THEN 1483 awdens(i) = awdens(i) + d_awdens(i) 1517 sigmaw_targ = max(sigmaw(i),sigmad) 1518 d_sig_bnd2(i) = d_sig_bnd2(i) + sigmaw_targ - sigmaw(i) 1519 d_sigmaw2(i) = d_sigmaw2(i) + sigmaw_targ - sigmaw(i) 1520 print *,'XXXX5 d_sigmaw2(i), sigmaw(i) ', d_sigmaw2(i), sigmaw(i) 1521 sigmaw(i) = sigmaw_targ 1522 END IF 1523 END DO 1524 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! wdens !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1525 ! Cumulatives 1526 DO i = 1, klon 1527 IF (wk_adv(i)) THEN 1484 1528 wdens(i) = wdens(i) + d_wdens(i) 1485 d_awdens2(i) = d_awdens2(i) + d_awdens(i)1486 1529 d_wdens2(i) = d_wdens2(i) + d_wdens(i) 1487 1530 d_dens_gen2(i) = d_dens_gen2(i) + d_dens_gen(i) … … 1491 1534 END IF 1492 1535 END DO 1536 ! Bounds 1493 1537 DO i = 1, klon 1494 1538 IF (wk_adv(i)) THEN … … 1497 1541 d_wdens2(i) = d_wdens2(i) + wdens_targ - wdens(i) 1498 1542 wdens(i) = wdens_targ 1499 ! 1543 END IF 1544 END DO 1545 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! awdens !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1546 ! Cumulatives 1547 DO i = 1, klon 1548 IF (wk_adv(i)) THEN 1549 awdens(i) = awdens(i) + d_awdens(i) 1550 d_awdens2(i) = d_awdens2(i) + d_awdens(i) 1551 END IF 1552 END DO 1553 ! Bounds 1554 DO i = 1, klon 1555 IF (wk_adv(i)) THEN 1500 1556 wdens_targ = min( max(awdens(i),0.), wdens(i) ) 1501 1557 d_awdens2(i) = d_awdens2(i) + wdens_targ - awdens(i) … … 1503 1559 END IF 1504 1560 END DO 1505 DO i = 1, klon 1506 IF (wk_adv(i)) THEN 1507 sigmaw_targ = max(sigmaw(i),sigmad) 1508 d_sig_bnd2(i) = d_sig_bnd2(i) + sigmaw_targ - sigmaw(i) 1509 d_sigmaw2(i) = d_sigmaw2(i) + sigmaw_targ - sigmaw(i) 1510 sigmaw(i) = sigmaw_targ 1511 END IF 1512 END DO 1561 ! 1562 IF (iflag_wk_pop_dyn == 2) THEN 1563 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! awdens again for iflag_wk_pop_dyn = 2!!!!!! 1564 ! Cumulatives 1565 DO i = 1, klon 1566 IF (wk_adv(i)) THEN 1567 d_adens_death2(i) = d_adens_death2(i) + d_adens_death(i) 1568 d_adens_icol2(i) = d_adens_icol2(i) + d_adens_icol(i) 1569 d_adens_acol2(i) = d_adens_acol2(i) + d_adens_acol(i) 1570 d_adens_bnd2(i) = d_adens_bnd2(i) + d_adens_bnd(i) 1571 END IF 1572 END DO 1573 ! Bounds 1574 DO i = 1, klon 1575 IF (wk_adv(i)) THEN 1576 wdens_targ = min( max(awdens(i),0.), wdens(i) ) 1577 d_adens_bnd2(i) = d_adens_bnd2(i) + wdens_targ - awdens(i) 1578 END IF 1579 END DO 1580 ENDIF ! (iflag_wk_pop_dyn == 2) 1513 1581 ENDIF ! (iflag_wk_pop_dyn >= 1) 1514 !>jyg1515 1582 1516 1583 … … 1755 1822 d_sig_bnd2(i) = d_sig_bnd2(i) + sigmaw_targ - sigmaw(i) 1756 1823 d_sigmaw2(i) = d_sigmaw2(i) + sigmaw_targ - sigmaw(i) 1824 print *,'XXXX6 d_sigmaw2(i), sigmaw(i) ', d_sigmaw2(i), sigmaw(i) 1757 1825 sigmaw(i) = sigmaw_targ 1758 1826 !>jyg … … 1973 2041 d_sig_bnd2(i) = d_sig_bnd2(i) + sigmaw_targ - sigmaw(i) 1974 2042 d_sigmaw2(i) = d_sigmaw2(i) + sigmaw_targ - sigmaw(i) 2043 print *,'XXXX7 d_sigmaw2(i), sigmaw(i) ', d_sigmaw2(i), sigmaw(i) 1975 2044 sigmaw(i) = sigmaw_targ 1976 2045 !>jyg … … 2072 2141 !! d_sigmaw2(i) = d_sigmaw2(i) + sigmaw_targ - sigmaw(i) 2073 2142 d_sigmaw2(i) = sigmaw_targ - sigmaw_in(i) ! _in = correction jyg 20220124 2143 print *,'XXXX8 d_sigmaw2(i), sigmaw(i) ', d_sigmaw2(i), sigmaw(i) 2074 2144 sigmaw(i) = sigmaw_targ 2075 2145 IF (iflag_wk_pop_dyn >= 1) THEN … … 2078 2148 wdens_targ = 0. 2079 2149 d_dens_bnd2(i) = d_dens_bnd2(i) + wdens_targ - wdens(i) 2080 d_wdens2(i) = wdens_targ - wdens(i) 2150 !! d_wdens2(i) = wdens_targ - wdens(i) 2151 d_wdens2(i) = wdens_targ - wdens_in(i) ! jyg 20220916 2081 2152 wdens(i) = wdens_targ 2082 2153 wdens_targ = 0. 2083 d_awdens2(i) = wdens_targ - awdens(i) 2154 !!jyg: bug fix : the d_adens_bnd2 computation must be before the update of awdens. 2155 IF (iflag_wk_pop_dyn == 2) THEN 2156 d_adens_bnd2(i) = d_adens_bnd2(i) + wdens_targ - awdens(i) 2157 ENDIF ! (iflag_wk_pop_dyn == 2) 2158 !! d_awdens2(i) = wdens_targ - awdens(i) 2159 d_awdens2(i) = wdens_targ - awdens_in(i) ! jyg 20220916 2084 2160 awdens(i) = wdens_targ 2161 !! IF (iflag_wk_pop_dyn == 2) THEN 2162 !! d_adens_bnd2(i) = d_adens_bnd2(i) + wdens_targ - awdens(i) 2163 !! ENDIF ! (iflag_wk_pop_dyn == 2) 2085 2164 ENDIF ! (iflag_wk_pop_dyn >= 1) 2086 2165 ELSE ! (kill_wake(i)) … … 2130 2209 d_sig_bnd2(i) = d_sig_bnd2(i)/dtime 2131 2210 d_sigmaw2(i) = d_sigmaw2(i)/dtime 2211 print *,'XXXX9 d_sigmaw2(i), sigmaw(i), dtime ', d_sigmaw2(i), sigmaw(i), dtime 2132 2212 ! 2133 2213 d_dens_gen2(i) = d_dens_gen2(i)/dtime … … 2139 2219 ENDIF 2140 2220 ENDDO 2141 ENDIF 2221 IF (iflag_wk_pop_dyn == 2) THEN 2222 DO i = 1, klon 2223 IF (ok_qx_qw(i)) THEN 2224 d_adens_death2(i) = d_adens_death2(i)/dtime 2225 d_adens_icol2(i) = d_adens_icol2(i)/dtime 2226 d_adens_acol2(i) = d_adens_acol2(i)/dtime 2227 d_adens_bnd2(i) = d_adens_bnd2(i)/dtime 2228 ENDIF 2229 ENDDO 2230 ENDIF ! (iflag_wk_pop_dyn == 2) 2231 ENDIF ! (iflag_wk_pop_dyn >= 1) 2232 2142 2233 !>jyg 2143 2234 … … 2392 2483 !! - sigmaw(i)*tau_wk_inv_min )*dtimesub 2393 2484 d_sig_gen(i) = wgen(i)*aa0 2394 print*, 'XXX sigmaw(i), awdens(i), wdens(i), tau_wk_inv_min', &2395 2485 !! print*, 'XXX sigmaw(i), awdens(i), wdens(i), tau_wk_inv_min', & 2486 !! sigmaw(i), awdens(i), wdens(i), tau_wk_inv_min 2396 2487 d_sig_death(i) = - sigmaw(i)*(1.-awdens(i)/wdens(i))*tau_wk_inv_min 2397 2488 !! … … 2432 2523 END SUBROUTINE wake_popdyn_1 2433 2524 2434 SUBROUTINE wake_popdyn_2(klon, klev, dtime, cstar, tau_wk_inv, wgen, wdens, awdens, sigmaw, & 2435 dtimesub, gfl, rad_wk, f_shear, drdt_pos, & 2436 d_awdens, d_wdens, d_sigmaw, & 2437 iflag_wk_act, wk_adv, cin, wape, & 2438 drdt, & 2439 d_dens_gen, d_dens_death, d_dens_col, d_dens_bnd, & 2440 d_sig_gen, d_sig_death, d_sig_col, d_sig_spread, d_sig_bnd, & 2441 d_wdens_targ, d_sigmaw_targ) 2442 2525 SUBROUTINE wake_popdyn_2 ( klon, klev, wk_adv, dtimesub, wgen, & 2526 sigmaw, wdens, awdens, & !! states variables 2527 gfl, cstar, cin, wape, rad_wk, & 2528 d_sigmaw, d_wdens, d_awdens, & !! tendences 2529 cont_fact, & 2530 d_sig_gen, d_sig_death, d_sig_col, d_sig_spread, d_sig_bnd, & 2531 d_dens_gen, d_dens_death, d_dens_col, d_dens_bnd, & 2532 d_adens_death, d_adens_icol, d_adens_acol, d_adens_bnd ) 2533 2534 2443 2535 2444 2536 USE wake_ini_mod , ONLY : wake_ini … … 2453 2545 INTEGER, INTENT(IN) :: klon,klev 2454 2546 LOGICAL, DIMENSION (klon), INTENT(IN) :: wk_adv 2455 REAL, INTENT(IN) :: dtime2456 2547 REAL, INTENT(IN) :: dtimesub 2457 REAL, DIMENSION (klon), INTENT(IN) :: wgen 2458 REAL, DIMENSION (klon), INTENT(IN) :: wdens 2459 REAL, DIMENSION (klon), INTENT(IN) :: awdens 2460 REAL, DIMENSION (klon), INTENT(IN) :: sigmaw 2461 REAL, DIMENSION (klon), INTENT(IN) :: gfl, cstar 2548 REAL, DIMENSION (klon), INTENT(IN) :: wgen !! B = birth rate of wakes 2549 REAL, DIMENSION (klon), INTENT(IN) :: sigmaw !! sigma = fractional area of wakes 2550 REAL, DIMENSION (klon), INTENT(IN) :: wdens !! D = number of wakes per unit area 2551 REAL, DIMENSION (klon), INTENT(IN) :: awdens !! A = number of active wakes per unit area 2552 REAL, DIMENSION (klon), INTENT(IN) :: gfl !! Lg = gust front lenght per unit area 2553 REAL, DIMENSION (klon), INTENT(IN) :: cstar !! C* = spreading velocity of wakes 2462 2554 REAL, DIMENSION (klon), INTENT(IN) :: cin, wape 2463 REAL, DIMENSION (klon), INTENT(IN) :: rad_wk 2464 REAL, DIMENSION (klon), INTENT(IN) :: f_shear 2465 INTEGER, INTENT(IN) :: iflag_wk_act 2466 2555 REAL, DIMENSION (klon), INTENT(IN) :: rad_wk !! r = wake radius 2556 2557 ! 2558 REAL, DIMENSION (klon), INTENT(OUT) :: d_sigmaw, d_wdens, d_awdens 2559 REAL, DIMENSION (klon), INTENT(OUT) :: cont_fact 2560 ! Some components of the tendencies of state variables 2561 REAL, DIMENSION (klon), INTENT(OUT) :: d_sig_gen, d_sig_death, d_sig_col, d_sig_spread, d_sig_bnd 2562 REAL, DIMENSION (klon), INTENT(OUT) :: d_dens_gen, d_dens_death, d_dens_col, d_dens_bnd 2563 REAL, DIMENSION (klon), INTENT(OUT) :: d_adens_death, d_adens_icol, d_adens_acol, d_adens_bnd 2564 2565 2566 !! internal variables 2467 2567 2468 ! 2469 2470 ! Tendencies of state variables (2 is appended to the names of fields which are the cumul of fields 2471 ! computed at each sub-timestep; e.g. d_wdens2 is the cumul of d_wdens) 2472 REAL, DIMENSION (klon), INTENT(OUT) :: d_sigmaw, d_awdens, d_wdens 2473 REAL, DIMENSION (klon), INTENT(OUT) :: drdt 2474 ! Some components of the tendencies of state variables 2475 REAL, DIMENSION (klon), INTENT(OUT) :: d_sig_gen, d_sig_death, d_sig_col, d_sig_bnd 2476 REAL, DIMENSION (klon), INTENT(OUT) :: d_sig_spread 2477 REAL, DIMENSION (klon), INTENT(OUT) :: d_dens_gen, d_dens_death, d_dens_col, d_dens_bnd 2478 REAL, INTENT(OUT) :: d_wdens_targ, d_sigmaw_targ 2479 2568 INTEGER :: i, k 2569 REAL, DIMENSION (klon) :: tau_wk_inv !! tau = life time of wakes 2570 REAL :: tau_wk_inv_min 2571 REAL, DIMENSION (klon) :: tau_prime !! tau_prime = life time of actives wakes 2572 REAL :: d_wdens_targ, d_sigmaw_targ 2480 2573 2481 REAL :: delta_t_min 2482 INTEGER :: nsub 2483 INTEGER :: i, k 2484 REAL :: wdens0 2485 ! IM 080208 2486 LOGICAL, DIMENSION (klon) :: gwake 2487 2488 ! Variables liees a la dynamique de population 2489 REAL, DIMENSION(klon) :: act 2490 REAL, DIMENSION(klon) :: tau_wk_inv 2491 REAL, DIMENSION(klon) :: wape1_act, wape2_act 2492 LOGICAL, DIMENSION (klon) :: kill_wake 2493 REAL :: drdt_pos 2494 REAL :: tau_wk_inv_min 2495 2496 2497 2498 IF (iflag_wk_act == 0) THEN 2499 act(:) = 0. 2500 ELSEIF (iflag_wk_act == 1) THEN 2501 act(:) = 1. 2502 ELSEIF (iflag_wk_act ==2) THEN 2503 DO i = 1, klon 2504 IF (wk_adv(i)) THEN 2505 wape1_act(i) = abs(cin(i)) 2506 wape2_act(i) = 2.*wape1_act(i) + 1. 2507 act(i) = min(1., max(0., (wape(i)-wape1_act(i)) / (wape2_act(i)-wape1_act(i)) )) 2508 ENDIF ! (wk_adv(i)) 2509 ENDDO 2510 ENDIF ! (iflag_wk_act ==2) 2574 2575 !! Equations 2576 !! dD/dt = B - (D-A)/tau - f D^2 2577 !! dA/dt = B - A/tau_prime + f (D-A)^2 - f A^2 2578 !! dsigma/dt = B a0 - sigma/D (D-A)/tau + Lg C* - f (D-A)^2 (sigma/D-a0) 2579 !! 2580 !! f = 2 (B (a0-sigma/D) + Lg C*) / (2 (D-A)^2 (2 sigma/D-a0) + D (1-2 sigma)) 2511 2581 2512 2582 … … 2517 2587 tau_wk_inv(i) = max( (3.*cstar(i))/(rad_wk(i)*((cstar(i)/cstart)**1.5 - 1)), 0.) 2518 2588 tau_wk_inv_min = min(tau_wk_inv(i), 1./dtimesub) 2519 drdt(i) = (cstar(i) - wgen(i)*(sigmaw(i)/wdens(i)-aa0)/gfl(i)) / & 2520 (1 + 2*f_shear(i)*(2.*sigmaw(i)-aa0*wdens(i)) - 2.*sigmaw(i)) 2521 !! (1 - 2*sigmaw(i)*(1.-f_shear(i))) 2522 drdt_pos=max(drdt(i),0.) 2523 2524 !! d_wdens(i) = ( wgen(i)*(1.+2.*(sigmaw(i)-sigmad)) & 2525 !! - wdens(i)*tau_wk_inv_min & 2526 !! - 2.*gfl(i)*wdens(i)*Cstar(i) )*dtimesub 2527 !jyg+mlt< 2528 d_awdens(i) = ( wgen(i) - (1./tau_cv)*(awdens(i) - act(i)*wdens(i)) )*dtimesub 2529 d_dens_gen(i) = wgen(i) 2530 d_dens_death(i) = - (wdens(i)-awdens(i))*tau_wk_inv_min 2531 d_dens_col(i) = -2.*wdens(i)*gfl(i)*drdt_pos 2532 d_dens_gen(i) = d_dens_gen(i)*dtimesub 2533 d_dens_death(i) = d_dens_death(i)*dtimesub 2534 d_dens_col(i) = d_dens_col(i)*dtimesub 2535 2536 d_wdens(i) = d_dens_gen(i)+d_dens_death(i)+d_dens_col(i) 2537 !! d_wdens(i) = ( wgen(i) - (wdens(i)-awdens(i))*tau_wk_inv_min - & 2538 !! 2.*wdens(i)*gfl(i)*drdt_pos )*dtimesub 2539 !>jyg+mlt 2589 tau_prime(i) = tau_cv 2590 !! cont_fact(i) = 2.*(wgen(i)*(aa0-sigmaw(i)/wdens(i)) + gfl(i)*cstar(i)) / & 2591 !! (2.*(wdens(i)-awdens(i))**2*(2.*sigmaw(i)/wdens(i) - aa0) + wdens(i)*(1.-2.*sigmaw(i))) 2592 cont_fact(i) = 2.*3.14*rad_wk(i)*cstar(i) 2593 2594 d_sig_gen(i) = wgen(i)*aa0 2595 d_sig_death(i) = - sigmaw(i)*(1.-awdens(i)/wdens(i))*tau_wk_inv_min 2596 d_sig_col(i) = - cont_fact(i)*(wdens(i)-awdens(i))**2*(2.*sigmaw(i)/wdens(i)-aa0) 2597 d_sig_spread(i) = gfl(i)*cstar(i) 2540 2598 ! 2541 !jyg<2542 d_wdens_targ = max(d_wdens(i), wdensmin-wdens(i))2543 !! d_dens_bnd(i) = d_dens_bnd(i) + d_wdens_targ - d_wdens(i)2544 d_dens_bnd(i) = d_wdens_targ - d_wdens(i)2545 d_wdens(i) = d_wdens_targ2546 !! d_wdens(i) = max(d_wdens(i), wdensmin-wdens(i))2547 !>jyg2548 2549 !jyg+mlt<2550 !! d_sigmaw(i) = ( (1.-2*f_shear(i)*sigmaw(i))*(gfl(i)*Cstar(i)+wgen(i)*sigmad/wdens(i)) &2551 !! + 2.*f_shear(i)*wgen(i)*sigmaw(i)**2/wdens(i) &2552 !! - sigmaw(i)*tau_wk_inv_min )*dtimesub2553 d_sig_gen(i) = wgen(i)*aa02554 print*, 'XXX sigmaw(i), awdens(i), wdens(i), tau_wk_inv_min', &2555 sigmaw(i), awdens(i), wdens(i), tau_wk_inv_min2556 d_sig_death(i) = - sigmaw(i)*(1.-awdens(i)/wdens(i))*tau_wk_inv_min2557 !!2558 2559 d_sig_col(i) = - 2*f_shear(i)*sigmaw(i)*gfl(i)*drdt_pos2560 d_sig_col(i) = - 2*f_shear(i)*(2.*sigmaw(i)-wdens(i)*aa0)*gfl(i)*drdt_pos2561 d_sig_spread(i) = gfl(i)*cstar(i)2562 2599 d_sig_gen(i) = d_sig_gen(i)*dtimesub 2563 2600 d_sig_death(i) = d_sig_death(i)*dtimesub … … 2565 2602 d_sig_spread(i) = d_sig_spread(i)*dtimesub 2566 2603 d_sigmaw(i) = d_sig_gen(i) + d_sig_death(i) + d_sig_col(i) + d_sig_spread(i) 2567 !>jyg+mlt 2568 ! 2569 !jyg< 2604 2605 2570 2606 d_sigmaw_targ = max(d_sigmaw(i), sigmad-sigmaw(i)) 2571 2607 !! d_sig_bnd(i) = d_sig_bnd(i) + d_sigmaw_targ - d_sigmaw(i) … … 2574 2610 d_sigmaw(i) = d_sigmaw_targ 2575 2611 !! d_sigmaw(i) = max(d_sigmaw(i), sigmad-sigmaw(i)) 2576 !>jyg 2612 2613 2614 d_dens_gen(i) = wgen(i) 2615 d_dens_death(i) = - (wdens(i)-awdens(i))*tau_wk_inv_min 2616 d_dens_col(i) = - cont_fact(i)*wdens(i)**2 2617 ! 2618 d_dens_gen(i) = d_dens_gen(i)*dtimesub 2619 d_dens_death(i) = d_dens_death(i)*dtimesub 2620 d_dens_col(i) = d_dens_col(i)*dtimesub 2621 d_wdens(i) = d_dens_gen(i) + d_dens_death(i) + d_dens_col(i) 2622 2623 2624 d_adens_death(i) = -awdens(i)/tau_prime(i) 2625 d_adens_icol(i) = cont_fact(i)*(wdens(i)-awdens(i))**2 2626 d_adens_acol(i) = - cont_fact(i)*awdens(i)**2 2627 ! 2628 d_adens_death(i) = d_adens_death(i)*dtimesub 2629 d_adens_icol(i) = d_adens_icol(i)*dtimesub 2630 d_adens_acol(i) = d_adens_acol(i)*dtimesub 2631 d_awdens(i) = d_dens_gen(i) + d_adens_death(i) + d_adens_icol(i) + d_adens_acol(i) 2632 2633 !! 2634 d_wdens_targ = max(d_wdens(i), wdensmin-wdens(i)) 2635 !! d_dens_bnd(i) = d_dens_bnd(i) + d_wdens_targ - d_wdens(i) 2636 d_dens_bnd(i) = d_wdens_targ - d_wdens(i) 2637 d_wdens(i) = d_wdens_targ 2638 2639 d_wdens_targ = min(max(d_awdens(i),-awdens(i)), wdens(i)-awdens(i)) 2640 !! d_dens_bnd(i) = d_dens_bnd(i) + d_wdens_targ - d_wdens(i) 2641 d_adens_bnd(i) = d_wdens_targ - d_awdens(i) 2642 d_awdens(i) = d_wdens_targ 2643 2644 2645 2577 2646 ENDIF 2578 2647 ENDDO 2579 2648 2580 2649 IF (prt_level >= 10) THEN 2581 print *,'wake, cstar(1), cstar(1)/cstart, rad_wk(1), tau_wk_inv(1), drdt(1) ', & 2582 cstar(1), cstar(1)/cstart, rad_wk(1), tau_wk_inv(1), drdt(1) 2583 print *,'wake, wdens(1), awdens(1), act(1), d_awdens(1) ', & 2584 wdens(1), awdens(1), act(1), d_awdens(1) 2585 print *,'wake, wgen, -(wdens-awdens)*tau_wk_inv, -2.*wdens*gfl*drdt_pos, d_wdens ', & 2586 wgen(1), -(wdens(1)-awdens(1))*tau_wk_inv(1), -2.*wdens(1)*gfl(1)*drdt_pos, d_wdens(1) 2650 print *,'wake, cstar(1), cstar(1)/cstart, rad_wk(1), tau_wk_inv(1), cont_fact(1) ', & 2651 cstar(1), cstar(1)/cstart, rad_wk(1), tau_wk_inv(1), cont_fact(1) 2652 print *,'wake, wdens(1), awdens(1), d_awdens(1) ', & 2653 wdens(1), awdens(1), d_awdens(1) 2587 2654 print *,'wake, d_sig_gen(1), d_sig_death(1), d_sig_col(1), d_sigmaw(1) ', & 2588 2655 d_sig_gen(1), d_sig_death(1), d_sig_col(1), d_sigmaw(1) … … 2592 2659 END SUBROUTINE wake_popdyn_2 2593 2660 2594 -
LMDZ6/trunk/libf/phylmd/wake_ini_mod.F90
r4230 r4294 44 44 INTEGER, SAVE, PROTECTED :: iflag_wk_pop_dyn 45 45 !$OMP THREADPRIVATE(iflag_wk_pop_dyn) 46 47 INTEGER, SAVE, PROTECTED :: iflag_wk_profile 48 !$OMP THREADPRIVATE(iflag_wk_profile) 46 49 47 50 REAL, SAVE, PROTECTED :: wdensmin … … 175 178 ! 2: act(:)=f(Wape) 176 179 180 iflag_wk_profile = 0 181 CALL getin_p('iflag_wk_profile',iflag_wk_profile) ! switch between wdens prescribed 182 ! and wdens prognostic 177 183 rzero = 5000. 178 184 CALL getin_p('rzero_wk', rzero)
Note: See TracChangeset
for help on using the changeset viewer.