New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
p4zbio.F90 in trunk/NEMOGCM/NEMO/TOP_SRC/PISCES – NEMO

source: trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zbio.F90 @ 3294

Last change on this file since 3294 was 3294, checked in by rblod, 12 years ago

Merge of 3.4beta into the trunk

  • Property svn:keywords set to Id
File size: 5.9 KB
Line 
1MODULE p4zbio
2   !!======================================================================
3   !!                         ***  MODULE p4zbio  ***
4   !! TOP :   PISCES bio-model
5   !!======================================================================
6   !! History :   1.0  !  2004     (O. Aumont) Original code
7   !!             2.0  !  2007-12  (C. Ethe, G. Madec)  F90
8   !!----------------------------------------------------------------------
9#if defined key_pisces
10   !!----------------------------------------------------------------------
11   !!   'key_pisces'                                       PISCES bio-model
12   !!----------------------------------------------------------------------
13   !!   p4z_bio        :   computes the interactions between the different
14   !!                      compartments of PISCES
15   !!----------------------------------------------------------------------
16   USE oce_trc         !  shared variables between ocean and passive tracers
17   USE trc             !  passive tracers common variables
18   USE sms_pisces      !  PISCES Source Minus Sink variables
19   USE p4zsink         !  vertical flux of particulate matter due to sinking
20   USE p4zopt          !  optical model
21   USE p4zlim          !  Co-limitations of differents nutrients
22   USE p4zprod         !  Growth rate of the 2 phyto groups
23   USE p4zmort         !  Mortality terms for phytoplankton
24   USE p4zmicro        !  Sources and sinks of microzooplankton
25   USE p4zmeso         !  Sources and sinks of mesozooplankton
26   USE p4zrem          !  Remineralisation of organic matter
27   USE prtctl_trc      !  print control for debugging
28   USE iom             !  I/O manager
29 
30   IMPLICIT NONE
31   PRIVATE
32
33   PUBLIC  p4z_bio   
34
35   !!* Substitution
36#  include "top_substitute.h90"
37   !!----------------------------------------------------------------------
38   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
39   !! $Id$
40   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
41   !!----------------------------------------------------------------------
42
43CONTAINS
44
45   SUBROUTINE p4z_bio ( kt, jnt )
46      !!---------------------------------------------------------------------
47      !!                     ***  ROUTINE p4z_bio  ***
48      !!
49      !! ** Purpose :   Ecosystem model in the whole ocean: computes the
50      !!              different interactions between the different compartments
51      !!              of PISCES
52      !!
53      !! ** Method  : - ???
54      !!---------------------------------------------------------------------
55      INTEGER, INTENT(in) :: kt, jnt
56      INTEGER  ::  ji, jj, jk, jn
57      REAL(wp) ::  ztra
58#if defined key_kriest
59      REAL(wp) ::  zcoef1, zcoef2
60#endif
61      CHARACTER (len=25) :: charout
62
63      !!---------------------------------------------------------------------
64      !
65      IF( nn_timing == 1 )  CALL timing_start('p4z_bio')
66      !
67      !     ASSIGN THE SHEAR RATE THAT IS USED FOR AGGREGATION
68      !     OF PHYTOPLANKTON AND DETRITUS
69
70      xdiss(:,:,:) = 1.
71!!gm the use of nmld should be better here?
72      DO jk = 2, jpkm1
73         DO jj = 1, jpj
74            DO ji = 1, jpi
75               IF( fsdepw(ji,jj,jk+1) > hmld(ji,jj) )   xdiss(ji,jj,jk) = 0.01
76            END DO
77         END DO
78      END DO
79
80         
81      CALL p4z_sink ( kt, jnt )     ! vertical flux of particulate organic matter
82      CALL p4z_opt  ( kt, jnt )     ! Optic: PAR in the water column
83      CALL p4z_lim  ( kt      )     ! co-limitations by the various nutrients
84      CALL p4z_prod ( kt, jnt )     ! phytoplankton growth rate over the global ocean.
85      !                             ! (for each element : C, Si, Fe, Chl )
86      CALL p4z_rem  ( kt      )     ! remineralization terms of organic matter+scavenging of Fe
87      CALL p4z_mort ( kt      )     ! phytoplankton mortality
88      !                             ! zooplankton sources/sinks routines
89      CALL p4z_micro( kt      )           ! microzooplankton
90      CALL p4z_meso ( kt, jnt )           ! mesozooplankton
91
92      !                             ! test if tracers concentrations fall below 0.
93      xnegtr(:,:,:) = 1.e0
94      DO jn = jp_pcs0, jp_pcs1
95         DO jk = 1, jpk
96            DO jj = 1, jpj
97               DO ji = 1, jpi
98                  IF( ( trn(ji,jj,jk,jn) + tra(ji,jj,jk,jn) ) < 0.e0 ) THEN
99                     ztra             = ABS(  ( trn(ji,jj,jk,jn) - rtrn ) &
100                                            / ( tra(ji,jj,jk,jn) + rtrn ) )
101                     xnegtr(ji,jj,jk) = MIN( xnegtr(ji,jj,jk),  ztra )
102                  ENDIF
103              END DO
104            END DO
105         END DO
106      END DO
107      !                                ! where at least 1 tracer concentration becomes negative
108      !                                !
109      DO jn = jp_pcs0, jp_pcs1
110         trn(:,:,:,jn) = trn(:,:,:,jn) + xnegtr(:,:,:) * tra(:,:,:,jn)
111      END DO
112
113
114      tra(:,:,:,:) = 0.e0
115
116#if defined key_kriest
117      !
118      zcoef1 = 1.e0 / xkr_massp 
119      zcoef2 = 1.e0 / xkr_massp / 1.1
120      DO jk = 1,jpkm1
121         trn(:,:,jk,jpnum) = MAX(  trn(:,:,jk,jpnum), trn(:,:,jk,jppoc) * zcoef1 / xnumm(jk)  )
122         trn(:,:,jk,jpnum) = MIN(  trn(:,:,jk,jpnum), trn(:,:,jk,jppoc) * zcoef2              )
123      END DO
124#endif
125
126      !
127      IF(ln_ctl)   THEN  ! print mean trends (used for debugging)
128         WRITE(charout, FMT="('bio ')")
129         CALL prt_ctl_trc_info(charout)
130         CALL prt_ctl_trc(tab4d=trn, mask=tmask, clinfo=ctrcnm)
131      ENDIF
132      !
133      IF( nn_timing == 1 )  CALL timing_stop('p4z_bio')
134      !
135   END SUBROUTINE p4z_bio
136
137#else
138   !!======================================================================
139   !!  Dummy module :                                   No PISCES bio-model
140   !!======================================================================
141CONTAINS
142   SUBROUTINE p4z_bio                         ! Empty routine
143   END SUBROUTINE p4z_bio
144#endif 
145
146   !!======================================================================
147END MODULE  p4zbio
Note: See TracBrowser for help on using the repository browser.