#!/bin/tcsh
if (-e /home/disk/sys/local/NAWIPS-5.10.4/Gemenviron) then
   source /home/disk/sys/local/NAWIPS-5.10.4/Gemenviron
else
   source /home/disk/sage2/mm5rt/NAWIPS-5.10.4g2021bigmem/Gemenviron
endif
#foreach fac (1 2 3 5)
foreach fac (5)
 @ xs = 810 * $fac
 @ ys = 564 * $fac
 set dir = "."
 if ($fac == 2) set dir = highres1
 if ($fac == 3) set dir = highres2
 if ($fac == 5) set dir = highres3
foreach fhr (`seq -w 0 3 72`)
   foreach fct (tmpc.2.f pmsl.2.c wind.2.b)
      set field = $fct:r:r
      set cint = $fct:r:e
      set type = $fct:e
      if ($field == "wind") then
        set gfun = "kntv(vecr(u10,v10))"
	if ($fac == 1) then
           set skip = 10
	else if ($fac == 2) then
           set skip = 5
	else if ($fac == 3) then
           set skip = 2
	else if ($fac == 5) then
           set skip = 0
        endif
      else
        set gfun = $field
	set skip = ""
      endif
      if (! -e $dir/$field.$fhr.gif) then
gdplot2_gf <<EOF
 GDFILE   = $HDS/2022110200_wrfd3.gem
 GDATTIM  = f$fhr
 GLEVEL   = 0
 GVCORD   = none
 PANEL    = 0
 SKIP     = 0
 SCALE    = 0
 GDPFUN   = $gfun
 TYPE     = $type
 CONTUR   = 0
 CINT     = $cint
 LINE     = 29;30 / 1;1 / 1;1 / 0 / 2 / 1
 FINT     = $cint
 FLINE    = 31-18;9-17
 HILO     =  
 HLSYM    =  
 CLRBAR   = 31
 WIND     = bk32
 REFVEC   =  
 TITLE    = 1
 TEXT     = 1.24/22//hw
 CLEAR    = YES
 GAREA    = dset
 IJSKIP   = $skip
 PROJ     = lcc/30;-121;60/nm
 MAP      = 32
 MSCALE   = 0
 LATLON   =  
 DEVICE   = gf|$dir/$field.$fhr.gif|$xs;$ys
 STNPLT   =  
 SATFIL   =  
 RADFIL   =  
 IMCBAR   =  
 LUTFIL   =  
 STREAM   =  
 POSN     = 0
 COLORS   = 1
 MARKER   = 0
 GRDLBL   = 0
 FILTER   = no
run

EOF
   endif
   if ($field != "tmpc" && ! -e $dir/$field.$fhr.png) convert -transparent white $dir/$field.$fhr.gif $dir/$field.$fhr.png
   end
end

end
gpend
