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/TRP/trcdmp.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/TRP/trcdmp.F90

    r11536 r12377  
    4444 
    4545   !! * Substitutions 
    46 #  include "vectopt_loop_substitute.h90" 
     46#  include "do_loop_substitute.h90" 
    4747   !!---------------------------------------------------------------------- 
    4848   !! NEMO/TOP 4.0 , NEMO Consortium (2018) 
     
    6363 
    6464 
    65    SUBROUTINE trc_dmp( kt ) 
     65   SUBROUTINE trc_dmp( kt, Kbb, Kmm, ptr, Krhs ) 
    6666      !!---------------------------------------------------------------------- 
    6767      !!                   ***  ROUTINE trc_dmp  *** 
     
    7373      !! ** Method  :   Newtonian damping towards trdta computed  
    7474      !!      and add to the general tracer trends: 
    75       !!                     trn = tra + restotr * (trdta - trb) 
     75      !!                     tr(Kmm) = tr(Krhs) + restotr * (trdta - tr(Kbb)) 
    7676      !!         The trend is computed either throughout the water column 
    7777      !!      (nlmdmptr=0) or in area of weak vertical mixing (nlmdmptr=1) or 
    7878      !!      below the well mixed layer (nlmdmptr=2) 
    7979      !! 
    80       !! ** Action  : - update the tracer trends tra with the newtonian  
     80      !! ** Action  : - update the tracer trends tr(:,:,:,:,Krhs) with the newtonian  
    8181      !!                damping trends. 
    8282      !!              - save the trends ('key_trdmxl_trc') 
    8383      !!---------------------------------------------------------------------- 
    84       INTEGER, INTENT(in) ::   kt   ! ocean time-step index 
     84      INTEGER,                                    INTENT(in   ) :: kt              ! ocean time-step index 
     85      INTEGER,                                    INTENT(in   ) :: Kbb, Kmm, Krhs  ! time level indices 
     86      REAL(wp), DIMENSION(jpi,jpj,jpk,jptra,jpt), INTENT(inout) :: ptr             ! passive tracers and RHS of tracer equation 
    8587      ! 
    8688      INTEGER ::   ji, jj, jk, jn, jl   ! dummy loop indices 
     
    100102         DO jn = 1, jptra                                           ! tracer loop 
    101103            !                                                       ! =========== 
    102             IF( l_trdtrc ) ztrtrd(:,:,:) = tra(:,:,:,jn)    ! save trends  
     104            IF( l_trdtrc ) ztrtrd(:,:,:) = ptr(:,:,:,jn,Krhs)    ! save trends  
    103105            ! 
    104106            IF( ln_trc_ini(jn) ) THEN      ! update passive tracers arrays with input data read from file 
    105107               ! 
    106108               jl = n_trc_index(jn)  
    107                CALL trc_dta( kt, sf_trcdta(jl), rf_trfac(jl), ztrcdta )   ! read tracer data at nit000 
     109               CALL trc_dta( kt, Kmm, sf_trcdta(jl), rf_trfac(jl), ztrcdta )   ! read tracer data at nit000 
    108110               ! 
    109111               SELECT CASE ( nn_zdmp_tr ) 
    110112               ! 
    111113               CASE( 0 )                !==  newtonian damping throughout the water column  ==! 
    112                   DO jk = 1, jpkm1 
    113                      DO jj = 2, jpjm1 
    114                         DO ji = fs_2, fs_jpim1   ! vector opt. 
    115                            tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + restotr(ji,jj,jk) * ( ztrcdta(ji,jj,jk) - trb(ji,jj,jk,jn) ) 
    116                         END DO 
    117                      END DO 
    118                   END DO 
     114                  DO_3D_00_00( 1, jpkm1 ) 
     115                     ptr(ji,jj,jk,jn,Krhs) = ptr(ji,jj,jk,jn,Krhs) + restotr(ji,jj,jk) * ( ztrcdta(ji,jj,jk) - ptr(ji,jj,jk,jn,Kbb) ) 
     116                  END_3D 
    119117                  ! 
    120118               CASE ( 1 )                !==  no damping in the turbocline (avt > 5 cm2/s)  ==! 
    121                   DO jk = 1, jpkm1 
    122                      DO jj = 2, jpjm1 
    123                         DO ji = fs_2, fs_jpim1   ! vector opt. 
    124                            IF( avt(ji,jj,jk) <= avt_c )  THEN  
    125                               tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + restotr(ji,jj,jk) * ( ztrcdta(ji,jj,jk) - trb(ji,jj,jk,jn) ) 
    126                            ENDIF 
    127                         END DO 
    128                      END DO 
    129                   END DO 
     119                  DO_3D_00_00( 1, jpkm1 ) 
     120                     IF( avt(ji,jj,jk) <= avt_c )  THEN  
     121                        ptr(ji,jj,jk,jn,Krhs) = ptr(ji,jj,jk,jn,Krhs) + restotr(ji,jj,jk) * ( ztrcdta(ji,jj,jk) - ptr(ji,jj,jk,jn,Kbb) ) 
     122                     ENDIF 
     123                  END_3D 
    130124                  ! 
    131125               CASE ( 2 )               !==  no damping in the mixed layer   ==!  
    132                   DO jk = 1, jpkm1 
    133                      DO jj = 2, jpjm1 
    134                         DO ji = fs_2, fs_jpim1   ! vector opt. 
    135                            IF( gdept_n(ji,jj,jk) >= hmlp (ji,jj) ) THEN 
    136                               tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + restotr(ji,jj,jk) * ( ztrcdta(ji,jj,jk) - trb(ji,jj,jk,jn) ) 
    137                            END IF 
    138                         END DO 
    139                      END DO 
    140                   END DO 
     126                  DO_3D_00_00( 1, jpkm1 ) 
     127                     IF( gdept(ji,jj,jk,Kmm) >= hmlp (ji,jj) ) THEN 
     128                        ptr(ji,jj,jk,jn,Krhs) = ptr(ji,jj,jk,jn,Krhs) + restotr(ji,jj,jk) * ( ztrcdta(ji,jj,jk) - ptr(ji,jj,jk,jn,Kbb) ) 
     129                     END IF 
     130                  END_3D 
    141131                  !   
    142132               END SELECT 
     
    145135            ! 
    146136            IF( l_trdtrc ) THEN 
    147                ztrtrd(:,:,:) = tra(:,:,:,jn) -  ztrtrd(:,:,:) 
    148                CALL trd_tra( kt, 'TRC', jn, jptra_dmp, ztrtrd ) 
     137               ztrtrd(:,:,:) = ptr(:,:,:,jn,Krhs) -  ztrtrd(:,:,:) 
     138               CALL trd_tra( kt, Kmm, Krhs, 'TRC', jn, jptra_dmp, ztrtrd ) 
    149139            END IF 
    150140            !                                                       ! =========== 
     
    156146      IF( l_trdtrc )  DEALLOCATE( ztrtrd ) 
    157147      !                                          ! print mean trends (used for debugging) 
    158       IF( ln_ctl ) THEN 
     148      IF( sn_cfctl%l_prttrc ) THEN 
    159149         WRITE(charout, FMT="('dmp ')") 
    160150         CALL prt_ctl_trc_info(charout) 
    161          CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 
     151         CALL prt_ctl_trc( tab4d=ptr(:,:,:,:,Krhs), mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 
    162152      ENDIF 
    163153      ! 
     
    181171      !!---------------------------------------------------------------------- 
    182172      ! 
    183       REWIND( numnat_ref )              ! Namelist namtrc_dmp in reference namelist : Passive tracers newtonian damping 
    184173      READ  ( numnat_ref, namtrc_dmp, IOSTAT = ios, ERR = 909) 
    185174909   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namtrc_dmp in reference namelist' ) 
    186       REWIND( numnat_cfg )              ! Namelist namtrc_dmp in configuration namelist : Passive tracers newtonian damping 
    187175      READ  ( numnat_cfg, namtrc_dmp, IOSTAT = ios, ERR = 910) 
    188176910   IF( ios >  0 )   CALL ctl_nam ( ios , 'namtrc_dmp in configuration namelist' ) 
     
    224212 
    225213 
    226    SUBROUTINE trc_dmp_clo( kt ) 
     214   SUBROUTINE trc_dmp_clo( kt, Kbb, Kmm ) 
    227215      !!--------------------------------------------------------------------- 
    228216      !!                  ***  ROUTINE trc_dmp_clo  *** 
     
    236224      !!                nctsi2(), nctsj2() : north-east Closed sea limits (i,j) 
    237225      !!---------------------------------------------------------------------- 
    238       INTEGER, INTENT( in ) ::   kt      ! ocean time-step index 
     226      INTEGER, INTENT( in ) ::   kt           ! ocean time-step index 
     227      INTEGER, INTENT( in ) ::   Kbb, Kmm     ! time level indices 
    239228      ! 
    240229      INTEGER :: ji , jj, jk, jn, jl, jc                    ! dummy loop indicesa 
     
    354343            IF( ln_trc_ini(jn) ) THEN      ! update passive tracers arrays with input data read from file 
    355344                jl = n_trc_index(jn) 
    356                 CALL trc_dta( kt, sf_trcdta(jl), rf_trfac(jl), ztrcdta )   ! read tracer data at nit000 
     345                CALL trc_dta( kt, Kmm, sf_trcdta(jl), rf_trfac(jl), ztrcdta )   ! read tracer data at nit000 
    357346                DO jc = 1, npncts 
    358347                   DO jk = 1, jpkm1 
    359348                      DO jj = nctsj1(jc), nctsj2(jc) 
    360349                         DO ji = nctsi1(jc), nctsi2(jc) 
    361                             trn(ji,jj,jk,jn) = ztrcdta(ji,jj,jk) 
    362                             trb(ji,jj,jk,jn) = trn(ji,jj,jk,jn) 
     350                            tr(ji,jj,jk,jn,Kmm) = ztrcdta(ji,jj,jk) 
     351                            tr(ji,jj,jk,jn,Kbb) = tr(ji,jj,jk,jn,Kmm) 
    363352                         END DO 
    364353                      END DO 
Note: See TracChangeset for help on using the changeset viewer.