[MITgcm-support] Initial Wind on Cubed Sphere

Jean-Michel Campin jmc at ocean.mit.edu
Fri May 4 17:25:03 EDT 2012


Hi Chris,

On Thu, May 03, 2012 at 03:27:20PM +0100, Chris Watkins wrote:
> Jean-Michel,
> 
> Thank you for your help. I'm afraid I have a few more questions.
> 
> I note uvLatLon2cube.m uses a file 'proj_cs32_2uEvN.bin' to get the
> cosalpha, sinalpha values. I have found that this is available in one of
> the verification examples. Are similar files available for C16 and C64
> grids? If not how do I make such files?

The problem here is that in the old days (before MITgcm started to write
AngleCS.*[data/meta] & AngleSN.*[data/meta]) we were storing these angles
in some binary files. But in your case, you can load these angles separately
(from AngleCS.* & AngleSN.* binary files, or from grid.t*.nc files if you 
are using NetCDF output files) and then pass these angles to uvLatLon2cube.m
(the last 2 optional arguments: cosalpha,sinalpha).
I should probably update this matlab script (to remove old & unused 
reference to proj_cs32_2uEvN.bin).

> You say to calculate the wind field at the cell center, rotate and move to
> the CS-grid - I'm not quite sure what to do to achieve that.
Yes, I was not clear: uvLatLon2cube.m does these 3 steps, but if you want
to just pick one of the 3 steps, should not be hard to isolate the corresponding
section within the matlab script.

> Finally, is the output of uvLatLon2cube.m in the right order for conversion
> into .bin files to be used to initialize a run? I guess what I am asking is
> does reshape(uCs,1,numel(uCs)) put the data in to correct order conversion
> to u_ini.bin to be read into MITgcm as uVelInitFile? And similarly for vCs?

Yes, it should be the right order (unless you select, in data.exch2: W2_mapIO, 
a format different from the default).

Cheers,
Jean-Michel

> Thanks,
> 
> Chris
> 
> On 1 May 2012 18:33, Jean-Michel Campin <jmc at ocean.mit.edu> wrote:
> 
> > Chris,
> >
> > This is a good question (I did not look to this script for some time,
> > need to remember how things are done) and should be documented at the
> > top ofuvLatLon2cube.m.
> > "spv" is an optional argument (but it's unfortunate that it's before
> > cosalpha,sinalpha,
> > which you may want to specify without providing "spv") for an
> > exclusion-value
> > (or "special value") that could be found in the input uFld,vFld over dead
> > region
> > (e.g., continent when processing oceanic velocity).
> > And when "spv" is specified, the interpolation discard these "dead regions"
> > and, at the end, put back "spv" over these regions.
> > So if you specify a value for "spv" that is not present anywhere neither in
> > uFld nor in vFld, then it will have no effect on the result.
> >
> > Cheers,
> > Jean-Michel
> >
> > On Tue, May 01, 2012 at 04:28:43PM +0100, Chris Watkins wrote:
> > > Hi Jean-Michel,
> > >
> > > Thank you for such a quick response. I was looking at
> > > utils/matlab/cs_grid/uvLatLon2cube.m. It asks for spv as one of its
> > input.
> > > Can you tell me what spv is?
> > >
> > > Thanks again,
> > >
> > > Chris
> > >
> > > On 1 May 2012 16:11, Jean-Michel Campin <jmc at ocean.mit.edu> wrote:
> > >
> > > > Hi Chris,
> > > >
> > > > Depending on the wind field, you may try one of the 2 methods:
> > > > 1) general method (similar to what is done within matlab script
> > > >  utils/matlab/cs_grid/uvLatLon2cube.m): your can define your wind field
> > > >  on a lat-lon grid and then use uvLatLon2cube.m to interpolate + rotate
> > > >  to CS-grid direction + put the uVel,vVel on to C-grid location;
> > > > Or, you can skip the interpolation stage and define your wind field
> > > >  on the CS-grid, at the grid-cell center location and then just do
> > > >  the rotation + the move to C-grid location.
> > > > 2) specific method for non-divergent wind-field (this is a special case
> > > >  which is not uncommon): From the analytical expression of the wind,
> > > >  you can derive an analytical expression of the horizontal
> > stream-function.
> > > >  Then you evaluate the stream-function on the CS-grid at the grid-cell
> > > > corner
> > > >  (position XG,YG) and from there you can compute directly the wind
> > > >  at the C-grid location (this ensure that uVel,vVel field is non
> > > > divergent).
> > > >  There are few matlab scripts that uses this 2nd method (e.g., in
> > > >  MITgcm_contrib/dyncore_ASP/mat_scripts ) and also some fortran code
> > > >  (e.g., verification/advect_cs/code/ini_vel.F or
> > > >   verification/code/solid-body.cs-32x32x1/code/ini_vel.F).
> > > >
> > > > Cheers,
> > > > Jean-Michel
> > > >
> > > > On Tue, May 01, 2012 at 02:34:45PM +0100, Chris Watkins wrote:
> > > > > I am trying to set up an initial wind field using the file ini_vel.f
> > on a
> > > > > cubed sphere. I know analytically what the meridional and zonal winds
> > > > > should be on a latitude-longitude grid. Can anyone help me understand
> > > > what
> > > > > adjustments I need to make to these values to make them into the
> > uVel and
> > > > > vVel variables.
> > > > >
> > > > > I originally set uVel to the zonal wind and vVel to the meridional
> > wind
> > > > but
> > > > > the output for U & V  for timestep 0 does not match.
> > > > >
> > > > > --
> > > > > Chris Watkins
> > > >
> > > > > _______________________________________________
> > > > > MITgcm-support mailing list
> > > > > MITgcm-support at mitgcm.org
> > > > > http://mitgcm.org/mailman/listinfo/mitgcm-support
> > > >
> > > >
> > > > _______________________________________________
> > > > MITgcm-support mailing list
> > > > MITgcm-support at mitgcm.org
> > > > http://mitgcm.org/mailman/listinfo/mitgcm-support
> > > >
> > >
> > >
> > >
> > > --
> > > Chris Watkins
> > >
> > > G+ GPlus.to/ChrisWatkins <http://gplus.to/ChrisWatkins>
> >
> > > _______________________________________________
> > > MITgcm-support mailing list
> > > MITgcm-support at mitgcm.org
> > > http://mitgcm.org/mailman/listinfo/mitgcm-support
> >
> >
> > _______________________________________________
> > MITgcm-support mailing list
> > MITgcm-support at mitgcm.org
> > http://mitgcm.org/mailman/listinfo/mitgcm-support
> >
> 
> 
> 
> -- 
> Chris Watkins
> 
> G+ GPlus.to/ChrisWatkins <http://gplus.to/ChrisWatkins>

> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-support




More information about the MITgcm-support mailing list