Skip to content
Snippets Groups Projects
Commit 0bd7cb36 authored by Takumi.Matsunobu's avatar Takumi.Matsunobu
Browse files

Adjust the date format fro file names

parent 47bbcb97
No related branches found
No related tags found
No related merge requests found
Pipeline #19096 failed
...@@ -52,9 +52,14 @@ if [ "${IC_DATA_IS_LOCAL}" != "True" ]; then ...@@ -52,9 +52,14 @@ if [ "${IC_DATA_IS_LOCAL}" != "True" ]; then
echo "${FG_SOURCE}" > fg_file.txt echo "${FG_SOURCE}" > fg_file.txt
# Copy the first-guess and analysis files. # Copy the first-guess and analysis files.
rsync -v --file-from=an_file.txt / "${COMMON_DATE_FOLDER}" #rsync -v --files-from=an_file.txt / "${COMMON_DATE_FOLDER}"
rsync -v --file-from=an_inc_file.txt / "${COMMON_DATE_FOLDER}" #rsync -v --files-from=an_inc_file.txt / "${COMMON_DATE_FOLDER}"
rsync -v --file-from=fg_file.txt / "${COMMON_DATE_FOLDER}" #rsync -v --files-from=fg_file.txt / "${COMMON_DATE_FOLDER}"
# Create links for the detected analysis and first-guess files
awk '{print $1}' an_file.txt | xargs -I[] ln -sf [] .
awk '{print $1}' an_inc_file.txt | xargs -I[] ln -sf [] .
awk '{print $1}' fg_file.txt | xargs -I[] ln -sf [] .
# Change permissions to read only. # Change permissions to read only.
chmod 440 ./* chmod 440 ./*
......
...@@ -97,10 +97,7 @@ if [ "${LBC_DATA_IS_LOCAL}" != "True" ]; then ...@@ -97,10 +97,7 @@ if [ "${LBC_DATA_IS_LOCAL}" != "True" ]; then
# Fetch tar.gz file of ICON-EU-EPS outputs necessary for the lateral boundary conditions # 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 -n ) LBC_SOURCE=$(find ${MEMBER_DIR} -name "latbc_*00.${MEMBER,}.grib" | sort -n )
LBC_FILE=$(basename "${LBC_SOURCE}") if [ -z "${LBC_SOURCE}" ]; then
if [ ! -z "${LBC_SOURCE}" ]; then
echo "Failed to make boundary conditions file for date ${STARTDATE}!" echo "Failed to make boundary conditions file for date ${STARTDATE}!"
exit 1 exit 1
fi fi
...@@ -111,7 +108,7 @@ if [ "${LBC_DATA_IS_LOCAL}" != "True" ]; then ...@@ -111,7 +108,7 @@ if [ "${LBC_DATA_IS_LOCAL}" != "True" ]; then
cd ${COMMON_DATE_FOLDER} || exit cd ${COMMON_DATE_FOLDER} || exit
# Save filenames to be used later by other scripts. # Save filenames to be used later by other scripts.
echo "${LBC_SOURCE}" >> lbc_file.txt echo "${LBC_SOURCE}" > ${MEMBER_DIR}/lbc_file.txt
# Copy the first-guess and analysis files. # Copy the first-guess and analysis files.
#cp "${LBC_SOURCE}" "${LBC_FILE}" #cp "${LBC_SOURCE}" "${LBC_FILE}"
...@@ -119,7 +116,5 @@ if [ "${LBC_DATA_IS_LOCAL}" != "True" ]; then ...@@ -119,7 +116,5 @@ if [ "${LBC_DATA_IS_LOCAL}" != "True" ]; then
# Change permissions to read only. # Change permissions to read only.
chmod 440 ./* chmod 440 ./*
# clear the working directory
rm -r work
fi fi
\ No newline at end of file
...@@ -17,10 +17,6 @@ CHUNK = "%CHUNK%" ...@@ -17,10 +17,6 @@ CHUNK = "%CHUNK%"
RUNDIR = Path(f"{WORKDIR}/{STARTDATE}/{MEMBER}") RUNDIR = Path(f"{WORKDIR}/{STARTDATE}/{MEMBER}")
ATMOSPHERE_NAMELIST_PATH = Path("%simulation.namelist_paths.atmosphere%") ATMOSPHERE_NAMELIST_PATH = Path("%simulation.namelist_paths.atmosphere%")
MASTER_NAMELIST_PATH = Path("%simulation.namelist_paths.master%") MASTER_NAMELIST_PATH = Path("%simulation.namelist_paths.master%")
# TODO: This is a bit ugly
# Read first-guess and analysis filenames from files:
first_guess_filename = (RUNDIR / "fg_file.txt").read_text().strip()
analysis_filename = (RUNDIR / "an_file.txt").read_text().strip()
# Example of date format "2018-06-01T00:00:00Z" # Example of date format "2018-06-01T00:00:00Z"
date_format = "%simulation.date_format%" date_format = "%simulation.date_format%"
...@@ -38,6 +34,11 @@ END_HOUR = "%Chunk_END_HOUR%" ...@@ -38,6 +34,11 @@ END_HOUR = "%Chunk_END_HOUR%"
Chunk_START_DATE = datetime(year=int(START_YEAR), month=int(START_MONTH), day=int(START_DAY), hour=int(START_HOUR)) Chunk_START_DATE = datetime(year=int(START_YEAR), month=int(START_MONTH), day=int(START_DAY), hour=int(START_HOUR))
Chunk_END_DATE = datetime(year=int(END_YEAR), month=int(END_MONTH), day=int(END_DAY), hour=int(END_HOUR)) Chunk_END_DATE = datetime(year=int(END_YEAR), month=int(END_MONTH), day=int(END_DAY), hour=int(END_HOUR))
# Read first-guess and analysis filenames from files:
first_guess_filename = (RUNDIR / f"fc_R19B07.{(Chunk_START_DATE-timedelta(minutes=5)).strftime('%Y%m%d%H%M')}00_an.{MEMBER[1:]}")
analysis_filename = (RUNDIR / f"an_R19B07.{Chunk_START_DATE.strftime('%Y%m%d%H%M')}00_an.{MEMBER[1:]}")
analysis_inc_filename = (RUNDIR / f"an_R19B07.{Chunk_START_DATE.strftime('%Y%m%d%H%M')}00_inc.{MEMBER[1:]}")
# Read custom namelist parameters from configuration # Read custom namelist parameters from configuration
atmosphere_namelist_string = """ atmosphere_namelist_string = """
%atmosphere_namelist% %atmosphere_namelist%
...@@ -52,7 +53,7 @@ checkpoint_time = int((Chunk_END_DATE - Chunk_START_DATE).total_seconds()) ...@@ -52,7 +53,7 @@ checkpoint_time = int((Chunk_END_DATE - Chunk_START_DATE).total_seconds())
# TODO: Is that really necessary? # TODO: Is that really necessary?
# Add 10 minutes to allow the model to write the restarts # Add 10 minutes to allow the model to write the restarts
Chunk_END_DATE = Chunk_END_DATE + timedelta(minutes=10) #Chunk_END_DATE = Chunk_END_DATE + timedelta(minutes=10)
atmosphere_namelist_replacements = { atmosphere_namelist_replacements = {
"time_nml": { "time_nml": {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment