File: msgparser.f90

package info (click to toggle)
jtdx 2.2.159%2Bimproved-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 75,336 kB
  • sloc: cpp: 38,503; f90: 31,141; python: 27,061; ansic: 11,772; sh: 409; fortran: 353; makefile: 232
file content (29 lines) | stat: -rw-r--r-- 1,111 bytes parent folder | download | duplicates (2)
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
subroutine msgparser(msg37,msg37_2)

  character msg37*37,msg37_2*37,call1*12,call2*12,call3*12,report*6

! ES1JA RR73; TA1BM <...> -22 
! ES1JA RR73; TA1BM <SX60RAAG> -22

  call1='            '; call2='            '; call3='            '; report='      '
  ispc1=index(msg37,' '); ispc2=index(msg37((ispc1+1):),' ')+ispc1
  ispc3=index(msg37((ispc2+1):),' ')+ispc2; ispc4=index(msg37((ispc3+1):),' ')+ispc3
  ispc5=index(msg37((ispc4+1):),' ')+ispc4
  if(ispc5.gt.20) then
    call1=msg37(1:ispc1-1); call2=msg37(ispc2+1:ispc3-1)
    if(msg37(ispc3+1:ispc3+2).eq.'<.') then
      call3='<...>'
    else
      call3=msg37(ispc3+1:ispc4-1)
      if(call3(1:1).eq.'<') call3=call3(2:12)//' '
      ib=index(call3,'>'); if(ib.gt.3) call3(ib:ib)=' '
    endif
    if(len_trim(call3).lt.11) then; report=msg37(ispc4+1:ispc5-1); else; report=msg37(ispc4+1:37); endif
    msg37='                                     '
! build standard messages
    msg37=trim(call1)//' '//trim(call3)//' RR73'
    msg37_2=trim(call2)//' '//trim(call3)//' '//trim(report)
  endif

  return
end subroutine