Commit bd738998 authored by Ian Boyd's avatar Ian Boyd
Browse files

Replace cds_tools.pro

parent 6a03a409
;Main Program Version: cds_tools.pro Release v2.0b63, 20200311
;Main Program Version: cds_tools.pro Release v2.0b66, 20210617
; Written by Ian Boyd for the AVDC/EVDC - iboyd@astro.umass.edu
;Sub-versions:
; 20090828: Initial Release for testing - v0.1
......@@ -164,7 +164,10 @@
; between the 3 different Costa Rica SHADOZ sites and make latitude and longitude
; dependent on DATETIME rather than constant - v2.0b62
; 20200311, Update due to modifications and fixes to idlcr8hdf - v2.0b63
; 20200709, Update due to fix in idlcr8hdf - v2.0b64
; 20200827, Add SYSTIME to ISO8601 conversion option. Used for some SHADOZ v6 files that
; write file creation date in SYSTIME form instead of DD MONTHNAME, YYYY - v2.0b65
; 20210617, Update due to fixes in idlcr8hdf - v2.0b66
;Program to read in a file or string array created by CDS_Match (or equivalent) and,
;based on the input information, convert NDACC NASA/AMES, WOUDC CSV, SHADOZ, NOAA-ESRL or
......@@ -211,6 +214,7 @@ PRO calc_mjd2000, rule, nwvalue, dsd, dyear, mjd2000, metaok
; 20120614: Add SHADOZ_Date_Time to MJD2000 - v2.0b21
; 20120703: Add DATE+TIME to MJD2000 - v2.0b22
; 20121127: Add DD+MonthName+YYYY to YYYYMMDD - v2.0b26
; 20200827: Add SYSTIME to ISO8601 - v2.0b65
;
; Input: rule - string holding the DATETIME conversion rule from Section (b) of the
; Translation Table file
......@@ -218,7 +222,7 @@ PRO calc_mjd2000, rule, nwvalue, dsd, dyear, mjd2000, metaok
; dsd - variable holding the DATA_START_DATE in MJD2000 format
; dyear - variable holding the year value
;
; Output: mjd2000 - returned value in MJD2000 format
; Output: mjd2000 - returned value in MJD2000 (or other) format
; metaok - string which will identify a problem if encountered
;
; Called by: Update_Global_Attributes, Write_Data
......@@ -339,6 +343,30 @@ CASE 1 OF
ENDIF
ENDIF
END
rule eq 'SYSTIMETOISO8601': BEGIN
;Convert systime format date/time (DOW MON DD HH:MM:SS YEAR) to YYYYMMDDtHHMMSSz
Month=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']
metaok='' & dhms=STRARR(4)
stime=STRSPLIT(dsd,' :',/Extract,count=stcnt)
IF stcnt NE 7 THEN metaok='Expected SYSTIME Datetime format in the form DOW Mon DD HH:MM:SS YEAR.' $
ELSE BEGIN
DYear=stime[6] & DMonth=WHERE(STRUPCASE(stime[1]) eq STRUPCASE(Month))
DMonth[0]=DMonth[0]+1
IF DMonth[0] LT 10 THEN DMnS='0'+STRTRIM(DMonth[0],2) ELSE DMnS=STRTRIM(DMonth[0],2)
FOR i=0,3 DO BEGIN
dtval=FIX(stime[i+2])
IF dtval LT 10 then dtvals='0'+STRTRIM(dtval,2) ELSE dtvals=STRTRIM(dtval,2)
dhms[i]=dtvals
ENDFOR
mjd2000=DYear+DMnS+dhms[0]+'t'+dhms[1]+dhms[2]+dhms[3]+'z'
ENDELSE
END
rule EQ 'AEOLUS_DATE_TIMETOMJD2000': BEGIN
;nwvalue is 2020-10-02T15:45:42
dtvals=STRSPLIT(nwvalue,' -T:',/EXTRACT)
dtvali=FIX(dtvals)
mjd2000=JULIAN_DATE(dtvali,/M)
END
ENDCASE
END ;Procedure Calc_MJD2000
......@@ -518,8 +546,8 @@ PRO read_input, ftest, ndacc, wgtem, table, metadata, sectionb, ga, nw, mv_meta,
; metadata - string array holding the metadata information from the translation table file
; sectionb - string array holding the information from section (b) of the translation table file
; ga - string array holding the global attibutes
; nw - variable identifying file to be converted as either NDACC (N),WOUDC (W), netCDF (C),
; SHADOZ (S), NOAA-ESRL (E)
; nw - variable identifying file to be converted as either NDACC (N), WOUDC (W), netCDF (C),
; SHADOZ (S), NOAA-ESRL (E), AEOLUS (A)
; mv_meta - structure/array containing NDACC/netCDF metadata information (NDACC/netCDF files only)
; ds - structure containing NDACC or netCDF datasets (NDACC/netCDF files only)
; mv_dbl - array holding netCDF valid_range or _FillValue values in double format (netCDF only)
......@@ -668,6 +696,8 @@ FOR i=0,N_ELEMENTS(ftest)-1 DO BEGIN
;Read in contents of files
OPENR,lu,ftest[i],/GET_LUN
READF,lu,holdstr
;Get file information (used to get file generation date for AEOLUS files
fileinf=FSTAT(lu)
FREE_LUN,lu
CASE 1 OF
i EQ 0: ndacc=STRTRIM(holdstr,2)
......@@ -688,12 +718,20 @@ FOR i=0,N_ELEMENTS(ftest)-1 DO BEGIN
ENDIF
ENDFOR
;Determine if input file is NDACC, WOUDC, SHADOZ or NOAA-ESRL by checking first line of the translation table
;Determine if input file is NDACC, WOUDC, SHADOZ, NOAA-ESRL or AEOLUS by checking first line of the translation table
IF (STRPOS(STRUPCASE(table[0]),'WOUDC') NE -1) AND (nw EQ '') THEN nw='W' $
ELSE IF (STRPOS(STRUPCASE(table[0]),'SHADOZ') NE -1) AND (nw EQ '') THEN nw='S' $
ELSE IF (STRPOS(STRUPCASE(table[0]),'NOAA-ESRL') NE -1) AND (nw EQ '') THEN nw='E' $
ELSE IF (STRPOS(STRUPCASE(table[0]),'AEOLUS') NE -1) AND (nw EQ '') THEN nw='A' $
ELSE IF nw EQ '' THEN nw='N'
IF nw EQ 'A' THEN BEGIN
;add file modification time as the last string entry (needed for SOURCE.PRODUCT entry)
modtime=fileinf.mtime
modtimes=SYSTIME(ELAPSED=modtime)
ndacc=['FILE CREATION DATE: '+modtimes,ndacc]
ENDIF
IF nw EQ 'N' THEN BEGIN
;Read NDACC data into mv_meta, data structures by calling NASA/AMES program xchgread.pro
rc=0
......@@ -1558,17 +1596,24 @@ ENDIF ELSE IF nw EQ 'W' THEN BEGIN ;WOUDC source file
ENDIF
ENDIF
ENDIF
ENDIF ELSE IF (nw EQ 'S') OR (nw EQ 'E') THEN BEGIN
ENDIF ELSE IF (nw EQ 'S') OR (nw EQ 'E') OR (nw EQ 'A') THEN BEGIN
;Determine file_creation_date - format is DD MonthName[,] YYYY so change to YYYYMMDD
;Some SHADOZ also in the form Wed Apr 1 13:01:28 2020
file_creation_date='UNKNOWN'
IF nw EQ 'S' THEN fcdtext='SHADOZ FORMAT DATA CREATED' $
ELSE fcdtext='OZONE SONDE VERTICAL PROFILE DATA REPORT'
ELSE IF nw EQ 'E' THEN fcdtext='OZONE SONDE VERTICAL PROFILE DATA REPORT' $
ELSE fcdtext='FILE CREATION DATE'
di=WHERE(STRUPCASE(STRMID(ndacc,0,STRLEN(fcdtext))) EQ fcdtext,dcnt)
IF dcnt NE 0 THEN BEGIN
res=STRSPLIT(ndacc[di[0]],' :,',/EXTRACT,count=nres)
IF (STRLEN(res[nres-1]) EQ 8) AND (IS_A_NUMBER_T(res[nres-1])) AND (nres GE 5) THEN BEGIN
;Format already in YYYYMMDD format
file_creation_date=res[nres-1] & nres=0
ENDIF ELSE IF ((nres EQ 11) AND (nw EQ 'S')) OR (nw EQ 'A') THEN BEGIN
;value is SYSTIME format
file_creation_date=STRTRIM(STRMID(ndacc[di[0]],STRPOS(ndacc[di[0]],':')+1),2)
CALC_MJD2000,'SYSTIME to ISO8601','',file_creation_date,'',iso8601, metaok
IF metaok EQ '' THEN file_creation_date=iso8601
ENDIF ELSE IF nres GT 3 THEN BEGIN
res[1]=res[nres-3]+' '+res[nres-2]+' '+ res[nres-1] & nres=2
ENDIF ELSE nres=0
......@@ -1677,7 +1722,7 @@ FOR i=0,nsb-1L DO BEGIN
IF dcntx EQ 0 THEN dcnt=0 ;if dcnt eq 0 then no checks will take place, unless nw eq 'S' or 'E'
ENDFOR
sl=0L & gatxt=''
IF (dcnt NE 0) OR (nw EQ 'S') OR (nw EQ 'E') THEN BEGIN ;Further checks done on res1 for SHADOZ and NOAA
IF (dcnt NE 0) OR (nw EQ 'S') OR (nw EQ 'E') OR (nw EQ 'A') THEN BEGIN ;Further checks done on res1 for SHADOZ and NOAA
resx=['']
IF nw EQ 'W' THEN BEGIN
READ_WOUDC_SECTION,ndacc,di[0],resx
......@@ -1686,7 +1731,12 @@ FOR i=0,nsb-1L DO BEGIN
ENDIF ELSE IF nw EQ 'C' THEN BEGIN
resx=STRSPLIT(ndacc[di[0]],'=',/EXTRACT,COUNT=sl)
resx=STRTRIM(resx,2) & dyr=0.
ENDIF ELSE IF (nw EQ 'S') OR (nw EQ 'E') THEN BEGIN
ENDIF ELSE IF nw EQ 'A' THEN BEGIN
resx=strarr(2)
resh=STRSPLIT(ndacc[di[0]],' ',/EXTRACT,COUNT=sl)
resx[0]=res[1] & resx[1]=resh[sl-1] & sl=2
resx=STRTRIM(resx,2) & dyr=0.
ENDIF ELSE IF (nw EQ 'S') OR (nw EQ 'E')THEN BEGIN
IF STRPOS(res(0),'DATE') NE -1 THEN BEGIN
;Extract values to be converted
resy=STRSPLIT(res[1],'+',/EXTRACT,count=nresy)
......@@ -2078,7 +2128,7 @@ IF conv_test THEN BEGIN
si2[j-1]=si2i[0]
ENDFOR
IF ((nw EQ 'W') OR (nw EQ 'S') OR (nw EQ 'E')) AND (STRPOS(res[3],conv_chk[4]) NE -1) THEN BEGIN
IF ((nw EQ 'W') OR (nw EQ 'S') OR (nw EQ 'E') OR (nw EQ 'A')) AND (STRPOS(res[3],conv_chk[4]) NE -1) THEN BEGIN
;Read in values required for interpolation (same method as reading in Global Attribute data from WOUDC files)
di=WHERE(STRUPCASE(ndacc) EQ STRUPCASE(STRMID(res[1],0,STRPOS(res[1],'_',/REVERSE_SEARCH))),dcnt)
int_val=[DOUBLE(mv)] ;default set of interpolated values
......@@ -2291,7 +2341,7 @@ IF STRPOS(STRUPCASE(res[3]),'YMDHMS') EQ -1 THEN BEGIN
ENDIF
;Account for missing or out-of range time values in the SHADOZ, NOAA and WOUDC files
IF ((nw EQ 'S') OR (nw EQ 'W') OR (nw EQ 'E')) AND (STRUPCASE(res[0]) EQ 'DATETIME') THEN BEGIN
IF ((nw EQ 'S') OR (nw EQ 'W') OR (nw EQ 'E') OR (nw EQ 'A')) AND (STRUPCASE(res[0]) EQ 'DATETIME') THEN BEGIN
ndsize=N_ELEMENTS(dsizx)
IF (mcnt EQ 0) OR ((mcnt EQ 1) AND (woudcstart EQ 1)) THEN BEGIN ;no accompanying time after launch values
;Create DATETIME values based on an ascent rate of 5 m/s
......@@ -2587,7 +2637,7 @@ IF STRPOS(res[3],'MJD2000') NE -1 THEN BEGIN
ENDFOR
ENDIF
;Check for missing duration values in ozonesonde profile and interpolate
IF ((nw EQ 'W') OR (nw EQ 'S') OR (nw EQ 'E') or (ntimefix)) AND $
IF ((nw EQ 'W') OR (nw EQ 'S') OR (nw EQ 'E') OR (nw EQ 'A') OR (ntimefix)) AND $
(STRUPCASE(res[0]) EQ 'DATETIME') AND (mcnt NE 0L) THEN BEGIN
fi=WHERE(dsize EQ fv,fcnt)
IF fcnt NE 0 THEN BEGIN ;fill values present in the DATETIME
......@@ -2788,7 +2838,7 @@ dbhdr=1 ;default value for NDACC files to indicate presence of database header l
READ_INPUT,ftest[0:2],ndacc,wgtem,table,metadata,sectionb,ga,nw,mv_meta,data,mv_dbl,mv_lon,mv_dim,dbhdr
IF metadata[0] EQ '' THEN metaok='Metadata not able to be extracted from the Translation Table.' $
ELSE IF (nw NE 'N') AND (nw NE 'W') AND (nw NE 'C') AND (nw NE 'S') AND (nw NE 'E') THEN $
ELSE IF (nw NE 'N') AND (nw NE 'W') AND (nw NE 'C') AND (nw NE 'S') AND (nw NE 'E') AND (nw NE 'A') THEN $
metaok='NASA/AMES file can''t be read by xchgread.' $
ELSE metaok=''
......@@ -2813,6 +2863,11 @@ CASE 1 OF
res=STRSPLIT(ndacc[pi[0]],'(:',/EXTRACT)
stid=STRUPCASE(STRTRIM(res[1],2))
END
nw EQ 'A': BEGIN
pi=WHERE(STRMID(STRUPCASE(ndacc),0,7) EQ 'STATION')
res=STRSPLIT(ndacc[pi[0]],' ',/EXTRACT,COUNT=sres)
stid=STRUPCASE(STRTRIM(res[sres-1],2))
END
ELSE: stid='xxx'
ENDCASE
......@@ -2839,6 +2894,7 @@ IF nw EQ 'N' THEN BEGIN
IF mv_meta.ffi NE 2160 THEN stid=[data.x[0],REFORM(data.a[0,*])] $ ;equals the first measurement header line
ELSE stid=[REFORM(data.a[0,*])]
ENDIF
IF metaok EQ '' THEN $
UPDATE_GLOBAL_ATTRIBUTES,stid,ndacc,mv_meta,ga,sectionb,nw,metaok,file_creation_date,dbhdr
......@@ -2848,7 +2904,12 @@ IF metaok EQ '' THEN BEGIN
nmeas=N_ELEMENTS(data.x)
;Set array to hold housekeeping information
ndhse=STRARR(nhse+1)
ci=WHERE(STRPOS(STRUPCASE(mv_meta.aname),STRUPCASE(sectionb[0])) NE -1,ccnt)
rlev=STRSPLIT(sectionb[0],'|',/EXTRACT,COUNT=lvnmcnt)
lvnm=0
REPEAT BEGIN
ci=WHERE(STRPOS(STRUPCASE(mv_meta.aname),STRUPCASE(rlev[lvnm])) NE -1,ccnt)
lvnm++
ENDREP UNTIL (ccnt NE 0) OR (lvnm EQ lvnmcnt)
IF ccnt NE 0 THEN lv=ci[0]+1 $
ELSE metaok='Number of Data levels for the measurement not able to be determined.'
;Extract NDACC scale factors and missing data values
......@@ -2868,7 +2929,7 @@ IF metaok EQ '' THEN BEGIN
axname=[STRTRIM(mv_meta.xname[1],2),STRTRIM(mv_meta.aname,2)]
;make array of profile name values, matching profile data order
pname=[STRTRIM(mv_meta.xname[0],2),STRTRIM(mv_meta.vname,2)]
ENDIF ELSE IF (nw EQ 'S') OR (nw EQ 'E') THEN BEGIN
ENDIF ELSE IF (nw EQ 'S') OR (nw EQ 'E') OR (nw EQ 'A') THEN BEGIN
colsclfill=[1.D,-90000.D] & hsesclfill=[1.D,-90000.d]
fvals='Missing or bad values'
fi=WHERE(STRMID(ndacc,0,STRLEN(fvals)) EQ fvals)
......@@ -3109,7 +3170,7 @@ IF metaok EQ '' THEN BEGIN
ENDIF
ENDIF
ENDIF
ENDIF ELSE IF (nw EQ 'W') OR (nw EQ 'S') OR (nw EQ 'E') THEN BEGIN ;WOUDC, SHADOZ or NOAA style
ENDIF ELSE IF (nw EQ 'W') OR (nw EQ 'S') OR (nw EQ 'E') OR (nw EQ 'A') THEN BEGIN ;WOUDC, SHADOZ or NOAA style
mv=STRTRIM(LONG(colsclfill[1]),2) ;dummy value in holddata (if changing need to also change value in WRITE_DATA routine)
sbi=INTARR(n_sds-1) ;array to hold the valid section (b) index values for each variable
;Values below are listed more than once in the translation table file
......@@ -3139,6 +3200,15 @@ IF metaok EQ '' THEN BEGIN
itxt='SHADOZ'
nchk=IS_A_NUMBER_T(STRTRIM(ndacc[0],2))
IF nchk THEN nhl=LONG(ndacc[0])
ENDIF ELSE IF nw EQ 'A' THEN BEGIN
itxt='AEOLUS'
li=WHERE(STRMID(STRUPCASE(STRTRIM(ndacc,2)),0,3) EQ 'N ;',nchk)
IF nchk NE 0 THEN nhl=li[0]+2L
;remove ';' from the profile measurements
FOR j=nhl,N_ELEMENTS(ndacc)-1L DO BEGIN
scres=STRSPLIT(ndacc[j],';',/EXTRACT,COUNT=sccnt)
ndacc[j]=STRING(FORMAT='('+STRTRIM(sccnt,2)+'a)',scres)
ENDFOR
ENDIF ELSE BEGIN
itxt='NOAA-ESRL'
;Determine number of lines to get to profile label
......@@ -3154,14 +3224,18 @@ IF metaok EQ '' THEN BEGIN
ENDELSE
ENDIF
ENDELSE
IF nx NE 0L THEN BEGIN
;Extract Column Descriptor Line, and assign resx the profile information only
IF nw EQ 'W' THEN BEGIN
col_desp=STRSPLIT(resx[0],',',/EXTRACT) & col_desp=STRUPCASE(STRTRIM(col_desp,2))
ENDIF ELSE BEGIN ;separate out SHADOZ/NOAA column names and units
col_desp=STRSPLIT(resx[0],' ',/EXTRACT) & col_desp=STRTRIM(col_desp,2)+'-'
cd2=STRSPLIT(resx[1],' ',/EXTRACT)
col_desp=STRUPCASE(col_desp+STRTRIM(cd2,2))
ENDIF ELSE BEGIN ;separate out SHADOZ/NOAA/AEOLUS column names and units
IF nw EQ 'A' THEN spls=';' ELSE spls=' '
col_desp=STRSPLIT(resx[0],spls,/EXTRACT) & col_desp=STRTRIM(col_desp,2)
cd2=STRSPLIT(resx[1],spls,/EXTRACT)
IF nw EQ 'A' THEN BEGIN
cd2=['',cd2] & col_desp=STRUPCASE(col_desp)
ENDIF ELSE col_desp=STRUPCASE(col_desp+'-'+STRTRIM(cd2,2))
ENDELSE
holddata=STRARR(nx,n_sds)+mv
;Read in each dataset in order given by Section (b)
......@@ -3211,7 +3285,7 @@ IF metaok EQ '' THEN BEGIN
;Find Section
sltln=-999.
;STOP,lres[0]
;STOP,lres
IF (nw EQ 'S') AND (STRPOS(lres[0],'|') NE -1) THEN BEGIN
vres=STRSPLIT(lres[0],'|',/EXTRACT,COUNT=cres)
IF res[0] EQ 'AUXILIARY.PARAMETERS' THEN BEGIN
......@@ -3229,13 +3303,14 @@ IF metaok EQ '' THEN BEGIN
ENDELSE
ENDIF
IF ((nw EQ 'S') OR (nw EQ 'E')) AND (lres[0] EQ '#PROFILE') THEN scnt=1 $
IF ((nw EQ 'S') OR (nw EQ 'E') OR (nw EQ 'A')) AND (lres[0] EQ '#PROFILE') THEN scnt=1 $
ELSE si=WHERE(STRMID(STRUPCASE(ndacc),0,STRLEN(lres[0])) EQ lres[0],scnt)
IF (scnt NE 0) OR ((lc EQ sccnt) AND (sccnt GT 1)) OR (aplabel[0] NE '-1') THEN BEGIN
IF STRUPCASE(res[2]) EQ 'NX' THEN BEGIN ;data already read in so identify correct column
IF scnt NE 0 THEN BEGIN
vsz=nx & resy=resx
IF (nw EQ 'S') OR (nw EQ 'E') THEN vsz++ ;to account for the extra header line so all profile data read in OK
IF (nw EQ 'S') OR (nw EQ 'E') OR (nw EQ 'A') THEN vsz++ ;to account for the extra header line so all profile data read in OK
li=WHERE(lres[nlres-1] EQ col_desp,nlres)
IF (sccnt NE 0) AND (nlres NE 0) THEN BEGIN
;PUMP_CORRECTION is part of the Profile information
......@@ -3249,9 +3324,14 @@ IF metaok EQ '' THEN BEGIN
vs=LONG(res[2]) & resy=STRARR(vs+1L)
ENDIF ELSE resy=['']
IF (nw EQ 'W') AND (scnt NE 0) THEN READ_WOUDC_SECTION,ndacc,si[0],resy,aplabel,lc,lres $
ELSE IF (nw EQ 'S') OR (nw EQ 'E') THEN BEGIN
ELSE IF (nw EQ 'S') OR (nw EQ 'E') OR (nw EQ 'A') THEN BEGIN
IF scnt NE 0 THEN BEGIN
resy=STRSPLIT(ndacc[si[0]],':',/EXTRACT,COUNT=nresy)
IF nw EQ 'A' THEN BEGIN
nresy=2 & resy=STRARR(nresy)
resy[0]=res[1]
resy[1]=STRMID(STRTRIM(ndacc[si[0]],2),STRLEN(res[1])+1)
IF IS_A_NUMBER_T(resy[1]) THEN resy[1]=STRTRIM(FLOAT(resy[1]),2)
ENDIF ELSE resy=STRSPLIT(ndacc[si[0]],':',/EXTRACT,COUNT=nresy)
resy=STRTRIM(resy,2)
;remove any commas in entries
FOR m=0,nresy-1 DO BEGIN
......@@ -3276,7 +3356,7 @@ IF metaok EQ '' THEN BEGIN
ENDIF
ENDIF
;STOP,aplabel[lc,*]
ENDIF ELSE IF (aplabel[0] NE '-1') AND ((nw EQ 'S') OR (nw EQ 'E')) THEN BEGIN
ENDIF ELSE IF (aplabel[0] NE '-1') AND ((nw EQ 'S') OR (nw EQ 'E') OR (nw EQ 'A')) THEN BEGIN
IF STRUPCASE(STRMID(aplabel[lc,0],0,29)) EQ 'CORRECTION FACTOR (COL2/COL1)' THEN $
;special case for correction factor - change to -9 to indicate no correction applied
aplabel[lc,1]='-9.0000'
......@@ -3408,7 +3488,7 @@ IF metaok EQ '' THEN BEGIN
gcnt=0
IF j NE n_sds-1 THEN BEGIN ;SOURCE.PRODUCT handled separately
;Write Variable Attributes to the structure
IF (nw EQ 'W') OR (nw EQ 'S') OR (nw EQ 'E') THEN BEGIN
IF (nw EQ 'W') OR (nw EQ 'S') OR (nw EQ 'E') OR (nw EQ 'A') THEN BEGIN
res=STRSPLIT(sectionb[sbi[j]],',',/EXTRACT,COUNT=rcnt)
res=STRTRIM(res,2)
ENDIF ELSE BEGIN
......@@ -3495,7 +3575,7 @@ IF metaok EQ '' THEN BEGIN
;add comment regarding missing DATETIME values
itxt='WARNING: Some DATETIME values have been interpolated or extrapolated - '
itxt=itxt+'please check the original file as given in SOURCE.PRODUCT.'
ENDIF ELSE IF (nmissing EQ nxprof[0]) AND ((nw EQ 'S') OR (nw EQ 'W') OR (nw EQ 'E') OR (nw EQ 'N')) THEN BEGIN
ENDIF ELSE IF (nmissing EQ nxprof[0]) AND ((nw EQ 'S') OR (nw EQ 'W') OR (nw EQ 'E') OR (nw EQ 'N') OR (nw EQ 'A')) THEN BEGIN
;add comment regarding assumed ascent rate
itxt='WARNING: No DATETIME values present in the source file (refer to '
itxt=itxt+'SOURCE.PRODUCT entry). DATETIME values estimated by assuming an '
......@@ -3561,7 +3641,7 @@ IF metaok EQ '' THEN BEGIN
;Create dataset for the attribute
IF j NE n_sds-1 THEN BEGIN ;SOURCE.PRODUCT handled separately
IF (nw EQ 'N') OR (nw EQ 'W') OR (nw EQ 'S') OR (nw EQ 'E') THEN BEGIN
IF (nw EQ 'N') OR (nw EQ 'W') OR (nw EQ 'S') OR (nw EQ 'E') OR (nw EQ 'A') THEN BEGIN
IF (nw EQ 'N') AND (res[0] EQ spec_case[0]) THEN datasize=holddata[0:apcnt-1,ncol+1] $
ELSE BEGIN
datasize=[0L] ;initialize datasize
......@@ -3591,7 +3671,7 @@ IF metaok EQ '' THEN BEGIN
ssi=WHERE(STRPOS(ndacc,ss[m]) NE -1,ssn)
IF ssn NE 0 THEN si[m]=ssi
ENDFOR
ENDIF ELSE IF (nw EQ 'W') OR (nw EQ 'S') OR (nw EQ 'E') THEN BEGIN
ENDIF ELSE IF (nw EQ 'W') OR (nw EQ 'S') OR (nw EQ 'E') OR (nw EQ 'A') THEN BEGIN
si=j & axname='' & pname=''
ENDIF ELSE BEGIN
supaxname=STRUPCASE(axname) & supres1=STRUPCASE(res[1])
......@@ -3676,6 +3756,7 @@ IF metaok EQ '' THEN BEGIN
ELSE IF nw EQ 'W' THEN nwtext='WOUDC' $
ELSE IF nw EQ 'S' THEN nwtext='SHADOZ' $
ELSE IF nw EQ 'E' THEN nwtext='NOAA.ESRL' $
ELSE IF nw EQ 'A' THEN nwtext='AEOLUS' $
ELSE BEGIN
IF STRPOS(ftest[2],'globwave') NE -1 THEN nwtext='Globwave netCDF' $
ELSE nwtext='MyOcean netCDF'
......@@ -3769,7 +3850,7 @@ FUNCTION cds_tools, listf, tav, outdir, dataformat, DATETIME=o1
;Initialize statusflag, and exit_code
statusflag='' & dum='' & exit_code=3
cdver='cds_tools version 2.0b63, 2020-03-11'
cdver='cds_tools version 2.0b66, 2021-06-17'
;Check input parameters
IF N_PARAMS() LT 3 THEN $
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment