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

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

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

ENHANCE-02_ISF: simplify use of ln_isf, add extra comments + minor changes (ticket #2142)

File size: 11.9 KB
Line 
1MODULE isfcavgam
2   !!======================================================================
3   !!                       ***  MODULE  isfgammats  ***
4   !! Ice shelf gamma module :  compute exchange coeficient at the ice/ocean interface
5   !!======================================================================
6   !! History :  4.1  !  (P. Mathiot) original
7   !!----------------------------------------------------------------------
8
9   !!----------------------------------------------------------------------
10   !!   isfcav_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 if needed
56      SELECT CASE ( cn_gammablk )
57      CASE ( 'spe'  ) 
58         ! gamma is constant (specified in namelist)
59         ! nothing to do
60      CASE ('ad15', 'hj99')
61         ! compute velocity in tbl
62         CALL isf_tbl(un(:,:,:) ,zutbl(:,:),'U', miku, rhisf_tbl_cav)
63         CALL isf_tbl(vn(:,:,:) ,zvtbl(:,:),'V', mikv, rhisf_tbl_cav)
64         !
65         ! mask velocity in tbl with ice shelf mask
66         zutbl(:,:) = zutbl(:,:) * mskisf_cav(:,:)
67         zvtbl(:,:) = zvtbl(:,:) * mskisf_cav(:,:)
68         !
69         ! output
70         CALL iom_put('utbl',zutbl(:,:))
71         CALL iom_put('vtbl',zvtbl(:,:))
72      CASE DEFAULT
73         CALL ctl_stop('STOP','method to compute gamma (cn_gammablk) is unknown (should not see this)')
74      END SELECT
75      !
76      ! compute gamma
77      SELECT CASE ( cn_gammablk )
78      CASE ( 'spe'  ) ! gamma is constant (specified in namelist)
79         pgt(:,:) = rn_gammat0
80         pgs(:,:) = rn_gammas0
81      CASE ( 'ad15' ) ! gamma is proportional to u*
82         CALL gammats_AD15 (              zutbl, zvtbl, rCd0_top, r_ke0_top,               pgt, pgs )
83      CASE ( 'hj99' ) ! gamma depends of stability of boundary layer and u*
84         CALL gammats_HJ99 (pttbl, pstbl, zutbl, zvtbl, rCd0_top, r_ke0_top, pqoce, pqfwf, pgt, pgs )
85      CASE DEFAULT
86         CALL ctl_stop('STOP','method to compute gamma (cn_gammablk) is unknown (should not see this)')
87      END SELECT
88      !
89      ! ouput exchange coeficient and tbl velocity
90      CALL iom_put('isfgammat', pgt(:,:))
91      CALL iom_put('isfgammas', pgs(:,:))
92      !
93   END SUBROUTINE isfcav_gammats
94   !
95   !!-----------------------------------------------------------------------------------------------------
96   !!                              PRIVATE SUBROUTINES
97   !!-----------------------------------------------------------------------------------------------------
98   !
99   SUBROUTINE gammats_AD15(putbl, pvtbl, pCd, pke2, &   ! <<== in
100      &                                  pgt, pgs   )   ! ==>> out gammats [m/s]
101      !!----------------------------------------------------------------------
102      !! ** Purpose    : compute the coefficient echange coefficient
103      !!
104      !! ** Method     : gamma is velocity dependent ( gt= gt0 * Ustar )
105      !!
106      !! ** Reference  : Jenkins et al., 2010, JPO, p2298-2312
107      !!                 Asay-Davis et al., Geosci. Model Dev., 9, 2471-2497, 2016
108      !!---------------------------------------------------------------------
109      !!-------------------------- OUT -------------------------------------
110      REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) :: pgt, pgs     ! gammat and gammas [m/s]
111      !!-------------------------- IN  -------------------------------------
112      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: putbl, pvtbl ! velocity in the losch top boundary layer
113      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: pCd          ! drag coefficient
114      REAL(wp),                     INTENT(in   ) :: pke2         ! background velocity
115      !!---------------------------------------------------------------------
116      REAL(wp), DIMENSION(jpi,jpj) :: zustar
117      !!---------------------------------------------------------------------
118      !
119      ! compute ustar (AD15 eq. 27)
120      zustar(:,:) = SQRT( pCd(:,:) * ( putbl(:,:) * putbl(:,:) + pvtbl(:,:) * pvtbl(:,:) + pke2 ) ) * mskisf_cav(:,:)
121      !
122      ! Compute gammats
123      pgt(:,:) = zustar(:,:) * rn_gammat0
124      pgs(:,:) = zustar(:,:) * rn_gammas0
125      !
126      ! output ustar
127      CALL iom_put('isfustar',zustar(:,:))
128      !
129   END SUBROUTINE gammats_AD15
130
131   SUBROUTINE gammats_HJ99( pttbl, pstbl, putbl, pvtbl, pCd, pke2, pqoce, pqfwf, &  ! <<== in
132      &                                                            pgt  , pgs    )  ! ==>> out gammats [m/s]
133      !!----------------------------------------------------------------------
134      !! ** Purpose    : compute the coefficient echange coefficient
135      !!
136      !! ** Method     : gamma is velocity dependent and stability dependent
137      !!
138      !! ** Reference  : Holland and Jenkins, 1999, JPO, p1787-1800
139      !!---------------------------------------------------------------------
140      !!-------------------------- OUT -------------------------------------
141      REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) :: pgt, pgs     ! gammat and gammas
142      !!-------------------------- IN  -------------------------------------
143      REAL(wp),                     INTENT(in   ) :: pke2           ! background velocity squared
144      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: pqoce, pqfwf   ! surface heat flux and fwf flux
145      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: pCd            ! drag coeficient
146      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: putbl, pvtbl   ! velocity in the losch top boundary layer
147      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: pttbl, pstbl   ! tracer   in the losch top boundary layer
148      !!---------------------------------------------------------------------
149      INTEGER  :: ji, jj                     ! loop index
150      INTEGER  :: ikt                        ! local integer
151      REAL(wp) :: zdku, zdkv                 ! U, V shear
152      REAL(wp) :: zPr, zSc, zRc              ! Prandtl, Scmidth and Richardson number
153      REAL(wp) :: zmob, zmols                ! Monin Obukov length, coriolis factor at T point
154      REAL(wp) :: zbuofdep, zhnu             ! Bouyancy length scale, sublayer tickness
155      REAL(wp) :: zhmax                      ! limitation of mol
156      REAL(wp) :: zetastar                   ! stability parameter
157      REAL(wp) :: zgmolet, zgmoles, zgturb   ! contribution of modelecular sublayer and turbulence
158      REAL(wp) :: zcoef                      ! temporary coef
159      REAL(wp) :: zdep
160      REAL(wp) :: zeps = 1.0e-20_wp   
161      REAL(wp), PARAMETER :: zxsiN = 0.052_wp   ! dimensionless constant
162      REAL(wp), PARAMETER :: znu   = 1.95e-6_wp ! kinamatic viscosity of sea water (m2.s-1)
163      REAL(wp), DIMENSION(2) :: zts, zab
164      REAL(wp), DIMENSION(jpi,jpj) :: zustar    ! friction velocity
165      !!---------------------------------------------------------------------
166      !
167      ! compute ustar
168      zustar(:,:) = SQRT( pCd * ( putbl(:,:) * putbl(:,:) + pvtbl(:,:) * pvtbl(:,:) + r_ke0_top ) )
169      !
170      ! output ustar
171      CALL iom_put('isfustar',zustar(:,:))
172      !
173      ! compute Pr and Sc number (eq ??)
174      zPr =   13.8_wp
175      zSc = 2432.0_wp
176      !
177      ! compute gamma mole (eq ??)
178      zgmolet = 12.5_wp * zPr ** (2.0/3.0) - 6.0_wp
179      zgmoles = 12.5_wp * zSc ** (2.0/3.0) - 6.0_wp
180      !
181      ! compute gamma
182      DO ji = 2, jpi
183         DO jj = 2, jpj
184            ikt = mikt(ji,jj)
185
186            IF( zustar(ji,jj) == 0._wp ) THEN           ! only for kt = 1 I think
187               pgt = rn_gammat0
188               pgs = rn_gammas0
189            ELSE
190               ! compute Rc number (as done in zdfric.F90)
191!!gm better to do it like in the new zdfric.F90   i.e. avm weighted Ri computation
192               zcoef = 0.5_wp / e3w_n(ji,jj,ikt+1)
193               !                                            ! shear of horizontal velocity
194               zdku = zcoef * (  un(ji-1,jj  ,ikt  ) + un(ji,jj,ikt  )  &
195                  &             -un(ji-1,jj  ,ikt+1) - un(ji,jj,ikt+1)  )
196               zdkv = zcoef * (  vn(ji  ,jj-1,ikt  ) + vn(ji,jj,ikt  )  &
197                  &             -vn(ji  ,jj-1,ikt+1) - vn(ji,jj,ikt+1)  )
198               !                                            ! richardson number (minimum value set to zero)
199               zRc = MAX(rn2(ji,jj,ikt+1), 0._wp) / MAX( zdku*zdku + zdkv*zdkv, zeps )
200
201               ! compute bouyancy
202               zts(jp_tem) = pttbl(ji,jj)
203               zts(jp_sal) = pstbl(ji,jj)
204               zdep        = gdepw_n(ji,jj,ikt)
205               !
206               CALL eos_rab( zts, zdep, zab )
207               !
208               ! compute length scale (Eq ??)
209               zbuofdep = grav * ( zab(jp_tem) * pqoce(ji,jj) - zab(jp_sal) * pqfwf(ji,jj) )
210               !
211               ! compute Monin Obukov Length
212               ! Maximum boundary layer depth (Eq ??)
213               zhmax = gdept_n(ji,jj,mbkt(ji,jj)) - gdepw_n(ji,jj,mikt(ji,jj)) -0.001_wp
214               !
215               ! Compute Monin obukhov length scale at the surface and Ekman depth: (Eq ??)
216               zmob   = zustar(ji,jj) ** 3 / (vkarmn * (zbuofdep + zeps))
217               zmols  = SIGN(1._wp, zmob) * MIN(ABS(zmob), zhmax) * tmask(ji,jj,ikt)
218               !
219               ! compute eta* (stability parameter) (Eq ??)
220               zetastar = 1._wp / ( SQRT(1._wp + MAX(zxsiN * zustar(ji,jj) / ( ABS(ff_f(ji,jj)) * zmols * zRc ), 0._wp)))
221               !
222               ! compute the sublayer thickness (Eq ??)
223               zhnu = 5 * znu / zustar(ji,jj)
224               !
225               ! compute gamma turb (Eq ??)
226               zgturb = 1._wp / vkarmn * LOG(zustar(ji,jj) * zxsiN * zetastar * zetastar / ( ABS(ff_f(ji,jj)) * zhnu )) &
227               &      + 1._wp / ( 2 * zxsiN * zetastar ) - 1._wp / vkarmn
228               !
229               ! compute gammats
230               pgt(ji,jj) = zustar(ji,jj) / (zgturb + zgmolet)
231               pgs(ji,jj) = zustar(ji,jj) / (zgturb + zgmoles)
232            END IF
233         END DO
234      END DO
235
236   END SUBROUTINE gammats_HJ99
237
238END MODULE isfcavgam
Note: See TracBrowser for help on using the repository browser.