Commit b6146951025ed44f25d444258e48a5ec0565edd4

Authored by root
1 parent 8a16b803
Exists in ontheside

nouveau commit

nml/bio_parameter.nml
... ... @@ -36,24 +36,25 @@
36 36 &bio_parameter_nml
37 37  
38 38 bio_calc = 1
39   -bio_model = 2
40   -mu_max = 2.8935e-5
  39 +photo_model = 2
  40 +bio_model = 1
  41 +mu_max = 2.3148e-5
41 42 q0 = 0.05
42 43 mortality = 0
43 44 Kn = 2.14e-4
44   -Vmax = 9.3870e-6
  45 +Vmax = 1.1574e-5
45 46 nut_profile = 1
46 47 nut_layer = 15
47   -Nutrient_0 = 5e-4
  48 +Nutrient_0 = 5e-3
48 49 Nutrient_1 = 1e-6
49 50 Nutrient_2 = 5e-3
50 51 bottom_flux = 0
51 52 nut_relax = 0
52   -w_s = 0
  53 +w_s = 2.3148e-06
53 54 part_management = 0
54   -mu_r = 1.1574e-06
55   -kw = 0
56   -q_max = 0.5
57   -m0 = 1e-12
  55 +mu_r = 1.1574e-6
  56 +kw = 1.1574e-7
  57 +q_max = 0.25
  58 +m0 = 4e-6
58 59  
59 60 /
... ...
nml/model_parameter.nml
... ... @@ -32,12 +32,12 @@
32 32 !------------------------------------------------------------------------------------------
33 33  
34 34 &model_parameter_nml
35   -name_exp ='exp3'
  35 +name_exp ='test_acclim'
36 36 depth = 40
37 37 dz = 0.5
38 38 K_value = 1e-6
39 39 time_step = 60
40   -ndays = 10
  40 +ndays = 15
41 41 output_time = 10
42 42 mix_state = 1
43 43 particle_distribution = 2
... ...
src/ADV_DIFF.f90
... ... @@ -27,21 +27,49 @@
27 27 double precision, allocatable :: DC(:)
28 28 double precision, allocatable :: DN_eul(:)
29 29 double precision, allocatable :: DN_lag(:)
30   - double precision, allocatable :: Dq(:)
31   - double precision, allocatable :: q2(:)
32   - integer :: i
  30 + double precision, allocatable :: Dq(:),DQQ(:,:)
  31 + double precision, allocatable :: q2(:),DNcell(:)
  32 + integer :: i,j
33 33 double precision :: alpha
34 34 double precision :: beta
35 35 double precision :: teta
  36 + double precision, allocatable :: DCL(:)
  37 +
36 38  
37 39 Allocate(DC(Nbin))
38 40 Allocate(DN_eul(Nbin))
39 41 Allocate(DN_lag(Nbin))
40 42 Allocate(Dq(Nbin))
41 43 Allocate(q2(Nbin))
  44 + Allocate(DQQ(Nbin,Ncat))
  45 + allocate(DNcell(Nbin))
  46 + Allocate(DCL(Nbin))
  47 +
  48 +
  49 + if(photo_model.eq.2) then
  50 +
  51 + do i=2,Nbin-1
  52 + DCL(i)=w_s*(CL(i+1)-CL(i))/dz
  53 + end do
  54 +
  55 + DCL(1)=w_s*CL(2)/dz
  56 + DCL(Nbin)=-w_s*CL(Nbin)/dz
  57 +
  58 + CL=CL+DCL*time_step
  59 +
  60 +
  61 + do i=2,Nbin-1
  62 + DCL(i)=(K(i)*(CL(i-1)-CL(i))+K(i+1)*(CL(i+1)-CL(i)))/(dz**2)
  63 + end do
  64 +
  65 + DCL(1)=(K(2)*(CL(2)-CL(1)))/(dz**2)
  66 + DCL(Nbin)=(K(Nlevel-1)*(CL(Nbin-1)-CL(Nbin)))/(dz**2)
42 67  
  68 + CL=CL+DCL*time_step
43 69  
  70 + end if
44 71  
  72 + if(bio_model.le.2) then
45 73 !________________________________________________________________________________
46 74 ! ADVECTION OF CELL QUOTA FOR EULERIAN CALCULATIONS
47 75 !________________________________________________________________________________
... ... @@ -49,13 +77,13 @@
49 77  
50 78  
51 79 do i=2,Nbin-1
52   - Dq(i)=w_s*(q(i+1)-q(i))/dz
  80 + DNcell(i)=w_s*(Ncell(i+1)-Ncell(i))/dz
53 81 end do
54 82  
55   - Dq(1)=w_s*q(2)/dz
56   - Dq(Nbin)=-w_s*q(Nbin)/dz
  83 + DNcell(1)=w_s*Ncell(2)/dz
  84 + DNcell(Nbin)=-w_s*Ncell(Nbin)/dz
57 85  
58   - q=q+Dq*time_step
  86 + Ncell=Ncell+DNcell*time_step
59 87  
60 88  
61 89 !________________________________________________________________________________
... ... @@ -65,13 +93,13 @@
65 93  
66 94  
67 95 do i=2,Nbin-1
68   - Dq(i)=(K(i)*(q(i-1)-q(i))+K(i+1)*(q(i+1)-q(i)))/(dz**2)
  96 + DNcell(i)=(K(i)*(Ncell(i-1)-Ncell(i))+K(i+1)*(Ncell(i+1)-Ncell(i)))/(dz**2)
