#!/usr/bin/perl -n
# fix obsolete functions to their correct names
# intrinsics.pl file.f > outputfile.out
######################################
chop;
(/^[cC]/) && (print"$_\n");
(/^[cC]/) && (next);
#DSIN(
if (/(.*)([\(\*\=\+\-\/\s])\s*d\s*s\s*i\s*n\s*\((.*)/){
        $_= "$1$2sin($3";
}
#DCOS(
if (/(.*)([\(\*\=\+\-\/\s])\s*d\s*c\s*o\s*s\s*\((.*)/){
        $_= "$1$2cos($3";
}
#CDSQRT(
if (/(.*)([\(\*\=\+\-\/\s])\s*c\s*d\s*s\s*q\s*r\s*t\s*\((.*)/){
        $_= "$1$2sqrt($3";
}
#DACOS(
if (/(.*)([\(\*\=\+\-\/\s])\s*d\s*a\s*c\s*o\s*s\s*\((.*)/){
        $_= "$1$2acos($3";
}
#DATAN2(
if (/(.*)([\(\*\=\+\-\/\s])\s*d\s*a\s*t\s*a\s*n\s*2\s*\((.*)/){
        $_= "$1$2atan2($3";
}
#DATAN(
if (/(.*)([\(\*\=\+\-\/\s])\s*d\s*a\s*t\s*a\s*n\s*\((.*)/){
        $_= "$1$2atan($3";
}
#DCOSH(
if (/(.*)([\(\*\=\+\-\/\s])\s*d\s*c\s*o\s*s\s*h\s*\((.*)/){
        $_= "$1$2cosh($3";
}
#DEXP(
if (/(.*)([\(\*\=\+\-\/\s])\s*d\s*e\s*x\s*p\s*\((.*)/){
        $_= "$1$2exp($3";
}
#DLOG10(
if (/(.*)([\(\*\=\+\-\/\s])\s*d\s*l\s*o\s*g\s*1\s*0\s*\((.*)/){
        $_= "$1$2log10($3";
}
#DLOG(
if (/(.*)([\(\*\=\+\-\/\s])\s*d\s*l\s*o\s*g\s*\((.*)/){
        $_= "$1$2log($3";
}
#DMAX1(
if (/(.*)([\(\*\=\+\-\/\s])\s*d\s*m\s*a\s*x\s*1\s*\((.*)/){
        $_= "$1$2max($3";
}
#DMIN1(
if (/(.*)([\(\*\=\+\-\/\s])\s*d\s*m\s*i\s*n\s*1\s*\((.*)/){
        $_= "$1$2min($3";
}
#DREAL(
if (/(.*)([\(\*\=\+\-\/\s])\s*d\s*r\s*e\s*a\s*l\s*\((.*)/){
        $_= "$1$2real($3";
}
#DSIGN(
if (/(.*)([\(\*\=\+\-\/\s])\s*d\s*s\s*i\s*g\s*n\s*\((.*)/){
        $_= "$1$2sign($3";
}
#DSINH(
if (/(.*)([\(\*\=\+\-\/\s])\s*d\s*s\s*i\s*n\s*h\s*\((.*)/){
        $_= "$1$2sinh($3";
}
#DSQRT(
if (/(.*)([\(\*\=\+\-\/\s])\s*d\s*s\s*q\s*r\s*t\s*\((.*)/){
        $_= "$1$2sqrt($3";
}
#IDINT(
if (/(.*)([\(\*\=\+\-\/\s])\s*i\s*d\s*i\s*n\s*t\s*\((.*)/){
        $_= "$1$2int($3";
}
#IDNINT(
if (/(.*)([\(\*\=\+\-\/\s])\s*i\s*d\s*n\s*i\s*n\s*t\s*\((.*)/){
        $_= "$1$2nint($3";
}
#ISIGN(
if (/(.*)([\(\*\=\+\-\/\s])\s*i\s*s\s*i\s*g\s*n\s*\((.*)/){
        $_= "$1$2sign($3";
}
#DMAX0(
if (/(.*)([\(\*\=\+\-\/\s])\s*d\s*m\s*a\s*x\s*0\s*\((.*)/){
        $_= "$1$2max($3";
}
#DMIN0(
if (/(.*)([\(\*\=\+\-\/\s])\s*d\s*m\s*i\s*n\s*0\s*\((.*)/){
        $_= "$1$2min($3";
}
#MAX0(
if (/(.*)([\(\*\=\+\-\/\s])\s*m\s*a\s*x\s*0\s*\((.*)/){
        $_= "$1$2max($3";
}
#MIN0(
if (/(.*)([\(\*\=\+\-\/\s])\s*m\s*i\s*n\s*0\s*\((.*)/){
        $_= "$1$2min($3";
}
#IABS(
if (/(.*)([\(\*\=\+\-\/\s])\s*i\s*a\s*b\s*s\s*\((.*)/){
        $_= "$1$2abs($3";
}
print "$_\n";
