Commit 0c7073ab0a8901620d2ff6d070f358f4f5306820

Authored by dumoda01
1 parent ac88286b
Exists in master and in 1 other branch snow

Adaptation pour que le code fonctionne avec le modele bio_ismer (bio_model=6). V…

…erifier la declaration de la variable cc(1:9,1:nlev), 9 etant le nombre compartiments qui peut varier d'un modele a l'autre.
src/meanflow/ammonium.F90
... ... @@ -64,13 +64,14 @@
64 64 ! !USES:
65 65  
66 66 use meanflow, only: avmola !CHG5
67   - use meanflow, only: h,u,v,w,AMM,avh !CHG5
  67 + use meanflow, only: h,u,v,w,amm,avh !CHG5
68 68 use observations, only: dadx,dady,a_adv !CHG5
69 69 use observations, only: w_adv_discr,w_adv_method
70 70 use observations, only: aprof,ARelaxTau !CHG5
71 71 use airsea, only: p_e
72 72 use util, only: Dirichlet,Neumann
73 73 use util, only: oneSided,zeroDivergence
  74 +! use bio_var, only : bio_model
74 75  
75 76 IMPLICIT NONE
76 77 !
... ... @@ -94,7 +95,7 @@
94 95 REALTYPE, intent(in) :: gams(0:nlev)
95 96  
96 97 ! nitrate concentration after bio loop
97   - REALTYPE, intent(in), optional :: cc(1:7,0:nlev) !CHG3
  98 + REALTYPE, intent(in), optional :: cc(1:9,0:nlev) !CHG3
98 99 !
99 100 ! !REVISION HISTORY:
100 101 ! Original author(s): Dany Dumont (dany_dumont@ete.inrs.ca)
... ... @@ -155,9 +156,23 @@
155 156  
156 157 ! redefinir amm apres un cyle bio
157 158 #ifdef BIO
158   - do i=1,nlev !CHG5
159   - amm(i) = cc(6,i)
160   - end do
  159 +do i=1,nlev
  160 + !amm(i) = cc(6,i) ! bio_model=2,4
  161 + amm(i) = cc(9,i) ! bio_model=6
  162 +end do
  163 +! if (bio_model.eq.2) then
  164 +! do i=1,nlev
  165 +! amm(i) = cc(6,i)
  166 +! end do
  167 +! else if (bio_model.eq.4) then
  168 +! do i=1,nlev
  169 +! amm(i) = cc(6,i)
  170 +! end do
  171 +! else if (bio_model.eq.6) then
  172 +! do i=1,nlev
  173 +! amm(i) = cc(9,i)
  174 +! end do
  175 +! end if
161 176 #endif
162 177  
163 178 ! do advection step
... ...
src/meanflow/meanflow.F90
... ... @@ -36,10 +36,10 @@
36 36 REALTYPE, public, dimension(:), allocatable :: T,S,rho
37 37  
38 38 ! nitrate
39   - REALTYPE, public, dimension(:), allocatable :: NIT !CHG3
  39 + REALTYPE, public, dimension(:), allocatable :: nit !CHG3
40 40  
41 41 ! ammonium
42   - REALTYPE, public, dimension(:), allocatable :: AMM !CHG5
  42 + REALTYPE, public, dimension(:), allocatable :: amm !CHG5
43 43  
44 44 ! bouyancy frequency squared
45 45 ! (total, from temperature only, from salinity only)
... ... @@ -280,12 +280,12 @@
280 280 S = _ZERO_
281 281  
282 282 allocate(nit(0:nlev),stat=rc) !CHG3
283   - if (rc /= 0) STOP 'init_meanflow: Error allocating (NIT)'
284   - NIT = _ZERO_
  283 + if (rc /= 0) STOP 'init_meanflow: Error allocating (nit)'
  284 + nit = _ZERO_
