Bonjour, une maintenance Gitlab aura lieu mardi prochain le 6 octobre afin de mettre à jour la version de Gitlab ainsi que d'ajouter la possibilité d'utiliser votre compte UQAR pour la connexion au serveur. Un courriel avec plus de détails vous sera envoyé une fois la maintenance complétée. Si vous avez des questions ou des commentaires, veuillez communiquer à l'adresse admin_calcul@uqar.ca. Merci de votre collaboration.

initialization.f90 2.59 KB
Newer Older
Jérémy Baudry's avatar
new  
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 22
!
!_______________________________________________________________________
!
!               DESCRIPTION:
!               This is the initialization routine which  contains the 
!               initial spectrum construction, set initial values for arrays
!               and construct the ice transect.
!_______________________________________________________________________

                !INTERFACE:
                subroutine initialization

                !MODULE USES:
                use parameters

                !LOCAL PARAMETERS AND VARIABLES
                implicit none
                double precision, allocatable ::Gf(:),PM(:)
                integer ::X1

                allocate(Gf(nfreq))
                allocate(PM(nfreq))
Jérémy Baudry's avatar
Jérémy Baudry committed
23 24 25 26



!_________________________INITIAL SPECTRUM_____________________________
Jérémy Baudry's avatar
new  
Jérémy Baudry committed
27 28

        E(1:nsteps,1:nbin,1:nfreq)=0d0  !INITIALIZE SPECTRUM ARRAY 
Jérémy Baudry's avatar
Jérémy Baudry committed
29
        
Jérémy Baudry's avatar
new  
Jérémy Baudry committed
30 31 32 33 34 35 36 37 38 39 40 41 42 43
        if(init_spec.eq.1) then         !use 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
Jérémy Baudry's avatar
Jérémy Baudry committed
44
        
Jérémy Baudry's avatar
new  
Jérémy Baudry committed
45
        else                            !use bretschneider spectrum
Jérémy Baudry's avatar
Jérémy Baudry committed
46 47 48

        Ei=(1.25*Hs**2*(1/freq)**5)/(8*pi*Tm**4)*exp(-1.25*((1/freq)/Tm)**4)
        end if
Jérémy Baudry's avatar
Jérémy Baudry committed
49 50


Jérémy Baudry's avatar
new  
Jérémy Baudry committed
51 52 53

        E(1,1,1:nfreq)=Ei               !initial spectrum

Jérémy Baudry's avatar
Jérémy Baudry committed
54 55
!_______________________________________________________________________

Jérémy Baudry's avatar
Jérémy Baudry committed
56 57
!_______________________ICE_TRANSECT____________________________________

Jérémy Baudry's avatar
new  
Jérémy Baudry committed
58 59 60
X1=floor(X_ice/dx)      !find in which grid bin is the ice edge
C_ice(1:X1)=0           !ice concentration is 0 before ice edge!
C_ice(X1:nbin)=cice     !ice concentration in the transect
Jérémy Baudry's avatar
Jérémy Baudry committed
61

Jérémy Baudry's avatar
new  
Jérémy Baudry committed
62 63 64 65
Dave(1:X1)=0            !initalize mean floe size before ice edge
Dmax(1:X1)=0            !initialize max floe size before ice edge
Dave(X1:nbin)=D0        !initalize mean floe size in ice transect
Dmax(X1:nbin)=D0        !initialize max floe size in ice transect
Jérémy Baudry's avatar
Jérémy Baudry committed
66

Jérémy Baudry's avatar
new  
Jérémy Baudry committed
67
if (ice_thick.eq.0) then ! constant ice thickness in the transect
Jérémy Baudry's avatar
Jérémy Baudry committed
68

Jérémy Baudry's avatar
new  
Jérémy Baudry committed
69 70
h(X1:nbin)=hice          
h(1:X1)=0d0             !0 before ice edge
Jérémy Baudry's avatar
Jérémy Baudry committed
71

Jérémy Baudry's avatar
new  
Jérémy Baudry committed
72
else                    ! thickness is a function of distance from ice edge
Jérémy Baudry's avatar
Jérémy Baudry committed
73 74

h(1:X1)=0d0
Jérémy Baudry's avatar
new  
Jérémy Baudry committed
75
        do jj=X1,nbin
Jérémy Baudry's avatar
Jérémy Baudry committed
76

Jérémy Baudry's avatar
new  
Jérémy Baudry committed
77
                h(jj)=hmax*(0.1+0.9*(1-exp(-((real(jj)*dx-X_ice)/Xh))))
Jérémy Baudry's avatar
Jérémy Baudry committed
78

Jérémy Baudry's avatar
new  
Jérémy Baudry committed
79
        end do
Jérémy Baudry's avatar
Jérémy Baudry committed
80 81 82 83 84 85 86

end if
        
!_____________________FSD_____________________________________________

FSD(1,1:nbin,1)=1d0

Jérémy Baudry's avatar
Jérémy Baudry committed
87
end subroutine initialization