WRF配置

Ubuntu中配置WRF 01

小白一枚,从未接触过linux与WRF,跟着视频
http://player.bilibili.com/player.html?aid=24466296&bvid=BV1hW411A7K6&cid=41081613&page=1好不容易安装了WRF,怕自己忘记,立贴为证,大家勿喷。
内容比较多,适合初学者
这是我的Ubuntu版本,我用的VMware虚拟机装的

1.安装csh,gfortran,m4和build-essential

sudo apt-get install csh gfortran m4 build-essential

Ubuntu "E: Unable to locate package"错误解决办法:
Unable to locate package:无法找到包。解决办法:执行命令:sudo apt-get update更新一下apt-get

Linux sudo命令以系统管理者的身份执行指令,也就是说,经由 sudo 所执行的指令就好像是 root 亲自执行。
使用权限:在 /etc/sudoers 中有出现的使用者。

2.system environment test

it is very important to have a gfortran compiler,as well as gcc and cpp.
if you have these installed ,you should be given a path for the location of each.

which [文件...]

Linux which命令用于查找文件。
which指令会在环境变量$PATH设置的目录里查找符合条件的文件。

3.check your gcc version. it is recommend using version 4.4.0 or later.

gcc —version

检查gcc的版本号

4.Create a new , clean directory called Build_WRF, and another one called TESTS

mkdir Build_WRF TESTS

Linux mkdir(英文全拼:make directory)命令用于创建目录。

5.Download the tar file that contains the test into the TESTS directory and unpack the tar file.
the tar file can be found at:
Fortran_C_tests.tar

cd TESTS

Linux cd(英文全拼:change directory)命令用于切换当前工作目录。
其中 dirName 表示法可为绝对路径或相对路径。若目录名称省略,则变换至使用者的 home 目录 (也就是刚 login 时所在的目录)。
另外,~ 也表示为 home 目录 的意思, . 则是表示目前所在的目录, … 则表示目前目录位置的上一层目录。

wget http://www2.mmm.ucar.edu/wrf/OnLineTutorial/compile_tutorial/tar_files/Fortran_C_tests.tar

使用wget从网上下载软件、音乐、视频
$ wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.2.1.tar.gz
下载文件并以指定的文件名保存文件
$ wget -O taglist.zip http://www.vim.org/scripts/download_script.php?src_id=7701

在TESTS文件夹下解压Fortran_C_tests.tar文件

tar -xvf Fortran_C_tests.tar


there are 7 tests available,so start at the top and run through them,one at a time.

test1 :Fixed format fortran test.

xiaomo@ubuntu:~/TESTS$ gfortran TEST_1_fortran_only_fixed.f
xiaomo@ubuntu:~/TESTS$ ./a.outSUCCESS test 1 fortran only fixed format

test2 :Free format fortran

xiaomo@ubuntu:~/TESTS$ gfortran TEST_2_fortran_only_free.f90
xiaomo@ubuntu:~/TESTS$ ./a.outAssume Fortran 2003: has FLUSH, ALLOCATABLE derived type, and ISO C BindingSUCCESS test 2 fortran only free format

test2 :C.

xiaomo@ubuntu:~/TESTS$ gcc TEST_3_c_only.c
xiaomo@ubuntu:~/TESTS$ ./a.out
SUCCESS test 3 C only

test4:Fortran calling a C function (the gcc and gfortran have different defaults, so is necessary to force both to always use 64 bit [-m64]when combining them).

xiaomo@ubuntu:~/TESTS$ gcc -c -m64 TEST_4_fortran+c_c.c
xiaomo@ubuntu:~/TESTS$ gfortran -c -m64 TEST_4_fortran+c_f.f90
xiaomo@ubuntu:~/TESTS$ gfortran -m64 TEST_4_fortran+c_f.o TEST_4_fortran+c_c.o
xiaomo@ubuntu:~/TESTS$ ./a.outC function called by FortranValues are xx =  2.00 and ii = 1SUCCESS test 4 fortran calling c

test5:Csh

xiaomo@ubuntu:~/TESTS$ csh TEST_csh.csh
SUCCESS csh test

test6:perl.

xiaomo@ubuntu:~/TESTS$ ./TEST_perl.pl
SUCCESS perl test

test7:sh

xiaomo@ubuntu:~/TESTS$ ./TEST_sh.sh
SUCCESS sh test
cd ..
#退回原来的目录下


Ubuntu中配置WRF 02

http://player.bilibili.com/player.html?aid=24466296&bvid=BV1hW411A7K6&cid=41081640&page=2

1.Building Libraries

Before getting started, you need to make another directory. Goinside your Build_WRF directory called LIBRARIES.

ls -ltr

Linux ls(英文全拼:list files)命令用于显示指定工作目录下之内容(列出目前工作目录所含之文件及子目录)。

xiaomo@ubuntu:~$ cd Build_WRF/
xiaomo@ubuntu:~/Build_WRF$ mkdir LIBRARIES

2.Depending on the type of run you wish to make, there are various libraries that should be installed. Go inside your LIBRARIES directory and then download all 5 tar files.
根据您希望进行的运行类型,应安装各种库。进入LIBRARIES目录,然后下载所有5个tar文件。

这里有一个问题,就是网站有时候进不去,倒霉的我就没进去,可以找运气好的时候进去把这些包下载下来,放到那个文件夹再直接解压就可以了

Mpich library.
The tar file can be found at:
mpich-3.0.4.tar.gz

xiaomo@ubuntu:~/Build_WRF$ cd LIBRARIES
xiaomo@ubuntu:~/Build_WRF/LIBRARIES$
wget http://www2.mmm.ucar.edu/wrf/OnlineTutorial/compile_tutorial/tar_files/mpich-3.0.4.tar.gz

