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_NEMO_MERGE_2011/NEMOGCM/NEMO/TOP_SRC – NEMO

source: branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/TOP_SRC/trcstp.F90 @ 3118

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

dev_NEMO_MERGE_2011: add in changes dev_NOC_UKMO_MERGE developments

  • 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   USE trcsub
25
26   IMPLICIT NONE
27   PRIVATE
28
29   PUBLIC   trc_stp    ! called by step
30
31   !! * Substitutions
32#  include "domzgr_substitute.h90"
33   !!----------------------------------------------------------------------
34   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
35   !! $Id$
36   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
37   !!----------------------------------------------------------------------
38CONTAINS
39
40   SUBROUTINE trc_stp( kt )
41      !!-------------------------------------------------------------------
42      !!                     ***  ROUTINE trc_stp  ***
43      !!                     
44      !! ** Purpose : Time loop of opa for passive tracer
45      !!
46      !! ** Method  :
47      !!              Compute the passive tracers trends
48      !!              Update the passive tracers
49      !!-------------------------------------------------------------------
50      INTEGER, INTENT( in ) ::  kt      ! ocean time-step index
51      INTEGER               ::  jk, jn  ! dummy loop indices
52      REAL(wp)              ::  ztrai
53      CHARACTER (len=25)    ::  charout
54      !!-------------------------------------------------------------------
55      !
56      IF( kt == nittrc000 ) THEN
57                               CALL iom_close( numrtr )     ! close input  passive tracers restart file
58         IF( lk_trdmld_trc  )  CALL trd_mld_trc_init        ! trends: Mixed-layer
59      ENDIF
60      !
61      IF( lk_vvl ) THEN                              ! update ocean volume due to ssh temporal evolution
62         DO jk = 1, jpk
63            cvol(:,:,jk) = e1e2t(:,:) * fse3t(:,:,jk) * tmask(:,:,jk)
64         END DO
65         IF( lk_degrad )  cvol(:,:,:) = cvol(:,:,:) * facvol(:,:,:)      ! degrad option: reduction by facvol
66         areatot     = glob_sum( cvol(:,:,:) )
67      ENDIF
68      !   
69     IF( nn_dttrc /= 1 )   CALL trc_sub_stp( kt )  ! averaging physical variables for sub-stepping
70
71     IF( MOD( kt , nn_dttrc ) == 0 ) THEN      ! only every nn_dttrc time step
72         !
73         IF(ln_ctl) THEN
74            WRITE(charout,FMT="('kt =', I4,'  d/m/y =',I2,I2,I4)") kt, nday, nmonth, nyear
75            CALL prt_ctl_trc_info(charout)
76         ENDIF
77         !
78         tra(:,:,:,:) = 0.e0
79         !
80                                   CALL trc_rst_opn( kt )       ! Open tracer restart file
81         IF( lk_iomput ) THEN  ;   CALL trc_wri    ( kt )       ! output of passive tracers with iom I/O manager
82         ELSE                  ;   CALL trc_dia    ( kt )       ! output of passive tracers with old I/O manager
83         ENDIF
84                                   CALL trc_sms( kt )           ! tracers: sinks and sources
85                                   CALL trc_trp( kt )           ! transport of passive tracers
86         IF( lrst_trc )            CALL trc_rst_wri( kt )       ! write tracer restart file
87         IF( lk_trdmld_trc  )      CALL trd_mld_trc( kt )       ! trends: Mixed-layer
88         !
89         IF( nn_dttrc /= 1   )     CALL trc_sub_reset( kt )  ! resetting physical variables when sub-stepping
90         !
91      ENDIF
92      !
93      ztrai = 0._wp                                                   !  content of all tracers
94      DO jn = 1, jptra
95         ztrai = ztrai + glob_sum( trn(:,:,:,jn) * cvol(:,:,:)   )
96      END DO
97      IF( lwp ) WRITE(numstr,9300) kt,  ztrai / areatot
989300  FORMAT(' iter :',i4,'    global content :',e18.10)
99
100   END SUBROUTINE trc_stp
101
102#else
103   !!----------------------------------------------------------------------
104   !!   Default key                                     NO passive tracers
105   !!----------------------------------------------------------------------
106CONTAINS
107   SUBROUTINE trc_stp( kt )        ! Empty routine
108      WRITE(*,*) 'trc_stp: You should not have seen this print! error?', kt
109   END SUBROUTINE trc_stp
110#endif
111
112   !!======================================================================
113END MODULE trcstp
Note: See TracBrowser for help on using the repository browser.