MODULE sbcblk_core !!====================================================================== !! *** MODULE sbcblk_core *** !! Ocean forcing: momentum, heat and freshwater flux formulation !!===================================================================== !! History : 1.0 ! 04-08 (U. Schweckendiek) Original code !! 2.0 ! 05-04 (L. Brodeau, A.M. Treguier) additions: !! - new bulk routine for efficiency !! - WINDS ARE NOW ASSUMED TO BE AT T POINTS in input files !!!! !! - file names and file characteristics in namelist !! - Implement reading of 6-hourly fields !! 3.0 ! 06-06 (G. Madec) sbc rewritting !!---------------------------------------------------------------------- !!---------------------------------------------------------------------- !! sbc_blk_core : bulk formulation as ocean surface boundary condition !! (forced mode, CORE bulk formulea) !! blk_oce_core : ocean: computes momentum, heat and freshwater fluxes !! blk_ice_core : ice : computes momentum, heat and freshwater fluxes !! turb_core : computes the CORE turbulent transfer coefficients !!---------------------------------------------------------------------- USE oce ! ocean dynamics and tracers USE dom_oce ! ocean space and time domain USE phycst ! physical constants USE daymod ! calendar USE fldread ! read input fields USE sbc_oce ! Surface boundary condition: ocean fields USE iom ! I/O manager library USE in_out_manager ! I/O manager USE lib_mpp ! distribued memory computing library USE lbclnk ! ocean lateral boundary conditions (or mpp link) USE prtctl ! Print control #if defined key_lim3 USE ice_oce ! For ice surface temperature #endif IMPLICIT NONE PRIVATE PUBLIC sbc_blk_core ! routine called in sbcmod module PUBLIC blk_ice_core ! routine called in sbc_ice_lim module INTEGER , PARAMETER :: jpfld = 8 ! maximum number of files to read INTEGER , PARAMETER :: jp_wndi = 1 ! index of 10m wind velocity (i-component) (m/s) at T-point INTEGER , PARAMETER :: jp_wndj = 2 ! index of 10m wind velocity (j-component) (m/s) at T-point INTEGER , PARAMETER :: jp_humi = 3 ! index of specific humidity ( % ) INTEGER , PARAMETER :: jp_qsr = 4 ! index of solar heat (W/m2) INTEGER , PARAMETER :: jp_qlw = 5 ! index of Long wave (W/m2) INTEGER , PARAMETER :: jp_tair = 6 ! index of 10m air temperature (Kelvin) INTEGER , PARAMETER :: jp_prec = 7 ! index of total precipitation (rain+snow) (Kg/m2/s) INTEGER , PARAMETER :: jp_snow = 8 ! index of snow (solid prcipitation) (kg/m2/s) TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf ! structure of input fields (file informations, fields read) !! * CORE bulk parameters REAL(wp), PARAMETER :: rhoa = 1.22 ! air density REAL(wp), PARAMETER :: cpa = 1000.5 ! specific heat of air REAL(wp), PARAMETER :: Lv = 2.5e6 ! latent heat of vaporization REAL(wp), PARAMETER :: Ls = 2.839e6 ! latent heat of sublimation REAL(wp), PARAMETER :: Stef = 5.67e-8 ! Stefan Boltzmann constant REAL(wp), PARAMETER :: Cice = 1.63e-3 ! transfer coefficient over ice LOGICAL :: ln_2m = .FALSE. !: logical flag for height of air temp. and hum REAL(wp) :: alpha_precip=1. !: multiplication factor for precipitation !! * Substitutions # include "domzgr_substitute.h90" # include "vectopt_loop_substitute.h90" !!---------------------------------------------------------------------- !! OPA 9.0 , LOCEAN-IPSL (2006) !! $Id$ !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) !!---------------------------------------------------------------------- CONTAINS SUBROUTINE sbc_blk_core( kt ) !!--------------------------------------------------------------------- !! *** ROUTINE sbc_blk_core *** !! !! ** Purpose : provide at each time step the surface ocean fluxes !! (momentum, heat, freshwater and runoff) !! !! ** Method : READ each fluxes in NetCDF files !! The i-component of the stress utau (N/m2) !! The j-component of the stress vtau (N/m2) !! the net downward heat flux qtot (watt/m2) !! the net downward radiative flux qsr (watt/m2) !! the net upward water (evapo - precip) emp (kg/m2/s) !! Assumptions made: !! - each file content an entire year (read record, not the time axis) !! - first and last record are part of the previous and next year !! (useful for time interpolation) !! - the number of records is 2 + 365*24 / freqh(jf) !! or 366 in leap year case !! !! C A U T I O N : never mask the surface stress fields !! the stress is assumed to be in the mesh referential !! i.e. the (i,j) referential !! !! ** Action : defined at each time-step at the air-sea interface !! - utau & vtau : stress components in geographical ref. !! - qns & qsr : non solar and solar heat fluxes !! - emp : evap - precip (volume flux) !! - emps : evap - precip (concentration/dillution) !!---------------------------------------------------------------------- INTEGER, INTENT( in ) :: kt ! ocean time step !! INTEGER :: ierror ! return error code !! CHARACTER(len=100) :: cn_dir ! Root directory for location of core files TYPE(FLD_N), DIMENSION(jpfld) :: slf_i ! array of namelist informations on the fields to read TYPE(FLD_N) :: sn_wndi, sn_wndj, sn_humi, sn_qsr ! informations about the fields to be read TYPE(FLD_N) :: sn_qlw , sn_tair, sn_prec, sn_snow ! " " NAMELIST/namsbc_core/ cn_dir, ln_2m, alpha_precip, sn_wndi, sn_wndj, sn_humi, sn_qsr, & & sn_qlw , sn_tair, sn_prec, sn_snow !!--------------------------------------------------------------------- ! ! ====================== ! IF( kt == nit000 ) THEN ! First call kt=nit000 ! ! ! ====================== ! ! set file information (default values) cn_dir = './' ! directory in which the model is executed ! (NB: frequency positive => hours, negative => months) ! ! file ! frequency ! variable ! time intep ! clim ! 'yearly' or ! ! ! name ! (hours) ! name ! (T/F) ! (T/F) ! 'monthly' ! sn_wndi = FLD_N( 'uwnd10m' , 24. , 'u_10' , .false. , .false. , 'yearly' ) sn_wndj = FLD_N( 'vwnd10m' , 24. , 'v_10' , .false. , .false. , 'yearly' ) sn_qsr = FLD_N( 'qsw' , 24. , 'qsw' , .false. , .false. , 'yearly' ) sn_qlw = FLD_N( 'qlw' , 24. , 'qlw' , .false. , .false. , 'yearly' ) sn_tair = FLD_N( 'tair10m' , 24. , 't_10' , .false. , .false. , 'yearly' ) sn_humi = FLD_N( 'humi10m' , 24. , 'q_10' , .false. , .false. , 'yearly' ) sn_prec = FLD_N( 'precip' , -1. , 'precip' , .true. , .false. , 'yearly' ) sn_snow = FLD_N( 'snow' , -1. , 'snow' , .true. , .false. , 'yearly' ) REWIND( numnam ) ! ... read in namlist namsbc_core READ ( numnam, namsbc_core ) ! store namelist information in an array slf_i(jp_wndi) = sn_wndi ; slf_i(jp_wndj) = sn_wndj slf_i(jp_qsr ) = sn_qsr ; slf_i(jp_qlw ) = sn_qlw slf_i(jp_tair) = sn_tair ; slf_i(jp_humi) = sn_humi slf_i(jp_prec) = sn_prec ; slf_i(jp_snow) = sn_snow ! set sf structure ALLOCATE( sf(jpfld), STAT=ierror ) IF( ierror > 0 ) THEN CALL ctl_stop( 'sbc_blk_core: unable to allocate sf structure' ) ; RETURN ENDIF ! fill sf with slf_i and control print CALL fld_fill( sf, slf_i, cn_dir, 'sbc_blk_core', 'flux formulattion for ocean surface boundary condition', 'namsbc_core' ) ! ENDIF CALL fld_read( kt, nn_fsbc, sf ) ! input fields provided at the current time-step #if defined key_lim3 tatm_ice(:,:) = sf(jp_tair)%fnow(:,:) #endif IF( MOD( kt - 1, nn_fsbc ) == 0 ) THEN CALL blk_oce_core( sst_m, ssu_m, ssv_m ) ! compute the surface ocean fluxes using CLIO bulk formulea ENDIF ! ! using CORE bulk formulea END SUBROUTINE sbc_blk_core SUBROUTINE blk_oce_core( pst, pu, pv ) !!--------------------------------------------------------------------- !! *** ROUTINE blk_core *** !! !! ** Purpose : provide the momentum, heat and freshwater fluxes at !! the ocean surface at each time step !! !! ** Method : CORE bulk formulea for the ocean using atmospheric !! fields read in sbc_read !! !! ** Outputs : - utau : i-component of the stress at U-point (N/m2) !! - vtau : j-component of the stress at V-point (N/m2) !! - qsr : Solar heat flux over the ocean (W/m2) !! - qns : Non Solar heat flux over the ocean (W/m2) !! - evap : Evaporation over the ocean (kg/m2/s) !! - tprecip : Total precipitation (Kg/m2/s) !! - sprecip : Solid precipitation (Kg/m2/s) !!--------------------------------------------------------------------- REAL(wp), INTENT(in), DIMENSION(jpi,jpj) :: pst ! surface temperature [Celcius] REAL(wp), INTENT(in), DIMENSION(jpi,jpj) :: pu ! surface current at U-point (i-component) [m/s] REAL(wp), INTENT(in), DIMENSION(jpi,jpj) :: pv ! surface current at V-point (j-component) [m/s] INTEGER :: ji, jj ! dummy loop indices REAL(wp) :: zcoef_qsatw REAL(wp), DIMENSION(jpi,jpj) :: zwnd_i, zwnd_j ! wind speed components at T-point REAL(wp), DIMENSION(jpi,jpj) :: zqsatw ! specific humidity at pst REAL(wp), DIMENSION(jpi,jpj) :: zqlw, zqsb ! long wave and sensible heat fluxes REAL(wp), DIMENSION(jpi,jpj) :: zqla, zevap ! latent heat fluxes and evaporation REAL(wp), DIMENSION(jpi,jpj) :: Cd ! transfer coefficient for momentum (tau) REAL(wp), DIMENSION(jpi,jpj) :: Ch ! transfer coefficient for sensible heat (Q_sens) REAL(wp), DIMENSION(jpi,jpj) :: Ce ! tansfert coefficient for evaporation (Q_lat) REAL(wp), DIMENSION(jpi,jpj) :: zst ! surface temperature in Kelvin REAL(wp), DIMENSION(jpi,jpj) :: zt_zu ! air temperature at wind speed height REAL(wp), DIMENSION(jpi,jpj) :: zq_zu ! air spec. hum. at wind speed height !!--------------------------------------------------------------------- ! local scalars ( place there for vector optimisation purposes) zcoef_qsatw = 0.98 * 640380. / rhoa zst(:,:) = pst(:,:) + rt0 ! converte Celcius to Kelvin (and set minimum value far above 0 K) ! ----------------------------------------------------------------------------- ! ! 0 Wind components and module at T-point relative to the moving ocean ! ! ----------------------------------------------------------------------------- ! ! ... components ( U10m - U_oce ) at T-point (unmasked) zwnd_i(:,:) = 0.e0 zwnd_j(:,:) = 0.e0 #if defined key_vectopt_loop !CDIR COLLAPSE #endif DO jj = 2, jpjm1 DO ji = fs_2, fs_jpim1 ! vect. opt. zwnd_i(ji,jj) = ( sf(jp_wndi)%fnow(ji,jj) - 0.5 * ( pu(ji-1,jj ) + pu(ji,jj) ) ) zwnd_j(ji,jj) = ( sf(jp_wndj)%fnow(ji,jj) - 0.5 * ( pv(ji ,jj-1) + pv(ji,jj) ) ) END DO END DO CALL lbc_lnk( zwnd_i(:,:) , 'T', -1. ) CALL lbc_lnk( zwnd_j(:,:) , 'T', -1. ) ! ... scalar wind ( = | U10m - U_oce | ) at T-point (masked) !CDIR NOVERRCHK !CDIR COLLAPSE wndm(:,:) = SQRT( zwnd_i(:,:) * zwnd_i(:,:) & & + zwnd_j(:,:) * zwnd_j(:,:) ) * tmask(:,:,1) ! ----------------------------------------------------------------------------- ! ! I Radiative FLUXES ! ! ----------------------------------------------------------------------------- ! ! ocean albedo assumed to be 0.066 !CDIR COLLAPSE qsr (:,:) = ( 1. - 0.066 ) * sf(jp_qsr)%fnow(:,:) * tmask(:,:,1) ! Short Wave !CDIR COLLAPSE zqlw(:,:) = ( sf(jp_qlw)%fnow(:,:) - Stef * zst(:,:)*zst(:,:)*zst(:,:)*zst(:,:) ) * tmask(:,:,1) ! Long Wave ! ----------------------------------------------------------------------------- ! ! II Turbulent FLUXES ! ! ----------------------------------------------------------------------------- ! ! ... specific humidity at SST and IST !CDIR NOVERRCHK !CDIR COLLAPSE zqsatw(:,:) = zcoef_qsatw * EXP( -5107.4 / zst(:,:) ) ! ... NCAR Bulk formulae, computation of Cd, Ch, Ce at T-point : IF( ln_2m ) THEN !! If air temp. and spec. hum. are given at different height (2m) than wind (10m) : CALL TURB_CORE_2Z(2.,10., zst , sf(jp_tair)%fnow, & & zqsatw, sf(jp_humi)%fnow, wndm, & & Cd , Ch , Ce , & & zt_zu , zq_zu ) ELSE !! If air temp. and spec. hum. are given at same height than wind (10m) : !gm bug? at the compiling phase, add a copy in temporary arrays... ==> check perf ! CALL TURB_CORE_1Z( 10., zst (:,:), sf(jp_tair)%fnow(:,:), & ! & zqsatw(:,:), sf(jp_humi)%fnow(:,:), wndm(:,:), & ! & Cd (:,:), Ch (:,:), Ce (:,:) ) !gm bug CALL TURB_CORE_1Z( 10., zst , sf(jp_tair)%fnow, & & zqsatw, sf(jp_humi)%fnow, wndm, & & Cd , Ch , Ce ) ENDIF ! ... utau, vtau at U- and V_points, resp. ! Note the use of 0.5*(2-umask) in order to unmask the stress along coastlines zwnd_i(:,:) = rhoa * wndm(:,:) * Cd(:,:) * zwnd_i(:,:) zwnd_j(:,:) = rhoa * wndm(:,:) * Cd(:,:) * zwnd_j(:,:) DO jj = 1, jpjm1 DO ji = 1, fs_jpim1 utau(ji,jj) = 0.5 * ( 2. - umask(ji,jj,1) ) * ( zwnd_i(ji,jj) + zwnd_i(ji+1,jj ) ) vtau(ji,jj) = 0.5 * ( 2. - vmask(ji,jj,1) ) * ( zwnd_j(ji,jj) + zwnd_j(ji ,jj+1) ) END DO END DO CALL lbc_lnk( utau(:,:), 'U', -1. ) CALL lbc_lnk( vtau(:,:), 'V', -1. ) ! Turbulent fluxes over ocean ! ----------------------------- IF( ln_2m ) THEN ! Values of temp. and hum. adjusted to 10m must be used instead of 2m values zevap(:,:) = MAX( 0.e0, rhoa *Ce(:,:)*( zqsatw(:,:) - zq_zu(:,:) ) * wndm(:,:) ) ! Evaporation zqsb (:,:) = rhoa*cpa*Ch(:,:)*( zst (:,:) - zt_zu(:,:) ) * wndm(:,:) ! Sensible Heat ELSE !CDIR COLLAPSE zevap(:,:) = MAX( 0.e0, rhoa *Ce(:,:)*( zqsatw(:,:) - sf(jp_humi)%fnow(:,:) ) * wndm(:,:) ) ! Evaporation !CDIR COLLAPSE zqsb (:,:) = rhoa*cpa*Ch(:,:)*( zst (:,:) - sf(jp_tair)%fnow(:,:) ) * wndm(:,:) ! Sensible Heat ENDIF !CDIR COLLAPSE zqla (:,:) = Lv * zevap(:,:) ! Latent Heat IF(ln_ctl) THEN CALL prt_ctl( tab2d_1=zqla , clinfo1=' blk_oce_core: zqla : ', tab2d_2=Ce , clinfo2=' Ce : ' ) CALL prt_ctl( tab2d_1=zqsb , clinfo1=' blk_oce_core: zqsb : ', tab2d_2=Ch , clinfo2=' Ch : ' ) CALL prt_ctl( tab2d_1=zqlw , clinfo1=' blk_oce_core: zqlw : ', tab2d_2=qsr, clinfo2=' qsr : ' ) CALL prt_ctl( tab2d_1=zqsatw, clinfo1=' blk_oce_core: zqsatw : ', tab2d_2=zst, clinfo2=' zst : ' ) CALL prt_ctl( tab2d_1=utau , clinfo1=' blk_oce_core: utau : ', mask1=umask, & & tab2d_2=vtau , clinfo2= ' vtau : ' , mask2=vmask ) CALL prt_ctl( tab2d_1=wndm , clinfo1=' blk_oce_core: wndm : ') CALL prt_ctl( tab2d_1=zst , clinfo1=' blk_oce_core: zst : ') ENDIF ! ----------------------------------------------------------------------------- ! ! III Total FLUXES ! ! ----------------------------------------------------------------------------- ! !CDIR COLLAPSE qns(:,:) = zqlw(:,:) - zqsb(:,:) - zqla(:,:) ! Downward Non Solar flux !CDIR COLLAPSE emp (:,:) = zevap(:,:) - sf(jp_prec)%fnow(:,:) * alpha_precip * tmask(:,:,1) !CDIR COLLAPSE emps(:,:) = zevap(:,:) - sf(jp_prec)%fnow(:,:) * alpha_precip * tmask(:,:,1) ! END SUBROUTINE blk_oce_core SUBROUTINE blk_ice_core( pst , pui , pvi , palb , & & p_taui, p_tauj, p_qns , p_qsr, & & p_qla , p_dqns, p_dqla, & & p_tpr , p_spr , & & p_fr1 , p_fr2 , cd_grid ) !!--------------------------------------------------------------------- !! *** ROUTINE blk_ice_core *** !! !! ** Purpose : provide the surface boundary condition over sea-ice !! !! ** Method : compute momentum, heat and freshwater exchanged !! between atmosphere and sea-ice using CORE bulk !! formulea, ice variables and read atmmospheric fields. !! NB: ice drag coefficient is assumed to be a constant !! !! caution : the net upward water flux has with mm/day unit !!--------------------------------------------------------------------- REAL(wp), INTENT(in ), DIMENSION(:,:,:) :: pst ! ice surface temperature (>0, =rt0 over land) [Kelvin] REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: pui ! ice surface velocity (i- and i- components [m/s] REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: pvi ! at I-point (B-grid) or U & V-point (C-grid) REAL(wp), INTENT(in ), DIMENSION(:,:,:) :: palb ! ice albedo (clear sky) (alb_ice_cs) [%] REAL(wp), INTENT( out), DIMENSION(jpi,jpj) :: p_taui ! i- & j-components of surface ice stress [N/m2] REAL(wp), INTENT( out), DIMENSION(jpi,jpj) :: p_tauj ! at I-point (B-grid) or U & V-point (C-grid) REAL(wp), INTENT( out), DIMENSION(:,:,:) :: p_qns ! non solar heat flux over ice (T-point) [W/m2] REAL(wp), INTENT( out), DIMENSION(:,:,:) :: p_qsr ! solar heat flux over ice (T-point) [W/m2] REAL(wp), INTENT( out), DIMENSION(:,:,:) :: p_qla ! latent heat flux over ice (T-point) [W/m2] REAL(wp), INTENT( out), DIMENSION(:,:,:) :: p_dqns ! non solar heat sensistivity (T-point) [W/m2] REAL(wp), INTENT( out), DIMENSION(:,:,:) :: p_dqla ! latent heat sensistivity (T-point) [W/m2] REAL(wp), INTENT( out), DIMENSION(jpi,jpj) :: p_tpr ! total precipitation (T-point) [Kg/m2/s] REAL(wp), INTENT( out), DIMENSION(jpi,jpj) :: p_spr ! solid precipitation (T-point) [Kg/m2/s] REAL(wp), INTENT( out), DIMENSION(jpi,jpj) :: p_fr1 ! 1sr fraction of qsr penetration in ice (T-point) [%] REAL(wp), INTENT( out), DIMENSION(jpi,jpj) :: p_fr2 ! 2nd fraction of qsr penetration in ice (T-point) [%] CHARACTER(len=1), INTENT(in ) :: cd_grid ! ice grid ( C or B-grid) !! INTEGER :: ji, jj, jl ! dummy loop indices INTEGER :: ijpl ! number of ice categories (size of 3rd dim of input arrays) REAL(wp) :: zst2, zst3 REAL(wp) :: zcoef_wnorm, zcoef_wnorm2, zcoef_dqlw, zcoef_dqla, zcoef_dqsb REAL(wp) :: zcoef_frca ! fractional cloud amount REAL(wp) :: zwnorm_f, zwndi_f , zwndj_f ! relative wind module and components at F-point REAL(wp) :: zwndi_t , zwndj_t ! relative wind components at T-point REAL(wp), DIMENSION(jpi,jpj) :: z_wnds_t ! wind speed ( = | U10m - U_ice | ) at T-point REAL(wp), DIMENSION(jpi,jpj,SIZE(pst,3)) :: z_qlw ! long wave heat flux over ice REAL(wp), DIMENSION(jpi,jpj,SIZE(pst,3)) :: z_qsb ! sensible heat flux over ice REAL(wp), DIMENSION(jpi,jpj,SIZE(pst,3)) :: z_dqlw ! sensible heat flux over ice REAL(wp), DIMENSION(jpi,jpj,SIZE(pst,3)) :: z_dqsb ! sensible heat flux over ice !!--------------------------------------------------------------------- ijpl = SIZE( pst, 3 ) ! number of ice categories ! local scalars ( place there for vector optimisation purposes) zcoef_wnorm = rhoa * Cice zcoef_wnorm2 = rhoa * Cice * 0.5 zcoef_dqlw = 4.0 * 0.95 * Stef zcoef_dqla = -Ls * Cice * 11637800. * (-5897.8) zcoef_dqsb = rhoa * cpa * Cice zcoef_frca = 1.0 - 0.3 !!gm brutal.... z_wnds_t(:,:) = 0.e0 p_taui (:,:) = 0.e0 p_tauj (:,:) = 0.e0 !!gm end ! ----------------------------------------------------------------------------- ! ! Wind components and module relative to the moving ocean ( U10m - U_ice ) ! ! ----------------------------------------------------------------------------- ! SELECT CASE( cd_grid ) CASE( 'B' ) ! B-grid ice dynamics : I-point (i.e. F-point with sea-ice indexation) ! and scalar wind at T-point ( = | U10m - U_ice | ) (masked) #if defined key_vectopt_loop !CDIR COLLAPSE #endif !CDIR NOVERRCHK DO jj = 2, jpjm1 DO ji = fs_2, fs_jpim1 ! ... scalar wind at I-point (fld being at T-point) zwndi_f = 0.25 * ( sf(jp_wndi)%fnow(ji-1,jj ) + sf(jp_wndi)%fnow(ji ,jj ) & & + sf(jp_wndi)%fnow(ji-1,jj-1) + sf(jp_wndi)%fnow(ji ,jj-1) ) - pui(ji,jj) zwndj_f = 0.25 * ( sf(jp_wndj)%fnow(ji-1,jj ) + sf(jp_wndj)%fnow(ji ,jj ) & & + sf(jp_wndj)%fnow(ji-1,jj-1) + sf(jp_wndj)%fnow(ji ,jj-1) ) - pvi(ji,jj) zwnorm_f = zcoef_wnorm * SQRT( zwndi_f * zwndi_f + zwndj_f * zwndj_f ) ! ... ice stress at I-point p_taui(ji,jj) = zwnorm_f * zwndi_f p_tauj(ji,jj) = zwnorm_f * zwndj_f ! ... scalar wind at T-point (fld being at T-point) zwndi_t = sf(jp_wndi)%fnow(ji,jj) - 0.25 * ( pui(ji,jj+1) + pui(ji+1,jj+1) & & + pui(ji,jj ) + pui(ji+1,jj ) ) zwndj_t = sf(jp_wndj)%fnow(ji,jj) - 0.25 * ( pvi(ji,jj+1) + pvi(ji+1,jj+1) & & + pvi(ji,jj ) + pvi(ji+1,jj ) ) z_wnds_t(ji,jj) = SQRT( zwndi_t * zwndi_t + zwndj_t * zwndj_t ) * tmask(ji,jj,1) END DO END DO CALL lbc_lnk( p_taui , 'I', -1. ) CALL lbc_lnk( p_tauj , 'I', -1. ) CALL lbc_lnk( z_wnds_t, 'T', 1. ) ! CASE( 'C' ) ! C-grid ice dynamics : U & V-points (same as ocean) #if defined key_vectopt_loop !CDIR COLLAPSE #endif DO jj = 2, jpj DO ji = fs_2, jpi ! vect. opt. zwndi_t = ( sf(jp_wndi)%fnow(ji,jj) - 0.5 * ( pui(ji-1,jj ) + pui(ji,jj) ) ) zwndj_t = ( sf(jp_wndj)%fnow(ji,jj) - 0.5 * ( pvi(ji ,jj-1) + pvi(ji,jj) ) ) z_wnds_t(ji,jj) = SQRT( zwndi_t * zwndi_t + zwndj_t * zwndj_t ) * tmask(ji,jj,1) END DO END DO #if defined key_vectopt_loop !CDIR COLLAPSE #endif DO jj = 2, jpjm1 DO ji = fs_2, fs_jpim1 ! vect. opt. p_taui(ji,jj) = zcoef_wnorm2 * ( z_wnds_t(ji+1,jj) + z_wnds_t(ji,jj) ) & & * ( 0.5 * (sf(jp_wndi)%fnow(ji+1,jj) + sf(jp_wndi)%fnow(ji,jj) ) - pui(ji,jj) ) p_tauj(ji,jj) = zcoef_wnorm2 * ( z_wnds_t(ji,jj+1) + z_wnds_t(ji,jj) ) & & * ( 0.5 * (sf(jp_wndj)%fnow(ji,jj+1) + sf(jp_wndj)%fnow(ji,jj) ) - pvi(ji,jj) ) END DO END DO CALL lbc_lnk( p_taui , 'U', -1. ) CALL lbc_lnk( p_tauj , 'V', -1. ) CALL lbc_lnk( z_wnds_t, 'T', 1. ) ! END SELECT ! ! ========================== ! DO jl = 1, ijpl ! Loop over ice categories ! ! ! ========================== ! !CDIR NOVERRCHK !CDIR COLLAPSE DO jj = 1 , jpj !CDIR NOVERRCHK DO ji = 1, jpi ! ----------------------------! ! I Radiative FLUXES ! ! ----------------------------! zst2 = pst(ji,jj,jl) * pst(ji,jj,jl) zst3 = pst(ji,jj,jl) * zst2 ! Short Wave (sw) p_qsr(ji,jj,jl) = ( 1. - palb(ji,jj,jl) ) * sf(jp_qsr)%fnow(ji,jj) * tmask(ji,jj,1) ! Long Wave (lw) z_qlw(ji,jj,jl) = 0.95 * ( sf(jp_qlw)%fnow(ji,jj) & & - Stef * pst(ji,jj,jl) * zst3 ) * tmask(ji,jj,1) ! lw sensitivity z_dqlw(ji,jj,jl) = zcoef_dqlw * zst3 ! ----------------------------! ! II Turbulent FLUXES ! ! ----------------------------! ! ... turbulent heat fluxes ! Sensible Heat z_qsb(ji,jj,jl) = rhoa * cpa * Cice * z_wnds_t(ji,jj) * ( pst(ji,jj,jl) - sf(jp_tair)%fnow(ji,jj) ) ! Latent Heat p_qla(ji,jj,jl) = MAX( 0.e0, rhoa * Ls * Cice * z_wnds_t(ji,jj) & & * ( 11637800. * EXP( -5897.8 / pst(ji,jj,jl) ) / rhoa - sf(jp_humi)%fnow(ji,jj) ) ) ! Latent heat sensitivity for ice (Dqla/Dt) p_dqla(ji,jj,jl) = zcoef_dqla * z_wnds_t(ji,jj) / ( zst2 ) * EXP( -5897.8 / pst(ji,jj,jl) ) ! Sensible heat sensitivity (Dqsb_ice/Dtn_ice) z_dqsb(ji,jj,jl) = zcoef_dqsb * z_wnds_t(ji,jj) ! ----------------------------! ! III Total FLUXES ! ! ----------------------------! ! Downward Non Solar flux p_qns (ji,jj,jl) = z_qlw (ji,jj,jl) - z_qsb (ji,jj,jl) - p_qla (ji,jj,jl) ! Total non solar heat flux sensitivity for ice p_dqns(ji,jj,jl) = - ( z_dqlw(ji,jj,jl) + z_dqsb(ji,jj,jl) + p_dqla(ji,jj,jl) ) END DO ! END DO ! END DO ! !-------------------------------------------------------------------- ! FRACTIONs of net shortwave radiation which is not absorbed in the ! thin surface layer and penetrates inside the ice cover ! ( Maykut and Untersteiner, 1971 ; Ebert and Curry, 1993 ) !CDIR COLLAPSE p_fr1(:,:) = ( 0.18 * ( 1.0 - zcoef_frca ) + 0.35 * zcoef_frca ) !CDIR COLLAPSE p_fr2(:,:) = ( 0.82 * ( 1.0 - zcoef_frca ) + 0.65 * zcoef_frca ) !CDIR COLLAPSE p_tpr(:,:) = sf(jp_prec)%fnow(:,:) * alpha_precip ! total precipitation [kg/m2/s] !CDIR COLLAPSE p_spr(:,:) = sf(jp_snow)%fnow(:,:) * alpha_precip ! solid precipitation [kg/m2/s] ! IF(ln_ctl) THEN CALL prt_ctl(tab3d_1=p_qla , clinfo1=' blk_ice_core: p_qla : ', tab3d_2=z_qsb , clinfo2=' z_qsb : ', kdim=ijpl) CALL prt_ctl(tab3d_1=z_qlw , clinfo1=' blk_ice_core: z_qlw : ', tab3d_2=p_dqla , clinfo2=' p_dqla : ', kdim=ijpl) CALL prt_ctl(tab3d_1=z_dqsb , clinfo1=' blk_ice_core: z_dqsb : ', tab3d_2=z_dqlw , clinfo2=' z_dqlw : ', kdim=ijpl) CALL prt_ctl(tab3d_1=p_dqns , clinfo1=' blk_ice_core: p_dqns : ', tab3d_2=p_qsr , clinfo2=' p_qsr : ', kdim=ijpl) CALL prt_ctl(tab3d_1=pst , clinfo1=' blk_ice_core: pst : ', tab3d_2=p_qns , clinfo2=' p_qns : ', kdim=ijpl) CALL prt_ctl(tab2d_1=p_tpr , clinfo1=' blk_ice_core: p_tpr : ', tab2d_2=p_spr , clinfo2=' p_spr : ') CALL prt_ctl(tab2d_1=p_taui , clinfo1=' blk_ice_core: p_taui : ', tab2d_2=p_tauj , clinfo2=' p_tauj : ') CALL prt_ctl(tab2d_1=z_wnds_t, clinfo1=' blk_ice_core: z_wnds_t : ') ENDIF END SUBROUTINE blk_ice_core SUBROUTINE TURB_CORE_1Z(zu, sst, T_a, q_sat, q_a, & & dU, Cd, Ch, Ce ) !!---------------------------------------------------------------------- !! *** ROUTINE turb_core *** !! !! ** Purpose : Computes turbulent transfert coefficients of surface !! fluxes according to Large & Yeager (2004) !! !! ** Method : 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 !! Momentum, Latent and sensible heat exchange coefficients !! Caution: this procedure should only be used in cases when air !! temperature (T_air), air specific humidity (q_air) and wind (dU) !! are provided at the same height 'zzu'! !! !! References : !! Large & Yeager, 2004 : ??? !! History : !! ! XX-XX (??? ) Original code !! 9.0 ! 05-08 (L. Brodeau) Rewriting and optimization !!---------------------------------------------------------------------- !! * Arguments REAL(wp), INTENT(in) :: zu ! altitude of wind measurement [m] REAL(wp), INTENT(in), DIMENSION(jpi,jpj) :: & sst, & ! sea surface temperature [Kelvin] T_a, & ! potential air temperature [Kelvin] q_sat, & ! sea surface specific humidity [kg/kg] q_a, & ! specific air humidity [kg/kg] dU ! wind module |U(zu)-U(0)| [m/s] REAL(wp), intent(out), DIMENSION(jpi,jpj) :: & Cd, & ! transfert coefficient for momentum (tau) Ch, & ! transfert coefficient for temperature (Q_sens) Ce ! transfert coefficient for evaporation (Q_lat) !! * Local declarations REAL(wp), DIMENSION(jpi,jpj) :: & dU10, & ! dU [m/s] dT, & ! air/sea temperature differeence [K] dq, & ! air/sea humidity difference [K] Cd_n10, & ! 10m neutral drag coefficient Ce_n10, & ! 10m neutral latent coefficient Ch_n10, & ! 10m neutral sensible coefficient sqrt_Cd_n10, & ! root square of Cd_n10 sqrt_Cd, & ! root square of Cd T_vpot, & ! virtual potential temperature [K] T_star, & ! turbulent scale of tem. fluct. q_star, & ! turbulent humidity of temp. fluct. U_star, & ! turb. scale of velocity fluct. L, & ! Monin-Obukov length [m] zeta, & ! stability parameter at height zu U_n10, & ! neutral wind velocity at 10m [m] xlogt, xct, zpsi_h, zpsi_m !! INTEGER :: j_itt INTEGER, PARAMETER :: nb_itt = 3 INTEGER, DIMENSION(jpi,jpj) :: & stab ! 1st guess stability test integer REAL(wp), PARAMETER :: & grav = 9.8, & ! gravity kappa = 0.4 ! von Karman s constant !! * Start !! Air/sea differences dU10 = max(0.5, dU) ! we don't want to fall under 0.5 m/s dT = T_a - sst ! assuming that T_a is allready the potential temp. at zzu dq = q_a - q_sat !! !! Virtual potential temperature T_vpot = T_a*(1. + 0.608*q_a) !! !! Neutral Drag Coefficient stab = 0.5 + sign(0.5,dT) ! stable : stab = 1 ; unstable : stab = 0 Cd_n10 = 1E-3 * ( 2.7/dU10 + 0.142 + dU10/13.09 ) ! L & Y eq. (6a) sqrt_Cd_n10 = sqrt(Cd_n10) Ce_n10 = 1E-3 * ( 34.6 * sqrt_Cd_n10 ) ! L & Y eq. (6b) Ch_n10 = 1E-3*sqrt_Cd_n10*(18*stab + 32.7*(1-stab)) ! L & Y eq. (6c), (6d) !! !! Initializing transfert coefficients with their first guess neutral equivalents : Cd = Cd_n10 ; Ce = Ce_n10 ; Ch = Ch_n10 ; sqrt_Cd = sqrt(Cd) !! * Now starting iteration loop DO j_itt=1, nb_itt !! Turbulent scales : U_star = sqrt_Cd*dU10 ! L & Y eq. (7a) T_star = Ch/sqrt_Cd*dT ! L & Y eq. (7b) q_star = Ce/sqrt_Cd*dq ! L & Y eq. (7c) !! Estimate the Monin-Obukov length : L = (U_star**2)/( kappa*grav*(T_star/T_vpot + q_star/(q_a + 1./0.608)) ) !! Stability parameters : zeta = zu/L ; zeta = sign( min(abs(zeta),10.0), zeta ) zpsi_h = psi_h(zeta) zpsi_m = psi_m(zeta) !! Shifting the wind speed to 10m and neutral stability : U_n10 = dU10*1./(1. + sqrt_Cd_n10/kappa*(log(zu/10.) - zpsi_m)) ! L & Y eq. (9a) !! Updating the neutral 10m transfer coefficients : Cd_n10 = 1E-3 * (2.7/U_n10 + 0.142 + U_n10/13.09) ! L & Y eq. (6a) sqrt_Cd_n10 = sqrt(Cd_n10) Ce_n10 = 1E-3 * (34.6 * sqrt_Cd_n10) ! L & Y eq. (6b) stab = 0.5 + sign(0.5,zeta) Ch_n10 = 1E-3*sqrt_Cd_n10*(18.*stab + 32.7*(1-stab)) ! L & Y eq. (6c), (6d) !! Shifting the neutral 10m transfer coefficients to ( zu , zeta ) : !! xct = 1. + sqrt_Cd_n10/kappa*(log(zu/10) - zpsi_m) Cd = Cd_n10/(xct*xct) ; sqrt_Cd = sqrt(Cd) !! xlogt = log(zu/10.) - zpsi_h !! xct = 1. + Ch_n10*xlogt/kappa/sqrt_Cd_n10 Ch = Ch_n10*sqrt_Cd/sqrt_Cd_n10/xct !! xct = 1. + Ce_n10*xlogt/kappa/sqrt_Cd_n10 Ce = Ce_n10*sqrt_Cd/sqrt_Cd_n10/xct !! END DO !! END SUBROUTINE TURB_CORE_1Z SUBROUTINE TURB_CORE_2Z(zt, zu, sst, T_zt, q_sat, q_zt, dU, Cd, Ch, Ce, T_zu, q_zu) !!---------------------------------------------------------------------- !! *** ROUTINE turb_core *** !! !! ** Purpose : Computes turbulent transfert coefficients of surface !! fluxes according to Large & Yeager (2004). !! !! ** Method : 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 !! Momentum, Latent and sensible heat exchange coefficients !! Caution: this procedure should only be used in cases when air !! temperature (T_air) and air specific humidity (q_air) are at 2m !! whereas wind (dU) is at 10m. !! !! References : !! Large & Yeager, 2004 : ??? !! History : !! 9.0 ! 06-12 (L. Brodeau) Original code for 2Z !!---------------------------------------------------------------------- !! * Arguments REAL(wp), INTENT(in) :: & zt, & ! height for T_zt and q_zt [m] zu ! height for dU [m] REAL(wp), INTENT(in), DIMENSION(jpi,jpj) :: & sst, & ! sea surface temperature [Kelvin] T_zt, & ! potential air temperature [Kelvin] q_sat, & ! sea surface specific humidity [kg/kg] q_zt, & ! specific air humidity [kg/kg] dU ! relative wind module |U(zu)-U(0)| [m/s] REAL(wp), INTENT(out), DIMENSION(jpi,jpj) :: & Cd, & ! transfer coefficient for momentum (tau) Ch, & ! transfer coefficient for sensible heat (Q_sens) Ce, & ! transfert coefficient for evaporation (Q_lat) T_zu, & ! air temp. shifted at zu [K] q_zu ! spec. hum. shifted at zu [kg/kg] !! * Local declarations REAL(wp), DIMENSION(jpi,jpj) :: & dU10, & ! dU [m/s] dT, & ! air/sea temperature differeence [K] dq, & ! air/sea humidity difference [K] Cd_n10, & ! 10m neutral drag coefficient Ce_n10, & ! 10m neutral latent coefficient Ch_n10, & ! 10m neutral sensible coefficient sqrt_Cd_n10, & ! root square of Cd_n10 sqrt_Cd, & ! root square of Cd T_vpot_u, & ! virtual potential temperature [K] T_star, & ! turbulent scale of tem. fluct. q_star, & ! turbulent humidity of temp. fluct. U_star, & ! turb. scale of velocity fluct. L, & ! Monin-Obukov length [m] zeta_u, & ! stability parameter at height zu zeta_t, & ! stability parameter at height zt U_n10, & ! neutral wind velocity at 10m [m] xlogt, xct, zpsi_hu, zpsi_ht, zpsi_m INTEGER :: j_itt INTEGER, PARAMETER :: nb_itt = 3 ! number of itterations INTEGER, DIMENSION(jpi,jpj) :: & & stab ! 1st stability test integer REAL(wp), PARAMETER :: & grav = 9.8, & ! gravity kappa = 0.4 ! von Karman's constant !! * Start !! Initial air/sea differences dU10 = max(0.5, dU) ! we don't want to fall under 0.5 m/s dT = T_zt - sst dq = q_zt - q_sat !! Neutral Drag Coefficient : stab = 0.5 + sign(0.5,dT) ! stab = 1 if dT > 0 -> STABLE Cd_n10 = 1E-3*( 2.7/dU10 + 0.142 + dU10/13.09 ) sqrt_Cd_n10 = sqrt(Cd_n10) Ce_n10 = 1E-3*( 34.6 * sqrt_Cd_n10 ) Ch_n10 = 1E-3*sqrt_Cd_n10*(18*stab + 32.7*(1 - stab)) !! Initializing transf. coeff. with their first guess neutral equivalents : Cd = Cd_n10 ; Ce = Ce_n10 ; Ch = Ch_n10 ; sqrt_Cd = sqrt(Cd) !! Initializing z_u values with z_t values : T_zu = T_zt ; q_zu = q_zt !! * Now starting iteration loop DO j_itt=1, nb_itt dT = T_zu - sst ; dq = q_zu - q_sat ! Updating air/sea differences T_vpot_u = T_zu*(1. + 0.608*q_zu) ! Updating virtual potential temperature at zu U_star = sqrt_Cd*dU10 ! Updating turbulent scales : (L & Y eq. (7)) T_star = Ch/sqrt_Cd*dT ! q_star = Ce/sqrt_Cd*dq ! !! L = (U_star*U_star) & ! Estimate the Monin-Obukov length at height zu & / (kappa*grav/T_vpot_u*(T_star*(1.+0.608*q_zu) + 0.608*T_zu*q_star)) !! Stability parameters : zeta_u = zu/L ; zeta_u = sign( min(abs(zeta_u),10.0), zeta_u ) zeta_t = zt/L ; zeta_t = sign( min(abs(zeta_t),10.0), zeta_t ) zpsi_hu = psi_h(zeta_u) zpsi_ht = psi_h(zeta_t) zpsi_m = psi_m(zeta_u) !! !! Shifting the wind speed to 10m and neutral stability : (L & Y eq.(9a)) ! U_n10 = dU10/(1. + sqrt_Cd_n10/kappa*(log(zu/10.) - psi_m(zeta_u))) U_n10 = dU10/(1. + sqrt_Cd_n10/kappa*(log(zu/10.) - zpsi_m)) !! !! Shifting temperature and humidity at zu : (L & Y eq. (9b-9c)) ! T_zu = T_zt - T_star/kappa*(log(zt/zu) + psi_h(zeta_u) - psi_h(zeta_t)) T_zu = T_zt - T_star/kappa*(log(zt/zu) + zpsi_hu - zpsi_ht) ! q_zu = q_zt - q_star/kappa*(log(zt/zu) + psi_h(zeta_u) - psi_h(zeta_t)) q_zu = q_zt - q_star/kappa*(log(zt/zu) + zpsi_hu - zpsi_ht) !! !! q_zu cannot have a negative value : forcing 0 stab = 0.5 + sign(0.5,q_zu) ; q_zu = stab*q_zu !! !! Updating the neutral 10m transfer coefficients : Cd_n10 = 1E-3 * (2.7/U_n10 + 0.142 + U_n10/13.09) ! L & Y eq. (6a) sqrt_Cd_n10 = sqrt(Cd_n10) Ce_n10 = 1E-3 * (34.6 * sqrt_Cd_n10) ! L & Y eq. (6b) stab = 0.5 + sign(0.5,zeta_u) Ch_n10 = 1E-3*sqrt_Cd_n10*(18.*stab + 32.7*(1-stab)) ! L & Y eq. (6c-6d) !! !! !! Shifting the neutral 10m transfer coefficients to (zu,zeta_u) : ! xct = 1. + sqrt_Cd_n10/kappa*(log(zu/10.) - psi_m(zeta_u)) xct = 1. + sqrt_Cd_n10/kappa*(log(zu/10.) - zpsi_m) Cd = Cd_n10/(xct*xct) ; sqrt_Cd = sqrt(Cd) !! ! xlogt = log(zu/10.) - psi_h(zeta_u) xlogt = log(zu/10.) - zpsi_hu !! xct = 1. + Ch_n10*xlogt/kappa/sqrt_Cd_n10 Ch = Ch_n10*sqrt_Cd/sqrt_Cd_n10/xct !! xct = 1. + Ce_n10*xlogt/kappa/sqrt_Cd_n10 Ce = Ce_n10*sqrt_Cd/sqrt_Cd_n10/xct !! !! END DO !! END SUBROUTINE TURB_CORE_2Z FUNCTION psi_m(zta) !! Psis, L & Y eq. (8c), (8d), (8e) REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: zta REAL(wp), PARAMETER :: pi = 3.141592653589793_wp REAL(wp), DIMENSION(jpi,jpj) :: psi_m REAL(wp), DIMENSION(jpi,jpj) :: X2, X, stabit X2 = sqrt(abs(1. - 16.*zta)) ; X2 = max(X2 , 1.0) ; X = sqrt(X2) stabit = 0.5 + sign(0.5,zta) psi_m = -5.*zta*stabit & ! Stable & + (1. - stabit)*(2*log((1. + X)/2) + log((1. + X2)/2) - 2*atan(X) + pi/2) ! Unstable END FUNCTION psi_m FUNCTION psi_h(zta) !! Psis, L & Y eq. (8c), (8d), (8e) REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: zta REAL(wp), DIMENSION(jpi,jpj) :: psi_h REAL(wp), DIMENSION(jpi,jpj) :: X2, X, stabit X2 = sqrt(abs(1. - 16.*zta)) ; X2 = max(X2 , 1.) ; X = sqrt(X2) stabit = 0.5 + sign(0.5,zta) psi_h = -5.*zta*stabit & ! Stable & + (1. - stabit)*(2.*log( (1. + X2)/2. )) ! Unstable END FUNCTION psi_h !!====================================================================== END MODULE sbcblk_core