#!/bin/sh # This script generates the very repetitive code for parsing the # GRAY parameters from a string. The output is embedded # into gray_params.f90 using a CPP include directive. sets='antenna equilibrium profiles raytracing ecrh_cd output misc' # shellcheck disable=SC2034 { antenna='alpha beta power psi chi iox ibeam filenm fghz pos w ri phi' equilibrium='ssplps ssplf factb sgnb sgni ixp iequil icocos ipsinorm idesc ifreefmt filenm' profiles='psnbnd sspld factne factte iscal irho iprof filenm' raytracing='rwmax dst nrayr nrayth nstep igrad idst ipass ipol' ecrh_cd='iwarm ilarm imx ieccd' output='ipec nrho istpr istpl' misc='rwall' } deref() { eval "echo \$$1"; } for set in $sets; do for param in $(deref "$set"); do cat < 0) error = ERR_VALUE EOF done done