From 516c95a10d1ce1e7f0fff249b4e3f293a7a142a0 Mon Sep 17 00:00:00 2001
From: "Takumi.Matsunobu" <Takumi.Matsunobu@physik.uni-muenchen.de>
Date: Fri, 2 Jun 2023 13:48:45 +0200
Subject: [PATCH] fix

---
 templates/real-from-d2-ana/icon-remap-helper.py  | 2 +-
 templates/real-from-d2-ana/prepare_lbc_remote.sh | 7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/templates/real-from-d2-ana/icon-remap-helper.py b/templates/real-from-d2-ana/icon-remap-helper.py
index af374b1..d930894 100644
--- a/templates/real-from-d2-ana/icon-remap-helper.py
+++ b/templates/real-from-d2-ana/icon-remap-helper.py
@@ -153,7 +153,7 @@ def remap_one_file(in_grid, out_grid, one_file, dst_fodler, rename=None, src_vgr
         vinp = False
 
     # rename the file if requested
-    if rename is not None:
+    if rename is not None and args.output_format != "grb":
         # read the time stamp
         if content["time"].size != 1:
             logging.error("more then one timestep, unable to rename the file!")
diff --git a/templates/real-from-d2-ana/prepare_lbc_remote.sh b/templates/real-from-d2-ana/prepare_lbc_remote.sh
index c3e9e63..9fa0ca1 100644
--- a/templates/real-from-d2-ana/prepare_lbc_remote.sh
+++ b/templates/real-from-d2-ana/prepare_lbc_remote.sh
@@ -21,7 +21,7 @@ if [ "${LBC_DATA_IS_LOCAL}" != "True" ]; then
   HPCHOST=%HPCHOST%
 
   . ${WORKDIR}/proj/platforms/common/spack_utils.sh
-  load_spack "module load user_spack" "$SCRATCH/autoicon-spack" "https://github.com/spack/spack.git" "develop" "slurm" "gcc@11.2.0" "False" "$SCRATCH/autoicon-spackcache" "$SCRATCH/autoicon-spackconfig" ""
+  load_spack "%spack.init%" "%spack.root%" "%spack.url%" "%spack.branch%" "%spack.externals%" "%spack.compiler%" "%spack.disable_local_config%" "%spack.user_cache_path%" "%spack.user_config_path%" "%spack.upstreams%"
 
   # Load icon module
   spack load --first dwd-icon-tools
@@ -59,7 +59,7 @@ if [ "${LBC_DATA_IS_LOCAL}" != "True" ]; then
   PARENT_GRID_FILE=%simulation.parent_grid_filename%
 
   # Loop through hours
-  for tt in {3..$((3 + %EXPERIMENT.CHUNKSIZE%))}; do
+  for ((tt=3; tt<=$((3 + %EXPERIMENT.CHUNKSIZE%)); tt++)) ; do
     th=$((tt % 24))
     td=$((tt / 24))
     EU_FC_TIME=$(printf "%02d" $td)$(printf "%02d" $th)
@@ -74,7 +74,8 @@ if [ "${LBC_DATA_IS_LOCAL}" != "True" ]; then
         --src-grid ${COMMON_GRID_FOLDER}/${PARENT_GRID_FILE} \
         --dst-grid ${COMMON_GRID_FOLDER}/${BOUNDARY_GRID_FILE} \
         --source   work/iefff${EU_FC_TIME}0000.m${AN_MEMBER} \
-        --dest ${COMMON_DATE_FOLDER}/latbc_${D2_FC_TIME}00.m${AN_MEMBER} \
+        --dest ${COMMON_DATE_FOLDER} \
+        --rename latbc_${D2_FC_TIME}00.m${AN_MEMBER} \
         --output-format grb
   done
 
-- 
GitLab