Netcdf library.
The tar file can be found at:
netcdf-4.1.3.tar.gz

wget http://www2.mmm.ucar.edu/wrf/OnlineTutorial/compile_tutorial/tar_files/netcdf-4.1.3.tar.gz

Jasper library.
The tar file can be found at:
jasper-1.900.1.tar.gz

wget http://www2.mmm.ucar.edu/wrf/OnlineTutorial/compile_tutorial/tar_files/jasper-1.900.1.tar.gz

libpng library.
The tar file can be found at:
libpng-1.2.50.tar.gz

wget http://www2.mmm.ucar.edu/wrf/OnlineTutorial/compile_tutorial/tar_files/libpng-1.2.50.tar.gz

Zlib library.
The tar file can be found at:
zlib-1.2.7.tar.gz

wget http://www2.mmm.ucar.edu/wrf/OnlineTutorial/compile_tutorial/tar_files/zlib-1.2.7.tar.gz

it is important to note that these libraries must all be installed with the same compilers as will be used to install WRF and WPS.

Configuring NetCDF library: this library is always necessary!
Modify the .bashrc file in the home directory of current user to set the environment variables.

sudo nano ~/.bashrc

At the bottom of the .bashrc file add these lines so that they will be set for future logins

# WRF environment variables
export DIR=/home/xiaomo/Build_WRF/LIBRARIES这里添自己的位置
export CC=gcc
export CXX=g++
export FC=gfortran
export CFLAGS=-m64
export F77=gfortran
export FFLAGS=-m64

linux怎么退出nano
1,如果你要保存所做的修改,按下Ctrl+O。
2,想要退出,按下Ctrl+X。
3,如果你退出前没有保存所做的修改,它会提示你是否要保存;
如果不要,请按N,反之,则按Y;
然后它会让你确认要保存的文件名,确认或修改后按Enter即可
拓展资料
1,Linux操作系统,是一种计算机操作系统,中文读法大致一般为“哩内克斯”,但真正的读法应为“哩纳克斯”。
2,Linux操作系统的内核的名字也是“Linux”;Linux操作系统也是自由软件和开放源代码发展中最著名的例子。

Then source the .bashrc file to make these settings active for current session.

source ~/.bashrc

Unpack the netcdf-4.1.3.tar.gz file.

tar -zxvf netcdf-4.1.3.tar.gz

Go inside the netcdf-4.1.3d directory and run the configure script with the parameters presented,then run make and make install.
进入netcdf-4.1.3d目录,并使用显示的参数运行configure脚本,然后运行make和make install。

xiaomo@ubuntu:~/Build_WRF/LIBRARIES$ cd netcdf-4.1.3/
xiaomo@ubuntu:~/Build_WRF/LIBRARIES/netcdf-4.1.3$ ./configure --prefix=$DIR/netcdf --disable-dap --disable-netcdf-4 --disable-shared
make
make install

Modify again the .bashrc file and set two new environment variables at the bottom. The source the file to make these settings active for current session.
再次修改.bashrc文件,并在底部设置两个新的环境变量

xiaomo@ubuntu:~/Build_WRF/LIBRARIES/netcdf-4.1.3$ sudo nano ~/.bashrc
在打开窗口输入:export PATH=$DIR/netcdf/bin:$PATHexport NETCDF=$DIR/netcdf
xiaomo@ubuntu:~/Build_WRF/LIBRARIES/netcdf-4.1.3$ source ~/.bashrc
xiaomo@ubuntu:~/Build_WRF/LIBRARIES/netcdf-4.1.3$ cd ..
xiaomo@ubuntu:~/Build_WRF/LIBRARIES$

Configuring MPICH library:This library is necessary if you are planning to build WRF in parallel.If your machine does not have more than 1 procssor, or if you have noneed to run WRF with multipleprocessors, you can skip installing MPICH.
配置MPICH库:如果您打算并行构建WRF,则此库是必需的。如果您的计算机没有多个处理器,或者如果您不希望使用多个处理器运行WRF,则可以跳过安装MPICH。

Assuming all the “export” commands were already issured while setting up NetCDF,you can continue on to install MPICH,issuing each of the following commands.
假设在设置NetCDF时已经确保了所有“导出”命令,则可以继续执行MPICH,并发出以下每个命令。

tar -zxvf mpich-3.0.4.tar.gz
cd mpich-3.0.4/
./configure --prefix=$DIR/mpich
make
make install
sudo nano ~/.bashrc
在打开窗口输入:export PATH=$DIR/mpich/bin:$PATH
xiaomo@ubuntu:~/Build_WRF/LIBRARIES/mpich-3.0.4$ source ~/.bashrc
xiaomo@ubuntu:~/Build_WRF/LIBRARIES/mpich-3.0.4$ cd ..
xiaomo@ubuntu:~/Build_WRF/LIBRARIES$

Configuring zlib: This is a compression library necessary for compiling WPS (specifically ungrib)with GRIB2 capability.
配置zlib:这是编译具有GRIB2功能的WPS(特别是ungrib)所必需的压缩库。

Assuming all the “export” commands from the NetCDF install are already set,you can move on to to the commands to install zlib.
假设已经设置了NetCDF安装中的所有“导出”命令,则可以继续执行安装zlib的命令。

sudo nano ~/.bashrc
在打开窗口输入:export LDFLAGS=-L$DIR/grib2/libexport CPPFLAGS=-I$DIR/grib2/include
source ~/.bashrc
tar -zxvf zlib-1.2.7.tar.gz
cd zlib-1.2.7/
./configure --prefix=$DIR/grib2
make
make install
cd ..

