Please help: Error saying "forrtl: severe (29): file not found"

876 views
Skip to first unread message

Jylee

unread,
Nov 8, 2022, 1:55:18 AM11/8/22
to SWAT-MODFLOW
Hi,

I have successfully created a swat-modflow project. However, when I run it, I get an error message like the following: 

forrtl: severe (29): file not found, unit 146, file C:\Temp\SM_test1\SWAT-MODFLOW\fort.146
Image              PC                Routine            Line        Source
SWAT-MODFLOW3.exe  00007FF7553D2B34  Unknown               Unknown  Unknown
SWAT-MODFLOW3.exe  00007FF7553917F9  Unknown               Unknown  Unknown
SWAT-MODFLOW3.exe  00007FF754D9F964  Unknown               Unknown  Unknown
SWAT-MODFLOW3.exe  00007FF755136771  Unknown               Unknown  Unknown
SWAT-MODFLOW3.exe  00007FF7551A9D40  Unknown               Unknown  Unknown
SWAT-MODFLOW3.exe  00007FF75535D388  Unknown               Unknown  Unknown
SWAT-MODFLOW3.exe  00007FF755289CE7  Unknown               Unknown  Unknown
SWAT-MODFLOW3.exe  00007FF75546812E  Unknown               Unknown  Unknown
SWAT-MODFLOW3.exe  00007FF755468659  Unknown               Unknown  Unknown
SWAT-MODFLOW3.exe  00007FF75546857E  Unknown               Unknown  Unknown
SWAT-MODFLOW3.exe  00007FF75546843E  Unknown               Unknown  Unknown
SWAT-MODFLOW3.exe  00007FF7554686C9  Unknown               Unknown  Unknown
KERNEL32.DLL       00007FFBBA937034  Unknown               Unknown  Unknown
ntdll.dll          00007FFBBC6826A1  Unknown               Unknown  Unknown

What does this mean? There is SWAT-MODFLOW3.exe in the project folder. Both my SWAT and MODFLOW work well alone, and the SWAT-MODFLOW linking process went smooth without an error. There is no missing file or misformated file..

Please help me if you know why this error is happening or how to fix this error.

My swatmf_log.txt file says the following:

Progress of SWAT-MODFLOW simulation

 swatmf_link.txt:    file flags have been read
 swatmf_link.txt:    MODFLOW is active
 swatmf_link.txt:    output flags have been read
 swatmf_link.txt:    output control has been read

Here are my project file and folder if you need to take a look at them:

Thank you.

Best,
Jy
Message has been deleted

Seonggyu Park

unread,
Nov 9, 2022, 2:58:56 PM11/9/22
to SWAT-MODFLOW
Hi Jy,

I checked your project and found you are using the PCG solver instead of NWT. Have you tried the NWT version?

Thanks,
Seonggyu

Jylee

unread,
Nov 14, 2022, 1:31:53 AM11/14/22
to SWAT-MODFLOW
 Dear Seeonggyu,

Thank you so much for your reply.

I tried again with the NWT version of my MODFLOW model, and I am still getting the same error (shown below). Once again, my SWAT and MODFLOW models run just fine individually. Here is the zip file for the qgz and project files with the NWT version: https://drive.google.com/file/d/1YUaJ9xNwq4egdkxycpEm5KrZV4ypldMA/view?usp=sharing

C:\Temp\SM_nwt_test\SWAT-MODFLOW>SWAT-MODFLOW3.exe
                SWAT2012
               Rev. 636_smrt
      Soil & Water Assessment Tool
               PC Version
 Program reading from file.cio . . . executing

 MODFLOW is being used
 Using NAME file: modflow.mfn

forrtl: severe (29): file not found, unit 146, file C:\Temp\SM_nwt_test\SWAT-MODFLOW\fort.146

Image              PC                Routine            Line        Source
SWAT-MODFLOW3.exe  00007FF6149EF2A4  Unknown               Unknown  Unknown
SWAT-MODFLOW3.exe  00007FF6149B0E89  Unknown               Unknown  Unknown
SWAT-MODFLOW3.exe  00007FF6144754F4  Unknown               Unknown  Unknown
SWAT-MODFLOW3.exe  00007FF614715A11  Unknown               Unknown  Unknown
SWAT-MODFLOW3.exe  00007FF61471E700  Unknown               Unknown  Unknown
SWAT-MODFLOW3.exe  00007FF614984F98  Unknown               Unknown  Unknown
SWAT-MODFLOW3.exe  00007FF614811F77  Unknown               Unknown  Unknown
SWAT-MODFLOW3.exe  00007FF614A8812E  Unknown               Unknown  Unknown
SWAT-MODFLOW3.exe  00007FF614A88649  Unknown               Unknown  Unknown
SWAT-MODFLOW3.exe  00007FF614A8856E  Unknown               Unknown  Unknown
SWAT-MODFLOW3.exe  00007FF614A8842E  Unknown               Unknown  Unknown
SWAT-MODFLOW3.exe  00007FF614A886BE  Unknown               Unknown  Unknown
KERNEL32.DLL       00007FFC577D74B4  Unknown               Unknown  Unknown
ntdll.dll          00007FFC597226A1  Unknown               Unknown  Unknown

