Skip to content

Conversation

@mandresm
Copy link
Contributor

@mandresm mandresm commented Jul 7, 2025

Hi @JanStreffing,

I think you were the one chaging ini_pseudo_initial_date value from prev_run.general.start_date to initial_date. This PR reverts that change.

The problem with the change you made is that people like @mathanase trying to run a continuation of a experiment need to manually specify ini_pseudo_initial_date. If they don't then the restart links have incorrect negative time in their names because initial_date is used. With the old approach, this people get automatically the correct ini_pseudo_initial_date for simulations that continue from the last date into the future.

For simulations that need to continue with those restarts but from a different date (branching of a control run finished in 2850 and starting a historical in 1850), the user would still need to specify ini_pseudo_initial_date manually. We could think of a way of actually shorting that problem as well automatically.

Note that ini_pseudo_initial_date is only used for branchoff restarts.

@nwieters
Copy link
Contributor

Hi,
I also tried a branchoff experiment with AWICM3. Therefore I tried out the changes in this PR. In general it worked for me for esm_runscript.
But then esm_master comp-awicm3-develop was not running but gave the following error:

Traceback (most recent call last):
  File "/work/ba1264/a270089/conda/envs/esm_tools_macv2sp/bin/esm_master", line 33, in <module>
    sys.exit(load_entry_point('esm-tools', 'console_scripts', 'esm_master')())
  File "/work/ab0995/a270089/esm_tools_macv2sp_dars/src/esm_master/cli.py", line 113, in main
    main_flow(parsed_args, target)
  File "/work/ab0995/a270089/esm_tools_macv2sp_dars/src/esm_master/esm_master.py", line 57, in main_flow
    complete_setup = SimulationSetup(user_config=user_config)
  File "/work/ab0995/a270089/esm_tools_macv2sp_dars/src/esm_runscripts/sim_objects.py", line 113, in __init__
    self.config = prepare.run_job(self.config)
  File "/work/ab0995/a270089/esm_tools_macv2sp_dars/src/esm_runscripts/prepare.py", line 20, in run_job
    helpers.evaluate(config, "prepare", "prepare_recipe")
  File "/work/ab0995/a270089/esm_tools_macv2sp_dars/src/esm_runscripts/helpers.py", line 71, in evaluate
    config = esm_plugin_manager.work_through_recipe(
  File "/work/ab0995/a270089/esm_tools_macv2sp_dars/src/esm_plugin_manager/esm_plugin_manager.py", line 159, in work_through_recipe
    config = getattr(submodule, workitem)(config)
  File "/work/ab0995/a270089/esm_tools_macv2sp_dars/src/esm_runscripts/prepare.py", line 647, in finalize_config
    config.finalize()
  File "/work/ab0995/a270089/esm_tools_macv2sp_dars/src/esm_parser/esm_parser.py", line 3305, in finalize
    self.run_recursive_functions(self)
  File "/work/ab0995/a270089/esm_tools_macv2sp_dars/src/esm_parser/esm_parser.py", line 3331, in run_recursive_functions
    recursive_run_function([], config, "atomic", marked_date_to_date_object, config)
  File "/work/ab0995/a270089/esm_tools_macv2sp_dars/src/esm_parser/provenance.py", line 1004, in inner
    output = func(tree, rhs, *args, **kwargs)
  File "/work/ab0995/a270089/esm_tools_macv2sp_dars/src/esm_parser/esm_parser.py", line 2040, in recursive_run_function
    right[key] = recursive_run_function(
  File "/work/ab0995/a270089/esm_tools_macv2sp_dars/src/esm_parser/provenance.py", line 1004, in inner
    output = func(tree, rhs, *args, **kwargs)
  File "/work/ab0995/a270089/esm_tools_macv2sp_dars/src/esm_parser/esm_parser.py", line 2040, in recursive_run_function
    right[key] = recursive_run_function(
  File "/work/ab0995/a270089/esm_tools_macv2sp_dars/src/esm_parser/provenance.py", line 1004, in inner
    output = func(tree, rhs, *args, **kwargs)
  File "/work/ab0995/a270089/esm_tools_macv2sp_dars/src/esm_parser/esm_parser.py", line 2004, in recursive_run_function
    right = func(tree + [None], right, *args, **kwargs)
  File "/work/ab0995/a270089/esm_tools_macv2sp_dars/src/esm_parser/provenance.py", line 1004, in inner
    output = func(tree, rhs, *args, **kwargs)
  File "/work/ab0995/a270089/esm_tools_macv2sp_dars/src/esm_parser/esm_parser.py", line 2643, in marked_date_to_date_object
    entry = Date(actual_date, config["general"]["calendar"])
  File "/work/ab0995/a270089/esm_tools_macv2sp_dars/src/esm_calendar/esm_calendar.py", line 265, in __init__
    self._init_from_str(indate, calendar=Calendar())
  File "/work/ab0995/a270089/esm_tools_macv2sp_dars/src/esm_calendar/esm_calendar.py", line 287, in _init_from_str
    date, time = indate2.split("_")
ValueError: too many values to unpack (expected 2)

I tried this with esm_tools, version 6.55.0

What of course workes is setting ini_pseudo_initial_date: "${prev_run.general.start_date}" in my runscript.yaml.

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

Successfully merging this pull request may close these issues.

3 participants