@@ -158,7 +158,7 @@ def __init__(self, path, file_str, time_fld, lat_fld, liq_flds,
158158 # ---------------------------------------------------------------- #
159159
160160 # ---------------------------------------------------------------- #
161- def start (self , timestamp ):
161+ def start (self , timestamp , rout_var ):
162162 """ Initialize the first files inputs"""
163163 # ------------------------------------------------------------ #
164164 # find and open first file
@@ -205,6 +205,26 @@ def start(self, timestamp):
205205 else :
206206 raise ValueError ('unknown forcing units' )
207207 # ------------------------------------------------------------ #
208+
209+ # ------------------------------------------------------------ #
210+ # Compare rout_var mask to forcing mask
211+ for fld in self .liq_flds :
212+ self .current_fhdl .variables [fld ].set_auto_maskandscale (False )
213+ try :
214+ fill_val = getattr (self .current_fhdl .variables [fld ],
215+ '_FillValue' )
216+ fmask = np .squeeze (self .current_fhdl .variables [fld ][0 ]) == fill_val
217+
218+ if np .any (fmask [rout_var .source_y_ind , rout_var .source_x_ind ]):
219+ log .error ('There are fill values in the routing domain' )
220+ log .error ('Can not continue...' )
221+ raise ValueError ('Exiting now due to fill values being '
222+ 'inside the domain defined by the RVIC '
223+ 'parameter file' )
224+
225+ except AttributeError :
226+ pass
227+ # ------------------------------------------------------------ #
208228 # ---------------------------------------------------------------- #
209229
210230 # ---------------------------------------------------------------- #
0 commit comments