1. 程式人生 > >WRF模式學習_從linux安裝開始

WRF模式學習_從linux安裝開始

本文作者為中山大學楊超鋒同學,特此感謝。

1 CentOS 5 Linux 安裝圖解

2 PGI 安裝

2.1 將檔案pgilinux86-64-707.tar.gz 下載到/home/yourname/pgi707 目錄下解壓

[yourname @localhost pgi707]$ tar -zxvf pgilinux86-707.tar.gz

[yourname @localhost pgi707]$ ls

common install INSTALL.txt linux86 linux86-64 pgilinux86-707.tar.gz

postinstall

2.2 編譯並安裝

[yourname @localhost pgi707]$ su root

Do you accept these terms? [accept,decline]

accept

Install the ACML? [y/n]

n

Installation directory? [/usr/pgi]

/usr/local/pgi

Create an evaluation license? [y/n]

n

Do you want the files in the install directory to be read-only? [y,n]

n

還有許多其他設定可以預設進行,直接回車即可

2.3 用root 使用者把license.dat(在使用期範圍的其他版本的license.dat 也可以用)複製

(cp)到/usr/local/pgi 下

2.4 把以下幾行放到/home/yourname/.bashrc 的最後

export PGI=/usr/local/pgi/linux86/7.0-7

export PATH=$PGI/bin:$PATH

export MANPATH=$PGI/man:$MANPATH

export LM_LICENSE_FILE=/usr/local/pgi/license.dat

並執行:

[[email protected] pgi707]# source /home/yourname/.bashrc

2.5 測試PGI:

pgf90-Warning-No files to process

以上說明PGI 安裝成功!

3 Netcdf 安裝

3.1 將檔案netcdf.tar.gz 下載到/home/yourname/netcdf 下解壓

[yourname @localhost netcdf]$ tar -zxvf netcdf-4.0.1.tar.gz

[yourname @localhost netcdf]$ ls

netcdf-4.0.1 netcdf-4.0.1.tar.gz

3.2 編譯並安裝

[yourname @localhost netcdf]$ cd netcdf-4.0.1/

[yourname @localhost netcdf-4.0.1]$ su root

[[email protected] netcdf-4.0.1]# mkdir /usr/local/netcdf

[[email protected] netcdf-4.0.1]# ./configure --prefix=/usr/local/netcdf

FC=pgf90

[[email protected] netcdf-4.0.1]# make install

3.3 把以下幾行放到/home/yourname/.bashrc 的最後

export NETCDF=/usr/local/netcdf

export PATH=$NETCDF/bin:$PATH

並執行:

[[email protected] netcdf-3.6.2]# source /home/yourname/.bashrc

這樣NetCDF 安裝成功!

4 NCARG 安裝

./configure --prefix=/usr/local

make all install

版本。本地機器版本可以用uname -m 檢視,gcc 版本用 gcc --version 檢視。我下載的是 NCL 5.1.1 32-bit

binary for i686 chips for LINUX (compiled with gcc 4.1.2)。

4.3. 安裝

將下載的檔案解壓,把裡面的三個子資料夾bin, lib, include 解壓到目標資料夾,即/usr/local/ncarg。

命令如下:

su

輸入口令

mkidr /usr/local/ncarg

cd /usr/local/ncarg

tar zxvf /home/yourname/ncl_ncarg-5.1.1.Linux_i686_gcc412.tar.gz

cd ~

gedit .bashrc

開啟.bashrc 檔案新增下面幾行:

export NCARG_ROOT=/usr/local/ncarg

export PATH=/usr/local/ncarg/bin:$PATH

export DISPLAY=:0.0

export NCARG_LIB=/usr/local/ncarg/lib

export NCARG_INC=/usr/local/ncarg/include

然後儲存

再在~/目錄下,輸入 source .bashrc

4.5. 配置檔案:

