Commit c946efdb authored by Gwenaelle Gremion's avatar Gwenaelle Gremion

Set up Wd4 Max

parent e48ad91f
......@@ -605,7 +605,7 @@ leak=leak/secs_pr_day
w_dph = w_dph /secs_pr_day
w_dzo = w_dzo /secs_pr_day
w_fp = w_fp /secs_pr_day
! w_msn = w_msn /secs_pr_day
w_msn = w_msn /secs_pr_day
litt_msn_w =litt_msn_w /secs_pr_day
!Phytoplankton
......@@ -1164,7 +1164,7 @@ end if
REALTYPE ::prob_break_msn,r_msn
REALTYPE :: diam_msn_max,RFV_msn,min_size_msn
! Sedimentation rate msn
REALTYPE :: w_msn_m,Re_msn,Rmsn,w_min_m,CFL
REALTYPE :: w_msn_m,Re_msn,Rmsn,w_min_m,CFL,max_w_msn
!EOP
!-----------------------------------------------------------------------
......@@ -2291,7 +2291,7 @@ if (Coag_coef .eq. 1.0) then ! #1 Size modified only if coagulation happenned
!--» At this points 'taille_coag' is the projected area equivalent diameter in m.
! ---Elaboration of the size variable (diameter), available for the fragmentation eventually (taille_intrm).
if(cc(d4,ci) .gt. cons_min) then
if(cc(d4,ci) .gt. cons_min) then
cc(taille_intrm,ci) = cc(taille_coag,ci) + cc(taille_msn,ci) ![m]
!--» Msn size after coagulation will depend on the increase of size due to coagaluation (taille_coag) &
!--» + the size at the previous time step (taille_msn) of the particles
......@@ -2307,11 +2307,11 @@ if (Coag_coef .eq. 1.0) then ! #1 Size modified only if coagulation happenned
write(*,*)'Taille _msn - May be equal to 0 :', cc(taille_msn,ci)
endif
else
else
!--» If there is not need to have a size augmentation due to low concentration of marine snow, the size of previous step remain
cc(taille_intrm,ci) = cc(taille_msn,ci) ![m]
write(*,*)'No size augmentation as [msn] < cons_min - The size stays the same', cc(taille_msn,ci)
endif
! write(*,*)'No size augmentation as [msn] < cons_min - The size stays the same', cc(taille_msn,ci)
endif
else !#1 Size not modified because no coagulation happenned
cc(taille_coag,ci) = 0.0
......@@ -2334,8 +2334,8 @@ endif !#1
if (cc(d4,ci).lt. cons_min)then
cc(taille_msn,ci) = _ZERO_
cc(taille_intrm,ci) = _ZERO_
write(*,*)'Size but no msn at :',ci
endif
! write(*,*)'Size but no msn at :',ci
endif
!-----------------------------------------------------------------------------------
! FRAGMENTATION
......@@ -2511,15 +2511,16 @@ endif
if (cc(d4,ci) .le. cons_min) then
w_msn_m = 0.0
write(*,*)'[msn] lt Cons_min, settling velocity set to :',w_msn_m
! write(*,*)'[msn] lt Cons_min, settling velocity set to :',w_msn_m
elseif (cc(d4,ci) .lt. cons_max) then !#1
!--» We set here the concentration limit in the water column from free settling of marine snow vs flocculation settling (Metha 1989)
!! --- Calculated by value from the .nml
if (w_msnow .eq. 0.0 ) then !#2
!w_msn_m = w_msn*sqrt(w_depth/100)
w_msn_m = w_msn_m
w_msn_m = w_msn
!! --- Stokes's law from Ghosh et al 2013
!--» msn is considered as sphere
......@@ -2564,7 +2565,7 @@ elseif (cc(d4,ci) .lt. cons_max) then !#1
endif!#2
elseif (cc(d4,ci) .ge. cons_max)then !#1
w_msn_m=-(coef5*cc(d4,ci)**(1.6)) ! Metha 1989
write(*,*)'[msn] > cons_max at :',ci
! write(*,*)'[msn] > cons_max at :',ci
else
write(*,*)'At Depth : ',ci
......@@ -2638,6 +2639,27 @@ endif !#3
w_msn_m = -w_msn_m
endif
!--» Definition of the maximum diameter size from our model calculation
If (litt_msn_w .lt. max_w_msn) then
max_w_msn = litt_msn_w
else
max_w_msn = max_w_msn
endif
!--» Does CFL limit respected ?
CFL = (depth_bio/nlev)/dt_bio
if(abs(w_msn_m) .gt. CFL) then
max_w_msn = max_w_msn
else
if(w_msn_m .lt. max_w_msn) then
max_w_msn = w_msn_m
else
max_w_msn = max_w_msn
endif
endif
!--» let them settling(m/s)
!--» The ncdf output(bio_save) do ws(x,ci) *86400 to have the ouptut in m/j.
......@@ -2645,8 +2667,8 @@ endif !#3
!-----------------------------------------------------------------------------------
!! ---Safety check
!-----------------------------------------------------------------------------------
!--» Does CFL limit respected ?
CFL = (depth_bio/nlev)/dt_bio
!--» Case of Phytoplankton
if (abs(w_p_m) .gt. (depth_bio/nlev)/dt_bio )then
......@@ -2700,34 +2722,16 @@ endif
!--Concentration - Vs CFL limit
if (abs(w_msn_m) .gt. (depth_bio/nlev)/dt_bio )then
if (w_msnow .eq. 4.0) then !#2
if(CSF .ge. 0.0 .and. CSF.lt. 0.4) then !#2.3
CSF_msn = 2.18-(2.09*CSF)
else if (CSF .ge. 0.4 .and. CSF .lt. 0.8) then!#2.3
CSF_msn = 0.946*(CSF)**(-0.378)
else if (CSF .ge. 0.8 .and. CSF .le. 1.0) then!#2.3
CSF_msn = 1.0 ! consider as a sphere
else !#2.3
write (*,*) 'Error in CSF values for Marine snow : CSF .NE. [0-1]'
endif !#2.3
w_msn_m=(1/(18*(kinvis*densFlu)))*(1/CSF_msn)*(Rmsn)*g*(diam_msn_max)**2 ![m/s]
if (w_msn_m .gt. 0.0) then
ws(d4,ci) = -w_msn_m
else
ws(d4,ci) = w_msn_m
endif
else
! -- As settling velocity overpass the CFL constrain we will attribute to the msn
! the maximum settling velocity found in the litterature
ws(d4,ci) = litt_msn_w ![m/s]
! the maximum settling velocity found between our simulation and the litterature
! ws(d4,ci) = litt_msn_w ![m/s]
ws(d4,ci) = max_w_msn ![m/s]
write(*,*) 'CFL Constrain is OVERPASS, w_msn use from nml',ws(d4,ci)
if (abs(litt_msn_w) .gt. (depth_bio/nlev)/dt_bio )then
ws(d4,ci) = 0.0
write(*,*) 'CFL Constrain is OVERPASS for w_msn,from the nml value', ws(d4,ci)
endif
endif
else
ws(d4,ci) = w_msn_m
write(*,*) 'CFL limit is respected, ws(D4,ci) = ',ws(d4,ci)
......@@ -2737,11 +2741,10 @@ endif
ws(taille_msn,ci) = ws(d4,ci)
!--Settling velocity trait - Vs CFL limit
cc(settl_msn,ci) = ws(d4,ci)
ws(settl_msn,ci) = ws(d4,ci)
!-----------------------------------------------------------------------------------
! NET PRIMARY PRODUCTION
......@@ -3052,8 +3055,17 @@ endif !#A
do j=1,numc
pp(i,j,ci)=dd(j,i,ci)
end do
end do
end do
end do
end do
!-----------------------------------------------------------------------
! If you want to do something over this timestep do it here !
!-----------------------------------------------------------------------
write(*,*)'-------------------------NEW TIMESTEP-----------------------'
!-----------------------------------------------------------------------
return
end subroutine do_bio_polynow
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment