/
Compile WPS

Compile WPS

การติดตั้งโปรแกรม WRF Preprocessing System (WPS) มีขั้นตอนดังนี้

A variant of WRF must be compiled prior to WPS.

ต้องใช้หน้าต่างเดียวกันเท่านั้น (ไม่เช่นนั้นต้องทำขั้นตอน 1 และ 3 ใหม่ทุกรอบ)


1. Load required modules

ทำการล้างโมดูลที่โหลดไว้ก่อนหน้าทั้งหมด แล้วโหลดโมดูลที่ WPS จำเป็นต้องใช้ โดยใช้คำสั่ง

module purge module load netCDF-Fortran/4.5.2-iimpi-2019b module load libpng/1.6.37-GCCcore-8.3.0 module load JasPer/1.900.1-intel-2019b # (MUST) JasPer version <2.0

These dependencies should be compiled with the same set of compilers.

2. Download WPS source code

ดาวน์โหลด WPS เวอร์ชั่นล่าสุดจาก GitHub มายัง Directory ปัจจุบัน

git clone https://github.com/wrf-model/WPS # Version 4.40 at the time

3. Set environment variables

ทำการตั้งค่า Environment variables ดังแสดงด้านล่าง (User ต้องตั้งค่า Path ไปยังโฟลเดอร์ WRF ลงในตัวแปร WRF_DIR)

export WRF_DIR=../WRF # Path to WRF folder *** {USER EDIT} *** export NETCDF=${EBROOTNETCDFMINFORTRAN:-${EBROOTNETCDF}} # Required export JASPERINC=$EBROOTJASPER/include # For GRIB2 IO (Optional) export JASPERLIB=$EBROOTJASPER/lib # For GRIB2 IO (Optional) ### Common mistake :: insert spaces before or after =

4. Set configure file

4.1 Run ./configure

  • เข้าไปในโฟลเดอร์ WPS ด้วยคำสั่ง cd ./WPS

  • ใช้คำสั่ง ./configure

  • พิมพ์เลข 19 แล้วกด Enter เพื่อเลือกการคำนวณขนานแบบ Distributed memory (dmpar) ด้วย Intel compiler บนระบบปฏิบัติการ Linux x86_64

  • (ใช้คำสั่ง ./clean -a ก่อน ถ้าหากต้องเริ่ม configure ใหม่)

4.2 Edit configure.wps

  • แก้ไขไฟล์ configure.wps ในโฟลเดอร์ WPS ด้วย Text editor เช่น nano, vi

  • ทำการเปลี่ยนจาก DM_FC = mpif90 เป็น DM_FC = mpiifort

  • ทำการเปลี่ยนจาก DM_CC = mpicc เป็น DM_CC = mpiicc

  • (สำหรับ WRF ที่ลงด้วย sm+dm option ให้เพิ่ม -liomp5 -lpthread ให้กับ WRF_LIB ด้วย)

  1. Press Ctrl + W # To search

  2. Type “mpif90“, then press Enter # Search using keyword “mpif90“

  3. For the DM_FC , change mpif90 to mpiifort

  4. For the DM_CC, change mpicc to mpiicc

  5. Press Ctrl + O, then press Enter # Save file

  6. Press Ctrl + X # Exit nano

5. Compile WPS

เริ่มทำการติดตั้ง WPS โดยบันทึกการแจ้งต่างๆลงในไฟล์ compile.wps.log แทน (ใช้เวลาประมาณ 5 นาทีบน TARA front-end)

6. Check

  • ใช้คำสั่ง ls -ls ./*.exe เพื่อตรวจหา geogrid.exe, metgrid.exe และ ungrib.exe

  • ใช้คำสั่ง ls -ls ./util/*.exe เพื่อตรวจหา avg_tsfc.exe, calc_ecmwf_p.exe, g1print.exe, g2print.exe, height_ukmo.exe, int2nc.exe, mod_levs.exe และ rd_intermediate.exe

  • ใช้คำสั่ง ls -ls ./util/*.ncl เพื่อตรวจหา gfs.ncl, plotfmt.ncl, plotfmt_nc.ncl และ plotgrids.ncl


Contact Us
ThaiSC support service : thaisc-support@nstda.or.th

Related content

Compile WRF
Compile WRF
More like this
Geography data --- for WPS geogrid.exe
Geography data --- for WPS geogrid.exe
Read with this
Install your own WPS
Install your own WPS
More like this
Weather Research and Forecasting (WRF) model
Weather Research and Forecasting (WRF) model
Read with this
Install your own WRFDA
Install your own WRFDA
More like this
multi-GPUs Training with PyTorch -- DataParallel
multi-GPUs Training with PyTorch -- DataParallel
Read with this