initialization.f90 680 Bytes
subroutine initialization
use parameters

!local parameters
implicit none
	double precision, allocatable ::Gf(:),PM(:)

	allocate(Gf(nfreq))
	allocate(PM(nfreq))
	
	

!_________________________INITIAL SPECTRUM_____________________________
	E(1:nsteps,1:nbin,1:nfreq)=0d0

	!build JONSWAP spectrum

	do i=1,nfreq 
		if (freq(i).le.freq_s) then
			sigma_s(i)=0.07
		else
			sigma_s(i)=0.09
		end if
	end do
	
	Gf=gamma_s**(exp((-(freq-freq_s)**2)/(2*sigma_s**2*freq_s**2)))
	PM=alpha_s*Hs**2*(freq_s**4/freq**5)*exp(-beta_s*(freq_s/freq)**4)

	Ei=Gf*PM

	

	E(1,1,1:nfreq)=Ei
	
!_______________________________________________________________________

end subroutine initialization