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.
p4zligand.F90 in NEMO/branches/2021/dev_r14116_HPC-10_mcastril_Mixed_Precision_implementation/src/TOP/PISCES/P4Z – NEMO

source: NEMO/branches/2021/dev_r14116_HPC-10_mcastril_Mixed_Precision_implementation/src/TOP/PISCES/P4Z/p4zligand.F90 @ 15648

Last change on this file since 15648 was 15648, checked in by sparonuz, 2 years ago

Updated name preprocessor function CASTWP to CASTDP

  • Property svn:keywords set to Id
File size: 6.4 KB
RevLine 
[7162]1MODULE p4zligand
2   !!======================================================================
3   !!                         ***  MODULE p4zligand  ***
4   !! TOP :   PISCES Compute remineralization/dissolution of organic ligands
5   !!=========================================================================
6   !! History :   3.6  !  2016-03  (O. Aumont, A. Tagliabue) Quota model and reorganization
7   !!----------------------------------------------------------------------
[9169]8   !!   p4z_ligand     :  Compute remineralization/dissolution of organic ligands
9   !!   p4z_ligand_init:  Initialisation of parameters for remineralisation
[7162]10   !!----------------------------------------------------------------------
[9169]11   USE oce_trc         ! shared variables between ocean and passive tracers
12   USE trc             ! passive tracers common variables
13   USE sms_pisces      ! PISCES Source Minus Sink variables
[13286]14   USE prtctl          ! print control for debugging
[10362]15   USE iom             !  I/O manager
[7162]16
17   IMPLICIT NONE
18   PRIVATE
19
20   PUBLIC   p4z_ligand         ! called in p4zbio.F90
21   PUBLIC   p4z_ligand_init    ! called in trcsms_pisces.F90
22
23   REAL(wp), PUBLIC ::  rlgw     !: lifetime (years) of weak ligands
24   REAL(wp), PUBLIC ::  rlgs     !: lifetime (years) of strong ligands
25   REAL(wp), PUBLIC ::  rlig     !: Remin ligand production
26   REAL(wp), PUBLIC ::  prlgw    !: Photochemical of weak ligand
27
[12377]28   !! * Substitutions
29#  include "do_loop_substitute.h90"
[14219]30#  include "single_precision_substitute.h90"
[7162]31   !!----------------------------------------------------------------------
[10067]32   !! NEMO/TOP 4.0 , NEMO Consortium (2018)
[10069]33   !! $Id$
[10068]34   !! Software governed by the CeCILL license (see ./LICENSE)
[7162]35   !!----------------------------------------------------------------------
36CONTAINS
37
[12377]38   SUBROUTINE p4z_ligand( kt, knt, Kbb, Krhs )
[7162]39      !!---------------------------------------------------------------------
40      !!                     ***  ROUTINE p4z_ligand  ***
41      !!
42      !! ** Purpose :   Compute remineralization/scavenging of organic ligands
43      !!---------------------------------------------------------------------
[12377]44      INTEGER, INTENT(in) ::   kt, knt   ! ocean time step
45      INTEGER, INTENT(in)  ::  Kbb, Krhs ! time level indices
[7162]46      !
47      INTEGER  ::   ji, jj, jk
[10416]48      REAL(wp) ::   zlgwp, zlgwpr, zlgwr, zlablgw
[12276]49      REAL(wp), DIMENSION(jpi,jpj,jpk) :: zligrem, zligpr, zligprod
[9169]50      CHARACTER (len=25) ::   charout
[7162]51      !!---------------------------------------------------------------------
52      !
[9124]53      IF( ln_timing )   CALL timing_start('p4z_ligand')
[7162]54      !
[13295]55      DO_3D( 1, 1, 1, 1, 1, jpkm1 )
[12377]56         !
57         ! ------------------------------------------------------------------
58         ! Remineralization of iron ligands
59         ! ------------------------------------------------------------------
60         ! production from remineralisation of organic matter
61         zlgwp = orem(ji,jj,jk) * rlig
62         ! decay of weak ligand
63         ! This is based on the idea that as LGW is lower
64         ! there is a larger fraction of refractory OM
65         zlgwr = max( rlgs , rlgw * exp( -2 * (tr(ji,jj,jk,jplgw,Kbb)*1e9) ) ) ! years
66         zlgwr = 1. / zlgwr * tgfunc(ji,jj,jk) * ( xstep / nyear_len(1) ) * blim(ji,jj,jk) * tr(ji,jj,jk,jplgw,Kbb)
67         ! photochem loss of weak ligand
68         zlgwpr = prlgw * xstep * etot(ji,jj,jk) * tr(ji,jj,jk,jplgw,Kbb) * (1. - fr_i(ji,jj))
69         tr(ji,jj,jk,jplgw,Krhs) = tr(ji,jj,jk,jplgw,Krhs) + zlgwp - zlgwr - zlgwpr
70         zligrem(ji,jj,jk)   = zlgwr
71         zligpr(ji,jj,jk)    = zlgwpr
72         zligprod(ji,jj,jk) = zlgwp
73         !
74      END_3D
[9169]75      !
[10362]76      !  Output of some diagnostics variables
77      !     ---------------------------------
78      IF( lk_iomput .AND. knt == nrdttrc ) THEN
79         IF( iom_use( "LIGREM" ) ) THEN
[12276]80           zligrem(:,:,jpk) = 0.  ; CALL iom_put( "LIGREM", zligrem(:,:,:) * 1e9 * 1.e+3 * rfact2r * tmask(:,:,:) )
[10362]81         ENDIF
82         IF( iom_use( "LIGPR" ) ) THEN
[12276]83           zligpr(:,:,jpk) = 0.   ; CALL iom_put( "LIGPR" , zligpr(:,:,:) * 1e9 * 1.e+3 * rfact2r * tmask(:,:,:) )
[10362]84         ENDIF
85         IF( iom_use( "LPRODR" ) ) THEN
[12276]86           zligprod(:,:,jpk) = 0. ; CALL iom_put( "LPRODR", zligprod(:,:,:) * 1e9 * 1.e+3 * rfact2r * tmask(:,:,:) )
[10362]87         ENDIF
88      ENDIF
89      !
[12377]90      IF(sn_cfctl%l_prttrc)   THEN  ! print mean trends (used for debugging)
[7162]91         WRITE(charout, FMT="('ligand1')")
[13286]92         CALL prt_ctl_info( charout, cdcomp = 'top' )
[15648]93         CALL prt_ctl(tab4d_1=CASTDP(tr(:,:,:,:,Krhs)), mask1=tmask, clinfo=ctrcnm)
[9169]94      ENDIF
[7162]95      !
[9124]96      IF( ln_timing )   CALL timing_stop('p4z_ligand')
[7162]97      !
98   END SUBROUTINE p4z_ligand
99
100
101   SUBROUTINE p4z_ligand_init
102      !!----------------------------------------------------------------------
103      !!                  ***  ROUTINE p4z_ligand_init  ***
104      !!
105      !! ** Purpose :   Initialization of remineralization parameters
106      !!
107      !! ** Method  :   Read the nampislig namelist and check the parameters
108      !!
109      !! ** input   :   Namelist nampislig
110      !!----------------------------------------------------------------------
[9124]111      INTEGER ::   ios   ! Local integer
112      !
[10416]113      NAMELIST/nampislig/ rlgw, prlgw, rlgs, rlig
[9124]114      !!----------------------------------------------------------------------
[9169]115      !
116      IF(lwp) THEN
117         WRITE(numout,*)
118         WRITE(numout,*) 'p4z_ligand_init : remineralization/scavenging of organic ligands'
119         WRITE(numout,*) '~~~~~~~~~~~~~~~'
120      ENDIF
[7162]121      READ  ( numnatp_ref, nampislig, IOSTAT = ios, ERR = 901)
[11536]122901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'nampislig in reference namelist' )
[7162]123      READ  ( numnatp_cfg, nampislig, IOSTAT = ios, ERR = 902 )
[11536]124902   IF( ios >  0 )   CALL ctl_nam ( ios , 'nampislig in configuration namelist' )
[7162]125      IF(lwm) WRITE ( numonp, nampislig )
[9169]126      !
[7162]127      IF(lwp) THEN                         ! control print
[9169]128         WRITE(numout,*) '   Namelist : nampislig'
129         WRITE(numout,*) '      Lifetime (years) of weak ligands             rlgw  =', rlgw
130         WRITE(numout,*) '      Remin ligand production per unit C           rlig  =', rlig
131         WRITE(numout,*) '      Photolysis of weak ligand                    prlgw =', prlgw
132         WRITE(numout,*) '      Lifetime (years) of strong ligands           rlgs  =', rlgs
[7162]133      ENDIF
134      !
135   END SUBROUTINE p4z_ligand_init
136
137   !!======================================================================
138END MODULE p4zligand
Note: See TracBrowser for help on using the repository browser.