Configuring libpng:This is a compression library necessary for compiling WPS (specifically ungrib)with GRIB2 capability.
配置libpng:这是使用GRIB2功能编译WPS(特别是ungrib)所必需的压缩库。

Assuming all the “export” commands from the NetCDF install are already set,you can move on to to the commands to install libpng.
假设已经设置了NetCDF安装中的所有“导出”命令,则可以转到安装libpng的命令。

tar -zxvf libpng-1.2.50.tar.gz
cd libpng-1.2.50/
./configure --prefix=$DIR/grib2
make
make install
cd ..

Configuring JasPer:This is a compression library necessary for compiling WPS (specifically ungrib)with GRIB2 capability.
配置JasPer:这是使用GRIB2功能编译WPS(特别是ungrib)所必需的压缩库。

Assuming all the “export” commands from the NetCDF install are already set, you can move on to to the commands to install jasper.
假定已经设置了NetCDF安装中的所有“导出”命令,则可以继续执行安装jasper的命令。

tar -zxvf jasper-1.900.1.tar.gz
cd jasper-1.900.1/
./configure --prefix=$DIR/grib2
make
make install
cd ..


Ubuntu中配置WRF 03

1.Libraries compatibility tests

Once the target machine is able to make small Fortran and C executables(what was verified in the System Environment Tests video),and after the NetCDF and MPI libraries section),to emulate the WRF code’s behavior ,two additional small tests are required. It is necessery to verify that the libraries are able to work with the compilers that are to be used for the WPS and WRF builds.

必须验证这些库是否能够与将用于WPS和WRF构建的编译器一起使用。

Move to TESTS directory, download the tar file that contans these tests and unpack it.
移至TESTS目录,下载包含这些测试的tar文件并将其解压缩。
The tar file can be found at:
Fortran_C_NETCDF_MPI_tests.tar

注意:还是提前下好放到TESTS文件夹里面进行下一步解压操作。

cd TESTS/
tar -xvf Fortran_C_NETCDF_MPI_tests.tar

There are 2 tests.

Test 1: Fortran + C + NetCDF

The NetCDF-only test requires the include file from the NetCDF package be in this directory. Copy the NetCDF include here and compile the Fortran and C codes for the purpose of this test(the -c option says to not try to build an executable).
仅限NetCDF的测试要求NetCDF软件包中的include文件位于此目录中。
为此复制NetCDF include并编译Fortran和C代码(此-c选项表示不要尝试生成可执行文件)。

xiaomo@ubuntu:~/TESTS$ cp ${NETCDF}/include/netcdf.inc .
xiaomo@ubuntu:~/TESTS$ gfortran -c 01_fortran+c+netcdf_f.f
xiaomo@ubuntu:~/TESTS$ gcc -c 01_fortran+c+netcdf_c.c
xiaomo@ubuntu:~/TESTS$ gfortran 01_fortran+c+netcdf_f.o 01_fortran+c+netcdf_c.o -L${NETCDF}/lib -lnetcdff -lnetcdf
xiaomo@ubuntu:~/TESTS$ ./a.outC function called by FortranValues are xx =  2.00 and ii = 1 SUCCESS test 1 fortran + c + netcdf

Linux cp(英文全拼:copy file)命令主要用于复制文件或目录。

Test 2: Fortran + C + NetCDF + MPI

The NetCDF+MPI test requires include files from both of these packages be in this directory, but the MPI scripts automatically make the mpif.h file available without assistance, so no need to copy that one. Copy the netCDF include file here and note that the MPI executables mpif90 and mpicc are used when compiling. Issure the following commands:
NetCDF + MPI测试要求将这两个软件包中的包含文件都放在此目录中,但是MPI脚本无需帮助即可自动使mpif.h文件可用,因此无需复制该文件。
在此处复制netCDF包含文件,并注意在编译时会使用MPI可执行文件mpif90和mpicc。
发出以下命令:

xiaomo@ubuntu:~/TESTS$ cp ${NETCDF}/include/netcdf.inc .
xiaomo@ubuntu:~/TESTS$ mpif90 -c 02_fortran+c+netcdf+mpi_f.f
xiaomo@ubuntu:~/TESTS$ mpicc -c 02_fortran+c+netcdf+mpi_c.c
xiaomo@ubuntu:~/TESTS$ mpif90 02_fortran+c+netcdf+mpi_f.o 02_fortran+c+netcdf+mpi_c.o -L${NETCDF}/lib -lnetcdff -lnetcdf
xiaomo@ubuntu:~/TESTS$ mpirun ./a.outC function called by FortranValues are xx =  2.00 and ii = 1 status =            2SUCCESS test 2 fortran + c + netcdf + mpi


Ubuntu中配置WRF 04-Building WRF

(视频里面这个旧版运行不太行,我装的WRF4.0)

1.Building WRF

After ensuring that all libraries are compatible with the compilers you can now prepare to build WRF.If you do not already have a WRF tar file, move to your Build_WRF directory, download that file and unpack it. Then go into the WRF directory and create a configuration file for your computer and compiler.
确保所有库与编译器兼容后,您现在可以准备构建WRF。如果您还没有WRF tar文件,请移至Build_WRF目录,下载该文件并解压缩。
然后进入WRF目录并为您的计算机和编译器创建一个配置文件。

The tar file can be found at:
WRFV4.0.TAR.gz

cd Build_WRF

把包下载好直接放到Build_WRF文件夹里面,就不wget了