69 97 end do
70 98  
71   - Dq(1)=(K(2)*(q(2)-q(1)))/(dz**2)
72   - Dq(Nbin)=(K(Nlevel-1)*(q(Nbin-1)-q(Nbin)))/(dz**2)
  99 + DNcell(1)=(K(2)*(Ncell(2)-Ncell(1)))/(dz**2)
  100 + DNcell(Nbin)=(K(Nlevel-1)*(Ncell(Nbin-1)-Ncell(Nbin)))/(dz**2)
73 101  
74   - q=q+Dq*time_step
  102 + Ncell=Ncell+DNcell*time_step
75 103  
76 104  
77 105  
... ... @@ -106,18 +134,33 @@
106 134  
107 135 euler=euler+DC*time_step
108 136  
  137 +
  138 + else
  139 +
  140 +
  141 + do j=1,Ncat
  142 + do i=2,Nbin-1
  143 + DQQ(i,j)=(K(i)*(q_dist(i-1,j)-q_dist(i,j))+K(i+1)*(q_dist(i+1,j)-q_dist(i,j)))/(dz**2)
  144 + end do
109 145  
  146 + DQQ(1,j)=(K(2)*(q_dist(2,j)-q_dist(1,j)))/(dz**2)
  147 + DQQ(Nbin,j)=(K(Nlevel-1)*(q_dist(Nbin-1,j)-q_dist(Nbin,j)))/(dz**2)
  148 +
  149 + q_dist(:,j)=q_dist(:,j)+DQQ(:,j)*time_step
  150 + end do
  151 +
  152 + end if
110 153  
111 154 !________________________________________________________________________________
112 155 ! NUTRIENT CONCENTRATION FOR EULERIAN CALCULATIONS
113 156 !________________________________________________________________________________
114 157  
115 158 do i=2,Nbin-1
116   - DN_eul(i)=(K(i)*(N_euler(i-1)-N_euler(i))+K(i+1)*(N_euler(i+1)-N_euler(i)))/(dz**2) -Nut(i)
  159 + DN_eul(i)=(K(i)*(N_euler(i-1)-N_euler(i))+K(i+1)*(N_euler(i+1)-N_euler(i)))/(dz**2)-Nut(i)
117 160 end do
118 161  
119 162 DN_eul(1)=(K(2)*(N_euler(2)-N_euler(1)))/(dz**2) -Nut(1)
120   - DN_eul(Nbin)=(K(Nlevel-1)*(N_euler(Nbin-1)-N_euler(Nbin)))/(dz**2) -Nut(Nbin)
  163 + DN_eul(Nbin)=(K(Nlevel-1)*(N_euler(Nbin-1)-N_euler(Nbin)))/(dz**2)-Nut(Nbin)
121 164  
122 165 N_euler=N_euler+DN_eul*time_step
123 166 N_euler(1:INT(2/dz))=N_euler(1:INT(2/dz))+bottom_flux*time_step
... ...
src/BIO_EULER.f90
... ... @@ -22,19 +22,30 @@
22 22  
23 23 IMPLICIT NONE
24 24  
25   - integer :: i
  25 + integer :: i,j,jj
26 26 integer :: a
27 27 double precision, allocatable :: light_level(:)
28 28 double precision, allocatable :: light_bin(:)
29   - double precision, allocatable :: dummy1(:)
  29 + double precision, allocatable :: dummy1(:),q_dummy(:),mu_dummy(:),nt(:),dt1(:)
30 30 double precision :: euler_av
31 31 double precision :: Pdmax=1
32 32 double precision :: Idark=50
33   -
  33 + double precision, allocatable :: Ndummy(:),Pl(:),Pd(:),CLQUOT(:)
  34 +
34 35  
35 36 allocate(light_level(Nlevel))
36 37 allocate(dummy1(Nlevel))
37 38 allocate(light_bin(Nbin))
  39 + allocate(q_dummy(Ncat))
  40 + allocate(mu_dummy(Ncat))
  41 + allocate(nt(Ncat))
  42 + allocate(dt1(Ncat))
  43 + allocate(Ndummy(Nbin))
  44 + allocate(Pl(Nbin))
  45 + allocate(Pd(Nbin))
  46 +
  47 + allocate(CLQUOT(Nbin))
  48 +
38 49  
39 50  
40 51 !____________________________________________________________________________
... ... @@ -55,39 +66,142 @@
55 66 do i=1,Nbin !compute light intensity in each grid bin
56 67 light_bin(i)=(light_level(i)+light_level(i+1))/2 !
57 68 end do !
58   -
  69 +
59 70  
60 71  
61 72 !_____________________________________________________________________________
62 73 ! GROWTH
63 74 !_____________________________________________________________________________
64   -
  75 + Nut=0d0
  76 + mu_dist=0d0
