Commit f5cf019f10c794af2f25871139c4ccb737ce24be

Authored by Gwenaelle Gremion
1 parent b15ffe85
Exists in master and in 1 other branch snow

Beaucoup de developpement du modele

src/extras/bio/bio.F90
... ... @@ -867,7 +867,6 @@
867 867 if (allocated(ammlim2)) deallocate(ammlim2)
868 868 if (allocated(ppnet)) deallocate(ppnet)
869 869  
870   -
871 870 if (allocated(flux_msn)) deallocate(flux_msn)
872 871 if (allocated(Flux_P)) deallocate(Flux_P)
873 872 if (allocated(Flux_D1)) deallocate(Flux_D1)
... ... @@ -981,6 +980,8 @@
981 980 if (rc /= 0) STOP 'init_bio: Error allocating (sti_dzofp)'
982 981 allocate(sti_2fp(0:nlev),stat=rc)
983 982 if (rc /= 0) STOP 'init_bio: Error allocating (sti_2fp)'
  983 +
  984 +
984 985 !DD
985 986  
986 987 allocate(lumlim1(0:nlev),stat=rc)
... ...
src/extras/bio/bio_polynow.F90
Changes suppressed. Click to show <
1   -!$id: bio_polynow.F90,v 1.11 2016-05-05 11:49:15 dd Exp $
2   -#include"cppdefs.h"
3   -!-----------------------------------------------------------------------
4   -!BOP
5   -!
6   -! !MODULE: bio_fasham --- Fasham et al. biological model \label{sec:bio-fasham}
7   -!
8   -! !INTERFACE:
9   - module bio_polynow
10   -!
11   -!----DESCRIPTION:--------------------------------------------------------------
12   -! The model developed by Fashametal1990
13   -! uses nitrogen as 'currency' according to the evidence that in
14   -! most cases nitrogen is the limiting macronutrient. It consists of
15   -! seven state variables: phytoplankton, zooplankton, bacteria,
16   -! particulate organic matter (detritus), dissolved organic matter
17   -! and the nutrients nitrate and ammonium.
18   -! The structure of the biogeochemical model in XXX states variables
19   -! bacteria (bac),
20   -! phytoplankton (phy),
21   -! detritus (det),
22   -! zooplankton (zoo),
23   -! labile dissolved
24   -! organic nitrogen (don),
25   -! ammonium (amm) and nitrate (nit)
26   -! XXX
27   -
28   -! The concentrations are in mmol N\m^-3,and all fluxes are conservative.
29   -!---------------------------------------------------------------------------------
30   -
31   -! !USES:
32   -! default: all is private.
33   - use bio_var ! S,T,zlev
34   - use output
35   - use observations, only : aa,g2
36   - use turbulence, only : eps
37   - use meanflow, only : Rho_0
38   - use eqstate, only : eqstate1 ! In situ density in kg.m-3
39   -
40   -
41   - private
42   -!
43   -! !PUBLIC MEMBER FUNCTIONS:
44   - public init_bio_polynow, init_var_polynow, var_info_polynow, &
45   - light_polynow, do_bio_polynow, end_bio_polynow
46   - REALTYPE, public,parameter :: pi= 3.141592654
47   - REALTYPE, public,parameter :: g= 9.80665 !m/s2
48   - REALTYPE :: pres = 10.1325! gauge pressure (absolute pressure - 10.1325 bar)
49   - REALTYPE,public ::gauss_p
50   -
51   -
52   -
53   -!-----LOCAL VARIABLES:---------- from a namelist : bio_polynow.nml----------------------
54   -
55   -!INITIAL and Minimum concentration for the variable
56   -
57   - REALTYPE :: p_init_value=1.0
58   - REALTYPE :: p_initial=0.01
59   - REALTYPE :: z_p_gauss_init= 2.0
60   - REALTYPE :: sigma_p=2.0
61   -
62   - REALTYPE :: zoo_init_value=1.0
63   - REALTYPE :: z_initial=0.01
64   - REALTYPE :: z_zoo_gauss_init= 2.0
65   - REALTYPE :: sigma_zoo=2.0
66   -
67   - REALTYPE :: b_initial= 0.001
68   -
69   -! Nitrate and ammonium are initialized within the GOTM observation module
70   -! REALTYPE :: n_initial= 8.3
71   -! REALTYPE :: a_initial= 0.22
72   -!Classes de détritus et LDON
73   -
74   - REALTYPE :: dph_init_value=1.0
75   - REALTYPE :: dph_initial=0.01
76   - REALTYPE :: z_dph_gauss_init= 2.0
77   - REALTYPE :: sigma_dph=2.0
78   -
79   - REALTYPE :: dzo_init_value=1.0
80   - REALTYPE :: dzo_initial=0.01
81   - REALTYPE :: z_dzo_gauss_init= 2.0
82   - REALTYPE :: sigma_dzo=2.0
83   -
84   - REALTYPE :: fp_init_value=1.0
85   - REALTYPE :: fp_initial=0.01
86   - REALTYPE :: z_fp_gauss_init= 2.0
87   - REALTYPE :: sigma_fp=2.0
88   -
89   - REALTYPE :: msn_init_value=1.0
90   - REALTYPE :: msn_initial=0.01
91   - REALTYPE :: z_msn_gauss_init= 2.0
92   - REALTYPE :: sigma_msn=2.0
93   -
94   - REALTYPE :: l_initial= 0.14
95   - REALTYPE :: p0 = 0.0
96   - REALTYPE :: z0 = 0.0
97   - REALTYPE :: b0 = 0.0
98   - REALTYPE :: mu5 = 0.02 !! GG-CHG1
99   -!Phytoplankton
100   - REALTYPE :: vp = 1.5
101   - REALTYPE :: alpha = 0.065
102   - REALTYPE :: inib = 0.05
103   - REALTYPE, public :: kc = 0.03
104   - REALTYPE :: k1 = 0.2
105   - REALTYPE :: k2 = 0.8
106   - REALTYPE :: mu1 = 0.05
107   - REALTYPE :: k5 = 0.2
108   - REALTYPE :: gamma = 0.05
109   - REALTYPE :: txloss_p = 0.7 ! GG-D
110   - REALTYPE :: txloss_dph = 0.05 ! GG-D
111   -
112   -!Zooplankton
113   - REALTYPE :: gmax = 1.0
114   - REALTYPE :: k3 = 1.0
115   - REALTYPE :: beta = 0.625
116   - REALTYPE :: mu2 = 0.3
117   - REALTYPE :: k6 = 0.2
118   - REALTYPE :: delta = 0.1
119   - REALTYPE :: epsi = 0.70
120   - REALTYPE :: eg = 0.05 ! GG-D
121   - REALTYPE :: r1 = 0.55
122   - REALTYPE :: r2 = 0.4
123   - REALTYPE :: r3 = 0.05 !dph GG-D
124   - REALTYPE :: r4 = 0.05 !dzo GG-D
125   - REALTYPE :: r5 = 0.05 !fp GG-D
126   - REALTYPE :: r6 = 0.05 !msn GG-D
127   - REALTYPE :: zingest = 0.05 ! GG-D
128   - REALTYPE :: txloss_dzo = 0.05 ! GG-D
129   - REALTYPE :: txloss_fp = 0.05 ! GG-D
130   -! Vertical migration(From Ariadna Nocera)
131   - !LOGICAL and integer doesn't work :: Migra_zoo=.true.
132   - REALTYPE :: Migra_zoo= 1.0
133   - REALTYPE :: pmin = 0.05
134   - REALTYPE :: w_zmax = 100.0 !! GG-B
135   - REALTYPE :: bertha = 0.05 !! GG-B
136   - REALTYPE :: parcrit = 0.02 !! GG-B
137   -!Bacterias
138   - REALTYPE :: vb = 1.2
139   - REALTYPE :: remi = 0.1
140   - REALTYPE :: k4 = 0.5
141   - REALTYPE :: mu3 = 0.15
142   - REALTYPE :: eta = 0.0
143   - REALTYPE :: mbac = 0.0 ! GG-D
144   - REALTYPE ::dphlossb =0.4
145   - REALTYPE :: dphlossl = 10.0 ! GG-D
146   - REALTYPE :: dzolossl = 10.0 ! GG-D
147   - REALTYPE :: dzolossb = 10.0 ! GG-D
148   - REALTYPE :: fplossl = 10.0 ! GG-D
149   - REALTYPE :: fplossb = 10.0 ! GG-D
150   - REALTYPE :: msnlossb =0.6
151   -!LDON
152   - REALTYPE :: leak=0.1
153   - REALTYPE :: mldon = 0.02 ! GG-D
154   - REALTYPE :: lmin = 0.02 ! GG-D
155   -!detritus/Settling
156   - ! LOGICAL :: Phys_w= .true.
157   - REALTYPE :: size_w=0.0
158   - REALTYPE :: Phys_w= 0.0
159   - REALTYPE :: w_msnow= 0.0
160   - REALTYPE :: w_p = -0.5
161   - REALTYPE :: w_dph = -1.0 !!GG-C
162   - REALTYPE :: w_dzo = -10.0 !!GG-C
163   - REALTYPE :: w_fp = -100.0 !!GG-C
164   - REALTYPE :: w_msn = -2.0 !!GG-C
165   -
166   - REALTYPE :: rho_p = 0.02
167   - REALTYPE :: rho_dph = 0.02
168   - REALTYPE :: rho_dzo = 0.02
169   - REALTYPE :: rho_fp = 0.02
170   - REALTYPE :: rho_msn = 0.02
171   -!Aggregation
172   -! LOGICAL :: Coag_coef=.true.
173   - REALTYPE :: Coag_coef=0.0 ! If true : utilisation of given parameters / False : utilisation of model calculate coefficient
174   -! Coefficient de Kernel sans calcul via la physique
175   - REALTYPE :: betap_p = 0.2
176   - REALTYPE :: betap_dph= 1
177   - REALTYPE :: betap_dzo= 1
178   - REALTYPE :: betap_fp= 1
179   -
180   - REALTYPE :: betadph_dph = 0.2
181   - REALTYPE :: betadph_dzo= 1
182   - REALTYPE :: betadph_fp= 1
183   -
184   - REALTYPE :: betadzo_dzo = 0.02
185   - REALTYPE :: betadzo_fp = 0.02
186   - REALTYPE :: betafp_fp = 0.02
187   -!Calcul de la collision avec la physique
188   - REALTYPE :: sti_cst = 0.0
189   - REALTYPE :: stip_p = -0.5
190   - REALTYPE :: stip_dph = -0.5
191   - REALTYPE :: stip_dzo = -0.5
192   - REALTYPE :: stip_fp = -0.5
193   - REALTYPE :: stidph_dph = -0.5
194   - REALTYPE :: stidph_dzo = -0.5
195   - REALTYPE :: stidph_fp = -0.5
196   - REALTYPE :: stidzo_dzo = -0.5
197   - REALTYPE :: stidzo_fp = -0.5
198   - REALTYPE :: stifp_fp = -0.5
199   -!Collision rate and Settling
200   - REALTYPE :: min_flux_msn = 2.0E-09
201   - REALTYPE :: size_rand = 1.0
202   - REALTYPE :: size_phy_us = -0.5
203   - REALTYPE :: size_phy_up = -0.5
204   - REALTYPE :: size_dph_us = 0.00001
205   - REALTYPE :: size_dph_up = 0.00001
206   - REALTYPE :: size_dzo_us= 0.000100
207   - REALTYPE :: size_dzo_up= 0.000100
208   - REALTYPE :: size_fp_us= 0.000050
209   - REALTYPE :: size_fp_up= 0.000050
  1 +!$id: bio_polynow.F90,v 1.11 2016-05-05 11:49:15 dd Exp $
  2 +#include"cppdefs.h"
  3 +!-----------------------------------------------------------------------
  4 +!BOP
  5 +!
  6 +! !MODULE: bio_fasham --- Fasham et al. biological model \label{sec:bio-fasham}
  7 +!
  8 +! !INTERFACE:
  9 + module bio_polynow
  10 +!
  11 +!----DESCRIPTION:--------------------------------------------------------------
  12 +! The model developed by Fashametal1990
  13 +! uses nitrogen as 'currency' according to the evidence that in
  14 +! most cases nitrogen is the limiting macronutrient. It consists of
  15 +! seven state variables: phytoplankton, zooplankton, bacteria,
  16 +! particulate organic matter (detritus), dissolved organic matter
  17 +! and the nutrients nitrate and ammonium.
  18 +! The structure of the biogeochemical model in XXX states variables
  19 +! bacteria (bac),
  20 +! phytoplankton (phy),
  21 +! detritus (det),
  22 +! zooplankton (zoo),
  23 +! labile dissolved
  24 +! organic nitrogen (don),
  25 +! ammonium (amm) and nitrate (nit)
  26 +! XXX
  27 +
  28 +! The concentrations are in mmol N\m^-3,and all fluxes are conservative.
  29 +!---------------------------------------------------------------------------------
  30 +
  31 +! !USES:
  32 +! default: all is private.
  33 + use bio_var ! S,T,zlev,rho
  34 + use output
  35 + use observations, only : aa,g2
  36 + use turbulence, only : eps
  37 + use meanflow, only : Rho_0
  38 +
  39 +
  40 + ! use eqstate, only : eqstate1 ! In situ density in kg.m-3
  41 +
  42 +
  43 + private
  44 +!
  45 +! !PUBLIC MEMBER FUNCTIONS:
  46 + public init_bio_polynow, init_var_polynow, var_info_polynow, &
  47 + light_polynow, do_bio_polynow, end_bio_polynow
  48 + REALTYPE, public,parameter :: pi= 3.141592654
  49 + REALTYPE, public,parameter :: g= 9.80665 !m/s2
  50 + REALTYPE :: pres = 10.1325! gauge pressure (absolute pressure - 10.1325 bar)
  51 + REALTYPE,public ::gauss_p
  52 +
  53 +
  54 +
  55 +!-----LOCAL VARIABLES:---------- from a namelist : bio_polynow.nml----------------------
  56 +
  57 + REALTYPE :: dt_bio
  58 + REALTYPE :: splitfac_bio
  59 +!INITIAL and Minimum concentration for the variable
  60 +
  61 + REALTYPE :: p_init_value=1.0
  62 + REALTYPE :: p_initial=0.01
  63 + REALTYPE :: z_p_gauss_init= 2.0
  64 + REALTYPE :: sigma_p=2.0
  65 +
  66 + REALTYPE :: zoo_init_value=1.0
  67 + REALTYPE :: z_initial=0.01
  68 + REALTYPE :: z_zoo_gauss_init= 2.0
  69 + REALTYPE :: sigma_zoo=2.0
  70 +
  71 + REALTYPE :: b_initial= 0.001
  72 +
  73 +! Nitrate and ammonium are initialized within the GOTM observation module
  74 +! REALTYPE :: n_initial= 8.3
  75 +! REALTYPE :: a_initial= 0.22
  76 +!Classes de détritus et LDON
  77 +
  78 + REALTYPE :: dph_init_value=1.0
  79 + REALTYPE :: dph_initial=0.01
  80 + REALTYPE :: z_dph_gauss_init= 2.0
  81 + REALTYPE :: sigma_dph=2.0
  82 +
  83 + REALTYPE :: dzo_init_value=1.0
  84 + REALTYPE :: dzo_initial=0.01
  85 + REALTYPE :: z_dzo_gauss_init= 2.0
  86 + REALTYPE :: sigma_dzo=2.0
  87 +
  88 + REALTYPE :: fp_init_value=1.0
  89 + REALTYPE :: fp_initial=0.01
  90 + REALTYPE :: z_fp_gauss_init= 2.0
  91 + REALTYPE :: sigma_fp=2.0
  92 +
  93 + REALTYPE :: msn_init_value=1.0
  94 + REALTYPE :: msn_initial=0.01
  95 + REALTYPE :: z_msn_gauss_init= 2.0
  96 + REALTYPE :: sigma_msn=2.0
  97 +
  98 + REALTYPE :: l_initial= 0.14
  99 + REALTYPE :: p0 = 0.0
  100 + REALTYPE :: z0 = 0.0
  101 + REALTYPE :: b0 = 0.0
  102 + REALTYPE :: mu5 = 0.02 !! GG-CHG1
  103 +!Phytoplankton
  104 + REALTYPE :: vp = 1.5
  105 + REALTYPE :: alpha = 0.065
  106 + REALTYPE :: inib = 0.05
  107 + REALTYPE, public :: kc = 0.03
  108 + REALTYPE :: k1 = 0.2
  109 + REALTYPE :: k2 = 0.8
  110 + REALTYPE :: mu1 = 0.05
  111 + REALTYPE :: k5 = 0.2
  112 + REALTYPE :: gamma = 0.05
  113 + REALTYPE :: txloss_p = 0.7 ! GG-D
  114 + REALTYPE :: txloss_dph = 0.05 ! GG-D
  115 +
  116 +!Zooplankton
  117 + REALTYPE :: gmax = 1.0
  118 + REALTYPE :: k3 = 1.0
  119 + REALTYPE :: beta = 0.625
  120 + REALTYPE :: mu2 = 0.3
  121 + REALTYPE :: k6 = 0.2
  122 + REALTYPE :: delta = 0.1
  123 + REALTYPE :: epsi = 0.70
  124 + REALTYPE :: eg = 0.05 ! GG-D
  125 + REALTYPE :: r1 = 0.55
  126 + REALTYPE :: r2 = 0.4
  127 + REALTYPE :: r3 = 0.05 !dph GG-D
  128 + REALTYPE :: r4 = 0.05 !dzo GG-D
  129 + REALTYPE :: r5 = 0.05 !fp GG-D
  130 + REALTYPE :: r6 = 0.05 !msn GG-D
  131 + REALTYPE :: txloss_dzo = 0.05 ! GG-D
  132 + REALTYPE :: txloss_fp = 0.05 ! GG-D
  133 +! Vertical migration(From Ariadna Nocera)
  134 + !LOGICAL and integer doesn't work :: Migra_zoo=.true.
  135 + REALTYPE :: Migra_zoo= 1.0
  136 + REALTYPE :: pmin = 0.05
  137 + REALTYPE :: w_zmax = 100.0 !! GG-B
  138 + REALTYPE :: bertha = 0.05 !! GG-B
  139 + REALTYPE :: parcrit = 0.02 !! GG-B
  140 +!Bacterias
  141 + REALTYPE :: vb = 1.2
  142 + REALTYPE :: remi = 0.1
  143 + REALTYPE :: k4 = 0.5
  144 + REALTYPE :: mu3 = 0.15
  145 + REALTYPE :: eta = 0.0
  146 + REALTYPE :: mbac = 0.0 ! GG-D
  147 + REALTYPE ::dphlossb =0.4
  148 + REALTYPE :: dphlossl = 10.0 ! GG-D
  149 + REALTYPE :: dzolossl = 10.0 ! GG-D
  150 + REALTYPE :: dzolossb = 10.0 ! GG-D
  151 + REALTYPE :: fplossl = 10.0 ! GG-D
  152 + REALTYPE :: fplossb = 10.0 ! GG-D
  153 + REALTYPE :: msnlossb =0.6
  154 +!LDON
  155 + REALTYPE :: leak=0.1
  156 + REALTYPE :: mldon = 0.02 ! GG-D
  157 + REALTYPE :: lmin = 0.02 ! GG-D
  158 +!detritus/Settling
  159 + ! LOGICAL :: Phys_w= .true.
  160 + REALTYPE :: size_w=0.0
  161 + REALTYPE :: Phys_w= 0.0
  162 + REALTYPE :: w_msnow= 0.0
  163 + REALTYPE :: w_p = -0.5
  164 + REALTYPE :: w_dph = -1.0 !!GG-C
  165 + REALTYPE :: w_dzo = -10.0 !!GG-C
  166 + REALTYPE :: w_fp = -100.0 !!GG-C
  167 + REALTYPE :: w_msn = -2.0 !!GG-C
  168 +
  169 + REALTYPE :: rho_p = 0.02
  170 + REALTYPE :: rho_dph = 0.02
  171 + REALTYPE :: rho_dzo = 0.02
  172 + REALTYPE :: rho_fp = 0.02
  173 + REALTYPE :: rho_msn = 0.02
  174 +!Aggregation
  175 +! LOGICAL :: Coag_coef=.true.
  176 + REALTYPE :: Coag_coef=0.0 ! If true : utilisation of given parameters / False : utilisation of model calculate coefficient
  177 +! Coefficient de Kernel sans calcul via la physique
  178 + REALTYPE :: betap_p = 0.2
  179 + REALTYPE :: betap_dph= 1
  180 + REALTYPE :: betap_dzo= 1
  181 + REALTYPE :: betap_fp= 1
  182 +
  183 + REALTYPE :: betadph_dph = 0.2
  184 + REALTYPE :: betadph_dzo= 1
  185 + REALTYPE :: betadph_fp= 1
  186 +
  187 + REALTYPE :: betadzo_dzo = 0.02
  188 + REALTYPE :: betadzo_fp = 0.02
  189 + REALTYPE :: betafp_fp = 0.02
  190 +!Calcul de la collision avec la physique
  191 + REALTYPE :: sti_cst = 0.0
  192 + REALTYPE :: stip_p = -0.5
  193 + REALTYPE :: stip_dph = -0.5
  194 + REALTYPE :: stip_dzo = -0.5
  195 + REALTYPE :: stip_fp = -0.5
  196 + REALTYPE :: stidph_dph = -0.5
  197 + REALTYPE :: stidph_dzo = -0.5
  198 + REALTYPE :: stidph_fp = -0.5
  199 + REALTYPE :: stidzo_dzo = -0.5
  200 + REALTYPE :: stidzo_fp = -0.5
  201 + REALTYPE :: stifp_fp = -0.5
  202 +!Collision rate and Settling
  203 + REALTYPE :: CSF =1.0
  204 + REALTYPE :: size_rand = 1.0
  205 + REALTYPE :: size_phy_us = -0.5
  206 + REALTYPE :: size_phy_up = -0.5
  207 + REALTYPE :: size_dph_us = 0.00001
  208 + REALTYPE :: size_dph_up = 0.00001
  209 + REALTYPE :: size_dzo_us= 0.000100
  210 + REALTYPE :: size_dzo_up= 0.000100
  211 + REALTYPE :: size_fp_us= 0.000050
  212 + REALTYPE :: size_fp_up= 0.000050
