source: palm/trunk/DOC/app/chapter_3.5.4.html @ 130

Last change on this file since 130 was 130, checked in by letzel, 16 years ago

DVRP output modifications:

  • The user can now visualize user-defined quantities using dvrp.

data_output_dvrp calls the new user_interface subroutine
user_data_output_dvrp in case of unknown variables (CASE DEFAULT).

  • Two instead of one digit are allowed to specify isosurface and slicer

variables with the parameter mode_dvrp.

  • Property svn:keywords set to Id
File size: 33.7 KB
RevLine 
[5]1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2<html><head>
[129]3<meta http-equiv="CONTENT-TYPE" content="text/html; charset=windows-1252"><title>PALM chapter 3.5.4</title> <meta name="GENERATOR" content="StarOffice 7 (Win32)"> <meta name="AUTHOR" content="Siegfried Raasch"> <meta name="CREATED" content="20040802;14050943"> <meta name="CHANGED" content="20041117;12180008"> <meta name="KEYWORDS" content="parallel LES model"> <style>
[62]4<!--
5@page { size: 21cm 29.7cm }
6-->
7</style></head>
8<body style="direction: ltr;" lang="en-US"><h3 style="line-height: 100%;"><font size="4">3.5.4
9User-defined output quantities<br>
10</font></h3>A very typical request of users is the
11calculation and
[5]12output of
13quantities which are not part of PALM's standard output. The basic user
14interface includes a number of subroutines which allow the calculation
[130]15of 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
16section</a> or <a href="#2D_and_3D">3d volume data</a> and 4. <a href="#dvrp">dvrp</a> objects. The respective subroutines
[87]17contain sample code lines (written as comment lines) for defining, calculating and
[89]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
[87]19rest of this chapter explains step-by-step how to modify/extend the
[130]20default 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
[89]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
[130]51profile 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
[129]52quantity shall be output, the following steps have to be carried out in the
[130]53same 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
[87]54quantity "square of the u-component" (<span style="font-weight: bold;">Note:</span> this quantity
[5]55could of course easily be calculated from the u-component by
56postprocessing the PALM output so that calculation within PALM is not
[87]57necessarily required). If more than one user-defined
[89]58quantity shall be output, the following steps have to be carried out in the
[62]59same way for each of the quantities.<br><br><ol><li>The
60quantity has to be given a unique string identifier, e.g. <span style="font-style: italic;">'u2'</span>.
[5]61This identifier must be different from the identifiers used for the
[62]62PALM standard output (see list in description of parameter <a href="chapter_4.2.html#data_output">data_output</a>).
63To switch on output of this quantity, the user has to assign the string
64identifier to the parameter <a href="chapter_4.3.html#data_output_user">data_output_user</a>,
65eg.:<br><br><span style="font-family: monospace;">&nbsp;
66&nbsp; data_output_user</span> = <span style="font-style: italic;">'u2'</span>, <span style="font-style: italic;">&nbsp;'u2_xy_av'</span><br><br>The
67pure string <span style="font-style: italic;">'u2'</span>
[5]68switches on the output of instantaneous 3d volume data. Output of cross
69section data and time averaged data is switched on by additionally
[62]70appending the strings <span style="font-style: italic;">'_xy'</span>,
71<span style="font-style: italic;">'_xz'</span>, <span style="font-style: italic;">'_yz'</span>, and/or <span style="font-style: italic;">'_av'</span> (for a
72detailed explanation see parameter <a href="chapter_4.2.html#data_output">data_output</a>).<br><br></li><li>In
73order to store the quantities' grid point data within PALM, a 3d data
74array has to be declared in module <a href="chapter_3.5.1.html#user"><span style="font-family: monospace;">user</span></a>:<br><br><span style="font-family: monospace;">&nbsp; &nbsp; REAL,
75DIMENSION(:,:,:), ALLOCATABLE ::&nbsp; u2, u2_av</span><br><br>The
76second array <span style="font-family: monospace;">u2_av</span>
[5]77is needed in case that output of time averaged data is requested. It is
78used to store the sum of the data of the respective time levels over
[62]79which the average has to be carried out.<br><br><br></li><li>The
80data array has to be allocated in subroutine <a href="chapter_3.5.1.html#user_init"><span style="font-family: monospace;">user_init</span></a>:<br><br><span style="font-family: monospace;">&nbsp; &nbsp;
81ALLOCATE( u2(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) )</span><br><br>In
[5]82case that output of time averaged data is requested, the array
83containing the sum has possibly to be read from the restart file (local
[62]84filename <a href="chapter_3.4.html#BININ">BININ</a>)
85by executing the following code in <span style="font-family: monospace;">user_init</span>:<br><br><span style="font-family: monospace;">&nbsp;&nbsp;
86&nbsp;IF ( initializing_actions == 'read_restart_data' )&nbsp;
87THEN</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;
88&nbsp; READ ( 13 )&nbsp; field_chr</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;
89&nbsp; &nbsp;DO&nbsp; WHILE ( TRIM( field_chr ) /= '*** end
90user ***' )</span><br style="font-family: monospace;"><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
91&nbsp; &nbsp; SELECT CASE ( TRIM( field_chr ) )</span><br style="font-family: monospace;"><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
92&nbsp;&nbsp; &nbsp;&nbsp; CASE ( 'u2_av' )</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
93&nbsp;&nbsp; &nbsp; ALLOCATE(
94u2_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) )</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
95&nbsp;&nbsp; &nbsp; READ ( 13 )&nbsp; u2_av</span><br style="font-family: monospace;"><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;
96&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; CASE DEFAULT</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
97&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp; PRINT*,
98'+++ user_init: unknown
[5]99variable named "', &amp;</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
100&nbsp; &nbsp;&nbsp;
[62]101&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
102TRIM(
[5]103field_chr ), '" found in'</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
104&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; PRINT*,
105'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
[62]106data from prior run on PE ', myid</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
107&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
108&nbsp; CALL local_stop</span><br style="font-family: monospace;"><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;
109&nbsp; &nbsp; &nbsp;&nbsp; END SELECT<br>&nbsp;
110&nbsp; &nbsp;&nbsp; ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;
111&nbsp;ENDIF</span><br style="font-family: monospace;"><br><br></li><li>The
112quantity has to be given a unit (subroutine <a href="chapter_3.5.1.html#user_check_data_output"><span style="font-family: monospace;">user_check_data_output</span></a>):<br><br><span style="font-family: monospace;">&nbsp; &nbsp; CASE (
113'u2' )</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;
114&nbsp;&nbsp; unit = 'm2/s2'</span><br>&nbsp;<br>Otherwise,
115PALM will abort.<br><br><br></li><li>The
[5]116vertical grid on which the quantity is defined (given by the levels
117'zu' or 'zw', on which the u- or w-component of the velocity are
[62]118defined) has to be specified for the NetCDF output files in subroutine <a href="chapter_3.5.1.html#user_define_netcdf_grid"><span style="font-family: monospace;">user_define_netcdf_grid</span></a>:<br><br><span style="font-family: monospace;">&nbsp;&nbsp;
119&nbsp;CASE ( 'u2', 'u2_xy', 'u2_xz', 'u2_yz' )</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;
120&nbsp; &nbsp; grid = 'zu'</span><br>&nbsp;<br>As
121the example shows, this grid has to be defined for the 3d volume data
122as well as for all of the three cross sections.<br><span style="font-family: monospace;"><br><br></span></li><li>After
123each timestep, the quantity has to be calculated at all gridpoints and
124to be stored. This has to be done in subroutine <a href="chapter_3.5.1#user_actions"><span style="font-family: monospace;">user_actions</span></a>
125at location 'after_integration':<br><br><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;CASE
126( 'after_integration' )</span><br style="font-family: monospace;"><span style="font-family: monospace;">!</span><br style="font-family: monospace;"><span style="font-family: monospace;">!--&nbsp;&nbsp;&nbsp;
127Enter actions to be done after every time integration (before</span><br style="font-family: monospace;"><span style="font-family: monospace;">!--&nbsp;&nbsp;&nbsp;
128data output)</span><br style="font-family: monospace;"><span style="font-family: monospace;">!--&nbsp;&nbsp;&nbsp;
129Sample for user-defined output:</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
130DO&nbsp; i = nxl-1, nxr+1</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
131DO&nbsp; j = nys-1, nyn+1</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
132DO&nbsp; k = nzb, nzt+1</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;
133u2(k,j,i) = u(k,j,i)**2</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
134ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
135ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
136ENDDO</span><br><br>&nbsp;<br></li><li>In
[5]137case that output of time-averaged data is requested, the sum- and
138average-operations as well as the allocation of the sum-array have to
[62]139be carried out in subroutine <a href="chapter_3.5.1.html#user_3d_data_averaging"><span style="font-family: monospace;">user_3d_data_averaging</span></a>:<br><br><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;
140IF ( mode == 'allocate' )&nbsp; THEN<br>&nbsp; &nbsp;
141...</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
142CASE ( 'u2' )</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
143IF ( .NOT. ALLOCATED( u2_av ) )&nbsp; THEN</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
144ALLOCATE( u2_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) )</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
145ENDIF</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
146u2_av = 0.0<br>&nbsp; &nbsp; ...</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;
147ELSEIF ( mode == 'sum' )&nbsp; THEN<br>&nbsp; &nbsp;
148...</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CASE
149( 'u2' )</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
150DO&nbsp; i = nxl-1, nxr+1</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
151DO&nbsp; j = nys-1, nyn+1</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;
152DO&nbsp; k = nzb, nzt+1</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;
153u2_av(k,j,i) = u2_av(k,j,i) + u2(k,j,i)</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;
154ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
155ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
156ENDDO<br>&nbsp; &nbsp; ...</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;
157ELSEIF ( mode == 'average' )&nbsp; THEN<br>&nbsp;
158&nbsp; ...</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CASE
159( 'u2' )</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
160DO&nbsp; i = nxl-1, nxr+1</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
161DO&nbsp; j = nys-1, nyn+1</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;
162DO&nbsp; k = nzb, nzt+1</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;
163u2_av(k,j,i) = u2_av(k,j,i) / REAL( average_count_3d )</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;
164ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
165ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
166ENDDO</span><br><br>&nbsp;</li><li>For
167output of 2d cross sections, the gridpoint data of the quantity has to
168be resorted to array <span style="font-family: monospace;">local_pf</span>
169in subroutine <a href="chapter_3.5.1.html#user_data_output_2d"><span style="font-family: monospace;">user_data_output_2d</span></a>.
170Also the vertical grid, on which the quantity is defined, has to be set
171again:<br><br><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;CASE
172( 'u2_xy', 'u2_xz', 'u2_yz' )</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
173IF ( av == 0 )&nbsp; THEN</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
174DO&nbsp; i = nxl-1, nxr+1</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
175DO&nbsp; j = nys-1, nyn+1</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;
176DO&nbsp; k = nzb, nzt+1</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;
177local_pf(i,j,k) = u2(k,j,i)</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;
178ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
179ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
180ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
181ELSE</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
182DO&nbsp; i = nxl-1, nxr+1</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
183DO&nbsp; j = nys-1, nyn+1</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;
184DO&nbsp; k = nzb, nzt+1</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;
185local_pf(i,j,k) = u2_av(k,j,i)</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;
186ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
187ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
188ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
189ENDIF</span><br style="font-family: monospace;"><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
190grid = 'zu'</span><br>&nbsp;<br>The <span style="font-family: monospace;">ELSE</span> case is
191only needed in case that output of time-averaged data is requested.<br><br><br></li><li>For
192output of 3d volume data, the gridpoint data of the quantity has to be
193resorted to array <span style="font-family: monospace;">local_pf</span>
194in subroutine <a href="chapter_3.5.1.html#user_data_output_3d"><span style="font-family: monospace;">user_data_output_3d</span></a>.
195Also the vertical grid, on which the quantity is defined, has to be set
196again:<br><br><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;CASE
197( 'u2' )</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
198IF ( av == 0 )&nbsp; THEN</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
199DO&nbsp; i = nxl-1, nxr+1</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
200DO&nbsp; j = nys-1, nyn+1</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;
201DO&nbsp; k = nzb, nz_do</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;
202local_pf(i,j,k) = u2(k,j,i)</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;
203ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
204ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
205ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
206ELSE</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
207DO&nbsp; i = nxl-1, nxr+1</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
208DO&nbsp; j = nys-1, nyn+1</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;
209DO&nbsp; k = nzb, nz_do</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;
210local_pf(i,j,k) = u2_av(k,j,i)</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;
211ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
212ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
213ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
214ENDIF</span><br style="font-family: monospace;"><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
215grid = 'zu'</span><br><br>The <span style="font-family: monospace;">ELSE</span> case is
216only needed in case that output of time-averaged data is requested.<br><br><br></li><li>In
217case of job chains, the sum array has to be written to the (binary)
218restart file (local filename <a href="chapter_3.4.html#BINOUT">BINOUT</a>)
219in subroutine <a href="chapter_3.5.1.html#user_last_actions"><span style="font-family: monospace;">user_last_actions</span></a>:<br><br><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;
220IF ( ALLOCATED( u2_av ) )&nbsp; THEN</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
[5]221WRITE ( 14 )&nbsp;
222'u2_av&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
[62]223';&nbsp; WRITE ( 14 )&nbsp; u2_av</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;
224ENDIF</span><br><br>Otherwise, the calculated
[130]225time-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
226quantity "square of the u-component", <span style="font-style: italic;">u<sup>2</sup></span>. If more than one user-defined
227quantity shall be output, the following steps have to be carried out in the
228same way for each of the quantities. First,&nbsp;steps 1 - 6 of <a href="chapter_3.5.4.html#2D_and_3D">2d cross
229section</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
230be resorted to array <span style="font-family: monospace;">local_pf</span>
231in 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>
[62]232<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>
233<p style="line-height: 100%;"><i>Last
234change:&nbsp;</i> $Id: chapter_3.5.4.html 130 2007-11-13 14:08:40Z letzel $</p>
[5]235</body></html>
Note: See TracBrowser for help on using the repository browser.