BEGIN_SHELL [ /usr/bin/python ] for i in [('r' ,'real'), \ ('d','double precision'), \ ('l','logical'), \ ('i','integer'), \ ('c','character*(*)'), \ ]: print "subroutine "+i[0]+"info (here,token,value)" print " implicit none" print " character*(*) :: here" print " character*(*) :: token" print " "+i[1]+" :: value" print " if (mpi_master) then" print " print *, trim(here)//':'" if i[0] == 'l': print " if (value) then" print " print *, ' -> ', trim(token), '= True' " print " else" print " print *, ' -> ', trim(token), '= False' " print " endif" else: print " print *, ' -> ', trim(token), '=', value" print " endif" print "end" END_SHELL subroutine info(here,message) implicit none character*(*) :: here, message if (mpi_master) then print *, trim(here)//':' print *, ' -> ', trim(message) endif end