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.
p2zsed.F90 in NEMO/trunk/src/TOP/PISCES/P2Z – NEMO

source: NEMO/trunk/src/TOP/PISCES/P2Z/p2zsed.F90 @ 13237

Last change on this file since 13237 was 13237, checked in by smasson, 4 years ago

trunk: Mid-year merge, merge back KERNEL-06_techene_e3

  • Property svn:keywords set to Id
File size: 6.6 KB
Line 
1MODULE p2zsed
2   !!======================================================================
3   !!                         ***  MODULE p2zsed  ***
4   !! TOP :   PISCES Compute loss of organic matter in the sediments
5   !!======================================================================
6   !! History :    -   !  1995-06 (M. Levy)  original code
7   !!              -   !  2000-12 (E. Kestenare)  clean up
8   !!             2.0  !  2007-12  (C. Deltel, G. Madec)  F90 + simplifications
9   !!----------------------------------------------------------------------
10   !!   p2z_sed        :  Compute loss of organic matter in the sediments
11   !!----------------------------------------------------------------------
12   USE oce_trc         !
13   USE trd_oce         !
14   USE trdtrc          !
15   USE trc             !
16   USE sms_pisces      !
17   !
18   USE lbclnk          !
19   USE iom             !
20   USE prtctl_trc      ! Print control for debbuging
21
22   IMPLICIT NONE
23   PRIVATE
24
25   PUBLIC   p2z_sed         ! called in ???
26   PUBLIC   p2z_sed_init    ! called in ???
27
28   REAL(wp), PUBLIC ::   sedlam      !: time coefficient of POC remineralization in sediments
29   REAL(wp), PUBLIC ::   sedlostpoc  !: mass of POC lost in sediments
30   REAL(wp), PUBLIC ::   vsed        !: detritus sedimentation speed [m/s]
31   REAL(wp), PUBLIC ::   xhr         !: coeff for martin''s remineralisation profile
32
33   !! * Substitutions
34#  include "do_loop_substitute.h90"
35#  include "domzgr_substitute.h90"
36   !!----------------------------------------------------------------------
37   !! NEMO/TOP 4.0 , NEMO Consortium (2018)
38   !! $Id$
39   !! Software governed by the CeCILL license (see ./LICENSE)
40   !!----------------------------------------------------------------------
41CONTAINS
42
43   SUBROUTINE p2z_sed( kt, Kmm, Krhs )
44      !!---------------------------------------------------------------------
45      !!                     ***  ROUTINE p2z_sed  ***
46      !!
47      !! ** Purpose :   compute the now trend due to the vertical sedimentation of
48      !!              detritus and add it to the general trend of detritus equations
49      !!
50      !! ** Method  :   this ROUTINE compute not exactly the advection but the
51      !!              transport term, i.e.  dz(wt) and dz(ws)., dz(wtr)
52      !!              using an upstream scheme
53      !!              the now vertical advection of tracers is given by:
54      !!                      dz(tr(:,:,:,:,Kmm) ww) = 1/bt dk+1( e1t e2t vsed (tr(:,:,:,:,Kmm)) )
55      !!              add this trend now to the general trend of tracer (ta,sa,tr(:,:,:,:,Krhs)):
56      !!                             tr(:,:,:,:,Krhs) = tr(:,:,:,:,Krhs) + dz(tr(:,:,:,:,Kmm) ww)
57      !!       
58      !!              IF 'key_diabio' is defined, the now vertical advection
59      !!              trend of passive tracers is saved for futher diagnostics.
60      !!---------------------------------------------------------------------
61      INTEGER, INTENT( in ) ::   kt         ! ocean time-step index     
62      INTEGER, INTENT( in ) ::   Kmm, Krhs  ! time level indices
63      !
64      INTEGER  ::   ji, jj, jk, jl, ierr
65      CHARACTER (len=25) :: charout
66      REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: zw2d
67      REAL(wp), DIMENSION(jpi,jpj,jpk) :: zwork, ztra
68      !!---------------------------------------------------------------------
69      !
70      IF( ln_timing )   CALL timing_start('p2z_sed')
71      !
72      IF( kt == nittrc000 ) THEN
73         IF(lwp) WRITE(numout,*)
74         IF(lwp) WRITE(numout,*) ' p2z_sed: LOBSTER sedimentation'
75         IF(lwp) WRITE(numout,*) ' ~~~~~~~'
76      ENDIF
77
78      ! sedimentation of detritus  : upstream scheme
79      ! --------------------------------------------
80
81      ! for detritus sedimentation only - jpdet
82      zwork(:,:,1  ) = 0.e0      ! surface value set to zero
83      zwork(:,:,jpk) = 0.e0      ! bottom value  set to zero
84
85      ! tracer flux at w-point: we use -vsed (downward flux)  with simplification : no e1*e2
86      DO jk = 2, jpkm1
87         zwork(:,:,jk) = -vsed * tr(:,:,jk-1,jpdet,Kmm)
88      END DO
89
90      ! tracer flux divergence at t-point added to the general trend
91      DO_3D_11_11( 1, jpkm1 )
92         ztra(ji,jj,jk)  = - ( zwork(ji,jj,jk) - zwork(ji,jj,jk+1) ) / e3t(ji,jj,jk,Kmm)
93         tr(ji,jj,jk,jpdet,Krhs) = tr(ji,jj,jk,jpdet,Krhs) + ztra(ji,jj,jk) 
94      END_3D
95
96      IF( lk_iomput )  THEN
97         IF( iom_use( "TDETSED" ) ) THEN
98            ALLOCATE( zw2d(jpi,jpj) )
99            zw2d(:,:) =  ztra(:,:,1) * e3t(:,:,1,Kmm) * 86400._wp
100            DO jk = 2, jpkm1
101               zw2d(:,:) = zw2d(:,:) + ztra(:,:,jk) * e3t(:,:,jk,Kmm) * 86400._wp
102            END DO
103            CALL iom_put( "TDETSED", zw2d )
104            DEALLOCATE( zw2d )
105         ENDIF
106      ENDIF
107      !
108
109      IF(sn_cfctl%l_prttrc)   THEN  ! print mean trends (used for debugging)
110         WRITE(charout, FMT="('sed')")
111         CALL prt_ctl_trc_info(charout)
112         CALL prt_ctl_trc(tab4d=tr(:,:,:,:,Krhs), mask=tmask, clinfo=ctrcnm)
113      ENDIF
114      !
115      IF( ln_timing )   CALL timing_stop('p2z_sed')
116      !
117   END SUBROUTINE p2z_sed
118
119
120   SUBROUTINE p2z_sed_init
121      !!----------------------------------------------------------------------
122      !!                  ***  ROUTINE p2z_sed_init  ***
123      !!
124      !! ** Purpose :   Parameters from aphotic layers to sediment
125      !!
126      !! ** Method  :   Read the namlobsed namelist and check the parameters
127      !!
128      !!----------------------------------------------------------------------
129      INTEGER ::   ios   ! Local integer
130      !!
131      NAMELIST/namlobsed/ sedlam, sedlostpoc, vsed, xhr
132      !!----------------------------------------------------------------------
133      !
134      READ  ( numnatp_ref, namlobsed, IOSTAT = ios, ERR = 901)
135901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namlosed in reference namelist' )
136      READ  ( numnatp_cfg, namlobsed, IOSTAT = ios, ERR = 902 )
137902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namlobsed in configuration namelist' )
138      IF(lwm) WRITE ( numonp, namlobsed )
139      !
140      IF(lwp) THEN
141          WRITE(numout,*) '   Namelist namlobsed'
142          WRITE(numout,*) '      time coeff of POC in sediments                sedlam    =', sedlam
143          WRITE(numout,*) '      Sediment geol loss for POC                    sedlostpoc=', sedlostpoc
144          WRITE(numout,*) '      detritus sedimentation speed                  vsed      =', 86400 * vsed  , ' d'
145          WRITE(numout,*) '      coeff for martin''s remineralistion           xhr       =', xhr
146          WRITE(numout,*) ' '
147      ENDIF
148      !
149   END SUBROUTINE p2z_sed_init
150
151   !!======================================================================
152END MODULE p2zsed
Note: See TracBrowser for help on using the repository browser.