#!/bin/sh 
#
# Part of rksuite_90 v1.2 (December 1995)
#         software for initial value problems in ODEs
#
# Authors: R.W. Brankin (NAG Ltd., Oxford, England)
#          I. Gladwell  (Math Dept., SMU, Dallas, TX, USA)
#          see main doc for contact details
#
# Script to automate generation of 2d array dependent variable
# version of rksuite_90 from a 1d array dependent variable version
#
# USAGE do_1_to_2 <infile >outfile
#
# NOTE if "infile" is not the distributed copy of "rksuite_90.bas"
#      the results are not predictable
#
# NOTE this script is not meant to be neat/fast/efficient/...
#      however, it does work!
#
sed -e "s/\(_[rc]\)1/\12/" \
    -e "s/_1d/_2d/" \
    -e "/.*[^\!]$/s/(:/(:,:/g" \
    -e "/\!spec-/s/(:/(:,:/g" \
    -e "/.*dep\!$/s/(:/(:,:/g" \
    -e "/.*dep\!$/s/\(size([a-z]\),1/\1,1),\1,2/g" \
    -e "/.*alloc\!$/s/\(size([^,]*\),1/\1,1),\1,2/g"
