Changeset 2155 for LMDZ5/trunk/libf
- Timestamp:
- Nov 25, 2014, 4:15:06 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/trunk/libf/phylmd/wake.F90
r2078 r2155 1089 1089 ! print*,'dtKE= ',dtKE(i,k),' dqKE= ',dqKE(i,k) 1090 1090 1091 dtpbl(i, k) = (wdtpbl(i,k)/sigmaw(i)-udtpbl(i,k)/(1.-sigmaw(i))) 1092 dqpbl(i, k) = (wdqpbl(i,k)/sigmaw(i)-udqpbl(i,k)/(1.-sigmaw(i))) 1091 !jyg< 1092 !! 1093 !!--------------------------------------------------------------- 1094 !! The change of delta_T due to PBL (vertical diffusion plus thermal plumes) 1095 !! is accounted for by the PBL and the Thermals schemes. It is now set to zero 1096 !! within the Wake scheme. 1097 !!--------------------------------------------------------------- 1098 dtPBL(i,k) = 0. 1099 dqPBL(i,k) = 0. 1100 ! 1101 !! dtPBL(i,k)=wdtPBL(i,k) - udtPBL(i,k) 1102 !! dqPBL(i,k)=wdqPBL(i,k) - udqPBL(i,k) 1103 ! 1104 !! dtpbl(i, k) = (wdtpbl(i,k)/sigmaw(i)-udtpbl(i,k)/(1.-sigmaw(i))) 1105 !! dqpbl(i, k) = (wdqpbl(i,k)/sigmaw(i)-udqpbl(i,k)/(1.-sigmaw(i))) 1093 1106 ! print*,'dtPBL= ',dtPBL(i,k),' dqPBL= ',dqPBL(i,k) 1107 !>jyg 1108 ! 1094 1109 1095 1110 ! cc nrlmd Prise en compte du taux de mortalité … … 1805 1820 END SUBROUTINE wake_vec_modulation 1806 1821 1807 SUBROUTINE wake_scal(p, ph, ppi, dtime, sigd_con, te0, qe0, omgb, dtdwn, & 1808 dqdwn, amdwn, amup, dta, dqa, wdtpbl, wdqpbl, udtpbl, udqpbl, deltatw, & 1809 deltaqw, dth, hw, sigmaw, wape, fip, gfl, dtls, dqls, ktopw, omgbdth, & 1810 dp_omgb, wdens, tu, qu, dtke, dqke, dtpbl, dqpbl, omg, dp_deltomg, & 1811 spread, cstar, d_deltat_gw, d_deltatw2, d_deltaqw2) 1812 1813 ! ************************************************************** 1814 ! * 1815 ! WAKE * 1816 ! retour a un Pupper fixe * 1817 ! * 1818 ! written by : GRANDPEIX Jean-Yves 09/03/2000 * 1819 ! modified by : ROEHRIG Romain 01/29/2007 * 1820 ! ************************************************************** 1821 1822 USE dimphy 1823 IMPLICIT NONE 1824 ! ============================================================================ 1825 1826 1827 ! But : Decrire le comportement des poches froides apparaissant dans les 1828 ! grands systemes convectifs, et fournir l'energie disponible pour 1829 ! le declenchement de nouvelles colonnes convectives. 1830 1831 ! Variables d'etat : deltatw : ecart de temperature wake-undisturbed 1832 ! area 1833 ! deltaqw : ecart d'humidite wake-undisturbed area 1834 ! sigmaw : fraction d'aire occupee par la poche. 1835 1836 ! Variable de sortie : 1837 1838 ! wape : WAke Potential Energy 1839 ! fip : Front Incident Power (W/m2) - ALP 1840 ! gfl : Gust Front Length per unit area (m-1) 1841 ! dtls : large scale temperature tendency due to wake 1842 ! dqls : large scale humidity tendency due to wake 1843 ! hw : hauteur de la poche 1844 ! dp_omgb : vertical gradient of large scale omega 1845 ! omgbdth: flux of Delta_Theta transported by LS omega 1846 ! dtKE : differential heating (wake - unpertubed) 1847 ! dqKE : differential moistening (wake - unpertubed) 1848 ! omg : Delta_omg =vertical velocity diff. wake-undist. (Pa/s) 1849 ! dp_deltomg : vertical gradient of omg (s-1) 1850 ! spread : spreading term in dt_wake and dq_wake 1851 ! deltatw : updated temperature difference (T_w-T_u). 1852 ! deltaqw : updated humidity difference (q_w-q_u). 1853 ! sigmaw : updated wake fractional area. 1854 ! d_deltat_gw : delta T tendency due to GW 1855 1856 ! Variables d'entree : 1857 1858 ! aire : aire de la maille 1859 ! te0 : temperature dans l'environnement (K) 1860 ! qe0 : humidite dans l'environnement (kg/kg) 1861 ! omgb : vitesse verticale moyenne sur la maille (Pa/s) 1862 ! dtdwn: source de chaleur due aux descentes (K/s) 1863 ! dqdwn: source d'humidite due aux descentes (kg/kg/s) 1864 ! dta : source de chaleur due courants satures et detrain (K/s) 1865 ! dqa : source d'humidite due aux courants satures et detra (kg/kg/s) 1866 ! amdwn: flux de masse total des descentes, par unite de 1867 ! surface de la maille (kg/m2/s) 1868 ! amup : flux de masse total des ascendances, par unite de 1869 ! surface de la maille (kg/m2/s) 1870 ! p : pressions aux milieux des couches (Pa) 1871 ! ph : pressions aux interfaces (Pa) 1872 ! ppi : (p/p_0)**kapa (adim) 1873 ! dtime: increment temporel (s) 1874 1875 ! Variables internes : 1876 1877 ! rhow : masse volumique de la poche froide 1878 ! rho : environment density at P levels 1879 ! rhoh : environment density at Ph levels 1880 ! te : environment temperature | may change within 1881 ! qe : environment humidity | sub-time-stepping 1882 ! the : environment potential temperature 1883 ! thu : potential temperature in undisturbed area 1884 ! tu : temperature in undisturbed area 1885 ! qu : humidity in undisturbed area 1886 ! dp_omgb: vertical gradient og LS omega 1887 ! omgbw : wake average vertical omega 1888 ! dp_omgbw: vertical gradient of omgbw 1889 ! omgbdq : flux of Delta_q transported by LS omega 1890 ! dth : potential temperature diff. wake-undist. 1891 ! th1 : first pot. temp. for vertical advection (=thu) 1892 ! th2 : second pot. temp. for vertical advection (=thw) 1893 ! q1 : first humidity for vertical advection 1894 ! q2 : second humidity for vertical advection 1895 ! d_deltatw : terme de redistribution pour deltatw 1896 ! d_deltaqw : terme de redistribution pour deltaqw 1897 ! deltatw0 : deltatw initial 1898 ! deltaqw0 : deltaqw initial 1899 ! hw0 : hw initial 1900 ! sigmaw0: sigmaw initial 1901 ! amflux : horizontal mass flux through wake boundary 1902 ! wdens : number of wakes per unit area (3D) or per 1903 ! unit length (2D) 1904 ! Tgw : 1 sur la période de onde de gravité 1905 ! Cgw : vitesse de propagation de onde de gravité 1906 ! LL : distance entre 2 poches 1907 1908 ! ------------------------------------------------------------------------- 1909 ! Déclaration de variables 1910 ! ------------------------------------------------------------------------- 1911 1912 include "dimensions.h" 1913 ! ccc include "dimphy.h" 1914 include "YOMCST.h" 1915 include "cvthermo.h" 1916 include "iniprint.h" 1917 1918 ! Arguments en entree 1919 ! -------------------- 1920 1921 REAL p(klev), ph(klev+1), ppi(klev) 1922 REAL dtime 1923 REAL te0(klev), qe0(klev) 1924 REAL omgb(klev+1) 1925 REAL dtdwn(klev), dqdwn(klev) 1926 REAL wdtpbl(klev), wdqpbl(klev) 1927 REAL udtpbl(klev), udqpbl(klev) 1928 REAL amdwn(klev), amup(klev) 1929 REAL dta(klev), dqa(klev) 1930 REAL sigd_con 1931 1932 ! Sorties 1933 ! -------- 1934 1935 REAL deltatw(klev), deltaqw(klev), dth(klev) 1936 REAL tu(klev), qu(klev) 1937 REAL dtls(klev), dqls(klev) 1938 REAL dtke(klev), dqke(klev) 1939 REAL dtpbl(klev), dqpbl(klev) 1940 REAL spread(klev) 1941 REAL d_deltatgw(klev) 1942 REAL d_deltatw2(klev), d_deltaqw2(klev) 1943 REAL omgbdth(klev+1), omg(klev+1) 1944 REAL dp_omgb(klev), dp_deltomg(klev) 1945 REAL d_deltat_gw(klev) 1946 REAL hw, sigmaw, wape, fip, gfl, cstar 1947 INTEGER ktopw 1948 1949 ! Variables internes 1950 ! ------------------- 1951 1952 ! Variables à fixer 1953 REAL alon 1954 REAL coefgw 1955 REAL wdens0, wdens 1956 REAL stark 1957 REAL alpk 1958 REAL delta_t_min 1959 REAL pupper 1960 INTEGER nsub 1961 REAL dtimesub 1962 REAL sigmad, hwmin 1963 1964 ! Variables de sauvegarde 1965 REAL deltatw0(klev) 1966 REAL deltaqw0(klev) 1967 REAL te(klev), qe(klev) 1968 REAL sigmaw0, sigmaw1 1969 1970 ! Variables pour les GW 1971 REAL ll 1972 REAL n2(klev) 1973 REAL cgw(klev) 1974 REAL tgw(klev) 1975 1976 ! Variables liées au calcul de hw 1977 REAL ptop_provis, ptop, ptop_new 1978 REAL sum_dth 1979 REAL dthmin 1980 REAL z, dz, hw0 1981 INTEGER ktop, kupper 1982 1983 ! Autres variables internes 1984 INTEGER isubstep, k 1985 1986 REAL sum_thu, sum_tu, sum_qu, sum_thvu 1987 REAL sum_dq, sum_rho 1988 REAL sum_dtdwn, sum_dqdwn 1989 REAL av_thu, av_tu, av_qu, av_thvu 1990 REAL av_dth, av_dq, av_rho 1991 REAL av_dtdwn, av_dqdwn 1992 1993 REAL rho(klev), rhoh(klev+1), rhow(klev) 1994 REAL rhow_moyen(klev) 1995 REAL zh(klev), zhh(klev+1) 1996 REAL epaisseur1(klev), epaisseur2(klev) 1997 1998 REAL the(klev), thu(klev) 1999 2000 REAL d_deltatw(klev), d_deltaqw(klev) 2001 2002 REAL omgbw(klev+1), omgtop 2003 REAL dp_omgbw(klev) 2004 REAL ztop, dztop 2005 REAL alpha_up(klev) 2006 2007 REAL rre1, rre2, rrd1, rrd2 2008 REAL th1(klev), th2(klev), q1(klev), q2(klev) 2009 REAL d_th1(klev), d_th2(klev), d_dth(klev) 2010 REAL d_q1(klev), d_q2(klev), d_dq(klev) 2011 REAL omgbdq(klev) 2012 2013 REAL ff, gg 2014 REAL wape2, cstar2, heff 2015 2016 REAL crep(klev) 2017 REAL crep_upper, crep_sol 2018 2019 ! ------------------------------------------------------------------------- 2020 ! Initialisations 2021 ! ------------------------------------------------------------------------- 2022 2023 ! print*, 'wake initialisations' 2024 2025 ! Essais d'initialisation avec sigmaw = 0.02 et hw = 10. 2026 ! ------------------------------------------------------------------------- 2027 2028 DATA sigmad, hwmin/.02, 10./ 2029 2030 ! Longueur de maille (en m) 2031 ! ------------------------------------------------------------------------- 2032 2033 ! ALON = 3.e5 2034 alon = 1.E6 2035 2036 2037 ! Configuration de coefgw,stark,wdens (22/02/06 by YU Jingmei) 2038 2039 ! coefgw : Coefficient pour les ondes de gravité 2040 ! stark : Coefficient k dans Cstar=k*sqrt(2*WAPE) 2041 ! wdens : Densité de poche froide par maille 2042 ! ------------------------------------------------------------------------- 2043 2044 coefgw = 10 2045 ! coefgw=1 2046 ! wdens0 = 1.0/(alon**2) 2047 wdens = 1.0/(alon**2) 2048 stark = 0.50 2049 ! CRtest 2050 alpk = 0.1 2051 ! alpk = 1.0 2052 ! alpk = 0.5 2053 ! alpk = 0.05 2054 crep_upper = 0.9 2055 crep_sol = 1.0 2056 2057 2058 ! Minimum value for |T_wake - T_undist|. Used for wake top definition 2059 ! ------------------------------------------------------------------------- 2060 2061 delta_t_min = 0.2 2062 2063 2064 ! 1. - Save initial values and initialize tendencies 2065 ! -------------------------------------------------- 2066 2067 DO k = 1, klev 2068 deltatw0(k) = deltatw(k) 2069 deltaqw0(k) = deltaqw(k) 2070 te(k) = te0(k) 2071 qe(k) = qe0(k) 2072 dtls(k) = 0. 2073 dqls(k) = 0. 2074 d_deltat_gw(k) = 0. 2075 d_deltatw2(k) = 0. 2076 d_deltaqw2(k) = 0. 2077 END DO 2078 ! sigmaw1=sigmaw 2079 ! IF (sigd_con.GT.sigmaw1) THEN 2080 ! print*, 'sigmaw,sigd_con', sigmaw, sigd_con 2081 ! ENDIF 2082 sigmaw = max(sigmaw, sigd_con) 2083 sigmaw = max(sigmaw, sigmad) 2084 sigmaw = min(sigmaw, 0.99) 2085 sigmaw0 = sigmaw 2086 ! wdens=wdens0/(10.*sigmaw) 2087 ! IF (sigd_con.GT.sigmaw1) THEN 2088 ! print*, 'sigmaw1,sigd1', sigmaw, sigd_con 2089 ! ENDIF 2090 2091 ! 2. - Prognostic part 2092 ! ========================================================= 2093 2094 ! print *, 'prognostic wake computation' 2095 2096 2097 ! 2.1 - Undisturbed area and Wake integrals 2098 ! --------------------------------------------------------- 2099 2100 z = 0. 2101 ktop = 0 2102 kupper = 0 2103 sum_thu = 0. 2104 sum_tu = 0. 2105 sum_qu = 0. 2106 sum_thvu = 0. 2107 sum_dth = 0. 2108 sum_dq = 0. 2109 sum_rho = 0. 2110 sum_dtdwn = 0. 2111 sum_dqdwn = 0. 2112 2113 av_thu = 0. 2114 av_tu = 0. 2115 av_qu = 0. 2116 av_thvu = 0. 2117 av_dth = 0. 2118 av_dq = 0. 2119 av_rho = 0. 2120 av_dtdwn = 0. 2121 av_dqdwn = 0. 2122 2123 ! Potential temperatures and humidity 2124 ! ---------------------------------------------------------- 2125 2126 DO k = 1, klev 2127 rho(k) = p(k)/(rd*te(k)) 2128 IF (k==1) THEN 2129 rhoh(k) = ph(k)/(rd*te(k)) 2130 zhh(k) = 0 2131 ELSE 2132 rhoh(k) = ph(k)*2./(rd*(te(k)+te(k-1))) 2133 zhh(k) = (ph(k)-ph(k-1))/(-rhoh(k)*rg) + zhh(k-1) 2134 END IF 2135 the(k) = te(k)/ppi(k) 2136 thu(k) = (te(k)-deltatw(k)*sigmaw)/ppi(k) 2137 tu(k) = te(k) - deltatw(k)*sigmaw 2138 qu(k) = qe(k) - deltaqw(k)*sigmaw 2139 rhow(k) = p(k)/(rd*(te(k)+deltatw(k))) 2140 dth(k) = deltatw(k)/ppi(k) 2141 ll = (1-sqrt(sigmaw))/sqrt(wdens) 2142 END DO 2143 2144 DO k = 1, klev - 1 2145 IF (k==1) THEN 2146 n2(k) = 0 2147 ELSE 2148 n2(k) = max(0., -rg**2/the(k)*rho(k)*(the(k+1)-the(k-1))/(p(k+ & 2149 1)-p(k-1))) 2150 END IF 2151 zh(k) = (zhh(k)+zhh(k+1))/2 2152 2153 cgw(k) = sqrt(n2(k))*zh(k) 2154 tgw(k) = coefgw*cgw(k)/ll 2155 END DO 2156 2157 n2(klev) = 0 2158 zh(klev) = 0 2159 cgw(klev) = 0 2160 tgw(klev) = 0 2161 2162 ! Calcul de la masse volumique moyenne de la colonne 2163 ! ----------------------------------------------------------------- 2164 2165 DO k = 1, klev 2166 epaisseur1(k) = 0. 2167 epaisseur2(k) = 0. 2168 END DO 2169 2170 epaisseur1(1) = -(ph(2)-ph(1))/(rho(1)*rg) + 1. 2171 epaisseur2(1) = -(ph(2)-ph(1))/(rho(1)*rg) + 1. 2172 rhow_moyen(1) = rhow(1) 2173 2174 DO k = 2, klev 2175 epaisseur1(k) = -(ph(k+1)-ph(k))/(rho(k)*rg) + 1. 2176 epaisseur2(k) = epaisseur2(k-1) + epaisseur1(k) 2177 rhow_moyen(k) = (rhow_moyen(k-1)*epaisseur2(k-1)+rhow(k)*epaisseur1(k))/ & 2178 epaisseur2(k) 2179 END DO 2180 2181 2182 ! Choose an integration bound well above wake top 2183 ! ----------------------------------------------------------------- 2184 2185 ! Pupper = 50000. ! melting level 2186 pupper = 60000. 2187 ! Pupper = 70000. 2188 2189 2190 ! Determine Wake top pressure (Ptop) from buoyancy integral 2191 ! ----------------------------------------------------------------- 2192 2193 ! -1/ Pressure of the level where dth becomes less than delta_t_min. 2194 2195 ptop_provis = ph(1) 2196 DO k = 2, klev 2197 IF (dth(k)>-delta_t_min .AND. dth(k-1)<-delta_t_min) THEN 2198 ptop_provis = ((dth(k)+delta_t_min)*p(k-1)-(dth(k- & 2199 1)+delta_t_min)*p(k))/(dth(k)-dth(k-1)) 2200 GO TO 25 2201 END IF 2202 END DO 2203 25 CONTINUE 2204 2205 ! -2/ dth integral 2206 2207 sum_dth = 0. 2208 dthmin = -delta_t_min 2209 z = 0. 2210 2211 DO k = 1, klev 2212 dz = -(max(ph(k+1),ptop_provis)-ph(k))/(rho(k)*rg) 2213 IF (dz<=0) GO TO 40 2214 z = z + dz 2215 sum_dth = sum_dth + dth(k)*dz 2216 dthmin = min(dthmin, dth(k)) 2217 END DO 2218 40 CONTINUE 2219 2220 ! -3/ height of triangle with area= sum_dth and base = dthmin 2221 2222 hw0 = 2.*sum_dth/min(dthmin, -0.5) 2223 hw0 = max(hwmin, hw0) 2224 2225 ! -4/ now, get Ptop 2226 2227 z = 0. 2228 ptop = ph(1) 2229 2230 DO k = 1, klev 2231 dz = min(-(ph(k+1)-ph(k))/(rho(k)*rg), hw0-z) 2232 IF (dz<=0) GO TO 45 2233 z = z + dz 2234 ptop = ph(k) - rho(k)*rg*dz 2235 END DO 2236 45 CONTINUE 2237 2238 2239 ! -5/ Determination de ktop et kupper 2240 2241 DO k = klev, 1, -1 2242 IF (ph(k+1)<ptop) ktop = k 2243 IF (ph(k+1)<pupper) kupper = k 2244 END DO 2245 2246 ! -6/ Correct ktop and ptop 2247 2248 ptop_new = ptop 2249 DO k = ktop, 2, -1 2250 IF (dth(k)>-delta_t_min .AND. dth(k-1)<-delta_t_min) THEN 2251 ptop_new = ((dth(k)+delta_t_min)*p(k-1)-(dth(k-1)+delta_t_min)*p(k))/ & 2252 (dth(k)-dth(k-1)) 2253 GO TO 225 2254 END IF 2255 END DO 2256 225 CONTINUE 2257 2258 ptop = ptop_new 2259 2260 DO k = klev, 1, -1 2261 IF (ph(k+1)<ptop) ktop = k 2262 END DO 2263 2264 ! Set deltatw & deltaqw to 0 above kupper 2265 ! ----------------------------------------------------------- 2266 2267 DO k = kupper, klev 2268 deltatw(k) = 0. 2269 deltaqw(k) = 0. 2270 END DO 2271 2272 2273 ! Vertical gradient of LS omega 2274 ! ------------------------------------------------------------ 2275 2276 DO k = 1, kupper 2277 dp_omgb(k) = (omgb(k+1)-omgb(k))/(ph(k+1)-ph(k)) 2278 END DO 2279 2280 2281 ! Integrals (and wake top level number) 2282 ! ----------------------------------------------------------- 2283 2284 ! Initialize sum_thvu to 1st level virt. pot. temp. 2285 2286 z = 1. 2287 dz = 1. 2288 sum_thvu = thu(1)*(1.+eps*qu(1))*dz 2289 sum_dth = 0. 2290 2291 DO k = 1, klev 2292 dz = -(max(ph(k+1),ptop)-ph(k))/(rho(k)*rg) 2293 IF (dz<=0) GO TO 50 2294 z = z + dz 2295 sum_thu = sum_thu + thu(k)*dz 2296 sum_tu = sum_tu + tu(k)*dz 2297 sum_qu = sum_qu + qu(k)*dz 2298 sum_thvu = sum_thvu + thu(k)*(1.+eps*qu(k))*dz 2299 sum_dth = sum_dth + dth(k)*dz 2300 sum_dq = sum_dq + deltaqw(k)*dz 2301 sum_rho = sum_rho + rhow(k)*dz 2302 sum_dtdwn = sum_dtdwn + dtdwn(k)*dz 2303 sum_dqdwn = sum_dqdwn + dqdwn(k)*dz 2304 END DO 2305 50 CONTINUE 2306 2307 hw0 = z 2308 2309 ! 2.1 - WAPE and mean forcing computation 2310 ! ------------------------------------------------------------- 2311 2312 ! Means 2313 2314 av_thu = sum_thu/hw0 2315 av_tu = sum_tu/hw0 2316 av_qu = sum_qu/hw0 2317 av_thvu = sum_thvu/hw0 2318 ! av_thve = sum_thve/hw0 2319 av_dth = sum_dth/hw0 2320 av_dq = sum_dq/hw0 2321 av_rho = sum_rho/hw0 2322 av_dtdwn = sum_dtdwn/hw0 2323 av_dqdwn = sum_dqdwn/hw0 2324 2325 wape = -rg*hw0*(av_dth+eps*(av_thu*av_dq+av_dth*av_qu+av_dth*av_dq))/ & 2326 av_thvu 2327 2328 ! 2.2 Prognostic variable update 2329 ! ------------------------------------------------------------ 2330 2331 ! Filter out bad wakes 2332 2333 IF (wape<0.) THEN 2334 IF (prt_level>=10) PRINT *, 'wape<0' 2335 wape = 0. 2336 hw = hwmin 2337 sigmaw = max(sigmad, sigd_con) 2338 fip = 0. 2339 DO k = 1, klev 2340 deltatw(k) = 0. 2341 deltaqw(k) = 0. 2342 dth(k) = 0. 2343 END DO 2344 ELSE 2345 IF (prt_level>=10) PRINT *, 'wape>0' 2346 cstar = stark*sqrt(2.*wape) 2347 END IF 2348 2349 ! ------------------------------------------------------------------ 2350 ! Sub-time-stepping 2351 ! ------------------------------------------------------------------ 2352 2353 ! nsub=36 2354 nsub = 10 2355 dtimesub = dtime/nsub 2356 2357 ! ------------------------------------------------------------ 2358 DO isubstep = 1, nsub 2359 ! ------------------------------------------------------------ 2360 2361 ! print*,'---------------','substep=',isubstep,'-------------' 2362 2363 ! Evolution of sigmaw 2364 2365 2366 gfl = 2.*sqrt(3.14*wdens*sigmaw) 2367 2368 sigmaw = sigmaw + gfl*cstar*dtimesub 2369 sigmaw = min(sigmaw, 0.99) !!!!!!!! 2370 ! wdens = wdens0/(10.*sigmaw) 2371 ! sigmaw =max(sigmaw,sigd_con) 2372 ! sigmaw =max(sigmaw,sigmad) 2373 2374 ! calcul de la difference de vitesse verticale poche - zone non perturbee 2375 2376 z = 0. 2377 dp_deltomg(1:klev) = 0. 2378 omg(1:klev+1) = 0. 2379 2380 omg(1) = 0. 2381 dp_deltomg(1) = -(gfl*cstar)/(sigmaw*(1-sigmaw)) 2382 2383 DO k = 2, ktop 2384 dz = -(ph(k)-ph(k-1))/(rho(k-1)*rg) 2385 z = z + dz 2386 dp_deltomg(k) = dp_deltomg(1) 2387 omg(k) = dp_deltomg(1)*z 2388 END DO 2389 2390 dztop = -(ptop-ph(ktop))/(rho(ktop)*rg) 2391 ztop = z + dztop 2392 omgtop = dp_deltomg(1)*ztop 2393 2394 2395 ! Conversion de la vitesse verticale de m/s a Pa/s 2396 2397 omgtop = -rho(ktop)*rg*omgtop 2398 dp_deltomg(1) = omgtop/(ptop-ph(1)) 2399 2400 DO k = 1, ktop 2401 omg(k) = -rho(k)*rg*omg(k) 2402 dp_deltomg(k) = dp_deltomg(1) 2403 END DO 2404 2405 ! raccordement lineaire de omg de ptop a pupper 2406 2407 IF (kupper>ktop) THEN 2408 omg(kupper+1) = -rg*amdwn(kupper+1)/sigmaw + rg*amup(kupper+1)/(1.- & 2409 sigmaw) 2410 dp_deltomg(kupper) = (omgtop-omg(kupper+1))/(ptop-pupper) 2411 DO k = ktop + 1, kupper 2412 dp_deltomg(k) = dp_deltomg(kupper) 2413 omg(k) = omgtop + (ph(k)-ptop)*dp_deltomg(kupper) 2414 END DO 2415 END IF 2416 2417 ! Compute wake average vertical velocity omgbw 2418 2419 DO k = 1, klev + 1 2420 omgbw(k) = omgb(k) + (1.-sigmaw)*omg(k) 2421 END DO 2422 2423 ! and its vertical gradient dp_omgbw 2424 2425 DO k = 1, klev 2426 dp_omgbw(k) = (omgbw(k+1)-omgbw(k))/(ph(k+1)-ph(k)) 2427 END DO 2428 2429 2430 ! Upstream coefficients for omgb velocity 2431 ! -- (alpha_up(k) is the coefficient of the value at level k) 2432 ! -- (1-alpha_up(k) is the coefficient of the value at level k-1) 2433 2434 DO k = 1, klev 2435 alpha_up(k) = 0. 2436 IF (omgb(k)>0.) alpha_up(k) = 1. 2437 END DO 2438 2439 ! Matrix expressing [The,deltatw] from [Th1,Th2] 2440 2441 rre1 = 1. - sigmaw 2442 rre2 = sigmaw 2443 rrd1 = -1. 2444 rrd2 = 1. 2445 2446 ! Get [Th1,Th2], dth and [q1,q2] 2447 2448 DO k = 1, kupper + 1 2449 dth(k) = deltatw(k)/ppi(k) 2450 th1(k) = the(k) - sigmaw*dth(k) ! undisturbed area 2451 th2(k) = the(k) + (1.-sigmaw)*dth(k) ! wake 2452 q1(k) = qe(k) - sigmaw*deltaqw(k) ! undisturbed area 2453 q2(k) = qe(k) + (1.-sigmaw)*deltaqw(k) ! wake 2454 END DO 2455 2456 d_th1(1) = 0. 2457 d_th2(1) = 0. 2458 d_dth(1) = 0. 2459 d_q1(1) = 0. 2460 d_q2(1) = 0. 2461 d_dq(1) = 0. 2462 2463 DO k = 2, kupper + 1 ! loop on interfaces 2464 d_th1(k) = th1(k-1) - th1(k) 2465 d_th2(k) = th2(k-1) - th2(k) 2466 d_dth(k) = dth(k-1) - dth(k) 2467 d_q1(k) = q1(k-1) - q1(k) 2468 d_q2(k) = q2(k-1) - q2(k) 2469 d_dq(k) = deltaqw(k-1) - deltaqw(k) 2470 END DO 2471 2472 omgbdth(1) = 0. 2473 omgbdq(1) = 0. 2474 2475 DO k = 2, kupper + 1 ! loop on interfaces 2476 omgbdth(k) = omgb(k)*(dth(k-1)-dth(k)) 2477 omgbdq(k) = omgb(k)*(deltaqw(k-1)-deltaqw(k)) 2478 END DO 2479 2480 2481 ! ----------------------------------------------------------------- 2482 DO k = 1, kupper - 1 2483 ! ----------------------------------------------------------------- 2484 2485 ! Compute redistribution (advective) term 2486 2487 d_deltatw(k) = dtimesub/(ph(k)-ph(k+1))*(rrd1*omg(k)*sigmaw*d_th1(k)- & 2488 rrd2*omg(k+1)*(1.-sigmaw)*d_th2(k+1)-(1.-alpha_up( & 2489 k))*omgbdth(k)-alpha_up(k+1)*omgbdth(k+1))*ppi(k) 2490 ! print*,'d_deltatw=',d_deltatw(k) 2491 2492 d_deltaqw(k) = dtimesub/(ph(k)-ph(k+1))*(rrd1*omg(k)*sigmaw*d_q1(k)- & 2493 rrd2*omg(k+1)*(1.-sigmaw)*d_q2(k+1)-(1.-alpha_up( & 2494 k))*omgbdq(k)-alpha_up(k+1)*omgbdq(k+1)) 2495 ! print*,'d_deltaqw=',d_deltaqw(k) 2496 2497 ! and increment large scale tendencies 2498 2499 dtls(k) = dtls(k) + dtimesub*((rre1*omg(k)*sigmaw*d_th1(k)-rre2*omg(k+ & 2500 1)*(1.-sigmaw)*d_th2(k+1))/(ph(k)-ph(k+1))-sigmaw*(1.-sigmaw)*dth(k)* & 2501 dp_deltomg(k))*ppi(k) 2502 ! print*,'dtls=',dtls(k) 2503 2504 dqls(k) = dqls(k) + dtimesub*((rre1*omg(k)*sigmaw*d_q1(k)-rre2*omg(k+ & 2505 1)*(1.-sigmaw)*d_q2(k+1))/(ph(k)-ph(k+1))-sigmaw*(1.-sigmaw)*deltaqw( & 2506 k)*dp_deltomg(k)) 2507 ! print*,'dqls=',dqls(k) 2508 2509 ! ------------------------------------------------------------------- 2510 END DO 2511 ! ------------------------------------------------------------------ 2512 2513 ! Increment state variables 2514 2515 DO k = 1, kupper - 1 2516 2517 ! Coefficient de répartition 2518 2519 crep(k) = crep_sol*(ph(kupper)-ph(k))/(ph(kupper)-ph(1)) 2520 crep(k) = crep(k) + crep_upper*(ph(1)-ph(k))/(p(1)-ph(kupper)) 2521 2522 2523 ! Reintroduce compensating subsidence term. 2524 2525 ! dtKE(k)=(dtdwn(k)*Crep(k))/sigmaw 2526 ! dtKE(k)=dtKE(k)-(dtdwn(k)*(1-Crep(k))+dta(k)) 2527 ! . /(1-sigmaw) 2528 ! dqKE(k)=(dqdwn(k)*Crep(k))/sigmaw 2529 ! dqKE(k)=dqKE(k)-(dqdwn(k)*(1-Crep(k))+dqa(k)) 2530 ! . /(1-sigmaw) 2531 2532 ! dtKE(k)=(dtdwn(k)*Crep(k)+(1-Crep(k))*dta(k))/sigmaw 2533 ! dtKE(k)=dtKE(k)-(dtdwn(k)*(1-Crep(k))+dta(k)*Crep(k)) 2534 ! . /(1-sigmaw) 2535 ! dqKE(k)=(dqdwn(k)*Crep(k)+(1-Crep(k))*dqa(k))/sigmaw 2536 ! dqKE(k)=dqKE(k)-(dqdwn(k)*(1-Crep(k))+dqa(k)*Crep(k)) 2537 ! . /(1-sigmaw) 2538 2539 dtke(k) = (dtdwn(k)/sigmaw-dta(k)/(1.-sigmaw)) 2540 dqke(k) = (dqdwn(k)/sigmaw-dqa(k)/(1.-sigmaw)) 2541 ! print*,'dtKE=',dtKE(k) 2542 ! print*,'dqKE=',dqKE(k) 2543 2544 dtpbl(k) = (wdtpbl(k)/sigmaw-udtpbl(k)/(1.-sigmaw)) 2545 dqpbl(k) = (wdqpbl(k)/sigmaw-udqpbl(k)/(1.-sigmaw)) 2546 2547 spread(k) = (1.-sigmaw)*dp_deltomg(k) + gfl*cstar/sigmaw 2548 ! print*,'spread=',spread(k) 2549 2550 2551 ! ajout d'un effet onde de gravité -Tgw(k)*deltatw(k) 03/02/06 YU 2552 ! Jingmei 2553 2554 d_deltat_gw(k) = d_deltat_gw(k) - tgw(k)*deltatw(k)*dtimesub 2555 ! print*,'d_delta_gw=',d_deltat_gw(k) 2556 ff = d_deltatw(k)/dtimesub 2557 2558 ! Sans GW 2559 2560 ! deltatw(k)=deltatw(k)+dtimesub*(ff+dtKE(k)-spread(k)*deltatw(k)) 2561 2562 ! GW formule 1 2563 2564 ! deltatw(k) = deltatw(k)+dtimesub* 2565 ! $ (ff+dtKE(k) - spread(k)*deltatw(k)-Tgw(k)*deltatw(k)) 2566 2567 ! GW formule 2 2568 2569 IF (dtimesub*tgw(k)<1.E-10) THEN 2570 deltatw(k) = deltatw(k) + dtimesub*(ff+dtke(k)+dtpbl(k)-spread(k)* & 2571 deltatw(k)-tgw(k)*deltatw(k)) 2572 ELSE 2573 deltatw(k) = deltatw(k) + 1/tgw(k)*(1-exp(-dtimesub*tgw(k)))*(ff+dtke & 2574 (k)+dtpbl(k)-spread(k)*deltatw(k)-tgw(k)*deltatw(k)) 2575 END IF 2576 2577 dth(k) = deltatw(k)/ppi(k) 2578 2579 gg = d_deltaqw(k)/dtimesub 2580 2581 deltaqw(k) = deltaqw(k) + dtimesub*(gg+dqke(k)+dqpbl(k)-spread(k)* & 2582 deltaqw(k)) 2583 2584 d_deltatw2(k) = d_deltatw2(k) + d_deltatw(k) 2585 d_deltaqw2(k) = d_deltaqw2(k) + d_deltaqw(k) 2586 END DO 2587 2588 ! And update large scale variables 2589 2590 DO k = 1, kupper 2591 te(k) = te0(k) + dtls(k) 2592 qe(k) = qe0(k) + dqls(k) 2593 the(k) = te(k)/ppi(k) 2594 END DO 2595 2596 ! Determine Ptop from buoyancy integral 2597 ! ---------------------------------------------------------------------- 2598 2599 ! -1/ Pressure of the level where dth changes sign. 2600 2601 ptop_provis = ph(1) 2602 2603 DO k = 2, klev 2604 IF (dth(k)>-delta_t_min .AND. dth(k-1)<-delta_t_min) THEN 2605 ptop_provis = ((dth(k)+delta_t_min)*p(k-1)-(dth(k- & 2606 1)+delta_t_min)*p(k))/(dth(k)-dth(k-1)) 2607 GO TO 65 2608 END IF 2609 END DO 2610 65 CONTINUE 2611 2612 ! -2/ dth integral 2613 2614 sum_dth = 0. 2615 dthmin = -delta_t_min 2616 z = 0. 2617 2618 DO k = 1, klev 2619 dz = -(max(ph(k+1),ptop_provis)-ph(k))/(rho(k)*rg) 2620 IF (dz<=0) GO TO 70 2621 z = z + dz 2622 sum_dth = sum_dth + dth(k)*dz 2623 dthmin = min(dthmin, dth(k)) 2624 END DO 2625 70 CONTINUE 2626 2627 ! -3/ height of triangle with area= sum_dth and base = dthmin 2628 2629 hw = 2.*sum_dth/min(dthmin, -0.5) 2630 hw = max(hwmin, hw) 2631 2632 ! -4/ now, get Ptop 2633 2634 ktop = 0 2635 z = 0. 2636 2637 DO k = 1, klev 2638 dz = min(-(ph(k+1)-ph(k))/(rho(k)*rg), hw-z) 2639 IF (dz<=0) GO TO 75 2640 z = z + dz 2641 ptop = ph(k) - rho(k)*rg*dz 2642 ktop = k 2643 END DO 2644 75 CONTINUE 2645 2646 ! -5/Correct ktop and ptop 2647 2648 ptop_new = ptop 2649 2650 DO k = ktop, 2, -1 2651 IF (dth(k)>-delta_t_min .AND. dth(k-1)<-delta_t_min) THEN 2652 ptop_new = ((dth(k)+delta_t_min)*p(k-1)-(dth(k-1)+delta_t_min)*p(k))/ & 2653 (dth(k)-dth(k-1)) 2654 GO TO 275 2655 END IF 2656 END DO 2657 275 CONTINUE 2658 2659 ptop = ptop_new 2660 2661 DO k = klev, 1, -1 2662 IF (ph(k+1)<ptop) ktop = k 2663 END DO 2664 2665 ! -6/ Set deltatw & deltaqw to 0 above kupper 2666 2667 DO k = kupper, klev 2668 deltatw(k) = 0. 2669 deltaqw(k) = 0. 2670 END DO 2671 2672 ! ------------------------------------------------------------------ 2673 END DO ! end sub-timestep loop 2674 ! ----------------------------------------------------------------- 2675 2676 ! Get back to tendencies per second 2677 2678 DO k = 1, kupper - 1 2679 dtls(k) = dtls(k)/dtime 2680 dqls(k) = dqls(k)/dtime 2681 d_deltatw2(k) = d_deltatw2(k)/dtime 2682 d_deltaqw2(k) = d_deltaqw2(k)/dtime 2683 d_deltat_gw(k) = d_deltat_gw(k)/dtime 2684 END DO 2685 2686 ! 2.1 - Undisturbed area and Wake integrals 2687 ! --------------------------------------------------------- 2688 2689 z = 0. 2690 sum_thu = 0. 2691 sum_tu = 0. 2692 sum_qu = 0. 2693 sum_thvu = 0. 2694 sum_dth = 0. 2695 sum_dq = 0. 2696 sum_rho = 0. 2697 sum_dtdwn = 0. 2698 sum_dqdwn = 0. 2699 2700 av_thu = 0. 2701 av_tu = 0. 2702 av_qu = 0. 2703 av_thvu = 0. 2704 av_dth = 0. 2705 av_dq = 0. 2706 av_rho = 0. 2707 av_dtdwn = 0. 2708 av_dqdwn = 0. 2709 2710 ! Potential temperatures and humidity 2711 ! ---------------------------------------------------------- 2712 2713 DO k = 1, klev 2714 rho(k) = p(k)/(rd*te(k)) 2715 IF (k==1) THEN 2716 rhoh(k) = ph(k)/(rd*te(k)) 2717 zhh(k) = 0 2718 ELSE 2719 rhoh(k) = ph(k)*2./(rd*(te(k)+te(k-1))) 2720 zhh(k) = (ph(k)-ph(k-1))/(-rhoh(k)*rg) + zhh(k-1) 2721 END IF 2722 the(k) = te(k)/ppi(k) 2723 thu(k) = (te(k)-deltatw(k)*sigmaw)/ppi(k) 2724 tu(k) = te(k) - deltatw(k)*sigmaw 2725 qu(k) = qe(k) - deltaqw(k)*sigmaw 2726 rhow(k) = p(k)/(rd*(te(k)+deltatw(k))) 2727 dth(k) = deltatw(k)/ppi(k) 2728 2729 END DO 2730 2731 ! Integrals (and wake top level number) 2732 ! ----------------------------------------------------------- 2733 2734 ! Initialize sum_thvu to 1st level virt. pot. temp. 2735 2736 z = 1. 2737 dz = 1. 2738 sum_thvu = thu(1)*(1.+eps*qu(1))*dz 2739 sum_dth = 0. 2740 2741 DO k = 1, klev 2742 dz = -(max(ph(k+1),ptop)-ph(k))/(rho(k)*rg) 2743 2744 IF (dz<=0) GO TO 51 2745 z = z + dz 2746 sum_thu = sum_thu + thu(k)*dz 2747 sum_tu = sum_tu + tu(k)*dz 2748 sum_qu = sum_qu + qu(k)*dz 2749 sum_thvu = sum_thvu + thu(k)*(1.+eps*qu(k))*dz 2750 sum_dth = sum_dth + dth(k)*dz 2751 sum_dq = sum_dq + deltaqw(k)*dz 2752 sum_rho = sum_rho + rhow(k)*dz 2753 sum_dtdwn = sum_dtdwn + dtdwn(k)*dz 2754 sum_dqdwn = sum_dqdwn + dqdwn(k)*dz 2755 END DO 2756 51 CONTINUE 2757 2758 hw0 = z 2759 2760 ! 2.1 - WAPE and mean forcing computation 2761 ! ------------------------------------------------------------- 2762 2763 ! Means 2764 2765 av_thu = sum_thu/hw0 2766 av_tu = sum_tu/hw0 2767 av_qu = sum_qu/hw0 2768 av_thvu = sum_thvu/hw0 2769 av_dth = sum_dth/hw0 2770 av_dq = sum_dq/hw0 2771 av_rho = sum_rho/hw0 2772 av_dtdwn = sum_dtdwn/hw0 2773 av_dqdwn = sum_dqdwn/hw0 2774 2775 wape2 = -rg*hw0*(av_dth+eps*(av_thu*av_dq+av_dth*av_qu+av_dth*av_dq))/ & 2776 av_thvu 2777 2778 2779 ! 2.2 Prognostic variable update 2780 ! ------------------------------------------------------------ 2781 2782 ! Filter out bad wakes 2783 2784 IF (wape2<0.) THEN 2785 IF (prt_level>=10) PRINT *, 'wape2<0' 2786 wape2 = 0. 2787 hw = hwmin 2788 sigmaw = max(sigmad, sigd_con) 2789 fip = 0. 2790 DO k = 1, klev 2791 deltatw(k) = 0. 2792 deltaqw(k) = 0. 2793 dth(k) = 0. 2794 END DO 2795 ELSE 2796 IF (prt_level>=10) PRINT *, 'wape2>0' 2797 cstar2 = stark*sqrt(2.*wape2) 2798 2799 END IF 2800 2801 ktopw = ktop 2802 2803 IF (ktopw>0) THEN 2804 2805 ! jyg1 Utilisation d'un h_efficace constant ( ~ feeding layer) 2806 ! cc heff = 600. 2807 ! Utilisation de la hauteur hw 2808 ! c heff = 0.7*hw 2809 heff = hw 2810 2811 fip = 0.5*rho(ktopw)*cstar2**3*heff*2*sqrt(sigmaw*wdens*3.14) 2812 fip = alpk*fip 2813 ! jyg2 2814 ELSE 2815 fip = 0. 2816 END IF 2817 2818 2819 ! Limitation de sigmaw 2820 2821 ! sécurité : si le wake occuppe plus de 90 % de la surface de la maille, 2822 ! alors il disparait en se mélangeant à la partie undisturbed 2823 2824 ! correction NICOLAS . ((wape.ge.wape2).and.(wape2.le.1.0))) THEN 2825 IF ((sigmaw>0.9) .OR. ((wape>=wape2) .AND. (wape2<= & 2826 1.0)) .OR. (ktopw<=2)) THEN 2827 ! IM cf NR/JYG 251108 . ((wape.ge.wape2).and.(wape2.le.1.0))) THEN 2828 ! IF (sigmaw.GT.0.9) THEN 2829 DO k = 1, klev 2830 dtls(k) = 0. 2831 dqls(k) = 0. 2832 deltatw(k) = 0. 2833 deltaqw(k) = 0. 2834 END DO 2835 wape = 0. 2836 hw = hwmin 2837 sigmaw = sigmad 2838 fip = 0. 2839 END IF 2840 2841 RETURN 2842 END SUBROUTINE wake_scal 2843 2844 2845 1822
Note: See TracChangeset
for help on using the changeset viewer.