diff --git a/inputs/namelist_remote.bdy b/inputs/namelist_remote.bdy index 379e3324dbf87f6f4d21759ed7cd318b34ddd061..77680055fe538e986b74f6560a525ac8fd431435 100644 --- a/inputs/namelist_remote.bdy +++ b/inputs/namelist_remote.bdy @@ -62,13 +62,13 @@ ! baroclinic velocities ln_tra = .true. ! boundary conditions for T and S ln_ice = .false. ! ice boundary condition - nn_rimwidth = 1 ! width of the relaxation zone + nn_rimwidth = 9 ! width of the relaxation zone !------------------------------------------------------------------------------ ! unstructured open boundaries tidal parameters !------------------------------------------------------------------------------ ln_tide = .true. ! =T : produce bdy tidal conditions - sn_tide_model = 'tpxo' ! Name of tidal model (fes|tpxo) + sn_tide_model = 'fes' ! Name of tidal model (fes|tpxo) clname(1) = 'M2' ! constituent name clname(2) = 'S2' ln_trans = .true. ! interpolate transport rather than diff --git a/pynemo/tide/nemo_bdy_tide3.py b/pynemo/tide/nemo_bdy_tide3.py index 7cac42dee2d3720def58067d118ad2c583ffcd69..3202514b1665d7ed68b1a1435ca076172dafb955 100644 --- a/pynemo/tide/nemo_bdy_tide3.py +++ b/pynemo/tide/nemo_bdy_tide3.py @@ -28,8 +28,8 @@ def nemo_bdy_tide_rot(setup, DstCoord, Grid_T, Grid_U, Grid_V, comp,tide_model): dst_lat = DC.bdy_lonlat[g_type]['lat'][Grid_T.bdy_r == 0] #nbdyz = len(Grid_T.bdy_i) - nbdyu = len(Grid_U.bdy_i) - nbdyv = len(Grid_V.bdy_i) + nbdyu = len(np.where(Grid_U.bdy_r == 0)[0]) + nbdyv = len(np.where(Grid_V.bdy_r == 0)[0]) # TODO: change from if statement defining HC extract to string passed that defines HC extract script # e.g. pass 'tpxo' for tpxo_extract_HC.py or 'fes' fro fes_extract_HC.py. This will make easier to add new @@ -257,11 +257,14 @@ def nemo_bdy_tide_rot(setup, DstCoord, Grid_T, Grid_U, Grid_V, comp,tide_model): dst_gsin = grid_angles.sinval #retain only boundary points rotation information - tmp_gcos = np.zeros(Grid_U.bdy_i.shape[0]) - tmp_gsin = np.zeros(Grid_U.bdy_i.shape[0]) - for index in range(Grid_U.bdy_i.shape[0]): - tmp_gcos[index] = dst_gcos[Grid_U.bdy_i[index, 1], Grid_U.bdy_i[index, 0]] - tmp_gsin[index] = dst_gsin[Grid_U.bdy_i[index, 1], Grid_U.bdy_i[index, 0]] + tmp_gcos = np.zeros(len(np.where(Grid_U.bdy_r == 0)[0])) + tmp_gsin = np.zeros(len(np.where(Grid_U.bdy_r == 0)[0])) + + bdy_r_in_i = Grid_U.bdy_i[Grid_U.bdy_r == 0] + + for index in range(len(np.where(Grid_U.bdy_r == 0)[0])): + tmp_gcos[index] = dst_gcos[bdy_r_in_i[index, 1], bdy_r_in_i[index, 0]] + tmp_gsin[index] = dst_gsin[bdy_r_in_i[index, 1], bdy_r_in_i[index, 0]] dst_gcos = tmp_gcos dst_gsin = tmp_gsin @@ -276,11 +279,14 @@ def nemo_bdy_tide_rot(setup, DstCoord, Grid_T, Grid_U, Grid_V, comp,tide_model): dst_gsin = grid_angles.sinval #retain only boundary points rotation information - tmp_gcos = np.zeros(Grid_V.bdy_i.shape[0]) - tmp_gsin = np.zeros(Grid_V.bdy_i.shape[0]) - for index in range(Grid_V.bdy_i.shape[0]): - tmp_gcos[index] = dst_gcos[Grid_V.bdy_i[index, 1], Grid_V.bdy_i[index, 0]] - tmp_gsin[index] = dst_gsin[Grid_V.bdy_i[index, 1], Grid_V.bdy_i[index, 0]] + tmp_gcos = np.zeros(len(np.where(Grid_V.bdy_r == 0)[0])) + tmp_gsin = np.zeros(len(np.where(Grid_V.bdy_r == 0)[0])) + + bdy_r_in_i = Grid_V.bdy_i[Grid_V.bdy_r == 0] + + for index in range(len(np.where(Grid_V.bdy_r == 0)[0])): + tmp_gcos[index] = dst_gcos[bdy_r_in_i[index, 1], bdy_r_in_i[index, 0]] + tmp_gsin[index] = dst_gsin[bdy_r_in_i[index, 1], bdy_r_in_i[index, 0]] dst_gcos = tmp_gcos dst_gsin = tmp_gsin