[Dart-dev] DART/branches Revision: 11117
dart at ucar.edu
dart at ucar.edu
Thu Feb 16 09:53:56 MST 2017
thoar at ucar.edu
2017-02-16 09:53:52 -0700 (Thu, 16 Feb 2017)
69
The forced_lorenz_96 model now has state-space diagnostics support.
Modified: DART/branches/rma_trunk/matlab/CheckModel.m
===================================================================
--- DART/branches/rma_trunk/matlab/CheckModel.m 2017-02-15 23:17:17 UTC (rev 11116)
+++ DART/branches/rma_trunk/matlab/CheckModel.m 2017-02-16 16:53:52 UTC (rev 11117)
@@ -86,13 +86,13 @@
% This model has the state variables replicated, so there is a difference
% between num_state_vars and the length of the state variable.
- forcing = nc_attget(fname, nc_global, 'model_forcing');
- delta_t = nc_attget(fname, nc_global, 'model_delta_t');
- time_step_days = nc_attget(fname, nc_global, 'model_time_step_days');
- time_step_seconds = nc_attget(fname, nc_global, 'model_time_step_seconds');
- num_model_vars = nc_attget(fname, nc_global, 'model_num_state_vars');
+ forcing = ncreadatt(fname, '/', 'model_forcing');
+ delta_t = ncreadatt(fname, '/', 'model_delta_t');
+ time_step_days = ncreadatt(fname, '/', 'model_time_step_days');
+ time_step_seconds = ncreadatt(fname, '/', 'model_time_step_seconds');
+ num_model_vars = ncreadatt(fname, '/', 'model_num_state_vars');
- num_vars = dim_length(fname,'StateVariable'); % determine # of state varbls
+ num_vars = dim_length(fname,'location'); % determine # of state varbls
% The only trick is to pick an equally-spaced subset of state
% variables for the default.
Modified: DART/branches/rma_trunk/matlab/PlotEnsMeanTimeSeries.m
===================================================================
--- DART/branches/rma_trunk/matlab/PlotEnsMeanTimeSeries.m 2017-02-15 23:17:17 UTC (rev 11116)
+++ DART/branches/rma_trunk/matlab/PlotEnsMeanTimeSeries.m 2017-02-16 16:53:52 UTC (rev 11117)
@@ -108,7 +108,7 @@
ens_mean = get_hyperslab('fname',pinfo.diagn_file,'varname','state_mean', ...
'stateindex',ivar,'tindex1',pinfo.diagn_time(1),'tcount',pinfo.diagn_time(2));
plot(pinfo.time, ens_mean, 'r');
- legend('Ensemble Mean',0);
+ legend(sprintf('Ensemble Mean %f',mean(ens_mean)),0)
if ( have_truth )
truth = get_hyperslab('fname',pinfo.truth_file, 'varname','state', ...
@@ -115,7 +115,8 @@
'stateindex',ivar, 'squeeze','true', ...
'tindex1',pinfo.truth_time(1), 'tcount',pinfo.truth_time(2));
hold on; plot(pinfo.time,truth,'b'); hold off;
- legend('Ensemble Mean','True State',0);
+ legend(sprintf('Ensemble Mean %f',mean(ens_mean)),...
+ sprintf('True State %f',mean(truth)),0)
end
s1 = sprintf('%s Variable %d',pinfo.model,ivar);
@@ -158,7 +159,7 @@
'varname', 'state_mean', 'stateindex',ivar, ...
'tindex1',pinfo.diagn_time(1), 'tcount',pinfo.diagn_time(2));
plot(pinfo.time, ens_mean, 'r')
- legend('Ensemble Mean',0)
+ legend(sprintf('Ensemble Mean %f',mean(ens_mean)),0)
% Get the truth for this variable
if (have_truth)
@@ -166,7 +167,8 @@
'varname','state', 'stateindex',ivar, 'squeeze', 'true', ...
'tindex1',pinfo.truth_time(1), 'tcount',pinfo.truth_time(2));
hold on; plot(pinfo.time,truth,'b'); hold off;
- legend('Ensemble Mean','True State',0)
+ legend(sprintf('Ensemble Mean %f',mean(ens_mean)),...
+ sprintf('True State %f',mean(truth)),0)
end
s1 = sprintf('%s Variable %d',pinfo.model,ivar);
title({s1,pinfo.diagn_file},'interpreter','none','fontweight','bold')
Modified: DART/branches/rma_trunk/matlab/PlotTotalErr.m
===================================================================
--- DART/branches/rma_trunk/matlab/PlotTotalErr.m 2017-02-15 23:17:17 UTC (rev 11116)
+++ DART/branches/rma_trunk/matlab/PlotTotalErr.m 2017-02-16 16:53:52 UTC (rev 11117)
@@ -124,29 +124,25 @@
ylabel('Total Error')
case 'forced_lorenz_96'
- error('not supported yet')
%% This model has the state variables replicated, so there is a difference
% between num_state_vars and the length of the state variable.
- %forcing = nc_attget(pinfo.truth_file, nc_global, 'model_forcing');
- %delta_t = nc_attget(pinfo.truth_file, nc_global, 'model_delta_t');
- %time_step_days = nc_attget(pinfo.truth_file, nc_global, 'model_time_step_days');
- %time_step_seconds = nc_attget(pinfo.truth_file, nc_global, 'model_time_step_seconds');
- num_model_vars = nc_attget(pinfo.truth_file, nc_global, 'model_num_state_vars');
+ num_model_vars = ncreadatt(pinfo.truth_file, '/', 'model_num_state_vars');
+
% Get the appropriate netcdf variables
Whole_truth = get_hyperslab('fname',pinfo.truth_file, ...
- 'varname','state', 'copyindex',truth_index, ...
+ 'varname','state', 'permute','T','squeeze','T', ...
'tindex1',pinfo.truth_time(1), 'tcount',pinfo.truth_time(2));
Whole_ens = get_hyperslab('fname',pinfo.diagn_file, ...
- 'varname','state', 'copyindex',ens_mean_index, ...
+ 'varname','state_mean', 'permute','T', ...
'tindex1',pinfo.diagn_time(1), 'tcount',pinfo.diagn_time(2));
Whole_spread = get_hyperslab('fname',pinfo.diagn_file, ...
- 'varname','state', 'copyindex',ens_spread_index, ...
+ 'varname','state_sd', 'permute','T', ...
More information about the Dart-dev
mailing list