SWAT Check Error

3,221 views
Skip to first unread message

James

unread,
Aug 17, 2012, 4:53:58 PM8/17/12
to SWAT-user
I am experiencing a problem with the SWAT Check program, and have not
been able to find any useful information on what might be causing it.
I am building a SWAT model of a site in Georgia, and have been getting
what seem to be reasonable results (a short calibration gave me an NS
value of ~0.6 for flow at the daily timescale). However, I am unable
to get the SWAT Check program to run to make sure everything looks
good. I have SWAT Check located at C:\SWAT\SWAT_Check\, and the SWAT
runs (done through ArcSWAT) are located in C:\SWAT_Project\Current\
Each time I try, I get the following error:


********** Starting Analysis *************
Finished reading File.CIO.
ERROR: Please contact technical support with the message listed below.
at System.String.InternalSubStringWithChecks(Int32 startIndex,
Int32 length, Boolean fAlwaysCopy)
at SWAT.OutputProcessor.OutputStd.Process()
at SWAT.Check.Library.Processor.ReadOutputStd()
at SWAT.Check.Application.SWATCheck.Run()

If anyone has suggestions on what my error is, I would greatly
appreciate it. Thank you for your time.

Regards,
James

James

unread,
Aug 17, 2012, 5:27:12 PM8/17/12
to SWAT-user
I realized I forgot to include some important information. I am
running ArcMap 10.0 (Build 2414) with ArcSWAT2009.10.1Beta3, and the
SWAT Check version from 8/14/2012. Thanks for your help.

Jaclyn

unread,
Aug 23, 2012, 11:12:33 AM8/23/12
to swat...@googlegroups.com
Hi James, are you able to attach your output.std file? I can then take a look at the SWAT Check code.

Thanks

James

unread,
Aug 27, 2012, 11:52:35 AM8/27/12
to SWAT-user
Hi Jaclyn,

