Friday, October 17, 2025

Research Note #32 - Instalasi ARWpost pada HPC BRIN

ARWpost adalah salah satu tool untuk mengolah keluaran (post-processor) dari WRF. Tool ini sebenarnya sudah termasuk 'kuno', dengan versi terakhir yang bisa diunduh adalah V3.1 (2 Maret 2011). Lalu kenapa saya pake tool ini? Alasannya karena keluaran dari ARWpost ini adalah data dalam format GrADS, dan saya sudah sangat terbiasa (dan nyaman) pake GrADS untuk analisis data.

Masalah utama dari ARWpost ini (seperti yg sudah-sudah) adalah kode programnya yang jadul, sehingga bila diinstall dengan compiler modern akan terjadi error, sehingga untuk instalasi pada Mahameru, diperlukan sedikit trik.

Pertama, download source ARWpost pada link ini. Ekstrak dan jalankan, script configurenya. Sebelum menjalankan configure, pastikan anda sudah memuat path NetCDF aktif pada enviroment sistem.

$ mkdir ARWpost
$ cd ARWpost
$ wget https://www2.mmm.ucar.edu/wrf/src/ARWpost_V3.tar.gz
$ tar -xzvf  ARWpost_V3.tar.gz
$ ./configure
Will use NETCDF in dir: /mgpfs/home/ardh003/source/wrf_dependencies/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
------------------------------------------------------------------------

Sampai sini jangan langsung compile, karena perlu beberapa modifikasi pada file configure.arwp dan Makefile.

$ vi configure.arwp

Modifikasi baris C-Pre-Processor (CPP) pada file tersebut menjadi:

CPP = gfortran -E -x f95-cpp-input -P

Kemudian tambahkan argumen untuk Fortran compiler (FFLAGS) sehingga menjadi seperti ini:

FFLAGS          =       -ffree-form -O -fno-second-underscore -fconvert=big-endian -frecord-marker=4 -std=legacy -fallow-argument-mismatch

Lalu simpan perubahan dan keluar dari file configure.arwp. Berikutnya, masuk ke direktori /src dan modifikasi file Makefile.

$ cd src
$ vi Makefile

Lalu tambahkan linker untuk Fortran compiler. Perhatikan urutannya.
 
ARWpost.exe: $(OBJS)
        $(FC) $(FFLAGS) $(LDFLAGS) -o $@ $(OBJS)  \
                -L$(NETCDF)/lib -I$(NETCDF)/include -lnetcdff -lnetcdf

Setelah itu simpan dan keluar dari Makefile. Sekarang anda bisa menjalankan compilernya.

$ ./compile

Pastikan tidak ada pesan error pada display. Berikut contoh beberapa baris terakhir proses compile bila tidak terjadi error.

gfortran -ffree-form -O -fno-second-underscore -fconvert=big-endian -frecord-marker=4 -std=legacy -fallow-argument-mismatch  -o ARWpost.exe module_model_basics.o constants_module.o gridinfo_module.o ARWpost.o input_module.o output_module.o module_map_utils.o misc_definitions_module.o module_date_pack.o module_debug.o process_domain_module.o module_get_file_names.o module_interp.o module_basic_arrays.o module_diagnostics.o module_arrays.o module_pressure.o module_calc_height.o module_calc_pressure.o module_calc_theta.o module_calc_tk.o module_calc_tc.o module_calc_td.o module_calc_td2.o module_calc_rh.o module_calc_rh2.o module_calc_uvmet.o module_calc_slp.o module_calc_dbz.o module_calc_cape.o module_calc_wdir.o module_calc_wspd.o module_calc_clfr.o  \
        -L/mgpfs/home/ardh003/source/wrf_dependencies/netcdf/lib -I/mgpfs/home/ardh003/source/wrf_dependencies/netcdf/include -lnetcdff -lnetcdf

Setelah itu pastikan file ARWpost.exe sudah terdapat pada direktori.

$ ls -alh ARWpost.exe
lrwxrwxrwx 1 ardh003 researcher 15 Oct 16 15:09 ARWpost.exe -> src/ARWpost.exe

Pastikan ARWpost.exe menggunakan library yg benar:

$ ldd ARWpost.exe
 linux-vdso.so.1 (0x00007ffd717be000)
        libnetcdff.so.7 => /mgpfs/home/ardh003/source/wrf_dependencies/netcdf/lib/libnetcdff.so.7 (0x000014756b874000)
        libnetcdf.so.15 => /mgpfs/home/ardh003/source/wrf_dependencies/netcdf/lib/libnetcdf.so.15 (0x000014756b564000)
        libgfortran.so.5 => /mgpfs/home/ardh003/source/wrf_dependencies/netcdf/lib64/libgfortran.so.5 (0x000014756b097000)
        libm.so.6 => /lib64/libm.so.6 (0x000014756ad15000)
        libgcc_s.so.1 => /mgpfs/home/ardh003/source/wrf_dependencies/netcdf/lib64/libgcc_s.so.1 (0x000014756aaf6000)
        libquadmath.so.0 => /mgpfs/home/ardh003/source/wrf_dependencies/netcdf/lib64/libquadmath.so.0 (0x000014756a8b1000)
        libc.so.6 => /lib64/libc.so.6 (0x000014756a4ec000)
        libhdf5_hl.so.100 => /mgpfs/home/ardh003/source/wrf_dependencies/netcdf/lib/libhdf5_hl.so.100 (0x000014756a2c7000)
        libhdf5.so.103 => /mgpfs/home/ardh003/source/wrf_dependencies/netcdf/lib/libhdf5.so.103 (0x0000147569cf7000)
        libdl.so.2 => /lib64/libdl.so.2 (0x0000147569af3000)
        libz.so.1 => /mgpfs/home/ardh003/source/wrf_dependencies/grib2/lib/libz.so.1 (0x00001475698d8000)
        /lib64/ld-linux-x86-64.so.2 (0x000014756bb33000)

Bila tidak ada error/library yang hilang, anda bisa langsung memodifikasi file konfigurasi namelist.ARWpost dan menjalankan ARWpost.exe. 

No comments:

Post a Comment