I am having an issue with a memory allocation, and it came back to the init for the var Nsrc.
In ROMS/Modules/mod_sources.F we have
#ifndef ANA_PSOURCE
....
Nsrc(mg)=var_Dsize(1) ! first dimension
....
#else
...
Msrc(ng)=200
Nsrc(ng)=Msrc(ng)
#endif
...
! Allocate point Sources/Sinks variables.
!
allocate ( SOURCES(ng) % Isrc(Nsrc(ng)) )
I do not have any Psources.
I did not set ana_psource.
Therefore Nsrc will only be set if i have a netcdf file.
--- Is it required to define ana_psource even if we do not have any sources? < this is my main question.
Can we just set Nsrc = 0 and adjust for a netcdf file or ana source?
-j
Nsrc init
Re: Nsrc init
I don't follow the question.
If ANA_PSOURCE is not defined but logical flags in roms.in indicate sources are to be used, then the netcdf file is interrogated.
If ANA_PSOURCE is defined, an arbitrary allocation of 200 is accommodated (there should probably be a warning in ana_psourceF about this).
If ANA_PSOURCE is not defined but logical flags in roms.in indicate sources are to be used, then the netcdf file is interrogated.
If ANA_PSOURCE is defined, an arbitrary allocation of 200 is accommodated (there should probably be a warning in ana_psourceF about this).
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu
Re: Nsrc init
I had a mix of options that were not correct and it caused an issue. There is a catch in mod_arrays to prevent my problem:
IF (LuvSrc(ng).or.LwSrc(ng).or.ANY(LtracerSrc(:,ng))) THEN
CALL allocate_sources (ng)
END IF
so this is all good.
sorry to raise the flag.
happy modeling.
-j
IF (LuvSrc(ng).or.LwSrc(ng).or.ANY(LtracerSrc(:,ng))) THEN
CALL allocate_sources (ng)
END IF
so this is all good.
sorry to raise the flag.
happy modeling.
-j