[Dart-dev] DART/branches Revision: 10774
dart at ucar.edu
dart at ucar.edu
Tue Nov 22 16:09:13 MST 2016
thoar at ucar.edu
2016-11-22 16:09:13 -0700 (Tue, 22 Nov 2016)
644
In utlilities_mod.f90:set_filename_list() The variable for the message
string was not long enough for the error message and it got truncated
before reporing the useful bit. I added a couple optional arguments
to provide more context.
It used to read:
ERROR FROM:
routine: convert_roms_obs
message: found no filenames contained in a list fi
now it reads:
ERROR FROM:
routine: convert_roms_obs
message: found no filenames contained in a list file
message: ... reading file # 1
message: ... reading file name ""
Fixed inverted logic in cycle.csh.template now that I have to check
a failure instead of a success.
Modified: DART/branches/rma_trunk/models/ROMS/shell_scripts/cycle.csh.template
===================================================================
--- DART/branches/rma_trunk/models/ROMS/shell_scripts/cycle.csh.template 2016-11-22 22:05:01 UTC (rev 10773)
+++ DART/branches/rma_trunk/models/ROMS/shell_scripts/cycle.csh.template 2016-11-22 23:09:13 UTC (rev 10774)
@@ -109,7 +109,7 @@
# Check for successful completion - log file should NOT have something like:
# Blowing-up: Saving latest model state into RESTART file
grep -i blow log_$instance.txt > /dev/null
- if ($status != 0) then
+ if ($status == 0) then
echo "ROMS instance $instance FAILED."
echo "ROMS instance $instance FAILED."
echo "ROMS instance $instance FAILED."
Modified: DART/branches/rma_trunk/utilities/utilities_mod.f90
===================================================================
--- DART/branches/rma_trunk/utilities/utilities_mod.f90 2016-11-22 22:05:01 UTC (rev 10773)
+++ DART/branches/rma_trunk/utilities/utilities_mod.f90 2016-11-22 23:09:13 UTC (rev 10774)
@@ -195,7 +195,7 @@
character(len=32 ), parameter :: revision = "$Revision$"
character(len=128), parameter :: revdate = "$Date$"
-character(len=512) :: msgstring
+character(len=512) :: msgstring1, msgstring2, msgstring3
!----------------------------------------------------------------
! Namelist input with default values
@@ -948,9 +948,7 @@
integer :: nc, rc, rlen
logical :: open, use_recl
character(len=32) :: format, pos, act, stat, acc, conversion, recl, del
- character(len=128) :: msgstring1, msgstring2
-
if ( .not. module_initialized ) call initialize_utilities
! if file already open, set iunit and return
@@ -1080,11 +1078,11 @@
endif
if (rc /= 0) then
- write(msgstring, *)'Cannot open file "'//trim(fname)//'" for '//trim(act)
- write(msgstring1,*)'File may not exist or permissions may prevent the requested operation'
- write(msgstring2,*)'Error code was ', rc
- call error_handler(E_ERR, 'open_file: ', msgstring, source, revision, revdate, &
- text2=msgstring1, text3=msgstring2)
+ write(msgstring1, *)'Cannot open file "'//trim(fname)//'" for '//trim(act)
+ write(msgstring2,*)'File may not exist or permissions may prevent the requested operation'
+ write(msgstring3,*)'Error code was ', rc
+ call error_handler(E_ERR, 'open_file: ', msgstring1, source, revision, revdate, &
+ text2=msgstring2, text3=msgstring3)
endif
end function open_file
@@ -1338,8 +1336,8 @@
inquire (unit=iunit, opened=open, iostat=ios)
if ( ios /= 0 ) then
- write(msgstring,*)'Unable to determine status of file unit ', iunit
- call error_handler(E_MSG, 'close_file: ', msgstring, source, revision, revdate)
+ write(msgstring1,*)'Unable to determine status of file unit ', iunit
+ call error_handler(E_MSG, 'close_file: ', msgstring1, source, revision, revdate)
endif
if (open) close(iunit)
@@ -1393,15 +1391,15 @@
read(iunit, '(A)', iostat = io) nml_string
if(io /= 0) then
! No values for this namelist; error
- write(msgstring, *) 'Namelist entry &', nml_name, ' must exist in ', namelist_file_name
+ write(msgstring1, *) 'Namelist entry &', nml_name, ' must exist in ', namelist_file_name
! Can't write to logfile if it hasn't yet been opened
if(write_to_logfile) then
- call error_handler(E_ERR, 'find_namelist_in_file', msgstring, &
+ call error_handler(E_ERR, 'find_namelist_in_file', msgstring1, &
source, revision, revdate)
else
write(*, *) 'FATAL ERROR before logfile initialization in utilities_mod'
write(*, *) 'Error is in subroutine find_namelist_in_file'
- write(*, *) msgstring
+ write(*, *) msgstring1
write(*,*)' ',trim(source)
write(*,*)' ',trim(revision)
write(*,*)' ',trim(revdate)
@@ -1421,14 +1419,14 @@
end do
else
! No namelist_file_name file is an error
- write(msgstring, *) 'Namelist input file: ', namelist_file_name, ' must exist.'
+ write(msgstring1, *) 'Namelist input file: ', namelist_file_name, ' must exist.'
if(write_to_logfile) then
- call error_handler(E_ERR, 'find_namelist_in_file', msgstring, &
+ call error_handler(E_ERR, 'find_namelist_in_file', msgstring1, &
source, revision, revdate)
else
write(*, *) 'FATAL ERROR before logfile initialization in utilities_mod'
write(*, *) 'Error is in subroutine find_namelist_in_file'
- write(*, *) msgstring
+ write(*, *) msgstring1
write(*,*)' ',trim(source)
write(*,*)' ',trim(revision)
More information about the Dart-dev
mailing list