解决mozbc编译时的Failed to build fire_emis问题

构建mozbc工具的基本过程:

下载地址及安装教程链接:GitHub - fengx7/mozbc_for_WRFv3.9: Modify the WRF-Chem preprocessor tool (mozbc) to work with the hybrid sigma-pressure vertical coordinate introduced with WRF V3.9.

          mkdir /your/dir/mozbc
          cd /your/dir/mozbc
          tar -xvf mozbc_for_WRFv3.9.tar
          chmod 777 *
          ./make_mozbc

在最后一步./make_mozbc时报错,报错如下(此处省略了很多类似报错行):

/home/xiahui/Build_WRFGC/LIBRARIES/netcdf-fortran-4.5.2/fortran/nf_varaio.F90:978: undefined reference to `nc_inq_varndims'
/home/xiahui/Build_WRFGC/LIBRARIES/netcdf-fortran-4.5.2/fortran/nf_varaio.F90:995: undefined reference to `nc_get_vara_longlong'
/home/xiahui/Build_WRFGC/common/lib/libnetcdff.a(nf_varaio.o): In function `nf_get_vara_':
/home/xiahui/Build_WRFGC/LIBRARIES/netcdf-fortran-4.5.2/fortran/nf_varaio.F90:1032: undefined reference to `nc_inq_varndims'
/home/xiahui/Build_WRFGC/LIBRARIES/netcdf-fortran-4.5.2/fortran/nf_varaio.F90:1049: undefined reference to `nc_get_vara'
Makefile:41: recipe for target 'mozbc' failed
make: *** [mozbc] Error 1
Failed to build fire_emis

在网上搜索,找到了点思路

mozbc编译问题(WRF-CHEM模型初始气象场处理)-专业气象研究-气象家园_气象人自己的家园 (06climate.com)

气象家园网的一个博主提到了【AR_FILES】的变量,于是我们打开mozbc文件夹下的Makefile,查看内容

编译时的关键步骤是这几句

我们可以发现自己并没有设置AR_FILES的相关内容,或许有,我没仔细找,我在bash环境下设置了export AR_FILES =”-lnetcdff -lnetcdf”,希望能链接到netcdf库里。

但是在bash里设置后依然报错,猜测可能是没有修改真正的AR_FILES

因此,这里建议大家直接修改LIBS变量

LIBS   = -L/home/xiahui/Build_WRFGC/common/lib -lnetcdff -lnetcdf

如下图所示:

注意,-lnetcdff 和-lnetcdf的顺序也很重要,即链接哪个库的顺序很重要。

修改完后,再次运行,可以看到mozbc编译成功啦

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
2=> data matches source data except for minor deviation(s) veh_description='Sample vehicle file for ADVISOR'; % one line description of the vehicle veh_mfr='Generic'; % manufacturer's name veh_model='Sample Vehicle'; % vehicle model name veh_class='Small Car'; % EPA size class veh_year=2002; % model year veh_cold_tmp=20; % Cold engine temperature (C) veh_warm_tmp=95; % Warm engine temperature (C) veh_hot_tmp=105; % Hot engine temperature (C) veh_emis=[0 0 0 0 0 0 0 0 0 0]; % Vector of emissions index (g/mi) [HC CO NOx PM H2O N2O CO2 CH4 NMHC] veh_glider_mass=1000; % Vehicle mass w/o propulsion system (kg) veh_CD=0.32; % Coefficient of aerodynamic drag veh_FA=1.9; % Vehicle frontal area (m^2) veh_starter='Integr'; % Starter type ('Integr' or 'Standalone') veh_idle_spd=700; % Idle speed (rpm) veh_cargo_mass=0; % Cargo mass (kg) veh_passenger_mass=[75 0]; % Passenger mass (kg/person) [driver, passenger] veh_wheelbase=2.5; % Vehicle wheelbase (m) veh_track=1.5; % Vehicle track (m) veh_cargo_cp=[0 0.5 0]; % Cargo center of gravity (m) [X Y Z] veh_passenger_cp=[0.5 0.5 0]; % Passenger center of gravity (m) [X Y Z] veh_front_wt_frac=0.6; % Fraction of vehicle weight on front axle veh_rear_wt_frac=0.4; % Fraction of vehicle weight on rear axle veh_wheel_front_radius=0.3; % Front wheel radius (m) veh_wheel_rear_radius=0.3; % Rear wheel radius (m) veh_gear_ratio=[2.4 1.5 1 0.7 0.5]; % Gear ratios veh_gb_eff=[0.95 0.95 0.95 0.95 0.95]; % Gearbox efficiency veh_final_drive_ratio=3.5; % Final drive ratio veh_fd_eff=0.95; % Final drive efficiency veh_inertia=0; % Vehicle rotational inertia (kg-m^2) veh_acc_grade=0; % Vehicle acceleration grade (deg) veh_max_grade=10; % Maximum grade (deg) veh_road_load=[100 0 0 0]; % Road load coefficients [a b c d] (N) at 100 kph veh_tire='205/55R16'; % Tire size (example: '205/60R15') veh_num_of_pax=1; % Number of passengers in the vehicle veh_fuel_type='Gasoline'; % Fuel type (example: 'Diesel', 'Gasoline', 'Hybrid') veh_fuel_den=0.749; % Fuel density (kg/l) veh_fuel_lhv=43.0; % Fuel lower heating value (MJ/kg) veh_fuel_frac=[0.85 0.15 0 0 0 0 0 0 0 0]; % Fuel composition [C H O N S AR CO2 H2O N2 O2] (mass fraction) veh_fuel_tank=60; % Fuel tank capacity (l) veh_mech_brake=1; % Mechanical braking system (1=>yes, 0=>no) veh_regenerative_braking=1; % Regenerative braking system (1=>yes, 0=>no) veh_coolant_fluid='water'; % Engine coolant fluid type (example: 'water', 'ethylene glycol') veh_coolant_cap=3; % Engine coolant capacity (l) veh_oil_cap=4.3; % Engine oil capacity (l) veh_oil_type='SAE 5W-30'; % Engine oil type (example: 'SAE 5W-30') veh_oil_fluid='oil'; % Engine oil fluid type (example: 'oil', 'synth oil') veh_trans_fluid='oil'; % Transmission fluid type (example: 'oil', 'synth oil') veh_trans_cap=2.5; % Transmission fluid capacity (l) veh_clutch_type='Dry'; % Clutch type (example: 'Dry', 'Wet') veh_regen_brake_type='Electric'; % Regenerative braking type (example: 'Electric', 'Hydraulic')

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值