Closed aidanheerdegen closed 9 months ago
Thanks @aidanheerdegen . I don't know/remember enough about WW3 off the top of my head to know what is the right solution here. But, I'll have a chat to @ezhilsabareesh8 and sort out a fix soon.
Thanks.
I had a chat to Ezhil, and unfortunately we think that the model definition file has to be in the work directory and called mod_def.ww3
, so we'll have to go with your option 2. I'll submit a PR now.
Problem
The CESM_CMEPS driver copies an input file to the
work
directory (and renames tomod_def.ww3
).https://github.com/payu-org/payu/blob/master/payu/models/cesm_cmeps.py#L181
This is an anti-pattern for
payu
for a couple of reasons:archive
step. The current implementation will save multiple identical copies of themod_def.ww3
file in theoutputXXX
directories. Each one is quite large, e.g.26M
for a 320x384 domain.work
directory, and so is not captured by the input manifestPossible fixes
These fixes assume the
mod_def.ww3
files is not altered when the model is run. If it is altered, and the updated version needs to be retained then it is effectively an output or restart file, and the following options won't work.Option 1: File can be read from
input
dirIdeally the model could be be made to read the
mod_def.ww3
from theinput
directory. In that case I would advise removing the code above entirely and making a symbolic link to themod_def.ww3
file in the original input directory.For example, the config provided by @ezhilsabareesh8 uses this file:
so making a symbolic link to it in the same same directory would work
Then the
config.yaml
could use either the directory as an input,/g/data/ik11/inputs/access-om3/0.1.0/cime/wav/ww3
, or use the full path to the symbolic link/g/data/ik11/inputs/access-om3/0.1.0/cime/wav/ww3/mod_def.ww3
.Option 2: File cannot be read from the
input
dirIf the path to
mod_def.ww3
is hard-coded (and there is resistance to that being made user-settable parameter) then I would suggest altering the code linked above, and rather than copy the file, make a symbolic link to the linked file in theinput
directory.A further version of this would be to follow the same steps above, and create a correctly named symbolic link in the original
input
directory, and then link to that link. This has the benefit that the manifest entry matches the name used by the model, so makes it a bit more obvious that this is the file that is actually used.Summary
Both options avoid needless copying of an identical file, so are an improvement.
I favour option 1 if possible. While both options capture the
mod_def.ww3
file used by the model in the input manifest, option 1 makes it clear that this was the file actually used by the model. Option 2 requires some inspection of thepayu
driver and/or thework
directory to make this connection.