main.f90 1.08 KB
PROGRAM WIM2


	use parameters
	call read_namelist
	call array_allocation
	call initialization
	
	


!______________________________________________________





!_______________________TIME LOOP______________________
	do n=2,nsteps
	
	call progress(n,nsteps)
        do ii=1,nfreq
	call advection
        end do

		do i=2,nbin
	
		call attenuation
		call floe_breaking
		call fsd_build
		end do
	end do
	!______________________OUTPUTS_________________________
	spectrum=trim(root)//'Energy_spectrum.dat'
	floe_size=trim(root)//'floe_size.dat'
        namefile=trim(root)//trim(name_sim)//'.nc'

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

	call write_output
       
	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