Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Paulo V C Medeiros
carra_obsoul
Commits
7752637b
Commit
7752637b
authored
Jun 18, 2020
by
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
carra_obsoul_prod.ksh
View file @
7752637b
#!/bin/ksh
#!/bin/ksh
#SBATCH --qos=normal
#SBATCH --qos=normal
#SBATCH --job-name=carra_obsoul
#SBATCH --job-name=carra_obsoul
#SBATCH --output=/scratch/ms/se/snz/carra_obsoul/
obsoul_out/
carra_obsoul.out
#SBATCH --output=/scratch/ms/se/snz/carra_obsoul/carra_obsoul
_sbatch
.out
#SBATCH --error=/scratch/ms/se/snz/carra_obsoul/
obsoul_out/
carra_obsoul.err
#SBATCH --error=/scratch/ms/se/snz/carra_obsoul/carra_obsoul
_sbatch
.err
set
-a
set
-a
...
@@ -19,6 +19,7 @@ hdir=/scratch/ms/se/snz/carra_obsoul/obsoul_out
...
@@ -19,6 +19,7 @@ hdir=/scratch/ms/se/snz/carra_obsoul/obsoul_out
ddir
=
/scratch/ms/se/snz/carra_obsoul
ddir
=
/scratch/ms/se/snz/carra_obsoul
odir
=
/scratch/ms/se/snz/carra_obsoul
odir
=
/scratch/ms/se/snz/carra_obsoul
[[
-d
$hdir
]]
||
mkdir
-p
$hdir
cd
$hdir
cd
$hdir
print
"
\n\t
Working directory on
$dator
is
\t
$(
pwd
)
"
print
"
\n\t
Working directory on
$dator
is
\t
$(
pwd
)
"
print
"
\t
Input data is stored in directory
\t
$ddir
"
print
"
\t
Input data is stored in directory
\t
$ddir
"
...
@@ -28,8 +29,9 @@ print "\t Output data is stored in directory \t $odir"
...
@@ -28,8 +29,9 @@ print "\t Output data is stored in directory \t $odir"
# Specify Times of Initial Conditions
# Specify Times of Initial Conditions
#-----------------------------------------------------------------------
#-----------------------------------------------------------------------
years
=
2019
;
mons
=
11
;
days
=
01
;
hours
=
03
;
dhour
=
03
#years=2018 ; mons=01 ; days=01 ; hours=00 ; dhour=03
yeare
=
2019
;
mone
=
11
;
daye
=
01
;
houre
=
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
"
\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
"
print
"
\t
yeare =
$yeare
\t
mone =
$mone
\t
daye =
$daye
\t
houre =
$houre
"
...
@@ -95,30 +97,27 @@ until (( date > EDATE )) ; do
...
@@ -95,30 +97,27 @@ until (( date > EDATE )) ; do
WIN
=
'OFF'
WIN
=
'OFF'
((
iw
==
0
))
&&
WIN
=
'CEN'
((
iw
==
0
))
&&
WIN
=
'CEN'
#----- FI DIRECTORY AT FIRST TIME POINT IN MONTH -----------------------
#----- FI DIRECTORY AT FIRST TIME POINT IN MONTH FOR MONTHS BEFORE OCT 2019 -------
if
{
((
DD_W
==
01
))
&&
((
HH_W
==
00
))
}
;
then
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
)
date_w_FI
=
$(
dateincr
-h
$date_w
-1
)
YYYY_W_FI
=
$(
echo
$date_w_FI
|
cut
-c1-4
)
YYYY_W_FI
=
$(
echo
$date_w_FI
|
cut
-c1-4
)
MM_W_FI
=
$(
echo
$date_w_FI
|
cut
-c5-6
)
MM_W_FI
=
$(
echo
$date_w_FI
|
cut
-c5-6
)
DD_W_FI
=
$(
echo
$date_w_FI
|
cut
-c7-8
)
DD_W_FI
=
$(
echo
$date_w_FI
|
cut
-c7-8
)
HH_W_FI
=
$(
echo
$date_w_FI
|
cut
-c9-10
)
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
FI data (
${
ITO_W
}
): 1st DTG in month, DTG<201910: Applying timeshift"
print
"
\n\t
ITO_W =
$ITO_W
\t
WIN =
$WIN
\t
ITO_W_FI =
$ITO_W_FI
"
else
else
YYYY_W_FI
=
$(
echo
$date_w
|
cut
-c1-4
)
YYYY_W_FI
=
${
YYYY_W
}
MM_W_FI
=
$(
echo
$date_w
|
cut
-c5-6
)
MM_W_FI
=
${
MM_W
}
DD_W_FI
=
$(
echo
$date_w
|
cut
-c7-8
)
DD_W_FI
=
${
DD_W
}
HH_W_FI
=
$(
echo
$date_w
|
cut
-c9-10
)
HH_W_FI
=
${
HH_W
}
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
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 ----------------------------
#----- FI DIRECTORY AT FIRST POINT IN MONTH ----------------------------
########################################################################
########################################################################
...
@@ -133,7 +132,7 @@ until (( date > EDATE )) ; do
...
@@ -133,7 +132,7 @@ until (( date > EDATE )) ; do
fi
fi
case
$land
in
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"
;;
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"
;;
SE
)
dfile
=
"
$ddir
/inputs/SE/
${
YYYY_W
}
/cerra_Sweden_
${
YYYY_W
}${
MM_W
}
.txt"
;;
NO
)
NO
)
...
@@ -153,8 +152,16 @@ until (( date > EDATE )) ; do
...
@@ -153,8 +152,16 @@ until (( date > EDATE )) ; do
if
[[
-f
$dfile
&&
-s
$dfile
]]
;
then
if
[[
-f
$dfile
&&
-s
$dfile
]]
;
then
print
"
\n\t
dfile =
$dfile
\t
Exist"
print
"
\n\t
dfile =
$dfile
\t
Exist"
print
$dfile
$land
$subset
$ITO_W
$WIN
case
$land
in
$ddir
/carra_obsoul.main.x
$dfile
$land
$subset
$ITO_W
$WIN
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
cat
obsoul.txt
>>
$ofile
/bin/rm obsoul.txt
/bin/rm obsoul.txt
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment