diff --git a/code/climada_tc_hazard_set.m b/code/climada_tc_hazard_set.m index e56bdea..a62dc37 100644 --- a/code/climada_tc_hazard_set.m +++ b/code/climada_tc_hazard_set.m @@ -174,15 +174,21 @@ % allocate the hazard array (sparse, to manage memory) hazard.intensity = spalloc(hazard.event_count,length(hazard.lon),... - ceil(hazard.event_count*length(hazard.lon)*hazard_arr_density)); + ceil(hazard.event_count*length(hazard.lon)*hazard_arr_density)); t0 = clock; n_tracks = length(tc_track); msgstr = sprintf('processing %i tracks',n_tracks); -fprintf('%s (updating waitbar with estimation of time remaining every 100th track)\n',msgstr); -h = waitbar(0,msgstr); -set(h,'Name','Hazard TC: tropical cyclones wind'); -mod_step = 10; % first time estimate after 10 tracks, then every 100 +if climada_global.waitbar + fprintf('%s (updating waitbar with estimation of time remaining every 100th track)\n',msgstr); + h = waitbar(0,msgstr); + set(h,'Name','Hazard TC: tropical cyclones wind'); + mod_step = 10; % first time estimate after 10 tracks, then every 100 +else + fprintf('%s (waitbar suppressed)\n',msgstr); + mod_step=n_tracks+10; +end + for track_i=1:n_tracks % calculate wind for every centroids, equal timestep within this routine @@ -221,7 +227,7 @@ end end %track_i -close(h); % dispose waitbar +if exist('h','var'),close(h);end % dispose waitbar t_elapsed = etime(clock,t0); msgstr = sprintf('generating %i windfields took %3.2f min (%3.2f sec/event)',length(tc_track),t_elapsed/60,t_elapsed/length(tc_track));