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 tags/nemo_v3_2/nemo_v3_2/NEMO/TOP_SRC – NEMO

source: tags/nemo_v3_2/nemo_v3_2/NEMO/TOP_SRC/trcini.F90 @ 1878

Last change on this file since 1878 was 1878, checked in by flavoni, 14 years ago

initial test for nemogcm

File size: 6.9 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 trp_trc
21   USE trcrst
22   USE trcctl
23   USE trclec
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
29   USE trcdta   
30#if defined key_off_tra 
31   USE daymod
32#endif
33   USE zpshde_trc      ! partial step: hor. derivative
34   USE in_out_manager  ! I/O manager
35   USE prtctl_trc      ! Print control passive tracers (prt_ctl_trc_init routine)
36   USE lib_mpp         ! distributed memory computing library
37   
38   IMPLICIT NONE
39   PRIVATE
40   
41   PUBLIC   trc_ini   ! called by opa
42
43    !! * Substitutions
44#  include "domzgr_substitute.h90"
45   !!----------------------------------------------------------------------
46   !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005)
47   !! $Id: trcini.F90 1745 2009-11-23 10:19:06Z cetlod $
48   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
49   !!----------------------------------------------------------------------
50 
51CONTAINS
52   
53   SUBROUTINE trc_ini
54      !!---------------------------------------------------------------------
55      !!                     ***  ROUTINE trc_ini  ***
56      !!
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
70      IF(lwp) WRITE(numout,*)
71      IF(lwp) WRITE(numout,*) 'trc_ini : initial set up of the passive tracers'
72      IF(lwp) WRITE(numout,*) '~~~~~~~'
73
74      !                 ! masked grid volume
75      DO jk = 1, jpk
76         cvol(:,:,jk) = e1t(:,:) * e2t(:,:) * fse3t(:,:,jk) * tmask(:,:,jk) * tmask_i(:,:)
77      END DO
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
84#endif
85      IF( lk_mpp )   CALL mpp_sum( areatot )     ! sum over the global domain 
86
87                                  CALL trc_lec      ! READ passive tracers namelists
88
89                                  CALL trc_ctl      ! control consistency between parameters, cpp key
90
91      IF( lk_lobster ) THEN   ;   CALL trc_ini_lobster      ! LOBSTER bio-model
92      ELSE                    ;   IF(lwp) WRITE(numout,*) '          LOBSTER not used'
93      ENDIF
94     
95      IF( lk_pisces  ) THEN   ;   CALL trc_ini_pisces       ! PISCES  bio-model
96      ELSE                    ;   IF(lwp) WRITE(numout,*) '          PISCES not used'
97      ENDIF
98     
99      IF( lk_cfc     ) THEN   ;   CALL trc_ini_cfc          ! CFC     tracers
100      ELSE                    ;   IF(lwp) WRITE(numout,*) '          CFC not used'
101      ENDIF
102
103      IF( lk_c14b    ) THEN   ;   CALL trc_ini_c14b         ! C14 bomb  tracer
104      ELSE                    ;   IF(lwp) WRITE(numout,*) '          C14 not used'
105      ENDIF
106     
107      IF( lk_my_trc  ) THEN   ;   CALL trc_ini_my_trc       ! MY_TRC  tracers
108      ELSE                    ;   IF(lwp) WRITE(numout,*) '          MY_TRC not used'
109      ENDIF
110
111      IF( .NOT. ln_rsttr ) THEN 
112#if defined key_off_tra
113         CALL day_init      ! calendar
114#endif
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
124         CALL trc_rst_read      ! restart from a file
125#if defined key_off_tra
126         CALL day_init          ! calendar
127#endif
128      ENDIF
129
130      tra(:,:,:,:) = 0.
131     
132      IF( ln_zps .AND. .NOT. lk_trc_c1d )   &              ! Partial steps: before horizontal gradient of passive
133      &                     CALL zps_hde_trc( nittrc000, trb, gtru, gtrv )       ! tracers at the bottom ocean level
134
135
136      !                 ! Computation content of all tracers
137      trai = 0.e0
138      DO jn = 1, jptra
139#if ! defined key_off_degrad
140         trai = trai + SUM( trn(:,:,:,jn) * cvol(:,:,:) )
141#else
142         trai = trai + SUM( trn(:,:,:,jn) * cvol(:,:,:) * facvol(:,:,:) ) ! degrad option: reduction by facvol
143#endif
144      END DO     
145      IF( lk_mpp )   CALL mpp_sum( trai )     ! sum over the global domain 
146
147
148      !                 ! control print
149      IF(lwp) WRITE(numout,*)
150      IF(lwp) WRITE(numout,*)
151      IF(lwp) WRITE(numout,*) '          *** Total number of passive tracer jptra = ', jptra
152      IF(lwp) WRITE(numout,*) '          *** Total volume of ocean                = ', areatot
153      IF(lwp) WRITE(numout,*) '          *** Total inital content of all tracers  = ', trai
154      IF(lwp) WRITE(numout,*)
155
156      IF( ln_ctl )   CALL prt_ctl_trc_init      ! control print
157      !
158
159      IF(ln_ctl) THEN      ! print mean trends (used for debugging)
160         WRITE(charout, FMT="('ini ')")
161         CALL prt_ctl_trc_info( charout )
162         CALL prt_ctl_trc( tab4d=trn, mask=tmask, clinfo=ctrcnm )
163      ENDIF
164
165   END SUBROUTINE trc_ini
166
167#else
168   !!----------------------------------------------------------------------
169   !!  Empty module :                                     No passive tracer
170   !!----------------------------------------------------------------------
171CONTAINS
172   SUBROUTINE trc_ini                      ! Dummy routine   
173   END SUBROUTINE trc_ini
174#endif
175
176   !!======================================================================
177END MODULE trcini
Note: See TracBrowser for help on using the repository browser.