%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 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 
[10 30 60 100 160 240 320 500 700 1000 2000 3500] 
 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]
 NewGRID replaceGRID Z last first RANGE
} 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/sl) setplotname
%/XOVY auto def
%/mask MASK > DEPTH 0 mul T first VALUE T removeGRID def

%MASK
%DEPTH X Y COLOR

%ONE_TIME
%TOTAL_DEPTH  X Y COLOR
% RELAX X Y CONTOUR
% SPONGE  X Y CONTOUR

%ONE_TIME
%TOTAL_DEPTH  X Y COLOR
%FOH DATA 0 1.e-7 .2e-8 RANGESTEP X Y CONTOUR
% RELAX X Y CONTOUR
% SPONGE  X Y CONTOUR

BARO
 PSI  1000000 div X Y CONTOUR
%\end{STREAMS}
% TAUX X Y COLOR
% TAUY X Y COLOR

%STR_XY

%TEMP L first VALUE X Y COLOR
\end{STREAMS}

%U_VEL L first VALUE X Y COLOR
%V_VEL L first VALUE X Y COLOR
%\end{STREAMS}
%SALT L first VALUE  X Y COLOR
/CSCALE 1.e-3 def
/arrowsperinch 8 def
U_VEL L first VALUE 
V_VEL L first VALUE X Y VECTOR
%U_VEL T last VALUE L 1 VALUES X Y COLOR
%V_VEL T last VALUE L 1 VALUES X Y COLOR
%W_VEL T last VALUE L 1 VALUES X Y COLOR
%\end{STREAMS}
%V_VEL mask add Y 4 STEP T last VALUE to_ZZ X Z CONTOUR
%U_VEL mask add L 1 5 RANGE T last VALUE V_VEL  T last VALUE X Y  VECTOR
%/CSCALE 1.e-4 def
%U_VEL mask add L  10 12 14 20 RANGE T last VALUE V_VEL  T last VALUE X Y  VECTOR
%

%STR_XY
%U_VEL TS L 1 VALUE X Y CONTOUR


/TS{T last VALUES L 1 VALUE} def

DUMP_X
COR_X TS X Y CONTOUR
NONLIN_X TS X Y CONTOUR
VERT_X TS X Y CONTOUR
RHS_X TS X Y CONTOUR
CRHS_X TS X Y CONTOUR
PGF_X TS X Y CONTOUR

DUMP_Y

COR_Y TS X Y CONTOUR
NONLIN_Y TS X Y CONTOUR
VERT_Y TS X Y CONTOUR
RHS_Y TS X Y CONTOUR
CRHS_Y TS X Y CONTOUR
PGF_Y TS X Y CONTOUR

\end{STREAMS}
% TAUX T last VALUE X Y CONTOUR
% TAUY T last VALUE X Y CONTOUR
%
%FLUX
% HFLX  T last VALUE X Y CONTOUR
% SOLAR  T last VALUE X Y CONTOUR
% LATENT  T last VALUE X Y CONTOUR
% SENSIBLE T last VALUE  X Y CONTOUR
% LONGWAVE T last VALUE  X Y CONTOUR
% EP T last VALUE  X Y CONTOUR
% CLD T last VALUE  X Y CONTOUR
% UWND T last VALUE  X Y CONTOUR
% VWND T last VALUE  X Y CONTOUR
% WNSP T last VALUE X Y CONTOUR
%
%PBL  
%/PLOTCOAST 1 def
% PBLHUM  T last VALUE X Y CONTOUR
% PBLPTEM  T last VALUE X Y CONTOUR
% AIRHUM  T last VALUE X Y CONTOUR
% AIRTEM T last VALUE X Y CONTOUR
%\end{STREAMS} 



%/D_AL LEVITUS94 .ANNUAL .temp T removeGRID def
%%LEVITUS94 .ANNUAL .temp D_AL add Z 0 VALUE X Y COLOR
%\end{STREAMS}

MEANS
T_MEAN >X /XM exch def  T_MEAN >Y /YM exch def

/TLA  LEVITUS94 >ANNUAL >temp X XM REGRID Y YM REGRID Z 0 VALUE def

T_MEAN T last 10 sub last RANGE T AVERAGE L first VALUE DATA 2 STEP X Y CONTOUR
TLA X Y CONTOUR
T_MEAN T last 10 sub last RANGE T AVERAGE L first VALUE 
TLA sub X Y CONTOUR

\end{STREAMS}

STR_XY
U_VEL mask add L 1 VALUE  X Y COLOR
TEMP mask add L 1 VALUE  X Y COLOR
%U_VEL mask add Y 0 VALUE to_ZZ X Z COLOR
%TEMP mask add Y 0 VALUE to_ZZ X Z COLOR
%V_VEL mask add Y 31 37 RANGE T last VALUES to_ZZ  -0.15 0. 0.15 rb_cmap X Z COLOR
%TEMP mask add X 310 VALUE DATA 0 30 RANGE T first last VALUES to_ZZ Y Z COLOR
%TEMP mask add X 330 VALUE DATA 0 30 RANGE T first last VALUES to_ZZ Y Z COLOR
%SALT T first last VALUE mask add X 310 VALUE DATA 32 38 RANGE L last first RANGE Y L COLOR
%SALT T first last VALUE mask add X 330 VALUE DATA 32 38 RANGE L last first RANGE Y L COLOR
/xyr {Y -30 79 RANGE X 262 380 RANGE} def
/arrowsperinch 10 def
/CSCALE 1.e-3 def
  U_VEL mask add xyr T last VALUES L first 2 5 VALUES
  V_VEL mask add xyr T last VALUES L first 2 5 VALUES X Y VECTOR
/CSCALE 1.e-4 def
  U_VEL mask add xyr T last VALUES L 11 14 last VALUES
  V_VEL mask add xyr T last VALUES L 11 14 last VALUES X Y VECTOR
%/CSCALE .5e-4 def
%V_VEL X AVERAGE T last VALUES
%W_VEL X AVERAGE T last VALUES 100 mul L last first RANGE Y L VECTOR



\end{STREAMS} 








