Thursday, April 30, 2026
Research Note #33 - Instalasi WRF-Chem 4.7.1 + KPP di HPC BRIN (Mahameru)
Friday, October 17, 2025
Research Note #32 - Instalasi ARWpost pada HPC BRIN
Update: 27 April 2026 (fix untuk WRF-Chem)
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.
$ 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
------------------------------------------------------------------------
IF ( INDEX(title,'OUTPUT FROM * PROGRAM:WRF-Chem V4.7.1 MODEL') /= 0 ) iprogram = 8 !! wrfchem output
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)
Thursday, October 16, 2025
Research Note #31 - Contoh Perintah Linux dan Slurm untuk Bekerja di HPC BRIN (updated)
Berikut beberapa perintah yang berguna untuk bekerja menggunakan fasilitas parallel computing di HPC BRIN (Mahameru). Perintah-perintah ini umumnya digunakan untuk mengetahui spesifikasi sistem yang digunakan sebelum menjalankan batch job pada slurm workload manager.
1. Mengetahui spesifikasi lengkap HPC
$ lscpu
Sunday, October 12, 2025
Research Note #30 - Instalasi Ncview dengan Miniconda3 di HPC BRIN
Conda adalah suatu package manager yang memungkinkan anda untuk menggunakan aplikasi scientific pada Linux tanpa harus repot menginstall/mengkonfigurasi library khusus pada sistem (seperti yg terjadi pada WRF-Chem). Dengan conda, anda dapat memilih instalasi aplikasi yang diinginkan dan menjalankannya pada environment khusus tanpa khawatir akan terjadi konflik dengan library lain pada system.
Pada tulisan ini, contoh aplikasi yang akan diinstall adalah ncview yang biasa digunakan untuk visualisasi data NetCDF (misal data domain WRF yang dibuat oleh geogrid). Salah satu kesulitan ketika instalasi ncview adalah tidak adanya library X11 untuk visualisasi pada server, terutama bila anda user biasa yang tidak punya akses admin untuk instalasi X11 pada sistem Linux. Pada HPC BRIN (Mahameru), ada beberapa jenis Conda yang bisa dipakai seperti Anaconda3 dan Miniconda3, tapi pada tulisan ini saya menggunakan Miniconda3.
Langkah pertama, pastikan conda sudah tersedia di module yang ada di Mahameru.
----------- /mgpfs/shared/apps/mod/tools ---------------------
Anaconda/3-2023.09-0
----------- /mgpfs/apps/modulefiles ---------------------------
ai-ml/Anaconda/3-2023.09 earth/anaconda3/2019.07 earth/miniconda3/24.7.1
bioinformatics/anaconda3/2023.09-0 earth/anaconda3/2023.09-0 (D) earth/miniconda3/24.11.1 (D)
Berikutnya muat module miniconda3 24.11.1 dan periksa path 'bin'nya.
$ module show earth/miniconda3/24.11.1
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
/mgpfs/apps/modulefiles/earth/miniconda3/24.11.1:
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
load("readline/8.2")
whatis("miniconda3 2023.09-0 - anaconda3 is environment management system.")
setenv("RHOME","/mgpfs/apps/earth/apps/miniconda3/24.11.1")
prepend_path("PATH","/mgpfs/apps/earth/apps/miniconda3/24.11.1/bin")
prepend_path("LIBRARY_PATH","/mgpfs/apps/earth/apps/miniconda3/24.11.1/lib")
prepend_path("LD_LIBRARY_PATH","/mgpfs/apps/earth/apps/miniconda3/24.11.1/lib")
prepend_path("MANPATH","/mgpfs/apps/earth/apps/miniconda3/24.11.1/share/man")
help([[
This module is for use of earth/miniconda3/24.11.1.
use example:
$ module load earth/miniconda3/24.11.1
]])
Thursday, October 9, 2025
Research Note #29 - Instalasi WRF-Chem di HPC BRIN (Mahameru)
Last edited on 16-10-2022
Instalasi model WRF itu selalu menantang (baca: bikin stress), apalagi kalau terakhir kali installnya itu lebih dari 5 tahun yang lalu. Butuh waktu untuk mereview ulang langkah-langkah yang dulu pernah dilakukan, termasuk merefresh ilmu per-Linux-an yang sudah lumayan lama terlupa. Untungnya, berkat catatan-catatan proses instalasi njelimet yang masih tersimpan rapih di blog ini, ditambah dengan bantuan asisten virtual yang setia mendampingi (baca: chatGPT), akhirnya WRF bisa terinstall di HPC BRIN (selanjutnya kita sebut saja Mahameru). Yang lebih bikin senang, yg terinstall bukan cuma WRF, tapi juga WRF-Chem, dan ada beberapa hal baru yang saya pelajari dari proses instalasi ini.
Secara umum, proses intalasi model WRF-Chem di Mahameru hampir sama dengan Oakforest UTokyo dulu, dengan beberapa trik baru. Kalau dirangkum prosesnya kurang lebih seperti ini:
- Pastikan jenis C dan Fortran compiler yang tersedia di sistem. Mahameru menggunakan gcc dan gfortran, berbeda dengan Oakforest yang menggunakan icc dan ifort.
- Install library-library yg dibutuhkan WRF, seperti NetCDF, grib2, Jasper, LibPNG dll. Sebagian library ini sudah tersedia di Mahameru, tinggal di-load saja modulnya. Untuk kasus saya, seluruh library ini saya install kembali di direktori user saya. Kenapa? Karena kl misal ada masalah, akan lebih gampang melacak dan memodifikasi path library-nya tanpa harus memuat ulang modul yang ada di sistem.
- Cara paling mudah instalasi library adalah dengan mengikuti panduan yang ada di website ini. Ikuti saja langkah-langkahnya
sampai sebelum instalasi WRF/WPS, kecuali untuk MPICH, WRF dan WPS. MPICH tidak digunakan karena Mahameru sudah menggunakan OpenMPI untuk parallel computing. Instalasi WRF/WPS di Mahameru juga perlu beberapa trik khusus yang tidak ada di panduan tersebut. - Download WRF dan WPS terbaru via github. Ini termasuk hal baru karena sebelumnya saya download manual dari website WRF (UCAR). Bedanya, download WRF via github memungkin modul WRF seperti Chem, WRFDA dll otomatis terunduh, jadi tidak perlu didownload satu-per-satu lagi. Praktis.
- Mulai dengan konfigurasi kompilasi WRF dahulu. Bila menggunakan bash shell, pastikan WRF_CHEM=1 dan NETCDF_classic=1 sudah tersimpan di environment. Jalankan configure script, pilih opsi #34 (dmpar, gcc/gfortran) dan basic nesting (#1). Pastikan proses configure berjalan normal.
- Untuk WRF-Chem, pastikan YACC (Yet Another Compiler-Compiler) sudah terinstall. Bila tidak ada (di Mahameru tidak ada), lakukan instalasi manual dengan Bison (YACC sudah include di dalamnya). Jangan lupa, deklarasikan pathnya, misal: export YACC="$CUSLIB/bison/bin/yacc -d". Bison bisa diunduh di sini.
- Trik pertama. Setelah configure selesai, edit file configure.wrf, dan hilangkan 'time' pada bagian deklarasi variabel FC (fortran compiler). Misal: FC = time $(DM_FC) menjadi FC = $(DM_FC). Kenapa ini penting? Karena script compiler WRF menggunakan 'time' untuk mencatat proses kompilasi, sedangkan Mahameru tidak memiliki modul 'time' ini, sehingga kalau script configure.wrf tidak diubah, maka proses kompilasi nantinya akan gagal (dikenal juga dengan Error 127).
- Trik berikutnya, jalankan kompilasi dengan batch job di Mahameru. Kenapa harus pakai batch job? Proses kompilasi ini memakan memori yg besar, sehingga bila dijalankan langsung dari login node (shell tempat anda mulai login), akan ada suatu saat di mana sistem akan menghentikan proses kompilasi secara paksa (kill/terminate) karena batasan memori untuk login node (dikenal juga dengan Error 1). Untuk instalasi ini, saya menggunakan opsi #SBATCH --mem-per-cpu=16G pada script batch job untuk memastikan kompilasi mendapat alokasi yang cukup. Contoh script ada di catatan 3 di bawah.
- Bila proses kompilasi berjalan lancar, beberapa file executable akan tersedia di direktori /main WRF, antara lain: real.exe, wrf.exe, ndown.exe dan tc.exe. Kalau tidak ada, ya berarti proses kompilasi gagal dan kompilasi WPS selanjutnya tidak akan bisa dilakukan.
- Untuk WPS, pastikan library fortran yg dibutuhkan sudah dimuat pada environment. Bila belum, jalankan: export LD_LIBRARY_PATH=$NETCDF/lib64, di mana $NETCDF adalah direktori library netcdf yg aktif digunakan. Pastikan juga WRF_DIR=[direktori WRF] karena WPS perlu executable WRF untuk mengkompilasi WPS.
- Jalankan script configure WPS, pilih opsi #1 (serial), dan pastikan proses configure lancar. Bila ada pesan "Your Fortran + NETCDF did not run successfully" itu artinya langkah 10 di atas msh belum benar.
- Jalankan script kompilasi WPS. Proses ini bisa dilakukan di login node dan tidak sampai 5 menit selesai. Bila proses lancar, akan ada tiga file executable baru di direktori WPS: geogrid.exe, metgrid.exe dan ungrib.exe.
- Pastikan ketiga file tadi terhubung dengan library yang dibutuhkan dengan menggunakan perintah 'ldd'. Misalnya: ldd geogrid.exe. Kalau tidak ada masalah, seharusnya sistem akan menunjukkan link ke tiap library untuk file tersebut tanpa ada pesan error.
Catatan #1: WRF-Chem yang diinstall tidak menggunakan KPP Library
#SBATCH --job-name=insjob
#SBATCH --ntasks=1
#SBATCH --partition=short
#SBATCH --cpus-per-task=4
#SBATCH --mem-per-cpu=16G
module load openmpi4/4.1.4
export LD_LIBRARY_PATH=/opt/ohpc/pub/mpi/openmpi4-gnu12/4.1.4/lib:$LD_LIBRARY_PATH
export PATH=/opt/ohpc/pub/mpi/openmpi4-gnu12/4.1.4/bin:$PATH
# Your script goes here
./compile em_real >& log.compile
Tuesday, January 7, 2020
Research Note #26 - Filtering Data and Making Standard Deviation using Google Earth Engine
Wednesday, November 6, 2019
Research Note #25 - Reading a Text File Line-by-Line with Fortran
The program will open file 'list.txt', then read the first line of the file and put the (string) contents into variable 'filecontents'. It will then print the contents of variable onto the screen. Since there's a DO.. END DO statement, this process will repeat, with the next line being read, replacing the contents of variable 'filecontents'. This looping process will end once there are no more lines found in the file, invoking IOSTAT to a value other than 0 (0 means no I/O error occurred, other values mean there are I/O errors), then program will exit. That's all!
Some important notices:
- The absence of 'DO ... END DO' will make the program only reads the first line of the file.
- The absence of 'IF (io/=0) EXIT' will make the program runs endlessly, with the last line of the file kept being showed on the screen.
- If the output format is not determined (for example, FMT=* instead of A70), the program will not correctly show the file's contents. The (character) length of this format should be same or more than the one at variable declaration. Why 70? Because in this case, the full path of file list (in one line) has 70 characters.
Tuesday, November 5, 2019
Research Note #24 - Showing GCOM-C/SLGI Dataset Header/Metadata
Tuesday, October 15, 2019
Research Note #23 - GEE Script to Overlay Sentinel 2A with MODIS Terra/Aqua Hotspots
/**
* Function to mask clouds using the Sentinel-2 QA band
* @param {ee.Image} image Sentinel-2 image
* @return {ee.Image} cloud masked Sentinel-2 image
*/
function maskS2clouds(image) {
var qa = image.select('QA60');
// Bits 10 and 11 are clouds and cirrus, respectively.
var cloudBitMask = 1 << 10;
var cirrusBitMask = 1 << 11;
// Both flags should be set to zero, indicating clear conditions.
var mask = qa.bitwiseAnd(cloudBitMask).eq(0)
.and(qa.bitwiseAnd(cirrusBitMask).eq(0));
return image.updateMask(mask).divide(10000);
}
// Map the function over one year of data and take the median.
// Load Sentinel-2 TOA reflectance data.
var dataset = ee.ImageCollection('COPERNICUS/S2')
.filterDate('2018-11-01', '2018-11-15')
// Pre-filter to get less cloudy granules.
.filter(ee.Filter.lt('CLOUDY_PIXEL_PERCENTAGE', 20))
.map(maskS2clouds);
var rgbVis = {
min: 0.0,
max: 0.3,
bands: ['B11', 'B8', 'B4'],
};
Map.addLayer(dataset.median(), rgbVis, 'RGB');
Map.setCenter(74.516872, 30.475603, 14);
var aqua = ee.ImageCollection('MODIS/006/MYD14A1')
.filter(ee.Filter.date('2018-11-01', '2018-11-15'));
var fireMaskVis = {
min: 9.936350984054926,
max: 107.38312795164352,
bands: ['MaxFRP', 'FireMask', 'FireMask'],
};
Map.addLayer(aqua, fireMaskVis, 'Fire Mask');
var terra = ee.ImageCollection('MODIS/006/MOD14A1')
.filter(ee.Filter.date('2018-11-01', '2018-11-15'));
var fireMaskVis = {
min: 9.936350984054926,
max: 107.38312795164352,
bands: ['MaxFRP', 'FireMask', 'FireMask'],
};
Map.addLayer(terra, fireMaskVis, 'Fire Mask');
Friday, June 14, 2019
Research Note #22 - Reading GCOM-C 250m-Res HDF5 Data with Fortran
- I used Linux OS.
- I used Fortran 90 for programming.
- HDF5 (ver 1.8.17) libraries has been already installed in my system as module.
- I used JAXA's GCOM-C NDVI Monthly statistics (Level-2 data) with 250m spatial resolution with Sinusoidal/EQA projection. This data contains 4800x4800 pixels. For exemplary purpose, I renamed it to "ndvi.h5".
- CALL h5open_f(hdferr). This function initializes HDF5 library for Fortran uses. Returns 0 (to hdferr variable) if it's successful, and -1 if it's failed.
- CALL h5fopen_f(filename, H5F_ACC_RDONLY_F, fileid, hdferr). This function opens an existing HDF5 file. In this example, I just want to read it, hence H5F_ACC_RDONLY_F was used as argument. This function will return integers for file identifier and status to fileid and hdferr variables, respectively.
- CALL h5dopen_f(fileid, dataset, dset, hdferr). This function opens an existing dataset in the opened file. Take notice that it needs file identifier (from h5fopen_f), dataset name, dataset identifier and status (as previous functions).
- CALL h5dread_f(dset, H5T_NATIVE_INTEGER, ndvi_ave, dims, hdferr). This function reads raw data from dataset of the file, into a buffer. The buffer means a space in the computer memory, this could be a variable or array. Take notice that it need dataset identifier (from h5dopen_f), memory data type (Native integer), buffer, dimension (to store buffer dimension) and as always, status (hdferr).
Wednesday, March 13, 2019
Research Note #21 - Compiling Fortran Script for NetCDF Data Processing
Thursday, February 7, 2019
Research Note #20 - Preparing Emission Data with PREP-CHEM-SRC and CONVERT_EMISS for WRF-Chem
- The emission dataset used this post is published does not contain MEGAN emission data.
- I didn't use bbem/bbem plumerise and volcanic emission data.
- The map projection used in my simulation is mercator/ii.
- For more detailed information about the configurations in the namelist file, read this guide (it is much better than the original emission guide of WRF-Chem).
Another possible reason is the program overloads the memory because of compilation or grid settings in the namelist file, causing crash. If it's the case, execute 'ulimit -s unlimited' and try again.
- g1-ab.bin file is anthropogenic emission data (+ biogenic emission data, if you use it) for WRF-Chem
- g1-bb.bin file is biomass burning (+ plume rise, if you use it) emission data for WRF-Chem
- g1-gocartBG.bin is GOCART background emission data for WRF-Chem
- g1.gra and g1.vfm are binary files in GrADS format to visualize the emission data
- g1.ctl is GrADS control/descriptor file
Monday, December 24, 2018
Research Note #19 - Installing prep_chem_sources Utility for WRF-Chem
,CO &
-----------------------------^
convert_edgar_to_RELACS_REAC.f90(20): error #6405: The same named entity from different modules and/or program units cannot be referenced. [CH4]
,CH4 &
-----------------------------^
convert_edgar_to_RELACS_REAC.f90(21): error #6405: The same named entity from different modules and/or program units cannot be referenced. [SO2]
,SO2 &
-----------------------------^
compilation aborted for convert_edgar_to_RELACS_REAC.f90 (code 1)
9 use chem1_list
10 !use chem1_list, only : alke, bio,ora2,aro,ket,alka,ald
update 2019/01/31:
Changed F_OPTS because the "longer" version caused crash during execution of utility for GOCART background data.
C_OPTS= -O2
LOADER_OPTS= -O2






