Using rebuild_nemo to combine NEMO output files

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

1 Like

Hey @griff, welcome to the Forum!

Thanks for the contribution. I hope you don’t mind, I added a couple of tags to help people find this topic.

Also you can use the triple back-tick for reformatted code blocks, and though the result isn’t spectacular for namelists, It does support fortran code highlighting:

So this

```fortran
&nam_rebuild
filebase = "cplhco.1d.mersea.grid_W"
ndomain = 128
/
```

renders as:

&nam_rebuild
filebase = "cplhco.1d.mersea.grid_W"
ndomain = 128
/

Cheers

Aidan

Thank you for adding the tags - Did look for them, but did not find them, I might have been loking at topics

Good to know about the backticks - I used <pre> and <code> tags - I am trying bacticks in this post

Some functionality isn’t available until you’ve “earned” a higher trust level: to keep complexity down to a minimal level. I’ve bumped your Trust Level so hopefully you should have a bit more functionality now.