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 945 for trunk/NEMO/TOP_SRC/trc.F90 – NEMO

Ignore:
Timestamp:
2008-05-14T18:14:53+02:00 (16 years ago)
Author:
cetlod
Message:

Update modules for new version of TOP model, see ticket 144

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/TOP_SRC/trc.F90

    r899 r945  
    44   !! Passive tracers   :  module for tracers defined 
    55   !!====================================================================== 
    6    !! History : 
    7    !!   8.2  !  96-01  (M. Levy)  Original code 
    8    !!        !  99-07  (M. Levy)  for LOBSTER1 or NPZD model 
    9    !!        !  00-04  (O. Aumont, M.A. Foujols)  HAMOCC3 and P3ZD 
    10    !!   9.0  !  04-03  (C. Ethe)  Free form and module 
     6   !! History :    -   !  1996-01  (M. Levy)  Original code 
     7   !!              -   !  1999-07  (M. Levy)  for LOBSTER1 or NPZD model 
     8   !!              -   !  2000-04  (O. Aumont, M.A. Foujols)  HAMOCC3 and P3ZD 
     9   !!             1.0  !  2004-03  (C. Ethe)  Free form and module 
    1110   !!---------------------------------------------------------------------- 
    12    !!  TOP 1.0, LOCEAN-IPSL (2005)  
    13    !! $Header$  
    14    !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt  
     11   !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005)  
     12   !! $Id$  
     13   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    1514   !!---------------------------------------------------------------------- 
    16 #if defined key_passivetrc 
     15#if defined key_top 
    1716   !!---------------------------------------------------------------------- 
    18    !!   'key_passivetrc'   :                               Passive tracer 
    19    !!--------------------------------------------------------------------- 
    20    !! * Modules used 
     17   !!   'key_top'                                                TOP models 
     18   !!---------------------------------------------------------------------- 
    2119   USE par_oce 
    2220   USE par_trc 
     21    
    2322   IMPLICIT NONE 
    24  
    2523   PUBLIC 
    26  
    2724 
    2825   !! passive tracers names and units (read in namelist) 
    2926   !! -------------------------------------------------- 
    30    CHARACTER(len=12), PUBLIC, DIMENSION(jptra) :: & 
    31       ctrcnm  ,   &   !!: tracer name  
    32       ctrcun          !!: tracer unit 
    33  
    34    CHARACTER(len=80), PUBLIC, DIMENSION(jptra) :: & 
    35       ctrcnl          !!: tracer long name  
     27   CHARACTER(len=12), PUBLIC, DIMENSION(jptra) ::   ctrcnm     !: tracer name  
     28   CHARACTER(len=12), PUBLIC, DIMENSION(jptra) ::   ctrcun     !: tracer unit 
     29   CHARACTER(len=80), PUBLIC, DIMENSION(jptra) ::   ctrcnl     !: tracer long name  
    3630    
    3731    
    3832   !! parameters for the control of passive tracers 
    3933   !! -------------------------------------------------- 
    40    INTEGER, PUBLIC ::  & 
    41       numnat          !!: the number of the passive tracer NAMELIST 
    42     
    43    LOGICAL, PUBLIC, DIMENSION(jptra) ::   & 
    44       lutini          !!:  initialisation from FILE or not (NAMELIST) 
    45  
    46    INTEGER , PUBLIC, DIMENSION(jptra) :: & 
    47       nutini          !!: FORTRAN LOGICAL UNIT for initialisation file 
     34   INTEGER, PUBLIC                   ::   numnat   !: the number of the passive tracer NAMELIST 
     35   LOGICAL, PUBLIC, DIMENSION(jptra) ::   lutini   !:  initialisation from FILE or not (NAMELIST) 
     36   LOGICAL, PUBLIC, DIMENSION(jptra) ::   lutsav   !:  logical for saving tracer or not 
     37   INTEGER, PUBLIC, DIMENSION(jptra) ::   nutini   !: FORTRAN LOGICAL UNIT for initialisation file 
    4838 
    4939   !! passive tracers fields (before,now,after) 
    5040   !! -------------------------------------------------- 
    51    REAL(wp), PUBLIC, SAVE  ::  & 
    52       trai    ,   &   !!: initial total tracer 
    53       areatot         !!: total volume  
     41   REAL(wp), PUBLIC ::   trai       !: initial total tracer 
     42   REAL(wp), PUBLIC ::   areatot    !: total volume  
    5443 
    55    REAL(wp), PUBLIC, DIMENSION (jpi,jpj,jpk,jptra) :: & 
    56       trn     ,   &   !!: traceur concentration for actual time step 
    57       tra     ,   &   !!: traceur concentration for next time step 
    58       trb             !!: traceur concentration for before time step 
     44   REAL(wp), PUBLIC, DIMENSION (jpi,jpj,jpk,jptra) ::   trn   !: traceur concentration for actual time step 
     45   REAL(wp), PUBLIC, DIMENSION (jpi,jpj,jpk,jptra) ::   tra   !: traceur concentration for next time step 
     46   REAL(wp), PUBLIC, DIMENSION (jpi,jpj,jpk,jptra) ::   trb   !: traceur concentration for before time step 
    5947 
    6048 
    6149   !! numerical parameter (NAMELIST) 
    6250   !! -------------------------------------------------- 
    63    REAL(wp), PUBLIC  ::  & 
    64       rsc     ,   &   !!: tuning coefficient for anti-diffusion 
    65       rtrn            !!: value for truncation 
     51   REAL(wp), PUBLIC ::   rsc    !: tuning coefficient for anti-diffusion 
     52   REAL(wp), PUBLIC ::   rtrn   !: value for truncation 
    6653 
    6754   !! namelist parameters 
    6855   !! -------------------------------------------------- 
    69    INTEGER , PUBLIC  ::  &  
    70       ncortrc ,   &   !!: number of corrective phases 
    71       ndttrc  ,   &   !!: frequency of step on passive tracers 
    72       nittrc000       !!: first time step of passive tracers model   
    73  
    74    LOGICAL, PUBLIC  ::  &  
    75       crosster        !!: logical if true computes crossterms 
     56   INTEGER , PUBLIC ::   ncortrc     !: number of corrective phases 
     57   INTEGER , PUBLIC ::   ndttrc      !: frequency of step on passive tracers 
     58   INTEGER , PUBLIC ::   nittrc000   !: first time step of passive tracers model   
     59   LOGICAL , PUBLIC ::   crosster    !: logical if true computes crossterms 
    7660 
    7761 
    7862   !! isopycnal scheme for passive tracers 
    79    !! --------------------------------------------------   
    80    REAL(wp), PUBLIC  ::  & 
    81       ahtrb0  ,   &   !!: background diffusivity coefficient for passive tracer (m2/s) 
    82       trcrat  ,   &   !!: ratio between passive and active tracer coeff for diffusion 
    83       ahtrc0  ,   &   !!: horizontal eddy diffusivity for passive tracers (m2/s) 
    84       aeivtr0         !!: eddy induced velocity coefficient (m2/s) 
     63   !! ------------------------------------   
     64   REAL(wp), PUBLIC ::   ahtrb0     !: background diffusivity coefficient for passive tracer (m2/s) 
     65   REAL(wp), PUBLIC ::   trcrat     !: ratio between passive and active tracer coeff for diffusion 
     66   REAL(wp), PUBLIC ::   ahtrc0     !: horizontal eddy diffusivity for passive tracers (m2/s) 
     67   REAL(wp), PUBLIC ::   aeivtr0    !: eddy induced velocity coefficient (m2/s) 
    8568    
    8669    
    8770   !! passive tracers restart (input and output) 
    88    !! --------------------------------------------------   
    89    LOGICAL, PUBLIC  ::  & 
    90       lrsttr          !!: boolean term for restart i/o for passive tracers (namelist) 
    91     
    92    INTEGER , PUBLIC  ::  & 
    93       nutwrs  ,   &   !!: output FILE for passive tracers restart 
    94       nutrst  ,   &   !!: logical unit for restart FILE for passive tracers 
    95       nrsttr          !!: control of the time step ( 0 or 1 ) for pass. tr. 
     71   !! ------------------------------------------   
     72   LOGICAL , PUBLIC ::   lrsttr     !: boolean term for restart i/o for passive tracers (namelist) 
     73   INTEGER , PUBLIC ::   nutwrs     !: output FILE for passive tracers restart 
     74   INTEGER , PUBLIC ::   nutrst     !: logical unit for restart FILE for passive tracers 
     75   INTEGER , PUBLIC ::   nrsttr     !: control of the time step ( 0 or 1 ) for pass. tr. 
    9676    
    9777    
    9878   !! interpolated gradient 
    9979   !!--------------------------------------------------   
    100    REAL (wp), PUBLIC, DIMENSION (jpi,jpj,jptra) :: & 
    101       gtru    ,   &   !!: horizontal gradient at u-points at bottom ocean level 
    102       gtrv            !!: horizontal gradient at v-points at bottom ocean level 
     80   REAL(wp), PUBLIC, DIMENSION (jpi,jpj,jptra) ::   gtru   !: horizontal gradient at u-points at bottom ocean level 
     81   REAL(wp), PUBLIC, DIMENSION (jpi,jpj,jptra) ::   gtrv   !: horizontal gradient at v-points at bottom ocean level 
    10382 
    10483    
    105 #if defined key_trcldf_eiv && defined key_diaeiv 
     84# if defined key_trcldf_eiv && defined key_diaeiv 
    10685   !! The three component of the eddy induced velocity 
    10786   !! -------------------------------------------------- 
    108    REAL(wp), PUBLIC, DIMENSION (jpi,jpj,jpk) :: & 
    109       u_trc_eiv,  &   !!: u-eiv (m/s) 
    110       v_trc_eiv,  &   !!: v-eiv (m/s) 
    111       w_trc_eiv       !!: w-eiv (m/s) 
    112 #endif 
     87   REAL(wp), PUBLIC, DIMENSION (jpi,jpj,jpk) ::   u_trc_eiv   !: u-eiv (m/s) 
     88   REAL(wp), PUBLIC, DIMENSION (jpi,jpj,jpk) ::   v_trc_eiv   !: v-eiv (m/s) 
     89   REAL(wp), PUBLIC, DIMENSION (jpi,jpj,jpk) ::   w_trc_eiv   !: w-eiv (m/s) 
     90# endif 
    11391    
    11492    
    11593   !! information for outputs 
    11694   !! -------------------------------------------------- 
    117    INTEGER , PUBLIC   ::  &  
    118       nwritetrc       !!: time step frequency for concentration outputs (namelist) 
     95   INTEGER , PUBLIC ::   nwritetrc   !: time step frequency for concentration outputs (namelist) 
    11996    
    120 #if defined key_trc_diaadd 
     97# if defined key_trc_diaadd 
    12198   !! additional 2D/3D outputs namelist 
    12299   !! -------------------------------------------------- 
    123    CHARACTER(len=8), PUBLIC, DIMENSION (jpdia2d) ::  &  
    124       ctrc2d  ,   &   !!: 2d output field name 
    125       ctrc2u          !!: 2d output field unit 
     100   CHARACTER(len= 8), PUBLIC, DIMENSION (jpdia2d) ::   ctrc2d   !: 2d output field name 
     101   CHARACTER(len= 8), PUBLIC, DIMENSION (jpdia2d) ::   ctrc2u   !: 2d output field unit    
     102   CHARACTER(len= 8), PUBLIC, DIMENSION (jpdia3d) ::   ctrc3d   !: 3d output field name 
     103   CHARACTER(len= 8), PUBLIC, DIMENSION (jpdia3d) ::   ctrc3u   !: 3d output field unit 
     104   CHARACTER(len=80), PUBLIC, DIMENSION (jpdia2d) ::   ctrc2l   !: 2d output field long name 
     105   CHARACTER(len=80), PUBLIC, DIMENSION (jpdia3d) ::   ctrc3l   !: 3d output field long name 
     106 
    126107    
    127    CHARACTER(len=8), PUBLIC, DIMENSION (jpdia3d) ::  &  
    128       ctrc3d ,    &   !!: 3d output field name 
    129       ctrc3u          !!: 3d output field unit 
    130     
    131    CHARACTER(len=80), PUBLIC, DIMENSION (jpdia2d) ::  &  
    132       ctrc2l          !!: 2d output field long name 
    133     
    134    CHARACTER(len=80), PUBLIC, DIMENSION (jpdia3d) ::  &  
    135       ctrc3l          !!: 3d output field long name 
    136     
    137    REAL(wp), PUBLIC, DIMENSION (jpi,jpj,jpdia2d) ::  &   
    138       trc2d           !!:  additional 2d outputs   
    139     
    140    REAL(wp), PUBLIC, DIMENSION (jpi,jpj,jpk,jpdia3d) ::  &   
    141       trc3d           !!:  additional 3d outputs   
     108   REAL(wp), PUBLIC, DIMENSION (jpi,jpj,    jpdia2d) ::   trc2d   !:  additional 2d outputs   
     109   REAL(wp), PUBLIC, DIMENSION (jpi,jpj,jpk,jpdia3d) ::   trc3d   !:  additional 3d outputs   
    142110    
    143111    
    144112   !! netcdf files and index common 
    145113   !! -------------------------------------------------- 
    146    INTEGER , PUBLIC :: & 
    147       nwriteadd     !!: frequency of additional arrays outputs(namelist) 
    148 #endif 
     114   INTEGER , PUBLIC ::   nwritedia     !: frequency of additional arrays outputs(namelist) 
     115# endif 
    149116    
    150 #if defined key_trc_diatrd 
     117# if defined key_trc_diatrd 
    151118    
    152119   !!  non conservative trends (biological, ...) 
    153120   !! -------------------------------------------------- 
    154    LOGICAL, PUBLIC, DIMENSION (jptra)  ::  &   
    155       luttrd          !!: large trends diagnostic to write or not (namelist) 
     121   LOGICAL, PUBLIC, DIMENSION (jptra) ::   luttrd   !: large trends diagnostic to write or not (namelist) 
    156122    
    157    !!  dynamical trends 
    158    !! trtrd()   : trends of the tracer equations 
    159    !!           1 : X advection 
    160    !!           2 : Y advection 
    161    !!           3 : Z advection 
    162    !!           4 : X diffusion 
    163    !!           5 : Y diffusion 
    164    !!           6 : Z diffusion 
    165    !!           7 : X gent velocity 
    166    !!           8 : Y gent velocity 
    167    !!           9 : Z gent velocity 
     123   !!  Advection-diffusion trends 
    168124   !! -------------------------------------------------- 
     125   REAL(wp), PUBLIC, DIMENSION(:,:,:,:,:), ALLOCATABLE ::   trtrd   !: trends of the tracer equations 
    169126    
    170     
    171    REAL(wp), PUBLIC, DIMENSION(:,:,:,:,:), ALLOCATABLE, SAVE :: & 
    172       trtrd           !!: trends of the tracer equations 
    173     
    174    INTEGER, PUBLIC, DIMENSION(jptra), SAVE :: ikeep ! indice of tracer for which dyn trends are stored 
    175    INTEGER, PUBLIC, SAVE                   :: nkeep ! number of tracers for which dyn trends are stored  
    176                                                     ! (used to allocate trtrd buffer) 
     127   INTEGER, PUBLIC, DIMENSION(jptra) :: ikeep ! indice of tracer for which dyn trends are stored 
     128   INTEGER, PUBLIC                   :: nkeep ! number of tracers for which dyn trends are stored  
     129   !                                          ! (used to allocate trtrd buffer) 
    177130 
    178131   !! netcdf files and index common 
    179132   !! -------------------------------------------------- 
    180    INTEGER , PUBLIC :: & 
    181       nwritetrd       !!: frequency of additional arrays outputs(namelist) 
     133   INTEGER , PUBLIC ::   nwritetrd   !: frequency of additional arrays outputs(namelist) 
    182134    
    183 #endif  
     135# endif  
    184136    
    185137   !! passive tracers data read and at given time_step 
    186138   !! -------------------------------------------------- 
    187 #if defined key_dtatrc 
    188     
    189    INTEGER , PUBLIC, DIMENSION(jptra) :: & 
    190       numtr          !!: logical unit for passive tracers data 
    191     
     139# if defined key_dtatrc 
     140   INTEGER , PUBLIC, DIMENSION(jptra) ::   numtr   !: logical unit for passive tracers data 
     141# endif 
     142 
     143#else 
     144   !!---------------------------------------------------------------------- 
     145   !!  Empty module :                                     No passive tracer 
     146   !!---------------------------------------------------------------------- 
    192147#endif 
    193148 
    194   !!  1D configuration 
    195   !! -------------------------------------------------- 
    196 #if defined key_cf1d 
    197       LOGICAL, PARAMETER ::   lk_trccfg_1d   = .TRUE.   !: 1D pass. tracer configuration flag 
    198 #else    
    199       LOGICAL, PARAMETER ::   lk_trccfg_1d   = .FALSE.  !: 1D pass. tracer configuration flag 
    200 #endif 
    201  
    202  
    203 #else 
    204149   !!====================================================================== 
    205    !!  Empty module : No passive tracer  
    206    !!====================================================================== 
    207 #endif 
    208  
    209150END MODULE trc 
Note: See TracChangeset for help on using the changeset viewer.