Error running SWAT:"Index was outside the bounds of the array" & "File already open"

2,956 views
Skip to first unread message

Gloria Salmoral

unread,
Apr 24, 2011, 6:49:43 AM4/24/11
to ArcSWAT
Dear SWAT users,

When I want to setup SWAT run I firstly get the error "Index was
outside the bounds of the array" and next "File already open". This
error takes place writing the reservoir file during setup.

I would like to simulate a reservoir based on measured daily outflow,
so I have created the RESMONO table as txt format, following the
example included in the database of ArcSWAT.

I have changed the range of surface and volume values in SWAT2009
database, and did not work the setup for running. I have also tried
with values of surface and volume included within the original ranges
of SWAT2009.

Please could you give advice. I have tried several times to run the
program, but I am not able to find the problem

Thanks a lot,

Gloria Salmoral

Rosie Records, CA Cooperative Fish & Wildlife Research Unit

unread,
Apr 25, 2011, 12:46:30 PM4/25/11
to ArcSWAT
Hi Gloria,

This has happened to me a couple of times...In my case, I think that I
had opened the project geodatabase in Access while the project was
running a program in ArcMap, and it led SWAT to think that the
geodatabase was read only or couldn't be accessed. When I got this
error, Access produced an extra file (projectname.ldb), which when
things are working normally only exists in the project folder if the
project is open in ArcMap. In my case, the .ldb file was there when
the project was closed.

What I ended up doing was making a copy of the project, then in one of
the copies deleting the .ldb file. This worked several times, but the
problem kept coming up so I eventually loaded an earlier saved
simulation, which fixed the problem.

Is the problem coming up during the watershed delineation? If so,
sometimes "Index outside the bounds of the array" error seems to
happen if you minimize the ArcMap program during delineation and
aren't careful to click on the ArcMap in the task pane before clicking
on delineation dialog boxes--or similar things. I have better success
if I don't run any other programs during watershed delineation.

Hope this helps,

Rosie Records

Gloria Salmoral

unread,
Apr 26, 2011, 9:41:03 AM4/26/11
to ArcSWAT
Hi Rosie,

Thanks for your answer. I have checked but I do not have my
projectname.ldb open when I close ArcMap. So I suppose my problem is
something else. I can properly upload the RESMONO table, but I get the
error during simulation setup.

Since I have not found I solution, I decided to used the option of
target release. Then, I have realized that the reservoir simulation
results do not change when I make any change on the reservoir
properties. I changed surface, volume, type of measured flow, and
always get the same results!

May you know why is this happening??

Thanks,

Gloria

On 25 abr, 18:46, "Rosie Records, CA Cooperative Fish & Wildlife

Kyle

unread,
Apr 26, 2011, 9:58:04 AM4/26/11
to ArcSWAT
Gloria,
When you are making changes to your RES file, are you remembering to
"Rewrite SWAT Input Files" from the "Edit SWAT Input" dropdown menu?
That'd be the first check when you are not getting different results
after making changes.

Regards,
Kyle
> > > Gloria Salmoral- Hide quoted text -
>
> - Show quoted text -

Gloria Salmoral

unread,
Apr 27, 2011, 4:40:13 AM4/27/11
to ArcSWAT
Thank you Kyle, you were right about "rewrite swat input files".
However, I still can not used my monthly measured outflow file. I
still do have the errors detting the run:"Index was
outside the bounds of the array" and next "File already open". When I
run SWAT I also get the error:

forrtl: The process does not have access to the file because is being
used by another process.
forrtl: severe (30): open failure, unit 101, file C:\SWAT\BAJO_TURIA
\Proy_0427\S
cenarios\Default\TxtInOut\000180000.mon

Image PC Routine Line Source
swat2009.exe 00708DC9 Unknown Unknown Unknown
swat2009.exe 00708C27 Unknown Unknown Unknown
swat2009.exe 00707E04 Unknown Unknown Unknown
swat2009.exe 00708239 Unknown Unknown Unknown
swat2009.exe 006FF2C4 Unknown Unknown Unknown
swat2009.exe 00583EC5 READRES 299 readres.f
swat2009.exe 00559797 READFIG 190 readfig.f
swat2009.exe 004F6B50 MAIN 84 main.f
swat2009.exe 00743789 Unknown Unknown Unknown
swat2009.exe 00727D59 Unknown Unknown Unknown
kernel32.dll 7C817077 Unknown Unknown Unknown

I will wait if someone knows the problem or send a new thread in a few
days. Thanks again.

Regards,

Gloria

Mike

unread,
Sep 12, 2012, 7:40:23 PM9/12/12
to arc...@googlegroups.com
I'm also having this problem.  Did you ever figure it out?

~Mike

Gloria Salmoral

unread,
Sep 13, 2012, 2:57:02 AM9/13/12
to arc...@googlegroups.com
Hello Mike,

As fas as I know this error occurs because the RESDAYO or RESMONO file can not be written. You can check it in the TxtInOut folder. If you have RESDAYO option your file has the extension ".day", for RESMONO I don`t remember. Be sure that your RESDAYO/RESMONO file has the same number of observations as the climate files. Also when you edit the reservoir parameters that you save the RESDAYO/RESMONO file. After you will have to rewrite the reservoir file to save the changes made. And then run the model. I hope this helps.

Best regards,

Gloria

Maria

unread,
Sep 14, 2012, 6:49:31 AM9/14/12
to arc...@googlegroups.com
Hello Gloria,

Do you have administration rights on the file you work with Swat?

Maria

Kim Oanh Hoàng

unread,
May 7, 2015, 1:09:57 AM5/7/15
to arc...@googlegroups.com
Hi Glori Salmoral,

I'm running SWAT and getting problem with reservoirs too. As I understand, the problem comes from daily outflow input format. Can you send me your sample format file for that?
Thank in advance!

Kim Oanh

Sudish Maskey

unread,
Nov 14, 2015, 4:02:09 AM11/14/15
to ArcSWAT
Dear all,

I have a problem of "Index was outside the bounds of array.: In reading line 0"during i upload the tempfork file.
I have already checked for empty spaces and all.
Can anyone help me?



Sudish

Camila Guimaraes

unread,
Dec 1, 2015, 5:35:28 AM12/1/15
to ArcSWAT
Dear all, 
I'm facing the same problem when I try to simulate 2 months a head.
How do I simulate the future without this error??
I appreciate your help!!
Thanks!
erro.jpg
Error.jpg

ismail sani

unread,
Jun 5, 2016, 7:44:09 AM6/5/16
to ArcSWAT

please can you tell how to correct the error "index was outside the boundary of the array. at the point of running the simulation

Lucas Sousa

unread,
Jan 5, 2018, 1:23:26 PM1/5/18
to ArcSWAT
Hey!

Did you find out how to fix it? Could you share with me?

Best regards!

Tosin James

unread,
Dec 27, 2018, 2:34:37 AM12/27/18
to ArcSWAT
Hello All

Am having the same error while importing observed weather data (Temperature & Precipitation) for weather data definition

The error is:   Index was outside the bounds of array.: In reading line 0" I have check for empty spaces in my lookup table

Thanks
Reply all
Reply to author
Forward
0 new messages