[Dart-dev] [4022] DART/trunk/utilities/utilities_mod.f90: Make it so the nml file is really not opened or written to at all
nancy at ucar.edu
nancy at ucar.edu
Fri Aug 28 09:49:03 MDT 2009
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/dart-dev/attachments/20090828/501f366c/attachment.html
-------------- next part --------------
Modified: DART/trunk/utilities/utilities_mod.f90
===================================================================
--- DART/trunk/utilities/utilities_mod.f90 2009-08-28 15:10:45 UTC (rev 4021)
+++ DART/trunk/utilities/utilities_mod.f90 2009-08-28 15:49:03 UTC (rev 4022)
@@ -289,30 +289,32 @@
! If nmlfilename != logfilename, open it. otherwise set nmlfileunit
! to be same as logunit.
- if (trim(adjustl(nmlfilename)) /= trim(adjustl(lname))) then
- if (do_output_flag) &
- write(*,*)'Trying to open namelist log ', trim(adjustl(nmlfilename))
-
- nmlfileunit = nextunit()
- if (nmlfileunit < 0) &
- call error_handler(E_ERR,'initialize_utilities', &
- 'Cannot get unit for nm log file', source, revision, revdate)
-
- open(nmlfileunit, file=trim(adjustl(nmlfilename)), form='formatted', &
- position='append', iostat = io )
- if ( io /= 0 ) then
- call error_handler(E_ERR,'initialize_utilities', &
- 'Cannot open nm log file', source, revision, revdate)
+ if (do_nml_file()) then
+ if (trim(adjustl(nmlfilename)) /= trim(adjustl(lname))) then
+ if (do_output_flag) &
+ write(*,*)'Trying to open namelist log ', trim(adjustl(nmlfilename))
+
+ nmlfileunit = nextunit()
+ if (nmlfileunit < 0) &
+ call error_handler(E_ERR,'initialize_utilities', &
+ 'Cannot get unit for nm log file', source, revision, revdate)
+
+ open(nmlfileunit, file=trim(adjustl(nmlfilename)), form='formatted', &
+ position='append', iostat = io )
+ if ( io /= 0 ) then
+ call error_handler(E_ERR,'initialize_utilities', &
+ 'Cannot open nm log file', source, revision, revdate)
+ endif
+
+ else
+ nmlfileunit = logfileunit
endif
-
- else
- nmlfileunit = logfileunit
endif
! Echo the namelist values for this module using normal mechanism
! including a separator line for this run.
if (do_output_flag) then
- if (nmlfileunit /= logfileunit) then
+ if (do_nml_file() .and. (nmlfileunit /= logfileunit)) then
if ( present(progname) ) then
write(nmlfileunit, *) '!Starting Program '//trim(progname)
else
@@ -374,7 +376,7 @@
! integer :: logfileunit -- private module variable
if (do_output_flag) then
- if (nmlfileunit /= logfileunit) then
+ if (do_nml_file() .and. (nmlfileunit /= logfileunit)) then
write(nmlfileunit, *) '!Ending Program '
endif
endif
More information about the Dart-dev
mailing list