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
d91fe58e
Commit
d91fe58e
authored
5 years ago
by
jelt
Browse files
Options
Download
Email Patches
Plain Diff
clip velocity fields
parent
877c61a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
0 deletions
+38
-0
STARTFILES/OPEN_BOUNDARIES/clip_bdy_vel.py
STARTFILES/OPEN_BOUNDARIES/clip_bdy_vel.py
+38
-0
No files found.
STARTFILES/OPEN_BOUNDARIES/clip_bdy_vel.py
0 → 100644
View file @
d91fe58e
# clip_bdy_vel.py
#
# Simple script to clip the velocity fields to make sure every thing stays sensible.
import
os
dst_path
=
'/projectsa/accord/BoBEAS/INPUTS/'
files
=
[]
#os.sytem('module load nco/gcc/4.4.2.ncwa')
yy_lst
=
[
'17'
]
var_lst
=
[
'U'
,
'V'
]
mon_lst
=
[
'JAN'
,
'FEB'
,
'MAR'
,
'APR'
,
'MAY'
,
'JUN'
,
'JUL'
,
'AUG'
,
'SEP'
,
'OCT'
,
'NOV'
,
'DEC'
]
#mon_lst = [ 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV' ]
for
yy
in
yy_lst
:
imm
=
0
# 1 if SKIPPING JAN
#print ' skipping JAN'
for
mm
in
mon_lst
:
imm
=
imm
+
1
# month counter
for
var
in
var_lst
:
dst_name
=
'BoBEAS_bdy'
+
var
+
'_y20'
+
yy
+
'm'
+
"{0:0=2d}"
.
format
(
imm
)
+
'.nc'
dst_file
=
dst_path
+
dst_name
if
var
==
'V'
:
fld
=
'vomecrty'
elif
var
==
'U'
:
fld
=
'vozocrtx'
else
:
print
'panic'
print
(
'ncap2 -O -s "where('
+
fld
+
'<-0.5) '
+
fld
+
'=-0.5" '
+
dst_file
+
' '
+
dst_file
+
'.tmp'
)
os
.
system
(
'ncap2 -O -s "where('
+
fld
+
'<-0.5) '
+
fld
+
'=-0.5" '
+
dst_file
+
' '
+
dst_file
+
'.tmp'
)
print
(
'ncap2 -O -s "where('
+
fld
+
'>0.5) '
+
fld
+
'=0.5" '
+
dst_file
+
'.tmp '
+
dst_file
+
'.tmp'
)
os
.
system
(
'ncap2 -O -s "where('
+
fld
+
'>0.5) '
+
fld
+
'=0.5" '
+
dst_file
+
'.tmp '
+
dst_file
+
'.tmp'
)
print
(
' rsync -uvt '
+
dst_file
+
'.tmp jelt@login.archer.ac.uk:/work/n01/n01/jelt/BoBEAS/EXP_2016/OBC/'
+
dst_name
)
os
.
system
(
' rsync -uvt '
+
dst_file
+
'.tmp jelt@login.archer.ac.uk:/work/n01/n01/jelt/BoBEAS/EXP_2016/OBC/'
+
dst_name
)
print
(
'mv '
+
dst_file
+
'.tmp '
+
dst_file
)
os
.
system
(
'mv '
+
dst_file
+
'.tmp '
+
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