Difference between revisions of "Building the UM"
|Line 31:||Line 31:|
Latest revision as of 00:46, 12 December 2019
The UM is designed in such a way that different sections of the code representing different science components can be swapped in or out depending on choices made in the UMUI. This means that changing the model configuration can in some cases require you to recompile the model.
Compilation settings can be found in the Compilation and Modifications section of the UMUI. There are two sections that are important here - the model itself and the reconfiguration. The reconfiguration does preparation work on the initial conditions file, such as interpolating it to the correct resolution and adding in any extra ancillary data files.
Compiling the Reconfiguration
In many cases you won't need to compile the reconfiguration for your run, instead you can make use of the standard version installed under ~access. ACCESS runs however add in a number of extra fields that require modifications to the reconfiguration process, so for these runs you must compile the reconfiguration yourself.
To do this select the 'Compile and build the executable' option in the reconfiguration compile options. The usual practice is to put binaries in the path $DATAW/bin, which is a subdirectory of the model output directory. Once the reconfiguration has been built by submitting the run you can switch this back to 'Run from existing executable'.
Compiling the Model
The model compilation works in a similar way to that of the reconfiguration. There are three options - run using an executable that's already compiled, compile the executable and then run it or only compile the executable.
Selecting either of the compile options shows up a few more options, detailing how the model should be compiled. The important option here is the optimisation level, the rest can usually be left alone. For production runs you'll want to use the 'Safe' optimisation level. This will compile with optimisation enabled & make sure that runs are reproducible - i.e. using the same inputs produces the same outputs. The 'High' optimisation level uses more aggressive optimisations that can break reproducibility.
When diagnosing problems it can be useful to use the 'Debug' optimisation level, which compiles without optimisation. This runs quite a bit slower, however it makes it easy to track what the model is doing in a debugger.
When to Recompile
The model needs to be recompiled whenever you change which science sections are included in the model. Science sections are defined in the Section by Section Choices UMUI section. At the top of each of these panels are options like <3B>, <3C>, <5A> etc. for the section version, each of which add different source code to the model. Changing the section version will mean you need to recompile the model (though not the reconfiguration). Changing other options however will generally be fine.