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

Last change on this file since 1174 was 1146, checked in by rblod, 16 years ago

Add svn Id (first try), see ticket #210

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 6.1 KB
RevLine 
[268]1MODULE trcini
[945]2   !!======================================================================
3   !!                         ***  MODULE trcini  ***
4   !! TOP :   Manage the passive tracer initialization
5   !!======================================================================
[1011]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
[274]10   !!----------------------------------------------------------------------
[1011]11#if defined key_top
12   !!----------------------------------------------------------------------
13   !!   'key_top'                                                TOP models
14   !!----------------------------------------------------------------------
15   !!----------------------------------------------------------------------
[945]16   !!   trc_ini :   Initialization for passive tracer
[335]17   !!----------------------------------------------------------------------
[1011]18   USE oce_trc
19   USE trc
20   USE trcrst
21   USE trcctl
22   USE trclec
[945]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
[1011]27   USE trcdta          !
[945]28   USE in_out_manager  ! I/O manager
[1011]29   USE prtctl_trc      ! Print control passive tracers (prt_ctl_trc_init routine)
30   USE lib_mpp         ! distributed memory computing library
31   
[335]32   IMPLICIT NONE
33   PRIVATE
[1011]34   
35   PUBLIC   trc_ini   ! called by opa
[268]36
[1011]37    !! * Substitutions
38#  include "domzgr_substitute.h90"
[335]39   !!----------------------------------------------------------------------
[1011]40   !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005)
41   !! $Id$
[945]42   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
[335]43   !!----------------------------------------------------------------------
[1011]44 
[335]45CONTAINS
[1011]46   
[335]47   SUBROUTINE trc_ini
[1011]48      !!---------------------------------------------------------------------
49      !!                     ***  ROUTINE trc_ini  ***
[335]50      !!
[1011]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
[945]65      IF(lwp) WRITE(numout,*)
[1011]66      IF(lwp) WRITE(numout,*) 'trc_ini : initial set up of the passive tracers'
[945]67      IF(lwp) WRITE(numout,*) '~~~~~~~'
[1011]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
[1077]83                                  CALL trc_lec      ! READ passive tracers namelists
[1011]84
[1077]85                                  CALL trc_ctl      ! control consistency between parameters, cpp key
[1011]86
[945]87      IF( lk_lobster ) THEN   ;   CALL trc_ini_lobster      ! LOBSTER bio-model
88      ELSE                    ;   IF(lwp) WRITE(numout,*) '          LOBSTER not used'
89      ENDIF
[1011]90     
[945]91      IF( lk_pisces  ) THEN   ;   CALL trc_ini_pisces       ! PISCES  bio-model
92      ELSE                    ;   IF(lwp) WRITE(numout,*) '          PISCES not used'
93      ENDIF
[1011]94     
[945]95      IF( lk_cfc     ) THEN   ;   CALL trc_ini_cfc          ! CFC     tracers
96      ELSE                    ;   IF(lwp) WRITE(numout,*) '          CFC not used'
97      ENDIF
[1011]98     
[945]99      IF( lk_my_trc  ) THEN   ;   CALL trc_ini_my_trc       ! MY_TRC  tracers
100      ELSE                    ;   IF(lwp) WRITE(numout,*) '          MY_TRC not used'
[268]101      ENDIF
[1011]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
[945]135      !
[1011]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
[335]143   END SUBROUTINE trc_ini
[268]144
[1011]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
[335]154   !!======================================================================
[268]155END MODULE trcini
Note: See TracBrowser for help on using the repository browser.