Transfer function in Configuration file (.fig)

519 views
Skip to first unread message

Mohammed Mizanur Rahman

unread,
Mar 12, 2013, 1:05:06 PM3/12/13
to arc...@googlegroups.com
Dear SWAT Users
Greetings.

I am working on a large basin (70,000 km2) which upper portion (60%) is hilly and lower 40% is very flat land. In lower flat basin, there are numerous rivers including Distributaries and Tributaries. Usually, SWAT doesn't model distributaries, for example, if a river bifurcates into two rivers flowing downstream (common picture in flat basin) then it is a question how the upper river's flow will be distributed between two downstream rivers (distributary). Though present River Hydraulics uses different formulas, SWAT doesn't deal with it. However, using SWAT TRANSFER function can be an alternative where my problem is, indeed.

I tried to use TRANSFER function in Configuration (.fig) file but SWAT shows error message. According to I/O document, we need to use the number of source and destination Rivers/Reservoirs NOT Hydrologic Storage number. My specific questions are

(i)  where should exactly the TRANSFER command should be written in .fig file?
(ii) With using River number but Hydrograph storage number, how SWAT will balance the water between two rivers; for example, if a river has 1000 m3/s flow, which is contribution of all upstream rivers' loads and this load is stored in Hydrograph storage number, in that case how the model will know the real location (Hydrograph storage number) of loads (1000 m3/s) if we use River number?


I am expecting some feedbacks.

 
Thanks.

M. M. Rahman

Mohammed Mizanur Rahman

unread,
Mar 13, 2013, 12:23:31 PM3/13/13
to arc...@googlegroups.com
Dear SWAT users

I haven't yet received any feedback from my raised question.

If you could, please let me know.


Thanks.

M. M. Rahman

Willem Vervoort

unread,
Mar 15, 2013, 9:40:06 AM3/15/13
to Mohammed Mizanur Rahman, ArcSWAT
Hi,
Answers on messages on this message board depends on 3 things:
1) whether people have time to answer
2) whether people actually understand your question
3) whether people have an answer to your question

If you have not received an answer, then one of the above is not fulfilled. It does not help to ask again.
Maybe you can answer some of the other open questions? Or maybe you can search the archives if someone has asked a similar question before?

I am sorry, but I don't have an answer to your question.
Willem


--
You received this message because you are subscribed to the Google Groups "ArcSWAT" group.
To unsubscribe from this group and stop receiving emails from it, send an email to arcswat+u...@googlegroups.com.
To post to this group, send email to arc...@googlegroups.com.
Visit this group at http://groups.google.com/group/arcswat?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
http://blogs.usyd.edu.au/waterhydrosu/

Mikhail Titov

unread,
Mar 26, 2013, 7:38:58 PM3/26/13
to arc...@googlegroups.com, Mohammed Mizanur Rahman
On Friday, March 15, 2013 8:40:06 AM UTC-5, Willem wrote:
Hi,
Answers on messages on this message board depends on 3 things:
1) whether people have time to answer
2) whether people actually understand your question
3) whether people have an answer to your question

If you have not received an answer, then one of the above is not fulfilled. It does not help to ask again.

I'd add that it might help if extra information was given with the hope that it was the case 2). Simple bumping never helps.

My reply is below. 

On Thu, Mar 14, 2013 at 3:23 AM, Mohammed Mizanur Rahman <miza...@gmail.com> wrote:
Dear SWAT users

I haven't yet received any feedback from my raised question.

If you could, please let me know.


Thanks.

M. M. Rahman


---------- Forwarded message ----------
From: Mohammed Mizanur Rahman <miza...@gmail.com>
Date: Tue, Mar 12, 2013 at 5:05 PM
Subject: Transfer function in Configuration file (.fig)
To: arc...@googlegroups.com


Dear SWAT Users
Greetings.

