"reinit" "set display color white"; "c" Mon.1="Jan"; Mon.2="Feb"; Mon.3="Mar"; Mon.4="Apr"; Mon.5="May"; Mon.6="Jun" Mon.7="Jul"; Mon.8="Aug"; Mon.9="Sep"; Mon.10="Oct"; Mon.11="Nov"; Mon.12="Dec" L.1="OBS"; L.2="LT=1 mon"; L.3="LT=2 mon"; L.4="LT=3 mon"; L.5="LT=4 mon"; L.6="LT=5 mon"; Var.1="Monthly Precipitation"; Var.2="Monthly 2m-Temperature"; Var.3="Monthly Maximun Temperature"; Var.4="Monthly Minimum Temperature" Varn.1="Pr"; Varn.2="T2m"; Varn.3="Tx"; Varn.4="Tm" Dir_Inp="/home/tanpv/Data/562_VNU/0.25_VN/Dr_IDXs/" Dat_out="/home/tanpv/Data/562_VNU/PDF/" * V.1="obs"; V.2="mod"; V.3="cli"; V.4="mlr"; V.5="ann" * V.1="obs_01"; V.2="obs_03"; V.3="obs_06"; V.4="cli_01"; V.5="cli_03";V.6="cli_06" V.1="obs_01"; V.2="obs_03"; V.3="obs_06"; V.4="mod_01"; V.5="cli_01";V.6="ann_01" L.1=1; L.2=3; L.3=6; Nvar=6 ;* 5 Ncol=Nvar; Nrow=4 ;* 5 cases, 4 months (1,4,7,10) y00=10.5; y01=0.0 dy=(y00-y01)/Nrow x00=0.5; x01=8.0 dx=(x01-x00)/Ncol ;* SPEI_RegCM_lead_1.nc Model="RegCM" imem=3 * "sdfopen "Dir_Inp "SPEI_" Model "_lead_" Lead ".nc" SYr=2015 * SYr=2012 ;* Plot from this year Nt1=(SYr-1982)*12+1; Nt2=480; year=1982+(Nt1-1)/12-1 imon=Nt1; i=0 While (imon1); y2=y11+0.15; y1=y2-dy; y11=y1; endif "set t "it icol=0; While (icol1); x1=x11-0.08; x2=x1+dx; x11=x2; endif "set parea "x1" "x2" "y1" "y2 "set mpdraw off"; "set frame off"; "set xlab off";"set ylab off" * if (icol<=3); Dr_Clor(); "d "V.icol; endif * if (icol>3); Pr_Clor(); "d "V.icol; endif if (icol<=3); DrO_Clor(); "d "V.icol; endif if (icol>3); DrF_Clor(); "d "V.icol; endif if (irow=1); draw_tit((x1+x2)/2-0.1, y2, V.icol); endif imon=1+(irow-1)*3 if (icol=1); draw_ver_tit(x1, (y1+y2)/2, Mon.imon); endif * if (irow=1); * if (ivar=1); R_Clor(); else; T_Clor(); endif * "d bias(z=7)"; * "xcbar "x01-0.45" "x01-0.30" "y00-dy+0.1" "y00" -fs 3 -xo 0.1 -fw 0.08 -fh 0.1 -fx -0.0 -line on " * endif * if (irow>1); * if (ivar=1); R_Bias_Clor(); else; T_Bias_Clor(); endif * "d bias(z="ilead")"; * endif * if (icol=1); draw_ver_tit(x00-0.1, (y1+y2)/2, L.irow); endif * if (irow=1); draw_tit((x1+x2)/2-0.05, y00+0.05, Mon.icol); endif * Sub_Reg2 * HSTS * "Title_lonlat -lon " 112.8 " -lat " 14.500 " -siz " 0.07 " -ang "0 " -tit "HSa"" * "Title_lonlat -lon " 113.5 " -lat " 8.250 " -siz " 0.07 " -ang "0 " -tit "TSa"" * "hatch pv 0 0.05 -angle 135 -int 0.05 -color 1 -thickness 0.01 -type 1 -density 0.01" if (irow=Nrow) if (icol=3); "xcbar "x2-3*dx+0.2" "x2-0.2" "y01+0.2" "y01+0.4" -fs 1 -xo 0.1 -fw 0.08 -fh 0.1 -fx -0.0 -line on "; endif if (icol=6); "xcbar "x2-3*dx+0.2" "x2-0.2" "y01+0.2" "y01+0.4" -fs 1 -xo 0.1 -fw 0.08 -fh 0.1 -fx -0.0 -line on "; endif endif Endwhile Endwhile * "xcbar "x01-0.45" "x01-0.25" "y01+0.7" "y00-0.2" -fs 1 -xo 0.1 -fw 0.08 -fh 0.1 -fx -0.0 -line on " Main_tit((x00+x01)/2, y00+0.35, "Drought: Obs and Model") Main_tit((x00+x01)/2, y00+0.15, "Year: "year" - Leadtime="L.iz" months") * "gxprint " Dat_out Varn.ivar "_Obs_and_Bias_Clim_" Model ".png png" pull dd "c" "close 1" Endwhile Endwhile * "close 1" ******************************************************* function Main_tit(x, y, title) "set string 1 c 5.5 0"; "set strsiz 0.11 0.11" "draw string "x" "y" "title "set string 1 c 5.5 0" return ******************************************************* function draw_tit(x, y, title) "set string 1 c 5.5 0"; "set strsiz 0.09 0.10" "draw string "x" "y" "title "set string 1 c 5.5 0" return ******************************************************* function draw_ver_tit(x, y, title) "set string 1 c 5.5 90"; "set strsiz 0.09 0.10" "draw string "x" "y" "title "set string 1 c 5.5 0" return ******************************************************* function Line_pl(mark,colo,thick,styl) "set gxout line" *"set gxout stnmark" "set cmark "mark "set ccolor "colo "set cthick "thick "set cstyle "styl return ******************************************** function Bar_pl(clor,gap) "set gxout bar" "set ccolor "clor "set bargap "gap "set barbase 0" "set baropts outline" "set cthick 2" "set baropts filled" *"set ccolor 1" return ******************************************** function DrO_Clor() * levels = " -2 -1.5 -1 0 1 1.5 2 " * "run color.gs -gxout grfill -kind darkred->red->yellow->white-(0)->white->cyan->blue->darkblue -levs " levels levels = " -0.5 0 1.0 " "run color.gs -gxout grfill -kind red->white-(0)->white->blue -levs " levels "set grads off" return ******************************************** function DrF_Clor() * levels = " -2 -1.5 -1 0 1 1.5 2 " * "run color.gs -gxout grfill -kind darkred->red->yellow->white-(0)->white->cyan->blue->darkblue -levs " levels levels = " -0.5 0 1.3 " "run color.gs -gxout grfill -kind red->white-(0)->white->green -levs " levels "set grads off" return ******************************************** function T_Clor() levels = " 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 " "run color.gs -gxout grfill -kind lightgreen->yellow->orange->red -levs " levels "set grads off" return ******************************************** function Pr_Clor() * levels = " 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 " levels = " 0.8 0.85 0.9 0.95 " "run color.gs -gxout grfill -kind white->yellow->orange->red->darkred -levs " levels "set grads off" return ******************************************** function R_Clor() * levels = " 10 30 50 70 100 150 200 250 300 350 400 450 500 550 600 650 700 750 800 " * "run color.gs -gxout grfill -kind lightgreen->yellow->orange->red -levs " levels levels = " 5 10 20 30 50 70 100 150 200 250 300 350 400 450 500 550 600 650 700 " "run color.gs -gxout grfill -kind green->lightgreen->yellow->orange->red -levs " levels * "run color.gs -gxout grfill -kind red->orange->yellow->lightgreen->green -levs " levels "set grads off" return