HOWTO write Modsets

A Modset is a file which contains instructions for modifications to the Unified Model. It can be included within the setup job in the umui and is processed at compilcation time by nupdate. A Modset can be written by hand, the details of how to do this can be found here, but an alternative method is to use nmodex. Nmodex read in an original source file and a modified source file and then generates a difference file. This difference file contains commands which will allow nupdate to reconstruct the modified source file from the original source file.

The way I do this is to create files on Newton using nupdate, and then create the modset here at Reading using nmodex. Here's an example:

creating the source and edit file on newton

First I log on to newton.
Now, the UM source code lives in:
/sanhp/lrum/vn4.5/source/
I issue the command:
nupdate -p /sanhp/lrum/vn4.5/source/umpl -q HNYCAL -s edit.f  
This command will extract the deck (subroutine) called HNYCAL from the program library umpl and write it to a file called edit.f Now:
nupdate -p /sanhp/lrum/vn4.5/source/umpl -q HNYCAL -s source.f  -o sq
This creates a file called source.f which is the same as edit.f except that it has a column with DECK line numbers (which label each line).

Finally I sftp these files back to reading.

creating the modset using nmodex

Now I edit the file edit.f to make the changes I wish to the source code. Once this is done I issue the command:
setup forte
to set up the fortran environment, and then:
nmodex -h -e edit.f -m modset.f -s source.f
This will compare edit.f with source.f and produce a file calledmodset.f. This file can then be used in the umui (under Compilations_and_modifications-Modifications_for_the_model) when creating a Job.

Roger Brugge also has some info on this


Page updated on