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/UKMO_MERGE_2019/src/OCE/ISF – NEMO

source: NEMO/branches/2019/UKMO_MERGE_2019/src/OCE/ISF/isfcavgam.F90 @ 12077

Last change on this file since 12077 was 12077, checked in by mathiot, 4 years ago

include ENHANCE-02_ISF_nemo in UKMO merge branch

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