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.
Changeset 9169 for branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zpoc.F90 – NEMO

Ignore:
Timestamp:
2017-12-26T17:32:56+01:00 (6 years ago)
Author:
gm
Message:

dev_merge_2017: all SRC: finalize the removal of useless warning when reading namelist_cfg + remove all nn_closea + nn_msh replaced by a logical

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zpoc.F90

    r9125 r9169  
    2323   PUBLIC   p4z_poc         ! called in p4zbio.F90 
    2424   PUBLIC   p4z_poc_init    ! called in trcsms_pisces.F90 
    25    PUBLIC   alngam 
    26    PUBLIC   gamain 
    27  
    28    !! * Shared module variables 
    29    REAL(wp), PUBLIC ::  xremip     !: remineralisation rate of DOC 
    30    REAL(wp), PUBLIC ::  xremipc    !: remineralisation rate of DOC 
    31    REAL(wp), PUBLIC ::  xremipn    !: remineralisation rate of DON 
    32    REAL(wp), PUBLIC ::  xremipp    !: remineralisation rate of DOP 
    33    INTEGER , PUBLIC ::  jcpoc      !: number of lability classes 
    34    REAL(wp), PUBLIC ::  rshape     !: shape factor of the gamma distribution 
    35  
    36    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)     ::   alphan, reminp 
    37    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: alphap 
     25   PUBLIC   alngam          ! 
     26   PUBLIC   gamain          ! 
     27 
     28   REAL(wp), PUBLIC ::   xremip     !: remineralisation rate of DOC 
     29   REAL(wp), PUBLIC ::   xremipc    !: remineralisation rate of DOC 
     30   REAL(wp), PUBLIC ::   xremipn    !: remineralisation rate of DON 
     31   REAL(wp), PUBLIC ::   xremipp    !: remineralisation rate of DOP 
     32   INTEGER , PUBLIC ::   jcpoc      !: number of lability classes 
     33   REAL(wp), PUBLIC ::   rshape     !: shape factor of the gamma distribution 
     34 
     35   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)       ::   alphan, reminp   !: 
     36   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   alphap           !: 
    3837 
    3938 
     
    5352      !! ** Method  : - ??? 
    5453      !!--------------------------------------------------------------------- 
    55       ! 
    56       INTEGER, INTENT(in) ::   kt, knt ! ocean time step 
     54      INTEGER, INTENT(in) ::   kt, knt   ! ocean time step and ??? 
    5755      ! 
    5856      INTEGER  ::   ji, jj, jk, jn 
     
    187185      END DO 
    188186 
    189       IF( ln_p4z ) THEN   ;  zremigoc(:,:,:) = MIN( xremip , ztremint(:,:,:) ) 
    190       ELSE                ;  zremigoc(:,:,:) = MIN( xremipc, ztremint(:,:,:) ) 
     187      IF( ln_p4z ) THEN   ;   zremigoc(:,:,:) = MIN( xremip , ztremint(:,:,:) ) 
     188      ELSE                ;   zremigoc(:,:,:) = MIN( xremipc, ztremint(:,:,:) ) 
    191189      ENDIF 
    192190 
     
    260258     ! ------------------------------------------------------------------- 
    261259     ! 
    262      totprod(:,:) = 0. 
     260     totprod (:,:) = 0. 
    263261     totthick(:,:) = 0. 
    264      totcons(:,:) = 0. 
     262     totcons (:,:) = 0. 
    265263     ! intregrated production and consumption of POC in the mixed layer 
    266264     ! ---------------------------------------------------------------- 
     
    396394      END DO 
    397395 
    398      IF( ln_p4z ) THEN   ;  zremipoc(:,:,:) = MIN( xremip , ztremint(:,:,:) ) 
    399      ELSE                ;  zremipoc(:,:,:) = MIN( xremipc, ztremint(:,:,:) ) 
     396     IF( ln_p4z ) THEN   ;   zremipoc(:,:,:) = MIN( xremip , ztremint(:,:,:) ) 
     397     ELSE                ;   zremipoc(:,:,:) = MIN( xremipc, ztremint(:,:,:) ) 
    400398     ENDIF 
    401399 
     
    473471      !! 
    474472      !! ** Method  :   Read the nampispoc namelist and check the parameters 
    475       !!      called at the first timestep 
     473      !!              called at the first timestep 
    476474      !! 
    477475      !! ** input   :   Namelist nampispoc 
    478       !! 
    479476      !!---------------------------------------------------------------------- 
     477      INTEGER ::   jn            ! dummy loop index 
    480478      INTEGER ::   ios, ifault   ! Local integer 
    481       INTEGER ::   jn 
    482       REAL(wp) :: remindelta, reminup, remindown 
     479      REAL(wp)::   remindelta, reminup, remindown 
    483480      !! 
    484481      NAMELIST/nampispoc/ xremip , jcpoc  , rshape,  & 
    485482         &                xremipc, xremipn, xremipp 
    486483      !!---------------------------------------------------------------------- 
    487  
     484      ! 
     485      IF(lwp) THEN 
     486         WRITE(numout,*) 
     487         WRITE(numout,*) 'p4z_poc_init : Initialization of remineralization parameters' 
     488         WRITE(numout,*) '~~~~~~~~~~~~' 
     489      ENDIF 
     490      ! 
    488491      REWIND( numnatp_ref )              ! Namelist nampisrem in reference namelist : Pisces remineralization 
    489492      READ  ( numnatp_ref, nampispoc, IOSTAT = ios, ERR = 901) 
    490 901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nampispoc in reference namelist', lwp ) 
    491  
     493901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'nampispoc in reference namelist', lwp ) 
    492494      REWIND( numnatp_cfg )              ! Namelist nampisrem in configuration namelist : Pisces remineralization 
    493495      READ  ( numnatp_cfg, nampispoc, IOSTAT = ios, ERR = 902 ) 
    494 902   IF( ios >  0 ) CALL ctl_nam ( ios , 'nampispoc in configuration namelist', lwp ) 
    495       IF(lwm) WRITE ( numonp, nampispoc ) 
     496902   IF( ios >  0 )   CALL ctl_nam ( ios , 'nampispoc in configuration namelist', lwp ) 
     497      IF(lwm) WRITE( numonp, nampispoc ) 
    496498 
    497499      IF(lwp) THEN                         ! control print 
    498          WRITE(numout,*) ' ' 
    499          WRITE(numout,*) ' Namelist parameters for remineralization, nampispoc' 
    500          WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' 
     500         WRITE(numout,*) '   Namelist : nampispoc' 
    501501         IF( ln_p4z ) THEN 
    502             WRITE(numout,*) '    remineralisation rate of POC              xremip    =', xremip 
     502            WRITE(numout,*) '      remineralisation rate of POC              xremip    =', xremip 
    503503         ELSE 
    504             WRITE(numout,*) '    remineralisation rate of POC              xremipc   =', xremipc 
    505             WRITE(numout,*) '    remineralisation rate of PON              xremipn   =', xremipn 
    506             WRITE(numout,*) '    remineralisation rate of POP              xremipp   =', xremipp 
     504            WRITE(numout,*) '      remineralisation rate of POC              xremipc   =', xremipc 
     505            WRITE(numout,*) '      remineralisation rate of PON              xremipn   =', xremipn 
     506            WRITE(numout,*) '      remineralisation rate of POP              xremipp   =', xremipp 
    507507         ENDIF 
    508          WRITE(numout,*) '    Number of lability classes for POC        jcpoc     =', jcpoc 
    509          WRITE(numout,*) '    Shape factor of the gamma distribution    rshape    =', rshape 
     508         WRITE(numout,*) '      Number of lability classes for POC        jcpoc     =', jcpoc 
     509         WRITE(numout,*) '      Shape factor of the gamma distribution    rshape    =', rshape 
    510510      ENDIF 
    511511      ! 
     
    513513      ! --------------------------------------- 
    514514      ! 
    515       ALLOCATE( alphan(jcpoc), reminp(jcpoc) ) 
    516       ALLOCATE( alphap(jpi,jpj,jpk,jcpoc) ) 
     515      ALLOCATE( alphan(jcpoc) , reminp(jcpoc) , alphap(jpi,jpj,jpk,jcpoc) ) 
    517516      ! 
    518517      IF (jcpoc > 1) THEN 
     
    551550   END SUBROUTINE p4z_poc_init 
    552551 
     552 
    553553   REAL FUNCTION alngam( xvalue, ifault ) 
    554  
    555 !*****************************************************************************80 
    556 ! 
    557 !! ALNGAM computes the logarithm of the gamma function. 
    558 ! 
    559 !  Modified: 
    560 ! 
    561 !    13 January 2008 
    562 ! 
    563 !  Author: 
    564 ! 
    565 !    Allan Macleod 
    566 !    FORTRAN90 version by John Burkardt 
    567 ! 
    568 !  Reference: 
    569 ! 
    570 !    Allan Macleod, 
    571 !    Algorithm AS 245, 
    572 !    A Robust and Reliable Algorithm for the Logarithm of the Gamma Function, 
    573 !    Applied Statistics, 
    574 !    Volume 38, Number 2, 1989, pages 397-402. 
    575 ! 
    576 !  Parameters: 
    577 ! 
    578 !    Input, real ( kind = 8 ) XVALUE, the argument of the Gamma function. 
    579 ! 
    580 !    Output, integer ( kind = 4 ) IFAULT, error flag. 
    581 !    0, no error occurred. 
    582 !    1, XVALUE is less than or equal to 0. 
    583 !    2, XVALUE is too big. 
    584 ! 
    585 !    Output, real ( kind = 8 ) ALNGAM, the logarithm of the gamma function of X. 
    586 ! 
     554      !*****************************************************************************80 
     555      ! 
     556      !! ALNGAM computes the logarithm of the gamma function. 
     557      ! 
     558      !  Modified:    13 January 2008 
     559      ! 
     560      !  Author  :    Allan Macleod 
     561      !               FORTRAN90 version by John Burkardt 
     562      ! 
     563      !  Reference: 
     564      !    Allan Macleod, Algorithm AS 245, 
     565      !    A Robust and Reliable Algorithm for the Logarithm of the Gamma Function, 
     566      !    Applied Statistics, 
     567      !    Volume 38, Number 2, 1989, pages 397-402. 
     568      ! 
     569      !  Parameters: 
     570      ! 
     571      !    Input, real ( kind = 8 ) XVALUE, the argument of the Gamma function. 
     572      ! 
     573      !    Output, integer ( kind = 4 ) IFAULT, error flag. 
     574      !    0, no error occurred. 
     575      !    1, XVALUE is less than or equal to 0. 
     576      !    2, XVALUE is too big. 
     577      ! 
     578      !    Output, real ( kind = 8 ) ALNGAM, the logarithm of the gamma function of X. 
     579      !*****************************************************************************80 
    587580  implicit none 
    588581 
     
    746739   END FUNCTION alngam 
    747740 
     741 
    748742   REAL FUNCTION gamain( x, p, ifault ) 
    749  
    750743!*****************************************************************************80 
    751744! 
Note: See TracChangeset for help on using the changeset viewer.