xr[:, i + 1] = xr[:, i] + 2 / (pm[:, i + 1] + pm[:, i]) for j in np.arange(0, M): yr[j + 1, :] = yr[j, :] + 2 / (pn[j + 1, :] + pn[j, :]) xu, xv, xp = rho2uvp(xr) yu, yv, yp = rho2uvp(yr) dx = 1 / pm dy = 1 / pn dxmax = np.max(dx / 1000.) dxmin = np.min(dx / 1000.) dymax = np.max(dy / 1000.) dymin = np.min(dy / 1000.) angle = get_angle(Latu, Lonu) f0 = 4 * np.pi * np.sin(np.pi * Latr / 180) / (24 * 3600) print(' \n' + '==> ' + ' ADDING TOPOGRAPHY ...\n' + ' ') #ff=np.isnan(X) ############## ETOPO2 = False if ETOPO2: print('bathymetry from ETOPO2') h = add_topo(Lonr, Latr, pm, pn, 'ETOPO2v2g_f4.nc') #etopo GEBCO = False if GEBCO:
xr[:, i+1] = xr[:, i] + 2 / ( pm[:, i+1] + pm[:, i] ) for j in np.arange(0, M): yr[j+1, :] = yr[j, :] + 2 / ( pn[j+1, :] + pn[j, :] ) xu, xv, xp = rho2uvp(xr) yu, yv, yp = rho2uvp(yr) dx = 1 / pm dy = 1 / pn dxmax = np.max( dx/1000 ) dxmin = np.min( dx/1000 ) dymax = np.max( dy/1000 ) dymin = np.min( dy/1000 ) angle = get_angle(Latu, Lonu) f0 = 4 * np.pi * np.sin( np.pi * Latr/180 ) / ( 24*3600 ) print ' \n' + '==> ' + ' ADDING TOPOGRAPHY ...\n' + ' ' h = add_topo(Lonr, Latr, pm, pn, run.topo_filename) hraw = h.copy() h[ np.where(h > run.hmax) ] = run.hmax print ' \n' + '==> ' + ' COMPUTING THE MASK ...\n' + ' ' maskr = h*0 maskr[ np.where(h > 0) ] = 1 maskr = process_mask(maskr)