285 285  
286 286 allocate(amm(0:nlev),stat=rc) !CHG5
287   - if (rc /= 0) STOP 'init_meanflow: Error allocating (AMM)'
288   - AMM = _ZERO_
  287 + if (rc /= 0) STOP 'init_meanflow: Error allocating (amm)'
  288 + amm = _ZERO_
289 289  
290 290 allocate(rho(0:nlev),stat=rc)
291 291 if (rc /= 0) STOP 'init_meanflow: Error allocating (rho)'
... ...
src/meanflow/nitrate.F90
... ... @@ -64,13 +64,14 @@
64 64 ! !USES:
65 65  
66 66 use meanflow, only: avmoln !CHG3
67   - use meanflow, only: h,u,v,w,NIT,avh !CHG3
  67 + use meanflow, only: h,u,v,w,nit,avh !CHG3
68 68 use observations, only: dndx,dndy,n_adv !CHG3
69 69 use observations, only: w_adv_discr,w_adv_method
70 70 use observations, only: nprof,NRelaxTau !CHG3
71 71 use airsea, only: p_e
72 72 use util, only: Dirichlet,Neumann
73 73 use util, only: oneSided,zeroDivergence
  74 +! use bio_var, only: bio_model
74 75  
75 76 IMPLICIT NONE
76 77 !
... ... @@ -94,7 +95,9 @@
94 95 REALTYPE, intent(in) :: gams(0:nlev)
95 96  
96 97 ! nitrate concentration after bio loop
97   - REALTYPE, intent(in), optional :: cc(1:7,0:nlev) !CHG3
  98 +!DD Not independent of the bio model, only works with 7 compartments model (Fasham)
  99 +! REALTYPE, intent(in), optional :: cc(1:10,0:nlev) !CHG3
  100 + REALTYPE, intent(in), optional :: cc(1:9,0:nlev) !CHG3
98 101 !
99 102 ! !REVISION HISTORY:
100 103 ! Original author(s): Dany Dumont (dany_dumont@ete.inrs.ca)
... ... @@ -155,20 +158,38 @@
155 158  
156 159 ! redefinir nit apres un cyle bio
157 160 #ifdef BIO
158   - do i=1,nlev !CHG3
159   - nit(i) = cc(5,i)
160   - end do
  161 +do i=1,nlev
  162 + !nit(i) = cc(7,i) ! bio_model=2,4
  163 + nit(i) = cc(1,i) ! bio_model=1,6
  164 +end do
  165 +! if (bio_model.eq.1) then
  166 +! do i=1,nlev
  167 +! nit(i) = cc(1,i)
  168 +! end do
  169 +! else if (bio_model.eq.2) then
  170 +! do i=1,nlev
  171 +! nit(i) = cc(7,i)
  172 +! end do
  173 +! else if (bio_model.eq.4) then
  174 +! do i=1,nlev
  175 +! nit(i) = cc(7,i)
  176 +! end do
  177 +! else if (bio_model.eq.6) then
  178 +! do i=1,nlev
  179 +! nit(i) = cc(1,i)
  180 +! end do
  181 +! end if
161 182 #endif
162 183  
163 184 ! do advection step
164 185 if (w_adv_method .ne. 0) then
165 186 call adv_center(nlev,dt,h,h,w,AdvBcup,AdvBcdw, &
166   - AdvSup,AdvSdw,w_adv_discr,adv_mode,NIT) !CHG3
  187 + AdvSup,AdvSdw,w_adv_discr,adv_mode,nit) !CHG3
167 188 end if
168 189  
169 190 ! do diffusion step
170 191 call diff_center(nlev,dt,cnpar,posconc,h,DiffBcup,DiffBcdw, &
171   - DiffSup,DiffSdw,avh,LSour,Qsour,NRelaxTau,nprof,NIT) !CHG3
  192 + DiffSup,DiffSdw,avh,LSour,Qsour,NRelaxTau,nprof,nit) !CHG3
172 193  
173 194 return
174 195 end subroutine nitrate
... ...