How to best compile swat source code files

本文探讨了针对SWAT源代码进行编译时遇到的问题,包括使用Intel Visual Fortran Compiler 11.1后的运行速度变化,以及如何通过调整编译选项来优化程序性能,特别是针对水文学模拟的需求。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Question:
The uniqueness of the watershed I am working on led me to make a minor modification to the SWAT source code.The modification doesn't add any calculations, but, when I compile it with the new Intel Visual Fortran Compiler 11.1, it actually takes slightly longer to run on my computer using Win32 architecture 60 seconds instead of 56 seconds. I can live with that, but I'm thinking the new compiler should actual ly be able to shave off some time.Worse still, when I compile with the new Fortran 11.1 compiler on a 64 bit desktop, it runs MUCH slower on that desktop (over 2 minutes), though there should be a way,I think, for it to run faster.Run times are important to me because I'm doing extensive uncertainty analysis.Anyone have any ideas?Itried to follow a handout from a SWAT workshop on compiling using Fortran 6.6C, but the software has changed so much since then.
Answer:
From my limited understanding attempts at compiling with the Intel compiler, with lots of trial and error, here are a few of my conclusions:
(1) the "release" set of compiler options results in very fast code, andhydrology seemed OK, but sediment and maybe other water quality
ariables were corrupted in some of the output files (floating point over flowerrors).The Reach output was corrupt, but I think the HRU and Sub output might be OK.
(2) the "full debug" set of compiler options produced very big and slow code

(3) the run
time option to check array and string bounds seems to be the critical factor that makes the code big and slow.Try turning this off.
(4) the "library" option for "debug multithreaded" seems to be the critical
factor in avoiding the overflow errors I noted above.So if I'm just running for hydrology, I use an executable created with the"release" compiler options.If I'm looking at sediment and nutrients, I recompile, starting with the "release" version but then add step (4).
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值