program rough_process real ave,sig,var real ave1,sig1,var1 real ave2,sig2,var2 real ave3,sig3,var3 real ave4,sig4,var4 real ave5,sig5,var5 real position(1700),height(1700) real position1,height1 real position2,height2 real position3,height3 real position4,height4 real position5,height5 integer i open(unit=20,file='06170934.l93') open(unit=21,file='06170943.l93') open(unit=22,file='06170952.l93') open(unit=23,file='06171002.l93') open(unit=24,file='06171009.l93') open(unit=25,file='roughness.dat') ave=0.0 ave1=0.0 ave2=0.0 ave3=0.0 ave4=0.0 ave5=0.0 do i=1,333 read(20,*) position1,height1 read(21,*) position2,height2 read(22,*) position3,height3 read(23,*) position4,height4 read(24,*) position5,height5 position(i)=position1 position(i+333)=position2+1000 position(i+666)=position3+2000 position(i+999)=position4+3000 position(i+1332)=position5+4000 height(i)=height1-(9./1000.)*position1 height(i+333)=height2-(12.5/1000.)*position2 height(i+666)=height3-(11./1000.)*position3 height(i+999)=height4-(9./1000.)*position4 height(i+1332)=height5-(9./1000.)*position5 ave=ave+(height(i)+height(i+333)+height(i+666) & +height(i+999)+height(i+1332))/1665.0 ave1=ave1+height(i)/333.0 ave2=ave2+height(i+333)/333.0 ave3=ave3+height(i+666)/333.0 ave4=ave4+height(i+999)/333.0 ave5=ave5+height(i+1332)/333.0 enddo var=0.0 var1=0.0 var2=0.0 var3=0.0 var4=0.0 var5=0.0 do i=1,333 height1=-1.0*(height(i)-ave1) height2=-1.0*(height(i+333)-ave2) height3=-1.0*(height(i+666)-ave3) height4=-1.0*(height(i+999)-ave4) height5=-1.0*(height(i+1332)-ave5) var1=var1+height1**2/332.0 var2=var2+height2**2/332.0 var3=var3+height3**2/332.0 var4=var4+height4**2/332.0 var5=var5+height5**2/332.0 enddo do i=1,1665 height(i)=-1.0*(height(i)-ave) var=var+height(i)**2/1664.0 write(25,*)position(i),height(i) enddo sig=sqrt(var) sig1=sqrt(var1) sig2=sqrt(var2) sig3=sqrt(var3) sig4=sqrt(var4) sig5=sqrt(var5) print*,'ave,sig = ',ave,' ',sig,' mm' print*,'ave1,sig1 = ',ave1,' ',sig1,' mm' print*,'ave2,sig2 = ',ave2,' ',sig2,' mm' print*,'ave3,sig3 = ',ave3,' ',sig3,' mm' print*,'ave4,sig4 = ',ave4,' ',sig4,' mm' print*,'ave5,sig5 = ',ave5,' ',sig5,' mm' close(20) close(21) close(22) close(23) close(24) close(25) stop end