[Dart-dev] DART/branches Revision: 11649

dart at ucar.edu dart at ucar.edu
Sun May 21 20:20:31 MDT 2017


thoar at ucar.edu
2017-05-21 20:20:30 -0600 (Sun, 21 May 2017)
504
These functions use whatever filename is specified by 'diagn_file' as
the default file name to use when prompting. Whatever you specify at
the prompt is used, but does not affect the setting of 'diagn_file'.

You can specify the true state via  the 'truth_file' variable,
which has a default value of 'true_state.nc'.  This is not prompted for,
by design.

There was an error in CheckModelCompatibility in that the model name
in each of the files came from the same file - so they always matched. Oops.




Modified: DART/branches/rma_trunk/diagnostics/matlab/plot_bins.m
===================================================================
--- DART/branches/rma_trunk/diagnostics/matlab/plot_bins.m	2017-05-22 02:13:02 UTC (rev 11648)
+++ DART/branches/rma_trunk/diagnostics/matlab/plot_bins.m	2017-05-22 02:20:30 UTC (rev 11649)
@@ -1,4 +1,4 @@
-function plot_bins(diagn_file)
+function plot_bins(input_file)
 %% DART:plot_bins Plots ensemble rank histograms
 %
 % plot_bins    interactively queries for the information needed to create
@@ -6,23 +6,36 @@
 %              need different pieces of information ... the model types are
 %              determined and additional user input may be queried.
 %
-% The true state ('true_state.nc') is REQUIRED.
+% The true state file is REQUIRED and is specified by the variable 'truth_file'.
 %
 % A reminder of the sequence:
 % truth  run (from    pmo):
-%           perfect_input  --->  true_state.nc   REQUIRED
+%           perfect_input.nc --->     true_state.nc     ---> perfect_output.nc
+%           [single timestep]      [multiple timesteps]      [single timestep]
+%
 % filter run (from filter):
-%           filter_input.nc  --->  [prior inflation]  --->
-%                 preassim.nc   --->  [assimilation]  --->
-%                       postassim.nc  ---> [posterior inflation]  --->
-%                             filter_output.nc
+%           filter_input.nc  --->
+%               forecast.nc      ---> [prior inflation] --->
+%               ^     preassim.nc     ---> [assimilation] --->
+%               ^          postassim.nc    ---> [posterior inflation] --->
+%               ^<<<<<<<<<<<<<<< analysis.nc   --->
+%                                      filter_output.nc
 %
-% Example 1  (Prompt for filter output filename. Default is 'preassim.nc')
+% Example 1:  Prompt for filter output filename. Default is defined in 'diagn_file' variable.
+%             The true state filename always comes from the 'truth_file' variable.
 % plot_bins
 %
-% Example 2
-% diagn_file = 'preassim.nc';
-% plot_bins(diagn_file)
+% Example 2:  Prompt, but use name specified in 'diagn_file'.
+% diagn_file = 'analysis.nc';
+% plot_bins
+%
+% Example 3:  Prompt with 'diagn_file', different true state.
+% diagn_file = 'analysis.nc';
+% truth_file = 'More_True_State.nc';
+% plot_bins
+%
+% Example 4: No prompting, true state filename comes from 'truth_file' variable.
+% plot_bins('output.nc')
 
 %% DART software - Copyright UCAR. This open source software is provided
 % by UCAR, "as is", without charge, subject to all terms of use at
@@ -30,15 +43,14 @@
 %
 % DART $Id$
 
-% error_checking ...
-% exist('bob') == 1   means the variable exists.
-%                     the value of the variable is checked later.
+[truth_file, diagn_file] = set_default_files();
 
 if (nargin == 0)
+    mystring = sprintf('<cr> for %s\n',diagn_file);
     disp('Input name of ensemble trajectory file:')
-    diagn_file = input('<cr> for preassim.nc\n','s');
-    if isempty(diagn_file)
-        diagn_file = 'preassim.nc';
+    input_file = input(mystring,'s');
+    if isempty(input_file)
+        input_file = diagn_file;
     end
 elseif (nargin == 1)
     % all good - nothing to do
@@ -46,14 +58,12 @@
     error('Must supply exactly one filename or none.')
 end
 
-truth_file = 'true_state.nc';
-
 if ( exist(truth_file,'file') ~= 2 ), error('%s does not exist.',truth_file); end
-if ( exist(diagn_file,'file') ~= 2 ), error('%s does not exist.',diagn_file); end
+if ( exist(input_file,'file') ~= 2 ), error('%s does not exist.',input_file); end
 
-vars  = CheckModel(diagn_file);   % also gets default values for this model.
+vars  = CheckModel(input_file);   % also gets default values for this model.
 vars  = rmfield(vars,{'time_series_length','time','fname'});
-pinfo = CheckModelCompatibility(truth_file,diagn_file);
+pinfo = CheckModelCompatibility(truth_file,input_file);
 pinfo = CombineStructs(pinfo,vars);
 clear vars
 
@@ -69,39 +79,39 @@
 
    case {'fms_bgrid'}
 
-      pinfo = GetBgridInfo(pinfo, diagn_file, 'PlotBins');


More information about the Dart-dev mailing list