main.f90 1.08 KB
Newer Older
Jérémy Baudry's avatar
Jérémy Baudry committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
PROGRAM WIM2


	use parameters
	call read_namelist
	call array_allocation
	call initialization
	
	


!______________________________________________________





!_______________________TIME LOOP______________________
	do n=2,nsteps
	
	call progress(n,nsteps)
Jérémy Baudry's avatar
Jérémy Baudry committed
22 23 24 25
        do ii=1,nfreq
	call advection
        end do

Jérémy Baudry's avatar
Jérémy Baudry committed
26
		do i=2,nbin
Jérémy Baudry's avatar
Jérémy Baudry committed
27 28 29 30
	
		call attenuation
		call floe_breaking
		call fsd_build
Jérémy Baudry's avatar
Jérémy Baudry committed
31 32 33 34 35
		end do
	end do
	!______________________OUTPUTS_________________________
	spectrum=trim(root)//'Energy_spectrum.dat'
	floe_size=trim(root)//'floe_size.dat'
Jérémy Baudry's avatar
Jérémy Baudry committed
36
        namefile=trim(root)//trim(name_sim)//'.nc'
Jérémy Baudry's avatar
Jérémy Baudry committed
37 38 39 40

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

Jérémy Baudry's avatar
Jérémy Baudry committed
41 42
	call write_output
       
Jérémy Baudry's avatar
Jérémy Baudry committed
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
	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