<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://source.geography.bristol.ac.uk/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Genie-user</id>
	<title>SourceWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://source.geography.bristol.ac.uk/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Genie-user"/>
	<link rel="alternate" type="text/html" href="https://source.geography.bristol.ac.uk/wiki/Special:Contributions/Genie-user"/>
	<updated>2026-04-05T13:24:08Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.8</generator>
	<entry>
		<id>https://source.geography.bristol.ac.uk/mediawiki/index.php?title=GENIE_Using_netCDF&amp;diff=8513</id>
		<title>GENIE Using netCDF</title>
		<link rel="alternate" type="text/html" href="https://source.geography.bristol.ac.uk/mediawiki/index.php?title=GENIE_Using_netCDF&amp;diff=8513"/>
		<updated>2012-05-23T09:30:02Z</updated>

		<summary type="html">&lt;p&gt;Genie-user: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Quickest Possible Start==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd genie/genie-main&lt;br /&gt;
make netcdf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will download the NetCDF library source code and compile, using the compiler selections in '''user.mak'''.  Once built, the libraries will be placed in the '''NETCDF_DIR''', also set in '''user.mak'''.&lt;br /&gt;
&lt;br /&gt;
==What is NetCDF? and why use it?==&lt;br /&gt;
&lt;br /&gt;
NetCDF is fast becoming the de facto standard format for storing climate model data.  It is a 'platform independent' format and so is good for sharing data between members of the community.  The format is also flexible in what can be stored and self-documenting--two more very useful features.  There is of course some overhead in learning any new file format, but I believe that using NetCDF is well worth the relatively small amount of effort (honest) involved.&lt;br /&gt;
&lt;br /&gt;
Data are stored in NetCDF in the form of ''variables''.  These can have '''dimensions''' and other '''attributes'''.  A NetCDF file is split into two main sections; (i) a header, which describes all the variables, dimensions and attributes; and (ii) the data part in which, well, the data is stored (ahem).&lt;br /&gt;
&lt;br /&gt;
In order to read and write data to and from a NetCDF file, we must tell our programs how to do it.  To do this fro scratch each time would be both tedious and a waste of time.  Luckily the kind folks at Unidata make a high-level ''interface'' available which we can use in our programs.  This is distributed in the form of a ''library'' which we can link to our programs. (They produce libraries for a number of languages such as F77 and F90, C and C++.)&lt;br /&gt;
&lt;br /&gt;
==Obtaining the NetCDF Libraries==&lt;br /&gt;
&lt;br /&gt;
You can download the source code for the NetCDF libraries from the [http://www.unidata.ucar.edu/software/netcdf/ Unidata NetCDF web page].  '''Note''' for older versions of the libraries, there is a choice of download between Fortran77 and Fortran90--i.e. there were different libraries for the two languages.  For more recent versions however, one downloa fits all:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
wget http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-4.0.tar.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Compiling the NetCDF libraries==&lt;br /&gt;
&lt;br /&gt;
The Unidata webpage contains links to documentation describing installing and using the libraries.  However, the quickstart below, may be enough to get you going.  Note that it's far easier if you use the same fortran compiler to compile both GENIE and the NetCDF libraries.  If you do not, then you will need to become familiar with compiler options which deal with the topic of &amp;quot;name mangling&amp;quot; (enough said).  Note that you will also most likely fair better with an up-to-date copy of the NetCDF libraries.  The libraries are written in C and Fortran.  You need to set some environment variables to tell the installation process which compilers you are using.  On my Linux system, using gcc to compile the C code and ifort for the Fortran, I typed the following in my bash shell:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tar -xzf netcdf-4.0.tar.gz&lt;br /&gt;
cd netcdf-4.0&lt;br /&gt;
./configure --prefix=${HOME}/netcdf/4.0 FC=gfortran CC=gcc CXX=g++ CPPFLAGS=&amp;quot;-DpgiFortran&amp;quot;&lt;br /&gt;
make&lt;br /&gt;
make check&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check that you have the created all the files you need.  You should see '''libnetcdf.a''' in the your installation lib directory.  For Fortran90 support, you will also need '''netcdf.mod''' in the include directory.&lt;br /&gt;
&lt;br /&gt;
==Linking with GENIE==&lt;br /&gt;
&lt;br /&gt;
Once you have compiled the NetCDF libraries, you must make them available to GENIE.  To do this, you will need edit '''genie-main/user.mak'''.  If you followed the example above, you should edit the line begining '''NETCDF_DIR=''' to be '''NETCDF_DIR=/opt/local'''.&lt;br /&gt;
&lt;br /&gt;
==If you get Compilation Errors==&lt;br /&gt;
&lt;br /&gt;
If you have followed the guidelines above and you still find you get errors compiling GENIE, then it is likely that these are due to something called '''name-mangling'''.  When I compiler creates ''object code'' from source code (you will see .o files created from .f files, for example--.o stands for 'object'), it ''mangles'' or decorates the names of functions, subroutines etc. typically with a number of leading or trailing underscores.  This is all fine and dandy--so long as the decorated names, or ''symbols'', match between your program and your library.  If different compilers were used to compile your NetCDF libraries and GENIE, then you will get a mismatch, and errors about '''unresolved symbols''', i.e. compiler A might work with symbols like '''myname_''', wheeras compiler B might expect '''myname__''' and hence we get trouble.&lt;br /&gt;
&lt;br /&gt;
If you are in this situation, you can do one of several things:&lt;br /&gt;
&lt;br /&gt;
# Make sure you use the same compiler for both the NetCDF libararies and GENIE.&lt;br /&gt;
# If (1) is true and you are using the '''g95''' compiler, you will need to add '''-fno-second-underscore''' to the Fortran compilation flags for both the NetCDF libs and GENIE &lt;br /&gt;
# If you can't satisfy (1) an argument to your compiler (such as in 2) can change the way it mangles names so that you can match the symbols in your NetCDF libraries to those expected when compiling GENIE.&lt;br /&gt;
&lt;br /&gt;
If you must use different compilers, you will find the UNIX command line tool '''nm''' useful for examing the contents of object files and libraries, e.g. &amp;lt;tt&amp;gt;nm path_to_netcdf_lib&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;nm path_to_a_genie_object_file&amp;lt;/tt&amp;gt;.  Determine the form of decoration and provide the appropriate options to the compiler.&lt;/div&gt;</summary>
		<author><name>Genie-user</name></author>
	</entry>
	<entry>
		<id>https://source.geography.bristol.ac.uk/mediawiki/index.php?title=GENIE_Versions&amp;diff=8512</id>
		<title>GENIE Versions</title>
		<link rel="alternate" type="text/html" href="https://source.geography.bristol.ac.uk/mediawiki/index.php?title=GENIE_Versions&amp;diff=8512"/>
		<updated>2012-05-23T09:21:05Z</updated>

		<summary type="html">&lt;p&gt;Genie-user: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==GENIE Versions==&lt;br /&gt;
&lt;br /&gt;
Latest released version: 2.7.1 (SVN tag '''rel-2-7-1''')&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot;&lt;br /&gt;
! Released Version&lt;br /&gt;
! Date&lt;br /&gt;
! SVN tag&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 2.8.0&lt;br /&gt;
| May 2012&lt;br /&gt;
| '''rel-2-8-0'''&lt;br /&gt;
| Cut down genie.F now default&lt;br /&gt;
|-&lt;br /&gt;
| 2.7.7&lt;br /&gt;
| April 2011&lt;br /&gt;
| '''rel-2-7-7'''&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 2.7.5&lt;br /&gt;
| January 2011&lt;br /&gt;
| '''rel-2-7-5'''&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 2.7.4&lt;br /&gt;
| October 2010&lt;br /&gt;
| '''rel-2-7-4'''&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 2.7.3&lt;br /&gt;
| August 2010&lt;br /&gt;
| '''release-2-7-3'''&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 2.7.2&lt;br /&gt;
| August 2010&lt;br /&gt;
| '''rel-2-7-2'''&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 2.7.1&lt;br /&gt;
| May 2010&lt;br /&gt;
| '''rel-2-7-1'''&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 2.7.0&lt;br /&gt;
| May 2010&lt;br /&gt;
| '''rel-2-7-0'''&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 2.6.0&lt;br /&gt;
| Feb 2010&lt;br /&gt;
| '''rel-2-6-0'''&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Genie-user</name></author>
	</entry>
	<entry>
		<id>https://source.geography.bristol.ac.uk/mediawiki/index.php?title=GENIE&amp;diff=8492</id>
		<title>GENIE</title>
		<link rel="alternate" type="text/html" href="https://source.geography.bristol.ac.uk/mediawiki/index.php?title=GENIE&amp;diff=8492"/>
		<updated>2012-01-10T14:10:28Z</updated>

		<summary type="html">&lt;p&gt;Genie-user: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Projects]]&lt;br /&gt;
