469 views
EFDC模型 === ## 简介 ## 适用场景 ## 软件下载 ## 应用指南 ### 基于EFDC-ACEE的模型配置说明 >[name=可爱的小苹果][time=Wed, Jun 7, 2023 5:14 PM] #### 文件列表 - 水动力水质一起算 ![](/uploads/upload_51940428d05926c7b6ced38a71eb67f4.png) - 基于已有流场算水质 ![](/uploads/upload_603938ff77fb879d16b2333244fb62d4.png) #### 结果文件 ![](/uploads/upload_80a3eb9f03878cc6fff6d90a0b9c74e9.png) >网格文件 cell.inp、celllt.inp 说明: 9——陆地与水域相交 5——水域 0——陆地 ![](/uploads/upload_4c649cc6ede2a1802dc79b9670be0baa.png) >网格角点坐标文件 concer.inp ![](/uploads/upload_572e847769e8ce99ca33a2d2dc431d91.png) >网格尺寸文件 dxdy.inp ![](/uploads/upload_02f22705f82603c3352af6405d4286f8.png) >网格尺寸文件 lxly.inp ![](/uploads/upload_479e240ba2a07d061997739032a0238e.png) >浓度排放文件 multi_dser1001.inp(核素序号1001号) ![](/uploads/upload_34bd1ea66c577a5c8b573a04c0fa2cce.png) >核素参数文件 multidyes_basic.inp(核素种类及参数) ![](/uploads/upload_a681d2cbd533be3a2a41919fd62150b5.png) >水位文件文件 pser.inp(水位值) ![](/uploads/upload_baacc3353661984f6c76dc7f375a3f0a.png) >排放水量文件 qser.inp(水位值) ![](/uploads/upload_05decd0c4696702c96c501175823c358.png) >主控文件 efdc.inp 需要根据界面传递的信息,修改文件里的相关计算条件,涉及很多修改的卡片,先总结如下: (1)从服务器复制 这个变为2是快速计算,1是二阶时间积分 ![](/uploads/upload_bad0089ed1ea17553ea413be5115a0bb.png) efdc中初始本底文件dye.inp的开关 ![](/uploads/upload_a9ca57d2d9bd2f1a91780ffd6e5b9d26.png) 时间参数修改 (C7) ![](/uploads/upload_394ee6a10a090cb1eb9005fe0a2ebf5b.png) 网格参数修改(C9) ![](/uploads/upload_56b700b1d73e6c24d3db1d064b4dcea9.png) 网格层数信息修改(C9A-C10) ![](/uploads/upload_77e89c658327878de14d3a044d52a50f.png) 源项信息修改(C24) ![](/uploads/upload_a10db258ff050ed738f37c3ae09f01e3.png) 输出步长信息修改(C72) ![](/uploads/upload_7447fe1e44d4564491590dc4cffbc6d4.png) 模型边界信息修改,涉及的卡片: C16,模型水位边界数目信息 C18(南边界水位信息设定)、 C19(西边界水位信息设定)、 C20(东边界水位信息设定)、 C21(北边界水位信息设定) C46,模型浓度边界数目信息设定 C47 C48 C49 C50 C51,南边界浓度信息设定 C52 C53 C54 C55 C56,西边界浓度信息设定 C57 C58 C59 C60 C61,东边界浓度信息设定 C62 C63 C64 C65 C66,北边界浓度信息设定 --- >快速模式 说明:快速模式的输入文件和实时模式基本相同,添加了流场文件EE_VEL.TXT,流场水位文件EE_WS.TXT,对主控文件efdc.inp进行了增添修改。 (1)流场文件EE_VEL.TXT 取出U、V、W变量,生成合速度Speed。 说明:文件按时刻,给出每个网格对应的所有层数的速度变量。例如10层网格,每层网格数30000,即t时刻,输出第一个网格,对应所有层数的速度分量(u、v、w),依次输出第二个网格,对应所有层数的速度分量(u、v、w)。 ![](/uploads/upload_4ded7cbc9bce508a10748c2a2da3d0bf.png) (2)水位文件EE_WS.TXT 说明:水位变化,指的是表层水位变化,并没有分层,只有表层。 文件按时刻,给出每个网格对应的水位变量。例如30000网格,即t时刻,给出30000个网格,每个网格对应的水位值(waterlever)。 ![](/uploads/upload_8db20f316310e38397e143b09f652ba8.png) (3)主控文件efdc.inp修改 A 修改C1A,激活计算模式 ![](/uploads/upload_41692eab611e3876137d8db06e386aee.png) B 修改C7,参考时间 ![](/uploads/upload_4b0d5e746b2252f64a53fc62aea15a1b.png) >输出文件格式 浓度输出文件EE_WC1001.TXT 依据文件取出每个时刻,单个网格,对应的所有层浓度值(从上到下,先排第一个网格,对应1、2、3层的浓度值;然后第二个网格,对应的1、2、3层的浓度值)。 ![](https://md.toolsbox.org.cn/uploads/upload_70e4a0f5551b1a8806e508471b994af1.png) ## 开发指南 ### EFDC-MPI #### IBM版EFDC-MPI开发库 ``` git clone https://github.com/fearghalodonncha/EFDC-MPI.git ``` #### 编译 - 安装脚本Quickstart ``` #!/bin/bash # This script is the run-able quickstart guide for building this project. It # assumes you are running on a recent version of Ubuntu or Debian. See the # README file if you are using a different distribution. # install openmpi from ubuntu package manager sudo apt-get install -y libopenmpi-dev openmpi-bin libhdf5-openmpi-dev openmpi-common libxml2-dev # Add NetCDF # 1) We need HDF #Required for NetCDF integration; source is supported at http://www.hdfgroup.org/ftp/HDF5/current/src HDF_VERSION="1.10.1" HDF_VERSION="1_10_10" # Download build and install HDF5 # mkdir ~/temp # cd ~/temp # wget http://www.hdfgroup.org/ftp/HDF5/current/src/hdf5-${HDF_VERSION}.tar.bz2; \ wget https://github.com/HDFGroup/hdf5/archive/refs/tags/hdf5-1_10_10.tar.gz # tar -xjvf hdf5-${HDF_VERSION}.tar.bz2; \ tar -xzvf hdf5-${HDF_VERSION}.tar.gz; \ cd hdf5-hdf5-${HDF_VERSION}; \ ./configure --enable-shared --prefix=/usr/local/hdf5; \ make; \ sudo make install; \ # cd ..; \ # rm -rf /hdf5-${HDF_VERSION} /hdf5-${HDF_VERSION}.tar.bz2; rm -rf /hdf5-hdf5-${HDF_VERSION} /hdf5-${HDF_VERSION}.tar.gz; # 2) #Build netcdf # First we need to build NetCDF C version # (http://www.unidata.ucar.edu/software/netcdf/docs/getting_and_building_netcdf.html) # Download and install netcdf C NCD_VERSION="4.3.3.1" NCD_VERSION="4.9.2" # wget ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-${NCD_VERSION}.tar.gz; wget https://downloads.unidata.ucar.edu/netcdf-c/4.9.2/netcdf-c-4.9.2.tar.gz # tar -xzvf netcdf-${NCD_VERSION}.tar.gz; tar -xzvf netcdf-c-${NCD_VERSION}.tar.gz; # cd netcdf-${NCD_VERSION}; cd netcdf-c-${NCD_VERSION}; ./configure --prefix=/usr/local/netcdf CC=gcc LDFLAGS=-L/usr/local/hdf5/lib CFLAGS=-I/usr/local/hdf5/include; make ; sudo make install; cd .. ; # rm -rf netcdf-${NCD_VERSION} netcdf-${NCD_VERSION}.tar.gz rm -rf netcdf-c-${NCD_VERSION} netcdf-c-${NCD_VERSION}.tar.gz # 3) Build NetCDF fortran version # (http://www.unidata.ucar.edu/software/netcdf/docs/building_netcdf_fortran.html) # Download and install NetCDF fortran NCF_VERSION="4.4.2" NCF_VERSION="4.6.0" # wget ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-${NCF_VERSION}.tar.gz; wget https://downloads.unidata.ucar.edu/netcdf-fortran/4.6.0/netcdf-fortran-4.6.0.tar.gz tar -xzvf netcdf-fortran-${NCF_VERSION}.tar.gz; cd netcdf-fortran-${NCF_VERSION}; ./configure --prefix=/usr/local/netcdf --disable-fortran-type-check CC=gcc FC=gfortran LDFLAGS=-L/usr/local/netcdf/lib CFLAGS=-I/usr/local/netcdf/include; make ; sudo make install; cd .. rm -rf netcdf-fortran-${NCF_VERSION} netcdf-fortran-${NCF_VERSION}.tar.gz ``` - 运行Quickstart脚本时,注意依赖库的下载路径是否还有效 - 编译出现的缺失依赖包的情况,安装之 - 编译EFDC时,查看makefile,查看netcdf库的路径是否正确 #### 运行 - 运行出现缺失共享库时,执行ldd EFDC查看缺失的库及路径,将相应的库拷贝过去即可 ###### tags: `博客` `模型软件学习` ### EFDC-ACEE 基于DSI EE 7.1配套源码修改,实现了多个DYE计算和水动力水质解耦计算。 #### 信息化集成思路 [EFDC模型在水环境管理信息系统集成开发过程中的关键技术研究](http://cnki.cgl.org.cn/KCMS/detail/detail.aspx?filename=HJGC201507029&dbcode=CJFD) [主控文件处理](https://www.toolsbox.org.cn/pages/coding/.net/2022070301/) #### 多DYE计算完善思路及配置文件说明 - 配置开边界及点源边界的流量及浓度时间序列编号,IQSERQ、ICSER3,浓度时间序列文件对应multi_dser100*.inp文件里的时间序列个数 ![](/uploads/upload_949b886a320d95441ad74c2c28572c5c.png) #### 水动力水质解耦计算完善思路及配置说明 #### 开发日志 - [time=Sat, May 13, 2023 10:44 AM] 1. 修改主控文件C64A卡片冰盖参数读取,以适应EE8版本主控文件 ### EFDC+ DSI OPEN SOURCE #### 源码下载 ``` git clone https://github.com/dsi-llc/EFDCPlus.git ``` #### 编译 - 按照源码编译说明文档提到的安装Intel OneAPI工具包 - 安装完编译不了时,注意安装的Intel系统环境变量名及值与源码工程配置的路径是否匹配,一一检查 - 选择64DP_Rel_OneApi_MPI配置编译 #### 运行 - 安装 [Intel OneApi运行包](https://registrationcenter-download.intel.com/akdlm/IRC_NAS/81e6950b-73c9-4ed6-95dc-57f38a7e9a30/w_ifort_runtime_p_2023.1.0.46319.exe) - decomp.jnp文件的生成(依赖EE,EFDC-MPI版本的Gorp程序经测试不能用) >Create a Decomp.inp File Created by Zander Mausolff (Unlicensed) 17 Apr, 20201 min read >The decomp.inp file specifies the widths in the I and J directions of each subdomain. >An example: >{ "number_i_subdomains": 2, "number_j_subdomains": 2, "number_active_subdomains": 4, "i_subdomain_widths": [31,42], "j_subdomain_widths": [19,28], "active_flag":[1,1,1,1] } >Each parts of the input file are described next. >"number_i_subdomains" - this specifies the number of subdomains in the I direction >"number_j_subdomains" - this specifies the number of subdomains in the J direction >"number_active_subdomains" - The total subdomains is equal to the number of I subdomains times the number of J subdomains. >"i_subdomain_widths" - Specifies the respective width in the I direction of each subdomain. >"j_subdomain_widths" - Specifies the respective width in the J direction of each subdomain. >“active_flag - Specifies if that sub-domain is active. For most cases just set all equal to 1. >So the sum of the widths in each respective dimension must add up to the total grid width (or height) in each respective direction. In the example decomp.inp file shown above, this would amount to a 'global' IC=73 and JC=47 in the efdc.inp file (Card 9). - 编写以下脚本运行 ``` SET KMP_AFFINITY=granularity=fine,compact,1,0 TITLE Sample Title of the Problem CD "C:\Path\To\WorkingDirectory\" "C:\Path\To\Exectuable\EFDCPlus.exe" -NT2 -NOP ``` #### 注意事项 - EE11 EFDC+ 支持多DYE计算 - EE8生成的文件适配问题 - C9 需要在ISMASK字段后增加 NBLOCKED 字段,赋值为0 - C14 需要在最后增加 ISPROPWASH 字段,赋值为0 - C22 需要在开头增加 NDYE 字段,赋值为0 - C23 需要在最后增加 NQCTLSER, NQCTRULES 字段,赋值为0 - 水质模型控制文件由wq3dwc.inp更改为json格式的wq_3dwc.jnp文件(待了解文件如何生成)