[Dart-dev] [6186] DART/branches/development/utilities: Add the html and nml for this program.

nancy at ucar.edu nancy at ucar.edu
Wed May 29 10:23:48 MDT 2013


Revision: 6186
Author:   nancy
Date:     2013-05-29 10:23:47 -0600 (Wed, 29 May 2013)
Log Message:
-----------
Add the html and nml for this program.  It still needs
an option to 'do all numerical variables'.  Right now
it only does the variables explicitly listed in the namelist.

Modified Paths:
--------------
    DART/branches/development/utilities/compare_states.f90

Added Paths:
-----------
    DART/branches/development/utilities/compare_states.html
    DART/branches/development/utilities/compare_states.nml

-------------- next part --------------
Modified: DART/branches/development/utilities/compare_states.f90
===================================================================
--- DART/branches/development/utilities/compare_states.f90	2013-05-29 16:17:40 UTC (rev 6185)
+++ DART/branches/development/utilities/compare_states.f90	2013-05-29 16:23:47 UTC (rev 6186)
@@ -50,7 +50,7 @@
 character(128) :: dimname(maxd), odimname(maxd)
 integer :: nin1Dimensions, nin1Variables, nin1Attributes, in1unlimitedDimID
 integer :: nin2Dimensions, nin2Variables, nin2Attributes, in2unlimitedDimID
-real(r8) :: min1, min2, max1, max2
+real(r8) :: min1, min2, max1, max2, delmin, delmax
 
 ! arrays for all possible dimensions
 real(r8), pointer ::   oned1(:),               oned2(:)       
@@ -202,7 +202,7 @@
    endif
 
    if (debug) then
-      write(msgstring, *) ' invarid1: ', trim(nextfield)//' ',  invarid1
+      write(msgstring, *) 'invarid1: ', trim(nextfield)//' ',  invarid1
       call error_handler(E_MSG, 'compare_states', msgstring)
       write(msgstring, *) 'invarid2: ', trim(nextfield)//' ', invarid2
       call error_handler(E_MSG, 'compare_states', msgstring)
@@ -295,6 +295,8 @@
          max1 = maxval(oned1)
          min2 = minval(oned2)
          max2 = maxval(oned2)
+         delmin = minval(abs(oned1-oned2))
+         delmax = maxval(abs(oned1-oned2))
          nitems = count(oned1 .ne. oned2)
          deallocate(oned1, oned2)
       case (2)
@@ -306,6 +308,8 @@
          max1 = maxval(twod1)
          min2 = minval(twod2)
          max2 = maxval(twod2)
+         delmin = minval(abs(twod1-twod2))
+         delmax = maxval(abs(twod1-twod2))
          nitems = count(twod1 .ne. twod2)
          deallocate(twod1, twod2)
       case (3)
@@ -317,6 +321,8 @@
          max1 = maxval(threed1)
          min2 = minval(threed2)
          max2 = maxval(threed2)
+         delmin = minval(abs(threed1-threed2))
+         delmax = maxval(abs(threed1-threed2))
          nitems = count(threed1 .ne. threed2)
          deallocate(threed1, threed2)
       case (4)
@@ -328,6 +334,8 @@
          max1 = maxval(fourd1)
          min2 = minval(fourd2)
          max2 = maxval(fourd2)
+         delmin = minval(abs(fourd1-fourd2))
+         delmax = maxval(abs(fourd1-fourd2))
          nitems = count(fourd1 .ne. fourd2)
          deallocate(fourd1, fourd2)
       case (5)
@@ -339,6 +347,8 @@
          max1 = maxval(fived1)
          min2 = minval(fived2)
          max2 = maxval(fived2)
+         delmin = minval(abs(fived1-fived2))
+         delmax = maxval(abs(fived1-fived2))
          nitems = count(fived1 .ne. fived2)
          deallocate(fived1, fived2)
       case (6)
@@ -350,6 +360,8 @@
          max1 = maxval(sixd1)
          min2 = minval(sixd2)
          max2 = maxval(sixd2)
