esm-tools / esm_tools

Simple Infrastructure for Earth System Simulations
https://esm-tools.github.io/
GNU General Public License v2.0
25 stars 12 forks source link

Bugfix for correct awicm3 general version in choose block #1155

Closed nwieters closed 2 months ago

nwieters commented 2 months ago

This PR corrects a small bugfix in awicm3.yaml for setting the right choose in a choose_general.version block.

nwieters commented 2 months ago

A short description about what still fails in this branch and in branch awicm3_recom:

I think the cause of this error is in the esm_parser function look_for_file line 234.

In the case of the fesom version set with a subversion variable (as in awicm3.yaml of branch awicm3_recom), at the time the actual fesom config file name is generated, the fesom version variable looks still like this fesom-2.0${subversion}. Without the variable ${subversion} evaluated. In line 234 of esm_parser.py it will cut off everything after and including the minus sign. So the fesom config file name will be fesom.yaml which leads to the above described error.

nwieters commented 2 months ago

Unfortunatly this doesn't solve the problem with the wrong fesom.yaml file taken.

nwieters commented 2 months ago

Hi @chrisdane, @mandresm ,

I merged this PR into the branch awicm3-recom. It still does not solve the problem with the resolving the variable in the fesom version. But the workaround for this is to set the fesom version explicitly in the runscript

fesom:
    version: "2.0-recom"

With this I think @chrisdane can start to test awicm3-recom for now. I will fix the version issue then in release.

mandresm commented 2 months ago

A very important remark for @chrisdane: once this is fix, one should not manually set the version of fesom (unless experimenting things) as specifying a particular version of AWICM3 should be enough, avoiding confusion and errors.

chrisdane commented 2 months ago

Thanks a lot all.

On 93409af the recom section now appears in the finished config of a check run. However, the namelist.recom is not in the run dir (the esm_runscripts call does not complain not to find namelist.recom). Any idea how to "activate" recom in this case?

Runscript:

/home/a/a270073/esm/runscripts/awicm3-v3.1.2_recom-levante.yaml

Expdir:

/work/ba1103/a270073/out/awicm3-v3.1.2-recom/test

Thanks a lot! Chris

mandresm commented 2 months ago

This is normal, the yaml file of awicm3 is not including the recom.yaml, that means no information from the default recom configuration is being used.

The solution is to follow a similar logic as in awiesm2 (use awiesm.yaml as a template) to include recom info into this coupled setup if with_recom is True: https://github.com/esm-tools/esm_tools/blob/2d980df9a923e666f8797b9d96baa1ad3ff2a6bc/configs/setups/awiesm/awiesm.yaml#L110-L114

add_include_models will make sure that the info in recom.yaml is read.

https://github.com/esm-tools/esm_tools/blob/2d980df9a923e666f8797b9d96baa1ad3ff2a6bc/configs/setups/awiesm/awiesm.yaml#L434-L463

The box above covers more lines than it seems, so please scroll down on the box to see the whole thing. By adding a recom section you can modify in awicm3.yaml any recom information you need to modify without touching the default info in the recom.yaml. The choose is to make sure not to add recom information in simulations that don't run with recom. You probably don't need all of that, this is just so you have an idea how things could be done.

mandresm commented 2 months ago

@chrisdane, let me know if we need to meet together with @nwieters to give you further advice on how to proceed, or if you think it would be good to discuss planning on support for adding this feature.