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.
trcsms_pisces.F90 in branches/nemo_v3_3_beta/NEMOGCM/NEMO/TOP_SRC/PISCES – NEMO

source: branches/nemo_v3_3_beta/NEMOGCM/NEMO/TOP_SRC/PISCES/trcsms_pisces.F90 @ 2392

Last change on this file since 2392 was 2287, checked in by smasson, 14 years ago

update licence of all NEMO files...

  • Property svn:keywords set to Id
File size: 6.4 KB
Line 
1MODULE trcsms_pisces
2   !!======================================================================
3   !!                         ***  MODULE trcsms_pisces  ***
4   !! TOP :   PISCES Source Minus Sink manager
5   !!======================================================================
6   !! History :   1.0  !  2004-03 (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   !!   trcsms_pisces        :  Time loop of passive tracers sms
14   !!----------------------------------------------------------------------
15   USE oce_trc         !
16   USE trc
17   USE sms_pisces
18   USE lbclnk
19   USE lib_mpp
20   
21   USE p4zint          !
22   USE p4zche          !
23   USE p4zbio          !
24   USE p4zsink         !
25   USE p4zopt          !
26   USE p4zlim          !
27   USE p4zprod         !
28   USE p4zmort         !
29   USE p4zmicro        !
30   USE p4zmeso         !
31   USE p4zrem          !
32   USE p4zsed          !
33   USE p4zlys          !
34   USE p4zflx          !
35
36   USE trdmod_oce
37   USE trdmod_trc
38
39   USE sedmodel
40
41   IMPLICIT NONE
42   PRIVATE
43
44   PUBLIC   trc_sms_pisces    ! called in trcsms.F90
45
46   !!----------------------------------------------------------------------
47   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
48   !! $Id$
49   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
50   !!----------------------------------------------------------------------
51
52CONTAINS
53
54   SUBROUTINE trc_sms_pisces( kt )
55      !!---------------------------------------------------------------------
56      !!                     ***  ROUTINE trc_sms_pisces  ***
57      !!
58      !! ** Purpose :   Managment of the call to Biological sources and sinks
59      !!              routines of PISCES bio-model
60      !!
61      !! ** Method  : - at each new day ...
62      !!              - several calls of bio and sed ???
63      !!              - ...
64      !!---------------------------------------------------------------------
65      INTEGER, INTENT( in ) ::   kt      ! ocean time-step index     
66      !!
67      INTEGER ::   jnt, jn
68      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   ztrpis   ! used for pisces sms trends
69      !!---------------------------------------------------------------------
70
71      IF( kt == nit000 )   CALL trc_sms_pisces_init    ! Initialization (first time-step only)
72
73      IF( ndayflxtr /= nday ) THEN      ! New days
74         !
75         ndayflxtr = nday
76
77         CALL p4z_che          ! computation of chemical constants
78         CALL p4z_int          ! computation of various rates for biogeochemistry
79         !
80      ENDIF
81
82
83      DO jnt = 1, nrdttrc          ! Potential time splitting if requested
84         !
85         CALL p4z_bio (kt, jnt)    ! Compute soft tissue production (POC)
86         CALL p4z_sed (kt, jnt)    ! compute soft tissue remineralisation
87         !
88         trb(:,:,:,:) = trn(:,:,:,:)
89         !
90      END DO
91
92      CALL p4z_lys( kt )             ! Compute CaCO3 saturation
93      CALL p4z_flx( kt )             ! Compute surface fluxes
94
95      DO jn = jp_pcs0, jp_pcs1
96        CALL lbc_lnk( trn(:,:,:,jn), 'T', 1. )
97        CALL lbc_lnk( trb(:,:,:,jn), 'T', 1. )
98        CALL lbc_lnk( tra(:,:,:,jn), 'T', 1. )
99      END DO
100
101      IF( l_trdtrc ) THEN
102          DO jn = jp_pcs0, jp_pcs1
103            ztrpis(:,:,:) = tra(:,:,:,jn)
104            CALL trd_mod_trc( ztrpis, jn, jptra_trd_sms, kt )   ! save trends
105          END DO
106      END IF
107
108      IF( lk_sed ) THEN 
109         !
110         CALL sed_model( kt )     !  Main program of Sediment model
111         !
112         DO jn = jp_pcs0, jp_pcs1
113           CALL lbc_lnk( trn(:,:,:,jn), 'T', 1. )
114         END DO
115         !
116      ENDIF
117
118   END SUBROUTINE trc_sms_pisces
119
120   SUBROUTINE trc_sms_pisces_init
121      !!----------------------------------------------------------------------
122      !!                  ***  ROUTINE trc_sms_pisces_init  ***
123      !!
124      !! ** Purpose :   Initialization of PH variable
125      !!
126      !!----------------------------------------------------------------------
127      INTEGER  ::  ji, jj, jk
128      REAL(wp) ::  zcaralk, zbicarb, zco3
129      REAL(wp) ::  ztmas, ztmas1
130
131      IF( .NOT. ln_rsttr ) THEN
132         ! Initialization of chemical variables of the carbon cycle
133         ! --------------------------------------------------------
134         DO jk = 1, jpk
135            DO jj = 1, jpj
136               DO ji = 1, jpi
137                  ztmas   = tmask(ji,jj,jk)
138                  ztmas1  = 1. - tmask(ji,jj,jk)
139                  zcaralk = trn(ji,jj,jk,jptal) - borat(ji,jj,jk) / (  1. + 1.E-8 / ( rtrn + akb3(ji,jj,jk) )  )
140                  zco3    = ( zcaralk - trn(ji,jj,jk,jpdic) ) * ztmas + 0.5e-3 * ztmas1
141                  zbicarb = ( 2. * trn(ji,jj,jk,jpdic) - zcaralk )
142                  hi(ji,jj,jk) = ( ak23(ji,jj,jk) * zbicarb / zco3 ) * ztmas + 1.e-9 * ztmas1
143               END DO
144            END DO
145         END DO
146         !
147      END IF
148
149      ! Time step duration for biology
150      xstep = rfact2 / rday
151
152      CALL p4z_sink_init      ! vertical flux of particulate organic matter
153      CALL p4z_opt_init       ! Optic: PAR in the water column
154      CALL p4z_lim_init       ! co-limitations by the various nutrients
155      CALL p4z_prod_init      ! phytoplankton growth rate over the global ocean.
156      CALL p4z_rem_init       ! remineralisation
157      CALL p4z_mort_init      ! phytoplankton mortality
158      CALL p4z_micro_init     ! microzooplankton
159      CALL p4z_meso_init      ! mesozooplankton
160      CALL p4z_sed_init       ! sedimentation
161      CALL p4z_lys_init       ! calcite saturation
162      CALL p4z_flx_init       ! gas exchange
163
164   END SUBROUTINE trc_sms_pisces_init
165
166#else
167   !!======================================================================
168   !!  Dummy module :                                   No PISCES bio-model
169   !!======================================================================
170CONTAINS
171   SUBROUTINE trc_sms_pisces( kt )                   ! Empty routine
172      INTEGER, INTENT( in ) ::   kt
173      WRITE(*,*) 'trc_sms_pisces: You should not have seen this print! error?', kt
174   END SUBROUTINE trc_sms_pisces
175#endif 
176
177   !!======================================================================
178END MODULE trcsms_pisces 
Note: See TracBrowser for help on using the repository browser.