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

Changeset 4617


Ignore:
Timestamp:
2014-04-06T17:47:31+02:00 (10 years ago)
Author:
gm
Message:

#1260 : TOP fixes, see the associated wiki page for explanation

Location:
branches/2014/dev_CNRS0_NOC1_LDF/NEMOGCM
Files:
26 edited

Legend:

Unmodified
Added
Removed
  • branches/2014/dev_CNRS0_NOC1_LDF/NEMOGCM/CONFIG/GYRE_BFM/cpp_GYRE_BFM.fcm

    r4230 r4617  
    1 bld::tool::fppkeys key_dynspg_flt key_ldfslp key_zdftke key_vectopt_loop key_top key_my_trc key_mpp_mpi key_iomput 
     1bld::tool::fppkeys key_dynspg_flt key_ldfslp key_zdftke key_top key_my_trc key_mpp_mpi key_iomput 
    22inc $BFMDIR/src/nemo/bfm.fcm 
  • branches/2014/dev_CNRS0_NOC1_LDF/NEMOGCM/CONFIG/GYRE_PISCES/EXP00/iodef.xml

    r4245 r4617  
    7474        </file> 
    7575 
    76    <file id="file5" name="_ptrc_T" description="lobster sms variables" > 
     76   <file id="file5" name_suffix="_ptrc_T" description="lobster sms variables" > 
    7777          <field field_ref="DET"      /> 
    7878          <field field_ref="ZOO"      /> 
  • branches/2014/dev_CNRS0_NOC1_LDF/NEMOGCM/CONFIG/GYRE_PISCES/EXP00/namelist_cfg

    r4370 r4617  
    3131   ln_zco      = .true.    !  z-coordinate - full    steps   (T/F)      ("key_zco" may also be defined) 
    3232   ln_zps      = .false.   !  z-coordinate - partial steps   (T/F) 
     33/ 
     34!----------------------------------------------------------------------- 
     35&namzgr_sco    !   s-coordinate or hybrid z-s-coordinate 
     36!----------------------------------------------------------------------- 
    3337/ 
    3438!----------------------------------------------------------------------- 
     
    7882!----------------------------------------------------------------------- 
    7983   nn_fsbc     = 1         !  frequency of surface boundary condition computation 
    80                            !     (also = the frequency of sea-ice model call) 
     84   !                       !     (also = the frequency of sea-ice model call) 
    8185   ln_ana      = .true.    !  analytical formulation                    (T => fill namsbc_ana ) 
    8286   ln_blk_core = .false.   !  CORE bulk formulation                     (T => fill namsbc_core) 
     
    8791/ 
    8892!----------------------------------------------------------------------- 
     93&namsbc_ana    !   analytical surface boundary condition 
     94!----------------------------------------------------------------------- 
     95   nn_tau000   =   100     !  gently increase the stress over the first ntau_rst time-steps 
     96   rn_utau0    =   0.1e0   !  uniform value for the i-stress 
     97/ 
     98!----------------------------------------------------------------------- 
     99&namsbc_flx    !   surface boundary condition : flux formulation 
     100!----------------------------------------------------------------------- 
     101/ 
     102!----------------------------------------------------------------------- 
     103&namsbc_clio   !   namsbc_clio  CLIO bulk formulae 
     104!----------------------------------------------------------------------- 
     105/ 
     106!----------------------------------------------------------------------- 
     107&namsbc_core   !   namsbc_core  CORE bulk formulae 
     108!----------------------------------------------------------------------- 
     109/ 
     110!----------------------------------------------------------------------- 
     111&namsbc_mfs   !   namsbc_mfs  MFS bulk formulae 
     112!----------------------------------------------------------------------- 
     113/ 
     114!----------------------------------------------------------------------- 
     115&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_coupled") 
     116!----------------------------------------------------------------------- 
     117/ 
     118!----------------------------------------------------------------------- 
    89119&namtra_qsr    !   penetrative solar radiation 
    90120!----------------------------------------------------------------------- 
     
    93123   nn_chldta   =      0    !  RGB : Chl data (=1) or cst value (=0) 
    94124/ 
    95  
     125!----------------------------------------------------------------------- 
     126&namsbc_rnf    !   runoffs namelist surface boundary condition 
     127!----------------------------------------------------------------------- 
     128   ln_rnf_mouth = .false.   !  specific treatment at rivers mouths 
     129/ 
     130!----------------------------------------------------------------------- 
     131&namsbc_apr    !   Atmospheric pressure used as ocean forcing or in bulk 
     132!----------------------------------------------------------------------- 
     133/ 
     134!----------------------------------------------------------------------- 
     135&namsbc_ssr    !   surface boundary condition : sea surface restoring 
     136!----------------------------------------------------------------------- 
     137   nn_sssr     =     0     !  add a damping     term in the surface freshwater flux (=2) 
     138   rn_deds     =   -27.7   !  magnitude of the damping on salinity   [mm/day] 
     139   ln_sssr_bnd =   .false. !  flag to bound erp term (associated with nn_sssr=2) 
     140/ 
     141!----------------------------------------------------------------------- 
     142&namsbc_alb    !   albedo parameters 
     143!----------------------------------------------------------------------- 
     144/ 
    96145!----------------------------------------------------------------------- 
    97146&namberg       !   iceberg parameters 
     
    105154!----------------------------------------------------------------------- 
    106155&namcla        !   cross land advection 
     156!----------------------------------------------------------------------- 
     157/ 
     158!----------------------------------------------------------------------- 
     159&namobc        !   open boundaries parameters                           ("key_obc") 
     160!----------------------------------------------------------------------- 
     161/ 
     162!----------------------------------------------------------------------- 
     163&namagrif      !  AGRIF zoom                                            ("key_agrif") 
     164!----------------------------------------------------------------------- 
     165/ 
     166!----------------------------------------------------------------------- 
     167&nam_tide      !    tide parameters (#ifdef key_tide) 
     168!----------------------------------------------------------------------- 
     169/ 
     170!----------------------------------------------------------------------- 
     171&nambdy        !  unstructured open boundaries                          ("key_bdy") 
     172!----------------------------------------------------------------------- 
     173/ 
     174!----------------------------------------------------------------------- 
     175&nambdy_dta      !  open boundaries - external data           ("key_bdy") 
     176!----------------------------------------------------------------------- 
     177/ 
     178!----------------------------------------------------------------------- 
     179&nambdy_tide     ! tidal forcing at open boundaries 
    107180!----------------------------------------------------------------------- 
    108181/ 
     
    119192/ 
    120193!----------------------------------------------------------------------- 
     194&nambbl        !   bottom boundary layer scheme 
     195!----------------------------------------------------------------------- 
     196/ 
     197!----------------------------------------------------------------------- 
    121198&nameos        !   ocean physical parameters 
    122199!----------------------------------------------------------------------- 
     
    127204!----------------------------------------------------------------------- 
    128205   ln_traadv_msc_ups=  .false.  !  use upstream scheme within muscl  
     206/ 
     207!----------------------------------------------------------------------- 
     208&namtra_adv_mle !  mixed layer eddy parametrisation (Fox-Kemper param) 
     209!----------------------------------------------------------------------- 
    129210/ 
    130211!---------------------------------------------------------------------------------- 
    131212&namtra_ldf    !   lateral diffusion scheme for tracers 
    132213!---------------------------------------------------------------------------------- 
    133    rn_aeiv_0        =     0.    !  eddy induced velocity coefficient [m2/s] 
    134    rn_aht_0         =  1000.    !  horizontal eddy diffusivity for tracers [m2/s] 
     214   !                       !  Operator type: 
     215   ln_traldf_lap   =  .true.   !  laplacian operator 
     216   ln_traldf_blp   =  .false.  !  bilaplacian operator 
     217   !                       !  Direction of action: 
     218   ln_traldf_lev   =  .false.  !  iso-level 
     219   ln_traldf_hor   =  .false.  !  horizontal (geopotential) 
     220   ln_traldf_iso   =  .false.  !  iso-neutral 
     221   ln_traldf_triad =  .true.   !  iso-neutral with Griffies triads 
     222   ! 
     223   !                       !  iso-neutral options          
     224   ln_traldf_msc   =  .true.   !  Method of Stabilizing Correction (both operator) 
     225   rn_slpmax       =   0.01    !  slope limit                      (both operator) 
     226   ln_triad_iso    =  .false.  !  pure horizontal mixing in ML     (triad only) 
     227   ln_botmix_triad =  .false.  !  lateral mixing on bottom         (triad only) 
     228   ! 
     229   !                       !  Coefficients 
     230   nn_aht_ijk_t    =  0        !  space/time variation of eddy coef 
     231   !                                   !   =0 constant ; =10 F(k) ; =20 F(i,j)=F(grid spacing) ; =30 F(i,j,k)  
     232   !                                   !   =21 F(i,jt)=Treguier et al. JPO 1997 formulation 
     233   !                                   !   =-20 (=-30) read in eddy_induced_velocity_2D.nc (..._3D.nc) file 
     234   rn_aht_0        = 1000.     !  lateral eddy diffusivity   (lap. operator) [m2/s] 
     235   rn_bht_0        = 5.e+11    !  lateral eddy diffusivity (bilap. operator) [m4/s] 
     236/ 
     237!---------------------------------------------------------------------------------- 
     238&namtra_ldfeiv !   eddy induced velocity param. 
     239!---------------------------------------------------------------------------------- 
     240   ln_ldfeiv     =.false.  ! use eddy induced velocity parameterization 
     241   ln_ldfeiv_dia =.false.  ! diagnose eiv stream function and velocities 
     242   rn_aeiv_0     = 1000.   ! eddy induced velocity coefficient   [m2/s] 
     243   nn_aei_ijk_t  =  0      ! space/time variation of the eiv coeficient 
     244   !                              !   =0 constant ; =10 F(k) ; =20 F(i,j) = F(grid spacing) ; =30 F(i,j,k)  
     245   !                              !   =21 F(i,jt)=Treguier et al. JPO 1997 formulation 
     246   !                              !   =-20 (=-30) read in eddy_induced_velocity_2D.nc (..._3D.nc) file 
    135247/ 
    136248!----------------------------------------------------------------------- 
     
    159271/ 
    160272!----------------------------------------------------------------------- 
     273!namdyn_spg    !   surface pressure gradient   (CPP key only) 
     274!----------------------------------------------------------------------- 
     275 
     276!----------------------------------------------------------------------- 
    161277&namdyn_ldf    !   lateral diffusion on momentum 
    162278!----------------------------------------------------------------------- 
    163    rn_ahm_0_lap     = 100000.   !  horizontal laplacian eddy viscosity   [m2/s] 
     279   !                       !  Type of the operator : 
     280   ln_dynldf_lap =  .true.     !  laplacian operator 
     281   ln_dynldf_blp =  .false.    !  bilaplacian operator 
     282   !                       !  Direction of action  : 
     283   ln_dynldf_lev =  .false.    !  iso-level 
     284   ln_dynldf_hor =  .true.     !  horizontal (geopotential) 
     285   ln_dynldf_iso =  .false.    !  iso-neutral 
     286   !                       !  Coefficient 
     287   nn_ahm_ijk_t  = 0           !  space/time variation of eddy coef 
     288   !                                !   =0 constant ; =10 F(k) ; =20 F(i,j)=F(grid spacing) ; =30 F(i,j,k)  
     289   !                                !   =-20 (=-30) read in eddy_induced_velocity_2D.nc (..._3D.nc) file 
     290   rn_ahm_0      = 100000.     !  horizontal laplacian eddy viscosity   [m2/s] 
     291   rn_ahm_b      =      0.     !  background eddy viscosity for ldf_iso [m2/s] 
     292   rn_bhm_0      = 1.e+12      !  horizontal bilaplacian eddy viscosity [m4/s] 
    164293/ 
    165294!----------------------------------------------------------------------- 
     
    169298/ 
    170299!----------------------------------------------------------------------- 
     300&namzdf_ric    !   richardson number dependent vertical diffusion       ("key_zdfric" ) 
     301!----------------------------------------------------------------------- 
     302/ 
     303!----------------------------------------------------------------------- 
    171304&namzdf_tke    !   turbulent eddy kinetic dependent vertical diffusion  ("key_zdftke") 
    172305!----------------------------------------------------------------------- 
    173306   nn_etau     =   0       !  penetration of tke below the mixed layer (ML) due to internal & intertial waves 
     307/ 
     308!------------------------------------------------------------------------ 
     309&namzdf_kpp    !   K-Profile Parameterization dependent vertical mixing  ("key_zdfkpp", and optionally: 
     310!------------------------------------------------------------------------ "key_kppcustom" or "key_kpplktb") 
     311/ 
     312!----------------------------------------------------------------------- 
     313&namzdf_gls                !   GLS vertical diffusion                   ("key_zdfgls") 
     314!----------------------------------------------------------------------- 
     315/ 
     316!----------------------------------------------------------------------- 
     317&namzdf_ddm    !   double diffusive mixing parameterization             ("key_zdfddm") 
     318!----------------------------------------------------------------------- 
     319/ 
     320!----------------------------------------------------------------------- 
     321&namzdf_tmx    !   tidal mixing parameterization                        ("key_zdftmx") 
     322!----------------------------------------------------------------------- 
     323   ln_tmx_itf  = .false.   !  ITF specific parameterisation 
    174324/ 
    175325!----------------------------------------------------------------------- 
     
    189339/ 
    190340!----------------------------------------------------------------------- 
     341&namnc4        !   netcdf4 chunking and compression settings            ("key_netcdf4") 
     342!----------------------------------------------------------------------- 
     343/ 
     344!----------------------------------------------------------------------- 
     345&namtrd        !   diagnostics on dynamics and/or tracer trends         ("key_trddyn" and/or "key_trdtra") 
     346!              !       or mixed-layer trends or barotropic vorticity    ("key_trdmld" or     "key_trdvor") 
     347!----------------------------------------------------------------------- 
     348/ 
     349!----------------------------------------------------------------------- 
     350&namflo       !   float parameters                                      ("key_float") 
     351!----------------------------------------------------------------------- 
     352/ 
     353!----------------------------------------------------------------------- 
    191354&namptr       !   Poleward Transport Diagnostic 
    192355!----------------------------------------------------------------------- 
     
    197360/ 
    198361!----------------------------------------------------------------------- 
     362&namdct        ! transports through sections 
     363!----------------------------------------------------------------------- 
     364    nn_dct      = 60       !  time step frequency for transports computing 
     365    nn_dctwri   = 60       !  time step frequency for transports writing 
     366    nn_secdebug = 0        !      0 : no section to debug 
     367/ 
     368!----------------------------------------------------------------------- 
     369&namobs       !  observation usage switch                               ('key_diaobs') 
     370!----------------------------------------------------------------------- 
     371/ 
     372!----------------------------------------------------------------------- 
     373&nam_asminc   !   assimilation increments                               ('key_asminc') 
     374!----------------------------------------------------------------------- 
     375/ 
     376!----------------------------------------------------------------------- 
     377&namsbc_wave   ! External fields from wave model 
     378!----------------------------------------------------------------------- 
     379/ 
     380!----------------------------------------------------------------------- 
    199381&namdyn_nept  !   Neptune effect (simplified: lateral and vertical diffusions removed) 
    200382!----------------------------------------------------------------------- 
  • branches/2014/dev_CNRS0_NOC1_LDF/NEMOGCM/CONFIG/GYRE_PISCES/cpp_GYRE_PISCES.fcm

    r4230 r4617  
    1 bld::tool::fppkeys  key_dynspg_flt key_ldfslp key_zdftke key_top key_pisces_reduced key_iomput key_mpp_mpi  
     1bld::tool::fppkeys  key_dynspg_flt key_zdftke key_top key_pisces_reduced key_iomput key_mpp_mpi 
  • branches/2014/dev_CNRS0_NOC1_LDF/NEMOGCM/NEMO/TOP_SRC/PISCES/P2Z/p2zbio.F90

    r4147 r4617  
    6666   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 
    6767   !!---------------------------------------------------------------------- 
    68  
    6968CONTAINS 
    7069 
     
    9089      !!              for passive tracers are saved for futher diagnostics. 
    9190      !!--------------------------------------------------------------------- 
    92       !! 
    9391      INTEGER, INTENT( in ) ::   kt      ! ocean time-step index       
    94       !! 
     92      ! 
    9593      INTEGER  ::   ji, jj, jk, jl 
    9694      REAL(wp) ::   zdet, zzoo, zphy, zno3, znh4, zdom      ! now concentrations 
     
    476474   END SUBROUTINE p2z_bio 
    477475 
     476 
    478477   SUBROUTINE p2z_bio_init 
    479478      !!---------------------------------------------------------------------- 
     
    485484      !! 
    486485      !!---------------------------------------------------------------------- 
     486      INTEGER ::   ios   ! local integer  
     487      !! 
    487488      NAMELIST/namlobphy/ tmumax, rgamma, fphylab, tmminp, aki 
    488489      NAMELIST/namlobnut/ akno3, aknh4, taunn, psinut 
     
    490491      NAMELIST/namlobdet/  taudn, fdetlab 
    491492      NAMELIST/namlobdom/ taudomn 
    492       INTEGER :: ios                 ! Local integer output status for namelist read 
    493493      !!---------------------------------------------------------------------- 
    494494 
  • branches/2014/dev_CNRS0_NOC1_LDF/NEMOGCM/NEMO/TOP_SRC/PISCES/P2Z/p2zexp.F90

    r3446 r4617  
    4848   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 
    4949   !!---------------------------------------------------------------------- 
    50  
    5150CONTAINS 
    5251 
     
    6463      !!              COLUMN BELOW THE SURFACE LAYER. 
    6564      !!--------------------------------------------------------------------- 
    66       !! 
    6765      INTEGER, INTENT( in ) ::   kt      ! ocean time-step index       
    68       !! 
     66      ! 
    6967      INTEGER  ::   ji, jj, jk, jl, ikt 
    7068      REAL(wp) ::   zgeolpoc, zfact, zwork, ze3t, zsedpocd, zmaskt 
     
    7775      ! 
    7876      IF( kt == nittrc000 )   CALL p2z_exp_init 
    79  
     77      ! 
    8078      CALL wrk_alloc( jpi, jpj, zsedpoca )  
    81       zsedpoca(:,:) = 0. 
     79      zsedpoca(:,:) = 0._wp 
    8280 
    8381      IF( l_trdtrc )  THEN 
     
    102100      ! Find the last level of the water column 
    103101      ! Compute fluxes due to sinking particles (slow) 
    104     
    105102 
    106103      zgeolpoc = 0.e0         !     Initialization 
     
    180177   END SUBROUTINE p2z_exp 
    181178 
     179 
    182180   SUBROUTINE p2z_exp_init 
    183181      !!---------------------------------------------------------------------- 
     
    272270   END SUBROUTINE p2z_exp_init 
    273271 
     272 
    274273   INTEGER FUNCTION p2z_exp_alloc() 
    275274      !!---------------------------------------------------------------------- 
  • branches/2014/dev_CNRS0_NOC1_LDF/NEMOGCM/NEMO/TOP_SRC/PISCES/P2Z/p2zopt.F90

    r4147 r4617  
    4747   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 
    4848   !!---------------------------------------------------------------------- 
    49  
    5049CONTAINS 
    5150 
     
    6463      !!                neln   ??? 
    6564      !!--------------------------------------------------------------------- 
    66       !! 
    6765      INTEGER, INTENT( in ) ::   kt   ! index of the time stepping 
    68       !! 
     66      ! 
    6967      INTEGER  ::   ji, jj, jk          ! dummy loop indices 
    7068      CHARACTER (len=25) ::   charout   ! temporary character 
     
    153151   END SUBROUTINE p2z_opt 
    154152 
     153 
    155154   SUBROUTINE p2z_opt_init 
    156155      !!---------------------------------------------------------------------- 
     
    164163      NAMELIST/namlobopt/ xkg0, xkr0, xkgp, xkrp, xlg, xlr, rpig 
    165164      NAMELIST/namlobrat/ rcchl, redf, reddom 
    166       INTEGER :: ios                 ! Local integer output status for namelist read 
     165      INTEGER ::   ios   ! local integer 
    167166      !!---------------------------------------------------------------------- 
    168  
     167      ! 
    169168      REWIND( numnatp_ref )              ! Namelist namlobopt in reference namelist : Lobster options 
    170169      READ  ( numnatp_ref, namlobopt, IOSTAT = ios, ERR = 901) 
    171170901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namlobopt in reference namelist', lwp ) 
    172  
     171      ! 
    173172      REWIND( numnatp_cfg )              ! Namelist namlobopt in configuration namelist : Lobster options 
    174173      READ  ( numnatp_cfg, namlobopt, IOSTAT = ios, ERR = 902 ) 
    175174902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namlobopt in configuration namelist', lwp ) 
    176175      WRITE ( numonp, namlobopt ) 
    177  
     176      ! 
    178177      IF(lwp) THEN 
    179178         WRITE(numout,*) 
     
    192191      READ  ( numnatp_ref, namlobrat, IOSTAT = ios, ERR = 903) 
    193192903   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namlobrat in reference namelist', lwp ) 
    194  
     193      ! 
    195194      REWIND( numnatp_cfg )              ! Namelist namlobrat in configuration namelist : Lobster ratios 
    196195      READ  ( numnatp_cfg, namlobrat, IOSTAT = ios, ERR = 904 ) 
    197196904   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namlobrat in configuration namelist', lwp ) 
    198197      WRITE ( numonp, namlobrat ) 
    199  
     198      ! 
    200199      IF(lwp) THEN 
    201200          WRITE(numout,*) ' Namelist namlobrat' 
  • branches/2014/dev_CNRS0_NOC1_LDF/NEMOGCM/NEMO/TOP_SRC/PISCES/P2Z/p2zsed.F90

    r4147 r4617  
    4141   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 
    4242   !!---------------------------------------------------------------------- 
    43  
    4443CONTAINS 
    4544 
     
    6261      !!              trend of passive tracers is saved for futher diagnostics. 
    6362      !!--------------------------------------------------------------------- 
    64       !! 
    6563      INTEGER, INTENT( in ) ::   kt      ! ocean time-step index       
    6664      !! 
     
    7876         IF(lwp) WRITE(numout,*) ' ~~~~~~~' 
    7977      ENDIF 
    80  
    81       ! Allocate temporary workspace 
    82                        CALL wrk_alloc( jpi, jpj, jpk, zwork, ztra ) 
    83       IF( ln_diatrc )  CALL wrk_alloc( jpi, jpj, zw2d ) 
     78      ! 
     79      CALL wrk_alloc( jpi, jpj, jpk, zwork, ztra ) 
     80      ! 
    8481      IF( l_trdtrc ) THEN 
    8582         CALL wrk_alloc( jpi, jpj, jpk, ztrbio ) 
     
    110107 
    111108      IF( ln_diatrc ) THEN  
    112          DO jk = 1, jpkm1 
     109         CALL wrk_alloc( jpi, jpj, zw2d ) 
     110         zw2d(:,:) = ztra(:,:,1) * fse3t(:,:,1) * 86400. 
     111         DO jk = 2, jpkm1 
    113112            zw2d(:,:) = zw2d(:,:) + ztra(:,:,jk) * fse3t(:,:,jk) * 86400. 
    114113         END DO 
     
    121120      ENDIF 
    122121      ! 
    123       IF( ln_diabio )  trbio(:,:,:,jp_pcs0_trd + 7) = ztra(:,:,:) 
     122      IF( ln_diabio .AND. .NOT.lk_iomput )  trbio(:,:,:,jp_pcs0_trd + 7) = ztra(:,:,:) 
    124123      CALL wrk_dealloc( jpi, jpj, jpk, zwork, ztra ) 
    125124      ! 
     
    130129         CALL wrk_dealloc( jpi, jpj, jpk, ztrbio ) 
    131130      ENDIF 
    132  
     131      ! 
    133132      IF(ln_ctl)   THEN  ! print mean trends (used for debugging) 
    134133         WRITE(charout, FMT="('sed')") 
     
    141140   END SUBROUTINE p2z_sed 
    142141 
     142 
    143143   SUBROUTINE p2z_sed_init 
    144144      !!---------------------------------------------------------------------- 
     
    150150      !! 
    151151      !!---------------------------------------------------------------------- 
     152      INTEGER ::   ios   ! Local integer 
     153      ! 
    152154      NAMELIST/namlobsed/ sedlam, sedlostpoc, vsed, xhr 
    153       INTEGER :: ios                 ! Local integer output status for namelist read 
    154  
     155      !!---------------------------------------------------------------------- 
     156      ! 
    155157      REWIND( numnatp_ref )              ! Namelist namlobsed in reference namelist : Lobster sediments 
    156158      READ  ( numnatp_ref, namlobsed, IOSTAT = ios, ERR = 901) 
    157159901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namlosed in reference namelist', lwp ) 
    158  
     160      ! 
    159161      REWIND( numnatp_cfg )              ! Namelist namlobsed in configuration namelist : Lobster sediments 
    160162      READ  ( numnatp_cfg, namlobsed, IOSTAT = ios, ERR = 902 ) 
    161163902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namlobsed in configuration namelist', lwp ) 
    162164      WRITE ( numonp, namlobsed ) 
    163  
     165      ! 
    164166      IF(lwp) THEN 
    165167          WRITE(numout,*) ' Namelist namlobsed' 
  • branches/2014/dev_CNRS0_NOC1_LDF/NEMOGCM/NEMO/TOP_SRC/PISCES/P2Z/p2zsms.F90

    r4147 r4617  
    5858      CALL p2z_sed( kt )      ! sedimentation model 
    5959      CALL p2z_exp( kt )      ! export 
    60  
     60      ! 
    6161      IF( l_trdtrc ) THEN 
    6262         DO jn = jp_pcs0, jp_pcs1 
     
    6464         END DO 
    6565      END IF 
    66  
     66      ! 
    6767      IF( lk_trdmld_trc )  CALL trd_mld_bio( kt )   ! trends: Mixed-layer 
    6868      ! 
    69       IF ( kt == nittrc000 ) CALL FLUSH    ( numonp )     ! flush output namelist PISCES 
    70       IF( nn_timing == 1 )  CALL timing_stop('p2z_sms') 
     69      IF( kt == nittrc000 )   CALL FLUSH( numonp )       ! flush output namelist PISCES 
     70      IF( nn_timing == 1  )   CALL timing_stop('p2z_sms') 
    7171      ! 
    7272   END SUBROUTINE p2z_sms 
  • branches/2014/dev_CNRS0_NOC1_LDF/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zche.F90

    r3557 r4617  
    195195      ! CHEMICAL CONSTANTS - SURFACE LAYER 
    196196      ! ---------------------------------- 
    197 !CDIR NOVERRCHK 
    198197      DO jj = 1, jpj 
    199 !CDIR NOVERRCHK 
    200198         DO ji = 1, jpi 
    201199            !                             ! SET ABSOLUTE TEMPERATURE 
     
    227225      ! OXYGEN SOLUBILITY - DEEP OCEAN 
    228226      ! ------------------------------- 
    229 !CDIR NOVERRCHK 
    230227      DO jk = 1, jpk 
    231 !CDIR NOVERRCHK 
    232228         DO jj = 1, jpj 
    233 !CDIR NOVERRCHK 
    234229            DO ji = 1, jpi 
    235230              ztkel = tsn(ji,jj,jk,jp_tem) + 273.16 
     
    252247      ! CHEMICAL CONSTANTS - DEEP OCEAN 
    253248      ! ------------------------------- 
    254 !CDIR NOVERRCHK 
    255249      DO jk = 1, jpk 
    256 !CDIR NOVERRCHK 
    257250         DO jj = 1, jpj 
    258 !CDIR NOVERRCHK 
    259251            DO ji = 1, jpi 
    260252 
  • branches/2014/dev_CNRS0_NOC1_LDF/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zfechem.F90

    r4529 r4617  
    113113         ! Chemistry is supposed to be fast enough to be at equilibrium 
    114114         ! ------------------------------------------------------------ 
    115 !CDIR NOVERRCHK 
    116115         DO jk = 1, jpkm1 
    117 !CDIR NOVERRCHK 
    118116            DO jj = 1, jpj 
    119 !CDIR NOVERRCHK 
    120117               DO ji = 1, jpi 
    121118                  ! Calculate ligand concentrations : assume 2/3rd of excess goes to 
     
    195192         ! Chemistry is supposed to be fast enough to be at equilibrium 
    196193         ! ------------------------------------------------------------ 
    197 !CDIR NOVERRCHK 
    198194         DO jk = 1, jpkm1 
    199 !CDIR NOVERRCHK 
    200195            DO jj = 1, jpj 
    201 !CDIR NOVERRCHK 
    202196               DO ji = 1, jpi 
    203197                  zTL1(ji,jj,jk) = ztotlig(ji,jj,jk) 
     
    217211      ENDIF 
    218212 
    219       zdust = 0.         ! if no dust available 
    220 !CDIR NOVERRCHK 
     213      zdust = 0._wp         ! if no dust available 
    221214      DO jk = 1, jpkm1 
    222 !CDIR NOVERRCHK 
    223215         DO jj = 1, jpj 
    224 !CDIR NOVERRCHK 
    225216            DO ji = 1, jpi 
    226217               zstep = xstep 
  • branches/2014/dev_CNRS0_NOC1_LDF/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zflx.F90

    r4230 r4617  
    122122 
    123123      DO jm = 1, 10 
    124 !CDIR NOVERRCHK 
    125124         DO jj = 1, jpj 
    126 !CDIR NOVERRCHK 
    127125            DO ji = 1, jpi 
    128126 
     
    155153      ! ------------------------------------------- 
    156154 
    157 !CDIR NOVERRCHK 
    158155      DO jj = 1, jpj 
    159 !CDIR NOVERRCHK 
    160156         DO ji = 1, jpi 
    161157            ztc  = MIN( 35., tsn(ji,jj,1,jp_tem) ) 
  • branches/2014/dev_CNRS0_NOC1_LDF/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zlys.F90

    r4147 r4617  
    8181      DO jn = 1, 5                               !  BEGIN OF ITERATION 
    8282         ! 
    83 !CDIR NOVERRCHK 
    8483         DO jk = 1, jpkm1 
    85 !CDIR NOVERRCHK 
    8684            DO jj = 1, jpj 
    87 !CDIR NOVERRCHK 
    8885               DO ji = 1, jpi 
    8986                  zfact = rhop(ji,jj,jk) / 1000. + rtrn 
  • branches/2014/dev_CNRS0_NOC1_LDF/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zopt.F90

    r4361 r4617  
    9090      ze2(:,:,jpk) = 0._wp 
    9191      ze3(:,:,jpk) = 0._wp 
    92  
    9392      !                                        !* attenuation coef. function of Chlorophyll and wavelength (Red-Green-Blue) 
    9493      DO jk = 1, jpkm1                         !  -------------------------------------------------------- 
    95 !CDIR NOVERRCHK 
    96          DO jj = 1, jpj 
    97 !CDIR NOVERRCHK 
     94         DO jj = 1, jpj 
    9895            DO ji = 1, jpi 
    9996               zchl = ( trn(ji,jj,jk,jpnch) + trn(ji,jj,jk,jpdch) + rtrn ) * 1.e6 
     
    107104         END DO 
    108105      END DO 
    109  
    110  
     106      ! 
    111107      !                                        !* Photosynthetically Available Radiation (PAR) 
    112108      !                                        !  -------------------------------------- 
    113  
    114109      IF( ln_varpar ) THEN 
    115110         ze1(:,:,1) = par_varsw(:,:) * qsr(:,:) * EXP( -0.5 * zekb(:,:,1) ) 
     
    122117      ENDIF 
    123118 
    124 !CDIR NOVERRCHK 
    125119      DO jj = 1, jpj 
    126 !CDIR NOVERRCHK 
    127120         DO ji = 1, jpi 
    128121            zc1 = ze1(ji,jj,1) 
     
    135128      END DO 
    136129 
    137      
    138130      DO jk = 2, nksrp       
    139 !CDIR NOVERRCHK 
    140          DO jj = 1, jpj 
    141 !CDIR NOVERRCHK 
     131         DO jj = 1, jpj 
    142132            DO ji = 1, jpi 
    143133               zc1 = ze1(ji,jj,jk-1) * EXP( -0.5 * ( zekb(ji,jj,jk-1) + zekb(ji,jj,jk) ) ) 
     
    175165         ! 
    176166         DO jk = 2, nksrp + 1 
    177 !CDIR NOVERRCHK 
    178167            DO jj = 1, jpj 
    179 !CDIR NOVERRCHK 
    180168               DO ji = 1, jpi 
    181169                  zc0 = ze0(ji,jj,jk-1) * EXP( -fse3t(ji,jj,jk-1) * zxsi0r ) 
     
    221209 
    222210      DO jk = 1, nksrp 
    223 !CDIR NOVERRCHK 
    224          DO jj = 1, jpj 
    225 !CDIR NOVERRCHK 
     211         DO jj = 1, jpj 
    226212            DO ji = 1, jpi 
    227213               IF( fsdepw(ji,jj,jk+1) <= hmld(ji,jj) ) THEN 
     
    238224      ! 
    239225      DO jk = 1, nksrp 
    240 !CDIR NOVERRCHK 
    241          DO jj = 1, jpj 
    242 !CDIR NOVERRCHK 
     226         DO jj = 1, jpj 
    243227            DO ji = 1, jpi 
    244228               IF( fsdepw(ji,jj,jk+1) <= hmld(ji,jj) ) THEN 
     
    273257   END SUBROUTINE p4z_opt 
    274258 
     259 
    275260   SUBROUTINE p4z_optsbc( kt ) 
    276261      !!---------------------------------------------------------------------- 
  • branches/2014/dev_CNRS0_NOC1_LDF/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zprod.F90

    r4529 r4617  
    3131   PUBLIC   p4z_prod_alloc 
    3232 
    33    !! * Shared module variables 
    3433   LOGICAL , PUBLIC ::  ln_newprod      !: 
    3534   REAL(wp), PUBLIC ::  pislope         !: 
     
    150149 
    151150      IF( ln_newprod ) THEN 
    152 !CDIR NOVERRCHK 
    153151         DO jk = 1, jpkm1 
    154 !CDIR NOVERRCHK 
    155152            DO jj = 1, jpj 
    156 !CDIR NOVERRCHK 
    157153               DO ji = 1, jpi 
    158154                  ! Computation of the P-I slope for nanos and diatoms 
     
    188184         END DO 
    189185      ELSE 
    190 !CDIR NOVERRCHK 
    191186         DO jk = 1, jpkm1 
    192 !CDIR NOVERRCHK 
    193187            DO jj = 1, jpj 
    194 !CDIR NOVERRCHK 
    195188               DO ji = 1, jpi 
    196189 
     
    231224      !  Computation of a proxy of the N/C ratio 
    232225      !  --------------------------------------- 
    233 !CDIR NOVERRCHK 
    234226      DO jk = 1, jpkm1 
    235 !CDIR NOVERRCHK 
    236227         DO jj = 1, jpj 
    237 !CDIR NOVERRCHK 
    238228            DO ji = 1, jpi 
    239229                zval = MIN( xnanopo4(ji,jj,jk), ( xnanonh4(ji,jj,jk) + xnanono3(ji,jj,jk) ) )   & 
     
    246236         END DO 
    247237      END DO 
    248  
    249  
    250238      DO jk = 1, jpkm1 
    251239         DO jj = 1, jpj 
    252240            DO ji = 1, jpi 
    253  
    254                 IF( etot(ji,jj,jk) > 1.E-3 ) THEN 
     241               ! 
     242               IF( etot(ji,jj,jk) > 1.E-3 ) THEN 
    255243                   !    Si/C of diatoms 
    256244                   !    ------------------------ 
     
    268256                  ENDIF 
    269257                  zysopt(ji,jj,jk) = grosip * zlim * zsilfac * zsilfac2 
    270               ENDIF 
     258               ENDIF 
    271259            END DO 
    272260         END DO 
     
    296284 
    297285      ! Computation of the various production terms  
    298 !CDIR NOVERRCHK 
    299286      DO jk = 1, jpkm1 
    300 !CDIR NOVERRCHK 
    301287         DO jj = 1, jpj 
    302 !CDIR NOVERRCHK 
    303288            DO ji = 1, jpi 
    304289               IF( etot(ji,jj,jk) > 1.E-3 ) THEN 
     
    331316 
    332317      IF( ln_newprod ) THEN 
    333 !CDIR NOVERRCHK 
    334318         DO jk = 1, jpkm1 
    335 !CDIR NOVERRCHK 
    336319            DO jj = 1, jpj 
    337 !CDIR NOVERRCHK 
    338320               DO ji = 1, jpi 
    339321                  IF( fsdepw(ji,jj,jk+1) <= hmld(ji,jj) ) THEN 
     
    359341         END DO 
    360342      ELSE 
    361 !CDIR NOVERRCHK 
    362343         DO jk = 1, jpkm1 
    363 !CDIR NOVERRCHK 
    364344            DO jj = 1, jpj 
    365 !CDIR NOVERRCHK 
    366345               DO ji = 1, jpi 
    367346                  IF( etot(ji,jj,jk) > 1.E-3 ) THEN 
  • branches/2014/dev_CNRS0_NOC1_LDF/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsms.F90

    r4162 r4617  
    1515   USE oce_trc         !  shared variables between ocean and passive tracers 
    1616   USE trc             !  passive tracers common variables  
    17    USE trcdta 
     17   USE trcdta          ! 
    1818   USE sms_pisces      !  PISCES Source Minus Sink variables 
    1919   USE p4zbio          !  Biological model 
     
    2424   USE p4zsed          !  Sedimentation 
    2525   USE p4zint          !  time interpolation 
    26    USE iom             !  I/O manager 
    2726   USE trdmod_oce      !  Ocean trends variables 
    2827   USE trdmod_trc      !  TOP trends variables 
    2928   USE sedmodel        !  Sediment model 
     29   ! 
    3030   USE prtctl_trc      !  print control for debugging 
     31   USE iom             !  I/O manager 
    3132 
    3233   IMPLICIT NONE 
     
    3435 
    3536   PUBLIC   p4z_sms_init    ! called in p4zsms.F90 
    36    PUBLIC   p4z_sms    ! called in p4zsms.F90 
     37   PUBLIC   p4z_sms         ! called in p4zsms.F90 
    3738 
    3839   REAL(wp) :: alkbudget, no3budget, silbudget, ferbudget 
     
    5859      !!              - ... 
    5960      !!--------------------------------------------------------------------- 
    60       ! 
    6161      INTEGER, INTENT( in ) ::   kt      ! ocean time-step index       
    6262      !! 
     
    7373            jl = jn + jp_pcs0 - 1 
    7474            ztrdpis(:,:,:,jn) = trn(:,:,:,jl) 
    75          ENDDO 
     75         END DO 
    7676      ENDIF 
    7777      ! 
     
    9191         ! 
    9292         ndayflxtr = nday_year 
    93  
     93         ! 
    9494         IF(lwp) write(numout,*) 
    9595         IF(lwp) write(numout,*) ' New chemical constants and various rates for biogeochemistry at new day : ', nday_year 
    9696         IF(lwp) write(numout,*) '~~~~~~' 
    97  
     97         ! 
    9898         CALL p4z_che              ! computation of chemical constants 
    9999         CALL p4z_int( kt )        ! computation of various rates for biogeochemistry 
    100100         ! 
    101101      ENDIF 
    102  
    103       IF( ll_sbc ) CALL p4z_sbc( kt )   ! external sources of nutrients  
    104  
     102      IF( ll_sbc )   CALL p4z_sbc( kt )   ! external sources of nutrients  
     103      ! 
    105104      DO jnt = 1, nrdttrc          ! Potential time splitting if requested 
    106105         ! 
     
    110109         DO jn = jp_pcs0, jp_pcs1 
    111110            trb(:,:,:,jn) = trn(:,:,:,jn) 
    112          ENDDO 
     111         END DO 
    113112         ! 
    114113      END DO 
     
    118117            jl = jn + jp_pcs0 - 1 
    119118            ztrdpis(:,:,:,jn) = ( ztrdpis(:,:,:,jn) - trn(:,:,:,jl) ) * rfact2r 
    120          ENDDO 
     119         END DO 
    121120      ENDIF 
    122121 
     
    152151      ! 
    153152      CALL p4z_chk_mass( kt ) ! Mass conservation checking 
    154  
    155       IF ( kt == nittrc000 ) CALL FLUSH    ( numonp )     ! flush output namelist PISCES 
    156       IF( nn_timing == 1 )  CALL timing_stop('p4z_sms') 
    157       ! 
     153      ! 
     154      IF( kt == nittrc000 )   CALL FLUSH    ( numonp )     ! flush output namelist PISCES 
     155      IF( nn_timing == 1  )   CALL timing_stop('p4z_sms') 
    158156      ! 
    159157   END SUBROUTINE p4z_sms 
     158 
    160159 
    161160   SUBROUTINE p4z_sms_init 
     
    260259         WRITE(numout,*) '    Flag to check mass conservation of NO3/Si/TALK ln_check_mass = ', ln_check_mass 
    261260      ENDIF 
    262  
     261      ! 
    263262   END SUBROUTINE p4z_sms_init 
     263 
    264264 
    265265   SUBROUTINE p4z_ph_ini 
     
    291291   END SUBROUTINE p4z_ph_ini 
    292292 
     293 
    293294   SUBROUTINE p4z_rst( kt, cdrw ) 
    294295      !!--------------------------------------------------------------------- 
     
    341342   END SUBROUTINE p4z_rst 
    342343 
     344 
    343345   SUBROUTINE p4z_dmp( kt ) 
    344346      !!---------------------------------------------------------------------- 
     
    347349      !! ** purpose  : Relaxation of some tracers 
    348350      !!---------------------------------------------------------------------- 
    349       ! 
    350       INTEGER, INTENT( in )  ::     kt ! time step 
     351      INTEGER, INTENT(in) ::   kt   ! time step 
    351352      ! 
    352353      REAL(wp) ::  alkmean = 2426.     ! mean value of alkalinity ( Glodap ; for Goyet 2391. ) 
     
    357358      REAL(wp) :: zarea, zalksum, zpo4sum, zno3sum, zsilsum 
    358359      !!--------------------------------------------------------------------- 
    359  
    360360 
    361361      IF(lwp)  WRITE(numout,*) 
     
    386386         ! 
    387387      ENDIF 
    388  
     388      ! 
    389389   END SUBROUTINE p4z_dmp 
    390390 
     
    397397      !! 
    398398      !!--------------------------------------------------------------------- 
    399       ! 
    400       INTEGER, INTENT( in ) ::   kt      ! ocean time-step index       
    401       !! 
    402       !!--------------------------------------------------------------------- 
    403  
     399      INTEGER, INTENT(in) ::   kt   ! ocean time-step index       
     400      !!--------------------------------------------------------------------- 
     401      ! 
    404402      IF( kt == nittrc000 ) THEN  
    405403         IF( ln_check_mass .AND. lwp) THEN      !   Open budget file of NO3, ALK, Si, Fer 
     
    434432            &                    + trn(:,:,:,jpzoo) * ferat3            & 
    435433            &                    + trn(:,:,:,jpmes) * ferat3            ) * cvol(:,:,:)  ) 
    436  
    437          ! 
     434            ! 
    438435         t_atm_co2_flx  = t_atm_co2_flx / glob_sum( e1e2t(:,:) ) 
    439436         t_oce_co2_flx  = t_oce_co2_flx         * 12. / 1.e15 * (-1 ) 
     
    452449         ! 
    453450      ENDIF 
    454        ! 
    455  9000  FORMAT(i8,f10.5,e18.10,f10.5,f10.5) 
    456  9500  FORMAT(i8,4e18.10)      
    457        ! 
     451      ! 
     452 9000 FORMAT(i8,f10.5,e18.10,f10.5,f10.5) 
     453 9500 FORMAT(i8,4e18.10)      
     454      ! 
    458455   END SUBROUTINE p4z_chk_mass 
    459456 
  • branches/2014/dev_CNRS0_NOC1_LDF/NEMOGCM/NEMO/TOP_SRC/TRP/trcadv.F90

    r3718 r4617  
    2323   USE traadv_ubs      ! UBS      scheme           (tra_adv_ubs    routine) 
    2424   USE traadv_qck      ! QUICKEST scheme           (tra_adv_qck    routine) 
    25    USE traadv_eiv      ! eddy induced velocity     (tra_adv_eiv    routine) 
    26    USE ldftra_oce      ! lateral diffusion coefficient on tracers 
     25   USE ldftra          ! lateral diffusion: eddy diffusivity & EIV coeff. 
     26   USE ldfslp          ! Lateral diffusion: slopes of neutral surfaces 
    2727   USE prtctl_trc      ! Print control 
    2828 
     
    4141#  include "vectopt_loop_substitute.h90" 
    4242   !!---------------------------------------------------------------------- 
    43    !! NEMO/TOP 3.3 , NEMO Consortium (2010) 
     43   !! NEMO/TOP 3.7 , NEMO Consortium (2014) 
    4444   !! $Id$  
    4545   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 
     
    5151      !!                  ***  ROUTINE trc_adv_alloc  *** 
    5252      !!---------------------------------------------------------------------- 
    53  
    5453      ALLOCATE( r2dt(jpk), STAT=trc_adv_alloc ) 
    55  
    56       IF( trc_adv_alloc /= 0 ) CALL ctl_warn('trc_adv_alloc : failed to allocate array.') 
    57  
     54      IF( trc_adv_alloc /= 0 )   CALL ctl_warn('trc_adv_alloc : failed to allocate array.') 
    5855   END FUNCTION trc_adv_alloc 
    5956 
     
    6764      !! ** Method  : - Update the tracer with the advection term following nadv 
    6865      !!---------------------------------------------------------------------- 
    69       !! 
    7066      INTEGER, INTENT(in) ::   kt   ! ocean time-step index 
    7167      ! 
    7268      INTEGER ::   jk  
    7369      CHARACTER (len=22) ::   charout 
    74       REAL(wp), POINTER, DIMENSION(:,:,:) :: zun, zvn, zwn  ! effective velocity 
     70      REAL(wp), POINTER, DIMENSION(:,:,:) ::   zun, zvn, zwn   ! effective transport 
    7571      !!---------------------------------------------------------------------- 
    7672      ! 
     
    7975      CALL wrk_alloc( jpi, jpj, jpk, zun, zvn, zwn ) 
    8076      ! 
    81  
    8277      IF( kt == nittrc000 )   CALL trc_adv_ctl          ! initialisation & control of options 
    83  
    84       IF( ln_top_euler) THEN 
     78      ! 
     79      IF( ln_top_euler ) THEN 
    8580         r2dt(:) =  rdttrc(:)              ! = rdttrc (use Euler time stepping) 
    8681      ELSE 
     
    9287      ENDIF 
    9388 
    94       !                                                   ! effective transport 
     89      !                                               !==  effective transport  ==! 
    9590      DO jk = 1, jpkm1 
    96          !                                                ! eulerian transport only 
    97          zun(:,:,jk) = e2u  (:,:) * fse3u(:,:,jk) * un(:,:,jk) 
     91         zun(:,:,jk) = e2u  (:,:) * fse3u(:,:,jk) * un(:,:,jk)                   ! eulerian transport 
    9892         zvn(:,:,jk) = e1v  (:,:) * fse3v(:,:,jk) * vn(:,:,jk) 
    9993         zwn(:,:,jk) = e1e2t(:,:)                 * wn(:,:,jk) 
    100          ! 
    10194      END DO 
    102       zwn(:,:,jpk) = 0.e0                                 ! no transport trough the bottom 
    103  
    104       IF( lk_traldf_eiv .AND. .NOT. ln_traldf_grif )   &  ! add the eiv transport (if necessary) 
    105          &              CALL tra_adv_eiv( kt, nittrc000, zun, zvn, zwn, 'TRC' ) 
     95!!gm      IF( ln_vvl_ztilde .OR. ln_vvl_layer ) THEN        !!gm to be added like on T and S ???? 
     96!!gm         zun(:,:,:) = zun(:,:,:) + un_td(:,:,:) 
     97!!gm         zvn(:,:,:) = zvn(:,:,:) + vn_td(:,:,:) 
     98!!gm      ENDIF 
     99      zun(:,:,jpk) = 0._wp                                                       ! no transport in the bottom 
     100      zvn(:,:,jpk) = 0._wp                                                       ! no transport in the bottom 
     101      zwn(:,:,jpk) = 0.e0                                                        ! no transport trough the bottom 
     102 
     103      IF( ln_ldfeiv .AND. .NOT. ln_traldf_triad )   &        
     104         &              CALL ldf_eiv_trp( kt, nittrc000, zun, zvn, zwn, 'TRC' )  ! add the eiv transport (if necessary) 
     105      ! 
     106!!gm  to be added like in T and S ? 
     107!!gm      IF( ln_mle    )   CALL tra_adv_mle( kt, nittrc000, zun, zvn, zwn, 'TRC' )  ! add the mle transport (if necessary) 
    106108      ! 
    107109      SELECT CASE ( nadv )                            !==  compute advection trend and add it to general trend  ==! 
     110      ! 
    108111      CASE ( 1 )   ;    CALL tra_adv_cen2  ( kt, nittrc000, 'TRC',       zun, zvn, zwn, trb, trn, tra, jptra )   !  2nd order centered 
    109112      CASE ( 2 )   ;    CALL tra_adv_tvd   ( kt, nittrc000, 'TRC', r2dt, zun, zvn, zwn, trb, trn, tra, jptra )   !  TVD  
     
    132135         WRITE(charout, FMT="('adv6')")  ; CALL prt_ctl_trc_info(charout) 
    133136                                           CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm,clinfo2='trd') 
    134          ! 
    135137      END SELECT 
    136138 
     
    157159      INTEGER ::   ioptio 
    158160      !!---------------------------------------------------------------------- 
    159  
     161      ! 
    160162      ioptio = 0                      ! Parameter control 
    161163      IF( ln_trcadv_cen2   )   ioptio = ioptio + 1 
  • branches/2014/dev_CNRS0_NOC1_LDF/NEMOGCM/NEMO/TOP_SRC/TRP/trcldf.F90

    r3294 r4617  
    44   !! Ocean Passive tracers : lateral diffusive trends 
    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 
     8   !!            3.7  ! 2014-03  (G. Madec)  LDF simplification 
    89   !!---------------------------------------------------------------------- 
    910#if defined key_top 
    1011   !!---------------------------------------------------------------------- 
    1112   !!   'key_top'                                                TOP models 
    12    !!---------------------------------------------------------------------- 
    1313   !!---------------------------------------------------------------------- 
    1414   !!   trc_ldf     : update the tracer trend with the lateral diffusion 
    1515   !!       ldf_ctl : initialization, namelist read, and parameters control 
    1616   !!---------------------------------------------------------------------- 
    17    USE oce_trc         ! ocean dynamics and active tracers 
    18    USE trc             ! ocean passive tracers variables 
    19    USE trcnam_trp      ! passive tracers transport namelist variables 
    20    USE ldftra_oce      ! lateral diffusion coefficient on tracers 
    21    USE ldfslp          ! ??? 
    22    USE traldf_bilapg   ! lateral mixing            (tra_ldf_bilapg routine) 
    23    USE traldf_bilap    ! lateral mixing            (tra_ldf_bilap routine) 
    24    USE traldf_iso      ! lateral mixing            (tra_ldf_iso routine) 
    25    USE traldf_iso_grif ! lateral mixing          (tra_ldf_iso_grif routine) 
    26    USE traldf_lap      ! lateral mixing            (tra_ldf_lap routine) 
     17   USE trc              ! ocean passive tracers variables 
     18   USE oce_trc          ! ocean dynamics and active tracers 
     19   USE trcnam_trp       ! passive tracers transport namelist variables 
     20   USE ldftra           ! lateral diffusion: eddy diffusivity & EIV coeff. 
     21   USE ldfslp           ! lateral diffusion: iso-neutral slope  
     22   USE traldf_lap       ! lateral diffusion: iso-level lap/blp (tra_ldf_lap/_blp  routine) 
     23   USE traldf_iso       ! lateral diffusion (Madec operator)   (tra_ldf_iso       routine) 
     24   USE traldf_iso_triad ! lateral diffusion (triad operator)   (tra_ldf_iso_triad routine) 
    2725   USE trdmod_oce 
    2826   USE trdtra 
     27   ! 
    2928   USE prtctl_trc      ! Print control 
    3029 
     
    4039#  include "vectopt_loop_substitute.h90" 
    4140   !!---------------------------------------------------------------------- 
    42    !! NEMO/TOP 3.3 , NEMO Consortium (2010) 
     41   !! NEMO/TOP 3.7 , NEMO Consortium (2014) 
    4342   !! $Id$ 
    4443   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 
    4544   !!---------------------------------------------------------------------- 
    46  
    4745CONTAINS 
    4846 
     
    6361      IF( nn_timing == 1 )   CALL timing_start('trc_ldf') 
    6462      ! 
     63       
     64!!gm  this call should be put in trcini ! 
    6565      IF( kt == nittrc000 )   CALL ldf_ctl          ! initialisation & control of options 
     66!!gm end 
    6667 
    6768      rldf = rldf_rat 
     
    7374 
    7475      SELECT CASE ( nldf )                       ! compute lateral mixing trend and add it to the general trend 
    75       CASE ( 0 )   ;   CALL tra_ldf_lap   ( kt, nittrc000, 'TRC', gtru, gtrv, trb, tra, jptra            )  ! iso-level laplacian 
    76       CASE ( 1 )                                                                                            ! rotated laplacian 
    77                        IF( ln_traldf_grif ) THEN 
    78                           CALL tra_ldf_iso_grif( kt, nittrc000, 'TRC', gtru, gtrv, trb, tra, jptra, rn_ahtb_0 ) 
    79                        ELSE 
    80                           CALL tra_ldf_iso     ( kt, nittrc000, 'TRC', gtru, gtrv, trb, tra, jptra, rn_ahtb_0 ) 
    81                        ENDIF 
    82       CASE ( 2 )   ;   CALL tra_ldf_bilap ( kt, nittrc000, 'TRC', gtru, gtrv, trb, tra, jptra            )  ! iso-level bilaplacian 
    83       CASE ( 3 )   ;   CALL tra_ldf_bilapg( kt, nittrc000, 'TRC',             trb, tra, jptra            )  ! s-coord. horizontal bilaplacian 
     76      CASE ( 0 )   ;   CALL tra_ldf_lap     ( kt, nittrc000, 'TRC', gtru, gtrv, ahtu, ahtv, trb     , tra, jpts, 1)  ! iso-level laplacian 
     77      CASE ( 1 )                                                                                      ! rotated laplacian 
     78         IF( ln_traldf_triad ) THEN                                                           
     79                       CALL tra_ldf_iso_triad( kt, nittrc000,'TRC', gtru, gtrv, ahtu, ahtv, trb, trb, tra, jpts, 1 )    ! triad operator 
     80         ELSE                                                                                 
     81                       CALL tra_ldf_iso      ( kt, nittrc000,'TRC', gtru, gtrv, ahtu, ahtv, trb, trb, tra, jpts, 1 )    ! Madec operator 
     82         ENDIF 
     83      CASE ( 2 )   ;   CALL tra_ldf_blp      ( kt, nittrc000,'TRC', gtru, gtrv, ahtu, ahtv, trb     , tra, jpts )    ! iso-level bilaplacian 
     84      CASE ( 3 )   ;   CALL tra_ldf_iso_blp  ( kt, nittrc000,'TRC', gtru, gtrv, ahtu, ahtv, trb     , tra, jpts )    ! rotated  bilaplacian 
    8485         ! 
    85       CASE ( -1 )                                     ! esopa: test all possibility with control print 
    86          CALL tra_ldf_lap   ( kt, nittrc000, 'TRC', gtru, gtrv, trb, tra, jptra            ) 
    87          WRITE(charout, FMT="('ldf0 ')") ;  CALL prt_ctl_trc_info(charout) 
    88                                             CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 
    89          IF( ln_traldf_grif ) THEN 
    90             CALL tra_ldf_iso_grif( kt, nittrc000, 'TRC', gtru, gtrv, trb, tra, jptra, rn_ahtb_0 ) 
    91          ELSE 
    92             CALL tra_ldf_iso     ( kt, nittrc000, 'TRC', gtru, gtrv, trb, tra, jptra, rn_ahtb_0 ) 
    93          ENDIF 
    94          WRITE(charout, FMT="('ldf1 ')") ;  CALL prt_ctl_trc_info(charout) 
    95                                             CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 
    96          CALL tra_ldf_bilap ( kt, nittrc000, 'TRC', gtru, gtrv, trb, tra, jptra            ) 
    97          WRITE(charout, FMT="('ldf2 ')") ;  CALL prt_ctl_trc_info(charout) 
    98                                             CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 
    99          CALL tra_ldf_bilapg( kt, nittrc000, 'TRC',             trb, tra, jptra            ) 
    100          WRITE(charout, FMT="('ldf3 ')") ;  CALL prt_ctl_trc_info(charout) 
    101                                             CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 
     86      CASE ( -1 )                                ! esopa: test all possibility with control print 
     87         CALL tra_ldf_lap   ( kt, nittrc000, 'TRC', gtru, gtrv, ahtu, ahtv, trb, tra, jpts, 1 )  
     88         WRITE(charout, FMT="('ldf0')")   ;   CALL prt_ctl_trc_info(charout) 
     89                                              CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm,clinfo2='trd') 
     90         IF( ln_traldf_triad ) THEN 
     91            CALL tra_ldf_iso_triad( kt, nittrc000, 'TRC', gtru, gtrv, ahtu, ahtv, trb, trb, tra, jpts, 1 ) 
     92         ELSE 
     93            CALL tra_ldf_iso      ( kt, nittrc000, 'TRC', gtru, gtrv, ahtu, ahtv, trb, trb, tra, jpts, 1 )   
     94         ENDIF 
     95         WRITE(charout, FMT="('ldf1')")   ;   CALL prt_ctl_trc_info(charout) 
     96                                              CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 
     97         CALL tra_ldf_blp   ( kt, nittrc000, 'TRC', gtru, gtrv, ahtu, ahtv, trb, tra, jpts        )  
     98         WRITE(charout, FMT="('ldf2')")   ;   CALL prt_ctl_trc_info(charout) 
     99                                              CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 
    102100      END SELECT 
    103101      ! 
     
    111109      !                                          ! print mean trends (used for debugging) 
    112110      IF( ln_ctl )   THEN 
    113          WRITE(charout, FMT="('ldf ')") ;  CALL prt_ctl_trc_info(charout) 
    114                                            CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 
     111         WRITE(charout, FMT="('ldf ')")   ;   CALL prt_ctl_trc_info(charout) 
     112                                              CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 
    115113      ENDIF 
    116114      ! 
     
    119117   END SUBROUTINE trc_ldf 
    120118 
     119!!gm ldf_ctl should be called in trcini  so that l_ldfslp=T  cause the slope init and calculation 
    121120 
    122121   SUBROUTINE ldf_ctl 
     
    155154      IF( ioptio >  1 )   CALL ctl_stop( '          use ONE or NONE of the 2 lap/bilap operator type on tracer' ) 
    156155      IF( ioptio == 0 )   nldf = -2   ! No lateral diffusion 
     156       
     157      IF( ln_traldf_lap .AND. ln_trcldf_bilap )   CALL ctl_stop( ' bilaplacian should be used on both TRC and TRA' ) 
     158      IF( ln_traldf_blp .AND. ln_trcldf_lap   )   CALL ctl_stop( '   laplacian should be used on both TRC and TRA' ) 
     159       
    157160      ioptio = 0 
    158161      IF( ln_trcldf_level )   ioptio = ioptio + 1 
     
    202205      IF( ierr == 1 )   CALL ctl_stop( ' iso-level in z-coordinate - partial step, not allowed' ) 
    203206      IF( ierr == 2 )   CALL ctl_stop( ' isoneutral bilaplacian operator does not exist' ) 
    204       IF( lk_traldf_eiv .AND. .NOT.ln_trcldf_iso )   & 
     207      IF( ln_ldfeiv .AND. .NOT.ln_trcldf_iso )   & 
    205208           CALL ctl_stop( '          eddy induced velocity on tracers',   & 
    206209           &              ' the eddy induced velocity on tracers requires isopycnal laplacian diffusion' ) 
    207210      IF( nldf == 1 .OR. nldf == 3 ) THEN      ! rotation 
    208          IF( .NOT.lk_ldfslp )   CALL ctl_stop( '          the rotation of the diffusive tensor require key_ldfslp' ) 
    209 #if defined key_offline 
    210          l_traldf_rot = .TRUE.                 ! needed for trazdf_imp 
    211 #endif 
     211         IF( .NOT.l_ldfslp )   CALL ctl_stop( '          the rotation of the diffusive tensor require l_ldfslp' ) 
    212212      ENDIF 
    213213 
  • branches/2014/dev_CNRS0_NOC1_LDF/NEMOGCM/NEMO/TOP_SRC/TRP/trcnxt.F90

    r3680 r4617  
    107107      END DO 
    108108 
    109  
    110 #if defined key_obc 
    111 !!      CALL obc_trc( kt )               ! OBC open boundaries 
    112 #endif 
    113109#if defined key_bdy 
    114110!!      CALL bdy_trc( kt )               ! BDY open boundaries 
  • branches/2014/dev_CNRS0_NOC1_LDF/NEMOGCM/NEMO/TOP_SRC/oce_trc.F90

    r4306 r4617  
    1111   !!   'key_top'                                                TOP models 
    1212   !!---------------------------------------------------------------------- 
    13  
    14    !* Domain size * 
     13   ! 
     14   !                                            !* Domain size * 
    1515   USE par_oce , ONLY :   jpi      =>   jpi        !: first  dimension of grid --> i  
    1616   USE par_oce , ONLY :   jpj      =>   jpj        !: second dimension of grid --> j   
     
    2424   USE par_oce , ONLY :   jp_sal   =>   jp_sal     !: indice for salinity 
    2525 
    26    !* IO manager * 
    27    USE in_out_manager     
    28   
    29    !* Memory Allocation * 
    30    USE wrk_nemo       
    31   
    32    !* Timing * 
    33    USE timing     
    34   
    35    !* MPP library                          
    36    USE lib_mpp  
     26   USE in_out_manager                           !* IO manager * 
     27   USE wrk_nemo                                 !* Memory Allocation * 
     28   USE timing                                   !* Timing *  
     29   USE lib_mpp                                  !* MPP library                          
     30   USE lib_fortran                              !* Fortran utilities                          
     31   USE lbclnk                                   !* Lateral boundary conditions                          
     32   USE phycst                                   !* physical constants * 
     33   USE c1d                                      !* 1D configuration 
     34   USE dom_oce                                  !* model domain * 
    3735 
    38    !* Fortran utilities                          
    39    USE lib_fortran 
    40  
    41    !* Lateral boundary conditions                          
    42    USE lbclnk 
    43  
    44    !* physical constants * 
    45    USE phycst             
    46  
    47    !* 1D configuration 
    48    USE c1d                                          
    49  
    50    !* model domain * 
    51    USE dom_oce  
    52  
    53  
    54    !* ocean fields: here now and after fields * 
    55    USE oce , ONLY :   ua      =>    ua      !: i-horizontal velocity (m s-1)  
    56    USE oce , ONLY :   va      =>    va      !: j-horizontal velocity (m s-1) 
    57    USE oce , ONLY :   un      =>    un      !: i-horizontal velocity (m s-1)  
    58    USE oce , ONLY :   vn      =>    vn      !: j-horizontal velocity (m s-1) 
    59    USE oce , ONLY :   wn      =>    wn      !: vertical velocity (m s-1)   
    60    USE oce , ONLY :   tsn     =>    tsn     !: 4D array contaning ( tn, sn ) 
    61    USE oce , ONLY :   tsb     =>    tsb     !: 4D array contaning ( tb, sb ) 
    62    USE oce , ONLY :   tsa     =>    tsa     !: 4D array contaning ( ta, sa ) 
    63    USE oce , ONLY :   rhop    =>    rhop    !: potential volumic mass (kg m-3)  
    64    USE oce , ONLY :   rhd     =>    rhd     !: in situ density anomalie rhd=(rho-rau0)/rau0 (no units) 
    65    USE oce , ONLY :   hdivn   =>    hdivn   !: horizontal divergence (1/s) 
    66    USE oce , ONLY :   rotn    =>    rotn    !: relative vorticity    [s-1] 
    67    USE oce , ONLY :   hdivb   =>    hdivb   !: horizontal divergence (1/s) 
    68    USE oce , ONLY :   rotb    =>    rotb    !: relative vorticity    [s-1] 
    69    USE oce , ONLY :   sshn    =>    sshn    !: sea surface height at t-point [m]    
    70    USE oce , ONLY :   sshb    =>    sshb    !: sea surface height at t-point [m]    
    71    USE oce , ONLY :   ssha    =>    ssha    !: sea surface height at t-point [m]    
    72    USE oce , ONLY :   l_traldf_rot => l_traldf_rot  !: rotated laplacian operator for lateral diffusion 
     36   !                                            !* ocean fields: here now and after fields * 
     37   USE oce     , ONLY :   ua      =>    ua         !: i-horizontal velocity (m s-1)  
     38   USE oce     , ONLY :   va      =>    va         !: j-horizontal velocity (m s-1) 
     39   USE oce     , ONLY :   un      =>    un         !: i-horizontal velocity (m s-1)  
     40   USE oce     , ONLY :   vn      =>    vn         !: j-horizontal velocity (m s-1) 
     41   USE oce     , ONLY :   wn      =>    wn         !: vertical velocity (m s-1)   
     42   USE oce     , ONLY :   tsn     =>    tsn        !: 4D array contaning ( tn, sn ) 
     43   USE oce     , ONLY :   tsb     =>    tsb        !: 4D array contaning ( tb, sb ) 
     44   USE oce     , ONLY :   tsa     =>    tsa        !: 4D array contaning ( ta, sa ) 
     45   USE oce     , ONLY :   rhop    =>    rhop       !: potential volumic mass (kg m-3)  
     46   USE oce     , ONLY :   rhd     =>    rhd        !: in situ density anomalie rhd=(rho-rau0)/rau0 (no units) 
     47   USE oce     , ONLY :   hdivn   =>    hdivn      !: now horizontal divergence (1/s) 
     48   USE oce     , ONLY :   sshn    =>    sshn       !: sea surface height at t-point [m]    
     49   USE oce     , ONLY :   sshb    =>    sshb       !: sea surface height at t-point [m]    
     50   USE oce     , ONLY :   ssha    =>    ssha       !: sea surface height at t-point [m]    
    7351#if defined key_offline 
    74    USE oce , ONLY :   gtsu    =>    gtsu    !: t-, s- and rd horizontal gradient at u- and 
    75    USE oce , ONLY :   gtsv    =>    gtsv    !: 
    76    USE oce , ONLY :   gru     =>    gru     !: 
    77    USE oce , ONLY :   grv     =>    grv     !:  
     52   USE oce     , ONLY :   gtsu    =>    gtsu       !: t-, s- and rd horizontal gradient at u- and 
     53   USE oce     , ONLY :   gtsv    =>    gtsv       !: 
     54   USE oce     , ONLY :   gru     =>    gru        !: 
     55   USE oce     , ONLY :   grv     =>    grv        !:  
    7856#endif 
    7957 
    80    !* surface fluxes * 
     58   !                                            !* surface fluxes * 
    8159   USE sbc_oce , ONLY :   utau       =>    utau       !: i-surface stress component 
    8260   USE sbc_oce , ONLY :   vtau       =>    vtau       !: j-surface stress component 
     
    9775   USE sbcrnf  , ONLY :   h_rnf      =>    h_rnf      !: river runoff   [Kg/m2/s] 
    9876 
    99    USE trc_oce 
     77   USE trc_oce                                  !* ??? * 
    10078 
    101    !* lateral diffusivity (tracers) * 
    102    USE ldftra_oce , ONLY :  rldf     =>   rldf        !: multiplicative coef. for lateral diffusivity 
    103    USE ldftra_oce , ONLY :  rn_aht_0 =>   rn_aht_0    !: horizontal eddy diffusivity for tracers (m2/s) 
    104    USE ldftra_oce , ONLY :  aht0     =>   aht0        !: horizontal eddy diffusivity for tracers (m2/s) 
    105    USE ldftra_oce , ONLY :  ahtb0    =>   ahtb0       !: background eddy diffusivity for isopycnal diff. (m2/s) 
    106    USE ldftra_oce , ONLY :  ahtu     =>   ahtu        !: lateral diffusivity coef. at u-points  
    107    USE ldftra_oce , ONLY :  ahtv     =>   ahtv        !: lateral diffusivity coef. at v-points  
    108    USE ldftra_oce , ONLY :  ahtw     =>   ahtw        !: lateral diffusivity coef. at w-points  
    109    USE ldftra_oce , ONLY :  ahtt     =>   ahtt        !: lateral diffusivity coef. at t-points 
    110    USE ldftra_oce , ONLY :  aeiv0    =>   aeiv0       !: eddy induced velocity coefficient (m2/s)  
    111    USE ldftra_oce , ONLY :  aeiu     =>   aeiu        !: eddy induced velocity coef. at u-points (m2/s)   
    112    USE ldftra_oce , ONLY :  aeiv     =>   aeiv        !: eddy induced velocity coef. at v-points (m2/s)  
    113    USE ldftra_oce , ONLY :  aeiw     =>   aeiw        !: eddy induced velocity coef. at w-points (m2/s)  
    114    USE ldftra_oce , ONLY :  lk_traldf_eiv  =>  lk_traldf_eiv     !: eddy induced velocity flag 
     79   !                                            !* lateral diffusivity (tracers) * 
     80!   USE ldftra , ONLY :  rn_aht_0 =>   rn_aht_0     !: horizontal eddy diffusivity for tracers (m2/s) 
     81!   USE ldftra , ONLY :  aht0     =>   aht0         !: horizontal eddy diffusivity for tracers (m2/s) 
     82!   USE ldftra , ONLY :  ahtb0    =>   ahtb0        !: background eddy diffusivity for isopycnal diff. (m2/s) 
     83!   USE ldftra , ONLY :  aeiv0    =>   aeiv0        !: eddy induced velocity coefficient (m2/s)  
     84   ! 
     85   USE ldftra , ONLY :  ln_ldfeiv      =>  ln_ldfeiv        !: eddy induced velocity flag 
     86   USE ldftra , ONLY :  ln_traldf_lap  =>  ln_traldf_lap    !: laplacian   flag 
     87   USE ldftra , ONLY :  ln_traldf_blp  =>  ln_traldf_blp    !: bilaplacian flag 
     88   USE ldftra , ONLY :  rldf     =>   rldf         !: multiplicative coef. for lateral diffusivity 
     89   USE ldftra , ONLY :  ahtu     =>   ahtu         !: lateral diffusivity coef. at u-points  
     90   USE ldftra , ONLY :  ahtv     =>   ahtv         !: lateral diffusivity coef. at v-points  
     91   USE ldftra , ONLY :  aeiu     =>   aeiu         !: eddy induced velocity coef. at u-points   
     92   USE ldftra , ONLY :  aeiv     =>   aeiv         !: eddy induced velocity coef. at v-points 
    11593 
    116    !* vertical diffusion * 
     94   !                                            !* vertical diffusion * 
    11795   USE zdf_oce , ONLY :   avt        =>   avt         !: vert. diffusivity coef. at w-point for temp   
    11896# if defined key_zdfddm 
     
    12098# endif 
    12199 
    122    !* mixing & mixed layer depth * 
     100   !                                            !* mixing & mixed layer depth * 
    123101   USE zdfmxl , ONLY :   nmln        =>   nmln        !: number of level in the mixed layer 
    124102   USE zdfmxl , ONLY :   hmld        =>   hmld        !: mixing layer depth (turbocline) 
     
    126104   USE zdfmxl , ONLY :   hmlpt       =>   hmlpt       !: mixed layer depth at t-points (m) 
    127105 
    128    !* direction of lateral diffusion * 
    129    USE ldfslp , ONLY :   lk_ldfslp  =>  lk_ldfslp     !: slopes flag 
    130 # if   defined key_ldfslp 
     106   !                                            !* direction of lateral diffusion * 
     107   USE ldfslp , ONLY :   l_ldfslp   =>   l_ldfslp     !: slopes flag 
    131108   USE ldfslp , ONLY :   uslp       =>   uslp         !: i-direction slope at u-, w-points 
    132109   USE ldfslp , ONLY :   vslp       =>   vslp         !: j-direction slope at v-, w-points 
    133110   USE ldfslp , ONLY :   wslpi      =>   wslpi        !: i-direction slope at u-, w-points 
    134111   USE ldfslp , ONLY :   wslpj      =>   wslpj        !: j-direction slope at v-, w-points 
    135 # endif 
    136112 
    137113#else 
  • branches/2014/dev_CNRS0_NOC1_LDF/NEMOGCM/NEMO/TOP_SRC/top_substitute.h90

    r2528 r4617  
    66   !! History :   1.0  !  2004-03 (C. Ethe) Original code 
    77   !!             2.0  !  2007-12 (C. Ethe, G. Madec) new architecture 
     8   !!             3.7  !  2014-03 (G. Madec)  LDF simplification  
    89   !!---------------------------------------------------------------------- 
    910#  include "domzgr_substitute.h90" 
    10 #  include "ldfeiv_substitute.h90" 
    11 #  include "ldftra_substitute.h90" 
    1211#  include "vectopt_loop_substitute.h90" 
    1312   !!---------------------------------------------------------------------- 
    14    !! NEMO/TOP 3.3 , NEMO Consortium (2010) 
     13   !! NEMO/TOP 3.7 , NEMO Consortium (2014) 
    1514   !! $Id$  
    1615   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 
  • branches/2014/dev_CNRS0_NOC1_LDF/NEMOGCM/NEMO/TOP_SRC/trc.F90

    r4148 r4617  
    119119   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  avs_tm      !: vertical double diffusivity coeff. at w-point   [m/s] 
    120120# endif 
    121 #if defined key_ldfslp 
    122    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  wslpi_tm    !: i-direction slope at u-, w-points 
    123    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  wslpj_tm    !: j-direction slope at u-, w-points 
    124    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  uslp_tm     !: j-direction slope at u-, w-points 
    125    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  vslp_tm     !: j-direction slope at u-, w-points 
    126 #endif 
     121   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  wslpi_tm, wslpi_temp    !: i-direction slope at w-points 
     122   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  wslpj_tm, wslpj_temp    !: j-direction slope at w-points 
     123   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  uslp_tm , uslp_temp     !: i-direction slope at u-points 
     124   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  vslp_tm , vslp_temp     !: j-direction slope at v-points 
    127125#if defined key_trabbl 
    128126   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  ahu_bbl_tm  !: u-, w-points 
     
    148146   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  wndm_tm    !: 10m wind average [m] 
    149147   ! 
    150 #if defined key_traldf_c3d 
    151    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  ahtt_tm, ahtu_tm, ahtv_tm, ahtw_tm   !: ** 3D coefficients ** at T-,U-,V-,W-points 
    152 #elif defined key_traldf_c2d 
    153    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  ahtt_tm, ahtu_tm, ahtv_tm, ahtw_tm   !: ** 2D coefficients ** at T-,U-,V-,W-points 
    154 #elif defined key_traldf_c1d 
    155    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)       ::  ahtt_tm, ahtu_tm, ahtv_tm, ahtw_tm   !: ** 1D coefficients ** at T-,U-,V-,W-points 
    156 #else 
    157    REAL(wp), PUBLIC                                        ::  ahtt_tm, ahtu_tm, ahtv_tm, ahtw_tm   !: ** 0D coefficients ** at T-,U-,V-,W-points 
    158 #endif 
    159    ! 
    160 #if defined key_traldf_eiv 
    161 #  if defined key_traldf_c3d 
    162    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  aeiu_tm , aeiv_tm , aeiw_tm   !: ** 3D coefficients ** 
    163 #  elif defined key_traldf_c2d 
    164    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  aeiu_tm , aeiv_tm , aeiw_tm   !: ** 2D coefficients ** 
    165 #  elif defined key_traldf_c1d 
    166    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)       ::  aeiu_tm , aeiv_tm, aeiw_tm   !: ** 1D coefficients ** 
    167 #  else 
    168    REAL(wp), PUBLIC                                        ::  aeiu_tm , aeiv_tm , aeiw_tm   !: ** 0D coefficients ** 
    169 #  endif 
    170 #endif 
     148   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  ahtu_tm, ahtv_tm   !: ** 3D coefficients ** at T-,U-,V-,W-points 
     149   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  aeiu_tm, aeiv_tm   !: ** 3D coefficients ** 
    171150 
    172151   ! Temporary physical arrays for sub_stepping 
     
    188167   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  ahu_bbl_temp, ahv_bbl_temp, utr_bbl_temp, vtr_bbl_temp !: hold current values  
    189168#endif 
    190    ! 
    191 #if defined key_ldfslp 
    192    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  wslpi_temp, wslpj_temp, uslp_temp, vslp_temp    !: hold current values  
    193 #endif 
    194169   !  
    195170# if defined key_zdfddm 
    196    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  avs_temp      !: salinity vertical diffusivity coeff. at w-point   [m/s] 
     171   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   avs_temp      !: salinity vertical diffusivity coeff. at w-point   [m/s] 
    197172# endif 
    198173   ! 
    199 #if defined key_traldf_c3d 
    200    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  ahtt_temp, ahtu_temp, ahtv_temp, ahtw_temp    
    201 #elif defined key_traldf_c2d 
    202    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  ahtt_temp, ahtu_temp, ahtv_temp, ahtw_temp   
    203 #elif defined key_traldf_c1d 
    204    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)       ::  ahtt_temp, ahtu_temp, ahtv_temp, ahtw_temp  
    205 #else 
    206    REAL(wp), PUBLIC                                        ::  ahtt_temp, ahtu_temp, ahtv_temp, ahtw_temp 
    207 #endif 
    208    ! 
    209 #if defined key_traldf_eiv 
    210 # if defined key_traldf_c3d 
    211    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  aeiu_temp , aeiv_temp , aeiw_temp   !: ** 3D coefficients ** 
    212 # elif defined key_traldf_c2d 
    213    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  aeiu_temp , aeiv_temp , aeiw_temp   !: ** 2D coefficients ** 
    214 # elif defined key_traldf_c1d 
    215    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)       ::  aeiu_temp , aeiv_temp, aeiw_temp   !: ** 1D coefficients ** 
    216 # else 
    217    REAL(wp), PUBLIC                                        ::  aeiu_temp , aeiv_temp , aeiw_temp   !: ** 0D coefficients ** 
    218 # endif 
    219 # endif 
     174   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   ahtu_temp, ahtv_temp    
     175   ! 
     176   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   aeiu_temp , aeiv_temp , aeiw_temp   !: ** 3D coefficients ** 
    220177 
    221178   !!---------------------------------------------------------------------- 
  • branches/2014/dev_CNRS0_NOC1_LDF/NEMOGCM/NEMO/TOP_SRC/trcsms.F90

    r3680 r4617  
    5252      IF( lk_c14b    )   CALL trc_sms_c14b   ( kt )    ! surface fluxes of C14 
    5353      IF( lk_my_trc  )   CALL trc_sms_my_trc ( kt )    ! MY_TRC  tracers 
    54  
     54      ! 
    5555      IF(ln_ctl) THEN      ! print mean trends (used for debugging) 
    5656         WRITE(charout, FMT="('sms ')") 
  • branches/2014/dev_CNRS0_NOC1_LDF/NEMOGCM/NEMO/TOP_SRC/trcstp.F90

    r4306 r4617  
    1010   !!   trc_stp      : passive tracer system time-stepping 
    1111   !!---------------------------------------------------------------------- 
     12   USE trc 
    1213   USE oce_trc          ! ocean dynamics and active tracers variables 
    1314   USE sbc_oce 
    14    USE trc 
    1515   USE trctrp           ! passive tracers transport 
    1616   USE trcsms           ! passive tracers sources and sinks 
     17   USE trcsub 
    1718   USE prtctl_trc       ! Print control for debbuging 
    1819   USE trcdia 
     
    2122   USE trdmod_trc_oce 
    2223   USE trdmld_trc 
     24   ! 
    2325   USE iom 
    2426   USE in_out_manager 
    25    USE trcsub 
    2627 
    2728   IMPLICIT NONE 
     
    5051      !!------------------------------------------------------------------- 
    5152      INTEGER, INTENT( in ) ::  kt      ! ocean time-step index 
     53      ! 
    5254      INTEGER               ::  jk, jn  ! dummy loop indices 
    5355      REAL(wp)              ::  ztrai 
    5456      CHARACTER (len=25)    ::  charout  
    55  
    5657      REAL(wp), DIMENSION(:,:), POINTER ::   zqsr_tmp ! save qsr during TOP time-step 
    5758      !!------------------------------------------------------------------- 
     
    7980      IF( nn_dttrc /= 1 )   CALL trc_sub_stp( kt )  ! averaging physical variables for sub-stepping 
    8081      !     
     82 
    8183      IF( MOD( kt , nn_dttrc ) == 0 ) THEN      ! only every nn_dttrc time step 
    8284         ! 
  • branches/2014/dev_CNRS0_NOC1_LDF/NEMOGCM/NEMO/TOP_SRC/trcsub.F90

    r4306 r4617  
    2525   USE zdf_oce 
    2626   USE domvvl 
    27    USE divcur          ! hor. divergence and curl      (div & cur routines) 
     27   USE divhor          ! hor. divergence 
    2828   USE sbcrnf, ONLY: h_rnf, nk_rnf   ! River runoff  
    2929   USE bdy_oce 
    30 #if defined key_obc 
    31    USE obc_oce, ONLY: obctmsk 
    32 #endif 
    3330#if defined key_agrif 
    3431   USE agrif_opa_update 
     
    4340   PUBLIC   trc_sub_ssh      ! called by trc_stp to reset physics variables 
    4441 
    45    !!* Module variables 
    4642   REAL(wp)  :: r1_ndttrc     !    1 /  nn_dttrc  
    4743   REAL(wp)  :: r1_ndttrcp1   !    1 / (nn_dttrc+1)  
     
    5046#  include "top_substitute.h90" 
    5147   !!---------------------------------------------------------------------- 
    52    !! NEMO/TOP 3.3 , NEMO Consortium (2010) 
     48   !! NEMO/TOP 3.7 , NEMO Consortium (2014) 
    5349   !! $Id: trcstp.F90 2528 2010-12-27 17:33:53Z rblod $  
    5450   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 
     
    9490          tsn_tm  (:,:,:,jp_sal) = tsn_tm  (:,:,:,jp_sal) + tsn  (:,:,:,jp_sal) * fse3t(:,:,:)   
    9591          rhop_tm (:,:,:)        = rhop_tm (:,:,:)        + rhop (:,:,:)        * fse3t(:,:,:)   
    96           avt_tm  (:,:,:)        = avt_tm  (:,:,:)        + avt  (:,:,:)        * fse3w(:,:,:)   
     92          avt_tm  (:,:,:)        = avt_tm  (:,:,:)        + avt  (:,:,:)  
    9793# if defined key_zdfddm 
    98           avs_tm  (:,:,:)        = avs_tm  (:,:,:)        + avs  (:,:,:)        * fse3w(:,:,:)   
     94          avs_tm  (:,:,:)        = avs_tm  (:,:,:)        + avs  (:,:,:)  
    9995# endif 
    10096#if defined key_ldfslp 
    101           wslpi_tm(:,:,:)        = wslpi_tm(:,:,:)        + wslpi(:,:,:)        * fse3w(:,:,:)  
    102           wslpj_tm(:,:,:)        = wslpj_tm(:,:,:)        + wslpj(:,:,:)        * fse3w(:,:,:)  
    103           uslp_tm (:,:,:)        = uslp_tm (:,:,:)        + uslp (:,:,:)        * fse3u(:,:,:)  
    104           vslp_tm (:,:,:)        = vslp_tm (:,:,:)        + vslp (:,:,:)        * fse3v(:,:,:)  
     97          wslpi_tm(:,:,:)        = wslpi_tm(:,:,:)        + wslpi(:,:,:)  
     98          wslpj_tm(:,:,:)        = wslpj_tm(:,:,:)        + wslpj(:,:,:) 
     99          uslp_tm (:,:,:)        = uslp_tm (:,:,:)        + uslp (:,:,:)  
     100          vslp_tm (:,:,:)        = vslp_tm (:,:,:)        + vslp (:,:,:) 
    105101#endif 
    106102# if defined key_trabbl 
     
    127123          wndm_tm  (:,:)         = wndm_tm  (:,:)         + wndm  (:,:) 
    128124          ! 
    129 #if defined key_traldf_c3d 
    130           ahtt_tm  (:,:,:)       = ahtt_tm  (:,:,:)       + ahtt(:,:,:)         * fse3t(:,:,:) 
    131           ahtu_tm  (:,:,:)       = ahtu_tm  (:,:,:)       + ahtu(:,:,:)         * fse3u(:,:,:) 
    132           ahtv_tm  (:,:,:)       = ahtv_tm  (:,:,:)       + ahtv(:,:,:)         * fse3v(:,:,:) 
    133           ahtw_tm  (:,:,:)       = ahtw_tm  (:,:,:)       + ahtw(:,:,:)         * fse3w(:,:,:) 
    134 #elif defined key_traldf_c2d 
    135           ahtt_tm  (:,:)         = ahtt_tm  (:,:)         + ahtt(:,:) 
    136           ahtu_tm  (:,:)         = ahtu_tm  (:,:)         + ahtu(:,:) 
    137           ahtv_tm  (:,:)         = ahtv_tm  (:,:)         + ahtv(:,:) 
    138           ahtw_tm  (:,:)         = ahtw_tm  (:,:)         + ahtw(:,:) 
    139 #elif defined key_traldf_c1d 
    140           ahtt_tm  (:)           = ahtt_tm  (:,:)         + ahtt(:) 
    141           ahtu_tm  (:)           = ahtu_tm  (:,:)         + ahtu(:) 
    142           ahtv_tm  (:)           = ahtv_tm  (:,:)         + ahtv(:) 
    143           ahtw_tm  (:)           = ahtw_tm  (:,:)         + ahtw(:) 
    144 #else 
    145           ahtt_tm                = ahtt_tm                + ahtt 
    146           ahtu_tm                = ahtu_tm                + ahtu 
    147           ahtv_tm                = ahtv_tm                + ahtv 
    148           ahtw_tm                = ahtw_tm                + ahtw 
    149 #endif 
    150 #if defined key_traldf_eiv 
    151 #  if defined key_traldf_c3d 
    152           aeiu_tm  (:,:,:)       = aeiu_tm  (:,:,:)       + aeiu(:,:,:)         * fse3u(:,:,:) 
    153           aeiv_tm  (:,:,:)       = aeiv_tm  (:,:,:)       + aeiv(:,:,:)         * fse3v(:,:,:) 
    154           aeiw_tm  (:,:,:)       = aeiw_tm  (:,:,:)       + aeiw(:,:,:)         * fse3w(:,:,:) 
    155 #  elif defined key_traldf_c2d 
    156           aeiu_tm  (:,:)         = aeiu_tm  (:,:)         + aeiu(:,:) 
    157           aeiv_tm  (:,:)         = aeiv_tm  (:,:)         + aeiv(:,:) 
    158           aeiw_tm  (:,:)         = aeiw_tm  (:,:)         + aeiw(:,:) 
    159 #  elif defined key_traldf_c1d 
    160           aeiu_tm  (:)           = aeiu_tm  (:,:)         + aeiu(:) 
    161           aeiv_tm  (:)           = aeiv_tm  (:,:)         + aeiv(:) 
    162           aeiw_tm  (:)           = aeiw_tm  (:,:)         + aeiw(:) 
    163 #  else 
    164           aeiu_tm                = aeiu_tm                + aeiu 
    165           aeiv_tm                = aeiv_tm                + aeiv 
    166           aeiw_tm                = aeiw_tm                + aeiw 
    167 #  endif 
    168 #endif 
     125          ahtu_tm  (:,:,:)       = ahtu_tm  (:,:,:)       + ahtu(:,:,:) 
     126          ahtv_tm  (:,:,:)       = ahtv_tm  (:,:,:)       + ahtv(:,:,:) 
     127          IF( ln_ldfeiv ) THEN 
     128            aeiu_tm  (:,:,:)     = aeiu_tm  (:,:,:)       + aeiu(:,:,:) 
     129            aeiv_tm  (:,:,:)     = aeiv_tm  (:,:,:)       + aeiv(:,:,:) 
     130          ENDIF 
    169131 
    170132      ELSE                           !  It is time to substep  
     
    179141         avs_temp   (:,:,:)      = avs   (:,:,:) 
    180142# endif 
    181 #if defined key_ldfslp 
    182          wslpi_temp (:,:,:)      = wslpi (:,:,:) 
    183          wslpj_temp (:,:,:)      = wslpj (:,:,:) 
    184          uslp_temp  (:,:,:)      = uslp (:,:,:) 
    185          vslp_temp  (:,:,:)      = vslp (:,:,:) 
    186 #endif 
     143         IF( l_ldfslp ) THEN 
     144            uslp_temp  (:,:,:)      = uslp (:,:,:) 
     145            vslp_temp  (:,:,:)      = vslp (:,:,:) 
     146            wslpi_temp (:,:,:)      = wslpi (:,:,:) 
     147            wslpj_temp (:,:,:)      = wslpj (:,:,:) 
     148         ENDIF 
    187149# if defined key_trabbl 
    188150          IF( nn_bbl_ldf == 1 ) THEN 
     
    214176         qsr_temp   (:,:)        = qsr   (:,:) 
    215177         wndm_temp  (:,:)        = wndm  (:,:) 
    216 #if defined key_traldf_c3d 
     178         ! 
    217179         ahtu_temp  (:,:,:)      = ahtu  (:,:,:) 
    218180         ahtv_temp  (:,:,:)      = ahtv  (:,:,:) 
    219          ahtw_temp  (:,:,:)      = ahtw  (:,:,:) 
    220          ahtt_temp  (:,:,:)      = ahtt  (:,:,:) 
    221 #elif defined key_traldf_c2d 
    222          ahtu_temp  (:,:)        = ahtu  (:,:) 
    223          ahtv_temp  (:,:)        = ahtv  (:,:) 
    224          ahtw_temp  (:,:)        = ahtw  (:,:) 
    225          ahtt_temp  (:,:)        = ahtt  (:,:) 
    226 #elif defined key_traldf_c1d 
    227          ahtu_temp  (:)          = ahtu  (:) 
    228          ahtv_temp  (:)          = ahtv  (:) 
    229          ahtw_temp  (:)          = ahtw  (:) 
    230          ahtt_temp  (:)          = ahtt  (:) 
    231 #else 
    232          ahtu_temp               = ahtu 
    233          ahtv_temp               = ahtv 
    234          ahtw_temp               = ahtw 
    235          ahtt_temp               = ahtt 
    236 #endif 
    237  
    238 #if defined key_traldf_eiv 
    239 # if defined key_traldf_c3d 
    240          aeiu_temp  (:,:,:)      = aeiu(:,:,:) 
    241          aeiv_temp  (:,:,:)      = aeiv(:,:,:) 
    242          aeiw_temp  (:,:,:)      = aeiw(:,:,:) 
    243 # elif defined key_traldf_c2d 
    244          aeiu_temp  (:,:)        = aeiu(:,:) 
    245          aeiv_temp  (:,:)        = aeiv(:,:) 
    246          aeiw_temp  (:,:)        = aeiw(:,:) 
    247 # elif defined key_traldf_c1d 
    248          aeiu_temp  (:)          = aeiu(:) 
    249          aeiv_temp  (:)          = aeiv(:) 
    250          aeiw_temp  (:)          = aeiw(:) 
    251 # else 
    252          aeiu_temp               = aeiu 
    253          aeiv_temp               = aeiv 
    254          aeiw_temp               = aeiw 
    255 # endif 
    256 #endif 
     181         IF( ln_ldfeiv ) THEN 
     182            aeiu_temp  (:,:,:)   = aeiu(:,:,:) 
     183            aeiv_temp  (:,:,:)   = aeiv(:,:,:) 
     184         ENDIF 
    257185         !                                    !  Variables reset in trc_sub_ssh 
    258          rotn_temp  (:,:,:)      = rotn  (:,:,:) 
    259186         hdivn_temp (:,:,:)      = hdivn (:,:,:) 
    260          rotb_temp  (:,:,:)      = rotb  (:,:,:) 
    261          hdivb_temp (:,:,:)      = hdivb (:,:,:) 
    262187         hu_temp    (:,:)        = hu    (:,:) 
    263188         hv_temp    (:,:)        = hv    (:,:) 
     
    287212         tsn_tm   (:,:,:,jp_sal) = tsn_tm  (:,:,:,jp_sal) + tsn  (:,:,:,jp_sal) * e3t_temp(:,:,:)   
    288213         rhop_tm (:,:,:)         = rhop_tm (:,:,:)        + rhop (:,:,:)        * e3t_temp(:,:,:)   
    289          avt_tm   (:,:,:)        = avt_tm  (:,:,:)        + avt  (:,:,:)        * e3w_temp(:,:,:)   
     214         avt_tm   (:,:,:)        = avt_tm  (:,:,:)        + avt  (:,:,:)   
    290215# if defined key_zdfddm 
    291          avs_tm   (:,:,:)        = avs_tm  (:,:,:)        + avs  (:,:,:)        * e3w_temp(:,:,:)   
    292 # endif 
    293 #if defined key_ldfslp 
    294          wslpi_tm (:,:,:)        = wslpi_tm(:,:,:)        + wslpi(:,:,:)        * e3w_temp(:,:,:)  
    295          wslpj_tm (:,:,:)        = wslpj_tm(:,:,:)        + wslpj(:,:,:)        * e3w_temp(:,:,:)  
    296          uslp_tm  (:,:,:)        = uslp_tm (:,:,:)        + uslp (:,:,:)        * e3u_temp(:,:,:)  
    297          vslp_tm  (:,:,:)        = vslp_tm (:,:,:)        + vslp (:,:,:)        * e3v_temp(:,:,:)  
    298 #endif 
     216         avs_tm   (:,:,:)        = avs_tm  (:,:,:)        + avs  (:,:,:)   
     217# endif 
     218         IF( l_ldfslp ) THEN 
     219            wslpi_tm (:,:,:)        = wslpi_tm(:,:,:)        + wslpi(:,:,:) 
     220            wslpj_tm (:,:,:)        = wslpj_tm(:,:,:)        + wslpj(:,:,:) 
     221            uslp_tm  (:,:,:)        = uslp_tm (:,:,:)        + uslp (:,:,:) 
     222            vslp_tm  (:,:,:)        = vslp_tm (:,:,:)        + vslp (:,:,:)  
     223         ENDIF 
    299224# if defined key_trabbl 
    300225          IF( nn_bbl_ldf == 1 ) THEN 
     
    377302                  tsn  (ji,jj,jk,jp_sal) = tsn_tm  (ji,jj,jk,jp_sal) * z1_ne3t 
    378303                  rhop (ji,jj,jk)        = rhop_tm (ji,jj,jk)        * z1_ne3t 
    379                   avt  (ji,jj,jk)        = avt_tm  (ji,jj,jk)        * z1_ne3w 
     304                  avt  (ji,jj,jk)        = avt_tm  (ji,jj,jk)        * r1_ndttrcp1 
    380305# if defined key_zdfddm 
    381                   avs  (ji,jj,jk)        = avs_tm  (ji,jj,jk)        * z1_ne3w 
    382 # endif 
    383 #if defined key_ldfslp 
    384                   wslpi(ji,jj,jk)        = wslpi_tm(ji,jj,jk)        * z1_ne3w  
    385                   wslpj(ji,jj,jk)        = wslpj_tm(ji,jj,jk)        * z1_ne3w  
    386                   uslp (ji,jj,jk)        = uslp_tm (ji,jj,jk)        * z1_ne3u  
    387                   vslp (ji,jj,jk)        = vslp_tm (ji,jj,jk)        * z1_ne3v  
    388 #endif 
    389                ENDDO 
    390             ENDDO 
    391          ENDDO 
    392  
    393 #if defined key_traldf_c3d 
    394           ahtt_tm  (:,:,:)       = ahtt_tm  (:,:,:)       + ahtt(:,:,:)         * e3t_temp(:,:,:) 
    395           ahtu_tm  (:,:,:)       = ahtu_tm  (:,:,:)       + ahtu(:,:,:)         * e3u_temp(:,:,:) 
    396           ahtv_tm  (:,:,:)       = ahtv_tm  (:,:,:)       + ahtv(:,:,:)         * e3v_temp(:,:,:) 
    397           ahtw_tm  (:,:,:)       = ahtw_tm  (:,:,:)       + ahtw(:,:,:)         * e3w_temp(:,:,:) 
    398           ! 
    399           ahtt     (:,:,:)       = ahtt_tm  (:,:,:) * r1_ndttrcp1  / fse3t(:,:,:) 
    400           ahtu     (:,:,:)       = ahtu_tm  (:,:,:) * r1_ndttrcp1  / fse3u(:,:,:) 
    401           ahtv     (:,:,:)       = ahtv_tm  (:,:,:) * r1_ndttrcp1  / fse3v(:,:,:) 
    402           ahtw     (:,:,:)       = ahtw_tm  (:,:,:) * r1_ndttrcp1  / fse3w(:,:,:) 
    403 #elif defined key_traldf_c2d 
    404           ahtt_tm  (:,:)         = ahtt_tm  (:,:)         + ahtt(:,:) 
    405           ahtu_tm  (:,:)         = ahtu_tm  (:,:)         + ahtu(:,:) 
    406           ahtv_tm  (:,:)         = ahtv_tm  (:,:)         + ahtv(:,:) 
    407           ahtw_tm  (:,:)         = ahtw_tm  (:,:)         + ahtw(:,:) 
    408           ! 
    409           ahtt     (:,:)         = ahtt_tm  (:,:)   * r1_ndttrcp1 
    410           ahtu     (:,:)         = ahtu_tm  (:,:)   * r1_ndttrcp1 
    411           ahtv     (:,:)         = ahtv_tm  (:,:)   * r1_ndttrcp1 
    412           ahtw     (:,:)         = ahtw_tm  (:,:)   * r1_ndttrcp1 
    413 #elif defined key_traldf_c1d 
    414           ahtt_tm  (:)           = ahtt_tm  (:,:)         + ahtt(:) 
    415           ahtu_tm  (:)           = ahtu_tm  (:,:)         + ahtu(:) 
    416           ahtv_tm  (:)           = ahtv_tm  (:,:)         + ahtv(:) 
    417           ahtw_tm  (:)           = ahtw_tm  (:,:)         + ahtw(:) 
    418           ! 
    419           ahtt     (:)           = ahtt_tm  (:)     * r1_ndttrcp1 
    420           ahtu     (:)           = ahtu_tm  (:)     * r1_ndttrcp1 
    421           ahtv     (:)           = ahtv_tm  (:)     * r1_ndttrcp1 
    422           ahtw     (:)           = ahtw_tm  (:)     * r1_ndttrcp1 
    423 #else 
    424           ahtt_tm                = ahtt_tm                + ahtt 
    425           ahtu_tm                = ahtu_tm                + ahtu 
    426           ahtv_tm                = ahtv_tm                + ahtv 
    427           ahtw_tm                = ahtw_tm                + ahtw 
    428           ! 
    429           ahtt                   = ahtt_tm          * r1_ndttrcp1 
    430           ahtu                   = ahtu_tm          * r1_ndttrcp1 
    431           ahtv                   = ahtv_tm          * r1_ndttrcp1 
    432           ahtw                   = ahtw_tm          * r1_ndttrcp1 
    433 #endif 
    434  
    435 #if defined key_traldf_eiv 
    436 # if defined key_traldf_c3d 
    437           aeiu_tm  (:,:,:)       = aeiu_tm  (:,:,:)       + aeiu(:,:,:)         * e3u_temp(:,:,:) 
    438           aeiv_tm  (:,:,:)       = aeiv_tm  (:,:,:)       + aeiv(:,:,:)         * e3v_temp(:,:,:) 
    439           aeiw_tm  (:,:,:)       = aeiw_tm  (:,:,:)       + aeiw(:,:,:)         * e3w_temp(:,:,:) 
    440           ! 
    441           aeiu     (:,:,:)       = aeiu_tm  (:,:,:) * r1_ndttrcp1  / fse3u(:,:,:) 
    442           aeiv     (:,:,:)       = aeiv_tm  (:,:,:) * r1_ndttrcp1  / fse3v(:,:,:) 
    443           aeiw     (:,:,:)       = aeiw_tm  (:,:,:) * r1_ndttrcp1  / fse3w(:,:,:) 
    444 # elif defined key_traldf_c2d 
    445           aeiu_tm  (:,:)         = aeiu_tm  (:,:)         + aeiu(:,:) 
    446           aeiv_tm  (:,:)         = aeiv_tm  (:,:)         + aeiv(:,:) 
    447           aeiw_tm  (:,:)         = aeiw_tm  (:,:)         + aeiw(:,:) 
    448           ! 
    449           aeiu     (:,:)         = aeiu_tm  (:,:)   * r1_ndttrcp1 
    450           aeiv     (:,:)         = aeiv_tm  (:,:)   * r1_ndttrcp1 
    451           aeiw     (:,:)         = aeiw_tm  (:,:)   * r1_ndttrcp1 
    452 # elif defined key_traldf_c1d 
    453           aeiu_tm  (:)           = aeiu_tm  (:,:)         + aeiu(:) 
    454           aeiv_tm  (:)           = aeiv_tm  (:,:)         + aeiv(:) 
    455           aeiw_tm  (:)           = aeiw_tm  (:,:)         + aeiw(:) 
    456           ! 
    457           aeiu     (:)           = aeiu_tm  (:)     * r1_ndttrcp1 
    458           aeiv     (:)           = aeiv_tm  (:)     * r1_ndttrcp1 
    459           aeiw     (:)           = aeiw_tm  (:)     * r1_ndttrcp1 
    460 # else 
    461           aeiu_tm                = aeiu_tm                + aeiu 
    462           aeiv_tm                = aeiv_tm                + aeiv 
    463           aeiw_tm                = aeiw_tm                + aeiw 
    464           ! 
    465           aeiu                   = aeiu_tm          * r1_ndttrcp1 
    466           aeiv                   = aeiv_tm          * r1_ndttrcp1 
    467           aeiw                   = aeiw_tm          * r1_ndttrcp1 
    468 # endif 
    469 #endif 
    470  
     306                  avs  (ji,jj,jk)        = avs_tm  (ji,jj,jk)        * r1_ndttrcp1 
     307# endif 
     308               END DO 
     309            END DO 
     310         END DO 
     311         IF( l_ldfslp ) THEN 
     312            wslpi(:,:,:)        = wslpi_tm(:,:,:)        * r1_ndttrcp1  
     313            wslpj(:,:,:)        = wslpj_tm(:,:,:)        * r1_ndttrcp1  
     314            uslp (:,:,:)        = uslp_tm (:,:,:)        * r1_ndttrcp1  
     315            vslp (:,:,:)        = vslp_tm (:,:,:)        * r1_ndttrcp1  
     316         ENDIF 
     317         ! 
     318         ahtu_tm(:,:,:) = ahtu_tm(:,:,:) + ahtu(:,:,:) 
     319         ahtv_tm(:,:,:) = ahtv_tm(:,:,:) + ahtv(:,:,:) 
     320         ! 
     321         ahtu   (:,:,:) = ahtu_tm(:,:,:) * r1_ndttrcp1 
     322         ahtv   (:,:,:) = ahtv_tm(:,:,:) * r1_ndttrcp1 
     323         IF( ln_ldfeiv ) THEN 
     324            aeiu_tm(:,:,:) = aeiu_tm(:,:,:) + aeiu(:,:,:) 
     325            aeiv_tm(:,:,:) = aeiv_tm(:,:,:) + aeiv(:,:,:) 
     326            ! 
     327            aeiu   (:,:,:) = aeiu_tm(:,:,:) * r1_ndttrcp1 
     328            aeiv   (:,:,:) = aeiv_tm(:,:,:) * r1_ndttrcp1 
     329         ENDIF 
     330 
     331!!gm  All those lbc_lnk are useless since the averaging is done over full arrays ! 
    471332         CALL lbc_lnk( un    (:,:,:)       , 'U',-1. )  
    472333         CALL lbc_lnk( vn    (:,:,:)       , 'V',-1. )  
     
    478339          CALL lbc_lnk( avs  (:,:,:)       , 'W', 1. )  
    479340# endif 
    480 #if defined key_ldfslp 
    481          CALL lbc_lnk( uslp  (:,:,:)       , 'U',-1. )  
    482          CALL lbc_lnk( vslp  (:,:,:)       , 'V',-1. )  
    483          CALL lbc_lnk( wslpi (:,:,:)       , 'W',-1. )  
    484          CALL lbc_lnk( wslpj (:,:,:)       , 'W',-1. )  
    485 #endif 
     341         IF( l_ldfslp ) THEN 
     342            CALL lbc_lnk( uslp  (:,:,:)       , 'U',-1. )  
     343            CALL lbc_lnk( vslp  (:,:,:)       , 'V',-1. )  
     344            CALL lbc_lnk( wslpi (:,:,:)       , 'W',-1. )  
     345            CALL lbc_lnk( wslpj (:,:,:)       , 'W',-1. )  
     346         ENDIF 
    486347         CALL lbc_lnk( sshn  (:,:)         , 'T', 1. )  
    487348!!Z~     CALL lbc_lnk( sshu_n(:,:)         , 'U', 1. )  
     
    513374         ENDIF 
    514375# endif 
    515 #if defined key_traldf_c3d 
    516          CALL lbc_lnk( ahtt  (:,:,:)       , 'T', 1. )  
    517376         CALL lbc_lnk( ahtu  (:,:,:)       , 'U', 1. )  
    518377         CALL lbc_lnk( ahtv  (:,:,:)       , 'V', 1. )  
    519          CALL lbc_lnk( ahtw  (:,:,:)       , 'W', 1. )  
    520 #elif defined key_traldf_c2d 
    521          CALL lbc_lnk( ahtt  (:,:)         , 'T', 1. )  
    522          CALL lbc_lnk( ahtu  (:,:)         , 'U', 1. )  
    523          CALL lbc_lnk( ahtv  (:,:)         , 'V', 1. )  
    524          CALL lbc_lnk( ahtw  (:,:)         , 'W', 1. )  
    525 #endif 
    526 #if defined key_traldf_eiv 
    527 #if defined key_traldf_c3d 
    528          CALL lbc_lnk( aeiu  (:,:,:)       , 'U', 1. )  
    529          CALL lbc_lnk( aeiv  (:,:,:)       , 'V', 1. )  
    530          CALL lbc_lnk( aeiw  (:,:,:)       , 'W', 1. )  
    531 #elif defined key_traldf_c2d 
    532          CALL lbc_lnk( aeiu  (:,:)         , 'U', 1. )  
    533          CALL lbc_lnk( aeiv  (:,:)         , 'V', 1. )  
    534          CALL lbc_lnk( aeiw  (:,:)         , 'W', 1. )  
    535 #endif 
    536 #endif 
     378         IF( ln_ldfeiv ) THEN 
     379            CALL lbc_lnk( aeiu  (:,:,:)    , 'U', 1. )  
     380            CALL lbc_lnk( aeiv  (:,:,:)    , 'V', 1. )  
     381         ENDIF 
    537382         ! 
    538383         CALL trc_sub_ssh( kt )         ! after ssh & vertical velocity 
    539384         ! 
    540385         CALL lbc_lnk( wn    (:,:,:)       , 'W',-1. )  
    541          CALL lbc_lnk( rotn  (:,:,:)       , 'F', 1. )  
    542386         CALL lbc_lnk( hdivn (:,:,:)       , 'T', 1. )  
    543          CALL lbc_lnk( rotb  (:,:,:)       , 'F', 1. )  
    544          CALL lbc_lnk( hdivb (:,:,:)       , 'T', 1. )  
    545387         CALL lbc_lnk( hu    (:,:)         , 'U', 1. )  
    546388         CALL lbc_lnk( hv    (:,:)         , 'V', 1. )  
     
    553395   END SUBROUTINE trc_sub_stp 
    554396 
     397 
    555398   SUBROUTINE trc_sub_ini 
    556399      !!------------------------------------------------------------------- 
    557400      !!                     ***  ROUTINE trc_sub_ini  *** 
    558401      !!                       
    559       !! ** Purpose : Initialize variables needed for sub-stepping passive tracers 
     402      !! ** Purpose :   Initialize variables needed for sub-stepping passive tracers 
    560403      !!  
    561       !! ** Method  :  
    562       !!              Compute the averages for sub-stepping 
     404      !! ** Method  :   Compute the averages for sub-stepping 
    563405      !!------------------------------------------------------------------- 
    564406      INTEGER ::   ierr 
     
    580422      tsn_tm  (:,:,:,jp_sal) = tsn  (:,:,:,jp_sal) * fse3t(:,:,:)   
    581423      rhop_tm (:,:,:)        = rhop (:,:,:)        * fse3t(:,:,:)   
    582       avt_tm  (:,:,:)        = avt  (:,:,:)        * fse3w(:,:,:)   
     424      avt_tm  (:,:,:)        = avt  (:,:,:)  
    583425# if defined key_zdfddm 
    584       avs_tm  (:,:,:)        = avs  (:,:,:)        * fse3w(:,:,:)   
    585 # endif 
    586 #if defined key_ldfslp 
    587       wslpi_tm(:,:,:)        = wslpi(:,:,:)        * fse3w(:,:,:)  
    588       wslpj_tm(:,:,:)        = wslpj(:,:,:)        * fse3w(:,:,:)  
    589       uslp_tm (:,:,:)        = uslp (:,:,:)        * fse3u(:,:,:)  
    590       vslp_tm (:,:,:)        = vslp (:,:,:)        * fse3v(:,:,:)  
    591 #endif 
     426      avs_tm  (:,:,:)        = avs  (:,:,:)   
     427# endif 
     428      IF( l_ldfslp ) THEN 
     429         wslpi_tm(:,:,:)        = wslpi(:,:,:) 
     430         wslpj_tm(:,:,:)        = wslpj(:,:,:) 
     431         uslp_tm (:,:,:)        = uslp (:,:,:) 
     432         vslp_tm (:,:,:)        = vslp (:,:,:) 
     433      ENDIF 
    592434      sshn_tm  (:,:) = sshn  (:,:)  
    593435!!Z~  sshu_n_tm(:,:) = sshu_n(:,:)  
     
    614456# endif 
    615457      ! 
    616 #if defined key_traldf_c3d 
    617       ahtt_tm(:,:,:) = ahtt(:,:,:) * fse3t(:,:,:) 
    618       ahtu_tm(:,:,:) = ahtu(:,:,:) * fse3u(:,:,:) 
    619       ahtv_tm(:,:,:) = ahtv(:,:,:) * fse3v(:,:,:) 
    620       ahtw_tm(:,:,:) = ahtw(:,:,:) * fse3w(:,:,:) 
    621 #elif defined key_traldf_c2d 
    622       ahtt_tm(:,:)   = ahtt(:,:) 
    623       ahtu_tm(:,:)   = ahtu(:,:) 
    624       ahtv_tm(:,:)   = ahtv(:,:) 
    625       ahtw_tm(:,:)   = ahtw(:,:) 
    626 #elif defined key_traldf_c1d 
    627       ahtt_tm(:)     = ahtt(:) 
    628       ahtu_tm(:)     = ahtu(:) 
    629       ahtv_tm(:)     = ahtv(:) 
    630       ahtw_tm(:)     = ahtw(:) 
    631 #else 
    632       ahtt_tm        = ahtt 
    633       ahtu_tm        = ahtu 
    634       ahtv_tm        = ahtv 
    635       ahtw_tm        = ahtw 
    636 #endif 
    637       ! 
    638 #if defined key_traldf_eiv 
    639 #  if defined key_traldf_c3d 
    640       aeiu_tm(:,:,:) = aeiu(:,:,:) * fse3u(:,:,:) 
    641       aeiv_tm(:,:,:) = aeiv(:,:,:) * fse3v(:,:,:) 
    642       aeiw_tm(:,:,:) = aeiw(:,:,:) * fse3w(:,:,:) 
    643 #  elif defined key_traldf_c2d 
    644       aeiu_tm(:,:)   = aeiu(:,:) 
    645       aeiv_tm(:,:)   = aeiv(:,:) 
    646       aeiw_tm(:,:)   = aeiw(:,:) 
    647 #  elif defined key_traldf_c1d 
    648       aeiu_tm(:)     = aeiu(:) 
    649       aeiv_tm(:)     = aeiv(:) 
    650       aeiw_tm(:)     = aeiw(:) 
    651 #  else 
    652       aeiu_tm        = aeiu 
    653       aeiv_tm        = aeiv 
    654       aeiw_tm        = aeiw 
    655 #  endif 
    656 #endif 
     458      ahtu_tm(:,:,:) = ahtu(:,:,:) 
     459      ahtv_tm(:,:,:) = ahtv(:,:,:) 
     460      ! 
     461      IF( ln_ldfeiv ) THEN 
     462         aeiu_tm(:,:,:) = aeiu(:,:,:) 
     463         aeiv_tm(:,:,:) = aeiv(:,:,:) 
     464      ENDIF 
    657465      ! 
    658466      IF( nn_timing == 1 )  CALL timing_stop('trc_sub_ini') 
    659467      ! 
    660468   END SUBROUTINE trc_sub_ini 
     469 
    661470 
    662471   SUBROUTINE trc_sub_reset( kt ) 
     
    685494      avs   (:,:,:)   =  avs_temp   (:,:,:) 
    686495# endif 
    687 #if defined key_ldfslp 
    688       wslpi (:,:,:)   =  wslpi_temp (:,:,:) 
    689       wslpj (:,:,:)   =  wslpj_temp (:,:,:) 
    690       uslp  (:,:,:)   =  uslp_temp  (:,:,:) 
    691       vslp  (:,:,:)   =  vslp_temp  (:,:,:) 
    692 #endif 
     496      IF( l_ldfslp ) THEN 
     497         wslpi (:,:,:)   =  wslpi_temp (:,:,:) 
     498         wslpj (:,:,:)   =  wslpj_temp (:,:,:) 
     499         uslp  (:,:,:)   =  uslp_temp  (:,:,:) 
     500         vslp  (:,:,:)   =  vslp_temp  (:,:,:) 
     501      ENDIF 
    693502      sshn  (:,:)     =  sshn_temp  (:,:) 
    694503      sshb  (:,:)     =  sshb_temp  (:,:) 
     
    722531# endif 
    723532      ! 
    724 #if defined key_traldf_c3d 
    725533      ahtu  (:,:,:)   =  ahtu_temp  (:,:,:) 
    726534      ahtv  (:,:,:)   =  ahtv_temp  (:,:,:) 
    727       ahtw  (:,:,:)   =  ahtw_temp  (:,:,:) 
    728       ahtt  (:,:,:)   =  ahtt_temp  (:,:,:) 
    729 #elif defined key_traldf_c2d 
    730       ahtu  (:,:)     =  ahtu_temp  (:,:) 
    731       ahtv  (:,:)     =  ahtv_temp  (:,:) 
    732       ahtw  (:,:)     =  ahtw_temp  (:,:) 
    733       ahtt  (:,:)     =  ahtt_temp  (:,:) 
    734 #elif defined key_traldf_c1d 
    735       ahtu  (:)       =  ahtu_temp  (:) 
    736       ahtv  (:)       =  ahtv_temp  (:) 
    737       ahtw  (:)       =  ahtw_temp  (:) 
    738       ahtt  (:)       =  ahtt_temp  (:) 
    739 #else 
    740       ahtu            =  ahtu_temp 
    741       ahtv            =  ahtv_temp 
    742       ahtw            =  ahtw_temp 
    743       ahtt            =  ahtt_temp 
    744 #endif 
    745       ! 
    746 #if defined key_traldf_eiv 
    747 #if defined key_traldf_c3d 
    748       aeiu  (:,:,:)  =  aeiu_temp(:,:,:) 
    749       aeiv  (:,:,:)  =  aeiv_temp(:,:,:) 
    750       aeiw  (:,:,:)  =  aeiw_temp(:,:,:) 
    751 #elif defined key_traldf_c2d 
    752       aeiu  (:,:)    =  aeiu_temp(:,:) 
    753       aeiv  (:,:)    =  aeiv_temp(:,:) 
    754       aeiw  (:,:)    =  aeiw_temp(:,:) 
    755 #elif defined key_traldf_c1d 
    756       aeiu  (:)      =  aeiu_temp(:) 
    757       aeiv  (:)      =  aeiv_temp(:) 
    758       aeiw  (:)      =  aeiw_temp(:) 
    759 #else 
    760       aeiu           =  aeiu_temp 
    761       aeiv           =  aeiv_temp 
    762       aeiw           =  aeiw_temp 
    763 #endif 
    764 #endif  
     535      ! 
     536      IF( ln_ldfeiv ) THEN 
     537         aeiu  (:,:,:)  =  aeiu_temp(:,:,:) 
     538         aeiv  (:,:,:)  =  aeiv_temp(:,:,:) 
     539      ENDIF 
    765540      hdivn (:,:,:)   =  hdivn_temp (:,:,:) 
    766       rotn  (:,:,:)   =  rotn_temp  (:,:,:) 
    767       hdivb (:,:,:)   =  hdivb_temp (:,:,:) 
    768       rotb  (:,:,:)   =  rotb_temp  (:,:,:) 
    769541      hu    (:,:)     =  hu_temp    (:,:) 
    770542      hv    (:,:)     =  hv_temp    (:,:) 
     
    773545      !                                       
    774546      DO jk = 1, jpk 
    775          fse3t(:,:,jk)= e3t_temp(:,:,jk)  
    776          fse3u(:,:,jk)= e3u_temp(:,:,jk)  
    777          fse3v(:,:,jk)= e3v_temp(:,:,jk)  
    778          fse3w(:,:,jk)= e3w_temp(:,:,jk)  
     547         fse3t(:,:,jk) = e3t_temp(:,:,jk)  
     548         fse3u(:,:,jk) = e3u_temp(:,:,jk)  
     549         fse3v(:,:,jk) = e3v_temp(:,:,jk)  
     550         fse3w(:,:,jk) = e3w_temp(:,:,jk)  
    779551      END DO 
    780552      !                                           !------------------------------! 
    781553      IF( lk_vvl ) THEN                           !  Update Now Vertical coord.  !   (only in vvl case) 
    782         !                                           !------------------------------! 
     554        !                                         !------------------------------! 
    783555         DO jk = 1, jpkm1 
    784556            fsdept(:,:,jk) = fsdept_n(:,:,jk)          ! now local depths stored in fsdep. arrays 
     
    803575         tsn_tm  (:,:,:,jp_sal) = tsn  (:,:,:,jp_sal) * fse3t(:,:,:)   
    804576         rhop_tm (:,:,:)        = rhop (:,:,:)        * fse3t(:,:,:)   
    805          avt_tm  (:,:,:)        = avt  (:,:,:)        * fse3w(:,:,:)   
     577         avt_tm  (:,:,:)        = avt  (:,:,:)  
    806578# if defined key_zdfddm 
    807          avs_tm  (:,:,:)        = avs  (:,:,:)        * fse3w(:,:,:)   
    808 # endif 
    809 #if defined key_ldfslp 
    810          wslpi_tm(:,:,:)        = wslpi(:,:,:)        * fse3w(:,:,:)  
    811          wslpj_tm(:,:,:)        = wslpj(:,:,:)        * fse3w(:,:,:)  
    812          uslp_tm (:,:,:)        = uslp (:,:,:)        * fse3u(:,:,:)  
    813          vslp_tm (:,:,:)        = vslp (:,:,:)        * fse3v(:,:,:)  
    814 #endif 
     579         avs_tm  (:,:,:)        = avs  (:,:,:) 
     580# endif 
     581      IF( l_ldfslp ) THEN 
     582         wslpi_tm(:,:,:)        = wslpi(:,:,:) 
     583         wslpj_tm(:,:,:)        = wslpj(:,:,:) 
     584         uslp_tm (:,:,:)        = uslp (:,:,:) 
     585         vslp_tm (:,:,:)        = vslp (:,:,:) 
     586      ENDIF 
    815587      ! 
    816588      sshb_hold  (:,:) = sshn  (:,:) 
     
    840612# endif 
    841613      ! 
    842 #if defined key_traldf_c3d 
    843614      DO jk = 1, jpkm1 
    844          ahtt_tm(:,:,jk) = ahtt(:,:,jk) * fse3t(:,:,jk) 
    845          ahtu_tm(:,:,jk) = ahtu(:,:,jk) * fse3u(:,:,jk) 
    846          ahtv_tm(:,:,jk) = ahtv(:,:,jk) * fse3v(:,:,jk) 
    847          ahtw_tm(:,:,jk) = ahtw(:,:,jk) * fse3w(:,:,jk) 
     615         ahtu_tm(:,:,jk) = ahtu(:,:,jk) 
     616         ahtv_tm(:,:,jk) = ahtv(:,:,jk) 
     617         IF( ln_ldfeiv ) THEN 
     618            aeiu_tm(:,:,jk) = aeiu(:,:,jk) * fse3u(:,:,jk) 
     619            aeiv_tm(:,:,jk) = aeiv(:,:,jk) * fse3v(:,:,jk) 
     620         ENDIF 
    848621      END DO 
    849 #elif defined key_traldf_c2d 
    850       ahtt_tm(:,:)   = ahtt(:,:) 
    851       ahtu_tm(:,:)   = ahtu(:,:) 
    852       ahtv_tm(:,:)   = ahtv(:,:) 
    853       ahtw_tm(:,:)   = ahtw(:,:) 
    854 #elif defined key_traldf_c1d 
    855       ahtt_tm(:)     = ahtt(:) 
    856       ahtu_tm(:)     = ahtu(:) 
    857       ahtv_tm(:)     = ahtv(:) 
    858       ahtw_tm(:)     = ahtw(:) 
    859 #else 
    860       ahtt_tm        = ahtt 
    861       ahtu_tm        = ahtu 
    862       ahtv_tm        = ahtv 
    863       ahtw_tm        = ahtw 
    864 #endif 
    865       ! 
    866 #if defined key_traldf_eiv 
    867 #  if defined key_traldf_c3d 
    868       DO jk = 1, jpk 
    869          aeiu_tm(:,:,jk) = aeiu(:,:,jk) * fse3u(:,:,jk) 
    870          aeiv_tm(:,:,jk) = aeiv(:,:,jk) * fse3v(:,:,jk) 
    871          aeiw_tm(:,:,jk) = aeiw(:,:,jk) * fse3w(:,:,jk) 
    872       END DO 
    873 #  elif defined key_traldf_c2d 
    874       aeiu_tm(:,:)   = aeiu(:,:) 
    875       aeiv_tm(:,:)   = aeiv(:,:) 
    876       aeiw_tm(:,:)   = aeiw(:,:) 
    877 #  elif defined key_traldf_c1d 
    878       aeiu_tm(:)     = aeiu(:) 
    879       aeiv_tm(:)     = aeiv(:) 
    880       aeiw_tm(:)     = aeiw(:) 
    881 #  else 
    882       aeiu_tm        = aeiu 
    883       aeiv_tm        = aeiv 
    884       aeiw_tm        = aeiw 
    885 #  endif 
    886 #endif 
    887622      ! 
    888623      IF( nn_timing == 1 )  CALL timing_stop('trc_sub_reset') 
     
    958693      ENDIF 
    959694      ! 
    960       CALL div_cur( kt )                              ! Horizontal divergence & Relative vorticity 
     695!!gm BUG here  the recomputed divergence will includes the wrong river runoff..... 
     696      CALL div_hor( kt )                              ! Horizontal divergence  
    961697      ! 
    962698      z2dt = 2._wp * rdt                              ! set time step size (Euler/Leapfrog) 
     
    979715      CALL agrif_ssh( kt ) 
    980716#endif 
    981 #if defined key_obc 
    982       IF( Agrif_Root() ) THEN  
    983          ssha(:,:) = ssha(:,:) * obctmsk(:,:) 
    984          CALL lbc_lnk( ssha, 'T', 1. )                 ! absolutly compulsory !! (jmm) 
    985       ENDIF 
    986 #endif 
    987717#if defined key_bdy 
    988718      ssha(:,:) = ssha(:,:) * bdytmask(:,:) 
    989719      CALL lbc_lnk( ssha, 'T', 1. )  
    990720#endif 
    991  
     721      ! 
    992722      !                                                ! Sea Surface Height at u-,v- and f-points (vvl case only) 
    993723!!Z~  IF( lk_vvl ) THEN                                ! (required only in key_vvl case) 
    994724!!Z~     DO jj = 1, jpjm1 
    995725!!Z~        DO ji = 1, jpim1      ! NO Vector Opt. 
    996 !!Z~           sshu_a(ji,jj) = 0.5  * umask(ji,jj,1) / ( e1u(ji  ,jj) * e2u(ji  ,jj) )                   & 
    997 !!Z~              &                                  * ( e1t(ji  ,jj) * e2t(ji  ,jj) * ssha(ji  ,jj)     & 
    998 !!Z~              &                                    + e1t(ji+1,jj) * e2t(ji+1,jj) * ssha(ji+1,jj) ) 
    999 !!Z~           sshv_a(ji,jj) = 0.5  * vmask(ji,jj,1) / ( e1v(ji,jj  ) * e2v(ji,jj  ) )                   & 
    1000 !!Z~              &                                  * ( e1t(ji,jj  ) * e2t(ji,jj  ) * ssha(ji,jj  )     & 
    1001 !!Z~              &                                    + e1t(ji,jj+1) * e2t(ji,jj+1) * ssha(ji,jj+1) ) 
     726!!Z~           sshu_a(ji,jj) = 0.5  * umask(ji,jj,1) * r1_e1e2u(ji  ,jj) * ( e1e2t(ji  ,jj) * ssha(ji  ,jj)   & 
     727!!Z~              &                                                        + e1e2t(ji+1,jj) * ssha(ji+1,jj) ) 
     728!!Z~           sshv_a(ji,jj) = 0.5  * vmask(ji,jj,1) * r1_e1e2v(ji,jj  ) * ( e1e2t(ji,jj  ) * ssha(ji,jj  )     & 
     729!!Z~              &                                                        + e1e2t(ji,jj+1) * ssha(ji,jj+1) ) 
    1002730!!Z~        END DO 
    1003731!!Z~     END DO 
    1004732!!Z~     CALL lbc_lnk( sshu_a, 'U', 1. )   ;   CALL lbc_lnk( sshv_a, 'V', 1. )      ! Boundaries conditions 
    1005733!!Z~  ENDIF 
    1006        
    1007  
     734      ! 
    1008735      !                                           !------------------------------! 
    1009736      !                                           !     Now Vertical Velocity    ! 
     
    1019746#endif 
    1020747      END DO 
    1021  
    1022748      ! 
    1023749      CALL wrk_dealloc( jpi, jpj, zhdiv ) 
     
    1045771         &      e3t_temp(jpi,jpj,jpk)       ,  e3u_temp(jpi,jpj,jpk),    & 
    1046772         &      e3v_temp(jpi,jpj,jpk)       ,  e3w_temp(jpi,jpj,jpk),    & 
    1047 #if defined key_ldfslp 
     773!!gm here define these arrays only if l_ldfslp = True  
    1048774         &      wslpi_temp(jpi,jpj,jpk)     ,  wslpj_temp(jpi,jpj,jpk),  & 
    1049775         &      uslp_temp(jpi,jpj,jpk)      ,  vslp_temp(jpi,jpj,jpk),   & 
    1050 #endif 
     776         &      wslpi_tm(jpi,jpj,jpk)       ,  wslpj_tm(jpi,jpj,jpk),    & 
     777         &      uslp_tm(jpi,jpj,jpk)        ,  vslp_tm(jpi,jpj,jpk),     & 
     778!!gm 
    1051779#if defined key_trabbl 
    1052780         &      ahu_bbl_temp(jpi,jpj)       ,  ahv_bbl_temp(jpi,jpj),    & 
    1053781         &      utr_bbl_temp(jpi,jpj)       ,  vtr_bbl_temp(jpi,jpj),    & 
     782         &      ahu_bbl_tm(jpi,jpj)         ,  ahv_bbl_tm(jpi,jpj),      & 
     783         &      utr_bbl_tm(jpi,jpj)         ,  vtr_bbl_tm(jpi,jpj),      & 
    1054784#endif 
    1055785         &      rnf_temp(jpi,jpj)           ,  h_rnf_temp(jpi,jpj) ,     & 
     
    1062792         &      avs_tm(jpi,jpj,jpk)         ,  avs_temp(jpi,jpj,jpk) ,   & 
    1063793# endif 
    1064 #if defined key_traldf_c3d 
    1065          &      ahtt_tm(jpi,jpj,jpk)        ,  ahtt_temp(jpi,jpj,jpk),   & 
     794!!gm here define these arrays only if l_ldftra_time = True  
    1066795         &      ahtu_tm(jpi,jpj,jpk)        ,  ahtu_temp(jpi,jpj,jpk),   & 
    1067796         &      ahtv_tm(jpi,jpj,jpk)        ,  ahtv_temp(jpi,jpj,jpk),   & 
    1068          &      ahtw_tm(jpi,jpj,jpk)        ,  ahtw_temp(jpi,jpj,jpk),   & 
    1069 #elif defined key_traldf_c2d 
    1070          &      ahtt_tm(jpi,jpj)            ,  ahtt_temp(jpi,jpj),       & 
    1071          &      ahtu_tm(jpi,jpj)            ,  ahtu_temp(jpi,jpj),       & 
    1072          &      ahtv_tm(jpi,jpj)            ,  ahtv_temp(jpi,jpj),       & 
    1073          &      ahtw_tm(jpi,jpj)            ,  ahtw_temp(jpi,jpj),       & 
    1074 #elif defined key_traldf_c1d 
    1075          &      ahtt_tm(jpk)                ,  ahtt_temp(jpk),           & 
    1076          &      ahtu_tm(jpk)                ,  ahtu_temp(jpk),           & 
    1077          &      ahtv_tm(jpk)                ,  ahtv_temp(jpk),           & 
    1078          &      ahtw_tm(jpk)                ,  ahtw_temp(jpk),           & 
    1079 #endif 
    1080 #if defined key_traldf_eiv 
    1081 # if defined key_traldf_c3d 
     797!!gm here define these arrays only if l_ldfeiv_time = True  
    1082798         &      aeiu_tm(jpi,jpj,jpk)        ,  aeiu_temp(jpi,jpj,jpk),   & 
    1083799         &      aeiv_tm(jpi,jpj,jpk)        ,  aeiv_temp(jpi,jpj,jpk),   & 
    1084          &      aeiw_tm(jpi,jpj,jpk)        ,  aeiw_temp(jpi,jpj,jpk),   & 
    1085 # elif defined key_traldf_c2d 
    1086          &      aeiu_tm(jpi,jpj)            ,  aeiu_temp(jpi,jpj),       & 
    1087          &      aeiv_tm(jpi,jpj)            ,  aeiv_temp(jpi,jpj),       & 
    1088          &      aeiw_tm(jpi,jpj)            ,  aeiw_temp(jpi,jpj),       & 
    1089 # elif defined key_traldf_c1d 
    1090          &      aeiu_tm(jpk)                ,  aeiu_temp(jpk),           & 
    1091          &      aeiv_tm(jpk)                ,  aeiv_temp(jpk),           & 
    1092          &      aeiw_tm(jpk)                ,  aeiw_temp(jpk),           & 
    1093 # endif 
    1094 # endif 
    1095          &      hdivn_temp(jpi,jpj,jpk)     ,  hdivb_temp(jpi,jpj,jpk),  & 
    1096          &      rotn_temp(jpi,jpj,jpk)      ,  rotb_temp(jpi,jpj,jpk),   & 
     800!!gm end 
     801         &      hdivn_temp(jpi,jpj,jpk)     ,                            & 
    1097802         &      hu_temp(jpi,jpj)            ,  hv_temp(jpi,jpj),         & 
    1098803         &      hur_temp(jpi,jpj)           ,  hvr_temp(jpi,jpj),        & 
     
    1106811         &      emp_b_hold(jpi,jpj)         ,                            & 
    1107812         &      hmld_tm(jpi,jpj)            ,  qsr_tm(jpi,jpj) ,         & 
    1108 #if defined key_ldfslp 
    1109          &      wslpi_tm(jpi,jpj,jpk)       ,  wslpj_tm(jpi,jpj,jpk),    & 
    1110          &      uslp_tm(jpi,jpj,jpk)        ,  vslp_tm(jpi,jpj,jpk),     & 
    1111 #endif 
    1112 #if defined key_trabbl 
    1113          &      ahu_bbl_tm(jpi,jpj)         ,  ahv_bbl_tm(jpi,jpj),      & 
    1114          &      utr_bbl_tm(jpi,jpj)         ,  vtr_bbl_tm(jpi,jpj),      & 
    1115 #endif 
    1116813         &      rnf_tm(jpi,jpj)             ,  h_rnf_tm(jpi,jpj) ,       & 
    1117814         &                                    STAT=trc_sub_alloc )   
  • branches/2014/dev_CNRS0_NOC1_LDF/NEMOGCM/NEMO/TOP_SRC/trcwri.F90

    r3750 r4617  
    1010   !!   'key_top'                                           TOP models 
    1111   !!---------------------------------------------------------------------- 
    12    !! trc_wri_trc   :  outputs of concentration fields 
     12   !! trc_wri      :  outputs of concentration fields 
    1313   !!---------------------------------------------------------------------- 
    1414   USE dom_oce     ! ocean space and time domain variables 
     
    2929   !! * Substitutions 
    3030#  include "top_substitute.h90" 
    31  
     31   !!---------------------------------------------------------------------- 
     32   !! NEMO/TOP 3.3 , NEMO Consortium (2010) 
     33   !! $Id$  
     34   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 
     35   !!---------------------------------------------------------------------- 
    3236CONTAINS 
    3337 
     
    7680#endif 
    7781 
    78    !!---------------------------------------------------------------------- 
    79    !! NEMO/TOP 3.3 , NEMO Consortium (2010) 
    80    !! $Id$  
    81    !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 
    8282   !!====================================================================== 
    8383END MODULE trcwri 
Note: See TracChangeset for help on using the changeset viewer.