1 | PRO forcage,iyear,ian |
---|
2 | @init2 |
---|
3 | @initorca2_bab |
---|
4 | |
---|
5 | |
---|
6 | |
---|
7 | |
---|
8 | @common |
---|
9 | |
---|
10 | |
---|
11 | |
---|
12 | ian='01' |
---|
13 | iyear='1993' |
---|
14 | |
---|
15 | e_exp='ESS' |
---|
16 | rep_fred='/usr/work/sur/fvi/OPA/geomag/' |
---|
17 | key_portrait = 0 |
---|
18 | ; stockage des fichiers brut |
---|
19 | ioDATA='/usr/work/sur/fvi/OPA/ORCA2/' |
---|
20 | file_U=e_exp+'_5d_'+ian+'0101_'+ian+'1231_grid_U.nc' |
---|
21 | print, file_U |
---|
22 | file_V=e_exp+'_5d_'+ian+'0101_'+ian+'1231_grid_V.nc' |
---|
23 | print, file_V |
---|
24 | file_T=e_exp+'_5d_'+ian+'0101_'+ian+'1231_grid_T.nc' |
---|
25 | print, file_T |
---|
26 | file_Sed= rep_fred+'cond_sed_ORCA2.nc' |
---|
27 | file_Br= rep_fred+'Br_ORCA2.nc' |
---|
28 | |
---|
29 | |
---|
30 | ; title |
---|
31 | t_exp= e_exp |
---|
32 | ; t_exp0= e_exp0 |
---|
33 | t_bt = 'bar_transp' |
---|
34 | ioORLN2 = '/usr/work/sur/fvi/OPA/ORCA2' |
---|
35 | ;facteur d'echelle vertical for partial steps |
---|
36 | e3v3d=read_ncdf('e3v_ps',0,/timestep,iodir=ioORLN2,/nostruct,/tout,filename='meshmask_bab.nc') |
---|
37 | e3u3d=read_ncdf('e3u_ps',0,/timestep,iodir=ioORLN2,/nostruct,/tout,filename='meshmask_bab.nc') |
---|
38 | SIGMAsed=read_ncdf('cond_sed',0,/timestep,/nostruct,/tout,filename=file_Sed,/cont_nofill) |
---|
39 | ;BR=read_ncdf('Br',0,/timestep,/nostruct,/tout,filename=file_Br) |
---|
40 | BR=read_ncdf('Br',0,/timestep,/nostruct,/tout,filename=file_Br,/cont_nofill) |
---|
41 | |
---|
42 | |
---|
43 | |
---|
44 | |
---|
45 | ; vertical integration: |
---|
46 | e3t3d=make_array(jpi,jpj,jpk) |
---|
47 | for k=0, jpk-1 do begin &$ |
---|
48 | for j=0,jpj-1 do begin &$ |
---|
49 | for i=0,jpi-1 do begin &$ |
---|
50 | e3t3d(i,j,k) = e3t(k) &$ |
---|
51 | endfor &$ |
---|
52 | endfor &$ |
---|
53 | endfor |
---|
54 | jpt = 73 |
---|
55 | |
---|
56 | ;vud = make_array(jpi,jpj,jpt) |
---|
57 | ;vvd = make_array(jpi, jpj, jpt) |
---|
58 | divBustar = make_array(jpi, jpj, jpt) |
---|
59 | |
---|
60 | ; ouverture des fichiers dans lesquels on va écrire |
---|
61 | ;id3=NCDF_OPEN('/usr/work/sur/fvi/OPA/geomag/U_5d_'+iyear+'_grid_T.nc',/write) |
---|
62 | ;id4=NCDF_OPEN('/usr/work/sur/fvi/OPA/geomag/V_5d_'+iyear+'_grid_T.nc',/write) |
---|
63 | id4=NCDF_CREATE('/usr/work/sur/fvi/OPA/ORCA2/DivBustar_5d_'+iyear+'_grid_T.nc',/clobber) |
---|
64 | |
---|
65 | ;id4=NCDF_OPEN('/usr/work/sur/fvi/OPA/ORCA2/DivBustar_5d_'+iyear+'_grid_T.nc',/write) |
---|
66 | |
---|
67 | FOR jt = 0, jpt-1 DO BEGIN &$ |
---|
68 | |
---|
69 | ; ouverture des fichiers et stockage en memoire partial steps |
---|
70 | vu=read_ncdf('vozocrtx',jt,jt, /timestep, iodir=ioDATA,/nostruct,/TOUT,filename=file_U) &$ |
---|
71 | vv=read_ncdf('vomecrty',jt,jt, /timestep,iodir=ioDATA,/nostruct,/TOUT,filename=file_V) &$ |
---|
72 | ; lecture salinite & temperature |
---|
73 | temp= read_ncdf('votemper',jt,jt,/timestep,iodir=ioDATA,/nostruct,/tout,filename=file_T) |
---|
74 | salin=read_ncdf('vosaline',jt,jt,/timestep,iodir=ioDATA,/nostruct,/tout,filename=file_T) |
---|
75 | |
---|
76 | conduct=0.02047780622061 + 0.00273147624197*temp + 0.00035133182334*temp*temp + 0.09139808809909*salin + 0.00241425798890*salin*temp -0.00023998958774*salin*salin |
---|
77 | mask_t=where(conduct GT 1.e+19) |
---|
78 | conduct(mask_t)=0. |
---|
79 | ; Somme conduct au point T |
---|
80 | |
---|
81 | |
---|
82 | ; Calcul SIGMA |
---|
83 | |
---|
84 | SIGMAoc=total(conduct*e3t3d*tmask,3) |
---|
85 | SIGMA=SIGMAsed+SIGMAoc |
---|
86 | |
---|
87 | SIGMA_u=(SIGMA+shift(SIGMA,-1,0))/2. |
---|
88 | |
---|
89 | SIGMA_v=(SIGMA+shift(SIGMA,0,1))/2. |
---|
90 | |
---|
91 | ; Calcul B en points u et v |
---|
92 | |
---|
93 | BR_u=(BR+shift(BR,-1,0))/2. |
---|
94 | |
---|
95 | BR_v=(BR+shift(BR,0,1))/2. |
---|
96 | |
---|
97 | |
---|
98 | ; Calcul integrale conduct |
---|
99 | |
---|
100 | conduct_u=(conduct+shift(conduct,-1,0,0))/2. |
---|
101 | |
---|
102 | conduct_v=(conduct+shift(conduct,0,1,0))/2. |
---|
103 | |
---|
104 | u_cond_u=total( vu*conduct_u*e3u3d*umask(),3) |
---|
105 | |
---|
106 | v_cond_v=total( vv*conduct_v*e3v3d*vmask(),3) |
---|
107 | |
---|
108 | |
---|
109 | Bu_star= BR_u*u_cond_u/SIGMA_u |
---|
110 | |
---|
111 | Bv_star= BR_v*v_cond_v/SIGMA_v |
---|
112 | |
---|
113 | ; Divergence du champ |
---|
114 | |
---|
115 | Diver=div(Bu_star,Bv_star) |
---|
116 | |
---|
117 | ; Somme sur la verticale partial steps |
---|
118 | ; vum=total( vu*e3u3d*umask(),3 ) &$ |
---|
119 | ; vvm=total( vv*e3v3d*vmask(),3 ) &$ |
---|
120 | |
---|
121 | ; Shift sur la grille T partial steps |
---|
122 | ; vut= (vum+shift(vum,1,0) )*0.5 &$ |
---|
123 | ; vvt= (vvm+shift(vvm,0,1) )*0.5 &$ |
---|
124 | ; Bande de recouvrement |
---|
125 | ; vut(0, *) = vut(jpi-2, *) |
---|
126 | ; vvt(*, 0) = 0. |
---|
127 | ; stockage dans le fichier de sortie |
---|
128 | ;NCDF_VARPUT, id3,'sossheig',vut, offset = [0, 0, jt] |
---|
129 | NCDF_VARPUT, id4,'sossheig',Diver, offset = [0, 0, jt] |
---|
130 | |
---|
131 | print, jt |
---|
132 | |
---|
133 | ENDFOR |
---|
134 | ; on ferme le NetCDF |
---|
135 | ;NCDF_CLOSE,id3 |
---|
136 | NCDF_CLOSE,id4 |
---|
137 | |
---|
138 | |
---|
139 | |
---|
140 | |
---|
141 | END |
---|