"reinit" "set display color white"; "c" Dr_var="spei_12" * Dr_var="ori_pdsi" Nvar=5; Nrow=Nvar; Ncol=3; Nidx=24; Nt=360 Mod.1="1) MCA1"; Mod.2="2) MCA2"; Mod.3="3) MCA3"; Out_Dir="/home/tanpv/Progs/2021/PDF/" In_Dir="/home/tanpv/Progs/2021/NC/" * FU="U_Dr_SST_APH_spei_12.nc" * FV="V_Dr_SST_APH_spei_12.nc" * FAB="AB_Dr_SST_APH_spei_12.nc" FU="U_Dr_SST.nc" FV="V_Dr_SST.nc" FAB="AB_Dr_SST.nc" mark.1=0; mark.2=0; mark.3=0; mark.4=0; mark.5=0; mark.6=0; mark.7=0 colo.1=2; colo.2=4; colo.3=1; colo.4=1; colo.5=1; colo.6=1; colo.7=1 thic.1=5; thic.2=5; thic.3=5; thic.4=5; thic.5=5; thic.6=5; thic.7=5 * thic.1=8; thic.2=8; thic.3=8; thic.4=8; thic.5=8; thic.6=8; thic.7=12 styl.1=1; styl.2=1; styl.3=1; styl.4=1; styl.5=1; styl.6=1; styl.7=1; Va.1="a) SPEI"; Va.2="b) SST" Ncol=2; Nrow=3 y00=10.6; y01=4.5 dy=(y00-y01)/3-0.1 x00=0.5; x01=8.2 * dx=(x01-x00)/3 dx=dy VRa=" -120 120 "; VIa=30 VRb.1=" -30 30 "; VRb.2=" -10 10 "; VRb.3=" -10 10 "; VRb.4=" -8 8 "; VRb.5=" -8 8 "; VIb.1=8; VIb.2=3; VIb.3=3; VIb.4=2; VIb.5=2; * Cor.1=0.393; Cor.2=0.460; Cor.3=0.536; Cor.4=0.627; Cor.5=0.476 "sdfopen " In_Dir FAB "set y 1"; "set x 1"; "define CO=cor"; "query define"; Cor.1=subwrd(result,2) "define CO=Per"; "query define"; Per.1=subwrd(result,2) "set x 2"; "define CO=cor"; "query define"; Cor.2=subwrd(result,2) "define CO=Per"; "query define"; Per.2=subwrd(result,2) "set x 3"; "define CO=cor"; "query define"; Cor.3=subwrd(result,2) "define CO=Per"; "query define"; Per.3=subwrd(result,2) "set x 4"; "define CO=cor"; "query define"; Cor.4=subwrd(result,2) "set x 5"; "define CO=cor"; "query define"; Cor.5=subwrd(result,2) "close 1" "set mpdraw on"; "set mpdset mres"; "set frame on"; "set grid on";"set xlab on";"set ylab on"; "set gxout shaded"; "set grads off" X_Labs=" 1960 2019 " irow=0 While (irow1); y2=y11-0.23; y1=y2-dy; y11=y1; endif icol=0 While (icol1); x1=x11+0.05; x2=x01; x11=x2; endif "set parea "x1" "x2" "y1" "y2 if (icol=1) "sdfopen " In_Dir FU "set lat -11 26.5" "set lon 89.5 144" Cor_Clor1() "set xlint 20"; "set ylint 10" "d u(t="irow")*10" HSTS if (irow=Nrow) "xcbar "x1-0.1" "x2-0.1" "y1-0.2" "y1-0.05" -fs 3 -xo 0.1 -fw 0.08 -fh 0.1 -fx -0.0 -line on -edge triangle " endif "close 1" endif if (icol=2) "sdfopen " In_Dir FV Cor_Clor() "set xlint 20"; "set ylint 10" "d v(t="irow")*10" if (irow=Nrow) "xcbar "x2-0.45" "x2-0.3" "y01+0.2" "y00-0.2" -fs 2 -xo 0.1 -fw 0.08 -fh 0.1 -fx -0.0 -line on -edge triangle " endif "close 1" endif draw_tit(x00+1.15, y2-0.4,Mod.irow) draw_tit(x00+2.5, y2-0.3,Mod.irow) if (irow=1); if (icol=1); Main_tit(x1+0.4,y2-0.05,Va.icol); endif if (icol=2); Main_tit(x2-0.7,y2+0.1,Va.icol); endif endif Endwhile "set parea off" Endwhile Main_tit((x00+x01)/2,y00+0.2,"The MCA patterns of SPEI and SST") * Plot AB Nvar=3 y00=3.8; y01=0.7; dy=(y00-y01)/Nrow-0.1 x1=x00+0.0; x2=x01 "set mpdraw off"; "set xlab off" "sdfopen " In_Dir FAB "query dims"; str=sublin(result,3); Nmons=subwrd(str,8) ivar=0; Nvar=3 While (ivar1); y2=y11-0.3; y1=y2-dy; y11=y1; endif "set parea "x1" "x2" "y1" "y2 "set x "ivar "set y 1 "Nmons "set vrange -150 150"; "set ylint 50" Line_pl(mark.1,colo.1,thic.1,styl.1) "set ylpos 0 l" "d a" "set xlab on"; "set xlint 5"; "set xaxis "X_Labs Line_pl(mark.2,colo.2,thic.2,styl.2) * "set ylpos 0 r" "d b" "set xlint 5"; "set xaxis "X_Labs Cor.ivar=math_format("%6.3f",Cor.ivar) Per.ivar=math_format("%4.1f",Per.ivar) draw_tit(x1+0.1, y2-0.1,"r="Cor.ivar) Main_tit((x1+x2)/2,y2-0.1,"Red: SPEI; Blue: SST") draw_tit(x00+0.1, y1+0.1,Mod.ivar" ("Per.ivar"%)") Endwhile Main_tit((x00+x01)/2,y00+0.1,"c) Time series of MCAs") "close 1" "gxprint " Out_Dir "Fig_8_MCA_Dr_SSTA_"Dr_var".pdf pdf" * Endwhile ******************************************************* 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 l 5.5 0"; "set strsiz 0.11 0.11" "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 Cor_Clor() levels = " -0.8 -0.6 -0.5 -0.4 -0.3 -0.2 -0.1 -0.05 -0.01 0 0.01 0.05 0.1 0.2 0.3 0.4 0.5 0.6 0.8 " * levels = " -8 -6 -4 -2 -1 -0.5 -0.1 0 0.1 0.5 1 2 4 6 8 " * "run color.gs -gxout grfill -kind darkblue->blue->white-(0)->white->red->darkred -levs " levels "run color.gs -gxout grfill -kind darkgreen->green->lightgreen->white-(0)->white->orange->red->darkred -levs" levels "set grads off" return ******************************************** function Cor_Clor1() levels = " -0.8 -0.6 -0.5 -0.4 -0.3 -0.2 -0.1 -0.05 -0.01 0 0.01 0.05 0.1 0.2 0.3 0.4 0.5 0.6 0.8 " * levels = " -8 -6 -4 -2 -1 -0.5 -0.1 0 0.1 0.5 1 2 4 6 8 " * "run color.gs -gxout grfill -kind darkblue->blue->white-(0)->white->red->darkred -levs " levels "run color.gs -gxout grfill -kind darkred->red->orange->white-(0)->white->lightgreen->green->darkgreen -levs" levels "set grads off" return