Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
thopri
BoBEAS
Commits
47bf0562
Commit
47bf0562
authored
5 years ago
by
jelt
Browse files
Options
Download
Email Patches
Plain Diff
script for concatting daily files into monthly files
parent
2f149a3c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
STARTFILES/OPEN_BOUNDARIES/concat_daily_files.py
STARTFILES/OPEN_BOUNDARIES/concat_daily_files.py
+21
-0
No files found.
STARTFILES/OPEN_BOUNDARIES/concat_daily_files.py
0 → 100644
View file @
47bf0562
import
os
src_path
=
'/projectsa/NEMO/ash/NEMO_INDIA/BOUNDARY_FORCING/'
dst_path
=
'/projectsa/accord/BoBEAS/INPUTS/'
files
=
[]
os
.
sytem
(
'module load nco/gcc/4.4.2.ncwa'
)
yy_lst
=
[
'16'
,
'17'
]
var_lst
=
[
'SAL'
,
'TEMP'
,
'SSH'
,
'U0'
,
'V0'
]
mon_lst
=
[
'JAN'
,
'FEB'
,
'MAR'
,
'APR'
,
'MAY'
,
'JUN'
,
'JUL'
,
'AUG'
,
'SEP'
,
'OCT'
,
'NOV'
,
'DEC'
]
#mon_lst = [ 'MAR', 'APR', 'MAY']
for
yy
in
yy_lst
:
for
var
in
var_lst
:
imm
=
0
for
mm
in
mon_lst
:
imm
=
imm
+
1
# month counter
src_dir
=
src_path
+
var
+
yy
+
str
(
'_dir/'
)
+
mm
+
'/'
dst_file
=
dst_path
+
'20'
+
yy
+
'/'
+
var
+
'_20'
+
yy
+
"{0:0=2d}"
.
format
(
imm
)
+
'.nc'
os
.
system
(
'rm -f '
+
dst_file
)
os
.
system
(
'ncrcat -h '
+
src_dir
+
'*.nc '
+
dst_file
)
This diff is collapsed.
Click to expand it.
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