tar -zxvf WRFV4.0.TAR.gz
***#(小技巧,文件名不需要输全,输入头几个字母,按下Tab键,会自动补齐)***
xiaomo@ubuntu:~/Build_WRF$ cd WRF/
xiaomo@ubuntu:~/Build_WRF/WRF$ ./configure
checking for perl5... no
checking for perl... found /usr/bin/perl (perl)
Will use NETCDF in dir: /home/lmc/Build_WRF/LIBRARIES/netcdf
HDF5 not set in environment. Will configure WRF for use without.
PHDF5 not set in environment. Will configure WRF for use without.
Will use 'time' to report timing information
$JASPERLIB or $JASPERINC not found in environment, configuring to build without grib2 I/O...
------------------------------------------------------------------------
Please select from among the following Linux x86_64 options:1. (serial)   2. (smpar)   3. (dmpar)   4. (dm+sm)   PGI (pgf90/gcc)5. (serial)   6. (smpar)   7. (dmpar)   8. (dm+sm)   PGI (pgf90/pgcc): SGI MPT9. (serial)  10. (smpar)  11. (dmpar)  12. (dm+sm)   PGI (pgf90/gcc): PGI accelerator13. (serial)  14. (smpar)  15. (dmpar)  16. (dm+sm)   INTEL (ifort/icc)17. (dm+sm)   INTEL (ifort/icc): Xeon Phi (MIC architecture)18. (serial)  19. (smpar)  20. (dmpar)  21. (dm+sm)   INTEL (ifort/icc): Xeon (SNB with AVX mods)22. (serial)  23. (smpar)  24. (dmpar)  25. (dm+sm)   INTEL (ifort/icc): SGI MPT26. (serial)  27. (smpar)  28. (dmpar)  29. (dm+sm)   INTEL (ifort/icc): IBM POE30. (serial)               31. (dmpar)                PATHSCALE (pathf90/pathcc)32. (serial)  33. (smpar)  34. (dmpar)  35. (dm+sm)   GNU (gfortran/gcc)36. (serial)  37. (smpar)  38. (dmpar)  39. (dm+sm)   IBM (xlf90_r/cc_r)40. (serial)  41. (smpar)  42. (dmpar)  43. (dm+sm)   PGI (ftn/gcc): Cray XC CLE44. (serial)  45. (smpar)  46. (dmpar)  47. (dm+sm)   CRAY CCE (ftn/cc): Cray XE and XC48. (serial)  49. (smpar)  50. (dmpar)  51. (dm+sm)   INTEL (ftn/icc): Cray XC52. (serial)  53. (smpar)  54. (dmpar)  55. (dm+sm)   PGI (pgf90/pgcc)56. (serial)  57. (smpar)  58. (dmpar)  59. (dm+sm)   PGI (pgf90/gcc): -f90=pgf9060. (serial)  61. (smpar)  62. (dmpar)  63. (dm+sm)   PGI (pgf90/pgcc): -f90=pgf9064. (serial)  65. (smpar)  66. (dmpar)  67. (dm+sm)   INTEL (ifort/icc): HSW/BDW68. (serial)  69. (smpar)  70. (dmpar)  71. (dm+sm)   INTEL (ifort/icc): KNL MICEnter selection [1-71] :

you will see various options. choose the option that lists the compiler you are using and the way you wish to build WRFV3 (i.e.,serially or in parallel).Although there are 3 different types of parallel(smpar, dmpar,and dm+sm),it is recommend choosing dmpar option.
您将看到各种选项。选择列出正在使用的编译器的选项以及构建WRFV3的方式(即串行或并行)。尽管有3种不同类型的并行(smpar,dmpar和dm+sm),建议选择dmpar选项。

即在32. (serial) 33. (smpar) 34. (dmpar) 35. (dm+sm) GNU (gfortran/gcc)中选一个

关于每个选项介绍:

每一个选项的前半部分通常是在描述编译器与运行环境,根据计算机实际情况选择即可。后半部分是并行选项:
serial 表示串行计算;
smpar 表示内存共享并行计算(shared memory option),即使用openMP,大部分多核电脑都支持这项功能;
dmpar 表示分布式并行计算(distributed memory option),即使用MPI 进行并行计算,主要用在计算集群,单个电脑就没必要用了;
dm+sm 表示同时使用openMP与MPI两种并行方式. 根据实际需要选择即可,最保险的方法就是选择 serial,不过这样编译出来的程序运行最慢

选择完编译选项后,会出现提示选择嵌套选项,一般就选 basic 选项即可:1

Enter selection [1-71] : 32
------------------------------------------------------------------------
Compile for nesting? (1=basic, 2=preset moves, 3=vortex following) [default 1]: 1Configuration successful!

Once your configuration is complete,you should have a configure.wrf file,and you are ready to compile. In order to compile WRF, you will need to decide which type of case you wish to compile.
配置完成后,您应该具有configure.wrf文件,并且可以进行编译了。为了编译WRF,您将需要确定要编译的案例类型。

The option are:选项是:
em_real(3d real case),em_quarter_ss(3d ideal case),
em_b_wav(3d ideal case),em_les(3d ideal case),
em_heldsuarez(3d ideal case),
em_tropical_cyclone(3d ideal case),
em_hill2d_x(2d ideal case),em_squall2d_x(2d ideal case),
em_squall2d_y(2d ideal case),em_grav2d_x(2d ideal case),
em_seabreeze2d_x(2d ideal case),
em_scm_xy(1d ideal case).

For this purpose we are going to compile WRF for real cases. Compilation should take about 20-30 minutes. The ongoing compilation can be checked.
为此,我们将针对实际案例编译WRF。编译大约需要20-30分钟。正在进行的编译可以检查。

./compile em_real >& compile.log &
tail -f compile.log

最后编译结果如下

build started:   2021年 01月 02日 星期六 15:09:36 CST
build completed: 2021年 01月 02日 星期六 15:23:20 CST--->                  Executables successfully built                  <----rwxrwxr-x 1 xiaomo xiaomo 42403576 1月   2 15:23 main/ndown.exe
-rwxrwxr-x 1 xiaomo xiaomo 42276504 1月   2 15:23 main/real.exe
-rwxrwxr-x 1 xiaomo xiaomo 41781344 1月   2 15:23 main/tc.exe
-rwxrwxr-x 1 xiaomo xiaomo 46018680 1月   2 15:22 main/wrf.exe

