From 36b687768598c67c9ff51d822b5cf7dc485a69fa Mon Sep 17 00:00:00 2001 From: Jim Bresch Date: Fri, 22 May 2009 01:08:55 +0000 Subject: [PATCH] Add a little friendly error handling... git-svn-id: https://svn-wrf-wps.cgd.ucar.edu/trunk@513 86b71a92-4018-0410-97f8-d555beccfc3a --- ungrib/src/geth_idts.F | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/ungrib/src/geth_idts.F b/ungrib/src/geth_idts.F index 3c3b8d5..a1aaded 100644 --- a/ungrib/src/geth_idts.F +++ b/ungrib/src/geth_idts.F @@ -84,15 +84,15 @@ scold = 0 olen = len(odate) - read(odate(1:4), '(I4)') yrold - read(odate(6:7), '(I2)') moold - read(odate(9:10), '(I2)') dyold + read(odate(1:4), '(I4)', err=101) yrold + read(odate(6:7), '(I2)', err=101) moold + read(odate(9:10), '(I2)', err=101) dyold if (olen.ge.13) then - read(odate(12:13),'(I2)') hrold + read(odate(12:13),'(I2)', err=101) hrold if (olen.ge.16) then - read(odate(15:16),'(I2)') miold + read(odate(15:16),'(I2)', err=101) miold if (olen.ge.19) then - read(odate(18:19),'(I2)') scold + read(odate(18:19),'(I2)', err=101) scold endif endif endif @@ -105,15 +105,15 @@ scnew = 0 nlen = len(ndate) - read(ndate(1:4), '(I4)') yrnew - read(ndate(6:7), '(I2)') monew - read(ndate(9:10), '(I2)') dynew + read(ndate(1:4), '(I4)', err=102) yrnew + read(ndate(6:7), '(I2)', err=102) monew + read(ndate(9:10), '(I2)', err=102) dynew if (nlen.ge.13) then - read(ndate(12:13),'(I2)') hrnew + read(ndate(12:13),'(I2)', err=102) hrnew if (nlen.ge.16) then - read(ndate(15:16),'(I2)') minew + read(ndate(15:16),'(I2)', err=102) minew if (nlen.ge.19) then - read(ndate(18:19),'(I2)') scnew + read(ndate(18:19),'(I2)', err=102) scnew endif endif endif @@ -277,6 +277,14 @@ endif + return + 101 write(6,*) 'Error reading odate. odate = ',odate + write(6,*) 'Most likely an error in namelist.wps' + stop 'geth_idts 101' + 102 write(6,*) 'Error reading ndate. ndate = ',ndate + write(6,*) 'Most likely an error in namelist.wps' + stop 'geth_idts 102' + !************************** Subroutine End *************************** end -- 2.11.4.GIT