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

Changeset 1496


Ignore:
Timestamp:
2009-07-20T16:23:15+02:00 (15 years ago)
Author:
ctlod
Message:

optimization (step II) of internal tidal mixing coefficient calculation, see ticket: #457

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/OPA_SRC/ZDF/zdftmx.F90

    r1495 r1496  
    1717   USE dom_oce         ! ocean space and time domain variables 
    1818   USE zdf_oce         ! ocean vertical physics variables 
    19    USE in_out_manager  ! I/O manager 
    2019   USE lbclnk          ! ocean lateral boundary conditions (or mpp link) 
    2120   USE eosbn2          ! ocean equation of state 
    2221   USE phycst          ! physical constants 
    2322   USE prtctl          ! Print control 
     23   USE in_out_manager  ! I/O manager 
     24   USE iom             ! I/O Manager 
    2425 
    2526   IMPLICIT NONE 
     
    3031   LOGICAL, PUBLIC, PARAMETER ::   lk_zdftmx = .TRUE.    !: tidal mixing flag 
    3132 
    32    !                                                    !!* Namelist  namtmx * 
     33   !                                                    !!* Namelist  namtmx : tidal mixing * 
    3334   REAL(wp) ::  rn_htmx  = 500.                          ! vertical decay scale for turbulence (meters) 
    3435   REAL(wp) ::  rn_n2min = 1.e-8                         ! threshold of the Brunt-Vaisala frequency (s-1) 
     
    5859      !!                    
    5960      !! ** Purpose :   add to the vertical mixing coefficients the effect of 
    60       !!      tidal mixing (Simmons et al 2004). 
     61      !!              tidal mixing (Simmons et al 2004). 
    6162      !! 
    6263      !! ** Method  : - tidal-induced vertical mixing is given by: 
    63       !!      Kz_tides = az_tmx / rn2, where az_tmx is a 2D coefficient set in 
    64       !!      zdf_tmx_init. This mixing is added to avt, avmu and avmv as 
    65       !!      follows:  avt  = avt  +    az_tmx 
    66       !!                avmu = avmu + mi(az_tmx) 
    67       !!                avmv = avmv + mj(az_tmx) 
    68       !! 
    69       !! ** Action  :   Update avt, avmu and avmv 
     64      !!                  Kz_tides = az_tmx / max( rn_n2min, N^2 ) 
     65      !!              where az_tmx is a coefficient that specified the 3D space  
     66      !!              distribution of the faction of tidal energy taht is used 
     67      !!              for mixing. Its expression is set in zdf_tmx_init routine, 
     68      !!              following Simmons et al. 2004. 
     69      !!                NB: a specific bounding procedure is performed on av_tide 
     70      !!              so that the input tidal energy is actually almost used. The 
     71      !!              basic maximum value is 60 cm2/s, but values of 300 cm2/s  
     72      !!              can be reached in area where bottom stratification is too  
     73      !!              weak. 
     74      !! 
     75      !!              - update av_tide in the Indonesian Through Flow area 
     76      !!              following Koch-Larrouy et al. (2007) parameterisation 
     77      !!              (see tmx_itf routine). 
     78      !! 
     79      !!              - update the model vertical eddy viscosity and diffusivity:  
     80      !!                     avt  = avt  +    av_tides 
     81      !!                     avmu = avmu + mi(av_tides) 
     82      !!                     avmv = avmv + mj(av_tides) 
     83      !! 
     84      !! ** Action  :   avt, avmu, avmv   increased by tidal mixing 
    7085      !! 
    7186      !! References : Simmons et al. 2004, Ocean Modelling, 6, 3-4, 245-263. 
    72       !!              St Laurent et al. 2002, GRL, 29, 2106, 10.1029/2002GL015 633. 
    73       !!              Osborn 1982, JPO, 10, 83-89. 
     87      !!              Koch-Larrouy et al. 2007, GRL. 
    7488      !!---------------------------------------------------------------------- 
    7589      INTEGER, INTENT(in) ::   kt   ! ocean time-step  
     
    8094      !!---------------------------------------------------------------------- 
    8195 
    82       !                             ! Initialization (first time-step only) 
    83       IF( kt == nit000  )   CALL zdf_tmx_init 
    84  
    85       !                             ! First estimation (with n2 bound by rn_n2min) bounded by 60 cm2/s 
     96      !                         
     97      IF( kt == nit000  )   CALL zdf_tmx_init      ! Initialization (first time-step only) 
     98 
     99      !                     ! ----------------------- ! 
     100      !                     !  Standard tidal mixing  !  (compute av_tide) 
     101      !                     ! ----------------------- ! 
     102      !                             !* First estimation (with n2 bound by rn_n2min) bounded by 60 cm2/s 
    86103      av_tide(:,:,:) = MIN(  60.e-4, az_tmx(:,:,:) / MAX( rn_n2min, rn2(:,:,:) )  ) 
    87104 
    88       zkz(:,:) = 0.e0               ! Associated potential energy consummed over the whole water column 
     105      zkz(:,:) = 0.e0               !* Associated potential energy consummed over the whole water column 
    89106      DO jk = 2, jpkm1 
    90107         zkz(:,:) = zkz(:,:) + fse3w(:,:,jk) * MAX( 0.e0, rn2(:,:,jk) ) * rau0 * av_tide(:,:,jk)* tmask(:,:,jk) 
    91108      END DO 
    92109 
    93       DO jj = 1, jpj                ! Here zkz should be equal to en_tmx ==> multiply by en_tmx/zkz to recover en_tmx 
     110      DO jj = 1, jpj                !* Here zkz should be equal to en_tmx ==> multiply by en_tmx/zkz to recover en_tmx 
    94111         DO ji = 1, jpi 
    95112            IF( zkz(ji,jj) /= 0.e0 )   zkz(ji,jj) = en_tmx(ji,jj) / zkz(ji,jj) 
     
    97114      END DO 
    98115 
    99       DO jk = 2, jpkm1              ! Mutiply by zkz to recover en_tmx, BUT bound by 30/6 ==> av_tide bound by 300 cm2/s 
     116      DO jk = 2, jpkm1              !* Mutiply by zkz to recover en_tmx, BUT bound by 30/6 ==> av_tide bound by 300 cm2/s 
    100117         av_tide(:,:,jk) = av_tide(:,:,jk) * MIN( zkz(:,:), 30./6. )   !kz max = 300 cm2/s 
    101118      END DO 
    102119 
    103       IF( kt == nit000 ) THEN       ! diagnose the nergy consumed by av_tide 
     120      IF( kt == nit000 ) THEN       !* check at first time-step: diagnose the energy consumed by av_tide 
    104121         ztpc = 0.e0 
    105122         DO jk= 1, jpk 
    106123            DO jj= 1, jpj 
    107124               DO ji= 1, jpi 
    108                   ztpc = ztpc + fse3w(ji,jj,jk)*e1t(ji,jj)*e2t(ji,jj)   & 
    109                      &         *MAX(0.e0,rn2(ji,jj,jk))*av_tide(ji,jj,jk)*tmask(ji,jj,jk)*tmask_i(ji,jj) 
     125                  ztpc = ztpc + fse3w(ji,jj,jk) * e1t(ji,jj) * e2t(ji,jj)   & 
     126                     &         * MAX( 0.e0, rn2(ji,jj,jk) ) * av_tide(ji,jj,jk) * tmask(ji,jj,jk) * tmask_i(ji,jj) 
    110127               END DO 
    111128            END DO 
     
    113130         ztpc= rau0 / ( rn_tfe * rn_me ) * ztpc 
    114131         IF(lwp) WRITE(numout,*)  
    115          IF(lwp) WRITE(numout,*) '          N Total power consumption by av_tide : ztpc = ', ztpc * 1.e-12 ,'TW' 
     132         IF(lwp) WRITE(numout,*) '          N Total power consumption by av_tide    : ztpc = ', ztpc * 1.e-12 ,'TW' 
    116133      ENDIF 
    117134        
     
    132149         END DO 
    133150      END DO 
    134       CALL lbc_lnk( avmu, 'U', 1. )    
    135       CALL lbc_lnk( avmv, 'V', 1. ) 
    136         
    137       CALL tmx_itf( kt )            ! Indonesian throughflow tidal vertical mixing  
    138  
    139       IF(ln_ctl) THEN 
    140          CALL prt_ctl_info( clinfo1='tmx  - t: ', ivar1=INT(SUM( avt (:,:,:) ) ) ) 
    141          CALL prt_ctl_info( clinfo1='tmx  - u: ', ivar1=INT(SUM( avmu(:,:,:) ) ),   & 
    142             &               clinfo2='     - v: ', ivar2=INT(SUM( avmv(:,:,:) ) ) ) 
    143       ENDIF 
     151      CALL lbc_lnk( avmu, 'U', 1. )   ;   CALL lbc_lnk( avmv, 'V', 1. )      ! lateral boundary condition 
     152 
     153      IF(ln_ctl)   CALL prt_ctl(tab3d_1=av_tide ,clinfo1=' tmx - av_tide: ',tab3d_2=avt,clinfo2=' avt: ',ovlap=1,kdim=jpk) 
    144154      ! 
    145155   END SUBROUTINE zdf_tmx 
     
    150160      !!                  ***  ROUTINE tmx_itf  *** 
    151161      !!                    
    152       !! ** Purpose :   add to the vertical mixing coefficients the effect of 
    153       !!      tidal mixing (st laurent et al. 2004) + specificities for the ITF  
    154       !!      region (vertical profil of energy (P. Bouruet Aubertot + Theo Gerkema) 
    155       !!      , q=1 all the energy remains confined) 
    156       !! 
    157       !! ** Method  : - tidal-induced vertical mixing is given by: 
    158       !!      Kz_tides = az_tmx / rn2, where az_tmx is a 2D coefficient set in 
    159       !!      zdf_tmx_init. This mixing is added to avt, avmu and avmv as 
    160       !!      follows:  avt  = avt  +    az_tmx 
    161       !!                avmu = avmu + mi(az_tmx) 
    162       !!                avmv = avmv + mj(az_tmx) 
    163       !! 
    164       !! ** Action  :   Update avt, avmu and avmv 
     162      !! ** Purpose :   modify the vertical eddy diffusivity coefficients  
     163      !!              (av_tide) in the Indonesian Through Flow area (ITF). 
     164      !! 
     165      !! ** Method  : - Following Koch-Larrouy et al. (2007), in the ITF defined 
     166      !!                by msk_itf (read in a file, see tmx_init), the tidal 
     167      !!                mixing coefficient is computed with : 
     168      !!                  * q=1 (i.e. all the tidal energy remains trapped in 
     169      !!                         the area and thus is used for mixing) 
     170      !!                  * the vertical distribution of the tifal energy is a 
     171      !!                    proportional to N above the thermocline (d(N^2)/dz > 0) 
     172      !!                    and to N^2 below the thermocline (d(N^2)/dz < 0) 
     173      !! 
     174      !! ** Action  :   av_tide   updated in the ITF area (msk_itf) 
    165175      !! 
    166176      !! References :  Koch-Larrouy et al. 2007, GRL  
     
    335345      !!                      
    336346      !! ** Purpose :   Initialization of the vertical tidal mixing, Reading 
    337       !!      of M2 and K1 tidal energy in nc files 
    338       !! 
    339       !! ** Method  :   Read the namtmx namelist and check the parameters 
    340       !!      called at the first timestep (nit000),  
    341       !!              - Read the M2 and K1 tidal energy in NetCDF files. 
     347      !!              of M2 and K1 tidal energy in nc files 
     348      !! 
     349      !! ** Method  : - Read the namtmx namelist and check the parameters 
     350      !! 
     351      !!              - Read the input data in NetCDF files : 
     352      !!              M2 and K1 tidal energy. The total tidal energy, en_tmx,  
     353      !!              is the sum of M2, K1 and S2 energy where S2 is assumed  
     354      !!              to be: S2=(1/2)^2 * M2 
     355      !!              mask_itf, a mask array that determine where substituing  
     356      !!              the standard Simmons et al. (2005) formulation with the 
     357      !!              one of Koch_Larrouy et al. (2007). 
     358      !! 
    342359      !!              - Compute az_tmx, a 3D coefficient that allows to compute 
    343       !!      the tidal-induced vertical mixing as follows: 
    344       !!         Kz_tides = avt0 + az_tmx / max( rn_n2min, N^2 ) 
    345       !!      where az_tmx is given by..... 
     360      !!             the standard tidal-induced vertical mixing as follows: 
     361      !!                  Kz_tides = az_tmx / max( rn_n2min, N^2 ) 
     362      !!             with az_tmx a bottom intensified coefficient is given by: 
     363      !!                 az_tmx(z) = en_tmx / ( rau0 * rn_htmx ) * EXP( -(H-z)/rn_htmx ) 
     364      !!                                                  / ( 1. - EXP( - H   /rn_htmx ) )  
     365      !!             where rn_htmx the characteristic length scale of the bottom  
     366      !!             intensification, en_tmx the tidal energy, and H the ocean depth 
    346367      !! 
    347368      !! ** input   :   - Namlist namtmx 
    348       !!                - NetCDF file  : M2_ORCA2.nc and K1_ORCA2.nc 
     369      !!                - NetCDF file : M2_ORCA2.nc, K1_ORCA2.nc, and mask_itf.nc 
    349370      !! 
    350371      !! ** Action  : - Increase by 1 the nstop flag is setting problem encounter 
    351372      !!              - defined az_tmx used to compute tidal-induced mixing 
    352       !!---------------------------------------------------------------------- 
    353       USE iom                                           ! to read input files 
    354  
     373      !! 
     374      !! References : Simmons et al. 2004, Ocean Modelling, 6, 3-4, 245-263. 
     375      !!              Koch-Larrouy et al. 2007, GRL. 
     376      !!---------------------------------------------------------------------- 
    355377      INTEGER ::   ji, jj, jk                           ! dummy loop indices 
    356378      INTEGER ::   inum                                 ! temporary logical unit 
     
    361383      REAL(wp), DIMENSION(jpi,jpj) ::  zhdep                ! Ocean depth  
    362384      REAL(wp), DIMENSION(jpi,jpj,jpk) ::  zpc          ! power consumption 
    363  
    364       !                                   ! * tidal mixing namelist * (namtmx) 
     385      !! 
    365386      NAMELIST/namtmx/ rn_htmx, rn_n2min, rn_tfe, rn_tfe_itf, rn_me 
    366387      !!---------------------------------------------------------------------- 
     
    408429      en_tmx(:,:) = - rn_tfe * rn_me * ( zem2(:,:) * 1.25 + zek1(:,:) ) * tmask(:,:,1) 
    409430 
    410       ! Bound total energy required to be <= 1 W/m2 
    411       ! Vertical structure  
    412       ! part independent of the level 
    413       DO jj = 1, jpj 
     431      ! Vertical structure (az_tmx) 
     432      DO jj = 1, jpj                ! part independent of the level 
    414433         DO ji = 1, jpi 
    415434            zhdep(ji,jj) = fsdepw(ji,jj,mbathy(ji,jj))       ! depth of the ocean 
Note: See TracChangeset for help on using the changeset viewer.