Commit 7752637b authored by Paulo V C Medeiros's avatar Paulo V C Medeiros
Browse files

Date offset for FI data

Despite the commit being now, this was used in the data production.
parent 54075f55
#!/bin/ksh
#SBATCH --qos=normal
#SBATCH --job-name=carra_obsoul
#SBATCH --output=/scratch/ms/se/snz/carra_obsoul/obsoul_out/carra_obsoul.out
#SBATCH --error=/scratch/ms/se/snz/carra_obsoul/obsoul_out/carra_obsoul.err
#SBATCH --output=/scratch/ms/se/snz/carra_obsoul/carra_obsoul_sbatch.out
#SBATCH --error=/scratch/ms/se/snz/carra_obsoul/carra_obsoul_sbatch.err
set -a
......@@ -19,6 +19,7 @@ hdir=/scratch/ms/se/snz/carra_obsoul/obsoul_out
ddir=/scratch/ms/se/snz/carra_obsoul
odir=/scratch/ms/se/snz/carra_obsoul
[[ -d $hdir ]] || mkdir -p $hdir
cd $hdir
print "\n\t Working directory on $dator is \t $(pwd)"
print "\t Input data is stored in directory \t $ddir"
......@@ -28,8 +29,9 @@ print "\t Output data is stored in directory \t $odir"
# Specify Times of Initial Conditions
#-----------------------------------------------------------------------
years=2019 ; mons=11 ; days=01 ; hours=03 ; dhour=03
yeare=2019 ; mone=11 ; daye=01 ; houre=03
#years=2018 ; mons=01 ; days=01 ; hours=00 ; dhour=03
years=2019 ; mons=09 ; days=01 ; hours=00 ; dhour=03
yeare=2020 ; mone=05 ; daye=01 ; houre=21
print "\n\t years = $years \t mons = $mons \t days = $days \t hours = $hours \t dhour = $dhour"
print "\t yeare = $yeare \t mone = $mone \t daye = $daye \t houre = $houre"
......@@ -95,30 +97,27 @@ until (( date > EDATE )) ; do
WIN='OFF'
(( iw == 0 )) && WIN='CEN'
#----- FI DIRECTORY AT FIRST TIME POINT IN MONTH -----------------------
if { (( DD_W == 01 )) && (( HH_W == 00 )) } ; then
#----- FI DIRECTORY AT FIRST TIME POINT IN MONTH FOR MONTHS BEFORE OCT 2019 -------
YYYYMM_FI=${YYYY_W}${MM_W}
if { (( YYYYMM_FI < 201910 )) && (( DD_W == 01 )) && (( HH_W == 00 )) } ; then
date_w_FI=$(dateincr -h $date_w -1)
YYYY_W_FI=$(echo $date_w_FI | cut -c1-4)
MM_W_FI=$(echo $date_w_FI | cut -c5-6)
DD_W_FI=$(echo $date_w_FI | cut -c7-8)
HH_W_FI=$(echo $date_w_FI | cut -c9-10)
ITO_W_FI=${YYYY_W_FI}${MM_W_FI}${DD_W_FI}${HH_W_FI}
print "\n\t ITO_W = $ITO_W \t WIN = $WIN \t ITO_W_FI = $ITO_W_FI"
print "\n\t FI data (${ITO_W}): 1st DTG in month, DTG<201910: Applying timeshift"
else
YYYY_W_FI=$(echo $date_w | cut -c1-4)
MM_W_FI=$(echo $date_w | cut -c5-6)
DD_W_FI=$(echo $date_w | cut -c7-8)
HH_W_FI=$(echo $date_w | cut -c9-10)
ITO_W_FI=${YYYY_W_FI}${MM_W_FI}${DD_W_FI}${HH_W_FI}
print "\n\t ITO_W = $ITO_W \t WIN = $WIN \t ITO_W_FI = $ITO_W_FI"
YYYY_W_FI=${YYYY_W}
MM_W_FI=${MM_W}
DD_W_FI=${DD_W}
HH_W_FI=${HH_W}
fi
ITO_W_FI=${YYYY_W_FI}${MM_W_FI}${DD_W_FI}${HH_W_FI}
print "\n\t ITO_W = $ITO_W \t WIN = $WIN \t ITO_W_FI = $ITO_W_FI"
#----- FI DIRECTORY AT FIRST POINT IN MONTH ----------------------------
########################################################################
......@@ -133,7 +132,7 @@ until (( date > EDATE )) ; do
fi
case $land in
FI) dfile="$ddir/inputs/FI/${YYYY_W}/synopCARRA_FMI_${YYYY_W}${MM_W}.txt" ;;
FI) dfile="$ddir/inputs/FI/${YYYY_W_FI}/synopCARRA_FMI_${YYYY_W_FI}${MM_W_FI}.txt" ;;
IS) dfile="$ddir/inputs/IS/${YYYY_W}/cerra_iceland_${YYYY_W}_${MM_W}.txt" ;;
SE) dfile="$ddir/inputs/SE/${YYYY_W}/cerra_Sweden_${YYYY_W}${MM_W}.txt" ;;
NO)
......@@ -153,8 +152,16 @@ until (( date > EDATE )) ; do
if [[ -f $dfile && -s $dfile ]] ; then
print "\n\t dfile = $dfile \t Exist"
print $dfile $land $subset $ITO_W $WIN
$ddir/carra_obsoul.main.x $dfile $land $subset $ITO_W $WIN
case $land in
FI)
print $dfile $land $subset $ITO_W_FI $WIN
$ddir/carra_obsoul.main.x $dfile $land $subset $ITO_W_FI $WIN
;;
*)
print $dfile $land $subset $ITO_W $WIN
$ddir/carra_obsoul.main.x $dfile $land $subset $ITO_W $WIN
;;
esac
cat obsoul.txt >> $ofile
/bin/rm obsoul.txt
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment