#!/usr/bin/env bash

# A script to create the gold files needed for AWSM
# Run this script in the main smrf directory, the config
# file will put the outputs in the correct place
#
# Run as:
#     $ ./awsm/tests/basins/Lakes/gold_hrrr_update/make_gold_hrrr_update

read -r -p "Recreating Lakes HRRR gold update standard, are you sure? [y/N] " response
if [[ "$response" = "yes" || "$response" = "y" ]]
then
    echo "Updating Lakes HRRR gold files"
    echo "Removing old gold files"
    rm awsm/tests/basins/Lakes/gold_hrrr_update/*.nc
    
    echo "Running AWSM"
    awsm awsm/tests/basins/Lakes/gold_hrrr_update/gold_config.ini

    echo "Cleaning up"
    mv awsm/tests/basins/Lakes/gold_hrrr_update/lakes/wy2020/lakes_gold/run20191001_20191001/snow.nc \
        awsm/tests/basins/Lakes/gold_hrrr_update
    mv awsm/tests/basins/Lakes/gold_hrrr_update/lakes/wy2020/lakes_gold/run20191001_20191001/em.nc \
        awsm/tests/basins/Lakes/gold_hrrr_update
    rm -rf awsm/tests/basins/Lakes/gold_hrrr_update/lakes
else
    echo "Lakes HRRR gold files not updated"
fi

