Changeset 62 for palm/trunk/DOC/app/chapter_3.5.4.html
- Timestamp:
- Mar 13, 2007 2:52:40 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/DOC/app/chapter_3.5.4.html
r54 r62 1 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 2 2 <html><head> 3 <meta http-equiv="CONTENT-TYPE" content="text/html; charset=windows-1252"> 4 5 <title>PALM chapter 3.5.5</title><meta name="GENERATOR" content="StarOffice 7 (Win32)"> 6 <meta name="AUTHOR" content="Siegfried Raasch"> 7 <meta name="CREATED" content="20040802;14050943"> 8 <meta name="CHANGED" content="20041117;12180008"> 9 <meta name="KEYWORDS" content="parallel LES model"> 10 <style> 11 <!-- 12 @page { size: 21cm 29.7cm } 13 --> 14 </style></head> 15 <body dir="ltr" lang="en-US"> 16 <h3 style="line-height: 100%;"><font size="4">3.5.4 User-defined output quantities<br> 17 </font></h3>A very typical request of users is the calculation and 3 <meta http-equiv="CONTENT-TYPE" content="text/html; charset=windows-1252"><title>PALM 4 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> 5 <!-- 6 @page { size: 21cm 29.7cm } 7 --> 8 </style></head> 9 <body style="direction: ltr;" lang="en-US"><h3 style="line-height: 100%;"><font size="4">3.5.4 10 User-defined output quantities<br> 11 </font></h3>A very typical request of users is the 12 calculation and 18 13 output of 19 14 quantities which are not part of PALM's standard output. The basic user 20 15 interface includes a number of subroutines which allow the calculation 21 16 of user-defined quantities and output of these quantities as 2d cross 22 section or 3d volume data. The respective subroutines contain as 17 section or 3d volume data. The respective subroutines 18 contain as 23 19 an example code lines (written as comment lines) for calculating and 24 20 output the square of the u-component velocity (note: this quantity … … 30 26 quantity "square of the u-component". If more than one user-defined 31 27 quantity shall be output, these steps have to be carried out in the 32 same way for each of the quantities.<br><br><ol><li>The quantity has to be given a unique string identifier, e.g. <span style="font-style: italic;">'u2'</span>. 28 same way for each of the quantities.<br><br><ol><li>The 29 quantity has to be given a unique string identifier, e.g. <span style="font-style: italic;">'u2'</span>. 33 30 This identifier must be different from the identifiers used for the 34 PALM standard output (see list in description of parameter <a href="chapter_4.2.html#data_output">data_output</a>). To switch on output of this quantity, the user has to assign the string identifier to the parameter <a href="chapter_4.3.html#data_output_user">data_output_user</a>, eg.:<br><br><span style="font-family: monospace;"> data_output_user</span> = <span style="font-style: italic;">'u2'</span>, <span style="font-style: italic;"> 'u2_xy_av'</span><br><br>The pure string <span style="font-style: italic;">'u2'</span> 31 PALM standard output (see list in description of parameter <a href="chapter_4.2.html#data_output">data_output</a>). 32 To switch on output of this quantity, the user has to assign the string 33 identifier to the parameter <a href="chapter_4.3.html#data_output_user">data_output_user</a>, 34 eg.:<br><br><span style="font-family: monospace;"> 35 data_output_user</span> = <span style="font-style: italic;">'u2'</span>, <span style="font-style: italic;"> 'u2_xy_av'</span><br><br>The 36 pure string <span style="font-style: italic;">'u2'</span> 35 37 switches on the output of instantaneous 3d volume data. Output of cross 36 38 section data and time averaged data is switched on by additionally 37 appending the strings <span style="font-style: italic;">'_xy'</span>, <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 detailed explanation see parameter <a href="chapter_4.2.html#data_output">data_output</a>).<br><br></li><li>In order to store the quantities' grid point data within PALM, a 3d data 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, DIMENSION(:,:,:), ALLOCATABLE :: u2, u2_av</span><br><br>The second array <span style="font-family: monospace;">u2_av</span> 39 appending the strings <span style="font-style: italic;">'_xy'</span>, 40 <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 41 detailed explanation see parameter <a href="chapter_4.2.html#data_output">data_output</a>).<br><br></li><li>In 42 order to store the quantities' grid point data within PALM, a 3d data 43 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, 44 DIMENSION(:,:,:), ALLOCATABLE :: u2, u2_av</span><br><br>The 45 second array <span style="font-family: monospace;">u2_av</span> 38 46 is needed in case that output of time averaged data is requested. It is 39 47 used to store the sum of the data of the respective time levels over 40 which the average has to be carried out.<br><br><br></li><li>The 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;"> ALLOCATE( u2(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) )</span><br><br>In 48 which the average has to be carried out.<br><br><br></li><li>The 49 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;"> 50 ALLOCATE( u2(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) )</span><br><br>In 41 51 case that output of time averaged data is requested, the array 42 52 containing the sum has possibly to be read from the restart file (local 43 filename <a href="chapter_3.4.html#BININ">BININ</a>) by executing the following code in <span style="font-family: monospace;">user_init</span>:<br><br><span style="font-family: monospace;"> IF ( initializing_actions == 'read_restart_data' ) THEN</span><br style="font-family: monospace;"><span style="font-family: monospace;"> READ ( 13 ) field_chr</span><br style="font-family: monospace;"><span style="font-family: monospace;"> DO WHILE ( TRIM( field_chr ) /= '*** end user ***' )</span><br style="font-family: monospace;"><br style="font-family: monospace;"><span style="font-family: monospace;"> SELECT CASE ( TRIM( field_chr ) )</span><br style="font-family: monospace;"><br style="font-family: monospace;"><span style="font-family: monospace;"> CASE ( 'u2_av' )</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 44 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;"> READ ( 13 ) u2_av</span><br style="font-family: monospace;"><br style="font-family: monospace;"><span style="font-family: monospace;"> CASE DEFAULT</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 45 PRINT*, '+++ user_init: unknown 53 filename <a href="chapter_3.4.html#BININ">BININ</a>) 54 by executing the following code in <span style="font-family: monospace;">user_init</span>:<br><br><span style="font-family: monospace;"> 55 IF ( initializing_actions == 'read_restart_data' ) 56 THEN</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 57 READ ( 13 ) field_chr</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 58 DO WHILE ( TRIM( field_chr ) /= '*** end 59 user ***' )</span><br style="font-family: monospace;"><br style="font-family: monospace;"><span style="font-family: monospace;"> 60 SELECT CASE ( TRIM( field_chr ) )</span><br style="font-family: monospace;"><br style="font-family: monospace;"><span style="font-family: monospace;"> 61 CASE ( 'u2_av' )</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 62 ALLOCATE( 63 u2_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) )</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 64 READ ( 13 ) u2_av</span><br style="font-family: monospace;"><br style="font-family: monospace;"><span style="font-family: monospace;"> 65 CASE DEFAULT</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 66 PRINT*, 67 '+++ user_init: unknown 46 68 variable named "', &</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 47 69 48 TRIM( 70 71 TRIM( 49 72 field_chr ), '" found in'</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 50 73 PRINT*, 51 74 ' 52 data from prior run on PE ', myid</span><br style="font-family: monospace;"><span style="font-family: monospace;"> CALL local_stop</span><br style="font-family: monospace;"><br style="font-family: monospace;"><span style="font-family: monospace;"> END SELECT<br> ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> ENDIF</span><br style="font-family: monospace;"><br><br></li><li>The 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 ( 'u2' )</span><br style="font-family: monospace;"><span style="font-family: monospace;"> unit = 'm2/s2'</span><br> <br>Otherwise, PALM will abort.<br><br><br></li><li>The 75 data from prior run on PE ', myid</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 76 77 CALL local_stop</span><br style="font-family: monospace;"><br style="font-family: monospace;"><span style="font-family: monospace;"> 78 END SELECT<br> 79 ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 80 ENDIF</span><br style="font-family: monospace;"><br><br></li><li>The 81 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 ( 82 'u2' )</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 83 unit = 'm2/s2'</span><br> <br>Otherwise, 84 PALM will abort.<br><br><br></li><li>The 53 85 vertical grid on which the quantity is defined (given by the levels 54 86 'zu' or 'zw', on which the u- or w-component of the velocity are 55 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;"> CASE ( 'u2', 'u2_xy', 'u2_xz', 'u2_yz' )</span><br style="font-family: monospace;"><span style="font-family: monospace;"> grid = 'zu'</span><br> <br>As the example shows, this grid has to be defined for the 3d volume data as well as for all of the three cross sections.<br><span style="font-family: monospace;"><br><br></span></li><li>After each timestep, the quantity has to be calculated at all gridpoints and 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> at location 'after_integration':<br><br><span style="font-family: monospace;"> CASE ( 'after_integration' )</span><br style="font-family: monospace;"><span style="font-family: monospace;">!</span><br style="font-family: monospace;"><span style="font-family: monospace;">!-- Enter actions to be done after every time integration (before</span><br style="font-family: monospace;"><span style="font-family: monospace;">!-- data output)</span><br style="font-family: monospace;"><span style="font-family: monospace;">!-- Sample for user-defined output:</span><br style="font-family: monospace;"><span style="font-family: monospace;"> DO i = nxl-1, nxr+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> DO j = nys-1, nyn+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> DO k = nzb, nzt+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> u2(k,j,i) = u(k,j,i)**2</span><br style="font-family: monospace;"><span style="font-family: monospace;"> ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> ENDDO</span><br><br> <br></li><li>In 87 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;"> 88 CASE ( 'u2', 'u2_xy', 'u2_xz', 'u2_yz' )</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 89 grid = 'zu'</span><br> <br>As 90 the example shows, this grid has to be defined for the 3d volume data 91 as well as for all of the three cross sections.<br><span style="font-family: monospace;"><br><br></span></li><li>After 92 each timestep, the quantity has to be calculated at all gridpoints and 93 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> 94 at location 'after_integration':<br><br><span style="font-family: monospace;"> CASE 95 ( 'after_integration' )</span><br style="font-family: monospace;"><span style="font-family: monospace;">!</span><br style="font-family: monospace;"><span style="font-family: monospace;">!-- 96 Enter actions to be done after every time integration (before</span><br style="font-family: monospace;"><span style="font-family: monospace;">!-- 97 data output)</span><br style="font-family: monospace;"><span style="font-family: monospace;">!-- 98 Sample for user-defined output:</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 99 DO i = nxl-1, nxr+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 100 DO j = nys-1, nyn+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 101 DO k = nzb, nzt+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 102 u2(k,j,i) = u(k,j,i)**2</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 103 ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 104 ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 105 ENDDO</span><br><br> <br></li><li>In 56 106 case that output of time-averaged data is requested, the sum- and 57 107 average-operations as well as the allocation of the sum-array have to 58 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;"> IF ( mode == 'allocate' ) THEN<br> ...</span><br style="font-family: monospace;"><span style="font-family: monospace;"> CASE ( 'u2' )</span><br style="font-family: monospace;"><span style="font-family: monospace;"> IF ( .NOT. ALLOCATED( u2_av ) ) THEN</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 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;"> ENDIF</span><br style="font-family: monospace;"><span style="font-family: monospace;"> u2_av = 0.0<br> ...</span><br style="font-family: monospace;"><span style="font-family: monospace;"> ELSEIF ( mode == 'sum' ) THEN<br> ...</span><br style="font-family: monospace;"><span style="font-family: monospace;"> CASE ( 'u2' )</span><br style="font-family: monospace;"><span style="font-family: monospace;"> DO i = nxl-1, nxr+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> DO j = nys-1, nyn+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> DO k = nzb, nzt+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 59 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;"> ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> ENDDO<br> ...</span><br style="font-family: monospace;"><span style="font-family: monospace;"> ELSEIF ( mode == 'average' ) THEN<br> ...</span><br style="font-family: monospace;"><span style="font-family: monospace;"> CASE ( 'u2' )</span><br style="font-family: monospace;"><span style="font-family: monospace;"> DO i = nxl-1, nxr+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> DO j = nys-1, nyn+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> DO k = nzb, nzt+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 60 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;"> ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> ENDDO</span><br><br> </li><li>For output of 2d cross sections, the gridpoint data of the quantity has to be resorted to array <span style="font-family: monospace;">local_pf</span> in subroutine <a href="chapter_3.5.1.html#user_data_output_2d"><span style="font-family: monospace;">user_data_output_2d</span></a>. Also the vertical grid, on which the quantity is defined, has to be set again:<br><br><span style="font-family: monospace;"> CASE ( 'u2_xy', 'u2_xz', 'u2_yz' )</span><br style="font-family: monospace;"><span style="font-family: monospace;"> IF ( av == 0 ) THEN</span><br style="font-family: monospace;"><span style="font-family: monospace;"> DO i = nxl-1, nxr+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> DO j = nys-1, nyn+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> DO k = nzb, nzt+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 61 local_pf(i,j,k) = u2(k,j,i)</span><br style="font-family: monospace;"><span style="font-family: monospace;"> ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> ELSE</span><br style="font-family: monospace;"><span style="font-family: monospace;"> DO i = nxl-1, nxr+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> DO j = nys-1, nyn+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> DO k = nzb, nzt+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 62 local_pf(i,j,k) = u2_av(k,j,i)</span><br style="font-family: monospace;"><span style="font-family: monospace;"> ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> ENDIF</span><br style="font-family: monospace;"><br style="font-family: monospace;"><span style="font-family: monospace;"> grid = 'zu'</span><br> <br>The <span style="font-family: monospace;">ELSE</span> case is only needed in case that output of time-averaged data is requested.<br><br><br></li><li>For output of 3d volume data, the gridpoint data of the quantity has to be resorted to array <span style="font-family: monospace;">local_pf</span> in subroutine <a href="chapter_3.5.1.html#user_data_output_3d"><span style="font-family: monospace;">user_data_output_3d</span></a>. Also the vertical grid, on which the quantity is defined, has to be set again:<br><br><span style="font-family: monospace;"> CASE ( 'u2' )</span><br style="font-family: monospace;"><span style="font-family: monospace;"> IF ( av == 0 ) THEN</span><br style="font-family: monospace;"><span style="font-family: monospace;"> DO i = nxl-1, nxr+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> DO j = nys-1, nyn+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> DO k = nzb, nz_do</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 63 local_pf(i,j,k) = u2(k,j,i)</span><br style="font-family: monospace;"><span style="font-family: monospace;"> ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> ELSE</span><br style="font-family: monospace;"><span style="font-family: monospace;"> DO i = nxl-1, nxr+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> DO j = nys-1, nyn+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> DO k = nzb, nz_do</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 64 local_pf(i,j,k) = u2_av(k,j,i)</span><br style="font-family: monospace;"><span style="font-family: monospace;"> ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> ENDIF</span><br style="font-family: monospace;"><br style="font-family: monospace;"><span style="font-family: monospace;"> grid = 'zu'</span><br><br>The <span style="font-family: monospace;">ELSE</span> case is only needed in case that output of time-averaged data is requested.<br><br><br></li><li>In case of job chains, the sum array has to be written to the (binary) restart file (local filename <a href="chapter_3.4.html#BINOUT">BINOUT</a>) 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;"> IF ( ALLOCATED( u2_av ) ) THEN</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 108 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;"> 109 IF ( mode == 'allocate' ) THEN<br> 110 ...</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 111 CASE ( 'u2' )</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 112 IF ( .NOT. ALLOCATED( u2_av ) ) THEN</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 113 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;"> 114 ENDIF</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 115 u2_av = 0.0<br> ...</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 116 ELSEIF ( mode == 'sum' ) THEN<br> 117 ...</span><br style="font-family: monospace;"><span style="font-family: monospace;"> CASE 118 ( 'u2' )</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 119 DO i = nxl-1, nxr+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 120 DO j = nys-1, nyn+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 121 DO k = nzb, nzt+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 122 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;"> 123 ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 124 ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 125 ENDDO<br> ...</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 126 ELSEIF ( mode == 'average' ) THEN<br> 127 ...</span><br style="font-family: monospace;"><span style="font-family: monospace;"> CASE 128 ( 'u2' )</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 129 DO i = nxl-1, nxr+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 130 DO j = nys-1, nyn+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 131 DO k = nzb, nzt+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 132 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;"> 133 ENDDO</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><br> </li><li>For 136 output of 2d cross sections, the gridpoint data of the quantity has to 137 be resorted to array <span style="font-family: monospace;">local_pf</span> 138 in subroutine <a href="chapter_3.5.1.html#user_data_output_2d"><span style="font-family: monospace;">user_data_output_2d</span></a>. 139 Also the vertical grid, on which the quantity is defined, has to be set 140 again:<br><br><span style="font-family: monospace;"> CASE 141 ( 'u2_xy', 'u2_xz', 'u2_yz' )</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 142 IF ( av == 0 ) THEN</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 143 DO i = nxl-1, nxr+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 144 DO j = nys-1, nyn+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 145 DO k = nzb, nzt+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 146 local_pf(i,j,k) = u2(k,j,i)</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 147 ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 148 ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 149 ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 150 ELSE</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 151 DO i = nxl-1, nxr+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 152 DO j = nys-1, nyn+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 153 DO k = nzb, nzt+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 154 local_pf(i,j,k) = u2_av(k,j,i)</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</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 157 ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 158 ENDIF</span><br style="font-family: monospace;"><br style="font-family: monospace;"><span style="font-family: monospace;"> 159 grid = 'zu'</span><br> <br>The <span style="font-family: monospace;">ELSE</span> case is 160 only needed in case that output of time-averaged data is requested.<br><br><br></li><li>For 161 output of 3d volume data, the gridpoint data of the quantity has to be 162 resorted to array <span style="font-family: monospace;">local_pf</span> 163 in subroutine <a href="chapter_3.5.1.html#user_data_output_3d"><span style="font-family: monospace;">user_data_output_3d</span></a>. 164 Also the vertical grid, on which the quantity is defined, has to be set 165 again:<br><br><span style="font-family: monospace;"> CASE 166 ( 'u2' )</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 167 IF ( av == 0 ) THEN</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 168 DO i = nxl-1, nxr+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 169 DO j = nys-1, nyn+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 170 DO k = nzb, nz_do</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 171 local_pf(i,j,k) = u2(k,j,i)</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 172 ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 173 ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 174 ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 175 ELSE</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 176 DO i = nxl-1, nxr+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 177 DO j = nys-1, nyn+1</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 178 DO k = nzb, nz_do</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 179 local_pf(i,j,k) = u2_av(k,j,i)</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 ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 182 ENDDO</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 183 ENDIF</span><br style="font-family: monospace;"><br style="font-family: monospace;"><span style="font-family: monospace;"> 184 grid = 'zu'</span><br><br>The <span style="font-family: monospace;">ELSE</span> case is 185 only needed in case that output of time-averaged data is requested.<br><br><br></li><li>In 186 case of job chains, the sum array has to be written to the (binary) 187 restart file (local filename <a href="chapter_3.4.html#BINOUT">BINOUT</a>) 188 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;"> 189 IF ( ALLOCATED( u2_av ) ) THEN</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 65 190 WRITE ( 14 ) 66 191 'u2_av 67 '; WRITE ( 14 ) u2_av</span><br style="font-family: monospace;"><span style="font-family: monospace;"> ENDIF</span><br><br>Otherwise, the calculated time-average may be wrong. </li></ol><hr> 68 <p style="line-height: 100%;"><br> 69 <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> 70 <p style="line-height: 100%;"><i>Last change: </i> 24/03/06 (SR)</p> 192 '; WRITE ( 14 ) u2_av</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 193 ENDIF</span><br><br>Otherwise, the calculated 194 time-average may be wrong. </li></ol><hr> 195 <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> 196 <p style="line-height: 100%;"><i>Last 197 change: </i> $Id$</p> 71 198 </body></html>
Note: See TracChangeset
for help on using the changeset viewer.