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.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> |
---|
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 |
---|
9 | User-defined output quantities<br> |
---|
10 | </font></h3>A very typical request of users is the |
---|
11 | calculation and |
---|
12 | output of |
---|
13 | quantities which are not part of PALM's standard output. The basic user |
---|
14 | interface 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. <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 |
---|
23 | same way for each of the quantities.<br><br><ol><li>The |
---|
24 | quantity has to be given a unique string identifier, e.g. <span style="font-style: italic;">'u*v*'</span>. |
---|
25 | This identifier must be different from the identifiers used for the |
---|
26 | PALM standard output (see list in description of parameter <a href="chapter_4.2.html#data_output_pr">data_output_pr</a>). |
---|
27 | To switch on output of this quantity, the user has to assign the string |
---|
28 | identifier to the parameter <a href="chapter_4.3.html#data_output_pr_user">data_output_pr_user</a>, |
---|
29 | eg.:<br><br><span style="font-family: monospace;"> |
---|
30 | 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 |
---|
31 | the |
---|
32 | quantity, 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> CASE ( |
---|
34 | 'u*v*' )<br></span><span style="font-family: monospace;"> index = pr_palm + <span style="color: rgb(255, 0, 0);">1<span style="color: rgb(0, 0, 0);"> |
---|
35 | |
---|
36 | |
---|
37 | ! identification number</span></span><br> dopr_index(var_count) = index<br> dopr_unit(var_count) = '<span style="color: rgb(255, 0, 0);">m2/s2</span>' |
---|
38 | |
---|
39 | ! physical unit<br> hom(:,2,index,:) = SPREAD( <span style="color: rgb(255, 0, 0);">zu</span>, 2, statistic_regions+1 ) ! 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 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. 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;"> !$OMP DO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> DO i = nxl, nxr</span><br style="font-family: monospace;"><span style="font-family: monospace;"> DO j = nys, nyn</span><br style="font-family: monospace;"><span style="font-family: monospace;"> DO 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;"> 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) + &</span><br style="font-family: monospace;"><span style="font-family: monospace;"> <span style="color: rgb(255, 0, 0);">( 0.5 * ( u(k,j,i) + u(k,j,i+1) ) - hom(k,1,1,sr) ) * &</span></span><br style="font-family: monospace; color: rgb(255, 0, 0);"><span style="font-family: monospace; color: rgb(255, 0, 0);"> |
---|
41 | ( 0.5 * ( v(k,j,i) + v(k,j+1,i) ) - hom(k,1,2,sr) ) * &</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
42 | * rmask(j,i,sr)<br> ENDDO<br> ENDDO<br> 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 |
---|
43 | turbulent resolved-scale momentum flux u*v* is defined as the product |
---|
44 | of the deviations of the horizontal velocities from their respective |
---|
45 | horizontally 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> |
---|
47 | are not defined at the same gridpoints, they have to be interpolated |
---|
48 | appropriately (here to the center of the gridbox). The result of the |
---|
49 | calculation is stored in array <span style="font-family: Courier New,Courier,monospace;">sums_l</span>. |
---|
50 | The 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> dots_label(dots_num<span style="color: rgb(255, 0, 0);">+1</span>) = '<span style="color: rgb(255, 0, 0);">abs_umx</span>'<br> dots_unit(dots_num<span style="color: rgb(255, 0, 0);">+1</span>) = '<span style="color: rgb(255, 0, 0);">m/s</span>'<br> dots_label(dots_num<span style="color: rgb(255, 0, 0);">+2</span>) = '<span style="color: rgb(255, 0, 0);">abs_vmx</span>'<br> dots_unit(dots_num<span style="color: rgb(255, 0, 0);">+2</span>) = '<span style="color: rgb(255, 0, 0);">m/s</span>'<br><br> dots_num_palm = dots_num<br> 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 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, but at least for the region <span style="font-style: italic;">"total domain"</span>:<br> <br><code> ts_value(dots_num_palm+1,sr) = ABS( u_max )<br> ts_value(dots_num_palm+2,sr) = ABS( v_max )<br></code></li></ol> <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 |
---|
54 | quantity "square of the u-component" (<span style="font-weight: bold;">Note:</span> this quantity |
---|
55 | could of course easily be calculated from the u-component by |
---|
56 | postprocessing the PALM output so that calculation within PALM is not |
---|
57 | necessarily required). If more than one user-defined |
---|
58 | quantity shall be output, the following steps have to be carried out in the |
---|
59 | same way for each of the quantities.<br><br><ol><li>The |
---|
60 | quantity has to be given a unique string identifier, e.g. <span style="font-style: italic;">'u2'</span>. |
---|
61 | This identifier must be different from the identifiers used for the |
---|
62 | PALM standard output (see list in description of parameter <a href="chapter_4.2.html#data_output">data_output</a>). |
---|
63 | To switch on output of this quantity, the user has to assign the string |
---|
64 | identifier to the parameter <a href="chapter_4.3.html#data_output_user">data_output_user</a>, |
---|
65 | eg.:<br><br><span style="font-family: monospace;"> |
---|
66 | data_output_user</span> = <span style="font-style: italic;">'u2'</span>, <span style="font-style: italic;"> 'u2_xy_av'</span><br><br>The |
---|
67 | pure string <span style="font-style: italic;">'u2'</span> |
---|
68 | switches on the output of instantaneous 3d volume data. Output of cross |
---|
69 | section data and time averaged data is switched on by additionally |
---|
70 | appending 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 |
---|
72 | detailed explanation see parameter <a href="chapter_4.2.html#data_output">data_output</a>).<br><br></li><li>In |
---|
73 | order to store the quantities' grid point data within PALM, a 3d data |
---|
74 | array 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;"> REAL, |
---|
75 | DIMENSION(:,:,:), ALLOCATABLE :: u2, u2_av</span><br><br>The |
---|
76 | second array <span style="font-family: monospace;">u2_av</span> |
---|
77 | is needed in case that output of time averaged data is requested. It is |
---|
78 | used to store the sum of the data of the respective time levels over |
---|
79 | which the average has to be carried out.<br><br><br></li><li>The |
---|
80 | data 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;"> |
---|
81 | ALLOCATE( u2(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) )</span><br><br>In |
---|
82 | case that output of time averaged data is requested, the array |
---|
83 | containing the sum has possibly to be read from the restart file (local |
---|
84 | filename <a href="chapter_3.4.html#BININ">BININ</a>) |
---|
85 | by executing the following code in <span style="font-family: monospace;">user_init</span>:<br><br><span style="font-family: monospace;"> |
---|
86 | IF ( initializing_actions == 'read_restart_data' ) |
---|
87 | THEN</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
88 | READ ( 13 ) field_chr</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
89 | DO WHILE ( TRIM( field_chr ) /= '*** end |
---|
90 | user ***' )</span><br style="font-family: monospace;"><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
91 | SELECT CASE ( TRIM( field_chr ) )</span><br style="font-family: monospace;"><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
92 | CASE ( 'u2_av' )</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
93 | ALLOCATE( |
---|
94 | u2_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) )</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
95 | READ ( 13 ) u2_av</span><br style="font-family: monospace;"><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
96 | CASE DEFAULT</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
97 | PRINT*, |
---|
98 | '+++ user_init: unknown |
---|
99 | variable named "', &</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
100 | |
---|
101 | |
---|
102 | TRIM( |
---|
103 | field_chr ), '" found in'</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
104 | PRINT*, |
---|
105 | ' |
---|
106 | data from prior run on PE ', myid</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
107 | |
---|
108 | CALL local_stop</span><br style="font-family: monospace;"><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
109 | END SELECT<br> |
---|
110 | ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
111 | ENDIF</span><br style="font-family: monospace;"><br><br></li><li>The |
---|
112 | quantity 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;"> CASE ( |
---|
113 | 'u2' )</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
114 | unit = 'm2/s2'</span><br> <br>Otherwise, |
---|
115 | PALM will abort.<br><br><br></li><li>The |
---|
116 | vertical 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 |
---|
118 | defined) 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;"> |
---|
119 | CASE ( 'u2', 'u2_xy', 'u2_xz', 'u2_yz' )</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
120 | grid = 'zu'</span><br> <br>As |
---|
121 | the example shows, this grid has to be defined for the 3d volume data |
---|
122 | as well as for all of the three cross sections.<br><span style="font-family: monospace;"><br><br></span></li><li>After |
---|
123 | each timestep, the quantity has to be calculated at all gridpoints and |
---|
124 | to 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> |
---|
125 | at location 'after_integration':<br><br><span style="font-family: monospace;"> 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;">!-- |
---|
127 | Enter actions to be done after every time integration (before</span><br style="font-family: monospace;"><span style="font-family: monospace;">!-- |
---|
128 | data output)</span><br style="font-family: monospace;"><span style="font-family: monospace;">!-- |
---|
129 | Sample for user-defined output:</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
130 | DO i = nxl-1, nxr+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
131 | DO j = nys-1, nyn+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
132 | DO k = nzb, nzt+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
133 | u2(k,j,i) = u(k,j,i)**2</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
134 | ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
135 | ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
136 | ENDDO</span><br><br> <br></li><li>In |
---|
137 | case that output of time-averaged data is requested, the sum- and |
---|
138 | average-operations as well as the allocation of the sum-array have to |
---|
139 | be 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;"> |
---|
140 | IF ( mode == 'allocate' ) THEN<br> |
---|
141 | ...</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
142 | CASE ( 'u2' )</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
143 | IF ( .NOT. ALLOCATED( u2_av ) ) THEN</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
144 | ALLOCATE( u2_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) )</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
145 | ENDIF</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
146 | u2_av = 0.0<br> ...</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
147 | ELSEIF ( mode == 'sum' ) THEN<br> |
---|
148 | ...</span><br style="font-family: monospace;"><span style="font-family: monospace;"> CASE |
---|
149 | ( 'u2' )</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
150 | DO i = nxl-1, nxr+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
151 | DO j = nys-1, nyn+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
152 | DO k = nzb, nzt+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
153 | u2_av(k,j,i) = u2_av(k,j,i) + u2(k,j,i)</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
154 | ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
155 | ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
156 | ENDDO<br> ...</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
157 | ELSEIF ( mode == 'average' ) THEN<br> |
---|
158 | ...</span><br style="font-family: monospace;"><span style="font-family: monospace;"> CASE |
---|
159 | ( 'u2' )</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
160 | DO i = nxl-1, nxr+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
161 | DO j = nys-1, nyn+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
162 | DO k = nzb, nzt+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
163 | u2_av(k,j,i) = u2_av(k,j,i) / REAL( average_count_3d )</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
164 | ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
165 | ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
166 | ENDDO</span><br><br> </li><li>For |
---|
167 | output of 2d cross sections, the gridpoint data of the quantity has to |
---|
168 | be resorted to array <span style="font-family: monospace;">local_pf</span> |
---|
169 | in subroutine <a href="chapter_3.5.1.html#user_data_output_2d"><span style="font-family: monospace;">user_data_output_2d</span></a>. |
---|
170 | Also the vertical grid, on which the quantity is defined, has to be set |
---|
171 | again:<br><br><span style="font-family: monospace;"> CASE |
---|
172 | ( 'u2_xy', 'u2_xz', 'u2_yz' )</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
173 | IF ( av == 0 ) THEN</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
174 | DO i = nxl-1, nxr+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
175 | DO j = nys-1, nyn+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
176 | DO k = nzb, nzt+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
177 | local_pf(i,j,k) = u2(k,j,i)</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
178 | ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
179 | ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
180 | ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
181 | ELSE</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
182 | DO i = nxl-1, nxr+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
183 | DO j = nys-1, nyn+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
184 | DO k = nzb, nzt+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
185 | local_pf(i,j,k) = u2_av(k,j,i)</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
186 | ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
187 | ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
188 | ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
189 | ENDIF</span><br style="font-family: monospace;"><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
190 | grid = 'zu'</span><br> <br>The <span style="font-family: monospace;">ELSE</span> case is |
---|
191 | only needed in case that output of time-averaged data is requested.<br><br><br></li><li>For |
---|
192 | output of 3d volume data, the gridpoint data of the quantity has to be |
---|
193 | resorted to array <span style="font-family: monospace;">local_pf</span> |
---|
194 | in subroutine <a href="chapter_3.5.1.html#user_data_output_3d"><span style="font-family: monospace;">user_data_output_3d</span></a>.:<br><br><span style="font-family: monospace;"> CASE |
---|
195 | ( 'u2' )</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
196 | IF ( av == 0 ) THEN</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
197 | DO i = nxl-1, nxr+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
198 | DO j = nys-1, nyn+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
199 | DO k = nzb, nz_do</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
200 | local_pf(i,j,k) = u2(k,j,i)</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
201 | ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
202 | ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
203 | ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
204 | ELSE</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
205 | DO i = nxl-1, nxr+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
206 | DO j = nys-1, nyn+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
207 | DO k = nzb, nz_do</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
208 | local_pf(i,j,k) = u2_av(k,j,i)</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
209 | ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
210 | ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
211 | ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
212 | ENDIF</span><br><br>The <span style="font-family: monospace;">ELSE</span> case is |
---|
213 | only needed in case that output of time-averaged data is requested.<br><br><br></li><li>In |
---|
214 | case of job chains, the sum array has to be written to the (binary) |
---|
215 | restart file (local filename <a href="chapter_3.4.html#BINOUT">BINOUT</a>) |
---|
216 | in 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;"> |
---|
217 | IF ( ALLOCATED( u2_av ) ) THEN</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
218 | WRITE ( 14 ) |
---|
219 | 'u2_av |
---|
220 | '; WRITE ( 14 ) u2_av</span><br style="font-family: monospace;"><span style="font-family: monospace;"> |
---|
221 | ENDIF</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, 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, the gridpoint data of the quantity has to |
---|
227 | be 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> 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' )<br> DO i = nxl, nxr+1<br> DO j = nys, nyn+1<br> DO k = nzb, nz_do3d<br> local_pf(i,j,k) = <span style="color: rgb(255, 0, 0);">u2</span>(k,j,i)<br> ENDDO<br> ENDDO<br> 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: </i> $Id: chapter_3.5.4.html 136 2007-11-26 02:47:32Z raasch $</p> |
---|
232 | </body></html> |
---|