运行到这里会卡住,如果成功了,在~/Build_WRF/WRF/main文件夹里有wrf.exe文件,看一下关闭终端然后接着做:

Once the compilation completes, to check whether it was sussessful, you need to look for executables in the WRF/main directory.
编译完成后,要检查编译是否成功,需要在WRF/ main目录中查找可执行文件。

These executables are linked to 2 different directories. You can choose to run WRF from either directory.这些可执行文件链接到2个不同的目录。 您可以选择从任一目录运行WRF。
WRF/run 和 WRF/test/em_real



Ubuntu中配置WRF 05-Building WPS

Building WPS

After the WRF model is built, the next step is building the WPS program (if you plan to run real case, as opposed to idealized cases).The WRF model MUST be properly built prior to trying to build the WPS programs.
构建WRF模型之后,下一步是构建WPS程序(如果您打算运行实际案例而不是理想案例)。在尝试构建WPS程序之前必须正确构建WRF模型。

If you do not already have the WPS source code, move to your Build_WRF directory, downloadthat file and unpack it. Then go into the WPS directory and make sure the WPS directory is clean.
如果您还没有WPS源代码,请移至Build_WRF目录,下载该文件并解压缩。 然后进入WPS目录,并确保WPS目录是干净的。
The tar file can be found at:

WPSV4.1.TAR.gz

不wget了,下载好放到Build_WRF文件夹里面

cd Build_WRF/
tar -zxvf WPS-4.1.tar.gz
cd WPS-4.1
./clean

The next step is to configure WPS, however, you first need to set some paths for the ungrib libraries and then you can configure.
下一步是配置WPS,但是,您首先需要为ungrib库设置一些路径,然后才能进行配置。

sudo nano ~/.bashrc

输入以下

export JASPERLIB=$DIR/grib2/lib
export JASPERINC=$DIR/grib2/include
xiaomo@ubuntu:~/Build_WRF/WPS$ source ~/.bashrc
xiaomo@ubuntu:~/Build_WRF/WPS$ ./configure
Will use NETCDF in dir: /home/lmc/Build_WRF/LIBRARIES/netcdf
Found Jasper environment variables for GRIB2 support...$JASPERLIB = /home/xiaomo/Build_WRF/LIBRARIES/grib2/lib$JASPERINC = /home/xiaomo/Build_WRF/LIBRARIES/grib2/include
------------------------------------------------------------------------
Please select from among the following supported platforms.1.  Linux x86_64, gfortran    (serial)2.  Linux x86_64, gfortran    (serial_NO_GRIB2)3.  Linux x86_64, gfortran    (dmpar)4.  Linux x86_64, gfortran    (dmpar_NO_GRIB2)5.  Linux x86_64, PGI compiler   (serial)6.  Linux x86_64, PGI compiler   (serial_NO_GRIB2)7.  Linux x86_64, PGI compiler   (dmpar)8.  Linux x86_64, PGI compiler   (dmpar_NO_GRIB2)9.  Linux x86_64, PGI compiler, SGI MPT   (serial)10.  Linux x86_64, PGI compiler, SGI MPT   (serial_NO_GRIB2)11.  Linux x86_64, PGI compiler, SGI MPT   (dmpar)12.  Linux x86_64, PGI compiler, SGI MPT   (dmpar_NO_GRIB2)13.  Linux x86_64, IA64 and Opteron    (serial)14.  Linux x86_64, IA64 and Opteron    (serial_NO_GRIB2)15.  Linux x86_64, IA64 and Opteron    (dmpar)16.  Linux x86_64, IA64 and Opteron    (dmpar_NO_GRIB2)17.  Linux x86_64, Intel compiler    (serial)18.  Linux x86_64, Intel compiler    (serial_NO_GRIB2)19.  Linux x86_64, Intel compiler    (dmpar)20.  Linux x86_64, Intel compiler    (dmpar_NO_GRIB2)21.  Linux x86_64, Intel compiler, SGI MPT    (serial)22.  Linux x86_64, Intel compiler, SGI MPT    (serial_NO_GRIB2)23.  Linux x86_64, Intel compiler, SGI MPT    (dmpar)24.  Linux x86_64, Intel compiler, SGI MPT    (dmpar_NO_GRIB2)25.  Linux x86_64, Intel compiler, IBM POE    (serial)26.  Linux x86_64, Intel compiler, IBM POE    (serial_NO_GRIB2)27.  Linux x86_64, Intel compiler, IBM POE    (dmpar)28.  Linux x86_64, Intel compiler, IBM POE    (dmpar_NO_GRIB2)29.  Linux x86_64 g95 compiler     (serial)30.  Linux x86_64 g95 compiler     (serial_NO_GRIB2)31.  Linux x86_64 g95 compiler     (dmpar)32.  Linux x86_64 g95 compiler     (dmpar_NO_GRIB2)33.  Cray XE/XC CLE/Linux x86_64, Cray compiler   (serial)34.  Cray XE/XC CLE/Linux x86_64, Cray compiler   (serial_NO_GRIB2)35.  Cray XE/XC CLE/Linux x86_64, Cray compiler   (dmpar)36.  Cray XE/XC CLE/Linux x86_64, Cray compiler   (dmpar_NO_GRIB2)37.  Cray XC CLE/Linux x86_64, Intel compiler   (serial)38.  Cray XC CLE/Linux x86_64, Intel compiler   (serial_NO_GRIB2)39.  Cray XC CLE/Linux x86_64, Intel compiler   (dmpar)40.  Cray XC CLE/Linux x86_64, Intel compiler   (dmpar_NO_GRIB2)Enter selection [1-40] :

