[Dart-dev] [6979] DART/trunk/utilities/utilities_mod.f90: collection of minor updates:

nancy at ucar.edu nancy at ucar.edu
Tue May 6 08:35:20 MDT 2014


Revision: 6979
Author:   nancy
Date:     2014-05-06 08:35:20 -0600 (Tue, 06 May 2014)
Log Message:
-----------
collection of minor updates:
1. do not try to declare a local variable based on the size
of an optional argument in the ascii_file_format() routine.
2. when searching a namelist file for a particular namelist,
backspace 1 record when it is found instead of rewinding.
this makes namelists work with the NAG compiler.
3. remove code that warned about deprecated namelist items
in the &filter_nml that haven't been supported since 2008.
4. changed "BACKSPACE n" to "backspace(n)".  both are legal
syntax but easier to find if we use a consistent format.
5. added "intent(in)" to the interface block for exit_all.
this made the NAG compiler happy.

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

-------------- next part --------------
Modified: DART/trunk/utilities/utilities_mod.f90
===================================================================
--- DART/trunk/utilities/utilities_mod.f90	2014-05-05 17:58:05 UTC (rev 6978)
+++ DART/trunk/utilities/utilities_mod.f90	2014-05-06 14:35:20 UTC (rev 6979)
@@ -176,7 +176,7 @@
 ! with this job when you exit.  in the non-mpi case, it just calls exit.
 interface
  subroutine exit_all(exitval)
-  integer :: exitval
+  integer, intent(in) :: exitval
  end subroutine exit_all
 end interface
 
@@ -1369,7 +1369,7 @@
          call to_upper(string1)
 
          if(trim(string1) == trim(test_string)) then
-            rewind(iunit)
+            backspace(iunit)
             return
          endif
 
@@ -1423,7 +1423,7 @@
    call close_file(iunit)
 else
    ! If it wasn't successful, print the line on which it failed  
-   BACKSPACE iunit
+   backspace(iunit)
    read(iunit, '(A)', iostat = io) nml_string
    ! A failure in this read means that the namelist started but never terminated
    ! Result was falling off the end, so backspace followed by read fails
@@ -1443,15 +1443,6 @@
       endif
    else
       ! Didn't fall off end so bad entry in the middle of namelist
-      ! TEMP HELP FOR USERS; remove after next release
-      if (len(nml_name) >= 10) then
-         if ((nml_name(1:10) == 'filter_nml') .and. (index(nml_string,'inf_start_from_restart') > 0)) then
-            write(msgstring, *) 'inf_start_from_restart obsolete'
-            call error_handler(E_MSG, 'filter_nml: ', msgstring)
-            write(msgstring, *) 'use inf_initial_from_restart and inf_sd_initial_from_restart'
-            call error_handler(E_MSG, 'filter_nml: ', msgstring)
-         endif 
-      endif 
       write(msgstring, *) 'INVALID NAMELIST ENTRY: ', trim(nml_string), ' in namelist ', trim(nml_name)
       if(write_to_logfile) then
          call error_handler(E_ERR, 'check_namelist_read', msgstring, &
@@ -1890,8 +1881,6 @@
 character(len=*), intent(in), optional :: fform
 logical                                :: ascii_file_format
 
-character(len=len(fform)) :: lj_fform ! Left Justified version of optional argument 
-
 ! Returns .true. for formatted/ascii file, .false. is unformatted/binary
 ! Defaults (if fform not specified) to formatted/ascii.
 
@@ -1903,17 +1892,7 @@
    return
 endif
 
-! Check to make sure we don't put 10lbs of stuff in a 5lb bag
-
-if (len(fform) > len(lj_fform)) then
-   write(msgstring,*)'fform is long: increase len of lj_fform to ',&
-                     len(fform),' and recompile.'
-   call error_handler(E_ERR,'ascii_file_format', msgstring, source, revision, revdate)
-endif
-
-lj_fform = adjustl(fform)
-
-SELECT CASE (trim(lj_fform))
+SELECT CASE (fform)
    CASE("unf", "UNF", "unformatted", "UNFORMATTED")
       ascii_file_format = .false.
    CASE DEFAULT


More information about the Dart-dev mailing list