River Sinks

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
ashbre
Posts: 21
Joined: Tue Apr 28, 2020 3:08 pm
Location: Florida Atlantic University

River Sinks

#1 Unread post by ashbre »

Dear ROMS users,

I'm having an issue with sinks in my river files. My understanding is (assume a square enclosed lake) that If I wanted a sink on my west bank, then I need the following:

river_direction = 0
river_transport < 0
river location on the land (u-point) with adjacent water point.

However, when I do this, the situation becomes very unstable for tracers. If I make this a source (river_transport >0) - then I get reasonable behaviour.

Any words of wisdom would be greatly appreciated!
Ash

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

Re: River Sinks

#2 Unread post by kate »

Do you only have river sinks or are there sources as well? You always want the tracer advection to be "upwind", using the tracer value of the upwind point. For sources, that means specifying the river temperature. For sinks, that means using the ambient temperature.

ashbre
Posts: 21
Joined: Tue Apr 28, 2020 3:08 pm
Location: Florida Atlantic University

Re: River Sinks

#3 Unread post by ashbre »

I see! I’m using using both, some rivers are sources and some rivers are sinks. Is there a tidy way to handle that?

Thanks for the quick response!

User avatar
wilkin
Posts: 922
Joined: Mon Apr 28, 2003 5:44 pm
Location: Rutgers University
Contact:

Re: River Sinks

#4 Unread post by wilkin »

Did you read the description in wikiroms?
https://www.myroms.org/wiki/River_Runoff

I would hope if you simply followed the protocols for a reversed sign for a sink it would work. The code was originally conceived that way long, long ago, but you are in novel territory on this as a user.

I did not test the "sink" case with the recently corrected LwSrc option.
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

ashbre
Posts: 21
Joined: Tue Apr 28, 2020 3:08 pm
Location: Florida Atlantic University

Re: River Sinks

#5 Unread post by ashbre »

Thanks for your reply!

Ha yes, I went over this page with a fine tooth comb - and I think I can understand how it wants me to locate the rivers for a sink. But the stability was throwing me off a little (making me think I've done something wrong).

How would I go about setting the tracer values of the rivers to the ambient temperature of my water?

Thanks again,
Ash

ashbre
Posts: 21
Joined: Tue Apr 28, 2020 3:08 pm
Location: Florida Atlantic University

Re: River Sinks

#6 Unread post by ashbre »

So I tried to turn off the tracer at particular source locations. I want the water volume to change, but I don't want to insert any tracer differences.

My logic is that I want to somehow mimic the behavior of "LtracerSrc = F" for certain rivers. But perhaps I am not fully understanding.

I did the following edits in step3d_t.F line 730:

IF (LuvSrc(ng)) THEN
DO is=1,Nsrc(ng)
Isrc=SOURCES(ng)%Isrc(is)
Jsrc=SOURCES(ng)%Jsrc(is)
IF (INT(SOURCES(ng)%Dsrc(is)).eq.0) THEN
IF ((Hadvection(itrc,ng)%MPDATA).or. &
& (Hadvection(itrc,ng)%HSIMT)) THEN
LapplySrc=(IstrUm2.le.Isrc).and. &
& (Isrc.le.Iendp3).and. &
& (JstrVm2.le.Jsrc).and. &
& (Jsrc.le.Jendp2i)
ELSE
LapplySrc=(Istr.le.Isrc).and. &
& (Isrc.le.Iend+1).and. &
& (Jstr.le.Jsrc).and. &
& (Jsrc.le.Jend)
END IF

IF (is.ge.5) THEN
LapplySrc = .FALSE.
FX(Isrc,Jsrc)=0.0_r8
ENDIF


Here, river numbers 5 and greater are the sources/sinks I would like to remove.

My test case was a source with higher temperature than the ambient temperature. The result without the change (above) introduces hot water. The result with the change introduces cold water.

If anyone out there in the ether has any ideas on how I should do this properly, I'd really appreciate it!

Ash

User avatar
wilkin
Posts: 922
Joined: Mon Apr 28, 2003 5:44 pm
Location: Rutgers University
Contact:

Re: River Sinks

#7 Unread post by wilkin »

The existing LtracerSrc functionality is to give the option to have selected tracer concentration data applied at all rivers, or none.

If I understand what you are asking, it is to break down that choice so that you specify inflow tracer concentration for some rivers (presumably where you have those data) but not at others (because you have no information).

So you want to have the LtracerSrc logical flag that is presently indexed on tracer number itrc (and grid, ng) as LtracerSrc(itrc,ng) also be effectively indexed on river source number as LtracerSrc(itrc,is,ng) where is=1,Nsrc.

It sounds like you've cleverly grouped the sources where you do want to specify the tracer concentration as sources 1 through 4 (you say remove tracers from 5 and greater), so I think the logic you want is to augment the logical test on LtracerSrc with a test on river number.

So in step3d_t.F near line 745 is would be instead of ...

Code: Select all

                END IF
                IF (LapplySrc) THEN
                  IF (LtracerSrc(itrc,ng)) THEN
                    FX(Isrc,Jsrc)=Huon(Isrc,Jsrc,k)*                    &
     &                            SOURCES(ng)%Tsrc(is,k,itrc)
to have ...

Code: Select all

                END IF
                IF (LapplySrc).and.(is.lt.5) THEN
                  IF (LtracerSrc(itrc,ng)) THEN
                    FX(Isrc,Jsrc)=Huon(Isrc,Jsrc,k)*                    &
     &                            SOURCES(ng)%Tsrc(is,k,itrc)

I think this will work because you are inside the D0 is=1,Nsrc(ng) loop and the behavior you want for source numbers 5 and greater is the code after the ELSE. (There are probably other places in the code where you need to deploy the same logic.)

As I understand it, the LapplySrc flag is there to ensure the code is activated only if in the correct tile of the MPI parallelization. You don't want to monkey with that or you may introduce a parallel bug.
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

ashbre
Posts: 21
Joined: Tue Apr 28, 2020 3:08 pm
Location: Florida Atlantic University

Re: River Sinks

#8 Unread post by ashbre »

This change works perfectly! Thank you for considering the problem for me, it is greatly appreciated!

So the idea is that sources add water and change the concentration of the tracer depending on the value of the tracer in the river, say. A sink on the other hand with remove water, but it won't change the concentration of the tracer around the river - hence the need to shut off the tracer part for some rivers (which act to only remove water from the system).

Thanks again for your help!

Ash

Post Reply