﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
31	ana_psource.h problem	m.hadfield	arango	"When compiled with explicit-shape declarations, subroutine ana_psource_grid (file ROMS/Functionals/ana_psource.h, revision 48) contains

      integer, intent(out) :: Nsrc

and later there are several arguments dimensioned with this, eg:

      logical, intent(out) :: Lsrc(Nsrc,NT(ng))
      integer, intent(out) :: Isrc(Nsrc)

So Lsrc, Isrc, etc are dimensioned with an intent(out) argument, which is illegal and obviously problematic, as the compiler needs to knwo the dimensions before calling the subroutine. However Nsrc can't be made intent(in) as its value is specified inside the subroutine.

Arguments Lsrc, Isrc, etc need to be declared with the same dimensions as the actual arrays they correspond to, namely SOURCES(ng)%Lsrc, SOURCES(ng)%Isrc, etc. The dimensions are determined when they are allocated in subroutine allocate_sources, module mod_sources, the declarations above should be 

      logical, intent(out) :: Lsrc(Msrc,NT(ng))
      integer, intent(out) :: Isrc(Msrc)

This value has to be fed to the subroutine somehow. I've done it with

#ifndef ASSUMED_SHAPE
      USE mod_sources, ONLY : Msrc
#endif

but alternatively it could be fed in as an extra argument.

Corrected file is attached.
"	bug	closed	major	Release ROMS/TOMS 3.1	Nonlinear	3.1	Fixed		
