本文主要是介绍VIC运行笔记2019.05.01,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
可执行文件加入Linux默认路径的办法:
如果需要临时的成为系统默认路径可以这样:
export PATH=/home/VIC/vic/drivers/classic:$PATH
此处假设要加入的路径是usr/local/arm/bin,记住,可执行文件是位于bin下面,比如可执行文件是a.o路径不能是:usr/local/arm/bin/a.o,路径指向可执行文件的所在 文件夹。
这样添加是暂时的,在关闭终端后就失去作用。
另外一种长期的方法是:
把路径加到/etc/profile或者~/.bash_profile,添加完之后需要注销一下,或者转换一下用户也可以啦。
就是在PATH加上命令的搜索路径就可以了;
参数文件夹:
#######################################################################
# Land Surface Files and Parameters
#######################################################################
SOIL /vic/vic.sample.stehekin-old/stehekin/params/vic/soil_param.STEHE # Soil parameter path/file
ARC_SOIL FALSE # TRUE = read soil parameters from ARC/INFO ASCII grids
#SOIL_DIR (soil param directory) # Directory containing ARC/INFO ASCII grids of soil parameters - only valid if ARC_SOIL is TRUE
BASEFLOW ARNO # ARNO = columns 5-8 are the standard VIC baseflow parameters; NIJSSEN2001 = columns 5-8 of soil file are baseflow parameters from Nijssen et al (2001)
JULY_TAVG_SUPPLIED FALSE # TRUE = final column of the soil parameter file will contain average July air temperature, for computing treeline; this will be ignored if COMPUTE_TREELINE is FALSE; FALSE = compute the treeline based on the average July air temperature of the forcings over the simulation period
ORGANIC_FRACT FALSE # TRUE = simulate organic soils; soil param file contains 3*Nlayer extra columns, listing for each layer the organic fraction, and the bulk density and soil particle density of the organic matter in the soil layer; FALSE = soil param file does not contain any information about organic soil, and organic fraction should be assumed to be 0
VEGLIB /vic/vic.sample.stehekin-old/stehekin/params/vic/veglib.LDAS # Veg library path/file
VEGPARAM /vic/vic.sample.stehekin-old/stehekin/params/vic/veg_param.STEHE # Veg parameter path/file
ROOT_ZONES 3 # Number of root zones (must match format of veg param file)
VEGPARAM_LAI TRUE # TRUE = veg param file contains LAI information; FALSE = veg param file does NOT contain LAI information
LAI_SRC LAI_FROM_VEGLIB # LAI_FROM_VEGPARAM = read LAI from veg param file; LAI_FROM_VEGLIB = read LAI from veg library file
SNOW_BAND 5 /vic/vic.sample.stehekin-old/stehekin/params/vic/snowbands.STEHE # Number of snow bands; if number of snow bands > 1, you must insert the snow band path/file after the number of bands (e.g. SNOW_BAND 5 my_path/my_snow_band_file)
在此处可以看出设置不设置动态植被!!!
一定注意各个文件引用路径是否对!,因为在linux里路径会发生更改。
[root@VM_0_15_centos src]# gcc *c -lm -o classic -I/vic/vic/drivers/classic/include //*C 表示编译文件夹里全部文件,-I...表示手动增加头文件地址
make 文件打开检查
之前新版本未编译成功可能是由于缺少make文件,后来发现没有关系!,主要是makefile里路径问题,
如下:注意下面几个路径是否正确!
# VIC DRIVER PATH (include and src are subdirs of this)
DRIVERPATH = .
# VIC RUN PATH
SHAREDPATH = ../shared_all
# VIC RUN PATH
VICPATH = ../../vic_run
注意vic_run前仅有两层文件夹!
# Set SHELL = your shell here
SHELL = /bin/bash #linux下一定是bash
# Set CC = your compiler here
ifndef CC
CC=gcc
endif
global_param.STEHE.txt参数文件夹路径一定改对,注意输出结果路径也要改一下!!
./vicNl -g/vic/VIC_sample_data-master/classic/Stehekin/parameters/global_param.STEHE.txt
第一次错误 后面没加后缀.txt
[root@VM_0_15_centos code]# ./vicNl -g/vic/VIC_sample_data-master/classic/Stehekin/parameters/global_param.STEHE.txt
***** VIC Version 4.1.1 *****
"/vic/VIC_sample_data-master/classic/Stehekin/parameters/global_param.STEHE.txt" has beenopened for reading.... skipping header
WARNING: Unrecognized option in the global parameter file:MODEL_STEPS_PER_DAY is unknown - check your spelling
WARNING: Unrecognized option in the global parameter file:SNOW_STEPS_PER_DAY is unknown - check your spelling
WARNING: Unrecognized option in the global parameter file:RUNOFF_STEPS_PER_DAY is unknown - check your spelling
Model run-time error...
Too many variables defined for forcing file 0.
...now exiting to system...
第二次错误:分析原因可能是用的是旧版本vic(4.1) 和新数据集(随着版本更新内部定义发生改变)!
所以直接在网站上下载版本5.01的主文件,并在数据集里下载(主文件了数据集是空)示例数据文件。教训:运行文件与示例文件一定匹配,因为版本更改的过程中,示例数据部分内容会发生变化!
结果如下:
[root@VM_0_15_centos classic]# ./vic_classic.exe -g/vic/VIC_sample_data-master/classic/Stehekin/parameters/global_param.STEHE.txt
VIC Driver : Classic
VIC Version : 5.0.1 February 1, 2017
VIC Git Tag :
Compiled : by root on VM_0_15_centos (LINUX) Jun 8 2019 12:19:17
Compiler : gcc
version : 4.8.5Variable Infiltration Capacity (VIC) macroscale hydrologicmodel version 5.0.1, Copyright (C) 2016 ComputationalHydrology Group, Dept. of Civil and Environmental Engineering,University of Washington. VIC comes with ABSOLUTELY NOWARRANTY. This is free software, you may redistribute itunder certain conditions; see LICENSE.txt for details.Report Bugs and Issues to : https://github.com/UW-Hydro/VIC/issuesVIC Users Email Listserve : vic_users@u.washington.edu[INFO] ../shared_all/src/vic_log.c:139: Logging to stderr
[WARN] ./src/read_snowband.c:103: errno: None: average band elevation 1726.542100 not equal to grid_cell average elevation 1668.150000; setting grid cell elevation to average band elevation.
[WARN] ./src/read_snowband.c:131: errno: None: Sum of the snow band precipitation fractions does not equal 1 (1.000000), dividing each fraction by the sum
[INFO] ./src/vic_force.c:111: Read meteorological forcing file
[WARN] ./src/read_snowband.c:103: errno: None: average band elevation 1697.461600 not equal to grid_cell average elevation 1698.790000; setting grid cell elevation to average band elevation.
[INFO] ./src/vic_force.c:111: Read meteorological forcing file
[WARN] ./src/read_vegparam.c:384: errno: None: Cv > 0.99 and Cv < 1.0 at grid cell 85875, model assuming that bare soil is not to be run - fractions being adjusted to equal 1
[WARN] ./src/read_snowband.c:103: errno: None: average band elevation 1593.672000 not equal to grid_cell average elevation 1613.520000; setting grid cell elevation to average band elevation.
[WARN] ./src/read_snowband.c:131: errno: None: Sum of the snow band precipitation fractions does not equal 1 (1.000000), dividing each fraction by the sum
[INFO] ./src/vic_force.c:111: Read meteorological forcing file
[WARN] ./src/read_vegparam.c:374: errno: None: Cv_sum exceeds 1.0 (1.000001) at grid cell 86339, fractions being adjusted to equal 1
[WARN] ./src/read_snowband.c:103: errno: None: average band elevation 1119.222000 not equal to grid_cell average elevation 1126.610000; setting grid cell elevation to average band elevation.
[WARN] ./src/read_snowband.c:131: errno: None: Sum of the snow band precipitation fractions does not equal 1 (1.000000), dividing each fraction by the sum
[INFO] ./src/vic_force.c:111: Read meteorological forcing file
[WARN] ./src/read_vegparam.c:374: errno: None: Cv_sum exceeds 1.0 (1.000001) at grid cell 86803, fractions being adjusted to equal 1
[WARN] ./src/read_snowband.c:103: errno: None: average band elevation 1760.166200 not equal to grid_cell average elevation 1740.180100; setting grid cell elevation to average band elevation.
[INFO] ./src/vic_force.c:111: Read meteorological forcing file
[WARN] ./src/read_snowband.c:103: errno: None: average band elevation 1805.449600 not equal to grid_cell average elevation 1816.870000; setting grid cell elevation to average band elevation.
[INFO] ./src/vic_force.c:111: Read meteorological forcing file
[WARN] ./src/read_snowband.c:103: errno: None: average band elevation 1847.293100 not equal to grid_cell average elevation 1846.020000; setting grid cell elevation to average band elevation.
[INFO] ./src/vic_force.c:111: Read meteorological forcing file
[WARN] ./src/read_snowband.c:103: errno: None: average band elevation 1461.972000 not equal to grid_cell average elevation 1552.689900; setting grid cell elevation to average band elevation.
[INFO] ./src/vic_force.c:111: Read meteorological forcing file
[WARN] ./src/read_vegparam.c:374: errno: None: Cv_sum exceeds 1.0 (1.000001) at grid cell 86802, fractions being adjusted to equal 1
[WARN] ./src/read_snowband.c:103: errno: None: average band elevation 1387.297600 not equal to grid_cell average elevation 1312.670000; setting grid cell elevation to average band elevation.
[INFO] ./src/vic_force.c:111: Read meteorological forcing file
[WARN] ./src/read_snowband.c:103: errno: None: average band elevation 1685.182600 not equal to grid_cell average elevation 1697.860000; setting grid cell elevation to average band elevation.
[INFO] ./src/vic_force.c:111: Read meteorological forcing file
[WARN] ./src/read_snowband.c:103: errno: None: average band elevation 1787.065900 not equal to grid_cell average elevation 1774.990000; setting grid cell elevation to average band elevation.
[INFO] ./src/vic_force.c:111: Read meteorological forcing file
[WARN] ./src/read_vegparam.c:384: errno: None: Cv > 0.99 and Cv < 1.0 at grid cell 86337, model assuming that bare soil is not to be run - fractions being adjusted to equal 1
[WARN] ./src/read_snowband.c:103: errno: None: average band elevation 1428.499200 not equal to grid_cell average elevation 1434.660000; setting grid cell elevation to average band elevation.
[INFO] ./src/vic_force.c:111: Read meteorological forcing file
[WARN] ./src/read_vegparam.c:374: errno: None: Cv_sum exceeds 1.0 (1.000001) at grid cell 86801, fractions being adjusted to equal 1
[WARN] ./src/read_snowband.c:103: errno: None: average band elevation 1477.456800 not equal to grid_cell average elevation 1488.360000; setting grid cell elevation to average band elevation.
[INFO] ./src/vic_force.c:111: Read meteorological forcing file
[WARN] ./src/read_vegparam.c:374: errno: None: Cv_sum exceeds 1.0 (1.000001) at grid cell 87265, fractions being adjusted to equal 1
[INFO] ./src/vic_force.c:111: Read meteorological forcing file
[WARN] ./src/read_snowband.c:103: errno: None: average band elevation 1634.700300 not equal to grid_cell average elevation 1640.470000; setting grid cell elevation to average band elevation.
[INFO] ./src/vic_force.c:111: Read meteorological forcing file
[WARN] ./src/read_snowband.c:103: errno: None: average band elevation 1596.935200 not equal to grid_cell average elevation 1580.660000; setting grid cell elevation to average band elevation.
[INFO] ./src/vic_force.c:111: Read meteorological forcing file
[INFO] ./src/vic_classic.c:351: Completed running VIC Classic------------------------------ VIC TIMING PROFILE ------------------------------Date : Sat Jun 8 12:37:58 2019Compiler : gcc (4.8.5)Machine : VM_0_15_centosVIC User : rootVIC Version :VIC GIT Version : 5.0.1 February 1, 2017VIC_DRIVER : ClassicGlobal Param File : /vic/VIC_sample_data-master/classic/Stehekin/parameters/global_param.STEHE.txtStart Date : 1949-01-01-00000Stop Date : 1949-01-10Nrecs : 240Model Timestep (seconds) : 3600Snow Timestep (seconds) : 3600Runoff Timestep (seconds) : 3600Atmos Timestep (seconds) : 3600Overall Metrics---------------Model Cost : 0.0489256 pe-hrs/simulated_yearModel Throughput : 490.541 simulated_years/dayTiming Table:
|------------|----------------------|----------------------|----------------------|----------------------|
| Timer | Wall Time (secs) | CPU Time (secs) | Wall Time (secs/day) | CPU Time (secs/day) |
|------------|----------------------|----------------------|----------------------|----------------------|
| Init Time | 0.00170612 | 0 | 0.000170612 | 0 |
| Run Time | 4.82372 | 4.54 | 0.482372 | 0.454 |
| Final Time | 8.89301e-05 | 0 | 8.89301e-06 | 0 |
| Total Time | 4.82553 | 4.54 | 0.482553 | 0.454 |
|------------|----------------------|----------------------|----------------------|----------------------|------------------------------ END VIC TIMING PROFILE ------------------------------
2019.06.11 开始跑径流
[root@VM_0_15_centos input]# /VIC_Routing-Fortran_version/src/rout /vic/VIC_sample_data-master/classic/Stehekin/rout/rout_input.STEHE
NDAY = 1095 NMONTHS = 36
1 STEHE 35 139
Routing station: STEHE
searching catchment...
Number of grid cells upstream of present station 16
reading grid_UH...
making grid UH...
reading UH_S grid from file
making convolution...
/vic/VIC_sample_data-master/classic/Stehekin/rout/input/fluxes_48.3125_-120.5625 NOT FOUND, INSERTING ZEROS
/vic/VIC_sample_data-master/classic/Stehekin/rout/input/fluxes_48.4375_-120.5625 NOT FOUND, INSERTING ZEROS
/vic/VIC_sample_data-master/classic/Stehekin/rout/input/fluxes_48.1875_-120.6875 NOT FOUND, INSERTING ZEROS
/vic/VIC_sample_data-master/classic/Stehekin/rout/input/fluxes_48.3125_-120.6875 NOT FOUND, INSERTING ZEROS
/vic/VIC_sample_data-master/classic/Stehekin/rout/input/fluxes_48.4375_-120.6875 NOT FOUND, INSERTING ZEROS
/vic/VIC_sample_data-master/classic/Stehekin/rout/input/fluxes_48.5625_-120.6875 NOT FOUND, INSERTING ZEROS
/vic/VIC_sample_data-master/classic/Stehekin/rout/input/fluxes_48.1875_-120.8125 NOT FOUND, INSERTING ZEROS
/vic/VIC_sample_data-master/classic/Stehekin/rout/input/fluxes_48.3125_-120.8125 NOT FOUND, INSERTING ZEROS
/vic/VIC_sample_data-master/classic/Stehekin/rout/input/fluxes_48.4375_-120.8125 NOT FOUND, INSERTING ZEROS
/vic/VIC_sample_data-master/classic/Stehekin/rout/input/fluxes_48.5625_-120.8125 NOT FOUND, INSERTING ZEROS
/vic/VIC_sample_data-master/classic/Stehekin/rout/input/fluxes_48.1875_-120.9375 NOT FOUND, INSERTING ZEROS
/vic/VIC_sample_data-master/classic/Stehekin/rout/input/fluxes_48.3125_-120.9375 NOT FOUND, INSERTING ZEROS
/vic/VIC_sample_data-master/classic/Stehekin/rout/input/fluxes_48.4375_-120.9375 NOT FOUND, INSERTING ZEROS
/vic/VIC_sample_data-master/classic/Stehekin/rout/input/fluxes_48.5625_-120.9375 NOT FOUND, INSERTING ZEROS
/vic/VIC_sample_data-master/classic/Stehekin/rout/input/fluxes_48.3125_-121.0625 NOT FOUND, INSERTING ZEROS
/vic/VIC_sample_data-master/classic/Stehekin/rout/input/fluxes_48.4375_-121.0625 NOT FOUND, INSERTING ZEROS16 files not found, zero runoff/baseflow used
writing data...
第一次报错,分析原因,vic跑出来的文件自带后缀.txt,所以需要把每个文件后缀删掉!(经验,直接看径流源代码 convention文件,发现问题)
[root@VM_0_15_centos input]# /VIC_Routing-Fortran_version/src/rout /vic/VIC_sample_data-master/classic/Stehekin/rout/rout_input.STEHE
NDAY = 1095 NMONTHS = 36
1 STEHE 35 139
Routing station: STEHE
searching catchment...
Number of grid cells upstream of present station 16
reading grid_UH...
making grid UH...
reading UH_S grid from file
making convolution...1 of 16 : /vic/VIC_sample_data-master/classic/Stehekin/rout/input/fluxes_48.3125_-120.5625
Error reading time-series data, insufficient data or missing input file/vic/VIC_sample_data-master/classic/Stehekin/rout/input/fluxes_48.3125_-120.5625
writing data...
这篇关于VIC运行笔记2019.05.01的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!