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

Last change on this file since 2793 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
RevLine 
[259]1MODULE initrc
[763]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
[772]9   !!             2.0  !  2005-10 (C. Ethe, G. Madec) revised architecture
[763]10   !!----------------------------------------------------------------------
[772]11#if defined key_top
[763]12   !!----------------------------------------------------------------------
[772]13   !!   'key_top'                                                TOP models
[763]14   !!----------------------------------------------------------------------
15   !!   ini_trc    :  initialisation of passive tracers
16   !!----------------------------------------------------------------------
[335]17   USE oce_trc
18   USE trc
19   USE trcrst
20   USE trcctl
21   USE trclec
22   USE trcdtr
23   USE trcini
[345]24   USE prtctl_trc      ! Print control passive tracers (prt_ctl_trc_init routine)
[335]25   
26   IMPLICIT NONE
27   PRIVATE
28   
[763]29   PUBLIC   ini_trc   ! called by ???
[617]30
31    !! * Substitutions
32#  include "domzgr_substitute.h90"
[763]33   !!----------------------------------------------------------------------
34   !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005)
[772]35   !! $Id$
[763]36   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
37   !!----------------------------------------------------------------------
[617]38 
[259]39CONTAINS
[335]40   
41   SUBROUTINE ini_trc
42      !!---------------------------------------------------------------------
[763]43      !!                     ***  ROUTINE ini_trc  ***
[335]44      !!
[763]45      !! ** Purpose :   Initialization of the passive tracer fields
[335]46      !!
[763]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
[335]52      !!---------------------------------------------------------------------
[773]53      INTEGER ::   jk, jn    ! dummy loop indices
[763]54      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zbt   ! workspace: masked grid volume
[847]55      CHARACTER (len=25) :: charout
56
[335]57      !!---------------------------------------------------------------------
[259]58
[763]59      IF(lwp) WRITE(numout,*)
60      IF(lwp) WRITE(numout,*) 'ini_trc : initial set up of the passive tracers'
61      IF(lwp) WRITE(numout,*) '~~~~~~~'
[259]62
[763]63      !                 ! masked grid volume
[617]64      DO jk = 1, jpk
[763]65         zbt(:,:,jk) = e1t(:,:) * e2t(:,:) * fse3t(:,:,jk) * tmask(:,:,jk) * tmask_i(:,:)
66      END DO
[617]67#if defined key_off_degrad
[847]68      DO jk = 1, jpk
69         zbt(:,:,:) = zbt(:,:,:) * facvol(:,:,jk)      ! degrad option: reduction by facvol
70      ENDDO
[617]71#endif
72
[763]73      !                 ! total volume of the ocean
74      areatot = SUM( zbt(:,:,:) )
75      IF( lk_mpp )   CALL mpp_sum( areatot )     ! sum over the global domain 
[617]76
[763]77      CALL trc_lec      ! READ passive tracers namelists
[617]78
[763]79      CALL trc_ctl      ! control consistency between parameters, cpp key and namelists
[259]80
[763]81      CALL trc_ini      ! computes some initializations
[259]82
[763]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
[259]86      ENDIF
87
[763]88      !                 ! Computation content of all tracers
89      trai = 0.e0
[617]90      DO jn = 1, jptra
[763]91         trai = trai + SUM( trn(:,:,:,jn) * zbt(:,:,:) )
92      END DO     
93      IF( lk_mpp )   CALL mpp_sum( trai )     ! sum over the global domain 
[617]94
95
[763]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,*)
[617]101
[763]102      IF( ln_ctl )   CALL prt_ctl_trc_init      ! control print
103      !
[847]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
[335]111   END SUBROUTINE ini_trc
[259]112
113#else
[763]114   !!----------------------------------------------------------------------
115   !!  Empty module :                                     No passive tracer
116   !!----------------------------------------------------------------------
[335]117CONTAINS
[763]118   SUBROUTINE ini_trc                      ! Dummy routine   
[335]119   END SUBROUTINE ini_trc
[259]120#endif
121
[763]122   !!======================================================================
[259]123END MODULE initrc 
Note: See TracBrowser for help on using the repository browser.