source: trunk/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfqiao.F90 @ 7881

Last change on this file since 7881 was 7646, checked in by timgraham, 4 years ago

Merge of dev_merge_2016 into trunk. UPDATE TO ARCHFILES NEEDED for XIOS2.
LIM_SRC_s/limrhg.F90 to follow in next commit due to change of kind (I'm unable to do it in this commit).
Merged using the following steps:

1) svn merge —reintegrate svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk .
2) Resolve minor conflicts in sette.sh and namelist_cfg for ORCA2LIM3 (due to a change in trunk after branch was created)
3) svn commit
4) svn switch svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk
5) svn merge svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/branches/2016/dev_merge_2016 .
6) At this stage I checked out a clean copy of the branch to compare against what is about to be committed to the trunk.
6) svn commit #Commit code to the trunk

In this commit I have also reverted a change to Fcheck_archfile.sh which was causing problems on the Paris machine.

File size: 5.3 KB
Line 
1MODULE zdfqiao
2   !!======================================================================
3   !!                       ***  MODULE  zdfqiao  ***
4   !! Qiao module      : vertical mixing enhancement due to surface waves
5   !!======================================================================
6   !! History :  3.6  !  2014-10  (E. Clementi)  Original code
7   !!----------------------------------------------------------------------
8   !!   zdf_qiao        : compute Qiao parameters
9   !!----------------------------------------------------------------------
10
11   USE in_out_manager  ! I/O manager
12   USE lib_mpp         ! distribued memory computing library
13   USE sbc_oce         ! Surface boundary condition: ocean fields
14   USE zdf_oce
15   USE sbcwave         ! wave module
16   USE dom_oce
17   USE lbclnk          ! ocean lateral boundary conditions (or mpp link) 
18   
19   IMPLICIT NONE
20   PRIVATE
21
22   PUBLIC zdf_qiao    ! routine called in step
23
24   REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:,:) :: qbv, qbvu, qbvv
25
26   !! * Substitutions
27#  include "vectopt_loop_substitute.h90"
28   !!----------------------------------------------------------------------
29   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
30   !! $Id: $
31   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
32   !!----------------------------------------------------------------------
33
34CONTAINS
35
36   SUBROUTINE zdf_qiao( kt )
37      !!---------------------------------------------------------------------
38      !!                     ***  ROUTINE zdf_qiao ***
39      !!
40      !! ** Purpose :Compute the Qiao term (qbv) to be added to
41      !!             vertical viscosity and diffusivity coeffs. 
42      !!
43      !! ** Method  :qbv = alpha * A * Us(0) * exp (3 * k * z)
44      !!             
45      !! ** action  :Compute the Qiao wave dependent term
46      !!             only if ln_wave=.true.
47      !!               
48      !!---------------------------------------------------------------------
49      INTEGER, INTENT( in  ) ::  kt   ! ocean time step
50      !
51      INTEGER :: jj, ji, jk   ! dummy loop indices
52      !!---------------------------------------------------------------------
53      !
54      IF( kt == nit000 ) THEN                   ! First call kt=nit000 !
55         IF( .NOT. ( ln_wave .AND. ln_sdw ) )   &
56            &   CALL ctl_stop ( 'Ask for wave Qiao enhanced turbulence but ln_wave   &
57            &                    and ln_sdw have to be activated')
58         IF( zdf_qiao_alloc() /= 0 )   &
59            &   CALL ctl_stop( 'STOP', 'zdf_qiao : unable to allocate arrays' )
60      ENDIF
61
62      !
63      ! Compute the Qiao term Bv (qbv) to be added to
64      ! vertical viscosity and diffusivity
65      ! qbv = alpha * A * Us(0) * exp (3 * k * z)
66      ! alpha here is set to 1
67      !---------------------------------------------------------------------------------
68      !
69      DO jk = 1, jpk
70         DO jj = 1, jpjm1
71            DO ji = 1, fs_jpim1
72               qbv(ji,jj,jk) = 1.0 * 0.353553 * hsw(ji,jj) * tsd2d(ji,jj) *             &
73            &                  EXP(3.0 * wnum(ji,jj) *                                  &                     
74            &                  (-MIN( gdepw_n(ji  ,jj  ,jk), gdepw_n(ji+1,jj  ,jk),     &
75            &                         gdepw_n(ji  ,jj+1,jk), gdepw_n(ji+1,jj+1,jk))))   &
76            &                          * wmask(ji,jj,jk)
77            END DO
78         END DO
79      END DO
80      !
81      CALL lbc_lnk( qbv, 'W', 1. )   ! Lateral boundary conditions
82         
83      !
84      ! Interpolate Qiao parameter qbv into the grid_U and grid_V
85      !----------------------------------------------------------
86      !
87      DO jk = 1, jpk
88         DO jj = 1, jpjm1
89            DO ji = 1, fs_jpim1
90               qbvu(ji,jj,jk) = 0.5 * wumask(ji,jj,jk)  *              & 
91            &                  ( qbv(ji,jj,jk) + qbv(ji+1,jj  ,jk) )
92               qbvv(ji,jj,jk) = 0.5 * wvmask(ji,jj,jk)  *              &
93            &                  ( qbv(ji,jj,jk) + qbv(ji  ,jj+1,jk) )
94            END DO
95         END DO
96      END DO
97      !
98      CALL lbc_lnk( qbvu, 'U', 1. ) ; CALL lbc_lnk( qbvv, 'V', 1. )   ! Lateral boundary conditions
99
100      ! Enhance vertical mixing coeff.         
101      !-------------------------------
102      !
103      DO jk = 1, jpkm1
104         DO jj = 1, jpj
105            DO ji = 1, jpi
106               avmu(ji,jj,jk) = ( avmu(ji,jj,jk) + qbvu(ji,jj,jk) ) * umask(ji,jj,jk)
107               avmv(ji,jj,jk) = ( avmv(ji,jj,jk) + qbvv(ji,jj,jk) ) * vmask(ji,jj,jk)
108               avt (ji,jj,jk) = ( avt (ji,jj,jk) + qbv (ji,jj,jk) ) * tmask(ji,jj,jk)
109            END DO
110         END DO
111      END DO
112      !
113   END SUBROUTINE zdf_qiao
114
115   INTEGER FUNCTION zdf_qiao_alloc()
116      !!----------------------------------------------------------------------
117      !!                ***  FUNCTION zdf_qiao_alloc  ***
118      !!----------------------------------------------------------------------
119      ALLOCATE( qbv(jpi,jpj,jpk), qbvu(jpi,jpj,jpk), qbvv(jpi,jpj,jpk),   &
120         &      STAT = zdf_qiao_alloc )
121      !
122      IF( lk_mpp             )  CALL mpp_sum ( zdf_qiao_alloc )
123      IF( zdf_qiao_alloc > 0 )  CALL ctl_warn('zdf_qiao_alloc: allocation of arrays failed.')
124      !
125   END FUNCTION zdf_qiao_alloc
126     
127   !!======================================================================
128END MODULE zdfqiao
Note: See TracBrowser for help on using the repository browser.