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 trunk/NEMO/TOP_SRC – NEMO

source: trunk/NEMO/TOP_SRC/trcini.F90 @ 1286

Last change on this file since 1286 was 1286, checked in by cetlod, 15 years ago

computation of horizontal derivatives at the first time step, see ticket:315

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