+         delmin = minval(abs(sixd1-sixd2))
+         delmax = maxval(abs(sixd1-sixd2))
          nitems = count(sixd1 .ne. sixd2)
          deallocate(sixd1, sixd2)
       case (7)
@@ -361,6 +373,8 @@
          max1 = maxval(sevend1)
          min2 = minval(sevend2)
          max2 = maxval(sevend2)
+         delmin = minval(abs(sevend1-sevend2))
+         delmax = maxval(abs(sevend1-sevend2))
          nitems = count(sevend1 .ne. sevend2)
          deallocate(sevend1, sevend2)
       case default
@@ -370,16 +384,21 @@
    end select
 
    ! common reporting code
-   write(msgstring, *) 'min/max 1: ', min1, max1
-   call error_handler(E_MSG, 'compare_states', msgstring, source, revision, revdate)
-   write(msgstring, *) 'min/max 2: ', min2, max2
-   call error_handler(E_MSG, 'compare_states', msgstring, source, revision, revdate)
    if (nitems > 0) then
       write(msgstring, *) 'arrays differ in ', nitems, ' places'
+      call error_handler(E_MSG, 'compare_states', msgstring, source, revision, revdate)
+      write(msgstring, *) 'min/max file1: ', min1, max1
+      call error_handler(E_MSG, 'compare_states', msgstring, source, revision, revdate)
+      write(msgstring, *) 'min/max file2: ', min2, max2
+      call error_handler(E_MSG, 'compare_states', msgstring, source, revision, revdate)
+      write(msgstring, *) 'delta min/max: ', delmin, delmax
+      call error_handler(E_MSG, 'compare_states', msgstring, source, revision, revdate)
    else
       write(msgstring, *) 'arrays same'
+      call error_handler(E_MSG, 'compare_states', msgstring, source, revision, revdate)
+      write(msgstring, *) 'min/max value: ', min1, max1
+      call error_handler(E_MSG, 'compare_states', msgstring, source, revision, revdate)
    endif
-   call error_handler(E_MSG, 'compare_states', msgstring, source, revision, revdate)
 
 enddo fieldloop
 