I am working on a large basin (70,000 km2) which upper portion (60%) is hilly and lower 40% is very flat land. In lower flat basin, there are numerous rivers including Distributaries and Tributaries. Usually, SWAT doesn't model distributaries, for example, if a river bifurcates into two rivers flowing downstream (common picture in flat basin) then it is a question how the upper river's flow will be distributed between two downstream rivers (distributary). Though present River Hydraulics uses different formulas, SWAT doesn't deal with it. However, using SWAT TRANSFER function can be an alternative where my problem is, indeed.

I tried to use TRANSFER function in Configuration (.fig) file but SWAT shows error message. According to I/O document, we need to use the number of source and destination Rivers/Reservoirs NOT Hydrologic Storage number. My specific questions are

(i)  where should exactly the TRANSFER command should be written in .fig file?

All the commands in configuration file are executed sequentially. Since TRANSFER command is a precursor for irrigation operation according to docs, I'd place it right after ROUTE command in a similar fashion to irrigation as call irr_rch resides at the end of route.f.

However there might be the case when water was extracted on one day and placed on another, depending on a connectivity tree in fig.fig. That will be the case if destination point has already been routed. That said, the presence of TRANSFER command should affect the order of generated commands in fig.fig such that destination is routed after water was transferred. I don't know if you can achieve that with ArcSWAT. Your extra water @destination might be lagging 1 step. It is all kind of tricky as there might be loops in the graph if you transfer water upstream. However it would probably make sense to route water same day if there are no cycles like in case of distributaries. I guess it is an area for possible improvements as how to generate fig.fig.
 
(ii) With using River number but Hydrograph storage number, how SWAT will balance the water between two rivers; for example, if a river has 1000 m3/s flow, which is contribution of all upstream rivers' loads and this load is stored in Hydrograph storage number, in that case how the model will know the real location (Hydrograph storage number) of loads (1000 m3/s) if we use River number?

