File: setup65.f90

package info (click to toggle)
wsjtx 2.7.0%2Brepack-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 70,440 kB
  • sloc: cpp: 75,379; f90: 46,460; python: 27,241; ansic: 13,367; fortran: 2,382; makefile: 197; sh: 133
file content (96 lines) | stat: -rwxr-xr-x 2,138 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
subroutine setup65

! Defines arrays related to the JT65 pseudo-random synchronizing pattern.
! Executed at program start.

  use jt65_mod
  integer nprc(126)

! JT65
  data nprc/                                   &
      1,0,0,1,1,0,0,0,1,1,1,1,1,1,0,1,0,1,0,0, &
      0,1,0,1,1,0,0,1,0,0,0,1,1,1,0,0,1,1,1,1, &
      0,1,1,0,1,1,1,1,0,0,0,1,1,0,1,0,1,0,1,1, &
      0,0,1,1,0,1,0,1,0,1,0,0,1,0,0,0,0,0,0,1, &
      1,0,0,0,0,0,0,0,1,1,0,1,0,0,1,0,1,1,0,1, &
      0,1,0,1,0,0,1,1,0,0,1,0,0,1,0,0,0,0,1,1, &
      1,1,1,1,1,1/
  data mr2/0/                !Silence compiler warning

! Put the appropriate pseudo-random sequence into pr
  nsym=126
  do i=1,nsym
     pr(i)=2*nprc(i)-1
  enddo

! Determine locations of data and reference symbols
  k=0
  mr1=0
  do i=1,nsym
     if(pr(i).lt.0.0) then
        k=k+1
        mdat(k)=i
     else
        mr2=i
        if(mr1.eq.0) mr1=i
     endif
  enddo
  nsig=k

! Determine the reference symbols for each data symbol.
  do k=1,nsig
     m=mdat(k)
     mref(k,1)=mr1
     do n=1,10                     !Get ref symbol before data
        if((m-n).gt.0) then
           if (pr(m-n).gt.0.0) go to 10
        endif
     enddo
     go to 12
10   mref(k,1)=m-n
12   mref(k,2)=mr2
     do n=1,10                     !Get ref symbol after data
        if((m+n).le.nsym) then
           if (pr(m+n).gt.0.0) go to 20
        endif
     enddo
     cycle
20   mref(k,2)=m+n
  enddo

! Now do it all again, using opposite logic on pr(i)
  k=0
  mr1=0
  do i=1,nsym
     if(pr(i).gt.0.0) then
        k=k+1
        mdat2(k)=i
     else
        mr2=i
        if(mr1.eq.0) mr1=i
     endif
  enddo
  nsig=k

  do k=1,nsig
     m=mdat2(k)
     mref2(k,1)=mr1
     do n=1,10
        if((m-n).gt.0) then
           if (pr(m-n).lt.0.0) go to 110
        endif
     enddo
     go to 112
110  mref2(k,1)=m-n
112  mref2(k,2)=mr2
     do n=1,10
        if((m+n).le.nsym) then
           if (pr(m+n).lt.0.0) go to 120
        endif
     enddo
     cycle
120  mref2(k,2)=m+n
  enddo

  return
end subroutine setup65