source: trunk/tools/bsf/moyz.pro @ 68

Last change on this file since 68 was 2, checked in by post_it, 17 years ago

Initial import from ~/POST_IT/

File size: 779 bytes
Line 
1;+
2;;
3;; Calcul de la moyenne verticale
4;;
5;; Creation : printemps 1998 / G. Roullet
6;;            reecriture : 15/01/99
7;;
8;-
9FUNCTION moyz, z, MSK = MSK, INT = int
10@common
11   
12   tt = tmask
13
14   IF n_elements(msk) EQ 0 THEN msk = 0
15
16   CASE (size(msk))[0] OF
17      0 : tt = tt
18      1 : tt = tt*(replicate(1, jpi*jpj)#msk)
19      2 : tt = tt*(msk(*)#replicate(1, jpk))
20      3 : tt = tt*msk
21   ENDCASE
22   
23   height    = reform( replicate(1, jpi*jpj)#e3t, jpi, jpj, jpk)*tt
24;   IF s_exp EQ 'GF1' THEN height(*, *, 0) = height(*, *, 0)+ssh
25   totz      = total( z*height, 3)
26   totheight = total( height, 3)
27
28   moy = totz
29   
30   IF n_elements(int) EQ 0 THEN BEGIN
31      ind = where(totheight NE 0)
32      moy(ind) = totz(ind) / totheight(ind)
33   ENDIF
34
35   return, moy
36
37END
38   
Note: See TracBrowser for help on using the repository browser.