/[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

--- MITgcm_contrib/gmaze_pv/compute_JBz.m	2006/10/06 21:44:51	1.2
+++ MITgcm_contrib/gmaze_pv/compute_JBz.m	2007/02/01 17:02:02	1.3
@@ -1,5 +1,5 @@
 %
-% [] = compute_JBz(SNAPSHOT)
+% [JBz] = compute_JBz(SNAPSHOT)
 %
 % Here we compute the PV flux due to diabatic processes as
 % JFz = - alpha * f * Qnet / MLD / Cw
@@ -22,7 +22,7 @@
 % 06/27/06
 % gmaze@mit.edu
 
-function compute_JBz(snapshot)
+function varargout = compute_JBz(snapshot)
 
 global sla toshow
 global netcdf_suff netcdf_domain
@@ -123,7 +123,7 @@
 nc{'Z'}.long_name  = ncchar('depth');
 nc{'Z'}.gridtype   = nclong(0);
 nc{'Z'}.units      = ncchar('m');
-nc{'Z'}(:)         = Qdpt;
+nc{'Z'}(:)         = Qdpt(1);
  
 % And main field:
 nc{ncid}               = ncfloat('Z', 'Y', 'X'); 
@@ -135,5 +135,14 @@
 nc{ncid}(:,:,:)        = JBz;
 
 nc=close(nc);
+close(ncQ);
+close(ncMLD);
 
 
+
+% Output:
+output = struct('JBz',JBz,'lat',Qlat,'lon',Qlon);
+switch nargout
+ case 1
+  varargout(1) = {output};
+end

 

  ViewVC Help
Powered by ViewVC 1.1.22