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/2011/dev_LOCEAN_2011/NEMOGCM/NEMO/TOP_SRC – NEMO

source: branches/2011/dev_LOCEAN_2011/NEMOGCM/NEMO/TOP_SRC/trc.F90 @ 2997

Last change on this file since 2997 was 2997, checked in by cetlod, 13 years ago

branch dev_LOCEAN_2011 : minor corrections to ensure PISCES restartability

  • Property svn:keywords set to Id
File size: 9.0 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   !! parameters for the control of passive tracers
24   !! --------------------------------------------------
25   INTEGER, PUBLIC                                                 ::   numnat        !: logicla unit for the passive tracer NAMELIST
26   INTEGER, PUBLIC                                                 ::   numstr        !: logical unit for tracer statistics
27
28   !! passive tracers fields (before,now,after)
29   !! --------------------------------------------------
30   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)               ::  trai           !: initial total tracer
31   REAL(wp), PUBLIC                                                ::  areatot        !: total volume
32   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:  )         ::  cvol           !: volume correction -degrad option-
33   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:)         ::  trn            !: traceur concentration for now time step
34   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:)         ::  tra            !: traceur concentration for next time step
35   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:)         ::  trb            !: traceur concentration for before time step
36
37   !! interpolated gradient
38   !!-------------------------------------------------- 
39   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)           ::  gtru           !: hor. gradient at u-points at bottom ocean level
40   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)           ::  gtrv           !: hor. gradient at v-points at bottom ocean level
41   
42   !! passive tracers  (input and output)
43   !! ------------------------------------------ 
44   LOGICAL             , PUBLIC                                    ::  ln_rsttr       !: boolean term for restart i/o for passive tracers (namelist)
45   LOGICAL             , PUBLIC                                    ::  lrst_trc       !: logical to control the trc restart write
46   INTEGER             , PUBLIC                                    ::  nn_dttrc       !: frequency of step on passive tracers
47   INTEGER             , PUBLIC                                    ::  nn_writetrc    !: time step frequency for concentration outputs (namelist)
48   INTEGER             , PUBLIC                                    ::  nutwrs         !: output FILE for passive tracers restart
49   INTEGER             , PUBLIC                                    ::  nutrst         !: logical unit for restart FILE for passive tracers
50   INTEGER             , PUBLIC                                    ::  nn_rsttr       !: control of the time step ( 0 or 1 ) for pass. tr.
51   CHARACTER(len = 80) , PUBLIC                                    ::  cn_trcrst_in   !: suffix of pass. tracer restart name (input)
52   CHARACTER(len = 80) , PUBLIC                                    ::  cn_trcrst_out  !: suffix of pass. tracer restart name (output)
53   REAL(wp)            , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)   ::  rdttrc         !: vertical profile of passive tracer time step
54   LOGICAL             , PUBLIC                                    ::  ln_trcdta      !: Read inputs data from files
55   LOGICAL             , PUBLIC                                    ::  ln_trcdmp      !: internal damping flag
56
57   !! information for outputs
58   !! --------------------------------------------------
59   TYPE, PUBLIC :: PTRACER                                                            !: Passive tracer type
60       CHARACTER(len = 20)  :: clsname  !: short name
61       CHARACTER(len = 80)  :: cllname  !: long name
62       CHARACTER(len = 20)  :: clunit   !: unit
63       LOGICAL              :: llinit   !: read in a file or not
64       LOGICAL              :: llsave   !: save the tracer or not
65   END TYPE PTRACER
66   CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ctrcnm         !: tracer name
67   CHARACTER(len = 80), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ctrcln         !: trccer field long name
68   CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ctrcun         !: tracer unit
69   LOGICAL            , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ln_trc_ini     !: Initialisation from data input file
70   LOGICAL            , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ln_trc_wri     !: save the tracer or not
71
72   TYPE, PUBLIC :: DIAG                                                               !: passive trcacer ddditional diagnostic type
73      CHARACTER(len = 20)  :: sname    !: short name
74      CHARACTER(len = 80)  :: lname    !: long name
75      CHARACTER(len = 20)  :: units    !: unit
76   END TYPE DIAG
77
78   !! additional 2D/3D outputs namelist
79   !! --------------------------------------------------
80   REAL(wp)           , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,  :) ::   trc2d         !: additional 2d outputs array
81   REAL(wp)           , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   trc3d         !: additional 3d outputs array
82   CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)       ::   ctrc2d        !: 2d field short name
83   CHARACTER(len = 80), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)       ::   ctrc2l        !: 2d field long name
84   CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)       ::   ctrc2u        !: 2d field unit
85   CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)       ::   ctrc3d        !: 3d field short name
86   CHARACTER(len = 80), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)       ::   ctrc3l        !: 3d field long name
87   CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)       ::   ctrc3u        !: 3d field unit
88   LOGICAL            , PUBLIC                                        ::  ln_diatrc      !: boolean term for additional diagnostic
89   INTEGER            , PUBLIC                                        ::  nn_writedia    !: frequency of additional outputs
90
91   !! Biological trends
92   !! -----------------
93   LOGICAL            , PUBLIC                                        ::  ln_diabio      !: boolean term for biological diagnostic
94   INTEGER            , PUBLIC                                        ::  nn_writebio    !: frequency of biological outputs
95   REAL(wp)           , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::  trbio          !: biological trends
96   CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)       ::  ctrbio         !: bio field short name
97   CHARACTER(len = 80), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)       ::  ctrbil         !: bio field long name
98   CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)       ::  ctrbiu         !: bio field unit
99
100   !!----------------------------------------------------------------------
101   !! NEMO/TOP 3.3.1 , NEMO Consortium (2010)
102   !! $Id$
103   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
104   !!----------------------------------------------------------------------
105CONTAINS
106
107   INTEGER FUNCTION trc_alloc()
108      !!-------------------------------------------------------------------
109      !!                    *** ROUTINE trc_alloc ***
110      !!-------------------------------------------------------------------
111      USE lib_mpp, ONLY: ctl_warn
112      !!-------------------------------------------------------------------
113      !
114      ALLOCATE( trn(jpi,jpj,jpk,jptra), trb(jpi,jpj,jpk,jptra), tra(jpi,jpj,jpk,jptra),       & 
115         &      gtru(jpi,jpj,jpk)     , gtrv(jpi,jpj,jpk)                             ,       &
116         &      cvol(jpi,jpj,jpk)     , rdttrc(jpk)           , trai(jptra)           ,       &
117         &      ctrcnm(jptra)         , ctrcln(jptra)         , ctrcun(jptra)         ,       & 
118         &      ln_trc_ini(jptra)     , ln_trc_wri(jptra)                             ,  STAT = trc_alloc  ) 
119
120      IF( trc_alloc /= 0 )   CALL ctl_warn('trc_alloc: failed to allocate arrays')
121      !
122   END FUNCTION trc_alloc
123
124#else
125   !!----------------------------------------------------------------------
126   !!  Empty module :                                     No passive tracer
127   !!----------------------------------------------------------------------
128#endif
129
130   !!======================================================================
131END MODULE trc
Note: See TracBrowser for help on using the repository browser.