      subroutine lodout(cload,stnam,rlat,rlam,ht,modo)
c  puts the data into a single ASCII rescaled file for all
c  constituents, in order of frequency. Loads are written out in
c  amp and local or Greenwich phase, lags neg
c
      character*80 stnam,mdfile
      character*80 grname
      character*80 polnam
      character*50 mdnam
      character*24 dates
      character*4 dsym
      character*1 modo,statgr,alpoly
      complex cload,toloc,phasor,cmp,dumm
      dimension cload(9),cmp(3)
      common/modpar/mdfile,dsym,icte(6),mdnam
      common/grinf/nring,rin(10),rout(10),rsz(10),statgr(10),grname
      common/polynm/polnam,alpoly
      common/coninf/dist,close,clat,clong,numnf,clnf,farnf
      phasor(dumm) =
     1 cmplx(cabs(dumm),57.2958*atan2(aimag(dumm),real(dumm)))
      data dr/.0174532935/
      data luo/6/
      write(luo,201) 'S',stnam, rlat, rlam, ht
 201  format(a1,2x,a40,3x,f10.4,f10.4,f10.0)
      write(luo,203) 'O',dsym,(icte(j),j=1,6),mdnam
 203  format(a1,1x,a4,5x,6i2,5x,a50)
      write(luo,205) 'G',grname
 205  format(a1,2x,a78)
      do 3 i=1,nring
      if(statgr(i).eq.'F') write(luo,207) rin(i),rout(i),rsz(i)
 207  format('G    Rings from ',f6.2,' to ',f6.2,' with spacing ',
     1 f4.2,' - detailed grid used')
      if(statgr(i).eq.'C') write(luo,209) rin(i),rout(i),rsz(i)
 209  format('G    Rings from ',f6.2,' to ',f6.2,' with spacing ',
     1 f4.2,' - ocean model grid used')
 3    continue
      if(alpoly.ne.'N') then
         write(luo,211) polnam
 211     format('P',1x,a78)
         if(alpoly.eq.'+') write(luo,212)
 212     format('P   all polygon areas included')
         if(alpoly.eq.'-') write(luo,213)
 213     format('P   all polygon areas excluded')
         if(alpoly.eq.'Y') write(luo,214)
 214     format('P   polygon areas included and excluded as in file')
      endif
c following three lines depend on a specific routine, which returns time
c information in string   dates
      call fdate(dates)
      write(luo,219) dates
 219  format('C   Version 3.0 of load program, run at ',a24)
      write(luo,221) close,clat,clong
 221  format('C   closest nonzero load was ',f6.2,' degrees away, at',
     1 2f8.2)
      if(numnf.ne.0) write(luo,223) numnf,clnf,farnf
 223  format('C   ',i6,' zero loads found where ocean present, range',
     1 f7.2,'-',f7.2,' deg')
      if(modo.eq.'g') write(luo,225)
 225  format('L g          Phases are Greenwich, lags negative')
      if(modo.eq.'l') write(luo,227)
 227  format('L l          Phases are local, lags negative')
      write(luo,231)
 231  format('X')
      isp = icte(1)
      toloc = cmplx(cos(dr*isp*rlam),sin(dr*isp*rlam))
      if(modo.eq.'g') toloc = cmplx(1.,0.)
c
c      gravity
c
      cmp(1) = 1.e8*toloc*cload(1)
      dumm = conjg(cmp(1))
      cmp(1) = phasor(dumm)
      write(luo,235) cmp(1)
 235  format('g',9x,2f10.4)
c
c      displacement (output as E N Z)
c
c  change sign of N and E (see CJ II-143, 5 Jan 82)
      cmp(1) = -1.e3*toloc*cload(4)
      cmp(2) = -1.e3*toloc*cload(3)
      cmp(3) =  1.e3*toloc*cload(2)
      do 5 i =1,3
      dumm = conjg(cmp(i))
 5    cmp(i) = phasor(dumm)
      write(luo,237) cmp
 237  format('d',9x,6f10.4)
c
c      tilt (output as E N)
c
      cmp(1) = 1.e9*toloc*cload(6)
      cmp(2) = 1.e9*toloc*cload(5)
      do 7 i = 1,2
      dumm = conjg(cmp(i))
 7    cmp(i) = phasor(dumm)
      write(luo,239) cmp(1),cmp(2)
 239  format('t',9x,4f10.4)
c
c      strain (output as E, N, EN shear)
c
      cmp(1) = 1.e9*toloc*cload(8)
      cmp(2) = 1.e9*toloc*cload(7)
      cmp(3) = 1.e9*toloc*cload(9)
      do 9 i = 1,3
      dumm = conjg(cmp(i))
 9    cmp(i) = phasor(dumm)
      write(luo,241) cmp
 241  format('s',9x,6f10.4)
 13   continue
      return
      end
