/[MITgcm]/MITgcm_contrib/gmaze_pv/compute_JBz.m
ViewVC logotype

Diff of /MITgcm_contrib/gmaze_pv/compute_JBz.m

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1 by gmaze, Mon Jul 10 15:09:01 2006 UTC revision 1.5 by gmaze, Wed Sep 19 15:37:38 2007 UTC
# Line 1  Line 1 
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
# Line 7  Line 7 
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:
# Line 22  Line 22 
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
# Line 123  nc{'Z'}.uniquename = ncchar('Z'); Line 123  nc{'Z'}.uniquename = ncchar('Z');
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');
# Line 135  nc{ncid}.uniquename    = ncchar(uniquena Line 135  nc{ncid}.uniquename    = ncchar(uniquena
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

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.22