Error in SUFI2_goal_fn.exe? -> NS=-1.#INF00

311 views
Skip to first unread message

pj...@stanford.edu

unread,
Feb 17, 2015, 8:10:01 PM2/17/15
to swat...@googlegroups.com
Hello All,

I am setting up a SWAT model for calibration in SWAT-CUP and am getting an error of a type I have never seen before, so am hoping I can get some help. 

I built the SWAT model in ArcSWAT and it seems to run fine there. In addition, the model runs in SWAT-CUP and the extraction seems to work fine. FLOW_OUT_12.txt (the model outputs for calibration) in the SUFI2.OUT folder looks fine, so I think that the extraction is working correctly. My observed.txt and observed_rch.txt files look correct to me, but a couple questions on that later (I have checked, and it doesn't look like there are any non-numeric or negative values, so I don't think that should cause the observed error). 

When I run SUFI2_post.bat I start to have problems. While running SUFI2_goal_fn.exe it tells me that it cannot find beh_*.*, which should be the behavioral solutions.  I know that this is not necessarily an error (maybe there are just no runs with a behavioral solution). Then it lists all of the samples with an NS= -1.#INF00, which I am taking to mean that there is an error in calculating the objective function. This shows up in echo_goal_fn, where the obs_avg_low and sim_avg_lower are always 0, obs_avg_higher and sim_avg_higher always > 0, obs_variance_lower and sim_variance_lower always -0, and obs_variance_higher and sim_variance_higher always -1.#IND00, and thus the NS and goal are always -1.#INF00. A couple of questions on that: are the NSEs actually calculated in SUFI2_goal_fn.exe? Are the beh_*.* files created in SUFI2_goal_fn.exe?

There is also something strange going on with SUFI2.OUT/best_sim.txt, which has only one line (after what look like the right headers), and has the second day of my observed discharge under observed and 0.0000 under simulated. I'm not sure whether best_sim is having a problem reading either my observed or FLOW_OUT_12.txt for some reason, but that could be part of why I am getting the errors in SUFI2_goal_fn. 

As mentioned, I think that the observed files look correct, but I want to ask a few questions. First, I am using daily data and missing 3 consecutive days during my time series. To do this I simply skipped those three days in the observed.txt and observed_rch.txt (e.g., 1103->1104->1108->1109). I also changed the number of data points from 1827 (the 5 years over which I'm calibrating) to 1824 (missing three days). Is that the correct procedure? Second, in the newest version of SWAT-CUP there is a file created in SUFI2.IN called observed+.txt. I haven't seen that before, so didn't change it--do I need to adjust that in any way? Third, there are a few days of 0 flow in the FLOW_OUT_12.txt (there shouldn't be, but that's a problem where the calibration isn't quite there yet); would that cause this problem? I can't quite see why it would, but figured I should ask. 

Thank you very much for your help. I can attach any appropriate files as necessary--I'm just not certain which ones would be useful. 

Best,
James

Abbaspour, Karim

unread,
Feb 18, 2015, 4:28:06 AM2/18/15
to swat...@googlegroups.com

You probably have an error in your input files. Check the files in Echo for some clues.

Observed+ is just an example file I provide to show the format of a case where you want to consider base flow separation.

If you can’t file the problem send the input files in SUFI2.IN as well as file.cio and extract.bat files to have a look.

Best, Karim

--
You received this message because you are subscribed to the Google Groups "SWAT-CUP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swat-cup+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

pj...@stanford.edu

unread,
Feb 19, 2015, 5:07:04 PM2/19/15
to swat...@googlegroups.com
Hi Karim,

I've looked these over and haven't been able to find an error, but there probably is one. I've looked through the Echo files and the only place I see an error is in the echo_goal_fn, as described aboveI'd appreciate you taking a look and letting me know where I made a mistake. See the attached. 

I'm not quite certain what you mean by the extract.bat files, but I'm assuming you mean the extrach_rch file I've set up (if you mean something else, let me know). 

Thank you very much for your help.

