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

source: branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/PISCES/trcsms_pisces.F90 @ 2819

Last change on this file since 2819 was 2819, checked in by cetlod, 13 years ago

Improvment of branch dev_r2787_LOCEAN3_TRA_TRP

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