You should be given a list of various options for compiler types,whether to compile in serial or parallel,and whether to compile ungrib with GRIB2 capability.Unless you plan to creat extremely large domains,it is recommended to compile WPS in serial mode, regardless of whether you compiled WRFV3 inparallel.
为您提供有关编译器类型的各种选项的列表,无论是串行还是并行编译,以及是否使用GRIB2功能进行编译。除非计划创建极大的域,否则建议以串行方式编译WPS,无论是否并行编译WRFV3。

It is also recommended that you choose a GRIB2 option (make sure you do not choose one that states NO_GRIB2).You may choose a non-grib2 option, but most data is now in grib2 format, so it is best to choose this option.You can still run grib1 data when you have built with grib2.
还建议您选择一个GRIB2选项(确保不要选择一个表示NO_GRIB2的选项)。您可以选择一个非grib2选项,但是现在大多数数据都是grib2格式,因此最好选择此选项。 使用grib2构建后,您仍然可以运行grib1数据。

Choose the option that lists a compiler to match what you used to compile WRFV3,serial,and grib2.
Note: The option number will likely be different than the number you chose to compile WRFV3.

选择列出了编译器的选项,以匹配您用来编译WRF,serial和grib2的选项。

注意:选项号可能与您选择的WRFV3编译号不同。

Enter selection [1-40] : 1
------------------------------------------------------------------------
Configuration successful. To build the WPS, type: compile
------------------------------------------------------------------------Testing for NetCDF, C and Fortran compilerThis installation NetCDF is 64-bit
C compiler is 64-bit
Fortran compiler is 64-bit

The metgrid.exe and geogrid.exe programs rely on the configure.wps file that directs the WPS build system to the location of the I/O libraries from the WRF modle : WRF_DIR = …/WRFV3
metgrid.exe和geogrid.exe程序依赖于configure.wps文件,该文件将WPS构建系统从WRF模型引导到I / O库的位置:WRF_DIR = …/WRFV3

sudo nano configure.wps

Above is the default setting. As long as the name of the WRF model’s top-level directory is WRF and the WPS and WRF directories are at the same level(which they should be if you have followed exactly as instructed on this page so far),then the exising default setting is correct and there is no need to change it.上面是默认设置。 只要WRF模型的顶级目录的名称是WRF,并且WPS和WRF目录处于同一级别(如果您到目前为止完全按照此页面上的说明进行操作,则应该是同一级别),然后使用现有的默认设置是正确的,不需要更改它。

If it is not correct,you must modify the configure file and then save the changes before compiling.
如果不正确,则必须修改配置文件,然后保存更改,然后再进行编译。

You can now compile WPS. The compilation should take a few minutes. The ongoing compilatiion can be checked.
您现在可以编译WPS。编译应花费几分钟。正在进行的编译可以检查。

xiaomo@ubuntu:~/Build_WRF/WPS-4.1$ ./compile >& compile.log &
[1] 19929
xiaomo@ubuntu:~/Build_WRF/WPS-4.1$ tail -f compile.log
#...运行一大堆截取最后一部分如下:
make[1]: Leaving directory '/home/xiaomo/Build_WRF/WPS-4.1/util/src'
if [ -h int2nc.exe ] ; then \/bin/rm -f int2nc.exe ; \
fi ; \
if [ -h ../int2nc.exe ] ; then \/bin/rm -f ../int2nc.exe ; \
fi ; \
if [ -e src/int2nc.exe ] ; then \ln -sf src/int2nc.exe . ; \
fi
#运行到这里卡住,按Ctrl+C键结束进程:
^C
[1]+  Done                    ./compile &> compile.log
xiaomo@ubuntu:~/Build_WRF/WPS-4.1$ ls -las *.exe
0 lrwxrwxrwx 1 xiaomo xiaomo 23 Jan  5 17:39 geogrid.exe -> geogrid/src/geogrid.exe
0 lrwxrwxrwx 1 xiaomo xiaomo 23 Jan  5 17:39 metgrid.exe -> metgrid/src/metgrid.exe
0 lrwxrwxrwx 1 xiaomo xiaomo 21 Jan  5 17:39 ungrib.exe -> ungrib/src/ungrib.exe

Once the compilation completes, to check whether it was successful, you need to look for 3 main executables in the WPS top-level directory.Then verify that they are not zero-sized.
编译完成后,要检查编译是否成功,需要在WPS顶级目录中查找3个主要的可执行文件,然后确认它们的大小不为零。

ls -las *.exe
xiaomo@ubuntu:~/Build_WRF/WPS-4.1$ ls -las *.exe
0 lrwxrwxrwx 1 xiaomo xiaomo 23 Jan  5 17:39 geogrid.exe -> geogrid/src/geogrid.exe
0 lrwxrwxrwx 1 xiaomo xiaomo 23 Jan  5 17:39 metgrid.exe -> metgrid/src/metgrid.exe
0 lrwxrwxrwx 1 xiaomo xiaomo 21 Jan  5 17:39 ungrib.exe -> ungrib/src/ungrib.exe

三个文件都出来,且不是红色如下:



Ubuntu中配置WRF 06-Static geography data

Static geography data

The WRF modeling system is able to create idealized simulations, though most users are interested inthe real-data cases. to initiate a real-data case, the domain’s physical location on the globe and the static information for that location must be created.
WRF建模系统能够创建理想的模拟,尽管大多数用户对实际数据案例感兴趣。 要启动实际数据案例,必须创建域在地球上的物理位置以及该位置的静态信息。

