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

Add adapt_member.sh job into the event-generator workflow.

parent 395211c9
No related branches found
No related tags found
No related merge requests found
Pipeline #19061 skipped
...@@ -8,10 +8,14 @@ JOBS: ...@@ -8,10 +8,14 @@ JOBS:
WALLCLOCK: 01:00 WALLCLOCK: 01:00
PLATFORM: LOCAL PLATFORM: LOCAL
PREPARE_MEMBER: PREPARE_MEMBER:
FILE: templates/event-generator/prepare_member.sh FILE: templates/event-generator/prepare_member.sh
DEPENDENCIES: PREPARE_EXPERIMENT PREPARE_DATE DEPENDENCIES: PREPARE_EXPERIMENT PREPARE_DATE
ADAPT_MEMBER:
FILE: templates/event-generator/adapt_member.sh
DEPENDENCIES: PREPARE_MEMBER TRANSFER_PROJECT BUILD_PYTHON_ENVIRONMENT
PREPARE_NAMELIST: PREPARE_NAMELIST:
FILE: templates/event-generator/prepare_namelist.py FILE: templates/event-generator/prepare_namelist.py
\ No newline at end of file DEPENDENCIES: ADAPT_MEMBER RUN_ICON-1
#!/bin/bash
#TODO:
# - Interpolate SST forcing file from regular grid to the destination grid
# - Integrate the SST into the analysis file
# - Add SST climatology in the external parameter file.
# Get some variables provided by autosubmit.
WORKDIR=%HPCROOTDIR%
PROJ_FOLDER=${WORKDIR}/proj
SST_FORCING=$( basename %simulation.sea_surface_temperature_forcing% )
INTERPOLATED_SST=whatever.nc
DESTINATION_GRID=%simulation.dynamics_grid%
EXTERNAL_PARAMETERS_FILE=%simulation.external_parameters_filename%
STARTDATE=%SDATE%
# Load spack
. ${WORKDIR}/proj/platforms/common/spack_utils.sh
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 dwd-icon-tools
spack load --first dwd-icon-tools % "%spack.compiler%"
# Interpolate SST
source ${PROJ_FOLDER}/templates/event-generator/interpolate_sst.sh
interpolate_SST ${DESTINATION_GRID} ${SST_FORCING} ${INTERPOLATED_SST}
# Integrate
#python ${sst_to_analysis_script} ${INTERPOLATED_SST}
# Add SST to external parameter
#python ${sst_to_extpar_script} ${INTERPOLATED_SST} ${EXTERNAL_PARAMETERS_FILE}
\ No newline at end of file
function interpolate_SST() {
local GRID_FILE="$1"
local SST_INPUT="$2"
local SST_OUTPUT="$3"
remap_namelist="tmp_sst_remap.nmp"
cat > ${remap_namelist} << END
&remap_nml
in_filename = "${SST_INPUT}"
in_type = 1
out_grid_filename = "${GRID_FILE}"
out_filename = "${SST_OUTPUT}"
out_type = 2
out_filetype = 4
/
&input_field_nml
inputname = "T_SEA"
outputname = "T_SEA"
code=167
&input_field_nml
inputname = "T_SEA_CLIM"
outputname = "T_SEA_CLIM"
code=167
/
END
iconremap --remap_nml ${remap_namelist} -vvv
# Remove namelist
rm -f ${remap_namelist}
}
\ No newline at end of file
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