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 775 for branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zint.F90 – NEMO

Ignore:
Timestamp:
2007-12-19T14:45:15+01:00 (16 years ago)
Author:
gm
Message:

dev_001_GM - PISCES in F90 : encapsulation of all p4z...F files in module F90 + doctor norme for local variables - compilation OK

File:
1 moved

Legend:

Unmodified
Added
Removed
  • branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zint.F90

    r774 r775  
     1MODULE p4zint 
     2   !!====================================================================== 
     3   !!                         ***  MODULE p4zint  *** 
     4   !! TOP :   PISCES interpolation and computation of various accessory fields 
     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   !!   p4z_int        :  interpolation and computation of various accessory fields 
     14   !!---------------------------------------------------------------------- 
     15   USE oce_trc         ! 
     16   USE trp_trc 
     17   USE sms 
    118 
    2 CCC $Header$  
    3 CCC  TOP 1.0 , LOCEAN-IPSL (2005)  
    4 C This software is governed by CeCILL licence see modipsl/doc/NEMO_CeCILL.txt  
    5 C --------------------------------------------------------------------------- 
    6 CDIR$ LIST 
    7       SUBROUTINE p4zint(kt) 
    8 #if defined key_top && defined key_pisces 
    9 CCC 
    10 CCC 
    11 CCC       ROUTINE p4zint : PISCES MODEL 
    12 CCC       ***************************** 
    13 CCC 
    14 CC 
    15 CC   PURPOSE : 
    16 CC   --------- 
    17 CC           *P4ZINT* INTERPOLATION AND COMPUTATION OF  
    18 CC                    VARIOUS ACCESSORY FIELDS 
    19 CC   INPUT : 
    20 CC   ----- 
    21 CC      argument 
    22 CC              kt              : time step 
    23 CC 
    24 CC   EXTERNAL : 
    25 CC   ---------- 
    26 CC          NONE 
    27 CC 
    28 CC   MODIFICATIONS: 
    29 CC   -------------- 
    30 CC      original      : 2004    O. Aumont 
    31 CC ---------------------------------------------------------------- 
    32 CC parameters and commons 
    33 CC ====================== 
    34 CDIR$ NOLIST 
    35       USE oce_trc 
    36       USE trp_trc 
    37       USE sms 
    38       IMPLICIT NONE 
    39 CDIR$ LIST 
    40 CC----------------------------------------------------------------- 
    41 CC------ 
    42 CC local declarations 
    43 CC ================== 
    44 C 
    45       INTEGER kt 
    46       INTEGER ji, jj 
    47       INTEGER iman 
    48       INTEGER nspyr,nvit1t,nvit2t 
    49       REAL zpdtan, zman, zpdtmo, zdemi 
    50       REAL zt, zdum 
    51 C 
    52 C 
     19   IMPLICIT NONE 
     20   PRIVATE 
     21 
     22   PUBLIC   p4z_int    ! called in p4zprg.F90 
     23 
     24   !!---------------------------------------------------------------------- 
     25   !! NEMO/TOP 2.0 , LOCEAN-IPSL (2007)  
     26   !! $Header:$  
     27   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
     28   !!---------------------------------------------------------------------- 
     29 
     30CONTAINS 
     31 
     32   SUBROUTINE p4z_int( kt ) 
     33      !!--------------------------------------------------------------------- 
     34      !!                     ***  ROUTINE p4z_int  *** 
     35      !! 
     36      !! ** Purpose :   interpolation and computation of various accessory fields 
     37      !! 
     38      !! ** Method  : - ??? 
     39      !!--------------------------------------------------------------------- 
     40      INTEGER, INTENT( in ) ::   kt      ! ocean time-step index       
     41      !! 
     42      INTEGER  ::   ji, jj 
     43      INTEGER  ::   iman, ivit1t, ivit2t 
     44      REAL(wp) ::   zpdtan, zman, zpdtmo, zdemi 
     45      REAL(wp) ::   zt, zdum 
     46      !!--------------------------------------------------------------------- 
     47 
    5348      zpdtan = raass / rdt 
    54       nspyr  = nint(zpdtan) 
    5549      zman   = 12. 
    5650      iman   = 12 
     
    5953      zt     = ( float ( kt) + zdemi) / zpdtmo 
    6054       
    61 C  recherche de l'indice des enregistrements 
    62 C  du modele dynamique encadrant le pas de temps kt. 
    63 C  -------------------------------------------------- 
    64 C 
    65       xtvit = zt - float(int ( zt)) 
    66       nvit1t = int (zt) 
    67       nvit2t = nvit1t+1 
    68       nvit1t = MOD ( nvit1t, iman) 
    69       IF ( nvit1t .EQ. 0 ) nvit1t = iman 
    70       nvit2t = MOD ( nvit2t, iman) 
    71       IF ( nvit2t .EQ. 0 ) nvit2t = iman 
    72 C 
    73 C Interpolation of dust deposition 
    74 C -------------------------------- 
    75 C 
    76          dust(:,:) = (1.-xtvit)*dustmo(:,:,nvit1t) 
    77      $            +xtvit*dustmo(:,:,nvit2t) 
    78 C 
    79 C 
    80 C Computation of phyto and zoo metabolic rate 
    81 C ------------------------------------------- 
    82 C 
     55      !  recherche de l indice des enregistrements 
     56      !  du modele dynamique encadrant le pas de temps kt. 
     57      !  -------------------------------------------------- 
    8358 
    84          Tgfunc(:,:,:) = exp(0.063913*tn(:,:,:)) 
    85          Tgfunc2(:,:,:) = exp(0.07608*tn(:,:,:)) 
    86 C 
    87 C      Computation of the silicon dependant half saturation 
    88 C      constant for silica uptake 
    89 C       --------------------------------------------------- 
    90 C 
    91         DO ji=1,jpi 
    92           DO jj=1,jpj 
    93           zdum=trn(ji,jj,1,jpsil)**2 
    94           xksimax(ji,jj) = max(xksimax(ji,jj),(1.+7.*zdum 
    95      &      /(xksi2*xksi2*25.+zdum))*1E-6) 
    96           END DO 
    97         END DO 
    98 C 
    99         IF (nday_year.EQ.365) THEN 
    100            xksi=xksimax 
    101            xksimax=0. 
    102         ENDIF 
    103 C 
    104 #endif 
    105 C 
    106       RETURN 
    107       END 
     59      xtvit = zt - FLOAT( INT( zt ) ) 
     60      ivit1t = INT( zt ) 
     61      ivit2t = ivit1t + 1 
     62      ivit1t = MOD ( ivit1t, iman ) 
     63      IF( ivit1t == 0 )   ivit1t = iman 
     64      ivit2t = MOD ( ivit2t, iman ) 
     65      IF( ivit2t == 0 )   ivit2t = iman 
     66 
     67      ! Interpolation of dust deposition 
     68      ! -------------------------------- 
     69 
     70      dust(:,:) = ( 1.- xtvit ) * dustmo(:,:,ivit1t) + xtvit * dustmo(:,:,ivit2t) 
     71 
     72      ! Computation of phyto and zoo metabolic rate 
     73      ! ------------------------------------------- 
     74 
     75      Tgfunc (:,:,:) = EXP( 0.063913 * tn(:,:,:) ) 
     76      Tgfunc2(:,:,:) = EXP( 0.07608  * tn(:,:,:) ) 
     77 
     78      ! Computation of the silicon dependant half saturation 
     79      ! constant for silica uptake 
     80      ! --------------------------------------------------- 
     81 
     82      DO ji = 1, jpi 
     83         DO jj = 1, jpj 
     84            zdum = trn(ji,jj,1,jpsil) * trn(ji,jj,1,jpsil) 
     85            xksimax(ji,jj) = MAX( xksimax(ji,jj), ( 1.+ 7.* zdum / ( xksi2 * xksi2 * 25. + zdum ) ) * 1e-6 ) 
     86         END DO 
     87      END DO 
     88 
     89      IF( nday_year == 365 ) THEN 
     90         xksi    = xksimax 
     91         xksimax = 0.e0 
     92      ENDIF 
     93      ! 
     94   END SUBROUTINE p4z_int 
     95 
     96#else 
     97   !!====================================================================== 
     98   !!  Dummy module :                                   No PISCES bio-model 
     99   !!====================================================================== 
     100CONTAINS 
     101   SUBROUTINE p4z_int( kt )                   ! Empty routine 
     102      INTEGER, INTENT( in ) ::   kt 
     103      WRITE(*,*) 'p4z_int: You should not have seen this print! error?', kt 
     104   END SUBROUTINE p4z_int 
     105#endif  
     106 
     107   !!====================================================================== 
     108END MODULE  p4zint 
Note: See TracChangeset for help on using the changeset viewer.