Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple top-level model instances #509

Open
jo-basevi opened this issue Sep 13, 2024 · 2 comments
Open

Multiple top-level model instances #509

jo-basevi opened this issue Sep 13, 2024 · 2 comments

Comments

@jo-basevi
Copy link
Collaborator

jo-basevi commented Sep 13, 2024

As pointed out by @blimlim, the Experiment in experiment.py stores two separate instances of the top-level model driver in Experiment.model and in the list Experiment.models. For model drivers such as access, setup and archive is not run for the access instance in Experiment.models list, only for the top-level instance Experiment.model.

There was already a TODO to rename models to submodels to make it more clear:

payu/payu/experiment.py

Lines 150 to 151 in bdf0c66

# TODO: Rename this to self.submodels
self.models = []

Could still have self.models = [self.model] + self.submodels for when wanting to iterate over all model drivers, but have only one instance of the top-level model.

What might need to be checked is accessom2 driver archive method. For the Experiment.models instance which archives before other submodel model drivers run archive(), it copies directories from work directories restart path to the output restart path. Then when the top level Experiment.model instance run after other submodel archives, it copies a file from a mom work path to a cice5 restart path.

So maybe there just needs to be a top-level post_setup/post_archive method or similar, that runs after other submodel setup/archives methods have run? This might make it more clear what runs before submodel methods and what runs after submodel methods.

@anton-seaice
Copy link
Collaborator

I think payu needs a design document to explain this stuff 🥲

@aidanheerdegen
Copy link
Collaborator

A refactor of some of this would be good I think. Would need to spend time thinking about it to have any useful input.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants