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 12377 for NEMO/trunk/src/TOP/trcstp.F90 – NEMO

Ignore:
Timestamp:
2020-02-12T15:39:06+01:00 (4 years ago)
Author:
acc
Message:

The big one. Merging all 2019 developments from the option 1 branch back onto the trunk.

This changeset reproduces 2019/dev_r11943_MERGE_2019 on the trunk using a 2-URL merge
onto a working copy of the trunk. I.e.:

svn merge --ignore-ancestry \

svn+ssh://acc@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/NEMO/trunk \
svn+ssh://acc@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/NEMO/branches/2019/dev_r11943_MERGE_2019 ./

The --ignore-ancestry flag avoids problems that may otherwise arise from the fact that
the merge history been trunk and branch may have been applied in a different order but
care has been taken before this step to ensure that all applicable fixes and updates
are present in the merge branch.

The trunk state just before this step has been branched to releases/release-4.0-HEAD
and that branch has been immediately tagged as releases/release-4.0.2. Any fixes
or additions in response to tickets on 4.0, 4.0.1 or 4.0.2 should be done on
releases/release-4.0-HEAD. From now on future 'point' releases (e.g. 4.0.2) will
remain unchanged with periodic releases as needs demand. Note release-4.0-HEAD is a
transitional naming convention. Future full releases, say 4.2, will have a release-4.2
branch which fulfills this role and the first point release (e.g. 4.2.0) will be made
immediately following the release branch creation.

2020 developments can be started from any trunk revision later than this one.

