set -xuve

HPCROOTDIR=%HPCROOTDIR%
EXPID=%EXPID%
MEMBER=%MEMBER%
SDATE=%SDATE%

# Original launch_dir
launch_dir=${HPCROOTDIR}/python-amip-reader/sources/ece3-toy-model

# Create the directory with the initial data files needed by all members
inidata=${HPCROOTDIR}/${SDATE}/${MEMBER}/inidata
mkdir -p ${inidata}

# Copy the initial data files from the original location
original_inidata=${HPCROOTDIR}/python-amip-reader/tests/data/ece3-toy-model
# Copy the data files
for f in masks.nc grids.nc areas.nc rmp*; do
    cp -f ${original_inidata}/$f ${inidata}
done
# Copy toy model files (python and yaml) and namcouple configuration
cp -f ${launch_dir}/toy_model.py ${inidata}
cp -f ${launch_dir}/*.yaml ${inidata}
cp -f ${launch_dir}/namcouple ${inidata}

scalability_data=${HPCROOTDIR}/python-amip-reader/sources/ece3-toy-model/ece3_scalability_data
cp -r ${scalability_data} ${inidata}
