From 7d224e8f10e8fe2632b5559f68f2d0cb539d86d9 Mon Sep 17 00:00:00 2001 From: "Takumi.Matsunobu" <Takumi.Matsunobu@physik.uni-muenchen.de> Date: Wed, 21 Jun 2023 12:05:57 +0200 Subject: [PATCH] fixed issues in rsync from a file list --- .../real-from-d2-ana/prepare_date_remote.sh | 22 ++++++++----------- .../real-from-d2-ana/prepare_lbc_remote.sh | 5 +++-- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/templates/real-from-d2-ana/prepare_date_remote.sh b/templates/real-from-d2-ana/prepare_date_remote.sh index 555c344..c0ffae3 100644 --- a/templates/real-from-d2-ana/prepare_date_remote.sh +++ b/templates/real-from-d2-ana/prepare_date_remote.sh @@ -23,23 +23,19 @@ if [ "${IC_DATA_IS_LOCAL}" != "True" ]; then AN_INC_SOURCE=$(find ${INITIAL_CONDITIONS_PATH} -name "an_R19B07.*00_inc.*" | sort -n ) FG_SOURCE=$(find ${INITIAL_CONDITIONS_PATH} -name "fc_R19B07.*5500.*" | sort -n ) - AN_FILE=$(basename "${AN_SOURCE}") - AN_INC_FILE=$(basename "${AN_INC_SOURCE}") - FG_FILE=$(basename "${FG_SOURCE}") - # Find files - if [ ! -f "${AN_SOURCE}" ]; then + if [ ! -z "${AN_SOURCE}" ]; then echo "Analysis file for date ${STARTDATE} not found!" exit 1 fi - if [ ! -f "${AN_INC_SOURCE}" ]; then + if [ ! -z "${AN_INC_SOURCE}" ]; then echo "Analysis increment file for date ${STARTDATE} not found!" exit 1 fi - if [ ! -f "${FG_SOURCE}" ]; then + if [ ! -z "${FG_SOURCE}" ]; then echo "FG file for date ${STARTDATE} not found!" exit 1 fi @@ -51,14 +47,14 @@ if [ "${IC_DATA_IS_LOCAL}" != "True" ]; then cd ${COMMON_DATE_FOLDER} || exit # Save filenames to be used later by other scripts. - echo "${AN_FILE}" > an_file.txt - echo "${AN_INC_FILE}" > an_inc_file.txt - echo "${FG_FILE}" > fg_file.txt + echo "${AN_SOURCE}" > an_file.txt + echo "${AN_INC_SOURCE}" > an_inc_file.txt + echo "${FG_SOURCE}" > fg_file.txt # Copy the first-guess and analysis files. - cp "${FG_SOURCE}" "${FG_FILE}" - cp "${AN_SOURCE}" "${AN_FILE}" - cp "${AN_INC_SOURCE}" "${AN_INC_FILE}" + rsync -v "${FG_SOURCE}" "${COMMON_DATE_FOLDER}" + rsync -v "${AN_SOURCE}" "${COMMON_DATE_FOLDER}" + rsync -v "${AN_INC_SOURCE}" "${COMMON_DATE_FOLDER}" # Change permissions to read only. chmod 440 ./* diff --git a/templates/real-from-d2-ana/prepare_lbc_remote.sh b/templates/real-from-d2-ana/prepare_lbc_remote.sh index 1db5b56..664d73c 100644 --- a/templates/real-from-d2-ana/prepare_lbc_remote.sh +++ b/templates/real-from-d2-ana/prepare_lbc_remote.sh @@ -63,6 +63,7 @@ if [ "${LBC_DATA_IS_LOCAL}" != "True" ]; then # necessary for running fortran ulimit -s unlimited + OMP_NUM_THREADS=1 # Loop through hours for ((tt=3; tt<=$((3 + %EXPERIMENT.CHUNKSIZE%)); tt++)) ; do @@ -94,12 +95,12 @@ if [ "${LBC_DATA_IS_LOCAL}" != "True" ]; then # Fetch tar.gz file of ICON-EU-EPS outputs necessary for the lateral boundary conditions - LBC_SOURCE=$(find ${MEMBER_DIR} -name "latbc_*00.${MEMBER,}.grib" | sort ) + LBC_SOURCE=$(find ${MEMBER_DIR} -name "latbc_*00.${MEMBER,}.grib" | sort -n ) LBC_FILE=$(basename "${LBC_SOURCE}") - if [ ! -f "${LBC_SOURCE}" ]; then + if [ ! -z "${LBC_SOURCE}" ]; then echo "Failed to make boundary conditions file for date ${STARTDATE}!" exit 1 fi -- GitLab