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.
sbcblk_algo_ncar.F90 in branches/2017/dev_r8183_ICEMODEL/NEMOGCM/NEMO/OPA_SRC/SBC – NEMO

source: branches/2017/dev_r8183_ICEMODEL/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_algo_ncar.F90 @ 8585

Last change on this file since 8585 was 8585, checked in by clem, 6 years ago

add option Lupkes2015 for ice-atm drag

File size: 16.7 KB
RevLine 
[6723]1MODULE sbcblk_algo_ncar
2   !!======================================================================
3   !!                   ***  MODULE  sbcblk_algo_ncar  ***
4   !! Computes:
5   !!   * bulk transfer coefficients C_D, C_E and C_H
6   !!   * air temp. and spec. hum. adjusted from zt (2m) to zu (10m) if needed
7   !!   * the effective bulk wind speed at 10m U_blk
8   !!   => all these are used in bulk formulas in sbcblk.F90
9   !!
10   !!    Using the bulk formulation/param. of Large & Yeager 2008
11   !!
12   !!       Routine turb_ncar maintained and developed in AeroBulk
13   !!                     (http://aerobulk.sourceforge.net/)
14   !!
15   !!                         L. Brodeau, 2015
16   !!=====================================================================
[6727]17   !! History :  3.6  !  2016-02  (L.Brodeau) successor of old turb_ncar of former sbcblk_core.F90
[6723]18   !!----------------------------------------------------------------------
19
20   !!----------------------------------------------------------------------
21   !!   turb_ncar  : computes the bulk turbulent transfer coefficients
22   !!                   adjusts t_air and q_air from zt to zu m
23   !!                   returns the effective bulk wind speed at 10m
24   !!----------------------------------------------------------------------
25   USE oce             ! ocean dynamics and tracers
26   USE dom_oce         ! ocean space and time domain
27   USE phycst          ! physical constants
28   USE sbc_oce         ! Surface boundary condition: ocean fields
29   USE sbcwave, ONLY   :  cdn_wave ! wave module
30#if defined key_lim3 || defined key_cice
31   USE sbc_ice         ! Surface boundary condition: ice fields
32#endif
33   !
34   USE iom             ! I/O manager library
35   USE lib_mpp         ! distribued memory computing library
36   USE wrk_nemo        ! work arrays
37   USE timing          ! Timing
38   USE in_out_manager  ! I/O manager
39   USE prtctl          ! Print control
40   USE lib_fortran     ! to use key_nosignedzero
41
42
43   IMPLICIT NONE
44   PRIVATE
45
[6727]46   PUBLIC ::   TURB_NCAR   ! called by sbcblk.F90
[6723]47
[6727]48   !                              ! NCAR own values for given constants:
[6723]49   REAL(wp), PARAMETER ::   rctv0 = 0.608   ! constant to obtain virtual temperature...
50   !!----------------------------------------------------------------------
51CONTAINS
52
53   SUBROUTINE turb_ncar( zt, zu, sst, t_zt, ssq, q_zt, U_zu, &
[8585]54      &                  Cd, Ch, Ce, t_zu, q_zu, U_blk,      &
55      &                  Cdn, Chn, Cen                       )
56
[6723]57      !!----------------------------------------------------------------------------------
58      !!                      ***  ROUTINE  turb_ncar  ***
59      !!
60      !! ** Purpose :   Computes turbulent transfert coefficients of surface
61      !!                fluxes according to Large & Yeager (2004) and Large & Yeager (2008)
62      !!                If relevant (zt /= zu), adjust temperature and humidity from height zt to zu
63      !!                Returns the effective bulk wind speed at 10m to be used in the bulk formulas
64      !!
65      !! ** Method : Monin Obukhov Similarity Theory
66      !!             + Large & Yeager (2004,2008) closure: CD_n10 = f(U_n10)
67      !!
68      !! ** References :   Large & Yeager, 2004 / Large & Yeager, 2008
69      !!
70      !! ** Last update: Laurent Brodeau, June 2014:
71      !!    - handles both cases zt=zu and zt/=zu
72      !!    - optimized: less 2D arrays allocated and less operations
73      !!    - better first guess of stability by checking air-sea difference of virtual temperature
74      !!       rather than temperature difference only...
75      !!    - added function "cd_neutral_10m" that uses the improved parametrization of
76      !!      Large & Yeager 2008. Drag-coefficient reduction for Cyclone conditions!
77      !!    - using code-wide physical constants defined into "phycst.mod" rather than redifining them
78      !!      => 'vkarmn' and 'grav'
79      !!
80      !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://sourceforge.net/p/aerobulk)
81      !!
82      !! INPUT :
83      !! -------
84      !!    *  zt   : height for temperature and spec. hum. of air            [m]
85      !!    *  zu   : height for wind speed (generally 10m)                   [m]
86      !!    *  U_zu : scalar wind speed at 10m                                [m/s]
87      !!    *  sst  : SST                                                     [K]
88      !!    *  t_zt : potential air temperature at zt                         [K]
89      !!    *  ssq  : specific humidity at saturation at SST                  [kg/kg]
90      !!    *  q_zt : specific humidity of air at zt                          [kg/kg]
91      !!
92      !!
93      !! OUTPUT :
94      !! --------
95      !!    *  Cd     : drag coefficient
96      !!    *  Ch     : sensible heat coefficient
97      !!    *  Ce     : evaporation coefficient
98      !!    *  t_zu   : pot. air temperature adjusted at wind height zu       [K]
99      !!    *  q_zu   : specific humidity of air        //                    [kg/kg]
100      !!    *  U_blk  : bulk wind at 10m                                      [m/s]
101      !!----------------------------------------------------------------------------------
102      REAL(wp), INTENT(in   )                     ::   zt       ! height for t_zt and q_zt                    [m]
103      REAL(wp), INTENT(in   )                     ::   zu       ! height for U_zu                             [m]
104      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   sst      ! sea surface temperature                [Kelvin]
105      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   t_zt     ! potential air temperature              [Kelvin]
106      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   ssq      ! sea surface specific humidity           [kg/kg]
107      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   q_zt     ! specific air humidity                   [kg/kg]
108      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   U_zu     ! relative wind module at zu                [m/s]
109      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   Cd       ! transfer coefficient for momentum         (tau)
110      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   Ch       ! transfer coefficient for sensible heat (Q_sens)
111      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   Ce       ! transfert coefficient for evaporation   (Q_lat)
112      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   t_zu     ! pot. air temp. adjusted at zu               [K]
113      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   q_zu     ! spec. humidity adjusted at zu           [kg/kg]
114      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   U_blk    ! bulk wind at 10m                          [m/s]
[8585]115      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   Cdn, Chn, Cen ! neutral transfer coefficients
[6723]116      !
117      INTEGER ::   j_itt
118      LOGICAL ::   l_zt_equal_zu = .FALSE.      ! if q and t are given at same height as U
119      INTEGER , PARAMETER ::   nb_itt = 4       ! number of itterations
120      !
121      REAL(wp), DIMENSION(:,:), POINTER ::   Cx_n10        ! 10m neutral latent/sensible coefficient
122      REAL(wp), DIMENSION(:,:), POINTER ::   sqrt_Cd_n10   ! root square of Cd_n10
123      REAL(wp), DIMENSION(:,:), POINTER ::   zeta_u        ! stability parameter at height zu
124      REAL(wp), DIMENSION(:,:), POINTER ::   zpsi_h_u
125      REAL(wp), DIMENSION(:,:), POINTER ::   ztmp0, ztmp1, ztmp2
126      REAL(wp), DIMENSION(:,:), POINTER ::   stab          ! stability test integer
127      !!----------------------------------------------------------------------------------
128      !
129      IF( nn_timing == 1 )   CALL timing_start('turb_ncar')
130      !
131      CALL wrk_alloc( jpi,jpj,   Cx_n10, sqrt_Cd_n10, zeta_u, stab )
132      CALL wrk_alloc( jpi,jpj,   zpsi_h_u, ztmp0, ztmp1, ztmp2 )
133      !
134      l_zt_equal_zu = .FALSE.
135      IF( ABS(zu - zt) < 0.01 ) l_zt_equal_zu = .TRUE.    ! testing "zu == zt" is risky with double precision
136
137      U_blk = MAX( 0.5 , U_zu )   !  relative wind speed at zu (normally 10m), we don't want to fall under 0.5 m/s
138
139      !! First guess of stability:
140      ztmp0 = t_zt*(1. + rctv0*q_zt) - sst*(1. + rctv0*ssq) ! air-sea difference of virtual pot. temp. at zt
141      stab  = 0.5 + sign(0.5,ztmp0)                           ! stab = 1 if dTv > 0  => STABLE, 0 if unstable
142
143      !! Neutral coefficients at 10m:
144      IF( ln_cdgw ) THEN      ! wave drag case
[7753]145         cdn_wave(:,:) = cdn_wave(:,:) + rsmall * ( 1._wp - tmask(:,:,1) )
146         ztmp0   (:,:) = cdn_wave(:,:)
[6723]147      ELSE
148         ztmp0 = cd_neutral_10m( U_blk )
149      ENDIF
150
151      sqrt_Cd_n10 = SQRT( ztmp0 )
152
153      !! Initializing transf. coeff. with their first guess neutral equivalents :
154      Cd = ztmp0
155      Ce = 1.e-3*( 34.6 * sqrt_Cd_n10 )
156      Ch = 1.e-3*sqrt_Cd_n10*(18.*stab + 32.7*(1. - stab))
157      stab = sqrt_Cd_n10   ! Temporaty array !!! stab == SQRT(Cd)
158
159      !! Initializing values at z_u with z_t values:
160      t_zu = t_zt   ;   q_zu = q_zt
161
162      !!  * Now starting iteration loop
163      DO j_itt=1, nb_itt
164         !
165         ztmp1 = t_zu - sst   ! Updating air/sea differences
166         ztmp2 = q_zu - ssq
167
168         ! Updating turbulent scales :   (L&Y 2004 eq. (7))
169         ztmp1  = Ch/stab*ztmp1    ! theta*   (stab == SQRT(Cd))
170         ztmp2  = Ce/stab*ztmp2    ! q*       (stab == SQRT(Cd))
171
172         ztmp0 = 1. + rctv0*q_zu      ! multiply this with t and you have the virtual temperature
173
174         ! Estimate the inverse of Monin-Obukov length (1/L) at height zu:
175         ztmp0 =  (grav*vkarmn/(t_zu*ztmp0)*(ztmp1*ztmp0 + rctv0*t_zu*ztmp2)) / (Cd*U_blk*U_blk)
176         !                                                      ( Cd*U_blk*U_blk is U*^2 at zu )
177
178         !! Stability parameters :
179         zeta_u   = zu*ztmp0   ;  zeta_u = sign( min(abs(zeta_u),10.0), zeta_u )
180         zpsi_h_u = psi_h( zeta_u )
181
182         !! Shifting temperature and humidity at zu (L&Y 2004 eq. (9b-9c))
183         IF( .NOT. l_zt_equal_zu ) THEN
184            !! Array 'stab' is free for the moment so using it to store 'zeta_t'
185            stab = zt*ztmp0 ;  stab = SIGN( MIN(ABS(stab),10.0), stab )  ! Temporaty array stab == zeta_t !!!
186            stab = LOG(zt/zu) + zpsi_h_u - psi_h(stab)                   ! stab just used as temp array again!
187            t_zu = t_zt - ztmp1/vkarmn*stab    ! ztmp1 is still theta*  L&Y 2004 eq.(9b)
188            q_zu = q_zt - ztmp2/vkarmn*stab    ! ztmp2 is still q*      L&Y 2004 eq.(9c)
189            q_zu = max(0., q_zu)
190         END IF
191
192         ztmp2 = psi_m(zeta_u)
193         IF( ln_cdgw ) THEN      ! surface wave case
194            stab = vkarmn / ( vkarmn / sqrt_Cd_n10 - ztmp2 )  ! (stab == SQRT(Cd))
195            Cd      = stab * stab
196         ELSE
197            ! Update neutral wind speed at 10m and neutral Cd at 10m (L&Y 2004 eq. 9a)...
198            !   In very rare low-wind conditions, the old way of estimating the
199            !   neutral wind speed at 10m leads to a negative value that causes the code
200            !   to crash. To prevent this a threshold of 0.25m/s is imposed.
201            ztmp0 = MAX( 0.25 , U_blk/(1. + sqrt_Cd_n10/vkarmn*(LOG(zu/10.) - ztmp2)) ) ! U_n10 (ztmp2 == psi_m(zeta_u))
202            ztmp0 = cd_neutral_10m(ztmp0)                                               ! Cd_n10
[8585]203            Cdn(:,:) = ztmp0
[6723]204            sqrt_Cd_n10 = sqrt(ztmp0)
205
206            stab    = 0.5 + sign(0.5,zeta_u)                           ! update stability
207            Cx_n10  = 1.e-3*sqrt_Cd_n10*(18.*stab + 32.7*(1. - stab))  ! L&Y 2004 eq. (6c-6d)    (Cx_n10 == Ch_n10)
[8585]208            Chn(:,:) = Cx_n10
[6723]209
210            !! Update of transfer coefficients:
211            ztmp1 = 1. + sqrt_Cd_n10/vkarmn*(LOG(zu/10.) - ztmp2)   ! L&Y 2004 eq. (10a) (ztmp2 == psi_m(zeta_u))
212            Cd      = ztmp0 / ( ztmp1*ztmp1 )
213            stab = SQRT( Cd ) ! Temporary array !!! (stab == SQRT(Cd))
214         ENDIF
215
216         ztmp0 = (LOG(zu/10.) - zpsi_h_u) / vkarmn / sqrt_Cd_n10
217         ztmp2 = stab / sqrt_Cd_n10   ! (stab == SQRT(Cd))
218         ztmp1 = 1. + Cx_n10*ztmp0    ! (Cx_n10 == Ch_n10)
219         Ch  = Cx_n10*ztmp2 / ztmp1   ! L&Y 2004 eq. (10b)
220
221         Cx_n10  = 1.e-3 * (34.6 * sqrt_Cd_n10)  ! L&Y 2004 eq. (6b)    ! Cx_n10 == Ce_n10
[8585]222         Cen(:,:) = Cx_n10
[6723]223         ztmp1 = 1. + Cx_n10*ztmp0
224         Ce  = Cx_n10*ztmp2 / ztmp1  ! L&Y 2004 eq. (10c)
225
226      END DO
227
228      CALL wrk_dealloc( jpi,jpj,   Cx_n10, sqrt_Cd_n10, zeta_u, stab )
229      CALL wrk_dealloc( jpi,jpj,   zpsi_h_u, ztmp0, ztmp1, ztmp2 )
230
231      IF( nn_timing == 1 )   CALL timing_stop('turb_ncar')
232
233   END SUBROUTINE turb_ncar
234
235
236   FUNCTION cd_neutral_10m( pw10 )
237      !!----------------------------------------------------------------------------------     
238      !! Estimate of the neutral drag coefficient at 10m as a function
239      !! of neutral wind  speed at 10m
240      !!
241      !! Origin: Large & Yeager 2008 eq.(11a) and eq.(11b)
242      !!
243      !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://sourceforge.net/p/aerobulk)
244      !!----------------------------------------------------------------------------------
245      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pw10           ! scalar wind speed at 10m (m/s)
246      REAL(wp), DIMENSION(jpi,jpj)             :: cd_neutral_10m
247      !
248      INTEGER  ::     ji, jj     ! dummy loop indices
249      REAL(wp) :: zgt33, zw, zw6 ! local scalars
250      !!----------------------------------------------------------------------------------
251      !
252      DO jj = 1, jpj
253         DO ji = 1, jpi
254            !
255            zw  = pw10(ji,jj)
256            zw6 = zw*zw*zw
257            zw6 = zw6*zw6
258            !
259            ! When wind speed > 33 m/s => Cyclone conditions => special treatment
260            zgt33 = 0.5 + SIGN( 0.5, (zw - 33.) )   ! If pw10 < 33. => 0, else => 1
261            !
262            cd_neutral_10m(ji,jj) = 1.e-3 * ( &
263               &       (1. - zgt33)*( 2.7/zw + 0.142 + zw/13.09 - 3.14807E-10*zw6) & ! wind <  33 m/s
264               &      +    zgt33   *      2.34 )                                     ! wind >= 33 m/s
265            !
266            cd_neutral_10m(ji,jj) = MAX(cd_neutral_10m(ji,jj), 1.E-6)
267            !
268         END DO
269      END DO
270      !
271   END FUNCTION cd_neutral_10m
272
273
274   FUNCTION psi_m( pzeta )
275      !!----------------------------------------------------------------------------------
276      !! Universal profile stability function for momentum
277      !!    !! Psis, L&Y 2004 eq. (8c), (8d), (8e)
278      !!     
279      !! pzet0 : stability paramenter, z/L where z is altitude measurement                                         
280      !!         and L is M-O length
281      !!
282      !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://sourceforge.net/p/aerobulk)
283      !!----------------------------------------------------------------------------------
284      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   pzeta
285      REAL(wp), DIMENSION(jpi,jpj)             ::   psi_m
286      !
287      INTEGER  ::   ji, jj         ! dummy loop indices
288      REAL(wp) :: zx2, zx, zstab   ! local scalars
289      !!----------------------------------------------------------------------------------
290      !
291      DO jj = 1, jpj
292         DO ji = 1, jpi
293            zx2 = SQRT( ABS( 1. - 16.*pzeta(ji,jj) ) )
294            zx2 = MAX ( zx2 , 1. )
295            zx  = SQRT( zx2 )
296            zstab = 0.5 + SIGN( 0.5 , pzeta(ji,jj) )
297            !
298            psi_m(ji,jj) =        zstab  * (-5.*pzeta(ji,jj))       &          ! Stable
299               &          + (1. - zstab) * (2.*LOG((1. + zx)*0.5)   &          ! Unstable
300               &               + LOG((1. + zx2)*0.5) - 2.*ATAN(zx) + rpi*0.5)  !    "
301            !
302         END DO
303      END DO
304      !
305   END FUNCTION psi_m
306
307
308   FUNCTION psi_h( pzeta )
309      !!----------------------------------------------------------------------------------
310      !! Universal profile stability function for temperature and humidity
311      !!    !! Psis, L&Y 2004 eq. (8c), (8d), (8e)
312      !!
313      !! pzet0 : stability paramenter, z/L where z is altitude measurement                                         
314      !!         and L is M-O length
315      !!
316      !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://sourceforge.net/p/aerobulk)
317      !!----------------------------------------------------------------------------------
318      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pzeta
319      REAL(wp), DIMENSION(jpi,jpj)             :: psi_h
320      !
321      INTEGER  ::   ji, jj    ! dummy loop indices
322      REAL(wp) :: zx2, zstab  ! local scalars
323      !!----------------------------------------------------------------------------------
324      !
325      DO jj = 1, jpj
326         DO ji = 1, jpi
327            zx2 = SQRT( ABS( 1. - 16.*pzeta(ji,jj) ) )
328            zx2 = MAX ( zx2 , 1. )
329            zstab = 0.5 + SIGN( 0.5 , pzeta(ji,jj) )
330            !
331            psi_h(ji,jj) =         zstab  * (-5.*pzeta(ji,jj))        &  ! Stable
332               &           + (1. - zstab) * (2.*LOG( (1. + zx2)*0.5 ))   ! Unstable
333            !
334         END DO
335      END DO
336      !
337   END FUNCTION psi_h
338
339   !!======================================================================
340END MODULE sbcblk_algo_ncar
Note: See TracBrowser for help on using the repository browser.