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
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
[1286]20   USE trp_trc
[1011]21   USE trcrst
22   USE trcctl
23   USE trclec
[1254]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
[1286]29   USE trcdta   
30   USE zpshde_trc      ! partial step: hor. derivative
[945]31   USE in_out_manager  ! I/O manager
[1011]32   USE prtctl_trc      ! Print control passive tracers (prt_ctl_trc_init routine)
33   USE lib_mpp         ! distributed memory computing library
34   
[335]35   IMPLICIT NONE
36   PRIVATE
[1011]37   
38   PUBLIC   trc_ini   ! called by opa
[268]39
[1011]40    !! * Substitutions
41#  include "domzgr_substitute.h90"
[335]42   !!----------------------------------------------------------------------
[1011]43   !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005)
44   !! $Id$
[945]45   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
[335]46   !!----------------------------------------------------------------------
[1011]47 
[335]48CONTAINS
[1011]49   
[335]50   SUBROUTINE trc_ini
[1011]51      !!---------------------------------------------------------------------
52      !!                     ***  ROUTINE trc_ini  ***
[335]53      !!
[1011]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
[945]67      IF(lwp) WRITE(numout,*)
[1011]68      IF(lwp) WRITE(numout,*) 'trc_ini : initial set up of the passive tracers'
[945]69      IF(lwp) WRITE(numout,*) '~~~~~~~'
[1011]70
71      !                 ! masked grid volume
72      DO jk = 1, jpk
[1254]73         cvol(:,:,jk) = e1t(:,:) * e2t(:,:) * fse3t(:,:,jk) * tmask(:,:,jk) * tmask_i(:,:)
[1011]74      END DO
[1254]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
[1011]81#endif
82      IF( lk_mpp )   CALL mpp_sum( areatot )     ! sum over the global domain 
83
[1077]84                                  CALL trc_lec      ! READ passive tracers namelists
[1011]85
[1077]86                                  CALL trc_ctl      ! control consistency between parameters, cpp key
[1011]87
[945]88      IF( lk_lobster ) THEN   ;   CALL trc_ini_lobster      ! LOBSTER bio-model
89      ELSE                    ;   IF(lwp) WRITE(numout,*) '          LOBSTER not used'
90      ENDIF
[1011]91     
[945]92      IF( lk_pisces  ) THEN   ;   CALL trc_ini_pisces       ! PISCES  bio-model
93      ELSE                    ;   IF(lwp) WRITE(numout,*) '          PISCES not used'
94      ENDIF
[1011]95     
[945]96      IF( lk_cfc     ) THEN   ;   CALL trc_ini_cfc          ! CFC     tracers
97      ELSE                    ;   IF(lwp) WRITE(numout,*) '          CFC not used'
98      ENDIF
[1254]99
100      IF( lk_c14b    ) THEN   ;   CALL trc_ini_c14b         ! C14 bomb  tracer
101      ELSE                    ;   IF(lwp) WRITE(numout,*) '          C14 not used'
102      ENDIF
[1011]103     
[945]104      IF( lk_my_trc  ) THEN   ;   CALL trc_ini_my_trc       ! MY_TRC  tracers
105      ELSE                    ;   IF(lwp) WRITE(numout,*) '          MY_TRC not used'
[268]106      ENDIF
[1011]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
[1286]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
[1177]125
[1286]126
[1011]127      !                 ! Computation content of all tracers
128      trai = 0.e0
129      DO jn = 1, jptra
[1254]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
[1011]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
[945]146      !
[1011]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
[335]154   END SUBROUTINE trc_ini
[268]155
[1011]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
[335]165   !!======================================================================
[268]166END MODULE trcini
Note: See TracBrowser for help on using the repository browser.