diff --git a/geoms_vntools.pro b/geoms_vntools.pro index ec9b8d625ad499dc06ef5764df4835f4e128aa20..107e99203494b06aa2dd71ee803c35b4db088f82 100644 --- a/geoms_vntools.pro +++ b/geoms_vntools.pro @@ -8,6 +8,7 @@ ; 2020-04-27, v2.02 Ian Boyd Allow DATA_SOURCE_01 inclusion/exclusion settings to cover more than ; one value - e.g. UVVIS.DOAS would mean the version name can be used ; in any file with UVVIS.DOAS as part of the DATA_SOURCE value +; 2023-12-18, v2.03 Ian Boyd Make keyword checks case sensitive ;--------------------------------------------------------------------------------------------------- FUNCTION is_a_number_vn,value @@ -339,24 +340,41 @@ FUNCTION analyze_GEOMS_VN, chVN_value, chFileGEOMSvn, ga_chk_vals, lu ;Check 2 - Are the keyword part(s) present in the list if iCheckOut eq 0 then begin ;check each keyword or combination until all keywords are accounted for or an error is found - keyword = strupcase(chvn_value) - chvn_allwdup = strupcase( chvernames[*,0]) + ;Note keyword comparison is case sensitive (introduced 20231218) + chvn_allwdupuc = strupcase( chvernames[*,0]) ;check if there is a case sensitivity issue + keyword = chvn_value + chvn_allwdup = chvernames[*,0] + j = kcnt & partok = 0 repeat begin + cserror = 0B repeat begin ;start with full version keyword then reduce until a match is found or no words are left to test - if j eq kcnt then kwtest = keyword $ - else kwtest = strmid(kwtest, 0, strpos( kwtest,'.',/Reverse_Search)) + if j eq kcnt then begin + kwtest = keyword & kwtestuc = strupcase(keyword) + endif else begin + kwtest = strmid(kwtest, 0, strpos( kwtest,'.',/Reverse_Search)) + kwtestuc = strupcase(kwtest) + endelse gi = where( kwtest eq chvn_allwdup, gcnt) + if gcnt eq 0 then begin + ;check if keyword is present but case is incorrect + gi = where( kwtestuc eq chvn_allwdupuc, gcnt) + if gcnt ne 0 then cserror = 1B + endif if (gcnt eq 0) or ((gcnt ne 0) and (kcnt eq 1)) then j-- endrep until (gcnt ne 0) or (j eq 0) if gcnt ne 0 then begin - ;partial or full match found so do inclusion/exclusion checks - if (j ne 0) or (partok eq 1) then kwfound = kwtest+' part' else kwfound = kwtest - chMessage = ' INFORMATION: Version keyword match found for '+kwfound - printf, lu, chMessage - print, chMessage - + ;partial or full match found so do inclusion/exclusion checks (unless the case is incorrect) + if (j ne 0) or (partok eq 1) then kwpart = ' part' else kwpart = '' + if cserror then begin + chMessage = ' ERROR: Version keyword'+kwpart+' found with case mismatch: '+kwtest+'/'+chvn_allwdup[gi[0]] + iCheckOut = (-1) + endif else begin + chMessage = ' INFORMATION: Version keyword match found for '+kwtest+kwpart + endelse + printf, lu, chMessage + print, chMessage ico = incl_excl_checks( chvernames[gi[0],*], chvn_excl_incl, n_chks, ga_chk_vals, lu) if ico eq (-1) then iCheckOut = ico