p2zbio.F90 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601
  1. MODULE p2zbio
  2. !!======================================================================
  3. !! *** MODULE p2zbio ***
  4. !! TOP : LOBSTER
  5. !!======================================================================
  6. !! History : - ! 1999-07 (M. Levy) Original code
  7. !! - ! 2000-12 (E. Kestenare) assign a parameter to name individual tracers
  8. !! - ! 2001-03 (M. Levy) LNO3 + dia2d
  9. !! 2.0 ! 2007-12 (C. Deltel, G. Madec) F90
  10. !!----------------------------------------------------------------------
  11. #if defined key_pisces_reduced
  12. !!----------------------------------------------------------------------
  13. !! 'key_pisces_reduced' LOBSTER bio-model
  14. !!----------------------------------------------------------------------
  15. !! p2z_bio :
  16. !!----------------------------------------------------------------------
  17. USE oce_trc !
  18. USE trc !
  19. USE sms_pisces
  20. USE p2zopt
  21. USE lbclnk !
  22. USE prtctl_trc ! Print control for debbuging
  23. USE trd_oce
  24. USE trdtrc
  25. USE iom
  26. IMPLICIT NONE
  27. PRIVATE
  28. PUBLIC p2z_bio ! called in ???
  29. PUBLIC p2z_bio_init ! called in ???
  30. REAL(wp) :: tmumax ! maximal phytoplankton growth rate [s-1]
  31. REAL(wp) :: rgamma ! phytoplankton exudation fraction [%]
  32. REAL(wp) :: fphylab ! NH4 fraction of phytoplankton exsudation
  33. REAL(wp) :: tmminp ! minimal phytoplancton mortality rate [0.05/86400 s-1=20 days]
  34. REAL(wp) :: aki ! light photosynthesis half saturation constant[W/m2]
  35. !
  36. REAL(wp) :: akno3 ! nitrate limitation half-saturation value [mmol/m3]
  37. REAL(wp) :: aknh4 ! ammonium limitation half-saturation value [mmol/m3]
  38. REAL(wp) :: taunn ! nitrification rate [s-1]
  39. REAL(wp) :: psinut ! inhibition of nitrate uptake by ammonium
  40. !
  41. REAL(wp) :: taudn ! detritus breakdown rate [0.1/86400 s-1=10 days]
  42. REAL(wp) :: fdetlab ! NH4 fraction of detritus dissolution
  43. !
  44. REAL(wp) :: taudomn ! DOM breakdown rate [s-1]
  45. ! ! slow remineralization rate of semi-labile dom to nh4 (1 month)
  46. !
  47. REAL(wp) :: rppz ! ivlev coeff for zoo mortality
  48. REAL(wp) :: taus ! specific zooplankton maximal grazing rate [s-1]
  49. ! ! 0.75/86400 s-1=8.680555E-6 1/86400 = 1.15e-5
  50. REAL(wp) :: aks ! half-saturation constant for total zooplankton grazing [mmolN.m-3]
  51. REAL(wp) :: rpnaz ! non-assimilated phytoplankton by zooplancton [%]
  52. REAL(wp) :: rdnaz ! non-assimilated detritus by zooplankton [%]
  53. REAL(wp) :: tauzn ! zooplancton specific excretion rate [0.1/86400 s-1=10 days]
  54. REAL(wp) :: tmminz ! minimal zooplankton mortality rate [(mmolN/m3)-1 d-1]
  55. REAL(wp) :: fzoolab ! NH4 fraction of zooplankton excretion
  56. REAL(wp) :: fdbod ! zooplankton mortality fraction that goes to detritus
  57. !!* Substitution
  58. # include "top_substitute.h90"
  59. !!----------------------------------------------------------------------
  60. !! NEMO/TOP 3.3 , NEMO Consortium (2010)
  61. !! $Id: p2zbio.F90 2750 2016-01-12 10:42:05Z ufla $
  62. !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
  63. !!----------------------------------------------------------------------
  64. CONTAINS
  65. SUBROUTINE p2z_bio( kt )
  66. !!---------------------------------------------------------------------
  67. !! *** ROUTINE p2z_bio ***
  68. !!
  69. !! ** Purpose : compute the now trend due to biogeochemical processes
  70. !! and add it to the general trend of passive tracers equations
  71. !!
  72. !! ** Method : each now biological flux is calculated in function of now
  73. !! concentrations of tracers.
  74. !! depending on the tracer, these fluxes are sources or sinks.
  75. !! the total of the sources and sinks for each tracer
  76. !! is added to the general trend.
  77. !!
  78. !! tra = tra + zf...tra - zftra...
  79. !! | |
  80. !! | |
  81. !! source sink
  82. !!
  83. !! IF 'key_diabio' defined , the biogeochemical trends
  84. !! for passive tracers are saved for futher diagnostics.
  85. !!---------------------------------------------------------------------
  86. !!
  87. INTEGER, INTENT( in ) :: kt ! ocean time-step index
  88. !!
  89. INTEGER :: ji, jj, jk, jl
  90. REAL(wp) :: zdet, zzoo, zphy, zno3, znh4, zdom ! now concentrations
  91. REAL(wp) :: zlno3, zlnh4, zle, zlt ! limitation terms for phyto
  92. REAL(wp) :: zno3phy, znh4phy, zphynh4, zphydom
  93. REAL(wp) :: zphydet, zphyzoo, zdetzoo
  94. REAL(wp) :: zzoonh4, zzoodom, zzoodet, zdetnh4, zdetdom
  95. REAL(wp) :: znh4no3, zdomnh4, zppz, zpdz, zpppz, zppdz, zfood
  96. REAL(wp) :: zfilpz, zfildz, zphya, zzooa, zno3a
  97. REAL(wp) :: znh4a, zdeta, zdoma, zzoobod, zboddet, zdomaju
  98. REAL(wp) :: ze3t
  99. REAL(wp), POINTER, DIMENSION(:,:,:) :: zw2d
  100. REAL(wp), POINTER, DIMENSION(:,:,:,:) :: zw3d
  101. CHARACTER (len=25) :: charout
  102. !!---------------------------------------------------------------------
  103. !
  104. IF( nn_timing == 1 ) CALL timing_start('p2z_bio')
  105. !
  106. IF( ln_diatrc .OR. lk_iomput ) THEN
  107. CALL wrk_alloc( jpi, jpj, 17, zw2d )
  108. CALL wrk_alloc( jpi, jpj, jpk, 3, zw3d )
  109. ENDIF
  110. IF( kt == nittrc000 ) THEN
  111. IF(lwp) WRITE(numout,*)
  112. IF(lwp) WRITE(numout,*) ' p2z_bio: LOBSTER bio-model'
  113. IF(lwp) WRITE(numout,*) ' ~~~~~~~'
  114. ENDIF
  115. xksi(:,:) = 0.e0 ! zooplakton closure ( fbod)
  116. IF( ln_diatrc .OR. lk_iomput ) THEN
  117. zw2d (:,:,:) = 0.e0
  118. zw3d(:,:,:,:) = 0.e0
  119. ENDIF
  120. ! ! -------------------------- !
  121. DO jk = 1, jpkbm1 ! Upper ocean (bio-layers) !
  122. ! ! -------------------------- !
  123. DO jj = 2, jpjm1
  124. DO ji = fs_2, fs_jpim1
  125. ! trophic variables( det, zoo, phy, no3, nh4, dom)
  126. ! ------------------------------------------------
  127. ! negative trophic variables DO not contribute to the fluxes
  128. zdet = MAX( 0.e0, trn(ji,jj,jk,jpdet) )
  129. zzoo = MAX( 0.e0, trn(ji,jj,jk,jpzoo) )
  130. zphy = MAX( 0.e0, trn(ji,jj,jk,jpphy) )
  131. zno3 = MAX( 0.e0, trn(ji,jj,jk,jpno3) )
  132. znh4 = MAX( 0.e0, trn(ji,jj,jk,jpnh4) )
  133. zdom = MAX( 0.e0, trn(ji,jj,jk,jpdom) )
  134. ! Limitations
  135. zlt = 1.
  136. zle = 1. - EXP( -etot(ji,jj,jk) / aki / zlt )
  137. ! psinut,akno3,aknh4 added by asklod AS Kremeur 2005-03
  138. zlno3 = zno3 * EXP( -psinut * znh4 ) / ( akno3 + zno3 )
  139. zlnh4 = znh4 / (znh4+aknh4)
  140. ! sinks and sources
  141. ! phytoplankton production and exsudation
  142. zno3phy = tmumax * zle * zlt * zlno3 * zphy
  143. znh4phy = tmumax * zle * zlt * zlnh4 * zphy
  144. ! fphylab added by asklod AS Kremeur 2005-03
  145. zphydom = rgamma * (1 - fphylab) * (zno3phy + znh4phy)
  146. zphynh4 = rgamma * fphylab * (zno3phy + znh4phy)
  147. ! zooplankton production
  148. ! preferences
  149. zppz = rppz
  150. zpdz = 1. - rppz
  151. zpppz = ( zppz * zphy ) / ( ( zppz * zphy + zpdz * zdet ) + 1.e-13 )
  152. zppdz = ( zpdz * zdet ) / ( ( zppz * zphy + zpdz * zdet ) + 1.e-13 )
  153. zfood = zpppz * zphy + zppdz * zdet
  154. ! filtration
  155. zfilpz = taus * zpppz / (aks + zfood)
  156. zfildz = taus * zppdz / (aks + zfood)
  157. ! grazing
  158. zphyzoo = zfilpz * zphy * zzoo
  159. zdetzoo = zfildz * zdet * zzoo
  160. ! fecal pellets production
  161. zzoodet = rpnaz * zphyzoo + rdnaz * zdetzoo
  162. ! zooplankton liquide excretion
  163. zzoonh4 = tauzn * fzoolab * zzoo
  164. zzoodom = tauzn * (1 - fzoolab) * zzoo
  165. ! mortality
  166. ! phytoplankton mortality
  167. zphydet = tmminp * zphy
  168. ! zooplankton mortality
  169. ! closure : flux grazing is redistributed below level jpkbio
  170. zzoobod = tmminz * zzoo * zzoo
  171. xksi(ji,jj) = xksi(ji,jj) + (1-fdbod) * zzoobod * fse3t(ji,jj,jk)
  172. zboddet = fdbod * zzoobod
  173. ! detritus and dom breakdown
  174. zdetnh4 = taudn * fdetlab * zdet
  175. zdetdom = taudn * (1 - fdetlab) * zdet
  176. zdomnh4 = taudomn * zdom
  177. ! flux added to express how the excess of nitrogen from
  178. ! PHY, ZOO and DET to DOM goes directly to NH4 (flux of ajustment)
  179. zdomaju = (1 - redf/reddom) * (zphydom + zzoodom + zdetdom)
  180. ! Nitrification
  181. znh4no3 = taunn * znh4
  182. ! determination of trends
  183. ! total trend for each biological tracer
  184. zphya = zno3phy + znh4phy - zphynh4 - zphydom - zphyzoo - zphydet
  185. zzooa = zphyzoo + zdetzoo - zzoodet - zzoodom - zzoonh4 - zzoobod
  186. zno3a = - zno3phy + znh4no3
  187. znh4a = - znh4phy - znh4no3 + zphynh4 + zzoonh4 + zdomnh4 + zdetnh4 + zdomaju
  188. zdeta = zphydet + zzoodet - zdetzoo - zdetnh4 - zdetdom + zboddet
  189. zdoma = zphydom + zzoodom + zdetdom - zdomnh4 - zdomaju
  190. ! tracer flux at totox-point added to the general trend
  191. tra(ji,jj,jk,jpdet) = tra(ji,jj,jk,jpdet) + zdeta
  192. tra(ji,jj,jk,jpzoo) = tra(ji,jj,jk,jpzoo) + zzooa
  193. tra(ji,jj,jk,jpphy) = tra(ji,jj,jk,jpphy) + zphya
  194. tra(ji,jj,jk,jpno3) = tra(ji,jj,jk,jpno3) + zno3a
  195. tra(ji,jj,jk,jpnh4) = tra(ji,jj,jk,jpnh4) + znh4a
  196. tra(ji,jj,jk,jpdom) = tra(ji,jj,jk,jpdom) + zdoma
  197. IF( ( ln_diabio .AND. .NOT. lk_iomput ) .OR. l_trdtrc ) THEN
  198. trbio(ji,jj,jk,jp_pcs0_trd ) = zno3phy
  199. trbio(ji,jj,jk,jp_pcs0_trd + 1) = znh4phy
  200. trbio(ji,jj,jk,jp_pcs0_trd + 2) = zphynh4
  201. trbio(ji,jj,jk,jp_pcs0_trd + 3) = zphydom
  202. trbio(ji,jj,jk,jp_pcs0_trd + 4) = zphyzoo
  203. trbio(ji,jj,jk,jp_pcs0_trd + 5) = zphydet
  204. trbio(ji,jj,jk,jp_pcs0_trd + 6) = zdetzoo
  205. ! trend number 8 in p2zsed
  206. trbio(ji,jj,jk,jp_pcs0_trd + 8) = zzoodet
  207. trbio(ji,jj,jk,jp_pcs0_trd + 9) = zzoobod
  208. trbio(ji,jj,jk,jp_pcs0_trd + 10) = zzoonh4
  209. trbio(ji,jj,jk,jp_pcs0_trd + 11) = zzoodom
  210. trbio(ji,jj,jk,jp_pcs0_trd + 12) = znh4no3
  211. trbio(ji,jj,jk,jp_pcs0_trd + 13) = zdomnh4
  212. trbio(ji,jj,jk,jp_pcs0_trd + 14) = zdetnh4
  213. trbio(ji,jj,jk,jp_pcs0_trd + 15) = zdetdom
  214. ! trend number 17 in p2zexp
  215. ENDIF
  216. IF( ln_diatrc .OR. lk_iomput ) THEN
  217. ! convert fluxes in per day
  218. ze3t = fse3t(ji,jj,jk) * 86400.
  219. zw2d(ji,jj,1) = zw2d(ji,jj,1) + zno3phy * ze3t
  220. zw2d(ji,jj,2) = zw2d(ji,jj,2) + znh4phy * ze3t
  221. zw2d(ji,jj,3) = zw2d(ji,jj,3) + zphydom * ze3t
  222. zw2d(ji,jj,4) = zw2d(ji,jj,4) + zphynh4 * ze3t
  223. zw2d(ji,jj,5) = zw2d(ji,jj,5) + zphyzoo * ze3t
  224. zw2d(ji,jj,6) = zw2d(ji,jj,6) + zphydet * ze3t
  225. zw2d(ji,jj,7) = zw2d(ji,jj,7) + zdetzoo * ze3t
  226. zw2d(ji,jj,8) = zw2d(ji,jj,8) + zzoodet * ze3t
  227. zw2d(ji,jj,9) = zw2d(ji,jj,9) + zzoobod * ze3t
  228. zw2d(ji,jj,10) = zw2d(ji,jj,10) + zzoonh4 * ze3t
  229. zw2d(ji,jj,11) = zw2d(ji,jj,11) + zzoodom * ze3t
  230. zw2d(ji,jj,12) = zw2d(ji,jj,12) + znh4no3 * ze3t
  231. zw2d(ji,jj,13) = zw2d(ji,jj,13) + zdomnh4 * ze3t
  232. zw2d(ji,jj,14) = zw2d(ji,jj,14) + zdetnh4 * ze3t
  233. zw2d(ji,jj,15) = zw2d(ji,jj,15) + ( zno3phy + znh4phy - zphynh4 - zphydom - zphyzoo - zphydet ) * ze3t
  234. zw2d(ji,jj,16) = zw2d(ji,jj,16) + ( zphyzoo + zdetzoo - zzoodet - zzoobod - zzoonh4 - zzoodom ) * ze3t
  235. zw2d(ji,jj,17) = zw2d(ji,jj,17) + zdetdom * ze3t
  236. !
  237. zw3d(ji,jj,jk,1) = zno3phy * 86400
  238. zw3d(ji,jj,jk,2) = znh4phy * 86400
  239. zw3d(ji,jj,jk,3) = znh4no3 * 86400
  240. !
  241. ENDIF
  242. END DO
  243. END DO
  244. END DO
  245. ! ! -------------------------- !
  246. DO jk = jpkb, jpkm1 ! Upper ocean (bio-layers) !
  247. ! ! -------------------------- !
  248. DO jj = 2, jpjm1
  249. DO ji = fs_2, fs_jpim1
  250. ! remineralisation of all quantities towards nitrate
  251. ! trophic variables( det, zoo, phy, no3, nh4, dom)
  252. ! negative trophic variables DO not contribute to the fluxes
  253. zdet = MAX( 0.e0, trn(ji,jj,jk,jpdet) )
  254. zzoo = MAX( 0.e0, trn(ji,jj,jk,jpzoo) )
  255. zphy = MAX( 0.e0, trn(ji,jj,jk,jpphy) )
  256. zno3 = MAX( 0.e0, trn(ji,jj,jk,jpno3) )
  257. znh4 = MAX( 0.e0, trn(ji,jj,jk,jpnh4) )
  258. zdom = MAX( 0.e0, trn(ji,jj,jk,jpdom) )
  259. ! Limitations
  260. zlt = 0.e0
  261. zle = 0.e0
  262. zlno3 = 0.e0
  263. zlnh4 = 0.e0
  264. ! sinks and sources
  265. ! phytoplankton production and exsudation
  266. zno3phy = 0.e0
  267. znh4phy = 0.e0
  268. zphydom = 0.e0
  269. zphynh4 = 0.e0
  270. ! zooplankton production
  271. zphyzoo = 0.e0 ! grazing
  272. zdetzoo = 0.e0
  273. zzoodet = 0.e0 ! fecal pellets production
  274. zzoonh4 = tauzn * fzoolab * zzoo ! zooplankton liquide excretion
  275. zzoodom = tauzn * (1 - fzoolab) * zzoo
  276. ! mortality
  277. zphydet = tmminp * zphy ! phytoplankton mortality
  278. zzoobod = 0.e0 ! zooplankton mortality
  279. zboddet = 0.e0 ! closure : flux fbod is redistributed below level jpkbio
  280. ! detritus and dom breakdown
  281. zdetnh4 = taudn * fdetlab * zdet
  282. zdetdom = taudn * (1 - fdetlab) * zdet
  283. zdomnh4 = taudomn * zdom
  284. zdomaju = (1 - redf/reddom) * (zphydom + zzoodom + zdetdom)
  285. ! Nitrification
  286. znh4no3 = taunn * znh4
  287. ! determination of trends
  288. ! total trend for each biological tracer
  289. zphya = zno3phy + znh4phy - zphynh4 - zphydom - zphyzoo - zphydet
  290. zzooa = zphyzoo + zdetzoo - zzoodet - zzoodom - zzoonh4 - zzoobod
  291. zno3a = - zno3phy + znh4no3
  292. znh4a = - znh4phy - znh4no3 + zphynh4 + zzoonh4 + zdomnh4 + zdetnh4 + zdomaju
  293. zdeta = zphydet + zzoodet - zdetzoo - zdetnh4 - zdetdom + zboddet
  294. zdoma = zphydom + zzoodom + zdetdom - zdomnh4 - zdomaju
  295. ! tracer flux at totox-point added to the general trend
  296. tra(ji,jj,jk,jpdet) = tra(ji,jj,jk,jpdet) + zdeta
  297. tra(ji,jj,jk,jpzoo) = tra(ji,jj,jk,jpzoo) + zzooa
  298. tra(ji,jj,jk,jpphy) = tra(ji,jj,jk,jpphy) + zphya
  299. tra(ji,jj,jk,jpno3) = tra(ji,jj,jk,jpno3) + zno3a
  300. tra(ji,jj,jk,jpnh4) = tra(ji,jj,jk,jpnh4) + znh4a
  301. tra(ji,jj,jk,jpdom) = tra(ji,jj,jk,jpdom) + zdoma
  302. !
  303. IF( ( ln_diabio .AND. .NOT. lk_iomput ) .OR. l_trdtrc ) THEN
  304. trbio(ji,jj,jk,jp_pcs0_trd ) = zno3phy
  305. trbio(ji,jj,jk,jp_pcs0_trd + 1) = znh4phy
  306. trbio(ji,jj,jk,jp_pcs0_trd + 2) = zphynh4
  307. trbio(ji,jj,jk,jp_pcs0_trd + 3) = zphydom
  308. trbio(ji,jj,jk,jp_pcs0_trd + 4) = zphyzoo
  309. trbio(ji,jj,jk,jp_pcs0_trd + 5) = zphydet
  310. trbio(ji,jj,jk,jp_pcs0_trd + 6) = zdetzoo
  311. ! trend number 8 in p2zsed
  312. trbio(ji,jj,jk,jp_pcs0_trd + 8) = zzoodet
  313. trbio(ji,jj,jk,jp_pcs0_trd + 9) = zzoobod
  314. trbio(ji,jj,jk,jp_pcs0_trd + 10) = zzoonh4
  315. trbio(ji,jj,jk,jp_pcs0_trd + 11) = zzoodom
  316. trbio(ji,jj,jk,jp_pcs0_trd + 12) = znh4no3
  317. trbio(ji,jj,jk,jp_pcs0_trd + 13) = zdomnh4
  318. trbio(ji,jj,jk,jp_pcs0_trd + 14) = zdetnh4
  319. trbio(ji,jj,jk,jp_pcs0_trd + 15) = zdetdom
  320. ! trend number 17 in p2zexp
  321. ENDIF
  322. IF( ln_diatrc .OR. lk_iomput ) THEN
  323. ! convert fluxes in per day
  324. ze3t = fse3t(ji,jj,jk) * 86400.
  325. zw2d(ji,jj,1) = zw2d(ji,jj,1) + zno3phy * ze3t
  326. zw2d(ji,jj,2) = zw2d(ji,jj,2) + znh4phy * ze3t
  327. zw2d(ji,jj,3) = zw2d(ji,jj,3) + zphydom * ze3t
  328. zw2d(ji,jj,4) = zw2d(ji,jj,4) + zphynh4 * ze3t
  329. zw2d(ji,jj,5) = zw2d(ji,jj,5) + zphyzoo * ze3t
  330. zw2d(ji,jj,6) = zw2d(ji,jj,6) + zphydet * ze3t
  331. zw2d(ji,jj,7) = zw2d(ji,jj,7) + zdetzoo * ze3t
  332. zw2d(ji,jj,8) = zw2d(ji,jj,8) + zzoodet * ze3t
  333. zw2d(ji,jj,9) = zw2d(ji,jj,9) + zzoobod * ze3t
  334. zw2d(ji,jj,10) = zw2d(ji,jj,10) + zzoonh4 * ze3t
  335. zw2d(ji,jj,11) = zw2d(ji,jj,11) + zzoodom * ze3t
  336. zw2d(ji,jj,12) = zw2d(ji,jj,12) + znh4no3 * ze3t
  337. zw2d(ji,jj,13) = zw2d(ji,jj,13) + zdomnh4 * ze3t
  338. zw2d(ji,jj,14) = zw2d(ji,jj,14) + zdetnh4 * ze3t
  339. zw2d(ji,jj,15) = zw2d(ji,jj,15) + ( zno3phy + znh4phy - zphynh4 - zphydom - zphyzoo - zphydet ) * ze3t
  340. zw2d(ji,jj,16) = zw2d(ji,jj,16) + ( zphyzoo + zdetzoo - zzoodet - zzoobod - zzoonh4 - zzoodom ) * ze3t
  341. zw2d(ji,jj,17) = zw2d(ji,jj,17) + zdetdom * ze3t
  342. !
  343. zw3d(ji,jj,jk,1) = zno3phy * 86400
  344. zw3d(ji,jj,jk,2) = znh4phy * 86400
  345. zw3d(ji,jj,jk,3) = znh4no3 * 86400
  346. !
  347. ENDIF
  348. END DO
  349. END DO
  350. END DO
  351. IF( ln_diatrc .OR. lk_iomput ) THEN
  352. DO jl = 1, 17
  353. CALL lbc_lnk( zw2d(:,:,jl),'T', 1. )
  354. END DO
  355. DO jl = 1, 3
  356. CALL lbc_lnk( zw3d(:,:,:,jl),'T', 1. )
  357. END DO
  358. ENDIF
  359. IF( lk_iomput ) THEN
  360. ! Save diagnostics
  361. CALL iom_put( "TNO3PHY", zw2d(:,:,1) )
  362. CALL iom_put( "TNH4PHY", zw2d(:,:,2) )
  363. CALL iom_put( "TPHYDOM", zw2d(:,:,3) )
  364. CALL iom_put( "TPHYNH4", zw2d(:,:,4) )
  365. CALL iom_put( "TPHYZOO", zw2d(:,:,5) )
  366. CALL iom_put( "TPHYDET", zw2d(:,:,6) )
  367. CALL iom_put( "TDETZOO", zw2d(:,:,7) )
  368. CALL iom_put( "TZOODET", zw2d(:,:,8) )
  369. CALL iom_put( "TZOOBOD", zw2d(:,:,9) )
  370. CALL iom_put( "TZOONH4", zw2d(:,:,10) )
  371. CALL iom_put( "TZOODOM", zw2d(:,:,11) )
  372. CALL iom_put( "TNH4NO3", zw2d(:,:,12) )
  373. CALL iom_put( "TDOMNH4", zw2d(:,:,13) )
  374. CALL iom_put( "TDETNH4", zw2d(:,:,14) )
  375. CALL iom_put( "TPHYTOT", zw2d(:,:,15) )
  376. CALL iom_put( "TZOOTOT", zw2d(:,:,16) )
  377. !
  378. CALL iom_put( "FNO3PHY", zw3d(:,:,:,1) )
  379. CALL iom_put( "FNH4PHY", zw3d(:,:,:,2) )
  380. CALL iom_put( "FNH4NO3", zw3d(:,:,:,3) )
  381. !
  382. ELSE
  383. IF( ln_diatrc ) THEN
  384. !
  385. trc2d(:,:,jp_pcs0_2d ) = zw2d(:,:,1)
  386. trc2d(:,:,jp_pcs0_2d + 1) = zw2d(:,:,2)
  387. trc2d(:,:,jp_pcs0_2d + 2) = zw2d(:,:,3)
  388. trc2d(:,:,jp_pcs0_2d + 3) = zw2d(:,:,4)
  389. trc2d(:,:,jp_pcs0_2d + 4) = zw2d(:,:,5)
  390. trc2d(:,:,jp_pcs0_2d + 5) = zw2d(:,:,6)
  391. trc2d(:,:,jp_pcs0_2d + 6) = zw2d(:,:,7)
  392. ! trend number 8 is in p2zsed.F
  393. trc2d(:,:,jp_pcs0_2d + 8) = zw2d(:,:,8)
  394. trc2d(:,:,jp_pcs0_2d + 9) = zw2d(:,:,9)
  395. trc2d(:,:,jp_pcs0_2d + 10) = zw2d(:,:,10)
  396. trc2d(:,:,jp_pcs0_2d + 11) = zw2d(:,:,11)
  397. trc2d(:,:,jp_pcs0_2d + 12) = zw2d(:,:,12)
  398. trc2d(:,:,jp_pcs0_2d + 13) = zw2d(:,:,13)
  399. trc2d(:,:,jp_pcs0_2d + 14) = zw2d(:,:,14)
  400. trc2d(:,:,jp_pcs0_2d + 15) = zw2d(:,:,15)
  401. trc2d(:,:,jp_pcs0_2d + 16) = zw2d(:,:,16)
  402. trc2d(:,:,jp_pcs0_2d + 17) = zw2d(:,:,17)
  403. ! trend number 19 is in p2zexp.F
  404. trc3d(:,:,:,jp_pcs0_3d ) = zw3d(:,:,:,1)
  405. trc3d(:,:,:,jp_pcs0_3d + 1) = zw3d(:,:,:,2)
  406. trc3d(:,:,:,jp_pcs0_3d + 2) = zw3d(:,:,:,3)
  407. ENDIF
  408. !
  409. ENDIF
  410. IF( ln_diabio .AND. .NOT. lk_iomput ) THEN
  411. DO jl = jp_pcs0_trd, jp_pcs1_trd
  412. CALL lbc_lnk( trbio(:,:,1,jl),'T', 1. )
  413. END DO
  414. ENDIF
  415. !
  416. IF( l_trdtrc ) THEN
  417. DO jl = jp_pcs0_trd, jp_pcs1_trd
  418. CALL trd_trc( trbio(:,:,:,jl), jl, kt ) ! handle the trend
  419. END DO
  420. ENDIF
  421. IF(ln_ctl) THEN ! print mean trends (used for debugging)
  422. WRITE(charout, FMT="('bio')")
  423. CALL prt_ctl_trc_info(charout)
  424. CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm)
  425. ENDIF
  426. !
  427. IF( ln_diatrc .OR. lk_iomput ) THEN
  428. CALL wrk_dealloc( jpi, jpj, 17, zw2d )
  429. CALL wrk_dealloc( jpi, jpj, jpk, 3, zw3d )
  430. ENDIF
  431. !
  432. IF( nn_timing == 1 ) CALL timing_stop('p2z_bio')
  433. !
  434. END SUBROUTINE p2z_bio
  435. SUBROUTINE p2z_bio_init
  436. !!----------------------------------------------------------------------
  437. !! *** ROUTINE p2z_bio_init ***
  438. !!
  439. !! ** Purpose : biological parameters
  440. !!
  441. !! ** Method : Read namelist and check the parameters
  442. !!
  443. !!----------------------------------------------------------------------
  444. NAMELIST/namlobphy/ tmumax, rgamma, fphylab, tmminp, aki
  445. NAMELIST/namlobnut/ akno3, aknh4, taunn, psinut
  446. NAMELIST/namlobzoo/ rppz, taus, aks, rpnaz, rdnaz, tauzn, fzoolab, fdbod, tmminz
  447. NAMELIST/namlobdet/ taudn, fdetlab
  448. NAMELIST/namlobdom/ taudomn
  449. INTEGER :: ios ! Local integer output status for namelist read
  450. !!----------------------------------------------------------------------
  451. REWIND( numnatp_ref ) ! Namelist namlobphy in reference namelist : Lobster biological parameters
  452. READ ( numnatp_ref, namlobphy, IOSTAT = ios, ERR = 901)
  453. 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namlobphy in reference namelist', lwp )
  454. REWIND( numnatp_cfg ) ! Namelist namlobphy in configuration namelist : Lobster biological parameters
  455. READ ( numnatp_cfg, namlobphy, IOSTAT = ios, ERR = 902 )
  456. 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namlobphy in configuration namelist', lwp )
  457. IF(lwm) WRITE ( numonp, namlobphy )
  458. IF(lwp) THEN
  459. WRITE(numout,*) ' Namelist namlobphy'
  460. WRITE(numout,*) ' phyto max growth rate tmumax =', 86400 * tmumax, ' d'
  461. WRITE(numout,*) ' phytoplankton exudation fraction rgamma =', rgamma
  462. WRITE(numout,*) ' NH4 fraction of phytoplankton exsudation fphylab =', fphylab
  463. WRITE(numout,*) ' minimal phyto mortality rate tmminp =', 86400 * tmminp
  464. WRITE(numout,*) ' light hlaf saturation constant aki =', aki
  465. WRITE(numout,*) ' '
  466. ENDIF
  467. REWIND( numnatp_ref ) ! Namelist namlobnut in reference namelist : Lobster nutriments parameters
  468. READ ( numnatp_ref, namlobnut, IOSTAT = ios, ERR = 903)
  469. 903 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namlobnut in reference namelist', lwp )
  470. REWIND( numnatp_cfg ) ! Namelist namlobnut in configuration namelist : Lobster nutriments parameters
  471. READ ( numnatp_cfg, namlobnut, IOSTAT = ios, ERR = 904 )
  472. 904 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namlobnut in configuration namelist', lwp )
  473. IF(lwm) WRITE ( numonp, namlobnut )
  474. IF(lwp) THEN
  475. WRITE(numout,*) ' Namelist namlobnut'
  476. WRITE(numout,*) ' half-saturation nutrient for no3 uptake akno3 =', akno3
  477. WRITE(numout,*) ' half-saturation nutrient for nh4 uptake aknh4 =', aknh4
  478. WRITE(numout,*) ' nitrification rate taunn =', taunn
  479. WRITE(numout,*) ' inhibition of no3 uptake by nh4 psinut =', psinut
  480. WRITE(numout,*) ' '
  481. ENDIF
  482. REWIND( numnatp_ref ) ! Namelist namlobzoo in reference namelist : Lobster zooplankton parameters
  483. READ ( numnatp_ref, namlobzoo, IOSTAT = ios, ERR = 905)
  484. 905 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namlobzoo in reference namelist', lwp )
  485. REWIND( numnatp_cfg ) ! Namelist namlobzoo in configuration namelist : Lobster zooplankton parameters
  486. READ ( numnatp_cfg, namlobzoo, IOSTAT = ios, ERR = 906 )
  487. 906 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namlobzoo in configuration namelist', lwp )
  488. IF(lwm) WRITE ( numonp, namlobzoo )
  489. IF(lwp) THEN
  490. WRITE(numout,*) ' Namelist namlobzoo'
  491. WRITE(numout,*) ' zoo preference for phyto rppz =', rppz
  492. WRITE(numout,*) ' maximal zoo grazing rate taus =', 86400 * taus, ' d'
  493. WRITE(numout,*) ' half saturation constant for zoo food aks =', aks
  494. WRITE(numout,*) ' non-assimilated phyto by zoo rpnaz =', rpnaz
  495. WRITE(numout,*) ' non-assimilated detritus by zoo rdnaz =', rdnaz
  496. WRITE(numout,*) ' zoo specific excretion rate tauzn =', 86400 * tauzn
  497. WRITE(numout,*) ' minimal zoo mortality rate tmminz =', 86400 * tmminz
  498. WRITE(numout,*) ' NH4 fraction of zooplankton excretion fzoolab =', fzoolab
  499. WRITE(numout,*) ' Zooplankton mortality fraction that goes to detritus fdbod =', fdbod
  500. WRITE(numout,*) ' '
  501. ENDIF
  502. REWIND( numnatp_ref ) ! Namelist namlobdet in reference namelist : Lobster detritus parameters
  503. READ ( numnatp_ref, namlobdet, IOSTAT = ios, ERR = 907)
  504. 907 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namlobdet in reference namelist', lwp )
  505. REWIND( numnatp_cfg ) ! Namelist namlobdet in configuration namelist : Lobster detritus parameters
  506. READ ( numnatp_cfg, namlobdet, IOSTAT = ios, ERR = 908 )
  507. 908 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namlobdet in configuration namelist', lwp )
  508. IF(lwm) WRITE ( numonp, namlobdet )
  509. IF(lwp) THEN
  510. WRITE(numout,*) ' Namelist namlobdet'
  511. WRITE(numout,*) ' detrital breakdown rate taudn =', 86400 * taudn , ' d'
  512. WRITE(numout,*) ' NH4 fraction of detritus dissolution fdetlab =', fdetlab
  513. WRITE(numout,*) ' '
  514. ENDIF
  515. REWIND( numnatp_ref ) ! Namelist namlobdom in reference namelist : Lobster DOM breakdown rate
  516. READ ( numnatp_ref, namlobdom, IOSTAT = ios, ERR = 909)
  517. 909 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namlobdom in reference namelist', lwp )
  518. REWIND( numnatp_cfg ) ! Namelist namlobdom in configuration namelist : Lobster DOM breakdown rate
  519. READ ( numnatp_cfg, namlobdom, IOSTAT = ios, ERR = 910 )
  520. 910 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namlobdom in configuration namelist', lwp )
  521. IF(lwm) WRITE ( numonp, namlobdom )
  522. IF(lwp) THEN
  523. WRITE(numout,*) ' Namelist namlobdom'
  524. WRITE(numout,*) ' DOM breakdown rate taudomn =', 86400 * taudn , ' d'
  525. WRITE(numout,*) ' '
  526. ENDIF
  527. !
  528. END SUBROUTINE p2z_bio_init
  529. #else
  530. !!======================================================================
  531. !! Dummy module : No PISCES bio-model
  532. !!======================================================================
  533. CONTAINS
  534. SUBROUTINE p2z_bio( kt ) ! Empty routine
  535. INTEGER, INTENT( in ) :: kt
  536. WRITE(*,*) 'p2z_bio: You should not have seen this print! error?', kt
  537. END SUBROUTINE p2z_bio
  538. #endif
  539. !!======================================================================
  540. END MODULE p2zbio