pro storload_lc,jday,yrss,ndays,cs,hltprgm ; modified from wcreek codes, the ppm file has 7 columns ;------------------------------------------------------------------------------ ; Initialize flag to stop program if main files are not present hltprgm = 0 ; The approximate total number of three minute intervals in ndays tot = 480.0*ndays ;------------------------------------------------------------------------------ ; IF ONE OR BOTH OF THE DESIRED FILES IS NOT PRESENT, THERE MUST BE AN ERROR ; STATEMENT INFORMING THE USER - NOT YET CREATED ;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------ ; Load slow CO2 files for ii = 0, (ndays-1) do begin yday = jday + ii if (yday lt 10) then jdays = '00' + strtrim(string(yday),2) if (yday lt 100 and yday ge 10) then jdays = '0' + strtrim(string(yday),2) if (yday ge 100) then jdays = strtrim(string(yday),2) yyddd = yrss+jdays ; cmd = "load_wc,'/data/davis2/wcreek/ppm/wc"+yyddd+".ppm',ppmtemp" ; r = execute(cmd) ; goto,try ; Aug 18 2000, changing for psu use ;;load_wc_stor,'/data/davis2/wcreek/ppm/wc'+yyddd+'.ppm',ppmtemp,err ;load_wc_stor,'/davis/s1/cheas/wcreek/ppm/wc'+yyddd+'.ppm',ppmtemp,err load_wc_stor,!loadppm +yyddd+'.ppm',ppmtemp,err if(err ne 0) then goto,bad_num goto, con1 bad_num: ppmtemp=fltarr(7,480)-999. k=0 a2=0 for i=0,480-1 do begin ppmtemp(0,i)=fix(jdays) a1=k*3 k=k+1 if(a1 ge 60)then begin k=1 a1=0 a2=a2+1 endif ppmtemp(1,i)=a2*100+a1 endfor con1: if(len(ppmtemp) ne 480) then begin ; if lack of some data, fill missing with badval ppmtemp1=fltarr(7,480)-999.0 k=0 a2=0 for i=0,480-1 do begin a1=k*3 k=k+1 if(a1 ge 60) then begin k=1 a1=0 a2=a2+1 endif ppmtemp1(0,i)=fix(jdays) ppmtemp1(1,i)=a2*100+a1 endfor ; for i=0,480-1 do begin ; if(ppmtemp1(1,i) eq ppmtemp(1,i)) then ppmtemp1(*,i)=ppmtemp(*,i) ; endfor FOR jj=0,len(ppmtemp)-1 DO begin for i=0,480-1 do begin if(ppmtemp1(1,i) eq ppmtemp(1,jj)) then BEGIN ppmtemp1(*,i)=ppmtemp(*,jj) GOTO, c1 ENDIF ENDFOR c1: ENDFOR ppmtemp=ppmtemp1 endif try: if (ii eq 0) then ppm = ppmtemp else ppm = [[ppm],[ppmtemp]] endfor ;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------ ;From the co2 array ;Initialize necessary data print,tot cs = fltarr(7,tot)-999. help,cs ; Extract data for the chosen days cs(0,*) = ppm(6,*) r = where (cs(0,*) eq -999.,c) if (c eq 480) then begin print,'.ppm file does not have sufficient data for the selected dates.' hltprgm = 1 endif cs=ppm ;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------ return end