
"reinit"
"set display color white"
"c"
V.1="ONI"; V.2="MEI"; V.3="REQSOI"; V.4="SOI"; V.5="RINDO"; V.6="Nino34"; V.7="CPAC850"; V.8="BEST"
V.9="WPC850"; V.10="PDO"; V.11="PNA"; V.12="DMI"; V.13="WHWP"; V.14="TNI"; V.15="WP"; V.16="QBO"

*"open tempEEMD.ctl"
"sdfopen EEMD_rlts.nc"

* Daily rainfall:
*Ntime=12775
* TC NWP:
Ntime=828
*
*Ntime=684
Nens=7
*Nvar=16
Nvar=1

ivar=0
While (ivar<Nvar)
   ivar=ivar+1
   "set x 1 "Ntime
   y=0
   While (y<Nens)
      y=y+1
      "set y "y
      if (ivar<10)
         "define a"y"="imf0" "ivar
      else
         "define a"y"="imf" "ivar
      endif
   Endwhile
  
   Nplt=6
   x00=0.5;  x01=8.0
   y00=10.5; y01=1.5; dy=(y00-y01)/Nplt
   irow=1; Nmap=Nens
   While (irow<Nmap)
      irow=irow+1
      if (irow=2); y2=y00; y1=y2-dy; y11=y1; endif
      if (irow>2); y2=y11-0.05; y1=y2-dy; y11=y1; endif
      x1=x00; x2=x01
      "set parea "x1" "x2" "y1" "y2
      "set grads off"; "set cmark 0"; 
      if (irow<Nmap); "set xlab off"; endif
* Daily rainfall:
*      if (irow=Nmap); "set xlab on"; "set xaxis 1980 2014 2"; endif
* TC:
      if (irow=Nmap); "set xlab on"; "set xaxis 1961 2019 5"; endif
*      if (irow<=6); "set vrange -12 12"; else; "set vrange -6 6"; endif
*      if (irow<=6); "set vrange -5 5"; else; "set vrange -5 5"; endif
      "set vrange -2 2"
      "d a"irow
   Endwhile  
   draw_tit((x01-x00)/2, y00+0.2, V.ivar)
   pull dd
*   "c"
Endwhile

"close 1"
*******************************************************

function draw_tit(x, y, title)
  "set string 1 c 5.5"; "set strsiz 0.12 0.12"
  "draw string "x" "y" "title
return
*******************************************************

