Skip to content

Commit 63fb109

Browse files
committed
fullamon working now
1 parent 2bc19d8 commit 63fb109

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

.github/workflows/pylint.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,7 @@ jobs:
9191
ESMF_ROOT: ${{ env.ESMF_ROOT }}
9292
LD_LIBRARY_PATH: ${{ env.ESMF_INSTALL_PREFIX }}/lib:${{ env.LD_LIBRARY_PATH }}
9393
run: |
94-
poetry run python -m pip --no-build-isolation --no-deps \
95-
"git+https://github.com/esmf-org/[email protected]#subdirectory=src/addon/ESMPy"
94+
poetry run python -m pip --no-build-isolation --no-deps "git+https://github.com/esmf-org/[email protected]#subdirectory=src/addon/ESMPy"
9695
poetry run python -m pip install xesmf dask
9796
- name: Cache virtualenv
9897
uses: actions/cache@v4

cmip7_prep/cmor_writer.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,7 @@ def _sigma_mid_and_bounds(
360360
raise ValueError(f"sigma mid {mid} not monotonic.")
361361
if not is_strictly_monotonic(bnds):
362362
raise ValueError(f"sigma bounds {bnds} not monotonic.")
363+
363364
return mid, bnds
364365

365366

@@ -430,7 +431,6 @@ def __enter__(self) -> "CmorSession":
430431
fname = self._log_name or f"cmor_{ts}.log"
431432
self._log_dir.mkdir(parents=True, exist_ok=True)
432433
self._log_path = (self._log_dir / fname).resolve()
433-
print(f"Creating CMOR data with Tables path {self.tables_path}")
434434

435435
# Setup CMOR; pass logfile if CMOR supports it, else fall back
436436
try:
@@ -779,7 +779,6 @@ def write_variable(
779779
)
780780

781781
table_filename = _resolve_table_filename(self.tables_path, table_key)
782-
print(f"table_filename is {table_filename} table_key {table_key}")
783782
cmor.load_table(table_filename)
784783

785784
data = ds[vdef.name]

cmip7_prep/data/cesm_to_cmip7.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@ variables:
2828
units: "1"
2929
src_axis_name: lev # model midlevel dimension
3030
src_axis_bnds: ilev # model interface/bounds dim (if you ever need it)
31-
hyam: hyam # 1D (lev,)
32-
hybm: hybm # 1D (lev,)
33-
ps: PS # (time, lat, lon) — regridded with the rest
34-
p0: P0 # scalar (Pa); default to 100000 if missing
3531
sources:
3632
- cesm_var: CLOUD
3733
cli:
@@ -307,6 +303,7 @@ variables:
307303
units: "W m-2"
308304
dims: [time, lat, lon]
309305
formula: SOLIN - FSNTOAC
306+
positive: up
310307
sources:
311308
- cesm_var: SOLIN
312309
- cesm_var: FSNTOAC

cmip7_prep/pipeline.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,11 @@ def realize_regrid_prepare(
246246

247247
# 7) If hybrid: merge in 1-D hybrid coefficients directly from native (no regridding needed)
248248
if is_hybrid:
249-
aux = [nm for nm in ("hyam", "hybm", "P0", "ilev", "lev") if nm in ds_native]
249+
aux = [
250+
nm
251+
for nm in ("hyai", "hybi", "hyam", "hybm", "P0", "ilev", "lev")
252+
if nm in ds_native
253+
]
250254
if aux:
251255
ds_regr = ds_regr.merge(ds_native[aux], compat="override")
252256

scripts/atm_monthly.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ def process_one_var(varname: str) -> tuple[str, str]:
6767
log_dir=log_dir,
6868
log_name=f"cmor_{datetime.now(UTC).strftime('%Y%m%dT%H%M%SZ')}_{varname}.log",
6969
dataset_attrs={"institution_id": "NCAR"}, # plus your other attrs if needed
70+
outdir=OUTDIR,
7071
) as cm:
7172
# vdef from mapping cfg
7273
cfg = mapping.get_cfg(varname)
@@ -87,7 +88,7 @@ def process_one_var(varname: str) -> tuple[str, str]:
8788
)()
8889

8990
# Your writer expects a dataset with varname present:
90-
cm.write_variable(ds_cmor, varname, vdef, outdir=OUTDIR)
91+
cm.write_variable(ds_cmor, varname, vdef)
9192

9293
return (varname, "ok")
9394
except Exception as e: # keep task alive; report failure

scripts/testone.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
mapping = Mapping.from_packaged_default()
1818
OUTDIR = scratch + "/CMIP7"
1919

20-
cmip_vars = ["tas"]
20+
cmip_vars = ["cl"]
2121

2222
ds_native, cmip_vars = open_native_for_cmip_vars(
2323
cmip_vars,

0 commit comments

Comments
 (0)