﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
915	VERY IMPORTANT: corrected bug when defining depth arrays in output NetCDF files	arango		"Corrected bug to define time-independent depth arrays in the output history, quicksave, and DA initialization NetCDF files. We get the following error during execution:

[[span(style=color: #FF0000, output statement overflows record, unit -5 )]]

The issue is fixed by changing the depth variable **long_name** attribute statement from:
 {{{
         WRITE (Vinfo( 2),40) Vname(2,idpthR)
}}}
to
 {{{
         WRITE (Vinfo( 2),40) TRIM(Vname(2,idpthR))
         ...

  40  FORMAT ('time independent',1x,a)
}}}
We need to use the intrinsic **TRIM()** function to remove the padding blanks and avoid overflow.

I am appalled about this one; no idea what the previous version of the compilers was doing here. Although the value in **Vname** for this case is [[span(style=color: #0000FF, ""depth of RHO-points"" )]]
the standard says that compilers should pad with blank spaces to the declared length of the character string (**120**). So, the first statement above prepended [[span(style=color: #0000FF, ""time independent"")]] to the resulting string, rendering the **Vinfo(2)** length larger than the declared **120** characters.

To avoid related issues in the future, the management of **Vname** and **Vinfo** is updated in several routines with a character length parameter, **!MaxLen** in the delaration:
 {{{
      integer, parameter :: MaxLen = 160    ! information string length
      ...
      character (len=MaxLen) :: Vname(6,0:NV)
      ...
      character (len=MaxLen), dimension(8) :: Vinfo
}}}
Notice its character length is incremented from **120** to **160**.

Many thanks to Jiangtao Xu (NOAA) for reporting and tracking this bug."	bug	closed	major	Release ROMS/TOMS 4.1	Nonlinear	4.0	Fixed		
