diff --git a/pyroms/pyroms/grid.py b/pyroms/pyroms/grid.py index 06550c9..5934d42 100644 --- a/pyroms/pyroms/grid.py +++ b/pyroms/pyroms/grid.py @@ -297,6 +297,12 @@ def get_ROMS_hgrid(gridid): x_psi=x_psi, y_psi=y_psi, dx=dx, dy=dy, \ dndx=dndx, dmde=dmde, angle_rho=angle) + #load the mask + try: + hgrd.mask_rho = np.array(nc.variables['mask_rho'][:]) + except: + hgrd.mask_rho = np.ones(hgrd.x_rho.shape) + else: #geographical grid print('Load geographical grid from file') @@ -366,11 +372,11 @@ def get_ROMS_hgrid(gridid): lon_psi=lon_psi, lat_psi=lat_psi, dx=dx, dy=dy, \ dndx=dndx, dmde=dmde, angle_rho=angle) - #load the mask - try: - hgrd.mask_rho = np.array(nc.variables['mask_rho'][:]) - except: - hgrd.mask_rho = np.ones(hgrd.lat_rho.shape) + #load the mask + try: + hgrd.mask_rho = np.array(nc.variables['mask_rho'][:]) + except: + hgrd.mask_rho = np.ones(hgrd.lat_rho.shape) return hgrd