Commit c2c1e911 authored by Dany Dumont's avatar Dany Dumont

Renommage de variables, injection continue de vagues, amelioration du fichier...

Renommage de variables, injection continue de vagues, amelioration du fichier de sortie netcdf, formatage des routines.
parent 963a18cb
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
! | | ! | |
! | WIM PARAMETERS | ! | WIM PARAMETERS |
! |_______________________| ! |_______________________|
!______________________________________________________________________________ !____________________________________________________________________
! WAVES PARAMETERS: ! WAVES PARAMETERS:
! !
! Tm -> Peak period [s] ! Tm -> Peak period [s]
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
! group speed is the same at all spectrum ! group speed is the same at all spectrum
! frequency (cg=max[cg(w)]) ! frequency (cg=max[cg(w)])
! 1: Wave dispersion is allowed ! 1: Wave dispersion is allowed
!------------------------------------------------------------------------------ !--------------------------------------------------------------------
&waves_parameters &waves_parameters
Tm =Tmbatch Tm =Tmbatch
...@@ -21,34 +21,34 @@ Hs =Hsbatch ...@@ -21,34 +21,34 @@ Hs =Hsbatch
disp =0 disp =0
/ /
!______________________________________________________________________________ !____________________________________________________________________
! MODEL PARAMETERS: ! MODEL PARAMETERS:
! !
! nbin -> Number of grid bin ! nx -> Number of grid bin
! dx -> Spatial resolution [m] ! dx -> Spatial resolution [m]
! Cfl -> Courant–Friedrichs–Lewy condition (0<Cfl<1) ! Cfl -> Courant–Friedrichs–Lewy condition (0<Cfl<1)
! Only in the case where disp=0. The CFL condition ! Only in the case where disp=0. The CFL condition
! is needed to calculate the time step. ! is needed to calculate the time step.
! name_sim -> name of the output file ! name_sim -> name of the output file
! root -> destination folder for the output file ! root -> destination folder for the output file
!------------------------------------------------------------------------------ !--------------------------------------------------------------------
&model_parameter &model_parameter
nbin =100 nx =100
dx =5000 dx =5000
Cfl =1 Cfl =1
name_sim ='nmebatch' name_sim ='nmebatch'
root = 'output/' root = 'output/'
/ /
!______________________________________________________________________________
!___________________________________________________________________
! SPECTRUM PARAMETERS: ! SPECTRUM PARAMETERS:
! !
! init_spec -> method to build the wave spectrum ! init_spec -> method to build the wave spectrum
! 2: Swell ! 2: Swell
! 1: JONSWAP spectrum ! 1: JONSWAP spectrum
! 0: Bretschneider spectrum ! 0: Bretschneider spectrum
! nfreq -> number of frequency bin ! nf -> number of frequency bin
! Tmin -> Minimum period [s] ! Tmin -> Minimum period [s]
! Tmax -> Maximum period [s] ! Tmax -> Maximum period [s]
! alpha_s -> parameter for jonswap spectrum (init_spec=1) ! alpha_s -> parameter for jonswap spectrum (init_spec=1)
...@@ -60,7 +60,7 @@ root = 'output/' ...@@ -60,7 +60,7 @@ root = 'output/'
&spectrum_parameters &spectrum_parameters
init_spec =0 init_spec =0
nfreq =800 nf =800
Tmin =2.5 Tmin =2.5
Tmax =20 Tmax =20
alpha_s =0.2044 alpha_s =0.2044
...@@ -85,8 +85,9 @@ swell_Hs=0.09 ...@@ -85,8 +85,9 @@ swell_Hs=0.09
! D0 -> initial floe size in the domain [m] ! D0 -> initial floe size in the domain [m]
! gam -> ! gam ->
! Dmin -> Minimum floe size (if FSD_sheme=1) [m] ! Dmin -> Minimum floe size (if FSD_sheme=1) [m]
!------------------------------------------------------------------------------ !--------------------------------------------------------------------
&ice_parameters &ice_parameters
X_ice =50000 X_ice =50000
cice =1 cice =1
ice_thick =0 ice_thick =0
...@@ -99,7 +100,6 @@ Dmin =20 ...@@ -99,7 +100,6 @@ Dmin =20
stress_crit =0.67e6 stress_crit =0.67e6
strain_crit =strainbatch strain_crit =strainbatch
P_c =probcritbatch P_c =probcritbatch
/ /
!________________________________________________________________________________ !________________________________________________________________________________
! FSD PARAMETERS ! FSD PARAMETERS
......
!
! _______________________ ! _______________________
! | | ! | |
! | WIM PARAMETERS | ! | WIM PARAMETERS |
! |_______________________| ! |_______________________|
!______________________________________________________________________________ !____________________________________________________________________
! WAVES PARAMETERS: ! WAVES PARAMETERS:
! !
! Tm -> Peak period [s] ! Tm -> Peak period [s]
...@@ -13,42 +12,46 @@ ...@@ -13,42 +12,46 @@
! group speed is the same at all spectrum ! group speed is the same at all spectrum
! frequency (cg=max[cg(w)]) ! frequency (cg=max[cg(w)])
! 1: Wave dispersion is allowed ! 1: Wave dispersion is allowed
!------------------------------------------------------------------------------ ! cont -> Allowing continuous wave input
! 0: Not continuous (default)
! 1: Continuous input
!--------------------------------------------------------------------
&waves_parameters &waves_parameters
Tm =8 Tm =4.5
Hs =1 Hs =1.5
disp =0 disp =1
cont =1
/ /
!______________________________________________________________________________
!____________________________________________________________________
! MODEL PARAMETERS: ! MODEL PARAMETERS:
! !
! nbin -> Number of grid bin ! nx -> Number of grid bin
! dx -> Spatial resolution [m] ! dx -> Spatial resolution [m]
! Cfl -> Courant–Friedrichs–Lewy condition (0<Cfl<1) ! Cfl -> Courant-Friedrich-Lewy condition (0 < Cfl < 1)
! Only in the case where disp=0. The CFL condition ! Only in the case where disp=0. The CFL condition
! is needed to calculate the time step. ! is needed to calculate the time step.
! name_sim -> name of the output file ! name_sim -> name of the output file
! root -> destination folder for the output file ! root -> destination folder for the output file
!------------------------------------------------------------------------------ !--------------------------------------------------------------------
&model_parameter &model_parameter
nbin =100 nx =100
dx =5000 dx =5
Cfl =1 Cfl =1.0
name_sim ='test' name_sim ='test'
root = 'output/' root = 'output/'
/ /
!______________________________________________________________________________
!____________________________________________________________________
! SPECTRUM PARAMETERS: ! SPECTRUM PARAMETERS:
! !
! init_spec -> method to build the wave spectrum ! init_spec -> method to build the wave spectrum
! 2: Swell ! 2: Swell
! 1: JONSWAP spectrum ! 1: JONSWAP spectrum
! 0: Bretschneider spectrum ! 0: Bretschneider spectrum
! nfreq -> number of frequency bin ! nf -> number of frequency bin
! Tmin -> Minimum period [s] ! Tmin -> Minimum period [s]
! Tmax -> Maximum period [s] ! Tmax -> Maximum period [s]
! alpha_s -> parameter for jonswap spectrum (init_spec=1) ! alpha_s -> parameter for jonswap spectrum (init_spec=1)
...@@ -56,21 +59,21 @@ root = 'output/' ...@@ -56,21 +59,21 @@ root = 'output/'
! gamma_s -> parameter for jonswap spectrum (init_spec=1) ! gamma_s -> parameter for jonswap spectrum (init_spec=1)
! swell_T -> swell period (init_spec=2) ! swell_T -> swell period (init_spec=2)
! swell_Hs -> swell significant height (init_spec=2) ! swell_Hs -> swell significant height (init_spec=2)
!------------------------------------------------------------------------------ !--------------------------------------------------------------------
&spectrum_parameters &spectrum_parameters
init_spec =0 init_spec =0
nfreq =800 nf =36
Tmin =2.5 Tmin =2.5
Tmax =20 Tmax =20
alpha_s =0.2044 alpha_s =0.2044
beta_s =1.2500 beta_s =1.2500
gamma_s =3.3 gamma_s =3.3
swell_T =19 swell_T =19
swell_Hs=0.09 swell_Hs =0.09
/ /
!______________________________________________________________________________
!____________________________________________________________________
! ICE PARAMETERS ! ICE PARAMETERS
! !
! X_ice -> Distance of the ice edge [m] ! X_ice -> Distance of the ice edge [m]
...@@ -82,62 +85,57 @@ swell_Hs=0.09 ...@@ -82,62 +85,57 @@ swell_Hs=0.09
! hice -> Ice thickness (if ice_thick=0) [m] ! hice -> Ice thickness (if ice_thick=0) [m]
! hmax -> Maximum ice thickness (if ice_thick=1) [m] ! hmax -> Maximum ice thickness (if ice_thick=1) [m]
! Xh -> distance where h=hmax/2 (if ice_thicl=1) [m] ! Xh -> distance where h=hmax/2 (if ice_thicl=1) [m]
!------------------------------------------------------------------------------ !--------------------------------------------------------------------
&ice_parameters &ice_parameters
X_ice =50000
cice =1
ice_thick =0
hice =3
hmax =3
Xh =200000
strain_crit =3e-5
P_c =0.55
X_ice =10
cice =1
ice_thick=0
hice =0
hmax =0.8
Xh =250
strain_crit=3e-5
P_c =0.55
/ /
!________________________________________________________________________________
!____________________________________________________________________
! FSD PARAMETERS ! FSD PARAMETERS
! FSD_sheme -> method for compute <D> ! FSD_sheme -> method for compute <D>
! 0: dumont et al (2011) ! 0: dumont et al (2011)
! 1: power law ! 1: power law
! !
! minfloe -> minimum size floe to build the floe size categories [m] ! minfloe -> minimum floe size of the FSD [m]
! maxfloe -> maximum size floe to build the floe size categories [m] ! maxfloe -> maximum floe size of the FSD [m]
! nbcat -> number of floe size categories ! nr -> number of floe size categories
!-------------------------------------------------------------------------------- !--------------------------------------------------------------------
&fsd_parameters &fsd_parameters
FSD_scheme =1 FSD_scheme =1
minfloe =5 minfloe =5
maxfloe =400 maxfloe =400
nbcat =60 nr =60
/ /
!_________________________________________________________________________________
! IDT PARAMETERS
!IDT_scheme -> compute the ice thickness distribution !____________________________________________________________________
! ITD PARAMETERS
!itd_scheme -> compute the ice thickness distribution
0: no distribution 0: no distribution
1: distribution (rayleigh) 1: distribution (rayleigh)
!mu_IDT -> parameter for the distribution !mu_itd -> parameter for the distribution
!mincat_h -> minimum ice thickness category !mincat_h -> minimum ice thickness category
!maxcat_h -> maximum ice thickness category !maxcat_h -> maximum ice thickness category
!nbcat_h -> number of ice thickness categories !nh -> number of ice thickness categories
!--------------------------------------------------------------------------------- !--------------------------------------------------------------------
&idt_parameters &itd_parameters
IDT_scheme =1
mu_IDT =0.5 itd_scheme =1
mu_itd =0.5
mincat_h =0.1 mincat_h =0.1
maxcat_h =10 maxcat_h =10
nbcat_h =50 nh =50
/ /
!________________________________________________________________________________
!____________________________________________________________________
!-------------------------------------------------------------------
!DESCRIPTION: Here, the wave spectrum is advected through the
! domain. The advection equation is solved using a
! Lax-wendroff discretization sheme with a Superbee
! flux limiter.
!-------------------------------------------------------------------
!_______________________________________________________________________________ !INTERFACE:
subroutine advection
!DESCRIPTION: Here, the wave spectrum is advected through the !MODULE USES:
!domain. The advection equation is solved using a Lax-wendroff use parameters
!discretization sheme with a superbee flux limiter.
!_______________________________________________________________________________ !LOCAL PARAMETERS:
implicit none
!INTERFACE:
subroutine advection
!MODULE USES:
use parameters
!LOCAL PARAMETERS:
implicit none
double precision, allocatable :: diffF(:) double precision, allocatable :: diffF(:)
double precision, allocatable :: diffl(:) double precision, allocatable :: diffl(:)
double precision, allocatable :: diffr(:) double precision, allocatable :: diffr(:)
double precision, allocatable :: phi(:) double precision, allocatable :: phi (:)
double precision, allocatable :: theta(:) double precision, allocatable :: theta(:)
double precision, allocatable :: F(:) double precision, allocatable :: F (:)
double precision, allocatable :: diff1(:) double precision, allocatable :: diff1(:)
allocate(diffl(nbin)) allocate(diffl(nx ))
allocate(diffr(nbin)) allocate(diffr(nx ))
allocate(diffF(nbin)) allocate(diffF(nx ))
allocate(theta(nbin)) allocate(theta(nx ))
allocate(phi(nbin)) allocate(phi (nx ))
allocate(F(nbin)) allocate(F (nx ))
allocate(diff1(nbin-1)) allocate(diff1(nx-1))
!________________________________________________________________________________ if ( cont.eq.1 ) then
E(1,ii,n-1)=Ei(ii)
do i=2,nbin end if
diffl(i)=E(n-1,i,ii)-E(n-1,i-1,ii)
end do do i=2,nx
diffl(i) = E(i ,ii,n-1) - E(i-1,ii,n-1)
do i=1,nbin-1 end do
diffr(i)=E(n-1,i+1,ii)-E(n-1,i,ii)
end do do i=1,nx-1
diffr(i) = E(i+1,ii,n-1) - E(i ,ii,n-1)
diffr(nbin)=-E(n-1,nbin,ii) !set dE=0 at boundaries end do
diffl(1)=E(n-1,1,ii)
! set dE=0 at boundaries
diffr(nx)=-E(nx,ii,n-1)
do i=1,nbin !Superbee flux limiter diffl(1 )= E( 1,ii,n-1)
theta(i)=diffl(i)/(diffr(i)+3e-14)
phi(i)=max(0d0,min(theta(i)*2,1d0),min(theta(i),2d0)) ! Superbee flux limiter
end do do i=1,nx
theta(i)=diffl(i)/(diffr(i)+3e-14)
phi(i)=max(0d0,min(theta(i)*2,1d0),min(theta(i),2d0))
!Lax-Wendroff sheme: end do
F=E(n-1,1:nbin,ii)+0.5*(1-CN(ii))*diffr*phi
do i=2,nbin ! Lax-Wendroff sheme
diffF(i)=F(i)-F(i-1) F=E(1:nx,ii,n-1) + 0.5*(1-CN(ii))*diffr*phi
end do
diffF(1)=F(1) do i=2,nx
E(n,1:nbin,ii)=E(n-1,1:nbin,ii)-CN(ii)*diffF diffF(i)=F(i) - F(i-1)
end do
!________________________________________________________________________________ diffF(1)=F(1)
E(1:nx,ii,n)=E(1:nx,ii,n-1)-CN(ii)*diffF
end subroutine advection end subroutine advection
!____________________________________________________________________________ !____________________________________________________________________
!
!DESCRIPTION: In this routine, the attenuation coefficient is
! calculated according Kohout and Meylan (2008) and the
! spectrum attenuation is computed.
!
!____________________________________________________________________
!INTERFACE:
subroutine attenuation
!DESCRIPTION: In this routine, the attenuation !USES:
!coefficient is calculated according Kohout and use parameters
!Meylan (2008) and the spectrum attenuation is
!computed.
!____________________________________________________________________________ implicit none
double precision :: q11,q12,q13,q14,q15,q21,q22,q23,q24,q25
double precision :: q31,q32,q33,q34,q35
double precision, allocatable :: p1(:),p2(:),p3(:)
double precision, allocatable :: att(:)
allocate(p1 (nf))
allocate(p2 (nf))
allocate(p3 (nf))
allocate(att(nf))
!INTERFACE:
subroutine attenuation
!USES:
use parameters
implicit none
double precision :: q11,q12,q13,q14,q15,q21,q22,q23,q24,q25
double precision :: q31,q32,q33,q34,q35
double precision, allocatable :: p1(:),p2(:),p3(:)
double precision, allocatable :: att(:)
allocate(p1(nfreq))
allocate(p2(nfreq))
allocate(p3(nfreq))
allocate(att(nfreq))
!____________________________________________________________________________
q11 = -0.00000777 q11 = -0.00000777
q12 = 0.00032080 q12 = 0.00032080
...@@ -53,21 +48,17 @@ p1 = q11*T**4 + q12*T**3 + q13*T**2 + q14*T + q15 ...@@ -53,21 +48,17 @@ p1 = q11*T**4 + q12*T**3 + q13*T**2 + q14*T + q15
p2 = q21*T**4 + q22*T**3 + q23*T**2 + q24*T + q25 p2 = q21*T**4 + q22*T**3 + q23*T**2 + q24*T + q25
p3 = q31*T**4 + q32*T**3 + q33*T**2 + q34*T + q35 p3 = q31*T**4 + q32*T**3 + q33*T**2 + q34*T + q35
alpha(i,1:nfreq)=-1*(p1*h(i)**2 + p2*h(i) + p3) alpha(i,:)=-1*(p1*h(i)**2 + p2*h(i) + p3)
do j=1,nfreq
if (alpha(i,j).lt.0)then
alpha(i,j)=0d0
end if
end do
att=C_ice(i)*alpha(i,1:nfreq)/(Dave(i)+3e-14)
S_ice(n,i,1:nfreq)=-att*E(n,i,1:nfreq)
E(n,i,1:nfreq)=E(n,i,1:nfreq)*exp(-att*Cg*dt)
do ii=1,nf
if ( alpha(i,ii).lt.0 )then
alpha(i,ii)=0d0
end if
end do
!_____________________________________________________________________________ att=C_ice(i)*alpha(i,:)/(Dave(i)+3e-14)
!S_ice(n,i,1:nf)=-att*E(n,i,1:nf)
S_ice(i,:,n)=-att*E(i,:,n)
E(i,:,n)=E(i,:,n)*exp(-att*Cg*dt)
end subroutine attenuation end subroutine attenuation
This diff is collapsed.
! !
!_______________________________________________________________________ !____________________________________________________________________
! !
! DESCRIPTION: !DESCRIPTION: This is the initialization routine which contains the
! This is the initialization routine which contains the ! initial spectrum construction, set initial values for
! initial spectrum construction, set initial values for arrays ! arrays and construct the ice transect.
! and construct the ice transect. !____________________________________________________________________
!_______________________________________________________________________
!INTERFACE:
!INTERFACE: subroutine initialization
subroutine initialization
!MODULE USES:
!MODULE USES: use parameters
use parameters
!LOCAL PARAMETERS AND VARIABLES
!LOCAL PARAMETERS AND VARIABLES implicit none
implicit none
double precision, allocatable ::Gf(:),PM(:) double precision, allocatable :: Gf(:),PM(:)
integer ::X1
complex(kind=8), dimension(6) :: poly integer :: x1
complex(kind=8), dimension(5) :: roots
logical :: param1 complex(kind=8), dimension(6) :: poly
logical :: param2 complex(kind=8), dimension(5) :: roots
allocate(Gf(nfreq))
allocate(PM(nfreq)) logical :: param1
logical :: param2
allocate(Gf(nf))