Skip to content

Commit

Permalink
Rossby number
Browse files Browse the repository at this point in the history
  • Loading branch information
Pperezhogin committed Apr 18, 2024
1 parent ae50a34 commit 104e1f2
Show file tree
Hide file tree
Showing 2 changed files with 334 additions and 2 deletions.
29 changes: 27 additions & 2 deletions experiments/ANN-Results/helpers/state_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def ZB20(self, ZB_scaling=1.0, VGM='False'):
div_corner = grid.interp(div, ['X', 'Y']) * param.wet_c
Txx += div * sh_xx + div**2
Tyy += - div * sh_xx + div**2
Txy += div_corner * sh_xy
Txy += div_corner * sh_xy

kappa_t = - param.dxT * param.dyT * param.wet * ZB_scaling
kappa_q = - param.dxBu * param.dyBu * param.wet_c * ZB_scaling
Expand Down Expand Up @@ -788,4 +788,29 @@ def Rd_dx(self):

param = self.param
dx = np.sqrt(param.dxT**2 + param.dyT**2)
return self.deformation_radius / dx
return self.deformation_radius / dx

@property
def rossby_number(self):
'''
Local Rossby number is defined similarly to Klower 2017, Juricke 2019:
as a local 2D or 3D field
Ro = sqrt(D^2+D_hat^2) / |f|
Possible usage is the resolution function:
Resolution_function = 1/(1+Ro)
'''
sh_xy, sh_xx, vort_xy, div = self.velocity_gradients()

Shear_mag = self.param.wet * (sh_xx**2+self.grid.interp(sh_xy**2,['X','Y']))**0.5

Omega = 7.2821e-5
lat_rad = self.param.yh * np.pi / 180. # latitude in radians
f = 2 * Omega * np.sin(lat_rad)

Ro = Shear_mag / (np.abs(f)+1e-25)
return Ro




307 changes: 307 additions & 0 deletions experiments/ANN-Results/offline_analysis/3-CM26-physical-scales.ipynb

Large diffs are not rendered by default.

0 comments on commit 104e1f2

Please sign in to comment.