[5] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
---|
| 2 | <html> |
---|
| 3 | <head> |
---|
| 4 | <meta http-equiv="CONTENT-TYPE" |
---|
| 5 | content="text/html; charset=windows-1252"> |
---|
| 6 | <title>PALM chapter 3.5.5</title> |
---|
| 7 | <meta name="GENERATOR" content="StarOffice 7 (Win32)"> |
---|
| 8 | <meta name="AUTHOR" content="Siegfried Raasch"> |
---|
| 9 | <meta name="CREATED" content="20040802;14050943"> |
---|
| 10 | <meta name="CHANGED" content="20041117;12180008"> |
---|
| 11 | <meta name="KEYWORDS" content="parallel LES model"> |
---|
| 12 | <style> |
---|
| 13 | <!-- |
---|
| 14 | @page { size: 21cm 29.7cm } |
---|
| 15 | --> |
---|
| 16 | </style> |
---|
| 17 | </head> |
---|
| 18 | <body dir="ltr" lang="en-US"> |
---|
| 19 | <h3 style="line-height: 100%;"><font size="4">3.5.5 Compiling and |
---|
| 20 | linking user-defined code<br> |
---|
| 21 | </font></h3> |
---|
| 22 | <p style="line-height: 100%;">The compiling and linking of |
---|
| 23 | user-defined code into a model run is done via the shellscript |
---|
| 24 | <a |
---|
| 25 | href="http://www.muk.uni-hannover.de/institut/software/mrun_beschreibung.html">mrun</a>. |
---|
| 26 | The simplest (however not the most comfortable) way is by giving the |
---|
| 27 | filenames of the files containing the user-defined code as an argument |
---|
| 28 | of the shellscript option <a |
---|
| 29 | href="http://www.muk.uni-hannover.de/institut/software/mrun_beschreibung.html#Opt-s">-s</a>. |
---|
| 30 | If the user-defined subroutines are located e.g. on the two files <span |
---|
| 31 | style="font-family: monospace;">user1.f90</span> and <span |
---|
| 32 | style="font-family: monospace;">user2.f90</span>, then |
---|
| 33 | the <b>mrun</b> call has to be:<br> |
---|
| 34 | </p> |
---|
| 35 | <p style="line-height: 100%; margin-left: 40px;"><span |
---|
| 36 | style="font-family: monospace;">mrun... -s "user1.f90 user2.f90" ... .</span><br> |
---|
| 37 | </p> |
---|
| 38 | <p style="line-height: 100%;">For this call the user has to be in the |
---|
| 39 | working directory <tt><tt><font style="font-size: 10pt;" size="2">~/palm/current_version/SOURCE</font></tt></tt>, |
---|
| 40 | because the file with the source code of the main program is located |
---|
| 41 | here. The main program is compiled with |
---|
| 42 | each model run (without the appropriate filename given as argument for |
---|
| 43 | the |
---|
| 44 | option -s). </p> |
---|
| 45 | <p style="line-height: 100%;">The call </p> |
---|
| 46 | <ul> |
---|
| 47 | <pre style="margin-bottom: 0.5cm; line-height: 100%;"><font |
---|
| 48 | style="font-size: 10pt;" size="2">mrun
-s TEST
,</font></pre> |
---|
| 49 | </ul> |
---|
| 50 | <p style="line-height: 100%;">is simpler and causes the compilation |
---|
| 51 | of all files with suffix <tt><font style="font-size: 10pt;" size="2">.f90</font></tt> |
---|
| 52 | located in the working |
---|
| 53 | directory <font face="Thorndale, serif">a</font>nd having |
---|
| 54 | user write permissions. Unchanged sources of the default model |
---|
| 55 | have read permission only and therefore are not compiled with that |
---|
| 56 | call. </p> |
---|
| 57 | <p style="line-height: 100%;">Typically, users may have different |
---|
| 58 | versions |
---|
| 59 | of user-defined code which are to be used for different model runs. |
---|
| 60 | According to the method just described for starting a certain model |
---|
| 61 | run, |
---|
| 62 | the associated user-defined code would have to be copied into the |
---|
| 63 | working directory and code for other runs may have to be |
---|
| 64 | removed (otherwise theses files would be compiled as well and the |
---|
| 65 | routines like <tt><font style="font-size: 10pt;" size="2">user_actions</font></tt> |
---|
| 66 | would occur twice or several times which would lead to compiling |
---|
| 67 | errors). This procedure is quite tedious and can lead to errors if |
---|
| 68 | different |
---|
| 69 | model runs with restarts are to be carried out at the same time. It is |
---|
| 70 | better |
---|
| 71 | to store the different versions of user-defined code in different |
---|
| 72 | subdirectories |
---|
| 73 | using the base file name of the respective model run as subdirectory |
---|
| 74 | name. In this case a line like </p> |
---|
| 75 | <ul> |
---|
| 76 | <pre style="margin-bottom: 0.5cm; line-height: 100%;"><font |
---|
| 77 | style="font-size: 10pt;" size="2">% </font><a |
---|
| 78 | href="http://www.muk.uni-hannover.de/institut/software/mrun_beschreibung.html#add_source_path"><font |
---|
| 79 | style="font-size: 10pt;" size="2">add_source_path</font></a><font |
---|
| 80 | style="font-size: 10pt;" size="2"> $HOME/palm/current_version/SOURCE/USER_CODE/$fname</font></pre> |
---|
| 81 | </ul> |
---|
| 82 | <p style="line-height: 100%;">has to be added to the <b>mrun</b> |
---|
| 83 | configuration file. If you call <b>mrun</b> now with </p> |
---|
| 84 | <ul> |
---|
| 85 | <pre style="margin-bottom: 0.5cm; line-height: 100%;"><font |
---|
| 86 | style="font-size: 10pt;" size="2">mrun -d run1 -s user1.f90 user2.f90
,</font></pre> |
---|
| 87 | </ul> |
---|
| 88 | <p style="line-height: 100%;">the additional entry in the configuration |
---|
| 89 | file |
---|
| 90 | causes that the files given as argument of the option -s are also |
---|
| 91 | looked |
---|
| 92 | for in the directory <tt><font style="font-size: 10pt;" size="2">$HOME/palm/current_version/SOURCE/USER_CODE/run1</font></tt><font |
---|
| 93 | style="font-size: 10pt;" size="2">,</font> |
---|
| 94 | in case they are not found in the current working directory. The |
---|
| 95 | specification of <tt><font style="font-size: 10pt;" size="2">-s</font><font |
---|
| 96 | size="2"> |
---|
| 97 | TEST</font></tt> in the <b>mrun</b> call now causes compilation of all |
---|
| 98 | files with suffix <tt><font style="font-size: 10pt;" size="2">.f90</font></tt> |
---|
| 99 | and user write permissions which are located in the working |
---|
| 100 | directory or in the directory indicated by <span |
---|
| 101 | style="font-family: monospace;">add_source_path</span>. In |
---|
| 102 | this case no files with the same name are allowed to be in these two |
---|
| 103 | directories. </p> |
---|
| 104 | <p style="line-height: 100%;">Further detailed information for linking |
---|
| 105 | user-defined code with <b>mrun</b> can be found in <a |
---|
| 106 | href="http://www.muk.uni-hannover.de/institut/software/mrun_beschreibung.html#chapter7">chapter |
---|
| 107 | 7</a> of the <b>mrun </b>documentation (only in German). </p> |
---|
| 108 | <p style="line-height: 100%;">While programming user-defined code, |
---|
| 109 | errors are frequently made. Possible ways of error |
---|
| 110 | tracing are described in the next chapter. <br> |
---|
| 111 | </p> |
---|
| 112 | <hr> |
---|
| 113 | <p style="line-height: 100%;"><br> |
---|
| 114 | <font color="#000080"><font color="#000080"><a href="chapter_3.5.3.html"><font |
---|
| 115 | color="#000080"><img src="left.gif" name="Grafik1" align="bottom" |
---|
| 116 | border="2" height="32" width="32"></font></a><a href="index.html"><font |
---|
| 117 | color="#000080"><img src="up.gif" name="Grafik2" align="bottom" |
---|
| 118 | border="2" height="32" width="32"></font></a><a href="chapter_3.6.html"><font |
---|
| 119 | color="#000080"><img src="right.gif" name="Grafik3" align="bottom" |
---|
| 120 | border="2" height="32" width="32"></font></a></font></font></p> |
---|
| 121 | <p style="line-height: 100%;"><i>Last change: </i> 15/04/05 (SR)</p> |
---|
| 122 | </body> |
---|
| 123 | </html> |
---|