This requires a data set that includes such fields as topography and land use catagories. Move to your Build_WRF directory,download the file and unpack it. When you unpack the file, it will be called “geog” rename the to “WPS_GEOG”.
这需要一个数据集,其中包括地形和土地用途分类等字段。 移至Build_WRF目录,下载文件并解压缩。 解压缩文件时,它将被称为“ geog”,将其重命名为“ WPS_GEOG”。
The tar file can be found at:
geog_complete.tar.bz2
geog_10m.tar.gz

不wget了,直接下载放到Build_WRF文件夹下面解压

tar -zxvf geog_10m.tar.gz

把解压出来的geog文件夹改名字成WPS_GEOG

mv geog WPS_GEOG

The directory infomation is given to the geogrid program in the namelist.wps file in the &geogrid section. The complete data expands to approximately 10 GB. This data allows a user to run the geogrid.exe program.
目录信息在&geogrid部分的namelist.wps文件中提供给geogrid程序。 完整的数据将扩展到大约10 GB。 该数据允许用户运行geogrid.exe程序。

xiaomo@ubuntu:~/Build_WRF$ cd WPS
xiaomo@ubuntu:~/Build_WRF/WPS$ nano namelist.wps

把geog_data_path = '/glade/p/work/wrfhelp/WPS_GEOG/'改成geog_data_path = ‘/home/xiaomo/Build_WRF/WPS_GEOG/’



Ubuntu中配置WRF 07-Post processing

Post processing

ARWpost is a Fortran program that reads WRF-ARW input and output file, then generates GrADS output files.
ARWpost是一个Fortran程序,它读取WRF-ARW输入和输出文件,然后生成GrADS输出文件。

Once the output files have been generated, GrADS can be used to produce horizontal or vertical cross-section plots of scalar fields(contours) or vector fields(barbs or arrows),vertical profiles and soundings.
一旦生成了输出文件,即可使用GrADS生成标量场(轮廓)或矢量场(倒钩或箭头),垂直剖面和测深的水平或垂直横截面图。

Is recommend the use of ARW post Version 3 or higher. This code is not dependent on the successful compilation of the WRFV3 code, and can therefore be installed anywhere, even if WRFV3 is not installed on this computer.
建议在版本3或更高版本中使用ARW。 此代码不依赖于WRFV3代码的成功编译,因此即使未在此计算机上安装WRFV3,也可以将其安装在任何位置。

Move to your Build_WRF directory, download the file and unpack it.
移至Build_WRF目录,下载文件并解压缩。

The tar file can be found at:

ARWpost_V3.tar.gz

不wget了下载完拷进去解压:

xiaomo@ubuntu:~/Build_WRF$ tar -zxvf ARWpost_V3.tar.gz

Once unpacked,move to AWRpost directory and look for the following files:
解压缩后,移至AWRpost目录并查找以下文件:
arch, clean, compile, configure, namelist.ARWpost, README, src, script and util.

xiaomo@ubuntu:~/Build_WRF$ cd ARWpost/
xiaomo@ubuntu:~/Build_WRF/ARWpost$ ls -las
total 60
4 drwxr-xr-x 6 xiaomo xiaomo 4096 Mar  2  2011 .
4 drwxrwxr-x 9 xiaomo xiaomo 4096 Jan  6 16:28 ..
4 drwxr-xr-x 2 xiaomo xiaomo 4096 Jan  6 16:28 arch
4 -rwxr-xr-x 1 xiaomo xiaomo  905 May 25  2007 clean
4 -rwxr-xr-x 1 xiaomo xiaomo  490 Dec 16  2010 compile
8 -rwxr-xr-x 1 xiaomo xiaomo 4257 May 25  2007 configure
4 -rw-r--r-- 1 xiaomo xiaomo   12 May 25  2007 fields.plt
4 -rw-r--r-- 1 xiaomo xiaomo   19 May 25  2007 myLIST
4 -rw-r--r-- 1 xiaomo xiaomo 1150 Dec 16  2010 namelist.ARWpost
8 -rw-r--r-- 1 xiaomo xiaomo 7189 Dec 16  2010 README
4 drwxr-xr-x 2 xiaomo xiaomo 4096 Jan  6 16:28 scripts
4 drwxr-xr-x 2 xiaomo xiaomo 4096 Jan  6 16:28 src
4 drwxr-xr-x 2 xiaomo xiaomo 4096 Mar  2  2011 util

Assuming that the NETCDF variable is set, it is possible to configure the ARWpost.
假设已设置NETCDF变量,则可以配置ARWpost。

xiaomo@ubuntu:~/Build_WRF/ARWpost$ ./configure
Will use NETCDF in dir: /home/xiaomo/Build_WRF/LIBRARIES/netcdf
------------------------------------------------------------------------
Please select from among the following supported platforms.1.  PC Linux i486 i586 i686 x86_64, PGI compiler 2.  PC Linux i486 i586 i686 x86_64, Intel compiler  3.  PC Linux i486 i586 i686 x86_64, gfortran compiler Enter selection [1-3] : 3
------------------------------------------------------------------------
Configuration successful. To build the ARWpost, type: compile
------------------------------------------------------------------------
xiaomo@ubuntu:~/Build_WRF/ARWpost$

Edit the Makefile file into the src directory and modify the -L$(NETCDF) line into the ARWpost.exe environment.
将Makefile文件编辑到src目录中,并将-L $(NETCDF)行修改到ARWpost.exe环境中。

xiaomo@ubuntu:~/Build_WRF/ARWpost$ cd src/
xiaomo@ubuntu:~/Build_WRF/ARWpost/src$ nano Makefile

在Makefile文件中,加上-lnetcdf -lnetcdff如下:

