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 2104 – NEMO

Changeset 2104


Ignore:
Timestamp:
2010-09-17T14:35:46+02:00 (13 years ago)
Author:
cetlod
Message:

update DEV_r2006_merge_TRA_TRC according to review

Location:
branches/DEV_r2006_merge_TRA_TRC/NEMO
Files:
99 edited

Legend:

Unmodified
Added
Removed
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/C1D_SRC/step_c1d.F90

    r1465 r2104  
    160160      ! N.B. ua, va arrays are used as workspace in this section 
    161161      !----------------------------------------------------------------------- 
    162                              ta(:,:,:) = 0.e0                ! set tracer trends to zero 
    163                              sa(:,:,:) = 0.e0 
     162                             tsa(:,:,:,:) = 0.e0                ! set tracer trends to zero 
    164163 
    165164                             CALL tra_sbc    ( kstp )        ! surface boundary condition 
     
    167166      IF( lk_zdfkpp )        CALL tra_kpp    ( kstp )        ! KPP non-local tracer fluxes 
    168167                             CALL tra_zdf    ( kstp )        ! vertical mixing 
    169                              CALL tra_nxt( kstp )            ! tracer fields at next time step 
    170       IF( ln_zdfnpc      )   CALL tra_npc( kstp )            ! applied non penetrative convective adjustment on (t,s) 
    171                              CALL eos( tb, sb, rhd, rhop )   ! now (swap=before) in situ density for dynhpg module 
     168                             CALL tra_nxt    ( kstp )        ! tracer fields at next time step 
     169      IF( ln_zdfnpc      )   CALL tra_npc    ( kstp )        ! applied non penetrative convective adjustment on (t,s) 
     170                             CALL eos( tsb, rhd, rhop )   ! now (swap=before) in situ density for dynhpg module 
    172171 
    173172      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/NST_SRC/agrif_user.F90

    r2082 r2104  
    11#if defined key_agrif 
    22   !!---------------------------------------------------------------------- 
    3    !!   OPA 9.0 , LOCEAN-IPSL (2006) 
     3   !! NEMO/NST 3.3 , LOCEAN-IPSL (2010)  
    44   !! $Id$ 
    55   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
     
    5555   END SUBROUTINE Agrif_InitWorkspace 
    5656 
    57 #if ! defined key_off_tra 
     57#if ! defined key_offline 
    5858 
    5959   SUBROUTINE Agrif_InitValues 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/DIA/diaar5.F90

    r2082 r2104  
    44   !! AR5 diagnostics 
    55   !!====================================================================== 
    6    !! History : 3.2  !  2009-11  (S. Masson)  Original code 
     6   !! History :  3.2  !  2009-11  (S. Masson)  Original code 
     7   !!            3.3  !  2010-10  (C. Ethe, G. Madec) reorganisation of initialisation phase + merge TRC-TRA 
    78   !!---------------------------------------------------------------------- 
    89#if defined key_diaar5 
     
    1011   !!   'key_diaar5'  :                           activate ar5 diagnotics 
    1112   !!---------------------------------------------------------------------- 
    12    !!   exa_mpl       : liste of module subroutine (caution, never use the 
    13    !!   exa_mpl_init  : name of the module for a routine) 
    14    !!   exa_mpl_stp   : Please try to use 3 letter block for routine names 
     13   !!   dia_ar5       : AR5 diagnostics 
     14   !!   dia_ar5_init  : initialisation of AR5 diagnostics 
    1515   !!---------------------------------------------------------------------- 
    1616   USE oce            ! ocean dynamics and active tracers  
     
    3737#  include "domzgr_substitute.h90" 
    3838   !!---------------------------------------------------------------------- 
    39    !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009)  
    40    !! $Id$  
     39   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010)  
     40   !! $Id$ 
    4141   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    4242   !!---------------------------------------------------------------------- 
     
    4848      !!                    ***  ROUTINE dia_ar5  *** 
    4949      !! 
    50       !! ** Purpose :   Brief description of the routine 
    51       !! 
    52       !! ** Method  :   description of the methodoloy used to achieve the 
    53       !!                objectives of the routine. Be as clear as possible! 
    54       !! 
    55       !! ** Action  : - first action (share memory array/varible modified 
    56       !!                in this routine 
    57       !!              - second action ..... 
    58       !!              - ..... 
    59       !! 
    60       !! References :   Author et al., Short_name_review, Year 
    61       !!                Give references if exist otherwise suppress these lines 
     50      !! ** Purpose :   compute and output some AR5 diagnostics 
     51      !! 
    6252      !!---------------------------------------------------------------------- 
    6353      INTEGER, INTENT( in ) ::   kt   ! ocean time-step index 
     
    155145      !!                  ***  ROUTINE dia_ar5_init  *** 
    156146      !!                    
    157       !! ** Purpose :   initialization of .... 
    158       !! 
    159       !! ** Method  :   blah blah blah ... 
    160       !! 
    161       !! ** input   :   Namlist namexa 
    162       !! 
    163       !! ** Action  :   ...   
     147      !! ** Purpose :   initialization for AR5 diagnostic computation 
     148      !! 
    164149      !!---------------------------------------------------------------------- 
    165150      INTEGER  ::   inum 
     
    206191   !!   Default option :                                         NO diaar5 
    207192   !!---------------------------------------------------------------------- 
    208  
    209193   LOGICAL, PUBLIC, PARAMETER :: lk_diaar5 = .FALSE.   ! coupled flag 
    210  
    211194CONTAINS 
    212  
     195   SUBROUTINE dia_ar5_init    ! Dummy routine 
     196   END SUBROUTINE dia_ar5_init 
    213197   SUBROUTINE dia_ar5( kt )   ! Empty routine 
    214       INTEGER, INTENT( in ) ::   kt      ! ocean time-step index 
     198      INTEGER ::   kt 
    215199      WRITE(*,*) 'dia_ar5: You should not have seen this print! error?', kt 
    216200   END SUBROUTINE dia_ar5 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/DTA/dtasal.F90

    r1951 r2104  
    6969      !! * Local declarations 
    7070      INTEGER ::   ji, jj, jk, jl, jkk            ! dummy loop indicies 
    71       INTEGER ::   imois, iman, i15 , ik          ! temporary integers 
    72       INTEGER ::   ierror 
     71      INTEGER ::   ik, ierror                     ! temporary integers 
    7372#if defined key_tradmp 
    7473      INTEGER ::   il0, il1, ii0, ii1, ij0, ij1   ! temporary integers 
    7574#endif 
    76       REAL(wp)::   zxy, zl 
     75      REAL(wp)::   zl 
    7776#if defined key_orca_lev10 
    7877      INTEGER ::   ikr, ikw, ikt, jjk  
    7978      REAL(wp)::   zfac 
    8079#endif 
    81       REAL(wp), DIMENSION(jpk) ::   zsaldta            ! auxiliary array for interpolation 
     80      REAL(wp), DIMENSION(jpk) :: zsaldta         ! auxiliary array for interpolation 
    8281      CHARACTER(len=100)       :: cn_dir          ! Root directory for location of ssr files 
    8382      TYPE(FLD_N)              :: sn_sal 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/DTA/dtatem.F90

    r1951 r2104  
    7474      !! * Local declarations 
    7575      INTEGER ::   ji, jj, jk, jl, jkk            ! dummy loop indicies 
    76       INTEGER ::   imois, iman, i15 , ik          ! temporary integers 
    77       INTEGER ::   ierror 
     76      INTEGER ::   ik, ierror                     ! temporary integers 
    7877#if defined key_tradmp 
    7978      INTEGER ::   il0, il1, ii0, ii1, ij0, ij1   ! temporary integers 
    8079#endif 
    81       REAL(wp)::   zxy, zl 
     80      REAL(wp)::   zl 
    8281#if defined key_orca_lev10 
    8382      INTEGER ::   ikr, ikw, ikt, jjk  
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/DYN/dynadv.F90

    r2027 r2104  
    44   !! Ocean active tracers:  advection scheme control 
    55   !!============================================================================== 
    6    !! History :  9.0  !  06-11  (G. Madec)  Original code 
     6   !! History :  1.0  !  2006-11  (G. Madec)  Original code 
     7   !!            3.3  !  2010-10  (C. Ethe, G. Madec) reorganisation of initialisation phase 
    78   !!---------------------------------------------------------------------- 
    89 
    910   !!---------------------------------------------------------------------- 
    1011   !!   dyn_adv      : compute the momentum advection trend  
    11    !!   dyn_adv_ctl : control the different options of advection scheme 
     12   !!   dyn_adv_init : control the different options of advection scheme 
    1213   !!---------------------------------------------------------------------- 
    1314   USE dom_oce         ! ocean space and time domain 
     
    2526   PUBLIC dyn_adv_init  ! routine called by opa module 
    2627  
    27    LOGICAL, PUBLIC ::   ln_dynadv_vec  = .TRUE.    ! vector form flag 
    28    LOGICAL, PUBLIC ::   ln_dynadv_cen2 = .FALSE.   ! flux form - 2nd order centered scheme flag 
    29    LOGICAL, PUBLIC ::   ln_dynadv_ubs  = .FALSE.   ! flux form - 3rd order UBS scheme flag 
     28   LOGICAL, PUBLIC ::   ln_dynadv_vec  = .TRUE.    !: vector form flag 
     29   LOGICAL, PUBLIC ::   ln_dynadv_cen2 = .FALSE.   !: flux form - 2nd order centered scheme flag 
     30   LOGICAL, PUBLIC ::   ln_dynadv_ubs  = .FALSE.   !: flux form - 3rd order UBS scheme flag 
    3031    
    3132   INTEGER ::   nadv   ! choice of the formulation and scheme for the advection 
     
    3536#  include "vectopt_loop_substitute.h90" 
    3637   !!---------------------------------------------------------------------- 
    37    !!   OPA 9.0 , LOCEAN-IPSL (2006)  
    38    !! $Id$  
     38   !! NEMO/OPA 3,3 , LOCEAN-IPSL (2010)  
     39   !! $Id$ 
    3940   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    4041   !!---------------------------------------------------------------------- 
     
    8485      !!---------------------------------------------------------------------- 
    8586      INTEGER ::   ioptio 
    86  
     87      !! 
    8788      NAMELIST/namdyn_adv/ ln_dynadv_vec, ln_dynadv_cen2 , ln_dynadv_ubs 
    8889      !!---------------------------------------------------------------------- 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/DYN/dynhpg.F90

    r2027 r2104  
    44   !! Ocean dynamics:  hydrostatic pressure gradient trend 
    55   !!====================================================================== 
    6    !! History :  1.0  !  87-09  (P. Andrich, M.-A. Foujols)  hpg_zco: Original code 
    7    !!            5.0  !  91-11  (G. Madec) 
    8    !!            7.0  !  96-01  (G. Madec)  hpg_sco: Original code for s-coordinates 
    9    !!            8.0  !  97-05  (G. Madec)  split dynber into dynkeg and dynhpg 
    10    !!            8.5  !  02-07  (G. Madec)  F90: Free form and module 
    11    !!            8.5  !  02-08  (A. Bozec)  hpg_zps: Original code 
    12    !!            9.0  !  05-10  (A. Beckmann, B.W. An)  various s-coordinate options 
     6   !! History :  OPA  !  1987-09  (P. Andrich, M.-A. Foujols)  hpg_zco: Original code 
     7   !!            5.0  !  1991-11  (G. Madec) 
     8   !!            7.0  !  1996-01  (G. Madec)  hpg_sco: Original code for s-coordinates 
     9   !!            8.0  !  1997-05  (G. Madec)  split dynber into dynkeg and dynhpg 
     10   !!            8.5  !  2002-07  (G. Madec)  F90: Free form and module 
     11   !!            8.5  !  2002-08  (A. Bozec)  hpg_zps: Original code 
     12   !!   NEMO     1.0  !  2005-10  (A. Beckmann, B.W. An)  various s-coordinate options 
    1313   !!                           Original code for hpg_ctl, hpg_hel hpg_wdj, hpg_djc, hpg_rot  
    14    !!            9.0  !  05-11  (G. Madec) style & small optimisation 
     14   !!             -   !  2005-11  (G. Madec) style & small optimisation 
     15   !!            3.3  !  2010-10  (C. Ethe, G. Madec) reorganisation of initialisation phase 
    1516   !!---------------------------------------------------------------------- 
    1617 
     
    1819   !!   dyn_hpg      : update the momentum trend with the now horizontal 
    1920   !!                  gradient of the hydrostatic pressure 
    20    !!       hpg_init : initialisation and control of options 
     21   !!   dyn_hpg_init : initialisation and control of options 
    2122   !!       hpg_zco  : z-coordinate scheme 
    2223   !!       hpg_zps  : z-coordinate plus partial steps (interpolation) 
     
    4041 
    4142   PUBLIC   dyn_hpg        ! routine called by step module 
    42    PUBLIC       hpg_init   ! routine called by opa module 
     43   PUBLIC   dyn_hpg_init   ! routine called by opa module 
    4344 
    4445   !                                              !!* Namelist namdyn_hpg : hydrostatic pressure gradient  
     
    6061#  include "vectopt_loop_substitute.h90" 
    6162   !!---------------------------------------------------------------------- 
    62    !!   OPA 9.0 , LOCEAN-IPSL (2005)  
    63    !! $Id$  
     63   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010)  
     64   !! $Id$ 
    6465   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    6566   !!---------------------------------------------------------------------- 
     
    109110 
    110111 
    111    SUBROUTINE hpg_init 
    112       !!---------------------------------------------------------------------- 
    113       !!                 ***  ROUTINE hpg_init  *** 
     112   SUBROUTINE dyn_hpg_init 
     113      !!---------------------------------------------------------------------- 
     114      !!                 ***  ROUTINE dyn_hpg_init  *** 
    114115      !! 
    115116      !! ** Purpose :   initializations for the hydrostatic pressure gradient 
     
    121122      INTEGER ::   ioptio = 0      ! temporary integer 
    122123      !! 
    123 !     NAMELIST/namdyn_hpg/ ln_hpg_zco   , ln_hpg_zps   , ln_hpg_sco, ln_hpg_hel,   & 
    124 !        &                 ln_hpg_wdj   , ln_hpg_djc   , ln_hpg_rot, rn_gamma  ,   & 
    125 !        &                 ln_dynhpg_imp, nn_dynhpg_rst 
    126       !!---------------------------------------------------------------------- 
    127  
    128 !     REWIND ( numnam )               ! Namelist namdyn_hpg : already read in opa.F90 module 
    129 !     READ   ( numnam, namdyn_hpg ) 
    130  
    131       IF(lwp) THEN                    ! Control print 
     124      NAMELIST/namdyn_hpg/ ln_hpg_zco   , ln_hpg_zps   , ln_hpg_sco, ln_hpg_hel,   & 
     125         &                 ln_hpg_wdj   , ln_hpg_djc   , ln_hpg_rot, rn_gamma  ,   & 
     126         &                 ln_dynhpg_imp, nn_dynhpg_rst 
     127      !!---------------------------------------------------------------------- 
     128      ! 
     129      REWIND( numnam )               ! Read Namelist namdyn_hpg 
     130      READ  ( numnam, namdyn_hpg ) 
     131      ! 
     132      IF(lwp) THEN                   ! Control print 
    132133         WRITE(numout,*) 
    133          WRITE(numout,*) 'dyn_hpg : hydrostatic pressure gradient' 
    134          WRITE(numout,*) '~~~~~~~' 
     134         WRITE(numout,*) 'dyn_hpg_init : hydrostatic pressure gradient initialisation' 
     135         WRITE(numout,*) '~~~~~~~~~~~~' 
    135136         WRITE(numout,*) '   Namelist namdyn_hpg : choice of hpg scheme' 
    136137         WRITE(numout,*) '      z-coord. - full steps                             ln_hpg_zco    = ', ln_hpg_zco 
     
    145146         WRITE(numout,*) '      add in restart dynhpg semi-implicit variable      nn_dynhpg_rst = ', nn_dynhpg_rst 
    146147      ENDIF 
    147  
    148       IF( .NOT. ln_dynhpg_imp )   nn_dynhpg_rst = 0      ! force no adding dynhpg implicit variables in restart 
    149  
    150       IF( lk_vvl .AND. .NOT. ln_hpg_sco )   THEN 
    151          CALL ctl_stop( 'hpg_ctl : variable volume key_vvl compatible only with the standard jacobian formulation hpg_sco') 
    152       ENDIF 
    153  
     148      ! 
     149      IF( .NOT. ln_dynhpg_imp )   nn_dynhpg_rst = 0      ! force no additional dynhpg implicit variables in restart file 
     150      ! 
     151      IF( lk_vvl .AND. .NOT. ln_hpg_sco )   & 
     152         &   CALL ctl_stop( 'dyn_hpg_init : variable volume key_vvl require the standard jacobian formulation hpg_sco') 
     153      ! 
    154154      !                               ! Set nhpg from ln_hpg_... flags 
    155155      IF( ln_hpg_zco )   nhpg = 0 
     
    160160      IF( ln_hpg_djc )   nhpg = 5 
    161161      IF( ln_hpg_rot )   nhpg = 6 
    162  
     162      ! 
    163163      !                               ! Consitency check 
    164164      ioptio = 0  
     
    171171      IF( ln_hpg_rot )   ioptio = ioptio + 1 
    172172      IF ( ioptio /= 1 )   CALL ctl_stop( ' NO or several hydrostatic pressure gradient options used' ) 
    173  
    174       ! 
    175    END SUBROUTINE hpg_init 
     173      ! 
     174   END SUBROUTINE dyn_hpg_init 
    176175 
    177176 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/DYN/dynldf.F90

    r2027 r2104  
    88 
    99   !!---------------------------------------------------------------------- 
    10    !!   dyn_ldf     : update the dynamics trend with the lateral diffusion 
    11    !!   dyn_ldf_ctl : initialization, namelist read, and parameters control 
     10   !!   dyn_ldf      : update the dynamics trend with the lateral diffusion 
     11   !!   dyn_ldf_init : initialization, namelist read, and parameters control 
    1212   !!---------------------------------------------------------------------- 
    1313   USE oce            ! ocean dynamics and tracers 
     
    3131 
    3232   PUBLIC   dyn_ldf       ! called by step module  
    33    PUBLIC   dyn_ldf_init  ! called by opa module  
     33   PUBLIC   dyn_ldf_init  ! called by opa  module  
    3434 
    3535   INTEGER ::   nldf = 0   ! type of lateral diffusion used defined from ln_dynldf_... namlist logicals) 
     
    3838#  include "domzgr_substitute.h90" 
    3939#  include "vectopt_loop_substitute.h90" 
    40    !!--------------------------------------------------------------------------------- 
    41    !!   OPA 9.0 , LOCEAN-IPSL (2005)  
     40   !!---------------------------------------------------------------------- 
     41   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010)  
    4242   !! $Id$ 
    4343   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/DYN/dynvor.F90

    r2027 r2104  
    1414   !!            2.0  !  2006-11  (G. Madec)  flux form advection: add metric term 
    1515   !!            3.2  !  2009-04  (R. Benshila)  vvl: correction of een scheme 
     16   !!            3.3  !  2010-10  (C. Ethe, G. Madec) reorganisation of initialisation phase 
    1617   !!---------------------------------------------------------------------- 
    1718 
    1819   !!---------------------------------------------------------------------- 
    19    !!   dyn_vor     : Update the momentum trend with the vorticity trend 
    20    !!       vor_ens : enstrophy conserving scheme       (ln_dynvor_ens=T) 
    21    !!       vor_ene : energy conserving scheme          (ln_dynvor_ene=T) 
    22    !!       vor_mix : mixed enstrophy/energy conserving (ln_dynvor_mix=T) 
    23    !!       vor_een : energy and enstrophy conserving   (ln_dynvor_een=T) 
    24    !!       vor_ctl : set and control of the different vorticity option 
     20   !!   dyn_vor      : Update the momentum trend with the vorticity trend 
     21   !!       vor_ens  : enstrophy conserving scheme       (ln_dynvor_ens=T) 
     22   !!       vor_ene  : energy conserving scheme          (ln_dynvor_ene=T) 
     23   !!       vor_mix  : mixed enstrophy/energy conserving (ln_dynvor_mix=T) 
     24   !!       vor_een  : energy and enstrophy conserving   (ln_dynvor_een=T) 
     25   !!   dyn_vor_init : set and control of the different vorticity option 
    2526   !!---------------------------------------------------------------------- 
    2627   USE oce            ! ocean dynamics and tracers 
     
    3738 
    3839   PUBLIC   dyn_vor        ! routine called by step.F90 
    39    PUBLIC       vor_init   ! routine called by opa.F90 
     40   PUBLIC   dyn_vor_init   ! routine called by opa.F90 
    4041 
    4142   !                                             !!* Namelist namdyn_vor: vorticity term 
     
    5455#  include "vectopt_loop_substitute.h90" 
    5556   !!---------------------------------------------------------------------- 
    56    !! NEMO/OPA 3,2 , LOCEAN-IPSL (2009)  
     57   !! NEMO/OPA 3,3 , LOCEAN-IPSL (2010)  
    5758   !! $Id$ 
    5859   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
     
    636637 
    637638 
    638    SUBROUTINE vor_init 
     639   SUBROUTINE dyn_vor_init 
    639640      !!--------------------------------------------------------------------- 
    640       !!                  ***  ROUTINE vor_init  *** 
     641      !!                  ***  ROUTINE dyn_vor_init  *** 
    641642      !! 
    642643      !! ** Purpose :   Control the consistency between cpp options for 
     
    652653      IF(lwp) THEN                    ! Namelist print 
    653654         WRITE(numout,*) 
    654          WRITE(numout,*) 'dyn:vor_init : vorticity term : read namelist and control the consistency' 
    655          WRITE(numout,*) '~~~~~~~~~~~' 
     655         WRITE(numout,*) 'dyn_vor_init : vorticity term : read namelist and control the consistency' 
     656         WRITE(numout,*) '~~~~~~~~~~~~' 
    656657         WRITE(numout,*) '        Namelist namdyn_vor : oice of the vorticity term scheme' 
    657658         WRITE(numout,*) '           energy    conserving scheme                ln_dynvor_ene = ', ln_dynvor_ene 
     
    699700      ENDIF 
    700701      ! 
    701    END SUBROUTINE vor_init 
     702   END SUBROUTINE dyn_vor_init 
    702703 
    703704   !!============================================================================== 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/DYN/dynzdf.F90

    r2027 r2104  
    44   !! Ocean dynamics :  vertical component of the momentum mixing trend 
    55   !!============================================================================== 
    6    !! History :  9.0  !  05-11  (G. Madec)  Original code 
     6   !! History :  1.0  !  2005-11  (G. Madec)  Original code 
     7   !!            3.3  !  2010-10  (C. Ethe, G. Madec) reorganisation of initialisation phase 
    78   !!---------------------------------------------------------------------- 
    89 
    910   !!---------------------------------------------------------------------- 
    1011   !!   dyn_zdf      : Update the momentum trend with the vertical diffusion 
    11    !!       zdf_ctl : initializations of the vertical diffusion scheme 
     12   !!   dyn_zdf_init : initializations of the vertical diffusion scheme 
    1213   !!---------------------------------------------------------------------- 
    1314   USE oce             ! ocean dynamics and tracers variables 
     
    3031   PUBLIC   dyn_zdf_init  !  routine called by opa.F90 
    3132 
    32    INTEGER  ::   nzdf = 0              ! type vertical diffusion algorithm used  
    33       !                                ! defined from ln_zdf...  namlist logicals) 
    34  
    35    REAL(wp) ::   r2dt                  ! time-step, = 2 rdttra 
    36       !                                ! except at nit000 (=rdttra) if neuler=0 
     33   INTEGER  ::   nzdf = 0   ! type vertical diffusion algorithm used, defined from ln_zdf... namlist logicals 
     34   REAL(wp) ::   r2dt       ! time-step, = 2 rdttra except at nit000 (=rdttra) if neuler=0 
    3735 
    3836   !! * Substitutions 
     
    4139#  include "vectopt_loop_substitute.h90" 
    4240   !!---------------------------------------------------------------------- 
    43    !!  OPA 9.0 , LOCEAN-IPSL (2005)  
     41   !! NEMO/OPA 3,3 , LOCEAN-IPSL (2010)  
    4442   !! $Id$ 
    4543   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
     
    6058 
    6159      !                                          ! set time step 
    62       IF( neuler == 0 .AND. kt == nit000    ) THEN   ;   r2dt =      rdt      ! = rdtra (restarting with Euler time stepping) 
    63       ELSEIF(               kt <= nit000 + 1) THEN   ;   r2dt = 2. * rdt      ! = 2 rdttra (leapfrog) 
     60      IF( neuler == 0 .AND. kt == nit000     ) THEN   ;   r2dt =      rdt   ! = rdtra (restart with Euler time stepping) 
     61      ELSEIF(               kt <= nit000 + 1 ) THEN   ;   r2dt = 2. * rdt   ! = 2 rdttra (leapfrog) 
    6462      ENDIF 
    6563 
     
    7169      SELECT CASE ( nzdf )                       ! compute lateral mixing trend and add it to the general trend 
    7270      ! 
    73       CASE ( 0 )   ;   CALL dyn_zdf_exp    ( kt, r2dt )      ! explicit scheme 
    74       CASE ( 1 )   ;   CALL dyn_zdf_imp    ( kt, r2dt )      ! implicit scheme 
     71      CASE ( 0 )   ;   CALL dyn_zdf_exp( kt, r2dt )      ! explicit scheme 
     72      CASE ( 1 )   ;   CALL dyn_zdf_imp( kt, r2dt )      ! implicit scheme 
    7573      ! 
    7674      CASE ( -1 )                                      ! esopa: test all possibility with control print 
    77                        CALL dyn_zdf_exp    ( kt, r2dt ) 
     75                       CALL dyn_zdf_exp( kt, r2dt ) 
    7876                       CALL prt_ctl( tab3d_1=ua, clinfo1=' zdf0 - Ua: ', mask1=umask,               & 
    7977            &                        tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' ) 
    80                        CALL dyn_zdf_imp    ( kt, r2dt ) 
     78                       CALL dyn_zdf_imp( kt, r2dt ) 
    8179                       CALL prt_ctl( tab3d_1=ua, clinfo1=' zdf1 - Ua: ', mask1=umask,               & 
    8280            &                        tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' ) 
     
    108106      USE zdfkpp 
    109107      !!---------------------------------------------------------------------- 
    110  
     108      ! 
    111109      ! Choice from ln_zdfexp read in namelist in zdfini 
    112110      IF( ln_zdfexp ) THEN   ;   nzdf = 0           ! use explicit scheme 
    113111      ELSE                   ;   nzdf = 1           ! use implicit scheme 
    114112      ENDIF 
    115  
     113      ! 
    116114      ! Force implicit schemes 
    117115      IF( lk_zdftke_old .OR. lk_zdftke .OR. lk_zdfkpp )   nzdf = 1   ! TKE or KPP physics 
    118116      IF( ln_dynldf_iso                               )   nzdf = 1   ! iso-neutral lateral physics 
    119117      IF( ln_dynldf_hor .AND. ln_sco                  )   nzdf = 1   ! horizontal lateral physics in s-coordinate 
    120  
     118      ! 
    121119      IF( lk_esopa )    nzdf = -1                   ! Esopa key: All schemes used 
    122  
     120      ! 
    123121      IF(lwp) THEN                                  ! Print the choice 
    124122         WRITE(numout,*) 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/FLO/floats.F90

    r2027 r2104  
    107107      WRITE(*,*) 'flo_stp: You should not have seen this print! error?', kt 
    108108   END SUBROUTINE flo_stp 
     109   SUBROUTINE flo_init          ! Empty routine 
     110   END SUBROUTINE flo_init 
    109111#endif 
    110112 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/IOM/restart.F90

    r2082 r2104  
    44   !! Ocean restart :  write the ocean restart file 
    55   !!====================================================================== 
    6    !! History :        !  99-11  (M. Imbard)  Original code 
    7    !!             8.5  !  02-08  (G. Madec)  F90: Free form 
    8    !!             9.0  !  05-11  (V. Garnier) Surface pressure gradient organization 
    9    !!             9.0  !  06-07  (S. Masson)  use IOM for restart 
     6   !! History :  OPA  !  1999-11  (M. Imbard)  Original code 
     7   !!   NEMO     1.0  !  2002-08  (G. Madec)  F90: Free form 
     8   !!            2.0  !  2006-07  (S. Masson)  use IOM for restart 
     9   !!            3.3  !  2010-10  (C. Ethe, G. Madec) TRC-TRA merge (T-S in 4D) 
    1010   !!---------------------------------------------------------------------- 
    1111 
     
    2626   USE zdfmxl          ! mixed layer depth 
    2727   USE trdmld_oce      ! ocean active mixed layer tracers trends variables 
    28 #if defined key_zdfkpp 
    29    USE traswap 
    30 #endif 
     28   USE traswp          ! swap from 4D T-S to 3D T & S and vice versa 
     29 
    3130   IMPLICIT NONE 
    3231   PRIVATE 
     
    3635   PUBLIC   rst_read   ! routine called by opa  module 
    3736 
    38    LOGICAL, PUBLIC ::   lrst_oce =  .FALSE.       !: logical to control the oce restart write  
    39    INTEGER, PUBLIC ::   numror, numrow            !: logical unit for cean restart (read and write) 
     37   LOGICAL, PUBLIC ::   lrst_oce =  .FALSE.   !: logical to control the oce restart write  
     38   INTEGER, PUBLIC ::   numror, numrow        !: logical unit for cean restart (read and write) 
    4039 
    4140   !! * Substitutions 
    4241#  include "vectopt_loop_substitute.h90" 
    4342   !!---------------------------------------------------------------------- 
    44    !!  OPA 9.0 , LOCEAN-IPSL (2006)  
     43   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010)  
    4544   !! $Id$ 
    4645   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
     
    109108      !! 
    110109      !! ** Method  :   Write in numrow when kt == nitrst in NetCDF 
    111       !!      file, save fields which are necessary for restart 
     110      !!              file, save fields which are necessary for restart 
    112111      !!---------------------------------------------------------------------- 
    113112      INTEGER, INTENT(in) ::   kt   ! ocean time-step 
     
    135134      CALL iom_rstput( kt, nitrst, numrow, 'rhop'   , rhop    ) 
    136135#if defined key_zdfkpp 
    137       CALL iom_rstput( kt, nitrst, numrow, 'rhd'  , rhd   ) 
     136      CALL iom_rstput( kt, nitrst, numrow, 'rhd'    , rhd     ) 
    138137#endif 
    139138 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/LDF/ldfslp.F90

    r2027 r2104  
    616616      WRITE(*,*) 'ldf_slp: You should not have seen this print! error?', kt, prd(1,1,1), pn2(1,1,1) 
    617617   END SUBROUTINE ldf_slp 
     618   SUBROUTINE ldf_slp_init       ! Dummy routine 
     619   END SUBROUTINE ldf_slp_init 
    618620#endif 
    619621 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/TRA/eosbn2.F90

    r2083 r2104  
    1616   !!             -   ! 2003-08  (G. Madec)  F90, free form 
    1717   !!            3.0  ! 2006-08  (G. Madec)  add tfreez function 
     18   !!            3.3  ! 2010-05  (C. Ethe, G. Madec)  merge TRC-TRA 
    1819   !!---------------------------------------------------------------------- 
    1920 
     
    6162#  include "vectopt_loop_substitute.h90" 
    6263   !!---------------------------------------------------------------------- 
    63    !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009)  
     64   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010)  
    6465   !! $Id$ 
    6566   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/TRA/traadv.F90

    r2082 r2104  
    55   !!============================================================================== 
    66   !! History :  2.0  !  2005-11  (G. Madec)  Original code 
    7    !!            3.0  !  2008-01  (C. Ethe, G. Madec)  merge TRC-TRA + switch from velocity to transport 
     7   !!            3.3  !  2010-09  (C. Ethe, G. Madec)  merge TRC-TRA + switch from velocity to transport 
    88   !!---------------------------------------------------------------------- 
    99 
     
    5050   !!---------------------------------------------------------------------- 
    5151   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010)  
    52    !! $Id$  
     52   !! $Id$ 
    5353   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    5454   !!---------------------------------------------------------------------- 
     
    6767      !! 
    6868      INTEGER ::   jk   ! dummy loop index 
    69       REAL(wp), DIMENSION(jpi,jpj,jpk)   ::  zun, zvn, zwn   ! effective transport 
     69      REAL(wp), DIMENSION(jpi,jpj,jpk)   ::  zun, zvn, zwn   ! 3D workspace: effective transport 
    7070      !!---------------------------------------------------------------------- 
    7171      !                                          ! set time step 
     
    135135      !!---------------------------------------------------------------------- 
    136136      INTEGER ::   ioptio 
    137  
     137      !! 
    138138      NAMELIST/namtra_adv/ ln_traadv_cen2 , ln_traadv_tvd,    & 
    139139         &                 ln_traadv_muscl, ln_traadv_muscl2, & 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/TRA/traadv_cen2.F90

    r2082 r2104  
    1515 
    1616   !!---------------------------------------------------------------------- 
    17    !!   tra_adv_cen2 : update the tracer trend with the horizontal and 
    18    !!                  vertical advection trends using a seconder order 
    19    !!   ups_orca_set : allow mixed upstream/centered scheme in specific 
    20    !!                  area (set for orca 2 and 4 only) 
     17   !!   tra_adv_cen2 : update the tracer trend with the advection trends using a 2nd order centered scheme 
     18   !!   ups_orca_set : allow mixed upstream/centered scheme in specific area (set for orca 2 and 4 only) 
    2119   !!---------------------------------------------------------------------- 
    2220   USE oce, ONLY: tsn  ! now ocean temperature and salinity 
     
    115113      USE oce         , zwy => va   ! use va as workspace 
    116114      !! 
    117       INTEGER         , INTENT(in   )                              ::   kt              ! ocean time-step index 
    118       CHARACTER(len=3), INTENT(in   )                              ::   cdtype          ! =TRA or TRC (tracer indicator) 
    119       REAL(wp)        , INTENT(in   ), DIMENSION(jpi,jpj,jpk)       ::   pun, pvn, pwn   ! 3 ocean velocity components 
    120       INTEGER         , INTENT(in   )                               ::   kjpt            ! number of tracers 
    121       REAL(wp)        , INTENT(in   ), DIMENSION(jpi,jpj,jpk,kjpt) ::   ptb, ptn        ! before and now tracer fields 
    122       REAL(wp)        , INTENT(inout), DIMENSION(jpi,jpj,jpk,kjpt)  ::   pta           ! tracer trend  
     115      INTEGER                              , INTENT(in   ) ::   kt              ! ocean time-step index 
     116      CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype          ! =TRA or TRC (tracer indicator) 
     117      INTEGER                              , INTENT(in   ) ::   kjpt            ! number of tracers 
     118      REAL(wp), DIMENSION(jpi,jpj,jpk     ), INTENT(in   ) ::   pun, pvn, pwn   ! 3 ocean velocity components 
     119      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   ptb, ptn        ! before and now tracer fields 
     120      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pta             ! tracer trend  
    123121      !! 
    124122      INTEGER  ::   ji, jj, jk, jn                   ! dummy loop indices 
     
    136134 
    137135 
    138       IF( ( cdtype == 'TRA' .AND. kt == nit000 ) .OR. ( cdtype == 'TRC' .AND. kt == nittrc000 ) )  THEN 
     136      IF( kt == nit000 )  THEN 
    139137         IF(lwp) WRITE(numout,*) 
    140138         IF(lwp) WRITE(numout,*) 'tra_adv_cen2 : 2nd order centered advection scheme on ', cdtype 
    141          IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~   Vector optimization case' 
     139         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~ ' 
    142140         IF(lwp) WRITE(numout,*) 
    143141         ! 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/TRA/traadv_eiv.F90

    r2082 r2104  
    44   !! Ocean tracers:  advection trend - eddy induced velocity 
    55   !!====================================================================== 
    6    !! History :  9.0  !  05-11 (G. Madec)  Original code, from traldf and zdf _iso 
    7    !!            3.3  !  10-05 (C. Ethe, G. Madec)  merge TRC-TRA  
     6   !! History :  1.0  !  2005-11 (G. Madec)  Original code, from traldf and zdf _iso 
     7   !!            3.3  !  2010-05 (C. Ethe, G. Madec)  merge TRC-TRA  
    88   !!---------------------------------------------------------------------- 
    99#if defined key_traldf_eiv   ||   defined key_esopa 
    1010   !!---------------------------------------------------------------------- 
    1111   !!   'key_traldf_eiv'                  rotation of the lateral mixing tensor 
    12    !!---------------------------------------------------------------------- 
    1312   !!---------------------------------------------------------------------- 
    1413   !!   tra_ldf_iso : update the tracer trend with the horizontal component 
     
    4039#  include "vectopt_loop_substitute.h90" 
    4140   !!---------------------------------------------------------------------- 
    42    !!  OPA 9.0 , LOCEAN-IPSL (2006)  
    43    !! $Id$  
     41   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010)  
     42   !! $Id$ 
    4443   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    4544   !!---------------------------------------------------------------------- 
     
    6564      !! ** Action  : - add to p.n the eiv component 
    6665      !!---------------------------------------------------------------------- 
    67       INTEGER , INTENT(in   )                         ::   kt     ! ocean time-step index 
    68       CHARACTER(len=3), INTENT(in)                    ::   cdtype          ! =TRA or TRC (tracer indicator) 
    69       REAL(wp), INTENT(inout), DIMENSION(jpi,jpj,jpk) ::   pun    ! in : 3 ocean velocity components  
    70       REAL(wp), INTENT(inout), DIMENSION(jpi,jpj,jpk) ::   pvn    ! out: 3 ocean velocity components 
    71       REAL(wp), INTENT(inout), DIMENSION(jpi,jpj,jpk) ::   pwn    ! increased by the eiv 
     66      INTEGER                         , INTENT(in   ) ::   kt       ! ocean time-step index 
     67      CHARACTER(len=3)                , INTENT(in   ) ::   cdtype   ! =TRA or TRC (tracer indicator) 
     68      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) ::   pun      ! in : 3 ocean velocity components  
     69      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) ::   pvn      ! out: 3 ocean velocity components 
     70      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) ::   pwn      ! increased by the eiv 
    7271      !! 
    7372      INTEGER  ::   ji, jj, jk                 ! dummy loop indices 
    74       REAL(wp) ::   zuwk, zuwk1, zuwi, zuwi1   ! temporary scalar 
    75       REAL(wp) ::   zvwk, zvwk1, zvwj, zvwj1   !    "         " 
    76       REAL(wp), DIMENSION(jpi,jpj) ::   zu_eiv, zv_eiv, zw_eiv     !    "         " 
     73      REAL(wp) ::   zuwk, zuwk1, zuwi, zuwi1   ! local scalars 
     74      REAL(wp) ::   zvwk, zvwk1, zvwj, zvwj1   !   -      - 
     75      REAL(wp), DIMENSION(jpi,jpj) ::   zu_eiv, zv_eiv, zw_eiv     ! 2D workspace 
    7776# if defined key_diaeiv  
    78       REAL(wp) ::   zztmp                      !    "         " 
    79       REAL(wp), DIMENSION(jpi,jpj) ::   z2d    !    "         " 
     77      REAL(wp) ::   zztmp                      ! local scalar 
     78      REAL(wp), DIMENSION(jpi,jpj) ::   z2d    ! 2D workspace 
    8079# endif   
    8180      !!---------------------------------------------------------------------- 
    8281 
    83       IF( ( cdtype == 'TRA' .AND. kt == nit000 ) .OR. ( cdtype == 'TRC' .AND. kt == nittrc000 ) )  THEN 
     82      IF( kt == nit000 )  THEN 
    8483         IF(lwp) WRITE(numout,*) 
    8584         IF(lwp) WRITE(numout,*) 'tra_adv_eiv : eddy induced advection on ', cdtype,' :' 
     
    9594 
    9695      zu_eiv(:,:) = 0.e0   ;   zv_eiv(:,:) = 0.e0   ;    zw_eiv(:,:) = 0.e0   
     96       
    9797                                                    ! ================= 
    9898      DO jk = 1, jpkm1                              !  Horizontal slab 
     
    188188CONTAINS 
    189189   SUBROUTINE tra_adv_eiv( kt, pun, pvn, pwn, cdtype )              ! Empty routine 
    190       INTEGER , INTENT(in   )           ::   kt     ! ocean time-step index 
    191       CHARACTER(len=3), INTENT(in)      ::   cdtype          ! =TRA or TRC (tracer indicator) 
     190      INTEGER  ::   kt     
     191      CHARACTER(len=3) ::   cdtype 
    192192      REAL, DIMENSION(:,:,:) ::   pun, pvn, pwn 
    193       WRITE(*,*) 'tra_adv_eiv: You should not have seen this print! error?', kt 
    194       WRITE(*,*) 'tra_adv_eiv: You should not have seen this print! error?', cdtype 
     193      WRITE(*,*) 'tra_adv_eiv: You should not have seen this print! error?', kt, cdtype 
    195194      WRITE(*,*) 'tra_adv_eiv: You should not have seen this print! error?', pun(1,1,1), pvn(1,1,1), pwn(1,1,1) 
    196195   END SUBROUTINE tra_adv_eiv 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/TRA/traadv_muscl.F90

    r2083 r2104  
    6565      USE oce         , zwy => va   ! use va as workspace 
    6666      !! 
    67       INTEGER         , INTENT(in   )                              ::   kt              ! ocean time-step index 
    68       CHARACTER(len=3), INTENT(in   )                              ::   cdtype          ! =TRA or TRC (tracer indicator) 
    69       INTEGER         , INTENT(in   )                              ::   kjpt            ! number of tracers 
    70       REAL(wp)        , INTENT(in   ), DIMENSION(jpk)              ::   p2dt            ! vertical profile of tracer time-step 
    71       REAL(wp)        , INTENT(in   ), DIMENSION(jpi,jpj,jpk)      ::   pun, pvn, pwn   ! 3 ocean velocity components 
    72       REAL(wp)        , INTENT(in   ), DIMENSION(jpi,jpj,jpk,kjpt)  ::   ptb           ! before and now tracer fields 
    73       REAL(wp)        , INTENT(inout), DIMENSION(jpi,jpj,jpk,kjpt)  ::   pta           ! tracer trend  
     67      INTEGER                              , INTENT(in   ) ::   kt              ! ocean time-step index 
     68      CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype          ! =TRA or TRC (tracer indicator) 
     69      INTEGER                              , INTENT(in   ) ::   kjpt            ! number of tracers 
     70      REAL(wp), DIMENSION(        jpk     ), INTENT(in   ) ::   p2dt            ! vertical profile of tracer time-step 
     71      REAL(wp), DIMENSION(jpi,jpj,jpk     ), INTENT(in   ) ::   pun, pvn, pwn   ! 3 ocean velocity components 
     72      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   ptb             ! before tracer field 
     73      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pta             ! tracer trend  
    7474      !! 
    7575      INTEGER  ::   ji, jj, jk, jn   ! dummy loop indices 
    76       REAL(wp) ::   zu, z0u, zzwx 
    77       REAL(wp) ::   zv, z0v, zzwy 
    78       REAL(wp) ::   zw, z0w 
     76      REAL(wp) ::   zu, z0u, zzwx    ! local scalar 
     77      REAL(wp) ::   zv, z0v, zzwy    !   -      - 
     78      REAL(wp) ::   zw, z0w          !   -      - 
    7979      REAL(wp) ::   ztra, zbtr, zdt, zalpha 
    8080      REAL(wp), DIMENSION (jpi,jpj,jpk) :: zslpx, zslpy   ! 3D workspace 
    8181      !!---------------------------------------------------------------------- 
    8282 
    83       IF( ( cdtype == 'TRA' .AND. kt == nit000 ) .OR. ( cdtype == 'TRC' .AND. kt == nittrc000 ) )  THEN 
     83      IF( kt == nit000 )  THEN 
    8484         WRITE(numout,*) 
    8585         WRITE(numout,*) 'tra_adv : MUSCL advection scheme on ', cdtype 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/TRA/traadv_muscl2.F90

    r2083 r2104  
    2828   PRIVATE 
    2929 
    30    !! * Accessibility 
    31    PUBLIC tra_adv_muscl2        ! routine called by step.F90 
     30   PUBLIC   tra_adv_muscl2        ! routine called by step.F90 
    3231 
    3332   LOGICAL  :: l_trd       ! flag to compute trends 
     
    6160      !!              IPSL, Sept. 2000 (http://www.lodyc.jussieu.fr/opa) 
    6261      !!---------------------------------------------------------------------- 
    63       !!* Module used 
    6462      USE oce         , zwx => ua   ! use ua as workspace 
    6563      USE oce         , zwy => va   ! use va as workspace 
    66       !!* Arguments 
    67       INTEGER         , INTENT(in   )                              ::   kt              ! ocean time-step index 
    68       CHARACTER(len=3), INTENT(in   )                              ::   cdtype          ! =TRA or TRC (tracer indicator) 
    69       INTEGER         , INTENT(in   )                              ::   kjpt            ! number of tracers 
    70       REAL(wp)        , INTENT(in   ), DIMENSION(jpk)              ::   p2dt            ! vertical profile of tracer time-step 
    71       REAL(wp)        , INTENT(in   ), DIMENSION(jpi,jpj,jpk)      ::   pun, pvn, pwn   ! 3 ocean velocity components 
    72       REAL(wp)        , INTENT(in   ), DIMENSION(jpi,jpj,jpk,kjpt)  ::   ptb, ptn        ! before and now tracer fields 
    73       REAL(wp)        , INTENT(inout), DIMENSION(jpi,jpj,jpk,kjpt)  ::   pta           ! tracer trend  
    74       !!* Local declarations 
     64      !! 
     65      INTEGER                              , INTENT(in   ) ::   kt              ! ocean time-step index 
     66      CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype          ! =TRA or TRC (tracer indicator) 
     67      INTEGER                              , INTENT(in   ) ::   kjpt            ! number of tracers 
     68      REAL(wp), DIMENSION(        jpk     ), INTENT(in   ) ::   p2dt            ! vertical profile of tracer time-step 
     69      REAL(wp), DIMENSION(jpi,jpj,jpk     ), INTENT(in   ) ::   pun, pvn, pwn   ! 3 ocean velocity components 
     70      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   ptb, ptn        ! before & now tracer fields 
     71      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pta             ! tracer trend  
     72      !! 
    7573      INTEGER  ::   ji, jj, jk, jn   ! dummy loop indices 
    76       REAL(wp) ::   zu, z0u, zzwx 
    77       REAL(wp) ::   zv, z0v, zzwy 
    78       REAL(wp) ::   zw, z0w 
     74      REAL(wp) ::   zu, z0u, zzwx    ! local scalar 
     75      REAL(wp) ::   zv, z0v, zzwy    !   -      - 
     76      REAL(wp) ::   zw, z0w          !   -      - 
    7977      REAL(wp) ::   ztra, zbtr, zdt, zalpha 
    8078      REAL(wp), DIMENSION (jpi,jpj,jpk) ::  zslpx, zslpy   ! 3D workspace 
    8179      !!---------------------------------------------------------------------- 
    8280 
    83       IF( ( cdtype == 'TRA' .AND. kt == nit000 ) .OR. ( cdtype == 'TRC' .AND. kt == nittrc000 ) )  THEN 
     81      IF( kt == nit000 )  THEN 
    8482         WRITE(numout,*) 
    8583         WRITE(numout,*) 'tra_adv_muscl2 : MUSCL2 advection scheme on ', cdtype 
     
    9088      ENDIF 
    9189 
    92       ! 
     90      !                                                          ! =========== 
    9391      DO jn = 1, kjpt                                            ! tracer loop 
    9492         !                                                       ! =========== 
     
    181179            END DO 
    182180         END DO 
    183  
    184          !                                                    ! lateral boundary conditions on zwx, zwy   (changed sign) 
    185          CALL lbc_lnk( zwx, 'U', -1. )   ;   CALL lbc_lnk( zwy, 'V', -1. ) 
     181         CALL lbc_lnk( zwx, 'U', -1. )   ;   CALL lbc_lnk( zwy, 'V', -1. )   ! lateral boundary condition (changed sign) 
     182 
    186183         ! Tracer flux divergence at t-point added to the general trend 
    187184         DO jk = 1, jpkm1 
     
    278275            END DO 
    279276         END DO 
    280  
    281          ! Compute & add the vertical advective trend 
    282          DO jk = 1, jpkm1 
     277         ! 
     278         DO jk = 1, jpkm1        ! Compute & add the vertical advective trend 
    283279            DO jj = 2, jpjm1       
    284280               DO ji = fs_2, fs_jpim1   ! vector opt. 
     
    291287            END DO 
    292288         END DO 
    293  
    294          ! Save the vertical advective trends for diagnostic 
    295          ! ------------------------------------------------- 
    296          !                                 ! trend diagnostics (contribution of upstream fluxes) 
     289         !                       ! trend diagnostics (contribution of upstream fluxes) 
    297290         IF( l_trd )  CALL trd_tra( kt, cdtype, jn, jptra_trd_zad, zwx, pwn, ptb(:,:,:,jn) ) 
    298291         ! 
    299       ENDDO 
     292      END DO 
    300293      ! 
    301294   END SUBROUTINE tra_adv_muscl2 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/TRA/traadv_qck.F90

    r2083 r2104  
    99 
    1010   !!---------------------------------------------------------------------- 
    11    !!   tra_adv_qck      : update the tracer trend with the horizontal advection 
    12    !!                      trends using a 3rd order finite difference scheme 
    13    !!   tra_adv_qck_i  :  
    14    !!   tra_adv_qck_j  :  
     11   !!   tra_adv_qck    : update the tracer trend with the horizontal advection 
     12   !!                    trends using a 3rd order finite difference scheme 
     13   !!   tra_adv_qck_i  : apply QUICK scheme in i-direction 
     14   !!   tra_adv_qck_j  : apply QUICK scheme in j-direction 
    1515   !!   tra_adv_cen2_k : 2nd centered scheme for the vertical advection 
    1616   !!---------------------------------------------------------------------- 
    1717   USE oce             ! ocean dynamics and active tracers 
    1818   USE dom_oce         ! ocean space and time domain 
    19    USE trdmod_oce         ! ocean space and time domain 
    20    USE trdtra      ! ocean tracers trends  
     19   USE trdmod_oce      ! ocean space and time domain 
     20   USE trdtra          ! ocean tracers trends  
    2121   USE trabbl          ! advective term in the BBL 
    2222   USE lib_mpp         ! distribued memory computing 
     
    3232   PUBLIC   tra_adv_qck   ! routine called by step.F90 
    3333 
    34    REAL(wp)  :: r1_6 = 1./ 6. 
    35    LOGICAL   :: l_trd    ! flag to compute trends 
     34   LOGICAL  :: l_trd           ! flag to compute trends 
     35   REAL(wp) :: r1_6 = 1./ 6.   ! 1/6 ratio 
    3636 
    3737   !! * Substitutions 
     
    4040   !!---------------------------------------------------------------------- 
    4141   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010)  
    42    !! $Id: traadv_qck.F90 2024 2010-07-29 10:57:35Z cetlod $ 
     42   !! $Id: $ 
    4343   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    4444   !!---------------------------------------------------------------------- 
     
    8383      !!---------------------------------------------------------------------- 
    8484      !! 
    85       INTEGER         , INTENT(in   )                              ::   kt              ! ocean time-step index 
    86       CHARACTER(len=3), INTENT(in   )                              ::   cdtype          ! =TRA or TRC (tracer indicator) 
    87       INTEGER         , INTENT(in   )                              ::   kjpt            ! number of tracers 
    88       REAL(wp)        , INTENT(in   ), DIMENSION(jpk)              ::   p2dt            ! vertical profile of tracer time-step 
    89       REAL(wp)        , INTENT(in   ), DIMENSION(jpi,jpj,jpk)      ::   pun, pvn, pwn   ! 3 ocean velocity components 
    90       REAL(wp)        , INTENT(in   ), DIMENSION(jpi,jpj,jpk,kjpt) ::   ptb, ptn        ! before and now tracer fields 
    91       REAL(wp)        , INTENT(inout), DIMENSION(jpi,jpj,jpk,kjpt)  ::   pta           ! tracer trend  
    92       !!---------------------------------------------------------------------- 
    93  
    94       IF( ( cdtype == 'TRA' .AND. kt == nit000 ) .OR. ( cdtype == 'TRC' .AND. kt == nittrc000 ) )  THEN 
     85      INTEGER                              , INTENT(in   ) ::   kt              ! ocean time-step index 
     86      CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype          ! =TRA or TRC (tracer indicator) 
     87      INTEGER                              , INTENT(in   ) ::   kjpt            ! number of tracers 
     88      REAL(wp), DIMENSION(        jpk     ), INTENT(in   ) ::   p2dt            ! vertical profile of tracer time-step 
     89      REAL(wp), DIMENSION(jpi,jpj,jpk     ), INTENT(in   ) ::   pun, pvn, pwn   ! 3 ocean velocity components 
     90      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   ptb, ptn        ! before and now tracer fields 
     91      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pta             ! tracer trend  
     92      !!---------------------------------------------------------------------- 
     93 
     94      IF( kt == nit000 )  THEN 
    9595         IF(lwp) WRITE(numout,*) 
    9696         IF(lwp) WRITE(numout,*) 'tra_adv_qck : 3rd order quickest advection scheme on ', cdtype 
     
    103103 
    104104      ! I. The horizontal fluxes are computed with the QUICKEST + ULTIMATE scheme 
    105       !--------------------------------------------------------------------------- 
    106  
    107105      CALL tra_adv_qck_i( kt, cdtype, p2dt, pun, ptb, ptn, pta, kjpt )  
    108106      CALL tra_adv_qck_j( kt, cdtype, p2dt, pvn, ptb, ptn, pta, kjpt )  
    109107 
    110108      ! II. The vertical fluxes are computed with the 2nd order centered scheme 
    111       !------------------------------------------------------------------------- 
    112       ! 
    113109      CALL tra_adv_cen2_k( kt, cdtype, pwn,         ptn, pta, kjpt ) 
    114110      ! 
    115111   END SUBROUTINE tra_adv_qck 
    116112 
     113 
    117114   SUBROUTINE tra_adv_qck_i( kt, cdtype, p2dt, pun,    & 
    118115      &                                        ptb, ptn, pta, kjpt   ) 
     
    122119      USE oce         , zwx => ua   ! use ua as workspace 
    123120      !! 
    124       INTEGER         , INTENT(in   )                              ::   kt              ! ocean time-step index 
    125       CHARACTER(len=3), INTENT(in   )                              ::   cdtype          ! =TRA or TRC (tracer indicator) 
    126       INTEGER         , INTENT(in   )                              ::   kjpt            ! number of tracers 
    127       REAL(wp)        , INTENT(in   ), DIMENSION(jpk)              ::   p2dt            ! vertical profile of tracer time-step 
    128       REAL(wp)        , INTENT(in   ), DIMENSION(jpi,jpj,jpk)       ::   pun             ! zonal velocity component 
    129       REAL(wp)        , INTENT(in   ), DIMENSION(jpi,jpj,jpk,kjpt)  ::   ptb, ptn    ! before tracer fields 
    130       REAL(wp)        , INTENT(inout), DIMENSION(jpi,jpj,jpk,kjpt)  ::   pta           ! tracer trend  
     121      INTEGER                              , INTENT(in   ) ::   kt              ! ocean time-step index 
     122      CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype          ! =TRA or TRC (tracer indicator) 
     123      INTEGER                              , INTENT(in   ) ::   kjpt            ! number of tracers 
     124      REAL(wp), DIMENSION(        jpk     ), INTENT(in   ) ::   p2dt            ! vertical profile of tracer time-step 
     125      REAL(wp), DIMENSION(jpi,jpj,jpk     ), INTENT(in   ) ::   pun             ! i-velocity components 
     126      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   ptb, ptn        ! before and now tracer fields 
     127      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pta             ! tracer trend  
    131128      !! 
    132129      INTEGER  :: ji, jj, jk, jn           ! dummy loop indices 
    133       REAL(wp) :: ztra, zbtr               ! temporary scalars 
    134       REAL(wp) :: zdir, zdx, zdt, zmsk     ! temporary scalars 
    135       REAL(wp), DIMENSION(jpi,jpj,jpk) ::  zfu, zfc, zfd 
     130      REAL(wp) :: ztra, zbtr               ! local scalars 
     131      REAL(wp) :: zdir, zdx, zdt, zmsk     ! local scalars 
     132      REAL(wp), DIMENSION(jpi,jpj,jpk) ::  zfu, zfc, zfd   ! 3D wokspace 
    136133      !---------------------------------------------------------------------- 
    137134 
    138        
     135      !                                                          ! =========== 
    139136      DO jn = 1, kjpt                                            ! tracer loop 
    140137         !                                                       ! =========== 
     
    154151            END DO 
    155152         END DO 
    156          ! 
    157          !--- Lateral boundary conditions  
    158          CALL lbc_lnk( zfc(:,:,:), 'T', 1. )      ;     CALL lbc_lnk( zfd(:,:,:), 'T', 1. )  
     153         CALL lbc_lnk( zfc(:,:,:), 'T', 1. )   ;   CALL lbc_lnk( zfd(:,:,:), 'T', 1. )   ! Lateral boundary conditions  
     154 
    159155          
    160156         ! 
     
    182178               END DO 
    183179            END DO 
    184          END DO      ! 
    185  
     180         END DO  
    186181         !--- Lateral boundary conditions  
    187          CALL lbc_lnk( zfu(:,:,:), 'T', 1. )      ;     CALL lbc_lnk( zfd(:,:,:), 'T', 1. ) 
    188          CALL lbc_lnk( zfc(:,:,:), 'T', 1. )      ;     CALL lbc_lnk( zwx(:,:,:), 'T', 1. ) 
     182         CALL lbc_lnk( zfu(:,:,:), 'T', 1. )   ;   CALL lbc_lnk( zfd(:,:,:), 'T', 1. ) 
     183         CALL lbc_lnk( zfc(:,:,:), 'T', 1. )   ;   CALL lbc_lnk( zwx(:,:,:), 'T', 1. ) 
    189184 
    190185         !--- QUICKEST scheme 
     
    199194            END DO 
    200195         END DO 
    201          !--- Lateral boundary conditions  
    202          CALL lbc_lnk( zfu(:,:,:), 'T', 1. )  
     196         CALL lbc_lnk( zfu(:,:,:), 'T', 1. )      ! Lateral boundary conditions  
     197 
    203198         ! 
    204199         ! Tracer flux on the x-direction 
     
    235230   END SUBROUTINE tra_adv_qck_i 
    236231 
     232 
    237233   SUBROUTINE tra_adv_qck_j( kt, cdtype, p2dt, pvn,   & 
    238234      &                                        ptb, ptn, pta, kjpt   ) 
     
    243239      USE oce         , zwy => ua   ! use ua as workspace 
    244240      !! 
    245       INTEGER         , INTENT(in   )                              ::   kt              ! ocean time-step index 
    246       CHARACTER(len=3), INTENT(in   )                              ::   cdtype          ! =TRA or TRC (tracer indicator) 
    247       INTEGER         , INTENT(in   )                              ::   kjpt            ! number of tracers 
    248       REAL(wp)        , INTENT(in   ), DIMENSION(jpk)              ::   p2dt            ! vertical profile of tracer time-step 
    249       REAL(wp)        , INTENT(in   ), DIMENSION(jpi,jpj,jpk)       ::   pvn             ! meridional velocity component 
    250       REAL(wp)        , INTENT(in   ), DIMENSION(jpi,jpj,jpk,kjpt)  ::   ptb, ptn    ! before tracer fields 
    251       REAL(wp)        , INTENT(inout), DIMENSION(jpi,jpj,jpk,kjpt)  ::   pta           ! tracer trend  
     241      INTEGER                              , INTENT(in   ) ::   kt              ! ocean time-step index 
     242      CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype          ! =TRA or TRC (tracer indicator) 
     243      INTEGER                              , INTENT(in   ) ::   kjpt            ! number of tracers 
     244      REAL(wp), DIMENSION(        jpk     ), INTENT(in   ) ::   p2dt            ! vertical profile of tracer time-step 
     245      REAL(wp), DIMENSION(jpi,jpj,jpk     ), INTENT(in   ) ::   pvn             ! j-velocity components 
     246      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   ptb, ptn        ! before and now tracer fields 
     247      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pta             ! tracer trend  
    252248      !! 
    253249      INTEGER  :: ji, jj, jk, jn           ! dummy loop indices 
    254       REAL(wp) :: ztra, zbtr               ! temporary scalars 
    255       REAL(wp) :: zdir, zdx, zdt, zmsk     ! temporary scalars 
    256       REAL(wp), DIMENSION(jpi,jpj,jpk) ::  zfu, zfc, zfd 
     250      REAL(wp) :: ztra, zbtr               ! local scalars 
     251      REAL(wp) :: zdir, zdx, zdt, zmsk     ! local scalars 
     252      REAL(wp), DIMENSION(jpi,jpj,jpk) ::  zfu, zfc, zfd   ! 3D wokspace 
    257253      !---------------------------------------------------------------------- 
    258254 
     255      !                                                          ! =========== 
    259256      DO jn = 1, kjpt                                            ! tracer loop 
    260257         !                                                       ! =========== 
     
    274271            END DO 
    275272         END DO 
    276          ! 
    277          !--- Lateral boundary conditions  
    278          CALL lbc_lnk( zfc(:,:,:), 'T', 1. )      ;     CALL lbc_lnk( zfd(:,:,:), 'T', 1. )  
     273         CALL lbc_lnk( zfc(:,:,:), 'T', 1. )   ;   CALL lbc_lnk( zfd(:,:,:), 'T', 1. )   ! Lateral boundary conditions  
     274 
    279275          
    280276         ! 
     
    302298               END DO 
    303299            END DO 
    304          END DO      ! 
     300         END DO 
    305301 
    306302         !--- Lateral boundary conditions  
     
    357353         ! 
    358354      END DO 
    359  
     355      ! 
    360356   END SUBROUTINE tra_adv_qck_j 
     357 
    361358 
    362359   SUBROUTINE tra_adv_cen2_k( kt, cdtype, pwn,   & 
     
    365362      !! 
    366363      !!---------------------------------------------------------------------- 
    367       !! 
    368364      USE oce         , zwz => ua   ! use ua as workspace 
    369365      !! 
    370       INTEGER         , INTENT(in   )                              ::   kt              ! ocean time-step index 
    371       CHARACTER(len=3), INTENT(in   )                              ::   cdtype          ! =TRA or TRC (tracer indicator) 
    372       INTEGER         , INTENT(in   )                              ::   kjpt            ! number of tracers 
    373       REAL(wp)        , INTENT(in   ), DIMENSION(jpi,jpj,jpk)       ::   pwn             ! vertical velocity component 
    374       REAL(wp)        , INTENT(in   ), DIMENSION(jpi,jpj,jpk,kjpt)  ::   ptn           ! now tracer field 
    375       REAL(wp)        , INTENT(inout), DIMENSION(jpi,jpj,jpk,kjpt)  ::   pta           ! tracer trend  
     366      INTEGER                              , INTENT(in   ) ::   kt              ! ocean time-step index 
     367      CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype          ! =TRA or TRC (tracer indicator) 
     368      INTEGER                              , INTENT(in   ) ::   kjpt            ! number of tracers 
     369      REAL(wp), DIMENSION(jpi,jpj,jpk     ), INTENT(in   ) ::   pwn             ! vertical velocity  
     370      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   ptn             ! before and now tracer fields 
     371      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pta             ! tracer trend  
    376372      !! 
    377373      INTEGER  ::   ji, jj, jk, jn   ! dummy loop indices 
     
    379375      !!---------------------------------------------------------------------- 
    380376 
    381       ! 
     377      !                                                          ! =========== 
    382378      DO jn = 1, kjpt                                            ! tracer loop 
    383379         !                                                       ! =========== 
     
    424420      !! ** Method :    
    425421      !!---------------------------------------------------------------------- 
    426       REAL(wp), INTENT(in)    , DIMENSION(jpi,jpj,jpk) :: pfu   ! second upwind point 
    427       REAL(wp), INTENT(in)    , DIMENSION(jpi,jpj,jpk) :: pfd   ! first douwning point 
    428       REAL(wp), INTENT(in)    , DIMENSION(jpi,jpj,jpk) :: pfc   ! the central point (or the first upwind point) 
    429       REAL(wp), INTENT(inout) , DIMENSION(jpi,jpj,jpk) :: puc   ! input as Courant number ; output as flux 
     422      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in   ) ::  pfu   ! second upwind point 
     423      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in   ) ::  pfd   ! first douwning point 
     424      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in   ) ::  pfc   ! the central point (or the first upwind point) 
     425      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) ::  puc   ! input as Courant number ; output as flux 
    430426      !! 
    431427      INTEGER  ::  ji, jj, jk               ! dummy loop indices  
    432       REAL(wp) ::  zcoef1, zcoef2, zcoef3   ! temporary scalars           
    433       REAL(wp) ::  zc, zcurv, zfho          !  
     428      REAL(wp) ::  zcoef1, zcoef2, zcoef3   ! local scalars           
     429      REAL(wp) ::  zc, zcurv, zfho          !   -      - 
    434430      !---------------------------------------------------------------------- 
    435431 
     
    460456               ENDIF 
    461457               puc(ji,jj,jk) = zfho 
    462             ENDDO 
    463          ENDDO 
    464       ENDDO 
     458            END DO 
     459         END DO 
     460      END DO 
    465461      ! 
    466462   END SUBROUTINE quickest 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/TRA/traadv_tvd.F90

    r2083 r2104  
    44   !! Ocean  tracers:  horizontal & vertical advective trend 
    55   !!============================================================================== 
    6    !! History :       !  95-12  (L. Mortier)  Original code 
    7    !!                 !  00-01  (H. Loukos)  adapted to ORCA  
    8    !!                 !  00-10  (MA Foujols E.Kestenare)  include file not routine 
    9    !!                 !  00-12  (E. Kestenare M. Levy)  fix bug in trtrd indexes 
    10    !!                 !  01-07  (E. Durand G. Madec)  adaptation to ORCA config 
    11    !!            8.5  !  02-06  (G. Madec)  F90: Free form and module 
    12    !!            9.0  !  04-01  (A. de Miranda, G. Madec, J.M. Molines ): advective bbl 
    13    !!            9.0  !  08-04  (S. Cravatte) add the i-, j- & k- trends computation 
    14    !!            " "  !  09-11  (V. Garnier) Surface pressure gradient organization 
    15    !!            3.3  !  10-05  (C. Ethe, G. Madec)  merge TRC-TRA + switch from velocity to transport 
    16    !!---------------------------------------------------------------------- 
    17  
     6   !! History :  OPA  !  1995-12  (L. Mortier)  Original code 
     7   !!                 !  2000-01  (H. Loukos)  adapted to ORCA  
     8   !!                 !  2000-10  (MA Foujols E.Kestenare)  include file not routine 
     9   !!                 !  2000-12  (E. Kestenare M. Levy)  fix bug in trtrd indexes 
     10   !!                 !  2001-07  (E. Durand G. Madec)  adaptation to ORCA config 
     11   !!            8.5  !  2002-06  (G. Madec)  F90: Free form and module 
     12   !!    NEMO    1.0  !  2004-01  (A. de Miranda, G. Madec, J.M. Molines ): advective bbl 
     13   !!            2.0  !  2008-04  (S. Cravatte) add the i-, j- & k- trends computation 
     14   !!             -   !  2009-11  (V. Garnier) Surface pressure gradient organization 
     15   !!            3.3  !  2010-05  (C. Ethe, G. Madec)  merge TRC-TRA + switch from velocity to transport 
     16   !!---------------------------------------------------------------------- 
    1817 
    1918   !!---------------------------------------------------------------------- 
     
    5352CONTAINS 
    5453 
    55    SUBROUTINE tra_adv_tvd ( kt, cdtype, p2dt, pun, pvn, pwn, & 
     54   SUBROUTINE tra_adv_tvd ( kt, cdtype, p2dt, pun, pvn, pwn,   & 
    5655      &                                       ptb, ptn, pta, kjpt   ) 
    5756      !!---------------------------------------------------------------------- 
     
    7170      USE oce         , zwy => va   ! use va as workspace 
    7271      !! 
    73       INTEGER         , INTENT(in   )                               ::   kt              ! ocean time-step index 
    74       CHARACTER(len=3), INTENT(in   )                               ::   cdtype          ! =TRA or TRC (tracer indicator) 
    75       INTEGER         , INTENT(in   )                               ::   kjpt            ! number of tracers 
    76       REAL(wp)        , INTENT(in   ), DIMENSION(jpk)               ::   p2dt            ! vertical profile of tracer time-step 
    77       REAL(wp)        , INTENT(in   ), DIMENSION(jpi,jpj,jpk)       ::   pun, pvn, pwn   ! 3 ocean velocity components 
    78       REAL(wp)        , INTENT(in   ), DIMENSION(jpi,jpj,jpk,kjpt)  ::   ptb, ptn        ! before and now tracer fields 
    79       REAL(wp)        , INTENT(inout), DIMENSION(jpi,jpj,jpk,kjpt)  ::   pta           ! tracer trend  
    80       !! 
    81       INTEGER  ::   ji, jj, jk, jn          ! dummy loop indices   
    82       REAL(wp) ::   & 
    83          z2dtt, zbtr, ztra,                  &  ! temporary scalar 
    84          zfp_ui, zfp_vj, zfp_wk,             &  !    "         " 
    85          zfm_ui, zfm_vj, zfm_wk                 !    "         " 
    86       REAL(wp), DIMENSION (jpi,jpj,jpk) ::   zwi, zwz   ! temporary workspace 
    87       REAL(wp), DIMENSION (:,:,:), ALLOCATABLE :: ztrdx, ztrdy, ztrdz 
    88       !!---------------------------------------------------------------------- 
    89  
    90  
    91       IF( ( cdtype == 'TRA' .AND. kt == nit000 ) .OR. ( cdtype == 'TRC' .AND. kt == nittrc000 ) )  THEN 
     72      INTEGER                              , INTENT(in   ) ::   kt              ! ocean time-step index 
     73      CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype          ! =TRA or TRC (tracer indicator) 
     74      INTEGER                              , INTENT(in   ) ::   kjpt            ! number of tracers 
     75      REAL(wp), DIMENSION(        jpk     ), INTENT(in   ) ::   p2dt            ! vertical profile of tracer time-step 
     76      REAL(wp), DIMENSION(jpi,jpj,jpk     ), INTENT(in   ) ::   pun, pvn, pwn   ! 3 ocean velocity components 
     77      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   ptb, ptn        ! before and now tracer fields 
     78      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pta             ! tracer trend  
     79      !! 
     80      INTEGER  ::   ji, jj, jk, jn           ! dummy loop indices   
     81      REAL(wp) ::   z2dtt, zbtr, ztra        ! local scalar 
     82      REAL(wp) ::   zfp_ui, zfp_vj, zfp_wk   !   -      - 
     83      REAL(wp) ::   zfm_ui, zfm_vj, zfm_wk   !   -      - 
     84      REAL(wp), DIMENSION (jpi,jpj,jpk) ::   zwi, zwz   ! 3D workspace 
     85      REAL(wp), DIMENSION (:,:,:), ALLOCATABLE ::   ztrdx, ztrdy, ztrdz 
     86      !!---------------------------------------------------------------------- 
     87 
     88      IF( kt == nit000 )  THEN 
    9289         WRITE(numout,*) 
    9390         WRITE(numout,*) 'tra_adv_tvd : TVD advection scheme on ', cdtype 
     
    9996      ! 
    10097      IF( l_trd )  THEN 
    101         ALLOCATE( ztrdx(jpi,jpj,jpk) )      ;      ztrdx(:,:,:) = 0. 
    102         ALLOCATE( ztrdy(jpi,jpj,jpk) )      ;      ztrdy(:,:,:) = 0. 
    103         ALLOCATE( ztrdz(jpi,jpj,jpk) )      ;      ztrdz(:,:,:) = 0. 
     98        ALLOCATE( ztrdx(jpi,jpj,jpk) )      ;      ztrdx(:,:,:) = 0.e0 
     99        ALLOCATE( ztrdy(jpi,jpj,jpk) )      ;      ztrdy(:,:,:) = 0.e0 
     100        ALLOCATE( ztrdz(jpi,jpj,jpk) )      ;      ztrdz(:,:,:) = 0.e0 
    104101      END IF 
    105102      ! 
     
    190187       
    191188         ! antidiffusive flux on k 
    192          ! Surface value 
    193          zwz(:,:,1) = 0.e0 
    194          ! Interior value 
    195          DO jk = 2, jpkm1 
     189         zwz(:,:,1) = 0.e0         ! Surface value 
     190         ! 
     191         DO jk = 2, jpkm1          ! Interior value 
    196192            DO jj = 1, jpj 
    197193               DO ji = 1, jpi 
     
    200196            END DO 
    201197         END DO 
    202  
    203          ! Lateral bondary conditions 
    204          CALL lbc_lnk( zwx, 'U', -1. ) 
    205          CALL lbc_lnk( zwy, 'V', -1. ) 
     198         CALL lbc_lnk( zwx, 'U', -1. )   ;   CALL lbc_lnk( zwy, 'V', -1. )         ! Lateral bondary conditions 
    206199         CALL lbc_lnk( zwz, 'W',  1. ) 
    207200 
     
    265258      !!       in-space based differencing for fluid 
    266259      !!---------------------------------------------------------------------- 
    267       REAL(wp), DIMENSION(jpk)         , INTENT( in    ) ::   &   
    268          p2dt                               ! vertical profile of tracer time-step 
    269       REAL(wp), DIMENSION (jpi,jpj,jpk), INTENT( in    ) ::   & 
    270          pbef,                            & ! before field 
    271          paft                               ! after field 
    272       REAL(wp), DIMENSION (jpi,jpj,jpk), INTENT( inout ) ::   & 
    273          paa,                             & ! monotonic flux in the i direction 
    274          pbb,                             & ! monotonic flux in the j direction 
    275          pcc                                ! monotonic flux in the k direction 
     260      REAL(wp), DIMENSION(jpk)         , INTENT(in   ) ::   p2dt            ! vertical profile of tracer time-step 
     261      REAL(wp), DIMENSION (jpi,jpj,jpk), INTENT(in   ) ::   pbef, paft      ! before & after field 
     262      REAL(wp), DIMENSION (jpi,jpj,jpk), INTENT(inout) ::   paa, pbb, pcc   ! monotonic fluxes in the 3 directions 
    276263      !! 
    277264      INTEGER ::   ji, jj, jk               ! dummy loop indices 
     
    332319         END DO 
    333320      END DO 
    334  
    335       ! lateral boundary condition on zbetup & zbetdo   (unchanged sign) 
    336       CALL lbc_lnk( zbetup, 'T', 1. ) 
    337       CALL lbc_lnk( zbetdo, 'T', 1. ) 
     321      CALL lbc_lnk( zbetup, 'T', 1. )   ;   CALL lbc_lnk( zbetdo, 'T', 1. )   ! lateral boundary cond. (unchanged sign) 
     322 
    338323 
    339324 
     
    362347         END DO 
    363348      END DO 
    364  
    365       ! lateral boundary condition on paa, pbb, pcc 
    366       CALL lbc_lnk( paa, 'U', -1. )      ! changed sign 
    367       CALL lbc_lnk( pbb, 'V', -1. )      ! changed sign 
     349      CALL lbc_lnk( paa, 'U', -1. )   ;   CALL lbc_lnk( pbb, 'V', -1. )   ! lateral boundary condition (changed sign) 
    368350      ! 
    369351   END SUBROUTINE nonosc 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/TRA/traadv_ubs.F90

    r2083 r2104  
    55   !!============================================================================== 
    66   !! History :  1.0  !  2006-08  (L. Debreu, R. Benshila)  Original code 
    7   !!             3.3  !  2010-05  (C. Ethe, G. Madec)  merge TRC-TRA + switch from velocity to transport 
     7   !!            3.3  !  2010-05  (C. Ethe, G. Madec)  merge TRC-TRA + switch from velocity to transport 
    88   !!---------------------------------------------------------------------- 
    99 
     
    4141CONTAINS 
    4242 
    43    SUBROUTINE tra_adv_ubs ( kt, cdtype, p2dt, pun, pvn, pwn, & 
     43   SUBROUTINE tra_adv_ubs ( kt, cdtype, p2dt, pun, pvn, pwn,   & 
    4444      &                                       ptb, ptn, pta, kjpt   ) 
    4545      !!---------------------------------------------------------------------- 
     
    7474      !!             Farrow, D.E., Stevens, D.P., 1995, J. Phys. Ocean. 25, 1731Ð1741.  
    7575      !!---------------------------------------------------------------------- 
    76       !!* Module used 
    7776      USE oce         , zwx => ua   ! use ua as workspace 
    7877      USE oce         , zwy => va   ! use va as workspace 
    79       !!* Arguments 
    80       INTEGER         , INTENT(in   )                              ::   kt              ! ocean time-step index 
    81       CHARACTER(len=3), INTENT(in   )                              ::   cdtype          ! =TRA or TRC (tracer indicator) 
    82       REAL(wp)        , INTENT(in   ), DIMENSION(jpi,jpj,jpk)       ::   pun, pvn, pwn   ! 3 ocean velocity components 
    83       INTEGER         , INTENT(in   )                               ::   kjpt            ! number of tracers 
    84       REAL(wp)        , INTENT(in   ), DIMENSION(jpk)               ::   p2dt            ! vertical profile of tracer time-step 
    85       REAL(wp)        , INTENT(in   ), DIMENSION(jpi,jpj,jpk,kjpt) ::   ptb, ptn        ! before and now tracer fields 
    86       REAL(wp)        , INTENT(inout), DIMENSION(jpi,jpj,jpk,kjpt)  ::   pta           ! tracer trend  
    87       !!* Local declarations 
     78      !! 
     79      INTEGER                              , INTENT(in   ) ::   kt              ! ocean time-step index 
     80      CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype          ! =TRA or TRC (tracer indicator) 
     81      INTEGER                              , INTENT(in   ) ::   kjpt            ! number of tracers 
     82      REAL(wp), DIMENSION(        jpk     ), INTENT(in   ) ::   p2dt            ! vertical profile of tracer time-step 
     83      REAL(wp), DIMENSION(jpi,jpj,jpk     ), INTENT(in   ) ::   pun, pvn, pwn   ! 3 ocean velocity components 
     84      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   ptb, ptn        ! before and now tracer fields 
     85      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pta             ! tracer trend  
     86      !! 
    8887      INTEGER  ::   ji, jj, jk, jn          ! dummy loop indices 
    89       REAL(wp) ::   ztra, zbtr, zcoef                  ! temporary scalars 
    90       REAL(wp) ::   zfp_ui, zfm_ui, zcenut  !    "         " 
    91       REAL(wp) ::   zfp_vj, zfm_vj, zcenvt  !    "         "    !    "         " 
    92       REAL(wp) ::   z2dtt                    
    93       REAL(wp) ::   ztak, zfp_wk, zfm_wk    !    "         " 
    94       REAL(wp) ::   zeeu, zeev, z_hdivn      
    95       REAL(wp), DIMENSION(jpi,jpj,jpk) :: ztu, ztv, zltu , zltv   !    "              " 
    96       REAL(wp), DIMENSION(jpi,jpj,jpk) :: zti, ztw                !    "              " 
    97       !!---------------------------------------------------------------------- 
    98  
    99  
    100       IF( ( cdtype == 'TRA' .AND. kt == nit000 ) .OR. ( cdtype == 'TRC' .AND. kt == nittrc000 ) )  THEN 
     88      REAL(wp) ::   ztra, zbtr, zcoef       ! local scalars 
     89      REAL(wp) ::   zfp_ui, zfm_ui, zcenut  !   -      - 
     90      REAL(wp) ::   zfp_vj, zfm_vj, zcenvt  !   -      - 
     91      REAL(wp) ::   z2dtt                   !   -      - 
     92      REAL(wp) ::   ztak, zfp_wk, zfm_wk    !   -      - 
     93      REAL(wp) ::   zeeu, zeev, z_hdivn     !   -      - 
     94      REAL(wp), DIMENSION(jpi,jpj,jpk) :: ztu, ztv, zltu , zltv   ! 3D workspace 
     95      REAL(wp), DIMENSION(jpi,jpj,jpk) :: zti, ztw                !  -      - 
     96      !!---------------------------------------------------------------------- 
     97 
     98      IF( kt == nit000 )  THEN 
    10199         IF(lwp) WRITE(numout,*) 
    102100         IF(lwp) WRITE(numout,*) 'tra_adv_ubs :  horizontal UBS advection scheme on ', cdtype 
     
    113111         ! ---------------------------------- 
    114112         zltu(:,:,jpk) = 0.e0       ;      zltv(:,:,jpk) = 0.e0 
    115          !                                                ! =============== 
     113         !                                               
    116114         DO jk = 1, jpkm1                                 ! Horizontal slab 
    117             !                                             ! =============== 
     115            !                                    
    118116            !  Laplacian 
    119             ! First derivative (gradient) 
    120             DO jj = 1, jpjm1 
     117            DO jj = 1, jpjm1            ! First derivative (gradient) 
    121118               DO ji = 1, fs_jpim1   ! vector opt. 
    122119                  zeeu = e2u(ji,jj) * fse3u(ji,jj,jk) / e1u(ji,jj) * umask(ji,jj,jk) 
     
    126123               END DO 
    127124            END DO 
    128             ! Second derivative (divergence) 
    129             DO jj = 2, jpjm1 
     125            DO jj = 2, jpjm1            ! Second derivative (divergence) 
    130126               DO ji = fs_2, fs_jpim1   ! vector opt. 
    131127                  zcoef = 1. / ( 6. * fse3t(ji,jj,jk) ) 
     
    134130               END DO 
    135131            END DO 
    136             !                                             ! ================= 
    137          END DO                                           !    End of slab 
    138          !                                                ! ================= 
    139           
    140          ! Lateral boundary conditions on the laplacian (zlt)   (unchanged sgn) 
    141          CALL lbc_lnk( zltu, 'T', 1. )   ;    CALL lbc_lnk( zltv, 'T', 1. ) 
     132            !                                     
     133         END DO                                           ! End of slab          
     134         CALL lbc_lnk( zltu, 'T', 1. )   ;    CALL lbc_lnk( zltv, 'T', 1. )   ! Lateral boundary cond. (unchanged sgn) 
    142135 
    143136         !     
    144137         !  Horizontal advective fluxes                
    145          DO jk = 1, jpkm1  
     138         DO jk = 1, jpkm1                                 ! Horizontal slab 
    146139            DO jj = 1, jpjm1 
    147140               DO ji = 1, fs_jpim1   ! vector opt. 
     
    159152               END DO 
    160153            END DO 
    161          ENDDO 
     154         END DO                                           ! End of slab          
    162155 
    163156         zltu(:,:,:) = pta(:,:,:,jn)      ! store pta trends 
     
    176169               END DO 
    177170            END DO 
    178             !                                             ! =============== 
     171            !                                              
    179172         END DO                                           !   End of slab 
    180          !                                                ! =============== 
    181173 
    182174         ! Horizontal trend used in tra_adv_ztvd subroutine 
     
    286278   END SUBROUTINE tra_adv_ubs 
    287279 
     280 
    288281   SUBROUTINE nonosc_z( pbef, pcc, paft, p2dt ) 
    289282      !!--------------------------------------------------------------------- 
     
    299292      !!       in-space based differencing for fluid 
    300293      !!---------------------------------------------------------------------- 
    301       REAL(wp), INTENT(in   ), DIMENSION(jpk)          ::   p2dt            ! vertical profile of tracer time-step 
     294      REAL(wp), INTENT(in   ), DIMENSION(jpk)          ::   p2dt   ! vertical profile of tracer time-step 
    302295      REAL(wp),                DIMENSION (jpi,jpj,jpk) ::   pbef   ! before field 
    303296      REAL(wp), INTENT(inout), DIMENSION (jpi,jpj,jpk) ::   paft   ! after field 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/TRA/trabbc.F90

    r2024 r2104  
    194194      WRITE(*,*) 'tra_bbc: You should not have seen this print! error?', kt 
    195195   END SUBROUTINE tra_bbc 
     196   SUBROUTINE tra_bbc_init           ! Empty routine 
     197   END SUBROUTINE tra_bbc_init 
    196198#endif 
    197199 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/TRA/trabbl.F90

    r2082 r2104  
    2626   USE phycst         !  
    2727   USE eosbn2         ! equation of state 
    28    USE trdmod_oce        ! ocean space and time domain 
    29    USE trdtra     ! ocean active tracers trends 
     28   USE trdmod_oce     ! ocean space and time domain 
     29   USE trdtra         ! ocean active tracers trends 
    3030   USE iom            ! IOM server                
    3131   USE in_out_manager ! I/O manager 
    3232   USE lbclnk         ! ocean lateral boundary conditions 
    3333   USE prtctl         ! Print control 
    34    USE trc_oce         ! share passive tracers/Ocean variables 
     34   USE trc_oce        ! share passive tracers/Ocean variables 
    3535 
    3636   IMPLICIT NONE 
     
    4949# endif 
    5050 
     51   LOGICAL, PUBLIC              ::   l_bbl               !: flag to compute bbl diffu. flux coef and transport 
     52    
    5153   !                                         !!* Namelist nambbl *  
    5254   INTEGER , PUBLIC ::   nn_bbl_ldf = 0       !: =1   : diffusive bbl or not (=0) 
     
    5759   REAL(wp), PUBLIC ::   rn_gambbl  = 10.e0   !: lateral coeff. for bottom boundary layer scheme [s] 
    5860 
     61   REAL(wp), DIMENSION(jpi,jpj), PUBLIC ::   utr_bbl, vtr_bbl   ! u- (v-) transport in the bottom boundary layer 
     62    
    5963   INTEGER , DIMENSION(jpi,jpj) ::   mbkt                   ! vertical index of the bottom ocean T-level 
    6064   INTEGER , DIMENSION(jpi,jpj) ::   mbku     , mbkv        ! vertical index of the (upper) bottom ocean U/V-level 
    6165   INTEGER , DIMENSION(jpi,jpj) ::   mbku_d   , mbkv_d      ! vertical index of the "lower" bottom ocean U/V-level 
    6266   INTEGER , DIMENSION(jpi,jpj) ::   mgrhu    , mgrhv       ! = +/-1, sign of grad(H) in u-(v-)direction 
    63    REAL(wp), DIMENSION(jpi,jpj), PUBLIC ::   utr_bbl  , vtr_bbl     ! u- (v-) transport in the bottom boundary layer 
    6467   REAL(wp), DIMENSION(jpi,jpj) ::   ahu_bbl_0, ahv_bbl_0   ! diffusive bbl flux coefficients at u and v-points 
    6568   REAL(wp), DIMENSION(jpi,jpj) ::   ahu_bbl  , ahv_bbl     ! masked diffusive bbl coefficients at u and v-points 
    6669   REAL(wp), DIMENSION(jpi,jpj) ::   e3u_bbl_0, e3v_bbl_0   ! thichness of the bbl (e3) at u and v-points 
    67    REAL(wp), DIMENSION(jpi,jpj) ::   e1e2t_r   ! thichness of the bbl (e3) at u and v-points 
    68    LOGICAL, PUBLIC              ::   l_bbl                    !: flag to compute bbl diffu. flux coef and transport 
     70   REAL(wp), DIMENSION(jpi,jpj) ::   e1e2t_r                ! thichness of the bbl (e3) at u and v-points 
    6971 
    7072   !! * Substitutions 
     
    7375   !!---------------------------------------------------------------------- 
    7476   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010)  
    75    !! $Id$  
     77   !! $Id$ 
    7678   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    7779   !!---------------------------------------------------------------------- 
    7880 
    7981CONTAINS 
    80  
    8182 
    8283   SUBROUTINE tra_bbl( kt ) 
     
    9091      !!----------------------------------------------------------------------   
    9192      INTEGER, INTENT( in ) ::   kt   ! ocean time-step  
    92       ! 
     93      !! 
    9394      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  ztrdt, ztrds 
    9495      !!---------------------------------------------------------------------- 
     
    154155      !!      convection is satified) 
    155156      !! 
    156       !! 
    157157      !! References : Beckmann, A., and R. Doscher, 1997, J. Phys.Oceanogr., 581-591. 
    158158      !!              Campin, J.-M., and H. Goosse, 1999, Tellus, 412-430. 
    159159      !!----------------------------------------------------------------------   
    160       !!* Arguments 
    161       INTEGER         , INTENT(in   )                                ::   kjpt      ! number of tracers 
    162       REAL(wp)        , INTENT(in   ), DIMENSION(jpi,jpj,jpk,kjpt)   ::   ptrab     ! before and now tracer fields 
    163       REAL(wp)        , INTENT(inout), DIMENSION(jpi,jpj,jpk,kjpt)   ::   ptraa     ! tracer trend  
     160      INTEGER                              , INTENT(in   ) ::   kjpt    ! number of tracers 
     161      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   ptrab   ! before and now tracer fields 
     162      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   ptraa   ! tracer trend  
     163      !! 
     164      INTEGER  ::   ji, jj, jn   ! dummy loop indices 
     165      INTEGER  ::   ik           ! local integer 
     166      REAL(wp) ::   zbtr, ztra   ! local scalars  
     167      REAL(wp), DIMENSION(jpi,jpj) :: ztrb, zkx, zky   ! 2D workspace 
     168      !!---------------------------------------------------------------------- 
    164169      ! 
    165       INTEGER  ::   ji, jj, jn           ! dummy loop indices 
    166       INTEGER  ::   ik                       ! temporary integers 
    167       REAL(wp) ::   zbtr, ztra               ! temporary  
    168       REAL(wp), DIMENSION(jpi,jpj) :: ztrb, zkx, zky        ! 2D workspace 
    169       !!---------------------------------------------------------------------- 
    170                                                           ! =========== 
     170      !                                                   ! =========== 
    171171      DO jn = 1, kjpt                                     ! tracer loop 
    172172         !                                                ! =========== 
     
    183183         END DO 
    184184         ! 
     185!!gm  forced unrolling should be uuseless in the loop below (no indirect adressing) 
    185186#  if defined key_vectopt_loop 
    186187         DO jj = 1, 1   ! vector opt. (forced unrolling) 
     
    212213      ! 
    213214   END SUBROUTINE tra_bbl_dif 
     215    
    214216 
    215217   SUBROUTINE tra_bbl_adv( ptrab, ptraa, kjpt ) 
     
    233235      !! 
    234236      !!----------------------------------------------------------------------   
    235       !!* Arguments 
    236       INTEGER         , INTENT(in   )                                ::   kjpt            ! number of tracers 
    237       REAL(wp)        , INTENT(in   ), DIMENSION(jpi,jpj,jpk,kjpt)   ::   ptrab          ! before and now tracer fields 
    238       REAL(wp)        , INTENT(inout), DIMENSION(jpi,jpj,jpk,kjpt)   ::   ptraa          ! tracer trend  
    239       ! 
     237      INTEGER                              , INTENT(in   ) ::   kjpt    ! number of tracers 
     238      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   ptrab   ! before and now tracer fields 
     239      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   ptraa   ! tracer trend  
     240      !! 
    240241      INTEGER  ::   ji, jj, jk, jn           ! dummy loop indices 
    241       INTEGER  ::   ik                       ! temporary integers 
    242       INTEGER  ::   iis , iid , ijs , ijd    !    -          - 
    243       INTEGER  ::   ikus, ikud, ikvs, ikvd   !    -          - 
    244       REAL(wp) ::   zbtr, ztra               !    -         - 
    245       REAL(wp) ::   zu_bbl, zv_bbl           !    -         - 
     242      INTEGER  ::   ik                       ! local integers 
     243      INTEGER  ::   iis , iid , ijs , ijd    !   -       - 
     244      INTEGER  ::   ikus, ikud, ikvs, ikvd   !   -       - 
     245      REAL(wp) ::   zbtr, ztra               ! local scalars 
     246      REAL(wp) ::   zu_bbl, zv_bbl           !   -      - 
    246247      !!---------------------------------------------------------------------- 
    247248 
     
    277278                  ptraa(iid,jj,ikud,jn) = ptraa(iid,jj,ikud,jn) + ztra 
    278279               ENDIF 
     280               ! 
    279281               IF( vtr_bbl(ji,jj) /= 0.e0 ) THEN            ! non-zero j-direction bbl advection 
    280282                  ! down-slope j/k-indices (deep)        &   up-slope j/k indices (shelf) 
     
    306308   END SUBROUTINE tra_bbl_adv 
    307309 
     310 
    308311   SUBROUTINE bbl( kt, cdtype ) 
    309312      !!---------------------------------------------------------------------- 
     
    330333      !!      local density (i.e. referenced at a common local depth). 
    331334      !! 
    332       !! 
    333335      !! References : Beckmann, A., and R. Doscher, 1997, J. Phys.Oceanogr., 581-591. 
    334336      !!              Campin, J.-M., and H. Goosse, 1999, Tellus, 412-430. 
    335337      !!----------------------------------------------------------------------   
    336       INTEGER         , INTENT(in   )                               ::   kt              ! ocean time-step index 
    337       CHARACTER(len=3), INTENT(in   )                               ::   cdtype          ! =TRA or TRC (tracer indicator) 
     338      INTEGER         , INTENT(in   ) ::   kt       ! ocean time-step index 
     339      CHARACTER(len=3), INTENT(in   ) ::   cdtype   ! =TRA or TRC (tracer indicator) 
     340      !! 
    338341      INTEGER  ::   ji, jj                    ! dummy loop indices 
    339       INTEGER  ::   ik                         ! temporary integers 
    340       INTEGER  ::   iis , iid , ijs , ijd     !    -          - 
    341       INTEGER  ::   ikus, ikud, ikvs, ikvd    !    -          - 
    342       REAL(wp) ::   zsign, zsigna, zgbbl      ! temporary scalars 
    343       REAL(wp) ::   zgdrho, zt, zs, zh        !    -         - 
    344       REAL(wp), DIMENSION(jpi,jpj) ::   zub, zvb, ztb, zsb, zdep  !  -      - 
     342      INTEGER  ::   ik                        ! local integers 
     343      INTEGER  ::   iis , iid , ijs , ijd     !   -       - 
     344      INTEGER  ::   ikus, ikud, ikvs, ikvd    !   -       - 
     345      REAL(wp) ::   zsign, zsigna, zgbbl      ! local scalars 
     346      REAL(wp) ::   zgdrho, zt, zs, zh        !   -      - 
     347      REAL(wp), DIMENSION(jpi,jpj) ::   zub, zvb, ztb, zsb, zdep  !  2D workspace 
    345348      !! 
    346349      REAL(wp) ::   fsalbt, fsbeta, pft, pfs, pfh   ! statement function 
     
    377380      !!---------------------------------------------------------------------- 
    378381       
     382      IF( kt == nit000 )  THEN 
     383         IF(lwp)  WRITE(numout,*) 
     384         IF(lwp)  WRITE(numout,*) 'trabbl:bbl : Compute bbl velocities and diffusive coefficients in ', cdtype 
     385         IF(lwp)  WRITE(numout,*) '~~~~~~~~~~' 
     386      ENDIF 
     387       
    379388      !                                        !* bottom temperature, salinity, velocity and depth 
    380       IF( ( cdtype == 'TRA' .AND. kt == nit000 ) .OR. ( cdtype == 'TRC' .AND. kt == nittrc000 ) )  THEN 
    381          IF(lwp)  WRITE(numout,*) ' ' 
    382          IF(lwp)  WRITE(numout,*) ' trabbl:bbl  : Compute bbl velocities and diffusive coefficients in ', cdtype 
    383          IF(lwp)  WRITE(numout,*) ' ' 
    384       ENDIF 
    385  
    386389#if defined key_vectopt_loop 
    387390      DO jj = 1, 1   ! vector opt. (forced unrolling) 
     
    392395#endif 
    393396            ik = mbkt(ji,jj)                        ! bottom T-level index 
    394             ztb (ji,jj) = tsb(ji,jj,ik,jp_tem)              ! bottom before T and S 
     397            ztb (ji,jj) = tsb(ji,jj,ik,jp_tem)      ! bottom before T and S 
    395398            zsb (ji,jj) = tsb(ji,jj,ik,jp_sal) 
    396399            zdep(ji,jj) = fsdept_0(ji,jj,ik)        ! bottom T-level reference depth 
     
    440443      ENDIF 
    441444 
    442  
    443445      !                                   !-------------------! 
    444446      IF( nn_bbl_adv /= 0 ) THEN          !   advective bbl   ! 
     
    477479               END DO 
    478480            END DO 
    479          ! 
     481            ! 
    480482         CASE( 2 )                                 != bbl velocity = F( delta rho ) 
    481483            zgbbl = grav * rn_gambbl 
     
    531533      !! 
    532534      !! ** Method  :   Read the nambbl namelist and check the parameters 
    533       !!      called by tra_bbl at the first timestep (nit000) 
     535      !!              called by tra_bbl at the first timestep (nit000) 
    534536      !!---------------------------------------------------------------------- 
    535537      INTEGER ::   ji, jj               ! dummy loop indices 
    536538      INTEGER ::   ii0, ii1, ij0, ij1   ! temporary integer 
    537539      REAL(wp), DIMENSION(jpi,jpj) ::   zmbk   ! 2D workspace  
    538  
     540      !! 
    539541      NAMELIST/nambbl/ nn_bbl_ldf, nn_bbl_adv, rn_ahtbbl, rn_gambbl 
    540542      !!---------------------------------------------------------------------- 
     
    634636   LOGICAL, PUBLIC, PARAMETER ::   lk_trabbl = .FALSE.   !: bbl flag 
    635637CONTAINS 
    636    SUBROUTINE tra_bbl( kt )              ! Empty routine 
     638   SUBROUTINE tra_bbl_init               ! Dummy routine 
     639   END SUBROUTINE tra_bbl_init 
     640   SUBROUTINE tra_bbl( kt )              ! Dummy routine 
    637641      WRITE(*,*) 'tra_bbl: You should not have seen this print! error?', kt 
    638642   END SUBROUTINE tra_bbl 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/TRA/tradmp.F90

    r2024 r2104  
    726726      WRITE(*,*) 'tra_dmp: You should not have seen this print! error?', kt 
    727727   END SUBROUTINE tra_dmp 
     728   SUBROUTINE tra_dmp_init        ! Empty routine 
     729   END SUBROUTINE tra_dmp_init 
    728730#endif 
    729731 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/TRA/traldf.F90

    r2082 r2104  
    99 
    1010   !!---------------------------------------------------------------------- 
    11    !!   tra_ldf     : update the tracer trend with the lateral diffusion 
    12    !!       ldf_ctl : initialization, namelist read, and parameters control 
    13    !!       ldf_ano : compute lateral diffusion for constant T-S profiles 
     11   !!   tra_ldf      : update the tracer trend with the lateral diffusion 
     12   !!   tra_ldf_init : initialization, namelist read, and parameters control 
     13   !!       ldf_ano  : compute lateral diffusion for constant T-S profiles 
    1414   !!---------------------------------------------------------------------- 
    1515   USE oce             ! ocean dynamics and tracers 
     
    3737   INTEGER ::   nldf = 0   ! type of lateral diffusion used defined from ln_traldf_... namlist logicals) 
    3838#if defined key_traldf_ano 
    39    REAL, DIMENSION(jpi,jpj,jpk) ::   t0_ldf, s0_ldf   ! lateral diffusion trends of T & S 
    40       !                                               ! for a constant vertical profile 
     39   REAL, DIMENSION(jpi,jpj,jpk) ::   t0_ldf, s0_ldf   ! lateral diffusion trends of T & S for a constant profile 
    4140#endif 
    4241 
     
    7372      CASE ( 1 )   ;   CALL tra_ldf_iso   ( kt, 'TRA', gtsu, gtsv, tsb, tsa, jpts, ahtb0 )  ! rotated laplacian  
    7473      CASE ( 2 )   ;   CALL tra_ldf_bilap ( kt, 'TRA', gtsu, gtsv, tsb, tsa, jpts        )  ! iso-level bilaplacian 
    75       CASE ( 3 )   ;   CALL tra_ldf_bilapg( kt, 'TRA',             tsb, tsa, jpts        )  ! s-coord. horizontal bilaplacian 
     74      CASE ( 3 )   ;   CALL tra_ldf_bilapg( kt, 'TRA',             tsb, tsa, jpts        )  ! s-coord. horizontal bilap. 
    7675         ! 
    7776      CASE ( -1 )                                     ! esopa: test all possibility with control print 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/TRA/traldf_bilap.F90

    r2082 r2104  
    44   !! Ocean  tracers:  horizontal component of the lateral tracer mixing trend 
    55   !!============================================================================== 
    6    !! History :     !  91-11  (G. Madec)  Original code 
    7    !!               93-03  (M. Guyon)  symetrical conditions 
    8    !!               95-11  (G. Madec)  suppress volumetric scale factors 
    9    !!               96-01  (G. Madec)  statement function for e3 
    10    !!               96-01  (M. Imbard)  mpp exchange 
    11    !!               97-07  (G. Madec)  optimization, and ahtt 
    12    !!          8.5  !  02-08  (G. Madec)  F90: Free form and module 
    13    !!          9.0  !  04-08  (C. Talandier) New trends organization 
    14    !!               !  05-11  (G. Madec)  zps or sco as default option 
    15    !!          3.3  !  10-05  (C. Ethe, G. Madec)  merge TRC-TRA  
     6   !! History :  OPA  !  1991-11  (G. Madec)  Original code 
     7   !!                 !  1993-03  (M. Guyon)  symetrical conditions 
     8   !!                 !  1995-11  (G. Madec)  suppress volumetric scale factors 
     9   !!                 !  1996-01  (G. Madec)  statement function for e3 
     10   !!                 !  1996-01  (M. Imbard)  mpp exchange 
     11   !!                 !  1997-07  (G. Madec)  optimization, and ahtt 
     12   !!            8.5  !  2002-08  (G. Madec)  F90: Free form and module 
     13   !!   NEMO     1.0  !  2004-08  (C. Talandier) New trends organization 
     14   !!             -   !  2005-11  (G. Madec)  zps or sco as default option 
     15   !!            3.3  !  2010-05  (C. Ethe, G. Madec)  merge TRC-TRA  
    1616   !!============================================================================== 
    1717 
     
    2020   !!                   using a iso-level biharmonic operator 
    2121   !!---------------------------------------------------------------------- 
    22    !! * Modules used 
    2322   USE oce             ! ocean dynamics and active tracers 
    2423   USE dom_oce         ! ocean space and time domain 
     
    3332   PRIVATE 
    3433 
    35    !! * Routine accessibility 
    36    PUBLIC tra_ldf_bilap   ! routine called by step.F90 
     34   PUBLIC   tra_ldf_bilap   ! routine called by step.F90 
    3735 
    3836   !! * Substitutions 
     
    4341   !!---------------------------------------------------------------------- 
    4442   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010)  
    45    !! $Id$  
    46    !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt  
     43   !! $Id$ 
     44   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    4745   !!---------------------------------------------------------------------- 
    4846 
     
    8078      USE oce         , ztv => va   ! use va as workspace 
    8179      !! 
    82       INTEGER         , INTENT(in   )                                ::   kt             ! ocean time-step index 
    83       CHARACTER(len=3), INTENT(in   )                                ::   cdtype         ! =TRA or TRC (tracer indicator) 
    84       INTEGER         , INTENT(in   )                                ::   kjpt            ! number of tracers 
    85       REAL(wp)        , INTENT(in   ), DIMENSION(jpi,jpj,kjpt  )     ::   pgu, pgv     ! tracer gradient at pstep levels 
    86       REAL(wp)        , INTENT(in   ), DIMENSION(jpi,jpj,jpk,kjpt)   ::   ptb          ! before and now tracer fields 
    87       REAL(wp)        , INTENT(inout), DIMENSION(jpi,jpj,jpk,kjpt)   ::   pta          ! tracer trend  
     80      INTEGER                              , INTENT(in   ) ::   kt         ! ocean time-step index 
     81      CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype     ! =TRA or TRC (tracer indicator) 
     82      INTEGER                              , INTENT(in   ) ::   kjpt       ! number of tracers 
     83      REAL(wp), DIMENSION(jpi,jpj,    kjpt), INTENT(in   ) ::   pgu, pgv   ! tracer gradient at pstep levels 
     84      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   ptb        ! before and now tracer fields 
     85      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pta        ! tracer trend  
    8886      !! 
    89       INTEGER  ::  ji, jj, jk, jn         ! dummy loop indices 
    90       INTEGER  ::  iku, ikv               ! temporary integers 
    91       REAL(wp) ::  zbtr, ztra             ! temporary scalars 
    92       REAL(wp), DIMENSION(jpi,jpj) ::   &  
    93          zeeu, zeev, zlt               ! 2D workspace 
     87      INTEGER  ::  ji, jj, jk, jn   ! dummy loop indices 
     88      INTEGER  ::  iku, ikv         ! local integers 
     89      REAL(wp) ::  zbtr, ztra       ! local scalars 
     90      REAL(wp), DIMENSION(jpi,jpj) ::   zeeu, zeev, zlt   ! 2D workspace 
    9491      !!---------------------------------------------------------------------- 
    9592 
    96       IF( ( cdtype == 'TRA' .AND. kt == nit000 ) .OR. ( cdtype == 'TRC' .AND. kt == nittrc000 ) )  THEN 
     93      IF( kt == nit000 )  THEN 
    9794         IF(lwp) WRITE(numout,*) 
    9895         IF(lwp) WRITE(numout,*) 'tra_ldf_bilap : iso-level biharmonic operator on ', cdtype 
     
    103100         !                                                       ! =========== 
    104101         !                                                
    105          DO jk = 1, jpkm1                                  
     102         DO jk = 1, jpkm1                                        ! Horizontal slab 
    106103            !                                              
    107              
    108             ! 0. Initialization of metric arrays (for z- or s-coordinates) 
    109             ! ---------------------------------- 
     104            !                          !==  Initialization of metric arrays (for z- or s-coordinates)  ==! 
    110105            DO jj = 1, jpjm1 
    111106               DO ji = 1, fs_jpim1   ! vector opt. 
     
    115110            END DO 
    116111 
    117  
    118             ! 1. Laplacian 
    119             ! ------------ 
    120              
    121             ! First derivative (gradient) 
    122             DO jj = 1, jpjm1 
     112            !                          !==  Laplacian  ==! 
     113            ! 
     114            DO jj = 1, jpjm1                 ! First derivative (gradient) 
    123115               DO ji = 1, fs_jpim1   ! vector opt. 
    124116                  ztu(ji,jj,jk) = zeeu(ji,jj) * ( ptb(ji+1,jj  ,jk,jn) - ptb(ji,jj,jk,jn) ) 
     
    126118               END DO 
    127119            END DO 
    128             IF( ln_zps ) THEN      ! set gradient at partial step level 
     120            IF( ln_zps ) THEN                ! set gradient at partial step level 
    129121               DO jj = 1, jpjm1 
    130122                  DO ji = 1, jpim1 
     
    137129               END DO 
    138130            ENDIF 
    139  
    140             ! Second derivative (divergence) multiply by the eddy diffusivity coefficient 
    141             DO jj = 2, jpjm1 
     131            DO jj = 2, jpjm1                 ! Second derivative (divergence) time the eddy diffusivity coefficient 
    142132               DO ji = fs_2, fs_jpim1   ! vector opt. 
    143133                  zbtr = 1.0 / ( e1t(ji,jj) * e2t(ji,jj) * fse3t(ji,jj,jk) ) 
    144                   zlt(ji,jj) = fsahtt(ji,jj,jk) & 
    145                      &                * zbtr * (  ztu(ji,jj,jk) - ztu(ji-1,jj,jk) + ztv(ji,jj,jk) - ztv(ji,jj-1,jk)  ) 
     134                  zlt(ji,jj) = fsahtt(ji,jj,jk) * zbtr * (   ztu(ji,jj,jk) - ztu(ji-1,jj,jk)   & 
     135                     &                                     + ztv(ji,jj,jk) - ztv(ji,jj-1,jk)   ) 
    146136               END DO 
    147137            END DO 
     138            CALL lbc_lnk( zlt, 'T', 1. )     ! Lateral boundary conditions (unchanged sgn) 
    148139 
    149             ! Lateral boundary conditions on the laplacian (zlt)   (unchanged sgn) 
    150             CALL lbc_lnk( zlt, 'T', 1. ) 
    151  
    152             ! 2. Bilaplacian 
    153             ! -------------- 
    154              
    155             ! third derivative (gradient) 
    156             DO jj = 1, jpjm1 
     140            !                          !==  Bilaplacian  ==! 
     141            ! 
     142            DO jj = 1, jpjm1                 ! third derivative (gradient) 
    157143               DO ji = 1, fs_jpim1   ! vector opt. 
    158144                  ztu(ji,jj,jk) = zeeu(ji,jj) * ( zlt(ji+1,jj  ) - zlt(ji,jj) ) 
     
    160146               END DO 
    161147            END DO 
    162  
    163             ! fourth derivative (divergence) and add to the general tracer trend 
    164             DO jj = 2, jpjm1 
     148            DO jj = 2, jpjm1                 ! fourth derivative (divergence) and add to the general tracer trend 
    165149               DO ji = fs_2, fs_jpim1   ! vector opt. 
    166150                  ! horizontal diffusive trends 
     
    171155               END DO 
    172156            END DO 
    173             !                                             ! =============== 
     157            !                                              
    174158         END DO                                           ! Horizontal slab 
    175          !                                                ! =============== 
     159         !                                                 
    176160         ! "zonal" mean lateral diffusive heat and salt transport 
    177161         IF( cdtype == 'TRA' .AND. ln_diaptr .AND. ( MOD( kt, nf_ptr ) == 0 ) ) THEN   
     
    179163           IF( jn == jp_sal )  pst_ldf(:) = ptr_vj( ztv(:,:,:) ) 
    180164         ENDIF 
    181          ! 
    182       END DO 
    183  
     165         !                                                ! =========== 
     166      END DO                                              ! tracer loop 
     167      !                                                   ! =========== 
    184168   END SUBROUTINE tra_ldf_bilap 
    185169 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/TRA/traldf_bilapg.F90

    r2082 r2104  
    1616   !!   ldfght         :  ??? 
    1717   !!---------------------------------------------------------------------- 
    18    !! * Modules used 
    1918   USE oce             ! ocean dynamics and tracers variables 
    2019   USE dom_oce         ! ocean space and time domain variables 
     
    2928   PRIVATE 
    3029 
    31    !! * Routine accessibility 
    32    PUBLIC tra_ldf_bilapg    ! routine called by step.F90 
     30   PUBLIC   tra_ldf_bilapg   ! routine called by step.F90 
    3331 
    3432   !! * Substitutions 
     
    3836   !!---------------------------------------------------------------------- 
    3937   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010)  
    40    !! $Id$  
     38   !! $Id$ 
    4139   !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt  
    4240   !!---------------------------------------------------------------------- 
     
    6866      !!               biharmonic mixing trend. 
    6967      !!---------------------------------------------------------------------- 
    70       !!* Arguments 
    7168      INTEGER         , INTENT(in   )                                ::   kt             ! ocean time-step index 
    7269      CHARACTER(len=3), INTENT(in   )                                ::   cdtype         ! =TRA or TRC (tracer indicator) 
    7370      INTEGER         , INTENT(in   )                                ::   kjpt            ! number of tracers 
    74       REAL(wp)        , INTENT(in   ), DIMENSION(jpi,jpj,jpk,kjpt)  ::   ptb          ! before and now tracer fields 
    75       REAL(wp)        , INTENT(inout), DIMENSION(jpi,jpj,jpk,kjpt)  ::   pta          ! tracer trend  
    76       !! * Local declarations 
     71      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   ptb          ! before and now tracer fields 
     72      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pta          ! tracer trend  
     73      !! 
    7774      INTEGER ::   ji, jj, jk, jn                 ! dummy loop indices 
    78       REAL(wp), DIMENSION(jpi,jpj,jpk,SIZE(ptb,4)) ::   & 
    79          wk1, wk2                ! work array used for rotated biharmonic 
    80          !                       ! operator on tracers and/or momentum 
    81       !!---------------------------------------------------------------------- 
    82  
    83       IF( ( cdtype == 'TRA' .AND. kt == nit000 ) .OR. ( cdtype == 'TRC' .AND. kt == nittrc000 ) )  THEN 
     75      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt) ::   wk1, wk2   ! 4D workspace 
     76      !!---------------------------------------------------------------------- 
     77 
     78      IF( kt == nit000 )  THEN 
    8479         IF(lwp) WRITE(numout,*) 
    8580         IF(lwp) WRITE(numout,*) 'tra_ldf_bilapg : horizontal biharmonic operator in s-coordinate on ', cdtype 
     
    9186      ! 1. Laplacian of ptb * aht 
    9287      ! -----------------------------  
    93       ! rotated harmonic operator applied to ptb and multiply by aht ; output in wk1  
    94  
    95       CALL ldfght( kt, cdtype, ptb, wk1, kjpt, 1 ) 
    96  
     88      CALL ldfght( kt, cdtype, ptb, wk1, kjpt, 1 )      ! rotated harmonic operator applied to ptb and multiply by aht  
     89      !                                                 ! output in wk1  
    9790      ! 
    9891      DO jn = 1, kjpt 
    99       ! Lateral boundary conditions on wk1   (unchanged sign) 
    100          CALL lbc_lnk( wk1(:,:,:,jn) , 'T', 1. ) 
     92         CALL lbc_lnk( wk1(:,:,:,jn) , 'T', 1. )        ! Lateral boundary conditions on wk1   (unchanged sign) 
    10193      END DO 
    10294 
    10395      ! 2. Bilaplacian of ptb 
    10496      ! ------------------------- 
    105       ! rotated harmonic operator applied to wk1 ; output in wk2 
    106  
    107       CALL ldfght( kt, cdtype, wk1, wk2, kjpt, 2 ) 
     97      CALL ldfght( kt, cdtype, wk1, wk2, kjpt, 2 )      ! rotated harmonic operator applied to wk1 ; output in wk2 
    10898 
    10999 
     
    167157      !! 
    168158      !!---------------------------------------------------------------------- 
    169       !!  
    170159      USE oce         , zftv => ua     ! use ua as workspace 
    171160      !! 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/TRA/traldf_iso.F90

    r2082 r2104  
    44   !! Ocean  tracers:  horizontal component of the lateral tracer mixing trend 
    55   !!====================================================================== 
    6    !! History :   OPA  !  1994-08  (G. Madec, M. Imbard) 
    7    !!                  !  1997-05  (G. Madec)  split into traldf and trazdf 
    8    !!             NEMO !  2002-08  (G. Madec)  Free form, F90 
    9    !!             1.0  !  2005-11  (G. Madec)  merge traldf and trazdf :-) 
    10    !!             3.0  !  2008-01  (C. Ethe, G. Madec) Merge TRA-TRC 
     6   !! History :  OPA  !  1994-08  (G. Madec, M. Imbard) 
     7   !!            8.0  !  1997-05  (G. Madec)  split into traldf and trazdf 
     8   !!            NEMO !  2002-08  (G. Madec)  Free form, F90 
     9   !!            1.0  !  2005-11  (G. Madec)  merge traldf and trazdf :-) 
     10   !!            3.3  !  2010-09  (C. Ethe, G. Madec) Merge TRA-TRC 
    1111   !!---------------------------------------------------------------------- 
    1212#if   defined key_ldfslp   ||   defined key_esopa 
    1313   !!---------------------------------------------------------------------- 
    1414   !!   'key_ldfslp'               slope of the lateral diffusive direction 
    15    !!---------------------------------------------------------------------- 
    1615   !!---------------------------------------------------------------------- 
    1716   !!   tra_ldf_iso  : update the tracer trend with the horizontal  
     
    4544   !!---------------------------------------------------------------------- 
    4645   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010)  
    47    !! $Id$  
     46   !! $Id$ 
    4847   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    4948   !!---------------------------------------------------------------------- 
     
    9291      !! ** Action :   Update pta arrays with the before rotated diffusion 
    9392      !!---------------------------------------------------------------------- 
    94       !!* Module used 
    9593      USE oce         , zftu => ua   ! use ua as workspace 
    9694      USE oce         , zftv => va   ! use va as workspace 
    97       !!* Arguments 
    98       INTEGER         , INTENT(in   )                                ::   kt             ! ocean time-step index 
    99       CHARACTER(len=3), INTENT(in   )                                ::   cdtype         ! =TRA or TRC (tracer indicator) 
    100       INTEGER         , INTENT(in   )                                ::   kjpt            ! number of tracers 
    101       REAL(wp)        , INTENT(in   ), DIMENSION(jpi,jpj,kjpt  )     ::   pgu, pgv     ! tracer gradient at pstep levels 
    102       REAL(wp)        , INTENT(in   ), DIMENSION(jpi,jpj,jpk,kjpt)   ::   ptb          ! before and now tracer fields 
    103       REAL(wp)        , INTENT(inout), DIMENSION(jpi,jpj,jpk,kjpt)   ::   pta          ! tracer trend  
    104       REAL(wp)        , INTENT(in   )                                ::   pahtb0         ! background diffusion coef 
    105       !!* Local declarations 
     95      !! 
     96      INTEGER                              , INTENT(in   ) ::   kt         ! ocean time-step index 
     97      CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype     ! =TRA or TRC (tracer indicator) 
     98      INTEGER                              , INTENT(in   ) ::   kjpt       ! number of tracers 
     99      REAL(wp), DIMENSION(jpi,jpj    ,kjpt), INTENT(in   ) ::   pgu, pgv   ! tracer gradient at pstep levels 
     100      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   ptb        ! before and now tracer fields 
     101      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pta        ! tracer trend  
     102      REAL(wp)                             , INTENT(in   ) ::   pahtb0     ! background diffusion coef 
     103      !! 
    106104      INTEGER  ::  ji, jj, jk,jn   ! dummy loop indices 
    107       INTEGER  ::  iku, ikv     ! temporary integer 
    108       REAL(wp) ::  zmsku, zabe1, zcof1, zcoef3   ! temporary scalars 
    109       REAL(wp) ::  zmskv, zabe2, zcof2, zcoef4   !    "         " 
    110       REAL(wp) ::  zcoef0, zbtr, ztra                           !    "         " 
     105      INTEGER  ::  iku, ikv        ! temporary integer 
     106      REAL(wp) ::  zmsku, zabe1, zcof1, zcoef3   ! local scalars 
     107      REAL(wp) ::  zmskv, zabe2, zcof2, zcoef4   !   -      - 
     108      REAL(wp) ::  zcoef0, zbtr, ztra            !   -      - 
    111109      REAL(wp), DIMENSION(jpi,jpj)     ::   zdkt, zdk1t         ! 2D workspace 
    112       REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zdit, zdjt, ztfw     ! 3D workspace 
     110      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zdit, zdjt, ztfw    ! 3D workspace 
    113111#if defined key_diaar5 
    114       REAL(wp), DIMENSION(jpi,jpj)     ::   z2d                  !  "         " 
    115       REAL(wp)                         ::   zztmp                !  "         " 
     112      REAL(wp), DIMENSION(jpi,jpj)     ::   z2d                 ! 2D workspace 
     113      REAL(wp)                         ::   zztmp               ! local scalar 
    116114#endif 
    117115      !!---------------------------------------------------------------------- 
    118116 
    119       IF( ( cdtype == 'TRA' .AND. kt == nit000 ) .OR. ( cdtype == 'TRC' .AND. kt == nittrc000 ) )  THEN 
     117      IF( kt == nit000 )  THEN 
    120118         IF(lwp) WRITE(numout,*) 
    121119         IF(lwp) WRITE(numout,*) 'tra_ldf_iso : rotated laplacian diffusion operator on ', cdtype 
     
    159157         !!   II - horizontal trend  (full) 
    160158         !!---------------------------------------------------------------------- 
    161           
    162159!CDIR PARALLEL DO PRIVATE( zdk1t )  
    163160         !                                                ! =============== 
     
    167164            ! ------------------------------------------------ 
    168165            ! surface boundary condition: zdkt(jk=1)=zdkt(jk=2) 
    169              
    170166            zdk1t(:,:) = ( ptb(:,:,jk,jn) - ptb(:,:,jk+1,jn) ) * tmask(:,:,jk+1) 
    171              
    172             IF( jk == 1 ) THEN 
    173                zdkt(:,:) = zdk1t(:,:) 
    174             ELSE 
    175                zdkt(:,:) = ( ptb(:,:,jk-1,jn) - ptb(:,:,jk,jn) ) * tmask(:,:,jk) 
     167            ! 
     168            IF( jk == 1 ) THEN   ;   zdkt(:,:) = zdk1t(:,:) 
     169            ELSE                 ;   zdkt(:,:) = ( ptb(:,:,jk-1,jn) - ptb(:,:,jk,jn) ) * tmask(:,:,jk) 
    176170            ENDIF 
    177171 
    178  
    179172            ! 2. Horizontal fluxes 
    180             ! -------------------- 
    181              
     173            ! --------------------    
    182174            DO jj = 1 , jpjm1 
    183175               DO ji = 1, fs_jpim1   ! vector opt. 
    184176                  zabe1 = ( fsahtu(ji,jj,jk) + pahtb0 ) * e2u(ji,jj) * fse3u(ji,jj,jk) / e1u(ji,jj) 
    185177                  zabe2 = ( fsahtv(ji,jj,jk) + pahtb0 ) * e1v(ji,jj) * fse3v(ji,jj,jk) / e2v(ji,jj) 
    186                    
     178                  ! 
    187179                  zmsku = 1. / MAX(  tmask(ji+1,jj,jk  ) + tmask(ji,jj,jk+1)   & 
    188180                     &             + tmask(ji+1,jj,jk+1) + tmask(ji,jj,jk  ), 1. ) 
    189                    
     181                  ! 
    190182                  zmskv = 1. / MAX(  tmask(ji,jj+1,jk  ) + tmask(ji,jj,jk+1)   & 
    191183                     &             + tmask(ji,jj+1,jk+1) + tmask(ji,jj,jk  ), 1. ) 
    192                    
     184                  ! 
    193185                  zcof1 = - fsahtu(ji,jj,jk) * e2u(ji,jj) * uslp(ji,jj,jk) * zmsku 
    194186                  zcof2 = - fsahtv(ji,jj,jk) * e1v(ji,jj) * vslp(ji,jj,jk) * zmskv 
     
    202194               END DO 
    203195            END DO 
    204  
    205196 
    206197            ! II.4 Second derivative (divergence) and add to the general trend 
     
    216207         END DO                                        !   End of slab   
    217208         !                                             ! =============== 
    218          ! "Poleward" diffusive heat or salt transports 
     209         ! 
     210         ! "Poleward" diffusive heat or salt transports (T-S case only) 
    219211         IF( cdtype == 'TRA' .AND. ln_diaptr .AND. ( MOD( kt, nf_ptr ) == 0 ) ) THEN 
    220212            IF( jn == jp_tem)   pht_ldf(:) = ptr_vj( zftv(:,:,:) ) 
     
    229221               DO jj = 2, jpjm1 
    230222                  DO ji = fs_2, fs_jpim1   ! vector opt. 
    231                      z2d(ji,jj) = z2d(ji,jj) + zztmp * zftu(ji,jj,jk)   & 
    232             &                    * ( ptn(ji,jj,jk,jn) + ptn(ji+1,jj,jk,jn) ) * e1u(ji,jj) * fse3u(ji,jj,jk)  
     223                     z2d(ji,jj) = z2d(ji,jj) + zztmp * zftu(ji,jj,jk)       & 
     224                        &       * ( ptn(ji,jj,jk,jn) + ptn(ji+1,jj,jk,jn) ) * e1u(ji,jj) * fse3u(ji,jj,jk)  
    233225                  END DO 
    234226               END DO 
     
    240232               DO jj = 2, jpjm1 
    241233                  DO ji = fs_2, fs_jpim1   ! vector opt. 
    242                      z2d(ji,jj) = z2d(ji,jj) + zztmp * zftv(ji,jj,jk)   & 
    243            &                   * ( ptn(ji,jj,jk,jn) + ptn(ji,jj+1,jk,jn) ) * e2v(ji,jj) * fse3v(ji,jj,jk)  
     234                     z2d(ji,jj) = z2d(ji,jj) + zztmp * zftv(ji,jj,jk)       & 
     235                        &       * ( ptn(ji,jj,jk,jn) + ptn(ji,jj+1,jk,jn) ) * e2v(ji,jj) * fse3v(ji,jj,jk)  
    244236                  END DO 
    245237               END DO 
     
    269261               DO ji = fs_2, fs_jpim1   ! vector opt. 
    270262                  zcoef0 = - fsahtw(ji,jj,jk) * tmask(ji,jj,jk) 
    271                    
     263                  ! 
    272264                  zmsku = 1./MAX(   umask(ji  ,jj,jk-1) + umask(ji-1,jj,jk)      & 
    273265                     &            + umask(ji-1,jj,jk-1) + umask(ji  ,jj,jk), 1.  ) 
    274                    
    275266                  zmskv = 1./MAX(   vmask(ji,jj  ,jk-1) + vmask(ji,jj-1,jk)      & 
    276267                     &            + vmask(ji,jj-1,jk-1) + vmask(ji,jj  ,jk), 1.  ) 
    277                    
     268                  ! 
    278269                  zcoef3 = zcoef0 * e2t(ji,jj) * zmsku * wslpi (ji,jj,jk) 
    279270                  zcoef4 = zcoef0 * e1t(ji,jj) * zmskv * wslpj (ji,jj,jk) 
    280                    
     271                  ! 
    281272                  ztfw(ji,jj,jk) = zcoef3 * (   zdit(ji  ,jj  ,jk-1) + zdit(ji-1,jj  ,jk)      & 
    282273                     &                        + zdit(ji-1,jj  ,jk-1) + zdit(ji  ,jj  ,jk)  )   & 
     
    290281         ! I.5 Divergence of vertical fluxes added to the general tracer trend 
    291282         ! ------------------------------------------------------------------- 
    292           
    293283         DO jk = 1, jpkm1 
    294284            DO jj = 2, jpjm1 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/TRA/traldf_lap.F90

    r2082 r2104  
    1313   !!            3.0  !  10-06  (C. Ethe, G. Madec) Merge TRA-TRC 
    1414   !!---------------------------------------------------------------------- 
     15 
    1516   !!---------------------------------------------------------------------- 
    1617   !!   tra_ldf_lap  : update the tracer trend with the horizontal diffusion 
    1718   !!                 using a iso-level harmonic (laplacien) operator. 
    1819   !!---------------------------------------------------------------------- 
    19    !! * Modules used 
    2020   USE oce             ! ocean dynamics and active tracers 
    2121   USE dom_oce         ! ocean space and time domain 
     
    2525   USE trc_oce         ! share passive tracers/Ocean variables 
    2626 
    27  
    2827   IMPLICIT NONE 
    2928   PRIVATE 
    3029 
    31    !! * Routine accessibility 
    32    PUBLIC tra_ldf_lap  ! routine called by step.F90 
     30   PUBLIC   tra_ldf_lap   ! routine called by step.F90 
    3331 
    3432   REAL(wp), DIMENSION(jpi,jpj) ::   e1ur, e2vr   ! scale factor coefficients 
     
    4038   !!---------------------------------------------------------------------- 
    4139   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010)  
    42    !! $Id$  
     40   !! $Id$ 
    4341   !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt  
    4442   !!---------------------------------------------------------------------- 
     
    4644CONTAINS 
    4745 
    48    SUBROUTINE tra_ldf_lap( kt, cdtype, pgu, pgv,  & 
     46   SUBROUTINE tra_ldf_lap( kt, cdtype, pgu, pgv,   & 
    4947      &                                ptb, pta, kjpt )  
    5048      !!---------------------------------------------------------------------- 
     
    6866      !!                harmonic mixing trend. 
    6967      !!---------------------------------------------------------------------- 
    70       !! 
    7168      USE oce         , ztu => ua   ! use ua as workspace 
    7269      USE oce         , ztv => va   ! use va as workspace 
    7370      !! 
    74       INTEGER         , INTENT(in   )                                ::   kt             ! ocean time-step index 
    75       CHARACTER(len=3), INTENT(in   )                                ::   cdtype         ! =TRA or TRC (tracer indicator) 
    76       INTEGER         , INTENT(in   )                                ::   kjpt            ! number of tracers 
    77       REAL(wp)        , INTENT(in   ), DIMENSION(jpi,jpj,kjpt  )     ::   pgu, pgv     ! tracer gradient at pstep levels 
    78       REAL(wp)        , INTENT(in   ), DIMENSION(jpi,jpj,jpk,kjpt)   ::   ptb          ! before and now tracer fields 
    79       REAL(wp)        , INTENT(inout), DIMENSION(jpi,jpj,jpk,kjpt)   ::   pta          ! tracer trend  
     71      INTEGER                              , INTENT(in   ) ::   kt         ! ocean time-step index 
     72      CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype     ! =TRA or TRC (tracer indicator) 
     73      INTEGER                              , INTENT(in   ) ::   kjpt       ! number of tracers 
     74      REAL(wp), DIMENSION(jpi,jpj    ,kjpt), INTENT(in   ) ::   pgu, pgv   ! tracer gradient at pstep levels 
     75      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   ptb        ! before and now tracer fields 
     76      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pta        ! tracer trend  
    8077      !! 
    81       INTEGER ::   ji, jj, jk, jn          ! dummy loop indices 
    82       INTEGER ::   iku, ikv                ! temporary integers 
    83       REAL(wp) ::   & 
    84          zabe1, zabe2, ztra, zbtr           ! temporary scalars 
     78      INTEGER  ::   ji, jj, jk, jn       ! dummy loop indices 
     79      INTEGER  ::   iku, ikv             ! local integers 
     80      REAL(wp) ::   zabe1, zabe2, zbtr   ! local scalars 
    8581      !!---------------------------------------------------------------------- 
    8682       
    87       IF( ( cdtype == 'TRA' .AND. kt == nit000 ) .OR. ( cdtype == 'TRC' .AND. kt == nittrc000 ) )  THEN 
     83      IF( kt == nit000 )  THEN 
    8884         IF(lwp) WRITE(numout,*) 
    8985         IF(lwp) WRITE(numout,*) 'tra_ldf_lap : iso-level laplacian diffusion on ', cdtype 
     
    9389      ENDIF 
    9490 
    95       ! 
    96       DO jn = 1, kjpt                                            ! tracer loop 
    97          !                                                       ! ===========       
    98          !                                                  
    99          DO jk = 1, jpkm1                                 
     91      !                                                          ! =========== ! 
     92      DO jn = 1, kjpt                                            ! tracer loop ! 
     93         !                                                       ! =========== !     
     94         DO jk = 1, jpkm1                                            ! slab loop 
    10095            !                                            
    10196            ! 1. First derivative (gradient) 
     
    133128               DO ji = fs_2, fs_jpim1   ! vector opt. 
    134129                  zbtr = 1.0 / ( e1t(ji,jj) * e2t(ji,jj) * fse3t(ji,jj,jk) ) 
    135                   ! horizontal diffusive trends 
    136                   ztra = zbtr * (  ztu(ji,jj,jk) - ztu(ji-1,jj,jk)   & 
    137                      &           + ztv(ji,jj,jk) - ztv(ji,jj-1,jk)  ) 
    138                   ! add it to the general tracer trends 
    139                   pta(ji,jj,jk,jn) = pta(ji,jj,jk,jn) + ztra 
     130                  ! horizontal diffusive trends added to the general tracer trends 
     131                  pta(ji,jj,jk,jn) = pta(ji,jj,jk,jn) + zbtr * (  ztu(ji,jj,jk) - ztu(ji-1,jj,jk)   & 
     132                     &                                          + ztv(ji,jj,jk) - ztv(ji,jj-1,jk)  ) 
    140133               END DO 
    141134            END DO 
    142             !                                               ! ============= 
     135            ! 
    143136         END DO                                             !  End of slab   
    144          !                                                  ! ============= 
     137         ! 
    145138         ! "Poleward" diffusive heat or salt transports 
    146139         IF( cdtype == 'TRA' .AND. ln_diaptr .AND. ( MOD( kt, nf_ptr ) == 0 ) ) THEN 
     
    148141            IF( jn  == jp_sal)   pst_ldf(:) = ptr_vj( ztv(:,:,:) ) 
    149142         ENDIF 
    150          ! 
    151       END DO 
    152       ! 
     143         !                                                  ! ================== 
     144      END DO                                                ! end of tracer loop 
     145      !                                                     ! ================== 
    153146   END SUBROUTINE tra_ldf_lap 
    154147 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/TRA/tranpc.F90

    r2082 r2104  
    88   !!   NEMO     1.0  ! 2002-06  (G. Madec)  free form F90 
    99   !!            3.0  ! 2008-06  (G. Madec)  applied on ta, sa and called before tranxt in step.F90 
     10   !!            3.3  ! 2010-05  (C. Ethe, G. Madec)  merge TRC-TRA 
    1011   !!---------------------------------------------------------------------- 
    1112 
     
    5556      !! References : Madec, et al., 1991, JPO, 21, 9, 1349-1371. 
    5657      !!---------------------------------------------------------------------- 
    57       !!  
    5858      INTEGER, INTENT(in) ::   kt   ! ocean time-step index 
    5959      !! 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/TRA/tranxt.F90

    r2083 r2104  
    1515   !!            3.0  !  2008-06  (G. Madec)  time stepping always done in trazdf 
    1616   !!            3.1  !  2009-02  (G. Madec, R. Benshila)  re-introduce the vvl option 
     17   !!            3.3  !  2010-05  (C. Ethe, G. Madec)  merge TRC-TRA 
    1718   !!---------------------------------------------------------------------- 
    1819 
     
    8788      !! 
    8889      INTEGER  ::   jk    ! dummy loop indices 
    89       REAL(wp) ::   zfact ! temporary scalars 
     90      REAL(wp) ::   zfact ! local scalars 
    9091      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  ztrdt, ztrds 
    91  
    9292      !!---------------------------------------------------------------------- 
    9393 
     
    131131 
    132132      ! Leap-Frog + Asselin filter time stepping 
    133       IF( lk_vvl )   THEN   ;   CALL tra_nxt_vvl( kt, nit000, tsb, tsn, tsa, jpts )  ! variable volume level (vvl)      
    134       ELSE                  ;   CALL tra_nxt_fix( kt, nit000, tsb, tsn, tsa, jpts )  ! fixed    volume level  
     133      IF( lk_vvl )   THEN   ;   CALL tra_nxt_vvl( kt, tsb, tsn, tsa, jpts )  ! variable volume level (vvl)      
     134      ELSE                  ;   CALL tra_nxt_fix( kt, tsb, tsn, tsa, jpts )  ! fixed    volume level  
    135135      ENDIF 
    136136 
     
    160160   END SUBROUTINE tra_nxt 
    161161 
    162    SUBROUTINE tra_nxt_fix( kt, kit000,                    & 
    163       &                               ptb, ptn, pta, kjpt ) 
     162 
     163   SUBROUTINE tra_nxt_fix( kt, ptb, ptn, pta, kjpt ) 
    164164      !!---------------------------------------------------------------------- 
    165165      !!                   ***  ROUTINE tra_nxt_fix  *** 
     
    184184      !!---------------------------------------------------------------------- 
    185185      INTEGER , INTENT(in   )                               ::  kt            ! ocean time-step index 
    186       INTEGER , INTENT(in   )                               ::  kit000        ! first time-step index 
    187186      INTEGER , INTENT(in   )                               ::  kjpt            ! number of tracers 
    188187      REAL(wp), INTENT(inout), DIMENSION(jpi,jpj,jpk,kjpt)  ::  ptb  ! before tracer fields 
     
    194193      !!---------------------------------------------------------------------- 
    195194 
    196       IF( kt == kit000 )  THEN 
     195      IF( kt == nit000 )  THEN 
    197196         IF(lwp) WRITE(numout,*) 
    198197         IF(lwp) WRITE(numout,*) 'tra_nxt_fix : time stepping' 
     
    204203         !                                           ! ----------------------- ! 
    205204         ! 
    206          IF( neuler == 0 .AND. kt == kit000 ) THEN        ! Euler time-stepping at first time-step 
     205         IF( neuler == 0 .AND. kt == nit000 ) THEN        ! Euler time-stepping at first time-step 
    207206            !                                             ! (only swap) 
    208207            DO jn = 1, kjpt 
     
    234233         !                                           ! ----------------------- ! 
    235234         ! 
    236          IF( neuler == 0 .AND. kt == kit000 ) THEN        ! Euler time-stepping at first time-step 
     235         IF( neuler == 0 .AND. kt == nit000 ) THEN        ! Euler time-stepping at first time-step 
    237236            DO jn = 1, kjpt 
    238237               DO jk = 1, jpkm1 
     
    262261   END SUBROUTINE tra_nxt_fix 
    263262 
    264    SUBROUTINE tra_nxt_vvl( kt, kit000,                    & 
    265       &                               ptb, ptn, pta, kjpt ) 
     263 
     264   SUBROUTINE tra_nxt_vvl( kt, ptb, ptn, pta, kjpt ) 
    266265      !!---------------------------------------------------------------------- 
    267266      !!                   ***  ROUTINE tra_nxt_vvl  *** 
     
    288287      !!---------------------------------------------------------------------- 
    289288      INTEGER , INTENT(in   )                               ::  kt            ! ocean time-step index 
    290       INTEGER , INTENT(in   )                               ::  kit000        ! first time-step index 
    291289      INTEGER , INTENT(in   )                               ::  kjpt            ! number of tracers 
    292290      REAL(wp), INTENT(inout), DIMENSION(jpi,jpj,jpk,kjpt)  ::  ptb  ! before tracer fields 
     
    300298      !!---------------------------------------------------------------------- 
    301299 
    302       IF( kt == kit000 ) THEN 
     300      IF( kt == nit000 ) THEN 
    303301         IF(lwp) WRITE(numout,*) 
    304302         IF(lwp) WRITE(numout,*) 'tra_nxt_vvl : time stepping' 
     
    310308         !                                           ! ----------------------- ! 
    311309         ! 
    312          IF( neuler == 0 .AND. kt == kit000 ) THEN        ! Euler time-stepping at first time-step 
     310         IF( neuler == 0 .AND. kt == nit000 ) THEN        ! Euler time-stepping at first time-step 
    313311            DO jn = 1, kjpt                               ! (only swap) 
    314312               DO jk = 1, jpkm1                               
     
    358356         !                                           ! ----------------------- ! 
    359357         ! 
    360          IF( neuler == 0 .AND. kt == kit000 ) THEN        ! case of Euler time-stepping at first time-step 
     358         IF( neuler == 0 .AND. kt == nit000 ) THEN        ! case of Euler time-stepping at first time-step 
    361359            DO jn = 1, kjpt                               ! No filter nor thickness weighting computation required     
    362360               DO jk = 1, jpkm1                           ! ONLY swap                         
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/TRA/trasbc.F90

    r2052 r2104  
    44   !! Ocean active tracers:  surface boundary condition 
    55   !!============================================================================== 
    6    !! History :  8.2  !  98-10  (G. Madec, G. Roullet, M. Imbard)  Original code 
    7    !!            8.2  !  01-02  (D. Ludicone)  sea ice and free surface 
    8    !!            8.5  !  02-06  (G. Madec)  F90: Free form and module 
     6   !! History :  OPA  !  1998-10  (G. Madec, G. Roullet, M. Imbard)  Original code 
     7   !!            8.2  !  2001-02  (D. Ludicone)  sea ice and free surface 
     8   !!  NEMO      1.0  !  2002-06  (G. Madec)  F90: Free form and module 
     9   !!            3.3  !  2010-09  (C. Ethe, G. Madec) Merge TRA-TRC 
    910   !!---------------------------------------------------------------------- 
    1011 
     
    3334#  include "vectopt_loop_substitute.h90" 
    3435   !!---------------------------------------------------------------------- 
    35    !!   OPA 9.0 , LOCEAN-IPSL (2005)  
     36   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010)  
    3637   !! $Id$ 
    3738   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
     
    100101      !!              - save the trend it in ttrd ('key_trdtra') 
    101102      !!---------------------------------------------------------------------- 
    102       !! 
    103       INTEGER, INTENT(in) ::   kt     ! ocean time-step index 
    104       !! 
    105       INTEGER  ::   ji, jj, jk           ! dummy loop indices   
    106       REAL(wp) ::   zta, zsa             ! temporary scalars, adjustment to temperature and salinity   
    107       REAL(wp) ::   zata, zasa           ! temporary scalars, calculations of automatic change to temp & sal due to vvl (done elsewhere)   
    108       REAL(wp) ::   zsrau, zse3t, zdep   ! temporary scalars, 1/density, 1/height of box, 1/height of effected water column   
     103      INTEGER, INTENT(in) ::   kt   ! ocean time-step index 
     104      !! 
     105      INTEGER  ::   ji, jj, jk      ! dummy loop indices   
     106      REAL(wp) ::   zta, zsa        ! local scalars, adjustment to temperature and salinity   
     107      REAL(wp) ::   zata, zasa      ! local scalars, calculations of automatic change to temp & sal due to vvl (done elsewhere)   
     108      REAL(wp) ::   zsrau, zse3t, zdep   ! local scalars, 1/density, 1/height of box, 1/height of effected water column   
    109109      REAL(wp) ::   zdheat, zdsalt       ! total change of temperature and salinity   
    110110      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  ztrdt, ztrds 
     
    136136#endif 
    137137            IF( lk_vvl) THEN 
    138                zta =  ro0cpr * qns(ji,jj) * zse3t &                  ! temperature : heat flux  
    139                 &    - emp(ji,jj) * zsrau * tsn(ji,jj,1,jp_tem) * zse3t      ! & cooling/heating effet of EMP flux  
    140                zsa = ( emps(ji,jj) - emp(ji,jj) ) & 
    141                 &                 * zsrau * tsn(ji,jj,1,jp_sal) * zse3t     ! concent./dilut. effect due to sea-ice  
    142                                                                      ! melt/formation and (possibly) SSS restoration 
     138               ! temperature : heat flux and heat content of EMP flux 
     139               zta = ( ro0cpr * qns(ji,jj) - emp(ji,jj) * zsrau * tsn(ji,jj,1,jp_tem) ) * zse3t 
     140               ! Salinity    : concent./dilut. effect due to sea-ice melt/formation and (possibly) SSS restoration 
     141               zsa = ( emps(ji,jj) - emp(ji,jj) ) * zsrau * tsn(ji,jj,1,jp_sal) * zse3t 
    143142            ELSE 
    144                zta =  ro0cpr * qns(ji,jj) * zse3t                    ! temperature : heat flux  
    145                zsa =  emps(ji,jj) * zsrau * tsn(ji,jj,1,jp_sal) * zse3t      ! salinity :  concent./dilut. effect  
     143               zta =  ro0cpr * qns(ji,jj) * zse3t                         ! temperature : heat flux  
     144               zsa =  emps(ji,jj) * zsrau * tsn(ji,jj,1,jp_sal) * zse3t   ! salinity :  concent./dilut. effect  
    146145            ENDIF 
    147146            tsa(ji,jj,1,jp_tem) = tsa(ji,jj,1,jp_tem) + zta                  ! add the trend to the general tracer trend 
     
    150149      END DO 
    151150 
    152       IF ( ln_rnf .AND. ln_rnf_att ) THEN   
    153         ! Concentration / dilution effect on (t,s) due to river runoff   
     151      IF( ln_rnf .AND. ln_rnf_att ) THEN        ! Concentration / dilution effect on (t,s) due to river runoff   
    154152        DO jj = 1, jpj   
    155153           DO ji = 1, jpi   
    156               rnf_dep(ji,jj) = 0.   
     154              rnf_dep(ji,jj) = 0.e0  
    157155              DO jk = 1, rnf_mod_dep(ji,jj)                          ! recalculates rnf_dep to be the depth   
    158156                rnf_dep(ji,jj) = rnf_dep(ji,jj) + fse3t(ji,jj,jk)    ! in metres to the bottom of the relevant grid box   
    159               ENDDO   
     157              END DO   
    160158              zdep = 1. / rnf_dep(ji,jj)   
    161159              zse3t= 1. / fse3t(ji,jj,1)   
    162               IF ( rnf_tmp(ji,jj) == -999 )   rnf_tmp(ji,jj) = tsn(ji,jj,1,jp_tem)    ! if not specified set runoff temp to be sst   
    163    
    164               IF ( rnf(ji,jj) > 0.0 ) THEN   
     160              IF( rnf_tmp(ji,jj) == -999 )   rnf_tmp(ji,jj) = tsn(ji,jj,1,jp_tem)   ! if not specified set runoff temp to be sst   
     161   
     162              IF( rnf(ji,jj) > 0.e0 ) THEN   
    165163   
    166164                IF( lk_vvl ) THEN   
    167165                  ! indirect flux, concentration or dilution effect : force a dilution effect in all levels  
    168                   zdheat = 0. 
    169                   zdsalt = 0. 
     166                  zdheat = 0.e 
     167                  zdsalt = 0.e 
    170168                  DO jk = 1, rnf_mod_dep(ji,jj)   
    171169                    zta = -tsn(ji,jj,jk,jp_tem) * rnf(ji,jj) * zsrau * zdep   
    172170                    zsa = -tsn(ji,jj,jk,jp_sal) * rnf(ji,jj) * zsrau * zdep   
    173                     tsa(ji,jj,jk,jp_tem) = tsa(ji,jj,jk,jp_tem) + zta                  ! add the trend to the general tracer trend 
     171                    tsa(ji,jj,jk,jp_tem) = tsa(ji,jj,jk,jp_tem) + zta        ! add the trend to the general tracer trend 
    174172                    tsa(ji,jj,jk,jp_sal) = tsa(ji,jj,jk,jp_sal) + zsa 
    175173                    zdheat = zdheat + zta * fse3t(ji,jj,jk)   
    176174                    zdsalt = zdsalt + zsa * fse3t(ji,jj,jk)   
    177                   ENDDO   
    178                   ! negate this total change in heat and salt content from top level   
     175                  END DO   
     176                  ! negate this total change in heat and salt content from top level    !!gm I don't understand this 
    179177                  zta = -zdheat * zse3t   
    180178                  zsa = -zdsalt * zse3t   
    181                   tsa(ji,jj,1,jp_tem) = tsa(ji,jj,1,jp_tem) + zta                  ! add the trend to the general tracer trend 
     179                  tsa(ji,jj,1,jp_tem) = tsa(ji,jj,1,jp_tem) + zta            ! add the trend to the general tracer trend 
    182180                  tsa(ji,jj,1,jp_sal) = tsa(ji,jj,1,jp_sal) + zsa 
    183181     
     
    187185     
    188186                  DO jk = 1, rnf_mod_dep(ji,jj)   
    189                     tsa(ji,jj,jk,jp_tem) = tsa(ji,jj,jk,jp_tem) + zta                  ! add the trend to the general tracer trend 
     187                    tsa(ji,jj,jk,jp_tem) = tsa(ji,jj,jk,jp_tem) + zta        ! add the trend to the general tracer trend 
    190188                    tsa(ji,jj,jk,jp_sal) = tsa(ji,jj,jk,jp_sal) + zsa 
    191                   ENDDO   
    192     
     189                  END DO   
    193190                ELSE   
    194191                  DO jk = 1, rnf_mod_dep(ji,jj)   
    195192                    zta = ( rnf_tmp(ji,jj) - tsn(ji,jj,jk,jp_tem) ) * rnf(ji,jj) * zsrau * zdep   
    196193                    zsa = ( rnf_sal(ji,jj) - tsn(ji,jj,jk,jp_sal) ) * rnf(ji,jj) * zsrau * zdep   
    197                     tsa(ji,jj,jk,jp_tem) = tsa(ji,jj,jk,jp_tem) + zta                  ! add the trend to the general tracer trend 
     194                    tsa(ji,jj,jk,jp_tem) = tsa(ji,jj,jk,jp_tem) + zta        ! add the trend to the general tracer trend 
    198195                    tsa(ji,jj,jk,jp_sal) = tsa(ji,jj,jk,jp_sal) + zsa 
    199                   ENDDO   
     196                  END DO   
    200197                ENDIF   
    201198   
    202               ELSE IF( rnf(ji,jj) < 0.) THEN   ! for use in baltic when flow is out of domain, want no change in temp and sal   
     199              ELSEIF( rnf(ji,jj) < 0.e0) THEN   ! for use in baltic when flow is out of domain, want no change in temp and sal   
    203200   
    204201                IF( lk_vvl ) THEN   
     
    212209              ENDIF   
    213210   
    214            ENDDO   
    215         ENDDO   
    216  
    217       ELSE IF( ln_rnf ) THEN 
    218  
    219       ! Concentration dilution effect on (t,s) due to runoff without temperatue, salinity and depth attributes 
     211           END DO   
     212        END DO   
     213 
     214      ELSE IF( ln_rnf ) THEN      ! Concentration dilution effect on (t,s) due to runoff without T, S and depth attributes 
     215 
     216 
    220217        DO jj = 2, jpj 
    221218           DO ji = fs_2, fs_jpim1   ! vector opt. 
     
    225222              IF( lk_vvl) THEN 
    226223                 zta =    rnf(ji,jj) * zsrau * tsn(ji,jj,1,jp_tem) * zse3t       ! & cooling/heating effect of runoff 
    227                  zsa =    0.e0                                            ! No salinity concent./dilut. effect 
     224                 zsa =    0.e0                                                   ! No salinity concent./dilut. effect 
    228225              ELSE 
    229226                 zta =    0.0                                            ! temperature : heat flux  
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/TRA/traswp.F90

    r2034 r2104  
    44   !! Ocean active tracers: swapping array  
    55   !!============================================================================== 
    6    USE par_oce 
     6   USE par_oce         ! ocean parameters 
    77   USE oce             ! ocean dynamics and active tracers 
    88 
     
    1515   !!---------------------------------------------------------------------- 
    1616   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010)  
    17    !! $Id: traswap.F90 2024 2010-07-29 10:57:35Z cetlod $  
     17   !! $Id: $  
    1818   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    1919   !!---------------------------------------------------------------------- 
     
    2828      !! 
    2929      !!---------------------------------------------------------------------- 
    30  
     30      ! 
    3131      tsn(:,:,:,jp_tem) = tn(:,:,:)      ;      tsn(:,:,:,jp_sal) = sn(:,:,:) 
    3232      tsb(:,:,:,jp_tem) = tb(:,:,:)      ;      tsb(:,:,:,jp_sal) = sb(:,:,:) 
    3333      tsa(:,:,:,jp_tem) = ta(:,:,:)      ;      tsa(:,:,:,jp_sal) = sa(:,:,:) 
    34  
     34      ! 
    3535   END SUBROUTINE tra_swap 
    3636 
     
    4242      !! 
    4343      !!---------------------------------------------------------------------- 
    44  
     44      ! 
    4545      tn(:,:,:) = tsn(:,:,:,jp_tem)      ;      sn(:,:,:) = tsn(:,:,:,jp_sal) 
    4646      tb(:,:,:) = tsb(:,:,:,jp_tem)      ;      sb(:,:,:) = tsb(:,:,:,jp_sal) 
    4747      ta(:,:,:) = tsa(:,:,:,jp_tem)      ;      sa(:,:,:) = tsa(:,:,:,jp_sal) 
    48  
     48      ! 
    4949   END SUBROUTINE tra_unswap 
    5050 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/TRA/trazdf.F90

    r2082 r2104  
    44   !! Ocean active tracers:  vertical component of the tracer mixing trend 
    55   !!============================================================================== 
    6    !! History :  9.0  ! 2005-11  (G. Madec)  Original code 
    7    !!       NEMO 3.0  ! 2008-01  (C. Ethe, G. Madec)  merge TRC-TRA 
     6   !! History :  1.0  ! 2005-11  (G. Madec)  Original code 
     7   !!           3.0  ! 2008-01  (C. Ethe, G. Madec)  merge TRC-TRA 
    88   !!---------------------------------------------------------------------- 
    99 
    1010   !!---------------------------------------------------------------------- 
    1111   !!   tra_zdf      : Update the tracer trend with the vertical diffusion 
    12    !!       zdf_ctl  : ??? 
     12   !!   tra_zdf_init : initialisation of the computation 
    1313   !!---------------------------------------------------------------------- 
    1414   USE oce             ! ocean dynamics and tracers variables 
     
    4747#  include "vectopt_loop_substitute.h90" 
    4848   !!---------------------------------------------------------------------- 
    49    !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010) 
     49   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010)  
    5050   !! $Id$ 
    5151   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
     
    6161      !!--------------------------------------------------------------------- 
    6262      INTEGER, INTENT( in ) ::   kt      ! ocean time-step index 
    63  
     63      !! 
    6464      INTEGER  ::   jk                   ! Dummy loop indices 
    6565      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   ztrdt, ztrds   ! 3D workspace 
     
    124124      !!---------------------------------------------------------------------- 
    125125 
    126       !  Define the vertical tracer physics scheme 
    127       ! ========================================== 
    128  
    129126      ! Choice from ln_zdfexp already read in namelist in zdfini module 
    130       IF( ln_zdfexp ) THEN               ! use explicit scheme 
    131          nzdf = 0 
    132       ELSE                               ! use implicit scheme 
    133          nzdf = 1 
     127      IF( ln_zdfexp ) THEN   ;   nzdf = 0           ! use explicit scheme 
     128      ELSE                   ;   nzdf = 1           ! use implicit scheme 
    134129      ENDIF 
    135130 
     
    138133      IF( ln_traldf_iso                               )   nzdf = 1      ! iso-neutral lateral physics 
    139134      IF( ln_traldf_hor .AND. ln_sco                  )   nzdf = 1      ! horizontal lateral physics in s-coordinate 
    140  
    141       IF( ln_zdfexp .AND. nzdf == 1 )   THEN 
    142          CALL ctl_stop( 'tra_zdf : If using the rotation of lateral mixing operator or TKE ', & 
    143             &           '          or KPP scheme, the implicit scheme is required, set ln_zdfexp = .false.' ) 
    144       ENDIF 
     135      IF( ln_zdfexp .AND. nzdf == 1 )   CALL ctl_stop( 'tra_zdf : If using the rotation of lateral mixing operator',   & 
     136            &                         ' TKE or KPP scheme, the implicit scheme is required, set ln_zdfexp = .false.' ) 
    145137 
    146138      ! Test: esopa 
     
    155147         IF( nzdf ==  1 )   WRITE(numout,*) '              Implicit (euler backward) scheme' 
    156148      ENDIF 
    157  
     149      ! 
    158150   END SUBROUTINE tra_zdf_init 
    159151 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/TRA/trazdf_exp.F90

    r2082 r2104  
    4141#  include "vectopt_loop_substitute.h90" 
    4242   !!---------------------------------------------------------------------- 
    43    !! NEMO/OPA  3.3 , LOCEAN-IPSL (2010)  
    44    !! $Id$  
     43   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010)  
     44   !! $Id$ 
    4545   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    4646   !!---------------------------------------------------------------------- 
     
    4848CONTAINS 
    4949 
    50    SUBROUTINE tra_zdf_exp( kt, cdtype, p2dt, kn_zdfexp,  & 
     50   SUBROUTINE tra_zdf_exp( kt, cdtype, p2dt, kn_zdfexp,   & 
    5151      &                                ptb , pta      , kjpt ) 
    5252      !!---------------------------------------------------------------------- 
     
    7373      !! ** Action : - after tracer fields pta 
    7474      !!--------------------------------------------------------------------- 
    75       !!  
    76       INTEGER         , INTENT(in   )                                ::   kt          ! ocean time-step index 
    77       CHARACTER(len=3), INTENT(in   )                                ::   cdtype      ! =TRA or TRC (tracer indicator) 
    78       INTEGER         , INTENT(in   )                                ::   kjpt        ! number of tracers 
    79       INTEGER         , INTENT(in   )                                ::   kn_zdfexp   ! number of sub-time step 
    80       REAL(wp)        , INTENT(in   ), DIMENSION(jpk)                ::   p2dt        ! vertical profile of tracer time-step 
    81       REAL(wp)        , INTENT(in   ), DIMENSION(jpi,jpj,jpk,kjpt)   ::   ptb       ! before and now tracer fields 
    82       REAL(wp)        , INTENT(inout), DIMENSION(jpi,jpj,jpk,kjpt)   ::   pta       ! tracer trend  
     75      INTEGER                              , INTENT(in   ) ::   kt          ! ocean time-step index 
     76      CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype      ! =TRA or TRC (tracer indicator) 
     77      INTEGER                              , INTENT(in   ) ::   kjpt        ! number of tracers 
     78      INTEGER                              , INTENT(in   ) ::   kn_zdfexp   ! number of sub-time step 
     79      REAL(wp), DIMENSION(        jpk     ), INTENT(in   ) ::   p2dt        ! vertical profile of tracer time-step 
     80      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   ptb         ! before and now tracer fields 
     81      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pta         ! tracer trend  
    8382      !!  
    8483      INTEGER  ::  ji, jj, jk, jn, jl        ! dummy loop indices 
    85       REAL(wp) ::  zlavmr, zave3r, ze3tr     ! temporary scalars 
    86       REAL(wp) ::  ztra, ze3tb               ! temporary scalars 
     84      REAL(wp) ::  zlavmr, zave3r, ze3tr     ! local scalars 
     85      REAL(wp) ::  ztra, ze3tb               !   -      - 
    8786      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zwx, zwy   ! 3D workspace 
    8887      !!--------------------------------------------------------------------- 
    8988 
    90       IF( ( cdtype == 'TRA' .AND. kt == nit000 ) .OR. ( cdtype == 'TRC' .AND. kt == nittrc000 ) )  THEN 
     89      IF( kt == nit000 )  THEN 
    9190         IF(lwp) WRITE(numout,*) 
    9291         IF(lwp) WRITE(numout,*) 'tra_zdf_exp : explicit vertical mixing on ', cdtype 
     
    9695      ! Initializations 
    9796      ! --------------- 
    98       zlavmr = 1. / float( kn_zdfexp )                           ! Local constant 
     97      zlavmr = 1. / float( kn_zdfexp )         ! Local constant 
    9998      ! 
    10099      ! 
    101       DO jn = 1, kjpt 
     100      DO jn = 1, kjpt                          ! loop over tracers 
    102101         ! 
    103102         zwy(:,:, 1 ) = 0.e0     ! surface boundary conditions: no flux 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/TRA/trazdf_imp.F90

    r2082 r2104  
    8989      !! 
    9090      !!--------------------------------------------------------------------- 
    91       !!  
    9291      USE oce    , ONLY :   zwd   => ua   ! ua used as workspace 
    9392      USE oce    , ONLY :   zws   => va   ! va  -          - 
    9493      !!  
    95       INTEGER         , INTENT(in   )                                ::   kt             ! ocean time-step index 
    96       CHARACTER(len=3), INTENT(in   )                                ::   cdtype         ! =TRA or TRC (tracer indicator) 
    97       INTEGER         , INTENT(in   )                                ::   kjpt            ! number of tracers 
    98       REAL(wp)        , INTENT(in   ), DIMENSION(jpk)                ::   p2dt        ! vertical profile of tracer time-step 
    99       REAL(wp)        , INTENT(in   ), DIMENSION(jpi,jpj,jpk,kjpt)   ::   ptb          ! before and now tracer fields 
    100       REAL(wp)        , INTENT(inout), DIMENSION(jpi,jpj,jpk,kjpt)   ::   pta          ! tracer trend  
     94      INTEGER                              , INTENT(in   ) ::   kt       ! ocean time-step index 
     95      CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype   ! =TRA or TRC (tracer indicator) 
     96      INTEGER                              , INTENT(in   ) ::   kjpt     ! number of tracers 
     97      REAL(wp), DIMENSION(        jpk     ), INTENT(in   ) ::   p2dt     ! vertical profile of tracer time-step 
     98      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   ptb      ! before and now tracer fields 
     99      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pta      ! tracer trend  
    101100      !! 
    102101      INTEGER  ::  ji, jj, jk, jn        ! dummy loop indices 
    103       REAL(wp) ::  zavi, zrhs, znvvl     ! temporary scalars 
     102      REAL(wp) ::  zavi, zrhs, znvvl     ! local scalars 
    104103      REAL(wp) ::  ze3tb, ze3tn, ze3ta   ! variable vertical scale factors 
    105104      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zwi, zwt   ! workspace arrays 
    106105      !!--------------------------------------------------------------------- 
    107106 
    108       IF( ( cdtype == 'TRA' .AND. kt == nit000 ) .OR. ( cdtype == 'TRC' .AND. kt == nittrc000 ) )  THEN 
     107      IF( kt == nit000 )  THEN 
    109108         IF(lwp)WRITE(numout,*) 
    110109         IF(lwp)WRITE(numout,*) 'tra_zdf_imp : implicit vertical mixing on ', cdtype 
     
    287286               DO ji = fs_2, fs_jpim1 
    288287                  pta(ji,jj,jk,jn) = ( pta(ji,jj,jk,jn) - zws(ji,jj,jk) * pta(ji,jj,jk+1,jn) ) & 
    289                   &                    / zwt(ji,jj,jk) * tmask(ji,jj,jk) 
     288                     &             / zwt(ji,jj,jk) * tmask(ji,jj,jk) 
    290289               END DO 
    291290            END DO 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/TRA/zpshde.F90

    r2082 r2104  
    44   !! z-coordinate - partial step : Horizontal Derivative 
    55   !!============================================================================== 
    6    !! History : 
    7    !!       OPA   8.5  !  2002-04  (A. Bozec)  Original code 
    8    !!             8.5  !  2002-08  (G. Madec E. Durand)  Optimization and Free form 
    9    !!             9.0  !  2004-03  (C. Ethe)  adapted for passive tracers 
    10    !!      NEMO   3.3  !  2010-05  (C. Ethe, G. Madec)  merge TRC-TRA  
     6   !! History :  OPA  !  2002-04  (A. Bozec)  Original code 
     7   !!            8.5  !  2002-08  (G. Madec E. Durand)  Optimization and Free form 
     8   !!   NEMO     1.0  !  2004-03  (C. Ethe)  adapted for passive tracers 
     9   !!            3.3  !  2010-05  (C. Ethe, G. Madec)  merge TRC-TRA  
    1110   !!============================================================================== 
    1211    
     
    1514   !!                   ocean level (Z-coord. with Partial Steps) 
    1615   !!---------------------------------------------------------------------- 
    17    !! * Modules used 
    1816   USE dom_oce         ! ocean space domain variables 
    1917   USE oce             ! ocean dynamics and tracers variables 
     
    2624   PRIVATE 
    2725 
    28    !! * Routine accessibility 
    29    PUBLIC zps_hde          ! routine called by step.F90 
    30    PUBLIC zps_hde_init     ! routine called by opa.F90 
    31  
    32    !! * module variables 
    33    INTEGER, DIMENSION(jpi,jpj) ::   & 
    34       mbatu, mbatv      ! bottom ocean level index at U- and V-points 
     26   PUBLIC   zps_hde        ! routine called by step.F90 
     27   PUBLIC   zps_hde_init   ! routine called by opa.F90 
     28 
     29   INTEGER, DIMENSION(jpi,jpj) ::   mbatu, mbatv   ! bottom ocean level index at U- and V-points 
    3530 
    3631   !! * Substitutions 
     
    3833#  include "vectopt_loop_substitute.h90" 
    3934   !!---------------------------------------------------------------------- 
    40    !!---------------------------------------------------------------------- 
    41    !!  OPA 9.0 , LOCEAN-IPSL (2005)  
    42    !! $Id$  
    43    !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt  
     35   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010)  
     36   !! $Id$ 
     37   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    4438   !!---------------------------------------------------------------------- 
    4539CONTAINS 
     
    9084      !!                and rd at V-points  
    9185      !!---------------------------------------------------------------------- 
    92       !! * Arguments 
    93       INTEGER                              , INTENT( in )           ::  kt    ! ocean time-step index 
    94       INTEGER                              , INTENT( in )           ::  kjpt  ! number of tracers 
    95       REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT( in )           ::  pta   ! 4D active or passive tracers fields 
    96       REAL(wp), DIMENSION(jpi,jpj,    kjpt), INTENT( out)           ::  pgtu, pgtv  ! horizontal grad. of ptra u- and v-points  
    97       REAL(wp), DIMENSION(jpi,jpj,jpk     ), INTENT( in ), OPTIONAL ::  prd   ! 3D rd fields 
    98       REAL(wp), DIMENSION(jpi,jpj         ), INTENT( out), OPTIONAL ::  pgru, pgrv  ! horizontal grad. of prd u- and v-points  
    99       !! * Local declarations 
     86      INTEGER                              , INTENT(in   )           ::  kt          ! ocean time-step index 
     87      INTEGER                              , INTENT(in   )           ::  kjpt        ! number of tracers 
     88      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   )           ::  pta         ! 4D tracers fields 
     89      REAL(wp), DIMENSION(jpi,jpj,    kjpt), INTENT(  out)           ::  pgtu, pgtv  ! hor. grad. of ptra at u- & v-pts  
     90      REAL(wp), DIMENSION(jpi,jpj,jpk     ), INTENT(in   ), OPTIONAL ::  prd         ! 3D density anomaly fields 
     91      REAL(wp), DIMENSION(jpi,jpj         ), INTENT(  out), OPTIONAL ::  pgru, pgrv  ! hor. grad. of prd at u- & v-pts  
     92      !! 
    10093      INTEGER  ::   ji, jj, jn      ! Dummy loop indices 
    10194      INTEGER  ::   iku, ikv        ! partial step level at u- and v-points 
     
    109102      ! Interpolation of tracers at the last ocean level 
    110103      DO jn = 1, kjpt 
     104         ! 
    111105# if defined key_vectopt_loop 
    112106         jj = 1 
     
    155149# endif 
    156150         END DO 
    157  
    158          ! Lateral boundary conditions on each gradient 
    159          CALL lbc_lnk( pgtu(:,:,jn) , 'U', -1. ) 
    160          CALL lbc_lnk( pgtv(:,:,jn) , 'V', -1. ) 
    161  
     151         CALL lbc_lnk( pgtu(:,:,jn), 'U', -1. )   ;   CALL lbc_lnk( pgtv(:,:,jn), 'V', -1. )   ! Lateral boundary cond. 
     152         ! 
    162153      END DO 
    163154 
    164       ! horizontal derivative of rd 
    165       IF( PRESENT( prd ) ) THEN 
    166          ! depth of the partial step level 
     155      ! horizontal derivative of density anomalies (rd) 
     156      IF( PRESENT( prd ) ) THEN         ! depth of the partial step level 
    167157# if defined key_vectopt_loop 
    168158         jj = 1 
     
    193183         ! Compute interpolated rd from zti, ztj for the 2 cases at the depth of the partial 
    194184         ! step and store it in  zri, zrj for each  case 
    195          CALL eos( zti, zhi, zri ) 
    196          CALL eos( ztj, zhj, zrj ) 
     185         CALL eos( zti, zhi, zri )   ;   CALL eos( ztj, zhj, zrj ) 
    197186 
    198187         ! Gradient of density at the last level  
     
    222211# endif 
    223212         END DO 
    224  
    225          ! Lateral boundary conditions on each gradient 
    226          CALL lbc_lnk( pgru , 'U', -1. )   ;   CALL lbc_lnk( pgrv , 'V', -1. ) 
     213         CALL lbc_lnk( pgru , 'U', -1. )   ;   CALL lbc_lnk( pgrv , 'V', -1. )   ! Lateral boundary conditions 
    227214         ! 
    228215      END IF 
     
    230217   END SUBROUTINE zps_hde 
    231218 
     219 
    232220   SUBROUTINE zps_hde_init 
    233221      !!---------------------------------------------------------------------- 
     
    237225      !!                     
    238226      !!---------------------------------------------------------------------- 
    239       !! * Local declarations 
    240       INTEGER ::   ji, jj           ! Dummy loop indices 
    241       REAL(wp), DIMENSION(jpi,jpj) :: zti, ztj     !  temporary arrays  
    242       !!---------------------------------------------------------------------- 
    243  
     227      INTEGER ::   ji, jj   ! Dummy loop indices 
     228      REAL(wp), DIMENSION(jpi,jpj) ::   zti, ztj     ! 2D workspace  
     229      !!---------------------------------------------------------------------- 
     230      ! 
    244231      mbatu(:,:) = 0 
    245232      mbatv(:,:) = 0 
     
    253240      ztj(:,:) = FLOAT( mbatv(:,:) ) 
    254241      ! lateral boundary conditions: T-point, sign unchanged 
    255       CALL lbc_lnk( zti , 'U', 1. ) 
    256       CALL lbc_lnk( ztj , 'V', 1. ) 
     242      CALL lbc_lnk( zti , 'U', 1. )   ;   CALL lbc_lnk( ztj , 'V', 1. ) 
    257243      mbatu(:,:) = MAX( INT( zti(:,:) ), 2 ) 
    258244      mbatv(:,:) = MAX( INT( ztj(:,:) ), 2 ) 
    259  
     245      ! 
    260246   END SUBROUTINE zps_hde_init 
    261247   !!====================================================================== 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/TRD/trdicp.F90

    r2082 r2104  
    44   !! Ocean diagnostics:  ocean tracers and dynamic trends 
    55   !!===================================================================== 
    6    !! History :       !  91-12 (G. Madec) 
    7    !!                 !  92-06 (M. Imbard) add time step frequency 
    8    !!                 !  96-01 (G. Madec)  terrain following coordinates 
    9    !!            8.5  !  02-06 (G. Madec)  F90: Free form and module 
    10    !!            9.0  !  04-08 (C. Talandier) New trends organization 
     6   !! History :  1.0  !  2004-08 (C. Talandier) New trends organization 
    117   !!---------------------------------------------------------------------- 
    128#if  defined key_trdtra   ||   defined key_trddyn   ||   defined key_esopa 
     
    1410   !!   'key_trdtra'  or                  active tracers trends diagnostics 
    1511   !!   'key_trddyn'                            momentum trends diagnostics 
    16    !!---------------------------------------------------------------------- 
    1712   !!---------------------------------------------------------------------- 
    1813   !!   trd_icp          : compute the basin averaged properties for tra/dyn  
     
    4843#  include "vectopt_loop_substitute.h90" 
    4944   !!---------------------------------------------------------------------- 
    50    !!   OPA 9.0 , LOCEAN-IPSL (2005)  
    51    !! $Id$  
     45   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010)  
     46   !! $Id$ 
    5247   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    5348   !!---------------------------------------------------------------------- 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/TRD/trdmod.F90

    r2026 r2104  
    44   !! Ocean diagnostics:  ocean tracers and dynamic trends 
    55   !!===================================================================== 
    6    !! History :  9.0  !  04-08  (C. Talandier) Original code 
    7    !!                 !  05-04  (C. Deltel)    Add Asselin trend in the ML budget 
     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 
    89   !!---------------------------------------------------------------------- 
    910#if  defined key_trdtra || defined key_trddyn || defined key_trdmld || defined key_trdvor || defined key_esopa 
     
    3637#  include "vectopt_loop_substitute.h90" 
    3738   !!---------------------------------------------------------------------- 
    38    !!   OPA 9.0 , LOCEAN-IPSL (2005)  
     39   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010)  
    3940   !! $Id$ 
    4041   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
     
    216217 
    217218      ENDIF 
    218  
     219      ! 
    219220   END SUBROUTINE trd_mod 
    220221 
    221 #   else 
     222#else 
    222223   !!---------------------------------------------------------------------- 
    223224   !!   Default case :                                         Empty module 
     
    230231CONTAINS 
    231232   SUBROUTINE trd_mod(ptrd3dx, ptrd3dy, ktrd , ctype, kt )   ! Empty routine 
    232       REAL, DIMENSION(:,:,:), INTENT( in ) ::   & 
    233           ptrd3dx,                     &                           ! Temperature or U trend  
    234           ptrd3dy                                                  ! Salinity    or V trend 
    235       INTEGER, INTENT( in ) ::   ktrd                              ! momentum or tracer trend index 
    236       INTEGER, INTENT( in ) ::   kt                                ! Time step 
    237       CHARACTER(len=3), INTENT( in ) ::  ctype                     ! momentum or tracers trends type 
    238       WRITE(*,*) 'trd_3d: You should not have seen this print! error ?', ptrd3dx(1,1,1) 
    239       WRITE(*,*) ' "   ": You should not have seen this print! error ?', ptrd3dy(1,1,1) 
    240       WRITE(*,*) ' "   ": You should not have seen this print! error ?', ktrd 
    241       WRITE(*,*) ' "   ": You should not have seen this print! error ?', ctype 
    242       WRITE(*,*) ' "   ": You should not have seen this print! error ?', kt 
     233      REAL    ::   ptrd3dx(:,:,:), ptrd3dy(:,:,:) 
     234      INTEGER ::   ktrd, kt                             
     235      CHARACTER(len=3) ::  ctype                   
     236      WRITE(*,*) 'trd_3d: You should not have seen this print! error ?', ptrd3dx(1,1,1), ptrd3dy(1,1,1) 
     237      WRITE(*,*) ' "   ": You should not have seen this print! error ?', ktrd, ctype, kt 
    243238   END SUBROUTINE trd_mod 
    244 #   endif 
     239#endif 
    245240 
    246241   SUBROUTINE trd_mod_init 
     
    251246      !!---------------------------------------------------------------------- 
    252247      USE in_out_manager          ! I/O manager 
    253  
     248      !!     
    254249      NAMELIST/namtrd/ nn_trd, nn_ctls, cn_trdrst_in, cn_trdrst_out, ln_trdmld_restart, rn_ucf, ln_trdmld_instant 
    255250      !!---------------------------------------------------------------------- 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/TRD/trdmod_oce.F90

    r2026 r2104  
    44   !! Ocean trends :   set tracer and momentum trend variables 
    55   !!====================================================================== 
    6    !! History :  9.0  !  04-08  (C. Talandier) Original code 
     6   !! History :  1.0  !  2004-08  (C. Talandier) Original code 
    77   !!---------------------------------------------------------------------- 
    88   USE trdicp_oce              ! ocean momentum/tracers bassin properties trends variables 
     
    3838   LOGICAL , PUBLIC ::   l_trdtrc = .FALSE.               !: tracers  trend flag 
    3939# endif 
    40    !                                                   !!! Active tracers trends indexes 
    41    INTEGER, PUBLIC, PARAMETER ::   jptra_trd_xad =  1   !: x- horizontal advection 
    42    INTEGER, PUBLIC, PARAMETER ::   jptra_trd_yad =  2   !: y- horizontal advection 
    43    INTEGER, PUBLIC, PARAMETER ::   jptra_trd_zad =  3   !: z- vertical   advection 
    44    INTEGER, PUBLIC, PARAMETER ::   jptra_trd_ldf =  4   !: lateral       diffusion 
    45    INTEGER, PUBLIC, PARAMETER ::   jptra_trd_zdf =  5   !: vertical diffusion (Kz) 
    46    INTEGER, PUBLIC, PARAMETER ::   jptra_trd_bbc =  6   !: Bottom Boundary Condition (geoth. flux)  
    47    INTEGER, PUBLIC, PARAMETER ::   jptra_trd_bbl =  7   !: Bottom Boundary Layer (diffusive/convective) 
    48    INTEGER, PUBLIC, PARAMETER ::   jptra_trd_npc =  8   !: static instability mixing 
    49    INTEGER, PUBLIC, PARAMETER ::   jptra_trd_dmp =  9   !: damping 
    50    INTEGER, PUBLIC, PARAMETER ::   jptra_trd_qsr = 10   !: penetrative solar radiation 
    51    INTEGER, PUBLIC, PARAMETER ::   jptra_trd_nsr = 11   !: non solar radiation 
    52    INTEGER, PUBLIC, PARAMETER ::   jptra_trd_atf = 12   !: Asselin correction 
     40   !                                                     !!!* Active tracers trends indexes 
     41   INTEGER, PUBLIC, PARAMETER ::   jptra_trd_xad =  1     !: x- horizontal advection 
     42   INTEGER, PUBLIC, PARAMETER ::   jptra_trd_yad =  2     !: y- horizontal advection 
     43   INTEGER, PUBLIC, PARAMETER ::   jptra_trd_zad =  3     !: z- vertical   advection 
     44   INTEGER, PUBLIC, PARAMETER ::   jptra_trd_ldf =  4     !: lateral       diffusion 
     45   INTEGER, PUBLIC, PARAMETER ::   jptra_trd_zdf =  5     !: vertical diffusion (Kz) 
     46   INTEGER, PUBLIC, PARAMETER ::   jptra_trd_bbc =  6     !: Bottom Boundary Condition (geoth. flux)  
     47   INTEGER, PUBLIC, PARAMETER ::   jptra_trd_bbl =  7     !: Bottom Boundary Layer (diffusive/convective) 
     48   INTEGER, PUBLIC, PARAMETER ::   jptra_trd_npc =  8     !: static instability mixing 
     49   INTEGER, PUBLIC, PARAMETER ::   jptra_trd_dmp =  9     !: damping 
     50   INTEGER, PUBLIC, PARAMETER ::   jptra_trd_qsr = 10     !: penetrative solar radiation 
     51   INTEGER, PUBLIC, PARAMETER ::   jptra_trd_nsr = 11     !: non solar radiation 
     52   INTEGER, PUBLIC, PARAMETER ::   jptra_trd_atf = 12     !: Asselin correction 
    5353#if defined key_top 
    54    !!* Passive tracers trends indexes 
    55    INTEGER, PUBLIC, PARAMETER ::   jptra_trd_sms  = 13   !: sources m. sinks 
    56    INTEGER, PUBLIC, PARAMETER ::   jptra_trd_radn = 14   !: corr. trn<0 in trcrad 
    57    INTEGER, PUBLIC, PARAMETER ::   jptra_trd_radb = 15   !: corr. trb<0 in trcrad (like atf) 
     54   !                                                     !!!* Passive tracers trends indexes 
     55   INTEGER, PUBLIC, PARAMETER ::   jptra_trd_sms  = 13    !: sources m. sinks 
     56   INTEGER, PUBLIC, PARAMETER ::   jptra_trd_radn = 14    !: corr. trn<0 in trcrad 
     57   INTEGER, PUBLIC, PARAMETER ::   jptra_trd_radb = 15    !: corr. trb<0 in trcrad (like atf) 
    5858#endif 
    5959    
    60    !                                                   !!! Momentum trends indexes 
    61    INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_hpg =  1   !: hydrostatic pressure gradient  
    62    INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_keg =  2   !: kinetic energy gradient 
    63    INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_rvo =  3   !: relative vorticity 
    64    INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_pvo =  4   !: planetary vorticity 
    65    INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_ldf =  5   !: lateral diffusion 
    66    INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_had =  6   !: horizontal advection 
    67    INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_zad =  7   !: vertical advection 
    68    INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_zdf =  8   !: vertical diffusion 
    69    INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_spg =  9   !: surface pressure gradient 
    70    INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_dat = 10   !: damping term 
    71    INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_swf = 11   !: surface wind forcing 
    72    INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_bfr = 12   !: bottom friction  
     60   !                                                     !!!* Momentum trends indexes 
     61   INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_hpg =  1     !: hydrostatic pressure gradient  
     62   INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_keg =  2     !: kinetic energy gradient 
     63   INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_rvo =  3     !: relative vorticity 
     64   INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_pvo =  4     !: planetary vorticity 
     65   INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_ldf =  5     !: lateral diffusion 
     66   INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_had =  6     !: horizontal advection 
     67   INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_zad =  7     !: vertical advection 
     68   INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_zdf =  8     !: vertical diffusion 
     69   INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_spg =  9     !: surface pressure gradient 
     70   INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_dat = 10     !: damping term 
     71   INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_swf = 11     !: surface wind forcing 
     72   INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_bfr = 12     !: bottom friction  
    7373 
    7474   !!---------------------------------------------------------------------- 
    75    !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009)  
    76    !! $Id$  
     75   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010)  
     76   !! $Id$ 
    7777   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    7878   !!====================================================================== 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/TRD/trdmod_trc.F90

    r2026 r2104  
    55   !!====================================================================== 
    66   !!---------------------------------------------------------------------- 
    7    !!   Dummy module                                     NO TOP use 
     7   !!   Dummy module                                             NO TOP use 
    88   !!---------------------------------------------------------------------- 
    99CONTAINS 
    1010 
    1111   SUBROUTINE trd_mod_trc( ptrtrd, kjn, ktrd, kt ) 
    12       INTEGER               , INTENT( in )     ::   kt      ! time step 
    13       INTEGER               , INTENT( in )     ::   kjn     ! tracer index 
    14       INTEGER               , INTENT( in )     ::   ktrd    ! tracer trend index 
    15       REAL, DIMENSION(:,:,:), INTENT( in )     ::   ptrtrd  ! Temperature or U trend 
     12      INTEGER ::   kt, kjn, ktrd    
     13      REAL    ::   ptrtrd(:,:,:)   
    1614      WRITE(*,*) 'trd_mod_trc_trp : You should not have seen this print! error?', ptrtrd(1,1,1) 
    17       WRITE(*,*) '  "      "      : You should not have seen this print! error?', kjn 
    18       WRITE(*,*) '  "      "      : You should not have seen this print! error?', ktrd 
    19       WRITE(*,*) '  "      "      : You should not have seen this print! error?', kt 
     15      WRITE(*,*) '  "      "      : You should not have seen this print! error?', kjn, ktrd, kt 
    2016   END SUBROUTINE trd_mod_trc 
    2117 
     18   !!====================================================================== 
    2219END MODULE trdmod_trc 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/ZDF/zdfbfr.F90

    r2027 r2104  
    77   !!   NEMO     1.0  ! 2002-06  (G. Madec)  F90: Free form and module 
    88   !!            3.2  ! 2009-09  (A.C.Coward)  Correction to include barotropic contribution 
     9   !!            3.3  ! 2010-10  (C. Ethe, G. Madec) reorganisation of initialisation phase 
    910   !!---------------------------------------------------------------------- 
    1011 
     
    1213   !!   zdf_bfr      : update momentum Kz at the ocean bottom due to the type of bottom friction chosen 
    1314   !!   zdf_bfr_init : read in namelist and control the bottom friction parameters. 
    14    !!   zdf_bfr_2d   : read in namelist and control the bottom friction 
    15    !!                  parameters. 
     15   !!   zdf_bfr_2d   : read in namelist and control the bottom friction parameters. 
    1616   !!---------------------------------------------------------------------- 
    1717   USE oce             ! ocean dynamics and tracers variables 
     
    4444#  include "domzgr_substitute.h90" 
    4545   !!---------------------------------------------------------------------- 
    46    !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009)  
    47    !! $Id$  
     46   !! NEMO/OPA 3,3 , LOCEAN-IPSL (2010)  
     47   !! $Id$ 
    4848   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    4949   !!---------------------------------------------------------------------- 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/ZDF/zdfddm.F90

    r2027 r2104  
    66   !! History :  OPA  ! 2000-08  (G. Madec)  double diffusive mixing 
    77   !!   NEMO     1.0  ! 2002-06  (G. Madec)  F90: Free form and module 
     8   !!            3.3  !  2010-10  (C. Ethe, G. Madec) reorganisation of initialisation phase 
    89   !!---------------------------------------------------------------------- 
    910#if defined key_zdfddm   ||   defined key_esopa 
     
    3940#  include "vectopt_loop_substitute.h90" 
    4041   !!---------------------------------------------------------------------- 
    41    !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009)  
    42    !! $Id$  
     42   !! NEMO/OPA 3,3 , LOCEAN-IPSL (2010)  
     43   !! $Id$ 
    4344   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    4445   !!---------------------------------------------------------------------- 
     
    9798            DO ji = 1, jpi 
    9899               ! stability indicator: msks=1 if rn2>0; 0 elsewhere 
    99                IF( rn2(ji,jj,jk) + 1.e-12  <= 0. ) THEN 
    100                   zmsks(ji,jj) = 0.e0 
    101                ELSE 
    102                   zmsks(ji,jj) = 1.e0 
     100               IF( rn2(ji,jj,jk) + 1.e-12  <= 0. ) THEN   ;   zmsks(ji,jj) = 0.e0 
     101               ELSE                                       ;   zmsks(ji,jj) = 1.e0 
    103102               ENDIF 
    104103               ! salt fingering indicator: msksf=1 if rrau>1; 0 elsewhere             
    105                IF( rrau(ji,jj,jk) <= 1. ) THEN 
    106                   zmskf(ji,jj) = 0.e0 
    107                ELSE 
    108                   zmskf(ji,jj) = 1.e0 
     104               IF( rrau(ji,jj,jk) <= 1.          ) THEN   ;   zmskf(ji,jj) = 0.e0 
     105               ELSE                                       ;   zmskf(ji,jj) = 1.e0 
    109106               ENDIF 
    110107               ! diffusive layering indicators:  
    111                !   mskdl1=1 if 0<rrau<1; 0 elsewhere 
    112                IF( rrau(ji,jj,jk) >= 1. ) THEN 
    113                   zmskd1(ji,jj) = 0.e0 
    114                ELSE 
    115                   zmskd1(ji,jj) = 1.e0 
    116                ENDIF 
    117                !   mskdl2=1 if 0<rrau<0.5; 0 elsewhere 
    118                IF( rrau(ji,jj,jk) >= 0.5 ) THEN 
    119                   zmskd2(ji,jj) = 0.e0 
    120                ELSE 
    121                   zmskd2(ji,jj) = 1.e0 
     108               !     ! mskdl1=1 if 0<rrau<1; 0 elsewhere 
     109               IF( rrau(ji,jj,jk) >= 1.          ) THEN   ;   zmskd1(ji,jj) = 0.e0 
     110               ELSE                                       ;   zmskd1(ji,jj) = 1.e0 
     111               ENDIF 
     112               !     ! mskdl2=1 if 0<rrau<0.5; 0 elsewhere 
     113               IF( rrau(ji,jj,jk) >= 0.5         ) THEN   ;   zmskd2(ji,jj) = 0.e0 
     114               ELSE                                       ;   zmskd2(ji,jj) = 1.e0 
    122115               ENDIF 
    123116               !   mskdl3=1 if 0.5<rrau<1; 0 elsewhere 
    124                IF( rrau(ji,jj,jk) <= 0.5 .OR. rrau(ji,jj,jk) >= 1. ) THEN 
    125                   zmskd3(ji,jj) = 0.e0 
    126                ELSE 
    127                   zmskd3(ji,jj) = 1.e0 
     117               IF( rrau(ji,jj,jk) <= 0.5 .OR. rrau(ji,jj,jk) >= 1. ) THEN   ;   zmskd3(ji,jj) = 0.e0 
     118               ELSE                                                         ;   zmskd3(ji,jj) = 1.e0 
    128119               ENDIF 
    129120            END DO 
     
    226217      WRITE(*,*) 'zdf_ddm: You should not have seen this print! error?', kt 
    227218   END SUBROUTINE zdf_ddm 
     219   SUBROUTINE zdf_ddm_init            ! Dummy routine 
     220   END SUBROUTINE zdf_ddm_init 
    228221#endif 
    229222 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/ZDF/zdfkpp.F90

    r2027 r2104  
    55   !!                 turbulent closure parameterization 
    66   !!===================================================================== 
    7    !! History :  8.1  ! 00-03 (W.G. Large, J. Chanut) Original code 
    8    !!            8.1  ! 02-06 (J.M. Molines) for real case CLIPPER   
    9    !!            8.2  ! 03-10 (Chanut J.) re-writting 
    10    !!            9.0  ! 05-01 (C. Ethe) Free form, F90 
     7   !! History :  OPA  ! 2000-03 (W.G. Large, J. Chanut) Original code 
     8   !!            8.1  ! 2002-06 (J.M. Molines) for real case CLIPPER   
     9   !!            8.2  ! 2003-10 (Chanut J.) re-writting 
     10   !!   NEMO     1.0  ! 2005-01 (C. Ethe, G. Madec) Free form, F90 + creation of tra_kpp routine 
     11   !!            3.3  ! 2010-10  (C. Ethe, G. Madec) reorganisation of initialisation phase + merge TRC-TRA 
    1112   !!---------------------------------------------------------------------- 
    1213#if defined key_zdfkpp   ||   defined key_esopa 
     
    1415   !!   'key_zdfkpp'                                             KPP scheme 
    1516   !!---------------------------------------------------------------------- 
    16    !!---------------------------------------------------------------------- 
    1717   !!   zdf_kpp      : update momentum and tracer Kz from a kpp scheme 
    1818   !!   zdf_kpp_init : initialization, namelist read, and parameters control 
     19   !!   tra_kpp      : compute and add to the T & S trend the non-local flux 
     20   !!   trc_kpp      : compute and add to the passive tracer trend the non-local flux (lk_top=T) 
    1921   !!---------------------------------------------------------------------- 
    2022   USE oce             ! ocean dynamics and active tracers  
     
    5860 
    5961#if defined key_zdfddm 
    60    REAL(wp) ::                 & !!! ** Double diffusion Mixing 
    61       difssf  = 1.e-03_wp   ,  &  ! maximum salt fingering mixing  
    62       Rrho0   = 1.9_wp      ,  &  ! limit for salt  fingering mixing  
    63       difsdc  = 1.5e-06_wp       ! maximum diffusive convection mixing 
     62   !                                        !!! ** Double diffusion Mixing 
     63   REAL(wp) ::   difssf  = 1.e-03_wp         ! maximum salt fingering mixing  
     64   REAL(wp) ::   Rrho0   = 1.9_wp            ! limit for salt  fingering mixing  
     65   REAL(wp) ::   difsdc  = 1.5e-06_wp        ! maximum diffusive convection mixing 
    6466#endif 
    6567   LOGICAL  ::   ln_kpprimix  = .TRUE.       ! Shear instability mixing  
    6668 
    67    REAL(wp) ::                 & !!! ** General constants  ** 
    68       epsln   = 1.0e-20_wp   , &  ! a small positive number     
    69       pthird  = 1._wp/3._wp  , &  ! 1/3 
    70       pfourth = 1._wp/4._wp       ! 1/4 
    71  
    72    REAL(wp) ::                 & !!! ** Boundary Layer Turbulence Parameters  ** 
    73       vonk     = 0.4_wp     ,  &  ! von Karman's constant 
    74       epsilon  = 0.1_wp     ,  &  ! nondimensional extent of the surface layer 
    75       rconc1   = 5.0_wp     ,  &  ! standard flux profile function parmaeters 
    76       rconc2   = 16.0_wp    ,  &  !         "        " 
    77       rconcm   = 8.38_wp    ,  &  ! momentum flux profile fit 
    78       rconam   = 1.26_wp    ,  &  !         "       " 
    79       rzetam   = -.20_wp    ,  &  !         "       "        
    80       rconcs   = 98.96_wp   ,  &  !  scalar  flux profile fit 
    81       rconas   = -28.86_wp  ,  &  !         "       " 
    82       rzetas   = -1.0_wp          !         "       "   
    83    REAL(wp) ::                 & !!! ** Boundary Layer Depth Diagnostic  ** 
    84       Ricr     = 0.3_wp     ,  &  ! critical bulk Richardson Number 
    85       rcekman  = 0.7_wp     ,  &  ! coefficient for ekman depth   
    86       rcmonob  = 1.0_wp     ,  &  ! coefficient for Monin-Obukhov depth  
    87       rconcv   = 1.7_wp     ,  &  ! ratio of interior buoyancy frequency to buoyancy frequency at entrainment depth 
    88       hbf      = 1.0_wp     ,  &  ! fraction of bound. layer depth to which absorbed solar  
    89       !                           ! rad. and contributes to surf. buo. forcing 
    90       Vtc                         ! function of rconcv,rconcs,epsilon,vonk,Ricr 
    91    REAL(wp) ::                 & !!! ** Nonlocal Boundary Layer Mixing ** 
    92       rcstar   = 5.0_wp     ,  &  ! coefficient for convective nonlocal transport 
    93       rcs      = 1.0e-3_wp  ,  &  ! conversion: mm/s ==> m/s    
    94       rcg                         ! non-dimensional coefficient for nonlocal transport 
     69   !                                        !!! ** General constants  ** 
     70   REAL(wp) ::   epsln   = 1.0e-20_wp        ! a small positive number     
     71   REAL(wp) ::   pthird  = 1._wp/3._wp       ! 1/3 
     72   REAL(wp) ::   pfourth = 1._wp/4._wp       ! 1/4 
     73 
     74   !                                        !!! ** Boundary Layer Turbulence Parameters  ** 
     75   REAL(wp) ::   vonk     = 0.4_wp           ! von Karman's constant 
     76   REAL(wp) ::   epsilon  = 0.1_wp           ! nondimensional extent of the surface layer 
     77   REAL(wp) ::   rconc1   = 5.0_wp           ! standard flux profile function parmaeters 
     78   REAL(wp) ::   rconc2   = 16.0_wp          !         "        " 
     79   REAL(wp) ::   rconcm   = 8.38_wp          ! momentum flux profile fit 
     80   REAL(wp) ::   rconam   = 1.26_wp          !         "       " 
     81   REAL(wp) ::   rzetam   = -.20_wp          !         "       "        
     82   REAL(wp) ::   rconcs   = 98.96_wp         !  scalar  flux profile fit 
     83   REAL(wp) ::   rconas   = -28.86_wp        !         "       " 
     84   REAL(wp) ::   rzetas   = -1.0_wp          !         "       "   
     85    
     86   !                                        !!! ** Boundary Layer Depth Diagnostic  ** 
     87   REAL(wp) ::   Ricr     = 0.3_wp           ! critical bulk Richardson Number 
     88   REAL(wp) ::   rcekman  = 0.7_wp           ! coefficient for ekman depth   
     89   REAL(wp) ::   rcmonob  = 1.0_wp           ! coefficient for Monin-Obukhov depth  
     90   REAL(wp) ::   rconcv   = 1.7_wp           ! ratio of interior buoyancy frequency to its value at entrainment depth 
     91   REAL(wp) ::   hbf      = 1.0_wp           ! fraction of bound. layer depth to which absorbed solar  
     92      !                                      ! rad. and contributes to surf. buo. forcing 
     93   REAL(wp) ::   Vtc                         ! function of rconcv,rconcs,epsilon,vonk,Ricr 
     94    
     95   !                                        !!! ** Nonlocal Boundary Layer Mixing ** 
     96   REAL(wp) ::   rcstar   = 5.0_wp           ! coefficient for convective nonlocal transport 
     97   REAL(wp) ::   rcs      = 1.0e-3_wp        ! conversion: mm/s ==> m/s    
     98   REAL(wp) ::   rcg                         ! non-dimensional coefficient for nonlocal transport 
    9599 
    96100#if ! defined key_kppcustom 
    97    REAL(wp), DIMENSION(jpk,jpk) ::   del   ! array for reference mean values of vertical integration  
     101   REAL(wp), DIMENSION(jpk,jpk) ::   del     ! array for reference mean values of vertical integration  
    98102#endif 
    99103 
    100104#if defined key_kpplktb 
    101    INTEGER, PARAMETER ::       & !!! ** Parameters for lookup table for turbulent velocity scales **  
    102       nilktb   = 892        ,  &  ! number of values for zehat in KPP lookup table 
    103       njlktb   = 482        ,  &  ! number of values for ustar in KPP lookup table 
    104       nilktbm1 = nilktb - 1 ,  &  ! 
    105       njlktbm1 = njlktb - 1       ! 
    106  
    107    REAL(wp), DIMENSION(nilktb,njlktb) ::   wmlktb   ! lookup table for the turbulent vertical velocity scale for momentum 
    108    REAL(wp), DIMENSION(nilktb,njlktb) ::   wslktb   ! lookup table for the turbulent vertical velocity scale for tracers 
    109  
    110    REAL(wp) ::                 & 
    111       dehatmin = -4.e-7_wp  ,  &  ! minimum limit for zhat in lookup table (m3/s3)  
    112       dehatmax = 0._wp      ,  &  ! maximum limit for zhat in lookup table (m3/s3) 
    113       ustmin   = 0._wp      ,  &  ! minimum limit for ustar in lookup table (m/s) 
    114       ustmax   = 0.04_wp    ,  &  ! maximum limit for ustar in lookup table (m/s)     
    115       dezehat               ,  &  ! delta zhat in lookup table 
    116       deustar                     ! delta ustar in lookup table 
     105   !                                         !!! ** Parameters for lookup table for turbulent velocity scales **  
     106   INTEGER, PARAMETER ::   nilktb   = 892     ! number of values for zehat in KPP lookup table 
     107   INTEGER, PARAMETER ::   njlktb   = 482     ! number of values for ustar in KPP lookup table 
     108   INTEGER, PARAMETER ::   nilktbm1 = nilktb-1   ! 
     109   INTEGER, PARAMETER ::   njlktbm1 = njlktb-1   ! 
     110 
     111   REAL(wp), DIMENSION(nilktb,njlktb) ::   wmlktb   ! lookup table for the turbulent vertical velocity scale (momentum) 
     112   REAL(wp), DIMENSION(nilktb,njlktb) ::   wslktb   ! lookup table for the turbulent vertical velocity scale (tracers) 
     113 
     114   REAL(wp) ::   dehatmin = -4.e-7_wp    ! minimum limit for zhat in lookup table (m3/s3)  
     115   REAL(wp) ::   dehatmax = 0._wp        ! maximum limit for zhat in lookup table (m3/s3) 
     116   REAL(wp) ::   ustmin   = 0._wp        ! minimum limit for ustar in lookup table (m/s) 
     117   REAL(wp) ::   ustmax   = 0.04_wp      ! maximum limit for ustar in lookup table (m/s)     
     118   REAL(wp) ::   dezehat                 ! delta zhat in lookup table 
     119   REAL(wp) ::   deustar                 ! delta ustar in lookup table 
    117120#endif 
    118121   REAL(wp), DIMENSION(jpk) ::   ratt   ! attenuation coef  (already defines in module traqsr,  
    119122   !                                    ! but only if the solar radiation penetration is considered) 
    120    REAL(wp) ::                 & !!! * penetrative solar radiation coefficient * 
    121       rabs = 0.58_wp        ,  &  ! fraction associated with xsi1 
    122       xsi1 = 0.35_wp        ,  &  ! first depth of extinction  
    123       xsi2 = 23.0_wp              ! second depth of extinction  
     123    
     124   !                                    !!! * penetrative solar radiation coefficient * 
     125   REAL(wp) ::   rabs = 0.58_wp          ! fraction associated with xsi1 
     126   REAL(wp) ::   xsi1 = 0.35_wp          ! first depth of extinction  
     127   REAL(wp) ::   xsi2 = 23.0_wp          ! second depth of extinction  
    124128      !                           ! (default values: water type Ib)  
    125129 
    126    REAL(wp), DIMENSION(jpi,jpj,jpk) ::   & 
    127       etmean                ,  &  ! coefficient used for horizontal smoothing 
    128       eumean                ,  &  ! at t-, u- and v-points 
    129       evmean   
     130   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   etmean, eumean, evmean   ! coeff. used for hor. smoothing at t-, u- & v-points 
     131         
    130132  
    131133#if defined key_c1d 
    132    REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   & 
    133       rig                   ,  &  ! gradient Richardson number 
    134       rib                   ,  &  ! bulk Richardson number 
    135       buof                  ,  &  ! buoyancy forcing 
    136       mols                        ! moning-Obukhov length scale  
    137    REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   ekdp   ! Ekman depth 
     134   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   rig    !: gradient Richardson number 
     135   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   rib    !: bulk Richardson number 
     136   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   buof   !: buoyancy forcing 
     137   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   mols   !: moning-Obukhov length scale  
     138   REAL(wp), PUBLIC, DIMENSION(jpi,jpj)     ::   ekdp   !: Ekman depth 
    138139#endif 
    139140 
     
    145146#  include  "zdfddm_substitute.h90" 
    146147   !!---------------------------------------------------------------------- 
    147    !! NEMO/OPA 3.2 , LOCEAN-IPSL   (2009) 
     148   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010)  
    148149   !! $Id$ 
    149150   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
     
    152153CONTAINS 
    153154 
    154    SUBROUTINE zdf_kpp ( kt ) 
     155   SUBROUTINE zdf_kpp( kt ) 
    155156      !!---------------------------------------------------------------------- 
    156157      !!                   ***  ROUTINE zdf_kpp  *** 
     
    188189      !!---------------------------------------------------------------------- 
    189190#if defined  key_zdfddm 
    190       USE oce     , zviscos => ua,      &  ! temp. array for viscosities use ua as workspace 
    191          &          zdiffut => ta,      &  ! temp. array for diffusivities use sa as workspace 
    192          &          zdiffus => sa          ! temp. array for diffusivities use sa as workspace 
     191      USE oce     , zviscos => ua   ! temp. array for viscosities use ua as workspace 
     192      USE oce     , zdiffut => ta   ! temp. array for diffusivities use sa as workspace 
     193      USE oce     , zdiffus => sa   ! temp. array for diffusivities use sa as workspace 
    193194#else 
    194       USE oce     , zviscos => ua,      &  ! temp. array for viscosities use ua as workspace 
    195          &          zdiffut => ta          ! temp. array for diffusivities use sa as workspace 
     195      USE oce     , zviscos => ua   ! temp. array for viscosities use ua as workspace 
     196      USE oce     , zdiffut => ta   ! temp. array for diffusivities use sa as workspace 
    196197#endif 
    197198      !! 
     
    201202      INTEGER ::   ikbot, jkmax, jkm1, jkp2   ! 
    202203 
    203       REAL(wp), DIMENSION(jpi,jpj) ::   & !!! Surface buoyancy forcing, friction velocity 
    204          zBo, zBosol, zustar              ! 
    205                       ! 
    206       REAL(wp) ::                       &  ! 
    207          ztx, zty, zflageos,            &  ! 
    208          zstabl, zbuofdep,zucube,       &  ! 
    209          zrhos, zalbet, zbeta,          &  ! 
    210          zthermal, zhalin, zatt1           ! 
    211       
    212       REAL(wp) ::                       & !!! Bulk richardson number 
    213          zref, zt, zs, zh,              &  ! 
    214          zu, zv, zrh,                   &  ! 
    215          zrib, zrinum,                  &  ! 
    216          zdVsq, zVtsq                      ! 
    217        
    218       REAL(wp) ::                       & !!! Velocity scales 
    219          zehat, zeta, zhrib, zsig,      &  ! 
    220          zscale, zwst, zws, zwm 
    221  
     204      REAL(wp), DIMENSION(jpi,jpj) ::   zBo, zBosol, zustar         ! Surface buoyancy forcing, friction velocity 
     205      REAL(wp) ::   ztx, zty, zflageos, zstabl, zbuofdep,zucube     ! 
     206      REAL(wp) ::   zrhos, zalbet, zbeta, zthermal, zhalin, zatt1   ! 
     207      REAL(wp) ::   zref, zt, zs, zh, zu, zv, zrh                   ! Bulk richardson number 
     208      REAL(wp) ::   zrib, zrinum, zdVsq, zVtsq                      ! 
     209      REAL(wp) ::   zehat, zeta, zhrib, zsig, zscale, zwst, zws, zwm   ! Velocity scales 
    222210#if defined key_kpplktb 
    223       INTEGER ::                        & !!! Lookup table or Analytical functions  
    224          il, jl                            ! 
    225       REAL(wp) ::                       &  ! 
    226          ud, zfrac, ufrac,              &  ! 
    227          zwam, zwbm, zwas, zwbs            ! 
     211      INTEGER ::    il, jl                                          ! Lookup table or Analytical functions  
     212      REAL(wp) ::   ud, zfrac, ufrac, zwam, zwbm, zwas, zwbs        ! 
    228213#else 
    229      REAL(wp) ::                        &  ! 
    230         zwsun, zwmun,                   &  
    231         zcons, zconm, zwcons, zwconm      ! 
    232 #endif 
    233   
    234      REAL(wp) ::                       & !!! In situ density 
    235          zsr, zbw, ze,                  &  ! 
    236          zb, zd, zc, zaw, za,           &  ! 
    237          zb1, za1, zkw, zk0,            &  ! 
    238          zcomp , zrhd, zrhdr,zbvzed       ! 
    239  
     214      REAL(wp) ::   zwsun, zwmun, zcons, zconm, zwcons, zwconm      ! 
     215#endif 
     216      REAL(wp) ::   zsr, zbw, ze, zb, zd, zc, zaw, za, zb1, za1, zkw, zk0, zcomp , zrhd,zrhdr,zbvzed   ! In situ density 
    240217#if ! defined key_kppcustom      
    241      !! * local declarations 
    242       INTEGER ::                        & 
    243          jm                                ! dummy loop indices 
    244       REAL(wp) ::                       & !!! Compression terms 
    245          zr1, zr2, zr3, zr4,            &  ! 
    246          zrhop                             ! 
    247 #endif 
    248   
    249       REAL(wp) ::                       &  ! 
    250          zflag, ztemp, zrn2,            &  ! 
    251          zdep21, zdep32, zdep43 
    252  
    253       REAL(wp) ::                       & !!! Interior richardson mixing 
    254          zdku2, zdkv2, ze3sqr,          &  ! 
    255          zsh2, zri, zfri                   ! 
    256  
    257       REAL(wp), DIMENSION(jpi,0:2) ::  &  !!! Moning-Obukov limitation 
    258          zmoek 
    259       REAL(wp), DIMENSION(jpi)     ::  & 
    260          zmoa, zekman                 
    261       REAL(wp)                     ::  & 
    262          zmob, zek 
    263  
    264       REAL(wp), DIMENSION(jpi,4) ::     &  !!! The pipe  
    265          zdepw, zdift, zvisc 
    266       REAL(wp), DIMENSION(jpi,3) ::     &  
    267          zdept 
    268       REAL(wp), DIMENSION(jpi,2) ::     &   
    269          zriblk 
    270       REAL(wp), DIMENSION(jpi,jpk) ::   &  ! 
    271          zmask                           
    272       REAL(wp), DIMENSION(jpi) ::       &  !  
    273          zhmax, zria, zhbl  
    274       REAL(wp) ::                       &  ! 
    275          zflagri, zflagek,              &  ! 
    276          zflagmo, zflagh, zflagkb          ! 
    277       REAL(wp), DIMENSION(jpi)     ::   & !!! Shape function (G) 
    278          za2m, za3m, zkmpm,             & 
    279          za2t, za3t, zkmpt 
    280       REAL(wp) ::                       &  ! 
    281          zdelta, zdelta2,               &  ! 
    282          zdzup, zdzdn, zdzh,            &  ! 
    283          zvath, zgat1, zdat1,           &  ! 
    284          zkm1m, zkm1t 
    285       REAL(wp), DIMENSION(jpi,jpk) ::   & !!! Boundary layer diffusivities/viscosities 
    286          zblcm, zblct                           
     218      INTEGER  ::   jm                          ! dummy loop indices 
     219      REAL(wp) ::   zr1, zr2, zr3, zr4, zrhop   ! Compression terms 
     220#endif 
     221      REAL(wp) ::   zflag, ztemp, zrn2, zdep21, zdep32, zdep43 
     222      REAL(wp) ::   zdku2, zdkv2, ze3sqr, zsh2, zri, zfri          ! Interior richardson mixing 
     223      REAL(wp), DIMENSION(jpi,0:2) ::   zmoek                      ! Moning-Obukov limitation 
     224      REAL(wp), DIMENSION(jpi)     ::   zmoa, zekman                 
     225      REAL(wp)                     ::   zmob, zek 
     226      REAL(wp), DIMENSION(jpi,4)   ::   zdepw, zdift, zvisc   ! The pipe  
     227      REAL(wp), DIMENSION(jpi,3)   ::   zdept 
     228      REAL(wp), DIMENSION(jpi,2)   ::   zriblk 
     229      REAL(wp), DIMENSION(jpi,jpk) ::   zmask                           
     230      REAL(wp), DIMENSION(jpi)     ::   zhmax, zria, zhbl  
     231      REAL(wp) ::   zflagri, zflagek, zflagmo, zflagh, zflagkb   ! 
     232      REAL(wp), DIMENSION(jpi)     ::   za2m, za3m, zkmpm, za2t, za3t, zkmpt   ! Shape function (G) 
     233      REAL(wp) ::   zdelta, zdelta2, zdzup, zdzdn, zdzh, zvath, zgat1, zdat1, zkm1m, zkm1t 
     234      REAL(wp), DIMENSION(jpi,jpk) ::   zblcm, zblct   ! Boundary layer diffusivities/viscosities 
    287235#if defined key_zdfddm 
    288       REAL(wp) ::                       & !!! double diffusion mixing 
    289          zrrau, zds,                    & 
    290          zavdds, zavddt,zinr  
    291       REAL(wp), DIMENSION(jpi,4) ::     &   
    292         zdifs 
    293       REAL(wp), DIMENSION(jpi)     ::   & 
    294          za2s, za3s, zkmps 
    295       REAL(wp) ::                       &  
    296          zkm1s 
    297       REAL(wp), DIMENSION(jpi,jpk) ::   &  
    298          zblcs                      
     236      REAL(wp) ::   zrrau, zds, zavdds, zavddt,zinr   ! double diffusion mixing 
     237      REAL(wp), DIMENSION(jpi,4) ::     zdifs 
     238      REAL(wp), DIMENSION(jpi)     ::   za2s, za3s, zkmps 
     239      REAL(wp) ::                       zkm1s 
     240      REAL(wp), DIMENSION(jpi,jpk) ::   zblcs                      
    299241#endif 
    300242      !!-------------------------------------------------------------------- 
    301  
    302  
    303       ! Initialization (first time-step only) 
    304       ! -------------- 
    305       IF( kt == nit000  )   CALL zdf_kpp_init 
    306243      
    307244      zviscos(:,:,:) = 0. 
     
    12411178      !!                  ***  ROUTINE tra_kpp  *** 
    12421179      !! 
    1243       !! ** Purpose :   compute and add to the tracer trend the non-local 
    1244       !!                tracer flux 
     1180      !! ** Purpose :   compute and add to the tracer trend the non-local tracer flux 
    12451181      !! 
    12461182      !! ** Method  :   ??? 
    1247       !! 
    1248       !! history : 
    1249       !!     1.0  ! 2005-11 (G. Madec)  Original code 
    1250       !!     3.3  ! 2010-06 (C. Ethe)  Merge TRA-TRC 
    12511183      !!---------------------------------------------------------------------- 
    1252       !! * Modules used 
    12531184      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   ztrdt, ztrds   ! 3D workspace 
    12541185      !!---------------------------------------------------------------------- 
     
    13751306      !! 
    13761307      !! ** input   :   Namlist namkpp 
    1377       !! 
    1378       !! 
    1379       !! history : 
    1380       !!     8.1  ! 00-02 (J. Chanut) KPP Mixing 
    1381       !!     9.0  ! 05-01 (C. Ethe) F90 : free form 
    13821308      !!---------------------------------------------------------------------- 
    1383       !! * local declarations 
    1384  
    1385       INTEGER    ::   & 
    1386          ji, jj, jk             ! dummy loop indices 
    1387        
     1309      INTEGER  ::   ji, jj, jk     ! dummy loop indices 
    13881310#if ! defined key_kppcustom 
    1389       INTEGER    ::   & 
    1390          jm                       ! dummy loop indices      
    1391       REAL(wp)   ::              & !!! tempory scalars 
    1392          zref, zdist 
    1393 #endif 
    1394  
     1311      INTEGER  ::   jm             ! dummy loop indices      
     1312      REAL(wp) ::   zref, zdist    ! tempory scalars 
     1313#endif 
    13951314#if defined key_kpplktb 
    1396       REAL(wp)   ::              & !!! tempory scalars 
    1397          zustar,    & 
    1398          zucube, zustvk,         &  
    1399          zeta, zehat 
    1400 #endif 
    1401       REAL(wp)   ::             & !!! tempory scalars 
    1402          zhbf 
    1403       LOGICAL ::                & 
    1404          ll_kppcustom,          &  ! 1st ocean level taken as surface layer 
    1405          ll_kpplktb                ! Lookup table for turbul. velocity scales  
     1315      REAL(wp) ::   zustar, zucube, zustvk, zeta, zehat   ! tempory scalars 
     1316#endif 
     1317      REAL(wp) ::   zhbf           ! tempory scalars 
     1318      LOGICAL  ::   ll_kppcustom   ! 1st ocean level taken as surface layer 
     1319      LOGICAL  ::   ll_kpplktb     ! Lookup table for turbul. velocity scales  
    14061320      !! 
    14071321      NAMELIST/namzdf_kpp/ ln_kpprimix, rn_difmiw, rn_difsiw, rn_riinfty, rn_difri, rn_bvsqcon, rn_difcon, nn_ave 
     
    16101524   LOGICAL, PUBLIC, PARAMETER ::   lk_zdfkpp = .FALSE.   !: KPP flag 
    16111525CONTAINS 
    1612    SUBROUTINE zdf_kpp( kt )          ! Empty routine 
     1526   SUBROUTINE zdf_kpp_init           ! Dummy routine 
     1527      WRITE(*,*) 'zdf_kpp_init: You should not have seen this print! error?' 
     1528   END SUBROUTINE zdf_kpp_init 
     1529   SUBROUTINE zdf_kpp( kt )          ! Dummy routine 
    16131530      WRITE(*,*) 'zdf_kpp: You should not have seen this print! error?', kt 
    16141531   END SUBROUTINE zdf_kpp 
    1615    SUBROUTINE tra_kpp( kt )          ! Empty routine 
     1532   SUBROUTINE tra_kpp( kt )          ! Dummy routine 
    16161533      WRITE(*,*) 'tra_kpp: You should not have seen this print! error?', kt 
    16171534   END SUBROUTINE tra_kpp 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/ZDF/zdfric.F90

    r2027 r2104  
    1010   !!            8.0  ! 1997-06 (G. Madec)  complete rewriting of zdfmix 
    1111   !!   NEMO     1.0  ! 2002-06  (G. Madec)  F90: Free form and module 
     12   !!            3.3  ! 2010-10  (C. Ethe, G. Madec) reorganisation of initialisation phase 
    1213   !!---------------------------------------------------------------------- 
    1314#if defined key_zdfric   ||   defined key_esopa 
     
    4344#  include "domzgr_substitute.h90" 
    4445   !!---------------------------------------------------------------------- 
    45    !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009)  
    46    !! $Id$  
     46   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010)  
     47   !! $Id$ 
    4748   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    4849   !!---------------------------------------------------------------------- 
     
    192193   LOGICAL, PUBLIC, PARAMETER ::   lk_zdfric = .FALSE.   !: Richardson mixing flag 
    193194CONTAINS 
     195   SUBROUTINE zdf_ric_init         ! Dummy routine 
     196   END SUBROUTINE zdf_ric_init 
    194197   SUBROUTINE zdf_ric( kt )        ! Dummy routine 
    195198      WRITE(*,*) 'zdf_ric: You should not have seen this print! error?', kt 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/ZDF/zdftke.F90

    r2027 r2104  
    2525   !!            3.2  !  2009-06  (G. Madec, S. Masson) TKE restart compatible with key_cpl  
    2626   !!                 !                                + cleaning of the parameters + bugs correction 
     27   !!            3.3  !  2010-10  (C. Ethe, G. Madec) reorganisation of initialisation phase 
    2728   !!---------------------------------------------------------------------- 
    2829#if defined key_zdftke   ||   defined key_esopa 
     
    3031   !!   'key_zdftke'                                   TKE vertical physics 
    3132   !!---------------------------------------------------------------------- 
    32    !!   zdf_tke       : update momentum and tracer Kz from a tke scheme 
    33    !!   tke_tke       : tke time stepping: update tke at now time step (en) 
    34    !!   tke_avn       : compute mixing length scale and deduce avm and avt 
    35    !!   tke_init      : initialization, namelist read, and parameters control 
    36    !!   tke_rst       : read/write tke restart in ocean restart file 
     33   !!   zdf_tke      : update momentum and tracer Kz from a tke scheme 
     34   !!   tke_tke      : tke time stepping: update tke at now time step (en) 
     35   !!   tke_avn      : compute mixing length scale and deduce avm and avt 
     36   !!   zdf_tke_init : initialization, namelist read, and parameters control 
     37   !!   tke_rst      : read/write tke restart in ocean restart file 
    3738   !!---------------------------------------------------------------------- 
    3839   USE oce            ! ocean dynamics and active tracers  
     
    5354   PRIVATE 
    5455 
    55    PUBLIC   zdf_tke    ! routine called in step module 
    56    PUBLIC   tke_init   ! routine called in opa module 
    57    PUBLIC   tke_rst    ! routine called in step module 
     56   PUBLIC   zdf_tke        ! routine called in step module 
     57   PUBLIC   zdf_tke_init   ! routine called in opa module 
     58   PUBLIC   tke_rst        ! routine called in step module 
    5859 
    5960   LOGICAL , PUBLIC, PARAMETER              ::   lk_zdftke = .TRUE.  !: TKE vertical mixing flag 
     
    9596#  include "vectopt_loop_substitute.h90" 
    9697   !!---------------------------------------------------------------------- 
    97    !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009)  
    98    !! $Id: zdftke2.F90 1201 2008-09-24 13:24:21Z rblod $ 
     98   !! NEMO/OPA 3,3 , LOCEAN-IPSL (2010)  
     99   !! $Id: $ 
    99100   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    100101   !!---------------------------------------------------------------------- 
     
    150151      !!---------------------------------------------------------------------- 
    151152      ! 
    152                            CALL tke_tke      ! now tke (en) 
    153                            ! 
    154                            CALL tke_avn      ! now avt, avm, avmu, avmv 
     153      CALL tke_tke      ! now tke (en) 
     154      ! 
     155      CALL tke_avn      ! now avt, avm, avmu, avmv 
    155156      ! 
    156157   END SUBROUTINE zdf_tke 
     
    655656 
    656657 
    657    SUBROUTINE tke_init 
     658   SUBROUTINE zdf_tke_init 
    658659      !!---------------------------------------------------------------------- 
    659       !!                  ***  ROUTINE tke_init  *** 
     660      !!                  ***  ROUTINE zdf_tke_init  *** 
    660661      !!                      
    661662      !! ** Purpose :   Initialization of the vertical eddy diffivity and  
     
    685686      IF(lwp) THEN                    !* Control print 
    686687         WRITE(numout,*) 
    687          WRITE(numout,*) 'zdf_tke : tke turbulent closure scheme - initialisation' 
    688          WRITE(numout,*) '~~~~~~~~' 
     688         WRITE(numout,*) 'zdf_tke_init : tke turbulent closure scheme - initialisation' 
     689         WRITE(numout,*) '~~~~~~~~~~~~' 
    689690         WRITE(numout,*) '   Namelist namzdf_tke : set tke mixing parameters' 
    690691         WRITE(numout,*) '      coef. to compute avt                        rn_ediff  = ', rn_ediff 
     
    747748      CALL tke_rst( nit000, 'READ' ) 
    748749      ! 
    749    END SUBROUTINE tke_init 
     750   END SUBROUTINE zdf_tke_init 
    750751 
    751752 
     
    824825   LOGICAL, PUBLIC, PARAMETER ::   lk_zdftke = .FALSE.   !: TKE flag 
    825826CONTAINS 
    826    SUBROUTINE zdf_tke( kt )          ! Empty routine 
     827   SUBROUTINE zdf_tke_init           ! Dummy routine 
     828   END SUBROUTINE zdf_tke_init 
     829   SUBROUTINE zdf_tke( kt )          ! Dummy routine 
    827830      WRITE(*,*) 'zdf_tke: You should not have seen this print! error?', kt 
    828831   END SUBROUTINE zdf_tke 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/ZDF/zdftke_old.F90

    r2027 r2104  
    4848   PRIVATE 
    4949 
    50    PUBLIC   zdf_tke_old   ! routine called in step module 
    51    PUBLIC   zdf_tke_init  ! routine called in opa module 
     50   PUBLIC   zdf_tke_old     ! routine called in step module 
     51   PUBLIC   zdf_tke_init_o  ! routine called in opa module 
    5252 
    5353   LOGICAL , PUBLIC, PARAMETER              ::   lk_zdftke_old = .TRUE.  !: TKE vertical mixing flag 
     
    696696 
    697697 
    698    SUBROUTINE zdf_tke_init 
     698   SUBROUTINE zdf_tke_init_o 
    699699      !!---------------------------------------------------------------------- 
    700       !!                  ***  ROUTINE zdf_tke_init  *** 
     700      !!                  ***  ROUTINE zdf_tke_init_o  *** 
    701701      !!                      
    702702      !! ** Purpose :   Initialization of the vertical eddy diffivity and  
     
    743743      IF(lwp) THEN 
    744744         WRITE(numout,*) 
    745          WRITE(numout,*) 'zdf_tke_init : tke turbulent closure scheme (old scheme)' 
    746          WRITE(numout,*) '~~~~~~~~~~~~' 
     745         WRITE(numout,*) 'zdf_tke_init_o : tke turbulent closure scheme (old scheme)' 
     746         WRITE(numout,*) '~~~~~~~~~~~~~~' 
    747747         WRITE(numout,*) '          Namelist namzdf_tke : set tke mixing parameters' 
    748748         WRITE(numout,*) '             restart with tke from no tke              ln_rstke = ', ln_rstke 
     
    853853      CALL tke_rst( nit000, 'READ' ) 
    854854      ! 
    855    END SUBROUTINE zdf_tke_init 
     855   END SUBROUTINE zdf_tke_init_o 
    856856 
    857857 
     
    901901   LOGICAL, PUBLIC, PARAMETER ::   lk_zdftke_old = .FALSE.   !: TKE flag 
    902902CONTAINS 
    903    SUBROUTINE zdf_tke_old( kt )          ! Empty routine 
     903   SUBROUTINE zdf_tke_init_o             ! Dummy routine 
     904   END SUBROUTINE zdf_tke_init_o 
     905   SUBROUTINE zdf_tke_old( kt )          ! Dummy routine 
    904906      WRITE(*,*) 'zdf_tke_old: You should not have seen this print! error?', kt 
    905907   END SUBROUTINE zdf_tke_old 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/ZDF/zdftmx.F90

    r2027 r2104  
    66   !! History :  1.0  !  2004-04  (L. Bessieres, G. Madec)  Original code 
    77   !!             -   !  2006-08  (A. Koch-Larrouy) Indonesian strait 
     8   !!            3.3  !  2010-10  (C. Ethe, G. Madec) reorganisation of initialisation phase 
    89   !!---------------------------------------------------------------------- 
    910#if defined key_zdftmx 
     
    4849#  include "vectopt_loop_substitute.h90" 
    4950   !!---------------------------------------------------------------------- 
    50    !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009)  
    51    !! $Id$  
     51   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010)  
     52   !! $Id: $ 
    5253   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    5354   !!---------------------------------------------------------------------- 
     
    486487         ! 
    487488      ENDIF 
    488  
     489      ! 
    489490   END SUBROUTINE zdf_tmx_init 
    490491 
     
    495496   LOGICAL, PUBLIC, PARAMETER ::   lk_zdftmx = .FALSE.   !: tidal mixing flag 
    496497CONTAINS 
    497    SUBROUTINE zdf_tmx( kt )          ! Empty routine 
     498   SUBROUTINE zdf_tmx_init           ! Dummy routine 
     499      WRITE(*,*) 'zdf_tmx: You should not have seen this print! error?' 
     500   END SUBROUTINE zdf_tmx_init 
     501   SUBROUTINE zdf_tmx( kt )          ! Dummy routine 
    498502      WRITE(*,*) 'zdf_tmx: You should not have seen this print! error?', kt 
    499503   END SUBROUTINE zdf_tmx 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/cla.F90

    r2027 r2104  
    763763   USE in_out_manager  ! I/O manager 
    764764CONTAINS 
     765   SUBROUTINE tra_cla_init  
     766   END SUBROUTINE tra_cla_init 
    765767   SUBROUTINE tra_cla( kt )  
    766768      INTEGER, INTENT(in) ::   kt    ! ocean time-step indice 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/istate.F90

    r2084 r2104  
    44   !! Ocean state   :  initial state setting 
    55   !!===================================================================== 
    6    !! History :   4.0  !  89-12  (P. Andrich)  Original code 
    7    !!             5.0  !  91-11  (G. Madec)  rewritting 
    8    !!             6.0  !  96-01  (G. Madec)  terrain following coordinates 
    9    !!             8.0  !  01-09  (M. Levy, M. Ben Jelloul)  istate_eel 
    10    !!             8.0  !  01-09  (M. Levy, M. Ben Jelloul)  istate_uvg 
    11    !!             9.0  !  03-08  (G. Madec)  F90: Free form, modules 
    12    !!             9.0  !  03-09  (G. Madec, C. Talandier)  add EEL R5 
    13    !!             9.0  !  04-05  (A. Koch-Larrouy)  istate_gyre  
    14    !!             9.0  !  06-07  (S. Masson)  distributed restart using iom 
     6   !! History :  OPA  !  1989-12  (P. Andrich)  Original code 
     7   !!            5.0  !  1991-11  (G. Madec)  rewritting 
     8   !!            6.0  !  1996-01  (G. Madec)  terrain following coordinates 
     9   !!            8.0  !  2001-09  (M. Levy, M. Ben Jelloul)  istate_eel 
     10   !!            8.0  !  2001-09  (M. Levy, M. Ben Jelloul)  istate_uvg 
     11   !!   NEMO     1.0  !  2003-08  (G. Madec, C. Talandier)  F90: Free form, modules + EEL R5 
     12   !!             -   !  2004-05  (A. Koch-Larrouy)  istate_gyre  
     13   !!            2.0  !  2006-07  (S. Masson)  distributed restart using iom 
     14   !!            3.3  !  2010-10  (C. Ethe) merge TRC-TRA 
    1515   !!---------------------------------------------------------------------- 
    1616 
     
    2525   USE oce             ! ocean dynamics and active tracers  
    2626   USE dom_oce         ! ocean space and time domain  
    27    USE daymod          !  
     27   USE daymod          ! calendar 
     28   USE eosbn2          ! eq. of state, Brunt Vaisala frequency (eos     routine) 
    2829   USE ldftra_oce      ! ocean active tracers: lateral physics 
    2930   USE zdf_oce         ! ocean vertical physics 
     
    3334   USE restart         ! ocean restart                   (rst_read routine) 
    3435   USE in_out_manager  ! I/O manager 
    35    USE iom 
     36   USE iom             ! I/O library 
    3637   USE c1d             ! re-initialization of u-v mask for the 1D configuration 
    3738   USE zpshde          ! partial step: hor. derivative (zps_hde routine) 
     
    5354#  include "vectopt_loop_substitute.h90" 
    5455   !!---------------------------------------------------------------------- 
    55    !!   OPA 9.0 , LOCEAN-IPSL (2006)  
     56   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010)  
    5657   !! $Id$ 
    5758   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
     
    6667      !! ** Purpose :   Initialization of the dynamics and tracer fields. 
    6768      !!---------------------------------------------------------------------- 
    68       USE eosbn2          ! eq. of state, Brunt Vaisala frequency (eos     routine) 
    6969 
    7070      IF(lwp) WRITE(numout,*) 
     
    8282         neuler = 1                              ! Set time-step indicator at nit000 (leap-frog) 
    8383         CALL rst_read                           ! Read the restart file 
    84          CALL tra_swap                           ! swap 3D arrays (ta,sa)  in a 4D array 
     84         CALL tra_swap                           ! swap 3D arrays (t,s)  in a 4D array (ts) 
    8585         CALL day_init                           ! model calendar (using both namelist and restart infos) 
    8686      ELSE 
     
    9191         CALL day_init                           ! model calendar (using both namelist and restart infos) 
    9292         !                                       ! Initialization of ocean to zero 
    93          !     before fields       !       now fields           
    94              ub   (:,:,:) = 0.e0   ;   un   (:,:,:) = 0.e0   ; sshb(:,:) = 0.e0 
    95              vb   (:,:,:) = 0.e0   ;   vn   (:,:,:) = 0.e0   ; sshn(:,:) = 0.e0 
    96              rotb (:,:,:) = 0.e0   ;   rotn (:,:,:) = 0.e0 
    97              hdivb(:,:,:) = 0.e0   ;   hdivn(:,:,:) = 0.e0 
     93         !   before fields     !       now fields      
     94         sshb (:,:)   = 0.e0   ;   sshn (:,:)   = 0.e0 
     95         ub   (:,:,:) = 0.e0   ;   un   (:,:,:) = 0.e0 
     96         vb   (:,:,:) = 0.e0   ;   vn   (:,:,:) = 0.e0   
     97         rotb (:,:,:) = 0.e0   ;   rotn (:,:,:) = 0.e0 
     98         hdivb(:,:,:) = 0.e0   ;   hdivn(:,:,:) = 0.e0 
    9899         ! 
    99100         IF( cp_cfg == 'eel' ) THEN 
    100             CALL istate_eel                      ! EEL   configuration : start from pre-defined 
    101             !                                    !                       velocity and thermohaline fields 
     101            CALL istate_eel                      ! EEL   configuration : start from pre-defined U,V T-S fields 
    102102         ELSEIF( cp_cfg == 'gyre' ) THEN          
    103             CALL istate_gyre                     ! GYRE  configuration : start from pre-defined temperature 
    104             !                                    !                       and salinity fields  
     103            CALL istate_gyre                     ! GYRE  configuration : start from pre-defined T-S fields 
    105104         ELSE 
    106             !                                    ! Other configurations: Initial temperature and salinity fields 
     105            !                                    ! Other configurations: Initial T-S fields 
    107106#if defined key_dtatem 
    108107            CALL dta_tem( nit000 )                  ! read 3D temperature data 
    109             tb(:,:,:) = t_dta(:,:,:)                ! use temperature data read 
    110             tn(:,:,:) = t_dta(:,:,:) 
     108            tb(:,:,:) = t_dta(:,:,:)   ;   tn(:,:,:) = t_dta(:,:,:) 
     109             
    111110#else 
    112111            IF(lwp) WRITE(numout,*)                 ! analytical temperature profile 
     
    116115#if defined key_dtasal 
    117116            CALL dta_sal( nit000 )                  ! read 3D salinity data 
    118             sb(:,:,:) = s_dta(:,:,:)                ! use salinity data read 
    119             sn(:,:,:) = s_dta(:,:,:) 
     117            sb(:,:,:) = s_dta(:,:,:)   ;   sn(:,:,:) = s_dta(:,:,:) 
    120118#else 
    121119            ! No salinity data 
     
    125123#endif 
    126124         ENDIF 
    127  
    128          CALL tra_swap                     ! swap 3D arrays (ta,sa)  in a 4D array 
     125         ! 
     126         CALL tra_swap                     ! swap 3D arrays (tb,sb,tn,sn)  in a 4D array 
    129127         CALL eos( tsb, rhd, rhop )        ! before potential and in situ densities 
    130          IF( ln_zps .AND. .NOT. lk_c1d )   & 
    131                            CALL zps_hde( nit000, jpts, tsb, gtsu, gtsv,  &    ! Partial steps: before horizontal gradient 
    132             &                                          rhd, gru , grv  )      ! of t, s, rd at the last ocean level 
    133           
     128         IF( ln_zps .AND. .NOT. lk_c1d )   CALL zps_hde( nit000, jpts, tsb, gtsu, gtsv,  & ! zps: before hor. gradient 
     129            &                                                          rhd, gru , grv  )   ! of t,s,rd at ocean bottom 
     130         !     
    134131      ENDIF 
    135132      ! 
    136       IF( lk_agrif ) THEN 
    137          ! read free surface arrays in restart file 
     133      IF( lk_agrif ) THEN                  ! read free surface arrays in restart file 
    138134         IF( ln_rstart ) THEN 
    139135            IF( lk_dynspg_flt )   CALL flt_rst( nit000, 'READ' )      ! read or initialize the following fields 
     
    162158      IF(lwp) WRITE(numout,*) 'istate_tem : initial temperature profile' 
    163159      IF(lwp) WRITE(numout,*) '~~~~~~~~~~' 
    164  
     160      ! 
    165161      DO jk = 1, jpk 
    166162         DO jj = 1, jpj 
     
    173169        END DO 
    174170      END DO 
    175  
     171      ! 
    176172      IF(lwp) CALL prizre( tn    , jpi   , jpj   , jpk   , jpj/2 ,   & 
    177173         &                 1     , jpi   , 5     , 1     , jpk   ,   & 
     
    193189      REAL(wp) ::   zsal = 35.50_wp 
    194190      !!---------------------------------------------------------------------- 
    195  
     191      ! 
    196192      IF(lwp) WRITE(numout,*) 
    197193      IF(lwp) WRITE(numout,*) 'istate_sal : initial salinity : ', zsal 
    198194      IF(lwp) WRITE(numout,*) '~~~~~~~~~~' 
    199  
     195      ! 
    200196      sn(:,:,:) = zsal * tmask(:,:,:) 
    201197      sb(:,:,:) = sn(:,:,:) 
    202        
     198      ! 
    203199   END SUBROUTINE istate_sal 
    204200 
     
    216212      !!                and relative vorticity fields 
    217213      !!---------------------------------------------------------------------- 
    218       USE eosbn2     ! eq. of state, Brunt Vaisala frequency (eos     routine) 
    219214      USE divcur     ! hor. divergence & rel. vorticity      (div_cur routine) 
    220215      USE iom 
     
    224219      INTEGER  ::   ijloc 
    225220      REAL(wp) ::   zh1, zh2, zslope, zcst, zfcor   ! temporary scalars 
    226       REAL(wp) ::   zt1  = 15._wp,               &  ! surface temperature value (EEL R5) 
    227          &          zt2  =  5._wp,               &  ! bottom  temperature value (EEL R5) 
    228          &          zsal = 35.0_wp,              &  ! constant salinity (EEL R2, R5 and R6) 
    229          &          zueel = 0.1_wp                  ! constant uniform zonal velocity (EEL R5) 
     221      REAL(wp) ::   zt1  = 15._wp                   ! surface temperature value (EEL R5) 
     222      REAL(wp) ::   zt2  =  5._wp                   ! bottom  temperature value (EEL R5) 
     223      REAL(wp) ::   zsal = 35.0_wp                  ! constant salinity (EEL R2, R5 and R6) 
     224      REAL(wp) ::   zueel = 0.1_wp                  ! constant uniform zonal velocity (EEL R5) 
    230225      REAL(wp), DIMENSION(jpiglo,jpjglo) ::   zssh  ! initial ssh over the global domain 
    231226      !!---------------------------------------------------------------------- 
     
    235230         CASE ( 5 )                                     ! EEL R5 configuration 
    236231            !                                           ! ==================== 
    237  
     232            ! 
    238233            ! set temperature field with a linear profile 
    239234            ! ------------------------------------------- 
     
    241236            IF(lwp) WRITE(numout,*) 'istate_eel : EEL R5: linear temperature profile' 
    242237            IF(lwp) WRITE(numout,*) '~~~~~~~~~~' 
    243  
     238            ! 
    244239            zh1 = gdept_0(  1  ) 
    245240            zh2 = gdept_0(jpkm1) 
    246  
     241            !