main.f90 1.17 KB
Newer Older
Jérémy Baudry's avatar
Jérémy Baudry committed
1 2 3 4 5 6 7 8 9
PROGRAM WIM2


	use parameters
	call read_namelist
	call array_allocation
	call initialization
	
	
Jérémy Baudry's avatar
Jérémy Baudry committed
10
       
Jérémy Baudry's avatar
Jérémy Baudry committed
11 12 13 14 15 16 17

!______________________________________________________





Jérémy Baudry's avatar
Jérémy Baudry committed
18 19 20 21 22 23
        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)
Jérémy Baudry's avatar
Jérémy Baudry committed
24 25 26 27
!_______________________TIME LOOP______________________
	do n=2,nsteps
	
	call progress(n,nsteps)
Jérémy Baudry's avatar
Jérémy Baudry committed
28 29 30 31
        do ii=1,nfreq
	call advection
        end do

Jérémy Baudry's avatar
Jérémy Baudry committed
32
		do i=1,nbin
Jérémy Baudry's avatar
Jérémy Baudry committed
33 34
	
		call attenuation
Jérémy Baudry's avatar
Jérémy Baudry committed
35 36 37
                call break_horvat
		!call floe_breaking
		!call fsd_build
Jérémy Baudry's avatar
Jérémy Baudry committed
38 39 40 41
		end do
	end do
	!______________________OUTPUTS_________________________

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