program maskreding implicit none integer idim,jdim,kdim,tdim parameter(idim=513,jdim=386,kdim=30,tdim=12) real*8 h8(idim,jdim),mask8(idim,jdim) real h4(idim,jdim),srho(kdim),mask(idim,jdim) integer i,j,k,t open(11,file='mask.dat',form='unformatted') read(11)mask8 close(11) do j=1,jdim do i=1,idim mask(i,j)=mask8(i,j) enddo enddo open(51,file='mask4.dat',form='unformatted') write(51)mask end