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 503 for trunk/NEMO/OPA_SRC/TRA/tranxt.F90 – NEMO

Ignore:
Timestamp:
2006-09-27T10:52:29+02:00 (18 years ago)
Author:
opalod
Message:

nemo_v1_update_064 : CT : general trends update including the addition of mean windows analysis possibility in the mixed layer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/OPA_SRC/TRA/tranxt.F90

    r457 r503  
    44   !! Ocean active tracers:  time stepping on temperature and salinity 
    55   !!====================================================================== 
    6    !! History : 
    7    !!   7.0  !  91-11  (G. Madec)  Original code 
    8    !!        !  93-03  (M. Guyon)  symetrical conditions 
    9    !!        !  96-02  (G. Madec & M. Imbard)  opa release 8.0 
    10    !!   8.0  !  96-04  (A. Weaver)  Euler forward step 
    11    !!   8.2  !  99-02  (G. Madec, N. Grima)  semi-implicit pressure grad. 
    12    !!   8.5  !  02-08  (G. Madec)  F90: Free form and module 
    13    !!        !  02-11  (C. Talandier, A-M Treguier) Open boundaries 
    14    !!   9.0  !  06-02  (L. Debreu, C. Mazauric) Agrif implementation 
     6   !! History :  7.0  !  91-11  (G. Madec)  Original code 
     7   !!                 !  93-03  (M. Guyon)  symetrical conditions 
     8   !!                 !  96-02  (G. Madec & M. Imbard)  opa release 8.0 
     9   !!            8.0  !  96-04  (A. Weaver)  Euler forward step 
     10   !!            8.2  !  99-02  (G. Madec, N. Grima)  semi-implicit pressure grad. 
     11   !!            8.5  !  02-08  (G. Madec)  F90: Free form and module 
     12   !!                 !  02-11  (C. Talandier, A-M Treguier) Open boundaries 
     13   !!                 !  05-04  (C. Deltel) Add Asselin trend in the ML budget 
     14   !!            9.0  !  06-02  (L. Debreu, C. Mazauric) Agrif implementation 
     15   !!---------------------------------------------------------------------- 
     16 
    1517   !!---------------------------------------------------------------------- 
    1618   !!   tra_nxt     : time stepping on temperature and salinity 
    1719   !!---------------------------------------------------------------------- 
    18    !! * Modules used 
    1920   USE oce             ! ocean dynamics and tracers variables 
    2021   USE dom_oce         ! ocean space and time domain variables  
     
    2324   USE lbclnk          ! ocean lateral boundary conditions (or mpp link) 
    2425   USE obctra          ! open boundary condition (obc_tra routine) 
     26   USE trdmod          ! ocean active tracers trends  
     27   USE trdmod_oce      ! ocean variables trends 
    2528   USE prtctl          ! Print control 
    2629   USE agrif_opa_update 
     
    3134 
    3235   !! * Routine accessibility 
    33    PUBLIC tra_nxt          ! routine called by step.F90 
    34    !!---------------------------------------------------------------------- 
    35    !!   OPA 9.0 , LOCEAN-IPSL (2005)  
     36   PUBLIC   tra_nxt   ! routine called by step.F90 
     37   !!---------------------------------------------------------------------- 
     38   !!   OPA 9.0 , LOCEAN-IPSL (2006)  
    3639   !! $Header$  
    37    !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt  
     40   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    3841   !!---------------------------------------------------------------------- 
    3942 
     
    6770      !! ** Action  : - update (tb,sb) and (tn,sn)  
    6871      !!              - (ta,sa) time averaged (t,s)      (ln_dynhpg_imp = T) 
    69       !! 
    7072      !!---------------------------------------------------------------------- 
    71       !! * Arguments 
    72       INTEGER, INTENT( in ) ::   kt         ! ocean time-step index 
    73  
    74       !! * Local declarations 
    75       INTEGER ::   ji, jj, jk   ! dummy loop indices 
    76       REAL(wp) ::   zt, zs      ! temporary scalars 
    77       REAL(wp) ::   zfact       ! temporary scalar 
     73      USE oce, ONLY :    ztrdt => ua   ! use ua as 3D workspace    
     74      USE oce, ONLY :    ztrds => va   ! use va as 3D workspace    
     75      !! 
     76      INTEGER, INTENT(in) ::   kt    ! ocean time-step index 
     77      !! 
     78      INTEGER  ::   ji, jj, jk   ! dummy loop indices 
     79      REAL(wp) ::   zt, zs       ! temporary scalars 
     80      REAL(wp) ::   zfact        ! temporary scalar 
    7881      !!---------------------------------------------------------------------- 
    7982 
    80  
     83      IF( l_trdtra ) THEN 
     84         ztrdt(:,:,jpk) = 0.e0 
     85         ztrds(:,:,jpk) = 0.e0 
     86      ENDIF 
    8187      ! 0. Lateral boundary conditions on ( ta, sa )   (T-point, unchanged sign) 
    8288      ! ---------------------------------============ 
     
    8490      CALL lbc_lnk( sa, 'T', 1. ) 
    8591 
    86  
    8792      !                                                ! =============== 
    8893      DO jk = 1, jpkm1                                 ! Horizontal slab 
     
    9398         IF( ln_zdfexp ) THEN 
    9499            zfact = 2. * rdttra(jk) 
    95             IF( neuler == 0 .AND. kt == nit000 ) zfact = rdttra(jk) 
     100            IF( neuler == 0 .AND. kt == nit000 )   zfact = rdttra(jk) 
    96101            ta(:,:,jk) = ( tb(:,:,jk) + zfact * ta(:,:,jk) ) * tmask(:,:,jk) 
    97102            sa(:,:,jk) = ( sb(:,:,jk) + zfact * sa(:,:,jk) ) * tmask(:,:,jk) 
     103            IF(l_trdtra)   CALL ctl_stop( 'tranxt: Asselin ML trend not yet accounted for.' ) 
    98104         ENDIF 
    99105 
     
    102108      END DO                                           !   End of slab 
    103109      !                                                ! =============== 
    104  
    105110      ! Update tracers on open boundaries. 
    106111      CALL obc_tra( kt ) 
    107  
    108112      !                                                ! =============== 
    109113      DO jk = 1, jpkm1                                 ! Horizontal slab 
     
    114118      END DO                                           !   End of slab 
    115119      !                                                ! =============== 
    116  
    117120      ! Update tracers on open boundaries. 
    118121      CALL Agrif_tra( kt ) 
    119  
    120122      !                                                ! =============== 
    121123      DO jk = 1, jpkm1                                 ! Horizontal slab 
    122124         !                                             ! =============== 
    123125#endif 
    124  
    125  
    126126         ! 2. Time filter and swap of arrays 
    127127         ! --------------------------------- 
     
    141141                  END DO 
    142142               END DO 
     143               IF( l_trdtra ) THEN 
     144                  ztrdt(:,:,jk) = 0.e0 
     145                  ztrds(:,:,jk) = 0.e0 
     146               END IF 
    143147            ELSE 
    144148               DO jj = 1, jpj 
     
    148152                     tb(ji,jj,jk) = atfp  * ( tb(ji,jj,jk) + ta(ji,jj,jk) ) + atfp1 * tn(ji,jj,jk) 
    149153                     sb(ji,jj,jk) = atfp  * ( sb(ji,jj,jk) + sa(ji,jj,jk) ) + atfp1 * sn(ji,jj,jk) 
     154                     IF( l_trdtra ) THEN ! ChD ceci est a optimiser, mais ca marche 
     155                        ztrdt(ji,jj,jk) = tb(ji,jj,jk) - tn(ji,jj,jk) 
     156                        ztrds(ji,jj,jk) = sb(ji,jj,jk) - sn(ji,jj,jk) 
     157                     END IF 
    150158                     tn(ji,jj,jk) = ta(ji,jj,jk) 
    151159                     sn(ji,jj,jk) = sa(ji,jj,jk) 
     
    165173                  END DO 
    166174               END DO 
     175               IF( l_trdtra ) THEN 
     176                  ztrdt(:,:,jk) = 0.e0 
     177                  ztrds(:,:,jk) = 0.e0 
     178               END IF 
    167179            ELSE 
     180               IF( l_trdtra ) THEN 
     181                  DO jj = 1, jpj 
     182                     DO ji = 1, jpi 
     183                        ztrdt(ji,jj,jk) = atfp * ( tb(ji,jj,jk) - 2*tn(ji,jj,jk) + ta(ji,jj,jk) ) 
     184                        ztrds(ji,jj,jk) = atfp * ( sb(ji,jj,jk) - 2*sn(ji,jj,jk) + sa(ji,jj,jk) ) 
     185                     END DO 
     186                  END DO 
     187               END IF 
    168188               DO jj = 1, jpj 
    169189                  DO ji = 1, jpi 
     
    180200      !                                                ! =============== 
    181201 
    182       IF(ln_ctl) THEN         ! print mean field (used for debugging) 
    183          CALL prt_ctl(tab3d_1=tn, clinfo1=' nxt  - Tn: ', mask1=tmask, & 
    184             &         tab3d_2=sn, clinfo2=' Sn: ', mask2=tmask) 
    185       ENDIF 
    186        
     202      IF( l_trdtra )   THEN      ! Take the Asselin trend into account  
     203         ztrdt(:,:,:) = ztrdt(:,:,:) / ( 2.*rdt ) 
     204         ztrds(:,:,:) = ztrds(:,:,:) / ( 2.*rdt )          
     205         CALL trd_mod( ztrdt, ztrds, jptra_trd_atf, 'TRA', kt ) 
     206      END IF 
     207 
     208      IF(ln_ctl)   CALL prt_ctl( tab3d_1=tn, clinfo1=' nxt  - Tn: ', mask1=tmask,   & 
     209         &                       tab3d_2=sn, clinfo2=       ' Sn: ', mask2=tmask ) 
    187210#if defined key_agrif 
    188211      IF (.NOT.Agrif_Root())    CALL Agrif_Update_Tra( kt ) 
    189212#endif       
    190  
     213      ! 
    191214   END SUBROUTINE tra_nxt 
    192215 
Note: See TracChangeset for help on using the changeset viewer.