Index: palm/trunk/DOC/app/chapter_3.5.4.html
===================================================================
--- palm/trunk/DOC/app/chapter_3.5.4.html	(revision 88)
+++ palm/trunk/DOC/app/chapter_3.5.4.html	(revision 116)
@@ -16,12 +16,43 @@
 section or 3d volume data. The respective subroutines
 contain sample code lines (written as comment lines) for defining, calculating and
-output of such quantities.<br><br>The
+output of such quantities.<br><br>Output times, averaging intervals, etc. are steered by the same variables as used for the standard PALM output quantities, e.g. <a href="chapter_4.2.html#dt_data_output">dt_data_output</a>.<br><br>The
 rest of this chapter explains step-by-step how to modify/extend the
-default file user_interface.f90 in order to generate the respective output.<br><br><br><h4>Output of vertical profiles</h4><br><br><h4><span style="font-weight: bold;">Output of 2d cross sections or 3d volume data</span></h4><br>This example shows the output of the
+default file user_interface.f90 in order to generate the respective output.<br><br><br><h4>Output of vertical profiles</h4>This example shows the output of the
+quantity "turbulent resolved-scale horizontal momentum flux" (u*v*). If more than one user-defined
+quantity shall be output, the following steps have to be carried out in the
+same way for each of the quantities.<br><br><ol><li>The
+quantity has to be given a unique string identifier, e.g. <span style="font-style: italic;">'u*v*'</span>.
+This identifier must be different from the identifiers used for the
+PALM standard output (see list in description of parameter <a href="chapter_4.2.html#data_output_pr">data_output_pr</a>).
+To switch on output of this quantity, the user has to assign the string
+identifier to the parameter <a href="chapter_4.3.html#data_output_pr_user">data_output_pr_user</a>,
+eg.:<br><br><span style="font-family: monospace;">&nbsp;
+&nbsp; data_output_pr_user</span> = <span style="font-style: italic;">'u*v*'</span>,<span style="font-style: italic;"></span><span style="font-style: italic;"></span><span style="font-style: italic;"></span><span style="font-style: italic;"></span><span style="font-style: italic;"></span><span style="font-style: italic;"></span><br><br></li><li>For
+the
+quantity, an identification number, a physical unit, and the vertical
+grid on which it is defined (u- or w-grid), has to be assigned (subroutine <a href="chapter_3.5.1.html#user_check_data_output_pr"><span style="font-family: monospace;">user_check_data_output_pr</span></a>):<span style="font-family: monospace;"><br><br>&nbsp; &nbsp; CASE (
+'u*v*' )<br></span><span style="font-family: monospace;">&nbsp; &nbsp; &nbsp; &nbsp;index = pr_palm + <span style="color: rgb(255, 0, 0);">1<span style="color: rgb(0, 0, 0);">
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
+&nbsp; &nbsp; ! identification number</span></span><br>&nbsp; &nbsp; &nbsp; &nbsp;dopr_index(var_count) = index<br>&nbsp; &nbsp; &nbsp;&nbsp; dopr_unit(var_count) &nbsp;= '<span style="color: rgb(255, 0, 0);">m2/s2</span>'
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ! physical unit<br>&nbsp; &nbsp; &nbsp; &nbsp;hom(:,2,index,:) &nbsp; &nbsp; &nbsp;= SPREAD( <span style="color: rgb(255, 0, 0);">zu</span>, 2, statistic_regions+1 ) &nbsp; &nbsp;! vertical grid<br></span><br>Here only the those parts in <span style="color: rgb(255, 0, 0);">red</span> color have to be given by the user appropriately.<br>The identification number (<span style="font-family: Courier New,Courier,monospace;">index</span>) must be within the range [<span style="font-family: Courier New,Courier,monospace;"> pr_palm+1 , pr_palm+max_pr_user</span> ], where <span style="font-family: Courier New,Courier,monospace;">max_pr_user</span> is the number of&nbsp;user-defined profiles as given by parameter <a href="chapter_4.3.html#data_output_pr_user">data_output_pr_user</a> in the respective PALM run.&nbsp;The physical unit has to be given with respect to the NetCDF conventions. If no unit is given,
+PALM will abort. The vertical grid has to be either <span style="font-family: Courier New,Courier,monospace;">zu</span> (u-grid) or <span style="font-family: Courier New,Courier,monospace;">zw</span> (w-grid).<br><br></li><li>The quantity has to be calculated for all gridpoints (subroutine <a href="chapter_3.5.1.html#user_statistics">user_statistics</a>):<br><br><span style="font-family: monospace;">&nbsp; &nbsp; !$OMP DO</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; DO&nbsp; i = nxl, nxr</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DO&nbsp; j = nys, nyn</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DO&nbsp; k = nzb_s_outer(j,i)+1, nzt</span><br style="font-family: monospace;"><span style="font-family: monospace;"></span><span style="font-family: monospace;"></span><span style="font-family: monospace;"></span><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sums_l(k,pr_palm+<span style="color: rgb(255, 0, 0);">1</span>,tn) = sums_l(k,pr_palm+<span style="color: rgb(255, 0, 0);">1</span>,tn) +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &amp;</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(255, 0, 0);">( 0.5 * ( u(k,j,i) + u(k,j,i+1) ) - hom(k,1,1,sr) ) * &amp;</span></span><br style="font-family: monospace; color: rgb(255, 0, 0);"><span style="font-family: monospace; color: rgb(255, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+( 0.5 * ( v(k,j,i) + v(k,j+1,i) ) - hom(k,1,2,sr) ) * &amp;</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+* rmask(j,i,sr)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ENDDO<br>&nbsp; &nbsp; &nbsp; &nbsp;ENDDO<br>&nbsp; &nbsp; ENDDO<br></span><br style="font-family: monospace;">Once again, only those parts in <span style="color: rgb(255, 0, 0);">red</span> have to be adjusted by the user.<br>The
+turbulent resolved-scale momentum flux u*v* is defined as the product
+of the deviations of the horizontal velocities from their respective
+horizontally averaged mean values. These mean values are stored in
+array <span style="font-family: Courier New,Courier,monospace;">hom(..,1,1,sr)</span> and <span style="font-family: Courier New,Courier,monospace;">hom(..,1,2,sr)</span> for the u- and v-component, respectively. Since due to the staggered grid, <span style="font-family: Courier New,Courier,monospace;">u</span> and <span style="font-family: Courier New,Courier,monospace;">v</span>
+are not defined at the same gridpoints, they have to be interpolated
+appropriately (here to the center of the gridbox). The result of the
+calculation is stored in array <span style="font-family: Courier New,Courier,monospace;">sums_l</span>.
+The second index of this array is the identification number of the
+profile which must match the one given in the previous step 2.</li></ol><br><h4>Output of timeseries</h4>still to be added<br>&nbsp;<br><h4><span style="font-weight: bold;">Output of 2d cross sections or 3d volume data</span></h4><br>This example shows the output of the
 quantity "square of the u-component" (<span style="font-weight: bold;">Note:</span> this quantity
 could of course easily be calculated from the u-component by
 postprocessing the PALM output so that calculation within PALM is not
 necessarily required). If more than one user-defined
-quantity shall be output, these steps have to be carried out in the
+quantity shall be output, the following steps have to be carried out in the
 same way for each of the quantities.<br><br><ol><li>The
 quantity has to be given a unique string identifier, e.g. <span style="font-style: italic;">'u2'</span>.
