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 @ 1284

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

update parameter files to take into account the new C14 bomb tracer model, see ticket:298

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 6.4 KB
RevLine 
[268]1MODULE trcini
[945]2   !!======================================================================
3   !!                         ***  MODULE trcini  ***
4   !! TOP :   Manage the passive tracer initialization
5   !!======================================================================
[1011]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
[274]10   !!----------------------------------------------------------------------
[1011]11#if defined key_top
12   !!----------------------------------------------------------------------
13   !!   'key_top'                                                TOP models
14   !!----------------------------------------------------------------------
15   !!----------------------------------------------------------------------
[945]16   !!   trc_ini :   Initialization for passive tracer
[335]17   !!----------------------------------------------------------------------
[1011]18   USE oce_trc
19   USE trc
20   USE trcrst
21   USE trcctl
22   USE trclec
[1254]23   USE trcini_cfc      ! CFC      initialisation
24   USE trcini_lobster  ! LOBSTER  initialisation
25   USE trcini_pisces   ! PISCES   initialisation
26   USE trcini_c14b     ! C14 bomb initialisation
27   USE trcini_my_trc   ! MY_TRC   initialisation
[1011]28   USE trcdta          !
[1177]29   USE trdmld_trc_oce
30   USE trdmld_trc
31
[945]32   USE in_out_manager  ! I/O manager
[1011]33   USE prtctl_trc      ! Print control passive tracers (prt_ctl_trc_init routine)
34   USE lib_mpp         ! distributed memory computing library
35   
[335]36   IMPLICIT NONE
37   PRIVATE
[1011]38   
39   PUBLIC   trc_ini   ! called by opa
[268]40
[1011]41    !! * Substitutions
42#  include "domzgr_substitute.h90"
[335]43   !!----------------------------------------------------------------------
[1011]44   !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005)
45   !! $Id$
[945]46   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
[335]47   !!----------------------------------------------------------------------
[1011]48 
[335]49CONTAINS
[1011]50   
[335]51   SUBROUTINE trc_ini
[1011]52      !!---------------------------------------------------------------------
53      !!                     ***  ROUTINE trc_ini  ***
[335]54      !!
[1011]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
[945]68      IF(lwp) WRITE(numout,*)
[1011]69      IF(lwp) WRITE(numout,*) 'trc_ini : initial set up of the passive tracers'
[945]70      IF(lwp) WRITE(numout,*) '~~~~~~~'
[1011]71
72      !                 ! masked grid volume
73      DO jk = 1, jpk
[1254]74         cvol(:,:,jk) = e1t(:,:) * e2t(:,:) * fse3t(:,:,jk) * tmask(:,:,jk) * tmask_i(:,:)
[1011]75      END DO
[1254]76
77      ! total volume of the ocean
78#if ! defined key_off_degrad
79      areatot = SUM( cvol(:,:,:) )
80#else
81      areatot = SUM( cvol(:,:,:) * facvol(:,:,:) ) ! degrad option: reduction by facvol
[1011]82#endif
83      IF( lk_mpp )   CALL mpp_sum( areatot )     ! sum over the global domain 
84
[1077]85                                  CALL trc_lec      ! READ passive tracers namelists
[1011]86
[1077]87                                  CALL trc_ctl      ! control consistency between parameters, cpp key
[1011]88
[945]89      IF( lk_lobster ) THEN   ;   CALL trc_ini_lobster      ! LOBSTER bio-model
90      ELSE                    ;   IF(lwp) WRITE(numout,*) '          LOBSTER not used'
91      ENDIF
[1011]92     
[945]93      IF( lk_pisces  ) THEN   ;   CALL trc_ini_pisces       ! PISCES  bio-model
94      ELSE                    ;   IF(lwp) WRITE(numout,*) '          PISCES not used'
95      ENDIF
[1011]96     
[945]97      IF( lk_cfc     ) THEN   ;   CALL trc_ini_cfc          ! CFC     tracers
98      ELSE                    ;   IF(lwp) WRITE(numout,*) '          CFC not used'
99      ENDIF
[1254]100
101      IF( lk_c14b    ) THEN   ;   CALL trc_ini_c14b         ! C14 bomb  tracer
102      ELSE                    ;   IF(lwp) WRITE(numout,*) '          C14 not used'
103      ENDIF
[1011]104     
[945]105      IF( lk_my_trc  ) THEN   ;   CALL trc_ini_my_trc       ! MY_TRC  tracers
106      ELSE                    ;   IF(lwp) WRITE(numout,*) '          MY_TRC not used'
[268]107      ENDIF
[1011]108
109      IF( .NOT. lrsttr ) THEN 
110           
111# if defined key_dtatrc
112         ! Initialization of tracer from a file that may also be used for damping
113         CALL trc_dta( nittrc000 )
114         DO jn = 1, jptra
115            IF( lutini(jn) )   trn(:,:,:,jn) = trdta(:,:,:,jn) * tmask(:,:,:)   ! initialisation from file if required
116         END DO
117# endif
118         trb(:,:,:,:) = trn(:,:,:,:)
119
120      ELSE
121
122         CALL trc_rst_read      ! restart from a file
123
124      ENDIF
125
[1177]126      IF( lk_trdmld_trc  )  CALL trd_mld_trc_init     ! trends: Mixed-layer
127
[1011]128      !                 ! Computation content of all tracers
129      trai = 0.e0
130      DO jn = 1, jptra
[1254]131#if ! defined key_off_degrad
132         trai = trai + SUM( trn(:,:,:,jn) * cvol(:,:,:) )
133#else
134         trai = trai + SUM( trn(:,:,:,jn) * cvol(:,:,:) * facvol(:,:,:) ) ! degrad option: reduction by facvol
135#endif
[1011]136      END DO     
137      IF( lk_mpp )   CALL mpp_sum( trai )     ! sum over the global domain 
138
139
140      !                 ! control print
141      IF(lwp) WRITE(numout,*) '          *** Total number of passive tracer jptra = ', jptra
142      IF(lwp) WRITE(numout,*) '          *** Total volume of ocean                = ', areatot
143      IF(lwp) WRITE(numout,*) '          *** Total inital content of all tracers  = ', trai
144      IF(lwp) WRITE(numout,*)
145
146      IF( ln_ctl )   CALL prt_ctl_trc_init      ! control print
[945]147      !
[1011]148
149      IF(ln_ctl) THEN      ! print mean trends (used for debugging)
150         WRITE(charout, FMT="('ini ')")
151         CALL prt_ctl_trc_info( charout )
152         CALL prt_ctl_trc( tab4d=trn, mask=tmask, clinfo=ctrcnm )
153      ENDIF
154
[335]155   END SUBROUTINE trc_ini
[268]156
[1011]157#else
158   !!----------------------------------------------------------------------
159   !!  Empty module :                                     No passive tracer
160   !!----------------------------------------------------------------------
161CONTAINS
162   SUBROUTINE trc_ini                      ! Dummy routine   
163   END SUBROUTINE trc_ini
164#endif
165
[335]166   !!======================================================================
[268]167END MODULE trcini
Note: See TracBrowser for help on using the repository browser.