In ROMS 2.1, arrays
Tobc_in and
Tobc_out are allocated in subroutine
initialize_scalars (mod_scalars.F lines 1263-1264) and written to netCDF output files in function
wrt_info (wrt_info.F lines 608-632). They are given values in subroutine
set_nudgcof_tile (set_nudgcof.F lines 552-665) but only for the boundaries on which the corresponding
xxxx_TNUDGING option is defined. So there may be uninitialised values written to the output file. This can generates an error; whether this actually happens depends on how the compiler treats allocated, but uninitialised, variables and on how tolerant the netCDF library is.
One solution is to write
Tobc_in and
Tobc_out only for those boundaries where they are used. But this would be awkward, as each array is currently written to a single netCDF variable. The simpler solution is to initialise these arrays with zeros in initialize_scalars, eg. replace lines 1263-1264 in mod_scalars.F
Code: Select all
allocate ( Tobc_in(MT,Ngrids,4) )
allocate ( Tobc_out(MT,Ngrids,4) )
with
Code: Select all
allocate ( Tobc_in(MT,Ngrids,4) )
Tobc_in = IniVal
allocate ( Tobc_out(MT,Ngrids,4) )
Tobc_out = IniVal