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

Possible naming problem in esm_tools. #1268

Closed
hajlaci opened this issue Jan 16, 2025 · 7 comments
Closed

Possible naming problem in esm_tools. #1268

hajlaci opened this issue Jan 16, 2025 · 7 comments
Assignees

Comments

@hajlaci
Copy link

hajlaci commented Jan 16, 2025

The working branch for this error is: feat/awiesm3-3.4_bugfix

In the awiesm.yaml we (with Jan) made the following modifications:

lpj_guess:
        ...
        coupling_fields:
                "[[veg_atm_fields-->FIELD]]":
                        grid: ${lpj_guess.mygrid}-land
        grids:
        ...       
               TL159-land:
                        name: TL159-land
                        nx: "${nx}"
                        ny: "${ny}" 
                        oasis_grid_type: "D"
                        oyac_grid_type: "LL"
                        oyac_io_per_node: 4 

but we got the following error message after the esm_runscript. Until we changed the naming it worked.


AttributeError: 'NoneType' object has no attribute 'get'
Traceback (most recent call last):
  File "/home/a/a270270/.local/bin/esm_runscripts", line 33, in <module>
    sys.exit(load_entry_point('esm-tools', 'console_scripts', 'esm_runscripts')())
  File "/home/a/a270270/esm_tools/src/esm_runscripts/cli.py", line 289, in main
    setup()
  File "/home/a/a270270/esm_tools/src/esm_runscripts/sim_objects.py", line 119, in __call__
    self.config = prepexp.run_job(self.config)
  File "/home/a/a270270/esm_tools/src/esm_runscripts/prepexp.py", line 27, in run_job
    evaluate(config, "prepexp", "prepexp_recipe")
  File "/home/a/a270270/esm_tools/src/esm_runscripts/helpers.py", line 71, in evaluate
    config = esm_plugin_manager.work_through_recipe(
  File "/home/a/a270270/esm_tools/src/esm_plugin_manager/esm_plugin_manager.py", line 159, in work_through_recipe
    config = getattr(submodule, workitem)(config)
  File "/home/a/a270270/esm_tools/src/esm_runscripts/prepexp.py", line 260, in call_esm_runscripts_from_prepexp
    _call_esm_runscripts_internally(config, new_command, scriptsdir)
  File "/home/a/a270270/esm_tools/src/esm_runscripts/prepexp.py", line 193, in _call_esm_runscripts_internally
    subprocess.check_call(command.split(), cwd=exedir)
  File "/sw/spack-levante/mambaforge-22.9.0-2-Linux-x86_64-kptncg/lib/python3.10/subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['esm_runscripts', 'awiesm3-v3.4-levante-TCO95L91-CORE2_1y.yaml', '-e', 'AWIESM3_Test22', '--open-run', '--no-motd', '--last-jobtype', 'prepcompute', '-t', 'prepcompute']' returned non-zero exit status 1.
@JanStreffing
Copy link
Contributor

Adding @mandresm

@JanStreffing
Copy link
Contributor

Would be great to have an idea what the error message means. The workaround are getting tedious (modifying ocp-tool twice and updating the pool dir multiple times, once with lpjg named oasis fields in oasis files, and another time with correctly named TL159-land variables in oasis files)

@mandresm
Copy link
Contributor

Working on it as for now. Sorry for the delay

@JanStreffing
Copy link
Contributor

NP, just pointing to the prio issue from our side. Some other workarounds are easier than than this one :)

@mandresm
Copy link
Contributor

mandresm commented Jan 17, 2025

NP, just pointing to the prio issue from our side. Some other workarounds are easier than than this one :)

Thanks, that is indeed how I interpreted it and it is very useful to understand prios :)

I think I have it. Here:

'lpjg->atma':
lag: ${v2a_lag}
seq: ${v2a_seq}
'atma->lpjg':
lag: ${a2v_lag}
seq: ${a2v_seq}

Try changing it to:

 '${lpj_guess.mygrid}-land->atma':
         lag: ${v2a_lag} 
         seq: ${v2a_seq} 
 'atma->${lpj_guess.mygrid}-land': 
         lag: ${a2v_lag} 
         seq: ${a2v_seq} 

This generated for me a namcouple file that included TL159-land and the coupling_fields in the finished_config.yaml look reasonable.

On an additional note, this logic of building the grid name does not allow you to match the current existing grid lpjg with mygrid as it will search for a grid that does not exist (lpjg-land):

grid: ${lpj_guess.mygrid}-land

@mandresm
Copy link
Contributor

Did this work?

@hajlaci
Copy link
Author

hajlaci commented Jan 21, 2025

It did work! Thx. a lot for the help!!!

@pgierz pgierz closed this as completed Jan 21, 2025
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

When branches are created from issues, their pull requests are automatically linked.

4 participants