null

Message Boards

Initial condition for nontransportable substance in bottom water layer?

MA
Matthew Adams, modified 2 Years ago.

Initial condition for nontransportable substance in bottom water layer?

Youngling Posts: 19 Join Date: 8/20/15 Recent Posts
Hi there,

My understanding is that substances following the S1/S2 approach are nontransportable and confined to the bottom-most water layer (and zero everywhere else).

To recreate this in PLCT, I am wondering how to set the initial condition of similar, nontransportable substances confined to the bottom water layer, so that it is zero everywhere except for the bottom water layer? So far, I've been using the dhkmrk function to make the substance (below called SG_V0) perish very quickly in all cells that don't have a water bottom, which works but is not ideal:

call dhkmrk ( 2, iknmrk(iseg), ibottom)
if ( ( ibottom .eq. 0 ) .or. (ibottom .eq. 3) ) then
! Apply code only to elements that have a "water bottom".
!
SG_V4FLUX = ??? whatever the typical code should be ???
else
SG_V4FLUX = -SG_beta*SG_V0/Depth
! Make SG_V0 perish quickly in elements that don't have a "water bottom".

endif

where SG_beta is a large number. Is there a more elegant way of doing this (e.g. with an spatially-dependent initial condition) that is closer to the pure S1/S2 approach used in DWQ?

Many thanks!
Matthew
Michel Jeuken, modified 2 Years ago.

RE: Initial condition for nontransportable substance in bottom water layer?

Jedi Knight Posts: 156 Join Date: 1/21/13 Recent Posts
Hi Matthew,

There are multiple options. When you uses the user inteface, you could work with a restart file that has the S1S2 only in the bottom segments, but when you start to edit the inp file there are other options as well. Look into section 8 of the D-Water Quality Input File manual to see how to do it.

In 8.2 there is the following example for section 8 (note that 23 is the number of substances from that model, but you only see the first 6 in the list. You'll need to adapt this to your own situation):

TRANSPOSE
1 ; Input without defaults
23*1.0 ; Scale values
23764*1.00 ; Continuity
23764*24.0 ; Salinity
23764*5.00 ; im1
23764*0.00 ; im2
23764*6.50 ; Oxy
23764*0.15 ; NH4
etc...


If you would want im1 only in the lowest of the presumably 4 layers here (5941 segments per layer), that could be changed to:

TRANSPOSE
1 ; Input without defaults
23*1.0 ; Scale values
23764*1.00 ; Continuity
23764*24.0 ; Salinity
17823*0.0 5941*5.00 ; im1
23764*0.00 ; im2
23764*6.50 ; Oxy
23764*0.15 ; NH4
etc...


Then the first there layers will have an initial im1 concentration of 0.0, en the lowest 5.0.

Michel
MA
Matthew Adams, modified 2 Years ago.

RE: Initial condition for nontransportable substance in bottom water layer?

Youngling Posts: 19 Join Date: 8/20/15 Recent Posts
Hi Michel,

Thanks - I think this is very close to what I need, but I am having some trouble with the TRANSPOSE function.

If I input your suggested code with the TRANSPOSE line commented out:

; eighth block of model input (initial conditions)
MASS/M2 ; unit for inactive substances
1 ; initial conditions follow
; TRANSPOSE
1 ; input values without defaults
4*1.0 ; scale factors
1115*0.020 ; NH4
1115*9.0 ; NO3
1115*1.0 ; PO4
892*1.0 223*0.0 ; Green
;
;
#8 ; delimiter for the eighth block

then the preprocessor and WAQ simulation (Waq (1) and Waq (2)) complete successfully, but the initial conditions aren't correct because I have commented out the TRANSPOSE line. The corresponding log in the LST file looks like:

Initials for passive substances are in mass/m2

Option selected for initials : 1
Information from the standard input file.
Second option for initials : 1
Constant values without defaults

Scale factors:
1 2 3 4
1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00
Unscaled values:
1 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02
2 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02
3 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02
4 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02
5 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02
6 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02
7 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02
8 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02
9 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02
10 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02
11 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02
12 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02
13 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02
14 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02

etc.




However, if I uncomment the TRANSPOSE line, the preprocessor fails with error code 1. Looking into the LST, it looks like this:

Initials for passive substances are in mass/m2

Option selected for initials : 1
Information from the standard input file.

Block of input data is ordered per substance
Second option for initials : 1
Constant values without defaults

Scale factors:
1
1.0000E+00
Unscaled values:
1 1.0000E+00 1.0000E+00 1.0000E+00 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02
2 2.0000E-02 2.0000E-02 2.0000E-02 9.0000E+00 9.0000E+00 9.0000E+00 9.0000E+00 9.0000E+00 9.0000E+00 9.0000E+00
3 9.0000E+00 9.0000E+00 9.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00
4 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00
Scale factors:


Unscaled values:
1 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02
2 9.0000E+00 9.0000E+00 9.0000E+00 9.0000E+00 9.0000E+00 9.0000E+00 9.0000E+00 9.0000E+00 9.0000E+00 9.0000E+00
3 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00
4 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00
Scale factors:

etc.

ERROR. Too many and/or invalid data in block 8 !! Check input file !!


Any idea what's causing this? It seems very close to working.

Thanks,
Matthew
Michel Jeuken, modified 2 Years ago.

RE: Initial condition for nontransportable substance in bottom water layer? (Answer)

Jedi Knight Posts: 156 Join Date: 1/21/13 Recent Posts
Hi Matthew,

I must admit I din't test this myself, just copied it from the user manual.

You were very close. I don't directly understand why, but apparently when using the transpose keyword, Delwaq only reads one scaling factor. The onter scaling factrs are seen as the first data values:

Scale factors:
1
1.0000E+00
Unscaled values:
1 1.0000E+00 1.0000E+00 1.0000E+00 2.0000E-02 2.0000E-02

So if you use

1*1.0 ; scale factors

It should work (it did for me now I tested it myself). It is something to look into because the model suggests otherwise.

Michel
MA
Matthew Adams, modified 2 Years ago.

RE: Initial condition for nontransportable substance in bottom water layer?

Youngling Posts: 19 Join Date: 8/20/15 Recent Posts
Hi Michel,

Many thanks for the speedy response - that worked for me!

Cheers
Matthew