Skip to content

Commit

Permalink
fixup distance in analysis in cosine bell
Browse files Browse the repository at this point in the history
  • Loading branch information
cbegeman committed Oct 3, 2023
1 parent 1f31838 commit 611da50
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions polaris/ocean/tasks/cosine_bell/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,15 @@ def exact_solution(self, mesh_name, field_name, time, zidx=None):
lonCent = config.getfloat('cosine_bell', 'lon_center')
radius = config.getfloat('cosine_bell', 'radius')
psi0 = config.getfloat('cosine_bell', 'psi0')
vel_pd = config.getfloat('cosine_bell', 'vel_pd')

ds_mesh = xr.open_dataset(f'{mesh_name}_mesh.nc')
ds_init = xr.open_dataset(f'{mesh_name}_init.nc')
# find new location of blob center
# center is based on equatorial velocity
R = ds_mesh.sphere_radius
distTrav = 2.0 * np.pi * R / time
# distance in radians is
distRad = distTrav / R
distRad = 2.0 * np.pi * time / (86400.0 * vel_pd)
newLon = lonCent + distRad
if newLon > 2.0 * np.pi:
newLon -= 2.0 * np.pi
Expand Down

0 comments on commit 611da50

Please sign in to comment.