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

Last change on this file since 1077 was 1077, checked in by cetlod, 16 years ago

update modules, see ticket:190

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