; --------------------------------------------------------------------------------------- ; 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 ; plot_trop_col.pro ; con_lc.pro ; --------------------------------------------------------------------------------------- @read_TEMPO_hourly.pro @plot_trop_col.pro !quiet=1 ; For testing user choice of variables is deactivated! goto, skip1 ; 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 : ' ; if long(hh) ge 12 or long(hh) le 23 then begin ; goto, start_single ; RETURN ; END ; print, ' Please choose hours between 12:23 ' ; stop endif if avg eq 'avg' then begin hh1 = ' ' hh2 = ' ' READ, hh1, hh2, PROMPT='Enter hourly range between [12:23] e.g.,13,15 for 3 hours avg. : ' ; if (long(hh2) lt long(hh1)) then begin ; goto, start_average ; RETURN ; END ; print, ' Please choose averaging time between 12:23 ' ; STOp endif skip1: ;spc1 = ['GLYX','H2O','HCHO','NO2','O3','SO2'] ;for sp = 5, n_elements(spc1)-1 do begin ; This loop for species is temprorary ; spc = spc1[sp] spc = 'NO2' dd = '11' ;avg = 'hour' ;hh = '23' avg = 'avg' hh1 = 13 hh2 = 16 ; for hh1 = 12, 23 do begin ; This loop for hours is temporary and will be replaced by prompt commands in the prev section ; hh = strcompress(string(hh1),/remove_all) Print,'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/FRAPPE_TEMPO/Piyush/' 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, sp for n = 0, n_elements(wrf_stup)-1 do begin 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, 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 date_all = output.year+output.month+output.day time_all = output.hour+ ':'+ output.minute+ ':'+output.seconds lat_all = output.lat lon_all = output.lon column_all = output.column true_column_all = output.true_column trop_column_all = output.trop_column true_trop_column_all = output.true_trop_column true_profile_all = output.true_gas_profile[*,*,0] amf_all = output.amf_molec_spec swath_all = output.swath swath_files = output.swath file_all = 1 file_files = 1 hour_all = output.hour 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) outfl = strcompress(plot_path+'TEMPO_trop_colum_'+species[sp]+'_'+scenario[n]+$ '_'+dd+'aug_'+hh+'UTC.eps' ,/remove_all) plot_trop_col, 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 column_all = fltarr(xtrack,mstep, nfiles) trop_column_all = fltarr(xtrack,mstep, nfiles) true_column_all = fltarr(xtrack,mstep, nfiles) true_trop_column_all = fltarr(xtrack,mstep, nfiles) true_profile_all = fltarr(xtrack,mstep, nfiles) profile_all = fltarr(xtrack,mstep, nfiles) swath_all = fltarr(xtrack,mstep, nfiles) amf_all = fltarr(xtrack,mstep, nfiles) file_all = fltarr(xtrack,mstep, nfiles) lon_all = fltarr(xtrack,mstep, nfiles) lat_all = fltarr(xtrack,mstep, nfiles) date_all = strarr(nfiles) time_all = strarr(nfiles) swath_files = fltarr(nfiles) file_files = fltarr(nfiles) hour_all = intarr(xtrack,mstep, nfiles) str_in = uint(where(avl_hr eq hh1)) end_in = uint(where(avl_hr eq hh2)) print, str_in, end_in, nfiles for nf = str_in, end_in do begin print, nf, files[nf] read_TEMPO_hourly, files[nf], output help, output.lat date_all[nf] = output.year+output.month+output.day time_all[nf] = output.hour+ ':'+ output.minute+ ':'+output.seconds lat_all[*,0:ntimes-1,nf] = output.lat lon_all[*,0:ntimes-1,nf] = output.lon column_all[*,0:ntimes-1,nf] = output.column true_column_all[*,0:ntimes-1,nf] = output.true_column trop_column_all[*,0:ntimes-1,nf] = output.trop_column true_trop_column_all[*,0:ntimes-1,nf] = output.true_trop_column true_profile_all[*,0:ntimes-1,nf] = output.true_gas_profile[*,*,0] amf_all[*,0:ntimes-1,nf] = output.amf_molec_spec swath_all[*,0:ntimes-1,nf] = output.swath swath_files[nf] = output.swath file_all[*,0:ntimes-1,nf] = nf file_files[nf] = nf hour_all[*,0:ntimes-1, nf] = output.hour endfor ; 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 lat_avg = [] endfor endfor trop_col_avg[where(trop_col_avg lt 0.)] = !Values.F_NAN true_trop_col_avg[where(true_trop_col_avg lt 0.)] = !Values.F_NAN ;;print, minmax(true_trop_col_avg ,/NAN), minmax(trop_col_avg,/NaN) ; ploting section int = strcompress(string(hh2)+'-'+string(hh1), /remove_all) outfl = strcompress(plot_path+'TEMPO_trop_colum_'+species[sp]+'_'+scenario[n]+$ '_'+dd+'aug_avg_'+int+'UTC.eps' ,/remove_all) plot_trop_col, 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 ; endfor ; num hours (to be replaced) ;endfor ; num species ; ---------------------------------------------------------------------------- end