|
70 | 70 |
|
71 | 71 | attrs = {'pet': {'units': 'mm timestep-1', |
72 | 72 | 'long_name': 'potential evaporation', |
73 | | - 'standard_name': 'water_potential_evaporation_flux'}, |
| 73 | + 'standard_name': 'water_potential_evaporation_flux', |
| 74 | + 'missing_value': np.nan, 'fill_value': np.nan}, |
74 | 75 | 'prec': {'units': 'mm timestep-1', 'long_name': 'precipitation', |
75 | | - 'standard_name': 'precipitation_flux'}, |
| 76 | + 'standard_name': 'precipitation_flux', |
| 77 | + 'missing_value': np.nan, 'fill_value': np.nan}, |
76 | 78 | 'shortwave': {'units': 'W m-2', 'long_name': 'shortwave radiation', |
77 | | - 'standard_name': 'surface_downwelling_shortwave_flux'}, |
| 79 | + 'standard_name': 'surface_downwelling_shortwave_flux', |
| 80 | + 'missing_value': np.nan, 'fill_value': np.nan}, |
78 | 81 | 'longwave': {'units': 'W m-2', 'long_name': 'longwave radiation', |
79 | | - 'standard_name': 'surface_downwelling_longwave_flux'}, |
| 82 | + 'standard_name': 'surface_downwelling_longwave_flux', |
| 83 | + 'missing_value': np.nan, 'fill_value': np.nan}, |
80 | 84 | 't_max': {'units': 'C', 'long_name': 'maximum daily air temperature', |
81 | | - 'standard_name': 'daily_maximum_air_temperature'}, |
| 85 | + 'standard_name': 'daily_maximum_air_temperature', |
| 86 | + 'missing_value': np.nan, 'fill_value': np.nan}, |
82 | 87 | 't_min': {'units': 'C', 'long_name': 'minimum daily air temperature', |
83 | | - 'standard_name': 'daily_minimum_air_temperature'}, |
| 88 | + 'standard_name': 'daily_minimum_air_temperature', |
| 89 | + 'missing_value': np.nan, 'fill_value': np.nan}, |
84 | 90 | 'temp': {'units': 'C', 'long_name': 'air temperature', |
85 | | - 'standard_name': 'air_temperature'}, |
| 91 | + 'standard_name': 'air_temperature', |
| 92 | + 'missing_value': np.nan, 'fill_value': np.nan}, |
86 | 93 | 'vapor_pressure': {'units': 'kPa', 'long_name': 'vapor pressure', |
87 | | - 'standard_name': 'vapor_pressure'}, |
| 94 | + 'standard_name': 'vapor_pressure', |
| 95 | + 'missing_value': np.nan, 'fill_value': np.nan}, |
88 | 96 | 'air_pressure': {'units': 'kPa', 'long_name': 'air pressure', |
89 | | - 'standard_name': 'air_pressure'}, |
| 97 | + 'standard_name': 'air_pressure', |
| 98 | + 'missing_value': np.nan, 'fill_value': np.nan}, |
90 | 99 | 'tskc': {'units': 'fraction', 'long_name': 'cloud fraction', |
91 | | - 'standard_name': 'cloud_fraction'}, |
| 100 | + 'standard_name': 'cloud_fraction', |
| 101 | + 'missing_value': np.nan, 'fill_value': np.nan}, |
92 | 102 | 'rel_humid': {'units': '%', 'long_name': 'relative humidity', |
93 | | - 'standard_name': 'relative_humidity'}, |
| 103 | + 'standard_name': 'relative_humidity', |
| 104 | + 'missing_value': np.nan, 'fill_value': np.nan}, |
94 | 105 | 'spec_humid': {'units': '', 'long_name': 'specific humidity', |
95 | | - 'standard_name': 'specific_humidity'}, |
| 106 | + 'standard_name': 'specific_humidity', |
| 107 | + 'missing_value': np.nan, 'fill_value': np.nan}, |
96 | 108 | 'wind': {'units': 'm/s', 'long_name': 'wind speed', |
97 | | - 'standard_name': 'wind_speed'}, |
| 109 | + 'standard_name': 'wind_speed', |
| 110 | + 'missing_value': np.nan, 'fill_value': np.nan}, |
98 | 111 | '_global': {'conventions': '1.6', 'title': 'Output from MetSim', |
99 | 112 | 'institution': 'University of Washington', |
100 | 113 | 'source': 'metsim.py', |
@@ -408,6 +421,14 @@ def run_slice(self): |
408 | 421 | self.setup_output() |
409 | 422 | times = self.met_data['time'] |
410 | 423 | params = self.params.copy() |
| 424 | + # transform input parameters to floating point values |
| 425 | + params['sw_prec_thresh'] = float(params['sw_prec_thresh']) |
| 426 | + params['rain_scalar'] = float(params['rain_scalar']) |
| 427 | + params['tdew_tol'] = float(params['tdew_tol']) |
| 428 | + params['tmax_daylength_fraction'] = float(params['tmax_daylength_fraction']) |
| 429 | + params['tday_coef'] = float(params['tday_coef']) |
| 430 | + params['tmax_daylength_fraction'] = float(params['tmax_daylength_fraction']) |
| 431 | + params['lapse_rate'] = float(params['lapse_rate']) |
411 | 432 | for index, mask_val in np.ndenumerate(self.domain['mask'].values): |
412 | 433 | if mask_val > 0: |
413 | 434 | locs = {d: i for d, i in zip(self.domain['mask'].dims, index)} |
|
0 commit comments