1 | ;+ |
---|
2 | ; |
---|
3 | ; @version |
---|
4 | ; $Id$ |
---|
5 | ; |
---|
6 | ;- |
---|
7 | FUNCTION msfz, vnname, date1, date2 $ |
---|
8 | , MASK=mask $ |
---|
9 | , ORCA=orca $ |
---|
10 | , _EXTRA=extra |
---|
11 | ; |
---|
12 | compile_opt idl2, strictarrsubs |
---|
13 | ; |
---|
14 | @common |
---|
15 | domdef,0,100000 |
---|
16 | ;------------------------- |
---|
17 | case n_params() of |
---|
18 | 0:msf=read_ncdf('vomecrty',0,/timestep,_EXTRA=extra,iodir=iodir,/nostruct,/tout) |
---|
19 | 1:begin |
---|
20 | if size(vnname,/type) eq 7 then $ |
---|
21 | msf=read_ncdf(vnname,0,/timestep,_EXTRA=extra,iodir=iodir,/nostruct,/tout) $ |
---|
22 | else msf=vnname |
---|
23 | end |
---|
24 | 2:msf=read_ncdf(vnname,date1,_EXTRA=extra,iodir=iodir,/nostruct,/tout) |
---|
25 | 3:msf=read_ncdf(vnname,date1,date2,_EXTRA=extra,iodir=iodir,/nostruct,/tout) |
---|
26 | endcase |
---|
27 | if n_params() eq 3 then msf=grossemoyenne(msf,'t') |
---|
28 | msf=msf*vmask() |
---|
29 | if keyword_set(mask) then begin |
---|
30 | ; print, 'subdomain: use of mask argument' |
---|
31 | if (size(mask))[0] eq 2 then mask=reform(mask[*]#replicate(1,jpk),jpi,jpj,jpk) |
---|
32 | msf=msf*mask |
---|
33 | endif else mask=1 |
---|
34 | ;print, mask |
---|
35 | msf=moyenne(msf,'x',/integration) |
---|
36 | msf=1e-6*msf |
---|
37 | e3t2d=replicate(1,jpj)#e3t |
---|
38 | msf=total(msf*e3t2d,2,/cumulative) |
---|
39 | msf=shift(msf,0,1) |
---|
40 | ; if sub basin, substract the bottom value (equivalent to upward integration) |
---|
41 | if keyword_set(mask) then begin |
---|
42 | for k=0, jpk-1 do begin |
---|
43 | for j=0,jpj-1 do begin |
---|
44 | msf[j,k] = msf[j,k] - msf[j,jpk-1] |
---|
45 | endfor |
---|
46 | endfor |
---|
47 | endif |
---|
48 | varname='Meridional Stream Function' |
---|
49 | varunit='Sv' |
---|
50 | vargrid='W' |
---|
51 | if keyword_set(orca) then begin |
---|
52 | case orca of |
---|
53 | 2:ixref=51-1 |
---|
54 | .5:ixref=204-1 |
---|
55 | .25:ixref=408-1 |
---|
56 | else:ixref=0 |
---|
57 | endcase |
---|
58 | ixref=ixref-ixminmesh |
---|
59 | ixref=ixref+key_shift |
---|
60 | ixref=ixref mod jpi |
---|
61 | if ixref lt 0 then ixref=ixref+jpi |
---|
62 | endif else ixref=0 |
---|
63 | domdef,ixref,ixref,0,jpj-1,0,jpk-1,/index,grille=['T','W'] |
---|
64 | ;terre=where(total(vmask()*mask,1) eq 0) |
---|
65 | ;if n_elements(valmask) eq 0 then valmask=1e20 |
---|
66 | ;if terre[0] ne -1 then msf[terre]=valmask |
---|
67 | ;------------------------ |
---|
68 | return, msf |
---|
69 | end |
---|