-
Notifications
You must be signed in to change notification settings - Fork 23
/
prtmsk.F90
56 lines (56 loc) · 1.58 KB
/
prtmsk.F90
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
subroutine prtmsk(mask,array,work,idm,ii,jj,offset,scale,title)
!
! --- Delete 'array' elements outside 'mask'. Then
! --- break 'array' into sections, each 'nchar' characters wide, for printing.
!
implicit none
integer nchar
parameter (nchar=120)
!cc parameter (nchar= 76)
!cc parameter (nchar= 80)
!cc parameter (nchar=132)
!
integer idm,ii,jj
integer mask(idm,*)
real array(idm,*),work(idm,*)
real offset,scale
character title*(*)
!
integer lp
common/linepr/ lp
save /linepr/
!
integer i,i1,i2,j,n,ncols
!
real cvmgp,cvmgz,a,b,c
integer ic
cvmgp(a,b,c)=a*(.5+sign(.5,c))+b*(.5-sign(.5,c))
cvmgz(a,b,ic)=cvmgp(a,b,-1.*iabs(ic))
!
ncols=nchar/4
do n=1,ii/ncols+1
i1=ncols*(n-1)+1
i2=min0(ncols*n,ii)
if (i1.gt.i2) exit
write &
(lp,'(/'' Sec.'',i2,'' (cols'',i4,'' -'',i4,'') -- '',a)') &
n,i1,i2,title
!cc if (i2.lt.i1+5) then
!cc write (lp,'('' (Not printed. Too few columns. Save paper.)'')')
!cc exit
!cc end if
do j=jj,1,-1
do i=i1,i2
work(i,j)=cvmgz(0.,array(i,j),mask(i,j))
enddo
do i=i1,i2
work(i,j)=cvmgz(0.,(work(i,j)-offset)*scale,mask(i,j))
enddo
write (lp,'(32i4)') j,(int(work(i,j)),i=i1,i2)
!cc write (lp,'(i4,1x,75i1)') j,(int(work(i,j)),i=i1,i2)
!cc write (lp,'(i4,1x,120i1)') j,(int(work(i,j)),i=i1,i2)
enddo
enddo
call flush(lp)
return
end