WRF在Fedora12虚拟机上的安装过程

    技术2022-05-19  22

       WRF安装过程

                                                                    Bernard 2011-3-4

    1.  在虚拟机VMware上安装Fedora 12 x64操作系统。

    2. 安装PGI9.01

    a)         电驴上可下载[[顶级编译器].PGI.Workstation.Complete.v9.0.1.LINUX.x64-TBE.7z

    b)         Windows下解压缩。把pgilinux-901.tar.gz复制到虚拟机里。

    c)         su命令切换至root用户。

    d)         执行PGI安装:

    # tar –zxvf pgilinux-901.tar.gz

    #./install

    PGI默认安装路径是/opt/pgi /

    复制pgi_9.0-1_linux64.tar.bz2/opt/pgi /

    # tar –zxvf pgi_9.0-1_linux64.tar.bz2

    #./ pgi_9.0-1_linux64_patcher         ; 运行补丁

    license.dat文件复制到/opt/pgi /下。

    #gedit /etc/profile     ;添加环境变量

    profile文件里添加如下行:

         export PGI=/opt/pgi

         export PATH=$PGI/linux86-64/9.0-1/bin:$PATH

    e)         安装PGI完成。

    f)          测试PGI安装是否成功。

        #cd $PGI

        #cd linux86-64/9.0-1/EXAMPLES

        通过编译这里的例子程序,验证PGI是否安装成功。

     

    2.安装 jasper-1.900.1

    a)         #unzip  jasper-1.900.1.zip

    b)         #./configure --prefix=/usr/local/jasper

    c)         #make

    d)         #make install

     

    3.安装netcdf-4.0.tar.gz[注意:编译netcdf,网络必须是通的,否则make all测试不通过]

    a)         #tar –zxvf netcdf-4.0.tar.gz

    b)         #./configure --prefix=/usr/local/netcdf4

    c)         #make all

    d)         #make install

     

    4.安装 libpng-1.5.0.tar.gz

    a)         #tar –zxvf libpng-1.5.0.tar.gz

    b)         #./configure --prefix=/usr/local/libpng

    c)         #make

    d)         #make install

     

    5.安装 zlib-1.2.5.tar.gz

    a)         #tar –zxvf zlib-1.2.5.tar.gz

    b)         #./configure --prefix=/usr/local/zlib

    c)         #make

    d)         #make install

     

    6.添加/修改环境变量

    a)         打开 /etc/profile文件, 添加如下内容:

    export NETCDF=/usr/local/netcdf4

    export NCARG=/usr/local/ncarg

    export NCARG_ROOT=/usr/local/ncarg

    export PGI=/opt/pgi

    export PATH=$PGI/linux86-64/9.0-1/bin:$PGI/linux86-64/9.0-1/include:$PGI/linux86-64/9.0-1/lib:$NETCDF/lib:$NETCDF/include:$NCARG/bin:$NCARG/lib:$NCARG/include:/usr/local/png/include:/usr/local/png/bin:$PATH

    export MANPATH=$MANPATH:$PGI/man

    export WRFIO_NCD_LARGE_FILE_SUPPORT=1

    export JASPERLIB=/usr/local/jasper/lib

    export JASPERINC=/usr/local/jasper/include

    export INCLUDE=/usr/include:$INCLUDE

    保存

    b)         运行#source /etc/profile,使环境变量生效.

    7.安装 WRFV3.1.1.TAR.gz  

    a)         gzip -cd WRFV3.1.1.TAR.gz | tar -xf –

    b)         #cd WRFV3

    c)         #./configure

    d)         选择:PGI编译器的选项,因为配置命令将生成使用PGI编译器的脚本。

    {PGI1314,下一步选1}

    e)         创建日志目录 #mkdir ./buildlog

    f)          逐个编译:

      #./compile em_grav2d_x &> ./buildlog/em_grav2d_x

      #./compile em_heldsuarez &> ./buildlog/em_heldsuarez

      #./compile em_hill2d_x &> ./buildlog/em_hill2d_x

      #./compile em_les &> ./buildlog/em_les

      #./compile em_quarter_ss &> ./buildlog/em_quarter_ss

      #./compile em_real &> ./buildlog/em_real

      #./compile em_seabreeze2d_x &> ./buildlog/em_seabreeze2d_x

      #./compile em_squall2d_x &> ./buildlog/em_squall2d_x

      #./compile em_squall2d_y &> ./buildlog/em_squall2d_y

    g)         检查:

      #ls -ls main/*.exe

      if you built a real-data case, you should see ndown.exe, real.exe, and wrf.exe

      if you built an ideal-data case, you should see ideal.exe and wrf.exe   

      Building the WRF-Var Code

      See details in Chapter 6.

    8.安装ncl

    a)         下载:ncl_ncarg-5.2.1.Linux_x86_64_nodap_gcc432.tar.gz

    b)         复制 ncl_ncarg-5.2.1.Linux_x86_64_nodap_gcc432.tar.gz /usr/home/local/ncarg

    c)         #tar -zxvf ncl_ncarg-5.2.1.Linux_i686_nodap_gcc432.tar ;完成安装

     

    9.安装gFortran

    a)         下载:compat-gcc-34-g77-3.4.6-18.x86_64.rpm 或执行#yum install compat-gcc-34-g77 安装。

    b)         建立连接:

         #ln -s /usr/lib64/libg2c.so.0 /usr/lib64/libg2c.so

         #ln -s /usr/lib64/libblas.so.3 /usr/lib64/libblas.so

         #ln -s /usr/lib64/libgfortran.so.3 /usr/lib64/libgfortran.a

     

    10.安装libpng-1.5.0.tar.gz

       #tar zxvf libpng-1.5.0.tar.gz 

       #cd libpng-1.5.0

       #./configure --prefix=/usr/local/png

       #make

       #make install

    11.安装zlib-1.2.5.tar.gz

      #tar zxvf zlib-1.2.5.tar.gz

      #cd zlib-1.2.5

      #./configure --prefix=/usr/local/zlib

      #make

      #make install

     

    12.安装WPSV3.1.1.TAR.gz

    a)         #gzip -cd WPSV3.1.1.TAR.gz | tar -xf –

    b)         #cd WPSV3

    c)         #./configure

    d)         PGI编译器选项 如:56

    e)         #gedit ./configure.wps ;修改configure.wps文件:

    f)          修改如下条目:

        NCARG_LIBS             =       -L/usr/local/ncarg/lib -lncarg -lncarg_gks -lncarg_c /

                                         -L/usr/lib64 -lX11 /

                                         -L/usr/lib64 -lgfortran

       COMPRESSION_LIBS        =       -L/usr/local/jasper/lib -ljasper /

                                         -L/usr/local/png/lib -lpng /

                                         -L/usr/local/zlib/lib -lz

       COMPRESSION_INC           =       -I/usr/local/zlib/include /

                                         -I/usr/local/jasper/include /

                                         -I/usr/local/png/include

     

    保存,关闭gedit.

    g)         编译

    #./compile &>/home/WPS/log.txt

    备注:这里也可以单个文件编译:

      如:#./compile plotfmt     只生成plotfmt.exe

      

    h)         检查:

    #ls -ls *.exe

    you should see geogrid.exe, ungrib.exe, and metgrid.exe

    #ls -ls util/*.exe

    you should see a number of utility executables:

           avg_tsfc.exe, g1print.exe,

           g2print.exe, mod_levs.exe,

           plotfmt.exe, plotgrids.exe,

       and rd_intermediate.exe

     

    如果安装过程中发现缺少其它依赖的包,可以使用yum install XXXX 命令来安装。


    最新回复(0)