Ignore:
Timestamp:
May 25, 2007 12:08:31 PM (17 years ago)
Author:
raasch
Message:

further changes concerning user-defined profiles

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/DOC/app/chapter_3.5.4.html

    r88 r89  
    1616section or 3d volume data. The respective subroutines
    1717contain sample code lines (written as comment lines) for defining, calculating and
    18 output of such quantities.<br><br>The
     18output 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
    1919rest of this chapter explains step-by-step how to modify/extend the
    20 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
     20default 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
     21quantity "turbulent resolved-scale horizontal momentum flux" (u*v*). If more than one user-defined
     22quantity shall be output, the following steps have to be carried out in the
     23same way for each of the quantities.<br><br><ol><li>The
     24quantity has to be given a unique string identifier, e.g. <span style="font-style: italic;">'u*v*'</span>.
     25This identifier must be different from the identifiers used for the
     26PALM standard output (see list in description of parameter <a href="chapter_4.2.html#data_output_pr">data_output_pr</a>).
     27To switch on output of this quantity, the user has to assign the string
     28identifier to the parameter <a href="chapter_4.3.html#data_output_pr_user">data_output_pr_user</a>,
     29eg.:<br><br><span style="font-family: monospace;">&nbsp;
     30&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
     31the
     32quantity, an identification number, a physical unit, and the vertical
     33grid 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 (
     34'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);">
     35&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
     36&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
     37&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>'
     38&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
     39&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,
     40PALM 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;
     41( 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;
     42* 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
     43turbulent resolved-scale momentum flux u*v* is defined as the product
     44of the deviations of the horizontal velocities from their respective
     45horizontally averaged mean values. These mean values are stored in
     46array <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>
     47are not defined at the same gridpoints, they have to be interpolated
     48appropriately (here to the center of the gridbox). The result of the
     49calculation is stored in array <span style="font-family: Courier New,Courier,monospace;">sums_l</span>.
     50The second index of this array is the identification number of the
     51profile 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
    2152quantity "square of the u-component" (<span style="font-weight: bold;">Note:</span> this quantity
    2253could of course easily be calculated from the u-component by
    2354postprocessing the PALM output so that calculation within PALM is not
    2455necessarily required). If more than one user-defined
    25 quantity shall be output, these steps have to be carried out in the
     56quantity shall be output, the following steps have to be carried out in the
    2657same way for each of the quantities.<br><br><ol><li>The
    2758quantity has to be given a unique string identifier, e.g. <span style="font-style: italic;">'u2'</span>.
Note: See TracChangeset for help on using the changeset viewer.