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

source: branches/DEV_r2006_merge_TRA_TRC/NEMO/TOP_SRC/trcini.F90 @ 2038

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

Apply the merge to passive tracers, see ticket:693

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