WRF compile errors

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Maplematics/article/details/50642580

The errors met in WRF/Chem compile process and solution.

Error 1:
Situation: ./compile em_real
Error: wrf_io.f:(.text 0x16a2): undefined reference to `nf_inq_varid_’

Solution: vim configure.wrf
change the line

LIB_EXTERNAL    = \
                     $(WRF_SRC_ROOT_DIR)/external/io_netcdf/libwrfio_nf.a -L/home/kfu/netcdf/lib  -lnetcdff -lnetcdf

to

LIB_EXTERNAL    = \
                     $(WRF_SRC_ROOT_DIR)/external/io_netcdf/libwrfio_nf.a -L/home/kfu/netcdf/lib  -lnetcdf

Another solution:
Check if the NETCDFPATH in configure.wrf is right or not:

NETCDFPATH      =    /usr/intel/netcdf/

Error 2
ifort catastrophic error **internal compiler error segmentation violation signal raised**

Solution
Change to the directory where the compile error file locates, and run the compile command in the compile.log file with replacement of -O3 by -O2.
Ref: https://software.intel.com/en-us/forums/intel-fortran-compiler-for-linux-and-mac-os-x/topic/559320
“It fails on the -O3 optimization, run the compile using -O3 and then change to -O2 in configure.wrf and compile the rest with that. Or update your compiler.”

Error 3
ver 3.5.1 WRF/Chem and ver 3.5.1 wps

real.exe

I am using GFS input data and am getting the following error:
----------------- ERROR -------------------

> namelist : num_metgrid_soil_levels = 4
> input files : NUM_METGRID_SOIL_LEVELS = 0 (from met_em files).
> -------------- FATAL CALLED ---------------
> FATAL CALLED FROM FILE: LINE: 695
> Mismatch between namelist and global attribute NUM_METGRID_SOIL_LEVELS
> -------------------------------------------

A3: Refer to
http://www2.mmm.ucar.edu/wrf/users/FAQ_files/FAQ_wrf_runtime.html

If you are using GFS initial conditions with WRFV3.6.1 or earlier, and with a start date of January 7, 2015 or later, then you will need to use a new Vtable, as GFS updated all of their data beginning 1/7/15. You can find the updated Vtable here. For additional information regarding the update to GFS data, click here.

You will need to copy this Vtable into your WPS/ungrib/Variable_Tables/ directory, and call it Vtable.GFS (this will overwrite your previous GFS Vtable). After that, you need to go back to the WPS/ directory and re-run ungrib.exe. Before running ungrib.exe, you will need to link-in the new Vtable:

ln -sf ungrib/Variable_Tables/Vtable.GFS Vtable

Once you are certain the ‘Vtable’ file in your WPS/ directory is the NEW Vtable.GFS, you can run ungrib.exe, then metgrid.exe, and then go to the WRFV3/ directory, link-in your met_em* files and run real.exe. You can verify that you have 4 soil levels in your met_em* files by issuing the command:

ncdump -h met_em.d01*
where ‘*’ represents only one of your met_em files

You should see the category (toward the bottom) NUM_METGRID_SOIL_LEVELS = 4.

After download the new Vtable_GFS file, and put it in the WPS ungrid Vtable directory, there still some problem. Check the original and new Vtable files, we can figure that there are four lines that affect the NUM_METGRID_SOIL_LEVELS:

扫描二维码关注公众号,回复: 5314022 查看本文章
  85 | 112  |   0  |  10  | ST000010 | K       | T 0-10 cm below ground layer (Upper)    |  2  |  0  |  2  | 106 |
  85 | 112  |  10  |  40  | ST010040 | K       | T 10-40 cm below ground layer (Upper)   |  2  |  0  |  2  | 106 |
  85 | 112  |  40  | 100  | ST040100 | K       | T 40-100 cm below ground layer (Upper)  |  2  |  0  |  2  | 106 |
  85 | 112  | 100  | 200  | ST100200 | K       | T 100-200 cm below ground layer (Bottom)|  2  |  0  |  2  | 106 |

Put these four lines in the original Vtable before the line

  11 | 112  |  10  | 200  | ST010200 | K       | T 10-200 cm below ground layer (Bottom) |  0  |  0  |  0  | 106 |

And run real.exe, problem solved.

猜你喜欢

转载自blog.csdn.net/Maplematics/article/details/50642580