Changeset 89 for palm/trunk/DOC/app/chapter_3.5.4.html
- Timestamp:
- May 25, 2007 12:08:31 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/DOC/app/chapter_3.5.4.html
r88 r89 16 16 section or 3d volume data. The respective subroutines 17 17 contain sample code lines (written as comment lines) for defining, calculating and 18 output of such quantities.<br><br> The18 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 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>Output of vertical profiles</h4><br><br><h4><span style="font-weight: bold;">Output of 2d cross sections or 3d volume data</span></h4><br>This example shows the output of the 20 default 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 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>Output of timeseries</h4>still to be added<br> <br><h4><span style="font-weight: bold;">Output of 2d cross sections or 3d volume data</span></h4><br>This example shows the output of the 21 52 quantity "square of the u-component" (<span style="font-weight: bold;">Note:</span> this quantity 22 53 could of course easily be calculated from the u-component by 23 54 postprocessing the PALM output so that calculation within PALM is not 24 55 necessarily required). If more than one user-defined 25 quantity shall be output, the sesteps have to be carried out in the56 quantity shall be output, the following steps have to be carried out in the 26 57 same way for each of the quantities.<br><br><ol><li>The 27 58 quantity has to be given a unique string identifier, e.g. <span style="font-style: italic;">'u2'</span>.
Note: See TracChangeset
for help on using the changeset viewer.