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

source: branches/nemo_v3_3_beta/NEMOGCM/NEMO/TOP_SRC/trcini.F90 @ 2392

Last change on this file since 2392 was 2287, checked in by smasson, 14 years ago

update licence of all NEMO files...

  • Property svn:keywords set to Id
File size: 7.3 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   !!----------------------------------------------------------------------
[2087]16   !!   trc_init :   Initialization for passive tracer
[335]17   !!----------------------------------------------------------------------
[1011]18   USE oce_trc
19   USE trc
20   USE trcrst
[2038]21   USE trcnam          ! Namelist read
[1254]22   USE trcini_cfc      ! CFC      initialisation
23   USE trcini_lobster  ! LOBSTER  initialisation
24   USE trcini_pisces   ! PISCES   initialisation
25   USE trcini_c14b     ! C14 bomb initialisation
26   USE trcini_my_trc   ! MY_TRC   initialisation
[1457]27   USE trcdta   
[2038]28#if defined key_offline
[1457]29   USE daymod
30#endif
[2082]31   USE zpshde          ! partial step: hor. derivative   (zps_hde routine)
[945]32   USE in_out_manager  ! I/O manager
[1011]33   USE prtctl_trc      ! Print control passive tracers (prt_ctl_trc_init routine)
34   USE lib_mpp         ! distributed memory computing library
35   
[335]36   IMPLICIT NONE
37   PRIVATE
[1011]38   
[2087]39   PUBLIC   trc_init   ! called by opa
[268]40
[1011]41    !! * Substitutions
42#  include "domzgr_substitute.h90"
43 
[335]44CONTAINS
[1011]45   
[2082]46   SUBROUTINE trc_init
[1011]47      !!---------------------------------------------------------------------
[2082]48      !!                     ***  ROUTINE trc_init  ***
[335]49      !!
[1011]50      !! ** Purpose :   Initialization of the passive tracer fields
51      !!
52      !! ** Method  : - read namelist
53      !!              - control the consistancy
54      !!              - compute specific initialisations
55      !!              - set initial tracer fields (either read restart
56      !!                or read data or analytical formulation
57      !!---------------------------------------------------------------------
58      INTEGER ::   jk, jn    ! dummy loop indices
59      CHARACTER (len=25) :: charout
60
61      !!---------------------------------------------------------------------
62
[945]63      IF(lwp) WRITE(numout,*)
[2082]64      IF(lwp) WRITE(numout,*) 'trc_init : initial set up of the passive tracers'
[945]65      IF(lwp) WRITE(numout,*) '~~~~~~~'
[1011]66
67      !                 ! masked grid volume
68      DO jk = 1, jpk
[1254]69         cvol(:,:,jk) = e1t(:,:) * e2t(:,:) * fse3t(:,:,jk) * tmask(:,:,jk) * tmask_i(:,:)
[1011]70      END DO
[1254]71
72      ! total volume of the ocean
[2038]73#if ! defined key_degrad
[1254]74      areatot = SUM( cvol(:,:,:) )
75#else
[2038]76      areatot = SUM( cvol(:,:,:) * facvol(:,:,:) )  ! degrad option: reduction by facvol
[1011]77#endif
[2038]78      IF( lk_mpp )   CALL mpp_sum( areatot )        ! sum over the global domain 
[1011]79
[2038]80                                  CALL trc_nam      ! read passive tracers namelists
[1011]81
[2038]82      ! restart for passive tracer (input)
83      IF( ln_rsttr ) THEN
84         IF(lwp) WRITE(numout,*) '       read a restart file for passive tracer : ', cn_trcrst_in
85         IF(lwp) WRITE(numout,*) ' '
86      ELSE
87         IF(lwp) WRITE(numout,*)
88         DO jn = 1, jptra
89            IF( lwp .AND. lutini(jn) )  &                  ! open input FILE only IF lutini(jn) is true
90            &  WRITE(numout,*) '        read an initial file  for passive tracer number :', jn, ' traceur : ', ctrcnm(jn) 
91         END DO
92      ENDIF
[1011]93
[2217]94      IF( ln_dm2dc .AND. ( lk_pisces .OR. lk_lobster ) )    &
95      &       CALL ctl_stop( ' The diurnal cycle is not compatible with PISCES or LOBSTER  ' )
96
[945]97      IF( lk_lobster ) THEN   ;   CALL trc_ini_lobster      ! LOBSTER bio-model
98      ELSE                    ;   IF(lwp) WRITE(numout,*) '          LOBSTER not used'
99      ENDIF
[1011]100     
[945]101      IF( lk_pisces  ) THEN   ;   CALL trc_ini_pisces       ! PISCES  bio-model
102      ELSE                    ;   IF(lwp) WRITE(numout,*) '          PISCES not used'
103      ENDIF
[1011]104     
[945]105      IF( lk_cfc     ) THEN   ;   CALL trc_ini_cfc          ! CFC     tracers
106      ELSE                    ;   IF(lwp) WRITE(numout,*) '          CFC not used'
107      ENDIF
[1254]108
109      IF( lk_c14b    ) THEN   ;   CALL trc_ini_c14b         ! C14 bomb  tracer
110      ELSE                    ;   IF(lwp) WRITE(numout,*) '          C14 not used'
111      ENDIF
[1011]112     
[945]113      IF( lk_my_trc  ) THEN   ;   CALL trc_ini_my_trc       ! MY_TRC  tracers
114      ELSE                    ;   IF(lwp) WRITE(numout,*) '          MY_TRC not used'
[268]115      ENDIF
[1011]116
[1542]117      IF( .NOT. ln_rsttr ) THEN 
[2038]118#if defined key_offline
[1457]119         CALL day_init      ! calendar
120#endif
[1011]121# if defined key_dtatrc
122         ! Initialization of tracer from a file that may also be used for damping
[2104]123         CALL trc_dta( nit000 )
[1011]124         DO jn = 1, jptra
125            IF( lutini(jn) )   trn(:,:,:,jn) = trdta(:,:,:,jn) * tmask(:,:,:)   ! initialisation from file if required
126         END DO
127# endif
128         trb(:,:,:,:) = trn(:,:,:,:)
129      ELSE
[1970]130         !
[1011]131         CALL trc_rst_read      ! restart from a file
[1970]132         !
[1011]133      ENDIF
134
[1286]135      tra(:,:,:,:) = 0.
136     
137      IF( ln_zps .AND. .NOT. lk_trc_c1d )   &              ! Partial steps: before horizontal gradient of passive
[2192]138      &                     CALL zps_hde( nit000, jptra, trn, gtru, gtrv )       ! tracers at the bottom ocean level
[1177]139
[1286]140
[1011]141      !                 ! Computation content of all tracers
142      trai = 0.e0
143      DO jn = 1, jptra
[2038]144#if ! defined key_degrad
[1254]145         trai = trai + SUM( trn(:,:,:,jn) * cvol(:,:,:) )
146#else
147         trai = trai + SUM( trn(:,:,:,jn) * cvol(:,:,:) * facvol(:,:,:) ) ! degrad option: reduction by facvol
148#endif
[1011]149      END DO     
150      IF( lk_mpp )   CALL mpp_sum( trai )     ! sum over the global domain 
151
152
153      !                 ! control print
[1745]154      IF(lwp) WRITE(numout,*)
155      IF(lwp) WRITE(numout,*)
[1011]156      IF(lwp) WRITE(numout,*) '          *** Total number of passive tracer jptra = ', jptra
157      IF(lwp) WRITE(numout,*) '          *** Total volume of ocean                = ', areatot
158      IF(lwp) WRITE(numout,*) '          *** Total inital content of all tracers  = ', trai
159      IF(lwp) WRITE(numout,*)
160
161      IF( ln_ctl )   CALL prt_ctl_trc_init      ! control print
[945]162      !
[1011]163
164      IF(ln_ctl) THEN      ! print mean trends (used for debugging)
165         WRITE(charout, FMT="('ini ')")
166         CALL prt_ctl_trc_info( charout )
167         CALL prt_ctl_trc( tab4d=trn, mask=tmask, clinfo=ctrcnm )
168      ENDIF
169
[2082]170   END SUBROUTINE trc_init
[268]171
[1011]172#else
173   !!----------------------------------------------------------------------
174   !!  Empty module :                                     No passive tracer
175   !!----------------------------------------------------------------------
176CONTAINS
[2082]177   SUBROUTINE trc_init                      ! Dummy routine   
178   END SUBROUTINE trc_init
[1011]179#endif
180
[2104]181   !!----------------------------------------------------------------------
[2287]182   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
[2104]183   !! $Id$
[2287]184   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
[335]185   !!======================================================================
[268]186END MODULE trcini
Note: See TracBrowser for help on using the repository browser.