pro sofie_read_summary_s3_all,pat,iver,$ nsea,ver,hem,season,stitle,sea_num,sea_nums,nevent,nz,missing,$ orbit,event,mode,date,time,lat,lon,lst,doy,dfs,$ z,p,t,h2o,o3,ch4,zmes,pmes,tmes, $ ztop,zmax,zbot,zbot2,ice_pres,mxnlay,nlay,ztop_al,zmax_al,zbot_al, $ vice,mice,h2oi,aro,arp,aroi,icet,con,rm,dr,re,vfs,con_s,rm_s,dr_s,re_s, $ iwc,od,waves,oddv,con_od,rm_od,dr_od,re_od, vfs_od,con_s_od,rm_s_od,dr_s_od,re_s_od,$ b2,b3,b4,b8,b9,b10,c2 ;------------------------------------------------------------------------------------------------ ; Read, combine, & return SOFIE summary files (summary version "S3"), for many SOFIE PMC seasons ; File name example: sofie_summary_s3_V1.2_SH_2008-09.nc, sofie_summary_s3_V1.1_test_SH_2007-08.nc, ... ; ; Input: ; pat........path for the directory where the files are, string, e.g., '/users/mhervig/sofie/data/summary/V1.2/' ; routine will get all the "iver" files in pat ; iver.......SOFIE data version, string, e.g., 'V1.2' ; ; Output: ; nsea.......# seasons (files) obtained, scalar ; ver........version, strarr(nsea) ; hem........hemisphere ('NH' or 'SH'), strarr(nsea) ; season.....season year(s) ('e.g., '2010' or '2010-11'), strarr(nsea) ; stitle.....title of season (e.g., 'NH 2011'), strarr(nsea) ; sea_num....# assigned to each season (e.g., NH 2007 is 1), intarr(nsea) ; sea_nums...season # assigned to each event, intarr(nevent) ; nevent.....total # events obtained, scalar ; ; The rest of the variables are as defined in "sofie_read_summary_s3.pro" ; ; Source: Mark Hervig, GATS ; ;------------------------------------------------------------------------------------------------ ;- Get the file names in "pat" spawn, 'ls ' + pat + 'sofie_summary_s3_' + iver + '_*.nc', files nsea = n_elements(files) stitle = strarr(nsea) sea_num = intarr(nsea) print,'Getting ', nsea, ' seasons' print,' ' ;- sort files into time order psea = strarr(16) psea(0) = ['NH_2007'] psea(1) = ['SH_2007-08'] psea(2) = ['NH_2008'] psea(3) = ['SH_2008-09'] psea(4) = ['NH_2009'] psea(5) = ['SH_2009-10'] psea(6) = ['NH_2010'] psea(7) = ['SH_2010-11'] psea(8) = ['NH_2011'] psea(9) = ['SH_2011-12'] psea(10) = ['NH_2012'] psea(11) = ['SH_2012-13'] psea(12) = ['NH_2013'] psea(13) = ['SH_2013-14'] psea(14) = ['NH_2014'] psea(15) = ['SH_2014-15'] ;file name e.g., '/users/mhervig/sofie/data/summary/V1.2/sofie_summary_s3_V1.2_SH_2012-13.nc' ord = intarr(nsea) for i = 0,nsea-1 do begin f = file_basename(files(i)) l = strlen(iver) j = strpos(f,iver) h = strmid(f,j+l+1,2) if (h eq 'NH') then s = strmid(f,j+l+1,7) if (h eq 'SH') then s = strmid(f,j+l+1,10) k = where(psea eq s,n) ord(i) = k ; print,f,' ',h,' ',s,' ',k endfor s = sort(ord) files = files(s) ;- Loop over files (seasons) for i = 0,nsea-1 do begin sea_num(i) = i+1 file = files(i) print, file sofie_read_summary_s3,file,0,$ ver1,remarks,hem1,season1,nevent1,nz,missing, $ orbit1,event1,mode1,date1,time1,lat1,lon1,lst1,doy1,dfs1,los_head1, $ z,p1,t1,h2o1,o31,ch41,zmes1,pmes1,tmes1, $ ztop1,zmax1,zbot1,zbot21,ice_pres1,nlay_al1,ztop_al1,zmax_al1,zbot_al1, $ vice1,mice1,h2oi1,aro1,arp1,aroi1,icet1,con1,rm1,dr1,re1,vfs1,con_s1,rm_s1,dr_s1,re_s1, $ iwc1,od1,waves,oddv1,con_od1,rm_od1,dr_od1,re_od1, vfs_od1,con_s_od1,rm_s_od1,dr_s_od1,re_s_od1,$ ex_b21,ex_b31,ex_b41,ex_b81,ex_b91,ex_b101,ex_c21 ; print, hem1,' ',season1 h2ot1 = h2o1 + h2oi1 stitle(i) = hem1 + ' ' + strmid(season1,2,99) ;- combine the variables if (i eq 0) then begin ver = ver1 hem = hem1 season = season1 nevent = nevent1 orbit = orbit1 event = event1 mode = mode1 sea_nums = intarr(nevent1) + sea_num(i) date = date1 time = time1 lat = lat1 lon = lon1 lst = lst1 doy = doy1 dfs = dfs1 ice_pres = ice_pres1 nlay = nlay_al1 ztop = ztop1 zmax = zmax1 zbot = zbot1 zbot2 = zbot21 zmes = zmes1 pmes = pmes1 tmes = tmes1 p = p1 t = t1 h2o = h2o1 o3 = o31 ch4 = ch41 mice = mice1 vice = vice1 h2oi = h2oi1 aro = aro1 arp = arp1 icet = icet1 aroi = aroi1 h2ot = h2ot1 con = con1 rm = rm1 dr = dr1 re = re1 vfs = vfs1 con_s = con_s1 rm_s = rm_s1 dr_s = dr_s1 re_s = re_s1 iwc = iwc1 con_od = con_od1 rm_od = rm_od1 dr_od = dr_od1 re_od = re_od1 od = od1 oddv = oddv1 vfs_od = vfs_od1 con_s_od = con_s_od1 rm_s_od = rm_s_od1 dr_s_od = dr_s_od1 re_s_od = re_s_od1 b2 = ex_b21 b3 = ex_b31 b4 = ex_b41 b8 = ex_b81 b9 = ex_b91 b10 = ex_b101 c2 = ex_c21 endif if (i gt 0) then begin ver = [ ver,ver1] hem = [ hem,hem1] season = [ season,season1] nevent = nevent + nevent1 orbit = [ orbit,orbit1] event = [ event,event1] mode = [ mode,mode1] sea_nums = [sea_nums,intarr(nevent1) + sea_num(i)] date = [ date,date1] time = [ time,time1] lat = [ lat,lat1] lon = [ lon,lon1] lst = [ lst,lst1] doy = [ doy,doy1] dfs = [ dfs,dfs1] ice_pres = [ice_pres,ice_pres1] nlay = [nlay,nlay_al1] ztop = [ ztop,ztop1] zmax = [ zmax,zmax1] zbot = [ zbot,zbot1] zbot2 = [ zbot2,zbot21] zmes = [ zmes,zmes1] pmes = [ pmes,pmes1] tmes = [ tmes,tmes1] p = [ [p],[p1] ] t = [ [t],[t1] ] h2o = [ [h2o],[h2o1] ] o3 = [ [o3],[o31] ] ch4 = [ [ch4],[ch4] ] mice = [ [mice],[mice1] ] vice = [ [vice],[vice1] ] h2oi = [ [h2oi],[h2oi1] ] aro = [ [aro],[aro1] ] arp = [ [arp],[arp1] ] icet = [ [icet],[icet1] ] aroi = [ [aroi],[aroi1] ] h2ot = [ [h2ot],[h2ot1] ] re = [ [re],[re1] ] con = [ [con],[con1] ] rm = [ [rm],[rm1] ] dr = [ [dr],[dr1] ] vfs = [ [vfs],[vfs1]] con_s = [ [con_s],[con_s1]] rm_s = [ [rm_s],[rm_s1]] dr_s = [ [dr_s],[dr_s1]] re_s = [ [re_s],[re_s1]] iwc = [ iwc,iwc1] con_od = [ con_od,con_od1] rm_od = [ rm_od,rm_od1] dr_od = [ dr_od,dr_od1] re_od = [ re_od,re_od1] vfs_od = [ vfs_od,vfs_od1] con_s_od = [ con_s_od,con_s_od1] rm_s_od = [ rm_s_od,rm_s_od1] dr_s_od = [ dr_s_od,dr_s_od1] re_s_od = [ re_s_od,re_s_od1] b2 = [ [b2],[ex_b21]] b3 = [ [b3],[ex_b31]] b4 = [ [b4],[ex_b41]] b8 = [ [b8],[ex_b81]] b9 = [ [b9],[ex_b91]] b10 = [ [b10],[ex_b101]] c2 = [ [c2],[ex_c21]] endif endfor ;- done return end