ARWpost.exe: $(OBJS)
$(FC) $(FFLAGS) $(LDFLAGS) -o $@ $(OBJS)  \
-L$(NETCDF)/lib -lnetcdf -lnetcdff  -I$(NETCDF)/include  -lnetcdf

Move to the ARWpost directory and modify the CFLAGS and CPP lines into the configure.arwp file.
移至ARWpost目录,然后将CFLAGS和CPP行修改为configure.arwp文件。

xiaomo@ubuntu:~/Build_WRF/ARWpost/src$ cd ..
xiaomo@ubuntu:~/Build_WRF/ARWpost$ nano configure.arwp

CPP = /lib/cpp -C -P -traditional 变为 CPP = /lib/cpp -P -traditional

CFLAGS = -m64变为CFLAGS = -fPIC -m64

Then compile the ARWpost. If successful, the executable ARWpost.exe will be created.
然后编译ARWpost。 如果成功,将创建可执行文件ARWpost.exe。

./compile
xiaomo@ubuntu:~/Build_WRF/ARWpost$ ls -ls *.exe
0 lrwxrwxrwx 1 xiaomo xiaomo 15 Jan  6 17:22 ARWpost.exe -> src/ARWpost.exe


就是这样啦,下一次写怎么运行官网的例子Q~Q

Ubuntu中配置WRF相关推荐

  1. Ubuntu中配置Java环境变量时,出现command not found问题解决记录

    百度出Ubuntu中配置Java环境变量时,在利用sudo gedit /etc/profile 对profile编辑后, 在terminal中输入 sudo source /etc/profile, ...

  2. Ubuntu | ubuntu 中配置静态 IP

    ===================================================== 博主github:https://github.com/MichaelBeechan 博主C ...

  3. Ubuntu中配置NFS服务

    NFS协议允许远程访问Linux主机中的指定目录,并且在Windows 7中,原生支持将NFS文件系统映射到本地,通过资源管理器就可以访问Linux虚拟机或者开发板中的文件,非常方便. Ubuntu中 ...

  4. ubuntu中配置好清华的apt源

    文章目录 6 软件管理 6.4 在ubuntu中配置好清华的apt源,安装wireshark 6 软件管理 6.4 在ubuntu中配置好清华的apt源,安装wireshark 首先找到清华的镜像源路 ...

  5. linux环境下如何调鼠标灵敏度,如何在Ubuntu中配置鼠标设置

    Ubuntu是open-source操作系统,它使您可以对最小的系统模块进行大量配置.其中之一就是您要使用外部USB鼠标的方式.在本文中,我们将介绍如何对鼠标设置进行以下更改: 将左/右按钮设置为主按 ...

  6. ubuntu中配置tars详细教程

    Tars是基于名字服务使用Tars协议的高性能RPC开发框架,同时配套一体化的服务治理平台,帮助个人或者企业快速的以微服务的方式构建自己稳定可靠的分布式应用. 官网:https://github.co ...

  7. boa服务器 系统设置,Ubuntu中配置boa服务器

    操作系统及前期准备 Ubuntu版本:11.4(我的Ubuntu已经从10.10升级到11.4) boa安装软件:boa-0.94.14rc21.tar.gz  (最新版本,网上用的比较多的是boa- ...

  8. 在Ubuntu中配置联通3G上网卡

    转载来源:http://hi.baidu.com/hao_wan/blog/item/e882653826c5b62d97ddd846.html 安装usb-modeswitch sudo apt-g ...

  9. Ubuntu中配置SSH服务

    sudo apt-get update    #更新可用程序列表 sudo apt-get install openssh-server   #安装OpenSSH sudo vi /etc/sshd_ ...

  10. Ubuntu中配置虚拟专用网络***

    1.下载open*** easy-rsa 进入open***安装目录/usr/share/doc/open***/examples 进入目录下的sample-config-files目录,使用gunz ...

最新文章

  1. linux系统中指定端口连接数限制
  2. bat脚本登陆ftp服务器
  3. linux shell 文件 第一行插入字符串
  4. 怎么git 自己建的服务器_如何搭建自己的git服务器
  5. Java enum枚举类型
  6. flink搭建集群(一主三从)
  7. java组合与继承始示例_排列组合:用公式示例解释的差异
  8. Python基础(map/reduce)
  9. PL/SQL Developer Initialization erro
  10. Redis 开发规范
  11. 热力图heatmap.js使用中的思路解析
  12. 批量修改mac系统文件的可读写权限
  13. python迭代遍历目录下所以文件(Iterating through directories with Python)
  14. 包含农历、节气、节假日的前端日历
  15. JAVA招聘管理系统计算机毕业设计Mybatis+系统+数据库+调试部署
  16. 什么是PLC?可编程控制器的结构和工作原理介绍
  17. Spring blunder
  18. 服务器基础知识全解(汇总版)
  19. 山寨AR手游频出,VRAR正打造一庞大…
  20. 【站内题解】十六道csdn每日一练Python题解

热门文章

  1. c语言手写平衡二叉树(一)
  2. vue接入DataV
  3. chrome源码国内下载
  4. 创新、协调、绿色、开放、共享”五大发展理念整体上是一个彼此之间有联系、成结构的体系,是统一的,而从个体上来说,他们之间是相互促进、相互依赖、相互作用、相互对立的,这恰恰体现出辩证法物质世界的普遍联系和
  5. MySQL窗口函数——分组排序函数:number_rank(),rank(),dense_rank()
  6. 如何克服自己的懒惰-第二弹
  7. 原生html单页应用,web单页应用
  8. C/C++外部链接、内部链接
  9. 支付宝快捷支付服务 android,图文详解Android下支付宝快捷支付教程
  10. 百度地图实现定位图标随手机方向变化而变化,即运用方向传感器