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 6140 for trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_cen.F90 – NEMO

Ignore:
Timestamp:
2015-12-21T12:35:23+01:00 (8 years ago)
Author:
timgraham
Message:

Merge of branches/2015/dev_merge_2015 back into trunk. Merge excludes NEMOGCM/TOOLS/OBSTOOLS/ for now due to issues with the change of file type. Will sort these manually with further commits.

Branch merged as follows:
In the working copy of branch ran:
svn merge svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk@HEAD
Small conflicts due to bug fixes applied to trunk since the dev_merge_2015 was copied. Bug fixes were applied to the branch as well so these were easy to resolve.
Branch committed at this stage

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/2015/dev_merge_2015
to merge the branch into the trunk and then commit - no conflicts at this stage.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_cen.F90

    r5836 r6140  
    22   !!====================================================================== 
    33   !!                     ***  MODULE  traadv_cen  *** 
    4    !! Ocean  tracers:  horizontal & vertical advective trend (2nd/4th order centered) 
     4   !! Ocean  tracers:  advective trend (2nd/4th order centered) 
    55   !!====================================================================== 
    66   !! History :  3.7  ! 2014-05  (G. Madec)  original code 
     
    88 
    99   !!---------------------------------------------------------------------- 
    10    !!   tra_adv_cen : update the tracer trend with the advection trends using a centered or scheme (2nd or 4th order) 
    11    !!                 NB: on the vertical it is actually a 4th order COMPACT scheme which is used 
    12    !!---------------------------------------------------------------------- 
    13    USE oce, ONLY: tsn ! now ocean temperature and salinity 
    14    USE dom_oce         ! ocean space and time domain 
    15    USE eosbn2          ! equation of state 
    16    USE traadv_fct      ! acces to routine interp_4th_cpt  
    17    USE trd_oce         ! trends: ocean variables 
    18    USE trdtra          ! trends manager: tracers  
    19    USE diaptr          ! poleward transport diagnostics 
     10   !!   tra_adv_cen   : update the tracer trend with the advection trends using a centered or scheme (2nd or 4th order) 
     11   !!                   NB: on the vertical it is actually a 4th order COMPACT scheme which is used 
     12   !!---------------------------------------------------------------------- 
     13   USE oce      , ONLY: tsn ! now ocean temperature and salinity 
     14   USE dom_oce        ! ocean space and time domain 
     15   USE eosbn2         ! equation of state 
     16   USE traadv_fct     ! acces to routine interp_4th_cpt  
     17   USE trd_oce        ! trends: ocean variables 
     18   USE trdtra         ! trends manager: tracers  
     19   USE diaptr         ! poleward transport diagnostics 
    2020   ! 
    21    USE in_out_manager  ! I/O manager 
    22    USE iom             ! IOM library 
    23    USE trc_oce         ! share passive tracers/Ocean variables 
    24    USE lib_mpp         ! MPP library 
    25    USE wrk_nemo        ! Memory Allocation 
    26    USE timing          ! Timing 
     21   USE in_out_manager ! I/O manager 
     22   USE iom            ! IOM library 
     23   USE trc_oce        ! share passive tracers/Ocean variables 
     24   USE lib_mpp        ! MPP library 
     25   USE wrk_nemo       ! Memory Allocation 
     26   USE timing         ! Timing 
    2727 
    2828   IMPLICIT NONE 
     
    3434 
    3535   !! * Substitutions 
    36 #  include "domzgr_substitute.h90" 
    3736#  include "vectopt_loop_substitute.h90" 
    3837   !!---------------------------------------------------------------------- 
     
    5352      !! ** Method  :   The advection is evaluated by a 2nd or 4th order scheme 
    5453      !!               using now fields (leap-frog scheme).  
    55       !! 
    5654      !!       kn_cen_h = 2  ==>> 2nd order centered scheme on the horizontal 
    5755      !!                = 4  ==>> 4th order    -        -       -      - 
    58       !! 
    5956      !!       kn_cen_v = 2  ==>> 2nd order centered scheme on the vertical 
    6057      !!                = 4  ==>> 4th order COMPACT  scheme     -      - 
    6158      !! 
    62       !! ** Action :  - update pta  with the now advective tracer trends 
    63       !!              - send trends to trdtra module for further diagnostcs 
     59      !! ** Action : - update pta  with the now advective tracer trends 
     60      !!             - send trends to trdtra module for further diagnostcs (l_trdtra=T) 
     61      !!             - htr_adv, str_adv : poleward advective heat and salt transport (ln_diaptr=T) 
    6462      !!---------------------------------------------------------------------- 
    6563      INTEGER                              , INTENT(in   ) ::   kt              ! ocean time-step index 
     
    9088      ENDIF 
    9189      ! 
    92       !                          ! surface & bottom values  
    93       IF( lk_vvl )   zwz(:,:, 1 ) = 0._wp             ! set to zero one for all 
    94                      zwz(:,:,jpk) = 0._wp             ! except at the surface in linear free surface 
     90      !                     
     91      zwz(:,:, 1 ) = 0._wp       ! surface & bottom vertical flux set to zero for all tracers 
     92      zwz(:,:,jpk) = 0._wp 
    9593      ! 
    9694      DO jn = 1, kjpt            !==  loop over the tracers  ==! 
    9795         ! 
    98          SELECT CASE( kn_cen_h )          !--  Horizontal fluxes  --! 
    99          ! 
    100          CASE(  2  )                               ! 2nd order centered 
     96         SELECT CASE( kn_cen_h )       !--  Horizontal fluxes  --! 
     97         ! 
     98         CASE(  2  )                         !* 2nd order centered 
    10199            DO jk = 1, jpkm1 
    102100               DO jj = 1, jpjm1 
     
    108106            END DO 
    109107            ! 
    110          CASE(  4  )                               ! 4th order centered 
    111             ztu(:,:,jpk) = 0._wp                            ! Bottom value : flux set to zero 
     108         CASE(  4  )                         !* 4th order centered 
     109            ztu(:,:,jpk) = 0._wp                   ! Bottom value : flux set to zero 
    112110            ztv(:,:,jpk) = 0._wp 
    113             DO jk = 1, jpkm1                                 ! gradient 
    114                DO jj = 2, jpjm1                                   ! masked derivative 
     111            DO jk = 1, jpkm1                       ! masked gradient 
     112               DO jj = 2, jpjm1 
    115113                  DO ji = fs_2, fs_jpim1   ! vector opt. 
    116114                     ztu(ji,jj,jk) = ( ptn(ji+1,jj  ,jk,jn) - ptn(ji,jj,jk,jn) ) * umask(ji,jj,jk) 
     
    121119            CALL lbc_lnk( ztu, 'U', -1. )   ;    CALL lbc_lnk( ztv, 'V', -1. )   ! Lateral boundary cond. (unchanged sgn) 
    122120            ! 
    123             DO jk = 1, jpkm1                                 ! Horizontal advective fluxes 
     121            DO jk = 1, jpkm1                       ! Horizontal advective fluxes 
    124122               DO jj = 2, jpjm1 
    125123                  DO ji = 1, fs_jpim1   ! vector opt. 
     
    140138         END SELECT 
    141139         ! 
    142          !                             !==  Vertical fluxes  ==! 
    143          ! 
    144          SELECT CASE( kn_cen_v )             !* interior fluxes 
    145          ! 
    146          CASE(  2  )                               ! 2nd order centered 
     140         SELECT CASE( kn_cen_v )       !--  Vertical fluxes  --!   (interior) 
     141         ! 
     142         CASE(  2  )                         !* 2nd order centered 
    147143            DO jk = 2, jpk 
    148144               DO jj = 2, jpjm1 
     
    153149            END DO 
    154150            ! 
    155          CASE(  4  )                               ! 4th order centered 
    156             CALL interp_4th_cpt( ptn(:,:,:,jn) , ztw )         ! 4th order compact interpolation of T at w-point 
     151         CASE(  4  )                         !* 4th order compact 
     152            CALL interp_4th_cpt( ptn(:,:,:,jn) , ztw )      ! ztw = interpolated value of T at w-point 
    157153            DO jk = 2, jpkm1 
    158154               DO jj = 2, jpjm1 
     
    165161         END SELECT 
    166162         ! 
    167          IF(.NOT.lk_vvl ) THEN               !* top value   (only in linear free surf. as zwz is multiplied by wmask) 
     163         IF( ln_linssh ) THEN                !* top value   (linear free surf. only as zwz is multiplied by wmask) 
    168164            IF( ln_isfcav ) THEN                  ! ice-shelf cavities (top of the ocean) 
    169165               DO jj = 1, jpj 
    170166                  DO ji = 1, jpi 
    171                      zwz(ji,jj, mikt(ji,jj) ) = pwn(ji,jj,mikt(ji,jj)) * ptn(ji,jj,mikt(ji,jj),jn)   ! linear free surface  
     167                     zwz(ji,jj, mikt(ji,jj) ) = pwn(ji,jj,mikt(ji,jj)) * ptn(ji,jj,mikt(ji,jj),jn)  
    172168                  END DO 
    173169               END DO    
     
    183179                     &             - (  zwx(ji,jj,jk) - zwx(ji-1,jj  ,jk  )    & 
    184180                     &                + zwy(ji,jj,jk) - zwy(ji  ,jj-1,jk  )    & 
    185                      &                + zwz(ji,jj,jk) - zwz(ji  ,jj  ,jk+1)  ) / ( e1e2t(ji,jj) *  fse3t_n(ji,jj,jk) ) 
     181                     &                + zwz(ji,jj,jk) - zwz(ji  ,jj  ,jk+1)  ) * r1_e1e2t(ji,jj) / e3t_n(ji,jj,jk) 
    186182               END DO 
    187183            END DO 
    188184         END DO 
    189          !                                 ! trend diagnostics 
     185         !                             ! trend diagnostics 
    190186         IF( ( cdtype == 'TRA' .AND. l_trdtra ) .OR. ( cdtype == 'TRC' .AND. l_trdtrc ) ) THEN 
    191187            CALL trd_tra( kt, cdtype, jn, jptra_xad, zwx, pun, ptn(:,:,:,jn) ) 
     
    193189            CALL trd_tra( kt, cdtype, jn, jptra_zad, zwz, pwn, ptn(:,:,:,jn) ) 
    194190         END IF 
    195          !                                 ! "Poleward" heat and salt transports (contribution of upstream fluxes) 
     191         !                             ! "Poleward" heat and salt transports (contribution of upstream fluxes) 
    196192         IF( cdtype == 'TRA' .AND. ln_diaptr ) THEN   
    197            IF( jn == jp_tem )  htr_adv(:) = ptr_sj( zwy(:,:,:) ) 
    198            IF( jn == jp_sal )  str_adv(:) = ptr_sj( zwy(:,:,:) ) 
     193           IF( jn == jp_tem )   htr_adv(:) = ptr_sj( zwy(:,:,:) ) 
     194           IF( jn == jp_sal )   str_adv(:) = ptr_sj( zwy(:,:,:) ) 
    199195         ENDIF 
    200196         ! 
Note: See TracChangeset for help on using the changeset viewer.