Write SWAT inputfiles

97 views
Skip to first unread message

Amna Kulsoom

unread,
Aug 7, 2022, 3:25:07 PM8/7/22
to AGWA Support
Hi Shea.
All of that has been resolved, this really helped.
But I am still not able to write swat200 input files, Can you help me figure out why the write option cant be selected?
Also how to fill these adjustable factors?
writeinput3.PNG
writeinput1.PNG
writeinput2.PNG

Shea

unread,
Aug 8, 2022, 5:06:42 PM8/8/22
to AGWA Support
It looks like you haven't selected a station in the Weather Generator section of the Climate Inputs tab. You have the point theme containing the stations selected in the drop-down, but you still need to click the button to the right of the drop-down and select the station you want to use on the map.

Shea

Amna Kulsoom

unread,
Aug 9, 2022, 10:01:00 AM8/9/22
to AGWA Support
Yes, Actually it was giving an error doing that.
but now it's fixed. Thanks to you for pointing out.
Can you please help me with one more thing?
Do I need to change the adjustment factors or should I just let it be? 

Amna Kulsoom

unread,
Aug 9, 2022, 10:04:42 AM8/9/22
to AGWA Support
And how do I import back the calibrated and validated results for visual representation in AGWA? 
And do these results really need to be calibrated and validated and if yes would SWAT CUP work?
I really need your urgent help, since my last date of report submission is just a day more to go.

Amna Kulsoom

unread,
Aug 9, 2022, 1:14:26 PM8/9/22
to AGWA Support
What does this error mean?
And how do I resolve it?

ERROR SIMULATING.PNG

Amna Kulsoom

unread,
Aug 9, 2022, 2:58:15 PM8/9/22
to AGWA Support
ERROR SIM4.PNG
ERROR SIM4.PNG

Shea

unread,
Aug 9, 2022, 5:23:52 PM8/9/22
to AGWA Support
>Do I need to change the adjustment factors or should I just let it be?
I would not change any of the adjustment factors until you have reason to.

And how do I import back the calibrated and validated results for visual representation in AGWA? 
And do these results really need to be calibrated and validated and if yes would SWAT CUP work?
Once you have a successful simulation complete, the AGWA Results form will recognize the simulations and make them available for you to import. If you manipulate the input files outside of AGWA and rerun the simulation, the AGWA results form will recognize the results need to be reimported/updated.
Simulation results are not calibrated or validated in AGWA. AGWA is designed to facilitate the creation of the model input files that can then be used in a separate calibration/validation exercise with external software, or alternatively to view results through the lens of relative change between scenarios/simulations or between subbasins within your watershed. You would need to locate an older version (4.3) of SWAT CUP if you want to use it with the SWAT 2005 in AGWA. We're several SWAT releases behind what the current version of what SWAT CUP supports. Other than SWAT CUP, there are also model independent calibration/validation tools like PEST, or your own scripting in Python, MatLab, or R that is supported. However, given your short timeline, I don't know that you have time to set up calibration and validation, which requires a lot of observed data you may not have yet. 

>What does this error mean?
>And how do I resolve it?
From the name of the routine and source, it is likely a curve number issue, which would point back to a land cover parameterization issue. In ArcMap, if you add the ..._p_parLUT located in your delineation geodatabase to the map and open it, you'll see the parameters that are used to create the SWAT input files. Each row references a parameterization and a subbasin and has some of the parameters for that subbasin. There should be zero null values; if there are there was a problem with the parameterization. If it's the CN and Cover fields that have null values, it's probably because the CLASS field of the land cover look-up table doesn't have the pixel values in the land cover raster. To fix this, double-check that the land cover look-up table is populated properly. The curve numbers will be in the A, B, C, and D fields, and the CLASS field must be populated with the pixel values of the land cover raster.

Shea

Amna Kulsoom

unread,
Aug 10, 2022, 4:54:35 AM8/10/22
to AGWA Support
Hey Shea.
I can't thank you enough.
I have fixed the CURNO error, all thanks to you but now this error has appeared.
Please help me understand what dose this means. And how do I fix it?

Waiting Amna.

Amna Kulsoom

unread,
Aug 10, 2022, 5:00:43 AM8/10/22
to AGWA Support
The error server (24) end-of-file during read, unit 101, sometimes server (64) unit 103. and server (24) unit 2
how do I fix both and what is the cause of them?

error sim.PNG
ERROR SIMULATING.PNG
error simu.PNG

Shea

unread,
Aug 10, 2022, 2:13:47 PM8/10/22
to AGWA Support
severe (64): input conversion error is a problem with the .wgn files. To troubleshoot that, I would use a text editor to compare one of the WGN files from your simulation to a WGN file in one of the subdirectories of the \AGWA\datafiles\wgn\ directory. That should help identify if there are formatting differences that are causing that particular error.

severe (24): end-of-file during read is a problem with the .sub files or the subbasin files listed in the .sub files. The files may be empty or incomplete. Look in the errors.txt file that is located where your ArcMap MXD document for this project is saved. If there was a problem writing the subbasin files, you should see an error that has the text "ModelSwat2005.WriteSubbasinFiles()" with some additional information that may point to what the problem is. Feel free to upload the errors.txt file here if you'd like me to scan it for problems.

Shea

Amna Kulsoom

unread,
Aug 13, 2022, 7:18:28 PM8/13/22
to AGWA Support
Hi Shea.
I tried a few ways but I can't resolve this severe (64) error so here I am attaching the screenshot of the error containing file 00001000.wgn and the wgn file I edited weatak1.wgn and the data I generated for wgn file using swat wgn generator.
Asking for your help if you could please help me with this error.
ER_WGN.PNG
000010000.WGN
weatak1.wgn
WGN_PLZ.xlsx

