Ignore:
Timestamp:
Jan 4, 2008 4:29:45 AM (17 years ago)
Author:
letzel
Message:

User-defined spectra.

Bugfix: extra '*' removed in user_statistics sample code (user_interface).

File:
1 edited

Legend:

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

    r136 r144  
    1313quantities which are not part of PALM's standard output. The basic user
    1414interface includes a number of subroutines which allow the calculation
    15 of user-defined quantities and output of these quantities as 1. (horizontally averaged) <a href="#vertical_profiles">vertical profiles</a>, 2.&nbsp;<a href="#time_series">time series</a>, 3. <a href="#2D_and_3D">2d cross
    16 section</a> or <a href="#2D_and_3D">3d volume data</a> and 4. <a href="#dvrp">dvrp</a> objects. The respective subroutines
    17 contain sample code lines (written as comment lines) for defining, calculating and
    18 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
    19 rest 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><a name="vertical_profiles"></a>1. Output of vertical profiles</h4>This example shows the output of the
    21 quantity "turbulent resolved-scale horizontal momentum flux" (u*v*). If more than one user-defined
    22 quantity shall be output, the following steps have to be carried out in the
     15of user-defined quantities and output of these quantities as 1.
     16(horizontally averaged) <a href="#vertical_profiles">vertical
     17profiles</a>, 2.&nbsp;<a href="#time_series">time
     18series</a>, 3. <a href="#2D_and_3D">2d cross
     19section</a> or <a href="#2D_and_3D">3d volume data</a>,
     204. <a href="#dvrp">dvrp</a> objects, and 5. <a href="#spectra">spectra</a>. The respective
     21subroutines
     22contain sample code lines (written as comment lines) for defining,
     23calculating and
     24output of such quantities.<br><br>Output times, averaging
     25intervals, etc. are steered by the same variables as used for the
     26standard PALM output quantities, e.g. <a href="chapter_4.2.html#dt_data_output">dt_data_output</a>.<br><br>The
     27following five parts of&nbsp;this chapter explains step-by-step how
     28to modify/extend the
     29default file user_interface.f90 in order to generate the respective
     30output:<br><ol><li>(horizontally averaged) <a href="chapter_3.5.4.html#vertical_profiles">vertical profiles</a>,&nbsp;</li><li><a href="chapter_3.5.4.html#time_series">time series</a>,&nbsp;</li><li><a href="chapter_3.5.4.html#2D_and_3D">2d cross
     31section</a> or <a href="chapter_3.5.4.html#2D_and_3D">3d
     32volume data</a>,&nbsp;</li><li><a href="chapter_3.5.4.html#dvrp">dvrp</a> objects,
     33and&nbsp;</li><li><a href="chapter_3.5.4.html#spectra">spectra</a>.</li></ol><br><h4><a name="vertical_profiles"></a>1. Output of user-defined
     34vertical profiles</h4>This example shows the output of the
     35quantity "turbulent resolved-scale horizontal momentum flux" (u*v*). If
     36more than one user-defined
     37quantity shall be output, the following steps have to be carried out in
     38the
    2339same way for each of the quantities.<br><br><ol><li>The
    2440quantity has to be given a unique string identifier, e.g. <span style="font-style: italic;">'u*v*'</span>.
     
    3147the
    3248quantity, an identification number, a physical unit, and the vertical
    33 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 (
    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,
    40 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;
    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
     49grid on which it is defined (u- or w-grid), has to be assigned
     50(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;
     51&nbsp; CASE (
     52'u*v*' )<br></span><span style="font-family: monospace;">&nbsp;
     53&nbsp; &nbsp; &nbsp;index = pr_palm + <span style="color: rgb(255, 0, 0);">1<span style="color: rgb(0, 0, 0);">
     54&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
     55&nbsp; &nbsp; &nbsp; &nbsp;
     56&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
     57&nbsp; &nbsp; &nbsp; &nbsp;
     58&nbsp; &nbsp; ! identification number</span></span><br>&nbsp;
     59&nbsp; &nbsp; &nbsp;dopr_index(var_count) = index<br>&nbsp;
     60&nbsp; &nbsp;&nbsp; dopr_unit(var_count) &nbsp;= '<span style="color: rgb(255, 0, 0);">m2/s2</span>'
     61&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
     62&nbsp; &nbsp; &nbsp; &nbsp;
     63&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; !
     64physical unit<br>&nbsp; &nbsp; &nbsp;
     65&nbsp;hom(:,2,index,:) &nbsp; &nbsp; &nbsp;= SPREAD( <span style="color: rgb(255, 0, 0);">zu</span>, 2,
     66statistic_regions+1 ) &nbsp; &nbsp;! vertical grid<br></span><br>Here
     67only the those parts in <span style="color: rgb(255, 0, 0);">red</span>
     68color have to be given by the user appropriately.<br>The
     69identification number (<span style="font-family: Courier New,Courier,monospace;">index</span>)
     70must be within the range [<span style="font-family: Courier New,Courier,monospace;">
     71pr_palm+1 , pr_palm+max_pr_user</span> ], where <span style="font-family: Courier New,Courier,monospace;">max_pr_user</span>
     72is 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>
     73in the respective PALM run.&nbsp;The physical unit has to be given
     74with respect to the NetCDF conventions. If no unit is given,
     75PALM will abort. The vertical grid has to be either <span style="font-family: Courier New,Courier,monospace;">zu</span>
     76(u-grid) or <span style="font-family: Courier New,Courier,monospace;">zw</span>
     77(w-grid).<br><br></li><li>The quantity has to
     78be 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
     79DO</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;
     80DO&nbsp; i = nxl, nxr</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     81DO&nbsp; j = nys, nyn</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     82DO&nbsp; k = nzb_s_inner(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;
     83sums_l(k,pr_palm+<span style="color: rgb(255, 0, 0);">1</span>,tn)
     84= sums_l(k,pr_palm+<span style="color: rgb(255, 0, 0);">1</span>,tn)
     85+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     86&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;
     87<span style="color: rgb(255, 0, 0);">( 0.5 * ( u(k,j,i) +
     88u(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;
     89( 0.5 * ( v(k,j,i) + v(k,j+1,i) ) - hom(k,1,2,sr) ) &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;&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;
     90* rmask(j,i,sr)<br>&nbsp; &nbsp; &nbsp; &nbsp;
     91&nbsp; ENDDO<br>&nbsp; &nbsp; &nbsp;
     92&nbsp;ENDDO<br>&nbsp; &nbsp; ENDDO<br></span><br style="font-family: monospace;">Once again, only those parts
     93in <span style="color: rgb(255, 0, 0);">red</span>
     94have to be adjusted by the user.<br>The
    4395turbulent resolved-scale momentum flux u*v* is defined as the product
    4496of the deviations of the horizontal velocities from their respective
    4597horizontally averaged mean values. These mean values are stored in
    46 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>
     98array <span style="font-family: Courier New,Courier,monospace;">hom(..,1,1,sr)</span>
     99and <span style="font-family: Courier New,Courier,monospace;">hom(..,1,2,sr)</span>
     100for the u- and v-component, respectively. Since due to the staggered
     101grid, <span style="font-family: Courier New,Courier,monospace;">u</span>
     102and <span style="font-family: Courier New,Courier,monospace;">v</span>
    47103are not defined at the same gridpoints, they have to be interpolated
    48104appropriately (here to the center of the gridbox). The result of the
    49105calculation is stored in array <span style="font-family: Courier New,Courier,monospace;">sums_l</span>.
    50106The second index of this array is the identification number of the
    51 profile which must match the one given in the previous step 2.</li></ol><br><h4><a name="time_series"></a>2. Output of timeseries</h4>This example shows the output of  two time series for the absolut extremal values of the horizontal velocities <span style="font-style: italic;">u</span> and <span style="font-style: italic;">v</span>. If more than one user-defined
    52 quantity shall be output, the following steps have to be carried out in the
    53 same way for each of the quantities.<br><br><ol><li>For each time series quantity you have to give a label and a unit  (subroutine <a href="chapter_3.5.1.html#user_init">user_init</a>), which will be used for the NetCDF file. They must not contain more than seven characters. The value of <code>dots_num</code> has to be increased by the number of new time series quantities. Its old value has to be stored in <code>dots_num_palm</code>.<br><br><code>&nbsp;&nbsp;&nbsp; dots_label(dots_num<span style="color: rgb(255, 0, 0);">+1</span>) = '<span style="color: rgb(255, 0, 0);">abs_umx</span>'<br>&nbsp;&nbsp;&nbsp; dots_unit(dots_num<span style="color: rgb(255, 0, 0);">+1</span>)&nbsp; = '<span style="color: rgb(255, 0, 0);">m/s</span>'<br>&nbsp;&nbsp;&nbsp; dots_label(dots_num<span style="color: rgb(255, 0, 0);">+2</span>) = '<span style="color: rgb(255, 0, 0);">abs_vmx</span>'<br>&nbsp;&nbsp;&nbsp; dots_unit(dots_num<span style="color: rgb(255, 0, 0);">+2</span>)&nbsp; = '<span style="color: rgb(255, 0, 0);">m/s</span>'<br><br>&nbsp;&nbsp;&nbsp; dots_num_palm = dots_num<br>&nbsp;&nbsp;&nbsp; dots_num = dots_num <span style="color: rgb(255, 0, 0);">+ 2</span><br><br></code>Only those parts in <span style="color: rgb(255, 0, 0);">red</span> have to be adjusted by the user.<br><br></li><li>These quantities are&nbsp;calculated and output in subroutine <a href="chapter_3.5.1.html#user_statistics">user_statistics</a> for every statistic region <code>sr</code> defined by the user,&nbsp;but at least for the region <span style="font-style: italic;">"total domain"</span>:<br>&nbsp;<br><code>&nbsp;&nbsp;&nbsp; ts_value(dots_num_palm+1,sr) = ABS( u_max )<br>&nbsp;&nbsp;&nbsp; ts_value(dots_num_palm+2,sr) = ABS( v_max )<br></code></li></ol>&nbsp;<br><h4><span style="font-weight: bold;"><a name="2D_and_3D"></a>3. Output of 2d cross sections or 3d volume data</span></h4><br>This example shows the output of the
     107profile which must match the one given in the previous step 2.</li></ol><br><h4><a name="time_series"></a>2. Output of user-defined
     108timeseries</h4>This example shows the output of two time series
     109for the absolut extremal values of the horizontal velocities <span style="font-style: italic;">u</span> and <span style="font-style: italic;">v</span>. If more than one
     110user-defined
     111quantity shall be output, the following steps have to be carried out in
     112the
     113same way for each of the quantities.<br><br><ol><li>For
     114each time series quantity you have to give a label and a unit
     115(subroutine <a href="chapter_3.5.1.html#user_init">user_init</a>),
     116which will be used for the NetCDF file. They must not contain more than
     117seven characters. The value of <code>dots_num</code> has
     118to be increased by the number of new time series quantities. Its old
     119value has to be stored in <code>dots_num_palm</code>.<br><br><code>&nbsp;&nbsp;&nbsp;
     120dots_label(dots_num<span style="color: rgb(255, 0, 0);">+1</span>)
     121= '<span style="color: rgb(255, 0, 0);">abs_umx</span>'<br>&nbsp;&nbsp;&nbsp;
     122dots_unit(dots_num<span style="color: rgb(255, 0, 0);">+1</span>)&nbsp;
     123= '<span style="color: rgb(255, 0, 0);">m/s</span>'<br>&nbsp;&nbsp;&nbsp;
     124dots_label(dots_num<span style="color: rgb(255, 0, 0);">+2</span>)
     125= '<span style="color: rgb(255, 0, 0);">abs_vmx</span>'<br>&nbsp;&nbsp;&nbsp;
     126dots_unit(dots_num<span style="color: rgb(255, 0, 0);">+2</span>)&nbsp;
     127= '<span style="color: rgb(255, 0, 0);">m/s</span>'<br><br>&nbsp;&nbsp;&nbsp;
     128dots_num_palm = dots_num<br>&nbsp;&nbsp;&nbsp;
     129dots_num = dots_num <span style="color: rgb(255, 0, 0);">+
     1302</span><br><br></code>Only those parts in <span style="color: rgb(255, 0, 0);">red</span> have to be
     131adjusted by the user.<br><br></li><li>These
     132quantities are&nbsp;calculated and output in subroutine <a href="chapter_3.5.1.html#user_statistics">user_statistics</a>
     133for every statistic region <code>sr</code> defined by the
     134user,&nbsp;but at least for the region <span style="font-style: italic;">"total domain"</span>:<br>&nbsp;<br><code>&nbsp;&nbsp;&nbsp;
     135ts_value(dots_num_palm+1,sr) = ABS( u_max )<br>&nbsp;&nbsp;&nbsp;
     136ts_value(dots_num_palm+2,sr) = ABS( v_max )<br></code></li></ol>&nbsp;<br><h4><span style="font-weight: bold;"><a name="2D_and_3D"></a>3.
     137Output of user-defined 2d cross sections or 3d volume data</span></h4><br>This
     138example shows the output of the
    54139quantity "square of the u-component" (<span style="font-weight: bold;">Note:</span> this quantity
    55140could of course easily be calculated from the u-component by
    56141postprocessing the PALM output so that calculation within PALM is not
    57142necessarily required). If more than one user-defined
    58 quantity shall be output, the following steps have to be carried out in the
     143quantity shall be output, the following steps have to be carried out in
     144the
    59145same way for each of the quantities.<br><br><ol><li>The
    60146quantity has to be given a unique string identifier, e.g. <span style="font-style: italic;">'u2'</span>.
     
    220306';&nbsp; WRITE ( 14 )&nbsp; u2_av</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;
    221307ENDIF</span><br><br>Otherwise, the calculated
    222 time-average may be wrong.</li></ol><br><h4><a name="dvrp"></a>4. Output of DVRP objects</h4>This example shows the output of the
    223 quantity "square of the u-component", <span style="font-style: italic;">u<sup>2</sup></span>. If more than one user-defined
    224 quantity shall be output, the following steps have to be carried out in the
    225 same way for each of the quantities. First,&nbsp;steps 1 - 6 of <a href="chapter_3.5.4.html#2D_and_3D">2d cross
    226 section</a> or <a href="chapter_3.5.4.html#2D_and_3D">3d volume data</a> are required. Second,&nbsp;the gridpoint data of the quantity has to
     308time-average may be wrong.</li></ol><br><h4><a name="dvrp"></a>4. Output of user-defined DVRP objects</h4>This
     309example shows the output of the
     310quantity "square of the u-component", <span style="font-style: italic;">u<sup>2</sup></span>.
     311If more than one user-defined
     312quantity shall be output, the following steps have to be carried out in
     313the
     314same way for each of the quantities. First,&nbsp;steps 1 - 6
     315of&nbsp;<a href="chapter_3.5.4.html#2D_and_3D"><span style="font-weight: bold;">part 3.</span> </a> <a href="chapter_3.5.4.html#2D_and_3D">(2d cross
     316section or </a><a href="chapter_3.5.4.html#2D_and_3D">3d
     317volume data)</a> are required. Second,&nbsp;the gridpoint
     318data
     319of the quantity has to
    227320be resorted to array <span style="font-family: monospace;">local_pf</span>
    228 in subroutine <a href="chapter_3.5.1.html#user_data_output_dvrp"><span style="font-family: monospace;">user_data_output_dvrp</span></a> as follows:<br><br><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CASE ( '<span style="color: rgb(255, 0, 0);">u2</span>', '<span style="color: rgb(255, 0, 0);">u2</span>_xy', '<span style="color: rgb(255, 0, 0);">u2</span>_xz', '<span style="color: rgb(255, 0, 0);">u2</span>_yz'&nbsp; )<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DO&nbsp; i = nxl, nxr+1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DO&nbsp; j = nys, nyn+1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DO&nbsp; k = nzb, nz_do3d<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; local_pf(i,j,k) = <span style="color: rgb(255, 0, 0);">u2</span>(k,j,i)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ENDDO<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ENDDO<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ENDDO</code><br><br>Only those parts in <span style="color: rgb(255, 0, 0);">red</span> have to be adjusted by the user.<br><br>After performing these steps, the user-defined quantity <code>'u2'</code> can be selected like standard model quantities by the <a href="chapter_4.2.html#dvrp_graphics">dvrp_graphics</a> package parameter <a href="chapter_4.2.html#mode_dvrp">mode_dvrp</a>.<hr>
    229 <p style="line-height: 100%;"><br><font color="#000080"><font color="#000080"><a href="chapter_3.5.3.html"><font color="#000080"><img src="left.gif" name="Grafik1" align="bottom" border="2" height="32" width="32"></font></a><a href="index.html"><font color="#000080"><img src="up.gif" name="Grafik2" align="bottom" border="2" height="32" width="32"></font></a><a href="chapter_3.5.5.html"><font color="#000080"><img style="border: 2px solid ; width: 32px; height: 32px;" alt="" src="right.gif" name="Grafik3"></font></a></font></font></p>
    230 <p style="line-height: 100%;"><i>Last
    231 change:&nbsp;</i> $Id$</p>
     321in subroutine <a href="chapter_3.5.1.html#user_data_output_dvrp"><span style="font-family: monospace;">user_data_output_dvrp</span></a>
     322as follows:<br><br><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     323CASE ( '<span style="color: rgb(255, 0, 0);">u2</span>',
     324'<span style="color: rgb(255, 0, 0);">u2</span>_xy',
     325'<span style="color: rgb(255, 0, 0);">u2</span>_xz',
     326'<span style="color: rgb(255, 0, 0);">u2</span>_yz'&nbsp;
     327)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     328DO&nbsp; i = nxl, nxr+1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     329DO&nbsp; j = nys, nyn+1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     330DO&nbsp; k = nzb, nz_do3d<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     331local_pf(i,j,k) = <span style="color: rgb(255, 0, 0);">u2</span>(k,j,i)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     332ENDDO<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     333ENDDO<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     334ENDDO</code><br><br>Only those parts in <span style="color: rgb(255, 0, 0);">red</span> have to be
     335adjusted by the user.<br><br>After performing these steps,
     336the user-defined quantity <code>'u2'</code> can be
     337selected like standard model quantities by the <a href="chapter_4.2.html#dvrp_graphics">dvrp_graphics</a>
     338package parameter <a href="chapter_4.2.html#mode_dvrp">mode_dvrp</a>.<br><br><h4><a name="spectra"></a>5. Output of user-defined spectra</h4>This
     339example shows the output of the
     340quantity "turbulent resolved-scale horizontal momentum flux" (u*v*). If
     341more than one user-defined
     342quantity shall be output, the following steps have to be carried out in
     343the
     344same way for each of the quantities.<br><br><ol><li>The
     345calculation of user-defined spectra is closely linked with the
     346calculation of <a href="chapter_3.5.4.html#vertical_profiles"><span style="font-weight: bold;">part 1.</span>
     347(user-defined
     348</a><a href="chapter_3.5.4.html#vertical_profiles">vertical
     349profiles</a><a href="chapter_3.5.4.html#vertical_profiles">)</a><span style="font-weight: bold;"></span> and <a href="chapter_3.5.4.html#2D_and_3D"><span style="font-weight: bold;">part 3.</span> (user-defined</a><a href="chapter_3.5.4.html#2D_and_3D"> </a><a href="chapter_3.5.4.html#2D_and_3D">3d volume data</a><a href="chapter_3.5.4.html#2D_and_3D">)</a><span style="font-weight: bold;"></span>. Therefore, the
     350following prerequisites apply
     351for each user-defined
     352spectra quantity:</li></ol><ol style="list-style-type: upper-alpha;"><ol style="list-style-type: upper-alpha;"><li>From <a href="chapter_3.5.4.html#vertical_profiles"><span style="font-weight: bold;">part 1.</span>
     353(user-defined
     354</a><a href="chapter_3.5.4.html#vertical_profiles">vertical
     355profiles</a><a href="chapter_3.5.4.html#vertical_profiles">)</a>
     356steps 2 and 3. <br>See the sample code (as comment lines) for <span style="font-style: italic;">'u*v*'</span> and <code>ustvst</code>,
     357respectively. (Actual output of vertical profiles - step 1 - is not
     358required.)</li><li>From <a href="chapter_3.5.4.html#2D_and_3D"><span style="font-weight: bold;">part 3.</span> (user-defined</a><a href="chapter_3.5.4.html#2D_and_3D"> </a><a href="chapter_3.5.4.html#2D_and_3D">3d volume data</a><a href="chapter_3.5.4.html#2D_and_3D">)</a> steps 2, 3,
     3594, 5, and 6. <br>See the sample code (as comment lines) for <span style="font-style: italic;">'u*v*'</span> and <code>ustvst</code>,
     360respectively. (Actual output of 3d volume data - step 1 - is not
     361required.)</li><li>The quantity has to be given a unique
     362string identifier, e.g. <span style="font-style: italic;">'u*v*'</span>.
     363This identifier must be different from the identifiers used for the
     364PALM standard output (see list in description of package parameter <a href="chapter_4.2.html#data_output_sp">data_output_sp</a>).
     365To switch on output of this quantity, the user has to assign the string
     366identifier to the package parameter <a href="chapter_4.2.html#data_output_sp">data_output_sp</a>,
     367eg.:<br><br><span style="font-family: monospace;">&nbsp;
     368&nbsp; data_output_sp</span> =&nbsp; <span style="font-style: italic;">'u*v*'</span><br><br></li></ol>A.
     369and B. as prerequisites for C. require a naming convention of identical
     370identifiers, e.g. data_output_pr_user = 'u*v*', data_output_user =
     371'u*v*' and data_output_sp = 'u*v*'. This naming convention applies only
     372in case of user-defined spectra.</ol><ol start="2"><li>Edit
     373the subroutine <a href="chapter_3.5.1.html#user_spectra">user_spectra</a>
     374(only those parts in <span style="color: rgb(255, 0, 0);">red</span>)
     375as follows:<br><br><code>&nbsp;&nbsp;&nbsp;
     376IF ( mode == 'preprocess' )&nbsp; THEN<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     377SELECT CASE ( TRIM( data_output_sp(m) ) )<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     378<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     379CASE ( 'u', 'v', 'w', 'pt', 'q' )<br>!--&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     380Not allowed here since these are the standard quantities used in <br>!--&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     381preprocess_spectra.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     382<br><span style="color: rgb(255, 0, 0); background-color: rgb(255, 255, 255);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     383CASE ( 'u*v*' )</span><br style="color: rgb(255, 0, 0); background-color: rgb(255, 255, 255);"><span style="color: rgb(255, 0, 0); background-color: rgb(255, 255, 255);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     384pr = pr_palm+1</span><br style="color: rgb(255, 0, 0); background-color: rgb(255, 255, 255);"><span style="color: rgb(255, 0, 0); background-color: rgb(255, 255, 255);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     385d(nzb+1:nzt,nys:nyn,nxl:nxr) = ustvst(nzb+1:nzt,nys:nyn,nxl:nxr)</span><br style="color: rgb(255, 0, 0); background-color: rgb(255, 255, 255);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     386<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     387CASE DEFAULT<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     388PRINT*, '+++ user_spectra/preprocess: Spectra of ', &amp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     389TRIM( data_output_sp(m) ), ' can not be calculated'<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     390<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     391END SELECT<br><br>&nbsp;&nbsp;&nbsp; ELSEIF (
     392mode == 'data_output' )&nbsp; THEN<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     393SELECT CASE ( TRIM( data_output_sp(m) ) )<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     394CASE ( 'u', 'v', 'w', 'pt', 'q' )<br>!--&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     395Not allowed here since these are the standard quantities used in <br>!--&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     396data_output_spectra.<br><br><span style="color: rgb(255, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     397CASE ( 'u*v*' )</span><br style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     398pr = 6</span><br style="color: rgb(255, 0, 0);"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     399CASE DEFAULT<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     400PRINT*, '+++ user_spectra/data_output: Spectra of ', &amp;<br>&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;
     401TRIM( data_output_sp(m) ), ' are not defined'<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     402END SELECT<br><br>&nbsp;&nbsp;&nbsp; ENDIF</code><br></li></ol>Note
     403that spectra output is an <a href="chapter_3.7.html">optional
     404software package</a> (see <a href="chapter_3.7.html">chapter
     4053.7</a>). Therefore user-defined spectra also require the package
     406activation via <code>mrun - p spectra</code>.<hr>
     407<p style="line-height: 100%;"><br><font color="#000080"><font color="#000080"><a href="chapter_3.5.3.html"><font color="#000080"><img src="left.gif" name="Grafik1" align="bottom" border="2" height="32" width="32"></font></a><a href="index.html"><font color="#000080"><img src="up.gif" name="Grafik2" align="bottom" border="2" height="32" width="32"></font></a><a href="chapter_3.5.5.html"><font color="#000080"><img style="border: 2px solid ; width: 32px; height: 32px;" alt="" src="right.gif" name="Grafik3"></font></a></font></font></p><p style="line-height: 100%;"><i>Last
     408change:&nbsp;</i> $Id: chapter_3.5.4.html 136 2007-11-26
     40902:47:32Z letzel $</p>
    232410</body></html>
Note: See TracChangeset for help on using the changeset viewer.