Skip to content

Commit

Permalink
Use bed derivatives from pixel file in calculate_wave_drag.py
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrus89 committed Apr 25, 2024
1 parent d692111 commit ab0da31
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions compass/ocean/tests/tides/init/calculate_wave_drag.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ def run(self):
ylat = np.asarray(bd.lat.values[:], dtype=np.float64)
xlon = np.asarray(bd.lon.values[:], dtype=np.float64)
bed_slope = np.asarray(bd.bed_slope.values)
xgrad = np.asarray(bd.bed_dz_dx.values)
ygrad = np.asarray(bd.bed_dz_dy.values)

md = xr.open_dataset(self.mesh_file)
nEdges = np.size(md.nEdges.values)
Expand All @@ -138,13 +140,6 @@ def run(self):
np.linspace(-1, ymid.size, 17)), dtype=int)
nset = []

R = 6378206.4
xmesh, ymesh = np.meshgrid(xmid, ymid)
ygrad, xgrad = np.gradient(elev, ymid, xmid)
ygrad = ygrad / R
xgrad = xgrad / (R * np.cos(ymesh * np.pi / 180.))
del xmesh, ymesh, R

for tile in range(indx.size - 1):

head = indx[tile + 0] + 1
Expand Down

0 comments on commit ab0da31

Please sign in to comment.