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 branches/dev_001_GM/NEMO/TOP_SRC – NEMO

source: branches/dev_001_GM/NEMO/TOP_SRC/initrc.F90 @ 847

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

bug in computation of ocean volume in case of degrad option, see ticket:85

  • 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   !!                         ***  MODULE initrc  ***
4   !! TOP :   Initialisation of passive tracers
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   !!   ini_trc    :  initialisation of passive tracers
16   !!----------------------------------------------------------------------
17   USE oce_trc
18   USE trc
19   USE trcrst
20   USE trcctl
21   USE trclec
22   USE trcdtr
23   USE trcini
24   USE prtctl_trc      ! Print control passive tracers (prt_ctl_trc_init routine)
25   
26   IMPLICIT NONE
27   PRIVATE
28   
29   PUBLIC   ini_trc   ! called by ???
30
31    !! * Substitutions
32#  include "domzgr_substitute.h90"
33   !!----------------------------------------------------------------------
34   !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005)
35   !! $Id$
36   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
37   !!----------------------------------------------------------------------
38 
39CONTAINS
40   
41   SUBROUTINE ini_trc
42      !!---------------------------------------------------------------------
43      !!                     ***  ROUTINE ini_trc  ***
44      !!
45      !! ** Purpose :   Initialization of the passive tracer fields
46      !!
47      !! ** Method  : - read namelist
48      !!              - control the consistancy
49      !!              - compute specific initialisations
50      !!              - set initial tracer fields (either read restart
51      !!                or read data or analytical formulation
52      !!---------------------------------------------------------------------
53      INTEGER ::   jk, jn    ! dummy loop indices
54      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zbt   ! workspace: masked grid volume
55      CHARACTER (len=25) :: charout
56
57      !!---------------------------------------------------------------------
58
59      IF(lwp) WRITE(numout,*)
60      IF(lwp) WRITE(numout,*) 'ini_trc : initial set up of the passive tracers'
61      IF(lwp) WRITE(numout,*) '~~~~~~~'
62
63      !                 ! masked grid volume
64      DO jk = 1, jpk
65         zbt(:,:,jk) = e1t(:,:) * e2t(:,:) * fse3t(:,:,jk) * tmask(:,:,jk) * tmask_i(:,:)
66      END DO
67#if defined key_off_degrad
68      DO jk = 1, jpk
69         zbt(:,:,:) = zbt(:,:,:) * facvol(:,:,jk)      ! degrad option: reduction by facvol
70      ENDDO
71#endif
72
73      !                 ! total volume of the ocean
74      areatot = SUM( zbt(:,:,:) )
75      IF( lk_mpp )   CALL mpp_sum( areatot )     ! sum over the global domain 
76
77      CALL trc_lec      ! READ passive tracers namelists
78
79      CALL trc_ctl      ! control consistency between parameters, cpp key and namelists
80
81      CALL trc_ini      ! computes some initializations
82
83      !                 ! set initial tracer values
84      IF( lrsttr ) THEN   ;   CALL trc_rst_read      ! restart from a file
85      ELSE                ;   CALL trc_dtr           ! analytical formulation or from data
86      ENDIF
87
88      !                 ! Computation content of all tracers
89      trai = 0.e0
90      DO jn = 1, jptra
91         trai = trai + SUM( trn(:,:,:,jn) * zbt(:,:,:) )
92      END DO     
93      IF( lk_mpp )   CALL mpp_sum( trai )     ! sum over the global domain 
94
95
96      !                 ! control print
97      IF(lwp) WRITE(numout,*) '          *** Total number of passive tracer jptra = ', jptra
98      IF(lwp) WRITE(numout,*) '          *** Total volume of ocean                = ', areatot
99      IF(lwp) WRITE(numout,*) '          *** Total inital content of all tracers  = ', trai
100      IF(lwp) WRITE(numout,*)
101
102      IF( ln_ctl )   CALL prt_ctl_trc_init      ! control print
103      !
104
105      IF(ln_ctl) THEN      ! print mean trends (used for debugging)
106         WRITE(charout, FMT="('ini ')")
107         CALL prt_ctl_trc_info( charout )
108         CALL prt_ctl_trc( tab4d=trn, mask=tmask, clinfo=ctrcnm )
109      ENDIF
110
111   END SUBROUTINE ini_trc
112
113#else
114   !!----------------------------------------------------------------------
115   !!  Empty module :                                     No passive tracer
116   !!----------------------------------------------------------------------
117CONTAINS
118   SUBROUTINE ini_trc                      ! Dummy routine   
119   END SUBROUTINE ini_trc
120#endif
121
122   !!======================================================================
123END MODULE initrc 
Note: See TracBrowser for help on using the repository browser.