2022年新安江模型程序C++代码 .pdf
《2022年新安江模型程序C++代码 .pdf》由会员分享,可在线阅读,更多相关《2022年新安江模型程序C++代码 .pdf(17页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、新安江模型程序 C+代码以下是类的声明:class XinanjiangModel private: / FORCING double *m_pP; / 降水数据double *m_pEm; / 水面蒸发数据/ long m_nSteps; / 模型要运行的步长 (一共m_nSteps 步) long steps; / OUTPUT double *m_pR; / 流域内每一步长的产流量(径流深度 ) double *m_pRs; / 每一步长的地表径流深 (毫米) double *m_pRi; / 每一步长的壤中流深毫米double *m_pRg; / 每一步长的地下径流深 (毫米) dou
2、ble *m_pE; / 每一步长的蒸发 (毫米) double *m_pQrs; / 流域出口地表径流量double *m_pQri; / 流域出口壤中流径流流量double *m_pQrg; / 流域出口地下径流量double *m_pQ; / 流域出口的总流量double m_U; / SOIL double *m_pW; / 流域内土壤湿度double *m_pWu; / 流域内上层土壤湿度double *m_pWl; / 流域内下层土壤适度double *m_pWd; / 流域内深层土壤湿度double m_Wum; / 流域内上层土壤蓄水容量double m_Wlm; / 流域内下
3、层土壤蓄水容量精选学习资料 - - - - - - - - - 名师归纳总结 - - - - - - -第 1 页,共 17 页double m_Wdm; / 流域内深层土壤蓄水容量,WDM=WM-WUM-WLM / EVAPORATION double *m_pEu; / 上层土壤蒸发量毫米double *m_pEl; / 下层土壤蒸发量毫米double *m_pEd; / 深层土壤蒸发量毫米/runoff double *RF; / PARAMETER double m_Kc; / 流域蒸散发能力与实测蒸散发值的比double m_IM; / 不透水面积占全流域面积之比double m_B
4、; / 蓄水容量曲线的方次,小流域几平方公里B0.1左右/ 中等面积平方公里以内,较大面积.30.4 double m_WM; / 流域平均蓄水容量毫米(WM=WUM+WLM+WDM) double m_C; / 流域内深层土壤蒸发系数,江南湿润地区:0,/华北半湿润地区:double m_SM; /自由水蓄水容量double m_EX; /自由水蓄水容量面积分布曲线指数double m_KG; /地下水日出流系数double m_KI; /壤中流日出流系数double m_CG; /地下水消退系数double m_CI; /壤中流消退系数double *m_UH; / 单元流域上地面径流的单
5、位线double m_WMM; / 流域内最大蓄水容量double m_Area; / 流域面积intm_DeltaT; / 每一步长的小时数intm_PD; / 给定数据,用以判断是否时行河道汇流计算public: XinanjiangModel(void); XinanjiangModel(void); 精选学习资料 - - - - - - - - - 名师归纳总结 - - - - - - -第 2 页,共 17 页/ 初始化模型void InitModel( long nSteps, double Area,int DeltaT, int PD, char *ForcingFile);
6、/ 设置模型参数void SetParameters( double *Params); / 运行新安江模型void RunModel(void); / 保存模拟结果到文件void SaveResults( char *FileName); / 记录出流数据,用以作图分析void Runoff(char *runoff); private: / 进行汇流计算,将径流深度转换为流域出口的流量void Routing(void); ; 以下是类的定义#include stdafx.h #include xinanjiangmodel.h #include #include #include usi
7、ngnamespace std; #include math.h #include stdio.h #include conio.h XinanjiangModel:XinanjiangModel( void) this-m_pP = NULL; this-m_pEm = NULL; this-m_pE = NULL; this-m_pEd = NULL; 精选学习资料 - - - - - - - - - 名师归纳总结 - - - - - - -第 3 页,共 17 页this-m_pEl = NULL; this-m_pEu = NULL; this-m_pW = NULL; this-m_
8、pWd = NULL; this-m_pWl = NULL; this-m_pWu = NULL; this-m_pR = NULL; this-m_pRg = NULL; this-m_pRi = NULL; this-m_pRs = NULL; this-m_pQ = NULL; this-m_pQrg = NULL; this-m_pQri = NULL; this-m_pQrs = NULL; XinanjiangModel:XinanjiangModel( void) delete this-m_pP; delete this-m_pEm; delete this-m_pE; del
9、ete this-m_pEd; delete this-m_pEl; delete this-m_pEu; delete this-m_pW; delete this-m_pWd; delete this-m_pWl; delete this-m_pWu; delete this-m_pR; delete this-m_pRg; delete this-m_pRi; 精选学习资料 - - - - - - - - - 名师归纳总结 - - - - - - -第 4 页,共 17 页delete this-m_pRs; delete this-m_pQ; delete this-m_pQrg; d
10、elete this-m_pQrs; delete this-m_pQri; / 初始化模型void XinanjiangModel:InitModel( long nSteps, double Area, int DeltaT,int PD, char* ForcingFile) FILE * fp; int i; this-m_nSteps = nSteps; this-steps = this-m_nSteps + 18; / 驱动数据this-m_pP = new doublethis-steps; this-m_pEm = new doublethis-steps; / 模型输出,蒸
11、散发项this-m_pE = new doublethis-steps; this-m_pEd = new doublethis-steps; this-m_pEl = new doublethis-steps; this-m_pEu = new doublethis-steps; / 模型输出,出流项,经过汇流的产流this-m_pQrg = new doublethis-steps; this-m_pQrs = new doublethis-steps; this-m_pQri = new doublethis-steps; this-m_pQ = new doublethis-steps
12、; / 模型输出,产流项this-m_pR = new doublethis-steps; this-m_pRg= newdoublethis-steps; 精选学习资料 - - - - - - - - - 名师归纳总结 - - - - - - -第 5 页,共 17 页this-m_pRi= new doublethis-steps; this-m_pRs = new doublethis-steps; / 模型状态量,土壤湿度this-m_pW = new doublethis-steps; this-m_pWd = new doublethis-steps; this-m_pWl = n
13、ew doublethis-steps; this-m_pWu = new doublethis-steps; /runoff值this-RF = new doublethis-steps; for(i = 0;isteps;i+ ) / 驱动数据this-m_pP i = 0.00; this-m_pEm i = 0.00; / 模型输出,蒸散发项this-m_pE i = 0.00; this-m_pEd i = 0.00; this-m_pEl i = 0.00; this-m_pEu i = 0.00; / 模型输出,出流项,经过汇流的产流this-m_pQrgi = 0.00; th
14、is-m_pQrsi = 0.00; this-m_pQrii = 0.00; this-m_pQi = 0.00; / 模型输出,产流项this-m_pR i = 0.00; this-m_pRg i = 0.00; this-m_pRi i = 0.00; this-m_pRs i = 0.00; 精选学习资料 - - - - - - - - - 名师归纳总结 - - - - - - -第 6 页,共 17 页/ 模型状态量,土壤湿度this-m_pW i = 0.00; this-m_pWdi = 0.00; this-m_pWli = 0.00; this-m_pWui = 0.00;
15、 this-m_Area = Area; this-m_DeltaT = DeltaT; this-m_PD = PD; this-m_U = this-m_Area/(3.6 * this-m_DeltaT); / Forcing文件格式:第一列:降水单位毫米 空格第二列水面蒸发 毫米if(fp = fopen(ForcingFile,r) = NULL) printf( Can not open forcing file!n);return; for(i = 0;im_nSteps;i+ ) fscanf(fp,%lf%lf ,&(this-m_pPi),&( this-m_pEmi);
16、fclose(fp); / 设置模型参数void XinanjiangModel:SetParameters( double* Params) this-m_Kc = Params0; / (1) 流域蒸散发能力与实测水面蒸发之比this-m_IM = Params1; / (2) 流域不透水面积占全流域面积之比this-m_B = Params2; / (3) 蓄水容量曲线的方次this-m_Wum = Params3; / (4) 上层蓄水容量this-m_Wlm = Params4; / (5) 下层蓄水容量this-m_Wdm = Params5; / (6) 深层蓄水容量this-m
17、_C = Params6; / (7) 深层蒸散发系数this-m_SM = Params7; / (8)自由水蓄水容量this-m_EX = Params8; / (9)自由水蓄水容量面积分布曲线指数精选学习资料 - - - - - - - - - 名师归纳总结 - - - - - - -第 7 页,共 17 页this-m_KG = Params9; / (10)地下水日出流系数this-m_KI = Params10; / (11)壤中流日出流系数this-m_CG = Params11; / (12)地下水消退系数this-m_CI = Params12; / (13)壤中流消退系数t
18、his-m_WM = this-m_Wum + this-m_Wlm + this-m_Wdm; this-m_WMM = this-m_WM * (1.0 + this-m_B)/(1.0 - this-m_IM); / 运行新安江模型void XinanjiangModel:RunModel( void) long i; / 模型的状态变量double PE; / 0 时为净雨量 ; 0 为蒸发不足量 mmdouble Ep; /m_Kc * m_pEmi double P; double R; / 产流深度,包括地表径流、壤中流和地下径流mmdouble RB; / 不透水面上产生的径流
19、深度mmdouble RG; / 地下径流深度 mmdouble RI; / 壤中流深度 mmdouble RS; / 地表径流深 mmdouble A; /土壤湿度为 W时土壤含水量折算成的径流深度mmdouble E = 0.0; / 蒸散发 (mm) double EU = 0.0; / 上层土壤蒸散发量 mmdouble EL = 0.0; / 下层土壤蒸散发量 mmdouble ED =0.0; / 深层土壤蒸散发量 mmdouble S; double FRo; double FR; double MS; double AU; 精选学习资料 - - - - - - - - - 名师
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 2022年新安江模型程序C+代码 2022 新安江 模型 程序 C+ 代码
限制150内