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.
initrc.F90 in trunk/NEMO/TOP_SRC – NEMO

source: trunk/NEMO/TOP_SRC/initrc.F90 @ 719

Last change on this file since 719 was 719, checked in by ctlod, 17 years ago

get back to the nemo_v2_3 version for trunk

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.8 KB
Line 
1MODULE initrc
2   !!================================================
3   !!
4   !!                       *** MODULE initrc ***
5   !! Initialisation the tracer model
6   !!================================================
7                                                                                                                           
8#if defined key_passivetrc
9
10   !!-------------------------------------------------------
11   !!  TOP 1.0,  LOCEAN-IPSL (2005)
12   !! $Header$
13   !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt
14   !!-------------------------------------------------------
15
16   !!--------------------------------------------------------------
17   !! * Modules used
18   !! ==============
19   USE oce_trc
20   USE trc
21   USE trcrst
22   USE trcctl
23   USE trclec
24   USE trcdtr
25   USE trcini
26   USE prtctl_trc      ! Print control passive tracers (prt_ctl_trc_init routine)
27   
28   IMPLICIT NONE
29   PRIVATE
30   
31   
32   !! * Accessibility
33   PUBLIC ini_trc
34
35    !! * Substitutions
36#  include "domzgr_substitute.h90"
37 
38CONTAINS
39   
40   SUBROUTINE ini_trc
41      !!---------------------------------------------------------------------
42      !!
43      !!                       ROUTINE ini_trc
44      !!                     ******************
45      !!
46      !!  PURPOSE :
47      !!  ---------
48      !!     initialize the tracer model
49      !!
50      !!   METHOD :
51      !!   -------
52      !!
53      !!
54      !!   History:
55      !!   -------
56      !!      original  : 91-03 ()
57      !!      additions : 92-01 (C. Levy)
58      !!                  05-03 (O. Aumont and A. El Moussaoui) F90
59      !!                  05-10 (C. Ethe ) print control initialization
60      !!----------------------------------------------------------------------
61
62      !!---------------------------------------------------------------------
63      !!  OPA.9, 03-2005
64      !!---------------------------------------------------------------------
65      INTEGER :: ji, jj, jk, jn    !: dummy loop indices
66
67      !! 0.b PRINT the number of tracer
68      !! ------------------------------
69
70      IF(lwp) WRITE(numout,*) ' '
71      IF(lwp) WRITE(numout,*) ' *** number of passive tracer jptra = ',jptra
72      IF(lwp) WRITE(numout,*) ' '
73
74      ! 1. READ passive tracers namelists
75      ! ---------------------------------
76
77      CALL trc_lec
78
79      ! 2. control consistency between parameters, cpp key and namelists
80      ! ----------------------------------------------------------------
81
82      CALL trc_ctl
83
84      ! 3. computes some initializations
85      ! --------------------------------
86
87      CALL trc_ini
88
89 
90      ! 4. total volume of the ocean
91      !-----------------------------
92
93      areatot = 0.
94      DO jk = 1, jpk
95         DO jj = 1, jpj
96            DO ji = 1, jpi
97               areatot = areatot + tmask(ji,jj,jk) * tmask_i(ji,jj)  &
98#if defined key_off_degrad
99                  &                * facvol(ji,jj,jk)    &
100#endif
101                  &                * e1t(ji,jj) * e2t(ji,jj) * fse3t(ji,jj,jk) 
102            END DO
103         END DO
104      END DO
105      IF( lk_mpp ) THEN
106         CALL mpp_sum(areatot)     ! sum over the global domain 
107      END IF
108
109      IF(lwp) WRITE(numout,*) ' '
110      IF (lwp) WRITE(numout,*) 'Total volume of ocean =',areatot
111      IF(lwp) WRITE(numout,*) ' '
112
113      ! 5. Initialization of tracers
114      ! -----------------------------
115
116      IF( lrsttr ) THEN
117
118         ! 5.1 restart from a file
119         !------------------------
120         CALL trc_rst_read
121
122      ELSE
123
124         !  5.2 analytical formulation or global data
125         !-------------------------------------
126         CALL trc_dtr
127
128      ENDIF
129
130
131      ! 6. Computation integral of all tracers
132      !------------------
133
134      trai = 0.
135      DO jn = 1, jptra
136         DO jk = 1, jpk
137            DO jj = 1, jpj
138               DO ji = 1, jpi
139                  trai = trai + trn(ji,jj,jk,jn) * tmask(ji,jj,jk) * tmask_i(ji,jj)    &
140#if defined key_off_degrad
141                     &              * facvol(ji,jj,jk)   &
142#endif
143
144                     &              * e1t(ji,jj) * e2t(ji,jj) * fse3t(ji,jj,jk)
145               END DO
146            END DO
147         END DO
148      ENDDO
149     
150      IF( lk_mpp ) THEN
151         CALL mpp_sum(trai)         ! sum over the global domain 
152      END IF
153
154      IF(lwp) WRITE(numout,*) ' '     
155      IF(lwp) WRITE(numout,*) 'Integral of all tracers over the full domain at initial time =',trai
156      IF(lwp) WRITE(numout,*) ' '
157
158      ! 6. Print control
159      !------------------
160
161      IF( ln_ctl )    CALL prt_ctl_trc_init
162
163   END SUBROUTINE ini_trc
164
165
166#else
167   !!======================================================================
168   !!  Empty module : No passive tracer
169   !!======================================================================
170CONTAINS
171   SUBROUTINE ini_trc     
172   END SUBROUTINE ini_trc
173#endif
174
175END MODULE initrc 
Note: See TracBrowser for help on using the repository browser.