Index: palm/trunk/DOC/app/chapter_4.1.html
===================================================================
--- palm/trunk/DOC/app/chapter_4.1.html	(revision 5)
+++ palm/trunk/DOC/app/chapter_4.1.html	(revision 40)
@@ -1786,5 +1786,5 @@
 
 
-      <td style="vertical-align: top;"><span style="font-style: italic;">'neumann'</span></td>
+      <td style="vertical-align: top;"><span style="font-style: italic;">'initial gradient'</span></td>
 
 
@@ -1831,12 +1831,11 @@
       
       <p>Allowed are the values <span style="font-style: italic;">'dirichlet'
-      </span>(pt(k=nz) and pt(k=nz+1)
-do not change during the run) and <span style="font-style: italic;">'neumann'</span>.
-With the Neumann boundary
-condition the value of the temperature gradient at the top is
+      </span>(pt(k=nz+1)
+does not change during the run), <span style="font-style: italic;">'neumann'</span> (pt(k=nz+1)=pt(k=nz)), and <span style="font-style: italic;">'initial_gradient'</span>.
+With the 'initial_gradient'-condition the value of the temperature gradient at the top is
 calculated from the initial
 temperature profile (see <a href="#pt_surface">pt_surface</a>, <a href="#pt_vertical_gradient">pt_vertical_gradient</a>)
