#!/bin/bash

# This script should be exexcuted from the directory containing storedir/ and yearXX for a certain experiment
# First create a simlink STORE to where you want to archive that experiment
# It will then copy storedir/yearXX/FILE.nc as STORE/FILE.XX.nc

function log()
{
    echo $*
    time $*
}

for year in 01 02 03 04 05 06 07 08 09 10 ; do
    for typ in day hf mth mth_icosa ; do
	log cp -n storedir/year$year/hist${typ}.nc STORE/hist${typ}.${year}.nc
    done
    log cp -n storedir/year$year/logs.tgz STORE/logs.${year}.tgz
done

ls -lRh STORE/
