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

source: trunk/NEMOGCM/NEMO/TOP_SRC/trcstp.F90 @ 4990

Last change on this file since 4990 was 4990, checked in by timgraham, 9 years ago

Merged branches/2014/dev_MERGE_2014 back onto the trunk as follows:

In the working copy of branch ran:
svn merge svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk@HEAD
1 conflict in LIM_SRC_3/limdiahsb.F90
Resolved by keeping the version from dev_MERGE_2014 branch
and commited at r4989

In working copy run:
svn switch svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk
to switch working copy

Run:
svn merge --reintegrate svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/branches/2014/dev_MERGE_2014
to merge the branch into the trunk - no conflicts at this stage.

  • Property svn:keywords set to Id
File size: 5.7 KB
RevLine 
[1457]1MODULE trcstp
2   !!======================================================================
3   !!                       ***  MODULE trcstp  ***
4   !! Time-stepping    : time loop of opa for passive tracer
5   !!======================================================================
[2528]6   !! History :  1.0  !  2004-03  (C. Ethe)  Original
7   !!----------------------------------------------------------------------
[1457]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
[4306]13   USE sbc_oce
[2528]14   USE trc
[1457]15   USE trctrp           ! passive tracers transport
16   USE trcsms           ! passive tracers sources and sinks
17   USE prtctl_trc       ! Print control for debbuging
18   USE trcdia
19   USE trcwri
20   USE trcrst
[4990]21   USE trdtrc_oce
22   USE trdmxl_trc
[1457]23   USE iom
24   USE in_out_manager
[3294]25   USE trcsub
[1457]26
27   IMPLICIT NONE
28   PRIVATE
29
[2528]30   PUBLIC   trc_stp    ! called by step
[3294]31
32   !! * Substitutions
33#  include "domzgr_substitute.h90"
[1457]34   !!----------------------------------------------------------------------
[2528]35   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
36   !! $Id$
37   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
[1457]38   !!----------------------------------------------------------------------
39CONTAINS
40
41   SUBROUTINE trc_stp( kt )
42      !!-------------------------------------------------------------------
43      !!                     ***  ROUTINE trc_stp  ***
44      !!                     
45      !! ** Purpose : Time loop of opa for passive tracer
46      !!
47      !! ** Method  :
48      !!              Compute the passive tracers trends
49      !!              Update the passive tracers
50      !!-------------------------------------------------------------------
[3294]51      INTEGER, INTENT( in ) ::  kt      ! ocean time-step index
52      INTEGER               ::  jk, jn  ! dummy loop indices
53      REAL(wp)              ::  ztrai
[4306]54      CHARACTER (len=25)    ::  charout 
55
56      REAL(wp), DIMENSION(:,:), POINTER ::   zqsr_tmp ! save qsr during TOP time-step
[2528]57      !!-------------------------------------------------------------------
[3294]58      !
59      IF( nn_timing == 1 )   CALL timing_start('trc_stp')
60      !
[4990]61      IF( kt == nittrc000 .AND. lk_trdmxl_trc )  CALL trd_mxl_trc_init    ! trends: Mixed-layer
[3294]62      !
[3319]63      IF( lk_vvl ) THEN                                                   ! update ocean volume due to ssh temporal evolution
[3294]64         DO jk = 1, jpk
65            cvol(:,:,jk) = e1e2t(:,:) * fse3t(:,:,jk) * tmask(:,:,jk)
66         END DO
[3319]67         IF( lk_degrad )  cvol(:,:,:) = cvol(:,:,:) * facvol(:,:,:)       ! degrad option: reduction by facvol
[3294]68         areatot         = glob_sum( cvol(:,:,:) )
69      ENDIF
70      !   
[4306]71      IF( ltrcdm2dc ) THEN
72         ! When Diurnal cycle, core bulk and LIM2  are activated, put daily mean qsr in qsr for TOP/biogeochemistery time-step
73         ! and save qsr with diurnal cycle in qsr_tmp
74         CALL wrk_alloc( jpi,jpj, zqsr_tmp )
75         zqsr_tmp(:,:) = qsr     (:,:)
76         qsr     (:,:) = qsr_mean(:,:)   
77      ENDIF
78      !   
79      IF( nn_dttrc /= 1 )   CALL trc_sub_stp( kt )  ! averaging physical variables for sub-stepping
80      !   
81      IF( MOD( kt , nn_dttrc ) == 0 ) THEN      ! only every nn_dttrc time step
[2528]82         !
83         IF(ln_ctl) THEN
84            WRITE(charout,FMT="('kt =', I4,'  d/m/y =',I2,I2,I4)") kt, nday, nmonth, nyear
85            CALL prt_ctl_trc_info(charout)
86         ENDIF
87         !
88         tra(:,:,:,:) = 0.e0
89         !
[3294]90                                   CALL trc_rst_opn  ( kt )       ! Open tracer restart file
[3680]91         IF( lrst_trc )            CALL trc_rst_cal  ( kt, 'WRITE' )   ! calendar
[3294]92         IF( lk_iomput ) THEN  ;   CALL trc_wri      ( kt )       ! output of passive tracers with iom I/O manager
93         ELSE                  ;   CALL trc_dia      ( kt )       ! output of passive tracers with old I/O manager
[2528]94         ENDIF
[3294]95                                   CALL trc_sms      ( kt )       ! tracers: sinks and sources
96                                   CALL trc_trp      ( kt )       ! transport of passive tracers
[4147]97         IF( kt == nittrc000 ) THEN
98            CALL iom_close( numrtr )       ! close input tracer restart file
[4624]99            IF(lwm) CALL FLUSH( numont )   ! flush namelist output
[4147]100         ENDIF
[3294]101         IF( lrst_trc )            CALL trc_rst_wri  ( kt )       ! write tracer restart file
[4990]102         IF( lk_trdmxl_trc  )      CALL trd_mxl_trc  ( kt )       ! trends: Mixed-layer
[2528]103         !
[3294]104         IF( nn_dttrc /= 1   )     CALL trc_sub_reset( kt )       ! resetting physical variables when sub-stepping
105         !
[1457]106      ENDIF
[3294]107      !
[4306]108      IF( ltrcdm2dc ) THEN
109         ! put back qsr with diurnal cycle in qsr
110         qsr(:,:) = zqsr_tmp(:,:)
111         CALL wrk_dealloc( jpi,jpj, zqsr_tmp )
112      ENDIF
113      !
[3294]114      ztrai = 0._wp                                                   !  content of all tracers
115      DO jn = 1, jptra
116         ztrai = ztrai + glob_sum( trn(:,:,:,jn) * cvol(:,:,:)   )
117      END DO
118      IF( lwp ) WRITE(numstr,9300) kt,  ztrai / areatot
1199300  FORMAT(i10,e18.10)
120      !
121      IF( nn_timing == 1 )   CALL timing_stop('trc_stp')
122      !
[1457]123   END SUBROUTINE trc_stp
124
125#else
126   !!----------------------------------------------------------------------
127   !!   Default key                                     NO passive tracers
128   !!----------------------------------------------------------------------
129CONTAINS
130   SUBROUTINE trc_stp( kt )        ! Empty routine
131      WRITE(*,*) 'trc_stp: You should not have seen this print! error?', kt
132   END SUBROUTINE trc_stp
133#endif
134
135   !!======================================================================
136END MODULE trcstp
Note: See TracBrowser for help on using the repository browser.