      program calzero381ns
C..........................................................Dec 2021
C calculate WUns = 0 from indices for 381 storms
C Coinsidence 1)WUn=0 & WUs =0,2)WLn=0 & WLs =0 3) WUn=0 &WLs=0 4) WUs =0	& WLn
C
      character*64 infile1,infile2,infile3,infile4
	+,outfile
	integer  idat1(72),idat2(72),idat3(72),idat4(72)
C
	infile1='hsswu3dn.txt' !
	infile2='hsswl3dn.txt' !
	infile3='hsswu3ds.txt' !
	infile4='hsswl3ds.txt' !
	outfile='calzero381.res'
	OPEN(10,file=outfile,access='APPEND')
C
   25	OPEN(11,file=infile1,action='READ')	  !un
      OPEN(12,file=infile2,action='READ')	  !ln
	OPEN(13,file=infile3,action='READ')	  !us
	OPEN(14,file=infile4,action='READ')	  !ls
 	DO ll=1,381	   !+++++++++
	read(11,*,end=44) idat1	   !WUn
	read(12,*,end=45) idat2	   !WLn
	read(13,*,end=46) idat3	   !WUs
	read(14,*,end=47) idat4	   !WLs
      icunus1=0
	iclnls1=0
      icunls1=0
	icusln1=0
C
	do k=1,24
	if ((idat1(k).eq.0).and.(idat3(k).eq.0)) icunus1=icunus1+1
	if ((idat2(k).eq.0).and.(idat4(k).eq.0)) iclnls1=iclnls1+1
	if ((idat1(k).eq.0).and.(idat4(k).eq.0)) icunls1=icunls1+1
	if ((idat3(k).eq.0).and.(idat2(k).eq.0)) icusln1=icusln1+1
	enddo
C
      icunus1=0
	iclnls1=0
      icunls1=0
	icusln1=0
C
	do k=1,24
	if ((idat1(k).eq.0).and.(idat3(k).eq.0)) icunus1=icunus1+1
	if ((idat2(k).eq.0).and.(idat4(k).eq.0)) iclnls1=iclnls1+1
	if ((idat1(k).eq.0).and.(idat4(k).eq.0)) icunls1=icunls1+1
	if ((idat3(k).eq.0).and.(idat2(k).eq.0)) icusln1=icusln1+1
	enddo
C
      icunus2=0
	iclnls2=0
      icunls2=0
	icusln2=0
C
	do k=25,48
	if ((idat1(k).eq.0).and.(idat3(k).eq.0)) icunus2=icunus2+1
	if ((idat2(k).eq.0).and.(idat4(k).eq.0)) iclnls2=iclnls2+1
	if ((idat1(k).eq.0).and.(idat4(k).eq.0)) icunls2=icunls2+1
	if ((idat3(k).eq.0).and.(idat2(k).eq.0)) icusln2=icusln2+1
	enddo
      icunus3=0
	iclnls3=0
      icunls3=0
	icusln3=0
C
	do k=49,72
	if ((idat1(k).eq.0).and.(idat3(k).eq.0)) icunus3=icunus3+1
	if ((idat2(k).eq.0).and.(idat4(k).eq.0)) iclnls3=iclnls3+1
	if ((idat1(k).eq.0).and.(idat4(k).eq.0)) icunls3=icunls3+1
	if ((idat3(k).eq.0).and.(idat2(k).eq.0)) icusln3=icusln3+1
	enddo
	ENDDO		  !+++++++++
   44	close(unit=11)
   45	close(unit=12)
   46	close(unit=13)
   47	close(unit=14)
   30	format(72(1X,F5.0))
   31	format(4(1X,I4))
   32	format(1X,A1,I1,A16)
      icnt1=0
	icnt2=0
	icnt3=0
	icnt4=0
	icnt1=icunus1+icunus2+icunus3
	icnt2=iclnls1+iclnls2+iclnls3
	icnt3=icunls1+icunls2+icunls3
	icnt4=icusln1+icusln2+icusln3
	 pcunus1=icunus1/91.44
	pclnls1=iclnls1/91.44
	pcunls1=icunls1/91.44
	pcusln1=icusln1/91.44
	 pcunus2=icunus2/91.44
	pclnls2=iclnls2/91.44
	pcunls2=icunls2/91.44
	pcusln2=icusln2/91.44
	 pcunus3=icunus3/91.44
	pclnls3=iclnls3/91.44
	pcunls3=icunls3/91.44
	pcusln3=icusln3/91.44
	 pcnt1=icnt1/274.32
	pcnt2=icnt2/274.32
	pcnt3=icnt3/274.32
	pcnt4=icnt4/274.32
	write(*,33) ' pcunus',pcunus1,pcunus2,pcunus3,pcnt1	
	write(10,33) ' pcunus',pcunus1,pcunus2,pcunus3,pcnt1
	write(*,33) ' pclnls',pclnls1,pclnls2,pclnls3,pcnt2	
	write(10,33) ' pclnls', pclnls1,pclnls2,pclnls3,pcnt2	
	write(*,33) ' pcunls',pcunls1,pcunls2,pcunls3,pcnt3	
	write(10,33) ' pcunls', pcunls1,pcunls2,pcunls3,pcnt3	
	write(*,33) ' pcusln',pcusln1,pcusln2,pcusln3,pcnt4	
	write(10,33)  ' pcusln',pcusln1,pcusln2,pcusln3,pcnt4

   42	CONTINUE
   33	format(4(1X,F6.2))
  222	close(unit=10)
       pause ' '
	STOP
	END