<p><b>duda</b> 2012-02-23 18:56:33 -0700 (Thu, 23 Feb 2012)</p><p>Add error checking code for reading namelists:<br>
<br>
- if a namelist record is not found in namelist.input, just print a warning message like<br>
     &quot;Namelist record &amp;restart not found; using default values for this namelist's variables&quot;<br>
  and continue<br>
<br>
- if there is an error in a namelist record, print an error message like<br>
     &quot;Error while reading namelist record &amp;restart&quot;<br>
  and stop the executable<br>
<br>
<br>
M    src/registry/gen_inc.c<br>
M    src/framework/mpas_configure.F<br>
</p><hr noshade><pre><font color="gray">Modified: trunk/mpas/src/framework/mpas_configure.F
===================================================================
--- trunk/mpas/src/framework/mpas_configure.F        2012-02-23 21:51:49 UTC (rev 1532)
+++ trunk/mpas/src/framework/mpas_configure.F        2012-02-24 01:56:33 UTC (rev 1533)
@@ -13,7 +13,7 @@
 
       type (dm_info), intent(in) :: dminfo
 
-      integer :: funit
+      integer :: funit, ierr
 
 #include &quot;config_namelist_defs.inc&quot;
 
@@ -23,10 +23,12 @@
 #include &quot;config_set_defaults.inc&quot;
 
       if (dminfo % my_proc_id == IO_NODE) then
+         write(0,*) 'Reading namelist.input'
          open(funit,file='namelist.input',status='old',form='formatted')
 
 #include &quot;config_namelist_reads.inc&quot;
          close(funit)
+         write(0,*) ' '
       end if
 
 #include &quot;config_bcast_namelist.inc&quot;

Modified: trunk/mpas/src/registry/gen_inc.c
===================================================================
--- trunk/mpas/src/registry/gen_inc.c        2012-02-23 21:51:49 UTC (rev 1532)
+++ trunk/mpas/src/registry/gen_inc.c        2012-02-24 01:56:33 UTC (rev 1533)
@@ -125,7 +125,15 @@
    nls_ptr = nls;
    while (nls_ptr) {
       if (!dict_search(dictionary, nls_ptr-&gt;record)) {
-         fortprintf(fd, &quot;         read(funit,%s)</font>
<font color="blue">&quot;, nls_ptr-&gt;record);
+         fortprintf(fd, &quot;         read(funit,%s,iostat=ierr)</font>
<font color="blue">&quot;, nls_ptr-&gt;record);
+         fortprintf(fd, &quot;         if (ierr &gt; 0) then</font>
<font color="blue">&quot;);
+         fortprintf(fd, &quot;            write(0,*) \'Error while reading namelist record &amp;%s\'</font>
<font color="blue">&quot;,nls_ptr-&gt;record);
+         fortprintf(fd, &quot;            call mpas_dmpar_abort(dminfo)</font>
<font color="blue">&quot;);
+         fortprintf(fd, &quot;         else if (ierr &lt; 0) then</font>
<font color="blue">&quot;);
+         fortprintf(fd, &quot;            write(0,*) \'Namelist record &amp;%s not found; using default values for this namelist\'\'s variables\'</font>
<font color="blue">&quot;,nls_ptr-&gt;record);
+         fortprintf(fd, &quot;            rewind(funit)</font>
<font color="blue">&quot;);
+         fortprintf(fd, &quot;         end if</font>
<font color="blue">&quot;);
+
          dict_insert(dictionary, nls_ptr-&gt;record);
       }
       nls_ptr = nls_ptr-&gt;next;

</font>
</pre>