Skip to content

Commit 3bd5318

Browse files
authored
Merge pull request #214 from NOC-MSM/213-mixed-z-coords
213 mixed z coords
2 parents ba9c724 + 1ff1f09 commit 3bd5318

File tree

5 files changed

+27
-44
lines changed

5 files changed

+27
-44
lines changed

docs/pybdy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,7 @@ Created.
830830

831831
## pybdy.nemo_bdy_zgrv2.get_bdy_depths(DstCoord, bdy_i, grd)
832832

833-
Depth levels from the nearest neighbour on the source grid.
833+
Depth levels on the destination grid at bdy points.
834834

835835
> ### Parameters<br>
836836

src/pybdy/nemo_bdy_extr_tm3.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,8 @@ def __init__(self, setup, SourceCoord, DstCoord, Grid, var_nam, grd, pair):
441441

442442
# Fig not implemented
443443

444+
sc_z_ch = sc_z[:, jmin:jmax, imin:imax]
445+
444446
if (not isslab) & self.settings["zinterp"]:
445447
# Determine vertical weights for the linear interpolation
446448
# onto Dst grid
@@ -449,7 +451,7 @@ def __init__(self, setup, SourceCoord, DstCoord, Grid, var_nam, grd, pair):
449451
dst_dep[:, chunk],
450452
dst_len_z,
451453
self.num_bdy_ch[c],
452-
sc_z,
454+
sc_z_ch,
453455
sc_z_len,
454456
ind,
455457
SC.zgr.grid_type == "zco",

src/pybdy/nemo_bdy_zgrv2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def get_bdy_depths_old(bdy_t, bdy_u, bdy_v, DstCoord, settings):
136136

