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.
trcstp.F90 in branches/2011/dev_LOCEAN_2011/NEMOGCM/NEMO/TOP_SRC – NEMO

source: branches/2011/dev_LOCEAN_2011/NEMOGCM/NEMO/TOP_SRC/trcstp.F90 @ 2997

Last change on this file since 2997 was 2997, checked in by cetlod, 13 years ago

branch dev_LOCEAN_2011 : minor corrections to ensure PISCES restartability

  • Property svn:keywords set to Id
File size: 4.8 KB
Line 
1MODULE trcstp
2   !!======================================================================
3   !!                       ***  MODULE trcstp  ***
4   !! Time-stepping    : time loop of opa for passive tracer
5   !!======================================================================
6   !! History :  1.0  !  2004-03  (C. Ethe)  Original
7   !!----------------------------------------------------------------------
8#if defined key_top
9   !!----------------------------------------------------------------------
10   !!   trc_stp      : passive tracer system time-stepping
11   !!----------------------------------------------------------------------
12   USE oce_trc          ! ocean dynamics and active tracers variables
13   USE trc
14   USE trctrp           ! passive tracers transport
15   USE trcsms           ! passive tracers sources and sinks
16   USE prtctl_trc       ! Print control for debbuging
17   USE trcdia
18   USE trcwri
19   USE trcrst
20   USE trdmod_trc_oce
21   USE trdmld_trc
22   USE iom
23   USE in_out_manager
24
25   IMPLICIT NONE
26   PRIVATE
27
28   PUBLIC   trc_stp    ! called by step
29
30   !! * Substitutions
31#  include "domzgr_substitute.h90"
32   !!----------------------------------------------------------------------
33   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
34   !! $Id$
35   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
36   !!----------------------------------------------------------------------
37CONTAINS
38
39   SUBROUTINE trc_stp( kt )
40      !!-------------------------------------------------------------------
41      !!                     ***  ROUTINE trc_stp  ***
42      !!                     
43      !! ** Purpose : Time loop of opa for passive tracer
44      !!
45      !! ** Method  :
46      !!              Compute the passive tracers trends
47      !!              Update the passive tracers
48      !!-------------------------------------------------------------------
49      INTEGER, INTENT( in ) ::  kt      ! ocean time-step index
50      INTEGER               ::  jk, jn  ! dummy loop indices
51      REAL(wp)              ::  ztrai
52      CHARACTER (len=25)    ::  charout
53      !!-------------------------------------------------------------------
54      !
55      IF( kt == nit000 ) THEN
56                               CALL iom_close( numrtr )     ! close input  passive tracers restart file
57         IF( lk_trdmld_trc  )  CALL trd_mld_trc_init        ! trends: Mixed-layer
58      ENDIF
59      !
60      IF( lk_vvl ) THEN                              ! update ocean volume due to ssh temporal evolution
61         DO jk = 1, jpk
62            cvol(:,:,jk) = e1e2t(:,:) * fse3t(:,:,jk) * tmask(:,:,jk)
63         END DO
64         IF( lk_degrad )  cvol(:,:,:) = cvol(:,:,:) * facvol(:,:,:)      ! degrad option: reduction by facvol
65         areatot     = glob_sum( cvol(:,:,:) )
66      ENDIF
67      !   
68
69      IF( kt == nit000 ) THEN
70                               CALL iom_close( numrtr )     ! close input  passive tracers restart file
71         IF( lk_trdmld_trc  )  CALL trd_mld_trc_init        ! trends: Mixed-layer
72      ENDIF
73      !
74      IF( MOD( kt - 1 , nn_dttrc ) == 0 ) THEN      ! only every nn_dttrc time step
75         !
76         IF(ln_ctl) THEN
77            WRITE(charout,FMT="('kt =', I4,'  d/m/y =',I2,I2,I4)") kt, nday, nmonth, nyear
78            CALL prt_ctl_trc_info(charout)
79         ENDIF
80         !
81         tra(:,:,:,:) = 0.e0
82         !
83                                   CALL trc_rst_opn( kt )       ! Open tracer restart file
84         IF( lk_iomput ) THEN  ;   CALL trc_wri    ( kt )       ! output of passive tracers with iom I/O manager
85         ELSE                  ;   CALL trc_dia    ( kt )       ! output of passive tracers with old I/O manager
86         ENDIF
87                                   CALL trc_sms( kt )           ! tracers: sinks and sources
88                                   CALL trc_trp( kt )           ! transport of passive tracers
89         IF( lrst_trc )            CALL trc_rst_wri( kt )       ! write tracer restart file
90         IF( lk_trdmld_trc  )      CALL trd_mld_trc( kt )       ! trends: Mixed-layer
91         !
92      ENDIF
93      !
94      ztrai = 0._wp                                                   !  content of all tracers
95      DO jn = 1, jptra
96         ztrai = ztrai + glob_sum( trn(:,:,:,jn) * cvol(:,:,:)   )
97      END DO
98      IF( lwp ) WRITE(numstr,9300) kt,  ztrai / areatot
999300  FORMAT(' iter :',i4,'    global content :',e18.10)
100
101   END SUBROUTINE trc_stp
102
103#else
104   !!----------------------------------------------------------------------
105   !!   Default key                                     NO passive tracers
106   !!----------------------------------------------------------------------
107CONTAINS
108   SUBROUTINE trc_stp( kt )        ! Empty routine
109      WRITE(*,*) 'trc_stp: You should not have seen this print! error?', kt
110   END SUBROUTINE trc_stp
111#endif
112
113   !!======================================================================
114END MODULE trcstp
Note: See TracBrowser for help on using the repository browser.