1 |
% |
% |
2 |
% [] = compute_JBz(SNAPSHOT) |
% [JBz] = compute_JBz(SNAPSHOT) |
3 |
% |
% |
4 |
% Here we compute the PV flux due to diabatic processes as |
% Here we compute the PV flux due to diabatic processes as |
5 |
% JFz = - alpha * f * Qnet / MLD / Cw |
% JFz = - alpha * f * Qnet / MLD / Cw |
7 |
% alpha = 2.5*E-4 1/K is the thermal expansion coefficient |
% alpha = 2.5*E-4 1/K is the thermal expansion coefficient |
8 |
% f = 2*OMEGA*sin(LAT) is the Coriolis parameter |
% f = 2*OMEGA*sin(LAT) is the Coriolis parameter |
9 |
% Qnet is the net surface heat flux (W/m^2), positive downward |
% Qnet is the net surface heat flux (W/m^2), positive downward |
10 |
% MLD is the mixed layer depth (m) |
% MLD is the mixed layer depth (m, positive) |
11 |
% Cw = 4187 J/kg/K is the specific heat of seawater |
% Cw = 4187 J/kg/K is the specific heat of seawater |
12 |
% |
% |
13 |
% Files names are: |
% Files names are: |
22 |
% 06/27/06 |
% 06/27/06 |
23 |
% gmaze@mit.edu |
% gmaze@mit.edu |
24 |
|
|
25 |
function compute_JBz(snapshot) |
function varargout = compute_JBz(snapshot) |
26 |
|
|
27 |
global sla toshow |
global sla toshow |
28 |
global netcdf_suff netcdf_domain |
global netcdf_suff netcdf_domain |
123 |
nc{'Z'}.long_name = ncchar('depth'); |
nc{'Z'}.long_name = ncchar('depth'); |
124 |
nc{'Z'}.gridtype = nclong(0); |
nc{'Z'}.gridtype = nclong(0); |
125 |
nc{'Z'}.units = ncchar('m'); |
nc{'Z'}.units = ncchar('m'); |
126 |
nc{'Z'}(:) = Qdpt; |
nc{'Z'}(:) = Qdpt(1); |
127 |
|
|
128 |
% And main field: |
% And main field: |
129 |
nc{ncid} = ncfloat('Z', 'Y', 'X'); |
nc{ncid} = ncfloat('Z', 'Y', 'X'); |
135 |
nc{ncid}(:,:,:) = JBz; |
nc{ncid}(:,:,:) = JBz; |
136 |
|
|
137 |
nc=close(nc); |
nc=close(nc); |
138 |
|
close(ncQ); |
139 |
|
close(ncMLD); |
140 |
|
|
141 |
|
|
142 |
|
|
143 |
|
% Output: |
144 |
|
output = struct('JBz',JBz,'lat',Qlat,'lon',Qlon); |
145 |
|
switch nargout |
146 |
|
case 1 |
147 |
|
varargout(1) = {output}; |
148 |
|
end |