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

Last change on this file since 993 was 993, checked in by ctlod, 16 years ago

add a missing USE lib_mpp, see ticket: #157

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