Changeset 212
- Timestamp:
- Nov 11, 2008 9:09:24 AM (16 years ago)
- Location:
- palm/trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/DOC/app/chapter_3.5.1.html
r144 r212 13 13 the 14 14 names and possible arguments of the subroutines involved as well as 15 actions which can be accomplished in these subroutines. <br> 15 actions which can be accomplished in these subroutines. The respective 16 name of a source code files is the subroutine name followed by "<span style="font-family: Courier New,Courier,monospace;">.f90</span>". Exception: the file containing the module<span style="font-family: Courier New,Courier,monospace;"> user </span>has the name <span style="font-family: Courier New,Courier,monospace;">user_module.f90</span>.<br> 16 17 </p> 17 18 <table style="width: 100%;" border="1" cellpadding="2" cellspacing="4"> <col width="211"> <col width="117"> <col width="862"> <tbody> <tr><td width="211"> <p><font size="4"><b>Call 18 19 location</b></font></p> </td> <td width="117"> <p><font size="4"><b>Subroutine 19 20 name and 20 argument </b></font></p> </td> <td style="width: 862px;"> <p><font size="4"><b>Possible21 actions</b></font></p> </td> </tr> <tr><td >---</td><td><span style="font-family: monospace;"><a name="user"></a>MODULE22 user</span></td><td >All21 argument(s)</b></font></p> </td> <td style="width: 862px;"> <p><font size="4"><b>Possible 22 actions</b></font></p> </td> </tr> <tr><td style="vertical-align: top;">---</td><td style="vertical-align: top;"><span style="font-family: monospace;"><a name="user"></a>MODULE 23 user</span></td><td style="vertical-align: top;">All 23 24 user-defined variables which are used outside the respective local 24 25 scopes of the user-defined subroutines have to be declared here.</td></tr><tr valign="top"> <td width="211"> <p>End … … 81 82 within the category “initialisation”.</p><p>See 82 83 also <tt><font style="font-size: 10pt;" size="2"><font face="Cumberland, monospace"><a href="#user_init_3d_model">user_init_3d_model</a>.</font></font></tt></p> 83 </td> </tr> <tr><td><tt><font style="font-size: 10pt;" size="2">DEFAULT</font></tt> 84 </td> </tr> <tr><td style="vertical-align: top;">End of <span style="font-family: Courier New,Courier,monospace;">read_3d_binary.f90</span></td><td style="vertical-align: top;"><tt><font style="font-size: 10pt;" size="2"><font face="Cumberland, monospace"><a name="user_read_restart_data"></a>user_read_<br>restart_data( nxlc, nxlf,nxl_on_file, nxrc, nxrf, nxr_on_file, nync, nynf,nyn_on_file, nysc, nysf, nys_on_file, tmp_2d, tmp_3d )</font></font></tt></td><td style="vertical-align: top;">Reading of user-defined 2d- and 3d-arrays from the restart file.<br><br>In 85 case of restart runs, user-defined quantities may have to be read from 86 the restart file generated by the previous run. These quantities must 87 have been output by the user in the previous run using routine <a href="#user_last_actions"><span style="font-family: Courier New,Courier,monospace;">user_last_actions</span></a>.<br><br>For usage, see example contained in <span style="font-family: Courier New,Courier,monospace;">read_3d_binary.f90</span> and <span style="font-family: Courier New,Courier,monospace;">user_last_actions.f90</span>.</td></tr><tr><td style="vertical-align: top;"><tt><font style="font-size: 10pt;" size="2">DEFAULT</font></tt> 84 88 case of <tt><font style="font-size: 10pt;" size="2">SELECT 85 89 CASE( TRIM(canopy_mode) ) </font></tt>command in the 86 middle of <tt><font style="font-size: 10pt;" size="2">init_3d_model.f90</font></tt></td><td ><a name="user_init_plant_canopy"></a><code>user_init_plant_canopy</code></td><td>User-defined initilisation of the plant canopy model.<br><br>Here, the user can define the two three-dimensional arrays <code>lad_s and cdc </code>that90 middle of <tt><font style="font-size: 10pt;" size="2">init_3d_model.f90</font></tt></td><td style="vertical-align: top;"><a name="user_init_plant_canopy"></a><code>user_init_plant_canopy</code></td><td style="vertical-align: top;">User-defined initilisation of the plant canopy model.<br><br>Here, the user can define the two three-dimensional arrays <code>lad_s and cdc </code>that 87 91 stand for the leaf area density and the canopy drag coefficient. By 88 92 this, the user can configure a plant canopy. This requires … … 206 210 in the CASE 207 211 structure of <tt><font style="font-size: 10pt;" size="2">user_actions_ij</font></tt>!</p> </td> 208 </tr> <tr><td style="vertical-align: top;"><code>SUBROUTINE preprocess_spectra</code> in <code>calc_spectra.f90</code>, and <code>data_output_spectra.f90</code></td><td style="vertical-align: top;">< tt><font style="font-size: 10pt;" size="2"><font face="Cumberland, monospace"><a name="user_spectra"></a>user_spectra</font></font></tt></td><td style="vertical-align: top;"><p><a href="chapter_3.5.4.html#spectra">Spectra of user-defined212 </tr> <tr><td style="vertical-align: top;"><code>SUBROUTINE preprocess_spectra</code> in <code>calc_spectra.f90</code>, and <code>data_output_spectra.f90</code></td><td style="vertical-align: top;"><p><tt><font style="font-size: 10pt;" size="2"><font face="Cumberland, monospace"><a name="user_spectra"></a>user_spectra</font></font></tt></p></td><td style="vertical-align: top;"><p><a href="chapter_3.5.4.html#spectra">Spectra of user-defined 209 213 quantities</a> can be computed here.</p>The 210 214 routine contains some simple examples (as comment lines) in order to … … 224 228 profiles 225 229 are further processed (e.g. temporally averaged), like the standard profiles, in <tt><font style="font-size: 10pt;" size="2">flow_statistics</font></tt>.</p> </td> 226 </tr> <tr><td style="vertical-align: top;"> End230 </tr> <tr><td style="vertical-align: top;">Middle of <span style="font-family: Courier New,Courier,monospace;">advec_particles.f90</span>, after particle reflection from walls.</td><td style="vertical-align: top;"><tt><font style="font-size: 10pt;" size="2"><font face="Cumberland, monospace"><a name="user_advec_particles"></a>user_advec_<br>particles</font></font></tt></td><td style="vertical-align: top;">User-defined actions after the calculation of the new particle position.</td></tr><tr><td style="vertical-align: top;">End 227 231 of <span style="font-family: monospace;">check_parameters.f90</span> 228 232 where 2d/3d output quantities are checked</td><td style="vertical-align: top;"><span style="font-family: monospace;"><a name="user_check_data_output"></a>user_check_data_<br>output( … … 318 322 creating user-defined output quantities.</td></tr><tr valign="top"> <td width="211"> <p>End 319 323 of <tt><font style="font-size: 10pt;" size="2">palm.f90</font></tt></p> 320 </td> <td width="117"> <p><tt><font style="font-size: 10pt;" size="2"><font face="Cumberland, monospace"><a name="user_last_action"></a>user_last_</font></font></tt><font style="font-size: 10pt;" size="2"><font face="Cumberland, monospace"> <br> </font></font><tt><font style="font-size: 10pt;" size="2"><font face="Cumberland, monospace">action </font></font></tt></p>324 </td> <td width="117"> <p><tt><font style="font-size: 10pt;" size="2"><font face="Cumberland, monospace"><a name="user_last_action"></a>user_last_</font></font></tt><font style="font-size: 10pt;" size="2"><font face="Cumberland, monospace"> <br> </font></font><tt><font style="font-size: 10pt;" size="2"><font face="Cumberland, monospace">actions</font></font></tt></p> 321 325 </td> <td width="862"> <p>User-defined 322 326 actions which are to be executed at the end … … 332 336 within the category “last actions” (the time 333 337 necessary for <tt><font style="font-size: 10pt;" size="2">close_files</font></tt> is included).</p> 334 </td> </tr> </tbody></table><hr>338 </td> </tr><tr><td style="vertical-align: top;">Not called in the default PALM code</td><td style="vertical-align: top;"><p><tt><font style="font-size: 10pt;" size="2"><font face="Cumberland, monospace"><a name="user_additional_routines"></a>user_additional_</font></font></tt><font style="font-size: 10pt;" size="2"><font face="Cumberland, monospace"> <br> </font></font><span style="font-family: Cumberland,monospace;">routines</span></p></td><td style="vertical-align: top;">This routine may contain additional routines defined by the user to be called from other user interface routines.</td></tr> </tbody></table><hr> 335 339 <p style="line-height: 100%;"><br><font color="#000080"><font color="#000080"><a href="chapter_3.5.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.2.html"><font color="#000080"><img src="right.gif" name="Grafik3" align="bottom" border="2" height="32" width="32"></font></a></font></font></p><p style="line-height: 100%;"><i>Last 336 340 change: </i>$Id$</p> -
palm/trunk/DOC/app/chapter_3.5.2.html
r62 r212 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"><title>PALM 4 chapter 3.5.2</title> <meta name="GENERATOR" content="StarOffice 7 (Win32)"> <meta name="AUTHOR" content="Siegfried Raasch"> <meta name="CREATED" content="20040802;13321506"> <meta name="CHANGED" content="20041112;14455666"> <meta name="KEYWORDS" content="parallel LES model"> <style> 3 <meta http-equiv="CONTENT-TYPE" content="text/html; charset=windows-1252"><title>PALM chapter 3.5.2</title> <meta name="GENERATOR" content="StarOffice 7 (Win32)"> <meta name="AUTHOR" content="Siegfried Raasch"> <meta name="CREATED" content="20040802;13321506"> <meta name="CHANGED" content="20041112;14455666"> <meta name="KEYWORDS" content="parallel LES model"> <style> 5 4 <!-- 6 5 @page { size: 21cm 29.7cm } … … 16 15 parameters. The declaration of user-defined parameters takes place in 17 16 the user-defined module <tt><font style="font-size: 10pt;" size="2">user</font></tt> 18 ( located at the beginning of the file <tt><font style="font-size: 10pt;" size="2">user_interface.f90</font></tt>).17 (file <tt><font style="font-size: 10pt;" size="2">user_module.f90</font></tt>). 19 18 This module must be declared in all relevant user-defined routines via 20 19 a USE statement, in order to make the parameters available. </p> -
palm/trunk/DOC/app/chapter_3.5.4.html
r148 r212 27 27 following five parts of this chapter explains step-by-step how 28 28 to modify/extend the 29 default file user_interface.f90in order to generate the respective29 respective default user interface subroutines in order to generate the respective 30 30 output:<br><ol><li>(horizontally averaged) <a href="chapter_3.5.4.html#vertical_profiles">vertical profiles</a>, </li><li><a href="chapter_3.5.4.html#time_series">time series</a>, </li><li><a href="chapter_3.5.4.html#2D_and_3D">2d cross 31 31 section</a> or <a href="chapter_3.5.4.html#2D_and_3D">3d … … 305 305 'u2_av 306 306 '; WRITE ( 14 ) u2_av</span><br style="font-family: monospace;"><span style="font-family: monospace;"> 307 ENDIF</span><br><br>Otherwise, the calculated 308 time-average may be wrong.</li></ol><br><h4><a name="dvrp"></a>4. Output of user-defined DVRP objects</h4>This 307 ENDIF</span><br><br>Otherwise, 308 the calculated 309 time-average may be wrong. In the restart run, this quantity has to be 310 read from the restart file by including the following code in 311 subroutine <a href="chapter_3.5.1.html#user_read_restart_data"><span style="font-family: monospace;">user_read_restart_data</span></a>:<br><br><span style="font-family: monospace;"> IF ( initializing_actions == 'read_restart_data' ) THEN<br> READ ( 13 ) field_char<br> DO WHILE ( TRIM( field_char ) /= '*** end user ***' )<br><br> SELECT CASE ( TRIM( field_char ) )<br><br> CASE ( 'u2_av' )<br> IF ( .NOT. ALLOCATED( u2_av ) ) THEN<br> 312 ALLOCATE( u2_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) )<br> ENDIF<br> READ ( 13 ) tmp_3d<br> 313 u2_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = &<br> 314 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1)<br><br> CASE DEFAULT<br> 315 PRINT*, '+++ user_init: unknown variable named "', &<br> 316 TRIM( field_char ), '" found in'<br> 317 PRINT*, 318 ' 319 data from prior run on PE ', myid<br> CALL local_stop<br><br> END SELECT<br><br> READ ( 13 ) field_char<br><br> ENDDO<br> ENDIF<br></span></li></ol><h4><a name="dvrp"></a>4. Output of user-defined DVRP objects</h4>This 309 320 example shows the output of the 310 321 quantity "square of the u-component", <span style="font-style: italic;">u<sup>2</sup></span>. -
palm/trunk/DOC/app/chapter_3.5.5.html
r62 r212 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"><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> 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> 5 4 <!-- 6 5 @page { size: 21cm 29.7cm } … … 12 11 </font></h3><p style="line-height: 100%;">Users 13 12 can add their own (modified) user-interface to a PALM-run by carrying 14 out the following steps:</p><ol><li>Copy the default15 (empty) user-interface (file<span style="font-family: Courier New,Courier,monospace;">16 user_ interface.f90</span>)to a directory of your choice, e.g.:<br><br><span style="font-family: Courier New,Courier,monospace;"> 13 out the following steps:</p><ol><li>Copy the appropriate default 14 (empty) user-interface files<span style="font-family: Courier New,Courier,monospace;"> 15 user_***.f90</span> to a directory of your choice, e.g.:<br><br><span style="font-family: Courier New,Courier,monospace;"> 17 16 cd ~/palm/current_version</span><br style="font-family: Courier New,Courier,monospace;"><span style="font-family: Courier New,Courier,monospace;"> 18 17 mkdir -p USER_CODE/example</span><br style="font-family: Courier New,Courier,monospace;"><span style="font-family: Courier New,Courier,monospace;"> 19 cp trunk/SOURCE/user_ interface.f90 20 USER_CODE/example /user_example.f90</span><br></li><li>Set18 cp trunk/SOURCE/user_***.f90 19 USER_CODE/example<br><br><span style="font-family: Times New Roman,Times,serif; font-weight: bold;">Attention: do not change the filenames!</span><br></span><br></li><li>Set 21 20 an additional path in the configuration file<span style="font-family: Courier New,Courier,monospace;"> 22 21 .mrun.config </span>to allow <span style="font-weight: bold;">mrun 23 </span>to find and include th is file:<br><br><span style="font-family: Courier New,Courier,monospace;"> 22 </span>to find and include these files:<br><br><span style="font-family: Courier New,Courier,monospace;"> 24 23 %add_source_path 25 24 $base_directory/USER_CODE/$fname</span><br><br>The 26 25 default configuration file (<span style="font-family: Courier New,Courier,monospace;">trunk/SCRIPTS/.mrun.config.default</span>) 27 already includes this setting.< /li><li>Modify the interface28 routines according to your needs.< /li><li>Start a PALM run26 already includes this setting.<br></li><li>Modify the interface 27 routines according to your needs.<br></li><li>Start a PALM run 29 28 by executing<br><br><span style="font-family: Courier New,Courier,monospace;"> 30 mrun -d example ...</span><br><br>The file <span style="font-family: Courier New,Courier,monospace;">31 user_ example.f90 </span>will be automatically compiled within32 the job and will replace PALM‘s default user-interface.<br></li></ol>The29 mrun -d example ...</span><br><br>The files<span style="font-family: Courier New,Courier,monospace;"> 30 user_***.f90 </span>will be automatically compiled within 31 the job and will replace the respective PALM‘s default user-interface routines.<br></li></ol>The 33 32 above method with including<span style="font-family: Courier New,Courier,monospace;"> $fname </span>in 34 33 the additional source path allows to use different user-interfaces for … … 39 38 “<span style="font-family: Courier New,Courier,monospace;">-d 40 39 abcd</span>“, “<span style="font-family: Courier New,Courier,monospace;">-d cdef</span>“, 41 etc.<br><br><span style="font-weight: bold;">The 42 modified user-interface file cannot be pre-compiled by using mbuild!</span><br><br>While 40 etc.<br><br>If the user wants to add additional routines, he/she can a) put them into the default user-interface file <span style="font-family: Courier New,Courier,monospace;">user_additional_routines.f90</span> 41 or b) can create new files in the additional source directory. These 42 files must have names different from the default PALM source code 43 files. In case of b), the user must also copy the default makefile into 44 the additional source directory:<br><br><span style="font-family: Courier New,Courier,monospace;"> cp trunk/SOURCE/Makefile 45 USER_CODE/example</span><br><br>The makefile must be modified appropriately followinf the "make"-rules in order to allow the new files to be compiled.<br><br><span style="font-weight: bold;">The 46 modified user-interface files cannot be pre-compiled by using mbuild!</span><br><br>While 43 47 programming user-defined code, 44 48 errors are frequently made. Possible ways of error -
palm/trunk/DOC/app/chapter_3.5.html
r62 r212 16 16 2.0</a> and the technical documentation are usually not 17 17 sufficient 18 and must be supplemented by the rigorous study of the source code of 19 the model. Programming experiences with FORTRAN95 and if necessary 18 and must be supplemented by a rigorous study of the model's source code. Programming experiences with FORTRAN95 and if necessary 20 19 experiences with the parallelization tool MPI are absolutely 21 nec cessary! </p>20 necessary! </p> 22 21 <p style="line-height: 100%;">Changes of the standard 23 22 model code by the … … 43 42 pre-defined names, which must not be changed by the user. Their basic 44 43 versions are a component of the standard model 45 code and they are all included in the source code file46 <tt><font style="font-size: 10pt;" size="2">user_ interface.f90</font></tt><font style="font-size: 10pt;" size="2">.</font>44 code and can be found in the source code files 45 <tt><font style="font-size: 10pt;" size="2">user_***.f90</font></tt><font style="font-size: 10pt;" size="2">.</font> 47 46 <font color="#000000">The</font> basic versions 48 47 accomplish nearly no … … 50 49 user as required. Actions which are already accomplished in these 51 50 basic versions by default should not be changed. Here is an example 52 of such a basic version : </p>51 of such a basic version (file <span style="font-family: Courier New,Courier,monospace;">user_init.f90</span>): </p> 53 52 <p style="line-height: 100%;"> </p> 54 53 <pre style="line-height: 100%;"><font color="#000000"><font style="font-size: 10pt;" size="2">SUBROUTINE user_init</font></font><br><br><font color="#000000"><font style="font-size: 10pt;" size="2">!------------------------------------------------------------------------------</font></font><br><font color="#000000"><font style="font-size: 10pt;" size="2">!</font></font><br><font color="#000000"><font style="font-size: 10pt;" size="2">!</font></font><br><font color="#000000"><font style="font-size: 10pt;" size="2">! Description:</font></font><br><font color="#000000"><font style="font-size: 10pt;" size="2">! -----------</font></font><br><font color="#000000"><font style="font-size: 10pt;" size="2">! Execution of user-defined initializing actions</font></font><br><font color="#000000"><font style="font-size: 10pt;" size="2">!------------------------------------------------------------------------------</font></font><br><font color="#000000"><font style="font-size: 10pt;" size="2">!</font></font><br><br><font color="#000000"> <font style="font-size: 10pt;" size="2">USE control_parameters</font></font><br><font color="#000000"> <font style="font-size: 10pt;" size="2">USE user</font></font><br><br><font color="#000000"> <font style="font-size: 10pt;" size="2">IMPLICIT NONE</font></font><br><br><font color="#000000"><font style="font-size: 10pt;" size="2">!</font></font><br><font color="#000000"><font style="font-size: 10pt;" size="2">!-- Here the user defined initializing actions follow:</font></font><br><br><br><font color="#000000"><font style="font-size: 10pt;" size="2">END SUBROUTINE user_init</font></font></pre><p style="line-height: 100%;">The communication (handling of … … 67 66 appears in the example 68 67 above. This is a 69 user-defined module (it is located at 70 the beginning of the file <tt><font style="font-size: 10pt;" size="2">user_interface.f90</font></tt>) 68 user-defined module (it can be found in file <tt><font style="font-size: 10pt;" size="2">user_module.f90</font></tt>) 71 69 and can be used for communication between the user-defined routines. In 72 70 this module own variables can be declared as desired. It 73 is not used outside of the user code. </p>71 is not used (and should not be used!) outside of the user code. </p> 74 72 <p style="line-height: 100%;">A very typical request of 75 73 users is the … … 79 77 for calculating and output of such quantities (see <a href="chapter_3.5.4.html">3.5.4</a>).</p><p style="line-height: 100%;">As already mentioned, the 80 78 contents of 81 the file <tt><font style="font-size: 10pt;" size="2">user_interface.f90</font></tt> 82 can be used as a basis for extensions. However the file should not be 83 manipulated directly (it is anyway write protected by default), but it 84 should be 85 copied to another file. User write permits for this new file must be 86 declared by means of the unix command <tt><font style="font-size: 10pt;" size="2">chmod</font></tt>. 79 the files <tt><font style="font-size: 10pt;" size="2">user_***.f90</font></tt> 80 can be used as a basis for extensions. However these files should not be 81 manipulated directly. Instead, a copy should be used. 87 82 </p> 88 83 <p style="line-height: 100%;">The following sections -
palm/trunk/SOURCE/CURRENT_MODIFICATIONS
r211 r212 42 42 dwdy, dvdx and dwdx. (production_e) 43 43 44 combine_plot_fields, header, production_e 44 Bugfix in calculating k index in case of oceans runs. (sort_particles) 45 46 advec_particles, combine_plot_fields, header, production_e -
palm/trunk/SOURCE/advec_particles.f90
r198 r212 4 4 ! Actual revisions: 5 5 ! ----------------- 6 ! Bugfix in calculating k index in case of oceans runs (sort_particles) 6 7 ! TEST: PRINT statements on unit 9 (commented out) 7 8 ! … … 1875 1876 1876 1877 ! 1877 !-- User-defined actions after the evaluation of the new particle position1878 !-- User-defined actions after the calculation of the new particle position 1878 1879 CALL user_advec_particles 1879 1880 … … 3890 3891 i = ( particles(n)%x + 0.5 * dx ) * ddx 3891 3892 j = ( particles(n)%y + 0.5 * dy ) * ddy 3892 k = particles(n)%z / dz + 1 + offset_ocean_nzt _m13893 k = particles(n)%z / dz + 1 + offset_ocean_nzt 3893 3894 ! only exact if equidistant 3894 3895 … … 3925 3926 i = ( particles(n)%x + 0.5 * dx ) * ddx 3926 3927 j = ( particles(n)%y + 0.5 * dy ) * ddy 3927 k = particles(n)%z / dz + 1 + offset_ocean_nzt _m13928 k = particles(n)%z / dz + 1 + offset_ocean_nzt 3928 3929 ! only exact if equidistant 3929 3930
Note: See TracChangeset
for help on using the changeset viewer.