Skip to content
Snippets Groups Projects
Commit e6e527f0 authored by Ian Boyd's avatar Ian Boyd
Browse files

Replace idlcr8hdf.pro

parent 9496d3ac
No related branches found
No related tags found
No related merge requests found
;Main Program Version: idlcr8hdf.pro v4.0b61, 20231218
;Main Program Version: idlcr8hdf.pro v4.0b63, 20240908
; Written by Ian Boyd for the EVDC/AVDC - iboyd@bryanscientific.org
;
;Sub-versions (refer to idlcr8hdf-v4.0_Readme.pdf for full history)
......@@ -113,7 +113,7 @@ PRO intro, intype
COMMON WIDGET_WIN
nhdr=44 & errtxt=STRARR(nhdr)
vertxt=['idlcr8hdf-v4.0_Readme.pdf','v4.0b61 December 2023']
vertxt=['idlcr8hdf-v4.0_Readme.pdf','v4.0b63 September 2024']
errtxt[1]='Welcome to IDLcr8HDF. This program creates GEOMS compliant HDF4, HDF5 and netCDF files'
errtxt[2]='(also refer to '+vertxt[0]+').'
errtxt[4]='Inputs to the program (IDL Virtual Machine (VM) and IDL Licensed (LIC) Versions):'
......@@ -674,6 +674,10 @@ PRO var_units_test, vuvalue, rd, tab_type, var_si_conv, errstate
; 20110303: Bug fix - when a dimensionless unit includes a power value (e.g. ppmv2), the base unit
; in VAR_SI_CONVERSION stays as '1'; Add 'dB' to var_unit_arr - Version 4.0b4
; 20110719: Add 'pH' - Version 4.0b5
; 20240908: Bug fix - Using the SORT command to put units in order of power value can give different
; results depending on the operating system when power values are identical. Change routine
; so the MAX command is used instead to create an array in descending power order
; - Version 4.0b6
;
; Inputs: vuvalue - a string containing the Metadata VAR_UNITS value to be checked (everything
; after the '=')
......@@ -883,11 +887,20 @@ IF errstate EQ '' THEN BEGIN ;No errors detected so continue
IF pwchk[scnt-3] EQ '1' THEN pwchk[scnt-3]=''
;Put units in power value order
;Note: Can't use SORT because identical elements are sorted arbitrary and may vary between operating systems
;Try using MAX command instead
pwhold=pwchk
oi=WHERE(pwhold EQ '',ocnt)
IF ocnt NE 0 THEN pwhold[oi]='1'
pws=SORT(FIX(pwhold))
sichk=sichk[REVERSE(pws)] & pwchk=pwchk[REVERSE(pws)]
pws=INTARR(scnt-2)
;determine minimum power value
mnp=MIN(FIX(pwhold))
FOR j=0,scnt-3 DO BEGIN
mxp=MAX(FIX(pwhold),mxs)
pws[j]=mxs
pwhold[mxs]=mnp - 1 ;make it the lowest value
ENDFOR
sichk=sichk[pws] & pwchk=pwchk[pws]
var_si_conv=schk[0]+';'+schk[1]+';'+sichk[0]+pwchk[0]
si=WHERE(sichk NE '',sicnt)
......@@ -918,7 +931,7 @@ IF errstate EQ '' THEN BEGIN ;No errors detected so continue
vsc=STRSPLIT(var_si_conv,';',/EXTRACT)
vsc[2]=STRTRIM(vsc[2],2)
IF (errstate EQ '') AND (STRMID(vsc[2],0,1) EQ '1') AND (STRLEN(vsc[2]) GT 1) THEN BEGIN
errstate=errtxt[1] & var_si_conv=''
errstate=errtxt[1] & var_si_conv=''
ENDIF
ENDIF
......@@ -3567,6 +3580,9 @@ PRO set_up_structure, sds, inf
; that depends on it. The new check is that the axis variable is present anywhere in the file.
; Text for errtxt[3] changed, code added to identify axis variables and determine their
; VAR_SIZE - Version 4.0b61
; 20240112: Remove test that INDEPENDENT can only be a second dimension variable if the variable includes
; .BOUNDARIES in the name e.g. ALTITUDE.BOUNDARIES. This is too limiting e.g. for Aerosol Lidar
; RANGE_INDEPENDENT_NORMALIZATION has VAR_DEPEND=INDEPENDENT;DATETIME - Version 4.0b62
;
; Inputs: sds - Either a structure containing the Variable Attributes and Data, or the input
; data file
......@@ -3864,7 +3880,7 @@ WHILE lc LT N_ELEMENTS(meta_arr) DO BEGIN
ENDIF
test1=(resvd[i] EQ 'CONSTANT') AND ((i GT 1) OR (nd GE 2)) ;CONSTANT can be the only VAR_DEPEND
test2=(resvd[i] EQ vn[vc]) AND ((i GT 1) OR (nd GT 2)) ;e.g. ALTITUDE;DATETIME are possible dependencies for ALTITUDE
test3=(resvd[i] EQ 'INDEPENDENT') AND ((i GT 1) OR (nd GE 2)) AND (STRPOS(vn[vc],'.BOUNDARIES') EQ -1)
test3=0B ;(resvd[i] EQ 'INDEPENDENT') AND ((i GT 1) OR (nd GE 2)) AND (STRPOS(vn[vc],'.BOUNDARIES') EQ -1) ;remove test as too specific
test4=(resvd[i] NE 'CONSTANT') AND (resvd[i] NE 'INDEPENDENT') AND (resvd[i] NE vn[vc])
;Check for CONSTANT,INDEPENDENT or self-referencing and more than one VAR_DEPEND value
IF (test1) OR (test2) OR (test3) THEN BEGIN
......@@ -6123,7 +6139,7 @@ PRO idlcr8hdf, ga, sds, tav, odir, reterr, H5=o1, AVK=o2, LOG=o4, POPUP=o5, QA=o
;
;Program documentation, idlcr8hdf-v4.0_Readme.pdf, available from http://avdc.gsfc.nasa.gov.
;
;Program sub-version 4.0b61 (20231218)
;Program sub-version 4.0b63 (20240908)
; ----------
;Written by Ian Boyd for the EVDC/AVDC - iboyd@bryanscientific.org
;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment