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.
Changeset 1011 for trunk/NEMO/TOP_SRC/trcini.F90 – NEMO

Ignore:
Timestamp:
2008-05-30T11:57:12+02:00 (16 years ago)
Author:
cetlod
Message:

re-organization of TOP initialization and outputs phases see ticket 171

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/TOP_SRC/trcini.F90

    r945 r1011  
    44   !! TOP :   Manage the passive tracer initialization 
    55   !!====================================================================== 
    6    !! History :    -   !  2000-04  (O. Aumont, M.A. Foujols)  original code 
    7    !!             1.0  !  2005-03  (O. Aumont, A. El Moussaoui) F90 
    8    !!              -   !  2005-10  (C. Ethe) Module 
    9    !!             2.0  !  2007-12  (C. Ethe, G. Madec) re-writing 
     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   !!---------------------------------------------------------------------- 
    1015   !!---------------------------------------------------------------------- 
    1116   !!   trc_ini :   Initialization for passive tracer 
    1217   !!---------------------------------------------------------------------- 
    13    USE par_trc         ! TOP parameters 
     18   USE oce_trc 
     19   USE trc 
     20   USE trcrst 
     21   USE trcctl 
     22   USE trclec 
    1423   USE trcini_cfc      ! CFC     initialisation 
    1524   USE trcini_lobster  ! LOBSTER initialisation 
    1625   USE trcini_pisces   ! PISCES  initialisation 
    1726   USE trcini_my_trc   ! MY_TRC  initialisation 
     27   USE trcdta          !  
    1828   USE in_out_manager  ! I/O manager 
    19  
     29   USE prtctl_trc      ! Print control passive tracers (prt_ctl_trc_init routine) 
     30   USE lib_mpp         ! distributed memory computing library 
     31    
    2032   IMPLICIT NONE 
    2133   PRIVATE 
     34    
     35   PUBLIC   trc_ini   ! called by opa 
    2236 
    23    PUBLIC   trc_ini   ! called by ??? 
    24  
     37    !! * Substitutions 
     38#  include "domzgr_substitute.h90" 
    2539   !!---------------------------------------------------------------------- 
    26    !! NEMO/TOP 2.0 , LOCEAN-IPSL (2007)  
    27    !! $Header:$  
     40   !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005)  
     41   !! $Id$  
    2842   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    2943   !!---------------------------------------------------------------------- 
     44   
     45CONTAINS 
     46    
     47   SUBROUTINE trc_ini 
     48      !!--------------------------------------------------------------------- 
     49      !!                     ***  ROUTINE trc_ini  *** 
     50      !! 
     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 
    3062 
    31 CONTAINS 
     63      !!--------------------------------------------------------------------- 
    3264 
    33    SUBROUTINE trc_ini 
    34       !!------------------------------------------------------------------- 
    35       !!                    ***  ROUTINE trc_ini  *** 
    36       !!               
    37       !! ** Purpose :   Initialization of passive tracer to zero 
    38       !! 
    39       !! ** Method  :   call the initialisation of each defined tracer 
    40       !!             model (LOBSTER, PISCES, CFC, MY_TRC) 
    41       !!------------------------------------------------------------------- 
    42       ! 
    4365      IF(lwp) WRITE(numout,*) 
    44       IF(lwp) WRITE(numout,*) 'trc_ini : initial set up of the tracer models' 
     66      IF(lwp) WRITE(numout,*) 'trc_ini : initial set up of the passive tracers' 
    4567      IF(lwp) WRITE(numout,*) '~~~~~~~' 
    46       ! 
     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 
     83      CALL trc_lec      ! READ passive tracers namelists 
     84 
     85      CALL trc_ctl      ! control consistency between parameters, cpp key and namelists 
     86 
    4787      IF( lk_lobster ) THEN   ;   CALL trc_ini_lobster      ! LOBSTER bio-model 
    4888      ELSE                    ;   IF(lwp) WRITE(numout,*) '          LOBSTER not used' 
    4989      ENDIF 
    50  
     90       
    5191      IF( lk_pisces  ) THEN   ;   CALL trc_ini_pisces       ! PISCES  bio-model 
    5292      ELSE                    ;   IF(lwp) WRITE(numout,*) '          PISCES not used' 
    5393      ENDIF 
    54  
     94       
    5595      IF( lk_cfc     ) THEN   ;   CALL trc_ini_cfc          ! CFC     tracers 
    5696      ELSE                    ;   IF(lwp) WRITE(numout,*) '          CFC not used' 
    5797      ENDIF 
    58  
     98       
    5999      IF( lk_my_trc  ) THEN   ;   CALL trc_ini_my_trc       ! MY_TRC  tracers 
    60100      ELSE                    ;   IF(lwp) WRITE(numout,*) '          MY_TRC not used' 
    61101      ENDIF 
     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 
    62135      ! 
     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 
    63143   END SUBROUTINE trc_ini 
     144 
     145#else 
     146   !!---------------------------------------------------------------------- 
     147   !!  Empty module :                                     No passive tracer 
     148   !!---------------------------------------------------------------------- 
     149CONTAINS 
     150   SUBROUTINE trc_ini                      ! Dummy routine    
     151   END SUBROUTINE trc_ini 
     152#endif 
    64153 
    65154   !!====================================================================== 
Note: See TracChangeset for help on using the changeset viewer.