137137
def get_bdy_depths(DstCoord, bdy_i, grd):
138138
"""
139-
Depth levels from the nearest neighbour on the source grid.
139+
Depth levels on the destination grid at bdy points.
140140
141141
Parameters
142142
----------

tests/data/namelist_zz_end_to_end.bdy

Lines changed: 14 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,6 @@
99
!!
1010
!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
1111

12-
!------------------------------------------------------------------------------
13-
! vertical coordinate
14-
!------------------------------------------------------------------------------
15-
ln_zco = .false. ! z-coordinate - full steps (T/F)
16-
ln_zps = .true. ! z-coordinate - partial steps (T/F)
17-
ln_sco = .false. ! s- or hybrid z-s-coordinate (T/F)
18-
rn_hmin = -10 ! min depth of the ocean (>0) or
19-
! min number of ocean level (<0)
20-
21-
!------------------------------------------------------------------------------
22-
! s-coordinate or hybrid z-s-coordinate
23-
!------------------------------------------------------------------------------
24-
rn_sbot_min = 10. ! minimum depth of s-bottom surface (>0) (m)
25-
rn_sbot_max = 7000. ! maximum depth of s-bottom surface
26-
! (= ocean depth) (>0) (m)
27-
ln_s_sigma = .false. ! hybrid s-sigma coordinates
28-
rn_hc = 150.0 ! critical depth with s-sigma
29-
3012
!------------------------------------------------------------------------------
3113
! grid information
3214
!------------------------------------------------------------------------------
@@ -81,24 +63,25 @@
8163
clname(7) = 'M4'
8264
ln_trans = .true. ! interpolate transport rather than
8365
! velocities
84-
! location of TPXO7.2 data
85-
sn_tide_grid_7p2 = './inputs/tpxo7.2/grid_tpxo7.2.nc'
86-
sn_tide_h = './inputs/tpxo7.2/h_tpxo7.2.nc'
87-
sn_tide_u = './inputs/tpxo7.2/u_tpxo7.2.nc'
88-
! location of TPXO9v5 data: single constituents per file
89-
sn_tide_grid_9p5 = './inputs/TPXO9_atlas_v5_nc/grid_tpxo9_atlas_30_v5.nc'
90-
sn_tide_dir = './inputs/TPXO9_atlas_v5_nc/'
91-
! location of FES2014 data
92-
sn_tide_fes = './inputs/FES2014/'
66+
! location of TPXO7.2 data
67+
sn_tide_grid_7p2 = './inputs/tpxo7.2/grid_tpxo7.2.nc'
68+
sn_tide_h = './inputs/tpxo7.2/h_tpxo7.2.nc'
69+
sn_tide_u = './inputs/tpxo7.2/u_tpxo7.2.nc'
70+
! location of TPXO9v5 data: single constituents per file
71+
sn_tide_grid_9p5 = './inputs/TPXO9_atlas_v5_nc/grid_tpxo9_atlas_30_v5.nc'
72+
sn_tide_dir = './inputs/TPXO9_atlas_v5_nc/'
73+
! location of FES2014 data
74+
sn_tide_fes = './inputs/FES2014/'
9375

9476
!------------------------------------------------------------------------------
9577
! Time information for output
9678
!------------------------------------------------------------------------------
9779
sn_date_start = '1979-11-01' ! dst output date start YYYY-MM-DD
9880
sn_date_end = '1979-12-01' ! dst output date end YYYY-MM-DD
9981
sn_dst_calendar = 'gregorian' ! output calendar format
100-
sn_date_origin = '1960-01-01' ! reference for time counter YYYY-MM-DD ln_time_interpolation = .true. ! set to false to use parent frequency and calender
101-
! for monthly only
82+
sn_date_origin = '1960-01-01' ! reference for time counter YYYY-MM-DD
83+
ln_time_interpolation = .true. ! set to false to use parent
84+
! calender for monthly frequency only
10285

10386
!------------------------------------------------------------------------------
10487
! Additional parameters
@@ -107,11 +90,9 @@
10790
rn_r0 = 0.041666666 ! decorrelation distance use in gauss
10891
! smoothing onto dst points. Need to
10992
! make this a funct. of dlon
110-
sn_history = 'Benchmarking test case'
111-
! history for netcdf file
11293
ln_nemo3p4 = .true. ! else presume v3.2 or v3.3
11394
nn_alpha = 0 ! Euler rotation angle
11495
nn_beta = 0 ! Euler rotation angle
11596
nn_gamma = 0 ! Euler rotation angle
116-
rn_mask_max_depth = 100.0 ! Maximum depth to be ignored for the mask
117-
rn_mask_shelfbreak_dist = 20000.0 ! Distance from the shelf break
97+
rn_mask_max_depth = 100.0 ! Maximum depth to be ignored for the mask
98+
rn_mask_shelfbreak_dist = 20000.0 ! Distance from the shelf break

tests/test_zz_end_to_end.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -185,14 +185,14 @@ def test_sco_sco():
185185
"Shape_temp": (30, 15, 1, 1584),
186186
"Shape_ssh": (30, 1, 1584),
187187
"Shape_mask": (60, 50),
188-
"Mean_temp": 18.50259017944336,
189-
"Mean_sal": 34.17912292480469,
188+
"Mean_temp": 18.054542541503906,
189+
"Mean_sal": 34.12153625488281,
190190
"Sum_unmask": 665280,
191191
"Sum_mask": 47520,
192192
"Shape_u": (30, 15, 1, 1566),
193193
"Shape_v": (30, 15, 1, 1566),
194-
"Mean_u": 0.8442354202270508,
195-
"Mean_v": 0.832240879535675,
194+
"Mean_u": 0.7764930725097656,
195+
"Mean_v": 0.7688539624214172,
196196
}
197197

198198
assert summary_grid == test_grid, "May need to update regression values."
@@ -265,14 +265,14 @@ def test_sco_zco():
265265
"Shape_temp": (30, 25, 1, 1584),
266266
"Shape_ssh": (30, 1, 1584),
267267
"Shape_mask": (60, 50),
268-
"Mean_temp": 18.56098747253418,
269-
"Mean_sal": 34.14830780029297,
268+
"Mean_temp": 18.122085571289062,
269+
"Mean_sal": 34.09104537963867,
270270
"Sum_unmask": 447510,
271271
"Sum_mask": 740490,
272272
"Shape_u": (30, 25, 1, 1566),
273273
"Shape_v": (30, 25, 1, 1566),
274-
"Mean_u": 0.8378004431724548,
275-
"Mean_v": 0.8349438905715942,
274+
"Mean_u": 0.7675425410270691,
275+
"Mean_v": 0.7679993510246277,
276276
}
277277

278278
assert summary_grid == test_grid, "May need to update regression values."

0 commit comments

Comments
 (0)