; --------------------------------------------------------------------------------------- ; This code plots the spatial distribution of TEMPO derived true and ; derived tropospheric columns ; User can provide type of species, date (Aug 11, 12), averaging time ; ;- Procedures Used - ; read_TEMPO_hourly.pro ; spl_trop_col_only.pro ; con_lc.pro ; --------------------------------------------------------------------------------------- @read_TEMPO_hourly.pro @spl_trop_col_only.pro !quiet=1 ; Specify the species of interest as a string before reading; Read input from the terminal: spc = '' READ, spc, PROMPT='Enter one species of interest e.g., [GLYX, H2O, HCHO, NO2, O3, SO2]: ' ; Specify date of interest; Read input from the terminal: dd = '' READ, dd, PROMPT='Enter one date of interest (month is Aug) e.g., 11 or 12: ' ; Specify single or multiple hour input; Read input from the terminal: avg = '' READ, avg, PROMPT='Enter hourly/averaged output e.g., hour or avg: ' if avg eq 'hour' then begin hh = '' READ, hh, PROMPT='Enter one hour between [12:23] e.g.,13 : ' endif if avg eq 'avg' then begin hh1 = ' ' hh2 = ' ' READ, hh1, PROMPT='Enter hourly range between [12:23] (e.g.,13,15 for 3 hours avg.) Enter start hour: ' READ, hh2, PROMPT='Enter hourly range between [12:23] (e.g.,13,15 for 3 hours avg.) Enter end hour: ' endif ; ----------------------------------------------------------------------------------- ; Print,'1: CODE will generate 5 maps for 5 WRF simulations ' ; --------------------------- Paths and relevant Info --------------------------- species = ['GLYX','H2O','HCHO','NO2','O3','SO2'] spc_ttl = ['GLYOXAL','H!I2!NO','HCHO','NO!I2!N','O!I3!N','SO!I2!N'] tmp_path = '/home/pfister/TEMPO/FRAPPE_TEMPO/' plot_path= '/home/pfister/TEMPO/Piyush/plots/' wrf_stup = ['WRFV4_S05_d02_MOZAIC_final_adj_EPA2014_newWRF_2xOG/l2_synth/', $ 'WRFV4_S05_d02_MOZAIC_final_adj_EPA2014_newWRF_phys/l2_synth/', $ 'WRFV4_S05_d02_MOZAIC_final_adj_EPA2014_newWRF_RAQMS/l2_synth/',$ 'WRFV4_S05_d02_MOZAIC_final_NEI2011adj_newWRF/l2_synth/', $ 'WRFV4_S05_d02_MOZAIC_final_S05_newWRF/l2_synth/' ] prefix = 'TEMPO_201408' scenario = ['adj_EPA2014_newWRF_2xOG','adj_EPA2014_newWRF_phys', $ 'adj_EPA2014_newWRF_RAQMS','NEI2011adj_newWRF','S05_newWRF'] sp = uint(where(species eq spc)) ;print, '2: ',sp for n = 0, n_elements(wrf_stup)-1 do begin ; Finding number of TEMPO files for selected day and hour(s) file_nm = strcompress(tmp_path+wrf_stup[n]+prefix+dd+'_*h_CO_'+species[sp]$ +'.nc',/remove_all) files = file_search(file_nm, count=numfiles) avl_hr = strmid(files, strlen(tmp_path+wrf_stup[n]+prefix+dd+'_'), 2) ;print, '3: ',species[sp],' ',wrf_stup[n],' ',numfiles ; --------------------------------------------------------------------------- ; If single hour is chosen then this section of the code works if avg eq 'hour' then begin file_ind = where(avl_hr eq hh) filename = files[file_ind] read_TEMPO_hourly, filename, output lat_all = output.lat lon_all = output.lon trop_column_all = output.trop_column true_trop_column_all = output.true_trop_column trop_column_all[where(trop_column_all lt 0.)] = !Values.F_NAN true_trop_column_all[where(true_trop_column_all lt 0.)] = !Values.F_NAN ;print, minmax(true_trop_column_all ,/NAN), minmax(trop_column_all,/NAN) ;- plotting columns outfl = strcompress(plot_path+'TEMPO_trop_colum_'+species[sp]+'_'+scenario[n]+$ '_'+dd+'aug_'+hh+'UTC.eps' ,/remove_all) spl_trop_col_only, outfl, trop_column_all, true_trop_column_all, $ lat_all, lon_all, dd, hh, scenario[n], spc_ttl[sp], sp endif ; --------------------------------------------------------------------- ; If hourly average is chosed this section of the code works (Working on it..) if avg eq 'avg' then begin nfiles = long(hh2)-long(hh1)+1 ;- Declare arrays that would be used ; column is [mirrorstep, xtrack] mstep = 158 xtrack = 279 trop_column_all = fltarr(xtrack,mstep, nfiles) true_trop_column_all = fltarr(xtrack,mstep, nfiles) lon_all = fltarr(xtrack,mstep, nfiles) lat_all = fltarr(xtrack,mstep, nfiles) str_in = uint(where(avl_hr eq hh1)) end_in = uint(where(avl_hr eq hh2)) ;print,'4: ',str_in, end_in, nfiles for nf = str_in[0], end_in[0] do begin print,nf,' ',nf-str_in[0] read_TEMPO_hourly, files[nf], output help, output.trop_column lat_all[*,*,nf-str_in[0]] = output.lat lon_all[*,*,nf-str_in[0]] = output.lon trop_column_all[*,*,nf-str_in[0]] = output.trop_column true_trop_column_all[*,*,nf-str_in[0]] = output.true_trop_column endfor trop_column_all[where(trop_column_all lt 0.)] = !Values.F_NAN true_trop_column_all[where(true_trop_column_all lt 0.)] = !Values.F_NAN ; calculate and plot hourly averaged values lat_avg = fltarr(xtrack, mstep) lon_avg = fltarr(xtrack, mstep) trop_col_avg = fltarr(xtrack, mstep) true_trop_col_avg = fltarr(xtrack, mstep) for ii = 0, xtrack-1 do begin for jj = 0, mstep-1 do begin ; print, ii, jj lat_avg[ii,jj] = mean(reform(lat_all[ii,jj,*])) lon_avg[ii,jj] = mean(reform(lon_all[ii,jj,*])) trop_col_avg[ii,jj] = mean(reform(trop_column_all[ii,jj,*]),/NAN) true_trop_col_avg[ii,jj] = mean(reform(true_trop_column_all[ii,jj,*]),/NAN) endfor endfor ;print,'6: ', minmax(true_trop_col_avg ,/NAN), minmax(trop_col_avg,/NAN) ; ploting section int = strcompress(string(hh1)+'-'+string(hh2), /remove_all) outfl = strcompress(plot_path+'TEMPO_trop_colum_'+species[sp]+'_'$ +scenario[n]+'_'+dd+'aug_avg_'+int+'UTC.eps' ,/remove_all) spl_trop_col_only, outfl, trop_col_avg, true_trop_col_avg, $ lat_avg, lon_avg, dd, int, scenario[n], spc_ttl[sp], sp endif ; --------------------------------------------------------------- endfor ; num WRF simulatons ; ---------------------------------------------------------------------------- end