main.f90 1.11 KB
PROGRAM WIM2


	use parameters
	call read_namelist
	call array_allocation
	call initialization
	
	


!______________________________________________________





!_______________________TIME LOOP______________________
	do n=2,nsteps
	
	call progress(n,nsteps)
	
		do i=2,nbin
		call advection		
		!call attenuation
		!call floe_breaking
		!call fsd_build
		end do
	end do
	!______________________OUTPUTS_________________________
	root='output/'
	spectrum=trim(root)//'Energy_spectrum.dat'
	floe_size=trim(root)//'floe_size.dat'


	open(10,file=spectrum)
	open(11,file=floe_size)

	!call write_output
	do i=1,nbin
	!do j=1,nsteps
	write(10,*)E(nsteps,i,1:nfreq)
	!end do
	write(11,*)Dave(i),Dmax(i)
	end do

	close(10)
	close(11)



contains

subroutine progress(j,jmax)
  implicit none
  integer::j,k,jmax
  character(len=15)::bar="processing ???%"
  write(unit=bar(12:14),fmt="(i3)")ceiling((real(j)/real(jmax))*100)
  write(unit=6,fmt="(a1,a17)",advance="no") char(13), bar
  if (ceiling((real(j)/real(jmax))*100).eq.100) then
  write(unit=6,fmt=*)
  write(*,*)'simulation completed!'
  
  endif
end subroutine progress

END PROGRAM WIM2