* "reinit" * "set display color white"; "c" * Yr_Ope=2024 * Mn_Ope=02 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" Lev.1="mild"; Lev.2="mord"; Lev.3="seve" Dr_lev.1="Mild drought"; Dr_lev.2="Moderate drought"; Dr_lev.3="Seve drought" * Dir_Inp="/home/tanpv/Progs/562_VNU/PDF_Ope/" * Dat_out="/home/tanpv/Progs/562_VNU/PDF_Ope/" Scale.1="1-month drought"; Scale.2="3-month drought"; Scale.3="6-month drought"; Tscal.1=1; Tscal.2=3; Tscal.3=6; Nlead=6; Nlev=3; Nscal=3 Ncol=Nlev; Nrow=1 ;* 5 cases, 4 months (1,4,7,10) y00=8.0; y01=0.8 dy=(y00-y01)/Nrow x00=0.5; x01=11.0 dx=(x01-x00)/Ncol-0.15 "sdfopen "Dir_Inp Dr_Prob.nc ;* "Drought probability" ilead=0 While (ilead12); Mon=Mon-12; Year=Year+1; endif * While (iscal1); y2=y11+0.15; y1=y2-dy; y11=y1; endif y2=y00; y1=y2-dy; ;* "set z "iscal While (ilev1); x1=x11+0.05; x2=x1+dx; x11=x2; endif "set parea "x1" "x2" "y1" "y2 "set mpdraw off"; "set frame on"; "set xlab on"; "set grid off"; "set ylab off";"set xlint 2"; "set ylint 2" if (ilev=1); "set ylab on"; "set grid off"; endif * if (icol=1) Dr_Clor() * else * Prob_Clor() * endif "set z "ilev; "set t "ilead "d dr_ens(t="ilead")" ;* "set gxout contour"; "set ccolor 1" Contour() "d dr_ens(t="ilead")" draw_tit((x1+x2)/2-0.1, y2, Tscal.icol"-month drought"); ;* 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 "set line 4 1 10" Sub_Reg2 * HSTS * "Title_lonlat -lon " 112.8 " -lat " 14.500 " -siz " 0.07 " -ang "0 " -tit "Hoang Sa"" * "Title_lonlat -lon " 113.5 " -lat " 8.250 " -siz " 0.07 " -ang "0 " -tit "Truong Sa"" "Title_lonlat -lon " 112.5 " -lat " 14.500 " -siz " 0.07 " -ang "0 " -tit "H_Sa"" "Title_lonlat -lon " 112.5 " -lat " 8.250 " -siz " 0.07 " -ang "0 " -tit "T_Sa"" "Title_lonlat -lon " 109 " -lat " 17.0 " -siz " 0.12 " -ang "300 " -tit "Bien_Dong"" * "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 "xcbar "x00+1" "x01-1.5" "y01-0.45" "y01-0.2" -fs 1 -xo 0.1 -fw 0.08 -fh 0.1 -fx -0.0 -line on "; Endwhile Main_tit(x00+0.5, y00+0.25, "Initial: "Yr_Ope"-"Mn_Ope) Main_tit((x00+x01)/2, y00+0.25, "Ensemble median of drought index for "Mon"-"Year) "gxprint " Dat_out "Dr_IDX_Lead_"ilead".png png" * pull dd "c" Endwhile "close 1" quit ******************************************************* function Main_tit(x, y, title) "set string 1 c 5.5 0"; "set strsiz 0.11 0.13" "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 Contour() * levels = " 5 10 15 20 25 30 35 40 45 50 55 60 70 80 90 " levels = " -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 " "set clevs " levels "set ccolor 4" "set gxout contour" "set grads off" return ******************************************** function Dr_Clor() * levels = " -2 -1.5 -1.25 -1 -0.75 -0.5 -0.25 0 0.25 0.5 0.75 1 1.25 1.5 2 " levels = " -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 " "run color.gs -gxout grfill -kind darkred->red->orange->yellow->white-(0)->white->aqua->lightblue->blue->darkblue -levs " levels "set grads off" return ******************************************** function Prob_Clor() levels = " 5 10 15 20 25 30 35 40 45 50 55 60 70 80 90 " * levels = " 10 20 30 50 70 90 " * "run color.gs -gxout grfill -kind green->lightgreen->yellow->orange->red -levs " levels "run color.gs -gxout grfill -kind white->lightyellow->yellow->orange->red->darkred -levs " levels "set grads off" return