From 83dac2bfffe15ab52aa5f4e45204a235baa00128 Mon Sep 17 00:00:00 2001 From: Ian Boyd <iboyd@astro.umass.edu> Date: Tue, 26 Nov 2024 02:56:11 +0000 Subject: [PATCH] Replace geoms_harmon.pro --- geoms_harmon.pro | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/geoms_harmon.pro b/geoms_harmon.pro index 48bdc5a..4381e1f 100644 --- a/geoms_harmon.pro +++ b/geoms_harmon.pro @@ -87,6 +87,8 @@ ; 2024-09-12, v2.14 Ian Boyd update due to fixes to idlcr8ascii and idlcr8hdf ; 2024-09-27, v2.15 Ian Boyd update due to fix to idlcr8ascii ; 2024-10-29, v2.16 Ian Boyd update due to fixes to geoms_tctools and idlcr8hdf +; 2024-11-26, v2.17 Ian Boyd Add run-time error handling capability in geoms_qa.pro and geoms_harmon.pro +; plus bug fix in idlcr8hdf ;--------------------------------------------------------------------------------------------------- function is_a_number,value on_ioerror, ConversionError @@ -105,7 +107,7 @@ PRO geoms_harmon if ( iNrArgs lt 4 ) then begin print print, 'GEOMS harmonization (geoms_harmon)' - print, ' Release v2.16, 2024-10-29' + print, ' Release v2.17, 2024-11-26' print, ' Provides harmonization of old Envisat/Aura HDF files or older versions of GEOMS files' print, ' into most recent GEOMS compliant files.' print @@ -170,6 +172,29 @@ PRO geoms_harmon end end if ( QA_error_code eq 0 ) then begin + + CATCH, error_status + IF error_status NE 0 THEN BEGIN + ;Run-time error so exit nicely + CLOSE,/ALL + ;Delete idlcr8ascii.log and idlcr8qa.log if they exist + hdfdir=FILE_DIRNAME(chFileOrig,/MARK_DIRECTORY) + FILE_DELETE,hdfdir+'idlcr8ascii.log',/QUIET + FILE_DELETE,hdfdir+'idlcr8log.log',/QUIET + ;Write Run-time error to the log file + logfile=STRMID(chFileOrig,0,STRPOS(chFileOrig,'.',/REVERSE_SEARCH))+'.log' + etxt=' Please contact Ian Boyd at iboyd@bryanscientific.org and nadirteam@nilu.no' + OPENW,lu,logfile, /GET_LUN, /Append + PRINTF,lu,'' + PRINTF,lu,' RUN-TIME ERROR: '+!ERROR_STATE.MSG + PRINTF,lu,'' + PRINTF,lu,'99 (Failed with Run-Time error.'+etxt+')' + FREE_LUN,lu + CATCH,/CANCEL + QA_error_code=99 + exit, status=QA_error_code + ENDIF + case 1 of iDataFormat eq 0: QA_error_code = geoms_tools( 1, chFileTAV, chFileOrig, chDirOutput, 'h4' ) iDataFormat eq 1: QA_error_code = geoms_tools( 1, chFileTAV, chFileOrig, chDirOutput, 'h5' ) -- GitLab