rem ************************** rem Histogram rem ************************** set inp_org=inp_PRB_DM.txt set out_text=out_DM_HISTO.txt set wd=10 set xlabel="Maximum daily rainfall (mm/day)" set fig_out=fig_DM_HISTO.eps minmax %inp_org% -H1 > %out_text% pshistogram %inp_org% -W%wd% -IO -H1 >> %out_text% gawk "{if(NR==1){nd=$4;str0=$5}}END{sub(//,\"\",str0);split(str0,a,\"/\");print nd,a[1],a[2]}" %out_text% > _tempdat.txt gawk "{printf \"0.95 0.95 12 0 0 MR n=%%g\n\",$1}" _tempdat.txt > _txtdat.txt gawk "{printf \"0.95 0.90 12 0 0 MR min=%%g\n\",$2}" _tempdat.txt >> _txtdat.txt gawk "{printf \"0.95 0.85 12 0 0 MR max=%%g\n\",$3}" _tempdat.txt >> _txtdat.txt gmtset ANOT_FONT_SIZE 14 gmtset LABEL_FONT_SIZE 14 gmtset TICK_LENGTH -0.2c pshistogram %inp_org% -JX15/10 -B:%xlabel%:/:"Frequency":WSen -H1 -W%wd% -L0.5p -G230 -Z0 -P -K > %fig_out% pstext _txtdat.txt -R0/1/0/1 -J -N -P -O -K >> %fig_out% gawk "BEGIN{FS=\",\"}{if(NR==1)printf \"0.5 1.02 12 0 0 BC %%s\n\",$0}" %inp_org% | pstext -R -J -N -P -O >> %fig_out% set inp_org=inp_PRB_YT.txt set out_text=out_YT_HISTO.txt set wd=50 set xlabel="Yearly total rainfall (mm/year)" set fig_out=fig_YT_HISTO.eps minmax %inp_org% -H1 > %out_text% pshistogram %inp_org% -W%wd% -IO -H1 >> %out_text% gawk "{if(NR==1){nd=$4;str0=$5}}END{sub(//,\"\",str0);split(str0,a,\"/\");print nd,a[1],a[2]}" %out_text% > _tempdat.txt gawk "{printf \"0.95 0.95 12 0 0 MR n=%%g\n\",$1}" _tempdat.txt > _txtdat.txt gawk "{printf \"0.95 0.90 12 0 0 MR min=%%g\n\",$2}" _tempdat.txt >> _txtdat.txt gawk "{printf \"0.95 0.85 12 0 0 MR max=%%g\n\",$3}" _tempdat.txt >> _txtdat.txt gmtset ANOT_FONT_SIZE 14 gmtset LABEL_FONT_SIZE 14 gmtset TICK_LENGTH -0.2c pshistogram %inp_org% -JX15/10 -B:%xlabel%:/:"Frequency":WSen -H1 -W%wd% -L0.5p -G230 -Z0 -P -K > %fig_out% pstext _txtdat.txt -R0/1/0/1 -J -N -P -O -K >> %fig_out% gawk "BEGIN{FS=\",\"}{if(NR==1)printf \"0.5 1.02 12 0 0 BC %%s\n\",$0}" %inp_org% | pstext -R -J -N -P -O >> %fig_out% set inp_org= set out_text= set wd= set xlabel= set fig_out= del .gmt* del _*