Possible Issue with White_noise

Bug reports, work arounds and fixes

Moderators: arango, robertson

Post Reply
Message
Author
stefano.masier

Possible Issue with White_noise

#1 Unread post by stefano.masier »

Hi everybody.
First of all, I'd like to thank you all for your great efforts. I'm quite new in ROMS and I'm still struggling to make it work, but your forum is a goldmine for hints and tips. 8)

Now, back to the topic. I was trying to run a simulation with "white_noise" on, but it always failed during the run.
The reported error was:

Code: Select all

ERROR IN: .oceanS: munmap_chunk(): invalid pointer: 0x09df2538
followed by the backtracing.
The last code was variable, but the error was always the same. Switching off the white noise caused the simulation to run smoothly, so the problem was there.

After some checks, we found the issue: in 'white_noise.f' there was a wrong definition in the 2D routine.
Around line 250 the code was:

Code: Select all

 R(Imin:Imax,Jmin:Jmax) 
while changing it with:

Code: Select all

 R(LBi:UBi,LBj:UBj) 
apparently solved the problem.

What do you think?

Thank you for your time,
Stefano

User avatar
kate
Posts: 4088
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: Possible Issue with White_noise

#2 Unread post by kate »

That's odd. What version of the code are you using? Looking through the history of my white_noise.F (going back to 2009), I only find versions with R(LBi:UBi,LBj:UBj).

stefano.masier

Re: Possible Issue with White_noise

#3 Unread post by stefano.masier »

I downloaded it in December from the repository; I really don't know what to say :?

stefano.masier

Re: Possible Issue with White_noise

#4 Unread post by stefano.masier »

Ok, I downloaded the new version from the svn and the error popped up again.

Here I'm going to write the issue in detail:

in 'white_noise.f' at lines 229 and following there is:

Code: Select all

#else
        ic=0
        DO j=Jmin,Jmax
          DO i=Imin,Imax
            ic=ic+1
            R(i,j)=random(ic)
          END DO
        END DO
#endif
What I did was simply this:

Code: Select all

#else
        ic=0
!       DO j=Jmin,Jmax
!         DO i=Imin,Imax
	DO j=LBj,UBj
	  DO i=LBi,UBi
            ic=ic+1
            R(i,j)=random(ic)
          END DO
        END DO
#endif
and the error vanished 8) Sorry I was not clear in my previous post.

User avatar
arango
Site Admin
Posts: 1347
Joined: Wed Feb 26, 2003 4:41 pm
Location: DMCS, Rutgers University
Contact:

Re: Possible Issue with White_noise

#5 Unread post by arango »

The routines in the white noise module white_noise.F are specific to the adjoint algorithms and we pass the Imin, Imax, Jmin, Jmax dummy variables as arguments. These are tiled parallel routines and need to be used by passing the appropriate values for these I- and J-range parameters. Using the array dimension values LBi, UBi, LBj, and UBj is totally incorrect in ROMS parallelism framework :!:

It seems that you are using these routines for other purposes and you need to use the appropriate call and pass the correct arguments. You can see how these routines are used in ROMS and follow the examples.

Post Reply