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
PyNEMO
Commits
b5b10a4d
Commit
b5b10a4d
authored
5 years ago
by
thopri
Browse files
Options
Download
Email Patches
Plain Diff
fixed issues with U and V currents when ln_dyn3d is set to true
parent
b8577c0e
github/fork/vleguenn/feature/update_README
IMMERSE
0.2.0
0.1.0
No related merge requests found
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
15 additions
and
13 deletions
+15
-13
inputs/namelist_remote.bdy
inputs/namelist_remote.bdy
+2
-2
pynemo/nemo_bdy_ncgen.py
pynemo/nemo_bdy_ncgen.py
+4
-3
pynemo/nemo_bdy_ncpop.py
pynemo/nemo_bdy_ncpop.py
+1
-1
pynemo/nemo_bdy_zgrv2.py
pynemo/nemo_bdy_zgrv2.py
+1
-1
pynemo/profile.py
pynemo/profile.py
+4
-4
pynemo/reader/factory.py
pynemo/reader/factory.py
+3
-2
screenshots/example_bdy_coords.png
screenshots/example_bdy_coords.png
+0
-0
No files found.
inputs/namelist_remote.bdy
View file @
b5b10a4d
...
@@ -58,7 +58,7 @@
...
@@ -58,7 +58,7 @@
! (if ln_mask_file=.TRUE.)
! (if ln_mask_file=.TRUE.)
ln_dyn2d = .false. ! boundary conditions for
ln_dyn2d = .false. ! boundary conditions for
! barotropic fields
! barotropic fields
ln_dyn3d = .
fals
e. ! boundary conditions for
ln_dyn3d = .
tru
e. ! boundary conditions for
! baroclinic velocities
! baroclinic velocities
ln_tra = .true. ! boundary conditions for T and S
ln_tra = .true. ! boundary conditions for T and S
ln_ice = .false. ! ice boundary condition
ln_ice = .false. ! ice boundary condition
...
@@ -68,7 +68,7 @@
...
@@ -68,7 +68,7 @@
! unstructured open boundaries tidal parameters
! unstructured open boundaries tidal parameters
!------------------------------------------------------------------------------
!------------------------------------------------------------------------------
ln_tide = .true. ! =T : produce bdy tidal conditions
ln_tide = .true. ! =T : produce bdy tidal conditions
sn_tide_model = '
tpxo
' ! Name of tidal model (fes|tpxo)
sn_tide_model = '
fes
' ! Name of tidal model (fes|tpxo)
clname(1) = 'M2' ! constituent name
clname(1) = 'M2' ! constituent name
clname(2) = 'S2'
clname(2) = 'S2'
clname(3) = 'O1'
clname(3) = 'O1'
...
...
This diff is collapsed.
Click to expand it.
pynemo/nemo_bdy_ncgen.py
View file @
b5b10a4d
...
@@ -14,7 +14,8 @@ def CreateBDYNetcdfFile(filename, N, I, J, K, rw, h, orig, fv, calendar, grd, va
...
@@ -14,7 +14,8 @@ def CreateBDYNetcdfFile(filename, N, I, J, K, rw, h, orig, fv, calendar, grd, va
""" This method creates a template of bdy netcdf files. A common for
""" This method creates a template of bdy netcdf files. A common for
T, I, U, V, E grid types.
T, I, U, V, E grid types.
"""
"""
if
var_nam
==
'tide_data'
or
var_nam
[
0
]
==
'votemper'
or
var_nam
[
0
]
==
'vosaline'
:
var_nams
=
[
'tide_data'
,
'votemper'
,
'vosaline'
,
'vozocrtx'
,
'vomecrty'
,
'vobtcrty'
,
'vomecrty'
]
if
var_nam
[
0
]
in
var_nams
:
logging
.
info
(
'benchmark variables identified, using original variable names.......'
)
logging
.
info
(
'benchmark variables identified, using original variable names.......'
)
gridNames
=
[
'T'
,
'I'
,
'U'
,
'V'
,
'E'
,
'Z'
]
# All possible grids
gridNames
=
[
'T'
,
'I'
,
'U'
,
'V'
,
'E'
,
'Z'
]
# All possible grids
...
@@ -239,8 +240,8 @@ def CreateBDYNetcdfFile(filename, N, I, J, K, rw, h, orig, fv, calendar, grd, va
...
@@ -239,8 +240,8 @@ def CreateBDYNetcdfFile(filename, N, I, J, K, rw, h, orig, fv, calendar, grd, va
logging
.
error
(
'Unknown Grid'
)
logging
.
error
(
'Unknown Grid'
)
ncid
.
close
()
ncid
.
close
()
var_nams
=
[
'thetao'
,
'so'
,
'zos'
,
'uo'
,
'vo'
]
if
var_nam
[
0
]
==
'thetao'
or
var_nam
[
0
]
==
'so'
or
var_nam
[
0
]
==
'uo'
or
var_nam
[
0
]
==
'vo'
:
if
var_nam
[
0
]
in
var_nams
:
logging
.
info
(
'CMEMS variables identified, using default CMEMS variables.....'
)
logging
.
info
(
'CMEMS variables identified, using default CMEMS variables.....'
)
gridNames
=
[
'T'
,
'I'
,
'U'
,
'V'
,
'E'
,
'Z'
]
# All possible grids
gridNames
=
[
'T'
,
'I'
,
'U'
,
'V'
,
'E'
,
'Z'
]
# All possible grids
...
...
This diff is collapsed.
Click to expand it.
pynemo/nemo_bdy_ncpop.py
View file @
b5b10a4d
...
@@ -18,7 +18,7 @@ def write_data_to_file(filename, variable_name, data):
...
@@ -18,7 +18,7 @@ def write_data_to_file(filename, variable_name, data):
ncid
=
Dataset
(
filename
,
'a'
,
clobber
=
False
,
format
=
'NETCDF4'
)
ncid
=
Dataset
(
filename
,
'a'
,
clobber
=
False
,
format
=
'NETCDF4'
)
count
=
data
.
shape
count
=
data
.
shape
three_dim_variables
=
[
'votemper'
,
'vosaline'
,
'N1p'
,
'N3n'
,
'N5s'
,
'thetao'
,
'so'
,
'uo'
,
'vo'
]
three_dim_variables
=
[
'votemper'
,
'vosaline'
,
'N1p'
,
'N3n'
,
'N5s'
,
'thetao'
,
'so'
,
'uo'
,
'vo'
,
'vobtcrtx'
,
'vozocrtx'
,
'vobtcrty'
,
'vomecrty'
]
two_dim_variables
=
[
'sossheig'
,
'vobtcrtx'
,
'vobtcrty'
,
'iicethic'
,
'ileadfra'
,
'isnowthi'
,
'zos'
]
two_dim_variables
=
[
'sossheig'
,
'vobtcrtx'
,
'vobtcrty'
,
'iicethic'
,
'ileadfra'
,
'isnowthi'
,
'zos'
]
if
variable_name
in
three_dim_variables
:
if
variable_name
in
three_dim_variables
:
...
...
This diff is collapsed.
Click to expand it.
pynemo/nemo_bdy_zgrv2.py
View file @
b5b10a4d
...
@@ -52,7 +52,7 @@ class Depth:
...
@@ -52,7 +52,7 @@ class Depth:
# Check inputs
# Check inputs
# FIX ME? Errors for wrong obj arg len. probably better to work around
# FIX ME? Errors for wrong obj arg len. probably better to work around
print
(
settings
)
self
.
logger
.
info
(
settings
)
if
settings
[
'sco'
]:
if
settings
[
'sco'
]:
# hc = ... FIX ME??
# hc = ... FIX ME??
# Depth of water column at t-point
# Depth of water column at t-point
...
...
This diff is collapsed.
Click to expand it.
pynemo/profile.py
View file @
b5b10a4d
...
@@ -531,8 +531,8 @@ def process_bdy(setup_filepath=0, mask_gui=False):
...
@@ -531,8 +531,8 @@ def process_bdy(setup_filepath=0, mask_gui=False):
var_in
[
't'
].
extend
([
'votemper'
,
'vosaline'
])
var_in
[
't'
].
extend
([
'votemper'
,
'vosaline'
])
if
ln_dyn2d
or
ln_dyn3d
:
if
ln_dyn2d
or
ln_dyn3d
:
var_in
[
'u'
].
extend
([
'vozocrtx'
,
'vomecrty'
])
var_in
[
'u'
].
extend
([
'vozocrtx'
])
var_in
[
'v'
].
extend
([
'vozocrtx'
,
'vomecrty'
])
var_in
[
'v'
].
extend
([
'vomecrty'
])
if
ln_dyn2d
:
if
ln_dyn2d
:
var_in
[
't'
].
extend
([
'sossheig'
])
var_in
[
't'
].
extend
([
'sossheig'
])
...
@@ -546,8 +546,8 @@ def process_bdy(setup_filepath=0, mask_gui=False):
...
@@ -546,8 +546,8 @@ def process_bdy(setup_filepath=0, mask_gui=False):
var_in
[
't'
].
extend
([
'votemper'
,
'vosaline'
])
var_in
[
't'
].
extend
([
'votemper'
,
'vosaline'
])
if
ln_dyn2d
or
ln_dyn3d
:
if
ln_dyn2d
or
ln_dyn3d
:
var_in
[
'u'
].
extend
([
'vozocrtx'
,
'vomecrty'
])
var_in
[
'u'
].
extend
([
'vozocrtx'
])
var_in
[
'v'
].
extend
([
'vozocrtx'
,
'vomecrty'
])
var_in
[
'v'
].
extend
([
'vomecrty'
])
if
ln_dyn2d
:
if
ln_dyn2d
:
var_in
[
't'
].
extend
([
'sossheig'
])
var_in
[
't'
].
extend
([
'sossheig'
])
...
...
This diff is collapsed.
Click to expand it.
pynemo/reader/factory.py
View file @
b5b10a4d
...
@@ -10,12 +10,13 @@ import os
...
@@ -10,12 +10,13 @@ import os
from
pynemo.reader.ncml
import
Reader
as
NcMLReader
from
pynemo.reader.ncml
import
Reader
as
NcMLReader
from
pynemo.reader.ncml
import
NcMLFile
from
pynemo.reader.ncml
import
NcMLFile
from
pynemo.reader.directory
import
Reader
as
DirectoryReader
from
pynemo.reader.directory
import
Reader
as
DirectoryReader
import
logging
from
netCDF4
import
Dataset
from
netCDF4
import
Dataset
logger
=
logging
.
getLogger
(
__name__
)
def
GetReader
(
uri
,
t_adjust
,
reader_type
=
None
):
def
GetReader
(
uri
,
t_adjust
,
reader_type
=
None
):
if
reader_type
is
None
:
if
reader_type
is
None
:
print
(
uri
)
logger
.
info
(
uri
)
if
uri
.
endswith
(
".ncml"
):
if
uri
.
endswith
(
".ncml"
):
reader_type
=
"NcML"
reader_type
=
"NcML"
elif
os
.
path
.
isdir
(
uri
):
elif
os
.
path
.
isdir
(
uri
):
...
...
This diff is collapsed.
Click to expand it.
screenshots/example_bdy_coords.png
deleted
100644 → 0
View file @
b8577c0e
265 KB
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