diff --git a/templates/event-generator/adapt_member.sh b/templates/event-generator/adapt_member.sh index 6575f2b013a39d83db15badb073ec1fbac0b314b..585fabcfac4a9ac3065456f16202f292d138859e 100644 --- a/templates/event-generator/adapt_member.sh +++ b/templates/event-generator/adapt_member.sh @@ -25,6 +25,7 @@ cd ${MEMBER_DIR} || exit # Get analysis file path ANALYSIS_FILE=$(find . -name "igaf*.m*.grb" -print -quit) +FG_FILE=$(find . -name "igfff00030000.m*.grb" -print -quit) # Load spack @@ -56,7 +57,8 @@ integrate_sst_to_extpar "${INTERPOLATED_SST}" "${EXTERNAL_PARAMETERS_FILE}" # Interpolate analysis -interpolate_analysis "icon_grid_0024_R02B06_G.nc" "${ANALYSIS_FILE}" "${DESTINATION_GRID}" +interpolate_initial_conditions "icon_grid_0024_R02B06_G.nc" "${ANALYSIS_FILE}" "${DESTINATION_GRID}" "interpolated_analysis.nc" +interpolate_initial_conditions "icon_grid_0024_R02B06_G.nc" "${FG}" "${DESTINATION_GRID}" "first_guess.nc" integrate_sst_to_analysis "${INTERPOLATED_SST}" diff --git a/templates/event-generator/adapt_member_utils.sh b/templates/event-generator/adapt_member_utils.sh index 0dcc00e12775fa36ea39bd1cca429bb78d0323e0..3d5eee0e7a8e3335530c664f5ac4ebfd9b8ecb41 100644 --- a/templates/event-generator/adapt_member_utils.sh +++ b/templates/event-generator/adapt_member_utils.sh @@ -110,21 +110,22 @@ END fi } -function interpolate_analysis() { +function interpolate_initial_conditions() { local INPUT_GRID="$1" - local ANALYSIS_FILE="$2" + local IC_FILE="$2" local OUTPUT_GRID="$3" + local OUTPUT_FILENAME="$4" - echo "Converting analysis to netcdf" + echo "Interpolating ${IC_FILE} to destination grid" cat >remap.nml <<END &remap_nml -in_filename = "${ANALYSIS_FILE}" +in_filename = "${IC_FILE}" in_grid_filename = "${INPUT_GRID}" in_type = 2 out_grid_filename = "${OUTPUT_GRID}" -out_filename = "interpolated_analysis.nc" +out_filename = "${OUTPUT_FILENAME} out_type = 2 out_filetype = 4 / @@ -133,7 +134,7 @@ END cat <<END >extend_remap_namelist.py from enstools.io import read -with read("${ANALYSIS_FILE}") as ds, open('remap.nml', 'a') as file: +with read("${IC_FILE}") as ds, open('remap.nml', 'a') as file: all_vars = list(ds.data_vars) remap_vars = [] for var in all_vars: diff --git a/templates/event-generator/prepare_namelist.py b/templates/event-generator/prepare_namelist.py index 0223de68d7eddb2f3a21e4c7ed6cddeb26ec2e0a..35888d548043749882c4db115cda6f88a5b4da2f 100644 --- a/templates/event-generator/prepare_namelist.py +++ b/templates/event-generator/prepare_namelist.py @@ -25,9 +25,10 @@ MASTER_NAMELIST_PATH = Path("%simulation.namelist_paths.master%") analysis_filename = "analysis.nc" -first_guess_filename = (RUNDIR / "igfff00030000.m*.grb").resolve() -first_guess_filename = first_guess_filename.parent.glob(first_guess_filename.name).__next__() -first_guess_filename = first_guess_filename.name +# first_guess_filename = (RUNDIR / "igfff00030000.m*.grb").resolve() +# first_guess_filename = first_guess_filename.parent.glob(first_guess_filename.name).__next__() +# first_guess_filename = first_guess_filename.name +first_guess_filename = "first_guess.nc" # Example of date format "2018-06-01T00:00:00Z"