Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
saeed
odb_panel
Commits
682c4f31
Commit
682c4f31
authored
Nov 14, 2019
by
saeed
Browse files
modified
parent
821ccc7d
Changes
1
Hide whitespace changes
Inline
Side-by-side
odb_manger.sh
View file @
682c4f31
...
...
@@ -44,6 +44,15 @@ function output_name(){
echo
${
fout
}
}
function
output_name_cycle
(){
fin
=
${
1
}
cycle
=
${
2
}
fout
=
${
fin
/
".txt"
/
}
fout_cycle
=
${
fout
}
"_cycle""
${
cycle
}
"".txt"
echo
${
fout_cycle
}
}
function
ismonthly
(){
result
=
0
...
...
@@ -79,11 +88,12 @@ function do_filter(){
}
do_era5
=
1
do_precise
=
1
use_report_file
=
1
do_precise
=
0
use_report_file
=
0
PRECISE_ODB_DIR
=
"/scratch/ms/se/smdk/scratchdir/"
OUTPUT_DIR
=
"/home/ms/se/smdk/odb_panel/OUTPUT"
path_cycle
=
"/home/ms/se/smdk/odb_panel/bin/"
list_report
=[]
if
[
${
use_report_file
}
-eq
1
]
;
then
...
...
@@ -96,7 +106,7 @@ else
list_report
=(
16001 16005
)
fi
startdate
=
"2017-01-01"
enddate
=
"2017-01-0
5
"
enddate
=
"2017-01-0
2
"
time_cycle
=
"00,12"
checkmonthly
=
`
ismonthly
${
startdate
}
${
enddate
}
`
...
...
@@ -127,18 +137,35 @@ echo ${startdate_out}
echo
${
enddate_out
}
if
[
${
do_era5
}
-eq
1
]
;
then
for
j
in
${
!list_report[*]
}
;
do
vr
=
${
list_report
[j]
}
fin
=
"odb_era5_
${
vr
}
_
${
startdate_out
}
_
${
enddate_out
}
.odb"
fout
=
`
output_name
${
fin
}
`
if
[
!
-f
${
OUTPUT_DIR
}
/
${
fout
}
]
;
then
lexist
=
1
nc
=
`
echo
${
time_cycle
}
|
awk
-F
','
'{print NF}'
`
for
nf
in
`
seq
1
${
nc
}
`
;
do
vb
=
`
echo
${
time_cycle
}
|
cut
-d
,
-f
${
nf
}
`
fout_cycle
=
`
output_name_cycle
${
fout
}
${
vb
}
`
if
[
!
-f
${
OUTPUT_DIR
}
/
${
fout_cycle
}
]
;
then
lexist
=
0
fi
done
if
[
${
lexist
}
-eq
0
]
;
then
echo
"we are extracting odb for repportype
${
vr
}
"
sed
-e
"s/<reptype>/
${
vr
}
/g"
-e
"s/<time_cycle>/
${
time_cycle_out
}
/g"
-e
"s/<startdate_out>/
${
startdate_out
}
/g"
-e
"s/<enddate_out>/
${
enddate_out
}
/g"
-e
"s/<startdate>/
${
startdate
}
/g"
-e
"s/<enddate>/
${
enddate
}
/g"
request_odb_temp_era5
>
request_odb_temp
mars request_odb_temp
do_filter
${
fin
}
rm
-f
${
fin
}
2>/dev/null
mv
${
fout
}
${
OUTPUT_DIR
}
2>/dev/null
nc
=
`
echo
${
time_cycle
}
|
awk
-F
','
'{print NF}'
`
for
nf
in
`
seq
1
${
nc
}
`
;
do
vb
=
`
echo
${
time_cycle
}
|
cut
-d
,
-f
${
nf
}
`
${
path_cycle
}
/era5_cycle.exe
${
fout
}
${
vb
}
fout_cycle
=
`
output_name_cycle
${
fout
}
${
vb
}
`
echo
"fout_cycle
${
fout_cycle
}
"
mv
${
fout_cycle
}
${
OUTPUT_DIR
}
2>/dev/null
done
rm
-f
${
fout
}
rm
-f
request_odb_temp 2>/dev/null
else
echo
"
${
OUTPUT_DIR
}
/
${
fout
}
already exists"
...
...
Write
Preview
Markdown
is supported
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