210 213 REALTYPE :: size_msn = -0.5
211   -!Parametres pour l'aggregation physique
212   - REALTYPE :: dynvis = -0.5
213   - REALTYPE :: kinvis = -0.5
214   - REALTYPE :: kB = -0.5
215   -!Fragmentation - Concentration seuil d'agrégat avant qu'un pourcentage parte dans le dph
216   - !logical :: Frag_meth=.true. !Utilisation de la physique ou pas pour la fragmentation
217   -! integer :: Frag_meth=0.0
218   - REALTYPE :: Frag_meth=0.0
219   - REALTYPE :: swim_brk = 0.8
220   -REALTYPE ::Floc_coef = 0.1
221   -REALTYPE ::lim_size=3.0
222   -!Tests parameter
223   - REALTYPE ::betaBr=1.0
224   - REALTYPE ::betaSh =1.0
225   - REALTYPE ::betaDs =1.0
226   - REALTYPE ::eps_const =1.0
227   - REALTYPE ::eps_n =1.0
228   - REALTYPE ::cons_min= 0.00001
229   -
230   - REALTYPE ::write_screen
231   -
232   - integer :: out_unit
233   - integer, parameter :: p=1,z=2,b=3,d1=4,n=5,a=6,l=7,d2=8,d3=9,d4=10,aug_si_d4=11,taille_msn=12
234   -! GG d1= dph , d2= dzo , d3= fp , d4 = msn, aug_si_d4= size_msn
235   -
236   -!EOP
237   -!-----------------------------------------------------------------------
238   -
239   - contains
240   -
241   -!-----------------------------------------------------------------------
242   -!BOP
243   -!
244   -! !IROUTINE: Initialise the bio module
245   -!
246   -! !INTERFACE:
247   - subroutine init_bio_polynow(namlst,fname,unit)
248   -!
249   -! !DESCRIPTION:
250   -! Here, the bio namelist bio_polynow.nml is read and
251   -! various variables (rates and settling velocities)
252   -! are transformed into SI units.
253   -!
254   -! !USES:
255   - IMPLICIT NONE
256   -!
257   -! !INPUT PARAMETERS:
258   - integer, intent(in) :: namlst
259   - character(len=*), intent(in) :: fname
260   - character(len=20) :: pfile
261   - integer, intent(in) :: unit
262   -!
263   -! !REVISION HISTORY:
264   -! Original author(s): Hans Burchard & Karsten Bolding
265   -!
266   -! !LOCAL VARIABLES:
267   - namelist /bio_polynow_nml/ numc, &
268   -
269   - p_init_value,p_initial,z_p_gauss_init,sigma_p, &
270   -zoo_init_value,z_initial,z_zoo_gauss_init,sigma_zoo, &
271   -b_initial, &
272   -dph_init_value,dph_initial,z_dph_gauss_init,sigma_dph, &
273   -dzo_init_value,dzo_initial,z_dzo_gauss_init,sigma_dzo, &
274   -fp_init_value,fp_initial,z_fp_gauss_init,sigma_fp, &
275   - msn_init_value,msn_initial,z_msn_gauss_init,sigma_msn, &
276   - l_initial,p0,z0,b0,mu5, &
277   - vp,alpha,inib,kc,k1,k2,mu1,k5,gamma,txloss_p,txloss_dph, & ! phytoplankton
278   - gmax,k3,beta,mu2,k6,delta,epsi,eg,r1,r2,r3,r4,r5,r6,zingest, & ! zooplankton
279   - txloss_dzo,txloss_fp, &
280   - Migra_zoo,pmin,w_zmax,bertha,parcrit, & !Vertical migration from Nocera
281   - vb,remi,k4,mu3,eta,mbac,dphlossb,dphlossl,dzolossl,dzolossb,fplossl,fplossb,msnlossb, & !Bacterias
282   - leak,mldon,lmin, & !LDON
283   - size_w,Phys_w,w_msnow,w_p,w_dph,w_dzo,w_fp,w_msn, & !Detritus
284   -rho_p,rho_dph,rho_dzo,rho_fp,rho_msn, &
285   - Coag_coef, &
286   - betap_p,betap_dph,betap_dzo,betap_fp, &
287   - betadph_dph,betadph_dzo,betadph_fp, &
288   - betadzo_dzo,betadzo_fp,betafp_fp , & !Aggregation
289   - sti_cst, &
290   - stip_p,stip_dph,stip_dzo,stip_fp,stidph_dph,stidph_dzo,stidph_fp,stidzo_dzo,stidzo_fp,stifp_fp, &
291   - min_flux_msn,size_rand,size_phy_us,size_phy_up,size_dph_us,size_dph_up,size_dzo_us,size_dzo_up,&
292   - size_fp_us,size_fp_up,size_msn,&
293   - dynvis,kinvis,kB, &
294   - Frag_meth,swim_brk, &
295   -Floc_coef,lim_size, &
296   - betaBr,betaSh,betaDs, &
297   - eps_const,eps_n,cons_min, &
298   - write_screen
299   -
300   -!EOP
301   -!-----------------------------------------------------------------------
302   -!BOC
303   - LEVEL2 'init_bio_polynow'
304   -
305   - open(namlst,file=fname,action='read',status='old',err=98)
306   - read(namlst,nml=bio_polynow_nml,err=99)
307   - close(namlst)
308   -
309   - numcc=numc
310   -!----Print some parameter values in standard output and save them in a separate file [out_fn]_polynow.par
311   - pfile = trim(out_fn) // '_polynow.par'
312   - open(10,status='unknown',action='write',file=pfile)
313   - LEVEL3 'Biogeochemical parameters saved in ', pfile
314   -
315   -
316   - !p_init_value=1.0
317   - write(*,900) ' p_initial = ',p_initial
318   - write(10,901) p_initial
319   - !z_p_gauss_init= -10
320   - !sigma_p= 2.0
321   -!zoo_init_value
322   - write(*,900) ' z_initial = ',z_initial
323   - write(10,901) z_initial
324   -! z_zoo_gauss_init
325   -! sigma_zoo
326   - write(*,900) ' b_initial = ',b_initial
327   - write(10,901) b_initial
328   -!dph_init_value=1.0
329   - write(*,900) ' dph_initial = ',dph_initial
330   - write(10,901) dph_initial
331   - !z_dph_gauss_init= -10
332   - !sigma_dph= 2.0
333   -!dzo_init_value=1.0
334   - write(*,900) ' dzo_initial = ',dzo_initial
335   - write(10,901) dzo_initial
336   - !z_dzo_gauss_init= -10
337   - !sigma_dzo= 2.0
338   -!fp_init_value=1.0
339   - write(*,900) ' fp_initial = ',fp_initial
340   - write(10,901) fp_initial
341   - !z_fp_gauss_init= -10
342   - !sigma_fp= 2.0
343   -!msn_init_value=1.0
344   - write(*,900) ' msn_initial = ',msn_initial
345   - write(10,901) msn_initial
346   - !z_msn_gauss_init= -10
347   - !sigma_msn= 2.0
348   - write(*,900) ' l_initial = ',l_initial
349   - write(10,901) l_initial
350   - write(*,900) ' p0 = ',p0
351   - write(10,901) p0
352   - write(*,900) ' z0 = ',z0
353   - write(10,901) z0
354   - write(*,900) ' b0 = ',b0
355   - write(10,901) b0
356   - write(*,900) ' mu5 = ',mu5
357   - write(10,901) mu5
358   - write(*,900) ' vp = ',vp
359   - write(10,901) vp
360   - write(*,900) ' alpha = ',alpha
361   - write(10,901) alpha
362   - write(*,900) ' inib = ',inib
363   - write(10,901) inib
364   - write(*,900) ' kc = ',kc
365   - write(10,901) kc
366   - write(*,900) ' k1 = ',k1
367   - write(10,901) k1
368   - write(*,900) ' k2 = ',k2
369   - write(10,901) k2
370   - write(*,900) ' mu1 = ',mu1
371   - write(10,901) mu1
372   - write(*,900) ' k5 = ',k5
373   - write(10,901) k5
374   - write(*,900) ' gamma = ',gamma
375   - write(10,901) gamma
376   - write(*,900) ' txloss_p = ',txloss_p
377   - write(10,901) txloss_p
378   - write(*,900) ' txloss_dph = ',txloss_dph
379   - write(10,901) txloss_dph
380   - write(*,900) ' gmax = ',gmax
381   - write(10,901) gmax
382   - write(*,900) ' k3 = ',k3
383   - write(10,901) k3
384   - write(*,900) ' beta = ',beta
385   - write(10,901) beta
386   - write(*,900) ' mu2 = ',mu2
387   - write(10,901) mu2
388   - write(*,900) ' k6 = ',k6
389   - write(10,901) k6
390   - write(*,900) ' delta = ',delta
391   - write(10,901) delta
392   - write(*,900) ' epsi = ',epsi
393   - write(10,901) epsi
394   - write(*,900) ' eg = ',eg
395   - write(10,901) eg
396   - write(*,900) ' r1 = ',r1
397   - write(10,901) r1
398   - write(*,900) ' r2 = ',r2
399   - write(10,901) r2
400   - write(*,900) ' r3 = ',r3
401   - write(10,901) r3
402   - write(*,900) ' r4 = ',r4
403   - write(10,901) r4
404   - write(*,900) ' r5 = ',r5
405   - write(10,901) r5
406   - write(*,900) ' r6 = ',r6
407   - write(10,901) r6
408   - write(*,900) ' zingest = ',zingest
409   - write(10,901) zingest
410   - write(*,900) ' txloss_dzo = ',txloss_dzo
411   - write(10,901) txloss_dzo
412   - write(*,900) ' txloss_fp = ',txloss_fp
413   - write(10,901) txloss_fp
414   - write(*,900) ' Migra_zoo = ',Migra_zoo
415   - write(10,901) Migra_zoo
416   - write(*,900) ' pmin = ',pmin
417   - write(10,901) pmin
418   - write(*,900) ' w_zmax = ',w_zmax
419   - write(10,901) w_zmax
420   - write(*,900) ' bertha = ',bertha
421   - write(10,901) bertha
422   - write(*,900) ' parcrit = ',parcrit
423   - write(10,901) parcrit
424   - write(*,900) ' vb = ',vb
425   - write(10,901) vb
426   -!remi
427   - write(*,900) ' k4 = ',k4
428   - write(10,901) k4
429   - write(*,900) ' mu3 = ',mu3
430   - write(10,901) mu3
431   - write(*,900) ' eta = ',eta
432   - write(10,901) eta
433   - write(*,900) ' mbac = ',mbac
434   - write(10,901) mbac
435   - write(*,900) ' dphlossb = ',dphlossb
436   - write(10,901) dphlossb
437   - write(*,900) ' dphlossl = ',dphlossl
438   - write(10,901) dphlossl
439   - write(*,900) ' dzolossl = ',dzolossl
440   - write(10,901) dzolossl
441   - write(*,900) ' dzolossb = ',dzolossb
442   - write(10,901) dzolossb
443   - write(*,900) ' fplossl = ',fplossl
444   - write(10,901) fplossl
445   - write(*,900) ' fplossb = ',fplossb
446   - write(10,901) fplossb
447   - write(*,900) ' msnlossb = ',msnlossb
448   - write(10,901) msnlossb
449   -!leak
450   - write(*,900) ' mldon = ',mldon
451   - write(10,901) mldon
452   - write(*,900) ' lmin = ',lmin
453   - write(10,901) lmin
454   -! size_w
455   - write(*,900) ' Phys_w = ',Phys_w
456   - write(10,901) Phys_w
457   -!w_msnow
458   - write(*,900) ' w_p = ',w_p
459   - write(10,901) w_p
460   - write(*,900) ' w_dph = ',w_dph
461   - write(10,901) w_dph
462   - write(*,900) ' w_dzo = ',w_dzo
463   - write(10,901) w_dzo
464   - write(*,900) ' w_fp = ',w_fp
465   - write(10,901) w_fp
466   - write(*,900) ' w_msn = ',w_msn
467   - write(10,901) w_msn
468   -
469   - ! write(*,900) ' rho_p = ',rho_p
470   - ! write(10,901) rho_p
471   -! write(*,900) ' rho_dph = ',rho_dph
472   -! write(10,901) rho_dph
473   - write(*,900) ' rho_dzo = ',rho_dzo
474   - write(10,901) rho_dzo
475   - write(*,900) ' rho_fp = ',rho_fp
476   - write(10,901) rho_fp
477   - write(*,900) ' rho_msn = ',rho_msn
478   - write(10,901) rho_msn
479   - write(*,900) ' coag_coef = ',coag_coef
480   - write(10,901) coag_coef
481   - write(*,900) ' betap_p = ',betap_p
482   - write(10,901) betap_p
483   -
484   -!betap_dph,betap_dzo,betap_fp
485   -
486   - write(*,900) ' betadph_dph = ',betadph_dph
487   - write(10,901) betadph_dph
488   -
489   -! betadph_dzo,betadph_fp,
490   -
491   - write(*,900) ' betadzo_dzo = ',betadzo_dzo
492   - write(10,901) betadzo_dzo
493   -!betadzo_fp
494   - write(*,900) ' betafp_fp = ',betafp_fp
495   - write(10,901) betafp_fp
496   -!sti_cst
497   - write(*,900) ' stip_p = ',stip_p
498   - write(10,901) stip_p
499   - write(*,900) ' stip_dph = ',stip_dph
500   - write(10,901) stip_dph
501   - write(*,900) ' stip_dzo = ',stip_dzo
502   - write(10,901) stip_dzo
503   - write(*,900) ' stip_fp = ',stip_fp
504   - write(10,901) stip_fp
505   - write(*,900) ' stidph_dph = ',stidph_dph
506   - write(10,901) stidph_dph
507   - write(*,900) ' stidph_dzo = ',stidph_dzo
508   - write(10,901) stidph_dzo
509   - write(*,900) ' stidph_fp = ',stidph_fp
510   - write(10,901) stidph_fp
511   - write(*,900) ' stidzo_dzo = ',stidzo_dzo
512   - write(10,901) stidzo_dzo
513   - write(*,900) ' stidzo_fp = ',stidzo_fp
514   - write(10,901) stidzo_fp
515   - write(*,900) ' stifp_fp = ',stifp_fp
516   - write(10,901) stifp_fp
517   -!min_flux_msn
518   - write(*,900) ' size_phy_us = ',size_phy_us
519   - write(10,901) size_phy_us
520   -!size_phy_up
521   - write(*,900) ' size_dph_us = ',size_dph_us
522   - write(10,901) size_dph_us
523   - write(*,900) ' size_dzo_us = ',size_dzo_us
524   - write(10,901) size_dzo_us
525   - write(*,900) ' size_fp_us = ',size_fp_us
526   - write(10,901) size_fp_us
527   -
528   - !size_dph_up = 0.00001
529   - !size_dzo_up= 0.000100
530   - !size_fp_up= 0.000050
531   - write(*,900) ' size_msn = ',size_msn
  214 + REALTYPE :: dm_msn = 0.0
  215 + REALTYPE :: diam_msn_us = 0.01
  216 +!Parametres pour l'aggregation physique
  217 + REALTYPE :: dynvis = -0.5
  218 + REALTYPE :: kinvis = -0.5
  219 + REALTYPE :: kB = -0.5
  220 +!Fragmentation - Concentration seuil d'agrégat avant qu'un pourcentage parte dans le dph
  221 + !logical :: Frag_meth=.true. !Utilisation de la physique ou pas pour la fragmentation
  222 +! integer :: Frag_meth=0.0
  223 + REALTYPE :: Frag_meth=0.0
  224 + REALTYPE :: swim_brk = 0.8
  225 +REALTYPE ::Floc_coef = 0.1
  226 +!Tests parameter
  227 + REALTYPE ::betaBr=1.0
  228 + REALTYPE ::betaSh =1.0
  229 + REALTYPE ::betaDs =1.0
  230 + REALTYPE ::eps_const =1.0
  231 + REALTYPE ::eps_n =1.0
  232 + REALTYPE ::cons_min= 0.00001
  233 +
  234 + REALTYPE ::write_screen
  235 +
  236 +
  237 +REALTYPE ::coef1
  238 +REALTYPE ::coef2
  239 +REALTYPE ::RFV
  240 +REALTYPE ::coef3
  241 +REALTYPE ::coef4
  242 +REALTYPE ::coef5
  243 +
  244 + integer :: out_unit
  245 +! integer, parameter :: p=1,z=2,b=3,d1=4,n=5,a=6,l=7,d2=8,d3=9,d4=10,aug_si_d4=11,taille_msn=12
  246 +! GG d1= dph , d2= dzo , d3= fp , d4 = msn, aug_si_d4= size_msn
  247 + integer, parameter :: p=1,z=2,b=3,d1=4,n=5,a=6,l=7,d2=8,d3=9,d4=10, &
  248 + taille_intrm=11,taille_coag=12, taille_frag=13,taille_msn=14
  249 +
  250 +
  251 +!EOP
  252 +!-----------------------------------------------------------------------
  253 +
  254 + contains
  255 +
  256 +!-----------------------------------------------------------------------
  257 +!BOP
  258 +!
  259 +! !IROUTINE: Initialise the bio module
  260 +!
  261 +! !INTERFACE:
  262 + subroutine init_bio_polynow(namlst,fname,unit)
  263 +!
  264 +! !DESCRIPTION:
  265 +! Here, the bio namelist bio_polynow.nml is read and
  266 +! various variables (rates and settling velocities)
  267 +! are transformed into SI units.
  268 +!
  269 +! !USES:
  270 + IMPLICIT NONE
  271 +!
  272 +! !INPUT PARAMETERS:
  273 + integer, intent(in) :: namlst
  274 + character(len=*), intent(in) :: fname
  275 + character(len=20) :: pfile
  276 + integer, intent(in) :: unit
  277 +!
  278 +! !REVISION HISTORY:
  279 +! Original author(s): Hans Burchard & Karsten Bolding
  280 +!
  281 +! !LOCAL VARIABLES:
  282 + namelist /bio_polynow_nml/ numc, &
  283 +
  284 + dt_bio,splitfac_bio,p_init_value,p_initial,z_p_gauss_init,sigma_p, &
  285 +zoo_init_value,z_initial,z_zoo_gauss_init,sigma_zoo, &
  286 +b_initial, &
  287 +dph_init_value,dph_initial,z_dph_gauss_init,sigma_dph, &
  288 +dzo_init_value,dzo_initial,z_dzo_gauss_init,sigma_dzo, &
  289 +fp_init_value,fp_initial,z_fp_gauss_init,sigma_fp, &
  290 + msn_init_value,msn_initial,z_msn_gauss_init,sigma_msn, &
  291 + l_initial,p0,z0,b0,mu5, &
  292 + vp,alpha,inib,kc,k1,k2,mu1,k5,gamma,txloss_p,txloss_dph, & ! phytoplankton
  293 + gmax,k3,beta,mu2,k6,delta,epsi,eg,r1,r2,r3,r4,r5,r6, & ! zooplankton
  294 + txloss_dzo,txloss_fp, &
  295 + Migra_zoo,pmin,w_zmax,bertha,parcrit, & !Vertical migration from Nocera
  296 + vb,remi,k4,mu3,eta,mbac,dphlossb,dphlossl,dzolossl,dzolossb,fplossl,fplossb,msnlossb, & !Bacterias
  297 + leak,mldon,lmin, & !LDON
  298 + size_w,Phys_w,w_msnow,w_p,w_dph,w_dzo,w_fp,w_msn, & !Detritus
  299 +rho_p,rho_dph,rho_dzo,rho_fp,rho_msn, &
  300 + Coag_coef, &
  301 + betap_p,betap_dph,betap_dzo,betap_fp, &
  302 + betadph_dph,betadph_dzo,betadph_fp, &
  303 + betadzo_dzo,betadzo_fp,betafp_fp , & !Aggregation
  304 + sti_cst, &
  305 + stip_p,stip_dph,stip_dzo,stip_fp,stidph_dph,stidph_dzo,stidph_fp,stidzo_dzo,stidzo_fp,stifp_fp, &
  306 + CSF,size_rand,size_phy_us,size_phy_up,size_dph_us,size_dph_up,size_dzo_us,size_dzo_up,&
  307 + size_fp_us,size_fp_up,size_msn,dm_msn,diam_msn_us,&
  308 + dynvis,kinvis,kB, &
  309 + Frag_meth,swim_brk, &
  310 +Floc_coef, &
  311 + betaBr,betaSh,betaDs, &
  312 + eps_const,eps_n,cons_min, &
  313 + coef1,coef2,RFV,coef3,coef4,coef5,&
  314 + write_screen
  315 +
  316 +!EOP
  317 +!-----------------------------------------------------------------------
  318 +!BOC
  319 + LEVEL2 'init_bio_polynow'
  320 +
  321 + open(namlst,file=fname,action='read',status='old',err=98)
  322 + read(namlst,nml=bio_polynow_nml,err=99)
  323 + close(namlst)
  324 +
  325 + numcc=numc
  326 +!----Print some parameter values in standard output and save them in a separate file [out_fn]_polynow.par
  327 + pfile = trim(out_fn) // '_polynow.par'
  328 + open(10,status='unknown',action='write',file=pfile)
  329 + LEVEL3 'Biogeochemical parameters saved in ', pfile
  330 +
  331 +!dt_bio
  332 +!splitfac_bio
  333 + !p_init_value=1.0
  334 + write(*,900) ' p_initial = ',p_initial
  335 + write(10,901) p_initial
  336 + !z_p_gauss_init= -10
  337 + !sigma_p= 2.0
  338 +!zoo_init_value
  339 + write(*,900) ' z_initial = ',z_initial
  340 + write(10,901) z_initial
  341 +! z_zoo_gauss_init
  342 +! sigma_zoo
  343 + write(*,900) ' b_initial = ',b_initial
  344 + write(10,901) b_initial
  345 +!dph_init_value=1.0
  346 + write(*,900) ' dph_initial = ',dph_initial
  347 + write(10,901) dph_initial
  348 + !z_dph_gauss_init= -10
  349 + !sigma_dph= 2.0
  350 +!dzo_init_value=1.0
  351 + write(*,900) ' dzo_initial = ',dzo_initial
  352 + write(10,901) dzo_initial
  353 + !z_dzo_gauss_init= -10
  354 + !sigma_dzo= 2.0
  355 +!fp_init_value=1.0
  356 + write(*,900) ' fp_initial = ',fp_initial
  357 + write(10,901) fp_initial
  358 + !z_fp_gauss_init= -10
  359 + !sigma_fp= 2.0
  360 +!msn_init_value=1.0
  361 + write(*,900) ' msn_initial = ',msn_initial
  362 + write(10,901) msn_initial
  363 + !z_msn_gauss_init= -10
  364 + !sigma_msn= 2.0
  365 + write(*,900) ' l_initial = ',l_initial
  366 + write(10,901) l_initial
  367 + write(*,900) ' p0 = ',p0
  368 + write(10,901) p0
  369 + write(*,900) ' z0 = ',z0
  370 + write(10,901) z0
  371 + write(*,900) ' b0 = ',b0
  372 + write(10,901) b0
  373 + write(*,900) ' mu5 = ',mu5
  374 + write(10,901) mu5
  375 + write(*,900) ' vp = ',vp
  376 + write(10,901) vp
  377 + write(*,900) ' alpha = ',alpha
  378 + write(10,901) alpha
  379 + write(*,900) ' inib = ',inib
  380 + write(10,901) inib
  381 + write(*,900) ' kc = ',kc
  382 + write(10,901) kc
  383 + write(*,900) ' k1 = ',k1
  384 + write(10,901) k1
  385 + write(*,900) ' k2 = ',k2
  386 + write(10,901) k2
  387 + write(*,900) ' mu1 = ',mu1
  388 + write(10,901) mu1
  389 + write(*,900) ' k5 = ',k5
  390 + write(10,901) k5
  391 + write(*,900) ' gamma = ',gamma
  392 + write(10,901) gamma
  393 + write(*,900) ' txloss_p = ',txloss_p
  394 + write(10,901) txloss_p
  395 + write(*,900) ' txloss_dph = ',txloss_dph
  396 + write(10,901) txloss_dph
  397 + write(*,900) ' gmax = ',gmax
  398 + write(10,901) gmax
  399 + write(*,900) ' k3 = ',k3
  400 + write(10,901) k3
  401 + write(*,900) ' beta = ',beta
  402 + write(10,901) beta
  403 + write(*,900) ' mu2 = ',mu2
  404 + write(10,901) mu2
  405 + write(*,900) ' k6 = ',k6
  406 + write(10,901) k6
  407 + write(*,900) ' delta = ',delta
  408 + write(10,901) delta
  409 + write(*,900) ' epsi = ',epsi
  410 + write(10,901) epsi
  411 + write(*,900) ' eg = ',eg
  412 + write(10,901) eg
  413 + write(*,900) ' r1 = ',r1
  414 + write(10,901) r1
  415 + write(*,900) ' r2 = ',r2
  416 + write(10,901) r2
  417 + write(*,900) ' r3 = ',r3
  418 + write(10,901) r3
  419 + write(*,900) ' r4 = ',r4
  420 + write(10,901) r4