I might be wrong but it looks like that SWAT I/O manual is lagging behind the actual code base. According to the source code, it should be a two lines command that should provide hydrograph storage and months for beginning & end the transfer is active. So as of now I can only suggest to look at the source code. The following table (I hope it won't break) might be helpful

| transfer | 4      | DEP_TYPE & DEST_TYPE | DEP_NUM      |        | DEST_NUM      | TRANS_AMT | TRANS_CODE |        |                   |                   |                  |
| cmd      | code   |
ch/res ?             | src ch/res # |        | dest ch/res # | amount    |            | seq. # | month active begn | month end         | src hydr storage |
| a        | icodes | ihouts               | inum1s       | inum2s | inum3s        | rnum1s    | inum4s     | inum5s | mo_transb(inum5s) | mo_transe(inum5s) | ih_tran(inum5s)  |

Each column represents a variable one way or another related to fig.fig & transfer function. First row corresponds to the naming in SWAT 2009 I/O doc, the 3rd line has variable names from the source code, and the middle one has a description as I understood it. I may made a mistake somewhere so double check it. Look at readfig.f for a proper formatting of TRANSFER command, namely formats 5000 and 5004.

route          2   XXX    44   YYY
          000XXX000.rte000XXX000.swq
transfer       4     1    10     0    20 1000.        3  1
             1  12  44

If I did not make a typo and provided I interpreted the code correctly, the above statement when placed right after water was routed from hydrograph storage 44 should transfer 1000. m^3 of water from reach 10 (with hydrograph storage number 44) to reach 20 between January and December (year round). Though perhaps you'd want to split using some percentage rather than using absolute values.

As to answer your question as how model knows what to move and where, take a look at route.f. There is a variable named rtwtr (initialized in rtday.f) that contains amount of water being routed. Then at some point irrigation kicks in that adjusts rchstor & rtwtr for example, and finally rtwtr is stored in hydrograph storage array varoute(2,:) in rtout.f .

I hope this helps.

M.

Mikhail Titov

unread,
Mar 29, 2013, 10:53:41 AM3/29/13
to Mohammed Mizanur Rahman, arc...@googlegroups.com
On Thu, Mar 28, 2013 at 8:09 PM, Mohammed Mizanur Rahman <miza...@gmail.com> wrote:
> Dear Mikhail Titov
>
> Thank you so much for your time. The code is working well. 
>
> Thanks once again.

Mohammed:

I'm glad that posted solution worked well. Thank you for following up on
that. However, please, keep conversation within the group and do not
reply in private so others know as well that it worked.

On the second thought though, TRANSFER will move water only leaving
sediment, nutrients, etc going only one branch. Perhaps it would be
better to implement SPLIT command for partitioning between
distributaries if those are critical in your work. Though it would
probably require customized fig.fig generator.

Another thing with TRANSFER command is that, depending on your settings,
you might want to remove ROUTE for a headwater sub-basin if such is
chosen as a TRANSFER destination and you opted in for a headwater
routing as it won't be headwater anymore. I'm talking about command like

ROUTE 2 ZZZ 20 20

given former example.

--
Mikhail

Mohammed Mizanur Rahman

unread,
Mar 30, 2013, 6:56:31 AM3/30/13
to Mikhail Titov, arc...@googlegroups.com
Hi Mikhail
Thanks for information. Yes, I do agree with your SPLIT command concept. I have tested TRANSFER command by placing in different locations of fig.fig file and found that this command can transfer water from one reach to another, even though from a downstream reach to upstream reach.

Thanks.

Mohammed 

Mikhail Titov

unread,
Mar 30, 2013, 5:07:31 PM3/30/13
to Mohammed Mizanur Rahman, arc...@googlegroups.com
On Sat, Mar 30, 2013 at 5:56 AM, Mohammed Mizanur Rahman <miza...@gmail.com> wrote:
> Thanks for information. Yes, I do agree with your SPLIT command
> concept.

Mohammed:

I guess the only reason this command is not there is that distributaries
are far from being common in agricultural watersheds.

> I have tested TRANSFER command by placing in different locations of
> fig.fig file and found that this command can transfer water from one
> reach to another, even though from a downstream reach to upstream
> reach.

I did not say it was impossible. I said you might expect 1 day delay in
streamflow depending on your network. That would be the case if
destination has already been ROUTEd in fig.fig somewhere above before
your TRANSFER. It might be okay if you calibrate your model on monthly
or even annual basis however it might be an issue with daily streamflow
calibration.

--
Mikhail

Guilherme Samprogna Mohor

unread,
Jan 28, 2015, 12:33:06 PM1/28/15
to arc...@googlegroups.com, miza...@gmail.com
Hello, dear Mikhail.
I found no new topic about the transfer command and you've made such an explanation, I believe you could help me.

I'm running the SWAT  Rev.635, quite new, and the transfer command ends in an error. I've read the I/O documentation, the source code and your comments here, and something seems wrong.

In the version I'm using, after taking the amount off the source reservoir (in my case is a reservoir), it follows:

        !! TRANSFER WATER TO DESTINATION
!        select case (inum2)
!          case (1)          !! TRANSFER WATER TO A CHANNEL
!            rchstor(inum3) = rchstor(inum3) + tranmx
!
!          case (2)          !! TRANSFER WATER TO A RESERVOIR
!            res_vol(inum3) = res_vol(inum3) + tranmx
!        end select


As it is, those lines are commented!
Later on, the transfer.f ends with

!!subratct from source
        do ii = 3, mvaro
          varoute(ii,nhyd_tr) = varoute(ii,nhyd_tr) * ratio
        end do
        !!save vartran to add in rchinit and resinit
        vartran(2,inum3) = varoute(2,nhyd_tr) / ratio * ratio1
        do ii = 3, mvaro
          vartran(ii,inum3) = varoute(ii,nhyd_tr) * ratio1
        end do

However, it gets an error in there, apparently because the "nhyd_tr" is read only in the case of a reach as a source, not a reservoir.

How is the code in the version you used at the time?

Thank you.

Aiswarya B Babu

unread,
Sep 18, 2023, 2:36:43 PM9/18/23
to ArcSWAT
Hi,

How to find the sequential transfer command number and hydrograph storage number.

Reply all
Reply to author
Forward
0 new messages