-by bc_pt_t_val = (pt_init(k=nz) -
-pt_init(k=nz-1)) / dzu(nz).<br>
+by bc_pt_t_val = (pt_init(k=nz+1) -
+pt_init(k=nz)) / dzu(nz+1).<br>
 
 
@@ -1871,69 +1870,26 @@
       
       
-      <ul>
-
-
-
-
-
-
-
-
-
-
-        
-        
-        
-        
-        
-        
-        
-        
-        
-        
-        <p style="font-style: normal;">pt(k=nz) = pt(k=nz-1) +
-bc_pt_t_val * dzu(nz)</p>
-
-
-
-
-
-
-
-
-
-
-      
-      
-      
-      
-      
-      
-      
-      
-      
-      
-      </ul>
-
-
-
-
-
-
-
-
-
-
-      
-      
-      
-      
-      
-      
-      
-      
-      
-      
-      <p style="font-style: normal;">and&nbsp; </p>
+      
+
+
+
+
+
+
+
+
+
+
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
 
 
@@ -2020,6 +1976,19 @@
       
       
-      <p style="font-style: normal;">(up to k=nz-1 the prognostic
-equation for the temperature is solved).</p>
+      <p style="font-style: normal;">(up to k=nz the prognostic
+equation for the temperature is solved).<br>
+
+
+
+
+
+
+
+
+
+
+When a constant sensible heat flux is used at the top boundary (<a href="chapter_4.1.html#top_heatflux">top_heatflux</a>), <b>bc_pt_t</b> = <span style="font-style: italic;">'neumann'</span>
+must be used, because otherwise the resolved scale may contribute to
+the top flux so that a constant value cannot be guaranteed.</p>
 
 
@@ -2345,69 +2314,26 @@
       
       
-      <ul>
-
-
-
-
-
-
-
-
-
-
-        
-        
-        
-        
-        
-        
-        
-        
-        
-        
-        <p style="font-style: normal;">q(k=nz) = q(k=nz-1) +
-bc_q_t_val * dzu(nz)</p>
-
-
-
-
-
-
-
-
-
-
-      
-      
-      
-      
-      
-      
-      
-      
-      
-      
-      </ul>
-
-
-
-
-
-
-
-
-
-
-      
-      
-      
-      
-      
-      
-      
-      
-      
-      
-      <p style="font-style: normal;">and&nbsp; </p>
+      
+
+
+
+
+
+
+
+
+
+
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
 
 
@@ -2494,5 +2420,5 @@
       
       
-      <p style="font-style: normal;">(up tp k=nz-1 the prognostic
+      <p style="font-style: normal;">(up tp k=nz the prognostic
 equation for q is solved). </p>
 
@@ -2819,69 +2745,26 @@
       
       
-      <ul>
-
-
-
-
-
-
-
-
-
-
-        
-        
-        
-        
-        
-        
-        
-        
-        
-        
-        <p style="font-style: normal;">s(k=nz) = s(k=nz-1) +
-bc_s_t_val * dzu(nz)</p>
-
-
-
-
-
-
-
-
-
-
-      
-      
-      
-      
-      
-      
-      
-      
-      
-      
-      </ul>
-
-
-
-
-
-
-
-
-
-
-      
-      
-      
-      
-      
-      
-      
-      
-      
-      
-      <p style="font-style: normal;">and&nbsp; </p>
+      
+
+
+
+
+
+
+
+
+
+
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
 
 
@@ -2968,5 +2851,5 @@
       
       
-      <p style="font-style: normal;">(up to k=nz-1 the prognostic
+      <p style="font-style: normal;">(up to k=nz the prognostic
 equation for the scalar concentration is
 solved).</p>
@@ -14687,5 +14570,5 @@
 logarithmic wind and temperature
 profiles between k=0 and k=1. In this case a Dirichlet condition (see <a href="#bc_pt_b">bc_pt_b</a>)
-must be used as bottom boundary condition for the potential temperature.</p>
+must be used as bottom boundary condition for the potential temperature.</p><p>See also <a href="#top_heatflux">top_heatflux</a>.</p>
 
 
@@ -16807,5 +16690,59 @@
 
 
-    <tr>
+    <tr><td style="vertical-align: top;"><a name="top_heatflux"></a><span style="font-weight: bold;">top_heatflux</span></td><td style="vertical-align: top;">R</td><td style="vertical-align: top;"><span style="font-style: italic;">no prescribed<br>
+heatflux</span></td><td style="vertical-align: top;"><p>Kinematic sensible heat flux at the top boundary (in K m/s).&nbsp; </p>
+
+
+
+
+
+
+
+
+
+
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      <p>If a value is assigned to this parameter, the internal two-dimensional surface heat flux field <span style="font-family: monospace;">tswst</span> is initialized with the value of <span style="font-weight: bold;">top_heatflux</span>&nbsp;as top (horizontally homogeneous) boundary condition for the
+temperature equation. This additionally requires that a Neumann
+condition must be used for the potential temperature (see <a href="chapter_4.1.html#bc_pt_t">bc_pt_t</a>),
+because otherwise the resolved scale may contribute to
+the top flux so that a constant value cannot be guaranteed.<span style="font-style: italic;"></span>&nbsp;</p>
+
+
+
+      
+      
+      
+      <p><span style="font-weight: bold;">Note:</span><br>The application of a top heat flux additionally requires the setting of initial parameter <a href="#use_top_fluxes">use_top_fluxes</a> = .T..<span style="font-style: italic;"></span><span style="font-weight: bold;"></span> </p><p>No Prandtl-layer is available at the top boundary so far.</p><p>See also <a href="#surface_heatflux">surface_heatflux</a>.</p>
+
+
+
+
+
+
+
+
+
+
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      </td></tr><tr>
 
 
@@ -18336,5 +18273,71 @@
 
 
-    <tr>
+    <tr><td style="vertical-align: top;"><a name="use_top_fluxes"></a><span style="font-weight: bold;">use_top_fluxes</span></td><td style="vertical-align: top;">L</td><td style="vertical-align: top;"><span style="font-style: italic;">.F.</span></td><td style="vertical-align: top;">
+
+
+
+
+
+
+
+
+
+
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+
+
+
+
+
+
+
+
+
+
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+
+
+
+
+
+
+
+
+
+
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      <p>Parameter to steer the treatment of the subgrid-scale vertical
+fluxes within the diffusion terms at k=nz (top boundary).</p><p>By default, the fluxes at nz are calculated using the gradient approach. If <b>use_top_fluxes</b>
+= <i>.TRUE.</i>, the user-assigned top fluxes are used instead
+(see <a href="chapter_4.1.html#top_heatflux">top_heatflux</a>).</p><p>Currently, only a value for the sensible heatflux can be assigned. In case of <span style="font-weight: bold;">use_top_fluxes</span> = <span style="font-style: italic;">.TRUE.</span>, the latent heat flux at the top will be automatically set to zero.</p></td></tr><tr>
 
 
