#! /bin/env /usr/local/pkg/usg/python-1.5.1/bin/python


import string
import os
import sys


# main program 
for line in sys.stdin.readlines():
	line = string.replace(line, "REAL*8", "real(kind=dp)")
	line = string.replace(line, "real*8", "real(kind=dp)")
	line = string.replace(line, "REAL", "real(kind=dp)")      
	line = string.replace(line,"D0","E0_dp")
	if string.find(line,"kind") == -1:
		line = string.replace(line, "real", "real(kind=dp)")
	if string.find(line, "IMPLICIT NONE") != -1 or string.find(line,"implicit none") != -1:
		print "      use kind_spec\n"
	print line[:-1]
