c
c @(#)mlwrs.f	1.2
c
      subroutine mlwrs

      include 'mladv.inc'

      common/inform/ifdiff,ifpert,titl(20,2),runid(6),restid(9),
     +              idstring,ident

      character*80 ident,fname
      character*70 idstring
      character*4 restid,runid

      data iopen/0/

      if (iopen .eq. 0) then
         iopen = 1
         iflen=lnblk(ident,80)
         fname=ident(:iflen)//'.mrs'
         open(unit=imlwrs,file=fname,form='unformatted',status='new')
        endif

      write(imlwrs)mltime
      write(imlwrs)mlcur,mlpast,imlcnt,iwcur,iwpast,icw
      write(imlwrs)strm0
      write(imlwrs)wsurf
      write(imlwrs)wzvel
      write(imlwrs)hdpth
      write(imlwrs)buoy
      write(imlwrs)temp
      write(imlwrs)trace
      write(imlwrs)bnddpth
      write(imlwrs)bndbuoy
      write(imlwrs)bndtemp
      write(imlwrs)bndtrace
      write(imlwrs)adv
      write(imlwrs)szz
      write(imlwrs)taux
      write(imlwrs)tauy

      return
      end
