Changeset 2787 for LMDZ5/branches/testing/libf/phylmd/wake.F90
- Timestamp:
- Jan 30, 2017, 5:54:45 PM (8 years ago)
- Location:
- LMDZ5/branches/testing
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/branches/testing
- Property svn:mergeinfo changed
/LMDZ5/trunk merged: 2728,2730-2775,2777-2785
- Property svn:mergeinfo changed
-
LMDZ5/branches/testing/libf/phylmd/wake.F90
r2720 r2787 2 2 ! $Id$ 3 3 4 SUBROUTINE wake( p, ph, pi, dtime, &4 SUBROUTINE wake(znatsurf, p, ph, pi, dtime, & 5 5 te0, qe0, omgb, & 6 6 dtdwn, dqdwn, amdwn, amup, dta, dqa, & … … 124 124 ! -------------------- 125 125 126 INTEGER, DIMENSION (klon), INTENT(IN) :: znatsurf 126 127 REAL, DIMENSION (klon, klev), INTENT(IN) :: p, pi 127 128 REAL, DIMENSION (klon, klev+1), INTENT(IN) :: ph … … 167 168 LOGICAL, SAVE :: first = .TRUE. 168 169 !$OMP THREADPRIVATE(first) 169 REAL, SAVE :: stark, wdens_ref, coefgw, alpk 170 !jyg< 171 !! REAL, SAVE :: stark, wdens_ref, coefgw, alpk 172 REAL, SAVE, DIMENSION(2) :: wdens_ref 173 REAL, SAVE :: stark, coefgw, alpk 174 !>jyg 170 175 REAL, SAVE :: crep_upper, crep_sol 171 176 !$OMP THREADPRIVATE(stark, wdens_ref, coefgw, alpk, crep_upper, crep_sol) 177 178 LOGICAL, SAVE :: flag_wk_check_trgl 179 !$OMP THREADPRIVATE(flag_wk_check_trgl) 172 180 173 181 REAL :: delta_t_min … … 200 208 REAL, DIMENSION (klon) :: z, dz, hw0 201 209 INTEGER, DIMENSION (klon) :: ktop, kupper 210 211 ! Variables liées au test de la forme triangulaire du profil de Delta_theta 212 REAL, DIMENSION (klon) :: sum_half_dth 213 REAL, DIMENSION (klon) :: dz_half 202 214 203 215 ! Sub-timestep tendencies and related variables … … 312 324 alpk=0.25 313 325 CALL getin_p('alpk',alpk) 314 wdens_ref=8.E-12 315 CALL getin_p('wdens_ref',wdens_ref) 326 !jyg< 327 !! wdens_ref=8.E-12 328 !! CALL getin_p('wdens_ref',wdens_ref) 329 wdens_ref(1)=8.E-12 330 wdens_ref(2)=8.E-12 331 CALL getin_p('wdens_ref_o',wdens_ref(1)) !wake number per unit area ; ocean 332 CALL getin_p('wdens_ref_l',wdens_ref(2)) !wake number per unit area ; land 333 !>jyg 316 334 coefgw=4. 317 335 CALL getin_p('coefgw',coefgw) … … 319 337 WRITE(*,*) 'stark=', stark 320 338 WRITE(*,*) 'alpk=', alpk 321 WRITE(*,*) 'wdens_ref=', wdens_ref 339 !jyg< 340 !! WRITE(*,*) 'wdens_ref=', wdens_ref 341 WRITE(*,*) 'wdens_ref_o=', wdens_ref(1) 342 WRITE(*,*) 'wdens_ref_l=', wdens_ref(2) 343 !>jyg 322 344 WRITE(*,*) 'coefgw=', coefgw 345 346 flag_wk_check_trgl=.false. 347 CALL getin_p('flag_wk_check_trgl ', flag_wk_check_trgl) 348 WRITE(*,*) 'flag_wk_check_trgl=', flag_wk_check_trgl 323 349 324 350 first=.false. … … 328 354 ! Les densites peuvent evoluer si les poches debordent 329 355 ! (voir au tout debut de la boucle sur les substeps) 330 wdens(:) = wdens_ref 356 !jyg< 357 !! wdens(:) = wdens_ref 358 DO i = 1,klon 359 wdens(i) = wdens_ref(znatsurf(i)+1) 360 ENDDO 361 !>jyg 331 362 332 363 ! print*,'stark',stark … … 824 855 825 856 IF (prt_level>=10) THEN 826 PRINT *, 'wake-4, sigmaw(igout), cstar(igout), wape(igout) ', &827 sigmaw(igout), cstar(igout), wape(igout) 857 PRINT *, 'wake-4, sigmaw(igout), cstar(igout), wape(igout), ktop(igout) ', & 858 sigmaw(igout), cstar(igout), wape(igout), ktop(igout) 828 859 ENDIF 829 860 … … 846 877 END DO 847 878 IF (prt_level>=10) THEN 848 PRINT *, 'wake-4.1, isubstep,wk_adv(igout),cstar(igout),wape(igout) ', &849 isubstep,wk_adv(igout),cstar(igout),wape(igout) 879 PRINT *, 'wake-4.1, isubstep,wk_adv(igout),cstar(igout),wape(igout), ptop(igout) ', & 880 isubstep,wk_adv(igout),cstar(igout),wape(igout), ptop(igout) 850 881 ENDIF 851 882 … … 962 993 IF (prt_level>=10) THEN 963 994 PRINT *, 'wake-4.2, omg(igout,k) ', (k,omg(igout,k), k=1,klev) 964 PRINT *, 'wake-4.2, omgtop(igout) ', omgtop(igout) 995 PRINT *, 'wake-4.2, omgtop(igout), ptop(igout), ktop(igout) ', & 996 omgtop(igout), ptop(igout), ktop(igout) 965 997 ENDIF 966 998 … … 1609 1641 1610 1642 IF (prt_level>=10) THEN 1611 PRINT *, 'wake-5, sigmaw(igout), cstar(igout), wape(igout) ', &1612 sigmaw(igout), cstar(igout), wape(igout) 1643 PRINT *, 'wake-5, sigmaw(igout), cstar(igout), wape(igout), ptop(igout) ', & 1644 sigmaw(igout), cstar(igout), wape(igout), ptop(igout) 1613 1645 ENDIF 1614 1646 … … 1632 1664 sum_thvu(i) = 0. 1633 1665 sum_dth(i) = 0. 1666 sum_half_dth(i) = 0. 1634 1667 sum_dq(i) = 0. 1635 1668 sum_rho(i) = 0. … … 1646 1679 av_dtdwn(i) = 0. 1647 1680 av_dqdwn(i) = 0. 1681 1682 dthmin(i) = -delta_t_min 1648 1683 END IF 1649 1684 END DO … … 1685 1720 z(i) = 1. 1686 1721 dz(i) = 1. 1722 dz_half(i) = 1. 1687 1723 sum_thvu(i) = thu(i, 1)*(1.+epsim1*qu(i,1))*dz(i) 1688 1724 sum_dth(i) = 0. … … 1696 1732 ! cc 1697 1733 dz(i) = -(amax1(ph(i,k+1),ptop(i))-ph(i,k))/(rho(i,k)*rg) 1734 dz_half(i) = -(amax1(ph(i,k+1),0.5*(ptop(i)+ph(i,1)))-ph(i,k))/(rho(i,k)*rg) 1698 1735 IF (dz(i)>0) THEN 1699 1736 z(i) = z(i) + dz(i) … … 1707 1744 sum_dtdwn(i) = sum_dtdwn(i) + dtdwn(i, k)*dz(i) 1708 1745 sum_dqdwn(i) = sum_dqdwn(i) + dqdwn(i, k)*dz(i) 1746 ! 1747 dthmin(i) = min(dthmin(i), dth(i,k)) 1748 END IF 1749 IF (dz_half(i)>0) THEN 1750 sum_half_dth(i) = sum_half_dth(i) + dth(i, k)*dz_half(i) 1709 1751 END IF 1710 1752 END IF … … 1750 1792 1751 1793 ! Filter out bad wakes 1794 1795 IF (flag_wk_check_trgl) THEN 1796 ! Check triangular shape of dth profile 1797 DO i = 1, klon 1798 IF (ok_qx_qw(i)) THEN 1799 !! print *,'wake, hw0(i), dthmin(i) ', hw0(i), dthmin(i) 1800 !! print *,'wake, 2.*sum_dth(i)/(hw0(i)*dthmin(i)) ', & 1801 !! 2.*sum_dth(i)/(hw0(i)*dthmin(i)) 1802 !! print *,'wake, sum_half_dth(i), sum_dth(i) ', & 1803 !! sum_half_dth(i), sum_dth(i) 1804 IF ((hw0(i) < 1.) .or. (dthmin(i) >= -delta_t_min) ) THEN 1805 wape2(i) = -1. 1806 !! print *,'wake, rej 1' 1807 ELSE IF (abs(2.*sum_dth(i)/(hw0(i)*dthmin(i)) - 1.) > 0.5) THEN 1808 wape2(i) = -1. 1809 !! print *,'wake, rej 2' 1810 ELSE IF (abs(sum_half_dth(i)) < 0.5*abs(sum_dth(i)) ) THEN 1811 wape2(i) = -1. 1812 !! print *,'wake, rej 3' 1813 END IF 1814 END IF 1815 END DO 1816 END IF 1817 1752 1818 1753 1819 DO k = 1, klev … … 1882 1948 1883 1949 ! cc nrlmd IF ( wk_adv(i) .AND. k .LE. kupper(i)) THEN 1884 IF (ok_qx_qw(i) .AND. k<=kupper(i)) THEN 1950 !jyg< 1951 !! IF (ok_qx_qw(i) .AND. k<=kupper(i)) THEN 1952 IF (ok_qx_qw(i)) THEN 1953 !>jyg 1885 1954 ! cc 1886 1955 dtls(i, k) = dtls(i, k)/dtime
Note: See TracChangeset
for help on using the changeset viewer.