Using rebuild_nemo.exe for the task of putting the NEMO files back together. Robin pointed me to a ksh script in his public directory and I also read through (some of) the code in the ACCESS-S2 suite - (There was a lot of code) - Which is why the solution seems too easy!
The program that is eventually called by the scripts is rebuild_nemo.exe
and it takes no arguments and crashes without any helpful error messages. You need to run it from within the directory that has the partial files and there needs to be a file called nam_rebuild in that directory too.
The contents of the file (default name nam_rebuild
has a minimal content of:
&nam_rebuild filebase = "cplhco.1d.mersea.grid_W" ndomain = 128 /
Where the filebase
is the name of the file(s) without the last _0000.nc
bit. The ndomain
is the number of files that need to be combined. In the above case the files that will be combined are cplhco.1d.mersea.grid_W_0000.nc
to cplhco.1d.mersea.grid_W_0127.nc
There are several additional options that seem to be available in the processing, but all these seem to be unnecessary for a simple recombination. Additionally, the above file was taken from the ACCESS-S2 hindcast run and shows that the options are not being used.
I have a test directory here /scratch/dx2/gay548/rebuild_nemo_test
if you would like to see an example. The script go
has the minimal code to combine the files. With the nam_rebuild
being:
&nam_rebuild filebase=restart_2020-10-01 ndomain=192 /
There is a compiled rebuild_nemo.exe
here:
/g/data/dx2/access-s2/research/ACCESS-S2/hpc_git_build_20220831/rebuild-nemo/bin/rebuild_nemo.exe
One more very informative link → tools/REBUILD_NEMO · 4.2.0 · NEMO Sources / Nemo · GitLab