From 46fcc260c010d46b36968f95389ff4a738844f93 Mon Sep 17 00:00:00 2001 From: raychew Date: Tue, 18 Jun 2024 18:26:22 +0200 Subject: [PATCH] coarse grain cells below 85 degrees south by five additional times this is because the resolution at the South Pole is high. --- runs/icon_merit_global.py | 6 +++--- src/io.py | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/runs/icon_merit_global.py b/runs/icon_merit_global.py index 1513bff..a4a7bcf 100644 --- a/runs/icon_merit_global.py +++ b/runs/icon_merit_global.py @@ -212,7 +212,6 @@ def parallel_wrapper(grid, params, reader, writer): from pycsam.inputs.icon_global_run import params from dask.distributed import Client -# from dask.diagnostics import ProgressBar # import dask.bag as db import dask @@ -242,8 +241,9 @@ def parallel_wrapper(grid, params, reader, writer): print(n_cells) - chunk_sz = 50 - for chunk in range(0, n_cells, chunk_sz): + chunk_sz = 100 + chunk_start = 0 + for chunk in range(chunk_start, n_cells, chunk_sz): # writer object sfx = "_" + str(chunk+chunk_sz) writer = io.nc_writer(params, sfx) diff --git a/src/io.py b/src/io.py index bb1986f..d849eff 100644 --- a/src/io.py +++ b/src/io.py @@ -463,6 +463,9 @@ def __load_topo(self, cell, fns, dirs, lon_cnt, lat_cnt, lat_idx_rng, lon_idx_r iint = self.merit_cg + if max(cell.lat) < -85.0: + iint *= 5 + cell.lat = utils.sliding_window_view( np.sort(cell.lat), (iint,), (iint,) ).mean(axis=-1) @@ -777,6 +780,7 @@ def __init__(self, params, sfx=""): if self.fn[-3:] != ".nc": self.fn += '.nc' + self.fn = 'datasets/' + self.fn self.path = params.path_output self.rect_set = params.rect_set self.debug = params.debug_writer