#!/bin/bash

# usage: make-mpif <fort_real_size> <fort_double_size>
#   e.g. make-mpif 4 8
#
# from the template in mpif.master.h, creates mpif.realXdoubleY.h file
#

set -e

if [ $# -ne 2 ]
  then echo 'Usage: make-mpif <fort_real_size> <fort_double_size>'
       exit 1
fi

RSIZE=$1
DSIZE=$2

DEST=mpif.real${RSIZE}double${DSIZE}.h
/bin/rm -f $DEST

sed -e s/_RSIZE_/$RSIZE/ -e s/_DSIZE_/$DSIZE/ <mpif.master.h >$DEST
chmod -w $DEST


