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_core.F90 in trunk/NEMO/OPA_SRC/SBC – NEMO

source: trunk/NEMO/OPA_SRC/SBC/sbcblk_core.F90 @ 710

Last change on this file since 710 was 710, checked in by smasson, 17 years ago

tau(x|y) -> (u|v)tau, see ticket:7

  • Property svn:executable set to *
File size: 33.6 KB
Line 
1MODULE sbcblk_core
2   !!======================================================================
3   !!                       ***  MODULE  sbcblk_core  ***
4   !! Ocean forcing:  momentum, heat and freshwater flux formulation
5   !!=====================================================================
6   !! History :  9.0   !  04-08  (U. Schweckendiek)  Original code
7   !!                  !  05-04  (L. Brodeau, A.M. Treguier) additions:
8   !!                            -  new bulk routine for efficiency
9   !!                            -  WINDS ARE NOW ASSUMED TO BE AT T POINTS in input files !!!!
10   !!                            -  file names and file characteristics in namelist
11   !!                            -  Implement reading of 6-hourly fields   
12   !!                  !  06-06  (G. Madec) sbc rewritting
13   !!----------------------------------------------------------------------
14
15   !!----------------------------------------------------------------------
16   !!   sbc_blk_core  : bulk formulation as ocean surface boundary condition
17   !!                   (forced mode, CORE bulk formulea)
18   !!   blk_oce_core  : ocean: computes momentum, heat and freshwater fluxes
19   !!   blk_ice_core  : ice  : computes momentum, heat and freshwater fluxes
20   !!   turb_core     : computes the CORE turbulent transfer coefficients
21   !!----------------------------------------------------------------------
22   USE oce             ! ocean dynamics and tracers
23   USE dom_oce         ! ocean space and time domain
24   USE phycst          ! physical constants
25   USE daymod          ! calendar
26   USE ocfzpt          ! ocean freezing point
27   USE fldread         ! read input fields
28   USE sbc_oce         ! Surface boundary condition: ocean fields
29   USE iom             ! I/O manager library
30   USE in_out_manager  ! I/O manager
31   USE lib_mpp         ! distribued memory computing library
32   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
33
34   IMPLICIT NONE
35   PRIVATE
36
37   PUBLIC   sbc_blk_core       ! routine called in sbcmod module
38   PUBLIC   blk_ice_core       ! routine called in sbc_ice_lim module
39     
40   INTEGER , PARAMETER ::   jpfld   = 8           ! maximum number of files to read
41   INTEGER , PARAMETER ::   jp_wndi = 1           ! index of 10m wind velocity (i-component) (m/s)    at T-point
42   INTEGER , PARAMETER ::   jp_wndj = 2           ! index of 10m wind velocity (j-component) (m/s)    at T-point
43   INTEGER , PARAMETER ::   jp_humi = 3           ! index of specific humidity               ( % )
44   INTEGER , PARAMETER ::   jp_qsr  = 4           ! index of solar heat                      (W/m2)
45   INTEGER , PARAMETER ::   jp_qlw  = 5           ! index of Long wave                       (W/m2)
46   INTEGER , PARAMETER ::   jp_tair = 6           ! index of 10m air temperature             (Kelvin)
47   INTEGER , PARAMETER ::   jp_prec = 7           ! index of total precipitation (rain+snow) (Kg/m2/s)
48   INTEGER , PARAMETER ::   jp_snow = 8           ! index of snow (solid prcipitation)       (kg/m2/s)
49   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf   ! structure of input fields (file informations, fields read)
50         
51   !! * CORE bulk parameters
52   REAL(wp), PARAMETER ::   rhoa =    1.22        ! air density
53   REAL(wp), PARAMETER ::   cpa  = 1000.5         ! specific heat of air
54   REAL(wp), PARAMETER ::   Lv   =    2.5e6       ! latent heat of vaporization
55   REAL(wp), PARAMETER ::   Ls   =    2.839e6     ! latent heat of sublimation
56   REAL(wp), PARAMETER ::   Stef =    5.67e-8     ! Stefan Boltzmann constant
57   REAL(wp), PARAMETER ::   Cice =    1.63e-3     ! transfer coefficient over ice
58
59   !! * Substitutions
60#  include "domzgr_substitute.h90"
61#  include "vectopt_loop_substitute.h90"
62   !!----------------------------------------------------------------------
63   !!   OPA 9.0 , LOCEAN-IPSL (2006)
64   !! $Header: $
65   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
66   !!----------------------------------------------------------------------
67
68CONTAINS
69
70   SUBROUTINE sbc_blk_core( kt )
71      !!---------------------------------------------------------------------
72      !!                    ***  ROUTINE sbc_blk_core  ***
73      !!                   
74      !! ** Purpose :   provide at each time step the surface ocean fluxes
75      !!      (momentum, heat, freshwater and runoff)
76      !!
77      !! ** Method  :   READ each fluxes in NetCDF files
78      !!      The i-component of the stress                utau   (N/m2)
79      !!      The j-component of the stress                vtau   (N/m2)
80      !!      the net downward heat flux                   qtot   (watt/m2)
81      !!      the net downward radiative flux              qsr    (watt/m2)
82      !!      the net upward water (evapo - precip)        emp    (kg/m2/s)
83      !!                Assumptions made:
84      !!       - each file content an entire year (read record, not the time axis)
85      !!       - first and last record are part of the previous and next year
86      !!         (useful for time interpolation)
87      !!       - the number of records is 2 + 365*24 / freqh(jf)
88      !!         or 366 in leap year case
89      !!
90      !!      C A U T I O N : never mask the surface stress fields
91      !!                      the stress is assumed to be in the mesh referential
92      !!                      i.e. the (i,j) referential
93      !!
94      !! ** Action  :   defined at each time-step at the air-sea interface
95      !!              - utau  &  vtau   : stress components in geographical ref.
96      !!              - qns   &  qsr    : non solar and solar heat fluxes
97      !!              - emp             : evap - precip (volume flux)
98      !!              - emps            : evap - precip (concentration/dillution)
99      !!----------------------------------------------------------------------
100      INTEGER, INTENT( in  ) ::   kt   ! ocean time step
101      !!
102      INTEGER  ::   jf       ! dummy indices
103      INTEGER  ::   ierror   ! return error code
104      !!
105      CHARACTER(len=100) ::  cn_dir   !   Root directory for location of core files
106      TYPE(FLD_N), DIMENSION(jpfld) ::   slf_i     ! array of namelist informations on the fields to read
107      TYPE(FLD_N) ::   sn_wndi, sn_wndj, sn_humi, sn_qsr       ! informations about the fields to be read
108      TYPE(FLD_N) ::   sn_qlw , sn_tair, sn_prec, sn_snow      !   "                                 "
109      NAMELIST/namsbc_core/ cn_dir, sn_wndi, sn_wndj, sn_humi, sn_qsr,   &
110         &                          sn_qlw , sn_tair, sn_prec, sn_snow
111      !!---------------------------------------------------------------------
112
113      !                                         ! ====================== !
114      IF( kt == nit000 ) THEN                   !  First call kt=nit000  !
115         !                                      ! ====================== !
116         ! set file information (default values)
117         cn_dir = './'       ! directory in which the model is executed
118
119         ! (NB: frequency positive => hours, negative => months)
120         !            !    file     ! frequency !  variable  ! time intep !  clim  ! starting !
121         !            !    name     !  (hours)  !   name     !   (T/F)    !  (0/1) !  record  !
122         sn_wndi = FLD_N( 'uwnd10m' ,    24.    ,  'u_10'    ,  .FALSE.   ,    0   ,     0    ) 
123         sn_wndj = FLD_N( 'vwnd10m' ,    24.    ,  'v_10'    ,  .FALSE.   ,    0   ,     0    ) 
124         sn_qsr  = FLD_N( 'qsw'     ,    24.    ,  'qsw'     ,  .FALSE.   ,    0   ,     0    ) 
125         sn_qlw  = FLD_N( 'qlw'     ,    24.    ,  'qlw'     ,  .FALSE.   ,    0   ,     0    ) 
126         sn_tair = FLD_N( 'tair10m' ,    24.    ,  't_10'    ,  .FALSE.   ,    0   ,     0    ) 
127         sn_humi = FLD_N( 'humi10m' ,    24.    ,  'q_10'    ,  .FALSE.   ,    0   ,     0    ) 
128         sn_prec = FLD_N( 'precip'  ,   -12.    ,  'precip'  ,  .TRUE.    ,    0   ,     0    ) 
129         sn_snow = FLD_N( 'snow'    ,   -12.    ,  'snow'    ,  .TRUE.    ,    0   ,     0    ) 
130
131         REWIND( numnam )                    ! ... read in namlist namsbc_core
132         READ  ( numnam, namsbc_core )
133
134         ! store namelist information in an array
135         slf_i(jp_wndi) = sn_wndi   ;   slf_i(jp_wndj) = sn_wndj
136         slf_i(jp_qsr ) = sn_qsr    ;   slf_i(jp_qlw ) = sn_qlw
137         slf_i(jp_tair) = sn_tair   ;   slf_i(jp_humi) = sn_humi
138         slf_i(jp_prec) = sn_prec   ;   slf_i(jp_snow) = sn_snow
139         
140         ! set sf structure
141         ALLOCATE( sf(jpfld), STAT=ierror )
142         IF( ierror > 0 ) THEN
143            CALL ctl_stop( 'sbc_blk_core: unable to allocate sf structure' )   ;   RETURN
144         ENDIF
145
146         DO jf = 1, jpfld
147            WRITE(sf(jf)%clrootname,'(a,a)' )   TRIM( cn_dir ), TRIM( slf_i(jf)%clname )
148            sf(jf)%freqh   = slf_i(jf)%freqh
149            sf(jf)%clvar   = slf_i(jf)%clvar
150            sf(jf)%ln_tint = slf_i(jf)%ln_tint
151            sf(jf)%nclim   = slf_i(jf)%nclim
152            sf(jf)%nstrec  = slf_i(jf)%nstrec
153         END DO
154
155         IF(lwp) THEN      ! control print
156            WRITE(numout,*)           
157            WRITE(numout,*) 'sbc_blk_core : flux formulattion for ocean surface boundary condition'
158            WRITE(numout,*) '~~~~~~~~~~~~ '
159            WRITE(numout,*) '          namsbc_core Namelist'
160            WRITE(numout,*) '          list of files and frequency (>0: in hours ; <0 in months)'
161            DO jf = 1, jpfld
162                WRITE(numout,*) '               file root name: ' , TRIM( sf(jf)%clrootname ),   &
163                   &                          ' variable name: '  , TRIM( sf(jf)%clvar      )
164                WRITE(numout,*) '               frequency: '      ,       sf(jf)%freqh       ,   &
165                   &                          ' time interp: '    ,       sf(jf)%ln_tint     ,   &
166                   &                          ' climatology: '    ,       sf(jf)%nclim       ,   &
167                   &                          ' starting record: ',       sf(jf)%nstrec
168            END DO
169         ENDIF
170         !
171      ENDIF
172
173      CALL fld_read( kt, nn_fsbc, sf )                ! Read input fields and provides the
174      !                                               ! input fields at the current time-step
175
176!!gm  IF( MOD( kt - 1, nn_fsbc ) == 0 ) THEN
177
178      CALL blk_oce_core( sst_m, ssu_m, ssv_m )        ! set the ocean surface fluxes
179
180!!gm  ENDIF
181      !                                               ! using CORE bulk formulea
182   END SUBROUTINE sbc_blk_core
183   
184   
185   SUBROUTINE blk_oce_core( pst, pu, pv )
186      !!---------------------------------------------------------------------
187      !!                     ***  ROUTINE blk_core  ***
188      !!
189      !! ** Purpose :   provide the momentum, heat and freshwater fluxes at
190      !!      the ocean surface at each time step
191      !!
192      !! ** Method  :   CORE bulk formulea for the ocean using atmospheric
193      !!      fields read in sbc_read
194      !!
195      !! ** Outputs : - utau    : i-component of the stress at U-point  (N/m2)
196      !!              - vtau    : j-component of the stress at V-point  (N/m2)
197      !!              - qsr_oce : Solar heat flux over the ocean        (W/m2)
198      !!              - qns_oce : Non Solar heat flux over the ocean    (W/m2)
199      !!              - evap    : Evaporation over the ocean            (kg/m2/s)
200      !!              - tprecip : Total precipitation                   (Kg/m2/s)
201      !!              - sprecip : Solid precipitation                   (Kg/m2/s)
202      !!---------------------------------------------------------------------
203      REAL(wp), INTENT(in), DIMENSION(jpi,jpj) ::   pst   ! surface temperature                      [Celcius]
204      REAL(wp), INTENT(in), DIMENSION(jpi,jpj) ::   pu    ! surface current at U-point (i-component) [m/s]
205      REAL(wp), INTENT(in), DIMENSION(jpi,jpj) ::   pv    ! surface current at V-point (j-component) [m/s]
206
207      INTEGER  ::   ji, jj     ! dummy loop indices
208      REAL(wp) ::   zcoef_qsatw
209      REAL(wp), DIMENSION(jpi,jpj) ::   zwnd_i, zwnd_j    ! wind speed components at T-point
210      REAL(wp), DIMENSION(jpi,jpj) ::   zwind_speed_t     ! wind speed module     at T-point ( = | U10m - Uoce | )
211      REAL(wp), DIMENSION(jpi,jpj) ::   zqsatw            ! specific humidity at pst
212      REAL(wp), DIMENSION(jpi,jpj) ::   zqlw, zqsb        ! long wave and sensible heat fluxes
213      REAL(wp), DIMENSION(jpi,jpj) ::   zqla, zevap       ! latent heat fluxes and evaporation
214      REAL(wp), DIMENSION(jpi,jpj) ::   Cd                ! transfer coefficient for momentum      (tau)
215      REAL(wp), DIMENSION(jpi,jpj) ::   Ch                ! transfer coefficient for sensible heat (Q_sens)
216      REAL(wp), DIMENSION(jpi,jpj) ::   Ce                ! tansfert coefficient for evaporation   (Q_lat)
217      REAL(wp), DIMENSION(jpi,jpj) ::   zst               ! surface temperature in Kelvin
218      !!---------------------------------------------------------------------
219
220      ! local scalars ( place there for vector optimisation purposes)
221      zcoef_qsatw = 0.98 * 640380. / rhoa
222     
223      zst(:,:) = pst(:,:) + rt0      ! converte Celcius to Kelvin (and set minimum value far above 0 K)
224
225      ! ----------------------------------------------------------------------------- !
226      !      0   Wind components and module at T-point relative to the moving ocean   !
227      ! ----------------------------------------------------------------------------- !
228      ! ... components ( U10m - U_oce ) at T-point (unmasked)
229      zwnd_i(:,:) = 0.e0 
230      zwnd_j(:,:) = 0.e0
231#if defined key_vectopt_loop
232!CDIR COLLAPSE
233#endif
234      DO jj = 2, jpjm1
235         DO ji = fs_2, fs_jpim1   ! vect. opt.
236            zwnd_i(ji,jj) = (  sf(jp_wndi)%fnow(ji,jj) - 0.5 * ( pu(ji-1,jj  ) + pu(ji,jj) )  )
237            zwnd_j(ji,jj) = (  sf(jp_wndj)%fnow(ji,jj) - 0.5 * ( pv(ji  ,jj-1) + pv(ji,jj) )  )
238         END DO
239      END DO
240      CALL lbc_lnk( zwnd_i(:,:) , 'T', -1. )
241      CALL lbc_lnk( zwnd_j(:,:) , 'T', -1. )
242      ! ... scalar wind ( = | U10m - U_oce | ) at T-point (masked)
243!CDIR NOVERRCHK
244!CDIR COLLAPSE
245      zwind_speed_t(:,:) = SQRT(  zwnd_i(:,:) * zwnd_i(:,:)   &
246         &                      + zwnd_j(:,:) * zwnd_j(:,:)  ) * tmask(:,:,1)
247
248      ! ----------------------------------------------------------------------------- !
249      !      I   Radiative FLUXES                                                     !
250      ! ----------------------------------------------------------------------------- !
251   
252      ! ocean albedo assumed to be 0.066
253!CDIR COLLAPSE
254      qsr (:,:) = ( 1. - 0.066 ) * sf(jp_qsr)%fnow(:,:) * tmask(:,:,1)                                 ! Short Wave
255!CDIR COLLAPSE
256      zqlw(:,:) = (  sf(jp_qlw)%fnow(:,:) - Stef * zst(:,:)*zst(:,:)*zst(:,:)*zst(:,:)  ) * tmask(:,:,1)   ! Long  Wave
257                     
258      ! ----------------------------------------------------------------------------- !
259      !     II    Turbulent FLUXES                                                    !
260      ! ----------------------------------------------------------------------------- !
261
262      ! ... specific humidity at SST and IST
263!CDIR NOVERRCHK
264!CDIR COLLAPSE
265      zqsatw(:,:) = zcoef_qsatw * EXP( -5107.4 / zst(:,:) ) 
266
267      ! ... NCAR Bulk formulae, computation of Cd, Ch, Ce at T-point :
268!!gm bug?  a the compiling phase, add a copy in temporary arrays...  ==> check perf!
269!     CALL TURB_CORE( 10., zst   (:,:), sf(jp_tair)%fnow(:,:),   &
270!        &                 zqsatw(:,:), sf(jp_humi)%fnow(:,:), zwind_speed_t(:,:),   &
271!        &                 Cd(:,:), Ch(:,:), Ce(:,:)                              )
272!!gm end
273      CALL TURB_CORE( 10., zst   , sf(jp_tair)%fnow,   &
274         &                 zqsatw, sf(jp_humi)%fnow, zwind_speed_t,   &
275         &                 Cd, Ch, Ce                              )
276   
277      ! ...  umasked Momentum : utau, vtau at U- and V_points, resp.
278      !      Note the use of 2-tmask in order to umask the stress along coastlines
279      zwnd_i(:,:) = rhoa * zwind_speed_t(:,:) * Cd(:,:) * zwnd_i(:,:)
280      zwnd_j(:,:) = rhoa * zwind_speed_t(:,:) * Cd(:,:) * zwnd_j(:,:)
281      DO jj = 1, jpjm1
282         DO ji = 1, fs_jpim1
283            utau(ji,jj) = 0.5 * ( zwnd_i(ji,jj) + zwnd_i(ji+1,jj  ) ) * ( 2. - tmask(ji,jj,1) )
284            vtau(ji,jj) = 0.5 * ( zwnd_j(ji,jj) + zwnd_j(ji  ,jj+1) ) * ( 2. - tmask(ji,jj,1) )
285         END DO
286      END DO
287      CALL lbc_lnk( utau(:,:), 'U', -1. )
288      CALL lbc_lnk( vtau(:,:), 'V', -1. )
289
290      !  Turbulent fluxes over ocean
291      ! -----------------------------
292!CDIR COLLAPSE
293      zevap(:,:) = rhoa    *Ce(:,:)*( zqsatw(:,:) - sf(jp_humi)%fnow(:,:) ) * zwind_speed_t(:,:)   ! Evaporation
294!CDIR COLLAPSE
295      zqsb (:,:) = rhoa*cpa*Ch(:,:)*( zst   (:,:) - sf(jp_tair)%fnow(:,:) ) * zwind_speed_t(:,:)   ! Sensible Heat
296!CDIR COLLAPSE
297      zqla (:,:) = Lv * zevap(:,:)                                                                 ! Latent Heat
298
299       
300      ! ----------------------------------------------------------------------------- !
301      !     III    Total FLUXES                                                       !
302      ! ----------------------------------------------------------------------------- !
303     
304!CDIR COLLAPSE
305      qns(:,:) = zqlw(:,:) - zqsb(:,:) - zqla(:,:)      ! Downward Non Solar flux
306       
307!CDIR COLLAPSE
308      emp (:,:) = zevap(:,:) - sf(jp_prec)%fnow(:,:) * tmask(:,:,1)
309!CDIR COLLAPSE
310      emps(:,:) = zevap(:,:) - sf(jp_prec)%fnow(:,:) * tmask(:,:,1)
311      !
312   END SUBROUTINE blk_oce_core
313   
314   
315   SUBROUTINE blk_ice_core(  pst   , pui   , pvi   , palb ,   &
316      &                      p_taui, p_tauj, p_qns , p_qsr,   &
317      &                      p_qla , p_dqns, p_dqla,          &
318      &                      p_tpr , p_spr ,                  &
319      &                      p_fr1 , p_fr2  ) 
320      !!---------------------------------------------------------------------
321      !!                     ***  ROUTINE blk_ice_core  ***
322      !!
323      !! ** Purpose :   provide the surface boundary condition over sea-ice
324      !!
325      !! ** Method  :   compute momentum, heat and freshwater exchanged
326      !!                between atmosphere and sea-ice using CORE bulk
327      !!                formulea, ice variables and read atmmospheric fields.
328      !!                NB: ice drag coefficient is assumed to be a constant
329      !!
330      !! caution : the net upward water flux has with mm/day unit
331      !!---------------------------------------------------------------------
332      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   pst      ! ice surface temperature (>0, =rt0 over land)   [Kelvin]
333      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   pui      ! ice surface velocity (i-component, I-point)    [m/s]
334      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   pvi      ! ice surface velocity (j-component, I-point)    [m/s]
335      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   palb     ! ice albedo (clear sky) (alb_ice_cs)            [%]
336      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   p_taui   ! surface ice stress at I-point (i-component)    [N/m2]
337      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   p_tauj   ! surface ice stress at I-point (j-component)    [N/m2]
338      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   p_qns    ! non solar heat flux over ice (T-point)         [W/m2]
339      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   p_qsr    !     solar heat flux over ice (T-point)         [W/m2]
340      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   p_qla    ! latent    heat flux over ice (T-point)         [W/m2]
341      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   p_dqns   ! non solar heat sensistivity  (T-point)         [W/m2]
342      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   p_dqla   ! latent    heat sensistivity  (T-point)         [W/m2]
343      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   p_tpr    ! total precipitation          (T-point)         [Kg/m2/s]
344      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   p_spr    ! solid precipitation          (T-point)         [Kg/m2/s]
345      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   p_fr1    ! 1sr fraction of qsr penetration in ice         [%]
346      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   p_fr2    ! 2nd fraction of qsr penetration in ice         [%]
347      !!
348      INTEGER  ::   ji, jj                    ! dummy loop indices
349      REAL(wp) ::   zst3
350      REAL(wp) ::   zcoef_wnorm, zcoef_dqlw, zcoef_dqla, zcoef_dqsb, zcoef_fr12
351      REAL(wp) ::   zwnorm_f, zwndi_f , zwndj_f      ! relative wind module and components at F-point
352      REAL(wp) ::             zwndi_t , zwndj_t      ! relative wind components at T-point
353      REAL(wp), DIMENSION(jpi,jpj) ::   z_wnds_t     ! wind speed ( = | U10m - U_ice | ) at T-point
354      REAL(wp), DIMENSION(jpi,jpj) ::   z_qlw        ! long wave heat flux over ice
355      REAL(wp), DIMENSION(jpi,jpj) ::   z_qsb        ! sensible  heat flux over ice
356      REAL(wp), DIMENSION(jpi,jpj) ::   z_dqlw       ! sensible  heat flux over ice
357      REAL(wp), DIMENSION(jpi,jpj) ::   z_dqsb       ! sensible  heat flux over ice
358      !!---------------------------------------------------------------------
359
360      ! local scalars ( place there for vector optimisation purposes)
361      zcoef_wnorm = rhoa * Cice
362      zcoef_dqlw = 4.0 * 0.95 * Stef
363      zcoef_dqla = -Ls * Cice * 0.98 * 11637800. / (rhoa*rhoa) * (-5897.8)
364      zcoef_dqsb = rhoa * cpa * Cice
365      zcoef_fr12 = 1.0  - 0.3       !!!gm ??? ! sf(jp_snow)%fnow(:,:)
366
367!!gm brutal....
368      z_wnds_t(:,:) = 0.e0
369      p_taui  (:,:) = 0.e0
370      p_tauj  (:,:) = 0.e0
371!!gm end
372
373      ! ----------------------------------------------------------------------------- !
374      !    Wind components and module relative to the moving ocean at I and T-point   !
375      ! ----------------------------------------------------------------------------- !
376      ! ... components ( U10m - U_oce ) at I-point (F-point with sea-ice indexation) (unmasked)
377      !     and scalar wind at T-point ( = | U10m - U_ice | ) (masked)
378#if defined key_vectopt_loop
379!CDIR COLLAPSE
380#endif
381!CDIR NOVERRCHK
382      DO jj = 2, jpjm1
383         DO ji = fs_2, fs_jpim1
384            ! ... scalar wind at I-point (fld being at T-point)
385            zwndi_f = 0.25 * (  sf(jp_wndi)%fnow(ji-1,jj  ) + sf(jp_wndi)%fnow(ji  ,jj  )   &
386               &              + sf(jp_wndi)%fnow(ji-1,jj-1) + sf(jp_wndi)%fnow(ji  ,jj-1)  ) - pui(ji,jj)
387            zwndj_f = 0.25 * (  sf(jp_wndj)%fnow(ji-1,jj  ) + sf(jp_wndj)%fnow(ji  ,jj  )   &
388               &              + sf(jp_wndj)%fnow(ji-1,jj-1) + sf(jp_wndj)%fnow(ji  ,jj-1)  ) - pvi(ji,jj)
389            zwnorm_f = zcoef_wnorm * SQRT( zwndi_f * zwndi_f + zwndj_f * zwndj_f )
390            ! ... ice stress at I-point
391            p_taui(ji,jj) = zwnorm_f * zwndi_f
392            p_tauj(ji,jj) = zwnorm_f * zwndj_f
393            ! ... scalar wind at T-point (fld being at T-point)
394            zwndi_t = sf(jp_wndi)%fnow(ji,jj) - 0.25 * (  pui(ji,jj+1) + pui(ji+1,jj+1)   &
395               &                                        + pui(ji,jj  ) + pui(ji+1,jj  )  )
396            zwndj_t = sf(jp_wndj)%fnow(ji,jj) - 0.25 * (  pvi(ji,jj+1) + pvi(ji+1,jj+1)   &
397               &                                        + pvi(ji,jj  ) + pvi(ji+1,jj  )  )
398            z_wnds_t(ji,jj)  = SQRT( zwndi_t * zwndi_t + zwndj_t * zwndj_t ) * tmask(ji,jj,1)
399         END DO
400      END DO
401      CALL lbc_lnk( p_taui  , 'I', -1. )
402      CALL lbc_lnk( p_tauj  , 'I', -1. )
403      CALL lbc_lnk( z_wnds_t, 'T',  1. )
404
405      ! ----------------------------------------------------------------------------- !
406      !      I   Radiative FLUXES                                                     !
407      ! ----------------------------------------------------------------------------- !
408!CDIR COLLAPSE
409      DO jj = 1, jpj
410         DO ji = 1, jpi
411            zst3 = pst(ji,jj) * pst(ji,jj) * pst(ji,jj)
412            p_qsr(ji,jj) = ( 1. - palb(ji,jj) ) * sf(jp_qsr)%fnow(ji,jj) * tmask(ji,jj,1)     ! Short Wave (sw)
413            z_qlw(ji,jj) = 0.95 * (  sf(jp_qlw)%fnow(ji,jj)       &                           ! Long  Wave (lw)
414               &                   - Stef * pst(ji,jj) * zst3  ) * tmask(ji,jj,1)
415            z_dqlw(ji,jj) = zcoef_dqlw * zst3                                                      ! lw sensitivity
416         END DO
417      END DO
418
419      ! ----------------------------------------------------------------------------- !
420      !     II    Turbulent FLUXES                                                    !
421      ! ----------------------------------------------------------------------------- !
422
423      ! ... turbulent heat fluxes
424!CDIR COLLAPSE
425      z_qsb(:,:) = rhoa * cpa * Cice * z_wnds_t(:,:) * ( pst(:,:) - sf(jp_tair)%fnow(:,:) )   ! Sensible Heat
426!CDIR NOVERRCHK
427!CDIR COLLAPSE
428      p_qla(:,:) = rhoa * Ls  * Cice * z_wnds_t(:,:)   &                                    ! Latent Heat
429         &       * (  11637800. * EXP( -5897.8 / pst(:,:) ) / rhoa - sf(jp_humi)%fnow(ji,jj)  )
430     
431      ! Latent heat sensitivity for ice (Dqla/Dt)
432!CDIR NOVERRCHK
433!CDIR COLLAPSE
434      p_dqla(:,:) = zcoef_dqla * z_wnds_t(:,:) / ( pst(:,:) * pst(:,:) ) * EXP( -5897.8 / pst(:,:) )
435       
436      ! Sensible heat sensitivity (Dqsb_ice/Dtn_ice)
437!CDIR COLLAPSE
438      z_dqsb(:,:) = zcoef_dqsb * z_wnds_t(:,:)
439
440      ! ----------------------------------------------------------------------------- !
441      !     III    Total FLUXES                                                       !
442      ! ----------------------------------------------------------------------------- !
443     
444!CDIR COLLAPSE
445      p_qns (:,:) =     z_qlw (:,:) - z_qsb (:,:) - p_qla (:,:)      ! Downward Non Solar flux
446!CDIR COLLAPSE
447      p_dqns(:,:) = - ( z_dqlw(:,:) + z_dqsb(:,:) + p_dqla(:,:) )    ! Total non solar heat flux sensitivity for ice
448       
449       
450      !--------------------------------------------------------------------
451      ! FRACTIONs of net shortwave radiation which is not absorbed in the
452      ! thin surface layer and penetrates inside the ice cover
453      ! ( Maykut and Untersteiner, 1971 ; Elbert and Curry, 1993 )
454   
455!CDIR COLLAPSE
456      p_fr1(:,:) = ( 0.18 * zcoef_fr12 + 0.35 * sf(jp_snow)%fnow(:,:) )
457!CDIR COLLAPSE
458      p_fr2(:,:) = ( 0.82 * zcoef_fr12 + 0.65 * sf(jp_snow)%fnow(:,:) )
459       
460!CDIR COLLAPSE
461      p_tpr(:,:) = sf(jp_prec)%fnow(:,:)      ! total precipitation [kg/m2/s]
462!CDIR COLLAPSE
463      p_spr(:,:) = sf(jp_snow)%fnow(:,:)      ! solid precipitation [kg/m2/s]
464      !
465   END SUBROUTINE blk_ice_core
466 
467 
468   SUBROUTINE turb_core( zzu, T_0, T_a, q_sat, q_a, dU, C_d, C_h, C_e )
469      !!---------------------------------------------------------------------
470      !!       Computes turbulent transfert coefficients of surface fluxes
471      !!             according to Large & Yeager (2004)
472      !!
473      !!    I N E R T I A L   D I S S I P A T I O N   M E T H O D
474      !!
475      !!   Momentum, Latent and sensible heat exchange coefficients
476      !!
477      !!   Caution: this procedure should only be used in cases when air temperature (T_air),
478      !!   air specific humidity (q_air) and wind (dU) are provided at the same height 'zzu'!
479      !!
480      !!   Laurent Brodeau, LEGI, Grenoble
481      !!   brodeau@hmg.inpg.fr
482      !!---------------------------------------------------------------------
483      REAL(wp), INTENT(in   )                     ::   zzu     ! altitude of wind measurement      [m]
484      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   T_0     ! sea surface temperature           [Kelvin]
485      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   T_a     ! potential air temperature at zzu  [Kelvin]
486      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   q_sat   ! sea surface specific humidity     [kg/kg]
487      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   q_a     ! specific air humidity at zzu      [kg/kg]
488      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   dU      ! wind module |U(zzu)-U(0)|         [m/s]
489      REAL(wp), INTENT(inout), DIMENSION(jpi,jpj) ::   C_d     ! transfer coefficient for momentum      (tau)
490      REAL(wp), INTENT(inout), DIMENSION(jpi,jpj) ::   C_h     ! transfer coefficient for sensible heat (Q_sens)
491      REAL(wp), INTENT(inout), DIMENSION(jpi,jpj) ::   C_e     ! tansfert coefficient for evaporation   (Q_lat)
492
493      INTEGER             ::   jk                   ! dummy loop indices
494      INTEGER , PARAMETER ::   nit = 3              ! number of iterations
495      INTEGER , DIMENSION(jpi,jpj) ::   stab        ! stability test integer
496      INTEGER , DIMENSION(jpi,jpj) ::   stabit      ! stability within iterative loop
497      REAL(wp), DIMENSION(jpi,jpj) ::   &
498         dU10,        &  ! dU                                   [m/s]
499         dT,          &  ! air/sea temperature differeence      [K]
500         dq,          &  ! air/sea humidity difference          [K]
501         Cd_n10,      &  ! 10m neutral drag coefficient
502         Ce_n10,      &  ! 10m neutral latent coefficient
503         Ch_n10,      &  ! 10m neutral sensible coefficient
504         Cd,          &  ! drag coefficient
505         Ce,          &  ! latent coefficient
506         Ch,          &  ! sensible coefficient
507         sqrt_Cd_n10, &  ! root square of Cd_n10
508         sqrt_Cd,     &  ! root square of Cd
509         T_vpot,      &  ! virtual potential temperature        [K]
510         T_star,      &  ! turbulent scale of tem. fluct.
511         q_star,      &  ! turbulent humidity of temp. fluct.
512         U_star,      &  ! turb. scale of velocity fluct.
513         L,           &  ! Monin-Obukov length                  [m]
514         zeta,        &  ! stability parameter at height zzu
515         X2, X,       &   
516         psi_m,       &
517         psi_h,       &
518         U_n10,       &  ! neutral wind velocity at 10m        [m]   
519         xlogt
520      !!---------------------------------------------------------------------
521
522      !! I. Preliminary stuffs
523      !! --------------------
524
525      ! ... Air/sea differences
526      dU10 = MAX( 0.5, dU )     ! we do not want to fall under 0.5 m/s
527      dT   = T_a - T_0          ! assuming that T_a is allready the potential temp. at zzu
528      dq   = q_a - q_sat
529
530      ! ... Virtual potential temperature
531      T_vpot = T_a * ( 1. + 0.608 * q_a )
532
533      ! ... Computing Neutral Drag Coefficient
534!CDIR NOVERRCHK
535      Cd_n10      = 1E-3 * ( 2.7/dU10 + 0.142 + dU10/13.09 )          !  \\ L & Y eq. (6a)
536      sqrt_Cd_n10 = SQRT( Cd_n10 )
537
538      Ce_n10  = 1E-3 * ( 34.6 * sqrt_Cd_n10 )                         !  \\ L & Y eq. (6b)
539
540      ! ... First guess of stabilitty :
541      stab    = 0.5 + SIGN( 0.5, dT )     ! stable : stab = 1 ; unstable : stab = 0
542      Ch_n10  = 1E-3 * sqrt_Cd_n10 * ( 18*stab + 32.7*(1-stab) )      !  \\ L & Y eq. (6c), (6d)
543
544      ! ... Initializing transfert coefficients with their first guess neutral equivalents :
545      Cd = Cd_n10   ;   Ce = Ce_n10   ;   Ch = Ch_n10
546
547
548      !! II. Now starting iteration loop (IDM)
549      !! -------------------------------------
550
551      DO jk = 1, nit
552 
553!CDIR NOVERRCHK
554         sqrt_Cd = SQRT( Cd )
555
556         !! Turbulent scales :
557         !! ------------------
558         U_star  = sqrt_Cd    * dU10             !  \\ L & Y eq. (7a)
559         T_star  = Ch/sqrt_Cd * dT               !  \\ L & Y eq. (7b)
560         q_star  = Ce/sqrt_Cd * dq               !  \\ L & Y eq. (7c)
561
562         !! Estimate the Monin-Obukov length :
563         !! ----------------------------------
564         L  = (U_star*U_star) / ( vkarmn*grav*(T_star/T_vpot + q_star/(q_a + 1./0.608)) )
565
566         !! Stability parameters :
567         !! ----------------------
568         zeta = zzu / L
569         zeta = SIGN( MIN( ABS( zeta ), 10.0 ), zeta )
570
571         !! Psis, L & Y eq. (8c), (8d), (8e) :
572         !! ----------------------------------
573!CDIR NOVERRCHK
574         X2 = SQRT( ABS( 1. - 16.*zeta ) )   ;   X2 = MAX( X2 , 1.0 )   
575!CDIR NOVERRCHK
576         X  = SQRT( X2 )
577
578         stabit    = 0.5 + SIGN( 0.5, zeta )
579
580!CDIR NOVERRCHK
581         psi_m = -5. * zeta * stabit   &                                                   ! Stable
582            &  + (1 - stabit)*(2*LOG((1. + X)/2) + LOG((1. + X2)/2) - 2*atan(X) + rpi/2)   ! Unstable
583
584!CDIR NOVERRCHK
585         psi_h = -5. * zeta * stabit   &                                                   ! Stable
586            &  + (1 - stabit)*(2*LOG( (1. + X2)/2 ))                                       ! Unstable
587
588         !! Shifting the wind speed to 10m and neutral stability :
589         !! ------------------------------------------------------
590!CDIR NOVERRCHK
591         U_n10 = dU10 / (1. + SQRT( Cd_n10 ) / vkarmn * ( LOG(zzu/10.) - psi_m ) )    ! \\ L & Y eq. (9a)
592         
593         !! Updating the neutral 10m transfer coefficients :
594         !! ------------------------------------------------
595         Cd_n10  = 1e-3 * ( 2.7/U_n10 + 0.142 + U_n10/13.09 )              ! \\ L & Y eq. (6a)
596!CDIR NOVERRCHK
597         sqrt_Cd_n10 = SQRT( Cd_n10 )
598         
599         Ce_n10  = 1e-3 * ( 34.6 * sqrt_Cd_n10 )                           ! \\ L & Y eq. (6b)
600       
601         stab    = 0.5 + sign(0.5,zeta)
602         Ch_n10  = 1e-3 * sqrt_Cd_n10 * ( 18.*stab + 32.7*(1-stab) )       ! \\ L & Y eq. (6c), (6d)
603       
604         !! Shifting the neutral  10m transfer coefficients to ( zzu , zeta ) :
605         !! --------------------------------------------------------------------
606         !! Problem here, formulation used within L & Y differs from the one provided
607         !! in their fortran code (only for Ce and Ch)
608         
609!CDIR NOVERRCHK
610         Cd = Cd_n10/(1. + sqrt_Cd_n10/vkarmn*(LOG(zzu/10) - psi_m))**2     ! \\ L & Y eq. (10a)
611       
612!CDIR NOVERRCHK
613         xlogt = LOG(zzu/10) - psi_h
614!CDIR NOVERRCHK
615         !?      Ch = Ch_n10*SQRT(Cd/Cd_n10)/(1. + Ch_n10/(vkarmn*sqrt_Cd_n10)*xlogt)
616         Ch = Ch_n10/( 1. + Ch_n10*xlogt/vkarmn/sqrt_Cd_n10 )**2             ! \\ L & Y eq. (10b)
617       
618!CDIR NOVERRCHK
619         !?      Ce = Ce_n10*SQRT(Cd/Cd_n10)/(1. + Ce_n10/(vkarmn*sqrt_Cd_n10)*xlogt)
620         Ce = Ce_n10/( 1. + Ce_n10*xlogt/vkarmn/sqrt_Cd_n10 )**2             ! \\ L & Y eq. (10c)
621     
622      END DO
623
624      C_d(:,:) = Cd(:,:)
625      C_h(:,:) = Ch(:,:)
626      C_e(:,:) = Ce(:,:)
627
628   END SUBROUTINE TURB_CORE
629 
630   !!======================================================================
631END MODULE sbcblk_core
Note: See TracBrowser for help on using the repository browser.