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

Last change on this file since 105 was 89, checked in by raasch, 18 years ago

further changes concerning user-defined profiles

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