Commit 0c7073ab authored by dumoda01's avatar dumoda01

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

Adaptation pour que le code fonctionne avec le modele bio_ismer (bio_model=6). Verifier la declaration de la variable cc(1:9,1:nlev), 9 etant le nombre compartiments qui peut varier d'un modele a l'autre.
parent ac88286b
...@@ -64,13 +64,14 @@ ...@@ -64,13 +64,14 @@
! !USES: ! !USES:
use meanflow, only: avmola !CHG5 use meanflow, only: avmola !CHG5
use meanflow, only: h,u,v,w,AMM,avh !CHG5 use meanflow, only: h,u,v,w,amm,avh !CHG5
use observations, only: dadx,dady,a_adv !CHG5 use observations, only: dadx,dady,a_adv !CHG5
use observations, only: w_adv_discr,w_adv_method use observations, only: w_adv_discr,w_adv_method
use observations, only: aprof,ARelaxTau !CHG5 use observations, only: aprof,ARelaxTau !CHG5
use airsea, only: p_e use airsea, only: p_e
use util, only: Dirichlet,Neumann use util, only: Dirichlet,Neumann
use util, only: oneSided,zeroDivergence use util, only: oneSided,zeroDivergence
! use bio_var, only : bio_model
IMPLICIT NONE IMPLICIT NONE
! !
...@@ -94,7 +95,7 @@ ...@@ -94,7 +95,7 @@
REALTYPE, intent(in) :: gams(0:nlev) REALTYPE, intent(in) :: gams(0:nlev)
! nitrate concentration after bio loop ! nitrate concentration after bio loop
REALTYPE, intent(in), optional :: cc(1:7,0:nlev) !CHG3 REALTYPE, intent(in), optional :: cc(1:9,0:nlev) !CHG3
! !
! !REVISION HISTORY: ! !REVISION HISTORY:
! Original author(s): Dany Dumont (dany_dumont@ete.inrs.ca) ! Original author(s): Dany Dumont (dany_dumont@ete.inrs.ca)
...@@ -155,9 +156,23 @@ ...@@ -155,9 +156,23 @@
! redefinir amm apres un cyle bio ! redefinir amm apres un cyle bio
#ifdef BIO #ifdef BIO
do i=1,nlev !CHG5 do i=1,nlev
amm(i) = cc(6,i) !amm(i) = cc(6,i) ! bio_model=2,4
end do amm(i) = cc(9,i) ! bio_model=6
end do
! if (bio_model.eq.2) then
! do i=1,nlev
! amm(i) = cc(6,i)
! end do
! else if (bio_model.eq.4) then
! do i=1,nlev
! amm(i) = cc(6,i)
! end do
! else if (bio_model.eq.6) then
! do i=1,nlev
! amm(i) = cc(9,i)
! end do
! end if
#endif #endif
! do advection step ! do advection step
......
...@@ -36,10 +36,10 @@ ...@@ -36,10 +36,10 @@
REALTYPE, public, dimension(:), allocatable :: T,S,rho REALTYPE, public, dimension(:), allocatable :: T,S,rho
! nitrate ! nitrate
REALTYPE, public, dimension(:), allocatable :: NIT !CHG3 REALTYPE, public, dimension(:), allocatable :: nit !CHG3
! ammonium ! ammonium
REALTYPE, public, dimension(:), allocatable :: AMM !CHG5 REALTYPE, public, dimension(:), allocatable :: amm !CHG5
! bouyancy frequency squared ! bouyancy frequency squared
! (total, from temperature only, from salinity only) ! (total, from temperature only, from salinity only)
...@@ -280,12 +280,12 @@ ...@@ -280,12 +280,12 @@
S = _ZERO_ S = _ZERO_
allocate(nit(0:nlev),stat=rc) !CHG3 allocate(nit(0:nlev),stat=rc) !CHG3
if (rc /= 0) STOP 'init_meanflow: Error allocating (NIT)' if (rc /= 0) STOP 'init_meanflow: Error allocating (nit)'
NIT = _ZERO_ nit = _ZERO_
allocate(amm(0:nlev),stat=rc) !CHG5 allocate(amm(0:nlev),stat=rc) !CHG5
if (rc /= 0) STOP 'init_meanflow: Error allocating (AMM)' if (rc /= 0) STOP 'init_meanflow: Error allocating (amm)'
AMM = _ZERO_ amm = _ZERO_
allocate(rho(0:nlev),stat=rc) allocate(rho(0:nlev),stat=rc)
if (rc /= 0) STOP 'init_meanflow: Error allocating (rho)' if (rc /= 0) STOP 'init_meanflow: Error allocating (rho)'
......
...@@ -64,13 +64,14 @@ ...@@ -64,13 +64,14 @@
! !USES: ! !USES:
use meanflow, only: avmoln !CHG3 use meanflow, only: avmoln !CHG3
use meanflow, only: h,u,v,w,NIT,avh !CHG3 use meanflow, only: h,u,v,w,nit,avh !CHG3
use observations, only: dndx,dndy,n_adv !CHG3 use observations, only: dndx,dndy,n_adv !CHG3
use observations, only: w_adv_discr,w_adv_method use observations, only: w_adv_discr,w_adv_method
use observations, only: nprof,NRelaxTau !CHG3 use observations, only: nprof,NRelaxTau !CHG3
use airsea, only: p_e use airsea, only: p_e
use util, only: Dirichlet,Neumann use util, only: Dirichlet,Neumann
use util, only: oneSided,zeroDivergence use util, only: oneSided,zeroDivergence
! use bio_var, only: bio_model
IMPLICIT NONE IMPLICIT NONE
! !
...@@ -94,7 +95,9 @@ ...@@ -94,7 +95,9 @@
REALTYPE, intent(in) :: gams(0:nlev) REALTYPE, intent(in) :: gams(0:nlev)
! nitrate concentration after bio loop ! nitrate concentration after bio loop
REALTYPE, intent(in), optional :: cc(1:7,0:nlev) !CHG3 !DD Not independent of the bio model, only works with 7 compartments model (Fasham)
! REALTYPE, intent(in), optional :: cc(1:10,0:nlev) !CHG3
REALTYPE, intent(in), optional :: cc(1:9,0:nlev) !CHG3
! !
! !REVISION HISTORY: ! !REVISION HISTORY:
! Original author(s): Dany Dumont (dany_dumont@ete.inrs.ca) ! Original author(s): Dany Dumont (dany_dumont@ete.inrs.ca)
...@@ -155,20 +158,38 @@ ...@@ -155,20 +158,38 @@
! redefinir nit apres un cyle bio ! redefinir nit apres un cyle bio
#ifdef BIO #ifdef BIO
do i=1,nlev !CHG3 do i=1,nlev
nit(i) = cc(5,i) !nit(i) = cc(7,i) ! bio_model=2,4
end do nit(i) = cc(1,i) ! bio_model=1,6
end do
! if (bio_model.eq.1) then
! do i=1,nlev
! nit(i) = cc(1,i)
! end do
! else if (bio_model.eq.2) then
! do i=1,nlev
! nit(i) = cc(7,i)
! end do
! else if (bio_model.eq.4) then
! do i=1,nlev
! nit(i) = cc(7,i)
! end do
! else if (bio_model.eq.6) then
! do i=1,nlev
! nit(i) = cc(1,i)
! end do
! end if
#endif #endif
! do advection step ! do advection step
if (w_adv_method .ne. 0) then if (w_adv_method .ne. 0) then
call adv_center(nlev,dt,h,h,w,AdvBcup,AdvBcdw, & call adv_center(nlev,dt,h,h,w,AdvBcup,AdvBcdw, &
AdvSup,AdvSdw,w_adv_discr,adv_mode,NIT) !CHG3 AdvSup,AdvSdw,w_adv_discr,adv_mode,nit) !CHG3
end if end if
! do diffusion step ! do diffusion step
call diff_center(nlev,dt,cnpar,posconc,h,DiffBcup,DiffBcdw, & call diff_center(nlev,dt,cnpar,posconc,h,DiffBcup,DiffBcdw, &
DiffSup,DiffSdw,avh,LSour,Qsour,NRelaxTau,nprof,NIT) !CHG3 DiffSup,DiffSdw,avh,LSour,Qsour,NRelaxTau,nprof,nit) !CHG3
return return
end subroutine nitrate end subroutine nitrate
......
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