Added: DART/branches/development/utilities/compare_states.html
===================================================================
--- DART/branches/development/utilities/compare_states.html	                        (rev 0)
+++ DART/branches/development/utilities/compare_states.html	2013-05-29 16:23:47 UTC (rev 6186)
@@ -0,0 +1,241 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+          "http://www.w3.org/TR/html4/strict.dtd">
+<HTML>
+<HEAD>
+<TITLE>program compare_states</TITLE>
+<link rel="stylesheet" type="text/css" href="../doc/html/doc.css">
+<link href="../doc/html/dart.ico" rel="shortcut icon" />
+</HEAD>
+<BODY>
+<A NAME="TOP"></A>
+
+<H1>PROGRAM <em class=program>compare_states</em></H1>
+
+<table border=0 summary="" cellpadding=5>
+<tr>
+    <td valign=middle>
+    <img src="../doc/html/Dartboard7.png" alt="DART project logo" height=70 />
+    </td>
+    <td>
+       <P>Jump to <a href="../index.html">DART Documentation Main Index</a><br />
+          <small><small>version information for this file: <br />
+          <!-- version tag follows, do not edit -->
+          $Id$</small></small>
+       </P></td>
+</tr>
+</table>
+
+<A HREF="#Namelist">NAMELIST</A> /
+<A HREF="#Modules">MODULES</A> /
+<A HREF="#FilesUsed">FILES</A> /
+<A HREF="#References">REFERENCES</A> /
+<A HREF="#Errors">ERRORS</A> /
+<A HREF="#FuturePlans">PLANS</A> /
+<A HREF="#Legalese">TERMS OF USE</A>
+
+<H2>Overview</H2>
+
+<P>
+Utility program to compare fields in two NetCDF files and
+print out the min and max values from each file and the
+min and max of the differences between the two fields.
+The fields to be compared can be named directly in the
+namelist, or can be in a separate file.
+The two input filenames are read from the console or
+can be echo'd into the standard input of the program.
+</P>
+
+<P>
+Specify the list of field names to compare either in
+the namelist, or put a list of fields, one per line,
+in a text file and specify the name of the text file.
+There should be an option to compare all data fields
+in the file (this is not implemented yet.)
+Only data arrays can be compared, not character arrays,
+strings, or attribute values.
+</P>
+
+<P>
+Namelist interface
+<A HREF="#Namelist"><em class=code>&amp;compare_states_nml</em> </A>
+must be read from file <em class=file>input.nml</em>.
+</P>
+
+<!--==================================================================-->
+<!--=================== DESCRIPTION OF A NAMELIST ====================-->
+<!--==================================================================-->
+
+<A NAME="Namelist"></A>
+<HR>
+<H2>NAMELIST</H2>
+<P>We adhere to the F90 standard of starting a namelist with an ampersand
+'&amp;' and terminating with a slash '/' for all our namelist input.
+</P>
+<div class=namelist>
+<pre>
+<em class=call>namelist / compare_states_nml / </em> 
+  fieldnames, fieldlist_file, fail_on_missing_field, debug
+</pre>
+</div>
+
+<div class=indent1>
+<!-- Description -->
+
+<P>
+The namelist sets the behavior of this tool.
+<br>
+<br>
+This namelist is read in a file called <em class=file>input.nml</em>
+</P>
+
+<TABLE border=0 cellpadding=10 width=100%>
+<TR><TH align=left>Contents    </TH>
+    <TH align=left>Type        </TH>
+    <TH align=left>Description </TH></TR>
+<TR><!--contents--><TD valign=top>fieldnames</TD>
+    <!--  type  --><TD valign=top>character list</TD>
+    <!--descript--><TD valign=top>One or more names of arrays in the NetCDF files
+                  to be compared.
+                  Default "&nbsp;".</TD></TR>
+<TR><!--contents--><TD valign=top>fieldlist_file</TD>
+    <!--  type  --><TD valign=top>character</TD>
+    <!--descript--><TD valign=top>Name of a text file containing the fieldnames, one
+                  per line.  It is an error to specify both the fieldnames namelist
+                  item and this one.
+                  Default "&nbsp;"</TD></TR>
+<TR><!--contents--><TD valign=top>fail_on_missing_field</TD>
+    <!--  type  --><TD valign=top>logical</TD>
+    <!--descript--><TD valign=top>If .true. and any one of the field names is not
+                  found in both files it is a fatal error.  If .false. a message is
+                  printed about the missing field but execution continues.
+                  Default .true.</TD></TR>
+<TR><!--contents--><TD valign=top>debug</TD>
+    <!--  type  --><TD valign=top>logical</TD>
+    <!--descript--><TD valign=top>If true print out debugging info.
+                  Default .false.</TD></TR>
+</TABLE>
+
+</div>
+<br>
+
+<!--==================================================================-->
+
+<A NAME="Modules"></A>
+<HR>
+<H2>MODULES USED</H2>
+<PRE>
+types_mod
+utilities_mod
+parse_args_mod
+</PRE>
+
+<!--==================================================================-->
+<!-- Describe the Files Used by this module.                          -->
+<!--==================================================================-->
+
+<A NAME="FilesUsed"></A>
+<HR>
+<H2>FILES</H2>
+<UL><LI>two NetCDF input files
+    <LI>compare_states.nml 
+    <LI>field names text file (optionally)
+</UL>
+
+<!--==================================================================-->
+<!-- Cite references, if need be.                                     -->
+<!--==================================================================-->
+
+<A NAME="References"></A>
+<HR>
+<H2>REFERENCES</H2>
+<ul>
+<li> none </li>
+</ul>
+
+<!--==================================================================-->
+<!-- Describe all the error conditions and codes.                     -->
+<!--==================================================================-->
+
+<A NAME="Errors"></A>
+<HR>
+<H2>ERROR CODES and CONDITIONS</H2>
+<div class=errors>
+<TABLE border=1 cellspacing=1 cellpadding=10 width=100%>
+<TR><TH>Routine</TH><TH>Message</TH><TH>Comment</TH></TR>
+
+<TR><!-- routine --><TD VALIGN=top>compare_states</TD>
+    <!-- message --><TD VALIGN=top>Only use single process</TD>
+    <!-- comment --><TD VALIGN=top>Only a single mpi process can be used 
+                                   with this program</TD></TR>
+
+<TR><!-- routine --><TD VALIGN=top>compare_states</TD>
+    <!-- message --><TD VALIGN=top>must specify data days and times</TD>
+    <!-- comment --><TD VALIGN=top>If overwrite_data_time is true,
+       the namelist must include the new day and time.</TD></TR>
+
+<TR><!-- routine --><TD VALIGN=top>compare_states</TD>
+    <!-- message --><TD VALIGN=top>output_is_model_advance_file must 
+                                   be true to set advance time</TD>
+    <!-- comment --><TD VALIGN=top>If overwrite_advance_time is true,
+              output_is_model_advance_file must also be true.</TD></TR>
+
+<TR><!-- routine --><TD VALIGN=top>compare_states</TD>
+    <!-- message --><TD VALIGN=top>must specify advance days and times</TD>
+    <!-- comment --><TD VALIGN=top>If overwrite_advance_time is true,
+       the namelist must include the new day and time.</TD></TR>
+
+<TR><!-- routine --><TD VALIGN=top>compare_states</TD>
+    <!-- message --><TD VALIGN=top>overwrite_advance_time must be true 
+                                   if output file has advance time</TD>
+    <!-- comment --><TD VALIGN=top>If the incoming file does not have
+                 a model advance time, the output cannot have one unless
+                 the user gives one in the namelist, and sets 
+                 overwrite_advance_time to true.</TD></TR>
+
+</TABLE>
+</div>
+
+<H2>KNOWN BUGS</H2>
+<P>
+none
+</P>
+
+<!--==================================================================-->
+<!-- Describe Future Plans.                                           -->
+<!--==================================================================-->
+
+<A NAME="FuturePlans"></A>
+<HR>
+<H2>FUTURE PLANS</H2>
+<P>
+none
+</P>
+
+<!--==================================================================-->
+<!-- Legalese & Metadata                                              -->
+<!--==================================================================-->
+
+<A NAME="Legalese"></A>
+<HR>
+<H2>Terms of Use</H2>
+
+<P>
+DART software - Copyright 2004 - 2011 UCAR.<br>
+This open source software is provided by UCAR, "as is",<br>
+without charge, subject to all terms of use at<br>
+<a href="http://www.image.ucar.edu/DAReS/DART/DART_download">
+http://www.image.ucar.edu/DAReS/DART/DART_download</a>
+</P>
+
+<TABLE border=0 cellpadding=0 width=100% summary="">
+<TR><TD valign=top>Contact:       </TD><TD> DART core group   </TD></TR>
+<TR><TD valign=top>Revision:      </TD><TD> $Revision$ </TD></TR>
+<TR><TD valign=top>Source:        </TD><TD> $URL$ </TD></TR>
+<TR><TD valign=top>Change Date:   </TD><TD> $Date$ </TD></TR>
+<TR><TD valign=top>Change&nbsp;history:&nbsp;</TD><TD> try "svn&nbsp;log" or "svn&nbsp;diff" </TD></TR>
+</TABLE>
+
+<!--==================================================================-->
+
+</BODY>
+</HTML>


Property changes on: DART/branches/development/utilities/compare_states.html
___________________________________________________________________
Added: svn:mime-type
   + text/html
Added: svn:keywords
   + Date Rev Author HeadURL Id
Added: svn:eol-style
   + native

Added: DART/branches/development/utilities/compare_states.nml
===================================================================
--- DART/branches/development/utilities/compare_states.nml	                        (rev 0)
+++ DART/branches/development/utilities/compare_states.nml	2013-05-29 16:23:47 UTC (rev 6186)
@@ -0,0 +1,7 @@
+&compare_states_nml
+  fieldnames = '', 
+  fieldlist_file = '',
+  fail_on_missing_field = .true.,
+  debug = .false., 
+/
+


Property changes on: DART/branches/development/utilities/compare_states.nml
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native


More information about the Dart-dev mailing list