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 3326 for branches/2012 – NEMO

Changeset 3326 for branches/2012


Ignore:
Timestamp:
2012-03-14T10:19:21+01:00 (12 years ago)
Author:
gm
Message:

Ediag branche: #927 add Potential Energy trend diagnostics (trdpen.F90)

Location:
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef.xml

    r3317 r3326  
    117117    <field id="Mmx_v"          description="Mm current barotrope along j-axis harmonic real part "      unit="m/s"        /> 
    118118    <field id="Mmy_v"          description="Mm current barotrope along j-axis harmonic imaginary part " unit="m/s"        /> 
    119     <!-- variables available with key_trdtra --> 
    120     <field id="ttrd_xad"     description="temperature-trend: i-advection"              unit="degC/s" axis_ref="deptht" /> 
    121     <field id="strd_xad"     description="salinity   -trend: i-advection"              unit="psu/s"  axis_ref="deptht" /> 
    122     <field id="ttrd_yad"     description="temperature-trend: j-advection"              unit="degC/s" axis_ref="deptht" /> 
    123     <field id="strd_yad"     description="salinity   -trend: j-advection"              unit="psu/s"  axis_ref="deptht" /> 
    124     <field id="ttrd_zad"     description="temperature-trend: k-advection"              unit="degC/s" axis_ref="deptht" /> 
    125     <field id="strd_zad"     description="salinity   -trend: k-advection"              unit="psu/s"  axis_ref="deptht" /> 
    126     <field id="ttrd_sad"     description="temperature-trend: surface adv. (no-vvl)"    unit="degC/s"                   /> 
    127     <field id="strd_sad"     description="salinity   -trend: surface adv. (no-vvl)"    unit="psu/s"                    /> 
    128     <field id="ttrd_ldf"     description="temperature-trend: lateral  diffusion"       unit="degC/s" axis_ref="deptht" /> 
    129     <field id="strd_ldf"     description="salinity   -trend: lateral  diffusion"       unit="psu/s"  axis_ref="deptht" /> 
    130     <field id="ttrd_zdf"     description="temperature-trend: vertical diffusion"       unit="degC/s" axis_ref="deptht" /> 
    131     <field id="strd_zdf"     description="salinity   -trend: vertical diffusion"       unit="psu/s"  axis_ref="deptht" /> 
    132     < ln_traldf_iso=T only (iso-neutral diffusion) > 
    133     <field id="ttrd_zdfp"    description="temperature-trend: pure vert. diffusion"     unit="degC/s" axis_ref="deptht" /> 
    134     <field id="strd_zdfp"    description="salinity   -trend: pure vert. diffusion"     unit="psu/s"  axis_ref="deptht" /> 
     119    <!-- T & S trends (ln_tra_trd=T) --> 
     120    <field id="ttrd_xad"     description="temperature-trend: i-advection"                               unit="degC/s" axis_ref="deptht" /> 
     121    <field id="strd_xad"     description="salinity   -trend: i-advection"                               unit="psu/s"  axis_ref="deptht" /> 
     122    <field id="ttrd_yad"     description="temperature-trend: j-advection"                               unit="degC/s" axis_ref="deptht" /> 
     123    <field id="strd_yad"     description="salinity   -trend: j-advection"                               unit="psu/s"  axis_ref="deptht" /> 
     124    <field id="ttrd_zad"     description="temperature-trend: k-advection"                               unit="degC/s" axis_ref="deptht" /> 
     125    <field id="strd_zad"     description="salinity   -trend: k-advection"                               unit="psu/s"  axis_ref="deptht" /> 
     126    <field id="ttrd_sad"     description="temperature-trend: surface adv. (NOT key_vvl)"                unit="degC/s"                   /> 
     127    <field id="strd_sad"     description="salinity   -trend: surface adv. (NOT key_vvl)"                unit="psu/s"                    /> 
     128    <field id="ttrd_ldf"     description="temperature-trend: lateral  diffusion"                        unit="degC/s" axis_ref="deptht" /> 
     129    <field id="strd_ldf"     description="salinity   -trend: lateral  diffusion"                        unit="psu/s"  axis_ref="deptht" /> 
     130    <field id="ttrd_zdf"     description="temperature-trend: vertical diffusion"                        unit="degC/s" axis_ref="deptht" /> 
     131    <field id="strd_zdf"     description="salinity   -trend: vertical diffusion"                        unit="psu/s"  axis_ref="deptht" /> 
     132    <field id="ttrd_zdfp"    description="temperature-trend: pure vert. diffusion  (ln_traldf_iso=T)"   unit="degC/s" axis_ref="deptht" /> 
     133    <field id="strd_zdfp"    description="salinity   -trend: pure vert. diffusion"                      unit="psu/s"  axis_ref="deptht" /> 
     134    <      * internal restoring only > 
     135    <field id="ttrd_dmp"     description="temperature-trend: internal restoring       (ln_tradmp=T) "   unit="degC/s" axis_ref="deptht" /> 
     136    <field id="strd_dmp"     description="salinity   -trend: internal restoring  (ln_tradmp=T) "        unit="psu/s"  axis_ref="deptht" /> 
     137    <field id="ttrd_bbl"     description="temperature-trend: bottom boundary layer"                     unit="degC/s" axis_ref="deptht" /> 
     138    <field id="strd_bbl"     description="salinity   -trend: bottom boundary layer"                     unit="psu/s"  axis_ref="deptht" /> 
     139    <field id="ttrd_npc"     description="temperature-trend: non-penetrative convection"                unit="degC/s" axis_ref="deptht" /> 
     140    <field id="strd_npc"     description="salinity   -trend: non-penetrative convection"                unit="psu/s"  axis_ref="deptht" /> 
     141    <field id="ttrd_qns"     description="temperature-trend: non-solar flux + runoff"                   unit="degC/s" axis_ref="deptht" /> 
     142    <field id="strd_cdt"     description="salinity   -trend: C/D term       + runoff"                   unit="degC/s" axis_ref="deptht" /> 
     143    <field id="ttrd_qsr"     description="temperature-trend: solar penetr. heating"                     unit="degC/s" axis_ref="deptht" /> 
     144    <field id="ttrd_bbc"     description="temperature-trend: geothermal heating"                        unit="degC/s" axis_ref="deptht" /> 
    135145    <> 
    136     <field id="ttrd_dmp"     description="temperature-trend: interior restoring"       unit="degC/s" axis_ref="deptht" /> 
    137     <field id="strd_dmp"     description="salinity   -trend: interior restoring"       unit="psu/s"  axis_ref="deptht" /> 
    138     <field id="ttrd_bbl"     description="temperature-trend: bottom boundary layer"    unit="degC/s" axis_ref="deptht" /> 
    139     <field id="strd_bbl"     description="salinity   -trend: bottom boundary layer"    unit="psu/s"  axis_ref="deptht" /> 
    140     <field id="ttrd_npc"     description="temperature-trend: non-penetrative conv."    unit="degC/s" axis_ref="deptht" /> 
    141     <field id="strd_npc"     description="salinity   -trend: non-penetrative conv."    unit="psu/s"  axis_ref="deptht" /> 
    142     <field id="ttrd_qns"     description="temperature-trend: non-solar flux + runoff"  unit="degC/s" axis_ref="deptht" /> 
    143     <field id="strd_cdt"     description="salinity   -trend: C/D term       + runoff"  unit="degC/s" axis_ref="deptht" /> 
    144     <field id="ttrd_qsr"     description="temperature-trend: solar penetr. heating"    unit="degC/s" axis_ref="deptht" /> 
    145     <field id="ttrd_bbc"     description="temperature-trend: geothermal heating"       unit="degC/s" axis_ref="deptht" /> 
     146    <!-- Kinetic energy trends (ln_PE_trd=T) --> 
     147    <field id="petrd_xad"     description="PE-trend: i-advection"                                       unit="XX/s" axis_ref="deptht" /> 
     148    <field id="petrd_yad"     description="PE-trend: j-advection"                                       unit="XX/s" axis_ref="deptht" /> 
     149    <field id="petrd_zad"     description="PE-trend: k-advection"                                       unit="XX/s" axis_ref="deptht" /> 
     150    <field id="petrd_sad"     description="PE-trend: surface advection                 (NOT key_vvl)"   unit="XX/s"                   /> 
     151    <field id="petrd_ldf"     description="PE-trend: lateral  diffusion"                                unit="XX/s" axis_ref="deptht" /> 
     152    <field id="petrd_zdf"     description="PE-trend: vertical diffusion"                                unit="XX/s" axis_ref="deptht" /> 
     153    <field id="petrd_zdfp"    description="PE-trend: pure vert. diffusion          (ln_traldf_iso=T)"   unit="XX/s" axis_ref="deptht" /> 
     154    <field id="petrd_dmp"     description="PE-trend: internal restoring                (ln_tradmp=T)"   unit="XX/s" axis_ref="deptht" /> 
     155    <field id="petrd_bbl"     description="PE-trend: bottom boundary layer"                             unit="XX/s" axis_ref="deptht" /> 
     156    <field id="petrd_npc"     description="PE-trend: non-penetrative conv."                             unit="XX/s" axis_ref="deptht" /> 
     157    <field id="petrd_qns"     description="PE-trend: non-solar flux + runoff"                           unit="XX/s" axis_ref="deptht" /> 
     158    <field id="petrd_qsr"     description="PE-trend: solar penetr. heating"                             unit="XX/s" axis_ref="deptht" /> 
     159    <field id="petrd_bbc"     description="PE-trend: geothermal heating"                                unit="XX/s" axis_ref="deptht" /> 
     160    <>   
     161    <!-- variables available with key_trddyn --> 
     162    <field id="ketrd_hpg"     description="PE-trend: hydrostatic pressure gradient"      unit="YY"                /> 
     163    <field id="ketrd_spg"     description="PE-trend: surface     pressure gradient"      unit="YY"                /> 
     164    <field id="ketrd_rvo"     description="PE-trend: relative  vorticity or metric term" unit="YY"                /> 
     165    <field id="ketrd_pvo"     description="PE-trend: planetary vorticity"                unit="YY"                /> 
     166    <field id="ketrd_keg"     description="PE-trend: KE gradient         or hor. adv."   unit="YY"                /> 
     167    <field id="ketrd_zad"     description="PE-trend: vertical  advection"                unit="YY"                /> 
     168    <field id="ketrd_ldf"     description="PE-trend: lateral   diffusion"                unit="YY"                /> 
     169    <field id="ketrd_zdf"     description="PE-trend: vertical  diffusion"                unit="YY"                /> 
     170    <field id="ketrd_tau"     description="PE-trend: wind stress "                       unit="YY" axis_ref="none"/> 
     171    <field id="ketrd_bfr"     description="PE-trend: bottom friction"                    unit="YY"                />    
    146172      </group> 
    147173 
  • branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRA/eosbn2.F90

    r3294 r3326  
    1818   !!            3.3  ! 2010-05  (C. Ethe, G. Madec)  merge TRC-TRA 
    1919   !!             -   ! 2010-10  (G. Nurser, G. Madec)  add eos_alpbet used in ldfslp 
     20   !!            3.5  ! 2012-03  (G. Madec)  add eos_drau_dtds used in trdpen 
    2021   !!---------------------------------------------------------------------- 
    2122 
     
    2829   !!   eos_bn2        : Compute the Brunt-Vaisala frequency 
    2930   !!   eos_alpbet     : calculates the in situ thermal/haline expansion ratio 
     31   !!   eos_drau_dtds  : calculates the partial derivative of in situ density with respect to T and S 
    3032   !!   tfreez         : Compute the surface freezing temperature 
    3133   !!   eos_init       : set eos parameters (namelist) 
     
    5153   END INTERFACE 
    5254 
    53    PUBLIC   eos        ! called by step, istate, tranpc and zpsgrd modules 
    54    PUBLIC   eos_init   ! called by istate module 
    55    PUBLIC   bn2        ! called by step module 
    56    PUBLIC   eos_alpbet ! called by ldfslp module 
    57    PUBLIC   tfreez     ! called by sbcice_... modules 
     55   PUBLIC   eos            ! called by step, istate, tranpc and zpsgrd modules 
     56   PUBLIC   eos_init       ! called by istate module 
     57   PUBLIC   bn2            ! called by step module 
     58   PUBLIC   eos_alpbet     ! called by ldfslp module 
     59   PUBLIC   tfreez         ! called by sbcice_... modules 
     60   PUBLIC   eos_drau_dtds  ! called by trdpen module 
    5861 
    5962   !                                          !!* Namelist (nameos) * 
     
    678681 
    679682 
     683   SUBROUTINE eos_drau_dtds( pts, pdr_dt, pdr_ds ) 
     684      !!---------------------------------------------------------------------- 
     685      !!                 ***  ROUTINE eos_alpbet  *** 
     686      !! 
     687      !! ** Purpose :   Calculates the in situ thermal/haline expansion ratio at T-points 
     688      !! 
     689      !! ** Method  :   calculates alpha / beta ratio at T-points 
     690      !!       * nn_eos = 0  : UNESCO sea water properties 
     691      !!                       The alpha/beta ratio is returned as 3-D array palpbet using the polynomial 
     692      !!                       polynomial expression of McDougall (1987). 
     693      !!                       Scalar beta0 is returned = 1. 
     694      !!       * nn_eos = 1  : linear equation of state (temperature only) 
     695      !!                       The ratio is undefined, so we return alpha as palpbet 
     696      !!                       Scalar beta0 is returned = 0. 
     697      !!       * nn_eos = 2  : linear equation of state (temperature & salinity) 
     698      !!                       The alpha/beta ratio is returned as ralpbet 
     699      !!                       Scalar beta0 is returned = 1. 
     700      !! 
     701      !! ** Action  : - palpbet : thermal/haline expansion ratio at T-points 
     702      !!            :   beta0   : 1. or 0. 
     703      !!---------------------------------------------------------------------- 
     704      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(in   ) ::   pts      ! pot. temperature & salinity 
     705      REAL(wp), DIMENSION(jpi,jpj,jpk)     , INTENT(  out) ::   pdr_dt   ! partial derivative of in situ density 
     706      REAL(wp), DIMENSION(jpi,jpj,jpk)     , INTENT(  out) ::   pdr_ds   ! with respect to T and S, resp. 
     707      ! 
     708      INTEGER  ::   ji, jj, jk   ! dummy loop indices 
     709      REAL(wp) ::   zt, zs, zh   ! local scalars 
     710      !!---------------------------------------------------------------------- 
     711      ! 
     712      IF ( nn_timing == 1 )   CALL timing_start('eos_drau_dtds') 
     713      ! 
     714      SELECT CASE ( nn_eos ) 
     715      ! 
     716      CASE ( 0 )               ! Jackett and McDougall (1994) formulation 
     717         ! 
     718         CALL ctl_stop('eos_drau_dtds: full eos not coded yet') 
     719         ! 
     720         ! 
     721      CASE ( 1 )              !==  Linear formulation = F( temperature )  ==! 
     722         rn_beta(:,:,:) = rn_alpha 
     723         rn_beta(:,:,:) = 0._wp 
     724         ! 
     725      CASE ( 2 )              !==  Linear formulation = F( temperature , salinity )  ==! 
     726         pdr_dt(:,:,:) = rn_alpha 
     727         pdr_ds(:,:,:) = rn_beta 
     728         ! 
     729      CASE DEFAULT 
     730         IF(lwp) WRITE(numout,cform_err) 
     731         IF(lwp) WRITE(numout,*) '          bad flag value for nn_eos = ', nn_eos 
     732         nstop = nstop + 1 
     733         ! 
     734      END SELECT 
     735      ! 
     736      IF( nn_timing == 1 ) CALL timing_stop('eos_drau_dtds') 
     737      ! 
     738   END SUBROUTINE eos_drau_dtds 
     739 
     740 
    680741   FUNCTION tfreez( psal ) RESULT( ptf ) 
    681742      !!---------------------------------------------------------------------- 
  • branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRA/traqsr.F90

    r3318 r3326  
    1313 
    1414   !!---------------------------------------------------------------------- 
    15    !!   tra_qsr      : trend due to the solar radiation penetration 
    16    !!   tra_qsr_init : solar radiation penetration initialization 
     15   !!   tra_qsr       : trend due to the solar radiation penetration 
     16   !!   tra_qsr_init  : solar radiation penetration initialization 
    1717   !!---------------------------------------------------------------------- 
    18    USE oce             ! ocean dynamics and active tracers 
    19    USE dom_oce         ! ocean space and time domain 
    20    USE sbc_oce         ! surface boundary condition: ocean 
    21    USE trc_oce         ! share SMS/Ocean variables 
    22    USE trd_oce         ! trends: ocean variables 
    23    USE trdtra          ! trends manager: tracers  
    24    USE phycst          ! physical constants 
    25    USE in_out_manager  ! I/O manager 
    26    USE prtctl          ! Print control 
    27    USE iom             ! I/O manager 
    28    USE fldread         ! read input fields 
    29    USE restart         ! ocean restart 
    30    USE lib_mpp         ! MPP library 
     18   USE oce            ! ocean dynamics and active tracers 
     19   USE dom_oce        ! ocean space and time domain 
     20   USE sbc_oce        ! surface boundary condition: ocean 
     21   USE trc_oce        ! share SMS/Ocean variables 
     22   USE trd_oce        ! trends: ocean variables 
     23   USE trdtra         ! trends manager: tracers  
     24   USE phycst         ! physical constants 
     25   USE in_out_manager ! I/O manager 
     26   USE prtctl         ! Print control 
     27   USE iom            ! I/O manager 
     28   USE fldread        ! read input fields 
     29   USE restart        ! ocean restart 
     30   USE lib_mpp        ! MPP library 
    3131   USE wrk_nemo       ! Memory Allocation 
    3232   USE timing         ! Timing 
     
    4848   REAL(wp), PUBLIC ::   rn_si1     = 23.0_wp   !: deepest depth of extinction (water type I)       (2 bands) 
    4949    
    50    ! Module variables 
    51    REAL(wp) ::   xsi0r                           !: inverse of rn_si0 
    52    REAL(wp) ::   xsi1r                           !: inverse of rn_si1 
     50   INTEGER , PUBLIC ::   nksr   !: levels below which the light cannot penetrate ( depth larger than 391 m) 
     51 
     52   REAL(wp)                  ::   xsi0r, xsi1r        ! inverse of rn_si0 and rn_si1, resp. 
     53   REAL(wp), DIMENSION(3,61) ::   rkrgb               ! tabulated attenuation coefficients for RGB absorption 
    5354   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_chl   ! structure of input Chl (file informations, fields read) 
    54    INTEGER, PUBLIC ::   nksr              ! levels below which the light cannot penetrate ( depth larger than 391 m) 
    55    REAL(wp), DIMENSION(3,61) ::   rkrgb   !: tabulated attenuation coefficients for RGB absorption 
    5655 
    5756   !! * Substitutions 
     
    9291      !!              Lengaigne et al. 2007, Clim. Dyn., V28, 5, 503-516. 
    9392      !!---------------------------------------------------------------------- 
    94       ! 
    9593      INTEGER, INTENT(in) ::   kt     ! ocean time-step 
    9694      ! 
     
    116114      ENDIF 
    117115 
    118       IF( l_trdtra ) THEN      ! Save ta and sa trends 
     116      IF( l_trdtra ) THEN      ! Save temperature trend 
    119117         CALL wrk_alloc( jpi, jpj, jpk, ztrdt )  
    120118         ztrdt(:,:,:) = tsa(:,:,:,jp_tem) 
     
    141139      !                                        Compute now qsr tracer content field 
    142140      !                                        ************************************ 
    143        
    144141      !                                           ! ============================================== ! 
    145142      IF( lk_qsr_bio .AND. ln_qsr_bio ) THEN      !  bio-model fluxes  : all vertical coordinates  ! 
     
    168165            IF( nn_chldta == 1 .OR. lk_vvl ) THEN            !*  Variable Chlorophyll or ocean volume 
    169166               ! 
    170                IF( nn_chldta == 1 ) THEN                             !* Variable Chlorophyll 
     167               IF( nn_chldta == 1 ) THEN                             !- Variable Chlorophyll 
    171168                  ! 
    172169                  CALL fld_read( kt, 1, sf_chl )                         ! Read Chl data and provides it at the current time step 
     
    184181                     END DO 
    185182                  END DO 
    186                ELSE                                            ! Variable ocean volume but constant chrlorophyll 
    187                   zchl = 0.05                                     ! constant chlorophyll 
     183               ELSE                                                  !- Variable ocean volume but constant chrlorophyll 
     184                  zchl = 0.05                                           ! constant chlorophyll 
    188185                  irgb = NINT( 41 + 20.*LOG10( zchl ) + 1.e-15 ) 
    189                   zekb(:,:) = rkrgb(1,irgb)                       ! Separation in R-G-B depending of the chlorophyll  
     186                  zekb(:,:) = rkrgb(1,irgb)                             ! Separation in R-G-B depending of the chlorophyll  
    190187                  zekg(:,:) = rkrgb(2,irgb) 
    191188                  zekr(:,:) = rkrgb(3,irgb) 
    192189               ENDIF 
    193190               ! 
    194                zcoef  = ( 1. - rn_abs ) / 3.e0                        ! equi-partition in R-G-B 
    195                ze0(:,:,1) = rn_abs  * qsr(:,:) 
    196                ze1(:,:,1) = zcoef * qsr(:,:) 
    197                ze2(:,:,1) = zcoef * qsr(:,:) 
    198                ze3(:,:,1) = zcoef * qsr(:,:) 
    199                zea(:,:,1) =         qsr(:,:) 
     191               zcoef  = ( 1. - rn_abs ) / 3.e0                       !- equi-partition in R-G-B 
     192               ze0(:,:,1) = rn_abs * qsr(:,:) 
     193               ze1(:,:,1) =  zcoef * qsr(:,:) 
     194               ze2(:,:,1) =  zcoef * qsr(:,:) 
     195               ze3(:,:,1) =  zcoef * qsr(:,:) 
     196               zea(:,:,1) =          qsr(:,:) 
    200197               ! 
    201198               DO jk = 2, nksr+1 
  • branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRD/trdken.F90

    r3325 r3326  
    8888      REAL(wp), POINTER, DIMENSION(:,:,:) ::   zke                 ! 3D workspace  
    8989      !!---------------------------------------------------------------------- 
     90      ! 
     91      CALL wrk_alloc( jpi, jpj     , z2dx, z2dy, zke2d ) 
     92      CALL wrk_alloc( jpi, jpj, jpk, zke ) 
    9093      ! 
    9194      CALL lbc_lnk( putrd, 'U', -1. )   ;   CALL lbc_lnk( pvtrd, 'V', -1. )      ! lateral boundary conditions 
  • branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRD/trdtra.F90

    r3318 r3326  
    122122            END SELECT 
    123123         ELSE                            ! other trends: mask and send T & S trends to trd_tra_mng 
    124             ztrds(:,:,:) = ptrd(:,:,:) * tmask(:,:,:) 
    125             CALL trd_tra_mng( trdt, ztrds, ktrd, kt )   
    126          ENDIF 
    127          ! 
    128          IF( ktrd == jptra_zdfp ) THEN     ! diagnose the "PURE" Kz trend (here: just before the swap) 
    129124            ! 
    130             IF( ln_traldf_iso ) THEN      ! iso-neutral diffusion only otherwise jptra_zdf is "PURE" 
     125            IF( ktrd == jptra_zdfp ) THEN     ! diagnose the "PURE" Kz trend (here: just before the swap) 
    131126               ! 
    132                CALL wrk_alloc( jpi, jpj, jpk, zwt, zws, ztrdt ) 
     127               IF( ln_traldf_iso ) THEN       ! iso-neutral diffusion only otherwise jptra_zdf is "PURE" 
     128                  ! 
     129                  CALL wrk_alloc( jpi, jpj, jpk, zwt, zws, ztrdt ) 
     130                  ! 
     131                  zwt(:,:, 1 ) = 0._wp   ;   zws(:,:, 1 ) = 0._wp            ! vertical diffusive fluxes 
     132                  zwt(:,:,jpk) = 0._wp   ;   zws(:,:,jpk) = 0._wp 
     133                  DO jk = 2, jpk 
     134                     zwt(:,:,jk) =   avt(:,:,jk) * ( tsa(:,:,jk-1,jp_tem) - tsa(:,:,jk,jp_tem) ) / fse3w(:,:,jk) * tmask(:,:,jk) 
     135                     zws(:,:,jk) = fsavs(:,:,jk) * ( tsa(:,:,jk-1,jp_sal) - tsa(:,:,jk,jp_sal) ) / fse3w(:,:,jk) * tmask(:,:,jk) 
     136                  END DO 
     137                  ! 
     138                  ztrdt(:,:,jpk) = 0._wp   ;   ztrds(:,:,jpk) = 0._wp 
     139                  DO jk = 1, jpkm1 
     140                     ztrdt(:,:,jk) = ( zwt(:,:,jk) - zwt(:,:,jk+1) ) / fse3t(:,:,jk) 
     141                     ztrds(:,:,jk) = ( zws(:,:,jk) - zws(:,:,jk+1) ) / fse3t(:,:,jk)  
     142                  END DO 
     143                  CALL trd_tra_mng( ztrdt, ztrds, jptra_zdfp, kt )   
     144                  ! 
     145                  CALL wrk_dealloc( jpi, jpj, jpk, zwt, zws, ztrdt ) 
     146                  ! 
     147               ENDIF 
    133148               ! 
    134                zwt(:,:, 1 ) = 0._wp   ;   zws(:,:, 1 ) = 0._wp            ! vertical diffusive fluxes 
    135                zwt(:,:,jpk) = 0._wp   ;   zws(:,:,jpk) = 0._wp 
    136                DO jk = 2, jpk 
    137                   zwt(:,:,jk) =   avt(:,:,jk) * ( tsa(:,:,jk-1,jp_tem) - tsa(:,:,jk,jp_tem) ) / fse3w(:,:,jk) * tmask(:,:,jk) 
    138                   zws(:,:,jk) = fsavs(:,:,jk) * ( tsa(:,:,jk-1,jp_sal) - tsa(:,:,jk,jp_sal) ) / fse3w(:,:,jk) * tmask(:,:,jk) 
    139                END DO 
    140                ! 
    141                ztrdt(:,:,jpk) = 0._wp   ;   ztrds(:,:,jpk) = 0._wp 
    142                DO jk = 1, jpkm1 
    143                   ztrdt(:,:,jk) = ( zwt(:,:,jk) - zwt(:,:,jk+1) ) / fse3t(:,:,jk) 
    144                   ztrds(:,:,jk) = ( zws(:,:,jk) - zws(:,:,jk+1) ) / fse3t(:,:,jk)  
    145                END DO 
    146                CALL trd_tra_mng( ztrdt, ztrds, jptra_zdfp, kt )   
    147                ! 
    148                CALL wrk_dealloc( jpi, jpj, jpk, zwt, zws, ztrdt ) 
    149                ! 
     149            ELSE                              !  
     150               ztrds(:,:,:) = ptrd(:,:,:) * tmask(:,:,:) 
     151               CALL trd_tra_mng( trdt, ztrds, ktrd, kt )   
    150152            ENDIF 
    151             ! 
    152          ENDIF 
    153153      ENDIF 
    154154 
     
    305305      SELECT CASE( ktrd ) 
    306306      CASE( jptra_xad  )   ;   CALL iom_put( "ttrd_xad" , ptrdx )        ! x- horizontal advection 
    307                                    CALL iom_put( "strd_xad" , ptrdy ) 
     307                               CALL iom_put( "strd_xad" , ptrdy ) 
    308308      CASE( jptra_yad  )   ;   CALL iom_put( "ttrd_yad" , ptrdx )        ! y- horizontal advection 
    309                                    CALL iom_put( "strd_yad" , ptrdy ) 
     309                               CALL iom_put( "strd_yad" , ptrdy ) 
    310310      CASE( jptra_zad  )   ;   CALL iom_put( "ttrd_zad" , ptrdx )        ! z- vertical   advection 
    311311                               CALL iom_put( "strd_zad" , ptrdy ) 
Note: See TracChangeset for help on using the changeset viewer.