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

Last change on this file since 3381 was 2517, checked in by cetlod, 14 years ago

v3.3beta:Ensure restartability of ORCA2_OFF_PISCES & define lk_offline flag for OFFLINE mode

  • Property svn:keywords set to Id
File size: 7.6 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
[2457]35   USE lib_fortran     !
[1011]36   
[335]37   IMPLICIT NONE
38   PRIVATE
[1011]39   
[2087]40   PUBLIC   trc_init   ! called by opa
[268]41
[1011]42    !! * Substitutions
43#  include "domzgr_substitute.h90"
44 
[335]45CONTAINS
[1011]46   
[2082]47   SUBROUTINE trc_init
[1011]48      !!---------------------------------------------------------------------
[2082]49      !!                     ***  ROUTINE trc_init  ***
[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      CHARACTER (len=25) :: charout
61
62      !!---------------------------------------------------------------------
63
[945]64      IF(lwp) WRITE(numout,*)
[2082]65      IF(lwp) WRITE(numout,*) 'trc_init : initial set up of the passive tracers'
[945]66      IF(lwp) WRITE(numout,*) '~~~~~~~'
[1011]67
68      !                 ! masked grid volume
69      DO jk = 1, jpk
[2457]70         cvol(:,:,jk) = e1t(:,:) * e2t(:,:) * fse3t(:,:,jk) * tmask(:,:,jk) 
[1011]71      END DO
[1254]72
73      ! total volume of the ocean
[2038]74#if ! defined key_degrad
[2457]75      areatot = glob_sum( cvol(:,:,:) )
[1254]76#else
[2457]77      areatot = glob_sum( cvol(:,:,:) * facvol(:,:,:) )  ! degrad option: reduction by facvol
[1011]78#endif
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 ) )    &
[2402]95         &       CALL ctl_stop( ' The diurnal cycle is not compatible with PISCES or LOBSTER  ' )
[2217]96
[2402]97      IF( nn_cla == 1 )   &
98         &       CALL ctl_stop( ' Cross Land Advection not yet implemented with passive tracer ; nn_cla must be 0' )
99
[945]100      IF( lk_lobster ) THEN   ;   CALL trc_ini_lobster      ! LOBSTER bio-model
101      ELSE                    ;   IF(lwp) WRITE(numout,*) '          LOBSTER not used'
102      ENDIF
[1011]103     
[945]104      IF( lk_pisces  ) THEN   ;   CALL trc_ini_pisces       ! PISCES  bio-model
105      ELSE                    ;   IF(lwp) WRITE(numout,*) '          PISCES not used'
106      ENDIF
[1011]107     
[945]108      IF( lk_cfc     ) THEN   ;   CALL trc_ini_cfc          ! CFC     tracers
109      ELSE                    ;   IF(lwp) WRITE(numout,*) '          CFC not used'
110      ENDIF
[1254]111
112      IF( lk_c14b    ) THEN   ;   CALL trc_ini_c14b         ! C14 bomb  tracer
113      ELSE                    ;   IF(lwp) WRITE(numout,*) '          C14 not used'
114      ENDIF
[1011]115     
[945]116      IF( lk_my_trc  ) THEN   ;   CALL trc_ini_my_trc       ! MY_TRC  tracers
117      ELSE                    ;   IF(lwp) WRITE(numout,*) '          MY_TRC not used'
[268]118      ENDIF
[1011]119
[2517]120      IF( ln_rsttr ) THEN
121        !
122        IF( lk_offline )  neuler = 1   ! Set time-step indicator at nit000 (leap-frog)
123        CALL trc_rst_read              ! restart from a file
124        !
[1011]125      ELSE
[2517]126        IF( lk_offline )  THEN
127           neuler = 0                  ! Set time-step indicator at nit000 (euler)
128           CALL day_init               ! set calendar
129        ENDIF
130        IF( lk_dtatrc )  THEN
131           CALL trc_dta( nit000 )      ! Initialization of tracer from a file that may also be used for damping
132           DO jn = 1, jptra
133              IF( lutini(jn) )   trn(:,:,:,jn) = trdta(:,:,:,jn) * tmask(:,:,:)   ! initialisation from file if required
134           END DO
135        ENDIF
136        trb(:,:,:,:) = trn(:,:,:,:)
137        !
[1011]138      ENDIF
[2517]139 
[1286]140      tra(:,:,:,:) = 0.
141     
[2431]142      IF( ln_zps .AND. .NOT. lk_c1d )   &              ! Partial steps: before horizontal gradient of passive
[2192]143      &                     CALL zps_hde( nit000, jptra, trn, gtru, gtrv )       ! tracers at the bottom ocean level
[1177]144
[1286]145
[1011]146      !                 ! Computation content of all tracers
147      trai = 0.e0
148      DO jn = 1, jptra
[2038]149#if ! defined key_degrad
[2457]150         trai = trai + glob_sum( trn(:,:,:,jn) * cvol(:,:,:) )
[1254]151#else
[2457]152         trai = trai + glob_sum( trn(:,:,:,jn) * cvol(:,:,:) * facvol(:,:,:) ) ! degrad option: reduction by facvol
[1254]153#endif
[1011]154      END DO     
155
156      !                 ! control print
[1745]157      IF(lwp) WRITE(numout,*)
158      IF(lwp) WRITE(numout,*)
[1011]159      IF(lwp) WRITE(numout,*) '          *** Total number of passive tracer jptra = ', jptra
160      IF(lwp) WRITE(numout,*) '          *** Total volume of ocean                = ', areatot
161      IF(lwp) WRITE(numout,*) '          *** Total inital content of all tracers  = ', trai
162      IF(lwp) WRITE(numout,*)
163
164      IF( ln_ctl )   CALL prt_ctl_trc_init      ! control print
[945]165      !
[1011]166
167      IF(ln_ctl) THEN      ! print mean trends (used for debugging)
168         WRITE(charout, FMT="('ini ')")
169         CALL prt_ctl_trc_info( charout )
170         CALL prt_ctl_trc( tab4d=trn, mask=tmask, clinfo=ctrcnm )
171      ENDIF
172
[2082]173   END SUBROUTINE trc_init
[268]174
[1011]175#else
176   !!----------------------------------------------------------------------
177   !!  Empty module :                                     No passive tracer
178   !!----------------------------------------------------------------------
179CONTAINS
[2082]180   SUBROUTINE trc_init                      ! Dummy routine   
181   END SUBROUTINE trc_init
[1011]182#endif
183
[2104]184   !!----------------------------------------------------------------------
[2287]185   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
[2104]186   !! $Id$
[2287]187   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
[335]188   !!======================================================================
[268]189END MODULE trcini
Note: See TracBrowser for help on using the repository browser.