Point source definitions
Point source definitions
I'm working on adding a point source (a river) to a test grid. In my input file (estuary.in) I added:
#define UV_PSOURCE /* use to turn ON or OFF point Sources/Sinks */
#define Q_PSOURCE /* use to turn ON or OFF mass point Sources */
#define ANA_PSOURCE /* use if analytical point Sources/Sinks */
The additions I made in the ANA_PSOURCE file are:
! Set tracer and/or mass point sources and/or sink.
#elif defined ESTUARY
Nsrc=1
Dsrc(Nsrc)=0.0_r8
Isrc(Nsrc)=1
Jsrc(Nsrc)=1
Lsrc(Nsrc,itemp)=.TRUE.
Lsrc(Nsrc,isalt)=.TRUE.
! If appropriate, set-up nondimensional shape function to distribute
! mass point sources/sinks vertically. It must add to unity!!.
# elif defined ESTUARY
DO k=1,N(ng)
DO is=1,Nsrc
Qshape(is,k)=1.0_r8/REAL(N(ng),r8)
END DO
END DO
! Set-up vertically integrated mass transport (m3/s) of point
! Sources/Sinks (positive in the positive U- or V-direction and
! viceversa).
# elif defined ESTUARY
DO is=1,Nsrc
Qbar(Nsrc)=10.0_r8
END DO
The model will compile with UV_PSOURCE added but fails with Q_PSOURCE included. The error I get is:
cd /ROMS/Projects/estuary/Build; g95 -c -fno-second-underscore -g -fbounds-check -ftrace=full pre_step3d.f90
cd /ROMS/Projects/estuary/Build; g95 -c -fno-second-underscore -g -fbounds-check -ftrace=full step3d_t.f90
In file step3d_t.f90:59
& SOURCES(ng) % Isrc, &
1
Error: Syntax error in argument list at (1)
cd /ROMS/Projects/estuary/Build; g95 -c -fno-second-underscore -g -fbounds-check -ftrace=full step3d_uv.f90
make: *** [/ROMS/Projects/estuary/Build/step3d_t.o] Error 1
make: *** Waiting for unfinished jobs....
My second question is about the point source time series. I now have it set up as a constant flow. How do I define a changing flow? How do I define changing salinity? sediment concentration (once I get to those runs)?
Again, thanks.
#define UV_PSOURCE /* use to turn ON or OFF point Sources/Sinks */
#define Q_PSOURCE /* use to turn ON or OFF mass point Sources */
#define ANA_PSOURCE /* use if analytical point Sources/Sinks */
The additions I made in the ANA_PSOURCE file are:
! Set tracer and/or mass point sources and/or sink.
#elif defined ESTUARY
Nsrc=1
Dsrc(Nsrc)=0.0_r8
Isrc(Nsrc)=1
Jsrc(Nsrc)=1
Lsrc(Nsrc,itemp)=.TRUE.
Lsrc(Nsrc,isalt)=.TRUE.
! If appropriate, set-up nondimensional shape function to distribute
! mass point sources/sinks vertically. It must add to unity!!.
# elif defined ESTUARY
DO k=1,N(ng)
DO is=1,Nsrc
Qshape(is,k)=1.0_r8/REAL(N(ng),r8)
END DO
END DO
! Set-up vertically integrated mass transport (m3/s) of point
! Sources/Sinks (positive in the positive U- or V-direction and
! viceversa).
# elif defined ESTUARY
DO is=1,Nsrc
Qbar(Nsrc)=10.0_r8
END DO
The model will compile with UV_PSOURCE added but fails with Q_PSOURCE included. The error I get is:
cd /ROMS/Projects/estuary/Build; g95 -c -fno-second-underscore -g -fbounds-check -ftrace=full pre_step3d.f90
cd /ROMS/Projects/estuary/Build; g95 -c -fno-second-underscore -g -fbounds-check -ftrace=full step3d_t.f90
In file step3d_t.f90:59
& SOURCES(ng) % Isrc, &
1
Error: Syntax error in argument list at (1)
cd /ROMS/Projects/estuary/Build; g95 -c -fno-second-underscore -g -fbounds-check -ftrace=full step3d_uv.f90
make: *** [/ROMS/Projects/estuary/Build/step3d_t.o] Error 1
make: *** Waiting for unfinished jobs....
My second question is about the point source time series. I now have it set up as a constant flow. How do I define a changing flow? How do I define changing salinity? sediment concentration (once I get to those runs)?
Again, thanks.
Do not use Q_Psource for your application. That is a vertical source term, and it is under construction.
For rivers use uv_psource.
This question has been asked several times, so I put this information (just now) on the wiki. We should have the answer at one place.
So try to look at this:
https://www.myroms.org/wiki/index.php/River_Runoff
and see if it helps. I can edit the page to make it more clear, add links, etc.
Maybe we all can get this page to be a correct description, so that users can go to one place to get the answer.
For rivers use uv_psource.
This question has been asked several times, so I put this information (just now) on the wiki. We should have the answer at one place.
So try to look at this:
https://www.myroms.org/wiki/index.php/River_Runoff
and see if it helps. I can edit the page to make it more clear, add links, etc.
Maybe we all can get this page to be a correct description, so that users can go to one place to get the answer.
John,
Thanks for the threads about how to distribute freshwater loadings and making the Wiki page to put that info in one place. It helps with understanding things a bit better.
I still don't seem to be able to get freshwater into my system. I have tried inverting things so that the initial condition = 0 psu with a 34 psu loading to try and tease out a signal if it were weak.
In the ANA_PSOURCE file, there are two point source examples with temperature and salinity loadings RIVERPLUME1 & 2. I have run both test cases and the salinities are uniformily 32 (where there is water) but temperature seems to be working fine (using both ncView and Matlab). In my test case, I get the same results--uniform salinity and a temperature response.
I assume that the examples output salinity right, so I think that I must be missing something but I have no idea what it may be.
Since I'm just doing this as a test to build on my understanding of things, it may be more efficient just to make loading files. If so, I have a couple of questions: Where are the grid locations for the input forcing files (changing flows/salinity/sediment *.nc files) specified ? I see where they are read from FRCNAME and ANA_PSOURCE.
And again, I say "Thanks for the help".
Thanks for the threads about how to distribute freshwater loadings and making the Wiki page to put that info in one place. It helps with understanding things a bit better.
I still don't seem to be able to get freshwater into my system. I have tried inverting things so that the initial condition = 0 psu with a 34 psu loading to try and tease out a signal if it were weak.
In the ANA_PSOURCE file, there are two point source examples with temperature and salinity loadings RIVERPLUME1 & 2. I have run both test cases and the salinities are uniformily 32 (where there is water) but temperature seems to be working fine (using both ncView and Matlab). In my test case, I get the same results--uniform salinity and a temperature response.
I assume that the examples output salinity right, so I think that I must be missing something but I have no idea what it may be.
Since I'm just doing this as a test to build on my understanding of things, it may be more efficient just to make loading files. If so, I have a couple of questions: Where are the grid locations for the input forcing files (changing flows/salinity/sediment *.nc files) specified ? I see where they are read from FRCNAME and ANA_PSOURCE.
And again, I say "Thanks for the help".
Re: Point source definitions
Hi, all
I'm trying to represent the river plume model which has a large discharge with uv_psource & ana_psource defined on cpp flag. The discharge varies 10000 upto 60000 ms-1. The size of delta x is approximately 11 km. At first, when I put the tidal forcing together with river, every thing was fine. However, once I ran the model without tide, I got high temperature when the amount of discharge is getting larger. At that time, I put only one river point source. I was thinking only one river point is not able to run off such a large amount of discharge. Hence, I tried to devide the discharge by three and put them in each grid point as a point source. Yet I still get the high temperature and it blow up when it is above 50 degree celcius on both cases.
I also tried Q_psource with ana_psource instead of using UV_psource with ana_psource. It looked fine at first but eventually the problem arose again. At this time, I got low temperature around -2 degree celcius instead of high temerature. By the way, the model didn't blow up until the end of set up time. The value of salinity in all cases were fine and they were reasonable. I don't know why I'm getting high/low temperature in my model.
Would you help me out please? I attach the pictures of my result.
Thanks in advance.
Regards,
-Peter
I'm trying to represent the river plume model which has a large discharge with uv_psource & ana_psource defined on cpp flag. The discharge varies 10000 upto 60000 ms-1. The size of delta x is approximately 11 km. At first, when I put the tidal forcing together with river, every thing was fine. However, once I ran the model without tide, I got high temperature when the amount of discharge is getting larger. At that time, I put only one river point source. I was thinking only one river point is not able to run off such a large amount of discharge. Hence, I tried to devide the discharge by three and put them in each grid point as a point source. Yet I still get the high temperature and it blow up when it is above 50 degree celcius on both cases.
I also tried Q_psource with ana_psource instead of using UV_psource with ana_psource. It looked fine at first but eventually the problem arose again. At this time, I got low temperature around -2 degree celcius instead of high temerature. By the way, the model didn't blow up until the end of set up time. The value of salinity in all cases were fine and they were reasonable. I don't know why I'm getting high/low temperature in my model.
Would you help me out please? I attach the pictures of my result.
Thanks in advance.
Regards,
-Peter
Last edited by susonic on Tue Nov 17, 2009 7:27 am, edited 1 time in total.
Re: Point source definitions
i could not see the tif files. Use png files instead - they are smaller file size and can be just as clear.
what advection scheme are you using? did you try mpdata?
what advection scheme are you using? did you try mpdata?
Re: Point source definitions
Hi warner,
Thank you for your reply. I'm using default uv_advection scheme and u3h c4v for TS.
I attached again with png format.(sorrry and thanks)
I'm going to use the mpdata and will report the result here.
FYI, it has wrong spell in mpdata_diff.F on 19th line.
Regards,
Thank you for your reply. I'm using default uv_advection scheme and u3h c4v for TS.
I attached again with png format.(sorrry and thanks)
I'm going to use the mpdata and will report the result here.
FYI, it has wrong spell in mpdata_diff.F on 19th line.
Regards,
Re: Point source definitions
what did you mean by
"FYI, it has wrong spell in mpdata_diff.F on 19th line."
What is the text on that line, and what is wrong?
thanks
"FYI, it has wrong spell in mpdata_diff.F on 19th line."
What is the text on that line, and what is wrong?
thanks
Re: Point source definitions
Well, it's not a big deal. I underlined the character in figure(see below).jcwarner wrote: What is the text on that line, and what is wrong?
Even though I'm using a mpdata, I'm still getting weird value.
This time, it has both hot water and cold water at the same time.
Actually, I had run my model several time without using mpdata and sometimes I get
good result(reasonable result) but other times I got some weird value such as hot water
or cold water. I also attach my ana_psource file. The discharge varies 10000 upto
60000 ton/sec. What seems to be wrong? Please help me out.
Regards,
- Attachments
-
- ana_psource.h
- (15.51 KiB) Downloaded 431 times
-
- spell.png (10.09 KiB) Viewed 17576 times
Last edited by susonic on Wed Sep 30, 2009 5:37 pm, edited 1 time in total.
Re: Point source definitions
1) where are these points on the grid and which way is 'xi'?
Are they flowing in the correct direction?
#elif defined ECSY10
Nsrc=3
Dsrc(1)=0.0_r8
Isrc(1)=61
Jsrc(1)=84
Lsrc(1,itemp)=.FALSE.
Lsrc(1,isalt)=.TRUE.
Dsrc(2)=0.0_r8
Isrc(2)=62
Jsrc(2)=82
Lsrc(2,itemp)=.FALSE.
Lsrc(2,isalt)=.TRUE.
Dsrc(3)=0.0_r8
Isrc(3)=63
Jsrc(3)=77
Lsrc(3,itemp)=.FALSE.
Lsrc(3,isalt)=.TRUE.
2)Did you try to make the Lsrc(*,itemp) to be .true.?
3) Does this flow go negative or is it always positive?
# elif defined ECSY10
fac=1.0_r8
Nsrc=3
omega=2.0_r8*pi/365.0_r8
amp=30000.0_r8
NsrcEach=1.0_r8/3.0_r8
DO is=1,Nsrc
Qbar(is)=(fac*((amp*(-sin(omega*(tdays(ng)+78.0_r8)))) &
& +32000.0_r8))*NsrcEach
END DO
4) maybe try without all the bulk flux stuff on. See if it just works ok with only rivers.
(*** i am just thinking of any quick issues that i see***)
Are they flowing in the correct direction?
#elif defined ECSY10
Nsrc=3
Dsrc(1)=0.0_r8
Isrc(1)=61
Jsrc(1)=84
Lsrc(1,itemp)=.FALSE.
Lsrc(1,isalt)=.TRUE.
Dsrc(2)=0.0_r8
Isrc(2)=62
Jsrc(2)=82
Lsrc(2,itemp)=.FALSE.
Lsrc(2,isalt)=.TRUE.
Dsrc(3)=0.0_r8
Isrc(3)=63
Jsrc(3)=77
Lsrc(3,itemp)=.FALSE.
Lsrc(3,isalt)=.TRUE.
2)Did you try to make the Lsrc(*,itemp) to be .true.?
3) Does this flow go negative or is it always positive?
# elif defined ECSY10
fac=1.0_r8
Nsrc=3
omega=2.0_r8*pi/365.0_r8
amp=30000.0_r8
NsrcEach=1.0_r8/3.0_r8
DO is=1,Nsrc
Qbar(is)=(fac*((amp*(-sin(omega*(tdays(ng)+78.0_r8)))) &
& +32000.0_r8))*NsrcEach
END DO
4) maybe try without all the bulk flux stuff on. See if it just works ok with only rivers.
(*** i am just thinking of any quick issues that i see***)
Re: Point source definitions
My domain is rotated so the xi direction would be rotated anticlockwise 40 degree from its original direction.jcwarner wrote: where are these points on the grid and which way is 'xi'?
And also if you see the above figure, named river_point, you can see the three blue points.
Those are river flux points.
No, not yet. I don't want to give the temperature value because I don't have the value of temperature.jcwarner wrote:Did you try to make the Lsrc(*,itemp) to be .true.?
Not always. Sometimes without any problem but othertimes it goes below zero/extremly high temperature.jcwarner wrote:Does this flow go negative or is it always positive?
I also tried to run it with undefined BULK_FLUXES but I got the same result.jcwarner wrote:maybe try without all the bulk flux stuff on. See if it just works ok with only rivers.
All I can tell you by
is its related with the wind direction. I could see when the wind is strong and the river is getting larger, the temperature is going down or up. Maybe I need to devide more river point sources?susonic wrote:sometimes I get
good result(reasonable result) but other times I got some weird value such as hot water
or cold water.
Thank you for your quick replies.
Best,
-Peter
Last edited by susonic on Wed Sep 30, 2009 5:40 pm, edited 1 time in total.
Re: Point source definitions
1) "My domain is rotated so the xi direction would be rotated anticlockwise 40 degree from its original direction.
And also if you see the above figure, named river_point, you can see the three blue points.
Those are river flux points."
I can not tell exactly where they are.
Load the grid in matlab and plot those locations.
Be careful, in that matlab indexing starts with 1, but roms indexing can be different.
2) try to run it with a const T at those locations, say 20 .
3) plot a time series of veolcity at those river points.
And also if you see the above figure, named river_point, you can see the three blue points.
Those are river flux points."
I can not tell exactly where they are.
Load the grid in matlab and plot those locations.
Be careful, in that matlab indexing starts with 1, but roms indexing can be different.
2) try to run it with a const T at those locations, say 20 .
3) plot a time series of veolcity at those river points.
Re: Point source definitions
You might try stations right around there so you can see a timeseries with fine temporal resolution, and also see the vertical structure.
Re: Point source definitions
Thank you Kate and Warner. I'm running the model again under temperature "TRUE" and staion with river point.
I'm also testing with same discharge but more river point source. We'll see what happens.
I'll report the result soon.
I took a few snapshot and attached. I just hope that this is what you want.
Regards,
-Peter
I'm also testing with same discharge but more river point source. We'll see what happens.
I'll report the result soon.
I took a few snapshot and attached. I just hope that this is what you want.
Regards,
-Peter
Re: Point source definitions
It took a while for me to fix the high/low temperature with point source erorr.
Now, I think I don't get the weird value anymore. The solution is turn on both the
temperature and salinity flag. I had been doing all the experiments with only salinity value defined
because I didn't know the temperature of my river source.
However, as pointed out by Warner,when I gave the temperature in my river forcing file together with salinity, there was no more high/low temperature in my result! I tested with higher resolution with same domain and it worked without any problem. I also tested it with tide, without tide and tide only cases, and it worked well with all the cases.
In the end, since I don't know the river temperature, I gave the nearest SST value(whole year) to my river temperature ignoring its vertical structure. Although it's not the best solution, the result is resonable.
As, I mentioned above, I didn't always get the high/low temperature with my river even if I didn't turn on temperature(the salinity was resonable). So, I thought the problem might be related with my rotated frame. But when I tried it with unrotated frame, I was still getting high/low temperature in my result when the discharge is getting larger.
Well, I don't think many of you guys had experienced this problem, because my river discharge is kind of unusually high varying 10,000 to 60,000 ton/sec winter and summer, respectively.
Thank you Warner and Kate for your advices. I really appreciate it.
Now, I think I don't get the weird value anymore. The solution is turn on both the
temperature and salinity flag. I had been doing all the experiments with only salinity value defined
because I didn't know the temperature of my river source.
However, as pointed out by Warner,when I gave the temperature in my river forcing file together with salinity, there was no more high/low temperature in my result! I tested with higher resolution with same domain and it worked without any problem. I also tested it with tide, without tide and tide only cases, and it worked well with all the cases.
In the end, since I don't know the river temperature, I gave the nearest SST value(whole year) to my river temperature ignoring its vertical structure. Although it's not the best solution, the result is resonable.
As, I mentioned above, I didn't always get the high/low temperature with my river even if I didn't turn on temperature(the salinity was resonable). So, I thought the problem might be related with my rotated frame. But when I tried it with unrotated frame, I was still getting high/low temperature in my result when the discharge is getting larger.
Well, I don't think many of you guys had experienced this problem, because my river discharge is kind of unusually high varying 10,000 to 60,000 ton/sec winter and summer, respectively.
Thank you Warner and Kate for your advices. I really appreciate it.