      subroutine stat_msg(routine_name,msg_str)
C
C Description:
C 
C This routines reports status messages in a standard fashion.
C
C User interface:
C
C name          in/out type           structure  purpose
C
C routine_name  in     character*(*)  scalar     The name of the routine
C                                                from which this routine
C                                                is invoked. It is nice
C                                                to know from where this 
C                                                message originates.
C msg_str       in     character*(*)  scalar     The error message to be
C                                                presented to the user.
C
C Errors:
C
C The standard array of I/O errors can occur but they are ignored
C because this is an error handling routine and it would be easy
C to get into an error loop.
C
C Notes:
C
C This routine reports statis to both the debug unit and the error unit.
C If the debug unit has not been opened, this routine will put the 
C message in a file called 'fort.7'. (The 'fort.7' file is specific to
C a Sun compiler. It will probably do something
C else on your machine.) Of course, the error unit is normally
C attached to the console so error messages will appear there by default.
C If you are not running UNIX, you need to find out what the standard
C error reporting unit is and change 'stderr' to that value. 'stderr'
C can be found in the file 'std_io.f'
C
C Subroutine accessed
C fnblnk
C lnblnk
C ut
C gerror
C
C Portability issues:
C
C The ut and gerror routines are implemented in Sun's FORTRAN library and
C are not generally portable. If you are not using a Sun computer and
C the proper Sun compiler then  this routine must be changed 
C in order to make it work.
C
C The easiest change is to remove/change all the lines from this routine that
C have to do with date and time stamping. Also remove lines that depend
C on gerror. Comments below indicate which lines should be removed/changed 
C for this simple fix.
C
      implicit none
      include 'std_io.for'
      integer ptr1,ptr2,ptr3,ptr4,
     $     fnblnk,lnblnk,date,time
      character*(*) routine_name,msg_str
      character*3 month
      dimension date(3),time(3),month(12)
      data month/'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug',
     $     'Sep','Oct','Nov','Dec'/
C
C For portability, comment out the following line
C
      call ut(date,time)
      ptr1=fnblnk(msg_str)
      ptr2=lnblnk(msg_str)
      ptr3=fnblnk(routine_name)
      ptr4=lnblnk(routine_name)
C
C For portability, comment out the following 3 lines
C
c      call gerror(err_str)
c      ptr5=lnblnk(err_str)
c      err_str='('//routine_name(ptr3:ptr4)//') '//err_str(1:ptr5)
C
C      write(unit=stderr,fmt=3) routine_name(ptr3:ptr4),
C     $     msg_str(ptr1:ptr2)
C      write(unit=debug,fmt=3) routine_name(ptr3:ptr4),
C     $     msg_str(ptr1:ptr2)
C 3    format('***ERROR*** (',a,') ',a)
C
C For portability, uncomment the preceeding lines and 
C comment out the following 13 lines 
C
      write(unit=stderr,fmt=1) date(1),month(date(2)),date(3),
     $     time(1),time(2),time(3),routine_name(ptr3:ptr4),
     $     msg_str(ptr1:ptr2)
c      write(unit=stderr,fmt=2) err_str(1:lnblnk(err_str))
      write(unit=debug,fmt=1) date(1),month(date(2)),date(3),
     $     time(1),time(2),time(3),routine_name(ptr3:ptr4),
     $     msg_str(ptr1:ptr2) 
c      write(unit=debug,fmt=2) err_str(1:lnblnk(err_str))
 1    format(' ***STATUS*** ',
     $     i2,' ',a3,' ',i4,' ',
     $     i2.2,':',i2.2,':',i2.2,'UT (',a,') ',
     $     a)
c 2    format(a)
      return
      end
