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
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
[1457]29   USE trcdta   
30#if defined key_off_tra 
31   USE daymod
32#endif
[1286]33   USE zpshde_trc      ! partial step: hor. derivative
[945]34   USE in_out_manager  ! I/O manager
[1011]35   USE prtctl_trc      ! Print control passive tracers (prt_ctl_trc_init routine)
36   USE lib_mpp         ! distributed memory computing library
37   
[335]38   IMPLICIT NONE
39   PRIVATE
[1011]40   
41   PUBLIC   trc_ini   ! called by opa
[268]42
[1011]43    !! * Substitutions
44#  include "domzgr_substitute.h90"
[335]45   !!----------------------------------------------------------------------
[1011]46   !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005)
47   !! $Id$
[945]48   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
[335]49   !!----------------------------------------------------------------------
[1011]50 
[335]51CONTAINS
[1011]52   
[335]53   SUBROUTINE trc_ini
[1011]54      !!---------------------------------------------------------------------
55      !!                     ***  ROUTINE trc_ini  ***
[335]56      !!
[1011]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
[945]70      IF(lwp) WRITE(numout,*)
[1011]71      IF(lwp) WRITE(numout,*) 'trc_ini : initial set up of the passive tracers'
[945]72      IF(lwp) WRITE(numout,*) '~~~~~~~'
[1011]73
74      !                 ! masked grid volume
75      DO jk = 1, jpk
[1254]76         cvol(:,:,jk) = e1t(:,:) * e2t(:,:) * fse3t(:,:,jk) * tmask(:,:,jk) * tmask_i(:,:)
[1011]77      END DO
[1254]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
[1011]84#endif
85      IF( lk_mpp )   CALL mpp_sum( areatot )     ! sum over the global domain 
86
[1077]87                                  CALL trc_lec      ! READ passive tracers namelists
[1011]88
[1077]89                                  CALL trc_ctl      ! control consistency between parameters, cpp key
[1011]90
[945]91      IF( lk_lobster ) THEN   ;   CALL trc_ini_lobster      ! LOBSTER bio-model
92      ELSE                    ;   IF(lwp) WRITE(numout,*) '          LOBSTER not used'
93      ENDIF
[1011]94     
[945]95      IF( lk_pisces  ) THEN   ;   CALL trc_ini_pisces       ! PISCES  bio-model
96      ELSE                    ;   IF(lwp) WRITE(numout,*) '          PISCES not used'
97      ENDIF
[1011]98     
[945]99      IF( lk_cfc     ) THEN   ;   CALL trc_ini_cfc          ! CFC     tracers
100      ELSE                    ;   IF(lwp) WRITE(numout,*) '          CFC not used'
101      ENDIF
[1254]102
103      IF( lk_c14b    ) THEN   ;   CALL trc_ini_c14b         ! C14 bomb  tracer
104      ELSE                    ;   IF(lwp) WRITE(numout,*) '          C14 not used'
105      ENDIF
[1011]106     
[945]107      IF( lk_my_trc  ) THEN   ;   CALL trc_ini_my_trc       ! MY_TRC  tracers
108      ELSE                    ;   IF(lwp) WRITE(numout,*) '          MY_TRC not used'
[268]109      ENDIF
[1011]110
[1542]111      IF( .NOT. ln_rsttr ) THEN 
[1457]112#if defined key_off_tra
113         CALL day_init      ! calendar
114#endif
[1011]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
[1814]124         !
[1011]125         CALL trc_rst_read      ! restart from a file
[1814]126         !
[1011]127      ENDIF
128
[1286]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
[1177]133
[1286]134
[1011]135      !                 ! Computation content of all tracers
136      trai = 0.e0
137      DO jn = 1, jptra
[1254]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
[1011]143      END DO     
144      IF( lk_mpp )   CALL mpp_sum( trai )     ! sum over the global domain 
145
146
147      !                 ! control print
[1745]148      IF(lwp) WRITE(numout,*)
149      IF(lwp) WRITE(numout,*)
[1011]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
[945]156      !
[1011]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
[335]164   END SUBROUTINE trc_ini
[268]165
[1011]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
[335]175   !!======================================================================
[268]176END MODULE trcini
Note: See TracBrowser for help on using the repository browser.