[Dart-dev] [6198] DART/branches/development: Extended GetNCindices. m to be able to read more coordinate dimensions,
nancy at ucar.edu
nancy at ucar.edu
Thu May 30 10:45:13 MDT 2013
Revision: 6198
Author: thoar
Date: 2013-05-30 10:45:12 -0600 (Thu, 30 May 2013)
Log Message:
-----------
Extended GetNCindices.m to be able to read more coordinate dimensions,
specifically those used in obs_diag_output.nc.
Compare_netCDF_files is entirely new and will print a summary of the min
and max differences of every numeric variable (regardless of shape) for a
single netCDF file or the difference between a pair of netCDF files.
The CESM_hop_check.m function codifies what we did to ensure the CESM
hop test went well. Hopefully this can be a guide to others.
CompareObsDiag.m is almost like Compare_netCDF_files expect that it
allows one to specify a hyperslab to compare. I had two versions of
obs_diag.f90 that created variables with different numbers of 'copies'
that I needed to compare.
Modified Paths:
--------------
DART/branches/development/matlab/GetNCindices.m
Added Paths:
-----------
DART/branches/development/matlab/CompareObsDiag.m
DART/branches/development/matlab/Compare_netCDF_files.m
DART/branches/development/models/CESM/matlab/CESM_hop_check.m
-------------- next part --------------
Added: DART/branches/development/matlab/CompareObsDiag.m
===================================================================
--- DART/branches/development/matlab/CompareObsDiag.m (rev 0)
+++ DART/branches/development/matlab/CompareObsDiag.m 2013-05-30 16:45:12 UTC (rev 6198)
@@ -0,0 +1,129 @@
+function CompareObsDiag(file1,file2)
+%% CompareObsDiag checks to see if two obs_diag netcdf files are identical.
+%
+% CompareObsDiag will subtract each numeric variable and print a
+% summary of the min/max differences for each variable.
+% If there are a different number of 'copies', for example, you can
+% specify which copies to compare in the call to get_hyperslab().
+% At present, this is a manual edit within this file.
+% This file is largely similar to Compare_netCDF_files.m but explicitly
+% checks only the FIRST 21 copies and uses a snctools get_var instead
+% of the native Matlab netcdf.getVar().
+%
+% $Id$
+%
+% Example:
+%
+% file1 = 'obs_diag_output.nc';
+% file2 = 'obs_diag_output_proposed.nc';
+% CompareObsDiag(file1,file2)
+
+%% DART software - Copyright 2004 - 2011 UCAR. This open source software is
+% provided by UCAR, "as is", without charge, subject to all terms of use at
+% http://www.image.ucar.edu/DAReS/DART/DART_download
+%
+% <next few lines under version control, do not edit>
+% $URL$
+% $Id$
+% $Revision$
+% $Date$
+
+fid = fopen('CompareObsDiag_results.txt','a+');
+fprintf(fid,'\n---\n');
+fprintf(fid,'%s\n',datestr(now));
+
+fprintf(fid,'Comparing %s\n',file1);
+fprintf(fid,'with %s\n',file2);
+CompareTwoFiles(file1,file2,fid)
+
+fclose(fid);
+
+%%---------------------------------------------------------------------
+% Display min and max of the difference of two numeric variables
+% from two separate files.
+%----------------------------------------------------------------------
+
+function CompareTwoFiles(file1, file2, fid)
+
+if (exist(file1,'file') ~= 2), error('%s does not exist.',file1); end
+if (exist(file2,'file') ~= 2), error('%s does not exist.',file2); end
+
+f1info = ncinfo(file1);
+nvariables = length(f1info.Variables);
+ncid1 = netcdf.open(file1,'NC_NOWRITE');
+ncid2 = netcdf.open(file2,'NC_NOWRITE');
+
+% Loop over all the variables in the first file ... the variables
+% can be in any order in either file. I do not check to see if
+% there are variables present in the second file that are not in
+% the first file.
+
+for ivar = 1:nvariables
+
+ varid1 = ivar-1; % Because netCDF tools use C-like indices.
+
+ [varname1, xtype1, ~, numatts1] = netcdf.inqVar( ncid1,varid1);
+ varid2 = netcdf.inqVarID(ncid2,varname1);
+ [varname2, xtype2, ~, numatts2] = netcdf.inqVar( ncid2,varid2);
+
+ FillValue1 = has_att(ncid1, varid1, numatts1, '_FillValue');
+ FillValue2 = has_att(ncid2, varid2, numatts2, '_FillValue');
+
+ switch (f1info.Variables(ivar).Datatype)
+ case {'char','character'}
+ fprintf(fid,'%32s is a %s variable.\n',varname1,f1info.Variables(ivar).Datatype);
+ fprintf( '%32s is a %s variable.\n',varname1,f1info.Variables(ivar).Datatype);
+ otherwise
+
+ bob = get_hyperslab('fname',file1,'varname',varname1,'copy1',1,'copycount',21);
+ data1 = bob(:);
+ bob = get_hyperslab('fname',file2,'varname',varname1,'copy1',1,'copycount',21);
+ data2 = bob(:);
+
+ bob = data1 - data2;
+ datamin = min(bob);
+ datamax = max(bob);
+
+ fprintf(fid,'%32s has min/max differences of %g %g\n',varname1,datamin,datamax);
+ if ((datamin ~= 0.0) && (datamax ~= 0.0))
+ fprintf('%32s has min/max differences of %g %g\n',varname1,datamin,datamax);
+ end
+ end
+
+end
+
+netcdf.close(ncid1)
+netcdf.close(ncid2)
+
+%%---------------------------------------------------------------------
+% helper functions
+%----------------------------------------------------------------------
+
+function data = has_att(ncid,varid,numatts,attstring)
+
+data = [];
+
+for iatt = 1:numatts
+ attid = iatt - 1;
+ attname = netcdf.inqAttName(ncid, varid, attid);
+
+ switch( attname )
+ case (attstring)
+ data = netcdf.getAtt(ncid, varid, attstring);
+ otherwise
+ end
+end
+
+function data = my_getVar(ncid,varid,FillValue,start,count)
+
+data = netcdf.getVar(ncid, varid, start, count);
+if ( ~ isempty(FillValue) )
+ data(data == FillValue) = NaN;
+end
+
+% <next few lines under version control, do not edit>
+% $URL$
+% $Id$
+% $Revision$
+% $Date$
+
Property changes on: DART/branches/development/matlab/CompareObsDiag.m
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:keywords
+ Date Rev Author HeadURL Id
Added: svn:eol-style
+ native
Added: DART/branches/development/matlab/Compare_netCDF_files.m
===================================================================
--- DART/branches/development/matlab/Compare_netCDF_files.m (rev 0)
+++ DART/branches/development/matlab/Compare_netCDF_files.m 2013-05-30 16:45:12 UTC (rev 6198)
@@ -0,0 +1,168 @@
+function Compare_netCDF_files(file1,file2)
+%% Compare_netCDF_files checks to see if two netcdf files are identical. An output text
+% file of the summary of the min/max differences for each variable is produced.
+%
+% If called with a single argument, Compare_netCDF_files will print a summary of the min
+% and max of every numeric variable in the file. If the file was the result
+% of an 'ncdiff', for example, these should all be zero.
+%
+% If called with two arguments, Compare_netCDF_files will subtract each numeric variable
+% and print a summary of the min/max differences for each variable.
+%
+% $Id$
+%
+% Example:
+%
+% file1 = '/glade/scratch/thoar/clm_2day1hop/run/clm_2day1hop.clm2_0004.r.2000-02-02-00000.nc';
+% file2 = '/glade/scratch/thoar/clm_2day2hop/run/clm_2day2hop.clm2_0004.r.2000-02-02-00000.nc';
+% Compare_netCDF_files(file1,file2)
+
+%% DART software - Copyright 2004 - 2011 UCAR. This open source software is
+% provided by UCAR, "as is", without charge, subject to all terms of use at
+% http://www.image.ucar.edu/DAReS/DART/DART_download
+
+fid = fopen('Compare_netCDF_files_results.txt','a+');
+fprintf(fid,'\n---\n');
+fprintf(fid,'%s\n',datestr(now));
+
+if (nargin == 1)
+ fprintf(fid,'Checking single file %s\n',file1);
+ CheckSingleFile(file1,fid)
+elseif(nargin == 2)
+ fprintf(fid,'Comparing %s\n',file1);
+ fprintf(fid,'with %s\n',file2);
+ CompareTwoFiles(file1,file2,fid)
+else
+ error('wrong number of arguments')
+end
+
+fclose(fid);
+
+%%---------------------------------------------------------------------
+% Display min and max of all the numeric variables in a single file.
+%----------------------------------------------------------------------
+
+function CheckSingleFile(file1,fid)
+
+if (exist(file1,'file') ~= 2), error('%s does not exist.',file1); end
+
+f1info = ncinfo(file1);
+nvariables = length(f1info.Variables);
+ncid1 = netcdf.open(file1,'NC_NOWRITE');
+
+for ivar = 1:nvariables
+
+ varid = ivar-1; % Because netCDF tools use C-like indices.
+
+ [varname, ~, ~, numatts] = netcdf.inqVar(ncid1,varid);
+ FillValue = has_att(ncid1, varid, numatts, '_FillValue');
+
+ switch (f1info.Variables(ivar).Datatype)
+ case {'char','character'}
+ fprintf(fid,'%32s is a %s variable.\n',varname,f1info.Variables(ivar).Datatype);
+ fprintf( '%32s is a %s variable.\n',varname,f1info.Variables(ivar).Datatype);
+ otherwise
+ data = my_getVar(ncid1, varid, FillValue);
+ bob = data(:);
+ datamin = min(bob);
+ datamax = max(bob);
+ fprintf(fid,'%32s has min/max differences of %g %g\n',varname,datamin,datamax);
+ if ((datamin ~= 0.0) && (datamax ~= 0.0))
+ fprintf('%32s has min/max differences of %g %g\n',varname,datamin,datamax);
+ end
+ end
+end
+
+netcdf.close(ncid1)
+
+%%---------------------------------------------------------------------
+% Display min and max of the difference of two numeric variables
+% from two separate files.
+%----------------------------------------------------------------------
+
+function CompareTwoFiles(file1, file2, fid)
+
+if (exist(file1,'file') ~= 2), error('%s does not exist.',file1); end
+if (exist(file2,'file') ~= 2), error('%s does not exist.',file2); end
+
+f1info = ncinfo(file1);
+nvariables = length(f1info.Variables);
+ncid1 = netcdf.open(file1,'NC_NOWRITE');
+ncid2 = netcdf.open(file2,'NC_NOWRITE');
+
+% logic not great ... could grab the variable name from one file
+% search the second file for that variable name. Right now the variables
+% must be in the same order in both files ...
+
+for ivar = 1:nvariables
+
+ varid1 = ivar-1; % Because netCDF tools use C-like indices.
+
+ [varname1, ~, ~, numatts1] = netcdf.inqVar(ncid1,varid1);
+ varid2 = netcdf.inqVarID(ncid2,varname1);
+ [varname2, ~, ~, numatts2] = netcdf.inqVar(ncid2,varid2);
+ FillValue1 = has_att(ncid1, varid1, numatts1, '_FillValue');
+ FillValue2 = has_att(ncid2, varid2, numatts2, '_FillValue');
+
+ switch (f1info.Variables(ivar).Datatype)
+ case {'char','character'}
+ fprintf(fid,'%32s is a %s variable.\n',varname1,f1info.Variables(ivar).Datatype);
+ fprintf( '%32s is a %s variable.\n',varname1,f1info.Variables(ivar).Datatype);
+ otherwise
+ bob = my_getVar(ncid1, varid1, FillValue1);
+ data1 = bob(:);
+ bob = my_getVar(ncid2, varid2, FillValue2);
+ data2 = bob(:);
+
+ if(numel(data1) ~= numel(data2))
+ error('%32s has different number of elements %d and %d.\n', ...
+ varname1,numel(data1),numel(data2));
+ end
+
+ bob = data1 - data2;
+ datamin = min(bob);
+ datamax = max(bob);
+
+ fprintf(fid,'%32s has min/max differences of %g %g\n',varname1,datamin,datamax);
+ if ((datamin ~= 0.0) && (datamax ~= 0.0))
+ fprintf('%32s has min/max differences of %g %g\n',varname1,datamin,datamax);
+ end
+ end
+
+end
+
+netcdf.close(ncid1)
+netcdf.close(ncid2)
+
+%%---------------------------------------------------------------------
+% helper functions
+%----------------------------------------------------------------------
+
+function data = has_att(ncid,varid,numatts,attstring)
+
+data = [];
+
+for iatt = 1:numatts
+ attid = iatt - 1;
+ attname = netcdf.inqAttName(ncid, varid, attid);
+
+ switch( attname )
+ case (attstring)
+ data = netcdf.getAtt(ncid, varid, attstring);
+ otherwise
+ end
+end
+
+function data = my_getVar(ncid,varid,FillValue)
+
+data = netcdf.getVar(ncid, varid);
+if ( ~ isempty(FillValue) )
+ data(data == FillValue) = NaN;
+end
+
+% <next few lines under version control, do not edit>
+% $URL$
+% $Id$
+% $Revision$
+% $Date$
+
Property changes on: DART/branches/development/matlab/Compare_netCDF_files.m
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:keywords
+ Date Rev Author HeadURL Id
Added: svn:eol-style
+ native
Modified: DART/branches/development/matlab/GetNCindices.m
===================================================================
--- DART/branches/development/matlab/GetNCindices.m 2013-05-30 00:22:50 UTC (rev 6197)
+++ DART/branches/development/matlab/GetNCindices.m 2013-05-30 16:45:12 UTC (rev 6198)
@@ -19,6 +19,9 @@
% pinfo.cellindex
% pinfo.columnindex
% pinfo.pftindex
+% pinfo.rankbinindex
+% pinfo.boundsindex
+% pinfo.obstypesindex
%
% whichfile is a character string specifying which
% filename component of 'pinfo' will be used.
@@ -60,19 +63,22 @@
if ( exist(fname,'file') ~= 2 ), error('%s does not exist.',fname); end
-% If the structure has subsetting information, use it.
+% If the structure has subsetting information, we will ultimately use it.
% Otherwise, use the whole extent.
-lat1 = 0; latN = -1;
-lon1 = 0; lonN = -1;
-time1 = 0; timeN = -1;
-copy1 = 0; copyN = -1;
-level1 = 0; levelN = -1;
-state1 = 0; stateN = -1;
-region1 = 0; regionN = -1;
-cell1 = 0; cellN = -1;
-column1 = 0; columnN = -1;
-pft1 = 0; pftN = -1;
+lat1 = 0; latN = -1;
+lon1 = 0; lonN = -1;
+time1 = 0; timeN = -1;
+copy1 = 0; copyN = -1;
+level1 = 0; levelN = -1;
+state1 = 0; stateN = -1;
+region1 = 0; regionN = -1;
+cell1 = 0; cellN = -1;
+column1 = 0; columnN = -1;
+pft1 = 0; pftN = -1;
+rankbin1 = 0; rankbinN = -1;
+bounds1 = 0; boundsN = -1;
+obstypes1 = 0; obstypesN = -1;
if (isfield(pinfo,'timeindex'))
time1 = pinfo.timeindex - 1;
@@ -184,6 +190,39 @@
pftN = pinfo.pftcount;
end
+if (isfield( pinfo,'rankbinindex'))
+ rankbin1 = pinfo.rankbinindex - 1;
+ rankbinN = 1;
+end
+if (isfield( pinfo,'rankbin1'))
+ rankbin1 = pinfo.rankbin1 - 1;
+end
+if (isfield( pinfo,'rankbincount'))
+ rankbinN = pinfo.rankbincount;
+end
+
+if (isfield( pinfo,'boundsindex'))
+ bounds1 = pinfo.boundsindex - 1;
+ boundsN = 1;
+end
+if (isfield( pinfo,'bounds1'))
+ bounds1 = pinfo.bounds1 - 1;
+end
+if (isfield( pinfo,'boundscount'))
+ boundsN = pinfo.boundscount;
+end
+
+if (isfield( pinfo,'obstypesindex'))
+ obstypes1 = pinfo.obstypesindex - 1;
+ obstypesN = 1;
+end
+if (isfield( pinfo,'obstypes1'))
+ obstypes1 = pinfo.obstypes1 - 1;
+end
+if (isfield( pinfo,'obstypescount'))
+ obstypesN = pinfo.obstypescount;
+end
+
% Determine shape of variable in question.
varinfo = nc_getvarinfo(fname,varname);
@@ -252,6 +291,15 @@
case 'colu'
start(i) = column1;
count(i) = columnN;
+ case 'rank'
+ start(i) = rankbin1;
+ count(i) = rankbinN;
+ case 'boun'
+ start(i) = bounds1;
+ count(i) = boundsN;
+ case 'obst'
+ start(i) = obstypes1;
+ count(i) = obstypesN;
otherwise
fprintf('GetNCindices encountered unknown coordinate variable %s\n',dimname)
end
Added: DART/branches/development/models/CESM/matlab/CESM_hop_check.m
===================================================================
--- DART/branches/development/models/CESM/matlab/CESM_hop_check.m (rev 0)
+++ DART/branches/development/models/CESM/matlab/CESM_hop_check.m 2013-05-30 16:45:12 UTC (rev 6198)
@@ -0,0 +1,471 @@
+function CESM_hop_check(testname)
+%% CESM_hop_check quantifies the difference between two runs of a model.
+% The complete filenames are contained within this script. YOU MUST EDIT THEM.
+%
+
+%% DART software - Copyright 2004 - 2011 UCAR. This open source software is
+% provided by UCAR, "as is", without charge, subject to all terms of use at
+% http://www.image.ucar.edu/DAReS/DART/DART_download
+
+switch ( testname )
+
+ case 'rof_test' % RESULT:
+
+ file1 = '/glade/scratch/thoar/cesm_startup/run/cesm_startup.cam_0002.i.2004-01-04-00000.nc';
+ file2 = '/glade/scratch/thoar/cesm_hybrid0/run/cesm_hybrid0.cam_0002.i.2004-01-04-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/cesm_startup/run/cesm_startup.pop_0002.r.2004-01-04-00000.nc';
+ file2 = '/glade/scratch/thoar/cesm_hybrid0/run/cesm_hybrid0.pop_0002.r.2004-01-04-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/cesm_startup/run/cesm_startup.clm2_0002.r.2004-01-04-00000.nc';
+ file2 = '/glade/scratch/thoar/cesm_hybrid0/run/cesm_hybrid0.clm2_0002.r.2004-01-04-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/cesm_startup/run/cesm_startup.cice_0002.r.2004-01-04-00000.nc';
+ file2 = '/glade/scratch/thoar/cesm_hybrid0/run/cesm_hybrid0.cice_0002.r.2004-01-04-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/cesm_startup/run/cesm_startup.rtm_0002.r.2004-01-04-00000.nc';
+ file2 = '/glade/scratch/thoar/cesm_hybrid0/run/cesm_hybrid0.rtm_0002.r.2004-01-04-00000.nc';
+ Compare_netCDF_files(file1,file2)
+
+ case 'clm_vanilla' % RESULT: mlaidiff differs
+
+ file1 = '/glade/scratch/thoar/clm_hop_test/2day1hop/clm_hop_test.clm2_0001.r.2000-02-02-00000.nc';
+ file2 = '/glade/scratch/thoar/clm_hop_test/2day2hop/clm_hop_test.clm2_0001.r.2000-02-02-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/clm_hop_test/2day1hop/clm_hop_test.clm2_0002.r.2000-02-02-00000.nc';
+ file2 = '/glade/scratch/thoar/clm_hop_test/2day2hop/clm_hop_test.clm2_0002.r.2000-02-02-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/clm_hop_test/2day1hop/clm_hop_test.clm2_0003.r.2000-02-02-00000.nc';
+ file2 = '/glade/scratch/thoar/clm_hop_test/2day2hop/clm_hop_test.clm2_0003.r.2000-02-02-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/clm_hop_test/2day1hop/clm_hop_test.clm2_0004.r.2000-02-02-00000.nc';
+ file2 = '/glade/scratch/thoar/clm_hop_test/2day2hop/clm_hop_test.clm2_0004.r.2000-02-02-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/clm_hop_test/2day1hop/clm_hop_test.cpl.r.2000-02-02-00000.nc';
+ file2 = '/glade/scratch/thoar/clm_hop_test/2day2hop/clm_hop_test.cpl.r.2000-02-02-00000.nc';
+ Compare_netCDF_files(file1,file2)
+
+ case 'clm_sourcemods' % RESULT: mlaidiff differs
+
+ file1 = '/glade/scratch/thoar/clm_test/2day1hop_sourcemods/clm_test.clm2_0001.r.2000-02-02-00000.nc';
+ file2 = '/glade/scratch/thoar/clm_test/2day2hop_sourcemods/clm_test.clm2_0001.r.2000-02-02-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/clm_test/2day1hop_sourcemods/clm_test.clm2_0002.r.2000-02-02-00000.nc';
+ file2 = '/glade/scratch/thoar/clm_test/2day2hop_sourcemods/clm_test.clm2_0002.r.2000-02-02-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/clm_test/2day1hop_sourcemods/clm_test.clm2_0003.r.2000-02-02-00000.nc';
+ file2 = '/glade/scratch/thoar/clm_test/2day2hop_sourcemods/clm_test.clm2_0003.r.2000-02-02-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/clm_test/2day1hop_sourcemods/clm_test.clm2_0004.r.2000-02-02-00000.nc';
+ file2 = '/glade/scratch/thoar/clm_test/2day2hop_sourcemods/clm_test.clm2_0004.r.2000-02-02-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/clm_test/2day1hop_sourcemods/clm_test.cpl.r.2000-02-02-00000.nc';
+ file2 = '/glade/scratch/thoar/clm_test/2day2hop_sourcemods/clm_test.cpl.r.2000-02-02-00000.nc';
+ Compare_netCDF_files(file1,file2)
+
+ case 'clm_overkill' % RESULT: mlaidiff and pfts1d_ci differ
+
+ file1 = '/glade/scratch/thoar/clm_hop_test/2day1hop/clm_hop_test.clm2_0001.r.2000-02-02-00000.nc';
+ file2 = '/glade/scratch/thoar/clm_test/2day1hop_sourcemods/clm_test.clm2_0001.r.2000-02-02-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/clm_hop_test/2day1hop/clm_hop_test.clm2_0002.r.2000-02-02-00000.nc';
+ file2 = '/glade/scratch/thoar/clm_test/2day1hop_sourcemods/clm_test.clm2_0002.r.2000-02-02-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/clm_hop_test/2day1hop/clm_hop_test.clm2_0003.r.2000-02-02-00000.nc';
+ file2 = '/glade/scratch/thoar/clm_test/2day1hop_sourcemods/clm_test.clm2_0003.r.2000-02-02-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/clm_hop_test/2day1hop/clm_hop_test.clm2_0004.r.2000-02-02-00000.nc';
+ file2 = '/glade/scratch/thoar/clm_test/2day1hop_sourcemods/clm_test.clm2_0004.r.2000-02-02-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/clm_hop_test/2day1hop/clm_hop_test.cpl.r.2000-02-02-00000.nc';
+ file2 = '/glade/scratch/thoar/clm_test/2day1hop_sourcemods/clm_test.cpl.r.2000-02-02-00000.nc';
+ Compare_netCDF_files(file1,file2)
+
+ case 'clm_nullDART' % RESULT: mlaidiff differs
+
+ file1 = '/glade/scratch/thoar/clm_test/2day2hop_sourcemods/clm_test.clm2_0001.r.2000-02-02-00000.nc';
+ file2 = '/glade/scratch/thoar/clm_test/2day2hop_nullDART/clm_test.clm2_0001.r.2000-02-02-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/clm_test/2day2hop_sourcemods/clm_test.clm2_0002.r.2000-02-02-00000.nc';
+ file2 = '/glade/scratch/thoar/clm_test/2day2hop_nullDART/clm_test.clm2_0002.r.2000-02-02-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/clm_test/2day2hop_sourcemods/clm_test.clm2_0003.r.2000-02-02-00000.nc';
+ file2 = '/glade/scratch/thoar/clm_test/2day2hop_nullDART/clm_test.clm2_0003.r.2000-02-02-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/clm_test/2day2hop_sourcemods/clm_test.clm2_0004.r.2000-02-02-00000.nc';
+ file2 = '/glade/scratch/thoar/clm_test/2day2hop_nullDART/clm_test.clm2_0004.r.2000-02-02-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/clm_test/2day2hop_sourcemods/clm_test.cpl.r.2000-02-02-00000.nc';
+ file2 = '/glade/scratch/thoar/clm_test/2day2hop_nullDART/clm_test.cpl.r.2000-02-02-00000.nc';
+ Compare_netCDF_files(file1,file2)
+
+ case 'popnull'
+
+ file1 = '/glade/scratch/thoar/pop_test/2day1hop_noFilter/pop_test.pop_0001.r.2004-01-05-00000.nc';
+ file2 = '/glade/scratch/thoar/pop_test/2day2hop_noFilter/pop_test.pop_0001.r.2004-01-05-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/pop_test/2day1hop_noFilter/pop_test.pop_0002.r.2004-01-05-00000.nc';
+ file2 = '/glade/scratch/thoar/pop_test/2day2hop_noFilter/pop_test.pop_0002.r.2004-01-05-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/pop_test/2day1hop_noFilter/pop_test.pop_0003.r.2004-01-05-00000.nc';
+ file2 = '/glade/scratch/thoar/pop_test/2day2hop_noFilter/pop_test.pop_0003.r.2004-01-05-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/pop_test/2day1hop_noFilter/pop_test.pop_0004.r.2004-01-05-00000.nc';
+ file2 = '/glade/scratch/thoar/pop_test/2day2hop_noFilter/pop_test.pop_0004.r.2004-01-05-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/pop_test/2day1hop_noFilter/pop_test.cice_0001.r.2004-01-05-00000.nc';
+ file2 = '/glade/scratch/thoar/pop_test/2day2hop_noFilter/pop_test.cice_0001.r.2004-01-05-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/pop_test/2day1hop_noFilter/pop_test.cice_0002.r.2004-01-05-00000.nc';
+ file2 = '/glade/scratch/thoar/pop_test/2day2hop_noFilter/pop_test.cice_0002.r.2004-01-05-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/pop_test/2day1hop_noFilter/pop_test.cice_0003.r.2004-01-05-00000.nc';
+ file2 = '/glade/scratch/thoar/pop_test/2day2hop_noFilter/pop_test.cice_0003.r.2004-01-05-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/pop_test/2day1hop_noFilter/pop_test.cice_0004.r.2004-01-05-00000.nc';
+ file2 = '/glade/scratch/thoar/pop_test/2day2hop_noFilter/pop_test.cice_0004.r.2004-01-05-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/pop_test/2day1hop_noFilter/pop_test.cpl.r.2004-01-05-00000.nc';
+ file2 = '/glade/scratch/thoar/pop_test/2day2hop_noFilter/pop_test.cpl.r.2004-01-05-00000.nc';
+ Compare_netCDF_files(file1,file2)
+
+ case 'pop'
+
+ file1 = '/glade/scratch/thoar/pop_test/2day1hop/pop_test.pop_0001.r.2004-01-05-00000.nc';
+ file2 = '/glade/scratch/thoar/pop_test/2day2hop/pop_test.pop_0001.r.2004-01-05-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/pop_test/2day1hop/pop_test.pop_0002.r.2004-01-05-00000.nc';
+ file2 = '/glade/scratch/thoar/pop_test/2day2hop/pop_test.pop_0002.r.2004-01-05-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/pop_test/2day1hop/pop_test.pop_0003.r.2004-01-05-00000.nc';
+ file2 = '/glade/scratch/thoar/pop_test/2day2hop/pop_test.pop_0003.r.2004-01-05-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/pop_test/2day1hop/pop_test.pop_0004.r.2004-01-05-00000.nc';
+ file2 = '/glade/scratch/thoar/pop_test/2day2hop/pop_test.pop_0004.r.2004-01-05-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/pop_test/2day1hop/pop_test.cice_0001.r.2004-01-05-00000.nc';
+ file2 = '/glade/scratch/thoar/pop_test/2day2hop/pop_test.cice_0001.r.2004-01-05-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/pop_test/2day1hop/pop_test.cice_0002.r.2004-01-05-00000.nc';
+ file2 = '/glade/scratch/thoar/pop_test/2day2hop/pop_test.cice_0002.r.2004-01-05-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/pop_test/2day1hop/pop_test.cice_0003.r.2004-01-05-00000.nc';
+ file2 = '/glade/scratch/thoar/pop_test/2day2hop/pop_test.cice_0003.r.2004-01-05-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/pop_test/2day1hop/pop_test.cice_0004.r.2004-01-05-00000.nc';
+ file2 = '/glade/scratch/thoar/pop_test/2day2hop/pop_test.cice_0004.r.2004-01-05-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/pop_test/2day1hop/pop_test.cpl.r.2004-01-05-00000.nc';
+ file2 = '/glade/scratch/thoar/pop_test/2day2hop/pop_test.cpl.r.2004-01-05-00000.nc';
+ Compare_netCDF_files(file1,file2)
+
+ case 'cam'
+
+ file1 = '/glade/scratch/thoar/cam_test2/2day1hop_initial/cam_test2.cam_0001.i.2008-11-06-00000.nc';
+ file2 = '/glade/scratch/thoar/cam_test2/2day2hop_initial/cam_test2.cam_0001.i.2008-11-06-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/cam_test2/2day1hop_initial/cam_test2.cam_0002.i.2008-11-06-00000.nc';
+ file2 = '/glade/scratch/thoar/cam_test2/2day2hop_initial/cam_test2.cam_0002.i.2008-11-06-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/cam_test2/2day1hop_initial/cam_test2.clm2_0001.r.2008-11-06-00000.nc';
+ file2 = '/glade/scratch/thoar/cam_test2/2day2hop_initial/cam_test2.clm2_0001.r.2008-11-06-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/cam_test2/2day1hop_initial/cam_test2.clm2_0002.r.2008-11-06-00000.nc';
+ file2 = '/glade/scratch/thoar/cam_test2/2day2hop_initial/cam_test2.clm2_0002.r.2008-11-06-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/cam_test2/2day1hop_initial/cam_test2.cice_0001.r.2008-11-06-00000.nc';
+ file2 = '/glade/scratch/thoar/cam_test2/2day2hop_initial/cam_test2.cice_0001.r.2008-11-06-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/cam_test2/2day1hop_initial/cam_test2.cice_0002.r.2008-11-06-00000.nc';
+ file2 = '/glade/scratch/thoar/cam_test2/2day2hop_initial/cam_test2.cice_0002.r.2008-11-06-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/cam_test2/2day1hop_initial/cam_test2.cpl.r.2008-11-06-00000.nc';
+ file2 = '/glade/scratch/thoar/cam_test2/2day2hop_initial/cam_test2.cpl.r.2008-11-06-00000.nc';
+ Compare_netCDF_files(file1,file2)
+
+ case 'Bstartdate'
+
+ file1 = '/glade/scratch/thoar/cesm_test/old_startdate/cesm_test.cam_0001.r.2004-01-05-00000.nc';
+ file2 = '/glade/scratch/thoar/cesm_test/new_startdate/cesm_test.cam_0001.r.2004-01-05-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/cesm_test/old_startdate/cesm_test.cam_0002.r.2004-01-05-00000.nc';
+ file2 = '/glade/scratch/thoar/cesm_test/new_startdate/cesm_test.cam_0002.r.2004-01-05-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/cesm_test/old_startdate/cesm_test.clm2_0001.r.2004-01-05-00000.nc';
+ file2 = '/glade/scratch/thoar/cesm_test/new_startdate/cesm_test.clm2_0001.r.2004-01-05-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/cesm_test/old_startdate/cesm_test.clm2_0002.r.2004-01-05-00000.nc';
+ file2 = '/glade/scratch/thoar/cesm_test/new_startdate/cesm_test.clm2_0002.r.2004-01-05-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/cesm_test/old_startdate/cesm_test.pop_0001.r.2004-01-05-00000.nc';
+ file2 = '/glade/scratch/thoar/cesm_test/new_startdate/cesm_test.pop_0001.r.2004-01-05-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/cesm_test/old_startdate/cesm_test.pop_0002.r.2004-01-05-00000.nc';
+ file2 = '/glade/scratch/thoar/cesm_test/new_startdate/cesm_test.pop_0002.r.2004-01-05-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/cesm_test/old_startdate/cesm_test.rtm_0001.r.2004-01-05-00000.nc';
+ file2 = '/glade/scratch/thoar/cesm_test/new_startdate/cesm_test.rtm_0001.r.2004-01-05-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/cesm_test/old_startdate/cesm_test.rtm_0002.r.2004-01-05-00000.nc';
+ file2 = '/glade/scratch/thoar/cesm_test/new_startdate/cesm_test.rtm_0002.r.2004-01-05-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/cesm_test/old_startdate/cesm_test.cice_0001.r.2004-01-05-00000.nc';
+ file2 = '/glade/scratch/thoar/cesm_test/new_startdate/cesm_test.cice_0001.r.2004-01-05-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/cesm_test/old_startdate/cesm_test.cice_0002.r.2004-01-05-00000.nc';
+ file2 = '/glade/scratch/thoar/cesm_test/new_startdate/cesm_test.cice_0002.r.2004-01-05-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ file1 = '/glade/scratch/thoar/cesm_test/old_startdate/cesm_test.cpl.r.2004-01-05-00000.nc';
+ file2 = '/glade/scratch/thoar/cesm_test/new_startdate/cesm_test.cpl.r.2004-01-05-00000.nc';
+ Compare_netCDF_files(file1,file2)
+
+ case 'Bhoptest'
+
+ disp('Testing CAM initial files.')
+ file1 = '/glade/scratch/thoar/cesm_test/3day1hop/cesm_test.cam_0001.i.2004-01-07-00000.nc';
+ file2 = '/glade/scratch/thoar/cesm_test/3day3hop/cesm_test.cam_0001.i.2004-01-07-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ disp('Testing CAM restart files.')
+ file1 = '/glade/scratch/thoar/cesm_test/3day1hop/cesm_test.cam_0001.r.2004-01-07-00000.nc';
+ file2 = '/glade/scratch/thoar/cesm_test/3day3hop/cesm_test.cam_0001.r.2004-01-07-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ disp('Testing CLM restart files on day 0 ... identical?')
+ file1 = '/glade/scratch/thoar/cesm_test/3day1hop/cesm_test.clm2_0001.r.2004-01-04-00000.nc';
+ file2 = '/glade/scratch/thoar/cesm_test/3day3hop/cesm_test.clm2_0001.r.2004-01-04-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+ disp('Testing CLM restart files on day +3 ... changed by CAM state?')
+ file1 = '/glade/scratch/thoar/cesm_test/3day1hop/cesm_test.clm2_0001.r.2004-01-07-00000.nc';
+ file2 = '/glade/scratch/thoar/cesm_test/3day3hop/cesm_test.clm2_0001.r.2004-01-07-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ disp('Testing CLM history files on day +1 ... identical?')
+ file1 = '/glade/scratch/thoar/cesm_test/3day1hop/cesm_test.clm2_0001.h0.2004-01-05-00000.nc';
+ file2 = '/glade/scratch/thoar/cesm_test/3day3hop/cesm_test.clm2_0001.h0.2004-01-05-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+ disp('Testing CLM history files on day +2 ... changed by CAM state?')
+ file1 = '/glade/scratch/thoar/cesm_test/3day1hop/cesm_test.clm2_0001.h0.2004-01-06-00000.nc';
+ file2 = '/glade/scratch/thoar/cesm_test/3day3hop/cesm_test.clm2_0001.h0.2004-01-06-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ disp('Testing POP restart files.')
+ file1 = '/glade/scratch/thoar/cesm_test/3day1hop/cesm_test.pop_0001.r.2004-01-07-00000.nc';
+ file2 = '/glade/scratch/thoar/cesm_test/3day3hop/cesm_test.pop_0001.r.2004-01-07-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ disp('Testing RTM restart files.')
+ file1 = '/glade/scratch/thoar/cesm_test/3day1hop/cesm_test.rtm_0001.r.2004-01-07-00000.nc';
+ file2 = '/glade/scratch/thoar/cesm_test/3day3hop/cesm_test.rtm_0001.r.2004-01-07-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ disp('Testing CICE restart files.')
+ file1 = '/glade/scratch/thoar/cesm_test/3day1hop/cesm_test.cice_0001.r.2004-01-07-00000.nc';
+ file2 = '/glade/scratch/thoar/cesm_test/3day3hop/cesm_test.cice_0001.r.2004-01-07-00000.nc';
+ Compare_netCDF_files(file1,file2)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+ disp('Testing CPL restart file.')
+ file1 = '/glade/scratch/thoar/cesm_test/3day1hop/cesm_test.cpl.r.2004-01-07-00000.nc';
+ file2 = '/glade/scratch/thoar/cesm_test/3day3hop/cesm_test.cpl.r.2004-01-07-00000.nc';
+ Compare_netCDF_files(file1,file2)
+
+ case 'B3day_h'
+
+ Compare_netCDF_files('/glade/scratch/thoar/cesm_test/cesm_test.pop_0001.hv.diff.nc')
+ Compare_netCDF_files('/glade/scratch/thoar/cesm_test/cesm_test.pop_0001.h.once.diff.nc')
+ Compare_netCDF_files('/glade/scratch/thoar/cesm_test/cam_0001.h0.2004-01-04-00000.diff.nc')
+ Compare_netCDF_files('/glade/scratch/thoar/cesm_test/cam_0001.h0.2004-01-06-00000.diff.nc')
+ Compare_netCDF_files('/glade/scratch/thoar/cesm_test/cam_0001.h0.2004-01-07-00000.diff.nc')
+ Compare_netCDF_files('/glade/scratch/thoar/cesm_test/cam_0001.h0.2004-01-05-00000.diff.nc')
+ Compare_netCDF_files('/glade/scratch/thoar/cesm_test/clm2_0001.h1.2004-01-04-00000.diff.nc')
+ Compare_netCDF_files('/glade/scratch/thoar/cesm_test/clm2_0001.h0.2004-01-05-00000.diff.nc')
+ Compare_netCDF_files('/glade/scratch/thoar/cesm_test/clm2_0001.h1.2004-01-05-00000.diff.nc')
+ Compare_netCDF_files('/glade/scratch/thoar/cesm_test/clm2_0001.h1.2004-01-06-00000.diff.nc')
+ Compare_netCDF_files('/glade/scratch/thoar/cesm_test/clm2_0001.h1.2004-01-07-00000.diff.nc')
+
+ otherwise
+
+ error('no known case of name %s',testname)
+
+end
+
+% <next few lines under version control, do not edit>
+% $URL$
+% $Id$
+% $Revision$
+% $Date$
+
Property changes on: DART/branches/development/models/CESM/matlab/CESM_hop_check.m
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:keywords
+ Date Rev Author HeadURL Id
Added: svn:eol-style
+ native
More information about the Dart-dev
mailing list