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.
isfcav_gam.F90 in NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/ISF – NEMO

source: NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/ISF/isfcav_gam.F90 @ 11395

Last change on this file since 11395 was 11395, checked in by mathiot, 5 years ago

ENHANCE-02_ISF_nemo : Initial commit isf simplification (add ISF directory, moved isf routine in and split isf cavity and isf parametrisation, ...) (ticket #2142)

File size: 11.6 KB
Line 
1MODULE isfgammats
2   !!======================================================================
3   !!                       ***  MODULE  isfgammats  ***
4   !! Ice shelf module :  compute exchange coeficient at the ice/ocean interface
5   !!======================================================================
6   !! History :  4.1  !  (P. Mathiot) original
7   !!----------------------------------------------------------------------
8
9   !!----------------------------------------------------------------------
10   !!   isf_gammats       : compute exchange coeficient gamma
11   !!----------------------------------------------------------------------
12   USE oce            ! ocean dynamics and tracers
13   USE isf
14   USE isftbl
15   USE dom_oce        ! ocean space and time domain
16   USE phycst         ! physical constants
17   USE eosbn2         ! equation of state
18   USE zdfdrg         ! vertical physics: top/bottom drag coef.
19   USE iom
20   USE in_out_manager ! I/O manager
21   !
22   IMPLICIT NONE
23   !
24   PRIVATE
25   !
26   PUBLIC   isfcav_gammats
27
28   !!----------------------------------------------------------------------
29   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
30   !! $Id: sbcisf.F90 10536 2019-01-16 19:21:09Z mathiot $
31   !! Software governed by the CeCILL license (see ./LICENSE)
32   !!----------------------------------------------------------------------
33CONTAINS
34   !
35   !!-----------------------------------------------------------------------------------------------------
36   !!                              PUBLIC SUBROUTINES
37   !!-----------------------------------------------------------------------------------------------------
38   !
39   SUBROUTINE isfcav_gammats( pttbl, pstbl, pqoce, pqfwf, pgt, pgs )
40      !!----------------------------------------------------------------------
41      !! ** Purpose    : compute the coefficient echange for heat and fwf flux
42      !!
43      !! ** Method     : select the gamma formulation
44      !!                 3 method available (cst, AD15 and HJ99)
45      !!---------------------------------------------------------------------
46      !!-------------------------- OUT -------------------------------------
47      REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) :: pgt  , pgs      ! gamma t and gamma s
48      !!-------------------------- IN  -------------------------------------
49      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: pqoce, pqfwf    ! isf heat and fwf
50      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: pttbl, pstbl    ! top boundary layer tracer
51      !!---------------------------------------------------------------------
52      REAL(wp), DIMENSION(jpi,jpj)                :: zutbl, zvtbl    ! top boundary layer velocity
53      !!---------------------------------------------------------------------
54      !
55      ! compute velocity in the tbl
56      SELECT CASE ( cn_gammablk )
57      CASE ( 'spe'  ) ! gamma is constant (specified in namelist)
58      ! nothing to do
59      CASE ('ad15', 'hj99')
60         CALL isf_tbl(un(:,:,:) ,zutbl(:,:),'U')
61         CALL isf_tbl(vn(:,:,:) ,zvtbl(:,:),'V')
62         CALL iom_put('utbl',zutbl(:,:))
63         CALL iom_put('vtbl',zvtbl(:,:))
64      CASE DEFAULT
65         CALL ctl_stop('STOP','method to compute gamma (cn_gammablk) is unknown (should not see this)')
66      END SELECT
67      !
68      ! compute gamma
69      SELECT CASE ( cn_gammablk )
70      CASE ( 'spe'  ) ! gamma is constant (specified in namelist)
71         pgt(:,:) = rn_gammat0
72         pgs(:,:) = rn_gammas0
73      CASE ( 'ad15' ) ! gamma is proportional to u*
74         CALL gammats_AD15 (              zutbl, zvtbl, rCdU_top, r_ke0_top,               pgt, pgs )
75      CASE ( 'hj99' ) ! gamma depends of stability of boundary layer and u*
76         CALL gammats_HJ99 (pttbl, pstbl, zutbl, zvtbl, rCdU_top, r_ke0_top, pqoce, pqfwf, pgt, pgs )
77      CASE DEFAULT
78         CALL ctl_stop('STOP','method to compute gamma (cn_gammablk) is unknown (should not see this)')
79      END SELECT
80      !
81      ! ouput exchange coeficient and tbl velocity
82      CALL iom_put('isfgammat', pgt(:,:))
83      CALL iom_put('isfgammas', pgs(:,:))
84      !
85   END SUBROUTINE isfcav_gammats
86   !
87   !!-----------------------------------------------------------------------------------------------------
88   !!                              PRIVATE SUBROUTINES
89   !!-----------------------------------------------------------------------------------------------------
90   !
91   SUBROUTINE gammats_AD15(putbl, pvtbl, pCd, pke2, &   ! <<== in
92      &                                  pgt, pgs   )   ! ==>> out gammats [m/s]
93      !!----------------------------------------------------------------------
94      !! ** Purpose    : compute the coefficient echange coefficient
95      !!
96      !! ** Method     : gamma is velocity dependent (gt= gt0 * Ustar
97      !!
98      !! ** Reference  : Jenkins et al., 2010, JPO, p2298-2312
99      !!                 Asay-Davis et al. (2015)
100      !!---------------------------------------------------------------------
101      !!-------------------------- OUT -------------------------------------
102      REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) :: pgt, pgs     ! gammat and gammas [m/s]
103      !!-------------------------- IN  -------------------------------------
104      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: putbl, pvtbl ! velocity in the losch top boundary layer
105      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: pCd          ! drag coefficient
106      REAL(wp),                     INTENT(in   ) :: pke2         ! background velocity
107      !!---------------------------------------------------------------------
108      REAL(wp), DIMENSION(jpi,jpj) :: zustar
109      !!---------------------------------------------------------------------
110      !
111      ! compute ustar (AD15 eq. 27)
112      zustar(:,:) = SQRT( pCd(:,:) * ( putbl(:,:) * putbl(:,:) + pvtbl(:,:) * pvtbl(:,:) + pke2 ) )
113      !
114      ! Compute gammats
115      pgt(:,:) = zustar(:,:) * rn_gammat0
116      pgs(:,:) = zustar(:,:) * rn_gammas0
117      !
118      ! output ustar
119      CALL iom_put('isfustar',zustar(:,:))
120      !
121   END SUBROUTINE gammats_AD15
122
123   SUBROUTINE gammats_HJ99( pttbl, pstbl, putbl, pvtbl, pCd, pke2, pqoce, pqfwf, &  ! <<== in
124      &                                                            pgt  , pgs    )  ! ==>> out gammats [m/s]
125      !!----------------------------------------------------------------------
126      !! ** Purpose    : compute the coefficient echange coefficient
127      !!
128      !! ** Method     : gamma is velocity dependent and stability dependent
129      !!
130      !! ** Reference  : Holland and Jenkins, 1999, JPO, p1787-1800
131      !!---------------------------------------------------------------------
132      !!-------------------------- OUT -------------------------------------
133      REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) :: pgt, pgs     ! gammat and gammas
134      !!-------------------------- IN  -------------------------------------
135      REAL(wp),                     INTENT(in   ) :: pke2           ! background velocity squared
136      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: pqoce, pqfwf   ! surface heat flux and fwf flux
137      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: pCd            ! drag coeficient
138      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: putbl, pvtbl   ! velocity in the losch top boundary layer
139      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: pttbl, pstbl   ! tracer   in the losch top boundary layer
140      !!---------------------------------------------------------------------
141      INTEGER  :: ji, jj                     ! loop index
142      INTEGER  :: ikt                        ! local integer
143      REAL(wp) :: zdku, zdkv                 ! U, V shear
144      REAL(wp) :: zPr, zSc, zRc              ! Prandtl, Scmidth and Richardson number
145      REAL(wp) :: zmob, zmols                ! Monin Obukov length, coriolis factor at T point
146      REAL(wp) :: zbuofdep, zhnu             ! Bouyancy length scale, sublayer tickness
147      REAL(wp) :: zhmax                      ! limitation of mol
148      REAL(wp) :: zetastar                   ! stability parameter
149      REAL(wp) :: zgmolet, zgmoles, zgturb   ! contribution of modelecular sublayer and turbulence
150      REAL(wp) :: zcoef                      ! temporary coef
151      REAL(wp) :: zdep
152      REAL(wp) :: zeps = 1.0e-20_wp   
153      REAL(wp), PARAMETER :: zxsiN = 0.052_wp   ! dimensionless constant
154      REAL(wp), PARAMETER :: znu   = 1.95e-6_wp ! kinamatic viscosity of sea water (m2.s-1)
155      REAL(wp), DIMENSION(2) :: zts, zab
156      REAL(wp), DIMENSION(jpi,jpj) :: zustar    ! friction velocity
157      !!---------------------------------------------------------------------
158      !
159      ! compute ustar
160      zustar(:,:) = SQRT( pCd * ( putbl(:,:) * putbl(:,:) + pvtbl(:,:) * pvtbl(:,:) + r_ke0_top ) )
161      !
162      ! output ustar
163      CALL iom_put('isfustar',zustar(:,:))
164      !
165      ! compute Pr and Sc number (eq ??)
166      zPr =   13.8_wp
167      zSc = 2432.0_wp
168      !
169      ! compute gamma mole (eq ??)
170      zgmolet = 12.5_wp * zPr ** (2.0/3.0) - 6.0_wp
171      zgmoles = 12.5_wp * zSc ** (2.0/3.0) - 6.0_wp
172      !
173      ! compute gamma
174      DO ji = 2, jpi
175         DO jj = 2, jpj
176            ikt = mikt(ji,jj)
177
178            IF( zustar(ji,jj) == 0._wp ) THEN           ! only for kt = 1 I think
179               pgt = rn_gammat0
180               pgs = rn_gammas0
181            ELSE
182               ! compute Rc number (as done in zdfric.F90)
183!!gm better to do it like in the new zdfric.F90   i.e. avm weighted Ri computation
184               zcoef = 0.5_wp / e3w_n(ji,jj,ikt+1)
185               !                                            ! shear of horizontal velocity
186               zdku = zcoef * (  un(ji-1,jj  ,ikt  ) + un(ji,jj,ikt  )  &
187                  &             -un(ji-1,jj  ,ikt+1) - un(ji,jj,ikt+1)  )
188               zdkv = zcoef * (  vn(ji  ,jj-1,ikt  ) + vn(ji,jj,ikt  )  &
189                  &             -vn(ji  ,jj-1,ikt+1) - vn(ji,jj,ikt+1)  )
190               !                                            ! richardson number (minimum value set to zero)
191               zRc = MAX(rn2(ji,jj,ikt+1), 0._wp) / MAX( zdku*zdku + zdkv*zdkv, zeps )
192
193               ! compute bouyancy
194               zts(jp_tem) = pttbl(ji,jj)
195               zts(jp_sal) = pstbl(ji,jj)
196               zdep        = gdepw_n(ji,jj,ikt)
197               !
198               CALL eos_rab( zts, zdep, zab )
199               !
200               ! compute length scale (Eq ??)
201               zbuofdep = grav * ( zab(jp_tem) * pqoce(ji,jj) - zab(jp_sal) * pqfwf(ji,jj) )
202               !
203               ! compute Monin Obukov Length
204               ! Maximum boundary layer depth (Eq ??)
205               zhmax = gdept_n(ji,jj,mbkt(ji,jj)) - gdepw_n(ji,jj,mikt(ji,jj)) -0.001_wp
206               !
207               ! Compute Monin obukhov length scale at the surface and Ekman depth: (Eq ??)
208               zmob   = zustar(ji,jj) ** 3 / (vkarmn * (zbuofdep + zeps))
209               zmols  = SIGN(1._wp, zmob) * MIN(ABS(zmob), zhmax) * tmask(ji,jj,ikt)
210               !
211               ! compute eta* (stability parameter) (Eq ??)
212               zetastar = 1._wp / ( SQRT(1._wp + MAX(zxsiN * zustar(ji,jj) / ( ABS(ff_f(ji,jj)) * zmols * zRc ), 0._wp)))
213               !
214               ! compute the sublayer thickness (Eq ??)
215               zhnu = 5 * znu / zustar(ji,jj)
216               !
217               ! compute gamma turb (Eq ??)
218               zgturb = 1._wp / vkarmn * LOG(zustar(ji,jj) * zxsiN * zetastar * zetastar / ( ABS(ff_f(ji,jj)) * zhnu )) &
219               &      + 1._wp / ( 2 * zxsiN * zetastar ) - 1._wp / vkarmn
220               !
221               ! compute gammats
222               pgt(ji,jj) = zustar(ji,jj) / (zgturb + zgmolet)
223               pgs(ji,jj) = zustar(ji,jj) / (zgturb + zgmoles)
224            END IF
225         END DO
226      END DO
227
228   END SUBROUTINE gammats_HJ99
229
230END MODULE isfgammats
Note: See TracBrowser for help on using the repository browser.