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.
trcini.F90 in branches/CMIP5_IPSL/NEMO/TOP_SRC – NEMO

source: branches/CMIP5_IPSL/NEMO/TOP_SRC/trcini.F90 @ 5712

Last change on this file since 5712 was 1814, checked in by cetlod, 14 years ago

Correction of bug when restoring passive tracers on closed seas. The
date was badly re-initialized in PISCES when restarting

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 6.8 KB
Line 
1MODULE trcini
2   !!======================================================================
3   !!                         ***  MODULE trcini  ***
4   !! TOP :   Manage the passive tracer initialization
5   !!======================================================================
6   !! History :    -   !  1991-03  ()  original code
7   !!             1.0  !  2005-03 (O. Aumont, A. El Moussaoui) F90
8   !!              -   !  2005-10 (C. Ethe) print control
9   !!             2.0  !  2005-10 (C. Ethe, G. Madec) revised architecture
10   !!----------------------------------------------------------------------
11#if defined key_top
12   !!----------------------------------------------------------------------
13   !!   'key_top'                                                TOP models
14   !!----------------------------------------------------------------------
15   !!----------------------------------------------------------------------
16   !!   trc_ini :   Initialization for passive tracer
17   !!----------------------------------------------------------------------
18   USE oce_trc
19   USE trc
20   USE trp_trc
21   USE trcrst
22   USE trcctl
23   USE trclec
24   USE trcini_cfc      ! CFC      initialisation
25   USE trcini_lobster  ! LOBSTER  initialisation
26   USE trcini_pisces   ! PISCES   initialisation
27   USE trcini_c14b     ! C14 bomb initialisation
28   USE trcini_my_trc   ! MY_TRC   initialisation
29   USE trcdta   
30#if defined key_off_tra 
31   USE daymod
32#endif
33   USE zpshde_trc      ! partial step: hor. derivative
34   USE in_out_manager  ! I/O manager
35   USE prtctl_trc      ! Print control passive tracers (prt_ctl_trc_init routine)
36   USE lib_mpp         ! distributed memory computing library
37   
38   IMPLICIT NONE
39   PRIVATE
40   
41   PUBLIC   trc_ini   ! called by opa
42
43    !! * Substitutions
44#  include "domzgr_substitute.h90"
45   !!----------------------------------------------------------------------
46   !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005)
47   !! $Id$
48   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
49   !!----------------------------------------------------------------------
50 
51CONTAINS
52   
53   SUBROUTINE trc_ini
54      !!---------------------------------------------------------------------
55      !!                     ***  ROUTINE trc_ini  ***
56      !!
57      !! ** Purpose :   Initialization of the passive tracer fields
58      !!
59      !! ** Method  : - read namelist
60      !!              - control the consistancy
61      !!              - compute specific initialisations
62      !!              - set initial tracer fields (either read restart
63      !!                or read data or analytical formulation
64      !!---------------------------------------------------------------------
65      INTEGER ::   jk, jn    ! dummy loop indices
66      CHARACTER (len=25) :: charout
67
68      !!---------------------------------------------------------------------
69
70      IF(lwp) WRITE(numout,*)
71      IF(lwp) WRITE(numout,*) 'trc_ini : initial set up of the passive tracers'
72      IF(lwp) WRITE(numout,*) '~~~~~~~'
73
74      !                 ! masked grid volume
75      DO jk = 1, jpk
76         cvol(:,:,jk) = e1t(:,:) * e2t(:,:) * fse3t(:,:,jk) * tmask(:,:,jk) * tmask_i(:,:)
77      END DO
78
79      ! total volume of the ocean
80#if ! defined key_off_degrad
81      areatot = SUM( cvol(:,:,:) )
82#else
83      areatot = SUM( cvol(:,:,:) * facvol(:,:,:) ) ! degrad option: reduction by facvol
84#endif
85      IF( lk_mpp )   CALL mpp_sum( areatot )     ! sum over the global domain 
86
87                                  CALL trc_lec      ! READ passive tracers namelists
88
89                                  CALL trc_ctl      ! control consistency between parameters, cpp key
90
91      IF( lk_lobster ) THEN   ;   CALL trc_ini_lobster      ! LOBSTER bio-model
92      ELSE                    ;   IF(lwp) WRITE(numout,*) '          LOBSTER not used'
93      ENDIF
94     
95      IF( lk_pisces  ) THEN   ;   CALL trc_ini_pisces       ! PISCES  bio-model
96      ELSE                    ;   IF(lwp) WRITE(numout,*) '          PISCES not used'
97      ENDIF
98     
99      IF( lk_cfc     ) THEN   ;   CALL trc_ini_cfc          ! CFC     tracers
100      ELSE                    ;   IF(lwp) WRITE(numout,*) '          CFC not used'
101      ENDIF
102
103      IF( lk_c14b    ) THEN   ;   CALL trc_ini_c14b         ! C14 bomb  tracer
104      ELSE                    ;   IF(lwp) WRITE(numout,*) '          C14 not used'
105      ENDIF
106     
107      IF( lk_my_trc  ) THEN   ;   CALL trc_ini_my_trc       ! MY_TRC  tracers
108      ELSE                    ;   IF(lwp) WRITE(numout,*) '          MY_TRC not used'
109      ENDIF
110
111      IF( .NOT. ln_rsttr ) THEN 
112#if defined key_off_tra
113         CALL day_init      ! calendar
114#endif
115# if defined key_dtatrc
116         ! Initialization of tracer from a file that may also be used for damping
117         CALL trc_dta( nittrc000 )
118         DO jn = 1, jptra
119            IF( lutini(jn) )   trn(:,:,:,jn) = trdta(:,:,:,jn) * tmask(:,:,:)   ! initialisation from file if required
120         END DO
121# endif
122         trb(:,:,:,:) = trn(:,:,:,:)
123      ELSE
124         !
125         CALL trc_rst_read      ! restart from a file
126         !
127      ENDIF
128
129      tra(:,:,:,:) = 0.
130     
131      IF( ln_zps .AND. .NOT. lk_trc_c1d )   &              ! Partial steps: before horizontal gradient of passive
132      &                     CALL zps_hde_trc( nittrc000, trb, gtru, gtrv )       ! tracers at the bottom ocean level
133
134
135      !                 ! Computation content of all tracers
136      trai = 0.e0
137      DO jn = 1, jptra
138#if ! defined key_off_degrad
139         trai = trai + SUM( trn(:,:,:,jn) * cvol(:,:,:) )
140#else
141         trai = trai + SUM( trn(:,:,:,jn) * cvol(:,:,:) * facvol(:,:,:) ) ! degrad option: reduction by facvol
142#endif
143      END DO     
144      IF( lk_mpp )   CALL mpp_sum( trai )     ! sum over the global domain 
145
146
147      !                 ! control print
148      IF(lwp) WRITE(numout,*)
149      IF(lwp) WRITE(numout,*)
150      IF(lwp) WRITE(numout,*) '          *** Total number of passive tracer jptra = ', jptra
151      IF(lwp) WRITE(numout,*) '          *** Total volume of ocean                = ', areatot
152      IF(lwp) WRITE(numout,*) '          *** Total inital content of all tracers  = ', trai
153      IF(lwp) WRITE(numout,*)
154
155      IF( ln_ctl )   CALL prt_ctl_trc_init      ! control print
156      !
157
158      IF(ln_ctl) THEN      ! print mean trends (used for debugging)
159         WRITE(charout, FMT="('ini ')")
160         CALL prt_ctl_trc_info( charout )
161         CALL prt_ctl_trc( tab4d=trn, mask=tmask, clinfo=ctrcnm )
162      ENDIF
163
164   END SUBROUTINE trc_ini
165
166#else
167   !!----------------------------------------------------------------------
168   !!  Empty module :                                     No passive tracer
169   !!----------------------------------------------------------------------
170CONTAINS
171   SUBROUTINE trc_ini                      ! Dummy routine   
172   END SUBROUTINE trc_ini
173#endif
174
175   !!======================================================================
176END MODULE trcini
Note: See TracBrowser for help on using the repository browser.