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.
ticket/0664_TRA_TRP (diff) – NEMO

Changes between Version 1 and Version 2 of ticket/0664_TRA_TRP


Ignore:
Timestamp:
2010-04-27T12:20:27+02:00 (14 years ago)
Author:
cetlod
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ticket/0664_TRA_TRP

    v1 v2  
    1919'''Strategy''' 
    2020[[BR]] 
    21 (1) 
    2221 
     22'''(1)''' Creation of advection/diffusion modules with 4D tracer array as input argument[[BR]] 
     23 
     24{{{ 
     25   SUBROUTINE tra_adv_cen2( kt, cdtype, pun, pvn, pwn, ptrab, ptran, ptraa ) 
     26      !!---------------------------------------------------------------------- 
     27      !!                  ***  ROUTINE tra_adv_cen2  *** 
     28      !! 
     29      !! ** Purpose : 
     30      !! 
     31      !! ** Method  :  
     32      !!---------------------------------------------------------------------- 
     33      INTEGER         , INTENT(in   )                         ::   kt              ! ocean time-step index 
     34      CHARACTER(len=3), INTENT(in   )                         ::   cdtype          ! =TRA or TRC (tracer indicator) 
     35      REAL(wp)        , INTENT(in   ), DIMENSION(:,:,:  )     ::   pun, pvn, pwn   ! 3 ocean velocity ( fluxes ) components 
     36      REAL(wp)        , INTENT(in   ), DIMENSION(:,:,:  )     ::   ptrab, ptran    ! before and now tracer fields 
     37      REAL(wp)        , INTENT(inout), DIMENSION(:,:,:,:)     ::   ptraa           ! tracer trend 
     38}}} 
     39 
     40'''(2)''' Test for T & S 3D arrays by using the fortran ''RESHAPE'' function [[BR]] 
     41 
     42 
     43{{{ 
     44   SUBROUTINE tra_adv( kt ) 
     45      !!---------------------------------------------------------------------- 
     46      !!                  ***  ROUTINE tra_adv  *** 
     47      !! 
     48      !! ** Purpose :   
     49      !! 
     50      !! ** Method  :  
     51      !!---------------------------------------------------------------------- 
     52      INTEGER, INTENT( in ) ::   kt   ! ocean time-step index 
     53      !! 
     54      INTEGER ::   jk   ! dummy loop index 
     55      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zun, zvn, zwn   ! effective transports 
     56      !!---------------------------------------------------------------------- 
     57 
     58      !                                              ! effective transport 
     59      DO jk = 1, jpkm1 
     60#if defined key_trabbl_adv 
     61         !                                                ! eulerian + bbl transport 
     62         zun(:,:,jk) = e2u(:,:) * fse3u(:,:,jk) * ( un(:,:,jk) - u_bbl(:,:,jk) ) 
     63         zvn(:,:,jk) = e1v(:,:) * fse3v(:,:,jk) * ( vn(:,:,jk) - v_bbl(:,:,jk) ) 
     64         zwn(:,:,jk) = e1t(:,:) * e2t(:,:)      * ( wn(:,:,jk) + w_bbl(:,:,jk) ) 
     65#else 
     66         !                                                ! eulerian transport only 
     67         zun(:,:,jk) = e2u(:,:) * fse3u(:,:,jk) *   un(:,:,jk) 
     68         zvn(:,:,jk) = e1v(:,:) * fse3v(:,:,jk) *   vn(:,:,jk) 
     69         zwn(:,:,jk) = e1t(:,:) * e2t(:,:)      *   wn(:,:,jk) 
     70#endif 
     71      END DO 
     72      zwn(:,:,jpk) = 0.e0                                 ! no transport trough the bottom 
     73 
     74      !                                                   ! add the eiv transport (if necessary) 
     75      IF( lk_traldf_eiv )   CALL tra_adv_eiv( kt, zun, zvn, zwn ) 
     76 
     77      CALL tra_adv_cen2( kt, 'TRA', zun, zvn, zwn                        ,  & 
     78         &                          RESHAPE( tb, (/jpi,jpj,jpk,2/), sb ) ,  & 
     79         &                          RESHAPE( tn, (/jpi,jpj,jpk,2/), sn ) ,  & 
     80         &                          RESHAPE( ta, (/jpi,jpj,jpk,2/), sa )      )    ! 2nd order centered 
     81}}} 
    2382 
    2483