Migration to the new Atlantis code
How to migrate a model to the new Atlantis code (most models no longer need this, but if you find a dusty one in the back cupboard prior to 2011 or so you may still find this handy).
Bec has created some scripts that will convert your prm files. They will still be prm files they will just contain some additional parameters, these are mostly just values that were assumed before.
Before you use the new code please contact Bec and she will convert your files for you as well as do some testing to make sure the differences in the output with the new code as within a reasonable limit. There will be small differences in the model outputs with the new code due to the joys of floating point numbers (Imagine Bec ranting to herself in her office for weeks on end) - for more details have a look here.
Separate CEP and PWN groups
follow this link: https://wiki.csiro.au/confluence/display/Atlantis/Updating+the+input+files+were+JCEP+and+JPWN+were+%27separate%27+groups
Significant changes in the code:
Input file parsing
One of the biggest changes is that Atlantis wants to parse XML files that are generated by the Atlantis Input GUI being developed. This isn’t quite finished yet and we want to allow people to keep using the prm files if they are keen to do so. Thus the need for some conversion code. These is now a new library in the Atlantis code called ConvertAtlantis. This basically reads in each prm and spits out the XML version of that file. The code isn’t all that nice but it seems to work ok.
So at the start of each module such as biology Atlantis calls the conversion library to convert the biology prm file into the xml file and it then reads in the XML file. If you pass Atlantis a biology file that is already an XML file it will skip the conversion step and go straight to reading in your parameters.
This conversion code will be maintained in the future so feel free to keep using your existing prm files. The XML files are really designed to be edited using the GUI not by hand.
Groups.xml
The groups in the Atlantis model can now be customized. You can have any number of groups and the number of cohorts is not fixed.
The setup of the functional groups is handled by the Groups.XML file
Fisheries.xml
There is also an unlimited number of fisheries and subfleets. The fisheries are setup in a similar XML file called Fisheries.xml
Functional group structure
Lots of the variables associated with a funuctional group are now stored in the FunctGroupArray within the code instead of being in a arrays. For example if you want to print the group code use FunctGroupArray[sp].groupCode instead of bm->spNAME[sp].
The speciesParams are also in the FunctGroupArray.
Array indexing
The new code doesn’t use different codes to index groups in arrays like the old code does. All arrays should be K_num_tot_sp in size and the index of the group should be then be used. While this means arrays might be a bit bigger the code is much easier to debug and read. Most of the bugs in the old code were due to the incorrect index being used in the wrong array.
The only exception to this is detritus. There are a couple of instances where there are arrays for detritus values only. These are allocated as K_num_detritus and the code forces the modellers to define detritus last in the group definition file. The index of the detritus group in the detritus arrays is then (sp + bm->K_num_detritus - bm->K_num_tot_sp) where sp is the detritus group index in the function group definition file.