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 trunk/NEMOGCM/NEMO/TOP_SRC/PISCES – NEMO

source: trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/trcsms_pisces.F90 @ 2528

Last change on this file since 2528 was 2528, checked in by rblod, 14 years ago

Update NEMOGCM from branch nemo_v3_3_beta

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