Thanks for your response. I can't seem to attach anything in this
google group (maybe I'm missing something?), but will send a copy of
the output.std file to you. I'll also include the File.CIO, in case
you need that (it seems to suggest that is the first thing it's
reading and that is going okay, but I thought there might need to be a
match between File.CIO and output.std . . .) I greatly appreciate
your help.

Regards,
James

Jaclyn

unread,
Aug 27, 2012, 3:02:21 PM8/27/12
to swat...@googlegroups.com

Hi James, thanks for sending! 

I noticed in the output.std it mentions it is using SWAT rev. 481, so the SWAT_Check from 8/14 is not compatible. Try the SWAT_Check from this link and let me know how it goes:

http://swat.tamu.edu/media/58045/SWAT_Check2011-09-28.zip

I hadn’t even caught in your message that you were using ArcSWAT2009 beta and not 2012 beta. I’ll put a note about that on the SWAT Check download page for others!

Thanks,

Jaclyn

James

unread,
Aug 28, 2012, 11:13:11 AM8/28/12
to SWAT-user
Hi Jaclyn,

Thanks for taking a look. That does seem to fix the problem I was
having (output.std starts reading), but now during the reading of
output.std I get a Microsoft .NET error:

Conversion from string "" to type 'Single' is not valid.

This seems to be the same error that got brought up on the ArcSWAT
group yesterday. The details of the .NET message are below.

Thanks for all your help!

-James


See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.InvalidCastException: Conversion from string "" to type
'Single' is not valid. ---> System.FormatException: Input string was
not in a correct format.
at
Microsoft.VisualBasic.CompilerServices.Conversions.ParseDouble(String
Value, NumberFormatInfo NumberFormat)
at
Microsoft.VisualBasic.CompilerServices.Conversions.ToSingle(String
Value, NumberFormatInfo NumberFormat)
--- End of inner exception stack trace ---
at
Microsoft.VisualBasic.CompilerServices.Conversions.ToSingle(String
Value, NumberFormatInfo NumberFormat)
at
Microsoft.VisualBasic.CompilerServices.Conversions.ToSingle(String
Value)
at SWAT_Check.checking_code.read_Basin_Average_std()
at SWAT_Check.checking_code.checkit()
at SWAT_Check.mainform.ExamineModelOutput()
at SWAT_Check.mainform.Button1_Click_1(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at
System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.5456 (Win7SP1GDR.050727-5400)
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
SWAT_Check
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Swat/SWAT_Check/SWAT_Check.exe
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 8.0.0.0
Win32 Version: 8.0.50727.5420 (Win7SP1.050727-5400)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.5456 (Win7SP1GDR.050727-5400)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.5460 (Win7SP1GDR.050727-5400)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.5462 (Win7SP1GDR.050727-5400)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Runtime.Remoting
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

meysam kamali

unread,
Jul 21, 2014, 4:15:48 AM7/21/14
to swat...@googlegroups.com, pj...@stanford.edu
salam. I think that you have some problem with your informations. you have some information are unsatisfactory. please test additional information untile you can know your problems.

Putri Yasmin N.F

unread,
Jan 15, 2018, 4:46:52 AM1/15/18
to SWAT-user
Hi Jaclyn,

Could you please help me?
I run the ArcSWAT for indonesian region, but  I am unable  to get the SWAT Check program to run and I get the following error:

********** Starting Analysis *************
Finished reading File.CIO.
ERROR: Please contact technical support with the message listed below.
Type: System.Exception
Message: Error reading output.std average annual values at line 1638
Source: SWAT_Check
Location: SWAT.OutputProcessor.OutputStd, line 0, column 0
StackTrace: 
   at SWAT.OutputProcessor.OutputStd.Process()
   at SWAT.Check.Library.Processor.ReadOutputStd()
   at SWAT.Check.Application.SWATCheck.Run()


I attached the output.std as well.


Regards,
Yasmin
output.std

Joy Sanyal

unread,
Oct 11, 2018, 4:53:29 AM10/11/18
to SWAT-user
Hi, 

I am unable to run the SWAT Error Checker. I have downloaded the ArcSWAT for ArcGIS 10.4. I get the following error:
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
********** Starting Analysis *************
Reading output.std...
Finished reading output.std in 00h:00m:01.16s. Reading output.rch...Value "" is not an int.

If you cannot resolve the error, please contact technical support with the message listed below.
----------------------------------------------------------------------
Type: System.FormatException
Message: Value "" is not an int.
Source: SWAT.OutputProcessor
Location: SWAT.OutputProcessor.Schemas.SchemaLine, line 0, column 0
StackTrace: 
   at SWAT.OutputProcessor.Schemas.SchemaLine.GetInt(String line, Boolean returnZeroIfNotNumeric)
   at SWAT.OutputProcessor.Parsers.OutputRchParser.ReadFile()
   at SWAT.Check.Desktop.SWATCheck.backgroundWorker_DoWork(Object sender, DoWorkEventArgs e)
   at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)
   at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
The output.std file is also attached. Any help to figure out what's wrong with my model setup would be of great help.
output.std.txt

Willem Vervoort

unread,
Oct 11, 2018, 5:13:09 AM10/11/18
to Joy Sanyal, SWAT-user
Hi,
not sure, but Q = 0 in your output. Seems not right. Probably something wrong in your input data
Willem

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

Natalja C.

unread,
Oct 11, 2018, 7:27:04 AM10/11/18
to SWAT-user
I have wrote in a side post about one possible error:
The new SWAT version is producing one more space in the output.hru. What version of SWAT do you use?

Natalja

Joy Sanyal

unread,
Oct 11, 2018, 7:59:46 AM10/11/18
to Willem Vervoort, SWAT-user
Hi Willem,
I also noticed that the Q is 0  it but at the very end of the output.std file I attached you may find that it reports surface runoff figure. When I dig into the Access database for the output in text in/out folder I found that  my FLOWOUT is actually higher than the observed values for a particular reach for which I have gauged data. I am not sure why the output.std is showing 0 for individual years.

I am not very sure about the version of SWAT executable I am using. I just downloaded and installed the ArcSWAT for ArcGIS 10.4 . However, I have a ArcSWAT version for ArcGIS 10.2 on a different PC and for a very similar model setup the SWAT Error Checker works perfectly fine.


------------------------------------------------------------
Dr Joy Sanyal

JSPS Postdoctoral Fellow
Department of Civil & Environmental Engineering
Tokyo Institute of Technology
Tokyo, Japan




Joy Sanyal

unread,
Oct 11, 2018, 8:01:42 AM10/11/18
to Natalja C., SWAT-user
Hi Natalja,

I am not very sure about the version of SWAT executable I am using. I just downloaded and installed the ArcSWAT for ArcGIS 10.4 . However, I have a ArcSWAT version for ArcGIS 10.2 on a different PC and for a very similar model setup the SWAT Error Checker works perfectly fine.
------------------------------------------------------------
Dr Joy Sanyal

JSPS Postdoctoral Fellow
Department of Civil & Environmental Engineering
Tokyo Institute of Technology
Tokyo, Japan




Natalja C.

unread,
Oct 11, 2018, 8:05:45 AM10/11/18
to SWAT-user
Navigate to your SWAT model folder (TxtInOut) and find the output.rch file. Open it in any text editor and there you will see the version of SWAT. Also, it is displayed while running the model (on the black cmd screen).
Well, if it is anything beyond rev. 664 - then you can fix this bug easily.

Natalja

Joy Sanyal

unread,
Oct 11, 2018, 8:34:53 AM10/11/18
to Natalja C., SWAT-user
Hi Natalja,

Many thanks for your prompt reply. It is version rev. 670. How do I fix this bug?

Cheers,

Joy

Natalja C.

unread,
Oct 11, 2018, 8:44:10 AM10/11/18
to SWAT-user
Install any text editor which has the "column mode" functionality. I use Crimson editor;
After running the model, go to your output directory (TxtInOut);
Find the output.rch file and open it in this text editor;
Turn on the column mode (Alt+C in crimson editor);
Starting from line 10, put your cursor just after the word "REACH" and select all the way down, to the end of your document. Imagine as if you were selecting a column in Excel.
Then delete one space (pres Del). When in column mode it should delete one space for all of the file.
Save.
Now it works in Swat Check :)

I attach the Before and After screenshots.
Hope this helps. Good luck!

Natalja
Before.PNG
After.PNG

Bendik Hansen

unread,
Nov 18, 2019, 10:13:11 AM11/18/19
to SWAT-user
Hi Natalja,

Do you know if any better solution for this has come up yet? Text editors aren't a good option for me since I have 600 000 rows in my output.rch file. They just tend to crash.

Best regards,
Bendik

Natalja C.

unread,
Nov 19, 2019, 1:45:57 AM11/19/19
to SWAT-user
Hello,
There is already a new SWAT-Check for swat rev.670. Just use it, no need to change the output files. Download it from the official site.
Best,
Natalja

C/laahi Maxamed

unread,
May 13, 2020, 8:38:05 AM5/13/20
to SWAT-user
thank you i got the same problem it worked for me. you just need to download swat checker and  examine again
Reply all
Reply to author
Forward
0 new messages