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.
zdfmxl_crs.F90 in branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/ZDF – NEMO

source: branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfmxl_crs.F90 @ 7207

Last change on this file since 7207 was 7207, checked in by cbricaud, 7 years ago

commit modif for CRS; run with/without CRS

  • Property svn:executable set to *
File size: 4.8 KB
Line 
1MODULE zdfmxl_crs
2   !!======================================================================
3   !!                       ***  MODULE  zdfmxl  ***
4   !! Ocean physics: mixed layer depth
5   !!======================================================================
6   !! History :  1.0  ! 2003-08  (G. Madec)  original code
7   !!            3.2  ! 2009-07  (S. Masson, G. Madec)  IOM + merge of DO-loop
8   !!            3.7  ! 2012-03  (G. Madec)  make public the density criteria for trdmxl
9   !!             -   ! 2014-02  (F. Roquet)  mixed layer depth calculated using N2 instead of rhop
10   !!----------------------------------------------------------------------
11   !!   zdf_mxl      : Compute the turbocline and mixed layer depths.
12   !!----------------------------------------------------------------------
13   !USE oce             ! ocean dynamics and tracers variables
14   !USE dom_oce         ! ocean space and time domain variables
15   !USE oce_trc
16   USE zdf_oce         ! ocean vertical physics
17   USE in_out_manager  ! I/O manager
18   USE prtctl          ! Print control
19   USE phycst          ! physical constants
20   USE iom             ! I/O library
21   USE lib_mpp         ! MPP library
22   USE wrk_nemo        ! work arrays
23   USE timing          ! Timing
24   USE trc_oce, ONLY : lk_offline ! offline flag
25   USE crs
26   USE ieee_arithmetic
27
28   IMPLICIT NONE
29   PRIVATE
30
31   PUBLIC   zdf_mxl_crs       ! called by step.F90
32
33   REAL(wp)         ::   avt_c = 5.e-4_wp   ! Kz criterion for the turbocline depth
34
35   !! * Substitutions
36#  include "domzgr_substitute.h90"
37   !!----------------------------------------------------------------------
38   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
39   !! $Id: zdfmxl.F90 4990 2014-12-15 16:42:49Z timgraham $
40   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
41   !!----------------------------------------------------------------------
42CONTAINS
43
44   SUBROUTINE zdf_mxl_crs( kt )
45      !!----------------------------------------------------------------------
46      !!                  ***  ROUTINE zdfmxl  ***
47      !!                   
48      !! ** Purpose :   Compute the turbocline depth and the mixed layer depth
49      !!              with density criteria.
50      !!
51      !! ** Method  :   The mixed layer depth is the shallowest W depth with
52      !!      the density of the corresponding T point (just bellow) bellow a
53      !!      given value defined locally as rho(10m) + rho_c
54      !!               The turbocline depth is the depth at which the vertical
55      !!      eddy diffusivity coefficient (resulting from the vertical physics
56      !!      alone, not the isopycnal part, see trazdf.F) fall below a given
57      !!      value defined locally (avt_c here taken equal to 5 cm/s2 by default)
58      !!
59      !! ** Action  :   nmln, hmld, hmlp, hmlpt
60      !!----------------------------------------------------------------------
61      INTEGER, INTENT(in) ::   kt   ! ocean time-step index
62      !
63      INTEGER  ::   ji, jj, jk   ! dummy loop indices
64      INTEGER  ::   iiki,iikn   ! local integer
65      REAL(wp) ::   zN2_c        ! local scalar
66      INTEGER, POINTER, DIMENSION(:,:) ::   imld   ! 2D workspace
67      !!----------------------------------------------------------------------
68      !
69      IF( nn_timing == 1 )  CALL timing_start('zdf_mxl_crs')
70      !
71      CALL wrk_alloc( jpi_crs,jpj_crs, imld )
72
73      IF( kt == nit000 ) THEN
74         IF(lwp) WRITE(numout,*)
75         IF(lwp) WRITE(numout,*) 'zdf_mxl_crs : mixed layer depth'
76         IF(lwp) WRITE(numout,*) '~~~~~~~ '
77      ENDIF
78
79      ! w-level of the turbocline
80      imld(:,:)=0
81      DO jk = jpkm1, nlb10, -1         ! from the bottom to nlb10
82         DO jj = 1, jpj_crs
83            DO ji = 1, jpi_crs
84               IF( avt_crs (ji,jj,jk) < avt_c )   imld(ji,jj) = MAX( jk, 1 )      ! Turbocline
85            END DO
86         END DO
87      END DO
88
89      ! depth of the mixing and mixed layers
90      hmld_crs(:,:) = 0._wp
91      hmlp_crs(:,:) = 0._wp
92      hmlpt_crs(:,:) = 0._wp
93      DO jj = 1, jpj_crs
94         DO ji = 1, jpi_crs
95            iiki = imld(ji,jj)
96            iikn = nmln_crs(ji,jj)
97            IF(iiki   .NE. 0 ) hmld_crs (ji,jj) = ( fsdepw_crs(ji,jj,iiki  ) - fsdepw_crs(ji,jj,1    )  ) * tmask_crs(ji,jj,1)    ! Turbocline depth
98            IF(iikn   .NE. 0 ) hmlp_crs (ji,jj) = ( fsdepw_crs(ji,jj,iikn  ) - fsdepw_crs(ji,jj,nla10)  ) * tmask_crs(ji,jj,1)    ! Mixed layer depth
99            IF(iikn-1 .NE. 0 ) hmlpt_crs(ji,jj) = ( fsdept_crs(ji,jj,iikn-1) - fsdepw_crs(ji,jj,1    )  ) * tmask_crs(ji,jj,1)    ! depth of the last T-point inside the mixed layer
100         END DO
101      END DO
102      !
103      CALL wrk_dealloc( jpi_crs,jpj_crs, imld )
104      !
105      IF( nn_timing == 1 )  CALL timing_stop('zdf_mxl_crs')
106      !
107   END SUBROUTINE zdf_mxl_crs
108
109   !!======================================================================
110END MODULE zdfmxl_crs
Note: See TracBrowser for help on using the repository browser.