Since my swatmf_log.txt stops before the line, "swatmf_init: MODFLOW files have been read", I suspected that even my NWT version MODFLOW model might still be a source of error. So, I tried building a simple MODFLOW model using the SWAT-MODFLOW gui instead of using my MODFLOW, but I still get the same error. 

One thing that might be noteworthy is that my basin is quite big (~45000km2) and my SWAT model is quite complex (~7500 HRUs). MODFLOW is relatively simple but still big in scale (~45000 active cells; 1km2 grid). It took 6-8 hours every time I attempted to build a SWAT-MODFLOW model using my models, as the linking process takes really long. 

Thinking that my large/complex SWAT might be causing issues in memory or some kind of input size limit that might exist for SWAT-MODFLOW, I also tested running my SWAT-MODFLOW model (the one with the NWT version MODFLOW; the link to the zip file is provided above) with SWAT-MODFLOW deactivated. I expected my SWAT-MODFLOW model should run fine for the SWAT part only, as my SWAT model alone runs well, but I am still getting the following error. Since it says "access violation", I checked the security under the properties of the project folder, and I do have full access and control of the folder. I have no idea what this access violation means. 

C:\Temp\SM_nwt_test\SWAT-MODFLOW>SWAT-MODFLOW3.exe
                SWAT2012
               Rev. 636_smrt
      Soil & Water Assessment Tool
               PC Version
 Program reading from file.cio . . . executing

  Executing year    1
forrtl: severe (157): Program Exception - access violation

Image              PC                Routine            Line        Source
SWAT-MODFLOW3.exe  00007FF7371D24F2  Unknown               Unknown  Unknown
SWAT-MODFLOW3.exe  00007FF737098D24  Unknown               Unknown  Unknown
SWAT-MODFLOW3.exe  00007FF7370AE974  Unknown               Unknown  Unknown
SWAT-MODFLOW3.exe  00007FF73700725C  Unknown               Unknown  Unknown
SWAT-MODFLOW3.exe  00007FF737284D36  Unknown               Unknown  Unknown
SWAT-MODFLOW3.exe  00007FF737111F77  Unknown               Unknown  Unknown
SWAT-MODFLOW3.exe  00007FF73738812E  Unknown               Unknown  Unknown

SWAT-MODFLOW3.exe  00007FF737388649  Unknown               Unknown  Unknown
SWAT-MODFLOW3.exe  00007FF73738856E  Unknown               Unknown  Unknown
SWAT-MODFLOW3.exe  00007FF73738842E  Unknown               Unknown  Unknown
SWAT-MODFLOW3.exe  00007FF7373886BE  Unknown               Unknown  Unknown
KERNEL32.DLL       00007FFC577D74B4  Unknown               Unknown  Unknown
ntdll.dll          00007FFC597226A1  Unknown               Unknown  Unknown


Regarding the program versions, I am using the latest versions, QGIS (3.22.12) and SWAT-MODFLOW version from your github (2.3.1). I've also checked that the programs run fine by building and running a SWAT-MODFLOW project using the example data from your github, so I doubt I have any issue with the programs.

As much as I am excited about SWAT-MODFLOW, I am so frustrated that I am not able to integrate my SWAT and MODFLOW models, which work fine individually and go through the linking process without any error. 

I would greatly appreciate your help on the issue. 

Thank you so much, and I look forward to hearing back your thoughts. 

Best,
Jy


2022년 11월 9일 수요일 오전 11시 58분 56초 UTC-8에 env...@gmail.com님이 작성:

Seonggyu Park

unread,
Nov 22, 2022, 12:53:22 PM11/22/22
to SWAT-MODFLOW
Hi Jy,

I changed 3 things.
  1. forrtl: severe (29): file not found, unit 146, file C:\Temp\SM_nwt_test\SWAT-MODFLOW\fort.146
    • this issue occurred because the model couldn't find a file with unit number 146. The model read the main file "modflow.mfn" and the file includes the unit number 5146 instead, which is the FHB package. 
    • I changed every unit number 146 to 5146 in the *.fhb file to match it in the main file.
  1. Once the first issue got fixed, the second issue came out, which was the solver convergence failure. 
    • I increased the head/flux tolerance/iteration number and changed the mode from SIMPLE to COMPLEX.
  2. The last issue was about matching simulation periods between SWAT and MODFLOW.
    • The MODFLOW simulation period was set to 517 days and the SWAT 3 years. So, the model crashed after 517 days.
    • I suggest you put the MODFLOW period longer than the SWAT meaning your SWAT-MODFLOW simulation will end whenever the SWAT simulation ends.
    • I modified the last stress period (2.430E+002 -> 2.430E+003) in the *.dis file.
You can overwrite those dis, nwt, fhb original files by these attached files in the SWAT-MODFLOW directory. Then try to run the model again.
Please, let me know if you have any other issues.

Best,
Seonggyu
MF_nwt.dis
MF_nwt.fhb
MF_nwt.nwt
Reply all
Reply to author
Forward
0 new messages