Index: palm/trunk/DOC/app/chapter_3.5.5.html
===================================================================
--- palm/trunk/DOC/app/chapter_3.5.5.html	(revision 5)
+++ palm/trunk/DOC/app/chapter_3.5.5.html	(revision 40)
@@ -1,9 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-<html>
-<head>
-  <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)">
+<html><head>
+  <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">
@@ -14,113 +12,20 @@
 		@page { size: 21cm 29.7cm }
 	-->
-	</style>
-</head>
+	</style></head>
+
 <body dir="ltr" lang="en-US">
 <h3 style="line-height: 100%;"><font size="4">3.5.5 Compiling and
 linking user-defined code<br>
 </font></h3>
-<p style="line-height: 100%;">The compiling and linking of
-user-defined code into a model run is done via the shellscript
-<a
- href="http://www.muk.uni-hannover.de/institut/software/mrun_beschreibung.html">mrun</a>.
-The simplest (however not the most comfortable) way is by giving the
-filenames of the files containing the user-defined code as an argument
-of the shellscript option <a
- href="http://www.muk.uni-hannover.de/institut/software/mrun_beschreibung.html#Opt-s">-s</a>.
-If the user-defined subroutines are located e.g. on the two files <span
- style="font-family: monospace;">user1.f90</span> and <span
- style="font-family: monospace;">user2.f90</span>, then
-the <b>mrun</b> call has to be:<br>
-</p>
-<p style="line-height: 100%; margin-left: 40px;"><span
- style="font-family: monospace;">mrun... -s "user1.f90 user2.f90" ... .</span><br>
-</p>
-<p style="line-height: 100%;">For this call the user has to be in the
-working directory <tt><tt><font style="font-size: 10pt;" size="2">~/palm/current_version/SOURCE</font></tt></tt>,
-because the file with the source code of the main program is located
-here. The main program is compiled with
-each model run (without the appropriate filename given as argument for
-the
-option -s). </p>
-<p style="line-height: 100%;">The call </p>
-<ul>
-  <pre style="margin-bottom: 0.5cm; line-height: 100%;"><font
- style="font-size: 10pt;" size="2">mrun
- -s TEST
-,</font></pre>
-</ul>
-<p style="line-height: 100%;">is simpler and causes the compilation
-of all files with suffix <tt><font style="font-size: 10pt;" size="2">.f90</font></tt>
-located in the working
-directory <font face="Thorndale, serif">a</font>nd having
-user write permissions.&nbsp; Unchanged sources of the default model
-have read permission only and therefore are not compiled with that
-call. </p>
-<p style="line-height: 100%;">Typically, users may have different
-versions
-of user-defined code which are to be used for different model runs.
-According to the method just described for starting a certain model
-run,
-the associated user-defined code would have to be copied into the
-working directory and code for other runs may have to be
-removed (otherwise theses files would be compiled as well and the
-routines like <tt><font style="font-size: 10pt;" size="2">user_actions</font></tt>
-would occur twice or several times which would lead to compiling
-errors). This procedure is quite tedious and can lead to errors if
-different
-model runs with restarts are to be carried out at the same time. It is
-better
-to store the different versions of user-defined code in different
-subdirectories
-using the base file name of the respective model run as subdirectory
-name. In this case a line like </p>
-<ul>
-  <pre style="margin-bottom: 0.5cm; line-height: 100%;"><font
- style="font-size: 10pt;" size="2">% </font><a
- href="http://www.muk.uni-hannover.de/institut/software/mrun_beschreibung.html#add_source_path"><font
- style="font-size: 10pt;" size="2">add_source_path</font></a><font
- style="font-size: 10pt;" size="2"> $HOME/palm/current_version/SOURCE/USER_CODE/$fname</font></pre>
-</ul>
-<p style="line-height: 100%;">has to be added to the <b>mrun</b>
-configuration file. If you call <b>mrun</b> now with </p>
-<ul>
-  <pre style="margin-bottom: 0.5cm; line-height: 100%;"><font
- style="font-size: 10pt;" size="2">mrun -d run1  -s user1.f90 user2.f90
-,</font></pre>
-</ul>
-<p style="line-height: 100%;">the additional entry in the configuration
-file
-causes that the files given as argument of the option -s are also
-looked
-for in the directory <tt><font style="font-size: 10pt;" size="2">$HOME/palm/current_version/SOURCE/USER_CODE/run1</font></tt><font
- style="font-size: 10pt;" size="2">,</font>
-in case they are not found in the current working directory. The
-specification of <tt><font style="font-size: 10pt;" size="2">-s</font><font
- size="2">
-TEST</font></tt> in the <b>mrun</b> call now causes compilation of all
-files with suffix <tt><font style="font-size: 10pt;" size="2">.f90</font></tt>
-and user write permissions which are located in the working
-directory or in the directory indicated by <span
- style="font-family: monospace;">add_source_path</span>. In
-this case no files with the same name are allowed to be in these two
-directories. </p>
-<p style="line-height: 100%;">Further detailed information for linking
-user-defined code with <b>mrun</b> can be found in <a
- href="http://www.muk.uni-hannover.de/institut/software/mrun_beschreibung.html#chapter7">chapter
-7</a> of the <b>mrun </b>documentation (only in German). </p>
-<p style="line-height: 100%;">While programming user-defined code,
+<p style="line-height: 100%;">Users can add their own (modified) user-interface to a PALM-run by carrying out the following steps:</p><ol><li>Copy the default (empty) user-interface (file<span style="font-family: Courier New,Courier,monospace;"> user_interface.f90</span>) to a directory of your choice, e.g.:<br><br><span style="font-family: Courier New,Courier,monospace;">&nbsp; &nbsp;cd ~/palm/current_version</span><br style="font-family: Courier New,Courier,monospace;"><span style="font-family: Courier New,Courier,monospace;">&nbsp; &nbsp;mkdir -p USER_CODE/example</span><br style="font-family: Courier New,Courier,monospace;"><span style="font-family: Courier New,Courier,monospace;">&nbsp; &nbsp;cp trunk/SOURCE/user_interface.f90&nbsp; USER_CODE/example/user_example.f90</span><br></li><li>Set an additional path in the configuration file<span style="font-family: Courier New,Courier,monospace;"> .mrun.config </span>to allow <span style="font-weight: bold;">mrun </span>to find and include this file:<br><br><span style="font-family: Courier New,Courier,monospace;">&nbsp; &nbsp;%add_source_path&nbsp;&nbsp; $base_directory/USER_CODE/$fname</span><br><br>The default configuration file (<span style="font-family: Courier New,Courier,monospace;">trunk/SCRIPTS/.mrun.config.default</span>) already includes this setting.</li><li>Modify the interface routines according to your needs.</li><li>Start a PALM run by executing<br><br><span style="font-family: Courier New,Courier,monospace;">&nbsp; &nbsp;mrun -d example ...</span><br><br>The file<span style="font-family: Courier New,Courier,monospace;"> user_example.f90 </span>will be automatically compiled within the job and will replace PALM&lsquo;s default user-interface.<br></li></ol>The above method with including<span style="font-family: Courier New,Courier,monospace;"> $fname </span>in
+the additional source path allows to use different user-interfaces for
+different runs at the same time. Just store the respective
+interface-files in subdirectories<span style="font-family: Courier New,Courier,monospace;"> USER_CODE/abcd</span>,<span style="font-family: Courier New,Courier,monospace;"> USER_CODE/cdef</span>, etc. and start <span style="font-weight: bold;">mrun</span> with option &ldquo;<span style="font-family: Courier New,Courier,monospace;">-d abcd</span>&ldquo;, &ldquo;<span style="font-family: Courier New,Courier,monospace;">-d cdef</span>&ldquo;, etc.<br><br><span style="font-weight: bold;">The modified user-interface file cannot be pre-compiled by using mbuild!</span><br><br>While programming user-defined code,
 errors are frequently made. Possible ways of error
-tracing are described in the next chapter. <br>
+tracing are described in the next chapter. <br><p style="line-height: 100%;">
 &nbsp; </p>
 <hr>
 <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.6.html"><font
- color="#000080"><img src="right.gif" name="Grafik3" align="bottom"
- border="2" height="32" width="32"></font></a></font></font></p>
+<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.6.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 change:&nbsp;</i> 15/04/05 (SR)</p>
-</body>
-</html>
+</body></html>