Location:
NEMO/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk

    • Property svn:externals
      •  

        old new  
        33^/utils/build/mk@HEAD         mk 
        44^/utils/tools@HEAD            tools 
        5 ^/vendors/AGRIF/dev@HEAD      ext/AGRIF 
         5^/vendors/AGRIF/dev_r11615_ENHANCE-04_namelists_as_internalfiles_agrif@HEAD      ext/AGRIF 
        66^/vendors/FCM@HEAD            ext/FCM 
        77^/vendors/IOIPSL@HEAD         ext/IOIPSL 
  • NEMO/trunk/src/TOP/trcstp.F90

    r12136 r12377  
    55   !!====================================================================== 
    66   !! History :  1.0  !  2004-03  (C. Ethe)  Original 
     7   !!            4.1  !  2019-08  (A. Coward, D. Storkey) rewrite in preparation for new timestepping scheme 
    78   !!---------------------------------------------------------------------- 
    89#if defined key_top 
     
    1718   USE trcwri 
    1819   USE trcrst 
    19    USE trcsub         ! 
    2020   USE trdtrc_oce 
    2121   USE trdmxl_trc 
     
    4444CONTAINS 
    4545 
    46    SUBROUTINE trc_stp( kt ) 
     46   SUBROUTINE trc_stp( kt, Kbb, Kmm, Krhs, Kaa ) 
    4747      !!------------------------------------------------------------------- 
    4848      !!                     ***  ROUTINE trc_stp  *** 
     
    5353      !!                Update the passive tracers 
    5454      !!------------------------------------------------------------------- 
    55       INTEGER, INTENT( in ) ::   kt   ! ocean time-step index 
     55      INTEGER, INTENT( in ) :: kt                  ! ocean time-step index 
     56      INTEGER, INTENT( in ) :: Kbb, Kmm, Krhs, Kaa ! time level indices 
    5657      ! 
    5758      INTEGER ::   jk, jn   ! dummy loop indices 
     
    6566      IF( ( neuler == 0 .AND. kt == nittrc000 ) .OR. ln_top_euler ) THEN     ! at nittrc000 
    6667         r2dttrc =  rdttrc           ! = rdttrc (use or restarting with Euler time stepping) 
    67       ELSEIF( kt <= nittrc000 + nn_dttrc ) THEN          ! at nittrc000 or nittrc000+1 
    68          r2dttrc = 2. * rdttrc       ! = 2 rdttrc (leapfrog) 
    69       ENDIF 
    70       ! 
    71       ll_trcstat  = ( ln_ctl .OR. sn_cfctl%l_trcstat ) .AND. & 
     68      ELSEIF( kt <= nittrc000 + 1 ) THEN                                     ! at nittrc000 or nittrc000+1  
     69         r2dttrc = 2. * rdttrc       ! = 2 rdttrc (leapfrog)  
     70      ENDIF 
     71      ! 
     72      ll_trcstat  = ( sn_cfctl%l_trcstat ) .AND. & 
    7273     &              ( ( MOD( kt, sn_cfctl%ptimincr ) == 0 ) .OR. ( kt == nitend ) ) 
    7374 
     
    7778      IF( .NOT.ln_linssh ) THEN                                           ! update ocean volume due to ssh temporal evolution 
    7879         DO jk = 1, jpk 
    79             cvol(:,:,jk) = e1e2t(:,:) * e3t_n(:,:,jk) * tmask(:,:,jk) 
     80            cvol(:,:,jk) = e1e2t(:,:) * e3t(:,:,jk,Kmm) * tmask(:,:,jk) 
    8081         END DO 
    81          IF ( ln_ctl .OR. kt == nitrst .OR. ( ln_check_mass .AND. kt == nitend )              & 
     82         IF ( ll_trcstat .OR. kt == nitrst .OR. ( ln_check_mass .AND. kt == nitend )   & 
    8283            & .OR. iom_use( "pno3tot" ) .OR. iom_use( "ppo4tot" ) .OR. iom_use( "psiltot" )   & 
    8384            & .OR. iom_use( "palktot" ) .OR. iom_use( "pfertot" ) )                           & 
     
    8788      IF( l_trcdm2dc )   CALL trc_mean_qsr( kt ) 
    8889      !     
    89       IF( nn_dttrc /= 1 )   CALL trc_sub_stp( kt )  ! averaging physical variables for sub-stepping 
    90       !     
    91       IF( MOD( kt , nn_dttrc ) == 0 ) THEN      ! only every nn_dttrc time step 
    92          ! 
    93          IF(ln_ctl) THEN 
    94             WRITE(charout,FMT="('kt =', I4,'  d/m/y =',I2,I2,I4)") kt, nday, nmonth, nyear 
    95             CALL prt_ctl_trc_info(charout) 
    96          ENDIF 
    97          ! 
    98          tra(:,:,:,:) = 0.e0 
    99          ! 
    100                                    CALL trc_rst_opn  ( kt )       ! Open tracer restart file  
    101          IF( lrst_trc )            CALL trc_rst_cal  ( kt, 'WRITE' )   ! calendar 
    102                                    CALL trc_wri      ( kt )       ! output of passive tracers with iom I/O manager 
    103                                    CALL trc_sms      ( kt )       ! tracers: sinks and sources 
    104                                    CALL trc_trp      ( kt )       ! transport of passive tracers 
    105          IF( kt == nittrc000 ) THEN 
    106             CALL iom_close( numrtr )       ! close input tracer restart file 
    107             IF(lwm) CALL FLUSH( numont )   ! flush namelist output 
    108          ENDIF 
    109          IF( lrst_trc )            CALL trc_rst_wri  ( kt )       ! write tracer restart file 
    110          IF( lk_trdmxl_trc  )      CALL trd_mxl_trc  ( kt )       ! trends: Mixed-layer 
    111          ! 
    112          IF( nn_dttrc /= 1   )     CALL trc_sub_reset( kt )       ! resetting physical variables when sub-stepping 
    113          ! 
     90      ! 
     91      IF(sn_cfctl%l_prttrc) THEN 
     92         WRITE(charout,FMT="('kt =', I4,'  d/m/y =',I2,I2,I4)") kt, nday, nmonth, nyear 
     93         CALL prt_ctl_trc_info(charout) 
     94      ENDIF 
     95      ! 
     96      tr(:,:,:,:,Krhs) = 0._wp 
     97      ! 
     98      CALL trc_rst_opn  ( kt )                            ! Open tracer restart file  
     99      IF( lrst_trc )  CALL trc_rst_cal  ( kt, 'WRITE' )   ! calendar 
     100      CALL trc_wri      ( kt,      Kmm            )       ! output of passive tracers with iom I/O manager 
     101      CALL trc_sms      ( kt, Kbb, Kmm, Krhs      )       ! tracers: sinks and sources 
     102      CALL trc_trp      ( kt, Kbb, Kmm, Krhs, Kaa )       ! transport of passive tracers 
     103           ! 
     104           ! Note passive tracers have been time-filtered in trc_trp but the time level 
     105           ! indices will not be swapped until after tra_atf/dyn_atf/ssh_atf in stp. Subsequent calls here 
     106           ! anticipate this update which will be: Nrhs= Nbb ; Nbb = Nnn ; Nnn = Naa ; Naa = Nrhs 
     107           ! and use the filtered levels explicitly. 
     108           ! 
     109      IF( kt == nittrc000 ) THEN 
     110         CALL iom_close( numrtr )                         ! close input tracer restart file 
     111         IF(lwm) CALL FLUSH( numont )                     ! flush namelist output 
     112      ENDIF 
     113      IF( lrst_trc )            CALL trc_rst_wri  ( kt, Kmm, Kaa, Kbb  )       ! write tracer restart file 
     114      IF( lk_trdmxl_trc  )      CALL trd_mxl_trc  ( kt,      Kaa       )       ! trends: Mixed-layer 
     115      ! 
     116      IF( ln_top_euler ) THEN  
     117         ! For Euler timestepping for TOP we need to copy the "after" to the "now" fields  
     118         ! here then after the (leapfrog) swapping of the time-level indices in OCE/step.F90 we have  
     119         ! "before" fields = "now" fields. 
     120         tr(:,:,:,:,Kmm) = tr(:,:,:,:,Kaa) 
    114121      ENDIF 
    115122      ! 
     
    117124         ztrai = 0._wp                                                   !  content of all tracers 
    118125         DO jn = 1, jptra 
    119             ztrai = ztrai + glob_sum( 'trcstp', trn(:,:,:,jn) * cvol(:,:,:)   ) 
     126            ztrai = ztrai + glob_sum( 'trcstp', tr(:,:,:,jn,Kaa) * cvol(:,:,:)   ) 
    120127         END DO 
    121128         IF( lwm ) WRITE(numstr,9300) kt,  ztrai / areatot 
     
    126133      ! 
    127134   END SUBROUTINE trc_stp 
     135 
    128136 
    129137   SUBROUTINE trc_stp_ctl 
Note: See TracChangeset for help on using the changeset viewer.