1 | ; |
---|
2 | ; make energetics computations |
---|
3 | ; |
---|
4 | FUNCTION make_energetics, file_name, ncdf_db, TIME_1 = time_1, TIME_2 = time_2, ALL_DATA = all_data, ZMTYP = zmtyp |
---|
5 | |
---|
6 | @common |
---|
7 | @com_eg |
---|
8 | IF debug_w THEN print, ' ' |
---|
9 | IF debug_w THEN print, ' ENTER make_energetics...' |
---|
10 | IF debug_w THEN print, 'cmd_wrk.grid =', cmd_wrk.grid |
---|
11 | CASE cmd_wrk.grid OF |
---|
12 | 'T': source_model = 'opa' |
---|
13 | 'T#': source_model = 'opa#' |
---|
14 | 'T05': source_model = 'opa' |
---|
15 | 'T05#': source_model = 'opa#' |
---|
16 | ELSE: source_model = 'ipcc' |
---|
17 | ENDCASE |
---|
18 | |
---|
19 | ;; full vertical domain |
---|
20 | ;; imposes vert_type = '0' in plt_def |
---|
21 | vert_switch = 0 |
---|
22 | IF debug_w THEN BEGIN |
---|
23 | print, 'base_file_name:', base_file_name |
---|
24 | print, 'file_name:', file_name |
---|
25 | ENDIF |
---|
26 | ; |
---|
27 | ; Read T, S, U, V, W, taux, tauy |
---|
28 | ; |
---|
29 | print, ' Data size to read (M)= ', nxt*nyt*jpt*(5*nzt + 2)*1.e-6 |
---|
30 | |
---|
31 | CASE source_model OF |
---|
32 | 'opa': BEGIN |
---|
33 | tn = nc_read(file_name,'votemper', ncdf_db, TIME_1 = time_1, TIME_2 = time_2) |
---|
34 | sn = nc_read(file_name,'vosaline', ncdf_db, TIME_1 = time_1, TIME_2 = time_2) |
---|
35 | IF data_domain EQ 'pacific' THEN BEGIN |
---|
36 | file_namu = strmid(file_name, 0, strlen(file_name)-8)+'U_pac.nc' |
---|
37 | file_namv = strmid(file_name, 0, strlen(file_name)-8)+'V_pac.nc' |
---|
38 | file_namw = strmid(file_name, 0, strlen(file_name)-8)+'W_pac.nc' |
---|
39 | ENDIF ELSE BEGIN |
---|
40 | file_namu = strmid(file_name, 0, strlen(file_name)-4)+'U.nc' |
---|
41 | file_namv = strmid(file_name, 0, strlen(file_name)-4)+'V.nc' |
---|
42 | file_namw = strmid(file_name, 0, strlen(file_name)-4)+'W.nc' |
---|
43 | ENDELSE |
---|
44 | un = nc_read(file_namu,'vozocrtx', ncdf_db, TIME_1 = time_1, TIME_2 = time_2) |
---|
45 | vn = nc_read(file_namv,'vomecrty', ncdf_db, TIME_1 = time_1, TIME_2 = time_2) |
---|
46 | wn = nc_read(file_namw,'vovecrtz', ncdf_db, TIME_1 = time_1, TIME_2 = time_2) |
---|
47 | tauxn = nc_read(file_namu,'sozotaux', ncdf_db, TIME_1 = time_1, TIME_2 = time_2) |
---|
48 | tauyn = nc_read(file_namv,'sometauy', ncdf_db, TIME_1 = time_1, TIME_2 = time_2) |
---|
49 | var_temp = 'votemper' |
---|
50 | file_temp = file_name |
---|
51 | END |
---|
52 | 'opa#': BEGIN |
---|
53 | tn = nc_read(file_name,'votemper', ncdf_db, TIME_1 = time_1, TIME_2 = time_2) |
---|
54 | IF data_domain EQ 'pacific' THEN BEGIN |
---|
55 | file_nams = strmid(file_name, 0, strlen(file_name)-17)+'T_pac_vosaline.nc' |
---|
56 | file_namu = strmid(file_name, 0, strlen(file_name)-17)+'U_pac_vozocrtx.nc' |
---|
57 | file_namv = strmid(file_name, 0, strlen(file_name)-17)+'V_pac_vomecrty.nc' |
---|
58 | file_namw = strmid(file_name, 0, strlen(file_name)-17)+'W_pac_vovecrtz.nc' |
---|
59 | file_namsu = strmid(file_name, 0, strlen(file_name)-17)+'U_pac_sozotaux.nc' |
---|
60 | file_namsv = strmid(file_name, 0, strlen(file_name)-17)+'V_pac_sometauy.nc' |
---|
61 | ENDIF ELSE BEGIN |
---|
62 | file_nams = strmid(file_name, 0, strlen(file_name)-13)+'T_vosaline.nc' |
---|
63 | file_namu = strmid(file_name, 0, strlen(file_name)-13)+'U_vozocrtx.nc' |
---|
64 | file_namv = strmid(file_name, 0, strlen(file_name)-13)+'V_vomecrty.nc' |
---|
65 | file_namw = strmid(file_name, 0, strlen(file_name)-13)+'W_vovecrtz.nc' |
---|
66 | file_namsu = strmid(file_name, 0, strlen(file_name)-13)+'U_sozotaux.nc' |
---|
67 | file_namsv = strmid(file_name, 0, strlen(file_name)-13)+'V_sometauy.nc' |
---|
68 | ENDELSE |
---|
69 | sn = nc_read(file_nams,'vosaline', ncdf_db, TIME_1 = time_1, TIME_2 = time_2) |
---|
70 | un = nc_read(file_namu,'vozocrtx', ncdf_db, TIME_1 = time_1, TIME_2 = time_2) |
---|
71 | vn = nc_read(file_namv,'vomecrty', ncdf_db, TIME_1 = time_1, TIME_2 = time_2) |
---|
72 | wn = nc_read(file_namw,'vovecrtz', ncdf_db, TIME_1 = time_1, TIME_2 = time_2) |
---|
73 | tauxn = nc_read(file_namsu,'sozotaux', ncdf_db, TIME_1 = time_1, TIME_2 = time_2) |
---|
74 | tauyn = nc_read(file_namsv,'sometauy', ncdf_db, TIME_1 = time_1, TIME_2 = time_2) |
---|
75 | var_temp = 'votemper' |
---|
76 | file_temp = file_name |
---|
77 | source_model = 'opa' |
---|
78 | END |
---|
79 | 'ipcc': BEGIN |
---|
80 | base_file_name_grd = base_file_name+base_suffix |
---|
81 | tn = nc_read(base_file_name_grd+'_thetao.nc','thetao', ncdf_db, TIME_1 = time_1, TIME_2 = time_2) |
---|
82 | sn = nc_read(base_file_name_grd+'_so.nc','so', ncdf_db, TIME_1 = time_1, TIME_2 = time_2) |
---|
83 | un = nc_read(base_file_name_grd+'_uo.nc','uo', ncdf_db, TIME_1 = time_1, TIME_2 = time_2) |
---|
84 | vn = nc_read(base_file_name_grd+'_vo.nc','vo', ncdf_db, TIME_1 = time_1, TIME_2 = time_2) |
---|
85 | wn = nc_read(base_file_name_grd+'_wo.nc','wo', ncdf_db, TIME_1 = time_1, TIME_2 = time_2) |
---|
86 | tauxn = nc_read(base_file_name_grd+'_tauu.nc','tauu', ncdf_db, TIME_1 = time_1, TIME_2 = time_2) |
---|
87 | tauyn = nc_read(base_file_name_grd+'_tauv.nc','tauv', ncdf_db, TIME_1 = time_1, TIME_2 = time_2) |
---|
88 | var_temp = 'thetao' |
---|
89 | file_temp = base_file_name_grd+'_thetao.nc' |
---|
90 | END |
---|
91 | ENDCASE |
---|
92 | |
---|
93 | t_unit = tn.units |
---|
94 | |
---|
95 | ; assign and free memory |
---|
96 | |
---|
97 | t = tn.data & tn = 0 |
---|
98 | s = sn.data & sn = 0 |
---|
99 | u = un.data & un = 0 |
---|
100 | v = vn.data & vn = 0 |
---|
101 | w = wn.data & wn = 0 |
---|
102 | tx = tauxn.data & tauxn = 0 |
---|
103 | ty = tauyn.data & tauyn = 0 |
---|
104 | |
---|
105 | rg = 9.81 |
---|
106 | |
---|
107 | print, ' read ok' |
---|
108 | |
---|
109 | ; rearrange data depending on source |
---|
110 | |
---|
111 | CASE source_model OF |
---|
112 | 'opa': BEGIN |
---|
113 | ; build mask |
---|
114 | IF valmask EQ 0. THEN BEGIN |
---|
115 | tmaskr = abs(s) gt 1.e-6 |
---|
116 | valmask = 1.e20 |
---|
117 | w(where (tmaskr EQ 0)) = valmask |
---|
118 | idxt = where (tmaskr EQ 0) |
---|
119 | t (where (tmaskr EQ 0)) = 0. |
---|
120 | s (where (tmaskr EQ 0)) = 0. |
---|
121 | tmaskr = 0 ; free memory |
---|
122 | ENDIF ELSE BEGIN |
---|
123 | idxt = where (t EQ valmask) |
---|
124 | IF idxt(0) NE -1 THEN t (idxt) = 0. |
---|
125 | IF idxt(0) NE -1 THEN s (idxt) = 0. |
---|
126 | ENDELSE |
---|
127 | |
---|
128 | ; transform W fields onto T grid |
---|
129 | maskw = w LT valmask/10. |
---|
130 | w_T = 0.5*( w*maskw + shift(w, 0, 0, -1, 0)*shift(maskw, 0, 0, -1, 0) ) |
---|
131 | w_T(*, *, (size(w))(3)-1, *) = w_T(*, *, (size(w))(3)-2, *) |
---|
132 | w = 0 |
---|
133 | maskw = 0 ; free memory |
---|
134 | |
---|
135 | END |
---|
136 | 'ipcc': BEGIN |
---|
137 | idx_t = where (t GT valmask/10) |
---|
138 | ; special case CCCMA |
---|
139 | IF strpos(cmd_wrk.exp, 'CCCMA') NE -1 THEN BEGIN |
---|
140 | ; transform W fields onto T grid |
---|
141 | maskw = w LT valmask/10. |
---|
142 | w_T = 0.5*( w*maskw + shift(w, 0, 0, -1, 0)*shift(maskw, 0, 0, -1, 0) ) |
---|
143 | w_T(*, *, (size(w))(3)-1, *) = w_T(*, *, (size(w))(3)-2, *) |
---|
144 | w = 0 |
---|
145 | w_T(idx_t) = valmask |
---|
146 | maskw = 0 ; free memory |
---|
147 | ENDIF ELSE w_T = w |
---|
148 | |
---|
149 | idx_2d = where (u(*, *, 0, 0) GT valmask/10.) |
---|
150 | IF idx_2d(0) NE -1 THEN tx(idx_2d) = valmask |
---|
151 | idx_2d = where (v(*, *, 0, 0) GT valmask/10.) |
---|
152 | IF idx_2d(0) NE -1 THEN ty(idx_2d) = valmask |
---|
153 | idx = where (t LT valmask/10.) |
---|
154 | IF t_unit NE "C" THEN BEGIN |
---|
155 | IF idx(0) NE -1 THEN t(idx) = t(idx)-273.15 |
---|
156 | ENDIF |
---|
157 | idx1 = n_elements(idx_t) |
---|
158 | idx_w = where (w_T GT valmask/10) |
---|
159 | idx2 = n_elements(idx_w) |
---|
160 | IF idx1 NE idx2 THEN BEGIN |
---|
161 | print, ' *** WARNING wo and thetao do not have same masks !', idx1, idx2, min(idx_t -idx_w), max(idx_t- idx_w) |
---|
162 | print, ' *** Setting wo to zero on all masked points' |
---|
163 | w_T(idx_w) = 0. |
---|
164 | ENDIF ELSE print, ' check these are 0 (W,T): ', min(idx_t -idx_w), max(idx_t- idx_w) |
---|
165 | w = 0 & idx = 0 & idx_t = 0 & idx_w = 0 ; free memory |
---|
166 | idxt=where(t GT valmask/10.) |
---|
167 | idxs=where(s GT valmask/10.) |
---|
168 | IF source_model EQ 'ipcc' THEN print, ' check these are 0 (T,S): ', min(idxt -idxs), max(idxt-idxs) |
---|
169 | IF idxt[0] NE -1 THEN t(idxt)=0. |
---|
170 | IF idxs[0] NE -1 THEN s(idxs)=0. |
---|
171 | idxs = 0 ; free memory |
---|
172 | |
---|
173 | END |
---|
174 | ENDCASE |
---|
175 | |
---|
176 | |
---|
177 | ; compute potential density rho |
---|
178 | |
---|
179 | print, ' compute rho...' |
---|
180 | |
---|
181 | |
---|
182 | sr=sqrt(abs(s)) |
---|
183 | r1=((((6.536332E-9*t-1.120083E-6)*t+1.001685E-4)*t $ |
---|
184 | -9.095290E-3)*t+6.793952E-2)*t+999.842594 |
---|
185 | r2=(((5.3875E-9*t-8.2467E-7)*t+7.6438E-5)*t-4.0899E-3)*t+8.24493E-1 |
---|
186 | r3=(-1.6546E-6*t+1.0227E-4)*t-5.72466E-3 |
---|
187 | rhop = ( ( 4.8314E-4*s + r3*sr +r2)*s +r1) |
---|
188 | print, ' rhop min/max', min(rhop), max(rhop) |
---|
189 | IF idxt[0] NE -1 THEN rhop(idxt) = valmask |
---|
190 | sr = 0 & r1 = 0 & r2 = 0 & r3 = 0 & t = 0 & s = 0 ; free memory |
---|
191 | |
---|
192 | ; compute mean profiles on T grid |
---|
193 | |
---|
194 | vargrid = 'T' |
---|
195 | IF valmask NE 0 THEN BEGIN |
---|
196 | rho_s = grossemoyenne(rhop, 'xyt', boite = zbox, NaN = valmask) |
---|
197 | ENDIF ELSE rho_s = grossemoyenne(rhop, 'xyt', boite = zbox) |
---|
198 | |
---|
199 | rho_s4d = replicate(1, nxt*nyt)#rho_s |
---|
200 | rho_s4d = reform(rho_s4d[*]#replicate(1, jpt), nxt, nyt, nzt, jpt, /overwrite) |
---|
201 | |
---|
202 | |
---|
203 | ; compute mean stability = d(rho_s)/dz (on W grid) |
---|
204 | |
---|
205 | rho_diff = (rho_s-shift(rho_s,-1))/shift(e3w, -1) |
---|
206 | rho_diff = shift(temporary(rho_diff), 1) |
---|
207 | rho_diff(0) = 0. |
---|
208 | |
---|
209 | ; transform onto T grid |
---|
210 | |
---|
211 | rho_diff_T = 0.5*(rho_diff+shift(rho_diff, -1)) |
---|
212 | rho_diff_T((size(rho_diff))(1)-1) = rho_diff((size(rho_diff))(1)-2) |
---|
213 | |
---|
214 | stab_inv = ABS(1./rho_diff_T) |
---|
215 | |
---|
216 | rho_diff_T = 0 ; free memory |
---|
217 | |
---|
218 | ; remove first 2 levels (MXL too unstable) |
---|
219 | |
---|
220 | stab_inv[0:1] = 0. |
---|
221 | |
---|
222 | ; test: remove only top level |
---|
223 | |
---|
224 | ; stab_inv[0:0] = 0. |
---|
225 | |
---|
226 | ; compute [(rho-rho_s)**2]/stability |
---|
227 | |
---|
228 | stab_inv = replicate(1, nxt*nyt)#stab_inv |
---|
229 | stab_inv = reform(stab_inv[*]#replicate(1, jpt), nxt, nyt, nzt, jpt, /overwrite) |
---|
230 | |
---|
231 | int_val2 = ((rhop-rho_s4d)^2)*stab_inv |
---|
232 | IF idxt[0] NE -1 THEN int_val2(idxt) = 0. |
---|
233 | |
---|
234 | print, ' compute APE...' |
---|
235 | |
---|
236 | ape = 0.5*rg*grossemoyenne(int_val2, 'xyz', /integration) |
---|
237 | |
---|
238 | int_val2 = 0 ; free memory |
---|
239 | |
---|
240 | ape_wr = ape |
---|
241 | ape = ape*1.e-18 |
---|
242 | ; |
---|
243 | ; compute buoyancy forcing bfx = int[(rho-rho_s).w]dxdydz |
---|
244 | ; |
---|
245 | print, ' compute BF...' |
---|
246 | |
---|
247 | int_val = (rhop-rho_s4d)*(w_T) |
---|
248 | ; remove first 2 levels (MXL too unstable) |
---|
249 | IF idxt[0] NE -1 THEN int_val(idxt) = 0. |
---|
250 | int_val[*, *, 0:1, *] = 0. |
---|
251 | |
---|
252 | bfx = rg*grossemoyenne(int_val, 'xyz', /integration) |
---|
253 | |
---|
254 | int_val = 0 ; free memory |
---|
255 | |
---|
256 | bfx_wr = bfx |
---|
257 | bfx_b = bfx |
---|
258 | bfx = bfx*1.e-11 |
---|
259 | |
---|
260 | ; compute wind work = int(tau.um)dx.dy where um=u(over 30 m) |
---|
261 | |
---|
262 | print, ' compute WW...' |
---|
263 | |
---|
264 | umean=grossemoyenne(u,'z',boite=[0,30]) |
---|
265 | vmean=grossemoyenne(v,'z',boite=[0,30]) |
---|
266 | |
---|
267 | idx = where(tx GT valmask/10.) |
---|
268 | idy = where(ty GT valmask/10.) |
---|
269 | idxu = where(umean GT valmask/10.) |
---|
270 | idyv = where(vmean GT valmask/10.) |
---|
271 | |
---|
272 | IF idx[0] NE -1 THEN tx(idx) = 0. |
---|
273 | IF idy[0] NE -1 THEN ty(idy) = 0. |
---|
274 | IF idxu[0] NE -1 THEN umean(idxu) = 0. |
---|
275 | IF idyv[0] NE -1 THEN vmean(idyv) = 0. |
---|
276 | |
---|
277 | dot_prodx = tx*umean |
---|
278 | dot_prody = ty*vmean |
---|
279 | |
---|
280 | wwx = grossemoyenne(dot_prodx, 'xy', /integration) |
---|
281 | wwy = grossemoyenne(dot_prody, 'xy', /integration) |
---|
282 | ww = wwx + wwy |
---|
283 | |
---|
284 | ww_wr = ww |
---|
285 | ww_b = ww |
---|
286 | ww = ww*1.e-11 |
---|
287 | wwx = wwx*1.e-11 |
---|
288 | wwy = wwy*1.e-11 |
---|
289 | |
---|
290 | ; compute forcing efficiency: stddev(B)/stddev(W) |
---|
291 | |
---|
292 | bfx_1mm = trends(bfx_b, 412, 't') |
---|
293 | bfx_sc = mean_sc |
---|
294 | ww_1mm = trends(ww_b, 412, 't') |
---|
295 | ww_sc = mean_sc |
---|
296 | efficiency = sqrt((moment(bfx_1mm))[1])/sqrt((moment(ww_1mm))[1]) |
---|
297 | efficiency_sc = sqrt((moment(bfx_sc[0:11]))[1])/sqrt((moment(ww_sc[0:11]))[1]) |
---|
298 | |
---|
299 | ; plotting stuff |
---|
300 | |
---|
301 | ps = 0 |
---|
302 | |
---|
303 | red = [0, 255, 0, 0, 0, 255] |
---|
304 | green = [0, 0, 255, 0, 0, 0] |
---|
305 | blue = [0, 0, 0, 255, 0, 255] |
---|
306 | red = [0, red, red, red, red, red, red, red ] |
---|
307 | green = [0, green, green, green, green, green, green, green] |
---|
308 | blue = [0, blue, blue, blue, blue, blue, blue, blue ] |
---|
309 | tvlct, red, green, blue |
---|
310 | |
---|
311 | IF cmd_wrk.out EQ 'ps' THEN ps = 1 |
---|
312 | |
---|
313 | IF ps EQ 1 THEN openps |
---|
314 | |
---|
315 | pltt, ape, 't', petit = [2, 4, 1], landscape = 1, /rempli, /BASICMARGES, title = 'APE (full) '+cmd_wrk.exp |
---|
316 | pltt, ww, 't', petit = [2, 4, 2], min = -2, max = 5, /noerase, /rempli, /BASICMARGES, title = 'Wind work (full) '+cmd_wrk.exp |
---|
317 | pltt, bfx, 't', petit = [2, 4, 8], min = -2, max = 5, color = 4, /noerase, /rempli, /BASICMARGES, title = 'B (full)' |
---|
318 | |
---|
319 | ape_1mm = trends(ape, 412, 't') |
---|
320 | pltt, ape_1mm, 't', petit = [2, 4, 3], /noerase, /rempli, /BASICMARGES, title = 'APE (inter)' |
---|
321 | jpt_b = jpt |
---|
322 | jpt = 24 |
---|
323 | pltt, mean_sc[0:23], 't', petit = [2, 4, 5], /noerase, /rempli, /BASICMARGES, title = 'APE (seasonal cycle x 2)' |
---|
324 | |
---|
325 | jpt = jpt_b |
---|
326 | |
---|
327 | ww_1mm = trends(ww, 412, 't') |
---|
328 | tmp = mean_sc |
---|
329 | wwx_1mm = trends(wwx, 412, 't') |
---|
330 | |
---|
331 | pltt, ww_1mm, 't', petit = [2, 4, 4], color = 2, /noerase, /rempli, /BASICMARGES, title = 'Interannual W (red) B (blue) [efficiency = '+string(strcompress(efficiency))+']' |
---|
332 | pltt, bfx_1mm*1.e-11, 't', petit = [2, 4, 4], /ov1d, color = 4, thick = 2, /noerase, /rempli, /BASICMARGES |
---|
333 | |
---|
334 | jpt_b = jpt |
---|
335 | jpt = 24 |
---|
336 | pltt, tmp[0:23], 't', petit = [2, 4, 6], min = -1, max = 3.5, /noerase, /rempli, /BASICMARGES, title = 'Seasonal Cycle x 2 (W total: black, B: blue, Wx/y: red/green)' |
---|
337 | pltt, mean_sc[0:23], 't', petit = [2, 4, 6], /ov1d, color = 2, thick = 2, /noerase, /rempli, /BASICMARGES |
---|
338 | wwy_1mm = trends(wwy, 412, 't') |
---|
339 | pltt, mean_sc[0:23], 't', petit = [2, 4, 6], /ov1d, color = 3, thick = 2, /noerase, /rempli, /BASICMARGES |
---|
340 | pltt, bfx_sc[0:23]*1.e-11, 't', petit = [2, 4, 6], /ov1d, color = 4, thick = 1, /noerase, /rempli, /BASICMARGES |
---|
341 | jpt = jpt_b |
---|
342 | |
---|
343 | ; compute and plot sst in nino 3 |
---|
344 | |
---|
345 | maxdepth = 10 |
---|
346 | IF gdept(0) GT maxdepth THEN maxdepth = gdept(0) |
---|
347 | |
---|
348 | domdef, [210., 280., -5., 5., 0., maxdepth] |
---|
349 | tn = nc_read(file_temp,var_temp, ncdf_db, TIME_1 = time_1, TIME_2 = time_2) |
---|
350 | st = tn.data |
---|
351 | sst = grossemoyenne(st, 'xyz') |
---|
352 | sst_wr = sst |
---|
353 | sst = trends(sst, 412, 't') |
---|
354 | |
---|
355 | pltt, sst, 't', petit = [2, 4, 7], /noerase, /rempli, /BASICMARGES, title = 'Nino3 SSTA' |
---|
356 | |
---|
357 | correlation = C_CORRELATE(ape, sst, [0]) |
---|
358 | |
---|
359 | IF ps EQ 1 THEN BEGIN |
---|
360 | closeps |
---|
361 | printps |
---|
362 | ENDIF |
---|
363 | |
---|
364 | ; write to ascii file |
---|
365 | |
---|
366 | get_lun, nuldat |
---|
367 | filename = cmd_wrk.exp+'_'+cmd_wrk.date1+'_'+cmd_wrk.spec+'_'+cmd_wrk.plt+'_sst.asc' |
---|
368 | openw, nuldat, asciidir+filename |
---|
369 | print, ' -> writing nino 3 sst data to ', asciidir+filename & print, ' ' |
---|
370 | printf, nuldat, sst_wr, format = '(f8.3)' |
---|
371 | free_lun, nuldat & close, nuldat |
---|
372 | |
---|
373 | get_lun, nuldat |
---|
374 | filename = cmd_wrk.exp+'_'+cmd_wrk.date1+'_'+cmd_wrk.spec+'_'+cmd_wrk.plt+'_ape.asc' |
---|
375 | openw, nuldat, asciidir+filename |
---|
376 | print, ' -> writing ape data to ', asciidir+filename & print, ' ' |
---|
377 | printf, nuldat, ape_wr, format = '(g10.4)' |
---|
378 | free_lun, nuldat & close, nuldat |
---|
379 | |
---|
380 | get_lun, nuldat |
---|
381 | filename = cmd_wrk.exp+'_'+cmd_wrk.date1+'_'+cmd_wrk.spec+'_'+cmd_wrk.plt+'_ww.asc' |
---|
382 | openw, nuldat, asciidir+filename |
---|
383 | print, ' -> writing ww data to ', asciidir+filename & print, ' ' |
---|
384 | printf, nuldat, ww_wr, format = '(g10.4)' |
---|
385 | free_lun, nuldat & close, nuldat |
---|
386 | |
---|
387 | get_lun, nuldat |
---|
388 | filename = cmd_wrk.exp+'_'+cmd_wrk.date1+'_'+cmd_wrk.spec+'_'+cmd_wrk.plt+'_bf.asc' |
---|
389 | openw, nuldat, asciidir+filename |
---|
390 | print, ' -> writing bf data to ', asciidir+filename & print, ' ' |
---|
391 | printf, nuldat, bfx_wr, format = '(g10.4)' |
---|
392 | free_lun, nuldat & close, nuldat |
---|
393 | |
---|
394 | ; check that d(APE)/dt ~ ww |
---|
395 | |
---|
396 | dapedt = (ape-shift(ape, 1))/(86400.*30.) |
---|
397 | ; pltt, dapedt-(ww*1.e11),'t',petit=[1,2,1],/rempli,/portrait |
---|
398 | ; pltt, dapedt/(ww*1.e11),'t',petit=[1,2,2],/rempli,/portrait,/noerase |
---|
399 | print, ' d(APE)/dt / wind work correlation', C_CORRELATE(dapedt, ww, [0]) |
---|
400 | print, ' APE/nino3 sst correlation=', correlation |
---|
401 | print, ' B/W efficiency (interannual) = ', efficiency |
---|
402 | print, ' B/W efficiency (SC) = ', efficiency_sc |
---|
403 | |
---|
404 | ; stop |
---|
405 | |
---|
406 | field = {name: '', data: rhop, legend: '', units: '', origin: '', direc: '', dim: 0} |
---|
407 | |
---|
408 | field.origin = tn.origin |
---|
409 | field.dim = tn.dim - 1 |
---|
410 | |
---|
411 | field.direc = 'xyzt' |
---|
412 | |
---|
413 | return, field |
---|
414 | END |
---|