source: trunk/tools/bsf/diag_bsf.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: 3.1 KB
Line 
1;+
2;;
3;; Calcul de la Fonction de Courant Barotrope
4;; a partir du champ de vitesse (u,v)
5;;
6;; creation : printemps 98 G. Roullet
7;;
8;-
9
10PRO diag_bsf_mu, hu, hv, mu
11@common
12@com_eg
13;;
14;; calcul adapte a la grille ORCA
15;;
16   mu = fltarr(14)
17; 0/ Antartic
18;   mu(0) = total( (hu*e2u*umaskr(*, *, 0))[149, 5:35])
19   mu(0) = total( (hu*e2u*umaskr(*, *, 0))[151, 14:48])
20; 1/ America
21;   mu(1) = -total( (hv*e1v*vmaskr(*, *, 0))[110:150, 60])
22   mu(1) = -total( (hv*e1v*vmaskr(*, *, 0))[110:150, 60])
23; 3/ Australia
24;   mu(3) = total( (hu*e2u*umaskr(*, *, 0))[17, 40:49])
25   mu(3) = total( (hu*e2u*umaskr(*, *, 0))[20, 50:61])
26; 2/ New Zealand
27;   mu(2) = mu(3)+ total( (hv*e1v*vmaskr(*, *, 0))[30:40, 25])
28   mu(2) = mu(3)+ total( (hv*e1v*vmaskr(*, *, 0))[35:49, 44])
29; 4/ Madagascar
30;   mu(4) = total( (hv*e1v*vmaskr(*, *, 0))[150:159, 40])
31   mu(4) = total( (hv*e1v*vmaskr(*, *, 0))[160:164, 56])
32; 5/ New Guinea
33;   mu(5) = - total( (hu*e2u*umaskr(*, *, 0))[16, 50:55])
34   mu(5) = total( (hv*e2v*vmaskr(*, *, 0))[23:33, 61])
35; 6/ Celebes
36   mu(6) = total( (hv*e1v*vmaskr(*, *, 0))[13:22, 64])
37; 7/ Borneo
38;   mu(6) = total( (hv*e1v*vmaskr(*, *, 0))[7:12, 60])
39   mu(7) = total( (hv*e1v*vmaskr(*, *, 0))[14:17, 67])
40; 8/ Philippines
41;   mu(7) = total( (hv*e1v*vmaskr(*, *, 0))[10:16, 90])
42   mu(8) = total( (hv*e1v*vmaskr(*, *, 0))[14:22, 86])
43; 9/ Tasmania
44   mu(9) =  mu(3)+ total( (hu*e1u*umaskr(*, *, 0))[34, 41:45])
45; 10/ Cuba
46;   mu(8) = - total( (hv*e1v*vmaskr(*, *, 0))[101:127, 86])
47   mu(10) = - total( (hv*e1v*vmaskr(*, *, 0))[105:134, 90])
48; 11/ Island
49;   mu(9) = - total( (hv*e1v*vmaskr(*, *, 0))[117:130, 124])
50   mu(11) = - total( (hv*e1v*vmaskr(*, *, 0))[132:143, 120])
51; 12/ Spitzberg
52;   mu(10) = - total( (hv*e1v*vmaskr(*, *, 0))[110:120, 137])
53   mu(12) = - total( (hv*e1v*vmaskr(*, *, 0))[140:160, 135])
54; 13/ Japan
55   mu(13) = total( (hv*e1v*vmaskr(*, *, 0))[25:131, 100])
56end
57
58PRO diag_bsf_lec, bsf
59@common
60@com_eg
61   ;;
62   ;; Lecture du fichier contenant les fonctions de courant associe a
63   ;; chaque ile (pour ORCA)
64   ;;
65   ;; Creation : printemps 1998 / G. Roullet
66   ;; modification : juin 99
67   ;;
68   jpisl=14
69   bsf = fltarr(jpi, jpj, jpisl)
70   z2d = fltarr(jpi, jpj)
71   fichier = 'islands.nc'
72   FOR k = 1, jpisl DO BEGIN
73      ile = 'island'+strtrim(string(k), 2)
74      z2d = nc_get(fichier, ile, NCDF_DB =hom_idl+'grids/')
75      bsf(*, *, k-1) = shift(z2d, 0, 0)
76   ENDFOR
77end
78
79
80FUNCTION diag_bsf, u, v, FLUX = flux, _EXTRA = extra
81   ;;
82   ;;  Routine principale
83   ;;
84@common
85COMMON bsf_lec, bsfislands
86
87   jpisl=14
88   IF keyword_set(flux) EQ 0 THEN BEGIN
89;
90;  integration sur la verticale
91;
92      hu = moyz(u, /int)
93      hv = moyz(v, /int)
94   ENDIF ELSE BEGIN
95;
96;  on suppose que u et v sont deja integres verticalement
97;
98      hu = u
99      hv = v
100   ENDELSE
101   
102 print, '     Inversion...'
103   bsf = inversion( curl2(hu, hv), /f, _extra = extra)
104;
105;  calcul des potentiels entre chaque ile
106;
107 print, '     Potential...'
108   diag_bsf_mu, hu, hv, mu
109;
110;  lecture des fonctions courants unite autour de chaque ile
111;
112   IF n_elements(bsfislands) EQ 0 THEN diag_bsf_lec, bsfislands
113   
114   FOR k = 0, jpisl-1 DO bsf = bsf+mu(k)*bsfislands(*, *, k)
115
116   return, bsf
117
118END
119
Note: See TracBrowser for help on using the repository browser.