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.
trc.F90 in branches/dev_r2586_dynamic_mem/NEMOGCM/NEMO/TOP_SRC – NEMO

source: branches/dev_r2586_dynamic_mem/NEMOGCM/NEMO/TOP_SRC/trc.F90 @ 2636

Last change on this file since 2636 was 2636, checked in by gm, 13 years ago

dynamic mem: #785 ; move ctl_stop & warn in lib_mpp to avoid a circular dependency + ctl_stop improvment

  • Property svn:keywords set to Id
File size: 7.6 KB
Line 
1MODULE trc
2   !!======================================================================
3   !!                      ***  MODULE  trc  ***
4   !! Passive tracers   :  module for tracers defined
5   !!======================================================================
6   !! History :   OPA  !  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   !!   NEMO      1.0  !  2004-03  (C. Ethe)  Free form and module
10   !!----------------------------------------------------------------------
11#if defined key_top
12   !!----------------------------------------------------------------------
13   !!   'key_top'                                                TOP models
14   !!----------------------------------------------------------------------
15   USE par_oce
16   USE par_trc
17   
18   IMPLICIT NONE
19   PUBLIC
20
21   PUBLIC    trc_alloc          ! called by nemogcm.F90
22
23   !! passive tracers names and units (read in namelist)
24   !! --------------------------------------------------
25   CHARACTER(len=12), PUBLIC, DIMENSION(jptra) ::   ctrcnm     !: tracer name
26   CHARACTER(len=12), PUBLIC, DIMENSION(jptra) ::   ctrcun     !: tracer unit
27   CHARACTER(len=80), PUBLIC, DIMENSION(jptra) ::   ctrcnl     !: tracer long name
28   
29   
30   !! parameters for the control of passive tracers
31   !! --------------------------------------------------
32   INTEGER, PUBLIC                   ::   numnat   !: the number of the passive tracer NAMELIST
33   LOGICAL, PUBLIC, DIMENSION(jptra) ::   lutini   !:  initialisation from FILE or not (NAMELIST)
34   LOGICAL, PUBLIC, DIMENSION(jptra) ::   lutsav   !:  save the tracer or not
35
36   !! passive tracers fields (before,now,after)
37   !! --------------------------------------------------
38   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:,:) :: cvol   !: volume correction -degrad option-
39   REAL(wp), PUBLIC ::   trai                          !: initial total tracer
40   REAL(wp), PUBLIC ::   areatot                       !: total volume
41
42   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:,:,:) ::   trn   !: traceur concentration for actual time step
43   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:,:,:) ::   tra   !: traceur concentration for next time step
44   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:,:,:) ::   trb   !: traceur concentration for before time step
45
46   !! interpolated gradient
47   !!-------------------------------------------------- 
48   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:,:) ::   gtru   !: horizontal gradient at u-points at bottom ocean level
49   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:,:) ::   gtrv   !: horizontal gradient at v-points at bottom ocean level
50   
51   !! passive tracers restart (input and output)
52   !! ------------------------------------------ 
53   LOGICAL , PUBLIC          ::  ln_rsttr      !: boolean term for restart i/o for passive tracers (namelist)
54   LOGICAL , PUBLIC          ::  lrst_trc      !: logical to control the trc restart write
55   INTEGER , PUBLIC          ::  nn_dttrc      !: frequency of step on passive tracers
56   INTEGER , PUBLIC          ::  nutwrs        !: output FILE for passive tracers restart
57   INTEGER , PUBLIC          ::  nutrst        !: logical unit for restart FILE for passive tracers
58   INTEGER , PUBLIC          ::  nn_rsttr      !: control of the time step ( 0 or 1 ) for pass. tr.
59   CHARACTER(len=50), PUBLIC ::  cn_trcrst_in  !: suffix of pass. tracer restart name (input)
60   CHARACTER(len=50), PUBLIC ::  cn_trcrst_out !: suffix of pass. tracer restart name (output)
61   
62   !! information for outputs
63   !! --------------------------------------------------
64   INTEGER , PUBLIC ::   nn_writetrc   !: time step frequency for concentration outputs (namelist)
65   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   rdttrc        !: vertical profile of passive tracer time step
66   
67# if defined key_diatrc && ! defined key_iomput
68   !! additional 2D/3D outputs namelist
69   !! --------------------------------------------------
70   INTEGER , PUBLIC                               ::   nn_writedia   !: frequency of additional arrays outputs(namelist)
71   CHARACTER(len= 8), PUBLIC, DIMENSION (jpdia2d) ::   ctrc2d      !: 2d output field name
72   CHARACTER(len= 8), PUBLIC, DIMENSION (jpdia2d) ::   ctrc2u      !: 2d output field unit   
73   CHARACTER(len= 8), PUBLIC, DIMENSION (jpdia3d) ::   ctrc3d      !: 3d output field name
74   CHARACTER(len= 8), PUBLIC, DIMENSION (jpdia3d) ::   ctrc3u      !: 3d output field unit
75   CHARACTER(len=80), PUBLIC, DIMENSION (jpdia2d) ::   ctrc2l      !: 2d output field long name
76   CHARACTER(len=80), PUBLIC, DIMENSION (jpdia3d) ::   ctrc3l      !: 3d output field long name
77
78   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:,  :) ::   trc2d    !:  additional 2d outputs 
79   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:,:,:) ::   trc3d    !:  additional 3d outputs 
80# endif
81
82# if defined key_diabio || defined key_trdmld_trc
83   !                                                              !!*  namtop_XXX namelist *
84   INTEGER , PUBLIC                               ::   nn_writebio   !: time step frequency for biological outputs
85   CHARACTER(len=8 ), PUBLIC, DIMENSION(jpdiabio) ::   ctrbio      !: biological trends name     
86   CHARACTER(len=20), PUBLIC, DIMENSION(jpdiabio) ::   ctrbiu      !: biological trends unit   
87   CHARACTER(len=80), PUBLIC, DIMENSION(jpdiabio) ::   ctrbil      !: biological trends long name
88# endif
89# if defined key_diabio
90   !! Biological trends
91   !! -----------------
92   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: trbio   !: biological trends
93# endif
94
95   
96   !! passive tracers data read and at given time_step
97   !! --------------------------------------------------
98# if defined key_dtatrc
99   INTEGER , PUBLIC, DIMENSION(jptra) ::   numtr   !: logical unit for passive tracers data
100# endif
101
102   !!----------------------------------------------------------------------
103   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
104   !! $Id$
105   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
106   !!----------------------------------------------------------------------
107CONTAINS
108
109   INTEGER FUNCTION trc_alloc()
110      !!-------------------------------------------------------------------
111      !!                    *** ROUTINE trc_alloc ***
112      !!-------------------------------------------------------------------
113      USE lib_mpp, ONLY: ctl_warn
114      !!-------------------------------------------------------------------
115      !
116      ALLOCATE(cvol(jpi,jpj,jpk),                                  &
117               trn(jpi,jpj,jpk,jptra),                             &
118               tra(jpi,jpj,jpk,jptra),                             &
119               trb(jpi,jpj,jpk,jptra),                             &
120               gtru(jpi,jpj,jptra), gtrv(jpi,jpj,jptra),           &
121               rdttrc(jpk),                                        &
122# if defined key_diatrc && ! defined key_iomput
123               trc2d(jpi,jpj,jpdia2d), trc3d(jpi,jpj,jpk,jpdia3d), &
124# endif
125# if defined key_diabio
126               trbio(jpi,jpj,jpk,jpdiabio),                        &
127# endif
128               STAT=trc_alloc)
129
130      IF( trc_alloc /= 0 )   CALL ctl_warn('trc_alloc: failed to allocate arrays')
131      !
132   END FUNCTION trc_alloc
133   
134#else
135   !!----------------------------------------------------------------------
136   !!  Empty module :                                     No passive tracer
137   !!----------------------------------------------------------------------
138#endif
139
140   !!======================================================================
141END MODULE trc
Note: See TracBrowser for help on using the repository browser.