#!/bin/bash

RunLengthSec=${leg_length_sec}
TimeStepSec=${cpl_freq_amip_sec}
StartYear=${leg_start_date_yyyymmdd:0:4}
StartMonth=${leg_start_date_yyyymmdd:4:2}
StartDay=${leg_start_date_yyyymmdd:6:2}
FixYear=${ifs_cmip_fixyear}
Output_file_name=${exp_input_yaml_file}

sed -e "s/\[leg_length_sec\]/$RunLengthSec/"  -e "s/\[cpl_freq_amip_sec\]/$TimeStepSec/" -e "s/\[StartYear\]/$StartYear/"          -e "s/\[StartMonth\]/$StartMonth/" \
    -e "s/\[StartMonth\]/$StartMonth/"          -e "s/\[StartDay\]/$StartDay/" -e "s/\[StartDay\]/$StartDay/"  \
    -e "s/\[FixYear\]/$FixYear/"  template_amip.yaml > $Output_file_name
