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

Ignore:
Timestamp:
2017-02-06T10:25:03+01:00 (7 years ago)
Author:
timgraham
Message:

Merge of dev_merge_2016 into trunk. UPDATE TO ARCHFILES NEEDED for XIOS2.
LIM_SRC_s/limrhg.F90 to follow in next commit due to change of kind (I'm unable to do it in this commit).
Merged using the following steps:

1) svn merge --reintegrate svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk .
2) Resolve minor conflicts in sette.sh and namelist_cfg for ORCA2LIM3 (due to a change in trunk after branch was created)
3) svn commit
4) svn switch svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk
5) svn merge svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/branches/2016/dev_merge_2016 .
6) At this stage I checked out a clean copy of the branch to compare against what is about to be committed to the trunk.
6) svn commit #Commit code to the trunk

In this commit I have also reverted a change to Fcheck_archfile.sh which was causing problems on the Paris machine.

File:
1 edited

Legend:

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

    r6140 r7646  
    99   !!            3.7  !  2014-05  (G. Madec)  Add 2nd/4th order cases for CEN and FCT schemes  
    1010   !!             -   !  2014-12  (G. Madec) suppression of cross land advection option 
     11   !!            3.6  !  2015-06  (E. Clementi) Addition of Stokes drift in case of wave coupling 
    1112   !!---------------------------------------------------------------------- 
    1213 
     
    2627   USE ldftra         ! lateral diffusion: eddy diffusivity & EIV coeff. 
    2728   USE ldfslp         ! Lateral diffusion: slopes of neutral surfaces 
     29   USE trd_oce         ! trends: ocean variables 
     30   USE trdtra          ! trends manager: tracers  
    2831   ! 
    2932   USE in_out_manager ! I/O manager 
     
    3336   USE wrk_nemo       ! Memory Allocation 
    3437   USE timing         ! Timing 
    35  
    36    USE diaptr          ! Poleward heat transport  
     38   USE sbcwave        ! wave module 
     39   USE sbc_oce        ! surface boundary condition: ocean 
     40   USE diaptr         ! Poleward heat transport  
    3741 
    3842   IMPLICIT NONE 
     
    8690      INTEGER ::   jk   ! dummy loop index 
    8791      REAL(wp), POINTER, DIMENSION(:,:,:) :: zun, zvn, zwn 
     92      REAL(wp), POINTER, DIMENSION(:,:,:) ::   ztrdt, ztrds   ! 3D workspace 
    8893      !!---------------------------------------------------------------------- 
    8994      ! 
     
    9398      ! 
    9499      !                                          ! set time step 
     100      zun(:,:,:) = 0.0 
     101      zvn(:,:,:) = 0.0 
     102      zwn(:,:,:) = 0.0 
     103      !     
    95104      IF( neuler == 0 .AND. kt == nit000 ) THEN     ! at nit000 
    96105         r2dt = rdt                                 ! = rdt (restarting with Euler time stepping) 
     
    100109      ! 
    101110      !                                         !==  effective transport  ==! 
    102       DO jk = 1, jpkm1 
    103          zun(:,:,jk) = e2u  (:,:) * e3u_n(:,:,jk) * un(:,:,jk)                  ! eulerian transport only 
    104          zvn(:,:,jk) = e1v  (:,:) * e3v_n(:,:,jk) * vn(:,:,jk) 
    105          zwn(:,:,jk) = e1e2t(:,:)                 * wn(:,:,jk) 
    106       END DO 
     111      IF( ln_wave .AND. ln_sdw )  THEN 
     112         DO jk = 1, jpkm1                                                       ! eulerian transport + Stokes Drift 
     113            zun(:,:,jk) = e2u  (:,:) * e3u_n(:,:,jk) * ( un(:,:,jk) + usd(:,:,jk) ) 
     114            zvn(:,:,jk) = e1v  (:,:) * e3v_n(:,:,jk) * ( vn(:,:,jk) + vsd(:,:,jk) ) 
     115            zwn(:,:,jk) = e1e2t(:,:)                 * ( wn(:,:,jk) + wsd(:,:,jk) ) 
     116         END DO 
     117      ELSE 
     118         DO jk = 1, jpkm1 
     119            zun(:,:,jk) = e2u  (:,:) * e3u_n(:,:,jk) * un(:,:,jk)               ! eulerian transport only 
     120            zvn(:,:,jk) = e1v  (:,:) * e3v_n(:,:,jk) * vn(:,:,jk) 
     121            zwn(:,:,jk) = e1e2t(:,:)                 * wn(:,:,jk) 
     122         END DO 
     123      ENDIF 
    107124      ! 
    108125      IF( ln_vvl_ztilde .OR. ln_vvl_layer ) THEN                                ! add z-tilde and/or vvl corrections 
     
    127144      IF( ln_diaptr )   CALL dia_ptr( zvn )                                    ! diagnose the effective MSF  
    128145!!gm ??? 
     146      ! 
     147      IF( l_trdtra )   THEN                    !* Save ta and sa trends 
     148         CALL wrk_alloc( jpi, jpj, jpk, ztrdt, ztrds ) 
     149         ztrdt(:,:,:) = tsa(:,:,:,jp_tem) 
     150         ztrds(:,:,:) = tsa(:,:,:,jp_sal) 
     151      ENDIF 
    129152      ! 
    130153      SELECT CASE ( nadv )                      !==  compute advection trend and add it to general trend  ==! 
     
    145168      END SELECT 
    146169      ! 
    147       !                                         ! print mean trends (used for debugging) 
     170      IF( l_trdtra )   THEN                      ! save the advective trends for further diagnostics 
     171         DO jk = 1, jpkm1 
     172            ztrdt(:,:,jk) = tsa(:,:,jk,jp_tem) - ztrdt(:,:,jk) 
     173            ztrds(:,:,jk) = tsa(:,:,jk,jp_sal) - ztrds(:,:,jk) 
     174         END DO 
     175         CALL trd_tra( kt, 'TRA', jp_tem, jptra_totad, ztrdt ) 
     176         CALL trd_tra( kt, 'TRA', jp_sal, jptra_totad, ztrds ) 
     177         CALL wrk_dealloc( jpi, jpj, jpk, ztrdt, ztrds ) 
     178      ENDIF 
     179      !                                              ! print mean trends (used for debugging) 
    148180      IF(ln_ctl)   CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' adv  - Ta: ', mask1=tmask,               & 
    149181         &                       tab3d_2=tsa(:,:,:,jp_sal), clinfo2=       ' Sa: ', mask2=tmask, clinfo3='tra' ) 
     
    255287         WRITE(numout,*) 
    256288         SELECT CASE ( nadv ) 
    257          CASE( np_NO_adv  )   ;   WRITE(numout,*) '         NO T-S advection' 
    258          CASE( np_CEN     )   ;   WRITE(numout,*) '         CEN      scheme is used. Horizontal order: ', nn_cen_h,   & 
     289         CASE( np_NO_adv  )   ;   WRITE(numout,*) '      ===>>   NO T-S advection' 
     290         CASE( np_CEN     )   ;   WRITE(numout,*) '      ===>>   CEN      scheme is used. Horizontal order: ', nn_cen_h,   & 
    259291            &                                                                     ' Vertical   order: ', nn_cen_v 
    260          CASE( np_FCT     )   ;   WRITE(numout,*) '         FCT      scheme is used. Horizontal order: ', nn_fct_h,   & 
     292         CASE( np_FCT     )   ;   WRITE(numout,*) '      ===>>   FCT      scheme is used. Horizontal order: ', nn_fct_h,   & 
    261293            &                                                                      ' Vertical   order: ', nn_fct_v 
    262          CASE( np_FCT_zts )   ;   WRITE(numout,*) '         use 2nd order FCT with ', nn_fct_zts,'vertical sub-timestepping' 
    263          CASE( np_MUS     )   ;   WRITE(numout,*) '         MUSCL    scheme is used' 
    264          CASE( np_UBS     )   ;   WRITE(numout,*) '         UBS      scheme is used' 
    265          CASE( np_QCK     )   ;   WRITE(numout,*) '         QUICKEST scheme is used' 
     294         CASE( np_FCT_zts )   ;   WRITE(numout,*) '      ===>>   use 2nd order FCT with ', nn_fct_zts,'vertical sub-timestepping' 
     295         CASE( np_MUS     )   ;   WRITE(numout,*) '      ===>>   MUSCL    scheme is used' 
     296         CASE( np_UBS     )   ;   WRITE(numout,*) '      ===>>   UBS      scheme is used' 
     297         CASE( np_QCK     )   ;   WRITE(numout,*) '      ===>>   QUICKEST scheme is used' 
    266298         END SELECT 
    267299      ENDIF 
Note: See TracChangeset for help on using the changeset viewer.