[ecco-support] question about calc_barostream.m

gael forget gforget at mit.edu
Mon Feb 29 16:19:50 EST 2016


Hi Martha,

I am transferring this thread to ecco-support since the answers may be of interest to others.

> I've used calc_barostream.m many times to calculate the barotropic streamfuntion.  I'd like to also use it to calculate the streamfunction in each layer, of course removing the divergent part of the flow.  It seems to me that the function can be used for this "as is", by simply passing u, v in a single depth layer, and then the function will return the streamfunction in Sv/m in that layer.  
> 
> Two questions
> (1) is this use correct?
> (2) If I do the above to calculate the streamfunction in each layer, I get a warning from diffsmooth2D_div_inv.m that the matrix is singular to working precision for a number of the depth levels. 


Yes this should work but you want to make sure that you specify an adequate list of scaling factors:

1) depending on the output you use dh | dz | hfac may have already been factored in by the MITgcm 
diagnostics package; UVELMASS & VVELMASS for example include hfac whereas UVEL & VVEL do not;
neither include the horizontal and vertical grid spacing (i.e. they are in m/s) but some other diagnostics may.
2) in the 3D case you can omit the list_factors argument of calc_barostream to let it apply the default dh and 
dz factors for you. But in 2D cases you want to apply dz beforehand and you might as well also apply dh 
beforehand too. Once you have converted velocities to m3/s you should be able to call calc_barostream
with list_factors={} as the fourth argument — in analogy with what's done in diags_set_SEAICE.m.

I would disregard the singular matrix warning unless you see something weird in the result.

> I'm trying to look at a section across the subtropical/subpolar gyre boundary, which I want to define as where the barotropic streamfunction is zero.   I looked a bit at the gcmfaces programs to see what might be helpful, including gcmfaces_lines_zonal.m and gcmfaces_lines_transp.m I'm still having trouble figuring out the best way to do this.  Do you have any suggestions? 


With regard to your earlier question pasted above (sorry for the delay) I would rather suggest using 
gcmfaces_interp_2d by providing the vectors of longitude and latitude that define the contour 
you like in the barotropic stream function. To identify these points you can do something like: 
	mskInt=1*(mygrid.Depth>1000);
	[mskCedge,mskWedge,mskSedge]=gcmfaces_edge_mask(mskInt);
	l=convert2vector(mygrid.XC); L=convert2vector(mygrid.YC); m=convert2vector(mskCedge);	
	l=l(find(m)); L=L(find(m));	

Two comments:
- gcmfaces_interp_2d.m is a relatively new capability (or at least I revamped it recently) so 
  make sure to use the latest gcmfaces before you try this. On a related note I recently revised 
  the gcmfaces examples and documentation (wrt gcmfaces_interp_2d.m see example_interp.m).
- gcmfaces_edge_mask.m also provides the velocity points (mskWedge,mskSedge) that
  you would need to compute transports across your selected domain edge.

Hope this helps.

Cheers,
Gael


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/mailman/private/ecco-support/attachments/20160229/9ebf6894/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1843 bytes
Desc: not available
Url : http://mailman.mit.edu/mailman/private/ecco-support/attachments/20160229/9ebf6894/attachment.bin


More information about the ecco-support mailing list