Best,
James
observed+.txt
str.txt
trk.txt
var_file_hru.txt
var_file_hru_No_obs.txt
var_file_name.txt
var_file_rch.txt
var_file_rch_No_obs.txt
var_file_res.txt
var_file_sub.txt
var_file_sub_No_obs.txt
observed.txt
file.cio
SUFI2_extract_rch.def
observed_hru.txt
observed_mgt.txt
observed_rch.txt
observed_res.txt
observed_sub.txt
par_inf.txt
par_val.txt

Abbaspour, Karim

unread,
Feb 19, 2015, 5:12:25 PM2/19/15
to <swat-cup@googlegroups.com>
Seems like you deleted the comments in observed.txt and other files? Why? 
Keep the format as it is, just edit the numbers...


<observed+.txt>
<observed.txt>
<observed_hru.txt>
<observed_mgt.txt>
<observed_rch.txt>
<observed_res.txt>
<observed_sub.txt>
<par_inf.txt>
<par_val.txt>
<str.txt>
<trk.txt>
<var_file_hru.txt>
<var_file_hru_No_obs.txt>
<var_file_name.txt>
<var_file_rch.txt>
<var_file_rch_No_obs.txt>
<var_file_res.txt>
<var_file_sub.txt>
<var_file_sub_No_obs.txt>
<file.cio>
<SUFI2_extract_rch.def>

pj...@stanford.edu

unread,
Feb 20, 2015, 10:23:46 AM2/20/15
to swat...@googlegroups.com
Hi Karim,

I built a script to write the observed and some of the other output files since I am doing this with a number of models--it makes it easier not to have to manually build the time series each time. I didn't include the comments because that did not seem necessary.  This script has worked fine on other sites so I don't think that the problem is in that, though if you see something that is wrong please let me know. Do you see any errors in the input files?

Best,
James

Abbaspour, Karim

unread,
Feb 20, 2015, 12:09:48 PM2/20/15
to swat...@googlegroups.com

Are you using an older version of the program?

Because since a long time now I  added a line to observed.txt file

 

FLOW_OUT_1   : this is the name of the variable and the subbasin number to be included in the objective function

1     : weight of the variable in the objective function

-1    : Dynamic flow separation. Not considered if -1. If 1, then values should be added in the forth column below after observations     .-------------                    This line is new.

-1    : constant flow separation, threshold value. (not considered if -1)              

1     : if separation of signal is considered, this is weight of the smaller values in the objective function

1     : if separation of signal is considered, this is weight of the larger values in the objective function

10    : percentage of measurement error

131   : number of data points for this variable as it follows below. First column is a sequential number from beginning

      : of the simulation, second column is variable name and date (format arbitrary), third column is variable value.

 

 

If you are opening an old project with new program, then you will have a problem..

Best, Karim

 

-------------------------------------------------
Dr. K.C. Abbaspour
Eawag, Swiss Federal Institute for Aquatic Science and Technology
Ueberlandstr. 133, P.O. Box 611, 8600 Duebendorf, Switzerland
email: abba...@eawag.ch
phone: +41 58 856 5359
fax: +41 58 856 5375
http://www.eawag.ch/index_EN

pj...@stanford.edu

unread,
Feb 20, 2015, 12:38:07 PM2/20/15
to swat...@googlegroups.com
Hi Karim,

That might well be it. I'll give it a try. I will let you know once I have a chance to try it.

I did just upgrade, so maybe I had a slightly old version and now with the new version my script is out of date.

Thank you very much for your help. 

Best,
James

pj...@stanford.edu

unread,
Feb 20, 2015, 12:52:24 PM2/20/15
to swat...@googlegroups.com
Hi Karim,

That fixed it. Thanks for all your help. My apologies for taking your time--I had not realized that the format of observed.txt had changed. Please let me know if I can do anything to help you.

Best,
James 

Abbaspour, Karim

unread,
Feb 20, 2015, 12:54:17 PM2/20/15
to swat...@googlegroups.com

Glad it worked….

Reply all
Reply to author
Forward
0 new messages