&lt;br /&gt;
==Welcome to the GENIE wiki!==&lt;br /&gt;
&lt;br /&gt;
===Science Pages===&lt;br /&gt;
&lt;br /&gt;
* [[GENIE_module_intros|Introductions to the GENIE component models]]&lt;br /&gt;
* [[GENIE:Internal|Wiki Pages for members of the GENIE project]]&lt;br /&gt;
* [http://www.genie.ac.uk The GENIE website]&lt;br /&gt;
&lt;br /&gt;
===Tutorials for Using the Model===&lt;br /&gt;
&lt;br /&gt;
* [[GENIE_running_an_expt|Installing and running GENIE on your local machine]]&lt;br /&gt;
** [[GENIE_WindowsCompilation|Configuring a Windows build environment]]&lt;br /&gt;
* [[GENIE_Main|An overview of the key files in genie_main]]&lt;br /&gt;
* [[GENIE_Using_netCDF|Using NetCDF]]&lt;br /&gt;
* [[Using_GLIMMER|Using GLIMMER]]&lt;br /&gt;
* [[GENIE_GENIELabInstall|Installing GENIELab -- Running and Tuning GENIE from MatLab]]&lt;br /&gt;
* [[GENIE_GENIELab|Using GENIELab]]&lt;br /&gt;
* &amp;lt;del&amp;gt;[[GENIE_Using_NaturalDocs|Using NaturalDocs to document your code]]&amp;lt;/del&amp;gt;&lt;br /&gt;
* [[GENIE_Using_Doxygen|Using Doxygen to document your code]]&lt;br /&gt;
* [[GENIE_How-To|GENIE How-To]]&lt;br /&gt;
&lt;br /&gt;
===Framework Documentation===&lt;br /&gt;
&lt;br /&gt;
* [[GENIE_Coupling|PRISM coupling in GENIE]]&lt;br /&gt;
** [[GENIE_Gridspec|Gridspec for GENIE]] - towards a standard description for model grids (for use in PRISM coupling)&lt;br /&gt;
** [[GENIE_BFG|Introduction to BFG]] - BFG will automatically generate framework code (the &amp;quot;glue&amp;quot; code between models) for PRISM coupling&lt;br /&gt;
&lt;br /&gt;
* [[GENIE_ALADDIN2|ALADDIN: the GENIE launchpad]]&lt;br /&gt;
&lt;br /&gt;
===Misc===&lt;br /&gt;
&lt;br /&gt;
* [[GENIE_Quick_wiki_ref|Very sparse quick tips on wiki editing]]&lt;/div&gt;</summary>
		<author><name>Genie-user</name></author>
	</entry>
	<entry>
		<id>https://source.geography.bristol.ac.uk/mediawiki/index.php?title=GENIE_Quick_wiki_ref&amp;diff=8490</id>
		<title>GENIE Quick wiki ref</title>
		<link rel="alternate" type="text/html" href="https://source.geography.bristol.ac.uk/mediawiki/index.php?title=GENIE_Quick_wiki_ref&amp;diff=8490"/>
		<updated>2012-01-10T14:08:45Z</updated>

		<summary type="html">&lt;p&gt;Genie-user: moved GENIE:Quick wiki ref to GENIE Quick wiki ref&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Adding New Pages==&lt;br /&gt;
&lt;br /&gt;
* An easy way to create a new wiki page is to add a link to the new page from an existing page, e.g. &amp;lt;pre&amp;gt;[[GENIE_MyPage|A link to my page]]&amp;lt;/pre&amp;gt;  Save your changes, and the link will appear in red.  When you click on the link, you will be able to edit the content of the new page.&lt;br /&gt;
&lt;br /&gt;
* Another way to create a new page is to type a URL in the address window and, again, a new page will automatically be created, e.g. &amp;lt;pre&amp;gt; http://source.ggy.bris.ac.uk/wiki/GENIE_new_page_name &amp;lt;/pre&amp;gt;  Remember to link it to another page, however, or it will be left in limbo!&lt;br /&gt;
&lt;br /&gt;
==Editing Content==&lt;br /&gt;
&lt;br /&gt;
Below are a some examples markup used to format wikimedia pages (for more detail visit [http://meta.wikimedia.org/wiki/Help:Wikitext_examples markup examples]).  &lt;br /&gt;
&lt;br /&gt;
First click '''edit'''.  Click on '''Show preview''' to see the effect of your changes, and '''Save page''' when you're happy.&lt;br /&gt;
&lt;br /&gt;
* Headings &amp;lt;pre&amp;gt; ==Section Heading==   ===Subsection===   ====Subsubsection==== &amp;lt;/pre&amp;gt;&lt;br /&gt;
* Bullet lists &amp;lt;pre&amp;gt; * Item   ** Indented item   *** Deeper indentation&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Numbered lists &amp;lt;pre&amp;gt; # Item   ## Sublist item   ### etc &amp;lt;/pre&amp;gt;&lt;br /&gt;
* Description lists &amp;lt;pre&amp;gt; ; Category : description &amp;lt;/pre&amp;gt;&lt;br /&gt;
* Bold &amp;lt;pre&amp;gt; '''text''' &amp;lt;/pre&amp;gt;&lt;br /&gt;
* Italics &amp;lt;pre&amp;gt; ''text'' &amp;lt;/pre&amp;gt;&lt;br /&gt;
* Internal page links &amp;lt;pre&amp;gt;[[GENIE:MyPage|A link to my page]]&amp;lt;/pre&amp;gt;&lt;br /&gt;
* External page links &amp;lt;pre&amp;gt;  [http://www.google.co.uk Click here for Google]  &amp;lt;/pre&amp;gt;&lt;br /&gt;
* Tables&lt;br /&gt;
&amp;lt;pre&amp;gt; {| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! This&lt;br /&gt;
! is&lt;br /&gt;
|- &lt;br /&gt;
| a&lt;br /&gt;
| table&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Genie-user</name></author>
	</entry>
	<entry>
		<id>https://source.geography.bristol.ac.uk/mediawiki/index.php?title=GENIE_Quick_wiki_ref&amp;diff=8489</id>
		<title>GENIE Quick wiki ref</title>
		<link rel="alternate" type="text/html" href="https://source.geography.bristol.ac.uk/mediawiki/index.php?title=GENIE_Quick_wiki_ref&amp;diff=8489"/>
		<updated>2012-01-10T14:08:12Z</updated>

		<summary type="html">&lt;p&gt;Genie-user: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Adding New Pages==&lt;br /&gt;
&lt;br /&gt;
* An easy way to create a new wiki page is to add a link to the new page from an existing page, e.g. &amp;lt;pre&amp;gt;[[GENIE_MyPage|A link to my page]]&amp;lt;/pre&amp;gt;  Save your changes, and the link will appear in red.  When you click on the link, you will be able to edit the content of the new page.&lt;br /&gt;
&lt;br /&gt;
* Another way to create a new page is to type a URL in the address window and, again, a new page will automatically be created, e.g. &amp;lt;pre&amp;gt; http://source.ggy.bris.ac.uk/wiki/GENIE_new_page_name &amp;lt;/pre&amp;gt;  Remember to link it to another page, however, or it will be left in limbo!&lt;br /&gt;
&lt;br /&gt;
==Editing Content==&lt;br /&gt;
&lt;br /&gt;
Below are a some examples markup used to format wikimedia pages (for more detail visit [http://meta.wikimedia.org/wiki/Help:Wikitext_examples markup examples]).  &lt;br /&gt;
&lt;br /&gt;
First click '''edit'''.  Click on '''Show preview''' to see the effect of your changes, and '''Save page''' when you're happy.&lt;br /&gt;
&lt;br /&gt;
* Headings &amp;lt;pre&amp;gt; ==Section Heading==   ===Subsection===   ====Subsubsection==== &amp;lt;/pre&amp;gt;&lt;br /&gt;
* Bullet lists &amp;lt;pre&amp;gt; * Item   ** Indented item   *** Deeper indentation&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Numbered lists &amp;lt;pre&amp;gt; # Item   ## Sublist item   ### etc &amp;lt;/pre&amp;gt;&lt;br /&gt;
* Description lists &amp;lt;pre&amp;gt; ; Category : description &amp;lt;/pre&amp;gt;&lt;br /&gt;
* Bold &amp;lt;pre&amp;gt; '''text''' &amp;lt;/pre&amp;gt;&lt;br /&gt;
* Italics &amp;lt;pre&amp;gt; ''text'' &amp;lt;/pre&amp;gt;&lt;br /&gt;
* Internal page links &amp;lt;pre&amp;gt;[[GENIE:MyPage|A link to my page]]&amp;lt;/pre&amp;gt;&lt;br /&gt;
* External page links &amp;lt;pre&amp;gt;  [http://www.google.co.uk Click here for Google]  &amp;lt;/pre&amp;gt;&lt;br /&gt;
* Tables&lt;br /&gt;
&amp;lt;pre&amp;gt; {| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! This&lt;br /&gt;
! is&lt;br /&gt;
|- &lt;br /&gt;
| a&lt;br /&gt;
| table&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Genie-user</name></author>
	</entry>
	<entry>
		<id>https://source.geography.bristol.ac.uk/mediawiki/index.php?title=GENIE&amp;diff=7686</id>
		<title>GENIE</title>
		<link rel="alternate" type="text/html" href="https://source.geography.bristol.ac.uk/mediawiki/index.php?title=GENIE&amp;diff=7686"/>
		<updated>2010-09-26T10:45:34Z</updated>

		<summary type="html">&lt;p&gt;Genie-user: added How-To page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Projects]]&lt;br /&gt;
&lt;br /&gt;
==Welcome to the GENIE wiki!==&lt;br /&gt;
&lt;br /&gt;
===Science Pages===&lt;br /&gt;
&lt;br /&gt;
* [[GENIE_module_intros|Introductions to the GENIE component models]]&lt;br /&gt;
* [[GENIE:Internal|Wiki Pages for members of the GENIE project]]&lt;br /&gt;
* [http://www.genie.ac.uk The GENIE website]&lt;br /&gt;
&lt;br /&gt;
===Tutorials for Using the Model===&lt;br /&gt;
&lt;br /&gt;
* [[GENIE_running_an_expt|Installing and running GENIE on your local machine]]&lt;br /&gt;
** [[GENIE_WindowsCompilation|Configuring a Windows build environment]]&lt;br /&gt;
* [[GENIE_Main|An overview of the key files in genie_main]]&lt;br /&gt;
* [[GENIE_Using_netCDF|Using NetCDF]]&lt;br /&gt;
* [[Using_GLIMMER|Using GLIMMER]]&lt;br /&gt;
* [[GENIE_GENIELabInstall|Installing GENIELab -- Running and Tuning GENIE from MatLab]]&lt;br /&gt;
* [[GENIE_GENIELab|Using GENIELab]]&lt;br /&gt;
* &amp;lt;del&amp;gt;[[GENIE_Using_NaturalDocs|Using NaturalDocs to document your code]]&amp;lt;/del&amp;gt;&lt;br /&gt;
* [[GENIE_Using_Doxygen|Using Doxygen to document your code]]&lt;br /&gt;
* [[GENIE_How-To|GENIE How-To]]&lt;br /&gt;
&lt;br /&gt;
===Framework Documentation===&lt;br /&gt;
&lt;br /&gt;
* [[GENIE_Coupling|PRISM coupling in GENIE]]&lt;br /&gt;
** [[GENIE_Gridspec|Gridspec for GENIE]] - towards a standard description for model grids (for use in PRISM coupling)&lt;br /&gt;
** [[GENIE_BFG|Introduction to BFG]] - BFG will automatically generate framework code (the &amp;quot;glue&amp;quot; code between models) for PRISM coupling&lt;br /&gt;
&lt;br /&gt;
* [[GENIE_ALADDIN2|ALADDIN: the GENIE launchpad]]&lt;/div&gt;</summary>
		<author><name>Genie-user</name></author>
	</entry>
	<entry>
		<id>https://source.geography.bristol.ac.uk/mediawiki/index.php?title=GENIE_WindowsCompilation&amp;diff=7346</id>
		<title>GENIE WindowsCompilation</title>
		<link rel="alternate" type="text/html" href="https://source.geography.bristol.ac.uk/mediawiki/index.php?title=GENIE_WindowsCompilation&amp;diff=7346"/>
		<updated>2010-05-10T14:30:27Z</updated>

		<summary type="html">&lt;p&gt;Genie-user: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Building GENIE on Windows Platforms==&lt;br /&gt;
The GENIE makefiles have been modified to enable a command line compilation of the framework under Windows using Linux emulation software.&lt;br /&gt;
&lt;br /&gt;
===Prerequisites===&lt;br /&gt;
In order to build GENIE on a Windows platform you will need to install and configure a suitable environment consisting of&lt;br /&gt;
&lt;br /&gt;
* A linux emulator&lt;br /&gt;
* Third party libraries including NetCDF&lt;br /&gt;
* A Windows Fortran compiler&lt;br /&gt;
* A Windows Linker&lt;br /&gt;
&lt;br /&gt;
The build system is known to work with the following software:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|Tool&lt;br /&gt;
!Software&lt;br /&gt;
!Versions&lt;br /&gt;
!Notes&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; colspan=&amp;quot;2&amp;quot;| Linux emulation&lt;br /&gt;
| CygWin&lt;br /&gt;
| 1.5.12-1&lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
|-&lt;br /&gt;
| MinGW (MSYS)&lt;br /&gt;
| 1.0.10&lt;br /&gt;
| Build only. There is no bash shell available so genie_example.job cannot be executed.&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; colspan=&amp;quot;2&amp;quot;| Third party libraries&lt;br /&gt;
| NetCDF&lt;br /&gt;
| 3.5.0, 3.6.0, 3.6.1, 3.6.2&lt;br /&gt;
| Pre-built dll from UCAR can be used with the native microsoft compilers. We recommend building the NetCDF library locally.&lt;br /&gt;
|-&lt;br /&gt;
| Python&lt;br /&gt;
| 2.3.3+&lt;br /&gt;
| Available in CygWin. Must be installed separately for MinGW.&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;5&amp;quot;| Native Microsoft&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot;| Fortran Compiler&lt;br /&gt;
| Compaq Visual Fortran&lt;br /&gt;
| 6.6C&lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
|-&lt;br /&gt;
| Intel Visual Fortran&lt;br /&gt;
| 9.1, 10.0, 10.1&lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot;| C/C++ Compiler / Linker&lt;br /&gt;
| Microsoft Visual Studio .NET 2003&lt;br /&gt;
| 7.1.3088&lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
|-&lt;br /&gt;
| Microsoft Platform SDK for Server 2003&lt;br /&gt;
| R2&lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
|-&lt;br /&gt;
| Microsoft Visual Studio 2005&lt;br /&gt;
| 8.0.50727.762&lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;4&amp;quot;| GNU Compilers&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot;|Fortran Compiler&lt;br /&gt;
| GNU g95&lt;br /&gt;
| 0.91&lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
|-&lt;br /&gt;
| GNU gFortran&lt;br /&gt;
| 4.3.0&lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot;| C/C++ Compiler / Linker&lt;br /&gt;
| GNU gcc&lt;br /&gt;
| 4.0.3&lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
|-&lt;br /&gt;
| GNU ld&lt;br /&gt;
| 2.16.91&lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Installing a Linux Emulator===&lt;br /&gt;
In order to execute the GENIE build process on a Windows platform it is necessary to install a Linux emulator that can process the GNU make files. There are two popular Linux emulation tools for Windows; Cygwin and MinGW. Cygwin provides a comprehensive Linux emulation layer for Windows and can be used to build, execute and manage GENIE. MinGW (Minimalist GNU for Windows) provides a limited set of tools that are sufficient to build GENIE but cannot be used to configure the model for execution. We therefore recommend the Cygwin route but provide details of MinGW for completeness.&lt;br /&gt;
&lt;br /&gt;
====Cygwin installation====&lt;br /&gt;
Download the Cygwin setup executable from the Cygwin website at [http://cygwin.com/ http://cygwin.com/].&lt;br /&gt;
Execute the setup program and install Cygwin as directed.&lt;br /&gt;
When asked to select packages please ensure that the following packages are installed:&lt;br /&gt;
* Base --&amp;gt; bash&lt;br /&gt;
* Devel --&amp;gt; make&lt;br /&gt;
* Devel --&amp;gt; gcc, gcc-core, gcc-g77, gcc-g++, subversion&lt;br /&gt;
* Utils --&amp;gt; diffutils&lt;br /&gt;
* Interpreters --&amp;gt; python&lt;br /&gt;
* Interpreters --&amp;gt; perl   (for documentation)&lt;br /&gt;
* Libs --&amp;gt; libxslt&lt;br /&gt;
* gfortran specific requirements&lt;br /&gt;
** Math --&amp;gt; gmp&lt;br /&gt;
** Math --&amp;gt; mpfr&lt;br /&gt;
&lt;br /&gt;
The Cygwin file &amp;lt;code&amp;gt;C:\cygwin\bin\link.exe&amp;lt;/code&amp;gt; needs to be moved so that the Visual Studio &amp;lt;code&amp;gt;link.exe&amp;lt;/code&amp;gt; linker can be picked up in preference. Alternatively, the Cygwin path would need to be updated to place the Visual Studio linker ahead of the Cygwin default.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Native Win32 Compiler Configuration&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Compaq Visual Fortran&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We assume that you have a standard installation of the Intel or Compaq Visual Fortran product on your system. In order to make the compiler and linker available at the command line within the Cygwin shell we recommend editing the batch file that launches Cygwin as follows. Edit the file &amp;lt;cygwin&amp;gt;/cygwin.bat (adjusting the paths to the compilers as appropriate):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
call &amp;quot;C:\Program Files\Microsoft Visual Studio\DF98\BIN\DFVARS.BAT&amp;quot;&lt;br /&gt;
call &amp;quot;C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\vcvars32.bat&amp;quot;&lt;br /&gt;
&lt;br /&gt;
C:&lt;br /&gt;
chdir C:\cygwin\bin&lt;br /&gt;
&lt;br /&gt;
bash --login -i&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Intel Visual Fortran&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
call &amp;quot;C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\SetEnv.Cmd&amp;quot; /XP32 /RETAIL&lt;br /&gt;
call &amp;quot;C:\Program Files\Intel\Compiler\Fortran\9.1\ia32\Bin\IFortVars.bat&amp;quot;&lt;br /&gt;
&lt;br /&gt;
C:&lt;br /&gt;
chdir C:\cygwin\bin&lt;br /&gt;
&lt;br /&gt;
bash --login -i&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;GNU g95 Compiler Installation&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For up to date details please see [http://ftp.g95.org/#Win http://ftp.g95.org/#Win].&lt;br /&gt;
Download g95-x86-cygwin.tgz from [http://ftp.g95.org/g95-x86-cygwin.tgz http://ftp.g95.org/g95-x86-cygwin.tgz].&lt;br /&gt;
Copy this file to the root of your cygwin distribution.&lt;br /&gt;
In cygwin:&lt;br /&gt;
  cd /&lt;br /&gt;
  tar zxvf g95-x86-cygwin.tgz&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;GNU gFortran Compiler Installation&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For up to date details please see [http://gcc.gnu.org/wiki/GFortranBinariesCygwin http://gcc.gnu.org/wiki/GFortranBinariesCygwin].&lt;br /&gt;
Download the latest release of the compiler. A link to the location of the latest release can be found at [http://gcc.gnu.org/wiki/GFortranBinaries http://gcc.gnu.org/wiki/GFortranBinaries].&lt;br /&gt;
Move the release archive to the Cygwin root directory.&lt;br /&gt;
In Cygwin:&lt;br /&gt;
  cd /&lt;br /&gt;
  tar jxvf gfortran-4.3-Cygwin-i686.tar.bz2&lt;br /&gt;
  ln -s /usr/local/gfortran/bin/gfortran.exe /usr/local/bin/gfortran&lt;br /&gt;
  ln -s /usr/local/gfortran/bin/gfortran.exe /usr/local/bin/gfc&lt;br /&gt;
&lt;br /&gt;
====MinGW installation====&lt;br /&gt;
MinGW [http://www.mingw.org/ http://www.mingw.org/] provides a build environment capable to generating Windows executables that do not rely on 3rd party dlls.&lt;br /&gt;
&lt;br /&gt;
===Building NetCDF===&lt;br /&gt;
Download NetCDF source release from UCAR:&lt;br /&gt;
  http://www.unidata.ucar.edu/downloads/netcdf&lt;br /&gt;
Extract the contents of the archive to a convenient location &amp;lt;netcdf_root&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
====Microsoft Compilers====&lt;br /&gt;
The GENIE framework requires a full installation of the NetCDF library including the C, F77, F90 and C++ interfaces (although the latter is only required for the nightly build tests and can be omitted if these will not be run). The UCAR website does not currently (August 2005) provide pre-built binaries for Win32 satisfying these requirements so we must build the libraries manually.&lt;br /&gt;
&lt;br /&gt;
Download the NetCDF source code from the UCAR website:&lt;br /&gt;
&lt;br /&gt;
[ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf.tar.gz ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf.tar.gz]&lt;br /&gt;
&lt;br /&gt;
Extract the contents of the archive to a local directory. Open the src\win32\NET\netcdf.sln file with Microsoft Visual Studio. Open the Configuration Manager and set the Active Solution to &amp;quot;Release&amp;quot;. Highlight the netcdf project and open the properties dialog. Select C/C++ -&amp;gt; Command Line and add the following compiler option in the Additional Options dialog:&lt;br /&gt;
&lt;br /&gt;
  /D FCALLSC_QUALIFIER=&amp;quot;__declspec(dllexport) __stdcall&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This compiler directive causes the F77 interface to be built in addition to the default C interface. Build the solution and close Visual Studio.&lt;br /&gt;
&lt;br /&gt;
Open a Command Prompt and configure the CVF and the VC++.NET environments (modify the paths to your local installation if necessary):&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;C:\Program Files\Microsoft Visual Studio\DF98\BIN\DFVARS.BAT&amp;quot;&lt;br /&gt;
  &amp;quot;C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\vcvars32.bat&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Navigate to the src\f90 directory and build the F90 library:&lt;br /&gt;
&lt;br /&gt;
  Compaq Visual Fortran:&lt;br /&gt;
  f90.exe /compile_only typeSizes.f90&lt;br /&gt;
  f90.exe /compile_only netcdf.f90&lt;br /&gt;
  lib /OUT:netcdf_f90.lib typeSizes.obj netcdf.obj&lt;br /&gt;
&lt;br /&gt;
  Intel Visual Fortran:&lt;br /&gt;
  ifort.exe /iface:cvf /compile-only typeSizes.f90&lt;br /&gt;
  ifort.exe /iface:cvf /compile-only netcdf.f90&lt;br /&gt;
  lib /OUT:netcdf_f90.lib typeSizes.obj netcdf.obj&lt;br /&gt;
&lt;br /&gt;
The Win32 build of the C++ interface is not officially supported by UCAR (at least no specific documentation exists on this). Unfortunately, we require a 'hack' to the code to get the C++ interface to build using Visual Studio. Create a copy of the netcdf.h header file:&lt;br /&gt;
&lt;br /&gt;
  copy src\libsrc\netcdf.h src\cxx\netcdf.h&lt;br /&gt;
&lt;br /&gt;
Edit the new copy of netcdf.h in src\cxx and comment out line 199 (line number may vary between releases)&lt;br /&gt;
&lt;br /&gt;
  // #define off_t __int64&lt;br /&gt;
&lt;br /&gt;
Navigate to the src\cxx directory and build the C++ library:&lt;br /&gt;
&lt;br /&gt;
  netcdf-3.6.0-p1:&lt;br /&gt;
  cl.exe /c /O2 /I..\libsrc /DNDEBUG /D &amp;quot;DLL_NETCDF&amp;quot; /EHsc netcdf.cpp&lt;br /&gt;
  cl.exe /c /O2 /I..\libsrc /DNDEBUG /D &amp;quot;DLL_NETCDF&amp;quot; /EHsc ncvalues.cpp&lt;br /&gt;
  lib /OUT:netcdf_c++.lib netcdf.obj ncvalues.obj&lt;br /&gt;
&lt;br /&gt;
  netcdf-3.6.1:&lt;br /&gt;
  cl.exe /c /O2 /I..\libsrc /I..\win32\NET /DNDEBUG /D &amp;quot;DLL_NETCDF&amp;quot; /EHsc netcdf.cpp&lt;br /&gt;
  cl.exe /c /O2 /I..\libsrc /I..\win32\NET /DNDEBUG /D &amp;quot;DLL_NETCDF&amp;quot; /EHsc ncvalues.cpp&lt;br /&gt;
  lib /OUT:netcdf_c++.lib netcdf.obj ncvalues.obj&lt;br /&gt;
&lt;br /&gt;
Unfortunately, we have to create our own installation. Please create directories and copy files as indicated below. Use the command prompt or Windows Explorer according to preference.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd &amp;lt;netcdf_root&amp;gt;		(contains the src folder)&lt;br /&gt;
[cut-and-paste should work for the commands below]&lt;br /&gt;
&lt;br /&gt;
mkdir bin&lt;br /&gt;
mkdir lib&lt;br /&gt;
mkdir include&lt;br /&gt;
&lt;br /&gt;
copy src\win32\NET\Release\netcdf.dll bin\&lt;br /&gt;
copy src\win32\NET\Release\ncdump.exe bin\&lt;br /&gt;
copy src\win32\NET\Release\ncgen.exe bin\&lt;br /&gt;
&lt;br /&gt;
copy src\win32\NET\Release\netcdf.lib lib\&lt;br /&gt;
copy src\f90\netcdf_f90.lib lib\&lt;br /&gt;
copy &amp;quot;src\cxx\netcdf_c++.lib&amp;quot; lib\&lt;br /&gt;
&lt;br /&gt;
copy src\libsrc\netcdf.h include\&lt;br /&gt;
copy src\fortran\netcdf.inc include\&lt;br /&gt;
copy src\f90\netcdf.mod include\&lt;br /&gt;
copy src\f90\typeSizes.mod include\&lt;br /&gt;
copy src\cxx\netcdf.hh include\&lt;br /&gt;
copy src\cxx\netcdfcpp.h include\&lt;br /&gt;
copy src\cxx\ncvalues.h include\&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====GNU Compilers====&lt;br /&gt;
In a Cygwin environment that has g95 installed, navigate to the NetCDF directory (here &amp;lt;netcdf_root_cygpath&amp;gt; refers to the location of the NetCDF root in the Cygwin path style. e.g. /cygdrive/c/netcdf-3.6.2).&lt;br /&gt;
  cd &amp;lt;netcdf_root_cygpath&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;g95 Compiler&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  FC=g95 ./configure --prefix=&amp;lt;netcdf_root_cygpath&amp;gt;&lt;br /&gt;
  make check&lt;br /&gt;
  make install&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;gfortran Compiler&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  FC=gfortran CPPFLAGS=-DpgiFortran ./configure --prefix=&amp;lt;netcdf_root_cygpath&amp;gt;&lt;br /&gt;
  make check&lt;br /&gt;
  make install&lt;br /&gt;
&lt;br /&gt;
'''NB. If the &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt; phase fails indicating that the f90 compiler is not working then please check that you have installed the Math packages GMP and MPFR into Cygwin.'''&lt;br /&gt;
&lt;br /&gt;
'''If &amp;lt;code&amp;gt;make check&amp;lt;/code&amp;gt; fails, try &amp;lt;code&amp;gt;make distclean&amp;lt;/code&amp;gt; ,reset your enviroment variables and rerun &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt;.'''&lt;br /&gt;
&lt;br /&gt;
===Configuring the GENIE build===&lt;br /&gt;
I strongly recommend checking out the GENIE code into a directory that &amp;lt;em&amp;gt;does not&amp;lt;/em&amp;gt; contain any space characters. We have not tested builds with paths containing spaces, they may or may not work. Life is simpler without the spaces.&lt;br /&gt;
&lt;br /&gt;
====Native Microsoft Compilers====&lt;br /&gt;
Edit user.sh:&lt;br /&gt;
  CODEDIR=/cygdrive/drive_letter/path/to/genie&lt;br /&gt;
  OUTROOT=/cygdrive/drive_letter/path/to/output&lt;br /&gt;
&lt;br /&gt;
Edit user.mak:&lt;br /&gt;
  GENIE_ROOT=/cygdrive/drive_letter/path/to/genie&lt;br /&gt;
  OUT_DIR=/cygdrive/drive_letter/path/to/output&lt;br /&gt;
&lt;br /&gt;
Select the appropriate Windows version of the GNU compiler:&lt;br /&gt;
  Either:&lt;br /&gt;
  F77=f90.exe&lt;br /&gt;
  Or:&lt;br /&gt;
  F77=ifort.exe&lt;br /&gt;
&lt;br /&gt;
And set the other relevant flags&lt;br /&gt;
&lt;br /&gt;
  CXX=cl.exe&lt;br /&gt;
  MACHINE=WIN32&lt;br /&gt;
  NETCDF_DIR=E:\\users\\andrew\\netcdf-3.6.0-p1&lt;br /&gt;
  NETCDF_NAME=netcdf.lib&lt;br /&gt;
&lt;br /&gt;
Change the path as appropriate for the location of your Win32 NetCDF installation.&lt;br /&gt;
&lt;br /&gt;
====GNU Compilers====&lt;br /&gt;
Edit user.sh:&lt;br /&gt;
  CODEDIR=/cygdrive/drive_letter/path/to/genie&lt;br /&gt;
  OUTROOT=/cygdrive/drive_letter/path/to/output&lt;br /&gt;
&lt;br /&gt;
Edit user.mak:&lt;br /&gt;
  GENIE_ROOT=/cygdrive/drive_letter/path/to/genie&lt;br /&gt;
  OUT_DIR=/cygdrive/drive_letter/path/to/output&lt;br /&gt;
&lt;br /&gt;
Select the appropriate Windows version of the GNU compiler:&lt;br /&gt;
  Either:&lt;br /&gt;
  F77=g95.exe&lt;br /&gt;
  Or:&lt;br /&gt;
  F77=gfc.exe&lt;br /&gt;
&lt;br /&gt;
And set the other relevant flags (please note that despite being a Windows build this is identical to a Linux setup)&lt;br /&gt;
  CC=gcc&lt;br /&gt;
  CXX=g++&lt;br /&gt;
  MACHINE=LINUX&lt;br /&gt;
  NETCDF_DIR=&amp;lt;netcdf_root_cygwin&amp;gt;&lt;br /&gt;
  NETCDF_NAME=netcdf&lt;br /&gt;
&lt;br /&gt;
===Executing the GENIE build===&lt;br /&gt;
Somewhat ironically, the Windows build in Cygwin is not at all forgiving of any Windows CRLF in the scripts it processes. After performing any edits on the files with native Windows tools it is recommended to sanitise the files in genie-main using &amp;lt;code&amp;gt;dos2unix&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  dos2unix genie-main/*&lt;br /&gt;
  dos2unix genie-main/configs/*&lt;br /&gt;
&lt;br /&gt;
At the CygWin bash prompt make sure that the NetCDF DLL and Python are in the system path. If you have installed Cygwin's release of Python then this should already be available on the path, if not then update as follows:&lt;br /&gt;
&lt;br /&gt;
  $ export PATH=$PATH:/cygdrive/c/netcdf/bin:/cygdrive/c/Python&lt;br /&gt;
&lt;br /&gt;
It is worth checking that Python can be invoked from the shell and that the version is &amp;gt;1.5.2. To build the binary it should be possible to execute the make command:&lt;br /&gt;
&lt;br /&gt;
  $ cd [install-path]/genie-main&lt;br /&gt;
  $ make&lt;br /&gt;
&lt;br /&gt;
The following warning message will be issued during the final link phase of the Compaq/Intel build:&lt;br /&gt;
&lt;br /&gt;
  LINK : warning LNK4044: unrecognized option &amp;quot;module:..\genie-lib\mod&amp;quot;; ignored&lt;br /&gt;
&lt;br /&gt;
This is an expected outcome and does not impact the final production of the GENIE binary.&lt;br /&gt;
&lt;br /&gt;
===Running GENIE===&lt;br /&gt;
In the Cygwin environment you should find that &amp;lt;code&amp;gt;genie_example.job&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;make &amp;lt;test_target&amp;gt;&amp;lt;/code&amp;gt; should work in exactly the same way as in Linux. The XML configuration files should be successfully processed by the version of xsltproc available in Cygwin.&lt;br /&gt;
&lt;br /&gt;
Please note that to run the GENIE binary on a remote system you will need to package up the cygwin1.dll file along with the genie.exe binary and appropriate configuration files.&lt;br /&gt;
&lt;br /&gt;
The MinGW/MSYS shell cannot successfully invoke &amp;lt;code&amp;gt;genie_example.job&amp;lt;/code&amp;gt;. Please look at the GENIELab software as an alternative means of managing the binary if you have Matlab available on your system.&lt;/div&gt;</summary>
		<author><name>Genie-user</name></author>
	</entry>
	<entry>
		<id>https://source.geography.bristol.ac.uk/mediawiki/index.php?title=Fortran1&amp;diff=7323</id>
		<title>Fortran1</title>
		<link rel="alternate" type="text/html" href="https://source.geography.bristol.ac.uk/mediawiki/index.php?title=Fortran1&amp;diff=7323"/>
		<updated>2010-05-04T23:58:17Z</updated>

		<summary type="html">&lt;p&gt;Genie-user: /* hello, world */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Pragmatic Programming]]&lt;br /&gt;
'''Fortran1: The Basics'''&lt;br /&gt;
=Getting the content for the practical=&lt;br /&gt;
We'll forge our path through the verdant garden of '''Fortran90''' using a number of examples.  To get your copy of these examples, from the version control repository, login to your favourite linux machine (perhaps dylan), and type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
svn co http://source.ggy.bris.ac.uk/subversion-open/fortran1/trunk fortran1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=hello, world=&lt;br /&gt;
&lt;br /&gt;
Without further ado, and in-keeping with the most venerable of traditions, let's meet our first example--&amp;quot;hello, world&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd fortran1/examples/example1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can compile the program by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gfortran hello_world.f90 -o hello_world.exe&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and run it by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./hello_world.exe&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Bingo!'''  You've just compiled and run, perhaps your first, Fortran90 program.  Hurrah! we're on our way:)  Everybody whoop!  Yeehah!&lt;br /&gt;
&lt;br /&gt;
OK, OK...you'd better reign in your excitement.  This is serious you know!:)&lt;br /&gt;
&lt;br /&gt;
Enough of the magic, let's take a look inside the source code file.  Take a look at the contents of hello_world.f90, using '''cat''', '''less''', '''more''' or your favourite text editor, and you'll see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
!&lt;br /&gt;
! This is a comment line.&lt;br /&gt;
! Below is a simple 'hello, world' program written in Fortran90.&lt;br /&gt;
! It illustrates creating a main 'program' unit together&lt;br /&gt;
! with good habits, such as using 'implicit none' and comments.&lt;br /&gt;
!&lt;br /&gt;
program hello_world&lt;br /&gt;
  implicit none&lt;br /&gt;
  write(*,*)  &amp;quot;hello, world&amp;quot;&lt;br /&gt;
end program hello_world&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We have:&lt;br /&gt;
#some comment lines, giving us a helpful narrative&lt;br /&gt;
#the start of the '''main program unit'''&lt;br /&gt;
#the '''implicit none''' statement (more of that in the next section, but suffice to say, every well dressed Fortran program should have one)&lt;br /&gt;
#a '''write''' statement, printing our greeting to the screen&lt;br /&gt;
#and last, but not least, the end of the main program.&lt;br /&gt;
&lt;br /&gt;
This is all pretty straight forward, right?  Open-up your text editor and try changing the greeting, just for the heck of it.  Retype '''make''' and re-run it.  We'll adopt a similar strategy for all the other examples we'll meet.  If you ever want to get back to the original version of a program, just type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
svn revert hello_world.f90&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although this has all been fairly painless, we have made a very significant step--we are now editing, compiling and running Fortran programs.  All the rest is basically just details!:)&lt;br /&gt;
&lt;br /&gt;
=Containers and the Types of Things=&lt;br /&gt;
&lt;br /&gt;
As fun as &amp;quot;hello, world&amp;quot; was, let's spice things up a little.  For instance, let's introduce some variables.  We'll need to move to the next example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ../example2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fortran90 has several types of built-in, or '''intrinsic''', variables.  Take a look in '''intrinsic_types.f90''':&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  character         :: sex       ! a letter e.g. 'm' or 'f'&lt;br /&gt;
  character(len=12) :: name      ! a string&lt;br /&gt;
  logical           :: wed       ! married?&lt;br /&gt;
  integer           :: numBooks  ! must be a whole number&lt;br /&gt;
  real              :: height    ! e.g. 1.83 m (good include units in comment)&lt;br /&gt;
  complex           :: z         ! real and imaginary parts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This set of types suffice for a great many programs.  The above are all single entities.  We'll meet arrays of things in a couple of examples time.  In ''Fortran2'', we'll also meet user-defined types.  These allow us to group instances of intrinsic types together forming new kinds of thing--new types.  User-defined types are the ''bees knees'' and can make programs much easier to work with.  We'll leave the details to that later course, however.&lt;br /&gt;
&lt;br /&gt;
The above snippet shows some variable '''declarations''', along with a helpful comments.  It's good practice to comment your  declarations, as a programmer new to your code (or even yourself in a couple of months time) can have a hard time figuring out what is supposed to be stored in such-and-such a variable.  While we're on the topic, it's also good practice to give your variables meaningful names, even if they are long.  Trust me, a bit more typing now, perhaps, but a lot less head-scratching later on over what is stored in the inspiringly named '''xbNew''', or '''z2'''!&lt;br /&gt;
&lt;br /&gt;
It's often a good idea to give variables an initial value when we declare them (working with unitialised variables in another common source of bugs):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  character         :: nucleotide = 'A'            ! DNA has A,C,G &amp;amp; T&lt;br /&gt;
  character(len=50) :: infile = 'yourData.nc', outfile = &amp;quot;myData.nc&amp;quot;&lt;br /&gt;
  logical           :: initialised = .true.        ! or .false.&lt;br /&gt;
  real              :: solConst       = 1.37       ! Solar 'constant' in kW/m^2&lt;br /&gt;
  complex           :: sqrtMinusOne = (-1.0, 0.0)  ! sqrt(-1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fortran90 also allows us to gives variables certain attributes, for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  real,parameter    :: pi = 3.14159  ! a fixed constant&lt;br /&gt;
  real(kind=8)      :: totPrecip     ! this is preferred to 'double precision'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''parameter''' attribute tells you, me and Fortran that '''pi''' is a '''constant'''.  It's fixed and it's a compile-time error if we try to change it.  This is a good thing, since we can catch nasty bugs that can creep in that way.  We never want pi to be anything other than pi, right?!  Assigning '''parameter''' attributes to quantities we know are constant is an example of '''defensive programming''', or ''bug avoidance''!&lt;br /&gt;
&lt;br /&gt;
By default reals in Fortran are represented using 4 bytes of memory.  The addition of '''(kind=8)''' gives us an 8-byte real, often referred to a '''double precision''' real.  Fortran does have a ''double precision'' type, but the '''kind''' attribute is preferred.  (Many compilers also support the promotion of all default, 4-byte reals and integers in your program through flags, typically named ''-r8'' and ''-i8'', respectively.)  8-byte reals can be useful as accumulators, since they can help to avoid rounding errors.&lt;br /&gt;
&lt;br /&gt;
The remaining part of the program illustrates some pitfalls--'''beware!''':&lt;br /&gt;
* '''integer division''' and it's truncation&lt;br /&gt;
* '''casting''' as a solution to mismatched types&lt;br /&gt;
* (integer) '''overflow'''&lt;br /&gt;
* (real number) '''underflow''' &lt;br /&gt;
&lt;br /&gt;
Let's have a play with the program.  You an compile it and run it by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
make&lt;br /&gt;
./types.exe&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although we compiled our first example ''by-hand'',  we'll be using '''make''' to compile the rest of our example programs, so you won't have to worry about that side of things.  (If you'd like to know more about make, you can take a look at [[Make|our course on make]], presented in a very similar style to this here excursion into Fortran90.)&lt;br /&gt;
&lt;br /&gt;
Now modify the program (remembering &amp;quot;svn revert intrinsic_types.f90&amp;quot; if you make a mess).  Try giving values to various types and also using operators such as:&lt;br /&gt;
&lt;br /&gt;
* arithmetic: +, -, /, ** (exponentiation)&lt;br /&gt;
* functions: sin, cos, floor (rounding down)&lt;br /&gt;
* logic: .and., .or., .not., .eqv., .neqv.&lt;br /&gt;
* and you'll meet many more in the future..&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
* Calculate the [http://en.wikipedia.org/wiki/Sphere#Surface_area_of_a_sphere surface area of a sphere].&lt;br /&gt;
* Is sine of pi divided by four really the same as one over root two?&lt;br /&gt;
* What is the truth table of the NAND operator?&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
About that mysterious '''implicit none''' which we keep seeing at the start of our programs.  Let me tell you a story:  Once upon a time, the kings and queens of the garden of Fortran, being a generous and well meaning bunch, decided to save the programmers the bother of specifying the type of their variables.  &amp;quot;Don't bother!&amp;quot;, they said, &amp;quot;just be sure to give them appropriate names, and well sort out the rest.&amp;quot;  &amp;quot;Thank you.  Thank you very much&amp;quot;, said the programmers, and it was decreed that the names of integers should start with the letters i, j, k, l, m, or n, and the names of reals would start with the other letters.  Anyhow, this all seemed like a great wheeze and everybody was very happy.  This lasted for a while, but after time, the programmers got complacent and forgot how to name things and it all got rather messy.  Integers became reals, reals became integers and before they knew it, the programmers had '''bugs all over the place!'''  Boo.  The kings and queens conferred on the matter and they realised that they had made a grave error in their gift of implicit typing.  However, they couldn't undo what they had done.  Instead, they had to persuade the programmers to give it up voluntarily.  &amp;quot;Anything, anything!&amp;quot;, they pleaded &amp;quot;to get rid of '''all these bugs!'''&amp;quot;, and so it passed that every good programmer agreed to put '''implicit none''' at the top of every program they wrote, and they all lived happily ever after.&lt;br /&gt;
&lt;br /&gt;
=If, Do, Select and Other Ways to Control the Flow=&lt;br /&gt;
&lt;br /&gt;
Programs are like cooking recipes.  We've covered the how much of this and how much of that part.  However, we also need to cover the doing bit--do this and then do that, and for how long etc.  This is generically termed '''control flow'''.  Fortran gives us a fairly rich language with which to describe how we would like things done.  Next example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ../example3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take a look inside '''control.f90'''.  We have some variable declarations and then we encounter our first '''conditional''':&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  if (initialised .eqv. .true.) then&lt;br /&gt;
     write (*,*) &amp;quot;The variable 'area' is initialised and has the value:&amp;quot;, area&lt;br /&gt;
  else&lt;br /&gt;
     write (*,*) &amp;quot;The variable 'area' is NOT initialised and has the value:&amp;quot;, area&lt;br /&gt;
  end if&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is fairly self eplanatory--'''if'''..something is the case..'''then'''..'''else'''..  You can also have an '''elseif'''.  In fact you can have as many of those as you like.  You can also have as many statements inside each clause as you like.  Talk about spoiled!&lt;br /&gt;
&lt;br /&gt;
Our first '''do loop''' is of the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  do ii=1,5&lt;br /&gt;
     write (*,*) &amp;quot;Do loop counter ii is:&amp;quot;, ii&lt;br /&gt;
  end do&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, this is fairly readable.  '''ii''' is first given the value of 1, the body of the loop is evaluated and then we go back to the top again.  Except this time we '''increment''' the counter (ii) by the '''default amount''', which is 1.  When we're at the top and we take '''ii''' past 5, we stop the loop and move on to the next statement passed the '''end do'''.  You're allowed as many statements inside the loop as you like.  Indeed, you're allowed more loops, conditions, loops in loops, just about anything you can think of!  '''Beware''', however, debugging a huge construct of nested this that and the other can be beyond the limits of human patience.  Keep our programs simple and you will be happier for it.&lt;br /&gt;
&lt;br /&gt;
The other loop examples show variations in the stopping condition and '''stride''' (i.e. how much we increment by), including counting backwards, and stopping before we've even started!&lt;br /&gt;
&lt;br /&gt;
'''Select''' is another control structure.  This is a neat way of saying, &amp;quot;if..then..elsif..else..&amp;quot;  The '''default''' clause at the bottom is important.  Dropping this off can lead to '''fall-through''', where none of the cases triggered.  This is rarely what you want and can lead to nasty bugs.&lt;br /&gt;
&lt;br /&gt;
As before, compile it, run it and generally muck about.  These are only a few of the control structures provided to us by Fortran.  You'll find that you can do most things with these three, however.&lt;br /&gt;
&lt;br /&gt;
Before leaving this example, let's consider if tests containing an equals and floating point numbers.  Remember that there are an infinite set of real numbers and so a computer can only approximate them.  For example, '''how would a computer represent 10/3'''?  It has limited precision.  It follows therefore that we should be careful when we need to test whether a real number is equal some value, such as '''3.3''' (see the last section of the program).  A common way around this problem is to subtract the first real from&lt;br /&gt;
second and to compare the '''absolute''' value of the result to some small threshold (to account for rounding errors).&lt;br /&gt;
&lt;br /&gt;
'''Exercises'''&lt;br /&gt;
&lt;br /&gt;
* Write a select statement which prints out the names of the digits in the set [1,10] in different languages.  Write a loop to trigger each of these print statements.&lt;br /&gt;
* Write a nested loop: Write a pair of nested do loops which count between 1 and 3.  Print the values of the two counters in the inner-most loop.  Think about where your 'end do's should go.&lt;br /&gt;
* Write a nested if statement: For example, create character variables called 'vehicle', 'colour' and 'size'.  We could represent a small red car as; vehicle = 'c', colour = 'r' and size = 's'.  Arrange for your nested if to print 'eureka' given a big green train.  Think about where your 'end if' statements should go.&lt;br /&gt;
&lt;br /&gt;
=Not one, Many!=&lt;br /&gt;
&lt;br /&gt;
That was fun.  Back to thinking about variables for a moment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ../example4&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Last time we declared just one thing of a given type.  Sometimes we're greedy!  Sometimes we want more!  To be fair, some things are naturally represented by a vector or a matrix.  Think of values on a grid, solutions to linear systems, points in space, transformations such as scaling or rotation of vectors.  For these sorts of things the kings and queens of Fortran gave us programmers '''arrays'''.  Take a look inside '''static_array.f90''': &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  real, dimension(4)   :: tinyGrid = (/1.0, 2.0, 3.0, 4.0/)&lt;br /&gt;
  real, dimension(2,2) :: square     ! 2 rows, 2 columns&lt;br /&gt;
  real, dimension(3,2) :: rectangle  ! 3 rows, 2 columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The syntax here reads, &amp;quot;we'll have an one-dimensional array (i.e. vector) of 4 reals called tinyGrid, please, and we'll set the initial values of the cells in that array to be 1.0, 2.0, 3.0 and 4.0, respectively.&lt;br /&gt;
&lt;br /&gt;
For the second and third declarations, we're asking for two-dimensional arrays.  One with two rows and two colums, called ''square'', and one with three rows and two colums.  We're calling that ''rectangle''. &lt;br /&gt;
&lt;br /&gt;
The program then goes on to print out the contents of ''tinyGrid''.&lt;br /&gt;
&lt;br /&gt;
Fortran90 provides a couple of handy '''intrinsic routines''' for determining the '''size''' (how many cells in total) and the '''shape''' (number of dimensions and the ''extent'' of each dimension) of an array.  Fortran90 also allows us to '''reshape''' an array on-the-fly.  Using this intrinsic, we can copy the values from ''tinyGrid'' into ''square''.  Neat.&lt;br /&gt;
&lt;br /&gt;
Fortran also provides us with a rather rich set of operators (+, -, *, / etc.) for array-valued variables.  Have a go at playing with these.  If you know some linear algebra, you're going to have a great time with this example!&lt;br /&gt;
&lt;br /&gt;
'''Exercises'''&lt;br /&gt;
&lt;br /&gt;
* Create 3x3 grid to store the outcome of a game of noughts-and-crosses (tic-tac-toe), populate it and print the grid to screen.&lt;br /&gt;
* Fortran allows you to '''slice''' arrays.  For example the second column of the 2d-array 'a' is a(:,2).  Print the third row from the grid above.&lt;br /&gt;
* Add two vectors together.  Is this algebraically correct?  What about adding two matrices?&lt;br /&gt;
* Create two 2-d arrays.  Populate one randomly and create another as a mask.  Combine the two matrices and print the result. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
The static malarky is because Fortran90 also allows us to say we want an array, but we don't know how big we want it to be yet. &amp;quot;We'll decide that at run-time&amp;quot;, we programmers say.  This can be handy if you're reading in some data, say a pay-roll, and you don't know how many employees you'll have from one year to the next.  Fortran90 calls these '''allocatable arrays''' and we'll meet them in ''Fortran2''.&lt;br /&gt;
&lt;br /&gt;
=If Things get Hectic, Outsource!=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ../example5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, as we get more ambitious, the size of our program grows.  Before long, it can get unwieldy.  Also we may find that we repeat ourselves.  We do the same thing twice, three times.  Heck, many times!  Now is the time to start breaking your program into chunks, re-using some from time-to-time, making it more manageable.  Fortran gives us two routes to chunk-ification, '''functions''' and '''subroutines'''.  Let's deal with subroutines first.  In '''procedures.f90''', scroll down a bit and ou can see:   &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
subroutine mirror(len,inArray,outArray)&lt;br /&gt;
&lt;br /&gt;
  implicit none&lt;br /&gt;
&lt;br /&gt;
  ! dummy variables&lt;br /&gt;
  integer,                 intent(in)  :: len&lt;br /&gt;
  character,dimension(len),intent(in)  :: inArray&lt;br /&gt;
  character,dimension(len),intent(out) :: outArray&lt;br /&gt;
&lt;br /&gt;
  ! local variables&lt;br /&gt;
  integer :: ii&lt;br /&gt;
  integer :: lucky = 3  ! notice scope of this identically named variable&lt;br /&gt;
&lt;br /&gt;
  do ii=1,len&lt;br /&gt;
     outArray(len+1-ii) = inArray(ii)&lt;br /&gt;
  end do&lt;br /&gt;
&lt;br /&gt;
  write (*,*) &amp;quot;'lucky' _inside_ subroutine is:&amp;quot;, lucky&lt;br /&gt;
&lt;br /&gt;
end subroutine mirror&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, note that this is '''outside''' of the main program unit.  (In principle, we could hive this off into another source code file, but we'll leave that discussion until ''Fortran2''.)  Notice also that we have a shiney '''implicit none''' resplendent at the top of the subroutine.  Overall, it looks pretty similar to how a main program unit might look, but with the addition of '''arguments'''.  Those fellows in the parentheses after the subroutine name.  The declaration part also lists those arguments and we've commented that this are so-called '''dummy variables'''.  We also see an attribute that we've not seen before, called '''intent'''.  This is a very handy tool for defensive programming (remember aka ''bug avoidance'').  Using ''intent'' we can say that the integer ''len'' is an input and as such we're not going to try to change it.  Likewise for the caharcter array ''inArray''.  It would be a compile-error if we did.  We also state that the character array ''outArray'' is an output and we're going to give it a new value ''come what may''!  We also have some variables that we note are '''local'''.  Interestingly enough, one of our local variables, the integer called ''lucky'', has exactly the same name as a variable in the main program unit.  When we run the program, however, we will see that the two do not interfere with each other.  This is down to their '''scope'''.  The scope of lucky in the main program is all and only the main program unit and the scope of lucky in the subroutine is all and only the subroutine.  We say that the main program unit and the subroutine units have different '''name spaces'''.&lt;br /&gt;
&lt;br /&gt;
Well, we've seen a lot of new syntax and concepts in all that.  Useful ones though.  This program is small and artificial, so it's hard to see the benefits just yet.  You will, however, as your programs grow.  The subroutine is '''called''' from the main program , funnily enough by a '''call''' statement.  Notice how the arguments passed to the subroutine in the call statement also have different names in the main program and the subroutine.  That's scope again.&lt;br /&gt;
&lt;br /&gt;
Functions are a bit different to subroutines.  Notice that we don't call them in the same way.  We still pass arguments, but the functions '''returns''' and value, and so we could place a function on the right-hand side (RHS) of an assignment.  Looking at the body of the function:   &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function isPrime(num)&lt;br /&gt;
  &lt;br /&gt;
  implicit none&lt;br /&gt;
  &lt;br /&gt;
  ! return and dummy variables&lt;br /&gt;
  logical             :: isPrime&lt;br /&gt;
  integer, intent(in) :: num&lt;br /&gt;
&lt;br /&gt;
  select case (num)&lt;br /&gt;
     case (2,3,5,7,11,13,17,19,23,29)&lt;br /&gt;
        isPrime = .true.&lt;br /&gt;
     case default&lt;br /&gt;
        isPrime = .false.&lt;br /&gt;
     end select&lt;br /&gt;
&lt;br /&gt;
end function isPrime&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we can see that we have a declaration for a variable with the same name as the function.  The type of this variable is the '''return type''' of the function.  Indeed the value of this variable when we reach the bottom of the function is the value passed by to the calling routine.  Note that we can call functions and subroutines from other functions and subroutines etc. in a nested fashion.  This particular function is a fairly lame prime number spotter and returns a logical (.true. or .false.) depending upon whether its single input integer is prime.&lt;br /&gt;
&lt;br /&gt;
The last thing of note is the funky '''interface''' structure at the top of the main program:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  interface&lt;br /&gt;
     function isPrime(num)&lt;br /&gt;
       logical :: isPrime&lt;br /&gt;
       integer, intent(in) :: num&lt;br /&gt;
     end function isPrime&lt;br /&gt;
  end interface&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Our function '''definition''' is outside of the main program and so is said to be '''external'''.  The main program unit needs to know about it, however, and an interface structure is a good way to do this as it prompts Fortran to check that all the arguments match up between the call and the definition.  It's the way to do it.&lt;br /&gt;
&lt;br /&gt;
Try running the program and writing some functions and subroutines of your own.&lt;br /&gt;
&lt;br /&gt;
'''Exercises'''&lt;br /&gt;
&lt;br /&gt;
* Write a simple error handling subroutine that '''stop'''s the program after printing a message, which is passed in as an argument.&lt;br /&gt;
* Does the surface area of a circle increase linearly with an increase in radius?  How about circumference?  Write some functions and a loop to investigate.&lt;br /&gt;
* What happens if you write a function which calls itself?&lt;br /&gt;
&lt;br /&gt;
=Input and output=&lt;br /&gt;
&lt;br /&gt;
==File i/o ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ../example6&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this example we se how we can write output to a file and also read input from a file. before you can use a file, it needs to be opened. This is done with the open statement:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
open(unit=19,file=&amp;quot;output.txt&amp;quot;,form='formatted',status='old',iostat=ios)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the &amp;lt;tt&amp;gt;unit&amp;lt;/tt&amp;gt; is just a number given to the file so that we can refer to it later. It needs to be between 1 and 99 and numbers 5 and 6 are reserved (5 for keyboard entry and 6 for screen output)&lt;br /&gt;
* the &amp;lt;tt&amp;gt;file&amp;lt;/tt&amp;gt; is simply the name of the file to open&lt;br /&gt;
* the &amp;lt;tt&amp;gt;form&amp;lt;/tt&amp;gt; is used to give the file format. It can be 'formatted' (i.e. a text file) or 'unformatted' (i.e. a binary file).&lt;br /&gt;
* he &amp;lt;tt&amp;gt;status&amp;lt;/tt&amp;gt; specifies the behaviour if the file exists:&lt;br /&gt;
** &amp;lt;tt&amp;gt;'old'&amp;lt;/tt&amp;gt; means the file must exists&lt;br /&gt;
** &amp;lt;tt&amp;gt;'new'&amp;lt;/tt&amp;gt; means the file cannot exists pror to being opened&lt;br /&gt;
** &amp;lt;tt&amp;gt;'replace'&amp;lt;/tt&amp;gt; is used when an old file will be overwritten&lt;br /&gt;
* &amp;lt;tt&amp;gt;iostat&amp;lt;/tt&amp;gt; is used to return a non zero integer in case of an error, i.e. the file cannot be opened for instance.&lt;br /&gt;
&lt;br /&gt;
After you are done with a file, you must close it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
close(19)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that if you need to go back to the beginning of a file, you don't have to close it and open it again, you can simly rewind it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rewind(19)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To write in a file, the syntax is:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
write(unit=19,fmt=something) data, to, write&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;unit&amp;lt;/tt&amp;gt; is simply the unit number of the file you want write to. Note that by default &amp;lt;tt&amp;gt;fmt=*&amp;lt;/tt&amp;gt;, and the data is written to the screen.&lt;br /&gt;
* &amp;lt;tt&amp;gt;fmt&amp;lt;/tt&amp;gt; is the '''format'''. It allows you to format the data you want to write (add spaces, number of significant digits etc...). The format can be given in the write statement or in another line. You should really look for more information about the formatting options.&lt;br /&gt;
&lt;br /&gt;
Look at how the data is written in &amp;lt;tt&amp;gt;example6&amp;lt;/tt&amp;gt; to see a range of options to output data.&lt;br /&gt;
&lt;br /&gt;
To read information from a file, the &amp;lt;tt&amp;gt;write&amp;lt;/tt&amp;gt; statement is used:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
read(unit=19,fmt=something,iostat=ios) data, to, read&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
It is used in the reverse way from write really (if you can write you should able to read...). Of note is that it is very important to use the &amp;lt;tt&amp;gt;iostat&amp;lt;/tt&amp;gt; keyword to make sure read errors are treated appropriately.&lt;br /&gt;
&lt;br /&gt;
The last thing shown in &amp;lt;tt&amp;gt;example6&amp;lt;/tt&amp;gt; is how more efficient binary data storage is compared to text/formatted data storing. The caveat is that you cannot directly look inside binary files using a text editor. In our case, the same data is written to two files, a text file and a binary file. Look at the size difference:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
-rw-r--r-- 1 ggjpr uucp 215K Feb  6 10:24 output.bin&lt;br /&gt;
-rw-r--r-- 1 ggjpr uucp 631K Feb  6 10:24 output.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Using character strings as file names==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ../example7&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;example7&amp;lt;/tt&amp;gt; shows a little trick for people who output a lot of data and need to manipulate a lot of files. It is possible to use a write statement to output a number (or anything else) to a character string, use that string as a file name and open, close and output to many files on the fly. Look at &amp;lt;tt&amp;gt;io.f90&amp;lt;/tt&amp;gt; in &amp;lt;tt&amp;gt;example7&amp;lt;/tt&amp;gt; for a simple example.&lt;br /&gt;
&lt;br /&gt;
==Namelists==&lt;br /&gt;
And all of a sudden, we're at our last example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ../example8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this one, we'll look at file-based input and output.  Fortran provides a way of grouping variables together into a set, called a '''namelist''', that are input or output from our program ''en masse''.  This is a common situation.  The statement:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
namelist /example_nml/numBooks,initialised,name,vec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
sets it up.&lt;br /&gt;
&lt;br /&gt;
Fortran further provides us with built-in mechanisms for reading or writing a namelist to or from a file.&lt;br /&gt;
&lt;br /&gt;
First, we must open the file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  open(unit=56,file='input.nml',status='old',iostat=ios)&lt;br /&gt;
  if (ios /= 0) then&lt;br /&gt;
     print*,'ERROR: could not open namelist file'&lt;br /&gt;
     stop&lt;br /&gt;
  end if&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this snippet, we've associated the file called '''input.nml''' (you can find this in the directory already) with a so-called Fortran '''unit'''.  Unit number 56 to be precise, although we could have picked any unit number we liked, so long as it wasn't associated with a different file.  We also made sure to tell Fortran that this is an '''old''' file, i.e. that it already exists, and to check the error code, in case the '''open''' operation failed.  If that were to happen, we've asked the program to halt with an error.&lt;br /&gt;
&lt;br /&gt;
Now, assuming that we've opened the file OK, we proceed to read its contents.  Fortran makes this rather easy for us, given that the information is contained in a namelist:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  read(UNIT=56,NML=example_nml,IOSTAT=ios)&lt;br /&gt;
  if (ios /= 0) then&lt;br /&gt;
     print*,'ERROR: could not read example namelist'&lt;br /&gt;
     stop&lt;br /&gt;
  else&lt;br /&gt;
     close(56)&lt;br /&gt;
  end if&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the '''read''' statement, we told fortran that we wanted to read a namelist and that the group of variables should be labelled in the file as '''example_nml'''.  Again we've checked the error status and decided to halt with an error should the read statement fail for any reason.  Take a look at the contents of '''input.nml'''.  See that it is ascii text and that the variables (with their values) do not need to be listed in the same order in the file as they are in the program.  If the data is read successfully, we close the file unit.&lt;br /&gt;
&lt;br /&gt;
The program procedes to print the values to screen, demonstrating that they have indeed come from the file, to assign new values to the variables and then to write the modified values to a new file, called '''modified.nml'''.  Compare the two ascii text files.  Try running the program a second time and you will recieve an error, telling you that the output could not be written since a file called modified.nml exists and that we expressly stated that is was to be a '''new''' file.  Delete modified.nml, try again and it will succeed.  Try changing the namelist, values, filenames etc.  Go for it, make a mess!  You'll learn a lot from it:)&lt;br /&gt;
&lt;br /&gt;
'''Exercises'''&lt;br /&gt;
&lt;br /&gt;
* Write some code to read in a colour (red, blue, green etc.) from a namelist and then print out the names of all the [http://en.wikipedia.org/wiki/Railway_engines_(Thomas_and_Friends) railway engines] (thomas, percy, gordon etc.) that match.&lt;br /&gt;
* Read in the dimensions of an ellipse from file and print out it's area.&lt;br /&gt;
&lt;br /&gt;
= To go further = &lt;br /&gt;
The  [[:category:Pragmatic Programming | Pragmatic Programming]] course continues with [[Linux2]], a look at some of the more advanced but very useful Linux concepts.&lt;br /&gt;
&lt;br /&gt;
Now that you are getting familiar with Fortran, go a bit further by reading [[Fortran2]].&lt;br /&gt;
&lt;br /&gt;
A useful reference: [http://www.amazon.co.uk/Fortran-Programming-International-Computer-Science/dp/0201544466 Fortran 90 Programming. Ellis, Philips, Lahey. Addison-Wesley. ISBN 0-201-54446-6].&lt;/div&gt;</summary>
		<author><name>Genie-user</name></author>
	</entry>
	<entry>
		<id>https://source.geography.bristol.ac.uk/mediawiki/index.php?title=GENIE_Compiling&amp;diff=7298</id>
		<title>GENIE Compiling</title>
		<link rel="alternate" type="text/html" href="https://source.geography.bristol.ac.uk/mediawiki/index.php?title=GENIE_Compiling&amp;diff=7298"/>
		<updated>2010-03-31T10:51:53Z</updated>

		<summary type="html">&lt;p&gt;Genie-user: /* Mac OSX - March 2010 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Mac OSX - March 2010=&lt;br /&gt;
by Greg Colbourn, with thanks to Simon Mueller&lt;br /&gt;
&lt;br /&gt;
* Intel Core 2 Duo, 2.26GHz MacBook Pro&lt;br /&gt;
* OSX Snow Leopard 10.6.2, Xcode 3.2.1&lt;br /&gt;
&lt;br /&gt;
1. Download netcdf from http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-4.0.1.tar.gz&lt;br /&gt;
&lt;br /&gt;
2. Go to unzipped netcdf directory and type following commands:&lt;br /&gt;
&lt;br /&gt;
    export FFLAGS=&amp;quot;-m32&amp;quot;; export FCFLAGS=&amp;quot;-m32&amp;quot;; export CFLAGS=&amp;quot;-m32&amp;quot;; export CXXFLAGS=&amp;quot;-m32&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    ./configure --prefix=[your path]/netcdf-4.0.1 FC=/usr/local/bin/gfortran F90=/usr/local/bin/gfortran CC=gcc CXX=g++ CPPFLAGS=&amp;quot;-DpgiFortran&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    make check&lt;br /&gt;
&lt;br /&gt;
    make install&lt;br /&gt;
&lt;br /&gt;
3. Comment out the line in the &amp;quot; # === GNU 'gfortran' compiler ===&amp;quot; section of genie-main/makefile.arc that says:&lt;br /&gt;
&lt;br /&gt;
    LDFLAGS += -static&lt;br /&gt;
&lt;br /&gt;
4. In user.mak have:&lt;br /&gt;
&lt;br /&gt;
   F77=gfortran&lt;br /&gt;
   CC=gcc&lt;br /&gt;
   CXX=g++-4.0&lt;br /&gt;
   NETCDF_NAME=netcdf&lt;br /&gt;
&lt;br /&gt;
=Compilation error with NetCDF version 4=&lt;br /&gt;
If you are using identical compilers for genie and netcdf, but still get a compilation error message associated with netcdf (e.g. ''This module file was generated for a different platform or by an incompatible compiler or compiler release. It cannot be read''), there may be a compatibility issue with your netcdf version. Switching from NetCDF version 4 (RHES4) to v3.6.1 has bypassed this problem (using Red Hat/ifort/icc), although the reason for this is not known.&lt;br /&gt;
&lt;br /&gt;
k.i.c.oliver@open.ac.uk, 21st November 2006&lt;br /&gt;
&lt;br /&gt;
=Intel Fortran v7.1, INT() and PARAMETER()=&lt;br /&gt;
&lt;br /&gt;
ifcv7.1 will not compile statements of the form:&lt;br /&gt;
&lt;br /&gt;
 * PARAMETER (N=INT(..))&lt;br /&gt;
&lt;br /&gt;
Hence they have been removed from genie-land/src/fotran/qsat.f&lt;br /&gt;
&lt;br /&gt;
Gethin Williams Fri Dec 15 16:58:47 GMT 2006&lt;br /&gt;
&lt;br /&gt;
=New line characters in text files (UNIX/Windows)=&lt;br /&gt;
&lt;br /&gt;
===Description of problem===&lt;br /&gt;
&lt;br /&gt;
UNIX uses a linefeed character (as should CVS internally), but Windows uses both carriage-return and linefeed (CR/LF).  Some compilers/other tools may have trouble reading or displaying files that have the wrong new line characters for the platform.    A symptom of this can be a large number of &amp;quot;odd-looking&amp;quot; compiler errors, and the problem may not be easy to spot because most code editors correctly display both UNIX and Windows new lines.  Note that CVS should append the appropriate new line characters for the platform onto which a source file is checked out, but this may not be reliable.&lt;br /&gt;
&lt;br /&gt;
===Suggested solutions===&lt;br /&gt;
&lt;br /&gt;
If your text editor has an option allowing you to change the new line character, edit the option and save the file.  UNIX commands are also available to do the job, for example:&lt;br /&gt;
&lt;br /&gt;
* dos2unix -ascii my_source_file.f90 my_source_file.f90&lt;br /&gt;
* unix2dos -ascii my_source_file.f90 my_source_file.f90&lt;br /&gt;
&lt;br /&gt;
Ian Henderson Fri Jan 12 15:49:57 GMT 2007&lt;br /&gt;
&lt;br /&gt;
=Standard Fortran compliance=&lt;br /&gt;
&lt;br /&gt;
===Description of problem===&lt;br /&gt;
&lt;br /&gt;
Most compilers allow extensions to the Fortran language, but using these extensions may cause errors when a different (often older) compiler is used.  For instance, the only format descriptor that can be used without an explicit width is the character descriptor &amp;quot;A&amp;quot;, however many compilers will allow other format descriptors to be used without a width, e.g. &amp;quot;G&amp;quot;, to which a default width (and number of characters right of the decimal place) is applied by the compiler.&lt;br /&gt;
&lt;br /&gt;
===Suggested solutions===&lt;br /&gt;
&lt;br /&gt;
The GENIE overnight tests are carried out on several different platforms (Linux, Windows, Solaris) with different compilers.  However, it isn't practicable to test every combination of platform and compiler, so when adding significant amounts of new code to GENIE it may be worth testing on more than one compiler/platform if available.&lt;br /&gt;
&lt;br /&gt;
A good check for non-standard Fortran is to compile GENIE with an appropriate compiler option that checks for standards compliance (the compiler option can be added in makefile.arc).  In general, it's best to avoid non-standard Fortran unless there's a strong argument for using it.&lt;br /&gt;
&lt;br /&gt;
Compiler flags for popular Fortran compilers:&lt;br /&gt;
&lt;br /&gt;
* -std -- Intel (ifort)&lt;br /&gt;
* -Mstandard -- Portland (pgf90)&lt;br /&gt;
* -ansi -- Sun (f95)&lt;br /&gt;
&lt;br /&gt;
The ISO Fortran standard homepage is here: http://www.nag.co.uk/sc22wg5/&lt;br /&gt;
&lt;br /&gt;
Ian Henderson Fri Jan 12 15:49:57 GMT 2007&lt;/div&gt;</summary>
		<author><name>Genie-user</name></author>
	</entry>
	<entry>
		<id>https://source.geography.bristol.ac.uk/mediawiki/index.php?title=GENIE_Compiling&amp;diff=7297</id>
		<title>GENIE Compiling</title>
		<link rel="alternate" type="text/html" href="https://source.geography.bristol.ac.uk/mediawiki/index.php?title=GENIE_Compiling&amp;diff=7297"/>
		<updated>2010-03-31T10:51:31Z</updated>

		<summary type="html">&lt;p&gt;Genie-user: /* Mac OSX - March 2010 */ forgotten step&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Mac OSX - March 2010=&lt;br /&gt;
by Greg Colbourn, with thanks to Simon Mueller&lt;br /&gt;
&lt;br /&gt;
* Intel Core 2 Duo, 2.26GHz MacBook Pro&lt;br /&gt;
* OSX Snow Leopard 10.6.2, Xcode 3.2.1&lt;br /&gt;
&lt;br /&gt;
1. Download netcdf from http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-4.0.1.tar.gz&lt;br /&gt;
&lt;br /&gt;
2. Go to unzipped netcdf directory and type following commands:&lt;br /&gt;
&lt;br /&gt;
    export FFLAGS=&amp;quot;-m32&amp;quot;; export FCFLAGS=&amp;quot;-m32&amp;quot;; export CFLAGS=&amp;quot;-m32&amp;quot;; export CXXFLAGS=&amp;quot;-m32&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    ./configure --prefix=[your path]/netcdf-4.0.1 FC=/usr/local/bin/gfortran F90=/usr/local/bin/gfortran CC=gcc CXX=g++ CPPFLAGS=&amp;quot;-DpgiFortran&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    make check&lt;br /&gt;
&lt;br /&gt;
    make install&lt;br /&gt;
&lt;br /&gt;
4. comment out the line in the &amp;quot; # === GNU 'gfortran' compiler ===&amp;quot; section of genie-main/makefile.arc that says:&lt;br /&gt;
&lt;br /&gt;
    LDFLAGS += -static&lt;br /&gt;
&lt;br /&gt;
3. In user.mak have:&lt;br /&gt;
&lt;br /&gt;
   F77=gfortran&lt;br /&gt;
   CC=gcc&lt;br /&gt;
   CXX=g++-4.0&lt;br /&gt;
   NETCDF_NAME=netcdf&lt;br /&gt;
&lt;br /&gt;
=Compilation error with NetCDF version 4=&lt;br /&gt;
If you are using identical compilers for genie and netcdf, but still get a compilation error message associated with netcdf (e.g. ''This module file was generated for a different platform or by an incompatible compiler or compiler release. It cannot be read''), there may be a compatibility issue with your netcdf version. Switching from NetCDF version 4 (RHES4) to v3.6.1 has bypassed this problem (using Red Hat/ifort/icc), although the reason for this is not known.&lt;br /&gt;
&lt;br /&gt;
k.i.c.oliver@open.ac.uk, 21st November 2006&lt;br /&gt;
&lt;br /&gt;
=Intel Fortran v7.1, INT() and PARAMETER()=&lt;br /&gt;
&lt;br /&gt;
ifcv7.1 will not compile statements of the form:&lt;br /&gt;
&lt;br /&gt;
 * PARAMETER (N=INT(..))&lt;br /&gt;
&lt;br /&gt;
Hence they have been removed from genie-land/src/fotran/qsat.f&lt;br /&gt;
&lt;br /&gt;
Gethin Williams Fri Dec 15 16:58:47 GMT 2006&lt;br /&gt;
&lt;br /&gt;
=New line characters in text files (UNIX/Windows)=&lt;br /&gt;
&lt;br /&gt;
===Description of problem===&lt;br /&gt;
&lt;br /&gt;
UNIX uses a linefeed character (as should CVS internally), but Windows uses both carriage-return and linefeed (CR/LF).  Some compilers/other tools may have trouble reading or displaying files that have the wrong new line characters for the platform.    A symptom of this can be a large number of &amp;quot;odd-looking&amp;quot; compiler errors, and the problem may not be easy to spot because most code editors correctly display both UNIX and Windows new lines.  Note that CVS should append the appropriate new line characters for the platform onto which a source file is checked out, but this may not be reliable.&lt;br /&gt;
&lt;br /&gt;
===Suggested solutions===&lt;br /&gt;
&lt;br /&gt;
If your text editor has an option allowing you to change the new line character, edit the option and save the file.  UNIX commands are also available to do the job, for example:&lt;br /&gt;
&lt;br /&gt;
* dos2unix -ascii my_source_file.f90 my_source_file.f90&lt;br /&gt;
* unix2dos -ascii my_source_file.f90 my_source_file.f90&lt;br /&gt;
&lt;br /&gt;
Ian Henderson Fri Jan 12 15:49:57 GMT 2007&lt;br /&gt;
&lt;br /&gt;
=Standard Fortran compliance=&lt;br /&gt;
&lt;br /&gt;
===Description of problem===&lt;br /&gt;
&lt;br /&gt;
Most compilers allow extensions to the Fortran language, but using these extensions may cause errors when a different (often older) compiler is used.  For instance, the only format descriptor that can be used without an explicit width is the character descriptor &amp;quot;A&amp;quot;, however many compilers will allow other format descriptors to be used without a width, e.g. &amp;quot;G&amp;quot;, to which a default width (and number of characters right of the decimal place) is applied by the compiler.&lt;br /&gt;
&lt;br /&gt;
===Suggested solutions===&lt;br /&gt;
&lt;br /&gt;
The GENIE overnight tests are carried out on several different platforms (Linux, Windows, Solaris) with different compilers.  However, it isn't practicable to test every combination of platform and compiler, so when adding significant amounts of new code to GENIE it may be worth testing on more than one compiler/platform if available.&lt;br /&gt;
&lt;br /&gt;
A good check for non-standard Fortran is to compile GENIE with an appropriate compiler option that checks for standards compliance (the compiler option can be added in makefile.arc).  In general, it's best to avoid non-standard Fortran unless there's a strong argument for using it.&lt;br /&gt;
&lt;br /&gt;
Compiler flags for popular Fortran compilers:&lt;br /&gt;
&lt;br /&gt;
* -std -- Intel (ifort)&lt;br /&gt;
* -Mstandard -- Portland (pgf90)&lt;br /&gt;
* -ansi -- Sun (f95)&lt;br /&gt;
&lt;br /&gt;
The ISO Fortran standard homepage is here: http://www.nag.co.uk/sc22wg5/&lt;br /&gt;
&lt;br /&gt;
Ian Henderson Fri Jan 12 15:49:57 GMT 2007&lt;/div&gt;</summary>
		<author><name>Genie-user</name></author>
	</entry>
	<entry>
		<id>https://source.geography.bristol.ac.uk/mediawiki/index.php?title=GENIE_Compiling&amp;diff=7278</id>
		<title>GENIE Compiling</title>
		<link rel="alternate" type="text/html" href="https://source.geography.bristol.ac.uk/mediawiki/index.php?title=GENIE_Compiling&amp;diff=7278"/>
		<updated>2010-03-24T15:54:59Z</updated>

		<summary type="html">&lt;p&gt;Genie-user: removed old Apple OSX and g95 section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Mac OSX - March 2010=&lt;br /&gt;
by Greg Colbourn, with thanks to Simon Mueller&lt;br /&gt;
&lt;br /&gt;
* Intel Core 2 Duo, 2.26GHz MacBook Pro&lt;br /&gt;
* OSX Snow Leopard 10.6.2, Xcode 3.2.1&lt;br /&gt;
&lt;br /&gt;
1. Download netcdf from http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-4.0.1.tar.gz&lt;br /&gt;
&lt;br /&gt;
2. Go to unzipped netcdf directory and type following commands:&lt;br /&gt;
&lt;br /&gt;
    export FFLAGS=&amp;quot;-m32&amp;quot;; export FCFLAGS=&amp;quot;-m32&amp;quot;; export CFLAGS=&amp;quot;-m32&amp;quot;; export CXXFLAGS=&amp;quot;-m32&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    ./configure --prefix=[your path]/netcdf-4.0.1 FC=/usr/local/bin/gfortran F90=/usr/local/bin/gfortran CC=gcc CXX=g++ CPPFLAGS=&amp;quot;-DpgiFortran&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    make check&lt;br /&gt;
&lt;br /&gt;
    make install&lt;br /&gt;
&lt;br /&gt;
3. In user.mak have:&lt;br /&gt;
&lt;br /&gt;
   F77=gfortran&lt;br /&gt;
   CC=gcc&lt;br /&gt;
   CXX=g++-4.0&lt;br /&gt;
   NETCDF_NAME=netcdf&lt;br /&gt;
&lt;br /&gt;
=Compilation error with NetCDF version 4=&lt;br /&gt;
If you are using identical compilers for genie and netcdf, but still get a compilation error message associated with netcdf (e.g. ''This module file was generated for a different platform or by an incompatible compiler or compiler release. It cannot be read''), there may be a compatibility issue with your netcdf version. Switching from NetCDF version 4 (RHES4) to v3.6.1 has bypassed this problem (using Red Hat/ifort/icc), although the reason for this is not known.&lt;br /&gt;
&lt;br /&gt;
k.i.c.oliver@open.ac.uk, 21st November 2006&lt;br /&gt;
&lt;br /&gt;
=Intel Fortran v7.1, INT() and PARAMETER()=&lt;br /&gt;
&lt;br /&gt;
ifcv7.1 will not compile statements of the form:&lt;br /&gt;
&lt;br /&gt;
 * PARAMETER (N=INT(..))&lt;br /&gt;
&lt;br /&gt;
Hence they have been removed from genie-land/src/fotran/qsat.f&lt;br /&gt;
&lt;br /&gt;
Gethin Williams Fri Dec 15 16:58:47 GMT 2006&lt;br /&gt;
&lt;br /&gt;
=New line characters in text files (UNIX/Windows)=&lt;br /&gt;
&lt;br /&gt;
===Description of problem===&lt;br /&gt;
&lt;br /&gt;
UNIX uses a linefeed character (as should CVS internally), but Windows uses both carriage-return and linefeed (CR/LF).  Some compilers/other tools may have trouble reading or displaying files that have the wrong new line characters for the platform.    A symptom of this can be a large number of &amp;quot;odd-looking&amp;quot; compiler errors, and the problem may not be easy to spot because most code editors correctly display both UNIX and Windows new lines.  Note that CVS should append the appropriate new line characters for the platform onto which a source file is checked out, but this may not be reliable.&lt;br /&gt;
&lt;br /&gt;
===Suggested solutions===&lt;br /&gt;
&lt;br /&gt;
If your text editor has an option allowing you to change the new line character, edit the option and save the file.  UNIX commands are also available to do the job, for example:&lt;br /&gt;
&lt;br /&gt;
* dos2unix -ascii my_source_file.f90 my_source_file.f90&lt;br /&gt;
* unix2dos -ascii my_source_file.f90 my_source_file.f90&lt;br /&gt;
&lt;br /&gt;
Ian Henderson Fri Jan 12 15:49:57 GMT 2007&lt;br /&gt;
&lt;br /&gt;
=Standard Fortran compliance=&lt;br /&gt;
&lt;br /&gt;
===Description of problem===&lt;br /&gt;
&lt;br /&gt;
Most compilers allow extensions to the Fortran language, but using these extensions may cause errors when a different (often older) compiler is used.  For instance, the only format descriptor that can be used without an explicit width is the character descriptor &amp;quot;A&amp;quot;, however many compilers will allow other format descriptors to be used without a width, e.g. &amp;quot;G&amp;quot;, to which a default width (and number of characters right of the decimal place) is applied by the compiler.&lt;br /&gt;
&lt;br /&gt;
===Suggested solutions===&lt;br /&gt;
&lt;br /&gt;
The GENIE overnight tests are carried out on several different platforms (Linux, Windows, Solaris) with different compilers.  However, it isn't practicable to test every combination of platform and compiler, so when adding significant amounts of new code to GENIE it may be worth testing on more than one compiler/platform if available.&lt;br /&gt;
&lt;br /&gt;
A good check for non-standard Fortran is to compile GENIE with an appropriate compiler option that checks for standards compliance (the compiler option can be added in makefile.arc).  In general, it's best to avoid non-standard Fortran unless there's a strong argument for using it.&lt;br /&gt;
&lt;br /&gt;
Compiler flags for popular Fortran compilers:&lt;br /&gt;
&lt;br /&gt;
* -std -- Intel (ifort)&lt;br /&gt;
* -Mstandard -- Portland (pgf90)&lt;br /&gt;
* -ansi -- Sun (f95)&lt;br /&gt;
&lt;br /&gt;
The ISO Fortran standard homepage is here: http://www.nag.co.uk/sc22wg5/&lt;br /&gt;
&lt;br /&gt;
Ian Henderson Fri Jan 12 15:49:57 GMT 2007&lt;/div&gt;</summary>
		<author><name>Genie-user</name></author>
	</entry>
	<entry>
		<id>https://source.geography.bristol.ac.uk/mediawiki/index.php?title=GENIE_Compiling&amp;diff=7277</id>
		<title>GENIE Compiling</title>
		<link rel="alternate" type="text/html" href="https://source.geography.bristol.ac.uk/mediawiki/index.php?title=GENIE_Compiling&amp;diff=7277"/>
		<updated>2010-03-23T18:47:01Z</updated>

		<summary type="html">&lt;p&gt;Genie-user: /* Mac OSX - March 2010 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Mac OSX - March 2010=&lt;br /&gt;
by Greg Colbourn, with thanks to Simon Mueller&lt;br /&gt;
&lt;br /&gt;
* Intel Core 2 Duo, 2.26GHz MacBook Pro&lt;br /&gt;
* OSX Snow Leopard 10.6.2, Xcode 3.2.1&lt;br /&gt;
&lt;br /&gt;
1. Download netcdf from http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-4.0.1.tar.gz&lt;br /&gt;
&lt;br /&gt;
2. Go to unzipped netcdf directory and type following commands:&lt;br /&gt;
&lt;br /&gt;
    export FFLAGS=&amp;quot;-m32&amp;quot;; export FCFLAGS=&amp;quot;-m32&amp;quot;; export CFLAGS=&amp;quot;-m32&amp;quot;; export CXXFLAGS=&amp;quot;-m32&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    ./configure --prefix=[your path]/netcdf-4.0.1 FC=/usr/local/bin/gfortran F90=/usr/local/bin/gfortran CC=gcc CXX=g++ CPPFLAGS=&amp;quot;-DpgiFortran&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    make check&lt;br /&gt;
&lt;br /&gt;
    make install&lt;br /&gt;
&lt;br /&gt;
3. In user.mak have:&lt;br /&gt;
&lt;br /&gt;
   F77=gfortran&lt;br /&gt;
   CC=gcc&lt;br /&gt;
   CXX=g++-4.0&lt;br /&gt;
   NETCDF_NAME=netcdf&lt;br /&gt;
&lt;br /&gt;
=Apple OSX and g95=&lt;br /&gt;
&lt;br /&gt;
* POWERPC, 1.5GHZ Powerbook&lt;br /&gt;
* OSX Tiger 10.4.7, Xcode 2.4&lt;br /&gt;
&lt;br /&gt;
Genie compiles with g95, gcc and g++&lt;br /&gt;
* g95 0.90-1 (Fink download)&lt;br /&gt;
* gcc 4 (Xcode, probably)&lt;br /&gt;
* g++ 4 (Xcode, probably)&lt;br /&gt;
&lt;br /&gt;
==Need to exclude biogem (code from cvs early October 2006)==&lt;br /&gt;
&lt;br /&gt;
In genie-main makefile&lt;br /&gt;
 MODULE_NAMES = igcm3 \&lt;br /&gt;
               slabocean \&lt;br /&gt;
               slabseaice \&lt;br /&gt;
               fixedocean \&lt;br /&gt;
               fixedseaice \&lt;br /&gt;
               goldstein \&lt;br /&gt;
               embm \&lt;br /&gt;
               seaice \&lt;br /&gt;
               fixedatmos \&lt;br /&gt;
               land \&lt;br /&gt;
               fixedland \&lt;br /&gt;
               fixedicesheet \&lt;br /&gt;
               fixedchem \&lt;br /&gt;
               ichem \&lt;br /&gt;
               atchem&lt;br /&gt;
 #               biogem \&lt;br /&gt;
 #               ichem &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
genie-main/genie_ini_wrappers.f90: Lines 262+:&lt;br /&gt;
 ! call initialise_biogenie(t0,go_dt,go_lin,go_lout, &amp;amp;&lt;br /&gt;
 ! and all the arguments...&lt;br /&gt;
&lt;br /&gt;
genie-main/genie_loop_wrappers.f90: Lines 676+ and 725:&lt;br /&gt;
&lt;br /&gt;
 ! call biogenie( &amp;amp;&lt;br /&gt;
 ! and all the arguments...&lt;br /&gt;
&lt;br /&gt;
 ! call rest_biogem(go_lout,'.'//go_ext)&lt;br /&gt;
&lt;br /&gt;
genie-main/genie.F: Line 1688:&lt;br /&gt;
&lt;br /&gt;
 c call end_biogenie(go_sfcatm(:,:,:)) &lt;br /&gt;
&lt;br /&gt;
==In order to work with netcdf (v3.6.1 compiled from source with g96, gcc and g++)==&lt;br /&gt;
You must compile netcdf with identical compilers to those used for genie. You may need to edit the netcdf configure script to make sure it finds the right compilers. Netcdf binaries downloaded via fin are therefore unlikely to work.&lt;br /&gt;
&lt;br /&gt;
Then in genie-main makefile.arc comment out two flags:&lt;br /&gt;
 #FFLAGS += -fno-second-underscore&lt;br /&gt;
 #LDFLAGS += -static&lt;br /&gt;
&lt;br /&gt;
Alternatively, if you can work out how to do it, compile netcdf with -fno-second-underscore. I couldn't fathom where to put that in. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
jules@jamstec.go.jp, 30th October 2006.&lt;br /&gt;
&lt;br /&gt;
=Compilation error with NetCDF version 4=&lt;br /&gt;
If you are using identical compilers for genie and netcdf, but still get a compilation error message associated with netcdf (e.g. ''This module file was generated for a different platform or by an incompatible compiler or compiler release. It cannot be read''), there may be a compatibility issue with your netcdf version. Switching from NetCDF version 4 (RHES4) to v3.6.1 has bypassed this problem (using Red Hat/ifort/icc), although the reason for this is not known.&lt;br /&gt;
&lt;br /&gt;
k.i.c.oliver@open.ac.uk, 21st November 2006&lt;br /&gt;
&lt;br /&gt;
=Intel Fortran v7.1, INT() and PARAMETER()=&lt;br /&gt;
&lt;br /&gt;
ifcv7.1 will not compile statements of the form:&lt;br /&gt;
&lt;br /&gt;
 * PARAMETER (N=INT(..))&lt;br /&gt;
&lt;br /&gt;
Hence they have been removed from genie-land/src/fotran/qsat.f&lt;br /&gt;
&lt;br /&gt;
Gethin Williams Fri Dec 15 16:58:47 GMT 2006&lt;br /&gt;
&lt;br /&gt;
=New line characters in text files (UNIX/Windows)=&lt;br /&gt;
&lt;br /&gt;
===Description of problem===&lt;br /&gt;
&lt;br /&gt;
UNIX uses a linefeed character (as should CVS internally), but Windows uses both carriage-return and linefeed (CR/LF).  Some compilers/other tools may have trouble reading or displaying files that have the wrong new line characters for the platform.    A symptom of this can be a large number of &amp;quot;odd-looking&amp;quot; compiler errors, and the problem may not be easy to spot because most code editors correctly display both UNIX and Windows new lines.  Note that CVS should append the appropriate new line characters for the platform onto which a source file is checked out, but this may not be reliable.&lt;br /&gt;
&lt;br /&gt;
===Suggested solutions===&lt;br /&gt;
&lt;br /&gt;
If your text editor has an option allowing you to change the new line character, edit the option and save the file.  UNIX commands are also available to do the job, for example:&lt;br /&gt;
&lt;br /&gt;
* dos2unix -ascii my_source_file.f90 my_source_file.f90&lt;br /&gt;
* unix2dos -ascii my_source_file.f90 my_source_file.f90&lt;br /&gt;
&lt;br /&gt;
Ian Henderson Fri Jan 12 15:49:57 GMT 2007&lt;br /&gt;
&lt;br /&gt;
=Standard Fortran compliance=&lt;br /&gt;
&lt;br /&gt;
===Description of problem===&lt;br /&gt;
&lt;br /&gt;
Most compilers allow extensions to the Fortran language, but using these extensions may cause errors when a different (often older) compiler is used.  For instance, the only format descriptor that can be used without an explicit width is the character descriptor &amp;quot;A&amp;quot;, however many compilers will allow other format descriptors to be used without a width, e.g. &amp;quot;G&amp;quot;, to which a default width (and number of characters right of the decimal place) is applied by the compiler.&lt;br /&gt;
&lt;br /&gt;
===Suggested solutions===&lt;br /&gt;
&lt;br /&gt;
The GENIE overnight tests are carried out on several different platforms (Linux, Windows, Solaris) with different compilers.  However, it isn't practicable to test every combination of platform and compiler, so when adding significant amounts of new code to GENIE it may be worth testing on more than one compiler/platform if available.&lt;br /&gt;
&lt;br /&gt;
A good check for non-standard Fortran is to compile GENIE with an appropriate compiler option that checks for standards compliance (the compiler option can be added in makefile.arc).  In general, it's best to avoid non-standard Fortran unless there's a strong argument for using it.&lt;br /&gt;
&lt;br /&gt;
Compiler flags for popular Fortran compilers:&lt;br /&gt;
&lt;br /&gt;
* -std -- Intel (ifort)&lt;br /&gt;
* -Mstandard -- Portland (pgf90)&lt;br /&gt;
* -ansi -- Sun (f95)&lt;br /&gt;
&lt;br /&gt;
The ISO Fortran standard homepage is here: http://www.nag.co.uk/sc22wg5/&lt;br /&gt;
&lt;br /&gt;
Ian Henderson Fri Jan 12 15:49:57 GMT 2007&lt;/div&gt;</summary>
		<author><name>Genie-user</name></author>
	</entry>
	<entry>
		<id>https://source.geography.bristol.ac.uk/mediawiki/index.php?title=GENIE_Compiling&amp;diff=7276</id>
		<title>GENIE Compiling</title>
		<link rel="alternate" type="text/html" href="https://source.geography.bristol.ac.uk/mediawiki/index.php?title=GENIE_Compiling&amp;diff=7276"/>
		<updated>2010-03-23T17:56:59Z</updated>

		<summary type="html">&lt;p&gt;Genie-user: removed mac os x march 2010 from middle of another section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Mac OSX - March 2010=&lt;br /&gt;
by Greg Colbourn&lt;br /&gt;
&lt;br /&gt;
* Intel Core 2 Duo, 2.26GHz MacBook Pro&lt;br /&gt;
* OSX Snow Leopard 10.6.2, Xcode 3.2.1&lt;br /&gt;
&lt;br /&gt;
1. Download netcdf from http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-4.0.1.tar.gz&lt;br /&gt;
&lt;br /&gt;
2. Go to unzipped netcdf directory and type following commands:&lt;br /&gt;
&lt;br /&gt;
    export FFLAGS=&amp;quot;-m32&amp;quot;; export FCFLAGS=&amp;quot;-m32&amp;quot;; export CFLAGS=&amp;quot;-m32&amp;quot;; export CXXFLAGS=&amp;quot;-m32&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    ./configure --prefix=[your path]/netcdf-4.0.1 FC=/usr/local/bin/gfortran F90=/usr/local/bin/gfortran CC=gcc CXX=g++ CPPFLAGS=&amp;quot;-DpgiFortran&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    make check&lt;br /&gt;
&lt;br /&gt;
    make install&lt;br /&gt;
&lt;br /&gt;
3. In user.mak have:&lt;br /&gt;
&lt;br /&gt;
   F77=gfortran&lt;br /&gt;
   CC=gcc&lt;br /&gt;
   CXX=g++-4.0&lt;br /&gt;
   NETCDF_NAME=netcdf&lt;br /&gt;
&lt;br /&gt;
=Apple OSX and g95=&lt;br /&gt;
&lt;br /&gt;
* POWERPC, 1.5GHZ Powerbook&lt;br /&gt;
* OSX Tiger 10.4.7, Xcode 2.4&lt;br /&gt;
&lt;br /&gt;
Genie compiles with g95, gcc and g++&lt;br /&gt;
* g95 0.90-1 (Fink download)&lt;br /&gt;
* gcc 4 (Xcode, probably)&lt;br /&gt;
* g++ 4 (Xcode, probably)&lt;br /&gt;
&lt;br /&gt;
==Need to exclude biogem (code from cvs early October 2006)==&lt;br /&gt;
&lt;br /&gt;
In genie-main makefile&lt;br /&gt;
 MODULE_NAMES = igcm3 \&lt;br /&gt;
               slabocean \&lt;br /&gt;
               slabseaice \&lt;br /&gt;
               fixedocean \&lt;br /&gt;
               fixedseaice \&lt;br /&gt;
               goldstein \&lt;br /&gt;
               embm \&lt;br /&gt;
               seaice \&lt;br /&gt;
               fixedatmos \&lt;br /&gt;
               land \&lt;br /&gt;
               fixedland \&lt;br /&gt;
               fixedicesheet \&lt;br /&gt;
               fixedchem \&lt;br /&gt;
               ichem \&lt;br /&gt;
               atchem&lt;br /&gt;
 #               biogem \&lt;br /&gt;
 #               ichem &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
genie-main/genie_ini_wrappers.f90: Lines 262+:&lt;br /&gt;
 ! call initialise_biogenie(t0,go_dt,go_lin,go_lout, &amp;amp;&lt;br /&gt;
 ! and all the arguments...&lt;br /&gt;
&lt;br /&gt;
genie-main/genie_loop_wrappers.f90: Lines 676+ and 725:&lt;br /&gt;
&lt;br /&gt;
 ! call biogenie( &amp;amp;&lt;br /&gt;
 ! and all the arguments...&lt;br /&gt;
&lt;br /&gt;
 ! call rest_biogem(go_lout,'.'//go_ext)&lt;br /&gt;
&lt;br /&gt;
genie-main/genie.F: Line 1688:&lt;br /&gt;
&lt;br /&gt;
 c call end_biogenie(go_sfcatm(:,:,:)) &lt;br /&gt;
&lt;br /&gt;
==In order to work with netcdf (v3.6.1 compiled from source with g96, gcc and g++)==&lt;br /&gt;
You must compile netcdf with identical compilers to those used for genie. You may need to edit the netcdf configure script to make sure it finds the right compilers. Netcdf binaries downloaded via fin are therefore unlikely to work.&lt;br /&gt;
&lt;br /&gt;
Then in genie-main makefile.arc comment out two flags:&lt;br /&gt;
 #FFLAGS += -fno-second-underscore&lt;br /&gt;
 #LDFLAGS += -static&lt;br /&gt;
&lt;br /&gt;
Alternatively, if you can work out how to do it, compile netcdf with -fno-second-underscore. I couldn't fathom where to put that in. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
jules@jamstec.go.jp, 30th October 2006.&lt;br /&gt;
&lt;br /&gt;
=Compilation error with NetCDF version 4=&lt;br /&gt;
If you are using identical compilers for genie and netcdf, but still get a compilation error message associated with netcdf (e.g. ''This module file was generated for a different platform or by an incompatible compiler or compiler release. It cannot be read''), there may be a compatibility issue with your netcdf version. Switching from NetCDF version 4 (RHES4) to v3.6.1 has bypassed this problem (using Red Hat/ifort/icc), although the reason for this is not known.&lt;br /&gt;
&lt;br /&gt;
k.i.c.oliver@open.ac.uk, 21st November 2006&lt;br /&gt;
&lt;br /&gt;
=Intel Fortran v7.1, INT() and PARAMETER()=&lt;br /&gt;
&lt;br /&gt;
ifcv7.1 will not compile statements of the form:&lt;br /&gt;
&lt;br /&gt;
 * PARAMETER (N=INT(..))&lt;br /&gt;
&lt;br /&gt;
Hence they have been removed from genie-land/src/fotran/qsat.f&lt;br /&gt;
&lt;br /&gt;
Gethin Williams Fri Dec 15 16:58:47 GMT 2006&lt;br /&gt;
&lt;br /&gt;
=New line characters in text files (UNIX/Windows)=&lt;br /&gt;
&lt;br /&gt;
===Description of problem===&lt;br /&gt;
&lt;br /&gt;
UNIX uses a linefeed character (as should CVS internally), but Windows uses both carriage-return and linefeed (CR/LF).  Some compilers/other tools may have trouble reading or displaying files that have the wrong new line characters for the platform.    A symptom of this can be a large number of &amp;quot;odd-looking&amp;quot; compiler errors, and the problem may not be easy to spot because most code editors correctly display both UNIX and Windows new lines.  Note that CVS should append the appropriate new line characters for the platform onto which a source file is checked out, but this may not be reliable.&lt;br /&gt;
&lt;br /&gt;
===Suggested solutions===&lt;br /&gt;
&lt;br /&gt;
If your text editor has an option allowing you to change the new line character, edit the option and save the file.  UNIX commands are also available to do the job, for example:&lt;br /&gt;
&lt;br /&gt;
* dos2unix -ascii my_source_file.f90 my_source_file.f90&lt;br /&gt;
* unix2dos -ascii my_source_file.f90 my_source_file.f90&lt;br /&gt;
&lt;br /&gt;
Ian Henderson Fri Jan 12 15:49:57 GMT 2007&lt;br /&gt;
&lt;br /&gt;
=Standard Fortran compliance=&lt;br /&gt;
&lt;br /&gt;
===Description of problem===&lt;br /&gt;
&lt;br /&gt;
Most compilers allow extensions to the Fortran language, but using these extensions may cause errors when a different (often older) compiler is used.  For instance, the only format descriptor that can be used without an explicit width is the character descriptor &amp;quot;A&amp;quot;, however many compilers will allow other format descriptors to be used without a width, e.g. &amp;quot;G&amp;quot;, to which a default width (and number of characters right of the decimal place) is applied by the compiler.&lt;br /&gt;
&lt;br /&gt;
===Suggested solutions===&lt;br /&gt;
&lt;br /&gt;
The GENIE overnight tests are carried out on several different platforms (Linux, Windows, Solaris) with different compilers.  However, it isn't practicable to test every combination of platform and compiler, so when adding significant amounts of new code to GENIE it may be worth testing on more than one compiler/platform if available.&lt;br /&gt;
&lt;br /&gt;
A good check for non-standard Fortran is to compile GENIE with an appropriate compiler option that checks for standards compliance (the compiler option can be added in makefile.arc).  In general, it's best to avoid non-standard Fortran unless there's a strong argument for using it.&lt;br /&gt;
&lt;br /&gt;
Compiler flags for popular Fortran compilers:&lt;br /&gt;
&lt;br /&gt;
* -std -- Intel (ifort)&lt;br /&gt;
* -Mstandard -- Portland (pgf90)&lt;br /&gt;
* -ansi -- Sun (f95)&lt;br /&gt;
&lt;br /&gt;
The ISO Fortran standard homepage is here: http://www.nag.co.uk/sc22wg5/&lt;br /&gt;
&lt;br /&gt;
Ian Henderson Fri Jan 12 15:49:57 GMT 2007&lt;/div&gt;</summary>
		<author><name>Genie-user</name></author>
	</entry>
	<entry>
		<id>https://source.geography.bristol.ac.uk/mediawiki/index.php?title=GENIE_Compiling&amp;diff=7275</id>
		<title>GENIE Compiling</title>
		<link rel="alternate" type="text/html" href="https://source.geography.bristol.ac.uk/mediawiki/index.php?title=GENIE_Compiling&amp;diff=7275"/>
		<updated>2010-03-23T17:53:57Z</updated>

		<summary type="html">&lt;p&gt;Genie-user: /* Mac OSX - March 2010 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Apple OSX and g95=&lt;br /&gt;
&lt;br /&gt;
* POWERPC, 1.5GHZ Powerbook&lt;br /&gt;
* OSX Tiger 10.4.7, Xcode 2.4&lt;br /&gt;
&lt;br /&gt;
Genie compiles with g95, gcc and g++&lt;br /&gt;
* g95 0.90-1 (Fink download)&lt;br /&gt;
* gcc 4 (Xcode, probably)&lt;br /&gt;
* g++ 4 (Xcode, probably)&lt;br /&gt;
&lt;br /&gt;
=Mac OSX - March 2010=&lt;br /&gt;
by Greg Colbourn&lt;br /&gt;
&lt;br /&gt;
* Intel Core 2 Duo, 2.26GHz MacBook Pro&lt;br /&gt;
* OSX Snow Leopard 10.6.2, Xcode 3.2.1&lt;br /&gt;
&lt;br /&gt;
1. Download netcdf from http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-4.0.1.tar.gz&lt;br /&gt;
&lt;br /&gt;
2. Go to unzipped netcdf directory and type following commands:&lt;br /&gt;
&lt;br /&gt;
    export FFLAGS=&amp;quot;-m32&amp;quot;; export FCFLAGS=&amp;quot;-m32&amp;quot;; export CFLAGS=&amp;quot;-m32&amp;quot;; export CXXFLAGS=&amp;quot;-m32&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    ./configure --prefix=[your path]/netcdf-4.0.1 FC=/usr/local/bin/gfortran F90=/usr/local/bin/gfortran CC=gcc CXX=g++ CPPFLAGS=&amp;quot;-DpgiFortran&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    make check&lt;br /&gt;
&lt;br /&gt;
    make install&lt;br /&gt;
&lt;br /&gt;
3. In user.mak have:&lt;br /&gt;
&lt;br /&gt;
   F77=gfortran&lt;br /&gt;
   CC=gcc&lt;br /&gt;
   CXX=g++-4.0&lt;br /&gt;
   NETCDF_NAME=netcdf&lt;br /&gt;
&lt;br /&gt;
==Need to exclude biogem (code from cvs early October 2006)==&lt;br /&gt;
&lt;br /&gt;
In genie-main makefile&lt;br /&gt;
 MODULE_NAMES = igcm3 \&lt;br /&gt;
               slabocean \&lt;br /&gt;
               slabseaice \&lt;br /&gt;
               fixedocean \&lt;br /&gt;
               fixedseaice \&lt;br /&gt;
               goldstein \&lt;br /&gt;
               embm \&lt;br /&gt;
               seaice \&lt;br /&gt;
               fixedatmos \&lt;br /&gt;
               land \&lt;br /&gt;
               fixedland \&lt;br /&gt;
               fixedicesheet \&lt;br /&gt;
               fixedchem \&lt;br /&gt;
               ichem \&lt;br /&gt;
               atchem&lt;br /&gt;
 #               biogem \&lt;br /&gt;
 #               ichem &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
genie-main/genie_ini_wrappers.f90: Lines 262+:&lt;br /&gt;
 ! call initialise_biogenie(t0,go_dt,go_lin,go_lout, &amp;amp;&lt;br /&gt;
 ! and all the arguments...&lt;br /&gt;
&lt;br /&gt;
genie-main/genie_loop_wrappers.f90: Lines 676+ and 725:&lt;br /&gt;
&lt;br /&gt;
 ! call biogenie( &amp;amp;&lt;br /&gt;
 ! and all the arguments...&lt;br /&gt;
&lt;br /&gt;
 ! call rest_biogem(go_lout,'.'//go_ext)&lt;br /&gt;
&lt;br /&gt;
genie-main/genie.F: Line 1688:&lt;br /&gt;
&lt;br /&gt;
 c call end_biogenie(go_sfcatm(:,:,:)) &lt;br /&gt;
&lt;br /&gt;
==In order to work with netcdf (v3.6.1 compiled from source with g96, gcc and g++)==&lt;br /&gt;
You must compile netcdf with identical compilers to those used for genie. You may need to edit the netcdf configure script to make sure it finds the right compilers. Netcdf binaries downloaded via fin are therefore unlikely to work.&lt;br /&gt;
&lt;br /&gt;
Then in genie-main makefile.arc comment out two flags:&lt;br /&gt;
 #FFLAGS += -fno-second-underscore&lt;br /&gt;
 #LDFLAGS += -static&lt;br /&gt;
&lt;br /&gt;
Alternatively, if you can work out how to do it, compile netcdf with -fno-second-underscore. I couldn't fathom where to put that in. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
jules@jamstec.go.jp, 30th October 2006.&lt;br /&gt;
&lt;br /&gt;
=Compilation error with NetCDF version 4=&lt;br /&gt;
If you are using identical compilers for genie and netcdf, but still get a compilation error message associated with netcdf (e.g. ''This module file was generated for a different platform or by an incompatible compiler or compiler release. It cannot be read''), there may be a compatibility issue with your netcdf version. Switching from NetCDF version 4 (RHES4) to v3.6.1 has bypassed this problem (using Red Hat/ifort/icc), although the reason for this is not known.&lt;br /&gt;
&lt;br /&gt;
k.i.c.oliver@open.ac.uk, 21st November 2006&lt;br /&gt;
&lt;br /&gt;
=Intel Fortran v7.1, INT() and PARAMETER()=&lt;br /&gt;
&lt;br /&gt;
ifcv7.1 will not compile statements of the form:&lt;br /&gt;
&lt;br /&gt;
 * PARAMETER (N=INT(..))&lt;br /&gt;
&lt;br /&gt;
Hence they have been removed from genie-land/src/fotran/qsat.f&lt;br /&gt;
&lt;br /&gt;
Gethin Williams Fri Dec 15 16:58:47 GMT 2006&lt;br /&gt;
&lt;br /&gt;
=New line characters in text files (UNIX/Windows)=&lt;br /&gt;
&lt;br /&gt;
===Description of problem===&lt;br /&gt;
&lt;br /&gt;
UNIX uses a linefeed character (as should CVS internally), but Windows uses both carriage-return and linefeed (CR/LF).  Some compilers/other tools may have trouble reading or displaying files that have the wrong new line characters for the platform.    A symptom of this can be a large number of &amp;quot;odd-looking&amp;quot; compiler errors, and the problem may not be easy to spot because most code editors correctly display both UNIX and Windows new lines.  Note that CVS should append the appropriate new line characters for the platform onto which a source file is checked out, but this may not be reliable.&lt;br /&gt;
&lt;br /&gt;
===Suggested solutions===&lt;br /&gt;
&lt;br /&gt;
If your text editor has an option allowing you to change the new line character, edit the option and save the file.  UNIX commands are also available to do the job, for example:&lt;br /&gt;
&lt;br /&gt;
* dos2unix -ascii my_source_file.f90 my_source_file.f90&lt;br /&gt;
* unix2dos -ascii my_source_file.f90 my_source_file.f90&lt;br /&gt;
&lt;br /&gt;
Ian Henderson Fri Jan 12 15:49:57 GMT 2007&lt;br /&gt;
&lt;br /&gt;
=Standard Fortran compliance=&lt;br /&gt;
&lt;br /&gt;
===Description of problem===&lt;br /&gt;
&lt;br /&gt;
Most compilers allow extensions to the Fortran language, but using these extensions may cause errors when a different (often older) compiler is used.  For instance, the only format descriptor that can be used without an explicit width is the character descriptor &amp;quot;A&amp;quot;, however many compilers will allow other format descriptors to be used without a width, e.g. &amp;quot;G&amp;quot;, to which a default width (and number of characters right of the decimal place) is applied by the compiler.&lt;br /&gt;
&lt;br /&gt;
===Suggested solutions===&lt;br /&gt;
&lt;br /&gt;
The GENIE overnight tests are carried out on several different platforms (Linux, Windows, Solaris) with different compilers.  However, it isn't practicable to test every combination of platform and compiler, so when adding significant amounts of new code to GENIE it may be worth testing on more than one compiler/platform if available.&lt;br /&gt;
&lt;br /&gt;
A good check for non-standard Fortran is to compile GENIE with an appropriate compiler option that checks for standards compliance (the compiler option can be added in makefile.arc).  In general, it's best to avoid non-standard Fortran unless there's a strong argument for using it.&lt;br /&gt;
&lt;br /&gt;
Compiler flags for popular Fortran compilers:&lt;br /&gt;
&lt;br /&gt;
* -std -- Intel (ifort)&lt;br /&gt;
* -Mstandard -- Portland (pgf90)&lt;br /&gt;
* -ansi -- Sun (f95)&lt;br /&gt;
&lt;br /&gt;
The ISO Fortran standard homepage is here: http://www.nag.co.uk/sc22wg5/&lt;br /&gt;
&lt;br /&gt;
Ian Henderson Fri Jan 12 15:49:57 GMT 2007&lt;/div&gt;</summary>
		<author><name>Genie-user</name></author>
	</entry>
	<entry>
		<id>https://source.geography.bristol.ac.uk/mediawiki/index.php?title=GENIE_Compiling&amp;diff=7274</id>
		<title>GENIE Compiling</title>
		<link rel="alternate" type="text/html" href="https://source.geography.bristol.ac.uk/mediawiki/index.php?title=GENIE_Compiling&amp;diff=7274"/>
		<updated>2010-03-23T17:48:38Z</updated>

		<summary type="html">&lt;p&gt;Genie-user: /* Mac OSX March 2010 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Apple OSX and g95=&lt;br /&gt;
&lt;br /&gt;
* POWERPC, 1.5GHZ Powerbook&lt;br /&gt;
* OSX Tiger 10.4.7, Xcode 2.4&lt;br /&gt;
&lt;br /&gt;
Genie compiles with g95, gcc and g++&lt;br /&gt;
* g95 0.90-1 (Fink download)&lt;br /&gt;
* gcc 4 (Xcode, probably)&lt;br /&gt;
* g++ 4 (Xcode, probably)&lt;br /&gt;
&lt;br /&gt;
=Mac OSX - March 2010=&lt;br /&gt;
by Greg Colbourn&lt;br /&gt;
&lt;br /&gt;
* Intel Core 2 Duo, 2.26GHz MacBook Pro&lt;br /&gt;
* OSX Snow Leopard 10.6.2, Xcode 3.2.1&lt;br /&gt;
&lt;br /&gt;
1. Download netcdf from http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-4.0.1.tar.gz&lt;br /&gt;
&lt;br /&gt;
2. Go to unzipped netcdf directory and type following commands:&lt;br /&gt;
&lt;br /&gt;
    export FFLAGS=&amp;quot;-m32&amp;quot;; export FCFLAGS=&amp;quot;-m32&amp;quot;; export CFLAGS=&amp;quot;-m32&amp;quot;; export CXXFLAGS=&amp;quot;-m32&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    ./configure --prefix=your path/netcdf-4.0.1 FC=/usr/local/bin/gfortran F90=/usr/local/bin/gfortran CC=gcc CXX=g++ CPPFLAGS=&amp;quot;-DpgiFortran&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    make&lt;br /&gt;
&lt;br /&gt;
    make check&lt;br /&gt;
&lt;br /&gt;
    make install&lt;br /&gt;
&lt;br /&gt;
3. In user.mak have:&lt;br /&gt;
&lt;br /&gt;
   F77=gfortran&lt;br /&gt;
   CC=gcc&lt;br /&gt;
   CXX=g++-4.0&lt;br /&gt;
   NETCDF_NAME=netcdf&lt;br /&gt;
&lt;br /&gt;
==Need to exclude biogem (code from cvs early October 2006)==&lt;br /&gt;
&lt;br /&gt;
In genie-main makefile&lt;br /&gt;
 MODULE_NAMES = igcm3 \&lt;br /&gt;
               slabocean \&lt;br /&gt;
               slabseaice \&lt;br /&gt;
               fixedocean \&lt;br /&gt;
               fixedseaice \&lt;br /&gt;
               goldstein \&lt;br /&gt;
               embm \&lt;br /&gt;
               seaice \&lt;br /&gt;
               fixedatmos \&lt;br /&gt;
               land \&lt;br /&gt;
               fixedland \&lt;br /&gt;
               fixedicesheet \&lt;br /&gt;
               fixedchem \&lt;br /&gt;
               ichem \&lt;br /&gt;
               atchem&lt;br /&gt;
 #               biogem \&lt;br /&gt;
 #               ichem &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
genie-main/genie_ini_wrappers.f90: Lines 262+:&lt;br /&gt;
 ! call initialise_biogenie(t0,go_dt,go_lin,go_lout, &amp;amp;&lt;br /&gt;
 ! and all the arguments...&lt;br /&gt;
&lt;br /&gt;
genie-main/genie_loop_wrappers.f90: Lines 676+ and 725:&lt;br /&gt;
&lt;br /&gt;
 ! call biogenie( &amp;amp;&lt;br /&gt;
 ! and all the arguments...&lt;br /&gt;
&lt;br /&gt;
 ! call rest_biogem(go_lout,'.'//go_ext)&lt;br /&gt;
&lt;br /&gt;
genie-main/genie.F: Line 1688:&lt;br /&gt;
&lt;br /&gt;
 c call end_biogenie(go_sfcatm(:,:,:)) &lt;br /&gt;
&lt;br /&gt;
==In order to work with netcdf (v3.6.1 compiled from source with g96, gcc and g++)==&lt;br /&gt;
You must compile netcdf with identical compilers to those used for genie. You may need to edit the netcdf configure script to make sure it finds the right compilers. Netcdf binaries downloaded via fin are therefore unlikely to work.&lt;br /&gt;
&lt;br /&gt;
Then in genie-main makefile.arc comment out two flags:&lt;br /&gt;
 #FFLAGS += -fno-second-underscore&lt;br /&gt;
 #LDFLAGS += -static&lt;br /&gt;
&lt;br /&gt;
Alternatively, if you can work out how to do it, compile netcdf with -fno-second-underscore. I couldn't fathom where to put that in. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
jules@jamstec.go.jp, 30th October 2006.&lt;br /&gt;
&lt;br /&gt;
=Compilation error with NetCDF version 4=&lt;br /&gt;
If you are using identical compilers for genie and netcdf, but still get a compilation error message associated with netcdf (e.g. ''This module file was generated for a different platform or by an incompatible compiler or compiler release. It cannot be read''), there may be a compatibility issue with your netcdf version. Switching from NetCDF version 4 (RHES4) to v3.6.1 has bypassed this problem (using Red Hat/ifort/icc), although the reason for this is not known.&lt;br /&gt;
&lt;br /&gt;
k.i.c.oliver@open.ac.uk, 21st November 2006&lt;br /&gt;
&lt;br /&gt;
=Intel Fortran v7.1, INT() and PARAMETER()=&lt;br /&gt;
&lt;br /&gt;
ifcv7.1 will not compile statements of the form:&lt;br /&gt;
&lt;br /&gt;
 * PARAMETER (N=INT(..))&lt;br /&gt;
&lt;br /&gt;
Hence they have been removed from genie-land/src/fotran/qsat.f&lt;br /&gt;
&lt;br /&gt;
Gethin Williams Fri Dec 15 16:58:47 GMT 2006&lt;br /&gt;
&lt;br /&gt;
=New line characters in text files (UNIX/Windows)=&lt;br /&gt;
&lt;br /&gt;
===Description of problem===&lt;br /&gt;
&lt;br /&gt;
UNIX uses a linefeed character (as should CVS internally), but Windows uses both carriage-return and linefeed (CR/LF).  Some compilers/other tools may have trouble reading or displaying files that have the wrong new line characters for the platform.    A symptom of this can be a large number of &amp;quot;odd-looking&amp;quot; compiler errors, and the problem may not be easy to spot because most code editors correctly display both UNIX and Windows new lines.  Note that CVS should append the appropriate new line characters for the platform onto which a source file is checked out, but this may not be reliable.&lt;br /&gt;
&lt;br /&gt;
===Suggested solutions===&lt;br /&gt;
&lt;br /&gt;
If your text editor has an option allowing you to change the new line character, edit the option and save the file.  UNIX commands are also available to do the job, for example:&lt;br /&gt;
&lt;br /&gt;
* dos2unix -ascii my_source_file.f90 my_source_file.f90&lt;br /&gt;
* unix2dos -ascii my_source_file.f90 my_source_file.f90&lt;br /&gt;
&lt;br /&gt;
Ian Henderson Fri Jan 12 15:49:57 GMT 2007&lt;br /&gt;
&lt;br /&gt;
=Standard Fortran compliance=&lt;br /&gt;
&lt;br /&gt;
===Description of problem===&lt;br /&gt;
&lt;br /&gt;
Most compilers allow extensions to the Fortran language, but using these extensions may cause errors when a different (often older) compiler is used.  For instance, the only format descriptor that can be used without an explicit width is the character descriptor &amp;quot;A&amp;quot;, however many compilers will allow other format descriptors to be used without a width, e.g. &amp;quot;G&amp;quot;, to which a default width (and number of characters right of the decimal place) is applied by the compiler.&lt;br /&gt;
&lt;br /&gt;
===Suggested solutions===&lt;br /&gt;
&lt;br /&gt;
The GENIE overnight tests are carried out on several different platforms (Linux, Windows, Solaris) with different compilers.  However, it isn't practicable to test every combination of platform and compiler, so when adding significant amounts of new code to GENIE it may be worth testing on more than one compiler/platform if available.&lt;br /&gt;
&lt;br /&gt;
A good check for non-standard Fortran is to compile GENIE with an appropriate compiler option that checks for standards compliance (the compiler option can be added in makefile.arc).  In general, it's best to avoid non-standard Fortran unless there's a strong argument for using it.&lt;br /&gt;
&lt;br /&gt;
Compiler flags for popular Fortran compilers:&lt;br /&gt;
&lt;br /&gt;
* -std -- Intel (ifort)&lt;br /&gt;
* -Mstandard -- Portland (pgf90)&lt;br /&gt;
* -ansi -- Sun (f95)&lt;br /&gt;
&lt;br /&gt;
The ISO Fortran standard homepage is here: http://www.nag.co.uk/sc22wg5/&lt;br /&gt;
&lt;br /&gt;
Ian Henderson Fri Jan 12 15:49:57 GMT 2007&lt;/div&gt;</summary>
		<author><name>Genie-user</name></author>
	</entry>
	<entry>
		<id>https://source.geography.bristol.ac.uk/mediawiki/index.php?title=GENIE_Compiling&amp;diff=7273</id>
		<title>GENIE Compiling</title>
		<link rel="alternate" type="text/html" href="https://source.geography.bristol.ac.uk/mediawiki/index.php?title=GENIE_Compiling&amp;diff=7273"/>
		<updated>2010-03-23T17:37:15Z</updated>

		<summary type="html">&lt;p&gt;Genie-user: /* Mac OSX March 2010 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Apple OSX and g95=&lt;br /&gt;
&lt;br /&gt;
* POWERPC, 1.5GHZ Powerbook&lt;br /&gt;
* OSX Tiger 10.4.7, Xcode 2.4&lt;br /&gt;
&lt;br /&gt;
Genie compiles with g95, gcc and g++&lt;br /&gt;
* g95 0.90-1 (Fink download)&lt;br /&gt;
* gcc 4 (Xcode, probably)&lt;br /&gt;
* g++ 4 (Xcode, probably)&lt;br /&gt;
&lt;br /&gt;
=Mac OSX March 2010=&lt;br /&gt;
&lt;br /&gt;
* Intel Core 2 Duo, 2.26GHz MacBook Pro&lt;br /&gt;
* OSX Snow Leopard 10.6.2, Xcode 3.2.1&lt;br /&gt;
&lt;br /&gt;
1. Download netcdf from http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-4.0.1.tar.gz&lt;br /&gt;
&lt;br /&gt;
2. Go to unzipped netcdf directory and type following commands:&lt;br /&gt;
&lt;br /&gt;
    export FFLAGS=&amp;quot;-m32&amp;quot;; export FCFLAGS=&amp;quot;-m32&amp;quot;; export CFLAGS=&amp;quot;-m32&amp;quot;; export CXXFLAGS=&amp;quot;-m32&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    ./configure --prefix=your path/netcdf-4.0.1 FC=/usr/local/bin/gfortran F90=/usr/local/bin/gfortran CC=gcc CXX=g++ CPPFLAGS=&amp;quot;-DpgiFortran&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    make&lt;br /&gt;
&lt;br /&gt;
    make check&lt;br /&gt;
&lt;br /&gt;
    make install&lt;br /&gt;
&lt;br /&gt;
3. In user.mak have:&lt;br /&gt;
&lt;br /&gt;
   F77=gfortran&lt;br /&gt;
   CC=gcc&lt;br /&gt;
   CXX=g++-4.0&lt;br /&gt;
   NETCDF_NAME=netcdf&lt;br /&gt;
&lt;br /&gt;
==Need to exclude biogem (code from cvs early October 2006)==&lt;br /&gt;
&lt;br /&gt;
In genie-main makefile&lt;br /&gt;
 MODULE_NAMES = igcm3 \&lt;br /&gt;
               slabocean \&lt;br /&gt;
               slabseaice \&lt;br /&gt;
               fixedocean \&lt;br /&gt;
               fixedseaice \&lt;br /&gt;
               goldstein \&lt;br /&gt;
               embm \&lt;br /&gt;
               seaice \&lt;br /&gt;
               fixedatmos \&lt;br /&gt;
               land \&lt;br /&gt;
               fixedland \&lt;br /&gt;
               fixedicesheet \&lt;br /&gt;
               fixedchem \&lt;br /&gt;
               ichem \&lt;br /&gt;
               atchem&lt;br /&gt;
 #               biogem \&lt;br /&gt;
 #               ichem &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
genie-main/genie_ini_wrappers.f90: Lines 262+:&lt;br /&gt;
 ! call initialise_biogenie(t0,go_dt,go_lin,go_lout, &amp;amp;&lt;br /&gt;
 ! and all the arguments...&lt;br /&gt;
&lt;br /&gt;
genie-main/genie_loop_wrappers.f90: Lines 676+ and 725:&lt;br /&gt;
&lt;br /&gt;
 ! call biogenie( &amp;amp;&lt;br /&gt;
 ! and all the arguments...&lt;br /&gt;
&lt;br /&gt;
 ! call rest_biogem(go_lout,'.'//go_ext)&lt;br /&gt;
&lt;br /&gt;
genie-main/genie.F: Line 1688:&lt;br /&gt;
&lt;br /&gt;
 c call end_biogenie(go_sfcatm(:,:,:)) &lt;br /&gt;
&lt;br /&gt;
==In order to work with netcdf (v3.6.1 compiled from source with g96, gcc and g++)==&lt;br /&gt;
You must compile netcdf with identical compilers to those used for genie. You may need to edit the netcdf configure script to make sure it finds the right compilers. Netcdf binaries downloaded via fin are therefore unlikely to work.&lt;br /&gt;
&lt;br /&gt;
Then in genie-main makefile.arc comment out two flags:&lt;br /&gt;
 #FFLAGS += -fno-second-underscore&lt;br /&gt;
 #LDFLAGS += -static&lt;br /&gt;
&lt;br /&gt;
Alternatively, if you can work out how to do it, compile netcdf with -fno-second-underscore. I couldn't fathom where to put that in. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
jules@jamstec.go.jp, 30th October 2006.&lt;br /&gt;
&lt;br /&gt;
=Compilation error with NetCDF version 4=&lt;br /&gt;
If you are using identical compilers for genie and netcdf, but still get a compilation error message associated with netcdf (e.g. ''This module file was generated for a different platform or by an incompatible compiler or compiler release. It cannot be read''), there may be a compatibility issue with your netcdf version. Switching from NetCDF version 4 (RHES4) to v3.6.1 has bypassed this problem (using Red Hat/ifort/icc), although the reason for this is not known.&lt;br /&gt;
&lt;br /&gt;
k.i.c.oliver@open.ac.uk, 21st November 2006&lt;br /&gt;
&lt;br /&gt;
=Intel Fortran v7.1, INT() and PARAMETER()=&lt;br /&gt;
&lt;br /&gt;
ifcv7.1 will not compile statements of the form:&lt;br /&gt;
&lt;br /&gt;
 * PARAMETER (N=INT(..))&lt;br /&gt;
&lt;br /&gt;
Hence they have been removed from genie-land/src/fotran/qsat.f&lt;br /&gt;
&lt;br /&gt;
Gethin Williams Fri Dec 15 16:58:47 GMT 2006&lt;br /&gt;
&lt;br /&gt;
=New line characters in text files (UNIX/Windows)=&lt;br /&gt;
&lt;br /&gt;
===Description of problem===&lt;br /&gt;
&lt;br /&gt;
UNIX uses a linefeed character (as should CVS internally), but Windows uses both carriage-return and linefeed (CR/LF).  Some compilers/other tools may have trouble reading or displaying files that have the wrong new line characters for the platform.    A symptom of this can be a large number of &amp;quot;odd-looking&amp;quot; compiler errors, and the problem may not be easy to spot because most code editors correctly display both UNIX and Windows new lines.  Note that CVS should append the appropriate new line characters for the platform onto which a source file is checked out, but this may not be reliable.&lt;br /&gt;
&lt;br /&gt;
===Suggested solutions===&lt;br /&gt;
&lt;br /&gt;
If your text editor has an option allowing you to change the new line character, edit the option and save the file.  UNIX commands are also available to do the job, for example:&lt;br /&gt;
&lt;br /&gt;
* dos2unix -ascii my_source_file.f90 my_source_file.f90&lt;br /&gt;
* unix2dos -ascii my_source_file.f90 my_source_file.f90&lt;br /&gt;
&lt;br /&gt;
Ian Henderson Fri Jan 12 15:49:57 GMT 2007&lt;br /&gt;
&lt;br /&gt;
=Standard Fortran compliance=&lt;br /&gt;
&lt;br /&gt;
===Description of problem===&lt;br /&gt;
&lt;br /&gt;
Most compilers allow extensions to the Fortran language, but using these extensions may cause errors when a different (often older) compiler is used.  For instance, the only format descriptor that can be used without an explicit width is the character descriptor &amp;quot;A&amp;quot;, however many compilers will allow other format descriptors to be used without a width, e.g. &amp;quot;G&amp;quot;, to which a default width (and number of characters right of the decimal place) is applied by the compiler.&lt;br /&gt;
&lt;br /&gt;
===Suggested solutions===&lt;br /&gt;
&lt;br /&gt;
The GENIE overnight tests are carried out on several different platforms (Linux, Windows, Solaris) with different compilers.  However, it isn't practicable to test every combination of platform and compiler, so when adding significant amounts of new code to GENIE it may be worth testing on more than one compiler/platform if available.&lt;br /&gt;
&lt;br /&gt;
A good check for non-standard Fortran is to compile GENIE with an appropriate compiler option that checks for standards compliance (the compiler option can be added in makefile.arc).  In general, it's best to avoid non-standard Fortran unless there's a strong argument for using it.&lt;br /&gt;
&lt;br /&gt;
Compiler flags for popular Fortran compilers:&lt;br /&gt;
&lt;br /&gt;
* -std -- Intel (ifort)&lt;br /&gt;
* -Mstandard -- Portland (pgf90)&lt;br /&gt;
* -ansi -- Sun (f95)&lt;br /&gt;
&lt;br /&gt;
The ISO Fortran standard homepage is here: http://www.nag.co.uk/sc22wg5/&lt;br /&gt;
&lt;br /&gt;
Ian Henderson Fri Jan 12 15:49:57 GMT 2007&lt;/div&gt;</summary>
		<author><name>Genie-user</name></author>
	</entry>
	<entry>
		<id>https://source.geography.bristol.ac.uk/mediawiki/index.php?title=GENIE_Compiling&amp;diff=7272</id>
		<title>GENIE Compiling</title>
		<link rel="alternate" type="text/html" href="https://source.geography.bristol.ac.uk/mediawiki/index.php?title=GENIE_Compiling&amp;diff=7272"/>
		<updated>2010-03-23T17:37:02Z</updated>

		<summary type="html">&lt;p&gt;Genie-user: /* Mac OSX March 2010 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Apple OSX and g95=&lt;br /&gt;
&lt;br /&gt;
* POWERPC, 1.5GHZ Powerbook&lt;br /&gt;
* OSX Tiger 10.4.7, Xcode 2.4&lt;br /&gt;
&lt;br /&gt;
Genie compiles with g95, gcc and g++&lt;br /&gt;
* g95 0.90-1 (Fink download)&lt;br /&gt;
* gcc 4 (Xcode, probably)&lt;br /&gt;
* g++ 4 (Xcode, probably)&lt;br /&gt;
&lt;br /&gt;
=Mac OSX March 2010=&lt;br /&gt;
&lt;br /&gt;
* Intel Core 2 Duo, 2.26GHz MacBook Pro&lt;br /&gt;
* OSX Snow Leopard 10.6.2, Xcode 3.2.1&lt;br /&gt;
&lt;br /&gt;
1. Download netcdf from http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-4.0.1.tar.gz&lt;br /&gt;
&lt;br /&gt;
2. Go to unzipped netcdf directory and type following commands:&lt;br /&gt;
    export FFLAGS=&amp;quot;-m32&amp;quot;; export FCFLAGS=&amp;quot;-m32&amp;quot;; export CFLAGS=&amp;quot;-m32&amp;quot;; export CXXFLAGS=&amp;quot;-m32&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    ./configure --prefix=your path/netcdf-4.0.1 FC=/usr/local/bin/gfortran F90=/usr/local/bin/gfortran CC=gcc CXX=g++ CPPFLAGS=&amp;quot;-DpgiFortran&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    make&lt;br /&gt;
    make check&lt;br /&gt;
    make install&lt;br /&gt;
&lt;br /&gt;
3. In user.mak have:&lt;br /&gt;
   F77=gfortran&lt;br /&gt;
   CC=gcc&lt;br /&gt;
   CXX=g++-4.0&lt;br /&gt;
   NETCDF_NAME=netcdf&lt;br /&gt;
&lt;br /&gt;
==Need to exclude biogem (code from cvs early October 2006)==&lt;br /&gt;
&lt;br /&gt;
In genie-main makefile&lt;br /&gt;
 MODULE_NAMES = igcm3 \&lt;br /&gt;
               slabocean \&lt;br /&gt;
               slabseaice \&lt;br /&gt;
               fixedocean \&lt;br /&gt;
               fixedseaice \&lt;br /&gt;
               goldstein \&lt;br /&gt;
               embm \&lt;br /&gt;
               seaice \&lt;br /&gt;
               fixedatmos \&lt;br /&gt;
               land \&lt;br /&gt;
               fixedland \&lt;br /&gt;
               fixedicesheet \&lt;br /&gt;
               fixedchem \&lt;br /&gt;
               ichem \&lt;br /&gt;
               atchem&lt;br /&gt;
 #               biogem \&lt;br /&gt;
 #               ichem &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
genie-main/genie_ini_wrappers.f90: Lines 262+:&lt;br /&gt;
 ! call initialise_biogenie(t0,go_dt,go_lin,go_lout, &amp;amp;&lt;br /&gt;
 ! and all the arguments...&lt;br /&gt;
&lt;br /&gt;
genie-main/genie_loop_wrappers.f90: Lines 676+ and 725:&lt;br /&gt;
&lt;br /&gt;
 ! call biogenie( &amp;amp;&lt;br /&gt;
 ! and all the arguments...&lt;br /&gt;
&lt;br /&gt;
 ! call rest_biogem(go_lout,'.'//go_ext)&lt;br /&gt;
&lt;br /&gt;
genie-main/genie.F: Line 1688:&lt;br /&gt;
&lt;br /&gt;
 c call end_biogenie(go_sfcatm(:,:,:)) &lt;br /&gt;
&lt;br /&gt;
==In order to work with netcdf (v3.6.1 compiled from source with g96, gcc and g++)==&lt;br /&gt;
You must compile netcdf with identical compilers to those used for genie. You may need to edit the netcdf configure script to make sure it finds the right compilers. Netcdf binaries downloaded via fin are therefore unlikely to work.&lt;br /&gt;
&lt;br /&gt;
Then in genie-main makefile.arc comment out two flags:&lt;br /&gt;
 #FFLAGS += -fno-second-underscore&lt;br /&gt;
 #LDFLAGS += -static&lt;br /&gt;
&lt;br /&gt;
Alternatively, if you can work out how to do it, compile netcdf with -fno-second-underscore. I couldn't fathom where to put that in. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
jules@jamstec.go.jp, 30th October 2006.&lt;br /&gt;
&lt;br /&gt;
=Compilation error with NetCDF version 4=&lt;br /&gt;
If you are using identical compilers for genie and netcdf, but still get a compilation error message associated with netcdf (e.g. ''This module file was generated for a different platform or by an incompatible compiler or compiler release. It cannot be read''), there may be a compatibility issue with your netcdf version. Switching from NetCDF version 4 (RHES4) to v3.6.1 has bypassed this problem (using Red Hat/ifort/icc), although the reason for this is not known.&lt;br /&gt;
&lt;br /&gt;
k.i.c.oliver@open.ac.uk, 21st November 2006&lt;br /&gt;
&lt;br /&gt;
=Intel Fortran v7.1, INT() and PARAMETER()=&lt;br /&gt;
&lt;br /&gt;
ifcv7.1 will not compile statements of the form:&lt;br /&gt;
&lt;br /&gt;
 * PARAMETER (N=INT(..))&lt;br /&gt;
&lt;br /&gt;
Hence they have been removed from genie-land/src/fotran/qsat.f&lt;br /&gt;
&lt;br /&gt;
Gethin Williams Fri Dec 15 16:58:47 GMT 2006&lt;br /&gt;
&lt;br /&gt;
=New line characters in text files (UNIX/Windows)=&lt;br /&gt;
&lt;br /&gt;
===Description of problem===&lt;br /&gt;
&lt;br /&gt;
UNIX uses a linefeed character (as should CVS internally), but Windows uses both carriage-return and linefeed (CR/LF).  Some compilers/other tools may have trouble reading or displaying files that have the wrong new line characters for the platform.    A symptom of this can be a large number of &amp;quot;odd-looking&amp;quot; compiler errors, and the problem may not be easy to spot because most code editors correctly display both UNIX and Windows new lines.  Note that CVS should append the appropriate new line characters for the platform onto which a source file is checked out, but this may not be reliable.&lt;br /&gt;
&lt;br /&gt;
===Suggested solutions===&lt;br /&gt;
&lt;br /&gt;
If your text editor has an option allowing you to change the new line character, edit the option and save the file.  UNIX commands are also available to do the job, for example:&lt;br /&gt;
&lt;br /&gt;
* dos2unix -ascii my_source_file.f90 my_source_file.f90&lt;br /&gt;
* unix2dos -ascii my_source_file.f90 my_source_file.f90&lt;br /&gt;
&lt;br /&gt;
Ian Henderson Fri Jan 12 15:49:57 GMT 2007&lt;br /&gt;
&lt;br /&gt;
=Standard Fortran compliance=&lt;br /&gt;
&lt;br /&gt;
===Description of problem===&lt;br /&gt;
&lt;br /&gt;
Most compilers allow extensions to the Fortran language, but using these extensions may cause errors when a different (often older) compiler is used.  For instance, the only format descriptor that can be used without an explicit width is the character descriptor &amp;quot;A&amp;quot;, however many compilers will allow other format descriptors to be used without a width, e.g. &amp;quot;G&amp;quot;, to which a default width (and number of characters right of the decimal place) is applied by the compiler.&lt;br /&gt;
&lt;br /&gt;
===Suggested solutions===&lt;br /&gt;
&lt;br /&gt;
The GENIE overnight tests are carried out on several different platforms (Linux, Windows, Solaris) with different compilers.  However, it isn't practicable to test every combination of platform and compiler, so when adding significant amounts of new code to GENIE it may be worth testing on more than one compiler/platform if available.&lt;br /&gt;
&lt;br /&gt;
A good check for non-standard Fortran is to compile GENIE with an appropriate compiler option that checks for standards compliance (the compiler option can be added in makefile.arc).  In general, it's best to avoid non-standard Fortran unless there's a strong argument for using it.&lt;br /&gt;
&lt;br /&gt;
Compiler flags for popular Fortran compilers:&lt;br /&gt;
&lt;br /&gt;
* -std -- Intel (ifort)&lt;br /&gt;
* -Mstandard -- Portland (pgf90)&lt;br /&gt;
* -ansi -- Sun (f95)&lt;br /&gt;
&lt;br /&gt;
The ISO Fortran standard homepage is here: http://www.nag.co.uk/sc22wg5/&lt;br /&gt;
&lt;br /&gt;
Ian Henderson Fri Jan 12 15:49:57 GMT 2007&lt;/div&gt;</summary>
		<author><name>Genie-user</name></author>
	</entry>
	<entry>
		<id>https://source.geography.bristol.ac.uk/mediawiki/index.php?title=GENIE_Compiling&amp;diff=7271</id>
		<title>GENIE Compiling</title>
		<link rel="alternate" type="text/html" href="https://source.geography.bristol.ac.uk/mediawiki/index.php?title=GENIE_Compiling&amp;diff=7271"/>
		<updated>2010-03-23T17:36:37Z</updated>

		<summary type="html">&lt;p&gt;Genie-user: /* Mac OSX March 2010 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Apple OSX and g95=&lt;br /&gt;
&lt;br /&gt;
* POWERPC, 1.5GHZ Powerbook&lt;br /&gt;
* OSX Tiger 10.4.7, Xcode 2.4&lt;br /&gt;
&lt;br /&gt;
Genie compiles with g95, gcc and g++&lt;br /&gt;
* g95 0.90-1 (Fink download)&lt;br /&gt;
* gcc 4 (Xcode, probably)&lt;br /&gt;
* g++ 4 (Xcode, probably)&lt;br /&gt;
&lt;br /&gt;
=Mac OSX March 2010=&lt;br /&gt;
&lt;br /&gt;
* Intel Core 2 Duo, 2.26GHz MacBook Pro&lt;br /&gt;
* OSX Snow Leopard 10.6.2, Xcode 3.2.1&lt;br /&gt;
&lt;br /&gt;
1. Download netcdf from http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-4.0.1.tar.gz&lt;br /&gt;
&lt;br /&gt;
2. Go to unzipped netcdf directory and type following commands:&lt;br /&gt;
    export FFLAGS=&amp;quot;-m32&amp;quot;; export FCFLAGS=&amp;quot;-m32&amp;quot;; export CFLAGS=&amp;quot;-m32&amp;quot;; export CXXFLAGS=&amp;quot;-m32&amp;quot;&lt;br /&gt;
    ./configure --prefix=your path/netcdf-4.0.1 FC=/usr/local/bin/gfortran F90=/usr/local/bin/gfortran CC=gcc CXX=g++ CPPFLAGS=&amp;quot;-DpgiFortran&amp;quot;&lt;br /&gt;
    make&lt;br /&gt;
    make check&lt;br /&gt;
    make install&lt;br /&gt;
&lt;br /&gt;
3. In user.mak have:&lt;br /&gt;
   F77=gfortran&lt;br /&gt;
   CC=gcc&lt;br /&gt;
   CXX=g++-4.0&lt;br /&gt;
   NETCDF_NAME=netcdf&lt;br /&gt;
&lt;br /&gt;
==Need to exclude biogem (code from cvs early October 2006)==&lt;br /&gt;
&lt;br /&gt;
In genie-main makefile&lt;br /&gt;
 MODULE_NAMES = igcm3 \&lt;br /&gt;
               slabocean \&lt;br /&gt;
               slabseaice \&lt;br /&gt;
               fixedocean \&lt;br /&gt;
               fixedseaice \&lt;br /&gt;
               goldstein \&lt;br /&gt;
               embm \&lt;br /&gt;
               seaice \&lt;br /&gt;
               fixedatmos \&lt;br /&gt;
               land \&lt;br /&gt;
               fixedland \&lt;br /&gt;
               fixedicesheet \&lt;br /&gt;
               fixedchem \&lt;br /&gt;
               ichem \&lt;br /&gt;
               atchem&lt;br /&gt;
 #               biogem \&lt;br /&gt;
 #               ichem &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
genie-main/genie_ini_wrappers.f90: Lines 262+:&lt;br /&gt;
 ! call initialise_biogenie(t0,go_dt,go_lin,go_lout, &amp;amp;&lt;br /&gt;
 ! and all the arguments...&lt;br /&gt;
&lt;br /&gt;
genie-main/genie_loop_wrappers.f90: Lines 676+ and 725:&lt;br /&gt;
&lt;br /&gt;
 ! call biogenie( &amp;amp;&lt;br /&gt;
 ! and all the arguments...&lt;br /&gt;
&lt;br /&gt;
 ! call rest_biogem(go_lout,'.'//go_ext)&lt;br /&gt;
&lt;br /&gt;
genie-main/genie.F: Line 1688:&lt;br /&gt;
&lt;br /&gt;
 c call end_biogenie(go_sfcatm(:,:,:)) &lt;br /&gt;
&lt;br /&gt;
==In order to work with netcdf (v3.6.1 compiled from source with g96, gcc and g++)==&lt;br /&gt;
You must compile netcdf with identical compilers to those used for genie. You may need to edit the netcdf configure script to make sure it finds the right compilers. Netcdf binaries downloaded via fin are therefore unlikely to work.&lt;br /&gt;
&lt;br /&gt;
Then in genie-main makefile.arc comment out two flags:&lt;br /&gt;
 #FFLAGS += -fno-second-underscore&lt;br /&gt;
 #LDFLAGS += -static&lt;br /&gt;
&lt;br /&gt;
Alternatively, if you can work out how to do it, compile netcdf with -fno-second-underscore. I couldn't fathom where to put that in. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
jules@jamstec.go.jp, 30th October 2006.&lt;br /&gt;
&lt;br /&gt;
=Compilation error with NetCDF version 4=&lt;br /&gt;
If you are using identical compilers for genie and netcdf, but still get a compilation error message associated with netcdf (e.g. ''This module file was generated for a different platform or by an incompatible compiler or compiler release. It cannot be read''), there may be a compatibility issue with your netcdf version. Switching from NetCDF version 4 (RHES4) to v3.6.1 has bypassed this problem (using Red Hat/ifort/icc), although the reason for this is not known.&lt;br /&gt;
&lt;br /&gt;
k.i.c.oliver@open.ac.uk, 21st November 2006&lt;br /&gt;
&lt;br /&gt;
=Intel Fortran v7.1, INT() and PARAMETER()=&lt;br /&gt;
&lt;br /&gt;
ifcv7.1 will not compile statements of the form:&lt;br /&gt;
&lt;br /&gt;
 * PARAMETER (N=INT(..))&lt;br /&gt;
&lt;br /&gt;
Hence they have been removed from genie-land/src/fotran/qsat.f&lt;br /&gt;
&lt;br /&gt;
Gethin Williams Fri Dec 15 16:58:47 GMT 2006&lt;br /&gt;
&lt;br /&gt;
=New line characters in text files (UNIX/Windows)=&lt;br /&gt;
&lt;br /&gt;
===Description of problem===&lt;br /&gt;
&lt;br /&gt;
UNIX uses a linefeed character (as should CVS internally), but Windows uses both carriage-return and linefeed (CR/LF).  Some compilers/other tools may have trouble reading or displaying files that have the wrong new line characters for the platform.    A symptom of this can be a large number of &amp;quot;odd-looking&amp;quot; compiler errors, and the problem may not be easy to spot because most code editors correctly display both UNIX and Windows new lines.  Note that CVS should append the appropriate new line characters for the platform onto which a source file is checked out, but this may not be reliable.&lt;br /&gt;
&lt;br /&gt;
===Suggested solutions===&lt;br /&gt;
&lt;br /&gt;
If your text editor has an option allowing you to change the new line character, edit the option and save the file.  UNIX commands are also available to do the job, for example:&lt;br /&gt;
&lt;br /&gt;
* dos2unix -ascii my_source_file.f90 my_source_file.f90&lt;br /&gt;
* unix2dos -ascii my_source_file.f90 my_source_file.f90&lt;br /&gt;
&lt;br /&gt;
Ian Henderson Fri Jan 12 15:49:57 GMT 2007&lt;br /&gt;
&lt;br /&gt;
=Standard Fortran compliance=&lt;br /&gt;
&lt;br /&gt;
===Description of problem===&lt;br /&gt;
&lt;br /&gt;
Most compilers allow extensions to the Fortran language, but using these extensions may cause errors when a different (often older) compiler is used.  For instance, the only format descriptor that can be used without an explicit width is the character descriptor &amp;quot;A&amp;quot;, however many compilers will allow other format descriptors to be used without a width, e.g. &amp;quot;G&amp;quot;, to which a default width (and number of characters right of the decimal place) is applied by the compiler.&lt;br /&gt;
&lt;br /&gt;
===Suggested solutions===&lt;br /&gt;
&lt;br /&gt;
The GENIE overnight tests are carried out on several different platforms (Linux, Windows, Solaris) with different compilers.  However, it isn't practicable to test every combination of platform and compiler, so when adding significant amounts of new code to GENIE it may be worth testing on more than one compiler/platform if available.&lt;br /&gt;
&lt;br /&gt;
A good check for non-standard Fortran is to compile GENIE with an appropriate compiler option that checks for standards compliance (the compiler option can be added in makefile.arc).  In general, it's best to avoid non-standard Fortran unless there's a strong argument for using it.&lt;br /&gt;
&lt;br /&gt;
Compiler flags for popular Fortran compilers:&lt;br /&gt;
&lt;br /&gt;
* -std -- Intel (ifort)&lt;br /&gt;
* -Mstandard -- Portland (pgf90)&lt;br /&gt;
* -ansi -- Sun (f95)&lt;br /&gt;
&lt;br /&gt;
The ISO Fortran standard homepage is here: http://www.nag.co.uk/sc22wg5/&lt;br /&gt;
&lt;br /&gt;
Ian Henderson Fri Jan 12 15:49:57 GMT 2007&lt;/div&gt;</summary>
		<author><name>Genie-user</name></author>
	</entry>
	<entry>
		<id>https://source.geography.bristol.ac.uk/mediawiki/index.php?title=GENIE_Compiling&amp;diff=7270</id>
		<title>GENIE Compiling</title>
		<link rel="alternate" type="text/html" href="https://source.geography.bristol.ac.uk/mediawiki/index.php?title=GENIE_Compiling&amp;diff=7270"/>
		<updated>2010-03-23T17:36:00Z</updated>

		<summary type="html">&lt;p&gt;Genie-user: /* Apple OSX March 2010  */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Apple OSX and g95=&lt;br /&gt;
&lt;br /&gt;
* POWERPC, 1.5GHZ Powerbook&lt;br /&gt;
* OSX Tiger 10.4.7, Xcode 2.4&lt;br /&gt;
&lt;br /&gt;
Genie compiles with g95, gcc and g++&lt;br /&gt;
* g95 0.90-1 (Fink download)&lt;br /&gt;
* gcc 4 (Xcode, probably)&lt;br /&gt;
* g++ 4 (Xcode, probably)&lt;br /&gt;
&lt;br /&gt;
=Mac OSX March 2010=&lt;br /&gt;
&lt;br /&gt;
* Intel Core 2 Duo, 2.26GHz MacBook Pro&lt;br /&gt;
* OSX Snow Leopard 10.6.2, Xcode 3.2.1&lt;br /&gt;
&lt;br /&gt;
1. Download netcdf from http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-4.0.1.tar.gz&lt;br /&gt;
2. Go to unzipped netcdf directory and type following commands:&lt;br /&gt;
    export FFLAGS=&amp;quot;-m32&amp;quot;; export FCFLAGS=&amp;quot;-m32&amp;quot;; export CFLAGS=&amp;quot;-m32&amp;quot;; export CXXFLAGS=&amp;quot;-m32&amp;quot;&lt;br /&gt;
    ./configure --prefix=your path/netcdf-4.0.1 FC=/usr/local/bin/gfortran F90=/usr/local/bin/gfortran CC=gcc CXX=g++ CPPFLAGS=&amp;quot;-DpgiFortran&amp;quot;&lt;br /&gt;
    make&lt;br /&gt;
    make check&lt;br /&gt;
    make install&lt;br /&gt;
3. In user.mak have:&lt;br /&gt;
   F77=gfortran&lt;br /&gt;
   CC=gcc&lt;br /&gt;
   CXX=g++-4.0&lt;br /&gt;
   NETCDF_NAME=netcdf&lt;br /&gt;
&lt;br /&gt;
==Need to exclude biogem (code from cvs early October 2006)==&lt;br /&gt;
&lt;br /&gt;
In genie-main makefile&lt;br /&gt;
 MODULE_NAMES = igcm3 \&lt;br /&gt;
               slabocean \&lt;br /&gt;
               slabseaice \&lt;br /&gt;
               fixedocean \&lt;br /&gt;
               fixedseaice \&lt;br /&gt;
               goldstein \&lt;br /&gt;
               embm \&lt;br /&gt;
               seaice \&lt;br /&gt;
               fixedatmos \&lt;br /&gt;
               land \&lt;br /&gt;
               fixedland \&lt;br /&gt;
               fixedicesheet \&lt;br /&gt;
               fixedchem \&lt;br /&gt;
               ichem \&lt;br /&gt;
               atchem&lt;br /&gt;
 #               biogem \&lt;br /&gt;
 #               ichem &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
genie-main/genie_ini_wrappers.f90: Lines 262+:&lt;br /&gt;
 ! call initialise_biogenie(t0,go_dt,go_lin,go_lout, &amp;amp;&lt;br /&gt;
 ! and all the arguments...&lt;br /&gt;
&lt;br /&gt;
genie-main/genie_loop_wrappers.f90: Lines 676+ and 725:&lt;br /&gt;
&lt;br /&gt;
 ! call biogenie( &amp;amp;&lt;br /&gt;
 ! and all the arguments...&lt;br /&gt;
&lt;br /&gt;
 ! call rest_biogem(go_lout,'.'//go_ext)&lt;br /&gt;
&lt;br /&gt;
genie-main/genie.F: Line 1688:&lt;br /&gt;
&lt;br /&gt;
 c call end_biogenie(go_sfcatm(:,:,:)) &lt;br /&gt;
&lt;br /&gt;
==In order to work with netcdf (v3.6.1 compiled from source with g96, gcc and g++)==&lt;br /&gt;
You must compile netcdf with identical compilers to those used for genie. You may need to edit the netcdf configure script to make sure it finds the right compilers. Netcdf binaries downloaded via fin are therefore unlikely to work.&lt;br /&gt;
&lt;br /&gt;
Then in genie-main makefile.arc comment out two flags:&lt;br /&gt;
 #FFLAGS += -fno-second-underscore&lt;br /&gt;
 #LDFLAGS += -static&lt;br /&gt;
&lt;br /&gt;
Alternatively, if you can work out how to do it, compile netcdf with -fno-second-underscore. I couldn't fathom where to put that in. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
jules@jamstec.go.jp, 30th October 2006.&lt;br /&gt;
&lt;br /&gt;
=Compilation error with NetCDF version 4=&lt;br /&gt;
If you are using identical compilers for genie and netcdf, but still get a compilation error message associated with netcdf (e.g. ''This module file was generated for a different platform or by an incompatible compiler or compiler release. It cannot be read''), there may be a compatibility issue with your netcdf version. Switching from NetCDF version 4 (RHES4) to v3.6.1 has bypassed this problem (using Red Hat/ifort/icc), although the reason for this is not known.&lt;br /&gt;
&lt;br /&gt;
k.i.c.oliver@open.ac.uk, 21st November 2006&lt;br /&gt;
&lt;br /&gt;
=Intel Fortran v7.1, INT() and PARAMETER()=&lt;br /&gt;
&lt;br /&gt;
ifcv7.1 will not compile statements of the form:&lt;br /&gt;
&lt;br /&gt;
 * PARAMETER (N=INT(..))&lt;br /&gt;
&lt;br /&gt;
Hence they have been removed from genie-land/src/fotran/qsat.f&lt;br /&gt;
&lt;br /&gt;
Gethin Williams Fri Dec 15 16:58:47 GMT 2006&lt;br /&gt;
&lt;br /&gt;
=New line characters in text files (UNIX/Windows)=&lt;br /&gt;
&lt;br /&gt;
===Description of problem===&lt;br /&gt;
&lt;br /&gt;
UNIX uses a linefeed character (as should CVS internally), but Windows uses both carriage-return and linefeed (CR/LF).  Some compilers/other tools may have trouble reading or displaying files that have the wrong new line characters for the platform.    A symptom of this can be a large number of &amp;quot;odd-looking&amp;quot; compiler errors, and the problem may not be easy to spot because most code editors correctly display both UNIX and Windows new lines.  Note that CVS should append the appropriate new line characters for the platform onto which a source file is checked out, but this may not be reliable.&lt;br /&gt;
&lt;br /&gt;
===Suggested solutions===&lt;br /&gt;
&lt;br /&gt;
If your text editor has an option allowing you to change the new line character, edit the option and save the file.  UNIX commands are also available to do the job, for example:&lt;br /&gt;
&lt;br /&gt;
* dos2unix -ascii my_source_file.f90 my_source_file.f90&lt;br /&gt;
* unix2dos -ascii my_source_file.f90 my_source_file.f90&lt;br /&gt;
&lt;br /&gt;
Ian Henderson Fri Jan 12 15:49:57 GMT 2007&lt;br /&gt;
&lt;br /&gt;
=Standard Fortran compliance=&lt;br /&gt;
&lt;br /&gt;
===Description of problem===&lt;br /&gt;
&lt;br /&gt;
Most compilers allow extensions to the Fortran language, but using these extensions may cause errors when a different (often older) compiler is used.  For instance, the only format descriptor that can be used without an explicit width is the character descriptor &amp;quot;A&amp;quot;, however many compilers will allow other format descriptors to be used without a width, e.g. &amp;quot;G&amp;quot;, to which a default width (and number of characters right of the decimal place) is applied by the compiler.&lt;br /&gt;
&lt;br /&gt;
===Suggested solutions===&lt;br /&gt;
&lt;br /&gt;
The GENIE overnight tests are carried out on several different platforms (Linux, Windows, Solaris) with different compilers.  However, it isn't practicable to test every combination of platform and compiler, so when adding significant amounts of new code to GENIE it may be worth testing on more than one compiler/platform if available.&lt;br /&gt;
&lt;br /&gt;
A good check for non-standard Fortran is to compile GENIE with an appropriate compiler option that checks for standards compliance (the compiler option can be added in makefile.arc).  In general, it's best to avoid non-standard Fortran unless there's a strong argument for using it.&lt;br /&gt;
&lt;br /&gt;
Compiler flags for popular Fortran compilers:&lt;br /&gt;
&lt;br /&gt;
* -std -- Intel (ifort)&lt;br /&gt;
* -Mstandard -- Portland (pgf90)&lt;br /&gt;
* -ansi -- Sun (f95)&lt;br /&gt;
&lt;br /&gt;
The ISO Fortran standard homepage is here: http://www.nag.co.uk/sc22wg5/&lt;br /&gt;
&lt;br /&gt;
Ian Henderson Fri Jan 12 15:49:57 GMT 2007&lt;/div&gt;</summary>
		<author><name>Genie-user</name></author>
	</entry>
	<entry>
		<id>https://source.geography.bristol.ac.uk/mediawiki/index.php?title=GENIE_experiments&amp;diff=7260</id>
		<title>GENIE experiments</title>
		<link rel="alternate" type="text/html" href="https://source.geography.bristol.ac.uk/mediawiki/index.php?title=GENIE_experiments&amp;diff=7260"/>
		<updated>2010-03-23T09:30:53Z</updated>

		<summary type="html">&lt;p&gt;Genie-user: /* Howto */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page introduces a new way to configure and run traceable (i.e. reproduceable) GENIE experiments. We hope that this new method of approaching the organisation of GENIE files will make more sense to new users too.&lt;br /&gt;
&lt;br /&gt;
[[#creating_and_configuring_GENIE_experiments|ENOUGH WITH THE BLATHER! Just show me how to built an experiment]]&lt;br /&gt;
&lt;br /&gt;
== The old way ==&lt;br /&gt;
&lt;br /&gt;
By convention, the normal place for GENIE to output data is a directory outside of the genie source tree, normally at the same level as the top-level genie directory, called genie_output. When an experiment with experiment id 'my_experiment' is compiled and run using the confusingly named genie_example.job script (which is traditionally used to compile and run all GENIE model runs), a directory genie_output/my_experiment is made, and directories made within it for each GENIE component model (e.g. embm) to write data into.&lt;br /&gt;
&lt;br /&gt;
So far, this is all very sensible, but then things get a bit confusing. The genie_example.job script generates namelist files of runtime parameters from the xml config file (or goin files in the soon-to-be-deprecated old way of specifying model configuration). These are used by the compiled executable so that it knows what configuration settings to run the model with (i.e. the details of the experiment you're doing, where to find input files, where to write output, whether or not do do x, or y etc). These namelist files (e.g. data_EMBM) and the executable are copied into genie_output/my_experiment and then the model is run from within the my_experiment directory. So, the my_experiment directory is more than just genie_output - it's in fact most of what you need to run the experiment. With the exception of a bunch of input files (topography, forcings etc), which are generally found within the source tree of the model, the location and details of which are specified in the config file, everything you need to run the experiment without the presence of the genie source tree is contained within my_experiment, along with the output data produced by the model. &lt;br /&gt;
&lt;br /&gt;
There's nothing at all insensible about most of this - having the compiled model executable and namelist parameters along with the model output is good for traceability (in theory, if nothing in the source tree has been changed since you ran the experiment, you should be able to navigate to genie_output/my_experiment and launch genie.exe, and exactly reproduce your previous results. In practice, it's rarely that simple and there are some things we can do to improve traceability; but the main problem with the above is the misleading name of the genie_output folder and the difficulty of having it outside the source tree. Therefore we have made a new directory in the genie tree, called genie-experiments, from which experiments can be configured, built and run with relative ease and better traceability.&lt;br /&gt;
&lt;br /&gt;
== GENIE experiments ==&lt;br /&gt;
&lt;br /&gt;
The motivation behind the changes outlined here is to i) make GENIE easier to configure and run for new users by making it more obvious what's what and ii) to facilitate the creation of full traceable and portable (i.e. source-tree-independent) compiled experiments, which can be run manually (i.e. by executing genie.exe) or through a front end (e.g. the [[GENIE_ALADDIN2|ALADDIN launchpad]]). Thus we have come up with the following specification for the structure and content of a GENIE experiment directory, which is portable and traceable. It is as follows&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
my_experiment/             // the experiment directory, by default written to genie/genie-experiments&lt;br /&gt;
 |&lt;br /&gt;
 |-aladdin/                // this directory not strictly part of the specification, but essential to an &lt;br /&gt;
 | |                       // experiment's use with the [[GENIE_ALADDIN2|ALADDIN launchpad]].&lt;br /&gt;
 | |-graphVarData.xml&lt;br /&gt;
 | |-mapVarData.xml        // see [[GENIE_ALADDIN2_varData_files]]&lt;br /&gt;
 |&lt;br /&gt;
 |-archive/                // directory containing information necessary to reproduce the experiment at a later date&lt;br /&gt;
 | |-definition.xml        // definition.xml containing the default values of all model parameters / settings&lt;br /&gt;
 | |-my_experiment.xml     // the user-defined experiment config used to generate the experiment&lt;br /&gt;
 | |-svn.info              // the result of doing svn info &amp;gt; svn.info in the top=level genie directory&lt;br /&gt;
 | |-svn.diff              // svn diff &amp;gt; svn.diff*&lt;br /&gt;
 | |-genie_example.job    &lt;br /&gt;
 | |-genie_gridsizes.txt&lt;br /&gt;
 | |-makefile.arc&lt;br /&gt;
 |&lt;br /&gt;
 |-&amp;lt;module_name&amp;gt;/          // e.g. 'embm' - directory for each component model containing output data (unchanged from  &lt;br /&gt;
 |                         // old genie_output directories). Can be empty if experiment compiled but not run&lt;br /&gt;
 |&lt;br /&gt;
 |-input/                  // input directory contains model inputs for each component and mirrors directory structure &lt;br /&gt;
 | |                       // of genie source tree to location of input files. i.e.:&lt;br /&gt;
 | |-genie-&amp;lt;module_name&amp;gt;/&lt;br /&gt;
 |   |-data/&lt;br /&gt;
 |     |-input/&lt;br /&gt;
 |       |-&amp;lt;input files&amp;gt; &lt;br /&gt;
 |&lt;br /&gt;
 |-data_&amp;lt;MODULE_NAME&amp;gt;     // e.g. data_EMBM, data_genie. Namelist files for experiment config &lt;br /&gt;
 |                        // (unchanged from the old genie_output approach) as&lt;br /&gt;
 |&lt;br /&gt;
 |-genie.exe              // compiled genie exectuable&lt;br /&gt;
 |&lt;br /&gt;
 |-genie_wrapper.sh       // genie wrapper which logs output to ./genie.out and contains controls for ALADDIN2  &lt;br /&gt;
                          // (not essential to the specification of a genie-experiment, but useful)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; the commands svn info and svn diff together in theory allow the recreation of any particular state of the genie source tree, whether a committed version or one containing user-changed code which wasn't in the repository at the time of doing the experiment. In practice, it would be silly to take GENIE into battle without using a fully-committed-to-svn version of the model, otherwise getting back to the same state in the future could be extremely difficult and messy even with the help of svn info and svn diff. If you're working with the GENIE trunk and not doing your own development work, it would be advisable to use a tuned tagged release of the model, which is set in stone and can always be reproduced.&lt;br /&gt;
&lt;br /&gt;
== Creating and configuring GENIE experiments ==&lt;br /&gt;
&lt;br /&gt;
It is assumed that you're adopting our proposed new genie/genie-experiments directory as the location for creating your compiled experiments (if not, you should be able to work out what needs changing in the details below, but don't come running to us when it all goes wrong...). &lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
&lt;br /&gt;
in genie/genie-experiments directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./build_experiment -f files/&amp;lt;file list&amp;gt; -c configs/&amp;lt;config file&amp;gt; (-m &amp;lt;mavVarData file&amp;gt; -g&amp;lt;graphVarData file&amp;gt; -n)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The optional -n command-line argument will create an experiment without recompiling the model.&lt;br /&gt;
The optional mapVarData and graphVarData files are specific to ALADDIN, where they are used to interpret ascii output files to extract parameters to be visualised in ALADDIN during the experiment. See [[GENIE_ALADDIN2_varData_files]]&lt;br /&gt;
&lt;br /&gt;
=== Howto ===&lt;br /&gt;
&lt;br /&gt;
You will need:&lt;br /&gt;
&lt;br /&gt;
# a working version of the genie source code and its prerequisites&lt;br /&gt;
# an experiment you want to build - i.e. an xml config file with your parameters of interest set to the values you want (note if you're doing this for ALADDIN you may wish to 'expose' them for user-configuration and set a range of available values - see the [[GENIE_ALADDIN_DOCS|ALADDIN documentation]]). &lt;br /&gt;
# knowledge of which data input files the experiment you want to do requires (see below).&lt;br /&gt;
# a terminal to run commands on&lt;br /&gt;
# a text editor&lt;br /&gt;
&lt;br /&gt;
You will also need to make sure the OUTROOT and RUNTIME_ROOT environment variables are set correctly in user.sh:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CODEDIR             =/path/to/genie    // ~/genie by default&lt;br /&gt;
OUTROOT             =${CODEDIR}/genie-experiments&lt;br /&gt;
RUNTIME_ROOT        = ${RUNTIME_ROOT:=../..}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and also OUT_DIR and RUNTIME_ROOT in user.mak:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GENIE_ROOT          = /path/to/genie&lt;br /&gt;
OUT_DIR             = $(GENIE_ROOT)/genie-experiments&lt;br /&gt;
RUNTIME_ROOT        = ../..&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
==== File lists ====&lt;br /&gt;
&lt;br /&gt;
Now, because we are creating a standalone experiment, we need to make sure that (i) all the necessary input files (topography, restart files, tracer initialisations, forcings etc) are in the correct places within the genie experiment structure (see specification) and (ii) that your xml config file is pointing GENIE to the correct place to look for them.&lt;br /&gt;
&lt;br /&gt;
The first part of this is non-trivial - as well as knowing how many files of what type are required for a particular run/ setup, you also need to know which of a selection of files are most appropriate. This isn't obvious, or documented anywhere at the moment, but I hope in the future [[GENIE_input_files]] might contain what you need to know. For now, a good starting point is to look around in the genie/genie-&amp;lt;module-name&amp;gt;/data/input directories and see what you can see. Also trial and error works OK - GENIE is pretty good at telling you when it's missing a file and the correct files can be diagnosed from this.&lt;br /&gt;
&lt;br /&gt;
To make life easier, there are a number of file lists provided for 'standard' model setups in genie-experiments/files. If you need to make a new one for a particular config / model setup, we'd be grateful if you'd add a filelist with a self-explanatory filename into the files directory and document it in [[GENIE_input_files]] if appropriate. &lt;br /&gt;
&lt;br /&gt;
These filelists must contain soleley a list of files required and all of the files must be situated within the genie source tree, preferably in their default locations, so that minimum changes are required to experiment config file to point GENIE to the correct place in the experiment directory when these files have been copied across by build_experiment.sh.&lt;br /&gt;
&lt;br /&gt;
e.g. a filelist for a standard 8 level eb_go_gs_el run might look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
genie-embm/data/input/worbe2.k1&lt;br /&gt;
genie-embm/data/input/taux_u.interp&lt;br /&gt;
genie-embm/data/input/taux_v.interp&lt;br /&gt;
genie-embm/data/input/tauy_u.interp&lt;br /&gt;
genie-embm/data/input/tauy_v.interp&lt;br /&gt;
genie-embm/data/input/uncep.silo&lt;br /&gt;
genie-embm/data/input/vncep.silo&lt;br /&gt;
genie-embm/data/input/ta_ncep.silo&lt;br /&gt;
genie-embm/data/input/qa_ncep.silo&lt;br /&gt;
genie-goldstein/data/input/worbe2.k1&lt;br /&gt;
genie-goldstein/data/input/worbe2.psiles&lt;br /&gt;
genie-goldstein/data/input/worbe2.paths&lt;br /&gt;
genie-goldstein/data/input/tempann.silo&lt;br /&gt;
genie-goldstein/data/input/saliann.silo&lt;br /&gt;
genie-goldsteinseaice/data/input/worbe2.k1&lt;br /&gt;
genie-ents/data/k_constants.dat&lt;br /&gt;
genie-ents/config/ents_config.par&lt;br /&gt;
genie-ents/data/atm_albedo_monthly.dat&lt;br /&gt;
genie-ents/data/uvic_windx.silo&lt;br /&gt;
genie-ents/data/uvic_windy.silo&lt;br /&gt;
genie-ents/data/monthly_windspd.silo&lt;br /&gt;
genie-ents/data/inv_linterp_matrix.dat&lt;br /&gt;
genie-ents/data/orography.dat&lt;br /&gt;
genie-ents/data/icemask.dat&lt;br /&gt;
genie-ents/config/sealevel_config.par&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== input (and output) directory information in my_experiment.xml ====&lt;br /&gt;
&lt;br /&gt;
In definitions.xml, the default settings for genie, which are overridden by those specified in your experiment config file, default directory locations are specified, e.g. for the EMBM:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   &amp;lt;param name=&amp;quot;indir_name&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;value datatype=&amp;quot;string&amp;quot;&amp;gt;&amp;lt;varref&amp;gt;RUNTIME_ROOT&amp;lt;/varref&amp;gt;&amp;lt;sep/&amp;gt;genie-embm&amp;lt;sep/&amp;gt;data&amp;lt;sep/&amp;gt;input&amp;lt;/value&amp;gt;&lt;br /&gt;
   &amp;lt;/param&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;param name=&amp;quot;rstdir_name&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;value datatype=&amp;quot;string&amp;quot;&amp;gt;&amp;lt;varref&amp;gt;RUNTIME_ROOT&amp;lt;/varref&amp;gt;&amp;lt;sep/&amp;gt;genie-embm&amp;lt;sep/&amp;gt;data&amp;lt;sep/&amp;gt;input&amp;lt;/value&amp;gt;&lt;br /&gt;
     &amp;lt;description&amp;gt;restart (input) directory&amp;lt;/description&amp;gt;&lt;br /&gt;
   &amp;lt;/param&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;param name=&amp;quot;outdir_name&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;value datatype=&amp;quot;string&amp;quot;&amp;gt;&amp;lt;varref&amp;gt;RUNTIME_OUTDIR&amp;lt;/varref&amp;gt;&amp;lt;sep/&amp;gt;embm&amp;lt;/value&amp;gt;&lt;br /&gt;
   &amp;lt;/param&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the output directory for EMBM is already set correctly to meet with the specification of a GENIE experiment. However, it could be simplified by replacing '&amp;lt;varref&amp;gt;RUNTIME_OUTDIR&amp;lt;/varref&amp;gt;' with '.' as genie.exe is executed from within the experiment directory.&lt;br /&gt;
&lt;br /&gt;
The input directories however have to be changed to point at the input directory of the experiment directory. Therefore, in the embm section of your config file, you will need to override the default values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   &amp;lt;param name=&amp;quot;indir_name&amp;quot;&amp;gt;.&amp;lt;sep/&amp;gt;input&amp;lt;sep/&amp;gt;genie-embm&amp;lt;sep/&amp;gt;data&amp;lt;sep/&amp;gt;input&amp;lt;/param&amp;gt;&lt;br /&gt;
   &amp;lt;param name=&amp;quot;rstdir_name&amp;quot;&amp;gt;.&amp;lt;sep/&amp;gt;input&amp;lt;sep/&amp;gt;genie-embm&amp;lt;sep/&amp;gt;data&amp;lt;sep/&amp;gt;input&amp;lt;/param&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== build_experiment.sh ===&lt;br /&gt;
&lt;br /&gt;
The build_experiment.sh script does the following:&lt;br /&gt;
&lt;br /&gt;
# creates an experiment directory within genie-experiments and input and aladdin subdirectories&lt;br /&gt;
# copies user-specified (by -m and -g) or default mapVarData and graphVarData files to the ALADDIN directory&lt;br /&gt;
# copies input files specified in the file list (as &amp;lt;path-to-file&amp;gt;) from genie/&amp;lt;path-to-file&amp;gt; to my_experiment/input/&amp;lt;path-to-file&amp;gt;&lt;br /&gt;
# copies genie_wrapper.sh to my_experiment&lt;br /&gt;
# copies config file to genie-main/configs&lt;br /&gt;
# changes directory to genie-main and runs make cleanall (unless -n option specified)&lt;br /&gt;
# executes genie_example.job -f &amp;lt;configfile&amp;gt; -x which does most of the work&lt;br /&gt;
&lt;br /&gt;
note that the -x command-line argument to genie_example.job supresses the execution of the model i.e. compilation and file copying to experiment directory only.&lt;br /&gt;
&lt;br /&gt;
Your GENIE experiment can now be moved to anywhere and run from there (by ./genie_wrapper.sh for logged output or ./genie.exe for command-line output) or used with ALADDIN, independent from the genie source tree. Yay!&lt;/div&gt;</summary>
		<author><name>Genie-user</name></author>
	</entry>
	<entry>
		<id>https://source.geography.bristol.ac.uk/mediawiki/index.php?title=GENIE_ALADDIN2&amp;diff=7259</id>
		<title>GENIE ALADDIN2</title>
		<link rel="alternate" type="text/html" href="https://source.geography.bristol.ac.uk/mediawiki/index.php?title=GENIE_ALADDIN2&amp;diff=7259"/>
		<updated>2010-03-23T09:21:59Z</updated>

		<summary type="html">&lt;p&gt;Genie-user: /* Get ALADDIN */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=ALADDIN: the GENIE launchpad=&lt;br /&gt;
&lt;br /&gt;
ALADDIN has been developed as part of the [[http://engage.ac.uk/ ENGAGE]] programme,  in collaboration with the Open Middleware Infrastructure Institute [[http://omii.ac.uk OMII]].&lt;br /&gt;
&lt;br /&gt;
==Get ALADDIN==&lt;br /&gt;
Aladdin2 is available in the GENIE trunk since release 2-6-0 or thereabouts. It can be found in genie-gui/package where you can execute &amp;lt;pre&amp;gt;java -jar GenieGUI.jar&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==What ALADDIN can do==&lt;br /&gt;
The ALADDIN launchpad is designed as a means to run [[GENIE_experiments|GENIE experiments]] through a graphical user interface (GUI). It requires an experiment directory with a compiled instance of the model, which may or may not have parameters exposed (through the xml config file). While the model is running it will provide real-time visualisation of key 2d and 3d parameters on a graph and a globe. When directed to an ALADDIN run directory (the output from a particular run of  a GENIE experiment - normally found as a subdirectory of the experiment directory) it will re-plot the data from the run for the purposes of simple visualisation of old runs. For compley data visualisation an application such as MatLab is recommended.   &lt;br /&gt;
&lt;br /&gt;
For more information, see the [[GENIE_ALADDIN_DOCS| ALADDIN Documentation]]&lt;br /&gt;
&lt;br /&gt;
==Where we'd like to go with ALADDIN==&lt;br /&gt;
Currently, ALADDIN works as standalone tool for running GENIE from a pre-compiled experiment directory, and as such is well suited for teaching and outreach purposes. In the future ALADDIN will also be able to fully configure, compile and launch GENIE, working with a copy of the GENIE source tree. It will read and plot sensible NetCDF output (it currently only works with ascii output files. It will be able to configure and launch mulitple instances of GENIE on remote computing resources such as the national grid service, or produce genie experiment directories ready to be copied to your local HPC resource and launched through the queueing system of your (or more likely your sysadmins) choice.&lt;/div&gt;</summary>
		<author><name>Genie-user</name></author>
	</entry>
	<entry>
		<id>https://source.geography.bristol.ac.uk/mediawiki/index.php?title=GENIE_experiments&amp;diff=7258</id>
		<title>GENIE experiments</title>
		<link rel="alternate" type="text/html" href="https://source.geography.bristol.ac.uk/mediawiki/index.php?title=GENIE_experiments&amp;diff=7258"/>
		<updated>2010-03-23T09:20:15Z</updated>

		<summary type="html">&lt;p&gt;Genie-user: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page introduces a new way to configure and run traceable (i.e. reproduceable) GENIE experiments. We hope that this new method of approaching the organisation of GENIE files will make more sense to new users too.&lt;br /&gt;
&lt;br /&gt;
[[#creating_and_configuring_GENIE_experiments|ENOUGH WITH THE BLATHER! Just show me how to built an experiment]]&lt;br /&gt;
&lt;br /&gt;
== The old way ==&lt;br /&gt;
&lt;br /&gt;
By convention, the normal place for GENIE to output data is a directory outside of the genie source tree, normally at the same level as the top-level genie directory, called genie_output. When an experiment with experiment id 'my_experiment' is compiled and run using the confusingly named genie_example.job script (which is traditionally used to compile and run all GENIE model runs), a directory genie_output/my_experiment is made, and directories made within it for each GENIE component model (e.g. embm) to write data into.&lt;br /&gt;
&lt;br /&gt;
So far, this is all very sensible, but then things get a bit confusing. The genie_example.job script generates namelist files of runtime parameters from the xml config file (or goin files in the soon-to-be-deprecated old way of specifying model configuration). These are used by the compiled executable so that it knows what configuration settings to run the model with (i.e. the details of the experiment you're doing, where to find input files, where to write output, whether or not do do x, or y etc). These namelist files (e.g. data_EMBM) and the executable are copied into genie_output/my_experiment and then the model is run from within the my_experiment directory. So, the my_experiment directory is more than just genie_output - it's in fact most of what you need to run the experiment. With the exception of a bunch of input files (topography, forcings etc), which are generally found within the source tree of the model, the location and details of which are specified in the config file, everything you need to run the experiment without the presence of the genie source tree is contained within my_experiment, along with the output data produced by the model. &lt;br /&gt;
&lt;br /&gt;
There's nothing at all insensible about most of this - having the compiled model executable and namelist parameters along with the model output is good for traceability (in theory, if nothing in the source tree has been changed since you ran the experiment, you should be able to navigate to genie_output/my_experiment and launch genie.exe, and exactly reproduce your previous results. In practice, it's rarely that simple and there are some things we can do to improve traceability; but the main problem with the above is the misleading name of the genie_output folder and the difficulty of having it outside the source tree. Therefore we have made a new directory in the genie tree, called genie-experiments, from which experiments can be configured, built and run with relative ease and better traceability.&lt;br /&gt;
&lt;br /&gt;
== GENIE experiments ==&lt;br /&gt;
&lt;br /&gt;
The motivation behind the changes outlined here is to i) make GENIE easier to configure and run for new users by making it more obvious what's what and ii) to facilitate the creation of full traceable and portable (i.e. source-tree-independent) compiled experiments, which can be run manually (i.e. by executing genie.exe) or through a front end (e.g. the [[GENIE_ALADDIN2|ALADDIN launchpad]]). Thus we have come up with the following specification for the structure and content of a GENIE experiment directory, which is portable and traceable. It is as follows&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
my_experiment/             // the experiment directory, by default written to genie/genie-experiments&lt;br /&gt;
 |&lt;br /&gt;
 |-aladdin/                // this directory not strictly part of the specification, but essential to an &lt;br /&gt;
 | |                       // experiment's use with the [[GENIE_ALADDIN2|ALADDIN launchpad]].&lt;br /&gt;
 | |-graphVarData.xml&lt;br /&gt;
 | |-mapVarData.xml        // see [[GENIE_ALADDIN2_varData_files]]&lt;br /&gt;
 |&lt;br /&gt;
 |-archive/                // directory containing information necessary to reproduce the experiment at a later date&lt;br /&gt;
 | |-definition.xml        // definition.xml containing the default values of all model parameters / settings&lt;br /&gt;
 | |-my_experiment.xml     // the user-defined experiment config used to generate the experiment&lt;br /&gt;
 | |-svn.info              // the result of doing svn info &amp;gt; svn.info in the top=level genie directory&lt;br /&gt;
 | |-svn.diff              // svn diff &amp;gt; svn.diff*&lt;br /&gt;
 | |-genie_example.job    &lt;br /&gt;
 | |-genie_gridsizes.txt&lt;br /&gt;
 | |-makefile.arc&lt;br /&gt;
 |&lt;br /&gt;
 |-&amp;lt;module_name&amp;gt;/          // e.g. 'embm' - directory for each component model containing output data (unchanged from  &lt;br /&gt;
 |                         // old genie_output directories). Can be empty if experiment compiled but not run&lt;br /&gt;
 |&lt;br /&gt;
 |-input/                  // input directory contains model inputs for each component and mirrors directory structure &lt;br /&gt;
 | |                       // of genie source tree to location of input files. i.e.:&lt;br /&gt;
 | |-genie-&amp;lt;module_name&amp;gt;/&lt;br /&gt;
 |   |-data/&lt;br /&gt;
 |     |-input/&lt;br /&gt;
 |       |-&amp;lt;input files&amp;gt; &lt;br /&gt;
 |&lt;br /&gt;
 |-data_&amp;lt;MODULE_NAME&amp;gt;     // e.g. data_EMBM, data_genie. Namelist files for experiment config &lt;br /&gt;
 |                        // (unchanged from the old genie_output approach) as&lt;br /&gt;
 |&lt;br /&gt;
 |-genie.exe              // compiled genie exectuable&lt;br /&gt;
 |&lt;br /&gt;
 |-genie_wrapper.sh       // genie wrapper which logs output to ./genie.out and contains controls for ALADDIN2  &lt;br /&gt;
                          // (not essential to the specification of a genie-experiment, but useful)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; the commands svn info and svn diff together in theory allow the recreation of any particular state of the genie source tree, whether a committed version or one containing user-changed code which wasn't in the repository at the time of doing the experiment. In practice, it would be silly to take GENIE into battle without using a fully-committed-to-svn version of the model, otherwise getting back to the same state in the future could be extremely difficult and messy even with the help of svn info and svn diff. If you're working with the GENIE trunk and not doing your own development work, it would be advisable to use a tuned tagged release of the model, which is set in stone and can always be reproduced.&lt;br /&gt;
&lt;br /&gt;
== Creating and configuring GENIE experiments ==&lt;br /&gt;
&lt;br /&gt;
It is assumed that you're adopting our proposed new genie/genie-experiments directory as the location for creating your compiled experiments (if not, you should be able to work out what needs changing in the details below, but don't come running to us when it all goes wrong...). &lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
&lt;br /&gt;
in genie/genie-experiments directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./build_experiment -f files/&amp;lt;file list&amp;gt; -c configs/&amp;lt;config file&amp;gt; (-m &amp;lt;mavVarData file&amp;gt; -g&amp;lt;graphVarData file&amp;gt; -n)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The optional -n command-line argument will create an experiment without recompiling the model.&lt;br /&gt;
The optional mapVarData and graphVarData files are specific to ALADDIN, where they are used to interpret ascii output files to extract parameters to be visualised in ALADDIN during the experiment. See [[GENIE_ALADDIN2_varData_files]]&lt;br /&gt;
&lt;br /&gt;
=== Howto ===&lt;br /&gt;
&lt;br /&gt;
You will need:&lt;br /&gt;
&lt;br /&gt;
# a working version of the genie source code and its prerequisites&lt;br /&gt;
# an experiment you want to build - i.e. an xml config file with your parameters of interest set to the values you want (note if you're doing this for ALADDIN you may wish to 'expose' them for user-configuration and set a range of available values - see the [[GENIE_ALADDIN_DOCS|ALADDIN documentation]]). &lt;br /&gt;
# knowledge of which data input files the experiment you want to do requires (see below).&lt;br /&gt;
# a terminal to run commands on&lt;br /&gt;
# a text editor&lt;br /&gt;
&lt;br /&gt;
You will also need to make sure the OUTROOT environment variable is set correctly in user.sh:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CODEDIR=/path/to/genie    // ~/genie by default&lt;br /&gt;
OUTROOT=${CODEDIR}/genie-experiments&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and OUT_DIR in user.mak:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GENIE_ROOT          = /path/to/genie&lt;br /&gt;
OUT_DIR             = $(GENIE_ROOT)/genie-experiments&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
==== File lists ====&lt;br /&gt;
&lt;br /&gt;
Now, because we are creating a standalone experiment, we need to make sure that (i) all the necessary input files (topography, restart files, tracer initialisations, forcings etc) are in the correct places within the genie experiment structure (see specification) and (ii) that your xml config file is pointing GENIE to the correct place to look for them.&lt;br /&gt;
&lt;br /&gt;
The first part of this is non-trivial - as well as knowing how many files of what type are required for a particular run/ setup, you also need to know which of a selection of files are most appropriate. This isn't obvious, or documented anywhere at the moment, but I hope in the future [[GENIE_input_files]] might contain what you need to know. For now, a good starting point is to look around in the genie/genie-&amp;lt;module-name&amp;gt;/data/input directories and see what you can see. Also trial and error works OK - GENIE is pretty good at telling you when it's missing a file and the correct files can be diagnosed from this.&lt;br /&gt;
&lt;br /&gt;
To make life easier, there are a number of file lists provided for 'standard' model setups in genie-experiments/files. If you need to make a new one for a particular config / model setup, we'd be grateful if you'd add a filelist with a self-explanatory filename into the files directory and document it in [[GENIE_input_files]] if appropriate. &lt;br /&gt;
&lt;br /&gt;
These filelists must contain soleley a list of files required and all of the files must be situated within the genie source tree, preferably in their default locations, so that minimum changes are required to experiment config file to point GENIE to the correct place in the experiment directory when these files have been copied across by build_experiment.sh.&lt;br /&gt;
&lt;br /&gt;
e.g. a filelist for a standard 8 level eb_go_gs_el run might look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
genie-embm/data/input/worbe2.k1&lt;br /&gt;
genie-embm/data/input/taux_u.interp&lt;br /&gt;
genie-embm/data/input/taux_v.interp&lt;br /&gt;
genie-embm/data/input/tauy_u.interp&lt;br /&gt;
genie-embm/data/input/tauy_v.interp&lt;br /&gt;
genie-embm/data/input/uncep.silo&lt;br /&gt;
genie-embm/data/input/vncep.silo&lt;br /&gt;
genie-embm/data/input/ta_ncep.silo&lt;br /&gt;
genie-embm/data/input/qa_ncep.silo&lt;br /&gt;
genie-goldstein/data/input/worbe2.k1&lt;br /&gt;
genie-goldstein/data/input/worbe2.psiles&lt;br /&gt;
genie-goldstein/data/input/worbe2.paths&lt;br /&gt;
genie-goldstein/data/input/tempann.silo&lt;br /&gt;
genie-goldstein/data/input/saliann.silo&lt;br /&gt;
genie-goldsteinseaice/data/input/worbe2.k1&lt;br /&gt;
genie-ents/data/k_constants.dat&lt;br /&gt;
genie-ents/config/ents_config.par&lt;br /&gt;
genie-ents/data/atm_albedo_monthly.dat&lt;br /&gt;
genie-ents/data/uvic_windx.silo&lt;br /&gt;
genie-ents/data/uvic_windy.silo&lt;br /&gt;
genie-ents/data/monthly_windspd.silo&lt;br /&gt;
genie-ents/data/inv_linterp_matrix.dat&lt;br /&gt;
genie-ents/data/orography.dat&lt;br /&gt;
genie-ents/data/icemask.dat&lt;br /&gt;
genie-ents/config/sealevel_config.par&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== input (and output) directory information in my_experiment.xml ====&lt;br /&gt;
&lt;br /&gt;
In definitions.xml, the default settings for genie, which are overridden by those specified in your experiment config file, default directory locations are specified, e.g. for the EMBM:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   &amp;lt;param name=&amp;quot;indir_name&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;value datatype=&amp;quot;string&amp;quot;&amp;gt;&amp;lt;varref&amp;gt;RUNTIME_ROOT&amp;lt;/varref&amp;gt;&amp;lt;sep/&amp;gt;genie-embm&amp;lt;sep/&amp;gt;data&amp;lt;sep/&amp;gt;input&amp;lt;/value&amp;gt;&lt;br /&gt;
   &amp;lt;/param&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;param name=&amp;quot;rstdir_name&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;value datatype=&amp;quot;string&amp;quot;&amp;gt;&amp;lt;varref&amp;gt;RUNTIME_ROOT&amp;lt;/varref&amp;gt;&amp;lt;sep/&amp;gt;genie-embm&amp;lt;sep/&amp;gt;data&amp;lt;sep/&amp;gt;input&amp;lt;/value&amp;gt;&lt;br /&gt;
     &amp;lt;description&amp;gt;restart (input) directory&amp;lt;/description&amp;gt;&lt;br /&gt;
   &amp;lt;/param&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;param name=&amp;quot;outdir_name&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;value datatype=&amp;quot;string&amp;quot;&amp;gt;&amp;lt;varref&amp;gt;RUNTIME_OUTDIR&amp;lt;/varref&amp;gt;&amp;lt;sep/&amp;gt;embm&amp;lt;/value&amp;gt;&lt;br /&gt;
   &amp;lt;/param&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the output directory for EMBM is already set correctly to meet with the specification of a GENIE experiment. However, it could be simplified by replacing '&amp;lt;varref&amp;gt;RUNTIME_OUTDIR&amp;lt;/varref&amp;gt;' with '.' as genie.exe is executed from within the experiment directory.&lt;br /&gt;
&lt;br /&gt;
The input directories however have to be changed to point at the input directory of the experiment directory. Therefore, in the embm section of your config file, you will need to override the default values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   &amp;lt;param name=&amp;quot;indir_name&amp;quot;&amp;gt;.&amp;lt;sep/&amp;gt;input&amp;lt;sep/&amp;gt;genie-embm&amp;lt;sep/&amp;gt;data&amp;lt;sep/&amp;gt;input&amp;lt;/param&amp;gt;&lt;br /&gt;
   &amp;lt;param name=&amp;quot;rstdir_name&amp;quot;&amp;gt;.&amp;lt;sep/&amp;gt;input&amp;lt;sep/&amp;gt;genie-embm&amp;lt;sep/&amp;gt;data&amp;lt;sep/&amp;gt;input&amp;lt;/param&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== build_experiment.sh ===&lt;br /&gt;
&lt;br /&gt;
The build_experiment.sh script does the following:&lt;br /&gt;
&lt;br /&gt;
# creates an experiment directory within genie-experiments and input and aladdin subdirectories&lt;br /&gt;
# copies user-specified (by -m and -g) or default mapVarData and graphVarData files to the ALADDIN directory&lt;br /&gt;
# copies input files specified in the file list (as &amp;lt;path-to-file&amp;gt;) from genie/&amp;lt;path-to-file&amp;gt; to my_experiment/input/&amp;lt;path-to-file&amp;gt;&lt;br /&gt;
# copies genie_wrapper.sh to my_experiment&lt;br /&gt;
# copies config file to genie-main/configs&lt;br /&gt;
# changes directory to genie-main and runs make cleanall (unless -n option specified)&lt;br /&gt;
# executes genie_example.job -f &amp;lt;configfile&amp;gt; -x which does most of the work&lt;br /&gt;
&lt;br /&gt;
note that the -x command-line argument to genie_example.job supresses the execution of the model i.e. compilation and file copying to experiment directory only.&lt;br /&gt;
&lt;br /&gt;
Your GENIE experiment can now be moved to anywhere and run from there (by ./genie_wrapper.sh for logged output or ./genie.exe for command-line output) or used with ALADDIN, independent from the genie source tree. Yay!&lt;/div&gt;</summary>
		<author><name>Genie-user</name></author>
	</entry>
</feed>