[Dart-dev] [4148] DART/trunk/utilities/utilities_mod.f90: Do not try to close an unopened nml file unit. Most com

nancy at ucar.edu nancy at ucar.edu
Tue Nov 17 14:46:19 MST 2009


Revision: 4148
Author:   nancy
Date:     2009-11-17 14:46:19 -0700 (Tue, 17 Nov 2009)
Log Message:
-----------
Do not try to close an unopened nml file unit.  Most compilers
apparently ignore close(-1), but the PGI compiler croaks on it.

Modified Paths:
--------------
    DART/trunk/utilities/utilities_mod.f90

-------------- next part --------------
Modified: DART/trunk/utilities/utilities_mod.f90
===================================================================
--- DART/trunk/utilities/utilities_mod.f90	2009-11-11 22:55:57 UTC (rev 4147)
+++ DART/trunk/utilities/utilities_mod.f90	2009-11-17 21:46:19 UTC (rev 4148)
@@ -382,7 +382,9 @@
       endif
 
       close(logfileunit)
-      if (nmlfileunit /= logfileunit) close(nmlfileunit)
+      if ((nmlfileunit /= logfileunit) .and. (nmlfileunit /= -1)) then
+         close(nmlfileunit)
+      endif
 
    end subroutine finalize_utilities
 


More information about the Dart-dev mailing list