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 3318 for branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRD – NEMO

Ignore:
Timestamp:
2012-02-25T16:50:01+01:00 (12 years ago)
Author:
gm
Message:

Ediag branche: #927 split TRA/DYN trd computation

Location:
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRD
Files:
6 edited
1 copied
3 moved

Legend:

Unmodified
Added
Removed
  • branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRD/trd_oce.F90

    r3317 r3318  
    1 MODULE trdmod_oce 
     1MODULE trd_oce 
    22   !!====================================================================== 
    3    !!                   ***  MODULE trdmod_oce  *** 
     3   !!                   ***  MODULE trd_oce  *** 
    44   !! Ocean trends :   set tracer and momentum trend variables 
    55   !!====================================================================== 
     
    1313   PUBLIC 
    1414 
    15 #if  defined key_trdtra   &&   defined key_trddyn    ||   defined key_esopa 
    16    LOGICAL, PARAMETER ::   lk_trdtra = .TRUE.    !: tracers  trend flag 
    17    LOGICAL, PARAMETER ::   lk_trddyn = .TRUE.    !: momentum trend flag 
    18 #elif  defined key_trdtra 
    19    LOGICAL, PARAMETER ::   lk_trdtra = .TRUE.    !: tracers  trend flag 
    20    LOGICAL, PARAMETER ::   lk_trddyn = .FALSE.   !: momentum trend flag 
    21 #elif  defined key_trddyn 
    22    LOGICAL, PARAMETER ::   lk_trdtra = .FALSE.   !: tracers  trend flag 
    23    LOGICAL, PARAMETER ::   lk_trddyn = .TRUE.    !: momentum trend flag 
    24 #else 
    25    LOGICAL, PARAMETER ::   lk_trdtra = .FALSE.   !: tracers  trend flag 
    26    LOGICAL, PARAMETER ::   lk_trddyn = .FALSE.   !: momentum trend flag 
    27 #endif 
     15   !                                                   !!* Namelist namtrd:  diagnostics on dynamics/tracer trends * 
     16   LOGICAL , PUBLIC  ::   ln_dyn_trd   = .FALSE.        !: (T) 3D momentum             trends or (F) not 
     17   LOGICAL , PUBLIC  ::   ln_tra_trd   = .FALSE.        !: (T) 3D tracer               trends or (F) not 
     18   LOGICAL , PUBLIC  ::   ln_KE_trd    = .FALSE.        !: (T) 3D Kinetic   Energy     trends or (F) not 
     19   LOGICAL , PUBLIC  ::   ln_PE_trd    = .FALSE.        !: (T) 3D Potential Energy     trends or (F) not 
     20   LOGICAL , PUBLIC  ::   ln_vor_trd   = .FALSE.        !: (T) 3D barotropic vorticity trends or (F) not 
     21   LOGICAL , PUBLIC  ::   ln_glo_trd   = .FALSE.        !: (T) global domain averaged diag for T, T^2, KE, and PE 
     22   LOGICAL , PUBLIC  ::   ln_dyn_mld   = .FALSE.        !: (T) 2D tracer   trends averaged over the mixed layer  
     23   LOGICAL , PUBLIC  ::   ln_tra_mld   = .FALSE.        !: (T) 2D momentum trends averaged over the mixed layer  
     24   INTEGER , PUBLIC  ::   nn_trd  = 10                  !: time step frequency for ln_glo_trd 
     25   INTEGER , PUBLIC  ::   nn_ctls =  0                  !: control surface type for trends vertical integration 
     26   REAL(wp), PUBLIC  ::   rn_ucf   = 1.                 !: unit conversion factor (for netCDF trends outputs) 
     27                                                        !: =1. (=86400.) for degC/s (degC/day) and psu/s (psu/day) 
     28   CHARACTER(len=32) ::   cn_trdrst_in  = "restart_mld" !: suffix of ocean restart name (input) 
     29   CHARACTER(len=32) ::   cn_trdrst_out = "restart_mld" !: suffix of ocean restart name (output) 
     30   LOGICAL , PUBLIC  ::   ln_trdmld_instant = .FALSE.   !: flag to diagnose inst./mean ML T/S trends 
     31   LOGICAL , PUBLIC  ::   ln_trdmld_restart = .FALSE.   !: flag to restart mixed-layer diagnostics 
    2832 
    29    !                                                     !!* Namelist namtrd:  diagnostics on dynamics/tracer trends * 
    30    LOGICAL , PUBLIC  ::   ln_3D_trd_d   = .FALSE.         !: (T) 3D momentum              trends or (F) not 
    31    LOGICAL , PUBLIC  ::   ln_3D_trd_t   = .FALSE.         !: (T) 3D tracer               trends or (F) not 
    32    LOGICAL , PUBLIC  ::   ln_PE_trd     = .FALSE.         !: (T) 3D Potential Energy     trends or (F) not 
    33    LOGICAL , PUBLIC  ::   ln_KE_trd     = .FALSE.         !: (T) 3D Kinetic   Energy     trends or (F) not 
    34    LOGICAL , PUBLIC  ::   ln_vor_trd    = .FALSE.         !: (T) 3D barotropic vorticity trends or (F) not 
    35    LOGICAL , PUBLIC  ::   ln_glo_trd    = .FALSE.         !: (T) global domain averaged diag for T, T^2, KE, and PE 
    36    LOGICAL , PUBLIC  ::   ln_ML_trd_t   = .FALSE.         !: (T) 2D tracer   trends averaged over the mixed layer  
    37    LOGICAL , PUBLIC  ::   ln_ML_trd_d   = .FALSE.         !: (T) 2D momentum trends averaged over the mixed layer  
    38    INTEGER , PUBLIC  ::   nn_trd  = 10                    !: time step frequency for ln_glo_trd 
    39    INTEGER , PUBLIC  ::   nn_ctls =  0                    !: control surface type for trends vertical integration 
    40    REAL(wp), PUBLIC  ::   rn_ucf   = 1.                   !: unit conversion factor (for netCDF trends outputs) 
    41                                                           !: =1. (=86400.) for degC/s (degC/day) and psu/s (psu/day) 
    42    CHARACTER(len=32) ::   cn_trdrst_in  = "restart_mld"   !: suffix of ocean restart name (input) 
    43    CHARACTER(len=32) ::   cn_trdrst_out = "restart_mld"   !: suffix of ocean restart name (output) 
    44    LOGICAL , PUBLIC  ::   ln_trdmld_instant = .FALSE.     !: flag to diagnose inst./mean ML T/S trends 
    45    LOGICAL , PUBLIC  ::   ln_trdmld_restart = .FALSE.     !: flag to restart mixed-layer diagnostics 
    46  
    47 # if defined key_trdtra   ||   defined key_trdmld 
    48    LOGICAL , PUBLIC ::   l_trdtra = .TRUE.                !: tracers  trend flag 
     33   LOGICAL , PUBLIC ::   l_trdtra        !: tracers  trend flag (set from namelist in trdini) 
     34   LOGICAL , PUBLIC ::   l_trddyn        !: momentum trend flag (set from namelist in trdini) 
     35    
     36# if ( defined key_trdtrc && defined key_iomput )  ||  defined key_trdmld_trc 
     37   LOGICAL , PUBLIC ::   l_trdtrc = .TRUE.        !: tracers  trend flag 
    4938# else 
    50    LOGICAL , PUBLIC ::   l_trdtra = .FALSE.               !: tracers  trend flag 
     39   LOGICAL , PUBLIC ::   l_trdtrc = .FALSE.       !: tracers  trend flag 
    5140# endif 
    52 # if defined key_trddyn   ||   defined key_trdvor 
    53    LOGICAL , PUBLIC ::   l_trddyn = .TRUE.                !: momentum trend flag 
    54 # else 
    55    LOGICAL , PUBLIC ::   l_trddyn = .FALSE.               !: momentum trend flag 
    56 # endif 
    57 # if ( defined key_trdtrc && defined key_iomput )  ||  defined key_trdmld_trc 
    58    LOGICAL , PUBLIC ::   l_trdtrc = .TRUE.                !: tracers  trend flag 
    59 # else 
    60    LOGICAL , PUBLIC ::   l_trdtrc = .FALSE.               !: tracers  trend flag 
    61 # endif 
    62    !                                                      !!!* Active tracers trends indexes 
    63    INTEGER, PUBLIC, PARAMETER ::   jptot_tra      = 14     !: Total trend nb: change it when adding/removing one indice below 
    64    !                               ===================     !   
    65    INTEGER, PUBLIC, PARAMETER ::   jptra_trd_xad  =  1     !: x- horizontal advection 
    66    INTEGER, PUBLIC, PARAMETER ::   jptra_trd_yad  =  2     !: y- horizontal advection 
    67    INTEGER, PUBLIC, PARAMETER ::   jptra_trd_zad  =  3     !: z- vertical   advection 
    68    INTEGER, PUBLIC, PARAMETER ::   jptra_trd_sad  =  4     !: z- vertical   advection 
    69    INTEGER, PUBLIC, PARAMETER ::   jptra_trd_ldf  =  5     !: lateral       diffusion 
    70    INTEGER, PUBLIC, PARAMETER ::   jptra_trd_zdf  =  6     !: vertical      diffusion 
    71    INTEGER, PUBLIC, PARAMETER ::   jptra_trd_zdfp =  7     !: "PURE" vert.  diffusion (ln_traldf_iso=T) 
    72    INTEGER, PUBLIC, PARAMETER ::   jptra_trd_bbc  =  8     !: Bottom Boundary Condition (geoth. heating)  
    73    INTEGER, PUBLIC, PARAMETER ::   jptra_trd_bbl  =  9     !: Bottom Boundary Layer (diffusive and/or advective) 
    74    INTEGER, PUBLIC, PARAMETER ::   jptra_trd_npc  = 10     !: non-penetrative convection treatment 
    75    INTEGER, PUBLIC, PARAMETER ::   jptra_trd_dmp  = 11     !: internal restoring (damping) 
    76    INTEGER, PUBLIC, PARAMETER ::   jptra_trd_qsr  = 12     !: penetrative solar radiation 
    77    INTEGER, PUBLIC, PARAMETER ::   jptra_trd_nsr  = 13     !: non solar radiation / C/D on salinity  (+runoff if ln_rnf=T) 
    78    INTEGER, PUBLIC, PARAMETER ::   jptra_trd_atf  = 14     !: Asselin time filter 
     41   !                                                  !!!* Active tracers trends indexes 
     42   INTEGER, PUBLIC, PARAMETER ::   jptot_tra  = 14     !: Total trend nb: change it when adding/removing one indice below 
     43   !                               ===============     !   
     44   INTEGER, PUBLIC, PARAMETER ::   jptra_xad  =  1     !: x- horizontal advection 
     45   INTEGER, PUBLIC, PARAMETER ::   jptra_yad  =  2     !: y- horizontal advection 
     46   INTEGER, PUBLIC, PARAMETER ::   jptra_zad  =  3     !: z- vertical   advection 
     47   INTEGER, PUBLIC, PARAMETER ::   jptra_sad  =  4     !: z- vertical   advection 
     48   INTEGER, PUBLIC, PARAMETER ::   jptra_ldf  =  5     !: lateral       diffusion 
     49   INTEGER, PUBLIC, PARAMETER ::   jptra_zdf  =  6     !: vertical      diffusion 
     50   INTEGER, PUBLIC, PARAMETER ::   jptra_zdfp =  7     !: "PURE" vert.  diffusion (ln_traldf_iso=T) 
     51   INTEGER, PUBLIC, PARAMETER ::   jptra_bbc  =  8     !: Bottom Boundary Condition (geoth. heating)  
     52   INTEGER, PUBLIC, PARAMETER ::   jptra_bbl  =  9     !: Bottom Boundary Layer (diffusive and/or advective) 
     53   INTEGER, PUBLIC, PARAMETER ::   jptra_npc  = 10     !: non-penetrative convection treatment 
     54   INTEGER, PUBLIC, PARAMETER ::   jptra_dmp  = 11     !: internal restoring (damping) 
     55   INTEGER, PUBLIC, PARAMETER ::   jptra_qsr  = 12     !: penetrative solar radiation 
     56   INTEGER, PUBLIC, PARAMETER ::   jptra_nsr  = 13     !: non solar radiation / C/D on salinity  (+runoff if ln_rnf=T) 
     57   INTEGER, PUBLIC, PARAMETER ::   jptra_atf  = 14     !: Asselin time filter 
    7958   ! 
    80    !                                                      !!!* Passive tracers trends indices (use if "key_top" defined) 
    81    INTEGER, PUBLIC, PARAMETER ::   jptra_trd_sms  = 13     !: sources m. sinks 
    82    INTEGER, PUBLIC, PARAMETER ::   jptra_trd_radn = 14     !: corr. trn<0 in trcrad 
    83    INTEGER, PUBLIC, PARAMETER ::   jptra_trd_radb = 15     !: corr. trb<0 in trcrad (like atf) 
     59   !                                                  !!!* Passive tracers trends indices (use if "key_top" defined) 
     60   INTEGER, PUBLIC, PARAMETER ::   jptra_sms  = 15     !: sources m. sinks 
     61   INTEGER, PUBLIC, PARAMETER ::   jptra_radn = 16     !: corr. trn<0 in trcrad 
     62   INTEGER, PUBLIC, PARAMETER ::   jptra_radb = 17     !: corr. trb<0 in trcrad (like atf) 
    8463   ! 
    85    !                                                      !!!* Momentum trends indices 
    86    INTEGER, PUBLIC, PARAMETER ::   jptot_dyn      = 11     !: Total trend nb: change it when adding/removing one indice below 
    87    !                               ===================     !   
    88    INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_hpg  =  1     !: hydrostatic pressure gradient  
    89    INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_spg  =  2     !: surface     pressure gradient 
    90    INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_keg  =  3     !: kinetic energy gradient  or horizontal advection 
    91    INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_rvo  =  4     !: relative  vorticity      or metric term 
    92    INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_pvo  =  5     !: planetary vorticity 
    93    INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_zad  =  6     !: vertical advection 
    94    INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_ldf  =  7     !: horizontal diffusion    
    95    INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_zdf  =  8     !: vertical   diffusion 
    96    INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_tau  =  9     !: surface stress 
    97    INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_bfr  = 10     !: bottom  stress  
    98    INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_atf  = 11     !: Asselin time filter 
     64   !                                                  !!!* Momentum trends indices 
     65   INTEGER, PUBLIC, PARAMETER ::   jptot_dyn  = 11     !: Total trend nb: change it when adding/removing one indice below 
     66   !                               ===============     !   
     67   INTEGER, PUBLIC, PARAMETER ::   jpdyn_hpg  =  1     !: hydrostatic pressure gradient  
     68   INTEGER, PUBLIC, PARAMETER ::   jpdyn_spg  =  2     !: surface     pressure gradient 
     69   INTEGER, PUBLIC, PARAMETER ::   jpdyn_keg  =  3     !: kinetic energy gradient  or horizontal advection 
     70   INTEGER, PUBLIC, PARAMETER ::   jpdyn_rvo  =  4     !: relative  vorticity      or metric term 
     71   INTEGER, PUBLIC, PARAMETER ::   jpdyn_pvo  =  5     !: planetary vorticity 
     72   INTEGER, PUBLIC, PARAMETER ::   jpdyn_zad  =  6     !: vertical advection 
     73   INTEGER, PUBLIC, PARAMETER ::   jpdyn_ldf  =  7     !: horizontal diffusion    
     74   INTEGER, PUBLIC, PARAMETER ::   jpdyn_zdf  =  8     !: vertical   diffusion 
     75   INTEGER, PUBLIC, PARAMETER ::   jpdyn_tau  =  9     !: surface stress 
     76   INTEGER, PUBLIC, PARAMETER ::   jpdyn_bfr  = 10     !: bottom  stress  
     77   INTEGER, PUBLIC, PARAMETER ::   jpdyn_atf  = 11     !: Asselin time filter 
    9978   ! 
    10079   !!---------------------------------------------------------------------- 
     
    10382   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
    10483   !!====================================================================== 
    105 END MODULE trdmod_oce 
     84END MODULE trd_oce 
  • branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRD/trddyn.F90

    r3317 r3318  
    1 MODULE trdmod 
     1MODULE trddyn 
    22   !!====================================================================== 
    3    !!                       ***  MODULE  trdmod  *** 
    4    !! Ocean diagnostics:  ocean tracers and dynamic trends 
     3   !!                       ***  MODULE  trddyn  *** 
     4   !! Ocean diagnostics:  ocean dynamic trends 
    55   !!===================================================================== 
    6    !! History :  1.0  !  2004-08  (C. Talandier) Original code 
    7    !!             -   !  2005-04  (C. Deltel)    Add Asselin trend in the ML budget 
    8    !!            3.3  !  2010-10  (C. Ethe, G. Madec) reorganisation of initialisation phase 
    9    !!            3.5  !  2012-02  (G. Madec) add 3D trends output for T, S, U, V, PE and KE 
     6   !! History :  3.5  !  2012-02  (G. Madec) creation from trdmod: split DYN and TRA trends 
     7   !!                           and manage  3D trends output for U, V, and KE 
    108   !!---------------------------------------------------------------------- 
    11 #if  defined key_trdtra || defined key_trddyn || defined key_trdmld || defined key_trdvor || defined key_esopa 
     9 
    1210   !!---------------------------------------------------------------------- 
    13    !!   trd_mod       : manage the type of trend diagnostics 
    14    !!   trd_3Diom     : output 3D momentum and/or tracer trends using IOM 
    15    !!   trd_mod_init  : Initialization step 
     11   !!   trd_dyn       : manage the type of momentum trend diagnostics (3D I/O, domain averaged, KE) 
     12   !!   trd_dyn_iom   : output 3D momentum and/or tracer trends using IOM 
     13   !!   trd_dyn_init  : initialization step 
    1614   !!---------------------------------------------------------------------- 
    1715   USE oce            ! ocean dynamics and tracers variables 
    1816   USE dom_oce        ! ocean space and time domain variables 
    1917   USE zdf_oce        ! ocean vertical physics variables 
    20    USE trdmod_oce     ! ocean variables trends 
     18   USE trd_oce        ! trends: ocean variables 
    2119   USE zdfbfr         ! bottom friction 
    2220   USE ldftra_oce     ! ocean active tracers lateral physics 
     
    2422   USE phycst         ! physical constants 
    2523   USE trdvor         ! ocean vorticity trends  
    26    USE trdicp         ! ocean bassin integral constraints properties 
     24   USE trdglo         ! trends:global domain averaged 
    2725   USE trdmld         ! ocean active mixed layer tracers trends  
    2826   USE in_out_manager ! I/O manager 
     
    3432   PRIVATE 
    3533 
    36    REAL(wp) ::   r2dt          ! time-step, = 2 rdttra except at nit000 (=rdttra) if neuler=0 
     34   REAL(wp) ::   r2dt    ! time-step, = 2 rdttra except at nit000 (=rdttra) if neuler=0 
    3735 
    38    PUBLIC trd_mod              ! called by all dynXX or traXX modules 
    39    PUBLIC trd_mod_init         ! called by opa.F90 module 
     36   PUBLIC trd_dyn        ! called by all dynXX modules 
    4037 
    4138   !! * Substitutions 
     
    4946CONTAINS 
    5047 
    51    SUBROUTINE trd_mod( ptrdx, ptrdy, ktrd, ctype, kt ) 
     48   SUBROUTINE trd_dyn( putrd, pvtrd, ktrd, kt ) 
    5249      !!--------------------------------------------------------------------- 
    5350      !!                  ***  ROUTINE trd_mod  *** 
    5451      !!  
    55       !! ** Purpose :   Dispatch all trends computation, e.g. 3D output, integral 
    56       !!                constraints, barotropic vorticity, kinetic enrgy,  
    57       !!                potential energy, and/or mixed layer budget. 
     52      !! ** Purpose :   Dispatch momentum trend computation, e.g. 3D output,  
     53      !!              integral constraints, barotropic vorticity, kinetic enrgy,  
     54      !!              and/or mixed layer budget. 
    5855      !!---------------------------------------------------------------------- 
    59       REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   ptrdx   ! Temperature or U trend  
    60       REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   ptrdy   ! Salinity    or V trend 
    61       INTEGER                   , INTENT(in   ) ::   ktrd    ! tracer trend index 
    62       CHARACTER(len=3)          , INTENT(in   ) ::   ctype   ! momentum or tracers trends type 'DYN'/'TRA' 
    63       INTEGER                   , INTENT(in   ) ::   kt      ! time step 
     56      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   putrd, pvtrd   ! U and V trends  
     57      INTEGER                   , INTENT(in   ) ::   ktrd           ! trend index 
     58      INTEGER                   , INTENT(in   ) ::   kt             ! time step 
    6459      !! 
    6560      INTEGER ::   ji, jj   ! dummy loop indices 
     
    7368      ENDIF 
    7469 
    75       !                                            !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    76       IF( ln_3D_trd_d .OR. ln_3D_trd_t ) THEN      !   3D output of momentum and/or tracers trends using IOM interface 
    77          !                                         !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    78          CALL trd_3Diom ( ptrdx, ptrdy, ktrd, ctype, kt ) 
    79          ! 
    80       ENDIF 
    81          !                                         !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    82       IF( ln_glo_trd ) THEN                        ! I. Integral Constraints Properties for momentum and/or tracers trends 
    83          !                                         !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    84          CALL trd_budget( ptrdx, ptrdy, ktrd, ctype, kt ) 
    85          ! 
    86       ENDIF 
     70      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
     71      !   3D output of momentum and/or tracers trends using IOM interface 
     72      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
     73      IF( ln_dyn_trd )   CALL trd_dyn_iom( putrd, pvtrd, ktrd, kt ) 
     74          
     75      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
     76      !  Integral Constraints Properties for momentum and/or tracers trends 
     77      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
     78      IF( ln_glo_trd  )   CALL trd_glo( putrd, pvtrd, ktrd, 'DYN', kt ) 
    8779 
    88       !                                            !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    89       IF( lk_trdvor .AND. ctype == 'DYN' ) THEN    ! II. Vorticity trends 
    90          !                                         !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    91          SELECT CASE( ktrd )  
    92          CASE( jpdyn_trd_hpg )   ;   CALL trd_vor_zint( ptrdx, ptrdy, jpvor_prg )   ! Hydrostatique Pressure Gradient  
    93          CASE( jpdyn_trd_keg )   ;   CALL trd_vor_zint( ptrdx, ptrdy, jpvor_keg )   ! KE Gradient  
    94          CASE( jpdyn_trd_rvo )   ;   CALL trd_vor_zint( ptrdx, ptrdy, jpvor_rvo )   ! Relative Vorticity  
    95          CASE( jpdyn_trd_pvo )   ;   CALL trd_vor_zint( ptrdx, ptrdy, jpvor_pvo )   ! Planetary Vorticity Term  
    96          CASE( jpdyn_trd_ldf )   ;   CALL trd_vor_zint( ptrdx, ptrdy, jpvor_ldf )   ! Horizontal Diffusion  
    97          CASE( jpdyn_trd_zad )   ;   CALL trd_vor_zint( ptrdx, ptrdy, jpvor_zad )   ! Vertical Advection  
    98          CASE( jpdyn_trd_spg )   ;   CALL trd_vor_zint( ptrdx, ptrdy, jpvor_spg )   ! Surface Pressure Grad.  
    99          CASE( jpdyn_trd_zdf )                                                      ! Vertical Diffusion  
    100             ztswu(:,:) = 0.e0   ;   ztswv(:,:) = 0.e0 
    101             DO jj = 2, jpjm1                                                             ! wind stress trends 
    102                DO ji = fs_2, fs_jpim1   ! vector opt. 
    103                   ztswu(ji,jj) = 0.5 * ( utau_b(ji,jj) + utau(ji,jj) ) / ( fse3u(ji,jj,1) * rau0 ) 
    104                   ztswv(ji,jj) = 0.5 * ( vtau_b(ji,jj) + vtau(ji,jj) ) / ( fse3v(ji,jj,1) * rau0 ) 
    105                END DO 
    106             END DO 
    107             ! 
    108             CALL trd_vor_zint( ptrdx, ptrdy, jpvor_zdf )                             ! zdf trend including surf./bot. stresses  
    109             CALL trd_vor_zint( ztswu, ztswv, jpvor_swf )                             ! surface wind stress  
    110          CASE ( jpdyn_trd_bfr ) 
    111             CALL trd_vor_zint( ptrdx, ptrdy, jpvor_bfr )                             ! Bottom stress 
    112          END SELECT 
    113          ! 
    114       ENDIF 
     80      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
     81      !  Kinetic Energy trends 
     82      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     83!!gm      IF( ln_KE_trd  )   CALL trd_KE( putrd, pvtrd, ktrd, kt ) 
     84 
     85      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
     86      !  Vorticity trends 
     87      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     88      IF( ln_vor_trd  )   CALL trd_vor( putrd, pvtrd, ktrd, kt ) 
    11589 
    11690      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    117       ! III. Mixed layer trends for active tracers 
     91      ! Mixed layer trends for active tracers 
    11892      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    119  
    120       IF( lk_trdmld .AND. ctype == 'TRA' )   THEN    
    121          !----------------------------------------------------------------------------------------------- 
    122          ! W.A.R.N.I.N.G : 
    123          ! jptra_trd_ldf : called by traldf.F90 
    124          !                 at this stage we store: 
    125          !                  - the lateral geopotential diffusion (here, lateral = horizontal) 
    126          !                  - and the iso-neutral diffusion if activated  
    127          ! jptra_trd_zdf : called by trazdf.F90 
    128          !                 * in case of iso-neutral diffusion we store the vertical diffusion component in the  
    129          !                   lateral trend including the K_z contrib, which will be removed later (see trd_mld) 
    130          !----------------------------------------------------------------------------------------------- 
    131  
    132          SELECT CASE ( ktrd ) 
    133          CASE ( jptra_trd_xad )        ;   CALL trd_mld_zint( ptrdx, ptrdy, jpmld_xad, '3D' )   ! zonal    advection 
    134          CASE ( jptra_trd_yad )        ;   CALL trd_mld_zint( ptrdx, ptrdy, jpmld_yad, '3D' )   ! merid.   advection 
    135          CASE ( jptra_trd_zad )        ;   CALL trd_mld_zint( ptrdx, ptrdy, jpmld_zad, '3D' )   ! vertical advection 
    136          CASE ( jptra_trd_ldf )        ;   CALL trd_mld_zint( ptrdx, ptrdy, jpmld_ldf, '3D' )   ! lateral  diffusion 
    137          CASE ( jptra_trd_bbl )        ;   CALL trd_mld_zint( ptrdx, ptrdy, jpmld_bbl, '3D' )   ! bottom boundary layer 
    138          CASE ( jptra_trd_zdf ) 
    139             IF( ln_traldf_iso ) THEN   ;   CALL trd_mld_zint( ptrdx, ptrdy, jpmld_ldf, '3D' )   ! lateral  diffusion (K_z) 
    140             ELSE                       ;   CALL trd_mld_zint( ptrdx, ptrdy, jpmld_zdf, '3D' )   ! vertical diffusion (K_z) 
    141             ENDIF 
    142          CASE ( jptra_trd_dmp )        ;   CALL trd_mld_zint( ptrdx, ptrdy, jpmld_dmp, '3D' )   ! internal 3D restoring (tradmp) 
    143          CASE ( jptra_trd_qsr )        ;   CALL trd_mld_zint( ptrdx, ptrdy, jpmld_for, '3D' )   ! air-sea : penetrative sol radiat 
    144          CASE ( jptra_trd_nsr ) 
    145             ptrdx(:,:,2:jpk) = 0._wp   ;   ptrdy(:,:,2:jpk) = 0._wp 
    146             CALL trd_mld_zint( ptrdx, ptrdy, jpmld_for, '2D' )                                  ! air-sea : non penetr sol radiat 
    147          CASE ( jptra_trd_bbc )        ;   CALL trd_mld_zint( ptrdx, ptrdy, jpmld_bbc, '3D' )   ! bottom bound cond (geoth flux) 
    148          CASE ( jptra_trd_atf )        ;   CALL trd_mld_zint( ptrdx, ptrdy, jpmld_atf, '3D' )   ! asselin numerical 
    149          CASE ( jptra_trd_npc )        ;   CALL trd_mld_zint( ptrdx, ptrdy, jpmld_npc, '3D' )   ! non penetr convect adjustment 
    150          END SELECT 
    151          ! 
    152       ENDIF 
     93!!gm      IF( ln_dyn_mld )   CALL trd_mld_dyn    
    15394      ! 
    15495      CALL wrk_dealloc( jpi, jpj, ztswu, ztswv ) 
    15596      ! 
    156    END SUBROUTINE trd_mod 
     97   END SUBROUTINE trd_dyn 
    15798 
    15899 
    159    SUBROUTINE trd_3Diom( ptrdx, ptrdy, ktrd, ctype, kt ) 
     100   SUBROUTINE trd_dyn_iom( putrd, pvtrd, ktrd, kt ) 
    160101      !!--------------------------------------------------------------------- 
    161       !!                  ***  ROUTINE trd_3Diom  *** 
     102      !!                  ***  ROUTINE trd_dyn_iom  *** 
    162103      !!  
    163104      !! ** Purpose :   output 3D trends using IOM 
    164105      !!---------------------------------------------------------------------- 
    165       REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   ptrdx   ! Temperature or U trend  
    166       REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   ptrdy   ! Salinity    or V trend 
    167       INTEGER                   , INTENT(in   ) ::   ktrd    ! tracer trend index 
    168       CHARACTER(len=3)          , INTENT(in   ) ::   ctype   ! momentum or tracers trends type 'DYN'/'TRA' 
    169       INTEGER                   , INTENT(in   ) ::   kt      ! time step 
    170       !! 
     106      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   putrd, pvtrd   ! U and V trends 
     107      INTEGER                   , INTENT(in   ) ::   ktrd           ! trend index 
     108      INTEGER                   , INTENT(in   ) ::   kt             ! time step 
     109      ! 
    171110      INTEGER ::   ji, jj, jk   ! dummy loop indices 
    172111      INTEGER ::   ikbu, ikbv   ! local integers 
     
    174113      REAL(wp), POINTER, DIMENSION(:,:,:) ::   z3dx, z3dy                 ! 3D workspace  
    175114      !!---------------------------------------------------------------------- 
     115      ! 
     116      putrd(:,:,:) = putrd(:,:,:) * umask(:,:,:)                       ! mask the trends 
     117      pvtrd(:,:,:) = pvtrd(:,:,:) * vmask(:,:,:) 
    176118 
    177        IF( lk_trdtra .AND. ctype == 'TRA' ) THEN       ! active tracer trends 
    178          ! 
    179 !!gm Rq: mask the trends already masked in trd_tra, but lbc_lnk should probably be added 
    180          ! 
    181          SELECT CASE( ktrd ) 
    182          CASE( jptra_trd_xad  )   ;   CALL iom_put( "ttrd_xad" , ptrdx )        ! x- horizontal advection 
    183                                       CALL iom_put( "strd_xad" , ptrdy ) 
    184          CASE( jptra_trd_yad  )   ;   CALL iom_put( "ttrd_yad" , ptrdx )        ! y- horizontal advection 
    185                                       CALL iom_put( "strd_yad" , ptrdy ) 
    186          CASE( jptra_trd_zad  )   ;   CALL iom_put( "ttrd_zad" , ptrdx )        ! z- vertical   advection 
    187                                       CALL iom_put( "strd_zad" , ptrdy ) 
    188                                       IF( .NOT.lk_vvl ) THEN                   ! cst volume : adv flux through z=0 surface 
    189                                          z2dx(:,:) = wn(:,:,1) * tsn(:,:,1,jp_tem) / fse3t(:,:,1) 
    190                                          z2dy(:,:) = wn(:,:,1) * tsn(:,:,1,jp_sal) / fse3t(:,:,1) 
    191                                          CALL iom_put( "ttrd_sad", z2dx ) 
    192                                          CALL iom_put( "strd_sad", z2dy ) 
    193                                       ENDIF 
    194          CASE( jptra_trd_ldf  )   ;   CALL iom_put( "ttrd_ldf" , ptrdx )        ! lateral diffusion 
    195                                       CALL iom_put( "strd_ldf" , ptrdy ) 
    196          CASE( jptra_trd_zdf  )   ;   CALL iom_put( "ttrd_zdf" , ptrdx )        ! vertical diffusion (including Kz contribution) 
    197                                       CALL iom_put( "strd_zdf" , ptrdy ) 
    198          CASE( jptra_trd_zdfp )   ;   CALL iom_put( "ttrd_zdfp", ptrdx )        ! PURE vertical diffusion (no isoneutral contribution) 
    199                                       CALL iom_put( "strd_zdfp", ptrdy ) 
    200          CASE( jptra_trd_dmp  )   ;   CALL iom_put( "ttrd_dmp" , ptrdx )        ! internal restoring (damping) 
    201                                       CALL iom_put( "strd_dmp" , ptrdy ) 
    202          CASE( jptra_trd_bbl  )   ;   CALL iom_put( "ttrd_bbl" , ptrdx )        ! bottom boundary layer 
    203                                       CALL iom_put( "strd_bbl" , ptrdy ) 
    204          CASE( jptra_trd_npc  )   ;   CALL iom_put( "ttrd_npc" , ptrdx )        ! static instability mixing 
    205                                       CALL iom_put( "strd_npc" , ptrdy ) 
    206          CASE( jptra_trd_nsr  )   ;   CALL iom_put( "ttrd_qns" , ptrdx )        ! surface forcing + runoff (ln_rnf=T) 
    207                                       CALL iom_put( "strd_cdt" , ptrdy ) 
    208          CASE( jptra_trd_qsr  )   ;   CALL iom_put( "ttrd_qsr" , ptrdx )        ! penetrative solar radiat. (only on temperature) 
    209          CASE( jptra_trd_bbc  )   ;   CALL iom_put( "ttrd_bbc" , ptrdx )        ! geothermal heating   (only on temperature) 
    210          CASE( jptra_trd_atf  )   ;   CALL iom_put( "ttrd_atf" , ptrdx )        ! asselin time Filter 
    211                                       CALL iom_put( "strd_atf" , ptrdy ) 
     119!!gm NB : here a lbc_lnk should probably be added 
    212120 
    213          END SELECT 
    214       ENDIF 
     121      ! 
     122      SELECT CASE( ktrd ) 
     123      CASE( jpdyn_hpg )   ;   CALL iom_put( "utrd_hpg", putrd )    ! hydrostatic pressure gradient 
     124                              CALL iom_put( "vtrd_hpg", pvtrd ) 
     125      CASE( jpdyn_spg )   ;   CALL iom_put( "utrd_spg", putrd )    ! surface pressure gradient 
     126                              CALL iom_put( "vtrd_spg", pvtrd ) 
     127      CASE( jpdyn_pvo )   ;   CALL iom_put( "utrd_pvo", putrd )    ! planetary vorticity 
     128                              CALL iom_put( "vtrd_pvo", pvtrd ) 
     129      CASE( jpdyn_rvo )   ;   CALL iom_put( "utrd_rvo", putrd )    ! relative  vorticity     (or metric term) 
     130                              CALL iom_put( "vtrd_rvo", pvtrd ) 
     131      CASE( jpdyn_keg )   ;   CALL iom_put( "utrd_keg", putrd )    ! Kinetic Energy gradient (or had) 
     132                              CALL iom_put( "vtrd_keg", pvtrd ) 
     133         z3dx(:,:,:) = 0._wp                                           ! U.dxU & V.dyV (approximation) 
     134         z3dy(:,:,:) = 0._wp 
     135         DO jk = 1, jpkm1                                                  ! no mask as un,vn are masked 
     136            DO jj = 2, jpjm1 
     137                DO ji = 2, jpim1 
     138                  z3dx(ji,jj,jk) = un(ji,jj,jk) * ( un(ji+1,jj,jk) - un(ji-1,jj,jk) ) / ( 2._wp * e1u(ji,jj) ) 
     139                  z3dy(ji,jj,jk) = vn(ji,jj,jk) * ( vn(ji,jj+1,jk) - vn(ji,jj-1,jk) ) / ( 2._wp * e2v(ji,jj) ) 
     140               END DO 
     141            END DO 
     142         END DO 
     143         CALL lbc_lnk( z3dx, 'U', -1. )   ;    CALL lbc_lnk( z3dy, 'V', -1. ) 
     144                              CALL iom_put( "utrd_udx", z3dx  )  
     145                              CALL iom_put( "vtrd_vdy", z3dy  ) 
     146      CASE( jpdyn_zad )   ;   CALL iom_put( "utrd_zad", putrd )    ! vertical   advection 
     147                              CALL iom_put( "vtrd_zad", pvtrd ) 
     148      CASE( jpdyn_ldf )   ;   CALL iom_put( "utrd_ldf", putrd )    ! lateral diffusion 
     149                              CALL iom_put( "vtrd_ldf", pvtrd ) 
     150      CASE( jpdyn_zdf )   ;   CALL iom_put( "utrd_zdf", putrd )    ! vertical diffusion  
     151                              CALL iom_put( "vtrd_zdf", pvtrd ) 
     152                              !                                    ! wind stress trends 
     153                              z2dx(:,:) = ( utau_b(ji,jj) + utau(ji,jj) ) / ( fse3u(:,:,1) * rau0 ) 
     154                              z2dy(:,:) = ( vtau_b(ji,jj) + vtau(ji,jj) ) / ( fse3v(:,:,1) * rau0 ) 
     155                              CALL iom_put( "utrd_tau", z2dx ) 
     156                              CALL iom_put( "vtrd_tau", z2dy ) 
     157      CASE( jpdyn_bfr ) 
     158         IF( .NOT.ln_bfrimp )     CALL iom_put( "utrd_bfr", putrd )    ! bottom friction (explicit case) 
     159         IF( .NOT.ln_bfrimp )     CALL iom_put( "vtrd_bfr", pvtrd ) 
     160!!gm only valid if ln_bfrimp=T otherwise the bottom stress as to be recomputed at the end of the compuation.... 
    215161 
    216       IF( lk_trddyn .AND. ctype == 'DYN' ) THEN       ! momentum trends  
    217             ! 
    218          ptrdx(:,:,:) = ptrdx(:,:,:) * umask(:,:,:)                       ! mask the trends 
    219          ptrdy(:,:,:) = ptrdy(:,:,:) * vmask(:,:,:) 
    220 !!gm NB : here a lbc_lnk should probably be added 
    221          ! 
    222          SELECT CASE( ktrd ) 
    223          CASE( jpdyn_trd_hpg )   ;   CALL iom_put( "utrd_hpg", ptrdx )    ! hydrostatic pressure gradient 
    224                                      CALL iom_put( "vtrd_hpg", ptrdy ) 
    225          CASE( jpdyn_trd_spg )   ;   CALL iom_put( "utrd_spg", ptrdx )    ! surface pressure gradient 
    226                                      CALL iom_put( "vtrd_spg", ptrdy ) 
    227          CASE( jpdyn_trd_pvo )   ;   CALL iom_put( "utrd_pvo", ptrdx )    ! planetary vorticity 
    228                                      CALL iom_put( "vtrd_pvo", ptrdy ) 
    229          CASE( jpdyn_trd_rvo )   ;   CALL iom_put( "utrd_rvo", ptrdx )    ! relative  vorticity     (or metric term) 
    230                                      CALL iom_put( "vtrd_rvo", ptrdy ) 
    231          CASE( jpdyn_trd_keg )   ;   CALL iom_put( "utrd_keg", ptrdx )    ! Kinetic Energy gradient (or had) 
    232                                      CALL iom_put( "vtrd_keg", ptrdy ) 
    233             z3dx(:,:,:) = 0._wp                                           ! U.dxU & V.dyV (approximation) 
    234             z3dy(:,:,:) = 0._wp 
    235             DO jk = 1, jpkm1                                                  ! no mask as un,vn are masked 
     162      CASE( jpdyn_atf )   ;   CALL iom_put( "utrd_atf", putrd )    ! asselin filter trends  
     163                              CALL iom_put( "vtrd_atf", pvtrd ) 
     164         IF( ln_bfrimp ) THEN                                          ! bottom friction (implicit case) 
     165            z3dx(:,:,:) = 0._wp   ;   z3dy(:,:,:) = 0._wp                 ! after velocity known (now filed at this stage) 
     166            DO jk = 1, jpkm1 
    236167               DO jj = 2, jpjm1 
    237168                  DO ji = 2, jpim1 
    238                      z3dx(ji,jj,jk) = un(ji,jj,jk) * ( un(ji+1,jj,jk) - un(ji-1,jj,jk) ) / ( 2._wp * e1u(ji,jj) ) 
    239                      z3dy(ji,jj,jk) = vn(ji,jj,jk) * ( vn(ji,jj+1,jk) - vn(ji,jj-1,jk) ) / ( 2._wp * e2v(ji,jj) ) 
     169                     ikbu = mbku(ji,jj)          ! deepest ocean u- & v-levels 
     170                     ikbv = mbkv(ji,jj) 
     171                     z3dx(ji,jj,jk) = bfrua(ji,jj) * un(ji,jj,ikbu) / fse3u(ji,jj,ikbu) 
     172                     z3dy(ji,jj,jk) = bfrva(ji,jj) * vn(ji,jj,ikbv) / fse3v(ji,jj,ikbv) 
    240173                  END DO 
    241174               END DO 
    242175            END DO 
    243             CALL lbc_lnk( z3dx, 'U', -1. )   ;    CALL lbc_lnk( z3dy, 'V', -1. ) 
    244                                      CALL iom_put( "utrd_udx", z3dx  )  
    245                                      CALL iom_put( "vtrd_vdy", z3dy  ) 
    246          CASE( jpdyn_trd_zad )   ;   CALL iom_put( "utrd_zad", ptrdx )    ! vertical   advection 
    247                                      CALL iom_put( "vtrd_zad", ptrdy ) 
    248          CASE( jpdyn_trd_ldf )   ;   CALL iom_put( "utrd_ldf", ptrdx )    ! lateral diffusion 
    249                                      CALL iom_put( "vtrd_ldf", ptrdy ) 
    250          CASE( jpdyn_trd_zdf )   ;   CALL iom_put( "utrd_zdf", ptrdx )    ! vertical diffusion  
    251                                      CALL iom_put( "vtrd_zdf", ptrdy ) 
    252                                      !                                    ! wind stress trends 
    253                                      z2dx(:,:) = ( utau_b(ji,jj) + utau(ji,jj) ) / ( fse3u(:,:,1) * rau0 ) 
    254                                      z2dy(:,:) = ( vtau_b(ji,jj) + vtau(ji,jj) ) / ( fse3v(:,:,1) * rau0 ) 
    255                                      CALL iom_put( "utrd_tau", z2dx ) 
    256                                      CALL iom_put( "vtrd_tau", z2dy ) 
    257          CASE( jpdyn_trd_bfr ) 
    258             IF( .NOT.ln_bfrimp )     CALL iom_put( "utrd_bfr", ptrdx )    ! bottom friction (explicit case) 
    259             IF( .NOT.ln_bfrimp )     CALL iom_put( "vtrd_bfr", ptrdy ) 
    260 !!gm only valid if ln_bfrimp=T otherwise the bottom stress as to be recomputed.... 
    261  
    262          CASE( jpdyn_trd_atf )   ;   CALL iom_put( "utrd_atf", ptrdx )    ! asselin filter trends  
    263                                      CALL iom_put( "vtrd_atf", ptrdy ) 
    264             IF( ln_bfrimp ) THEN                                          ! bottom friction (implicit case) 
    265                z3dx(:,:,:) = 0._wp   ;   z3dy(:,:,:) = 0._wp                 ! after velocity known (now filed at this stage) 
    266                DO jk = 1, jpkm1 
    267                   DO jj = 2, jpjm1 
    268                      DO ji = 2, jpim1 
    269                         ikbu = mbku(ji,jj)          ! deepest ocean u- & v-levels 
    270                         ikbv = mbkv(ji,jj) 
    271                         z3dx(ji,jj,jk) = bfrua(ji,jj) * un(ji,jj,ikbu) / fse3u(ji,jj,ikbu) 
    272                         z3dy(ji,jj,jk) = bfrva(ji,jj) * vn(ji,jj,ikbv) / fse3v(ji,jj,ikbv) 
    273                      END DO 
    274                   END DO 
    275                END DO 
    276                                      CALL iom_put( "utrd_bfr", z3dx )    ! bottom friction (implicit) 
    277                                      CALL iom_put( "vtrd_bfr", z3dy ) 
    278             ENDIF 
    279             ! 
    280          END SELECT 
     176                              CALL iom_put( "utrd_bfr", z3dx )    ! bottom friction (implicit) 
     177                              CALL iom_put( "vtrd_bfr", z3dy ) 
     178         ENDIF 
    281179         ! 
    282       ENDIF 
     180      END SELECT 
    283181      ! 
    284182      CALL wrk_dealloc( jpi, jpj     , z2dx, z2dy, ztswu, ztswv ) 
    285183      CALL wrk_dealloc( jpi, jpj, jpk, z3dx, z3dy ) 
    286184      ! 
    287    END SUBROUTINE trd_3Diom 
    288  
    289 #else 
    290    !!---------------------------------------------------------------------- 
    291    !!   Default case :           Empty module          No trend diagnostics 
    292    !!---------------------------------------------------------------------- 
    293 CONTAINS 
    294    SUBROUTINE trd_mod( ptrdx, ptrdy, ktrd, ctype, kt )   ! Empty routine 
    295       REAL ::   ptrdx(:,:,:), ptrdy(:,:,:) 
    296       INTEGER  ::   ktrd, kt                             
    297       CHARACTER(len=3) ::  ctype                   
    298       WRITE(*,*) 'trd_mod: You should not have seen this print! error ?',   & 
    299          &       ptrdx(1,1,1), ptrdy(1,1,1), ktrd, ctype, kt 
    300    END SUBROUTINE trd_mod 
    301 #endif 
    302  
    303    SUBROUTINE trd_mod_init 
    304       !!---------------------------------------------------------------------- 
    305       !!                  ***  ROUTINE trd_mod_init  *** 
    306       !!  
    307       !! ** Purpose :   Initialization of activated trends 
    308       !!---------------------------------------------------------------------- 
    309       USE in_out_manager          ! I/O manager 
    310  
    311       NAMELIST/namtrd/ ln_3D_trd_d, ln_KE_trd, ln_vor_trd, ln_ML_trd_d,   & 
    312          &             ln_3D_trd_t, ln_PE_trd, ln_glo_trd, ln_ML_trd_t,   & 
    313          &             nn_trd , cn_trdrst_in , ln_trdmld_restart,         & 
    314          &             nn_ctls, cn_trdrst_out, ln_trdmld_instant, rn_ucf 
    315       !!---------------------------------------------------------------------- 
    316  
    317       IF( l_trdtra .OR. l_trddyn )   THEN 
    318          REWIND( numnam ) 
    319          READ  ( numnam, namtrd )      ! namelist namtrd : trends diagnostic 
    320  
    321          IF(lwp) THEN 
    322             WRITE(numout,*) 
    323             WRITE(numout,*) ' trd_mod_init : Momentum/Tracers trends' 
    324             WRITE(numout,*) ' ~~~~~~~~~~~~~' 
    325             WRITE(numout,*) '   Namelist namtrd : set trends parameters' 
    326             WRITE(numout,*) '      U & V trends: 3D output                 ln_3D_trd_d        = ', ln_3D_trd_d 
    327             WRITE(numout,*) '      T & S trends: 3D output                 ln_3D_trd_t        = ', ln_3D_trd_t 
    328             WRITE(numout,*) '      Kinetic   Energy trends                 ln_KE_trd          = ', ln_KE_trd 
    329             WRITE(numout,*) '      Potential Energy trends                 ln_PE_trd          = ', ln_PE_trd 
    330             WRITE(numout,*) '      Barotropic vorticity trends             ln_vor_trd         = ', ln_vor_trd 
    331             WRITE(numout,*) '      check domain averaged dyn & tra trends  ln_glo_trd         = ', ln_glo_trd 
    332             WRITE(numout,*) '      U & V trends: Mixed Layer averaged      ln_ML_trd_d        = ', ln_3D_trd_d 
    333             WRITE(numout,*) '      T & S trends: Mixed Layer averaged      ln_ML_trd_t        = ', ln_3D_trd_t 
    334      ! 
    335             WRITE(numout,*) '      frequency of trends diagnostics (glo)   nn_trd             = ', nn_trd 
    336             WRITE(numout,*) '      control surface type            (mld)   nn_ctls            = ', nn_ctls 
    337             WRITE(numout,*) '      restart for ML diagnostics              ln_trdmld_restart  = ', ln_trdmld_restart 
    338             WRITE(numout,*) '      instantaneous or mean ML T/S            ln_trdmld_instant  = ', ln_trdmld_instant 
    339             WRITE(numout,*) '      unit conversion factor                  rn_ucf             = ', rn_ucf 
    340         ENDIF 
    341       ENDIF 
    342       ! 
    343       IF( ln_KE_trd .OR. ln_PE_trd .OR. ln_ML_trd_d )   & 
    344          CALL ctl_stop( 'KE, PE, aur ML on momentum are not yet coded we stop' ) 
    345 !!gm  : Potential BUG : 3D output only for vector invariant form!  add a ctl_stop or code the flux form case 
    346 !!gm  : bug/pb for vertical advection of tracer in vvl case: add T.dt[eta] in the output...  
    347       ! 
    348       IF( lk_trddyn .OR. lk_trdtra )    CALL trd_icp_init       ! integral constraints trends 
    349       IF( lk_trdmld                )    CALL trd_mld_init       ! mixed-layer trends (active  tracers)   
    350       IF( lk_trdvor                )    CALL trd_vor_init       ! vorticity trends         
    351       ! 
    352    END SUBROUTINE trd_mod_init 
     185   END SUBROUTINE trd_dyn_iom 
    353186 
    354187   !!====================================================================== 
    355 END MODULE trdmod 
     188END MODULE trddyn 
  • branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRD/trdglo.F90

    r3317 r3318  
    1 MODULE trdicp 
     1MODULE trdglo 
    22   !!====================================================================== 
    3    !!                       ***  MODULE  trdicp  *** 
    4    !! Ocean diagnostics:  ocean tracers and dynamic trends 
     3   !!                       ***  MODULE  trdglo  *** 
     4   !! Ocean diagnostics:  global domain averaged tracer and momentum trends 
    55   !!===================================================================== 
    66   !! History :  1.0  !  2004-08 (C. Talandier) New trends organization 
     
    99 
    1010   !!---------------------------------------------------------------------- 
    11    !!   trd_budget     : domain averaged budget of trends (including kinetic energy and T^2 trends) 
    12    !!   trd_icp        : compute the basin averaged properties for tra/dyn  
    13    !!   trd_dwr        : print dynmaic trends in ocean.output file 
    14    !!   trd_twr        : print tracers trends in ocean.output file 
    15    !!   trd_icp_init   : initialization step 
     11   !!   trd_glo      : domain averaged budget of trends (including kinetic energy and T^2 trends) 
     12   !!   glo_dyn_wri  : print dynamic trends in ocean.output file 
     13   !!   glo_tra_wri  : print global T & T^2 trends in ocean.output file 
     14   !!   trd_glo_init : initialization step 
    1615   !!---------------------------------------------------------------------- 
    1716   USE oce             ! ocean dynamics and tracers variables 
    1817   USE dom_oce         ! ocean space and time domain variables 
    1918   USE sbc_oce         ! surface boundary condition: ocean 
     19   USE trd_oce         ! trends: ocean variables 
    2020   USE phycst          ! physical constants 
    21    USE trdmod_oce      ! ocean variables trends 
    2221   USE ldftra_oce      ! ocean active tracers: lateral physics 
    2322   USE ldfdyn_oce      ! ocean dynamics: lateral physics 
     
    3534   PRIVATE 
    3635 
    37    PUBLIC   trd_budget    ! called by trdmod.F90 
    38    PUBLIC   trd_dwr       ! called by step.F90 
    39    PUBLIC   trd_twr       ! called by step.F90 
    40    PUBLIC   trd_icp_init  ! called by opa.F90 
     36   PUBLIC   trd_glo       ! called by trdtra and trddyn modules 
     37   PUBLIC   trd_glo_init  ! called by trdini module 
    4138 
    4239   !                     !!! Variables used for diagnostics 
     
    6461CONTAINS 
    6562 
    66    SUBROUTINE trd_budget( ptrdx, ptrdy, ktrd, ctype, kt ) 
     63   SUBROUTINE trd_glo( ptrdx, ptrdy, ktrd, ctype, kt ) 
    6764      !!--------------------------------------------------------------------- 
    68       !!                  ***  ROUTINE trd_budget  *** 
     65      !!                  ***  ROUTINE trd_glo  *** 
    6966      !!  
    70       !! ** Purpose : integral constraint diagnostics for momentum and/or tracer trends 
    71       !!               
     67      !! ** Purpose :   compute and print global domain averaged trends for  
     68      !!              T, T^2, momentum, KE, and KE<->PE 
     69      !! 
    7270      !!---------------------------------------------------------------------- 
    7371      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   ptrdx   ! Temperature or U trend  
    7472      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   ptrdy   ! Salinity    or V trend 
    7573      INTEGER                   , INTENT(in   ) ::   ktrd    ! tracer trend index 
    76       CHARACTER(len=3)          , INTENT(in   ) ::   ctype   ! momentum or tracers trends type 'DYN'/'TRA' 
     74      CHARACTER(len=3)          , INTENT(in   ) ::   ctype   ! momentum or tracers trends type (='DYN'/'TRA') 
    7775      INTEGER                   , INTENT(in   ) ::   kt      ! time step 
    7876      !! 
     
    104102            END DO 
    105103            !                       ! linear free surface: diagnose advective flux trough the fixed k=1 w-surface 
    106             IF( .NOT.lk_vvl .AND. ktrd == jptra_trd_zad ) THEN   
    107                tmo(jptra_trd_sad) = SUM( wn(:,:,1) * tsn(:,:,1,jp_tem) * e1e2t(:,:) ) 
    108                smo(jptra_trd_sad) = SUM( wn(:,:,1) * tsn(:,:,1,jp_sal) * e1e2t(:,:)  ) 
    109                t2 (jptra_trd_sad) = SUM( wn(:,:,1) * tsn(:,:,1,jp_tem) * tsn(:,:,1,jp_tem) * e1e2t(:,:)  ) 
    110                s2 (jptra_trd_sad) = SUM( wn(:,:,1) * tsn(:,:,1,jp_sal) * tsn(:,:,1,jp_sal) * e1e2t(:,:)  ) 
     104            IF( .NOT.lk_vvl .AND. ktrd == jptra_zad ) THEN   
     105               tmo(jptra_sad) = SUM( wn(:,:,1) * tsn(:,:,1,jp_tem) * e1e2t(:,:) ) 
     106               smo(jptra_sad) = SUM( wn(:,:,1) * tsn(:,:,1,jp_sal) * e1e2t(:,:)  ) 
     107               t2 (jptra_sad) = SUM( wn(:,:,1) * tsn(:,:,1,jp_tem) * tsn(:,:,1,jp_tem) * e1e2t(:,:)  ) 
     108               s2 (jptra_sad) = SUM( wn(:,:,1) * tsn(:,:,1,jp_sal) * tsn(:,:,1,jp_sal) * e1e2t(:,:)  ) 
    111109            ENDIF 
    112110            ! 
    113             IF( ktrd == jptra_trd_atf ) THEN     ! last trend (asselin time filter) 
     111            IF( ktrd == jptra_atf ) THEN     ! last trend (asselin time filter) 
    114112               !  
    115                CALL trd_twr( kt )   ! print the results in ocean.output 
     113               CALL glo_tra_wri( kt )             ! print the results in ocean.output 
    116114               !                 
    117                tmo(:) = 0._wp       ! prepare the next time step (domain averaged array reset to zero) 
     115               tmo(:) = 0._wp                     ! prepare the next time step (domain averaged array reset to zero) 
    118116               smo(:) = 0._wp 
    119117               t2 (:) = 0._wp 
     
    137135            END DO 
    138136            !                  
    139             IF( ktrd == jpdyn_trd_zdf ) THEN      ! zdf trend: compute separately the surface forcing trend 
     137            IF( ktrd == jpdyn_zdf ) THEN      ! zdf trend: compute separately the surface forcing trend 
    140138               z1_2rau0 = 0.5_wp / rau0 
    141139               DO jj = 1, jpjm1 
     
    145143                     zvs = ( vtau_b(ji,jj) + vtau(ji,jj) ) * tmask_i(ji  ,jj+1) * tmask_i(ji,jj) * vmask(ji,jj,jk)   & 
    146144                        &                       * z1_2rau0 * e1v    (ji  ,jj  ) * e2v    (ji,jj) * fse3u(ji,jj,jk) 
    147                      umo(jpdyn_trd_tau) = umo(jpdyn_trd_tau) + zvt 
    148                      vmo(jpdyn_trd_tau) = vmo(jpdyn_trd_tau) + zvs 
    149                      hke(jpdyn_trd_tau) = hke(jpdyn_trd_tau) + un(ji,jj,1) * zvt + vn(ji,jj,1) * zvs 
     145                     umo(jpdyn_tau) = umo(jpdyn_tau) + zvt 
     146                     vmo(jpdyn_tau) = vmo(jpdyn_tau) + zvs 
     147                     hke(jpdyn_tau) = hke(jpdyn_tau) + un(ji,jj,1) * zvt + vn(ji,jj,1) * zvs 
    150148                  END DO 
    151149               END DO 
    152150            ENDIF 
    153151            !                        
    154             IF( ktrd == jpdyn_trd_atf ) THEN     ! last trend (asselin time filter) 
     152            IF( ktrd == jpdyn_atf ) THEN     ! last trend (asselin time filter) 
    155153               ! 
    156154               IF( ln_bfrimp ) THEN                   ! implicit bfr case: compute separately the bottom friction  
     
    162160                        zvt = bfrua(ji,jj) * un(ji,jj,ikbu) * e1u(ji,jj) * e2v(ji,jj) 
    163161                        zvs = bfrva(ji,jj) * vn(ji,jj,ikbv) * e1v(ji,jj) * e2v(ji,jj) 
    164                         umo(jpdyn_trd_bfr) = umo(jpdyn_trd_bfr) + zvt 
    165                         vmo(jpdyn_trd_bfr) = vmo(jpdyn_trd_bfr) + zvs 
    166                         hke(jpdyn_trd_bfr) = hke(jpdyn_trd_bfr) + un(ji,jj,ikbu) * zvt + vn(ji,jj,ikbv) * zvs 
     162                        umo(jpdyn_bfr) = umo(jpdyn_bfr) + zvt 
     163                        vmo(jpdyn_bfr) = vmo(jpdyn_bfr) + zvs 
     164                        hke(jpdyn_bfr) = hke(jpdyn_bfr) + un(ji,jj,ikbu) * zvt + vn(ji,jj,ikbv) * zvs 
    167165                     END DO 
    168166                  END DO 
    169167               ENDIF 
    170168               !  
    171                CALL trd_dwr( kt )                     ! print the results in ocean.output 
     169               CALL glo_dyn_wri( kt )                 ! print the results in ocean.output 
    172170               !                 
    173171               umo(:) = 0._wp                         ! reset for the next time step 
     
    183181      CALL wrk_dealloc( jpi, jpj, ztswu, ztswv, z2dx, z2dy ) 
    184182      ! 
    185    END SUBROUTINE trd_budget 
    186  
    187  
    188    SUBROUTINE trd_icp_init 
     183   END SUBROUTINE trd_glo 
     184 
     185 
     186   SUBROUTINE trd_glo_init 
    189187      !!--------------------------------------------------------------------- 
    190       !!                  ***  ROUTINE trd_icp_init  *** 
     188      !!                  ***  ROUTINE trd_glo_init  *** 
    191189      !!  
    192190      !! ** Purpose :   Read the namtrd namelist 
     
    197195      IF(lwp) THEN 
    198196         WRITE(numout,*) 
    199          WRITE(numout,*) 'trd_icp_init : integral constraints properties trends' 
     197         WRITE(numout,*) 'trd_glo_init : integral constraints properties trends' 
    200198         WRITE(numout,*) '~~~~~~~~~~~~~' 
    201199      ENDIF 
     
    210208      IF(lwp) WRITE(numout,*) '                total ocean volume at T-point   tvolt = ',tvolt 
    211209 
    212 #if  defined key_trddyn 
    213210      ! Initialization of potential to kinetic energy conversion 
    214211      rpktrd = 0._wp 
     
    233230         WRITE(numout,*) '                total ocean volume at V-point   tvolv = ',tvolv 
    234231      ENDIF 
    235 #endif 
    236       ! 
    237    END SUBROUTINE trd_icp_init 
    238  
    239  
    240    SUBROUTINE trd_dwr( kt ) 
     232      ! 
     233   END SUBROUTINE trd_glo_init 
     234 
     235 
     236   SUBROUTINE glo_dyn_wri( kt ) 
    241237      !!--------------------------------------------------------------------- 
    242       !!                  ***  ROUTINE trd_dwr  *** 
     238      !!                  ***  ROUTINE glo_dyn_wri  *** 
    243239      !!  
    244       !! ** Purpose :  write dynamic trends in ocean.output  
     240      !! ** Purpose :  write global averaged U, KE, PE<->KE trends in ocean.output  
    245241      !!---------------------------------------------------------------------- 
    246242      INTEGER, INTENT(in) ::   kt   ! ocean time-step index 
     
    319315            WRITE (numout,*) 
    320316            WRITE (numout,9500) kt 
    321             WRITE (numout,9501) umo(jpdyn_trd_hpg) / tvolu, vmo(jpdyn_trd_hpg) / tvolv 
    322             WRITE (numout,9509) umo(jpdyn_trd_spg) / tvolu, vmo(jpdyn_trd_spg) / tvolv 
    323             WRITE (numout,9502) umo(jpdyn_trd_keg) / tvolu, vmo(jpdyn_trd_keg) / tvolv 
    324             WRITE (numout,9503) umo(jpdyn_trd_rvo) / tvolu, vmo(jpdyn_trd_rvo) / tvolv 
    325             WRITE (numout,9504) umo(jpdyn_trd_pvo) / tvolu, vmo(jpdyn_trd_pvo) / tvolv 
    326             WRITE (numout,9507) umo(jpdyn_trd_zad) / tvolu, vmo(jpdyn_trd_zad) / tvolv 
    327             WRITE (numout,9505) umo(jpdyn_trd_ldf) / tvolu, vmo(jpdyn_trd_ldf) / tvolv 
    328             WRITE (numout,9508) umo(jpdyn_trd_zdf) / tvolu, vmo(jpdyn_trd_zdf) / tvolv 
    329             WRITE (numout,9510) umo(jpdyn_trd_tau) / tvolu, vmo(jpdyn_trd_tau) / tvolv 
    330             WRITE (numout,9511) umo(jpdyn_trd_bfr) / tvolu, vmo(jpdyn_trd_bfr) / tvolv 
    331             WRITE (numout,9512) umo(jpdyn_trd_atf) / tvolu, vmo(jpdyn_trd_atf) / tvolv 
     317            WRITE (numout,9501) umo(jpdyn_hpg) / tvolu, vmo(jpdyn_hpg) / tvolv 
     318            WRITE (numout,9509) umo(jpdyn_spg) / tvolu, vmo(jpdyn_spg) / tvolv 
     319            WRITE (numout,9502) umo(jpdyn_keg) / tvolu, vmo(jpdyn_keg) / tvolv 
     320            WRITE (numout,9503) umo(jpdyn_rvo) / tvolu, vmo(jpdyn_rvo) / tvolv 
     321            WRITE (numout,9504) umo(jpdyn_pvo) / tvolu, vmo(jpdyn_pvo) / tvolv 
     322            WRITE (numout,9507) umo(jpdyn_zad) / tvolu, vmo(jpdyn_zad) / tvolv 
     323            WRITE (numout,9505) umo(jpdyn_ldf) / tvolu, vmo(jpdyn_ldf) / tvolv 
     324            WRITE (numout,9508) umo(jpdyn_zdf) / tvolu, vmo(jpdyn_zdf) / tvolv 
     325            WRITE (numout,9510) umo(jpdyn_tau) / tvolu, vmo(jpdyn_tau) / tvolv 
     326            WRITE (numout,9511) umo(jpdyn_bfr) / tvolu, vmo(jpdyn_bfr) / tvolv 
     327            WRITE (numout,9512) umo(jpdyn_atf) / tvolu, vmo(jpdyn_atf) / tvolv 
    332328            WRITE (numout,9513) 
    333329            WRITE (numout,9514)                                                 & 
    334             &     (  umo(jpdyn_trd_hpg) + umo(jpdyn_trd_spg) + umo(jpdyn_trd_keg) + umo(jpdyn_trd_rvo)   & 
    335             &      + umo(jpdyn_trd_pvo) + umo(jpdyn_trd_zad) + umo(jpdyn_trd_ldf) + umo(jpdyn_trd_zdf)   & 
    336             &      + umo(jpdyn_trd_tau) + umo(jpdyn_trd_bfr) + umo(jpdyn_trd_atf) ) / tvolu,   & 
    337             &     (  vmo(jpdyn_trd_hpg) + vmo(jpdyn_trd_spg) + vmo(jpdyn_trd_keg) + vmo(jpdyn_trd_rvo)   & 
    338             &      + vmo(jpdyn_trd_pvo) + vmo(jpdyn_trd_zad) + vmo(jpdyn_trd_ldf) + vmo(jpdyn_trd_zdf)   & 
    339             &      + vmo(jpdyn_trd_tau) + vmo(jpdyn_trd_bfr) + vmo(jpdyn_trd_atf) ) / tvolv 
     330            &     (  umo(jpdyn_hpg) + umo(jpdyn_spg) + umo(jpdyn_keg) + umo(jpdyn_rvo)   & 
     331            &      + umo(jpdyn_pvo) + umo(jpdyn_zad) + umo(jpdyn_ldf) + umo(jpdyn_zdf)   & 
     332            &      + umo(jpdyn_tau) + umo(jpdyn_bfr) + umo(jpdyn_atf) ) / tvolu,   & 
     333            &     (  vmo(jpdyn_hpg) + vmo(jpdyn_spg) + vmo(jpdyn_keg) + vmo(jpdyn_rvo)   & 
     334            &      + vmo(jpdyn_pvo) + vmo(jpdyn_zad) + vmo(jpdyn_ldf) + vmo(jpdyn_zdf)   & 
     335            &      + vmo(jpdyn_tau) + vmo(jpdyn_bfr) + vmo(jpdyn_atf) ) / tvolv 
    340336         ENDIF 
    341337 
     
    359355            WRITE (numout,*) 
    360356            WRITE (numout,9520) kt 
    361             WRITE (numout,9521) hke(jpdyn_trd_hpg) / tvolt 
    362             WRITE (numout,9529) hke(jpdyn_trd_spg) / tvolt 
    363             WRITE (numout,9522) hke(jpdyn_trd_keg) / tvolt 
    364             WRITE (numout,9523) hke(jpdyn_trd_rvo) / tvolt 
    365             WRITE (numout,9524) hke(jpdyn_trd_pvo) / tvolt 
    366             WRITE (numout,9527) hke(jpdyn_trd_zad) / tvolt 
    367             WRITE (numout,9525) hke(jpdyn_trd_ldf) / tvolt 
    368             WRITE (numout,9528) hke(jpdyn_trd_zdf) / tvolt 
    369             WRITE (numout,9530) hke(jpdyn_trd_tau) / tvolt 
    370             WRITE (numout,9531) hke(jpdyn_trd_bfr) / tvolt 
    371             WRITE (numout,9532) hke(jpdyn_trd_atf) / tvolt 
     357            WRITE (numout,9521) hke(jpdyn_hpg) / tvolt 
     358            WRITE (numout,9529) hke(jpdyn_spg) / tvolt 
     359            WRITE (numout,9522) hke(jpdyn_keg) / tvolt 
     360            WRITE (numout,9523) hke(jpdyn_rvo) / tvolt 
     361            WRITE (numout,9524) hke(jpdyn_pvo) / tvolt 
     362            WRITE (numout,9527) hke(jpdyn_zad) / tvolt 
     363            WRITE (numout,9525) hke(jpdyn_ldf) / tvolt 
     364            WRITE (numout,9528) hke(jpdyn_zdf) / tvolt 
     365            WRITE (numout,9530) hke(jpdyn_tau) / tvolt 
     366            WRITE (numout,9531) hke(jpdyn_bfr) / tvolt 
     367            WRITE (numout,9532) hke(jpdyn_atf) / tvolt 
    372368            WRITE (numout,9533) 
    373369            WRITE (numout,9534)   & 
    374             &     (  hke(jpdyn_trd_hpg) + hke(jpdyn_trd_spg) + hke(jpdyn_trd_keg) + hke(jpdyn_trd_rvo)   & 
    375             &      + hke(jpdyn_trd_pvo) + hke(jpdyn_trd_zad) + hke(jpdyn_trd_ldf) + hke(jpdyn_trd_zdf)   & 
    376             &      + hke(jpdyn_trd_tau) + hke(jpdyn_trd_bfr) + hke(jpdyn_trd_atf)  ) / tvolt 
     370            &     (  hke(jpdyn_hpg) + hke(jpdyn_spg) + hke(jpdyn_keg) + hke(jpdyn_rvo)   & 
     371            &      + hke(jpdyn_pvo) + hke(jpdyn_zad) + hke(jpdyn_ldf) + hke(jpdyn_zdf)   & 
     372            &      + hke(jpdyn_tau) + hke(jpdyn_bfr) + hke(jpdyn_atf)  ) / tvolt 
    377373         ENDIF 
    378374 
     
    396392            WRITE (numout,*) 
    397393            WRITE (numout,9540) kt 
    398             WRITE (numout,9541) ( hke(jpdyn_trd_keg) + hke(jpdyn_trd_rvo) + hke(jpdyn_trd_zad) ) / tvolt 
    399             WRITE (numout,9542) ( hke(jpdyn_trd_keg) + hke(jpdyn_trd_zad) ) / tvolt 
    400             WRITE (numout,9543) ( hke(jpdyn_trd_pvo) ) / tvolt 
    401             WRITE (numout,9544) ( hke(jpdyn_trd_rvo) ) / tvolt 
    402             WRITE (numout,9545) ( hke(jpdyn_trd_spg) ) / tvolt 
    403             WRITE (numout,9546) ( hke(jpdyn_trd_ldf) ) / tvolt 
    404             WRITE (numout,9547) ( hke(jpdyn_trd_zdf) ) / tvolt 
    405             WRITE (numout,9548) ( hke(jpdyn_trd_hpg) ) / tvolt, rpktrd / tvolt 
     394            WRITE (numout,9541) ( hke(jpdyn_keg) + hke(jpdyn_rvo) + hke(jpdyn_zad) ) / tvolt 
     395            WRITE (numout,9542) ( hke(jpdyn_keg) + hke(jpdyn_zad) ) / tvolt 
     396            WRITE (numout,9543) ( hke(jpdyn_pvo) ) / tvolt 
     397            WRITE (numout,9544) ( hke(jpdyn_rvo) ) / tvolt 
     398            WRITE (numout,9545) ( hke(jpdyn_spg) ) / tvolt 
     399            WRITE (numout,9546) ( hke(jpdyn_ldf) ) / tvolt 
     400            WRITE (numout,9547) ( hke(jpdyn_zdf) ) / tvolt 
     401            WRITE (numout,9548) ( hke(jpdyn_hpg) ) / tvolt, rpktrd / tvolt 
    406402            WRITE (numout,*) 
    407403            WRITE (numout,*) 
     
    425421      CALL wrk_dealloc( jpi, jpj, jpk, zkx, zky, zkz, zkepe ) 
    426422      ! 
    427    END SUBROUTINE trd_dwr 
    428  
    429  
    430    SUBROUTINE trd_twr( kt ) 
     423   END SUBROUTINE glo_dyn_wri 
     424 
     425 
     426   SUBROUTINE glo_tra_wri( kt ) 
    431427      !!--------------------------------------------------------------------- 
    432       !!                  ***  ROUTINE trd_twr  *** 
     428      !!                  ***  ROUTINE glo_tra_wri  *** 
    433429      !!  
    434       !! ** Purpose :  write active tracers trends in ocean.output  
     430      !! ** Purpose :  write global domain averaged of T and T^2 trends in ocean.output  
    435431      !!---------------------------------------------------------------------- 
    436432      INTEGER, INTENT(in) ::   kt   ! ocean time-step index 
     
    460456            WRITE (numout,*) 
    461457            WRITE (numout,9400) kt 
    462             WRITE (numout,9401)  tmo(jptra_trd_xad) / tvolt, smo(jptra_trd_xad) / tvolt 
    463             WRITE (numout,9411)  tmo(jptra_trd_yad) / tvolt, smo(jptra_trd_yad) / tvolt 
    464             WRITE (numout,9402)  tmo(jptra_trd_zad) / tvolt, smo(jptra_trd_zad) / tvolt 
    465             WRITE (numout,9403)  tmo(jptra_trd_ldf) / tvolt, smo(jptra_trd_ldf) / tvolt 
    466             WRITE (numout,9404)  tmo(jptra_trd_zdf) / tvolt, smo(jptra_trd_zdf) / tvolt 
    467             WRITE (numout,9405)  tmo(jptra_trd_npc) / tvolt, smo(jptra_trd_npc) / tvolt 
    468             WRITE (numout,9406)  tmo(jptra_trd_dmp) / tvolt, smo(jptra_trd_dmp) / tvolt 
    469             WRITE (numout,9407)  tmo(jptra_trd_qsr) / tvolt 
    470             WRITE (numout,9408)  tmo(jptra_trd_nsr) / tvolt, smo(jptra_trd_nsr) / tvolt 
     458            WRITE (numout,9401)  tmo(jptra_xad) / tvolt, smo(jptra_xad) / tvolt 
     459            WRITE (numout,9411)  tmo(jptra_yad) / tvolt, smo(jptra_yad) / tvolt 
     460            WRITE (numout,9402)  tmo(jptra_zad) / tvolt, smo(jptra_zad) / tvolt 
     461            WRITE (numout,9403)  tmo(jptra_ldf) / tvolt, smo(jptra_ldf) / tvolt 
     462            WRITE (numout,9404)  tmo(jptra_zdf) / tvolt, smo(jptra_zdf) / tvolt 
     463            WRITE (numout,9405)  tmo(jptra_npc) / tvolt, smo(jptra_npc) / tvolt 
     464            WRITE (numout,9406)  tmo(jptra_dmp) / tvolt, smo(jptra_dmp) / tvolt 
     465            WRITE (numout,9407)  tmo(jptra_qsr) / tvolt 
     466            WRITE (numout,9408)  tmo(jptra_nsr) / tvolt, smo(jptra_nsr) / tvolt 
    471467            WRITE (numout,9409)  
    472             WRITE (numout,9410) (  tmo(jptra_trd_xad) + tmo(jptra_trd_yad) + tmo(jptra_trd_zad) + tmo(jptra_trd_ldf) + tmo(jptra_trd_zdf)   & 
    473             &                    + tmo(jptra_trd_npc) + tmo(jptra_trd_dmp) + tmo(jptra_trd_qsr) + tmo(jptra_trd_nsr) ) / tvolt,   & 
    474             &                   (  smo(jptra_trd_xad) + smo(jptra_trd_yad) + smo(jptra_trd_zad) + smo(jptra_trd_ldf) + smo(jptra_trd_zdf)   & 
    475             &                    + smo(jptra_trd_npc) + smo(jptra_trd_dmp)                   + smo(jptra_trd_nsr) ) / tvolt 
     468            WRITE (numout,9410) (  tmo(jptra_xad) + tmo(jptra_yad) + tmo(jptra_zad) + tmo(jptra_ldf) + tmo(jptra_zdf)   & 
     469            &                    + tmo(jptra_npc) + tmo(jptra_dmp) + tmo(jptra_qsr) + tmo(jptra_nsr) ) / tvolt,   & 
     470            &                   (  smo(jptra_xad) + smo(jptra_yad) + smo(jptra_zad) + smo(jptra_ldf) + smo(jptra_zdf)   & 
     471            &                    + smo(jptra_npc) + smo(jptra_dmp)                   + smo(jptra_nsr) ) / tvolt 
    476472         ENDIF 
    477473 
     
    495491            WRITE (numout,*) 
    496492            WRITE (numout,9420) kt 
    497             WRITE (numout,9421)   t2(jptra_trd_xad) / tvolt, s2(jptra_trd_xad) / tvolt 
    498             WRITE (numout,9431)   t2(jptra_trd_yad) / tvolt, s2(jptra_trd_yad) / tvolt 
    499             WRITE (numout,9422)   t2(jptra_trd_zad) / tvolt, s2(jptra_trd_zad) / tvolt 
    500             WRITE (numout,9423)   t2(jptra_trd_ldf) / tvolt, s2(jptra_trd_ldf) / tvolt 
    501             WRITE (numout,9424)   t2(jptra_trd_zdf) / tvolt, s2(jptra_trd_zdf) / tvolt 
    502             WRITE (numout,9425)   t2(jptra_trd_npc) / tvolt, s2(jptra_trd_npc) / tvolt 
    503             WRITE (numout,9426)   t2(jptra_trd_dmp) / tvolt, s2(jptra_trd_dmp) / tvolt 
    504             WRITE (numout,9427)   t2(jptra_trd_qsr) / tvolt 
    505             WRITE (numout,9428)   t2(jptra_trd_nsr) / tvolt, s2(jptra_trd_nsr) / tvolt 
     493            WRITE (numout,9421)   t2(jptra_xad) / tvolt, s2(jptra_xad) / tvolt 
     494            WRITE (numout,9431)   t2(jptra_yad) / tvolt, s2(jptra_yad) / tvolt 
     495            WRITE (numout,9422)   t2(jptra_zad) / tvolt, s2(jptra_zad) / tvolt 
     496            WRITE (numout,9423)   t2(jptra_ldf) / tvolt, s2(jptra_ldf) / tvolt 
     497            WRITE (numout,9424)   t2(jptra_zdf) / tvolt, s2(jptra_zdf) / tvolt 
     498            WRITE (numout,9425)   t2(jptra_npc) / tvolt, s2(jptra_npc) / tvolt 
     499            WRITE (numout,9426)   t2(jptra_dmp) / tvolt, s2(jptra_dmp) / tvolt 
     500            WRITE (numout,9427)   t2(jptra_qsr) / tvolt 
     501            WRITE (numout,9428)   t2(jptra_nsr) / tvolt, s2(jptra_nsr) / tvolt 
    506502            WRITE (numout,9429) 
    507             WRITE (numout,9430) (  t2(jptra_trd_xad) + t2(jptra_trd_yad) + t2(jptra_trd_zad) + t2(jptra_trd_ldf) + t2(jptra_trd_zdf)   & 
    508             &                    + t2(jptra_trd_npc) + t2(jptra_trd_dmp) + t2(jptra_trd_qsr) + t2(jptra_trd_nsr) ) / tvolt,   & 
    509             &                   (  s2(jptra_trd_xad) + s2(jptra_trd_yad) + s2(jptra_trd_zad) + s2(jptra_trd_ldf) + s2(jptra_trd_zdf)   & 
    510             &                    + s2(jptra_trd_npc) + s2(jptra_trd_dmp)                  + s2(jptra_trd_nsr) ) / tvolt 
     503            WRITE (numout,9430) (  t2(jptra_xad) + t2(jptra_yad) + t2(jptra_zad) + t2(jptra_ldf) + t2(jptra_zdf)   & 
     504            &                    + t2(jptra_npc) + t2(jptra_dmp) + t2(jptra_qsr) + t2(jptra_nsr) ) / tvolt,   & 
     505            &                   (  s2(jptra_xad) + s2(jptra_yad) + s2(jptra_zad) + s2(jptra_ldf) + s2(jptra_zdf)   & 
     506            &                    + s2(jptra_npc) + s2(jptra_dmp)                  + s2(jptra_nsr) ) / tvolt 
    511507         ENDIF 
    512508 
     
    530526            WRITE (numout,*) 
    531527            WRITE (numout,9440) kt 
    532             WRITE (numout,9441) ( tmo(jptra_trd_xad)+tmo(jptra_trd_yad)+tmo(jptra_trd_zad) )/tvolt,   & 
    533             &                   ( smo(jptra_trd_xad)+smo(jptra_trd_yad)+smo(jptra_trd_zad) )/tvolt 
    534             WRITE (numout,9442)   tmo(jptra_trd_sad)/tvolt,  smo(jptra_trd_sad)/tvolt 
    535             WRITE (numout,9443)   tmo(jptra_trd_ldf)/tvolt,  smo(jptra_trd_ldf)/tvolt 
    536             WRITE (numout,9444)   tmo(jptra_trd_zdf)/tvolt,  smo(jptra_trd_zdf)/tvolt 
    537             WRITE (numout,9445)   tmo(jptra_trd_npc)/tvolt,  smo(jptra_trd_npc)/tvolt 
    538             WRITE (numout,9446) ( t2(jptra_trd_xad)+t2(jptra_trd_yad)+t2(jptra_trd_zad) )/tvolt,    & 
    539             &                   ( s2(jptra_trd_xad)+s2(jptra_trd_yad)+s2(jptra_trd_zad) )/tvolt 
    540             WRITE (numout,9447)   t2(jptra_trd_ldf)/tvolt,   s2(jptra_trd_ldf)/tvolt 
    541             WRITE (numout,9448)   t2(jptra_trd_zdf)/tvolt,   s2(jptra_trd_zdf)/tvolt 
    542             WRITE (numout,9449)   t2(jptra_trd_npc)/tvolt,   s2(jptra_trd_npc)/tvolt 
     528            WRITE (numout,9441) ( tmo(jptra_xad)+tmo(jptra_yad)+tmo(jptra_zad) )/tvolt,   & 
     529            &                   ( smo(jptra_xad)+smo(jptra_yad)+smo(jptra_zad) )/tvolt 
     530            WRITE (numout,9442)   tmo(jptra_sad)/tvolt,  smo(jptra_sad)/tvolt 
     531            WRITE (numout,9443)   tmo(jptra_ldf)/tvolt,  smo(jptra_ldf)/tvolt 
     532            WRITE (numout,9444)   tmo(jptra_zdf)/tvolt,  smo(jptra_zdf)/tvolt 
     533            WRITE (numout,9445)   tmo(jptra_npc)/tvolt,  smo(jptra_npc)/tvolt 
     534            WRITE (numout,9446) ( t2(jptra_xad)+t2(jptra_yad)+t2(jptra_zad) )/tvolt,    & 
     535            &                   ( s2(jptra_xad)+s2(jptra_yad)+s2(jptra_zad) )/tvolt 
     536            WRITE (numout,9447)   t2(jptra_ldf)/tvolt,   s2(jptra_ldf)/tvolt 
     537            WRITE (numout,9448)   t2(jptra_zdf)/tvolt,   s2(jptra_zdf)/tvolt 
     538            WRITE (numout,9449)   t2(jptra_npc)/tvolt,   s2(jptra_npc)/tvolt 
    543539         ENDIF 
    544540 
     
    558554      ENDIF 
    559555      ! 
    560    END SUBROUTINE trd_twr 
     556   END SUBROUTINE glo_tra_wri 
    561557 
    562558   !!====================================================================== 
    563 END MODULE trdicp 
     559END MODULE trdglo 
  • branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRD/trdini.F90

    r3317 r3318  
    1 MODULE trdmod 
     1MODULE trdini 
    22   !!====================================================================== 
    3    !!                       ***  MODULE  trdmod  *** 
     3   !!                       ***  MODULE  trdini  *** 
    44   !! Ocean diagnostics:  ocean tracers and dynamic trends 
    55   !!===================================================================== 
    6    !! History :  1.0  !  2004-08  (C. Talandier) Original code 
    7    !!             -   !  2005-04  (C. Deltel)    Add Asselin trend in the ML budget 
    8    !!            3.3  !  2010-10  (C. Ethe, G. Madec) reorganisation of initialisation phase 
    9    !!            3.5  !  2012-02  (G. Madec) add 3D trends output for T, S, U, V, PE and KE 
     6   !! History :   3.5  !  2012-02  (G. Madec) add 3D trends output for T, S, U, V, PE and KE 
    107   !!---------------------------------------------------------------------- 
    11 #if  defined key_trdtra || defined key_trddyn || defined key_trdmld || defined key_trdvor || defined key_esopa 
     8 
    129   !!---------------------------------------------------------------------- 
    13    !!   trd_mod       : manage the type of trend diagnostics 
    14    !!   trd_3Diom     : output 3D momentum and/or tracer trends using IOM 
    15    !!   trd_mod_init  : Initialization step 
     10   !!   trd_init      : initialization step 
    1611   !!---------------------------------------------------------------------- 
    17    USE oce            ! ocean dynamics and tracers variables 
    18    USE dom_oce        ! ocean space and time domain variables 
    19    USE zdf_oce        ! ocean vertical physics variables 
    20    USE trdmod_oce     ! ocean variables trends 
    21    USE zdfbfr         ! bottom friction 
    22    USE ldftra_oce     ! ocean active tracers lateral physics 
    23    USE sbc_oce        ! surface boundary condition: ocean 
    24    USE phycst         ! physical constants 
     12   USE trd_oce        ! trends: ocean variables 
     13!   USE ldftra_oce     ! ocean active tracers lateral physics 
     14   USE trdglo         ! ocean bassin integral constraints properties 
     15   USE trdmld         ! ocean active mixed layer tracers trends  
    2516   USE trdvor         ! ocean vorticity trends  
    26    USE trdicp         ! ocean bassin integral constraints properties 
    27    USE trdmld         ! ocean active mixed layer tracers trends  
    2817   USE in_out_manager ! I/O manager 
    29    USE iom            ! I/O manager library 
    3018   USE lib_mpp        ! MPP library 
    31    USE wrk_nemo       ! Memory allocation 
    3219 
    3320   IMPLICIT NONE 
    3421   PRIVATE 
    3522 
    36    REAL(wp) ::   r2dt          ! time-step, = 2 rdttra except at nit000 (=rdttra) if neuler=0 
    37  
    38    PUBLIC trd_mod              ! called by all dynXX or traXX modules 
    39    PUBLIC trd_mod_init         ! called by opa.F90 module 
     23   PUBLIC   trd_init   ! called by nemogcm.F90 module 
    4024 
    4125   !! * Substitutions 
     
    4933CONTAINS 
    5034 
    51    SUBROUTINE trd_mod( ptrdx, ptrdy, ktrd, ctype, kt ) 
    52       !!--------------------------------------------------------------------- 
    53       !!                  ***  ROUTINE trd_mod  *** 
     35   SUBROUTINE trd_init 
     36      !!---------------------------------------------------------------------- 
     37      !!                  ***  ROUTINE trd_init  *** 
    5438      !!  
    55       !! ** Purpose :   Dispatch all trends computation, e.g. 3D output, integral 
    56       !!                constraints, barotropic vorticity, kinetic enrgy,  
    57       !!                potential energy, and/or mixed layer budget. 
     39      !! ** Purpose :   Initialization of trend diagnostics 
    5840      !!---------------------------------------------------------------------- 
    59       REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   ptrdx   ! Temperature or U trend  
    60       REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   ptrdy   ! Salinity    or V trend 
    61       INTEGER                   , INTENT(in   ) ::   ktrd    ! tracer trend index 
    62       CHARACTER(len=3)          , INTENT(in   ) ::   ctype   ! momentum or tracers trends type 'DYN'/'TRA' 
    63       INTEGER                   , INTENT(in   ) ::   kt      ! time step 
    64       !! 
    65       INTEGER ::   ji, jj   ! dummy loop indices 
    66       REAL(wp), POINTER, DIMENSION(:,:) ::   ztswu, ztswv    ! 2D workspace  
    67       !!---------------------------------------------------------------------- 
    68  
    69       CALL wrk_alloc( jpi, jpj, ztswu, ztswv ) 
    70  
    71       IF( neuler == 0 .AND. kt == nit000    ) THEN   ;   r2dt =      rdt      ! = rdtra (restart with Euler time stepping) 
    72       ELSEIF(               kt <= nit000 + 1) THEN   ;   r2dt = 2. * rdt      ! = 2 rdttra (leapfrog) 
    73       ENDIF 
    74  
    75       !                                            !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    76       IF( ln_3D_trd_d .OR. ln_3D_trd_t ) THEN      !   3D output of momentum and/or tracers trends using IOM interface 
    77          !                                         !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    78          CALL trd_3Diom ( ptrdx, ptrdy, ktrd, ctype, kt ) 
    79          ! 
    80       ENDIF 
    81          !                                         !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    82       IF( ln_glo_trd ) THEN                        ! I. Integral Constraints Properties for momentum and/or tracers trends 
    83          !                                         !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    84          CALL trd_budget( ptrdx, ptrdy, ktrd, ctype, kt ) 
    85          ! 
    86       ENDIF 
    87  
    88       !                                            !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    89       IF( lk_trdvor .AND. ctype == 'DYN' ) THEN    ! II. Vorticity trends 
    90          !                                         !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    91          SELECT CASE( ktrd )  
    92          CASE( jpdyn_trd_hpg )   ;   CALL trd_vor_zint( ptrdx, ptrdy, jpvor_prg )   ! Hydrostatique Pressure Gradient  
    93          CASE( jpdyn_trd_keg )   ;   CALL trd_vor_zint( ptrdx, ptrdy, jpvor_keg )   ! KE Gradient  
    94          CASE( jpdyn_trd_rvo )   ;   CALL trd_vor_zint( ptrdx, ptrdy, jpvor_rvo )   ! Relative Vorticity  
    95          CASE( jpdyn_trd_pvo )   ;   CALL trd_vor_zint( ptrdx, ptrdy, jpvor_pvo )   ! Planetary Vorticity Term  
    96          CASE( jpdyn_trd_ldf )   ;   CALL trd_vor_zint( ptrdx, ptrdy, jpvor_ldf )   ! Horizontal Diffusion  
    97          CASE( jpdyn_trd_zad )   ;   CALL trd_vor_zint( ptrdx, ptrdy, jpvor_zad )   ! Vertical Advection  
    98          CASE( jpdyn_trd_spg )   ;   CALL trd_vor_zint( ptrdx, ptrdy, jpvor_spg )   ! Surface Pressure Grad.  
    99          CASE( jpdyn_trd_zdf )                                                      ! Vertical Diffusion  
    100             ztswu(:,:) = 0.e0   ;   ztswv(:,:) = 0.e0 
    101             DO jj = 2, jpjm1                                                             ! wind stress trends 
    102                DO ji = fs_2, fs_jpim1   ! vector opt. 
    103                   ztswu(ji,jj) = 0.5 * ( utau_b(ji,jj) + utau(ji,jj) ) / ( fse3u(ji,jj,1) * rau0 ) 
    104                   ztswv(ji,jj) = 0.5 * ( vtau_b(ji,jj) + vtau(ji,jj) ) / ( fse3v(ji,jj,1) * rau0 ) 
    105                END DO 
    106             END DO 
    107             ! 
    108             CALL trd_vor_zint( ptrdx, ptrdy, jpvor_zdf )                             ! zdf trend including surf./bot. stresses  
    109             CALL trd_vor_zint( ztswu, ztswv, jpvor_swf )                             ! surface wind stress  
    110          CASE ( jpdyn_trd_bfr ) 
    111             CALL trd_vor_zint( ptrdx, ptrdy, jpvor_bfr )                             ! Bottom stress 
    112          END SELECT 
    113          ! 
    114       ENDIF 
    115  
    116       !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    117       ! III. Mixed layer trends for active tracers 
    118       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    119  
    120       IF( lk_trdmld .AND. ctype == 'TRA' )   THEN    
    121          !----------------------------------------------------------------------------------------------- 
    122          ! W.A.R.N.I.N.G : 
    123          ! jptra_trd_ldf : called by traldf.F90 
    124          !                 at this stage we store: 
    125          !                  - the lateral geopotential diffusion (here, lateral = horizontal) 
    126          !                  - and the iso-neutral diffusion if activated  
    127          ! jptra_trd_zdf : called by trazdf.F90 
    128          !                 * in case of iso-neutral diffusion we store the vertical diffusion component in the  
    129          !                   lateral trend including the K_z contrib, which will be removed later (see trd_mld) 
    130          !----------------------------------------------------------------------------------------------- 
    131  
    132          SELECT CASE ( ktrd ) 
    133          CASE ( jptra_trd_xad )        ;   CALL trd_mld_zint( ptrdx, ptrdy, jpmld_xad, '3D' )   ! zonal    advection 
    134          CASE ( jptra_trd_yad )        ;   CALL trd_mld_zint( ptrdx, ptrdy, jpmld_yad, '3D' )   ! merid.   advection 
    135          CASE ( jptra_trd_zad )        ;   CALL trd_mld_zint( ptrdx, ptrdy, jpmld_zad, '3D' )   ! vertical advection 
    136          CASE ( jptra_trd_ldf )        ;   CALL trd_mld_zint( ptrdx, ptrdy, jpmld_ldf, '3D' )   ! lateral  diffusion 
    137          CASE ( jptra_trd_bbl )        ;   CALL trd_mld_zint( ptrdx, ptrdy, jpmld_bbl, '3D' )   ! bottom boundary layer 
    138          CASE ( jptra_trd_zdf ) 
    139             IF( ln_traldf_iso ) THEN   ;   CALL trd_mld_zint( ptrdx, ptrdy, jpmld_ldf, '3D' )   ! lateral  diffusion (K_z) 
    140             ELSE                       ;   CALL trd_mld_zint( ptrdx, ptrdy, jpmld_zdf, '3D' )   ! vertical diffusion (K_z) 
    141             ENDIF 
    142          CASE ( jptra_trd_dmp )        ;   CALL trd_mld_zint( ptrdx, ptrdy, jpmld_dmp, '3D' )   ! internal 3D restoring (tradmp) 
    143          CASE ( jptra_trd_qsr )        ;   CALL trd_mld_zint( ptrdx, ptrdy, jpmld_for, '3D' )   ! air-sea : penetrative sol radiat 
    144          CASE ( jptra_trd_nsr ) 
    145             ptrdx(:,:,2:jpk) = 0._wp   ;   ptrdy(:,:,2:jpk) = 0._wp 
    146             CALL trd_mld_zint( ptrdx, ptrdy, jpmld_for, '2D' )                                  ! air-sea : non penetr sol radiat 
    147          CASE ( jptra_trd_bbc )        ;   CALL trd_mld_zint( ptrdx, ptrdy, jpmld_bbc, '3D' )   ! bottom bound cond (geoth flux) 
    148          CASE ( jptra_trd_atf )        ;   CALL trd_mld_zint( ptrdx, ptrdy, jpmld_atf, '3D' )   ! asselin numerical 
    149          CASE ( jptra_trd_npc )        ;   CALL trd_mld_zint( ptrdx, ptrdy, jpmld_npc, '3D' )   ! non penetr convect adjustment 
    150          END SELECT 
    151          ! 
    152       ENDIF 
    153       ! 
    154       CALL wrk_dealloc( jpi, jpj, ztswu, ztswv ) 
    155       ! 
    156    END SUBROUTINE trd_mod 
    157  
    158  
    159    SUBROUTINE trd_3Diom( ptrdx, ptrdy, ktrd, ctype, kt ) 
    160       !!--------------------------------------------------------------------- 
    161       !!                  ***  ROUTINE trd_3Diom  *** 
    162       !!  
    163       !! ** Purpose :   output 3D trends using IOM 
    164       !!---------------------------------------------------------------------- 
    165       REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   ptrdx   ! Temperature or U trend  
    166       REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   ptrdy   ! Salinity    or V trend 
    167       INTEGER                   , INTENT(in   ) ::   ktrd    ! tracer trend index 
    168       CHARACTER(len=3)          , INTENT(in   ) ::   ctype   ! momentum or tracers trends type 'DYN'/'TRA' 
    169       INTEGER                   , INTENT(in   ) ::   kt      ! time step 
    170       !! 
    171       INTEGER ::   ji, jj, jk   ! dummy loop indices 
    172       INTEGER ::   ikbu, ikbv   ! local integers 
    173       REAL(wp), POINTER, DIMENSION(:,:)   ::   z2dx, z2dy, ztswu, ztswv   ! 2D workspace  
    174       REAL(wp), POINTER, DIMENSION(:,:,:) ::   z3dx, z3dy                 ! 3D workspace  
    175       !!---------------------------------------------------------------------- 
    176  
    177        IF( lk_trdtra .AND. ctype == 'TRA' ) THEN       ! active tracer trends 
    178          ! 
    179 !!gm Rq: mask the trends already masked in trd_tra, but lbc_lnk should probably be added 
    180          ! 
    181          SELECT CASE( ktrd ) 
    182          CASE( jptra_trd_xad  )   ;   CALL iom_put( "ttrd_xad" , ptrdx )        ! x- horizontal advection 
    183                                       CALL iom_put( "strd_xad" , ptrdy ) 
    184          CASE( jptra_trd_yad  )   ;   CALL iom_put( "ttrd_yad" , ptrdx )        ! y- horizontal advection 
    185                                       CALL iom_put( "strd_yad" , ptrdy ) 
    186          CASE( jptra_trd_zad  )   ;   CALL iom_put( "ttrd_zad" , ptrdx )        ! z- vertical   advection 
    187                                       CALL iom_put( "strd_zad" , ptrdy ) 
    188                                       IF( .NOT.lk_vvl ) THEN                   ! cst volume : adv flux through z=0 surface 
    189                                          z2dx(:,:) = wn(:,:,1) * tsn(:,:,1,jp_tem) / fse3t(:,:,1) 
    190                                          z2dy(:,:) = wn(:,:,1) * tsn(:,:,1,jp_sal) / fse3t(:,:,1) 
    191                                          CALL iom_put( "ttrd_sad", z2dx ) 
    192                                          CALL iom_put( "strd_sad", z2dy ) 
    193                                       ENDIF 
    194          CASE( jptra_trd_ldf  )   ;   CALL iom_put( "ttrd_ldf" , ptrdx )        ! lateral diffusion 
    195                                       CALL iom_put( "strd_ldf" , ptrdy ) 
    196          CASE( jptra_trd_zdf  )   ;   CALL iom_put( "ttrd_zdf" , ptrdx )        ! vertical diffusion (including Kz contribution) 
    197                                       CALL iom_put( "strd_zdf" , ptrdy ) 
    198          CASE( jptra_trd_zdfp )   ;   CALL iom_put( "ttrd_zdfp", ptrdx )        ! PURE vertical diffusion (no isoneutral contribution) 
    199                                       CALL iom_put( "strd_zdfp", ptrdy ) 
    200          CASE( jptra_trd_dmp  )   ;   CALL iom_put( "ttrd_dmp" , ptrdx )        ! internal restoring (damping) 
    201                                       CALL iom_put( "strd_dmp" , ptrdy ) 
    202          CASE( jptra_trd_bbl  )   ;   CALL iom_put( "ttrd_bbl" , ptrdx )        ! bottom boundary layer 
    203                                       CALL iom_put( "strd_bbl" , ptrdy ) 
    204          CASE( jptra_trd_npc  )   ;   CALL iom_put( "ttrd_npc" , ptrdx )        ! static instability mixing 
    205                                       CALL iom_put( "strd_npc" , ptrdy ) 
    206          CASE( jptra_trd_nsr  )   ;   CALL iom_put( "ttrd_qns" , ptrdx )        ! surface forcing + runoff (ln_rnf=T) 
    207                                       CALL iom_put( "strd_cdt" , ptrdy ) 
    208          CASE( jptra_trd_qsr  )   ;   CALL iom_put( "ttrd_qsr" , ptrdx )        ! penetrative solar radiat. (only on temperature) 
    209          CASE( jptra_trd_bbc  )   ;   CALL iom_put( "ttrd_bbc" , ptrdx )        ! geothermal heating   (only on temperature) 
    210          CASE( jptra_trd_atf  )   ;   CALL iom_put( "ttrd_atf" , ptrdx )        ! asselin time Filter 
    211                                       CALL iom_put( "strd_atf" , ptrdy ) 
    212  
    213          END SELECT 
    214       ENDIF 
    215  
    216       IF( lk_trddyn .AND. ctype == 'DYN' ) THEN       ! momentum trends  
    217             ! 
    218          ptrdx(:,:,:) = ptrdx(:,:,:) * umask(:,:,:)                       ! mask the trends 
    219          ptrdy(:,:,:) = ptrdy(:,:,:) * vmask(:,:,:) 
    220 !!gm NB : here a lbc_lnk should probably be added 
    221          ! 
    222          SELECT CASE( ktrd ) 
    223          CASE( jpdyn_trd_hpg )   ;   CALL iom_put( "utrd_hpg", ptrdx )    ! hydrostatic pressure gradient 
    224                                      CALL iom_put( "vtrd_hpg", ptrdy ) 
    225          CASE( jpdyn_trd_spg )   ;   CALL iom_put( "utrd_spg", ptrdx )    ! surface pressure gradient 
    226                                      CALL iom_put( "vtrd_spg", ptrdy ) 
    227          CASE( jpdyn_trd_pvo )   ;   CALL iom_put( "utrd_pvo", ptrdx )    ! planetary vorticity 
    228                                      CALL iom_put( "vtrd_pvo", ptrdy ) 
    229          CASE( jpdyn_trd_rvo )   ;   CALL iom_put( "utrd_rvo", ptrdx )    ! relative  vorticity     (or metric term) 
    230                                      CALL iom_put( "vtrd_rvo", ptrdy ) 
    231          CASE( jpdyn_trd_keg )   ;   CALL iom_put( "utrd_keg", ptrdx )    ! Kinetic Energy gradient (or had) 
    232                                      CALL iom_put( "vtrd_keg", ptrdy ) 
    233             z3dx(:,:,:) = 0._wp                                           ! U.dxU & V.dyV (approximation) 
    234             z3dy(:,:,:) = 0._wp 
    235             DO jk = 1, jpkm1                                                  ! no mask as un,vn are masked 
    236                DO jj = 2, jpjm1 
    237                   DO ji = 2, jpim1 
    238                      z3dx(ji,jj,jk) = un(ji,jj,jk) * ( un(ji+1,jj,jk) - un(ji-1,jj,jk) ) / ( 2._wp * e1u(ji,jj) ) 
    239                      z3dy(ji,jj,jk) = vn(ji,jj,jk) * ( vn(ji,jj+1,jk) - vn(ji,jj-1,jk) ) / ( 2._wp * e2v(ji,jj) ) 
    240                   END DO 
    241                END DO 
    242             END DO 
    243             CALL lbc_lnk( z3dx, 'U', -1. )   ;    CALL lbc_lnk( z3dy, 'V', -1. ) 
    244                                      CALL iom_put( "utrd_udx", z3dx  )  
    245                                      CALL iom_put( "vtrd_vdy", z3dy  ) 
    246          CASE( jpdyn_trd_zad )   ;   CALL iom_put( "utrd_zad", ptrdx )    ! vertical   advection 
    247                                      CALL iom_put( "vtrd_zad", ptrdy ) 
    248          CASE( jpdyn_trd_ldf )   ;   CALL iom_put( "utrd_ldf", ptrdx )    ! lateral diffusion 
    249                                      CALL iom_put( "vtrd_ldf", ptrdy ) 
    250          CASE( jpdyn_trd_zdf )   ;   CALL iom_put( "utrd_zdf", ptrdx )    ! vertical diffusion  
    251                                      CALL iom_put( "vtrd_zdf", ptrdy ) 
    252                                      !                                    ! wind stress trends 
    253                                      z2dx(:,:) = ( utau_b(ji,jj) + utau(ji,jj) ) / ( fse3u(:,:,1) * rau0 ) 
    254                                      z2dy(:,:) = ( vtau_b(ji,jj) + vtau(ji,jj) ) / ( fse3v(:,:,1) * rau0 ) 
    255                                      CALL iom_put( "utrd_tau", z2dx ) 
    256                                      CALL iom_put( "vtrd_tau", z2dy ) 
    257          CASE( jpdyn_trd_bfr ) 
    258             IF( .NOT.ln_bfrimp )     CALL iom_put( "utrd_bfr", ptrdx )    ! bottom friction (explicit case) 
    259             IF( .NOT.ln_bfrimp )     CALL iom_put( "vtrd_bfr", ptrdy ) 
    260 !!gm only valid if ln_bfrimp=T otherwise the bottom stress as to be recomputed.... 
    261  
    262          CASE( jpdyn_trd_atf )   ;   CALL iom_put( "utrd_atf", ptrdx )    ! asselin filter trends  
    263                                      CALL iom_put( "vtrd_atf", ptrdy ) 
    264             IF( ln_bfrimp ) THEN                                          ! bottom friction (implicit case) 
    265                z3dx(:,:,:) = 0._wp   ;   z3dy(:,:,:) = 0._wp                 ! after velocity known (now filed at this stage) 
    266                DO jk = 1, jpkm1 
    267                   DO jj = 2, jpjm1 
    268                      DO ji = 2, jpim1 
    269                         ikbu = mbku(ji,jj)          ! deepest ocean u- & v-levels 
    270                         ikbv = mbkv(ji,jj) 
    271                         z3dx(ji,jj,jk) = bfrua(ji,jj) * un(ji,jj,ikbu) / fse3u(ji,jj,ikbu) 
    272                         z3dy(ji,jj,jk) = bfrva(ji,jj) * vn(ji,jj,ikbv) / fse3v(ji,jj,ikbv) 
    273                      END DO 
    274                   END DO 
    275                END DO 
    276                                      CALL iom_put( "utrd_bfr", z3dx )    ! bottom friction (implicit) 
    277                                      CALL iom_put( "vtrd_bfr", z3dy ) 
    278             ENDIF 
    279             ! 
    280          END SELECT 
    281          ! 
    282       ENDIF 
    283       ! 
    284       CALL wrk_dealloc( jpi, jpj     , z2dx, z2dy, ztswu, ztswv ) 
    285       CALL wrk_dealloc( jpi, jpj, jpk, z3dx, z3dy ) 
    286       ! 
    287    END SUBROUTINE trd_3Diom 
    288  
    289 #else 
    290    !!---------------------------------------------------------------------- 
    291    !!   Default case :           Empty module          No trend diagnostics 
    292    !!---------------------------------------------------------------------- 
    293 CONTAINS 
    294    SUBROUTINE trd_mod( ptrdx, ptrdy, ktrd, ctype, kt )   ! Empty routine 
    295       REAL ::   ptrdx(:,:,:), ptrdy(:,:,:) 
    296       INTEGER  ::   ktrd, kt                             
    297       CHARACTER(len=3) ::  ctype                   
    298       WRITE(*,*) 'trd_mod: You should not have seen this print! error ?',   & 
    299          &       ptrdx(1,1,1), ptrdy(1,1,1), ktrd, ctype, kt 
    300    END SUBROUTINE trd_mod 
    301 #endif 
    302  
    303    SUBROUTINE trd_mod_init 
    304       !!---------------------------------------------------------------------- 
    305       !!                  ***  ROUTINE trd_mod_init  *** 
    306       !!  
    307       !! ** Purpose :   Initialization of activated trends 
    308       !!---------------------------------------------------------------------- 
    309       USE in_out_manager          ! I/O manager 
    310  
    311       NAMELIST/namtrd/ ln_3D_trd_d, ln_KE_trd, ln_vor_trd, ln_ML_trd_d,   & 
    312          &             ln_3D_trd_t, ln_PE_trd, ln_glo_trd, ln_ML_trd_t,   & 
    313          &             nn_trd , cn_trdrst_in , ln_trdmld_restart,         & 
     41      NAMELIST/namtrd/ ln_dyn_trd, ln_KE_trd, ln_vor_trd, ln_dyn_mld,   & 
     42         &             ln_tra_trd, ln_PE_trd, ln_glo_trd, ln_tra_mld,   & 
     43         &             nn_trd , cn_trdrst_in , ln_trdmld_restart,       & 
    31444         &             nn_ctls, cn_trdrst_out, ln_trdmld_instant, rn_ucf 
    31545      !!---------------------------------------------------------------------- 
    31646 
    317       IF( l_trdtra .OR. l_trddyn )   THEN 
    318          REWIND( numnam ) 
    319          READ  ( numnam, namtrd )      ! namelist namtrd : trends diagnostic 
     47      REWIND( numnam ) 
     48      READ  ( numnam, namtrd )      ! namelist namtrd : trends diagnostic 
    32049 
    321          IF(lwp) THEN 
    322             WRITE(numout,*) 
    323             WRITE(numout,*) ' trd_mod_init : Momentum/Tracers trends' 
    324             WRITE(numout,*) ' ~~~~~~~~~~~~~' 
    325             WRITE(numout,*) '   Namelist namtrd : set trends parameters' 
    326             WRITE(numout,*) '      U & V trends: 3D output                 ln_3D_trd_d        = ', ln_3D_trd_d 
    327             WRITE(numout,*) '      T & S trends: 3D output                 ln_3D_trd_t        = ', ln_3D_trd_t 
    328             WRITE(numout,*) '      Kinetic   Energy trends                 ln_KE_trd          = ', ln_KE_trd 
    329             WRITE(numout,*) '      Potential Energy trends                 ln_PE_trd          = ', ln_PE_trd 
    330             WRITE(numout,*) '      Barotropic vorticity trends             ln_vor_trd         = ', ln_vor_trd 
    331             WRITE(numout,*) '      check domain averaged dyn & tra trends  ln_glo_trd         = ', ln_glo_trd 
    332             WRITE(numout,*) '      U & V trends: Mixed Layer averaged      ln_ML_trd_d        = ', ln_3D_trd_d 
    333             WRITE(numout,*) '      T & S trends: Mixed Layer averaged      ln_ML_trd_t        = ', ln_3D_trd_t 
    334      ! 
    335             WRITE(numout,*) '      frequency of trends diagnostics (glo)   nn_trd             = ', nn_trd 
    336             WRITE(numout,*) '      control surface type            (mld)   nn_ctls            = ', nn_ctls 
    337             WRITE(numout,*) '      restart for ML diagnostics              ln_trdmld_restart  = ', ln_trdmld_restart 
    338             WRITE(numout,*) '      instantaneous or mean ML T/S            ln_trdmld_instant  = ', ln_trdmld_instant 
    339             WRITE(numout,*) '      unit conversion factor                  rn_ucf             = ', rn_ucf 
    340         ENDIF 
     50      IF(lwp) THEN                  ! control print 
     51         WRITE(numout,*) 
     52         WRITE(numout,*) ' trd_init : Momentum/Tracers trends' 
     53         WRITE(numout,*) ' ~~~~~~~~~~' 
     54         WRITE(numout,*) '   Namelist namtrd : set trends parameters' 
     55         WRITE(numout,*) '      global domain averaged dyn & tra trends        ln_glo_trd  = ', ln_glo_trd 
     56         WRITE(numout,*) '      U & V trends: 3D output                        ln_dyn_trd  = ', ln_dyn_trd 
     57         WRITE(numout,*) '      U & V trends: Mixed Layer averaged             ln_dyn_mld  = ', ln_dyn_mld 
     58         WRITE(numout,*) '      T & S trends: 3D output                        ln_tra_trd  = ', ln_tra_trd 
     59         WRITE(numout,*) '      T & S trends: Mixed Layer averaged             ln_tra_mld  = ', ln_tra_mld 
     60         WRITE(numout,*) '      Kinetic   Energy trends                        ln_KE_trd   = ', ln_KE_trd 
     61         WRITE(numout,*) '      Potential Energy trends                        ln_PE_trd   = ', ln_PE_trd 
     62         WRITE(numout,*) '      Barotropic vorticity trends                    ln_vor_trd  = ', ln_vor_trd 
     63         ! 
     64         WRITE(numout,*) '      frequency of trends diagnostics (glo)   nn_trd             = ', nn_trd 
     65         WRITE(numout,*) '      control surface type            (mld)   nn_ctls            = ', nn_ctls 
     66         WRITE(numout,*) '      restart for ML diagnostics              ln_trdmld_restart  = ', ln_trdmld_restart 
     67         WRITE(numout,*) '      instantaneous or mean ML T/S            ln_trdmld_instant  = ', ln_trdmld_instant 
     68         WRITE(numout,*) '      unit conversion factor                  rn_ucf             = ', rn_ucf 
    34169      ENDIF 
    34270      ! 
    343       IF( ln_KE_trd .OR. ln_PE_trd .OR. ln_ML_trd_d )   & 
     71      !                             ! trend extraction flags   
     72      l_trdtra = .FALSE.                                                       ! tracers   
     73      IF ( ln_tra_trd .OR. ln_PE_trd .OR. ln_tra_mld .OR.   & 
     74         & ln_glo_trd                                       )   l_trdtra = .TRUE.  
     75      ! 
     76      l_trddyn = .FALSE.                                                       ! momentum 
     77      IF ( ln_dyn_trd .OR. ln_KE_trd .OR. ln_dyn_mld .OR.   & 
     78         & ln_vor_trd .OR. ln_glo_trd                       )   l_trddyn = .TRUE. 
     79      ! 
     80       
     81      IF( ln_KE_trd .OR. ln_PE_trd .OR. ln_dyn_mld )   & 
    34482         CALL ctl_stop( 'KE, PE, aur ML on momentum are not yet coded we stop' ) 
     83 
     84      ! 
     85      IF( ln_glo_trd )    CALL trd_glo_init       ! integral constraints trends 
     86      IF( ln_tra_mld )    CALL trd_mld_init       ! mixed-layer trends (active  tracers)   
     87      IF( ln_vor_trd )    CALL trd_vor_init       ! vorticity trends         
     88      ! 
    34589!!gm  : Potential BUG : 3D output only for vector invariant form!  add a ctl_stop or code the flux form case 
    34690!!gm  : bug/pb for vertical advection of tracer in vvl case: add T.dt[eta] in the output...  
    34791      ! 
    348       IF( lk_trddyn .OR. lk_trdtra )    CALL trd_icp_init       ! integral constraints trends 
    349       IF( lk_trdmld                )    CALL trd_mld_init       ! mixed-layer trends (active  tracers)   
    350       IF( lk_trdvor                )    CALL trd_vor_init       ! vorticity trends         
    35192      ! 
    352    END SUBROUTINE trd_mod_init 
     93   END SUBROUTINE trd_init 
    35394 
    35495   !!====================================================================== 
    355 END MODULE trdmod 
     96END MODULE trdini 
  • branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRD/trdmld.F90

    r3294 r3318  
    1111   !!                 !  05-05  (C. Deltel)     Diagnose trends of time averaged ML T & S 
    1212   !!---------------------------------------------------------------------- 
    13 #if   defined key_trdmld   ||   defined key_esopa 
    14    !!---------------------------------------------------------------------- 
    15    !!   'key_trdmld'                          mixed layer trend diagnostics 
     13 
    1614   !!---------------------------------------------------------------------- 
    1715   !!   trd_mld          : T and S cumulated trends averaged over the mixed layer 
     
    2119   USE oce             ! ocean dynamics and tracers variables 
    2220   USE dom_oce         ! ocean space and time domain variables 
    23    USE trdmod_oce      ! ocean variables trends 
     21   USE trd_oce         ! trends: ocean variables 
    2422   USE trdmld_oce      ! ocean variables trends 
    2523   USE ldftra_oce      ! ocean active tracers lateral physics 
     
    9492      !!            surface and the control surface is called "mixed-layer" 
    9593      !!---------------------------------------------------------------------- 
    96       ! 
    9794      INTEGER                         , INTENT( in ) ::   ktrd       ! ocean trend index 
    9895      CHARACTER(len=2)                , INTENT( in ) ::   ctype      ! 2D surface/bottom or 3D interior physics 
     
    112109      IF( icount == 1 ) THEN         
    113110         ! 
    114          tmltrd(:,:,:) = 0.e0    ;    smltrd(:,:,:) = 0.e0    ! <<< reset trend arrays to zero 
     111         tmltrd(:,:,:) = 0._wp    ;    smltrd(:,:,:) = 0._wp    ! <<< reset trend arrays to zero 
    115112          
    116113         ! ... Set nmld(ji,jj) = index of first T point below control surf. or outside mixed-layer 
    117114         IF( nn_ctls == 0 ) THEN       ! * control surface = mixed-layer with density criterion  
    118115            nmld(:,:) = nmln(:,:)    ! array nmln computed in zdfmxl.F90 
    119          ELSE IF( nn_ctls == 1 ) THEN  ! * control surface = read index from file  
     116         ELSEIF( nn_ctls == 1 ) THEN   ! * control surface = read index from file  
    120117            nmld(:,:) = nbol(:,:) 
    121          ELSE IF( nn_ctls >= 2 ) THEN  ! * control surface = model level 
     118         ELSEIF( nn_ctls >= 2 ) THEN   ! * control surface = model level 
    122119            nn_ctls = MIN( nn_ctls, jpktrd - 1 ) 
    123120            nmld(:,:) = nn_ctls + 1 
     
    129126            ! Check of validity : nmld(ji,jj) <= jpktrd 
    130127            isum        = 0 
    131             zvlmsk(:,:) = 0.e0 
     128            zvlmsk(:,:) = 0._wp 
    132129 
    133130            IF( jpktrd < jpk ) THEN  
     
    138135                     ELSE 
    139136                        isum = isum + 1 
    140                         zvlmsk(ji,jj) = 0. 
     137                        zvlmsk(ji,jj) = 0._wp 
    141138                     ENDIF 
    142139                  END DO 
     
    157154          
    158155         ! ... Weights for vertical averaging 
    159          wkx(:,:,:) = 0.e0 
     156         wkx(:,:,:) = 0._wp 
    160157         DO jk = 1, jpktrd             ! initialize wkx with vertical scale factor in mixed-layer 
    161158            DO jj = 1,jpj 
     
    166163         END DO 
    167164          
    168          rmld(:,:) = 0.e0                ! compute mixed-layer depth : rmld 
     165         rmld(:,:) = 0._wp               ! compute mixed-layer depth : rmld 
    169166         DO jk = 1, jpktrd 
    170167            rmld(:,:) = rmld(:,:) + wkx(:,:,jk) 
     
    172169          
    173170         DO jk = 1, jpktrd             ! compute integration weights 
    174             wkx(:,:,jk) = wkx(:,:,jk) / MAX( 1., rmld(:,:) ) 
     171            wkx(:,:,jk) = wkx(:,:,jk) / MAX( 1._wp, rmld(:,:) ) 
    175172         END DO 
    176173 
     
    241238      !!       In IV), the appropriate trends are written in the trends NetCDF file. 
    242239      !! 
    243       !! References : 
    244       !!       - Vialard & al. 
    245       !!       - See NEMO documentation (in preparation) 
    246       !!---------------------------------------------------------------------- 
    247       ! 
     240      !! References :  Vialard et al.,2001, JPO. 
     241      !!---------------------------------------------------------------------- 
    248242      INTEGER, INTENT( in ) ::   kt   ! ocean time-step index 
    249243      ! 
     
    761755      ! ------------------------------------------------- 
    762756 
    763       IF( ( lk_trdmld ) .AND. ( MOD( nitend, nn_trd ) /= 0 ) ) THEN 
     757      IF( MOD( nitend, nn_trd ) /= 0 ) THEN 
    764758         WRITE(numout,cform_err) 
    765759         WRITE(numout,*) '                Your nitend parameter, nitend = ', nitend 
     
    774768      END IF 
    775769 
    776       IF( ( lk_trdmld ) .AND. ( nn_cla == 1 ) ) THEN 
    777          WRITE(numout,cform_war) 
    778          WRITE(numout,*) '                You set n_cla = 1. Note that the Mixed-Layer diagnostics  ' 
    779          WRITE(numout,*) '                are not exact along the corresponding straits.            ' 
    780          nwarn = nwarn + 1 
    781       END IF 
     770      IF( nn_cla == 1 )   CALL ctl_warn( '      You set n_cla = 1. Note that the Mixed-Layer diagnostics  ',   & 
     771         &                               '      are not exact along the corresponding straits.            ') 
    782772 
    783773      !                                   ! allocate trdmld arrays 
     
    951941   END SUBROUTINE trd_mld_init 
    952942 
    953 #else 
    954    !!---------------------------------------------------------------------- 
    955    !!   Default option :                                       Empty module 
    956    !!---------------------------------------------------------------------- 
    957 CONTAINS 
    958    SUBROUTINE trd_mld( kt )             ! Empty routine 
    959       INTEGER, INTENT( in) ::   kt 
    960       WRITE(*,*) 'trd_mld: You should not have seen this print! error?', kt 
    961    END SUBROUTINE trd_mld 
    962    SUBROUTINE trd_mld_zint( pttrdmld, pstrdmld, ktrd, ctype ) 
    963       REAL, DIMENSION(:,:,:), INTENT( in ) ::   & 
    964          pttrdmld, pstrdmld                   ! Temperature and Salinity trends 
    965       INTEGER, INTENT( in ) ::   ktrd         ! ocean trend index 
    966       CHARACTER(len=2), INTENT( in ) ::   &   
    967          ctype                                ! surface/bottom (2D arrays) or 
    968          !                                    ! interior (3D arrays) physics 
    969       WRITE(*,*) 'trd_mld_zint: You should not have seen this print! error?', pttrdmld(1,1,1) 
    970       WRITE(*,*) '  "      "  : You should not have seen this print! error?', pstrdmld(1,1,1) 
    971       WRITE(*,*) '  "      "  : You should not have seen this print! error?', ctype 
    972       WRITE(*,*) '  "      "  : You should not have seen this print! error?', ktrd 
    973    END SUBROUTINE trd_mld_zint 
    974    SUBROUTINE trd_mld_init              ! Empty routine 
    975       WRITE(*,*) 'trd_mld_init: You should not have seen this print! error?' 
    976    END SUBROUTINE trd_mld_init 
    977 #endif 
    978  
    979943   !!====================================================================== 
    980944END MODULE trdmld 
  • branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRD/trdmld_oce.F90

    r2715 r3318  
    55   !!====================================================================== 
    66   !! History :  1.0  ! 2004-08  (C. Talandier)  New trends organization 
     7   !!            3.5  ! 2012-02  (G. Madec) suppress the trend keys 
    78   !!---------------------------------------------------------------------- 
    89   USE par_oce        ! ocean parameters 
     
    1314   PUBLIC   trdmld_oce_alloc    ! Called in trdmld.F90 
    1415 
    15 #if defined key_trdmld 
    16    LOGICAL, PUBLIC, PARAMETER ::   lk_trdmld = .TRUE.    !: ML trend flag 
    17 #else 
    18    LOGICAL, PUBLIC, PARAMETER ::   lk_trdmld = .FALSE.   !: ML trend flag 
    19 #endif 
    20    !!* mixed layer trends indices 
    21    INTEGER, PARAMETER, PUBLIC ::   jpltrd = 11      !: number of mixed-layer trends arrays 
     16   !                                                !* mixed layer trend indices 
     17   INTEGER, PUBLIC, PARAMETER ::   jpltrd = 11      !: number of mixed-layer trends arrays 
    2218   INTEGER, PUBLIC            ::   jpktrd           !: max level for mixed-layer trends diag. 
    2319   ! 
     
    3531   INTEGER, PUBLIC, PARAMETER ::   jpmld_atf = 11   !:  asselin trend (**MUST BE THE LAST ONE**) 
    3632 
    37 #if   defined  key_trdmld   ||   defined key_esopa 
    38    !!---------------------------------------------------------------------- 
    39    !!   'key_trdmld'                         mixed layer trends diagnostics 
    40    !!---------------------------------------------------------------------- 
    4133 
    4234   !! Arrays used for diagnosing mixed-layer trends  
     
    7971      smltrd_csum_ln,               & !:    ( idem for salinity ) 
    8072      smltrd_csum_ub                  !:  
    81 #endif 
     73 
    8274   !!---------------------------------------------------------------------- 
    8375   !! NEMO/OPA 4.0 , NEMO Consortium (2011) 
     
    10193     ierr(:) = 0 
    10294 
    103 #if   defined  key_trdmld   ||   defined key_esopa 
    10495     ALLOCATE( nmld(jpi,jpj), nbol(jpi,jpj),       & 
    10596        &      wkx(jpi,jpj,jpk), rmld(jpi,jpj),    &  
     
    125116        &      tmltrd_csum_ub(jpi,jpj,jpltrd), smltrd_sum(jpi,jpj,jpltrd),     & 
    126117        &      smltrd_csum_ln(jpi,jpj,jpltrd), smltrd_csum_ub(jpi,jpj,jpltrd), STAT=ierr(5) ) 
    127 #endif 
    128118      ! 
    129119      trdmld_oce_alloc = MAXVAL( ierr ) 
  • branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRD/trdmld_rst.F90

    r2528 r3318  
    44   !! Ocean dynamic :  Input/Output files for restart on mixed-layer diagnostics 
    55   !!================================================================================= 
    6    !! History :  9.0  ! 05-05 (C. Deltel) Original code 
     6   !! History :  1.0  ! 2005-05 (C. Deltel) Original code 
    77   !!--------------------------------------------------------------------------------- 
    8 #if defined key_trdmld 
     8 
     9   !!--------------------------------------------------------------------------------- 
     10   !!  trd_mld_rst_write : write mixed layer trend restart 
     11   !!  trd_mld_rst_read  : read  mixed layer trend restart 
    912   !!--------------------------------------------------------------------------------- 
    1013   USE dom_oce         ! ocean space and time domain 
    11    USE trdmod_oce      ! ocean variables for trend diagnostics (i.e. icp/mixed-layer/vorticity) 
     14   USE trd_oce         ! trends: ocean variables 
    1215   USE in_out_manager  ! I/O manager 
    1316   USE iom             ! I/O module 
     
    2730   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 
    2831   !!--------------------------------------------------------------------------------- 
    29    
    3032CONTAINS 
    3133   
     
    9294         CALL iom_rstput( kt, nitrst, nummldw, 'tml_sumb'        , tml_sumb        ) 
    9395         DO jk = 1, jpltrd 
    94             IF( jk < 10 ) THEN   ;   WRITE(charout,FMT="('tmltrd_csum_ub_', I1)") jk 
    95             ELSE                 ;   WRITE(charout,FMT="('tmltrd_csum_ub_', I2)") jk 
     96            IF( jk < 10 ) THEN   ;   WRITE(charout,FMT="('tmltrd_csum_ub_', I1)")   jk 
     97            ELSE                 ;   WRITE(charout,FMT="('tmltrd_csum_ub_', I2)")   jk 
    9698            ENDIF 
    9799            CALL iom_rstput( kt, nitrst, nummldw, charout,  tmltrd_csum_ub(:,:,jk) ) 
     
    103105         CALL iom_rstput( kt, nitrst, nummldw, 'sml_sumb'        , sml_sumb        ) 
    104106         DO jk = 1, jpltrd 
    105             IF( jk < 10 ) THEN   ;   WRITE(charout,FMT="('smltrd_csum_ub_', I1)") jk 
    106             ELSE                 ;   WRITE(charout,FMT="('smltrd_csum_ub_', I2)") jk 
     107            IF( jk < 10 ) THEN   ;   WRITE(charout,FMT="('smltrd_csum_ub_', I1)")   jk 
     108            ELSE                 ;   WRITE(charout,FMT="('smltrd_csum_ub_', I2)")   jk 
    107109            ENDIF 
    108110            CALL iom_rstput( kt, nitrst, nummldw, charout , smltrd_csum_ub(:,:,jk) ) 
     
    116118      ENDIF 
    117119      !  
    118       !     
    119120   END SUBROUTINE trd_mld_rst_write 
    120121 
    121122 
    122123   SUBROUTINE trd_mld_rst_read 
    123     !!---------------------------------------------------------------------------- 
    124     !!                   ***  SUBROUTINE trd_mld_rst_lec  *** 
    125     !!                    
    126     !! ** Purpose :   Read file for mixed-layer diagnostics restart. 
    127     !!---------------------------------------------------------------------------- 
    128     INTEGER  ::  inum       ! temporary logical unit 
    129     ! 
    130     CHARACTER (len=35) :: charout 
    131     INTEGER ::   jk         ! loop indice 
    132     INTEGER ::   jlibalt = jprstlib 
    133     LOGICAL ::   llok 
    134     !!----------------------------------------------------------------------------- 
     124      !!---------------------------------------------------------------------------- 
     125      !!                   ***  SUBROUTINE trd_mld_rst_lec  *** 
     126      !!                    
     127      !! ** Purpose :   Read file for mixed-layer diagnostics restart. 
     128      !!---------------------------------------------------------------------------- 
     129      INTEGER  ::  inum       ! temporary logical unit 
     130      ! 
     131      CHARACTER (len=35) :: charout 
     132      INTEGER ::   jk         ! loop indice 
     133      INTEGER ::   jlibalt = jprstlib 
     134      LOGICAL ::   llok 
     135      !!----------------------------------------------------------------------------- 
    135136 
    136     IF(lwp)  THEN 
    137        WRITE(numout,*) 
    138        WRITE(numout,*) ' trd_mld_rst_read : read the NetCDF MLD restart file' 
    139        WRITE(numout,*) ' ~~~~~~~~~~~~~~~~' 
    140     ENDIF 
    141     IF ( jprstlib == jprstdimg ) THEN 
    142        ! eventually read netcdf file (monobloc)  for restarting on different number of processors 
    143        ! if {cn_trdrst_in}.nc exists, then set jlibalt to jpnf90 
    144        INQUIRE( FILE = TRIM(cn_trdrst_in)//'.nc', EXIST = llok ) 
    145        IF ( llok ) THEN ; jlibalt = jpnf90  ; ELSE ; jlibalt = jprstlib ; ENDIF 
    146     ENDIF 
     137      IF(lwp)  THEN 
     138         WRITE(numout,*) 
     139         WRITE(numout,*) ' trd_mld_rst_read : read the NetCDF MLD restart file' 
     140         WRITE(numout,*) ' ~~~~~~~~~~~~~~~~' 
     141      ENDIF 
     142      IF ( jprstlib == jprstdimg ) THEN 
     143         ! eventually read netcdf file (monobloc)  for restarting on different number of processors 
     144         ! if {cn_trdrst_in}.nc exists, then set jlibalt to jpnf90 
     145         INQUIRE( FILE = TRIM(cn_trdrst_in)//'.nc', EXIST = llok ) 
     146         IF ( llok ) THEN   ;   jlibalt = jpnf90    
     147         ELSE               ;   jlibalt = jprstlib    
     148         ENDIF 
     149      ENDIF 
    147150 
    148     CALL iom_open( cn_trdrst_in, inum, kiolib = jlibalt )  
     151      CALL iom_open( cn_trdrst_in, inum, kiolib = jlibalt )  
    149152 
    150     IF( ln_trdmld_instant ) THEN  
    151        !-- Temperature 
    152        CALL iom_get( inum, jpdom_autoglo, 'tmlbb'           , tmlbb          ) 
    153        CALL iom_get( inum, jpdom_autoglo, 'tmlbn'           , tmlbn          ) 
    154        CALL iom_get( inum, jpdom_autoglo, 'tmlatfb'         , tmlatfb        ) 
    155  
    156        !-- Salinity 
    157        CALL iom_get( inum, jpdom_autoglo, 'smlbb'           , smlbb          ) 
    158        CALL iom_get( inum, jpdom_autoglo, 'smlbn'           , smlbn          ) 
    159        CALL iom_get( inum, jpdom_autoglo, 'smlatfb'         , smlatfb        ) 
    160     ELSE 
    161        CALL iom_get( inum, jpdom_autoglo, 'rmldbn'          , rmldbn         ) ! needed for rmld_sum 
    162  
    163        !-- Temperature 
    164        CALL iom_get( inum, jpdom_autoglo, 'tmlbn'           , tmlbn          ) ! needed for tml_sum 
    165        CALL iom_get( inum, jpdom_autoglo, 'tml_sumb'        , tml_sumb       ) 
    166        DO jk = 1, jpltrd 
    167           IF( jk < 10 )   THEN 
    168              WRITE(charout,FMT="('tmltrd_csum_ub_', I1)") jk 
    169           ELSE 
    170              WRITE(charout,FMT="('tmltrd_csum_ub_', I2)") jk 
    171           ENDIF 
    172           CALL iom_get( inum, jpdom_autoglo, charout, tmltrd_csum_ub(:,:,jk) ) 
    173        ENDDO 
    174        CALL iom_get( inum, jpdom_autoglo, 'tmltrd_atf_sumb' , tmltrd_atf_sumb) 
    175  
    176        !-- Salinity 
    177        CALL iom_get( inum, jpdom_autoglo, 'smlbn'           , smlbn          ) ! needed for sml_sum 
    178        CALL iom_get( inum, jpdom_autoglo, 'sml_sumb'        , sml_sumb       ) 
    179        DO jk = 1, jpltrd 
    180           IF( jk < 10 )   THEN 
    181              WRITE(charout,FMT="('smltrd_csum_ub_', I1)") jk 
    182           ELSE 
    183              WRITE(charout,FMT="('smltrd_csum_ub_', I2)") jk 
    184           ENDIF 
    185           CALL iom_get( inum, jpdom_autoglo, charout, smltrd_csum_ub(:,:,jk) ) 
    186        ENDDO 
    187        CALL iom_get( inum, jpdom_autoglo, 'smltrd_atf_sumb' , smltrd_atf_sumb) 
    188  
    189        CALL iom_close( inum ) 
    190     ENDIF 
    191  
    192   END SUBROUTINE trd_mld_rst_read 
     153      IF( ln_trdmld_instant ) THEN  
     154         !-- Temperature 
     155         CALL iom_get( inum, jpdom_autoglo, 'tmlbb'           , tmlbb          ) 
     156         CALL iom_get( inum, jpdom_autoglo, 'tmlbn'           , tmlbn          ) 
     157         CALL iom_get( inum, jpdom_autoglo, 'tmlatfb'         , tmlatfb        ) 
     158         ! 
     159         !-- Salinity 
     160         CALL iom_get( inum, jpdom_autoglo, 'smlbb'           , smlbb          ) 
     161         CALL iom_get( inum, jpdom_autoglo, 'smlbn'           , smlbn          ) 
     162         CALL iom_get( inum, jpdom_autoglo, 'smlatfb'         , smlatfb        ) 
     163      ELSE 
     164         CALL iom_get( inum, jpdom_autoglo, 'rmldbn'          , rmldbn         ) ! needed for rmld_sum 
     165         ! 
     166         !-- Temperature 
     167         CALL iom_get( inum, jpdom_autoglo, 'tmlbn'           , tmlbn          ) ! needed for tml_sum 
     168         CALL iom_get( inum, jpdom_autoglo, 'tml_sumb'        , tml_sumb       ) 
     169         DO jk = 1, jpltrd 
     170            IF( jk < 10 ) THEN   ;   WRITE(charout,FMT="('tmltrd_csum_ub_', I1)")   jk 
     171            ELSE                 ;   WRITE(charout,FMT="('tmltrd_csum_ub_', I2)")   jk 
     172            ENDIF 
     173            CALL iom_get( inum, jpdom_autoglo, charout, tmltrd_csum_ub(:,:,jk) ) 
     174         END DO 
     175         CALL iom_get( inum, jpdom_autoglo, 'tmltrd_atf_sumb' , tmltrd_atf_sumb) 
     176         ! 
     177         !-- Salinity 
     178         CALL iom_get( inum, jpdom_autoglo, 'smlbn'           , smlbn          ) ! needed for sml_sum 
     179         CALL iom_get( inum, jpdom_autoglo, 'sml_sumb'        , sml_sumb       ) 
     180         DO jk = 1, jpltrd 
     181            IF( jk < 10 ) THEN   ;   WRITE(charout,FMT="('smltrd_csum_ub_', I1)")   jk 
     182            ELSE                 ;   WRITE(charout,FMT="('smltrd_csum_ub_', I2)")   jk 
     183            ENDIF 
     184            CALL iom_get( inum, jpdom_autoglo, charout, smltrd_csum_ub(:,:,jk) ) 
     185         END DO 
     186         CALL iom_get( inum, jpdom_autoglo, 'smltrd_atf_sumb' , smltrd_atf_sumb) 
     187         ! 
     188         CALL iom_close( inum ) 
     189      ENDIF 
     190      ! 
     191   END SUBROUTINE trd_mld_rst_read 
    193192   
    194 #else 
    195   !!================================================================================= 
    196   !!                       ***  MODULE  trdmld_rst  *** 
    197   !! Ocean dynamic :  Input/Output files for restart on mixed-layer diagnostics 
    198   !!================================================================================= 
    199 CONTAINS 
    200   SUBROUTINE trd_mld_rst_write( kt )           !  No ML diags ==> empty routine 
    201     WRITE(*,*) 'trd_mld_rst_wri: You should not have seen this print! error?', kt 
    202   END SUBROUTINE trd_mld_rst_write 
    203   SUBROUTINE trd_mld_rst_read                  !  No ML Diags ==> empty routine 
    204   END SUBROUTINE trd_mld_rst_read 
    205 #endif 
    206  
    207193  !!================================================================================= 
    208194END MODULE trdmld_rst 
  • branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRD/trdtra.F90

    r3317 r3318  
    77   !!            3.5  !  2012-02  (G. Madec) update the comments  
    88   !!---------------------------------------------------------------------- 
    9 #if  defined key_trdtra || defined key_trdmld || defined key_trdmld_trc  
    10    !!---------------------------------------------------------------------- 
    11    !!   trd_tra       : pre-process the tracer trends and calll trd_mod(_trc) 
     9 
     10   !!---------------------------------------------------------------------- 
     11   !!   trd_tra       : pre-process the tracer trends 
    1212   !!   trd_tra_adv   : transform a div(U.T) trend into a U.grad(T) trend 
     13   !!   trd_tra_mng   : tracer trend manager: dispatch to the diagnostic modules 
     14   !!   trd_tra_iom   : output 3D tracer trends using IOM 
    1315   !!---------------------------------------------------------------------- 
    1416   USE oce            ! ocean dynamics and tracers variables 
    1517   USE dom_oce        ! ocean domain  
     18   USE sbc_oce        ! surface boundary condition: ocean 
    1619   USE zdf_oce        ! ocean vertical physics 
     20   USE trd_oce        ! trends: ocean variables 
     21   USE trdmod_trc     ! ocean passive mixed layer tracers trends  
     22   USE trdglo         ! trends:global domain averaged 
     23   USE trdmld         ! ocean active mixed layer tracers trends  
     24   USE ldftra_oce     ! ocean active tracers lateral physics 
    1725   USE zdfddm         ! vertical physics: double diffusion 
    18    USE trdmod_oce     ! ocean active mixed layer tracers trends  
    19    USE trdmod         ! ocean active mixed layer tracers trends  
    20    USE trdmod_trc     ! ocean passive mixed layer tracers trends  
    21    USE ldftra_oce     ! ocean active tracers lateral physics 
     26   USE phycst         ! physical constants 
    2227   USE in_out_manager ! I/O manager 
     28   USE iom            ! I/O manager library 
    2329   USE lib_mpp        ! MPP library 
    2430   USE wrk_nemo       ! Memory allocation 
     
    2834 
    2935   PUBLIC   trd_tra   ! called by all tra_... modules 
    30   
     36 
     37   REAL(wp) ::   r2dt   ! time-step, = 2 rdttra except at nit000 (=rdttra) if neuler=0 
     38 
    3139   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   trdtx, trdty, trdt   ! use to store the temperature trends 
    3240 
     
    6472      !!              call to trd_tra_adv 
    6573      !!              - 'TRA' case : regroup T & S trends 
    66       !!              - send the trends to trd_mod(_trc) for further processing 
     74      !!              - send the trends to trd_tra_mng (trdmod_trc) for further processing 
    6775      !!---------------------------------------------------------------------- 
    6876      INTEGER                         , INTENT(in)           ::   kt      ! time step 
     
    8896         IF( PRESENT( ptra ) ) THEN                       ! advection: transform flux into trend 
    8997            SELECT CASE( ktrd )      
    90             CASE( jptra_trd_xad )   ;   CALL trd_tra_adv( ptrd, pun, ptra, 'X', trdtx )  
    91             CASE( jptra_trd_yad )   ;   CALL trd_tra_adv( ptrd, pun, ptra, 'Y', trdty )  
    92             CASE( jptra_trd_zad )   ;   CALL trd_tra_adv( ptrd, pun, ptra, 'Z', trdt  )  
     98            CASE( jptra_xad )   ;   CALL trd_tra_adv( ptrd, pun, ptra, 'X', trdtx )  
     99            CASE( jptra_yad )   ;   CALL trd_tra_adv( ptrd, pun, ptra, 'Y', trdty )  
     100            CASE( jptra_zad )   ;   CALL trd_tra_adv( ptrd, pun, ptra, 'Z', trdt  )  
    93101            END SELECT 
    94102         ELSE                                             ! other trends: 
    95             trdt(:,:,:) = ptrd(:,:,:) * tmask(:,:,:)                      ! mask & store 
    96             IF( ktrd == jptra_trd_bbc .OR. ktrd == jptra_trd_qsr ) THEN   ! qsr, bbc: on temperature only 
     103            trdt(:,:,:) = ptrd(:,:,:) * tmask(:,:,:)              ! mask & store 
     104            IF( ktrd == jptra_bbc .OR. ktrd == jptra_qsr ) THEN   ! qsr, bbc: on temperature only 
    97105               ztrds(:,:,:) = 0._wp 
    98                CALL trd_mod( trdt, ztrds, ktrd, ctype, kt )                  ! send to trd_mod 
     106               CALL trd_tra_mng( trdt, ztrds, ktrd, kt )               ! send to trd_tra_mng 
    99107            ENDIF 
    100108         ENDIF 
     
    105113         ! 
    106114         IF( PRESENT( ptra ) ) THEN      ! advection: transform the advective flux into a trend 
    107             SELECT CASE( ktrd )          !            and send T & S trends to trd_mod 
    108             CASE( jptra_trd_xad )   ;   CALL trd_tra_adv( ptrd , pun  , ptra, 'X'  , ztrds )  
    109                                         CALL trd_mod    ( trdtx, ztrds, ktrd, ctype, kt    ) 
    110             CASE( jptra_trd_yad )   ;   CALL trd_tra_adv( ptrd , pun  , ptra, 'Y'  , ztrds )  
    111                                     ;   CALL trd_mod    ( trdty, ztrds, ktrd, ctype, kt    ) 
    112             CASE( jptra_trd_zad )   ;   CALL trd_tra_adv( ptrd , pun  , ptra, 'Z'  , ztrds )  
    113                                         CALL trd_mod    ( trdt , ztrds, ktrd, ctype, kt    ) 
     115            SELECT CASE( ktrd )          !            and send T & S trends to trd_tra_mng 
     116            CASE( jptra_xad )   ;   CALL trd_tra_adv( ptrd , pun  , ptra, 'X'  , ztrds )  
     117                                    CALL trd_tra_mng( trdtx, ztrds, ktrd, kt   ) 
     118            CASE( jptra_yad )   ;   CALL trd_tra_adv( ptrd , pun  , ptra, 'Y'  , ztrds )  
     119                                ;   CALL trd_tra_mng( trdty, ztrds, ktrd, kt   ) 
     120            CASE( jptra_zad )   ;   CALL trd_tra_adv( ptrd , pun  , ptra, 'Z'  , ztrds )  
     121                                    CALL trd_tra_mng( trdt , ztrds, ktrd, kt   ) 
    114122            END SELECT 
    115          ELSE                            ! other trends: mask and send T & S trends to trd_mod 
     123         ELSE                            ! other trends: mask and send T & S trends to trd_tra_mng 
    116124            ztrds(:,:,:) = ptrd(:,:,:) * tmask(:,:,:) 
    117             CALL trd_mod( trdt, ztrds, ktrd, ctype, kt )   
     125            CALL trd_tra_mng( trdt, ztrds, ktrd, kt )   
    118126         ENDIF 
    119127         ! 
    120          IF( ktrd == jptra_trd_zdfp ) THEN     ! diagnose the "PURE" Kz trend (here: just before the swap) 
     128         IF( ktrd == jptra_zdfp ) THEN     ! diagnose the "PURE" Kz trend (here: just before the swap) 
    121129            ! 
    122             IF( ln_traldf_iso ) THEN      ! iso-neutral diffusion only otherwise jptra_trd_zdf is "PURE" 
     130            IF( ln_traldf_iso ) THEN      ! iso-neutral diffusion only otherwise jptra_zdf is "PURE" 
    123131               ! 
    124132               CALL wrk_alloc( jpi, jpj, jpk, zwt, zws, ztrdt ) 
     
    136144                  ztrds(:,:,jk) = ( zws(:,:,jk) - zws(:,:,jk+1) ) / fse3t(:,:,jk)  
    137145               END DO 
    138                CALL trd_mod( ztrdt, ztrds, jptra_trd_zdfp, ctype, kt )   
     146               CALL trd_tra_mng( ztrdt, ztrds, jptra_zdfp, kt )   
    139147               ! 
    140148               CALL wrk_dealloc( jpi, jpj, jpk, zwt, zws, ztrdt ) 
     
    147155      IF( ctype == 'TRC' ) THEN                           !==  passive tracer trend  ==! 
    148156         ! 
    149          IF( PRESENT( ptra ) ) THEN                          ! advection: transform flux into a trend 
     157         IF( PRESENT( ptra ) ) THEN                          ! advection: transform flux into a masked trend 
    150158            SELECT CASE( ktrd ) 
    151             CASE( jptra_trd_xad )   ;   CALL trd_tra_adv( ptrd , pun , ptra, 'X', ztrds )  
    152             CASE( jptra_trd_yad )   ;   CALL trd_tra_adv( ptrd , pun , ptra, 'Y', ztrds )  
    153             CASE( jptra_trd_zad )   ;   CALL trd_tra_adv( ptrd , pun , ptra, 'Z', ztrds )  
     159            CASE( jptra_xad )   ;   CALL trd_tra_adv( ptrd , pun , ptra, 'X', ztrds )  
     160            CASE( jptra_yad )   ;   CALL trd_tra_adv( ptrd , pun , ptra, 'Y', ztrds )  
     161            CASE( jptra_zad )   ;   CALL trd_tra_adv( ptrd , pun , ptra, 'Z', ztrds )  
    154162            END SELECT 
    155          ELSE                                                ! other trends: mask 
     163         ELSE                                                ! other trends: masked trend 
    156164            ztrds(:,:,:) = ptrd(:,:,:) * tmask(:,:,:) 
    157165         END IF 
     
    211219   END SUBROUTINE trd_tra_adv 
    212220 
    213 #else 
    214    !!---------------------------------------------------------------------- 
    215    !!   Default case :          Dummy module           No trend diagnostics 
    216    !!---------------------------------------------------------------------- 
    217    USE par_oce      ! ocean variables trends 
    218 CONTAINS 
    219    SUBROUTINE trd_tra( kt, ctype, ktra, ktrd, ptrd, pu, ptra ) 
    220       !!---------------------------------------------------------------------- 
    221       CHARACTER(len=3)                , INTENT(in)           ::  ctype    
    222       INTEGER                         , INTENT(in)           ::  kt, ktra, ktrd 
    223       REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in)           ::  ptrd     
    224       REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in), OPTIONAL ::  pu, ptra    ! Tracer variable  
    225       WRITE(*,*) 'trd_tra: You should not have seen this print! error ?',   & 
    226          &   ptrd(1,1,1), ptra(1,1,1), pu(1,1,1), ktrd, ktra, ctype, kt 
    227    END SUBROUTINE trd_tra 
    228 #endif 
     221 
     222   SUBROUTINE trd_tra_mng( ptrdx, ptrdy, ktrd, kt ) 
     223      !!--------------------------------------------------------------------- 
     224      !!                  ***  ROUTINE trd_tra_mng  *** 
     225      !!  
     226      !! ** Purpose :   Dispatch all trends computation, e.g. 3D output, integral 
     227      !!                constraints, barotropic vorticity, kinetic enrgy,  
     228      !!                potential energy, and/or mixed layer budget. 
     229      !!---------------------------------------------------------------------- 
     230      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   ptrdx   ! Temperature or U trend  
     231      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   ptrdy   ! Salinity    or V trend 
     232      INTEGER                   , INTENT(in   ) ::   ktrd    ! tracer trend index 
     233      INTEGER                   , INTENT(in   ) ::   kt      ! time step 
     234      !!---------------------------------------------------------------------- 
     235 
     236      IF( neuler == 0 .AND. kt == nit000    ) THEN   ;   r2dt =      rdt      ! = rdtra (restart with Euler time stepping) 
     237      ELSEIF(               kt <= nit000 + 1) THEN   ;   r2dt = 2. * rdt      ! = 2 rdttra (leapfrog) 
     238      ENDIF 
     239 
     240      !                   ! 3D output of tracers trends using IOM interface 
     241      IF( ln_tra_trd )   CALL trd_tra_iom ( ptrdx, ptrdy, ktrd, kt ) 
     242 
     243      !                   ! Integral Constraints Properties for tracers trends                                       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
     244      IF( ln_glo_trd )   CALL trd_glo( ptrdx, ptrdy, ktrd, 'TRA', kt ) 
     245 
     246      !                   ! Mixed layer trends for active tracers 
     247      IF( ln_tra_mld )   THEN    
     248         !----------------------------------------------------------------------------------------------- 
     249         ! W.A.R.N.I.N.G : 
     250         ! jptra_ldf : called by traldf.F90 
     251         !                 at this stage we store: 
     252         !                  - the lateral geopotential diffusion (here, lateral = horizontal) 
     253         !                  - and the iso-neutral diffusion if activated  
     254         ! jptra_zdf : called by trazdf.F90 
     255         !                 * in case of iso-neutral diffusion we store the vertical diffusion component in the  
     256         !                   lateral trend including the K_z contrib, which will be removed later (see trd_mld) 
     257         !----------------------------------------------------------------------------------------------- 
     258 
     259         SELECT CASE ( ktrd ) 
     260         CASE ( jptra_xad )        ;   CALL trd_mld_zint( ptrdx, ptrdy, jpmld_xad, '3D' )   ! zonal    advection 
     261         CASE ( jptra_yad )        ;   CALL trd_mld_zint( ptrdx, ptrdy, jpmld_yad, '3D' )   ! merid.   advection 
     262         CASE ( jptra_zad )        ;   CALL trd_mld_zint( ptrdx, ptrdy, jpmld_zad, '3D' )   ! vertical advection 
     263         CASE ( jptra_ldf )        ;   CALL trd_mld_zint( ptrdx, ptrdy, jpmld_ldf, '3D' )   ! lateral  diffusion 
     264         CASE ( jptra_bbl )        ;   CALL trd_mld_zint( ptrdx, ptrdy, jpmld_bbl, '3D' )   ! bottom boundary layer 
     265         CASE ( jptra_zdf ) 
     266            IF( ln_traldf_iso ) THEN ; CALL trd_mld_zint( ptrdx, ptrdy, jpmld_ldf, '3D' )   ! lateral  diffusion (K_z) 
     267            ELSE                   ;   CALL trd_mld_zint( ptrdx, ptrdy, jpmld_zdf, '3D' )   ! vertical diffusion (K_z) 
     268            ENDIF 
     269         CASE ( jptra_dmp )        ;   CALL trd_mld_zint( ptrdx, ptrdy, jpmld_dmp, '3D' )   ! internal 3D restoring (tradmp) 
     270         CASE ( jptra_qsr )        ;   CALL trd_mld_zint( ptrdx, ptrdy, jpmld_for, '3D' )   ! air-sea : penetrative sol radiat 
     271         CASE ( jptra_nsr )        ;   ptrdx(:,:,2:jpk) = 0._wp   ;   ptrdy(:,:,2:jpk) = 0._wp 
     272                                   ;   CALL trd_mld_zint( ptrdx, ptrdy, jpmld_for, '2D' )   ! air-sea : non penetr sol radiation 
     273         CASE ( jptra_bbc )        ;   CALL trd_mld_zint( ptrdx, ptrdy, jpmld_bbc, '3D' )   ! bottom bound cond (geoth flux) 
     274         CASE ( jptra_npc )        ;   CALL trd_mld_zint( ptrdx, ptrdy, jpmld_npc, '3D' )   ! non penetr convect adjustment 
     275         CASE ( jptra_atf )        ;   CALL trd_mld_zint( ptrdx, ptrdy, jpmld_atf, '3D' )   ! asselin time filter (last trend) 
     276                                   ! 
     277                                       CALL trd_mld( kt )                                   ! trends: Mixed-layer (output) 
     278         END SELECT 
     279         ! 
     280      ENDIF 
     281      ! 
     282   END SUBROUTINE trd_tra_mng 
     283 
     284 
     285   SUBROUTINE trd_tra_iom( ptrdx, ptrdy, ktrd, kt ) 
     286      !!--------------------------------------------------------------------- 
     287      !!                  ***  ROUTINE trd_tra_iom  *** 
     288      !!  
     289      !! ** Purpose :   output 3D tracer trends using IOM 
     290      !!---------------------------------------------------------------------- 
     291      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   ptrdx   ! Temperature or U trend  
     292      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   ptrdy   ! Salinity    or V trend 
     293      INTEGER                   , INTENT(in   ) ::   ktrd    ! tracer trend index 
     294      INTEGER                   , INTENT(in   ) ::   kt      ! time step 
     295      !! 
     296      INTEGER ::   ji, jj, jk   ! dummy loop indices 
     297      INTEGER ::   ikbu, ikbv   ! local integers 
     298      REAL(wp), POINTER, DIMENSION(:,:)   ::   z2dx, z2dy   ! 2D workspace  
     299      !!---------------------------------------------------------------------- 
     300      ! 
     301      CALL wrk_alloc( jpi, jpj, z2dx, z2dy ) 
     302      ! 
     303!!gm Rq: mask the trends already masked in trd_tra, but lbc_lnk should probably be added 
     304      ! 
     305      SELECT CASE( ktrd ) 
     306      CASE( jptra_xad  )   ;   CALL iom_put( "ttrd_xad" , ptrdx )        ! x- horizontal advection 
     307                                   CALL iom_put( "strd_xad" , ptrdy ) 
     308      CASE( jptra_yad  )   ;   CALL iom_put( "ttrd_yad" , ptrdx )        ! y- horizontal advection 
     309                                   CALL iom_put( "strd_yad" , ptrdy ) 
     310      CASE( jptra_zad  )   ;   CALL iom_put( "ttrd_zad" , ptrdx )        ! z- vertical   advection 
     311                               CALL iom_put( "strd_zad" , ptrdy ) 
     312                               IF( .NOT.lk_vvl ) THEN                   ! cst volume : adv flux through z=0 surface 
     313                                  z2dx(:,:) = wn(:,:,1) * tsn(:,:,1,jp_tem) / fse3t(:,:,1) 
     314                                  z2dy(:,:) = wn(:,:,1) * tsn(:,:,1,jp_sal) / fse3t(:,:,1) 
     315                                  CALL iom_put( "ttrd_sad", z2dx ) 
     316                                  CALL iom_put( "strd_sad", z2dy ) 
     317                               ENDIF 
     318      CASE( jptra_ldf  )   ;   CALL iom_put( "ttrd_ldf" , ptrdx )        ! lateral diffusion 
     319                               CALL iom_put( "strd_ldf" , ptrdy ) 
     320      CASE( jptra_zdf  )   ;   CALL iom_put( "ttrd_zdf" , ptrdx )        ! vertical diffusion (including Kz contribution) 
     321                               CALL iom_put( "strd_zdf" , ptrdy ) 
     322      CASE( jptra_zdfp )   ;   CALL iom_put( "ttrd_zdfp", ptrdx )        ! PURE vertical diffusion (no isoneutral contribution) 
     323                               CALL iom_put( "strd_zdfp", ptrdy ) 
     324      CASE( jptra_dmp  )   ;   CALL iom_put( "ttrd_dmp" , ptrdx )        ! internal restoring (damping) 
     325                               CALL iom_put( "strd_dmp" , ptrdy ) 
     326      CASE( jptra_bbl  )   ;   CALL iom_put( "ttrd_bbl" , ptrdx )        ! bottom boundary layer 
     327                               CALL iom_put( "strd_bbl" , ptrdy ) 
     328      CASE( jptra_npc  )   ;   CALL iom_put( "ttrd_npc" , ptrdx )        ! static instability mixing 
     329                               CALL iom_put( "strd_npc" , ptrdy ) 
     330      CASE( jptra_nsr  )   ;   CALL iom_put( "ttrd_qns" , ptrdx )        ! surface forcing + runoff (ln_rnf=T) 
     331                               CALL iom_put( "strd_cdt" , ptrdy ) 
     332      CASE( jptra_qsr  )   ;   CALL iom_put( "ttrd_qsr" , ptrdx )        ! penetrative solar radiat. (only on temperature) 
     333      CASE( jptra_bbc  )   ;   CALL iom_put( "ttrd_bbc" , ptrdx )        ! geothermal heating   (only on temperature) 
     334      CASE( jptra_atf  )   ;   CALL iom_put( "ttrd_atf" , ptrdx )        ! asselin time Filter 
     335                               CALL iom_put( "strd_atf" , ptrdy ) 
     336      END SELECT 
     337      ! 
     338      CALL wrk_dealloc( jpi, jpj, z2dx, z2dy ) 
     339      ! 
     340   END SUBROUTINE trd_tra_iom 
    229341 
    230342   !!====================================================================== 
  • branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRD/trdvor.F90

    r3316 r3318  
    88   !!            3.5  !  2012-02  (G. Madec) regroup beta.V computation with pvo trend 
    99   !!---------------------------------------------------------------------- 
    10 #if defined key_trdvor   ||   defined key_esopa 
    11    !!---------------------------------------------------------------------- 
    12    !!   'key_trdvor'   : momentum trend diagnostics 
     10 
    1311   !!---------------------------------------------------------------------- 
    1412   !!   trd_vor      : momentum trends averaged over the depth 
     
    1816   USE oce             ! ocean dynamics and tracers variables 
    1917   USE dom_oce         ! ocean space and time domain variables 
    20    USE trdmod_oce      ! ocean variables trends 
     18   USE trd_oce         ! trends: ocean variables 
    2119   USE zdf_oce         ! ocean vertical physics 
    22    USE in_out_manager  ! I/O manager 
     20   USE sbc_oce         ! surface boundary condition: ocean 
    2321   USE phycst          ! Define parameters for the routines 
    2422   USE ldfdyn_oce      ! ocean active tracers: lateral physics 
    2523   USE dianam          ! build the name of file (routine) 
    2624   USE zdfmxl          ! mixed layer depth 
     25   USE lbclnk          ! ocean lateral boundary conditions (or mpp link) 
     26   USE in_out_manager  ! I/O manager 
    2727   USE ioipsl          ! NetCDF library 
    28    USE lbclnk          ! ocean lateral boundary conditions (or mpp link) 
    2928   USE lib_mpp         ! MPP library 
    3029   USE wrk_nemo        ! Memory allocation 
    31  
    3230 
    3331   IMPLICIT NONE 
     
    3836   END INTERFACE 
    3937 
    40    PUBLIC   trd_vor        ! routine called by step.F90 
    41    PUBLIC   trd_vor_zint   ! routine called by dynamics routines 
     38   PUBLIC   trd_vor        ! routine called by trddyn.F90 
    4239   PUBLIC   trd_vor_init   ! routine called by opa.F90 
    4340   PUBLIC   trd_vor_alloc  ! routine called by nemogcm.F90 
     
    8178      IF( trd_vor_alloc /= 0 )   CALL ctl_warn('trd_vor_alloc: failed to allocate arrays') 
    8279   END FUNCTION trd_vor_alloc 
     80 
     81 
     82   SUBROUTINE trd_vor( putrd, pvtrd, ktrd, kt ) 
     83      !!---------------------------------------------------------------------- 
     84      !!                  ***  ROUTINE trd_vor  *** 
     85      !!  
     86      !! ** Purpose :  computation of cumulated trends over analysis period 
     87      !!               and make outputs (NetCDF or DIMG format) 
     88      !!---------------------------------------------------------------------- 
     89      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   putrd, pvtrd   ! U and V trends  
     90      INTEGER                   , INTENT(in   ) ::   ktrd           ! trend index 
     91      INTEGER                   , INTENT(in   ) ::   kt             ! time step 
     92      ! 
     93      INTEGER ::   ji, jj   ! dummy loop indices 
     94      REAL(wp), POINTER, DIMENSION(:,:) ::   ztswu, ztswv    ! 2D workspace  
     95      !!---------------------------------------------------------------------- 
     96 
     97      CALL wrk_alloc( jpi, jpj, ztswu, ztswv ) 
     98 
     99      SELECT CASE( ktrd )  
     100      CASE( jpdyn_hpg )   ;   CALL trd_vor_zint( putrd, pvtrd, jpvor_prg )   ! Hydrostatique Pressure Gradient  
     101      CASE( jpdyn_keg )   ;   CALL trd_vor_zint( putrd, pvtrd, jpvor_keg )   ! KE Gradient  
     102      CASE( jpdyn_rvo )   ;   CALL trd_vor_zint( putrd, pvtrd, jpvor_rvo )   ! Relative Vorticity  
     103      CASE( jpdyn_pvo )   ;   CALL trd_vor_zint( putrd, pvtrd, jpvor_pvo )   ! Planetary Vorticity Term  
     104      CASE( jpdyn_ldf )   ;   CALL trd_vor_zint( putrd, pvtrd, jpvor_ldf )   ! Horizontal Diffusion  
     105      CASE( jpdyn_zad )   ;   CALL trd_vor_zint( putrd, pvtrd, jpvor_zad )   ! Vertical Advection  
     106      CASE( jpdyn_spg )   ;   CALL trd_vor_zint( putrd, pvtrd, jpvor_spg )   ! Surface Pressure Grad.  
     107      CASE( jpdyn_zdf )                                                      ! Vertical Diffusion  
     108         ztswu(:,:) = 0.e0   ;   ztswv(:,:) = 0.e0 
     109         DO jj = 2, jpjm1                                                             ! wind stress trends 
     110            DO ji = fs_2, fs_jpim1   ! vector opt. 
     111               ztswu(ji,jj) = 0.5 * ( utau_b(ji,jj) + utau(ji,jj) ) / ( fse3u(ji,jj,1) * rau0 ) 
     112               ztswv(ji,jj) = 0.5 * ( vtau_b(ji,jj) + vtau(ji,jj) ) / ( fse3v(ji,jj,1) * rau0 ) 
     113            END DO 
     114         END DO 
     115         ! 
     116         CALL trd_vor_zint( putrd, pvtrd, jpvor_zdf )                             ! zdf trend including surf./bot. stresses  
     117         CALL trd_vor_zint( ztswu, ztswv, jpvor_swf )                             ! surface wind stress  
     118      CASE ( jpdyn_bfr ) 
     119         CALL trd_vor_zint( putrd, pvtrd, jpvor_bfr )                             ! Bottom stress 
     120         ! 
     121      CASE( jpdyn_atf )       ! last trends: perform the output of 2D vorticity trends 
     122         CALL trd_vor_iom( kt ) 
     123      END SELECT 
     124      ! 
     125      CALL wrk_dealloc( jpi, jpj, ztswu, ztswv ) 
     126      ! 
     127   END SUBROUTINE trd_vor 
    83128 
    84129 
     
    268313 
    269314 
    270    SUBROUTINE trd_vor( kt ) 
     315   SUBROUTINE trd_vor_iom( kt ) 
    271316      !!---------------------------------------------------------------------- 
    272317      !!                  ***  ROUTINE trd_vor  *** 
     
    275320      !!               and make outputs (NetCDF or DIMG format) 
    276321      !!---------------------------------------------------------------------- 
    277       ! 
    278       INTEGER, INTENT(in) ::   kt   ! ocean time-step index 
     322      INTEGER                   , INTENT(in   ) ::   kt             ! time step 
    279323      ! 
    280324      INTEGER  ::   ji, jj, jk, jl   ! dummy loop indices 
     
    453497      CALL wrk_dealloc( jpi, jpj, zun, zvn )                                    
    454498      ! 
    455    END SUBROUTINE trd_vor 
     499   END SUBROUTINE trd_vor_iom 
    456500 
    457501 
     
    577621   END SUBROUTINE trd_vor_init 
    578622 
    579 #else 
    580    !!---------------------------------------------------------------------- 
    581    !!   Default option :                                       Empty module 
    582    !!---------------------------------------------------------------------- 
    583    INTERFACE trd_vor_zint 
    584       MODULE PROCEDURE trd_vor_zint_2d, trd_vor_zint_3d 
    585    END INTERFACE 
    586 CONTAINS 
    587    SUBROUTINE trd_vor( kt )        ! Empty routine 
    588       WRITE(*,*) 'trd_vor: You should not have seen this print! error?', kt 
    589    END SUBROUTINE trd_vor 
    590    SUBROUTINE trd_vor_zint_2d( putrdvor, pvtrdvor, ktrd ) 
    591       REAL, DIMENSION(:,:), INTENT( inout ) ::   putrdvor, pvtrdvor 
    592       INTEGER, INTENT( in ) ::   ktrd         ! ocean trend index 
    593       WRITE(*,*) 'trd_vor_zint_2d: You should not have seen this print! error?', putrdvor(1,1), pvtrdvor(1,1), ktrd 
    594    END SUBROUTINE trd_vor_zint_2d 
    595    SUBROUTINE trd_vor_zint_3d( putrdvor, pvtrdvor, ktrd ) 
    596       REAL, DIMENSION(:,:,:), INTENT( inout ) ::   putrdvor, pvtrdvor 
    597       INTEGER, INTENT( in ) ::   ktrd         ! ocean trend index 
    598       WRITE(*,*) 'trd_vor_zint_3d: You should not have seen this print! error?', putrdvor(1,1,1), pvtrdvor(1,1,1), ktrd 
    599    END SUBROUTINE trd_vor_zint_3d 
    600    SUBROUTINE trd_vor_init              ! Empty routine 
    601       WRITE(*,*) 'trd_vor_init: You should not have seen this print! error?' 
    602    END SUBROUTINE trd_vor_init 
    603 #endif 
    604623   !!====================================================================== 
    605624END MODULE trdvor 
  • branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRD/trdvor_oce.F90

    r2715 r3318  
    1313   PRIVATE 
    1414 
    15 #if defined key_trdvor 
    16    LOGICAL, PUBLIC, PARAMETER ::   lk_trdvor = .TRUE.    !: momentum trend flag 
    17 #else 
    18    LOGICAL, PUBLIC, PARAMETER ::   lk_trdvor = .FALSE.   !: momentum trend flag 
    19 #endif 
    2015   !                                               !!* vorticity trends index 
    2116   INTEGER, PUBLIC, PARAMETER ::   jpltot_vor = 11  !: Number of vorticity trend terms 
Note: See TracChangeset for help on using the changeset viewer.