 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% XY PLANE PICTURES
\begin{TIOS}

(/home/senya/work/model/MC_PG/senq/Inew.rc) run

/setT{T exch dup 0 gt{1 sub first}{1 add last}ifelse exch step mul add VALUE}def
/L05 {DEPTH >L 0.5 sub}def
/limZ {Z exch -1 mul 0 RANGE}def

/T12N {T first second last VALUES} def
/T2N  {T second last RANGE 
  T /T units gridtype first 0.5 sub 1. last 0.5 sub NewEvenGRID replaceGRID}def

/X0 {X 210 VALUE}def
/Y0 {Y /Y units gridtype [0] NewGRID REGRID} def
/Z0 {Z 0 VALUE}def

/X3 {X [155 205 245] VALUES}def
/Y3 {Y [20 40 60]   VALUES}def
/Z3 {Z [0 -75 -150] VALUES}def
/T3 {T first secondtolast last VALUES} def

/setXY {Y low 2 high GRID} def 

/stfn{/fullname exch def}def

/Z dup /real ordered 40 20 5000 log_array NewGRID def %%%% NZ H(1) HMAX --
/lgZ {Z first -10. RANGE 
Z -1. mul 1. add log /longname ($log parenleft Z parenright $) def} def

/deltH [50 25 25 50 50 100 100] def
/meanH {L first secondtolast RANGE L
/L /real unordered deltH NewGRID replaceGRID L mul L SUM 400. div}def

/Tym  {T2N T AVERAGE T /year setunits pop}def

/vel_scale 1.e-3 def
/CSC0 {/CSCALE undef}def  
/CSC1 {/CSCALE vel_scale def}def  
/CSC2 {/CSCALE vel_scale 2 mul def}def  
/CSC01{/CSCALE vel_scale 0.1 mul def}def
/CSC05{/CSCALE vel_scale 0.5 mul def}def 

/TL {T [first last] VALUES} def
/BOX1 { X 270 330 RANGE Y first -40 RANGE}def
/BOX2 { X 270 360 RANGE Y 40 last   RANGE}def

/to_Z { 
 L /Z /m ordered 
[167 500 833 1167 1500 1833 ]
 NewGRID replaceGRID Z last first RANGE
} def

/to_ZZ { 
 L /Z /m ordered 
[16.8 50.4 96.6 153.6 221.4 300 389.4 489.6 600.6 722.4 855.0 998.4 1152.6 1317.6
1493.4 1680. 1877.4 2085.6 2304.6 2534.4 2775 3026.4 3288.6 3561.6 3845.4 4140 4400
4700 5000 ]
 NewGRID replaceGRID Z last first RANGE
} def

/to_ZZZ { 
 L /Z /m ordered 
[16.8 50.4 96.6 153.6 221.4 300 389.4 489.6 600.6 722.4 855.0 998.4 1152.6 1317.6
1493.4 1680. 1877.4 2085.6]
 NewGRID replaceGRID Z last first RANGE
} def

/topz {to_ZZ Z [16.8 50.4] VALUES} def
/botz {to_ZZ Z [855 1152.6 3026.4 4140] VALUES} def

/rb_cmap {               % low zero high --
/m_h exch def
/m_z exch def
/m_l exch def

startcolormap
m_l m_h RANGE
black
blue
blue  m_l value
LightCyan m_z m_h m_l sub .005 mul sub value
white m_z value
LightPink m_z m_h m_l sub .005 mul add value
red   m_h value
red
endcolormap
} def


\end{TIOS}	

\begin{STREAMS} 

(pl/st3) setplotname
%/mask MASK > DEPTH 0 mul T first VALUE T removeGRID def

%MASK
%DEPTH T last VALUE X Y COLOR

%ONE_TIME
%FOH  2000 mul X Y CONTOUR
%\end{STREAMS} 
%TOTAL_DEPTH T last VALUE T first VALUE X Y COLOR

%BARO
% PSI L removeGRID 1000000 div T last VALUE X Y CONTOUR
% TAUX T last VALUE  X Y CONTOUR
% TAUY  T last VALUE X Y CONTOUR
%PSI L removeGRID T removeGRID (psi.cdf) writeCDF

STR_XY
%TEMP T last VALUE L 1 VALUE X Y CONTOUR
%TEMP T last VALUE L last VALUE X Y CONTOUR
TEMP  T last VALUE X AVERAGE to_Z Y Z CONTOUR
U_VEL T last VALUE X AVERAGE to_Z Y Z CONTOUR
V_VEL T last VALUE X AVERAGE to_Z Y Z CONTOUR
W_VEL T last VALUE  X AVERAGE to_Z Y Z CONTOUR
\end{STREAMS} 
/XOVY 3. def
%TEMP T last VALUE X 0 20 RANGE Y first first 4 add RANGE X Y CONTOUR
TEMP T last VALUE X Y CONTOUR
U_VEL T last VALUE X Y CONTOUR
/arrowsperinch 100 def
%U_VEL T last VALUE  V_VEL X Y VECTOR
U_VEL X 0 20 RANGE Y 40 48 RANGE T last VALUE  V_VEL X Y VECTOR
\end{STREAMS} 
%








