source: issm/trunk-jpl/src/m/classes/snowpack.m@ 16144

Last change on this file since 16144 was 16144, checked in by Mathieu Morlighem, 12 years ago

CHG: removed double blank lines

File size: 27.2 KB
Line 
1%SNOWPACK class definition
2%
3% Usage:
4% snowpack=snowpack();
5
6classdef snowpack
7 properties (SetAccess=public)
8
9 %first, the configuration fields, by category:
10 %snowpack: %{{{
11 snowpack_meas_tss = 0;
12 snowpack_enforce_measured_snow_heights = 0;
13 snowpack_sw_mode = 0;
14 snowpack_incoming_longwave = 0;
15 snowpack_height_of_wind_value = 0;
16 snowpack_height_of_meteo_values = 0;
17 snowpack_neutral = 0;
18 snowpack_roughness_length = 0;
19 snowpack_number_slopes = 0;
20 snowpack_snow_redistribution = 0;
21 snowpack_calculation_step_length = 0;
22 snowpack_change_bc = 0;
23 snowpack_thresh_change_bc = 0;
24 snowpack_snp_soil = 0;
25 snowpack_soil_flux = 0;
26 snowpack_geo_heat = 0;
27 snowpack_canopy = 0;
28 %}}}
29 %snowpackadvanced: %{{{
30 snowpackadvanced_variant = ''; % use 320 kg m-3 for fixed density
31 snowpackadvanced_hn_density = '';
32 %}}}
33 %general: %{{{
34 general_pluginpath = '';
35 general_buff_chunk_size = 0;
36 general_buff_before = 0;
37 %}}}
38 %input {{{
39 input_coordsys = '';
40 input_coordparam = '';
41 input_time_zone = 0;
42 input_meteo = '';
43 input_meteopath = '';
44 input_station1 = '';
45 input_snowfile1 = '';
46 %}}}
47 %output {{{
48 output_coordsys = '';
49 output_coordparam = '';
50 output_time_zone = 0;
51 output_meteopath = '';
52 output_experiment = '';
53 output_ts_write = 0;
54 output_ts_start = 0;
55 output_ts_days_between = 0;
56 output_profile = '';
57 output_prof_write = 0;
58 output_prof_start = 0;
59 output_prof_days_between = 0;
60 %}}}
61 %interpolations1d %{{{
62 interpolations1d_window_size = 0; %that is 5 d and 2 h; 1 d = 86400
63 interpolations1d_hnw_resample = '';
64 interpolations1d_hs_resample = '';
65 interpolations1d_tsg_resample = '';
66 interpolations1d_rho_hn_resample = '';
67 interpolations1d_vw_resample = '';
68 interpolations1d_vw_args = '';
69 %}}}
70 %filters {{{
71 filters={'TA::filter1',{'soft',[-20 10]}};
72 filters=NaN;
73 filter_values=NaN;
74
75 filters_ta_filter1 = '';
76 filters_ta_arg1 = NaN;
77 filters_rh_filter1 = '';
78 filters_rh_arg1 = NaN;
79 filters_rh_filter2 = '';
80 filters_rh_arg2 = NaN;
81 filters_iswr_filter1 = '';
82 filters_iswr_arg1 = NaN;
83 filters_iswr_filter2 = '';
84 filters_iswr_arg2 = NaN;
85 filters_rswr_filter1 = '';
86 filters_rswr_arg1 = NaN;
87 filters_rswr_filter2 = '';
88 filters_rswr_arg2 = NaN;
89
90 %for ta between 190 and 280 k;
91 filters_ilwr_filter1 = '';
92 filters_ilwr_arg1 = NaN;
93 filters_ilwr_filter2 = '';
94 filters_ilwr_arg2 = NaN;
95 filters_tss_filter1 = '';
96 filters_tss_arg1 = NaN;
97 filters_tsg_filter1 = '';
98 filters_tsg_arg1 = NaN;
99 filters_vw_filter1 = '';
100 filters_vw_arg1 = NaN;
101 filters_vw_filter2 = '';
102 filters_vw_arg2 = NaN;
103 %}}}
104
105 end
106 methods
107 function obj = snowpack(varargin) % {{{
108 switch nargin
109 case 0
110 obj=setdefaultparameters(obj);
111 case 1
112 inputstruct=varargin{1};
113 list1 = properties('snowpack');
114 list2 = fieldnames(inputstruct);
115 for i=1:length(list1)
116 fieldname = list1{i};
117 if ismember(fieldname,list2),
118 obj.(fieldname) = inputstruct.(fieldname);
119 end
120 end
121 otherwise
122 error('constructor not supported');
123 end
124 end % }}}
125 function obj = setdefaultparameters(obj) % {{{
126
127 %snowpack: %{{{
128 obj.snowpack_meas_tss = 1;
129 obj.snowpack_enforce_measured_snow_heights = 0;
130 obj.snowpack_sw_mode = 0;
131 obj.snowpack_incoming_longwave = 1;
132 obj.snowpack_height_of_wind_value = 12.;
133 obj.snowpack_height_of_meteo_values = 12.;
134 obj.snowpack_neutral = 0;
135 obj.snowpack_roughness_length = 0.002;
136 obj.snowpack_number_slopes = 1;
137 obj.snowpack_snow_redistribution = 1;
138 obj.snowpack_calculation_step_length = 15.0;
139 obj.snowpack_change_bc = 0;
140 obj.snowpack_thresh_change_bc = -1.0;
141 obj.snowpack_snp_soil = 0;
142 obj.snowpack_soil_flux = 0;
143 obj.snowpack_geo_heat = 0.06;
144 obj.snowpack_canopy = 0;
145 %}}}
146 %snowpackadvanced: %{{{
147 obj.snowpackadvanced_variant = 'ANTARCTICA'; % use 320 kg m-3 for fixed density
148 obj.snowpackadvanced_hn_density = 'EVENT';
149 %}}}
150 %general: %{{{
151 obj.general_pluginpath = '/usr/local/lib/meteoio/plugins/';
152 obj.general_buff_chunk_size = 90;
153 obj.general_buff_before = 1.5;
154 %}}}
155 %input {{{
156 obj.input_coordsys = 'ch1903';
157 obj.input_coordparam = 'null';
158 obj.input_time_zone = 8;
159 obj.input_meteo = 'smet';
160 obj.input_meteopath = './input';
161 obj.input_station1 = 'domec.smet';
162 obj.input_snowfile1 = 'domec.sno';
163 %}}}
164 %output {{{
165 obj.output_coordsys = 'ch1903';
166 obj.output_coordparam = 'null';
167 obj.output_time_zone = 8;
168 obj.output_meteopath = './output';
169 obj.output_experiment = 'smet';
170 obj.output_ts_write = 1;
171 obj.output_ts_start = 0.0;
172 obj.output_ts_days_between = 0.04166667;
173 obj.output_profile = 'ascii';
174 obj.output_prof_write = 1;
175 obj.output_prof_start = 0.0;
176 obj.output_prof_days_between = 0.04166667;
177 %}}}
178 %interpolations1d %{{{
179 obj.interpolations1d_window_size = 439200; %that is 5 d and 2 h; 1 d = 86400
180 obj.interpolations1d_hnw_resample = 'none';
181 obj.interpolations1d_hs_resample = 'linear';
182 obj.interpolations1d_tsg_resample = 'linear';
183 obj.interpolations1d_rho_hn_resample = 'none';
184 obj.interpolations1d_vw_resample = 'nearest_neighbour';
185 obj.interpolations1d_vw_args = 'extrapolate';
186 %}}}
187 %filters {{{
188 obj.filters_ta_filter1 = 'min_max';
189 obj.filters_ta_arg1 = [190 280];
190 obj.filters_rh_filter1 = 'min_max';
191 obj.filters_rh_arg1 = [0.01 1.2];
192 obj.filters_rh_filter2 = 'min_max';
193 obj.filters_rh_arg2 = {'soft' 0.01 1.0};
194 obj.filters_iswr_filter1 = 'min_max';
195 obj.filters_iswr_arg1 = [-10 1500];
196 obj.filters_iswr_filter2 = 'min_max';
197 obj.filters_iswr_arg2 = {'soft' 0 1500};
198 obj.filters_rswr_filter1 = 'min_max';
199 obj.filters_rswr_arg1 = [-10 1500];
200 obj.filters_rswr_filter2 = 'min_max';
201 obj.filters_rswr_arg2 = {'soft' 0 1500};
202
203 %for ta between 190 and 280 k;
204 obj.filters_ilwr_filter1 = 'min_max';
205 obj.filters_ilwr_arg1 = [30 355];
206 obj.filters_ilwr_filter2 = 'min_max';
207 obj.filters_ilwr_arg2 = {'soft' 35 350};
208 obj.filters_tss_filter1 = 'min_max';
209 obj.filters_tss_arg1 = [180 275];
210 obj.filters_tsg_filter1 = 'min_max';
211 obj.filters_tsg_arg1 = [200 275];
212 obj.filters_vw_filter1 = 'min_max';
213 obj.filters_vw_arg1 = [-2 70];
214 obj.filters_vw_filter2 = 'min_max';
215 obj.filters_vw_arg2 = {'soft' 0 50};
216 %}}}
217
218 end % }}}
219 function md = checkconsistency(obj,md,solution,analyses) % {{{
220 %snowpack: %{{{
221 md=checkfield(md,'snowpack.snowpack_meas_tss','values',[0 1]);
222 md=checkfield(md,'snowpack.snowpack_enforce_measured_snow_heights','values',[0 1]);
223 md=checkfield(md,'snowpack.snowpack_sw_mode','values',[0 1 2]);
224 md=checkfield(md,'snowpack.snowpack_incoming_longwave','values',[0 1]);
225 md=checkfield(md,'snowpack.snowpack_height_of_wind_value','>=',0);
226 md=checkfield(md,'snowpack.snowpack_height_of_meteo_values','>=',0);
227 md=checkfield(md,'snowpack.snowpack_neutral','values',[-1 0 1]);
228 md=checkfield(md,'snowpack.snowpack_roughness_length','>=',0);
229 md=checkfield(md,'snowpack.snowpack_number_slopes','values',[1 3 5 9]);
230 md=checkfield(md,'snowpack.snowpack_snow_redistribution','values',[0 1]);
231 md=checkfield(md,'snowpack.snowpack_calculation_step_length','>',0);
232 md=checkfield(md,'snowpack.snowpack_change_bc','values',[0 1]);
233 md=checkfield(md,'snowpack.snowpack_thresh_change_bc','<=',0);
234 md=checkfield(md,'snowpack.snowpack_snp_soil','values',[0 1]);
235 md=checkfield(md,'snowpack.snowpack_soil_flux','values',[0 1]);
236 md=checkfield(md,'snowpack.snowpack_geo_heat','>=',0);
237 md=checkfield(md,'snowpack.snowpack_canopy','values',[0 1]);
238 %}}}
239 %snowpackadvanced: %{{{
240 md=checkfield(md,'snowpack.snowpackadvanced_variant','values',{'JAPAN','DEFAULT','ANTARCTICA'});
241 md=checkfield(md,'snowpack.snowpackadvanced_hn_density','values',{'PARAMETERIZED','EVENT','MEASURED'});
242 %}}}
243 %general: %{{{
244 md=checkfield(md,'snowpack.general_buff_chunk_size','>',0);
245 md=checkfield(md,'snowpack.general_buff_before','>',0);
246 %}}}
247 %input {{{
248 md=checkfield(md,'snowpack.input_coordsys','values',{'CH1903','UTM','UPS','PROJ4','LOCAL'});
249 md=checkfield(md,'snowpack.input_coordparam','values','null');
250 md=checkfield(md,'snowpack.input_time_zone','>',-12,'<',12);
251 md=checkfield(md,'snowpack.input_meteo','values',{'BORMA','COSMO','GEOTOP','GRIB','GSN','IMIS','SMET','SNOWPACK'});
252 md=checkfield(md,'snowpack.input_meteopath','empty',1);
253 md=checkfield(md,'snowpack.input_station1 ','empty',1);
254 md=checkfield(md,'snowpack.input_snowfile1','empty',1);
255 %}}}
256 %output {{{
257 md=checkfield(md,'snowpack.output_coordsys','values',{'CH1903','UTM','UPS','PROJ4','LOCAL'});
258 md=checkfield(md,'snowpack.output_coordparam','values','null');
259 md=checkfield(md,'snowpack.output_time_zone','>',-12,'<',12);
260 md=checkfield(md,'snowpack.output_meteopath','empty',1);
261 md=checkfield(md,'snowpack.output_experiment','empty',1);
262 md=checkfield(md,'snowpack.output_ts_write','values',[0 1]);
263 md=checkfield(md,'snowpack.output_ts_start','>=',0);
264 md=checkfield(md,'snowpack.output_ts_days_between','>=',0);
265 md=checkfield(md,'snowpack.output_profile','values',{'ASCII','IMIS','ASCII IMIS'});
266 md=checkfield(md,'snowpack.output_prof_write','values',[0 1]);
267 md=checkfield(md,'snowpack.output_prof_start','>=',0);
268 md=checkfield(md,'snowpack.output_prof_days_between','>=',0);
269 %}}}
270 %interpolations1d %{{{
271 md=checkfield(md,'snowpack.interpolations1d_window_size','>',0);
272 md=checkfield(md,'snowpack.interpolations1d_hnw_resample','values',{'NONE','NEAREST_NEIGHBOUR','ACCUMULATE','LINEAR'});
273 md=checkfield(md,'snowpack.interpolations1d_hs_resample','values',{'NONE','NEAREST_NEIGHBOUR','ACCUMULATE','LINEAR'});
274 md=checkfield(md,'snowpack.interpolations1d_tsg_resample','values',{'NONE','NEAREST_NEIGHBOUR','ACCUMULATE','LINEAR'});
275 md=checkfield(md,'snowpack.interpolations1d_rho_hn_resample','values',{'NONE','NEAREST_NEIGHBOUR','ACCUMULATE','LINEAR'});
276 md=checkfield(md,'snowpack.interpolations1d_vw_resample','values',{'NONE','NEAREST_NEIGHBOUR','ACCUMULATE','LINEAR'});
277 md=checkfield(md,'snowpack.interpolations1d_vw_args','values',{'EXTRAPOLATE'});
278 %}}}
279 %filters {{{
280 filter_values={'MIN_MAX','RATE_FILTER1','RATE_FILTER2','UNHEATED_RAIN_GAUGE_FILTER','WMO_UNDERCATCH_FILTER','WMO_UNDERCATCH_FILTER-SIMPLIFIED','UNVENTILLATED_TEMPERATURE_SENSOR','ADD_AN_OFFSET'};
281
282 md=checkfield(md,'snowpack.filters_ta_filter1','values',{filter_values});
283 if strcmpi(md.snowpack.filters_ta_filter1,'MIN_MAX'), md=checkfield(md,'snowpack.filters_ta_filter1','size',[1 NaN]); end
284 md=checkfield(md,'snowpack.filters_ta_arg1','values',{filter_values});
285 if strcmpi(md.snowpack.filters_ta_arg1,'MIN_MAX'), md=checkfield(md,'snowpack.filters_ta_arg1','size',[1 NaN]); end
286 md=checkfield(md,'snowpack.filters_rh_filter1','values',{filter_values});
287 if strcmpi(md.snowpack.filters_rh_filter1,'MIN_MAX'), md=checkfield(md,'snowpack.filters_rh_filter1','size',[1 NaN]); end
288 md=checkfield(md,'snowpack.filters_rh_arg1','values',{filter_values});
289 if strcmpi(md.snowpack.filters_rh_arg1,'MIN_MAX'), md=checkfield(md,'snowpack.filters_rh_arg1','size',[1 NaN]); end
290 md=checkfield(md,'snowpack.filters_rh_filter2','values',{filter_values});
291 if strcmpi(md.snowpack.filters_rh_filter2,'MIN_MAX'), md=checkfield(md,'snowpack.filters_rh_filter2','size',[1 NaN]); end
292 md=checkfield(md,'snowpack.filters_rh_arg2','values',{filter_values});
293 if strcmpi(md.snowpack.filters_rh_arg2,'MIN_MAX'), md=checkfield(md,'snowpack.filters_rh_arg2','size',[1 NaN]); end
294 md=checkfield(md,'snowpack.filters_iswr_filter1','values',{filter_values});
295 if strcmpi(md.snowpack.filters_iswr_filter1,'MIN_MAX'), md=checkfield(md,'snowpack.filters_iswr_filter1','size',[1 NaN]); end
296 md=checkfield(md,'snowpack.filters_iswr_arg1','values',{filter_values});
297 if strcmpi(md.snowpack.filters_iswr_arg1,'MIN_MAX'), md=checkfield(md,'snowpack.filters_iswr_arg1','size',[1 NaN]); end
298 md=checkfield(md,'snowpack.filters_iswr_filter2','values',{filter_values});
299 if strcmpi(md.snowpack.filters_iswr_filter2,'MIN_MAX'), md=checkfield(md,'snowpack.filters_iswr_filter2','size',[1 NaN]); end
300 md=checkfield(md,'snowpack.filters_iswr_arg2','values',{filter_values});
301 if strcmpi(md.snowpack.filters_iswr_arg2,'MIN_MAX'), md=checkfield(md,'snowpack.filters_iswr_arg2','size',[1 NaN]); end
302 md=checkfield(md,'snowpack.filters_rswr_filter1','values',{filter_values});
303 if strcmpi(md.snowpack.filters_rswr_filter1,'MIN_MAX'), md=checkfield(md,'snowpack.filters_rswr_filter1','size',[1 NaN]); end
304 md=checkfield(md,'snowpack.filters_rswr_arg1','values',{filter_values});
305 if strcmpi(md.snowpack.filters_rswr_arg1,'MIN_MAX'), md=checkfield(md,'snowpack.filters_rswr_arg1','size',[1 NaN]); end
306 md=checkfield(md,'snowpack.filters_rswr_filter2','values',{filter_values});
307 if strcmpi(md.snowpack.filters_rswr_filter2,'MIN_MAX'), md=checkfield(md,'snowpack.filters_rswr_filter2','size',[1 NaN]); end
308 md=checkfield(md,'snowpack.filters_rswr_arg2','values',{filter_values});
309 if strcmpi(md.snowpack.filters_rswr_arg2,'MIN_MAX'), md=checkfield(md,'snowpack.filters_rswr_arg2','size',[1 NaN]); end
310
311 %for ta between 190 and 280 k;
312 md=checkfield(md,'snowpack.filters_ilwr_filter1','values',{filter_values});
313 if strcmpi(md.snowpack.filters_ilwr_filter1,'MIN_MAX'), md=checkfield(md,'snowpack.filters_ilwr_filter1','size',[1 NaN]); end
314 md=checkfield(md,'snowpack.filters_ilwr_arg1','values',{filter_values});
315 if strcmpi(md.snowpack.filters_ilwr_arg1,'MIN_MAX'), md=checkfield(md,'snowpack.filters_ilwr_arg1','size',[1 NaN]); end
316 md=checkfield(md,'snowpack.filters_ilwr_filter2','values',{filter_values});
317 if strcmpi(md.snowpack.filters_ilwr_filter2,'MIN_MAX'), md=checkfield(md,'snowpack.filters_ilwr_filter2','size',[1 NaN]); end
318 md=checkfield(md,'snowpack.filters_ilwr_arg2','values',{filter_values});
319 if strcmpi(md.snowpack.filters_ilwr_arg2,'MIN_MAX'), md=checkfield(md,'snowpack.filters_ilwr_arg2','size',[1 NaN]); end
320 md=checkfield(md,'snowpack.filters_tss_filter1','values',{filter_values});
321 if strcmpi(md.snowpack.filters_tss_filter1,'MIN_MAX'), md=checkfield(md,'snowpack.filters_tss_filter1','size',[1 NaN]); end
322 md=checkfield(md,'snowpack.filters_tss_arg1','values',{filter_values});
323 if strcmpi(md.snowpack.filters_tss_arg1,'MIN_MAX'), md=checkfield(md,'snowpack.filters_tss_arg1','size',[1 NaN]); end
324 md=checkfield(md,'snowpack.filters_tsg_filter1','values',{filter_values});
325 if strcmpi(md.snowpack.filters_tsg_filter1,'MIN_MAX'), md=checkfield(md,'snowpack.filters_tsg_filter1','size',[1 NaN]); end
326 md=checkfield(md,'snowpack.filters_tsg_arg1','values',{filter_values});
327 if strcmpi(md.snowpack.filters_tsg_arg1,'MIN_MAX'), md=checkfield(md,'snowpack.filters_tsg_arg1','size',[1 NaN]); end
328 md=checkfield(md,'snowpack.filters_vw_filter1','values',{filter_values});
329 if strcmpi(md.snowpack.filters_vw_filter1,'MIN_MAX'), md=checkfield(md,'snowpack.filters_vw_filter1','size',[1 NaN]); end
330 md=checkfield(md,'snowpack.filters_vw_arg1','values',{filter_values});
331 if strcmpi(md.snowpack.filters_vw_arg1,'MIN_MAX'), md=checkfield(md,'snowpack.filters_vw_arg1','size',[1 NaN]); end
332 md=checkfield(md,'snowpack.filters_vw_filter2','values',{filter_values});
333 if strcmpi(md.snowpack.filters_vw_filter2,'MIN_MAX'), md=checkfield(md,'snowpack.filters_vw_filter2','size',[1 NaN]); end
334 md=checkfield(md,'snowpack.filters_vw_arg2','values',{filter_values});
335 if strcmpi(md.snowpack.filters_vw_arg2,'MIN_MAX'), md=checkfield(md,'snowpack.filters_vw_arg2','size',[1 NaN]); end
336
337 %}}}
338 end % }}}
339 function disp(obj) % {{{
340
341 disp(sprintf(' Snowpack solution parameters:'));
342 disp(sprintf('\n %s','Snowpack parameters:')); % {{{
343 fielddisplay(obj,'snowpack_meas_tss',{'A measured surface temperature is available and can be reliably ','used for various consistency tests (it needs to be set to true if enabling CHANGE_BC) (0 or 1)'});
344 fielddisplay(obj,'snowpack_enforce_measured_snow_heights','Input mode by which a measurement of snow depth is used to drive the snow cover mass balance (0 or 1)');
345 fielddisplay(obj,'snowpack_sw_mode',{'Define the shortwave radiation input:',...
346 '0 Incoming shortwave radiation is measured and albedo estimated by the model',...
347 '1 Reflected shortwave radiation is available as input and albedo is estimated by the model (IMIS standard)',...
348 '2 Incoming and reflected shortwave radiation are both measured and the albedo is estimated from both measurements subject to plausibility checks.'});
349 fielddisplay(obj,'snowpack_incoming_longwave','Use the provided incoming long wave on the virtual slopes? (0 or 1)');
350 fielddisplay(obj,'snowpack_height_of_wind_value',{'The instrument height (or model layer height) for wind input data; note that height ',...
351 'is above ground for a standard SNOWPACK application but above surface (snow or ground) for Alpine3D applications '});
352 fielddisplay(obj,'snowpack_height_of_meteo_values',{'The instrument height (or model layer height) for meteorological input data except for wind,',...
353 'which may be at a different height; note that height is above ground for a standard SNOWPACK ',...
354 'application but above surface (snow or ground) for Alpine3D applications. '});
355 fielddisplay(obj,'snowpack_neutral',{'Select the atmospheric stability correction model:',...
356 '-1 use a simplified Richardson number stability correction',...
357 '0 assume standard Monin-Obukhov bulk formulation for surface exchange iteration with Paulson, Stearns and Weidner (can be used with BC_CHANGE=0)',...
358 '1 force Monin-Obukhov formulation to assume neutral conditions regardless of the actual stratification; it has been shown to work well in ',...
359 'complex terrain settings. It should be used with BC_CHANGE=1, i.e., Dirichlet /* but also is recommended with Neumann b.c., i.e., BC_CHANGE=0.'});
360 fielddisplay(obj,'snowpack_roughness_length',{'Aerodynamic roughness length as a parameter for the Monin-Obukhov bulk formulation;',...
361 'A typical value for complex terrain is 0.01 m and for snow covered flat sites 0.001 m. '});
362 fielddisplay(obj,'snowpack_number_slopes',{'Based on meteorological input from a (flat field) automatic station or numerical weather model,',...
363 'up to 8 expositions can be calculated in addition to the flat field if the corresponding *.sno files are provided. For example,',...
364 'if you provide a flat field *.snow file (mandatory), which is named KLO3.sno and you want 4 slopes to be calculated the corresponding',...
365 'slope files should be named KLO21.sno, ...,KLO24.sno '});
366 fielddisplay(obj,'snowpack_snow_redistribution',{'Specifies if redistribution of snow is allowed from (upwind) expositions to lee slopes.',...
367 'In case just the flat field is calculated, snow erosion is enabled but only for "ENFORCE_MEASURED_SNOW_HEIGHTS".'});
368 fielddisplay(obj,'snowpack_calculation_step_length',{'Internal time step (in minutes) used for model simulation. Please note that this MUST ',...
369 'be the same as HNW::accumulate (the latter being in seconds) if re-acumulating precipitation, otherwise it would lead to wrong results.'});
370 fielddisplay(obj,'snowpack_change_bc',{'Use measured surface temperature as Dirichlet temperature BC for sub-freezing snowpacks and switch to ',...
371 'Neumann only for melting snowpacks. If set to false, assumes Neumann boundary conditions.'});
372 fielddisplay(obj,'snowpack_thresh_change_bc','Threshold value (small number below freezing), which switches from Dirichlet to Neumann BCs if CHANGE_BC is selected');
373 fielddisplay(obj,'snowpack_snp_soil','Soil layers as defined by the *.sno files are included in the simulation');
374 fielddisplay(obj,'snowpack_soil_flux','Assume that the lower temperature boundary condition is given by GEO_HEAT (Neumann) and not by a measured temperature');
375 fielddisplay(obj,'snowpack_geo_heat','Constant geothermal heat flux at great) depth W m-2): Lower flux boundary condition for temperature equation if BC is Neumann');
376 fielddisplay(obj,'snowpack_canopy','Switch to tell the model that canopy is present (note that Canopy parameters should then be provided in the *.sno file)');
377 % }}}
378 disp(sprintf('\n %s','Snowpackadvanced parameters:')); % {{{
379 fielddisplay(obj,'snowpackadvanced_variant','variant selection (includes a choice of specific models, DEFAULT, ANTARCTICA and JAPAN )'); % use 320 kg m-3 for fixed density
380 fielddisplay(obj,'snowpackadvanced_hn_density',{'Fixed value to be used as new snow density if a constant density model is chosen, otherwise the choices are "PARAMETERIZED" "EVENT" "MEASURED"'});
381 % }}}
382 disp(sprintf('\n %s','General parameters:')); % {{{
383 fielddisplay(obj,'general_pluginpath','');
384 fielddisplay(obj,'general_buff_chunk_size','Size in days of a chunk of data to read at once.');
385 fielddisplay(obj,'general_buff_before','Alternate way of buffer centering: When rebuffering, the new date will be located BUFF_BEFORE days from the beginning of the buffer (therefore, it takes a value in days). ');
386 % }}}
387 disp(sprintf('\n %s','Input parameter:')); % {{{
388 fielddisplay(obj,'input_coordsys','coordinates in the Swiss Grid (http://geomatics.ladetto.ch/ch1903_wgs84_de.pdf). One of CH1903,UTM,UPS,PROJ4 or LOCAL');
389 fielddisplay(obj,'input_coordparam',' ');
390 fielddisplay(obj,'input_time_zone',' ');
391 fielddisplay(obj,'input_meteo','plugin for METEO data (one of BORMA,COSMO,GEOTOP,GRIB,GS,IMIS,SMET,SNOWPACK');
392 fielddisplay(obj,'input_meteopath','string containing the path to the xml files.');
393 fielddisplay(obj,'input_station1','Meteorology file for station number #');
394 fielddisplay(obj,'input_snowfile1','File name for the initial snow profile for station number #');
395 % }}}
396 disp(sprintf('\n %s','Output parameters:')); % {{{
397 fielddisplay(obj,'output_coordsys','Coordinates in the Swiss Grid http://geomatics.ladetto.ch/ch1903_wgs84_de.pdf. One of CH1903,UTM,UPS,PROJ4 or LOCAL ');
398 fielddisplay(obj,'output_coordparam','');
399 fielddisplay(obj,'output_time_zone','');
400 fielddisplay(obj,'output_meteopath','Path to the outputs (this path MUST exist, it won''t be created)');
401 fielddisplay(obj,'output_experiment','Option to give an additional simulation specific output name to the run in addition to "STATION_NAME"');
402 fielddisplay(obj,'output_ts_write','Write meteo data out? (0 or 1)');
403 fielddisplay(obj,'output_ts_start','When to start writing meteo data out (offset, in days)');
404 fielddisplay(obj,'output_ts_days_between','How often to write meteo data out (in days: 3 hours=.125, 1 hour=4.1666e-2)');
405 fielddisplay(obj,'output_profile','How to write the profiles (default: ASCII, choice is ASCII,IMIS or ASCII IMIS)');
406)');
407 fielddisplay(obj,'output_prof_write','Write profile data out? (0 or 1) ');
408 fielddisplay(obj,'output_prof_start','When to start writing profile data out (offset, in days)');
409 fielddisplay(obj,'output_prof_days_between','How often to write profile data out (in days: 3 hours=.125, 1 hour=4.1666e-2)');
410 % }}}
411 disp(sprintf('\n %s','Interpolations1d parameters:')); % {{{
412 fielddisplay(obj,'interpolations1d_window_size','Affects resampling: expresses (in seconds) how far a valid point can be searched for when re-interpolating a missing value');
413 fielddisplay(obj,'interpolations1d_hnw_resample','NONE, NEAREST_NEIGHBOUR, ACCUMULATE or LINEAR');
414 ');
415 fielddisplay(obj,'interpolations1d_hs_resample','Mean average processing. The mean average filter returns the mean value of all values within a user given time window. (NONE, NEAREST_NEIGHBOUR, ACCUMULATE or LINEAR)');
416 fielddisplay(obj,'interpolations1d_tsg_resample','Mean average processing. The mean average filter returns the mean value of all values within a user given time window.(NONE, NEAREST_NEIGHBOUR, ACCUMULATE or LINEAR)');
417 fielddisplay(obj,'interpolations1d_rho_hn_resample','(NONE, NEAREST_NEIGHBOUR, ACCUMULATE or LINEAR)');
418 fielddisplay(obj,'interpolations1d_vw_resample','(NONE, NEAREST_NEIGHBOUR, ACCUMULATE or LINEAR)');
419 fielddisplay(obj,'interpolations1d_vw_args','default nothing, otherwise, ''extrapolcate''');
420 % }}}
421 disp(sprintf('\n %s','Filters parameters:')); % {{{
422 fielddisplay(obj,'filters_ta_filter1',' ');
423 fielddisplay(obj,'filters_ta_arg1','');
424 fielddisplay(obj,'filters_rh_filter1',' ');
425 fielddisplay(obj,'filters_rh_arg1','');
426 fielddisplay(obj,'filters_rh_filter2',' ');
427 fielddisplay(obj,'filters_rh_arg2','');
428 fielddisplay(obj,'filters_iswr_filter1',' ');
429 fielddisplay(obj,'filters_iswr_arg1','');
430 fielddisplay(obj,'filters_iswr_filter2',' ');
431 fielddisplay(obj,'filters_iswr_arg2','');
432 fielddisplay(obj,'filters_rswr_filter1',' ');
433 fielddisplay(obj,'filters_rswr_arg1','');
434 fielddisplay(obj,'filters_rswr_filter2',' ');
435 fielddisplay(obj,'filters_rswr_arg2','');
436
437 %for ta between 190 and 280 k;
438 fielddisplay(obj,'filters_ilwr_filter1',' ');
439 fielddisplay(obj,'filters_ilwr_arg1','');
440 fielddisplay(obj,'filters_ilwr_filter2',' ');
441 fielddisplay(obj,'filters_ilwr_arg2','');
442 fielddisplay(obj,'filters_tss_filter1',' ');
443 fielddisplay(obj,'filters_tss_arg1','');
444 fielddisplay(obj,'filters_tsg_filter1',' ');
445 fielddisplay(obj,'filters_tsg_arg1','');
446 fielddisplay(obj,'filters_vw_filter1',' ');
447 fielddisplay(obj,'filters_vw_arg1','');
448 fielddisplay(obj,'filters_vw_filter2',' ');
449 fielddisplay(obj,'filters_vw_arg2','');
450 % }}}
451
452 end % }}}
453 function marshall(obj,md,fid) % {{{
454
455 yts=365.0*24.0*3600.0;
456
457 WriteData(fid,'object',obj,'class','snowpack','fieldname','spcvx','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1);
458 WriteData(fid,'object',obj,'class','snowpack','fieldname','spcvy','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1);
459 WriteData(fid,'object',obj,'class','snowpack','fieldname','spcvz','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1);
460 WriteData(fid,'object',obj,'class','snowpack','fieldname','restol','format','Double');
461 WriteData(fid,'object',obj,'class','snowpack','fieldname','reltol','format','Double');
462 WriteData(fid,'object',obj,'class','snowpack','fieldname','abstol','format','Double');
463 WriteData(fid,'object',obj,'class','snowpack','fieldname','isnewton','format','Integer');
464 WriteData(fid,'object',obj,'class','snowpack','fieldname','FSreconditioning','format','Double');
465 WriteData(fid,'object',obj,'class','snowpack','fieldname','viscosity_overshoot','format','Double');
466 WriteData(fid,'object',obj,'class','snowpack','fieldname','maxiter','format','Integer');
467 WriteData(fid,'object',obj,'class','snowpack','fieldname','shelf_dampening','format','Integer');
468 WriteData(fid,'object',obj,'class','snowpack','fieldname','vertex_pairing','format','DoubleMat','mattype',3);
469 WriteData(fid,'object',obj,'class','snowpack','fieldname','penalty_factor','format','Double');
470 WriteData(fid,'object',obj,'class','snowpack','fieldname','rift_penalty_lock','format','Integer');
471 WriteData(fid,'object',obj,'class','snowpack','fieldname','rift_penalty_threshold','format','Integer');
472 WriteData(fid,'object',obj,'class','snowpack','fieldname','referential','format','DoubleMat','mattype',1);
473 WriteData(fid,'object',obj,'class','snowpack','fieldname','requested_outputs','format','DoubleMat','mattype',3);
474 WriteData(fid,'data',obj.loadingforce(:,1),'format','DoubleMat','mattype',1,'enum',LoadingforceXEnum);
475 WriteData(fid,'data',obj.loadingforce(:,2),'format','DoubleMat','mattype',1,'enum',LoadingforceYEnum);
476 WriteData(fid,'data',obj.loadingforce(:,3),'format','DoubleMat','mattype',1,'enum',LoadingforceZEnum);
477 end % }}}
478 end
479end
Note: See TracBrowser for help on using the repository browser.