Amna Kulsoom

unread,
Aug 13, 2022, 7:24:13 PM8/13/22
to AGWA Support
Also, the data I have for calibration and validation includes the attributes Evaporation, Gauge, Discharge, and rain. And results from AGWA as  
WatYld_mm
Q_cmd
Tloss_m3/s
SedYld_mtn, 
so what would how be comparing and how do I get water balance results like Deep percolation and ET from AGWA?

Shea

unread,
Aug 15, 2022, 8:15:21 PM8/15/22
to AGWA Support
The .wgn files you uploaded have a mix of tabs and spaces. The tabs need to be converted to spaces, and the spacing should follow the requirements specified in Chapter 12 of the the SWAT 2005 IO Documentation (https://swat.tamu.edu/media/1291/SWAT2005io.pdf). The issue is lines 5 through 18 in your .wgn files- they should follow the f6.2 format, which means a fixed spacing 6 spaces wide including the decimal point with 2 numbers to the right of the decimal place (e.g. xxx.xx). I'd recommend using a text editor that allows you to see the difference between tabs and spaces (see attached screenshot, your file is on top and the other is the original from the \AGWA\datafiles\wgn\ak\ directory-  notice how the decimal points line up vertically in the bottom and how the spaces are represented differently than the tabs).

wgn formatting.png

Shea

Message has been deleted

Amna Kulsoom

unread,
Aug 16, 2022, 1:10:39 PM8/16/22
to AGWA Support
Thank you so much shea.
It has worked. :) 

Amna Kulsoom

unread,
Aug 16, 2022, 4:37:42 PM8/16/22
to AGWA Support
Hi, shea
One more thing, I want my results in terms of like date and the values but the results I am obtaining from AGWA are kind of stream-based or subwatershed like this, Although I selected the daily option while writing swat input files. so can you tell me how can I get that?
also, I m sharing with you how I want the results to be and how they are. 

agwa_results.PNG
observed-compa.PNG

Amna Kulsoom

unread,
Aug 17, 2022, 5:14:25 PM8/17/22
to AGWA Support
Hi Shea,
I tried to find Swat-cup 4.3, But it's not available online.
And while I was trying to use SWAT-Cup I figured out that, it requires a TxtInOut file, which I can't find in the results obtained from AGWA. 
Can you tell me how can I calibrate the results?
Or maybe share the swat-cup 4.3 version if you can?
Or tell me how can I prepare a TxtInOut file of my results to use Swat-cup 5.2.


On Wednesday, August 10, 2022 at 2:23:52 AM UTC+5 Shea wrote:

And how do I import back the calibrated and validated results for visual representation in AGWA? 
And do these results really need to be calibrated and validated and if yes would SWAT CUP work?

Shea

unread,
Aug 17, 2022, 5:20:11 PM8/17/22
to AGWA Support
Despite the daily, monthly, or annual output frequency option, the results viewer in AGWA doesn't support viewing specific dates within a simulation. Instead it calculates the average annual value over the entire simulation period. However, the daily output still exists and can be joined to the subwatershed and stream layers using the native functionality of ArcMap to join tables.

If you look in the simulation directory after importing the results in AGWA, you will see {simulation name}_dailyrch.txt and {simulation name}_dailysbs.txt text files. These contain the daily output for each subwatershed and stream. Unfortunately, the year isn't output on each line, so that needs to be calculated based on the line number. It's probably easiest to work with this data in Excel to do your filtering and selection of dates and subwatersheds and reaches first, then joining what you create in Excel to the subwatersheds and streams in AGWA. The ID field of the subwatersheds layer in AGWA joins to the SUB field in the dailysbs.txt file and the SWAT_id field of the streams layer in AGWA joins to the RCH field in the dailyrch.txt file.

Shea

Amna Kulsoom

unread,
Aug 17, 2022, 6:33:42 PM8/17/22
to AGWA Support
Hi Shea,
I tried to find Swat-cup 4.3, But it's not available online.
And while I was trying to use SWAT-Cup I figured out that, it requires a TxtInOut file, which I can't find in the results obtained from AGWA. 
Can you tell me how can I calibrate the results?
Or maybe share the swat-cup 4.3 version if you can?
Or tell me how can I prepare a TxtInOut file of my results to use Swat-cup 5.2.

Amna Kulsoom

unread,
Aug 17, 2022, 6:34:17 PM8/17/22
to AGWA Support
Let me try this.


On Thursday, August 18, 2022 at 2:20:11 AM UTC+5 Shea wrote:
Message has been deleted

Shea

unread,
Aug 18, 2022, 12:31:14 PM8/18/22
to AGWA Support
I was able to find a copy of SWAT-CUP 4.3.7, but I have never used it so I'm not familiar with it's requirements. I think the TxtInOut you refer to is actually the simulation directory that other SWAT interfaces use when writing simulation input files. If SWAT-CUP requires that to be the name of the folder, simply copy your existing simulation directory and rename it to TxtInOut. I'm also not sure if SWAT-CUP requires the files in the folder to follow a specific naming convention, and if it does whether AGWA follows the same convention, but I did look at the example TxtInOut folder included in the download and the file names do look similar.

The file was too big to attach, so you can download it temporarily from the following link: https://arizona.box.com/shared/static/id012fmxfbyofbxndf510cgihmnlv6sy.zip

Shea

Amna Kulsoom

unread,
Aug 18, 2022, 3:27:38 PM8/18/22
to agwa-s...@googlegroups.com
Thank you so very much shea.
Its a huge help. 
This would definitely work I hope.


--
You received this message because you are subscribed to the Google Groups "AGWA Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to agwa-support...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/agwa-support/0a60b383-b965-4687-b6c5-39358698ccb3n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages