Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/release' into feat/awicm3_v3.3_a…
Browse files Browse the repository at this point in the history
…nd_v3.4
  • Loading branch information
JanStreffing committed Jan 29, 2025
2 parents 82a89dc + 74dc6d5 commit fcf4f8f
Show file tree
Hide file tree
Showing 39 changed files with 140 additions and 30 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/esm_tools_actions_novm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@ jobs:
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
name: Python ${{ matrix.python-version }} sample
steps:
- uses: actions/checkout@v2
Expand Down
4 changes: 2 additions & 2 deletions configs/components/fesom/fesom-2.6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ required_plugins:

choose_version:
"2.6":
branch: "2.6.1"
branch: "2.6.4"

"2.6-paleodyn":
branch: "2.6.1"
branch: "2.6.4"
wiso_code: true
icb_code: true
namelist_dir: "${model_dir}/config/"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
general:
account: "paleodyn.paleodyn"
setup_name: "awiesm"
compute_time: "01:55:00"
initial_date: "5001-01-01"
final_date: "7999-12-31"
base_dir: "/albedo/work/projects/p_paleo_compute/stepanek/esm_tools_6_PlioMIP3_production/PlioMIP3_experiments/"
nmonth: 0
nyear: 1
use_venv: False
with_wiso: False
with_icb: False
clean_old_rundirs_except: 2
clean_old_rundirs_keep_every: 50
version: "2.6"
description: >
PI_dynveg for PlioMIP3; with dynamic vegetation, without momix, with spp, no stable water isotopes; new model version by Lars; for spinup, stream definitions not yet optimized for production
computer:
mail_type: "FAIL"
mail_user: "[email protected]"

awiesm:
model_dir: "/albedo/work/projects/p_paleo_compute/stepanek/esm_tools_6_PlioMIP3_production/esm_tools/model_codes/awiesm-2.6"

echam:
lresume: 1
ini_parent_exp_id: "PI_251_wiso_c"
#fake_initial_date: "5001-01-01"
#ini_parent_date: "$(( ${fake_initial_date} - ${echam.time_step}seconds ))"
ini_parent_date: "50001231"
ini_parent_dir: "/albedo/work/projects/p_paleo_compute/stepanek/esm_tools_6_PlioMIP3_production/initial_conditions/PI_251_wiso_c_from_Yuchen/echam/"
restart_rate: 1
restart_unit: "years"
nproca: 24
nprocb: 24
nprocar: 0
nprocbr: 0
use_transient_forcing: False
namelist_dir: "/albedo/work/projects/p_paleo_compute/stepanek/esm_tools_6_PlioMIP3_production/namelists/namelist_spinup/echam/"

jsbach:
namelist_dir: "/albedo/work/projects/p_paleo_compute/stepanek/esm_tools_6_PlioMIP3_production/namelists/namelist_spinup/jsbach/"
input_sources:
jsbach_1850: "${fesom.mesh_dir}/tarfiles${echam.resolution}/input/jsbach/jsbach_T63CORE2_11tiles_5layers_1850.nc"

fesom:
res: "CORE2"
nproc: 384
mesh_dir: "/albedo/work/projects/p_paleo_compute/stepanek/esm_tools_6_PlioMIP3_production/meshes/mesh_core2/"
namelist_dir: "/albedo/work/projects/p_paleo_compute/stepanek/esm_tools_6_PlioMIP3_production/namelists/namelist_spinup/fesom/"
lresume: 1
ini_parent_exp_id: "PI_251_wiso_c"
ini_parent_date: "5000-12-31"
ini_parent_dir: "/albedo/work/projects/p_paleo_compute/stepanek/esm_tools_6_PlioMIP3_production/initial_conditions/PI_251_wiso_c_from_Yuchen/fesom/"
restart_rate: 1
restart_unit: "y"
restart_first: 1
namelist_changes:
namelist.io:
diag_list:
ldiag_Ri: remove_from_namelist
ldiag_turbflux: remove_from_namelist
namelist.tra:
tracer_phys:
use_momix: false
namelist.oce:
oce_dyn:
spp: true
namelist.config:
paths:
ClimateDataPath: "/albedo/work/projects/p_paleo_compute/stepanek/esm_tools_6_PlioMIP3_production/hydrography_fromXiaoXu/"

