MRGGRD

Latest: MRGGRD v2.0 (11JUN19) [Fortran] [Python]
17OCT25
Contents

Introduction

Part of the RFM handling of Irregular Grids (
.grd files)

MRGGRD is a FORTRAN90 program to combine two or more .grd files into a single file, taking the union of all selected grid points, and optionally modifying the spectral range.

The same operation can be achieved using the Python class rfm_grd_class.py

General Comments

  1. An application for this program would be to create a common irregular grid for RFM calculations where different absorbers are represented in .tab files on individual irregular grids (which can be extracted using the TABHDR program).
  2. The various input files must all be on the same common fine grid, but not necessarily the same (or even overlapping) spectral range
  3. The default option is to produce an output .grd file which exactly matches the spectral range of the user-supplied points, but the user has the option of modifying this range, any extension being filled with '0' (i.e., 'do not use this point') values.
  4. Whatever the final spectral range, the end points will always be flagged with '1' (i.e. 'use this point'), values, whether or not this point was flagged as '1' in any of the original grids.

Installing MRGGRD

Download the source code: [mrggrd.f90] or [rfm_grd_class.py]

If using the Fortran code, compile with any generic Fortran compiler, eg

gfortran mrggrd.f90 -o mrggrd
which will create an executable file mrggrd

Running MRGGRD

To run the Fortran program, type mrggrd (or ./mrggrd) and respond to the prompts.

A typical run might be (user responses, <CR> = Return/Enter)

mrggrd R-MRGGRD: Running MRGGRD v.2.0 Input .grd filenames (max= 10) ending with <CR> File# 1: file1.grd File# 2: file2.grd File# 3: <CR> Spectral range (<CR>= 727.6000: 792.1750 [cm-1]): <CR> Output file: common.grd New grid: Range= 727.6000 792.1750 [cm-1] Total, Used pts= 129151 4192 3.25% R-MRGGRD: Successful Completion

The program should run almost instantaneously.

For the Python version, if a simple merge of several files is required, a typical program (or interactive commands within the Python shell) might be as follows

from rfm_grd_class import Rfm_Grd grd = Rfm_Grd('file1.grd') # instantiate grd.merge('file2.grd') # merge with another grd grd.write('common.grd') # create output grd file

This creates terminal output

New grid: Range: 727.6000 792.1750 [cm-1] Total, Used pts: 129151 4192 3.25% Creating file: common.grd

The spectral range may also be modified using the Rfm_Grd.wnolim method (see MAKGRD example)

Version History

27AUG25
Add Python version
v2.00 (11JUN19)
Recoded in FORTRAN90
v1.00 (23JUL15)
Original code