This software reads MONAN data files in netcdf format and writes them into FM92-GRIB2
To compile MPAS_NC2GRIB on linux, it is necessary to previously install of ECCODES and netcdf-fotran libraries. To use the grid_ccsds packing type to produce more compressed grib be sure that ECCODES was compiled with the option -DENABLE_AEC=ON (Adaptive Entropy Coding library). The libaec must be istalled or/and loaded. The latest version of ECCODES available can be download from ECCODES relases page at https://confluence.ecmwf.int/display/ECC/Releases
To compile in a linux desktop with gfortran
ln -s makefile_config_lnx makefile_config
make
To use other fortran compilers or other compiler options, edit makefile_config_lnx
For informations about compilation in the supercomputer environments of INPE/CPTEC, see "special compilation instructions" or click here
Before run MPAS_NC2GRIB2 It is necessay set ECCODES_DIR , ECCODES_DEFINITION_PATH and NFDIR environments variables.
Set ECCODES_DIR with path where ECCODES software is. This definition is necessary to software find the grib definitions tables used in coding / decoding process. As example, in case bash terminal edit the .bashrc file and add the follow commnad.
export ECCODES_DIR=/home/User_name/eccodes
Note: The eccodes directory usualy contains the follow directories: bin, include, lib, share. The "share" is the directories where the grib definitions tables are.
Set the NFDIR with the path where NETCDF-FORTRAN is. As examples:
-
In usual instalation add in .bashrc environmet variable the commnad
export NFDIR=/usr/local
Set the NC2GRIB_DIR with the path where mpas_nc2grib directory is. It is necessary to software find specific configuration in the mpas_nc2grib2/settings directory. Example
export NC2GRIB_DIR=/home/User_name/mpas_nc2grib2
Type the follow commnad
./bin/mpas_nc2grib2.x
Generic scripts to run MPAS_NC2GRIB software with examples is in the "examples/example1" diretory. So, go to the "examples/example1" and run the followed scripts:
-
1-download_sample_data.sh: This script download a set off MPAS_MONAN NETCDF file from ftp1.cptec.inpe.br and places them in ./datain
- Type ls -ltr ./datain to verify if the files were download.
-
2-running mpas_nc2grib.x: Use one of followed scripts to run mpas_nc2grib.x:
- a) run_mpas_nc2grib2.sh (with grid simple packing type)
- b) run_mpas_nc2grib2_cssds.sh (with ccsds packing type - more compressed option)
The scripts runs MPAS_NC2GRIB to convert the MPAS_FILE in datain to GRIB2 file in dataout.
MONAN_DIAG_G_POS_GFS_2024070900_2024070900.x1024002L55.grib2
MONAN_DIAG_G_POS_GFS_2024070900_2024070903.x1024002L55.grib2
MONAN_DIAG_G_POS_GFS_2024070900_2024070906.x1024002L55.grib2
MONAN_DIAG_G_POS_GFS_2024070900_2024070912.x1024002L55.grib2
MONAN_DIAG_G_POS_GFS_2024070900_2024071000.x1024002L55.grib2
- Type ls -ltr ./dataout to verify if the grib files were generated
- 3-grib_decoding_test.sh: This script do the inverse process, i.e. decoding the grib file to nc as well as into other formats.
For more details see UserGuide.md or click on : user guide