在~/ 目錄下建立.hluresfile 檔案, 然後把下面內容複製( 此檔案說明見:

!=========================================

! comments for ".res" files are preceded by a "!"

! remember quotations are not used in .res files

! White background/black foreground

*wkForegroundColor : (/0.,0.,0./)

*wkBackgroundColor : (/1.,1.,1./)

*wkColorMap : rainbow+gray

! Font stuff

*Font : helvetica

! Function Codes [Default is a colon ]

*TextFuncCode : ~

! Make default X11 window larger (adjust as necessary)

*wkWidth : 800

*wkHeight : 800

! Have a favorite colormap that you use for everything? You can

! make it your default here (note the name is NOT in quotes):

! *wkColorMap : temp1

! Increase the default (16mb) contour memory

! If you gave gridded data > 500 x 500, you may need this

*wsMaximumSize: 32556688

!==========================================

然後 cd ~, 分別執行

ng4ex gsun01n ncl gsun01n.ncl

ncargex cpex08, ctrans -d X11 cpex08.ncgm

此時,可以看到測試的顯示結果。

※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※

到此為止,WRF 模式安裝的前期準備已經完成,下面開始正式安裝模式。在正式安裝之前,我們先在我們

自己的使用者目錄下建立一個名為WRF 的資料夾,然後把地形檔案壓縮包geog_v3.1.tar.gz、WRFV3 壓

縮包WRFV3.1.1.TAR.gz、WPSV3 壓縮包WPSV3.1.1.TAR.gz 和ARWpost 壓縮包ARWpost.tar.gz

都複製到WRF 資料夾裡,最後就可以在WRF 資料夾裡進行模式的安裝了。

※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※

5 WRFV3 安裝

要先安裝WRF,再安裝WPS,這個順序不能顛倒。

安裝步驟:

5.1 WRF 壓縮包可以到以下網頁下載:

需要註冊,不過註冊很方便。我們已經下載好了。

5.2 在事前建立的WRF 目錄下,解壓WRFV3 的壓縮包

tar zxvf WRFV3.1.1.TAR.gz

cd WRFV3

export WRFIO_NCD_LARGE_FILE_SUPPORT=1

./configure

註釋:serial means single processor (考慮到大家機器的實際情況,請大家選擇這項)

smpar means Symmetric Multi-Processing/Shared Memory Parallel (OpenMP)

dmpar means Distributed Memory Parallel (MPI)

dm+sm means Distributed Memory with Shared Memory (for example, MPI across

nodes with OpenMP within a node)

the second option is for nesting: 0 = no nesting, 1 = standard static nesting,

2 = nesting with a prescribed set of moves, 3 = nesting that allows a domain

to follow a vortex (typhoon tracking)

注意:選擇linux with pgi 編譯器(serial)的選項,回車以後,出現compile for nesting?

選擇basic。

5.3 開始編譯

./compile em_real

ls -ls main/*.exe

註釋:you should see ndown.exe, real.exe, and wrf.exe 。代表WRFV3 安裝成功。

5.4 如果編譯失敗,請先回到WRFV3 目錄下,輸入./clean –a ,再重新查詢問題,重新安裝。

6 WPSV3 安裝

6.1 獲取WPS 的原始檔 WPSV3.TAR.gz

6.2 進入WRF 目錄,並解壓:

cd WRF

tar -zxvf WPSV3.1.1.TAR.gz

解壓後,進入WPS 目錄

cd WPS

6.3 配置:

./configure

這一佈會出現相關選項,注意事項如下:

o choose one of the options

o usually, option "1" and option “2” are for serial builds, that is the best

for an initial test

o WPS requires that you build for the appropriate Grib decoding, select an

option that suitable for the data you will use with the ungrib program

o If you select a Grib2 option, you must have those libraries prepared and

built in advance

6.4 編譯:

./compile

ls -ls *.exe

註釋:

o you should see geogrid.exe, ungrib.exe, and metgrid.exe (if you are missing

both geogrid.exe and metgrid.exe, you probably need to fix where the path to

WRF is pointing in the configure.wps file; if you are missing ungrib.exe, try

a Grib1-only build to further isolate the problem)

ls -ls util/*.exe

註釋:

o you should see a number of utility executables: avg_tsfc.exe,

calc_ecmwf_p.exe, g1print.exe, g2print.exe, mod_levs.exe, plotfmt.exe,

plotgrids.exe, and rd_intermediate.exe (files requiring NCAR Graphics are

plotfmt.exe and plotgrids.exe)

• if geogrid.exe and metgrid.exe executables are missing, probably the path

to the WRFV3 directory structure is incorrect (found inside the configure.wps

file)

• if the ungrib.exe is missing, probably the Grib2 libraries are not linked

or built correctly

• if the plotfmt.exe or the plotgrids.exe programs are missing, probably the

NCAR Graphics path is set incorrectly

6.5 如果編譯失敗,請先回到WPS 目錄下,輸入./clean –a ,再重新查詢問題,重新安裝。

7 ARWpost 安裝

ARWpost 是一個把WRF 結果轉為GrADS 或Vis5D 可以辨識的資料格式的軟體。

下面為安裝步驟:

tar zxvf ARWpost.tar.gz

cd ARWpost

解壓後進入資料夾,然後如下操作:

./configure

生成configure.arwp

如果你的WRF 目錄路徑不是在"../WRFV3" ,則要編輯configure.arwp,檔案,設定“WRF_DIR“變

量為你的WRFV3 路徑

./complie

生成 ARWpost.exe,表明安裝成功,

執行時,先修改namelist.ARWpost

然後執行 ./ARWpost.exe

這就會生成 output_root_name.dat & output_root_name.ctl 或output_root_name.v5d

然後就可以通過 GrADS 或Vis5D 畫圖。

8 GrADS 安裝

假設檔案下載位置為/home/yourname/grads-2.0.a7.1-bin-i686-pc-linux-gnu.tar.gz

8.1.選擇安裝路徑.一般選擇裝在 /usr/local/bin/ 目錄(也可自行選擇其他)

[[email protected] ~]$ su 轉入根使用者,以便訪問/usr/local/bin

[[email protected] yourname]# cd /usr/local/bin

8.2.解壓縮檔案

/home/yourname/grads-2.0.a7.1-bin-i686-pc-linux-gnu.tar.gz

[[email protected] grads-2.0.a7.1]# mkdir dat

[[email protected] grads-2.0.a7.1] # cd dat

[[email protected] bin]# tar zxvf /home/yourname/data.tar.Z

8.3.設定環境變數

轉到普通使用者(Ctrl+D),開啟 ~./.bashrc,

新增如下命令:

export GADDIR=/usr/local/bin/grads-2.0.a7.1/dat

export GASCRP=/usr/local/bin/grads-2.0.a7.1/lib

export PATH=/usr/local/bin/grads-2.0.a7.1/bin:$PATH

alias grads=/usr/local/bin/grads-2.0.a7.1/bin/grads

8.4.OK.輸入'grads'命令即可開啟GrADS.


相關推薦

WRF模式學習_linux安裝開始

本文作者為中山大學楊超鋒同學,特此感謝。 1 CentOS 5 Linux 安裝圖解 2 PGI 安裝 2.1 將檔案pgilinux86-64-707.tar.gz 下載到/home/yourname/pgi707 目錄下解壓 [yourname @lo

Python_開始學習_(47) pygame 安裝

實戰步驟 pygame 快速體驗 飛機大戰 實戰 確認模組 --pygame pygame 就是一個 Python 模組,  專為電子遊戲設計 提示 : 學習第三方模組, 通常最好的參考資料就在官方網站 安裝 pygame Lin

使用Apache pdfbox: Linux安裝字體到log4j設置日誌級別

目錄 log erro warn 第三方jar ado logs brush apach 在使用Apache的pdfbox的過程中,因為Linux環境下沒有STSong-Light字體而報警告信息 (PDCIDFontType0.java:147) - Using fal

學習Java 這些書開始

Java的優勢是簡單、面向物件、分散式、解釋執行、魯棒、安全、體系結構中立、可移植、高效能、多執行緒以及動態性。 Java語言的設計從現在的角度看非常中庸,啥都不是特別出色,但都“湊合”。 學習Java就業時就意味著有不少選擇餘地的。 其實Java並沒有想象中的那麼難,前提是做好一

教程:學習React接受JSX開始

雖然JSX是擴充套件到ECMAScript的類XML語法,但是它本身並沒有定義任何語義。也就是說它本身不在ECMAScript標準範圍之內。它也不會被引擎或者瀏覽器直接執行。通常會利用很編譯器前處理器來將這些JSX轉化為標準的ECMAScript。 吐槽:雖然JSX出發

學習C#俄羅斯方塊開始(一)概述

       前幾天和一個在讀的本科生聊天,他一直在抱怨學校學習的理論知識太多,實踐的機會太少。擔心自己因此畢業後可能難以找到工作。我認為一個人要是想投入開發,他總是可以找到專案的。與其把自己的時間浪費

學習vim 常用按鍵開始

常用 復制 開始 true scrip 當前 ctr ctrl ctrl+d 撤銷 u 前進 ctrl r 移動 下一個單詞 w 當前單詞首或上個單詞首 b 當前單詞尾或上個單詞尾 e ---- 大寫就是忽略標點符號 查詢 /+word 下一個

Linux 學習筆記 1 使用最小的系統,分割槽安裝系統開始

我們常用的linux系統在安裝過程中大多都省略了對系統進行分割槽的操作,以至於後期,不瞭解什麼是分割槽以及分割槽當中最基本的一些概念, 我們不說最細的知識,只求瞭解這個過程,那直接步入正題,開始第一節的學習。   開始準備 Linux 系統映象一個 這裡我選擇的是 TinyCore Linux 最

Python_開始學習_(46) eval 函式

eval() 函式十分強大 ---- 將字串 當成 有效的表示式 來求職 並 返回計算結果 # 基本的數學計算 print(eval("1 + 1")) # 2 # 字串重複 print(eval("'*' * 5")) # ***** # 將字串轉換成列表 print(eval("[1

Python_開始學習_(44) 模組 和 包

目錄   1.  模組 1.1  模組的概念 1.2  模組的兩種匯入方式 1.3  模組的搜尋順序(擴充套件) 1.4  原則 ---- 每一個檔案都應該是可以被匯入的 2.  包 (package)

Python_開始學習_(43) 異常

目錄   1.  異常的概念 2.  捕獲異常 2.1  簡單的捕獲異常語法 2.2  錯誤型別捕獲 2.3  異常捕獲完整語法 3.  異常的傳遞 4.  丟擲 raise 異常 4

Python_開始學習_(42) 單例

目錄   1.  單例設計模式 2.  __new__方法 3.  Python 中的單例   1.  單例設計模式 設計模式 設計模式 是 前人工作的總結和提煉

Python_開始學習_(41) 類屬性和類方法

目錄 1.  類的結構 1.1  術語 ---- 例項 1.2  類是一個特殊的物件 2.  類屬性和例項屬性 2.1  概念和使用 2.2  屬性的獲取機制 (科普) 3.  類方法和靜態方法 3

Python_開始學習_(40) 多型

1.  多型 面向物件三大特性 1.  封裝 根據 職責 將 屬性 和 方法 封裝 到一個抽象的 類 中 定義類的準則 2.  繼承 實現程式碼的重用,  相同的程式碼不需要重複的編寫 設計類的技巧

Python_開始學習_(39) 繼承

目錄 1.  單繼承 1.1  繼承的概念,  語法和特點 1.2  方法的重寫 1.3  父類的 私有屬性 和 私有方法 2.  多繼承 2.1  多繼承的使用注意事項 2.2  新式類與舊

Python_開始學習_(38) 私有屬性和私有方法

1.  應用場景及定義方式 應用場景 在實際開發中,  物件 的 某些屬性或方法 可能只希望 在物件的內部被使用, 而 不希望在外部被訪問到 私有屬性 就是 物件&nbs

Python_開始學習_(37) 面向物件封裝案例 2

目錄 1.  士兵突擊 1.1  開發槍類 1.2  開發士兵類 2.  身份運算子 is 與 == 區別 封裝 封裝 是面向物件程式設計的一大特點 面向物件程式設計的 第一步 ----

Python_開始學習_(36) 面向物件封裝案例

目錄   1.  封裝 2.  小明愛跑步 3.  小明愛跑步 ---- 小美也愛跑步 4.  擺放傢俱 4.1  新增傢俱 1.  封裝 封裝 是面向物件程式設計的一大特點

Python_開始學習_(35) 類的基本使用

目錄 1.  定義簡單的類 (只包含方法) 1.1  定義只包含方法的類 1.2 建立物件 1.3  第一個面向物件程式 2.  方法中的 self 引數  2.1  給物件增加屬性 2.2  使用 s

Python_開始學習_(34) 面向物件

目錄 1.  面向物件基本概念 1.1  過程和函式 1.2  面向過程 和 面向物件 基本概念 1) 面向過程  ---- 怎麼做? 2) 面向物件 ---- 誰來做? 2.  類和物件 2.1  類 2.