[Dart-dev] [6168] DART/branches/development/utilities/utilities_mod.f90: Added a debug print block that summarizes the values of r8, r4, etc.
nancy at ucar.edu
nancy at ucar.edu
Tue May 28 15:42:05 MDT 2013
Revision: 6168
Author: thoar
Date: 2013-05-28 15:42:04 -0600 (Tue, 28 May 2013)
Log Message:
-----------
Added a debug print block that summarizes the values of r8,r4, etc.
if the print_debug logical is .true.
Also had a bugfix in the next_file() routine. If the user supplies a
single filename that has a '/' in it - next_file() is supposed to
parse the directory name and increment the portion after the underscore.
dir_0023/obs_seq.final becomes dir_0024/obs_seq.final
Problem is ... test_dir/obs_seq.final used to throw an error.
Modified Paths:
--------------
DART/branches/development/utilities/utilities_mod.f90
-------------- next part --------------
Modified: DART/branches/development/utilities/utilities_mod.f90
===================================================================
--- DART/branches/development/utilities/utilities_mod.f90 2013-05-23 21:23:54 UTC (rev 6167)
+++ DART/branches/development/utilities/utilities_mod.f90 2013-05-28 21:42:04 UTC (rev 6168)
@@ -141,7 +141,7 @@
!
!-----------------------------------------------------------------------
-use types_mod, only : r8, PI
+use types_mod, only : r4, r8, digits12, i4, i8, PI
use netcdf
implicit none
@@ -227,8 +227,8 @@
integer :: iunit, io
character(len=129) :: lname
+ character(len=169) :: string1,string2,string3
-
if ( module_initialized ) then ! nothing to do
! write(*,*)'Module initialized ... carry on.'
@@ -349,6 +349,25 @@
if (do_nml_term()) write( * , nml=utilities_nml)
endif
+ ! Record the values used for variable types:
+ if (do_output_flag .and. print_debug) then
+
+ write( * ,*) ! a little whitespace is nice
+ write(logfileunit,*) ! a little whitespace is nice
+
+ write(string1,*)'.. digits12 is ',digits12
+ write(string2,*)'r8 is ',r8
+ write(string3,*)'r4 is ',r4
+ call error_handler(E_DBG, 'initialize_utilities', string1, &
+ source, revision, revdate, text2=string2, text3=string3)
+
+ write(string1,*)'.. integer is ',kind(iunit) ! any integer variable will do
+ write(string2,*)'i8 is ',i8
+ write(string3,*)'i4 is ',i4
+ call error_handler(E_DBG, 'initialize_utilities', string1, &
+ source, revision, revdate, text2=string2, text3=string3)
+ endif
+
endif
contains
@@ -1687,7 +1706,7 @@
character(len=129), SAVE :: filename
character(len=129), SAVE :: dir_ext
-integer :: slashindex, splitindex, i, strlen
+integer :: slashindex, splitindex, i, strlen, ios
if (len(fname) > len(dir_base) ) then
write(msgstring,*)'input filename not guaranteed to fit in local variables'
@@ -1743,8 +1762,13 @@
dir_base = dir_name(1:splitindex-1)
dir_ext = dir_name(splitindex+1:slashindex-1)
dir_prec = slashindex - splitindex - 1
-
- read(dir_ext,*) filenum
+
+ read(dir_ext,*,iostat=ios) filenum
+ if(ios /= 0) then
+ ! Directory has an '_' separating two alphabetic parts
+ ! Nothing to increment.
+ filenum = -1
+ endif
endif
else ! we have one single file - on the first trip through
More information about the Dart-dev
mailing list