Skip to content
Snippets Groups Projects
Commit ebef3dcf authored by Oriol Tintó Prims's avatar Oriol Tintó Prims
Browse files

Split prepare_rundir.sh into three different stages for the whole experiment,...

Split prepare_rundir.sh into three different stages for the whole experiment, the start date and each member.
parent 1fb8aa71
No related branches found
No related tags found
1 merge request!2Split prepare_rundir.sh into three different stages for the whole experiment,...
...@@ -68,15 +68,27 @@ JOBS: ...@@ -68,15 +68,27 @@ JOBS:
WALLCLOCK: 01:00 WALLCLOCK: 01:00
PROCESSORS: 16 PROCESSORS: 16
PREPARE_RUNDIR: PREPARE_EXPERIMENT:
FILE: templates/prepare_rundir.sh FILE: templates/prepare_experiment.sh
DEPENDENCIES: BUILD_ICON DEPENDENCIES: BUILD_ICON
RUNNING: once
WALLCLOCK: 01:00
PREPARE_DATE:
FILE: templates/prepare_date.sh
DEPENDENCIES: PREPARE_EXPERIMENT
RUNNING: once
WALLCLOCK: 01:00
PREPARE_MEMBER:
FILE: templates/prepare_member.sh
DEPENDENCIES: PREPARE_DATE
RUNNING: member RUNNING: member
WALLCLOCK: 01:00 WALLCLOCK: 01:00
PREPARE_CHUNK: PREPARE_CHUNK:
FILE: templates/prepare_chunk.sh FILE: templates/prepare_chunk.sh
DEPENDENCIES: PREPARE_RUNDIR RUN_ICON-1 DEPENDENCIES: PREPARE_MEMBER RUN_ICON-1
WALLCLOCK: 00:05 WALLCLOCK: 00:05
RUNNING: chunk RUNNING: chunk
...@@ -94,7 +106,7 @@ JOBS: ...@@ -94,7 +106,7 @@ JOBS:
DEPENDENCIES: RUN_ICON BUILD_PYTHON_ENVIRONMENT COMPRESS-1 DEPENDENCIES: RUN_ICON BUILD_PYTHON_ENVIRONMENT COMPRESS-1
RUNNING: chunk RUNNING: chunk
TYPE: python TYPE: python
EXECUTABLE: "%HPCROOTDIR%/venv/bin/python3" EXECUTABLE: "%HPCROOTDIR%/%python_environment.folder_name%/bin/python3"
PROCESSORS: 16 PROCESSORS: 16
MEMORY: 16384 MEMORY: 16384
......
#!/bin/bash -l
# Get some variables provided by autosubmit.
WORKDIR=%HPCROOTDIR%
STARTDATE=%SDATE%
# Define date directory, create it and go there
COMMON_DATE_FOLDER=${WORKDIR}/${STARTDATE}/inidata
# Create member folder and go there
mkdir -p ${COMMON_DATE_FOLDER}
cd ${COMMON_DATE_FOLDER} || exit
# some settings
AN_MEMBER=$(printf "%03d" %initial_conditions.member%)
INITIAL_CONDITIONS_PARENT_FOLDER=%initial_conditions.parent_folder%
INITIAL_CONDITIONS_PATH=${INITIAL_CONDITIONS_PARENT_FOLDER}/${STARTDATE:0:6}/${STARTDATE:0:8}T00
AN_SOURCE=$(find ${INITIAL_CONDITIONS_PATH} -name "igaf*00.m${AN_MEMBER}.grb" | sort | tail -n 1)
FG_SOURCE=$(find ${INITIAL_CONDITIONS_PATH} -name "igfff00030000.m${AN_MEMBER}.grb" | sort | tail -n 1)
if [ ! -f "${AN_SOURCE}" ]; then
echo "Analysis file for date ${STARTDATE} not found!"
exit 1
fi
if [ ! -f "${FG_SOURCE}" ]; then
echo "FG file for date ${STARTDATE} not found!"
exit 1
fi
AN_FILE=$(basename "${AN_SOURCE}")
FG_FILE=$(basename "${FG_SOURCE}")
# Save filenames to be used later by other scripts.
echo "${AN_FILE}" > an_file.txt
echo "${FG_FILE}" > fg_file.txt
# Copy the first-guess and analysis files.
cp "${FG_SOURCE}" "${FG_FILE}"
cp "${AN_SOURCE}" "${AN_FILE}"
...@@ -10,24 +10,18 @@ BGRID=%simulation.BGRID% ...@@ -10,24 +10,18 @@ BGRID=%simulation.BGRID%
RGRID=%simulation.RGRID% RGRID=%simulation.RGRID%
BEXTPAR=%simulation.BEXTPAR% BEXTPAR=%simulation.BEXTPAR%
STARTDATE=%SDATE%
MEMBER=%MEMBER%
# Define rundir
RUNDIR=${WORKDIR}/${STARTDATE}/${MEMBER}
# Activate spack # Activate spack
SPACK_ENV=${WORKDIR}/spack/share/spack/setup-env.sh SPACK_ENV=${WORKDIR}/spack/share/spack/setup-env.sh
source ${SPACK_ENV} source ${SPACK_ENV}
# Load icon module # Load icon module needed to retrieve some data
spack load icon-nwp@%ICON_VERSION% spack load icon-nwp@%ICON_VERSION%
# Create member folder and go there # Create a folder for the common inidata and go there
mkdir -p ${RUNDIR} COMMON_INIDATA_FOLDER=${WORKDIR}/inidata
mkdir -p "${COMMON_INIDATA_FOLDER}"
cd ${RUNDIR} cd "${COMMON_INIDATA_FOLDER}" || exit
# Download or copy required input files # Download or copy required input files
function download_file() { function download_file() {
...@@ -39,43 +33,17 @@ function download_file() { ...@@ -39,43 +33,17 @@ function download_file() {
fi fi
} }
# some settings
AN_MEMBER=$(printf "%03d" %initial_conditions.member%)
INITIAL_CONDITIONS_PARENT_FOLDER=%initial_conditions.parent_folder%
INITIAL_CONDITIONS_PATH=${INITIAL_CONDITIONS_PARENT_FOLDER}/${STARTDATE:0:6}/${STARTDATE:0:8}T00
AN_SOURCE=$(find ${INITIAL_CONDITIONS_PATH} -name "igaf*00.m${AN_MEMBER}.grb" | sort | tail -n 1)
FG_SOURCE=$(find ${INITIAL_CONDITIONS_PATH} -name igfff00030000.m${AN_MEMBER}.grb | sort | tail -n 1)
if [ ! -f "${AN_SOURCE}" ]; then
echo "Analysis file for date ${STARTDATE} not found!"
exit 1
fi
if [ ! -f "${FG_SOURCE}" ]; then
echo "FG file for date ${STARTDATE} not found!"
exit 1
fi
AN_FILE=$(basename ${AN_SOURCE})
FG_FILE=$(basename ${FG_SOURCE})
# Save filenames to be used later by other scripts.
echo ${AN_FILE} >an_file.txt
echo ${FG_FILE} >fg_file.txt
# Download grid files and external parameters # Download grid files and external parameters
BASEURL=http://icon-downloads.mpimet.mpg.de/grids/public/edzw BASEURL=http://icon-downloads.mpimet.mpg.de/grids/public/edzw
download_file $BASEURL/$BGRID download_file $BASEURL/$BGRID
download_file $BASEURL/$RGRID download_file $BASEURL/$RGRID
download_file $BASEURL/$BEXTPAR download_file $BASEURL/$BEXTPAR
# Link first-guess and analysis files.
ln -sf ${FG_SOURCE} ${FG_FILE}
ln -sf ${AN_SOURCE} ${AN_FILE}
# Link input for radiation # Link input for radiation
ln -sf ${ICON_DATA_PATH}/rrtmg_lw.nc . ln -sf "${ICON_DATA_PATH}/rrtmg_lw.nc" .
ln -sf ${ICON_DATA_PATH}/ECHAM6_CldOptProps.nc . ln -sf "${ICON_DATA_PATH}/ECHAM6_CldOptProps.nc" .
ln -sf ${ICON_BASE_PATH}/run/ana_varnames_map_file.txt . ln -sf "${ICON_BASE_PATH}/run/ana_varnames_map_file.txt" .
# Set all permissions to read only
chmod 700
\ No newline at end of file
#!/bin/bash -l
# Get some variables provided by autosubmit.
WORKDIR=%HPCROOTDIR%
STARTDATE=%SDATE%
MEMBER=%MEMBER%
# Common folder with data needed for all simulations
COMMON_INIDATA_FOLDER=${WORKDIR}/
# Common folder for the same start date
COMMON_DATE_FOLDER=${WORKDIR}/${STARTDATE}/inidata
# Member folder
MEMBER_DIR=${WORKDIR}/${STARTDATE}/${MEMBER}
# Create member folder and go there
mkdir -p ${MEMBER_DIR}
cd ${MEMBER_DIR} || exit
# Link all files from the common inidata folder and the common date folder
ln -sf ${COMMON_INIDATA_FOLDER}/* .
ln -sf ${COMMON_DATE_FOLDER}/* .
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