#!/bin/bash
#
# Quick script to download IMERG-early and -late rain rates for 
# using in LIS runs as precip forcing.
#

ver='v7c'

earlyscr=/usr/people/casejl/scripts/IMERG/wget_imerg_early_${ver}.bash
latescr=/usr/people/casejl/scripts/IMERG/wget_imerg_late_${ver}.bash

date0=`date -u +%Y%m%d`
datem1=`date -u +%Y%m%d -d "${yyyymmdd}-1 days"`
datem2=`date -u +%Y%m%d -d "${yyyymmdd}-2 days"`
datem3=`date -u +%Y%m%d -d "${yyyymmdd}-3 days"`

for yyyymmdd in $datem3 $datem2 $datem1 $date0 ; do
  $earlyscr $yyyymmdd
  $latescr $yyyymmdd
done

exit