oasis3mct:
lresume: 1
ini_parent_exp_id: "PI_251_wiso_c"
ini_parent_date: "50001231"
ini_parent_dir: "/albedo/work/projects/p_paleo_compute/stepanek/esm_tools_6_PlioMIP3_production/initial_conditions/PI_251_wiso_c_from_Yuchen/oasis3mct/"
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 6.43.3
current_version = 6.45.0
commit = True
tag = True

Expand Down
7 changes: 5 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"[email protected]",
"[email protected]",
],
python_requires=">=3.6, <=3.11",
python_requires=">=3.6, <3.12",
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research",
Expand All @@ -68,6 +68,9 @@
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
],
description="ESM Tools external infrastructure for Earth System Modelling",
entry_points={
Expand Down Expand Up @@ -114,6 +117,6 @@
test_suite="tests",
tests_require=test_requirements,
url="https://github.com/esm-tools/esm_tools",
version="6.43.3",
version="6.45.0",
zip_safe=False,
)
2 changes: 1 addition & 1 deletion src/esm_archiving/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

__author__ = """Paul Gierz"""
__email__ = "[email protected]"
__version__ = "6.43.3"
__version__ = "6.45.0"

from .esm_archiving import (archive_mistral, check_tar_lists,
delete_original_data, determine_datestamp_location,
Expand Down
2 changes: 1 addition & 1 deletion src/esm_calendar/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

__author__ = """Dirk Barbi"""
__email__ = "[email protected]"
__version__ = "6.43.3"
__version__ = "6.45.0"

from .esm_calendar import *
2 changes: 1 addition & 1 deletion src/esm_cleanup/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

__author__ = """Dirk Barbi"""
__email__ = "[email protected]"
__version__ = "6.43.3"
__version__ = "6.45.0"
2 changes: 1 addition & 1 deletion src/esm_database/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

__author__ = """Dirk Barbi"""
__email__ = "[email protected]"
__version__ = "6.43.3"
__version__ = "6.45.0"
2 changes: 1 addition & 1 deletion src/esm_environment/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

__author__ = """Dirk Barbi"""
__email__ = "[email protected]"
__version__ = "6.43.3"
__version__ = "6.45.0"

from .esm_environment import *
2 changes: 1 addition & 1 deletion src/esm_master/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__author__ = """Dirk Barbi"""
__email__ = "[email protected]"
__version__ = "6.43.3"
__version__ = "6.45.0"


from . import database
4 changes: 2 additions & 2 deletions src/esm_master/software_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,8 @@ def get_command_list(self, setup_info, vcs, general):
if isinstance(commands, str):
commands = [commands]
if not todo == "get":
commands.insert(0, "cd " + self.destination)
commands.append("cd ..")
commands.insert(0, "pushd " + self.destination)
commands.append("popd")
if todo == "get":
if self.coupling_changes:
commands = []
Expand Down
12 changes: 12 additions & 0 deletions src/esm_master/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,8 @@ def generate_task_script(self):
def execute(self, ignore_errors=False):
# Calculate the number of get commands for this esm_master operation
self.num_of_get_commands()
# Initialize the dirstack for imitating pushd popd
dirstack = []
# Loop through the commands
for command in self.command_list:
repo = self.get_repo_properties_from_command(command)
Expand Down Expand Up @@ -481,6 +483,16 @@ def execute(self, ignore_errors=False):
command_spl = shlex.split(command)
if "cd" == command_spl[0]:
os.chdir(command_spl[1])
elif "pushd" == command_spl[0]:
# Emulates pushd (MA): yes it is horrible, but I don't
# have time to rewrite esm_master right now
dirstack.append(os.getcwd())
os.chdir(command_spl[1])
elif "popd" == command_spl[0]:
# Emulates popd (MA): yes it is horrible, but I don't
# have time to rewrite esm_master right now
target_dir = target_dir = dirstack.pop(-1)
os.chdir(target_dir)
else:
subprocess.run(
command_spl,
Expand Down
2 changes: 1 addition & 1 deletion src/esm_motd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

__author__ = """Dirk Barbi"""
__email__ = "[email protected]"
__version__ = "6.43.3"
__version__ = "6.45.0"

from .esm_motd import *
2 changes: 1 addition & 1 deletion src/esm_parser/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__author__ = """Dirk Barbi"""
__email__ = "[email protected]"
__version__ = "6.43.3"
__version__ = "6.45.0"


from .dict_to_yaml import *
Expand Down
10 changes: 9 additions & 1 deletion src/esm_parser/esm_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -2333,12 +2333,14 @@ def do_math_in_entry(tree, rhs, config):
if "${" in str(entry):
return entry
entry = " " + str(entry) + " "
date_operation = False
while "$((" in entry:
math, after_math = entry.split("))", 1)
math, before_math = math[::-1].split("(($", 1)
math = math[::-1]
before_math = before_math[::-1]
if DATE_MARKER in math:
date_operation = True
all_dates = []
steps = math.split(" ")
steps = [step for step in steps if step]
Expand Down Expand Up @@ -2416,12 +2418,18 @@ def do_math_in_entry(tree, rhs, config):
math = math + "all_dates[" + str(index) + "]"
index += 1
result = eval(math)
if isinstance(result, list):
if isinstance(result, list) and date_operation:
result = result[
-1
] # should be extended in the future - here: if list (= if diff between dates) than result in seconds
elif isinstance(result, list):
entry = ListWithProvenance(result, None)
entry.set_provenance(rhs.provenance)
return entry

result = str(result)
entry = before_math + result + after_math

# TODO MA: this is a provisional dirty fix for release. Get rid of this once a more
# general solution is worked out
# ORIGINAL LINE: return convert(entry.strip())
Expand Down
2 changes: 1 addition & 1 deletion src/esm_plugin_manager/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

__author__ = """Dirk Barbi, Paul Gierz, Sebastian Wahl"""
__email__ = "[email protected]"
__version__ = "6.43.3"
__version__ = "6.45.0"

from .esm_plugin_manager import *
2 changes: 1 addition & 1 deletion src/esm_profile/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

__author__ = """Dirk Barbi"""
__email__ = "[email protected]"
__version__ = "6.43.3"
__version__ = "6.45.0"

from .esm_profile import *
2 changes: 1 addition & 1 deletion src/esm_runscripts/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__author__ = """Dirk Barbi"""
__email__ = "[email protected]"
__version__ = "6.43.3"
__version__ = "6.45.0"

from .batch_system import *
from .chunky_parts import *
Expand Down
2 changes: 1 addition & 1 deletion src/esm_tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__author__ = """Miguel Andres-Martinez"""
__email__ = "[email protected]"
__version__ = "6.43.3"
__version__ = "6.45.0"

from .initialization import *
from .read_shipped_data import *
Expand Down
18 changes: 11 additions & 7 deletions src/esm_tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,9 @@ def comp_test(info):
user_info = info["user"]
this_computer = info["this_computer"]

# Set the regex format for check compilations
# Set the regex formats for check compilations
cd_format = re.compile(" cd (.*)")
pushd_format = re.compile(" pushd (.*)")

# Set the counter to 0
c = 0
Expand Down Expand Up @@ -212,14 +213,17 @@ def comp_test(info):
folders = []
# Search for the folders to be created
for line in out.split("\n"):
found_format = ""
if "cd" in line and "cd .." not in line:
found_format = cd_format.findall(line)
if len(found_format) > 0:
if (
";" not in found_format[0]
and "/" not in found_format[0]
):
folders.append(found_format[0])
elif "pushd" in line and "popd" not in line:
found_format = pushd_format.findall(line)
if len(found_format) > 0:
if (
";" not in found_format[0]
and "/" not in found_format[0]
):
folders.append(found_format[0])
if len(folders) == 0:
logger.warning(
f'NOT TESTING {model}{version}: "cd" command not found'
Expand Down
2 changes: 1 addition & 1 deletion src/esm_tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

__author__ = """Dirk Barbi, Paul Gierz"""
__email__ = "[email protected]"
__version__ = "6.43.3"
__version__ = "6.45.0"

import functools
import inspect
Expand Down
2 changes: 1 addition & 1 deletion src/esm_utilities/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

__author__ = """Paul Gierz"""
__email__ = "[email protected]"
__version__ = "6.43.3"
__version__ = "6.45.0"

from .utils import *

0 comments on commit fcf4f8f

Please sign in to comment.