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 945 for trunk/NEMO/TOP_SRC/initrc.F90 – NEMO

Ignore:
Timestamp:
2008-05-14T18:14:53+02:00 (16 years ago)
Author:
cetlod
Message:

Update modules for new version of TOP model, see ticket 144

File:
1 edited

Legend:

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

    r793 r945  
    11MODULE initrc 
    2    !!================================================ 
    3    !! 
    4    !!                       *** MODULE initrc *** 
    5    !! Initialisation the tracer model 
    6    !!================================================ 
    7                                                                                                                              
    8 #if defined key_passivetrc 
    9  
    10    !!------------------------------------------------------- 
    11    !!  TOP 1.0,  LOCEAN-IPSL (2005)  
    12    !! $Header$  
    13    !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt  
    14    !!------------------------------------------------------- 
    15  
    16    !!-------------------------------------------------------------- 
    17    !! * Modules used 
    18    !! ============== 
     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 
     9   !!             2.0  !  2005-10 (C. Ethe, G. Madec) revised architecture 
     10   !!---------------------------------------------------------------------- 
     11#if defined key_top 
     12   !!---------------------------------------------------------------------- 
     13   !!   'key_top'                                                TOP models 
     14   !!---------------------------------------------------------------------- 
     15   !!   ini_trc    :  initialisation of passive tracers 
     16   !!---------------------------------------------------------------------- 
    1917   USE oce_trc 
    2018   USE trc 
     
    2523   USE trcini 
    2624   USE prtctl_trc      ! Print control passive tracers (prt_ctl_trc_init routine) 
    27    USE lib_mpp         ! distributed memory computing 
    2825    
    2926   IMPLICIT NONE 
    3027   PRIVATE 
    3128    
    32     
    33    !! * Accessibility 
    34    PUBLIC ini_trc 
     29   PUBLIC   ini_trc   ! called by ??? 
    3530 
    3631    !! * Substitutions 
    3732#  include "domzgr_substitute.h90" 
     33   !!---------------------------------------------------------------------- 
     34   !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005)  
     35   !! $Id$  
     36   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
     37   !!---------------------------------------------------------------------- 
    3838   
    3939CONTAINS 
     
    4141   SUBROUTINE ini_trc 
    4242      !!--------------------------------------------------------------------- 
     43      !!                     ***  ROUTINE ini_trc  *** 
    4344      !! 
    44       !!                       ROUTINE ini_trc 
    45       !!                     ****************** 
     45      !! ** Purpose :   Initialization of the passive tracer fields  
    4646      !! 
    47       !!  PURPOSE : 
    48       !!  --------- 
    49       !!     initialize the tracer model 
    50       !! 
    51       !!   METHOD : 
    52       !!   ------- 
    53       !! 
    54       !! 
    55       !!   History: 
    56       !!   ------- 
    57       !!      original  : 91-03 () 
    58       !!      additions : 92-01 (C. Levy) 
    59       !!                  05-03 (O. Aumont and A. El Moussaoui) F90 
    60       !!                  05-10 (C. Ethe ) print control initialization  
    61       !!---------------------------------------------------------------------- 
     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 
     52      !!--------------------------------------------------------------------- 
     53      INTEGER ::   jk, jn    ! dummy loop indices 
     54      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zbt   ! workspace: masked grid volume 
     55      CHARACTER (len=25) :: charout 
    6256 
    6357      !!--------------------------------------------------------------------- 
    64       !!  OPA.9, 03-2005 
    65       !!--------------------------------------------------------------------- 
    66       INTEGER :: ji, jj, jk, jn    !: dummy loop indices 
    6758 
    68       !! 0.b PRINT the number of tracer 
    69       !! ------------------------------ 
     59      IF(lwp) WRITE(numout,*) 
     60      IF(lwp) WRITE(numout,*) 'ini_trc : initial set up of the passive tracers' 
     61      IF(lwp) WRITE(numout,*) '~~~~~~~' 
    7062 
    71       IF(lwp) WRITE(numout,*) ' ' 
    72       IF(lwp) WRITE(numout,*) ' *** number of passive tracer jptra = ',jptra 
    73       IF(lwp) WRITE(numout,*) ' ' 
     63      !                 ! masked grid volume 
     64      DO jk = 1, jpk 
     65         zbt(:,:,jk) = e1t(:,:) * e2t(:,:) * fse3t(:,:,jk) * tmask(:,:,jk) * tmask_i(:,:) 
     66      END DO 
     67#if defined key_off_degrad 
     68      DO jk = 1, jpk 
     69         zbt(:,:,:) = zbt(:,:,:) * facvol(:,:,jk)      ! degrad option: reduction by facvol 
     70      ENDDO 
     71#endif 
    7472 
    75       ! 1. READ passive tracers namelists 
    76       ! --------------------------------- 
     73      !                 ! total volume of the ocean 
     74      areatot = SUM( zbt(:,:,:) ) 
     75      IF( lk_mpp )   CALL mpp_sum( areatot )     ! sum over the global domain   
    7776 
    78       CALL trc_lec 
     77      CALL trc_lec      ! READ passive tracers namelists 
    7978 
    80       ! 2. control consistency between parameters, cpp key and namelists 
    81       ! ---------------------------------------------------------------- 
     79      CALL trc_ctl      ! control consistency between parameters, cpp key and namelists 
    8280 
    83       CALL trc_ctl 
     81      CALL trc_ini      ! computes some initializations 
    8482 
    85       ! 3. computes some initializations 
    86       ! -------------------------------- 
    87  
    88       CALL trc_ini 
    89  
    90   
    91       ! 4. total volume of the ocean 
    92       !----------------------------- 
    93  
    94       areatot = 0. 
    95       DO jk = 1, jpk 
    96          DO jj = 1, jpj 
    97             DO ji = 1, jpi 
    98                areatot = areatot + tmask(ji,jj,jk) * tmask_i(ji,jj)  & 
    99 #if defined key_off_degrad 
    100                   &                * facvol(ji,jj,jk)    & 
    101 #endif 
    102                   &                * e1t(ji,jj) * e2t(ji,jj) * fse3t(ji,jj,jk)  
    103             END DO 
    104          END DO 
    105       END DO 
    106       IF( lk_mpp ) THEN  
    107          CALL mpp_sum(areatot)     ! sum over the global domain   
    108       END IF 
    109  
    110       IF(lwp) WRITE(numout,*) ' ' 
    111       IF (lwp) WRITE(numout,*) 'Total volume of ocean =',areatot 
    112       IF(lwp) WRITE(numout,*) ' ' 
    113  
    114       ! 5. Initialization of tracers 
    115       ! ----------------------------- 
    116  
    117       IF( lrsttr ) THEN 
    118  
    119          ! 5.1 restart from a file 
    120          !------------------------ 
    121          CALL trc_rst_read 
    122  
    123       ELSE 
    124  
    125          !  5.2 analytical formulation or global data 
    126          !------------------------------------- 
    127          CALL trc_dtr 
    128  
     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 
    12986      ENDIF 
    13087 
     88      !                 ! Computation content of all tracers 
     89      trai = 0.e0 
     90      DO jn = 1, jptra 
     91         trai = trai + SUM( trn(:,:,:,jn) * zbt(:,:,:) ) 
     92      END DO       
     93      IF( lk_mpp )   CALL mpp_sum( trai )     ! sum over the global domain   
    13194 
    132       ! 6. Computation integral of all tracers 
    133       !------------------ 
    13495 
    135       trai = 0. 
    136       DO jn = 1, jptra 
    137          DO jk = 1, jpk 
    138             DO jj = 1, jpj 
    139                DO ji = 1, jpi 
    140                   trai = trai + trn(ji,jj,jk,jn) * tmask(ji,jj,jk) * tmask_i(ji,jj)    & 
    141 #if defined key_off_degrad 
    142                      &              * facvol(ji,jj,jk)   & 
    143 #endif 
     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,*) 
    144101 
    145                      &              * e1t(ji,jj) * e2t(ji,jj) * fse3t(ji,jj,jk) 
    146                END DO 
    147             END DO 
    148          END DO 
    149       ENDDO 
    150        
    151       IF( lk_mpp ) THEN  
    152          CALL mpp_sum(trai)         ! sum over the global domain   
    153       END IF 
     102      IF( ln_ctl )   CALL prt_ctl_trc_init      ! control print 
     103      ! 
    154104 
    155       IF(lwp) WRITE(numout,*) ' '      
    156       IF(lwp) WRITE(numout,*) 'Integral of all tracers over the full domain at initial time =',trai 
    157       IF(lwp) WRITE(numout,*) ' ' 
    158  
    159       ! 6. Print control 
    160       !------------------ 
    161  
    162       IF( ln_ctl )    CALL prt_ctl_trc_init 
     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 
    163110 
    164111   END SUBROUTINE ini_trc 
    165112 
    166  
    167113#else 
    168    !!====================================================================== 
    169    !!  Empty module : No passive tracer 
    170    !!====================================================================== 
     114   !!---------------------------------------------------------------------- 
     115   !!  Empty module :                                     No passive tracer 
     116   !!---------------------------------------------------------------------- 
    171117CONTAINS 
    172    SUBROUTINE ini_trc       
     118   SUBROUTINE ini_trc                      ! Dummy routine    
    173119   END SUBROUTINE ini_trc 
    174120#endif 
    175121 
     122   !!====================================================================== 
    176123END MODULE initrc  
Note: See TracChangeset for help on using the changeset viewer.