﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
268	3D U variables misaligned with INLINE_2DIO	m.hadfield	arango	"When '''DISTRIBUTE''' and '''INLINE_2DIO''' are defined (which normally happens only on the UNICOS_SN platform) there is a misalignment problem when 3D u-grid variables are written to a netCDF file: successive rows of data are out of step by 1, leading to a skewing of the fields. The same error occurs (I think) when data are read from a restart file.

I have traced this to functions '''mp_gather2d''' and '''mp_scatter2d''' in '''distribute.F'''. These have code to adjust the offset for U and V grids:
{{{
      IF ((MyType.eq.p2dvar).or.(MyType.eq.u2dvar)) Io=1
      IF ((MyType.eq.p2dvar).or.(MyType.eq.v2dvar)) Jo=1
}}}
However this doesn't anticipate the possibility that '''mp_gather2d''' and '''mp_scatter2d''' will be called for 3D variables, as happens when '''INLINE_2DIO''' is defined. To cover this case, the code should be changed to the following
{{{
      IF ((MyType.eq.p2dvar).or.(MyType.eq.u2dvar).or.                  &
     &    (MyType.eq.p3dvar).or.(MyType.eq.u3dvar)) Io=1
      IF ((MyType.eq.p2dvar).or.(MyType.eq.v2dvar).or.                  &
     &    (MyType.eq.p3dvar).or.(MyType.eq.v3dvar)) Jo=1
}}}
A modified version of '''distribute.F''' is attached."	bug	closed	major	Release ROMS/TOMS 3.2	Nonlinear	3.2	Fixed		