65 77 do i=1,Nbin
  78 +
  79 + if (photo_model.eq.1) then
  80 + growlight(i)=Pdmax*(1d0-dexp(-light_bin(i)/Idark))
  81 +
  82 + else
  83 +
  84 + CLQUOT=CL/euler
  85 +
  86 + !growlight(i)=Pdmax*(1d0-dexp(-light_bin(i)/(Idark+1000*CLQUOT(i))))
  87 + growlight(i)=light_bin(i)/(light_bin(i)+(500*CLQUOT(i))**2)
  88 +
  89 + if (light_bin(i)/(rad_max*0.45*4.16).lt.0.01) then
  90 + Clquot_ACC(i)=0.04
  91 + else
  92 +
  93 + Clquot_ACC(i)=0.01+0.03*log(light_bin(i)/(rad_max*0.45*4.16))/log(0.01)
  94 + end if
66 95  
67   - growlight(i)=Pdmax*(1d0-dexp(-light_bin(i)/Idark)) !calculate P(I)
  96 + end if
  97 +
  98 + q(i)=Ncell(i)/euler(i)
68 99  
  100 + if(q(i).gt.q_max) then
  101 + !write(*,*)q(i)
  102 + Ncell(i)=q_max*euler(i)
  103 + q(i)=Ncell(i)/euler(i)
  104 + end if
  105 +
69 106 if (bio_model.eq.1) then ! Monod equations
70 107  
71 108 grow(i)=(growlight(i)*(mu_max*(N_euler(i))/(Kn+N_euler(i))) -mortality) -mu_r ! growth rate
72   - Nut(i)=(growlight(i)*mu_max*N_euler(i)/(Kn+N_euler(i)))*q0*euler(i) ! nutrients taken
  109 +
  110 +
  111 + Nut(i)=(growlight(i)*mu_max*(N_euler(i)/(Kn+N_euler(i))))*q0*euler(i)
