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

How to remove_namelist_changes? #1173

Open
joakimkjellsson opened this issue May 2, 2024 · 8 comments
Open

How to remove_namelist_changes? #1173

joakimkjellsson opened this issue May 2, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@joakimkjellsson
Copy link
Contributor

Hey ho

In the nemo.yaml we have something like this for FOCI-OpenIFS 3.0.1:

                    add_namelist_changes:
                                namelist_cfg:
                                        namdyn_ldf:
                                                # Increased viscosity
                                                # (old value of 6e11 was very low)
                                                rn_ahm_0_blp: -1.709e12
                                        namtra_ldf:
                                                # Reduce the effect of GM
                                                rn_aeiv_scale: 0.5

Now, I have one experiment where I'd like to un-do some of these namelist changes. So I found this in awiesm.yaml

remove_namelist_changes.namelist.recom.pavariables:
                            - constant_CO2

which I think instructs ESM-Tools to remove the namelist change for constant_CO2 in namelist.recom under chapter pavariables.

So I tried to mimick this in my own runscript:

nemo: 
   remove_namelist_changes.namelist_cfg.namtra_ldf:
      - rn_aeiv_scale

But this doesn't actually do anything. The rn_aeiv_scale value is still modified in the final namelist. I can see it under add_namelist_changes in the "finished" yaml file, but I can't see the remove_namelist_changes there.

Am I not doing the remove_namelist_changes correctly?

Best wishes
Joakim

@mandresm
Copy link
Contributor

mandresm commented May 5, 2024

HI @joakimkjellsson,

Note that your namelist has an add_. I think adding the complete path to it should do:

nemo:
    remove_add_namelist_changes.namelist_cfg.namtra_ldf:
      - rn_aeiv_scale

If this does not work, and the add_namelist_changes is within a choose_ add also the choose, but I think that won;t be necessary.

If you still have the problem, I can have a look at it on Monday, just let me know

@joakimkjellsson
Copy link
Contributor Author

Hi @mandresm. Thanks for the tip.

Unfortunately that did not solve the problem. To give the full details:
rn_aeiv_scale is not set in nemo.yaml but in focioifs.yaml we have (line 667 in https://github.com/esm-tools/esm_tools/blob/geomar_dev/configs/setups/focioifs/focioifs.yaml):

nemo:
        ....

        # See nemo.yaml for description of versions
        choose_general.version:
                ...
                
                "agrif-3.0":
                        version: "ORCA05_LIM2_KCM_AGRIF_OASISMCT4"
                        resolution: ORCA05
                        add_namelist_changes:
                                namelist_cfg:
                                        namdyn_ldf:
                                                rn_ahm_0_blp: -1.709e12
                                        namtra_ldf:
                                                rn_aeiv_scale: 0.5

I've tried adding the following to my runscript but nothing actually removes the rn_aeiv_scale from the namelist_cfg.
Attempt one in runscript:

nemo: 
   ...
   remove_namelist_changes.namelist_cfg.namtra_ldf:
         - rn_aeiv_scale

Attempt 2:

   nemo: 
      remove_add_namelist_changes.namelist_cfg.namtra_ldf:
         - rn_aeiv_scale 

Attempt 3:

nemo: 
   choose_general.version:
         "agrif-3.0":
             remove_add_namelist_changes.namelist_cfg.namtra_ldf:
                - rn_aeiv_scale

Attempt 4:

focioifs:
   model_dir: ${general.homedir}/esm/models/focioifs-agrif-3.0/
   nemo:
      choose_general.version:
         "agrif-3.0":
            remove_add_namelist_changes.namelist_cfg.namtra_ldf:
               - rn_aeiv_scale

I feel like I've tried every possible permutation with no luck.

It would be great if you could have a look. I feel like there must be a small mistake here somewhere.

Many thanks
Joakim

@mandresm
Copy link
Contributor

mandresm commented May 6, 2024

One last try:

nemo:
    remove_choose_general.version.agrif-3.0.add_namelist_changes.namelist_cfg.namtra_ldf:
        - rn_aeiv_scale

That's what I meant above. If this doesn't work I'll look at it.

@joakimkjellsson
Copy link
Contributor Author

Nope that didn't solve it either.
But if I add the "remove" under the focioifs block, i.e.:

focioifs:
   nemo:  
      remove_choose_general.version.agrif-3.0.add_namelist_changes.namelist_cfg.namtra_ldf:
         - rn_aeiv_scale

then at least it shows up in the *finished.yaml file:

general:
   ...
   nemo:
        remove_choose_general.version.agrif-3.0.add_namelist_changes.namelist_cfg.namtra_ldf:
        - rn_aeiv_scale

I still get the namelist change in my final namelist_cfg, so it doesn't work as expected, but at least I can see that ESM-Tools registers what I'm trying to do ;-)

I'm free for a zoom call before 13:30 if that helps.

Thanks!
/J

@mandresm
Copy link
Contributor

mandresm commented May 6, 2024

A provisional solution that actually works:

   add_namelist_changes:
      namelist_cfg:
         namsbc_rnf:
            rn_rfact: 1.00
         namdyn_ldf:
            rn_ahm_0_blp: -1.709e12
         namtra_ldf:
            rn_aht_0: 600 
            rn_aeiv_scale: "remove_from_namelist"

I'll keep looking at why the other remove does not work

@joakimkjellsson
Copy link
Contributor Author

Thanks a lot @mandresm! That did the trick for me!
/J

@mandresm mandresm added the bug Something isn't working label May 6, 2024
@mandresm
Copy link
Contributor

mandresm commented May 6, 2024

Note for the ESM-Tools devs: the problem with remove is probably related with the case agrif-3.0 having a dot.

@chrisdane
Copy link
Contributor

chrisdane commented May 16, 2024

I have the same problem but neither of these 3 works:

configs/setups/awicm3/awicm3.yaml
# 1 
add_namelist_changes:
    fort.4:
        LTRCMFMG: ".false."
# 2
add_namelist_changes:
    fort.4:
        LTRCMFMG: "remove_from_namelist"
# 3
remove_namelist_changes.fort.4.NAMGFL:
    - LTRCMFMG

These are all in a setup and hence should overwrite the component default:

configs/components/oifs/oifs.yaml
...
    LTRCMFMG: ".true."

Note that for cases 2 and 3 the resulting runscripts log line

- NOTE: removing the variable: LTRCMFMG from the namelist: fort.4

is not displayed. But when I comment out the key in the component yaml, this line is displayed (in case 2, not in case 3), but still not updated in the final namelist (in neither case 2 nor 3). Case 1 however then works but thats not a solution since I do not want to remove the key from the component yaml.

Thanks for help: /home/a/a270073/esm/esm_tools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants