Skip to content

Commit

Permalink
Reveert init of msource to 0 for tracers other than T,S, c/o Nicole Cai.
Browse files Browse the repository at this point in the history
Using ambient values for other tracers can lead to slow accumulation of
nutrients e.g.
  • Loading branch information
josephzhang8 committed Aug 27, 2020
1 parent de0cfcb commit f311026
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/Hydro/schism_step.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1304,9 +1304,21 @@ subroutine schism_step(it)
enddo !i

! Read in volume/mass sources/sinks
! Notes on msource: while vsource may be updated after this loop (e.g. precip), msource
! is not updated. So msource will take the value from msource.th if an elem
! is in source_sink.in; if not, the init values given below are used, and different tracers
! may require different init. T,S: -9999 (junk) so ambient values will be
! used to avoid 'ice rain' (if randrop falls on a source_sink.in elem, vsource will be combined and
! values in msource.th will be used. If outside, ambient values are used and
! note that evap/precip is handled separately for S outside source method).
! Other tracers: 0 (otherwise additional nutrients from rain will fall onto
! water)
vsource=0 !init; dimension [m^3/s]; includes sinks as well
if(if_source==1) then
msource=-9999.d0 !init as flags; dimension same as concentration (psu etc)
!init all first; dimension same as concentration (psu etc)
msource=0.d0
!Exceptions
msource(1:2,:)=-9999.d0 !junk so ambient values will be used
if(nsources>0) then
if(time>th_time3(2,1)) then !not '>=' to avoid last step
ath3(:,1,1,1)=ath3(:,1,2,1)
Expand Down Expand Up @@ -1398,9 +1410,6 @@ subroutine schism_step(it)
vsource(i)=vsource(i)+(precip-evap)/rho0*area(i) !m^3/s
enddo !i
endif !impose_net_flux

!msource not updated: if a value (valid or junk) is read in from .th, use same
!value; if not, msource=-9999 (init)
endif !isconsv/=0

! Calculation of cross-section areas and length for flow b.c.
Expand Down

8 comments on commit f311026

@huyquangtranaus
Copy link
Contributor

@huyquangtranaus huyquangtranaus commented on f311026 Sep 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Joseph, @josephzhang8 do you know which unit we used for generic tracer concentration in msource.th. I guess it is mg/L. Thanks

@josephzhang8
Copy link
Member Author

@josephzhang8 josephzhang8 commented on f311026 Sep 23, 2021 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@huyquangtranaus
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @josephzhang8, I understand I can put any values msource.th for generic tracer. In the example I put 1.00 for concentration in msource.th, but I can even put 100.000 or whatever.
0 -9999.0000 0.0000 1.0000
86400 -9999.0000 0.0000 1.0000
172800 -9999.0000 0.0000 1.0000 `

My question is that: does 1.000 here have a unit?

My apologies if I still misunderstand something here :)

@nicolecx122
Copy link
Member

@nicolecx122 nicolecx122 commented on f311026 Sep 23, 2021 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@josephzhang8
Copy link
Member Author

@josephzhang8 josephzhang8 commented on f311026 Sep 23, 2021 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@huyquangtranaus
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool. Thanks @nicolecx122 and @josephzhang8 ... so does it mean the output variable: iof_gen(1) = 0 !1st tracer {GEN_1} does not have a unit too? and the iof_gen(1) or GEN_1 here is the dilution?

@nicolecx122
Copy link
Member

@nicolecx122 nicolecx122 commented on f311026 Sep 23, 2021 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@huyquangtranaus
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome & Thanks. Sorry I am a beginner for concentration/dilution stuff :)

Please sign in to comment.