73 112 euler(i)=euler(i)+grow(i)*time_step*euler(i) !compute the growth with euler solver
74 113  
75   - else !Droop equations
  114 + CL(i)=CL(i)+(1/tau*(Clquot_ACC(i)-CLQUOT(i))*euler(i)+grow(i)*CL(i))*time_step
  115 +
  116 + elseif (bio_model.eq.4) then
  117 +
  118 +
  119 + CLQUOT_dumm=0
  120 + do j=1,nCLcat
  121 + if ((Clquot_ACC(i).gt.CLQUOTDIST(i,j).and.(j.ne.nCLcat).and.(CLQUOTDIST(i,j).gt.0d0)))then
  122 + CLQUOT_dumm(j+1)=CLQUOT_dumm(j+1)+(1/tau*(Clquot_ACC(i)-CLQUOTDIST(i,j))/(CLquat(i,j+1)-CLquat(i,j)))*time_step
  123 + elseif ((Clquot_ACC(i).lt.CLQUOTDIST(i,j).and.(j.ne.1).and.(CLQUOTDIST(i,j).gt.0d0)) then
  124 + CLQUOT_dumm(j-1)=CLQUOT_dumm(j-1)+(1/tau*(Clquot_ACC(i)-CLQUOTDIST(i,j))/(CLquat(i,j)-CLquat(i,j-1)))*time_step
  125 + end if
  126 + end do
  127 +
  128 + CL_to_mu=(light_bin(i)/(light_bin(i)+(500*CLcat)**2))*(mu_max*(N_euler(i))/(Kn+N_euler(i)))-mortality -mu_r
  129 + Nut(i)=sum(((light_bin(i)/(light_bin(i)+(500*CLcat)**2))*mu_max*(N_euler(i)/(Kn+N_euler(i))))*q0*CLQUOTDIST(i,:))
  130 +
  131 + CLQUOTDIST(i,:)=CLQUOTDIST(i,:)+CLQUOT_dumm
  132 + CLQUOTDIST(i,:)=CLQUOTDIST(i,:)+CL_to_mu*CLQUOTDIST(i,:)*time_step
76 133  
77   - Uptake_eul(i)=Vmax*N_euler(i)/(Kn+N_euler(i))*(1-(q(i)/euler(i))/q_max) !nutrient uptake
78   - q(i)=q(i)+(Uptake_eul(i)-kw*q(i))*time_step*euler(i) !change in cell quota
79   - Nut(i)=(Uptake_eul(i)-kw*q(i))*euler(i) !nutrient taken
  134 + euler(i)=sum(CLQUOTDIST(i,:))
  135 +
  136 +
80 137  
81   - if (q(i).ge.q0*euler(i)) then !compute the growth rate
82   - grow(i)=growlight(i)*mu_max*(1-q0/(q(i)/euler(i)))-mu_r !
  138 + elseif (bio_model.eq.2) then !Droop equations
  139 +
  140 + Uptake_eul(i)=Vmax*N_euler(i)/(Kn+N_euler(i))*(1-q(i)/q_max)
  141 +
  142 + Ncell(i)=Ncell(i)+(Uptake_eul(i)-kw*q(i))*time_step*euler(i) -mu_r*Ncell(i)*time_step
  143 + Nut(i)=(Uptake_eul(i)-kw*q(i))*euler(i)-mu_r*Ncell(i) !nutrient taken
  144 +
  145 + if (q(i).gt.q0) then !compute the growth rate
  146 + grow(i)=growlight(i)*mu_max*(1-q0/q(i))-mu_r
  147 + !grow(i)=growlight(i)*mu_max*(q(i)/q_max)-mu_r
83 148 else !
84 149 grow(i)=-mortality -mu_r !
85   - end if !
  150 + end if !
86 151 euler(i)=euler(i)+grow(i)*time_step*euler(i) !compute the growth with euler solver
87 152  
  153 +
  154 +
  155 + elseif (bio_model.eq.3) then
  156 +
  157 + q_dummy=0
  158 + nt=0
  159 + dt1=0
  160 + do j=1,Ncat
  161 + uptake_dist(j)=Vmax*N_euler(i)/(Kn+N_euler(i))*(1-q_cat(j)/q_max)
  162 + Nut(i)=Nut(i)+uptake_dist(j)*q_dist(i,j)-kw*q_cat(j)*q_dist(i,j)
  163 +
  164 + if (q_cat(j).gt.q0) then
  165 + q_to_mu(j)=growlight(i)*mu_max*(1-q0/q_cat(j))-mu_r
  166 + else
  167 + q_to_mu(j)=-mortality -mu_r
88 168 end if
  169 + q_to_mu(1)=-mortality -mu_r
  170 +
  171 + if((uptake_dist(j).lt.q_to_mu(j)*q_cat(j)+kw*q_cat(j)).and.(j.ne.1).and.(q_dist(i,j).gt.0d0)) then
  172 + dt1(j)=(q_cat(j-1)-q_cat(j))/(uptake_dist(j)-q_to_mu(j)*q_cat(j)-kw*q_cat(j))
  173 + nt(j)=dt1(j)/time_step;
  174 + q_dummy(j-1)=q_dummy(j-1)+q_dist(i,j)/nt(j)
  175 + q_dummy(j)=q_dummy(j)-q_dist(i,j)/nt(j)
  176 + elseif((uptake_dist(j).gt.q_to_mu(j)*q_cat(j)+kw*q_cat(j)).and.(j.ne.Ncat).and.(q_dist(i,j).gt.0d0)) then
  177 + dt1(j)=(q_cat(j+1)-q_cat(j))/(uptake_dist(j)-q_to_mu(j)*q_cat(j)-kw*q_cat(j))
  178 + nt(j)=dt1(j)/time_step;
  179 + q_dummy(j+1)=q_dummy(j+1)+q_dist(i,j)/nt(j)
  180 + q_dummy(j)=q_dummy(j)-q_dist(i,j)/nt(j)
  181 + end if
  182 +
89 183  
90 184 end do
91   -
  185 +
  186 + ! do j=1,Ncat
  187 + ! do jj=1,Ncat
  188 + ! if((q_to_mu(j).ge.mu_edge(jj)).and.(q_to_mu(j).le.mu_edge(jj+1))) then
  189 + ! mu_dist(i,jj)=mu_dist(i,jj)+q_dist(i,j)
  190 + ! end if
  191 + ! end do
  192 + ! end do
  193 + ! write(*,*)euler(i),sum(q_dist(i,:))+ sum(q_dist(i,:)*q_to_mu*time_step)
  194 +
  195 + q_dist(i,:)=q_dist(i,:)+ q_dist(i,:)*q_to_mu*time_step
  196 + q_dist(i,:)=q_dist(i,:)+q_dummy
  197 + euler(i)=sum(q_dist(i,:))
  198 +
  199 +
  200 +
  201 +
  202 + end if
  203 +
  204 + end do
  205 +
92 206 !===============================================================================
93 207 end subroutine bio_euler
... ...
src/BIO_LAGRANGE.f90
... ... @@ -38,12 +38,18 @@
38 38 double precision :: Idark=50
39 39 double precision, dimension(100000) :: Fi
40 40 double precision,allocatable :: nb1(:)
  41 + double precision,allocatable :: Pl(:),Pd(:)
  42 + double precision, allocatable :: CLQUOT_lag(:)
41 43  
42 44 allocate(light_level(Nlevel))
43 45 allocate(dummy1(Nlevel))
44 46 allocate(light_bin(Nbin))
45 47 allocate(nb(Nbin))
46 48 allocate(nb1(Nbin))
  49 +
  50 + allocate(Pl(Nbpart))
  51 + allocate(Pd(Nbpart))
  52 + allocate(CLQUOT_lag(Nbpart))
47 53  
48 54 Fi(1:100000)=0
49 55 div=0
... ... @@ -76,51 +82,87 @@
76 82  
77 83 do i=1,nbpart
78 84  
79   - bin=1+floor(z_cell(i)*z_res) !find the bin where the particle is.
  85 + qlag(i)=Ncell_lag(i)/weight(i)
  86 + if (qlag(i).gt.q_max)then
  87 + !write(*,*)qlag(i)
  88 + Ncell_lag(i)=q_max*weight(i)
  89 + qlag(i)=Ncell_lag(i)/weight(i)
  90 + end if
  91 +
  92 +
  93 + bin=1+floor(z_cell(i)*z_res)
  94 + !find the bin where the particle is.
  95 +
  96 + if (photo_model.eq.1) then
80 97 uptlight(i)=Pdmax*(1d0-dexp(-light_bin(bin)/Idark)) !compute P(I)
81 98  
  99 + else
  100 +
  101 + CLQUOT_lag(i)=CL_lag(i)/weight(i)
  102 + ! uptlight(i)=Pdmax*(1d0-dexp(-light_bin(bin)/(Idark+1000*CLQUOT_lag(i))))
  103 + uptlight(i)=light_bin(bin)/(light_bin(bin)+(500*CLQUOT_lag(i))**2)
  104 +
  105 +
  106 + if (light_bin(bin)/(rad_max*0.45*4.16).lt.0.01) then
  107 + Clquot_ACC(bin)=0.04
  108 + else
  109 + Clquot_ACC(bin)=0.01+0.03*log(light_bin(bin)/(rad_max*0.45*4.16))/log(0.01)
  110 + end if
  111 +
  112 +
  113 +
  114 + end if
  115 +
  116 +
82 117 if (bio_model.eq.1) then ! Use Monod's equations
83 118  
84 119 Dphyto_lag(i)=(uptlight(i)*mu_max*(N_lag(bin)/(Kn+N_lag(bin))) -mortality)-mu_r !compute growth rate
85 120 Nut_taken(bin)=Nut_taken(bin)+(uptlight(i)*mu_max*(N_lag(bin)/(Kn+N_lag(bin))))*q0*weight(i) !nutrient taken
86   - weight_cell(i)=weight_cell(i)+Dphyto_lag(i)*time_step*weight_cell(i) !compute growth for each particle
  121 + weight(i)=weight(i)+Dphyto_lag(i)*time_step*weight(i) !compute growth for each particle
  122 +
  123 + if (photo_model.eq.2) then
  124 + CL_lag(i)=CL_lag(i)+(1/tau*(Clquot_ACC(bin)-CLQUOT_lag(i))*weight(i)+Dphyto_lag(i)*CL_lag(i))*time_step
  125 + end if
87 126  
88 127 else ! Use Droop's equations
89 128  
90 129  
91   - do ii=1,20
92   - if ((qlag(i).ge.Qcat(ii)).and.(qlag(i).le.Qcat(ii+1))) then
93   - Q_distrib(bin,ii)=Q_distrib(bin,ii)+1
94   - end if
95   - end do
  130 + ! do ii=1,Ncat
  131 + ! if ((qlag(i).ge.q_edge(ii)).and.(qlag(i).le.q_edge(ii+1))) then
  132 + ! Q_distrib(bin,ii)=Q_distrib(bin,ii)+1
  133 + ! end if
  134 + ! end do
  135 +
  136 +
96 137 Uptake_lag(i)=Vmax*(N_lag(bin)/(Kn+N_lag(bin)))*(1-qlag(i)/q_max) ! nutrient uptake
97   - Nut_taken(bin)=Nut_taken(bin)+(Uptake_lag(i)-kw*qlag(i))*weight(i) ! nutrient taken
98   - if (qlag(i).ge.q0) then !compute growth rate
  138 + Ncell_lag(i)=Ncell_lag(i)+(Uptake_lag(i)-kw*qlag(i))*time_step*weight(i)-mu_r*Ncell_lag(i)*time_step
  139 + Nut_taken(bin)=Nut_taken(bin)+(Uptake_lag(i)-kw*qlag(i))*weight(i)-mu_r*Ncell_lag(i) ! nutrient taken
  140 +
  141 +
  142 + if (qlag(i).ge.q0) then
99 143 Dphyto_lag(i)=uptlight(i)*mu_max*(1-q0/qlag(i)) -mu_r
  144 + !Dphyto_lag(i)=uptlight(i)*mu_max*(qlag(i)/q_max) -mu_r
100 145 else
101 146 Dphyto_lag(i)=-mortality -mu_r
102 147 end if
103   - do ii=1,20
104   - if ((Dphyto_lag(i).ge.growthcat(ii)).and.(Dphyto_lag(i).le.growthcat(ii+1))) then
105   - growth_distrib(bin,ii)=growth_distrib(bin,ii)+1
106   - end if
107   - end do
108   -
109   - qlag(i)=qlag(i)+(Uptake_lag(i)-kw*qlag(i)-Dphyto_lag(i)*qlag(i))*time_step !change in cell quota
110   - weight_cell(i)=weight_cell(i)+Dphyto_lag(i)*time_step*weight_cell(i) !compute growth for each particle
  148 + ! do ii=1,Ncat
  149 + !if ((Dphyto_lag(i).ge.mu_edge(ii)).and.(Dphyto_lag(i).le.mu_edge(ii+1))) then
  150 + ! growth_distrib(bin,ii)=growth_distrib(bin,ii)+1
  151 + ! end if
  152 + ! end do
  153 +
  154 + weight(i)=weight(i)+Dphyto_lag(i)*time_step*weight(i) !compute growth for each particle
  155 +
  156 +
111 157  
112 158 end if
113 159  
114 160  
115   - if(weight_cell(i).gt.2d0*m0) then !cell division
116   - S(i)=2*S(i) !
117   - weight_cell(i)=weight_cell(i)*0.5 !
118   - end if !
119   - weight(i)=S(i)*weight_cell(i) !
  161 +
120 162  
121 163  
122 164 if (part_management.eq.1) then !particle management
123   - if(S(i).gt.16*4e6) then !if 4 divisions
  165 + if(weight(i).gt.16*m0) then !if 4 divisions
124 166 div=div+1 ! Number of particle to be divided
125 167 Fi(div)=i ! save which particle to be divided
126 168 end if !
... ...
src/INITIALIZATION.f90
... ... @@ -23,7 +23,14 @@
23 23 integer :: i
24 24 integer :: j
25 25 integer :: a
26   -
  26 + double precision, allocatable ::light_level(:),light_bin(:)
  27 + double precision, allocatable :: dummy1(:)
  28 +
  29 +
  30 + allocate(light_level(Nlevel))
  31 + allocate(light_bin(Nbin))
  32 + allocate(dummy1(Nlevel))
  33 +
27 34 !_____________________________________________________________________________
28 35  
29 36  
... ... @@ -50,7 +57,7 @@
50 57 z_cell(i)=depth/nbpart/2d0+DBLE(i-1)*(depth/nbpart) !
51 58 end do !
52 59 end if !
53   -
  60 +
54 61  
55 62  
56 63 !______________________________________________________________________________
... ... @@ -59,9 +66,11 @@
59 66  
60 67  
61 68  
62   - S(1:nbpart)=4e6 !initial biomass per particle
63   - weight_cell(1:nbpart)=m0 !
64   - weight(1:nbpart)=S*weight_cell !
  69 + !S(1:nbpart)=4e6 !initial biomass per particle
  70 + !weight_cell(1:nbpart)=m0 !
  71 + !weight(1:nbpart)=S*weight_cell !
  72 +
  73 + weight(1:nbpart)=m0
65 74  
66 75 binned_weight(1:Nbin)=0
67 76 binned_pos=0
... ... @@ -77,18 +86,55 @@
77 86 euler=binned_weight/dz
78 87  
79 88  
80   - q(1:Nbin)=q0 !initial cell quota
81   - qlag(1:nbpart)=q0 !
  89 + Ncell(1:Nbin)=q0*euler !initial cell quota
  90 + Ncell_lag=q0*weight
  91 + qlag(1:nbpart)=Ncell_lag/weight !
82 92 binned_Qlag(1:Nbin)=q0 !
83   - q=q*euler !
  93 + q=Ncell/euler !
84 94  
85   - growthcat(1)=0d0
86   - Qcat(1)=q0
87   - do i=2,21
88   - Qcat(i)=Qcat(i-1)+(q_max-q0)/20d0
89   - growthcat(i)=growthcat(i-1)+(mu_max)/20d0
  95 + mu_edge(1)=-2e-6
  96 + q_edge(1)=q0
  97 + do i=2,Ncat+1
  98 + q_edge(i)=q_edge(i-1)+(q_max-q0)/Ncat
  99 + mu_edge(i)=mu_edge(i-1)+(mu_max+2e-6)/Ncat
90 100 end do
  101 +
  102 +
  103 + do i=1,Ncat
  104 + q_cat(i)=(q_edge(i)+q_edge(i+1))/2d0
  105 + mu_cat(i)=(mu_edge(i)+mu_edge(i+1))/2d0
  106 + end do
  107 + q_dist=0d0
  108 + q_dist(:,1)=euler(10)
  109 + mu_dist=0
  110 +
  111 + if (photo_model.eq.2) then
  112 + light_level=rad*0.45*4.16*dexp(-k_bg*levels)
  113 + a=0
  114 + do i=1,Nlevel
  115 + dummy1(Nlevel-a)=light_level(i)
  116 + a=a+1
  117 + end do !
  118 + light_level=dummy1
  119 +
  120 +
  121 + do i=1,Nbin
  122 + light_bin(i)=(light_level(i)+light_level(i+1))/2
91 123  
  124 + if (light_bin(i)/(rad_max*0.45*4.16).lt.0.01) then
  125 + Clquot_ACC(i)=0.04
  126 + else
  127 + Clquot_ACC(i)=0.01+0.03*log(light_bin(i)/(rad_max*0.45*4.16))/log(0.01)
  128 + end if
  129 + CL=clquot_ACC*euler
  130 +
  131 + end do
  132 +
  133 + do i=1,nbpart
  134 + bin=1+floor(z_cell(i)*z_res)
  135 + CL_lag(i)=CL(bin)
  136 + end do
  137 + end if
92 138 !_________________________________________________________________________________
93 139 !nutrient profile
94 140 !_________________________________________________________________________________
... ...
src/MAIN.f90
... ... @@ -98,8 +98,8 @@
98 98 write(16,*) binned_weight/dz !
99 99 write(17,*) N_lag !
100 100 write(18,*) N_euler !
101   - write(21,*) K !
102   - write(31,*) q/euler !
  101 + write(21,*) Clquot_ACC!K !
  102 + write(31,*) Ncell/euler !
103 103 write(32,*) binned_Qlag !
104 104 write(33,*) grow !
105 105 write(34,*) binned_growth !
... ... @@ -123,19 +123,23 @@
123 123  
124 124 if (mod(time,output_time).eq.0) then !write outputs each output_time
125 125 !
126   - write(21,*) K !
127   - write(13,*) rad !
  126 + write(21,*) Clquot_ACC!K !
  127 + write(13,*) CL/euler!rad !
128 128 write(16,*) binned_weight/dz !
129 129 write(34,*) binned_growth !
130 130 write(12,*) euler !
131 131 write(17,*) N_lag !
132 132 write(18,*) N_euler !
133 133 write(33,*) grow !
134   - if(bio_model.eq.2) then !
  134 + if(bio_model.ge.2) then !
135 135 write(32,*) binned_Qlag !
136   - write(31,*) q/euler !
  136 + write(31,*) Ncell/euler !
137 137 Q_distrib2(:,:,i)=Q_distrib
138 138 growth_distrib2(:,:,i)=growth_distrib
  139 + if(bio_model.eq.3) then
  140 + q_dist2(:,:,i)=q_dist
  141 + mu_dist2(:,:,i)=mu_dist
  142 + end if
139 143 i=i+1
140 144 end if !
141 145 !
... ...
src/MODULE_PARAMETERS.f90
... ... @@ -151,11 +151,31 @@
151 151 double precision, allocatable :: weight_cell(:)
152 152 double precision, allocatable :: Q_distrib(:,:)
153 153 double precision, allocatable :: Q_distrib2(:,:,:)
154   - double precision, dimension(21) :: Qcat
155   - double precision, dimension(21) :: growthcat
  154 + double precision, allocatable :: Qcat(:)
  155 + double precision, allocatable :: growthcat(:)
156 156 double precision, allocatable :: growth_distrib(:,:)
157 157 double precision, allocatable :: growth_distrib2(:,:,:)
158   -
  158 + double precision, allocatable :: Ncell(:),Ncell_lag(:)
  159 + double precision :: Il=50
  160 + double precision :: Plmax=0.5
  161 + double precision :: Ib=150
  162 + double precision, allocatable :: CL(:),CL_lag(:),Clquot_ACC(:)
  163 + double precision :: tau=16000
  164 + integer :: photo_model=1
  165 +
  166 + !_________________MODEL_3_________________________
  167 + double precision, allocatable :: uptake_dist(:)
  168 + double precision, allocatable :: q_cat(:)
  169 + double precision, allocatable :: q_edge(:)
  170 + double precision, allocatable :: q_to_mu(:)
  171 + double precision, allocatable :: q_dist(:,:)
  172 + double precision, allocatable :: q_to_newq(:)
  173 + double precision, allocatable :: mu_dist(:,:)
  174 + double precision, allocatable :: mu_cat(:)
  175 + double precision, allocatable :: mu_edge(:)
  176 + double precision, allocatable :: mu_dist2(:,:,:)
  177 + double precision, allocatable :: q_dist2(:,:,:)
  178 + integer :: Ncat=200
159 179  
160 180 contains
161 181 !____________________________________________________________________________
... ... @@ -172,7 +192,7 @@
172 192 namelist /bio_parameter_nml/ bio_calc,bio_model,mu_max,q0,mortality, &
173 193 Kn,Vmax,nut_profile,nut_layer,Nutrient_0, &
174 194 Nutrient_1,Nutrient_2,bottom_flux,nut_relax, &
175   - w_s,part_management,mu_r,kw,q_max,m0
  195 + w_s,part_management,mu_r,kw,q_max,m0,photo_model
176 196  
177 197 open(14,file='nml/model_parameter.nml',status='old')
178 198 read(14,nml=model_parameter_nml)
... ... @@ -231,14 +251,31 @@
231 251 allocate(Nut(Nbin))
232 252 allocate(binned_growth(Nbin))
233 253 allocate(time_vec(L_time))
234   - allocate(Q_distrib(Nbin,20))
235   - allocate(Q_distrib2(Nbin,20,L_time))
236   - allocate(growth_distrib(Nbin,20))
237   - allocate(growth_distrib2(Nbin,20,L_time))
  254 + allocate(Q_distrib(Nbin,Ncat))
  255 + allocate(Q_distrib2(Nbin,Ncat,L_time))
  256 + allocate(growth_distrib(Nbin,Ncat))
  257 + allocate(growth_distrib2(Nbin,Ncat,L_time))
  258 + allocate(q_dist2(Nbin,Ncat,L_time))
  259 + allocate(mu_dist2(Nbin,Ncat,L_time))
  260 + allocate(q_dist(Nbin,Ncat))
  261 + allocate(mu_dist(Nbin,Ncat))
  262 + allocate(Ncell(Nbin))
  263 + allocate(Ncell_lag(nbpart))
  264 + allocate(Qcat(Ncat+1))
  265 + allocate(growthcat(Ncat+1))
  266 + allocate(mu_edge(Ncat+1))
  267 + allocate(mu_cat(Ncat))
  268 + allocate(q_to_newq(Ncat))
  269 + allocate(q_to_mu(Ncat))
  270 + allocate(q_edge(Ncat+1))
  271 + allocate(q_cat(Ncat))
  272 + allocate(uptake_dist(Ncat))
  273 + allocate(CL(Nbin))
  274 + allocate(CL_lag(nbpart))
  275 + allocate(Clquot_ACC(Nbin))
238 276  
239 277 end subroutine
240 278  
241 279  
242 280 !=================================================================================
243 281 END MODULE
244   -
... ...
src/PART_MGMT.f90
... ... @@ -28,6 +28,7 @@
28 28 double precision, allocatable :: weight_cell_av(:)
29 29 double precision, allocatable :: S_av(:)
30 30 double precision, allocatable :: weight_av(:)
  31 + double precision, allocatable :: Ncell_av(:)
31 32 integer, intent(in) :: div
32 33 integer :: nbp
33 34 double precision, dimension(100000),intent(in):: Fi
... ... @@ -52,6 +53,7 @@
52 53 allocate(uptlight_av(nbpart))
53 54 allocate(weight_cell_av(nbpart))
54 55 allocate(S_av(nbpart))
  56 + allocate(Ncell_av(nbpart))
55 57  
56 58  
57 59 z_cell_av=z_cell
... ... @@ -63,6 +65,7 @@
63 65 weight_cell_av=weight_cell
64 66 S_av=S
65 67 weight_av=weight
  68 + Ncell_av=Ncell_lag
66 69  
67 70 deallocate(weight)
68 71 deallocate(z_cell)
... ... @@ -73,6 +76,7 @@
73 76 deallocate(uptlight)
74 77 deallocate(weight_cell)
75 78 deallocate(S)
  79 + deallocate(Ncell_lag)
76 80  
77 81  
78 82 allocate(weight(nbp))
... ... @@ -84,24 +88,27 @@
84 88 allocate(uptlight(nbp))
85 89 allocate(weight_cell(nbp))
86 90 allocate(S(nbp))
  91 + allocate(Ncell_lag(nbp))
87 92  
88 93  
89 94 z_cell(1:nbpart)=z_cell_av
90 95 qlag(1:nbpart)=qlag_av
91 96 S(1:nbpart)=S_av
92 97 weight_cell(1:nbpart)=weight_cell_av
93   - weight(1:nbpart)=S_av*weight_cell_av
94   -
  98 + weight(1:nbpart)=weight_av
  99 + Ncell_lag(1:nbpart)=Ncell_av
95 100  
96 101  
97 102 z_cell(nbpart+1:nbp)=z_cell(INT(Fi(1:div)))
98 103 qlag(nbpart+1:nbp)=qlag(INT(Fi(1:div)))
99 104 weight_cell(nbpart+1:nbp)=weight_cell(INT(Fi(1:div)))
100   - S(nbpart+1:nbp)=S(INT(Fi(1:div)))/2
101   - weight(nbpart+1:nbp)=S(1:div)*weight_cell(1:div)
  105 + Ncell_lag(nbpart+1:nbp)=Ncell_lag(INT(Fi(1:div)))/2
  106 + weight(nbpart+1:nbp)=weight(INT(Fi(1:div)))/2
  107 +
  108 +
  109 + weight(INT(Fi(1:div)))=weight(INT(Fi(1:div)))/2
  110 + Ncell_lag(INT(Fi(1:div)))=Ncell_lag(INT(Fi(1:div)))/2
102 111  
103   - S(INT(Fi(1:div)))=S(INT(Fi(1:div)))/2
104   - weight(INT(Fi(1:div)))=S(INT(Fi(1:div)))*weight_cell(INT(Fi(1:div)))
105 112  
106 113  
107 114  
... ...
src/write_output.f90
... ... @@ -36,6 +36,8 @@
36 36 integer :: stat
37 37 integer :: growthcatID
38 38 integer :: QcatID
  39 + integer :: q_distID
  40 + integer :: mu_distID
39 41  
40 42 !_________________________________________________________________________________
41 43 stat=nf90_create(trim(root)//'/out.nc',cmode=or(nf90_clobber,nf90_64bit_offset),ncid=ncid)
... ... @@ -49,7 +51,7 @@ call handle_err(stat)
49 51  
50 52 stat=nf90_def_dim(ncid,"time", L_time, timeID)
51 53 call handle_err(stat)
52   - stat=nf90_def_dim(ncid,"ncat",20, ncatID)
  54 + stat=nf90_def_dim(ncid,"ncat",Ncat, ncatID)
53 55 call handle_err(stat)
54 56  
55 57  
... ... @@ -66,6 +68,13 @@ call handle_err(stat)
66 68 stat=nf90_def_var(ncid,"growth_rate",nf90_double,(/ depthID, ncatID, timeID/),growth_varID)
67 69 call handle_err(stat)
68 70  
  71 + stat=nf90_def_var(ncid,"cell quota eul",nf90_double,(/ depthID,ncatID,timeID /),q_distID)
  72 + call handle_err(stat)
  73 + stat=nf90_def_var(ncid,"growth_rate eul",nf90_double,(/ depthID,ncatID,timeID/),mu_distID)
  74 + call handle_err(stat)
  75 +
  76 +
  77 +
69 78 stat=nf90_def_var(ncid,"time",nf90_double,timeID,time_varID)
70 79 call handle_err(stat)
71 80  
... ... @@ -75,9 +84,9 @@ call handle_err(stat)
75 84 call handle_err(stat)
76 85 stat=nf90_put_var(ncid,depth_varID,levels(1:Nlevel-1))
77 86 call handle_err(stat)
78   - stat=nf90_put_var(ncid,growthcatID,growthcat(1:20))
  87 + stat=nf90_put_var(ncid,growthcatID,mu_cat)
79 88 call handle_err(stat)
80   - stat=nf90_put_var(ncid,QcatID,Qcat(1:20))
  89 + stat=nf90_put_var(ncid,QcatID,q_cat)
81 90 call handle_err(stat)
82 91  
83 92 stat=nf90_put_var(ncid,Q_varID,Q_distrib2)
... ... @@ -85,6 +94,12 @@ call handle_err(stat)
85 94 stat=nf90_put_var(ncid,growth_varID,growth_distrib2)
86 95 call handle_err(stat)
87 96  
  97 + stat=nf90_put_var(ncid,q_distID,q_dist2)
  98 + call handle_err(stat)
  99 + stat=nf90_put_var(ncid,mu_distID,mu_dist2)
  100 + call handle_err(stat)
  101 +
  102 +
88 103 stat=nf90_put_var(ncid,time_varID,time_vec)
89 104 call handle_err(stat)
90 105  
... ...