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