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.
Changeset 12179 for NEMO/branches/2019/dev_r12072_MERGE_OPTION2_2019/src/OCE/SBC – NEMO

Ignore:
Timestamp:
2019-12-11T12:09:17+01:00 (5 years ago)
Author:
laurent
Message:

Bug fix in skin temperature! use of "tsk_m" array!

Location:
NEMO/branches/2019/dev_r12072_MERGE_OPTION2_2019/src/OCE/SBC
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_r12072_MERGE_OPTION2_2019/src/OCE/SBC/sbc_oce.F90

    r12166 r12179  
    22   !!====================================================================== 
    33   !!                       ***  MODULE  sbc_oce  *** 
    4    !! Surface module :   variables defined in core memory  
     4   !! Surface module :   variables defined in core memory 
    55   !!====================================================================== 
    66   !! History :  3.0  ! 2006-06  (G. Madec)  Original code 
     
    99   !!             -   ! 2010-11  (G. Madec) ice-ocean stress always computed at each ocean time-step 
    1010   !!            3.3  ! 2010-10  (J. Chanut, C. Bricaud)  add the surface pressure forcing 
    11    !!            4.0  ! 2012-05  (C. Rousset) add attenuation coef for use in ice model  
     11   !!            4.0  ! 2012-05  (C. Rousset) add attenuation coef for use in ice model 
    1212   !!            4.0  ! 2016-06  (L. Brodeau) new unified bulk routine (based on AeroBulk) 
    13    !!            4.0  ! 2019-03  (F. Lemarié, G. Samson) add compatibility with ABL mode     
     13   !!            4.0  ! 2019-03  (F. Lemarié, G. Samson) add compatibility with ABL mode 
    1414   !!---------------------------------------------------------------------- 
    1515 
     
    2727   PUBLIC   sbc_oce_alloc   ! routine called in sbcmod.F90 
    2828   PUBLIC   sbc_tau2wnd     ! routine called in several sbc modules 
    29     
     29 
    3030   !!---------------------------------------------------------------------- 
    3131   !!           Namelist for the Ocean Surface Boundary Condition 
     
    4545   LOGICAL , PUBLIC ::   ln_dm2dc       !: Daily mean to Diurnal Cycle short wave (qsr) 
    4646   LOGICAL , PUBLIC ::   ln_rnf         !: runoffs / runoff mouths 
    47    LOGICAL , PUBLIC ::   ln_ssr         !: Sea Surface restoring on SST and/or SSS       
     47   LOGICAL , PUBLIC ::   ln_ssr         !: Sea Surface restoring on SST and/or SSS 
    4848   LOGICAL , PUBLIC ::   ln_apr_dyn     !: Atmospheric pressure forcing used on dynamics (ocean & ice) 
    4949   INTEGER , PUBLIC ::   nn_ice         !: flag for ice in the surface boundary condition (=0/1/2/3) 
     
    5151   !                                             !: =F levitating ice (no presure effect) with mass and salt exchanges 
    5252   !                                             !: =T embedded sea-ice (pressure effect + mass and salt exchanges) 
    53    INTEGER , PUBLIC ::   nn_components  !: flag for sbc module (including sea-ice) coupling mode (see component definition below)  
    54    INTEGER , PUBLIC ::   nn_fwb         !: FreshWater Budget:  
    55    !                                             !:  = 0 unchecked  
     53   INTEGER , PUBLIC ::   nn_components  !: flag for sbc module (including sea-ice) coupling mode (see component definition below) 
     54   INTEGER , PUBLIC ::   nn_fwb         !: FreshWater Budget: 
     55   !                                             !:  = 0 unchecked 
    5656   !                                             !:  = 1 global mean of e-p-r set to zero at each nn_fsbc time step 
    5757   !                                             !:  = 2 annual global mean of e-p-r set to zero 
     
    8181   INTEGER , PUBLIC, PARAMETER ::   jp_purecpl = 5        !: Pure ocean-atmosphere Coupled formulation 
    8282   INTEGER , PUBLIC, PARAMETER ::   jp_none    = 6        !: for OPA when doing coupling via SAS module 
    83     
    84    !!---------------------------------------------------------------------- 
    85    !!           Stokes drift parametrization definition  
     83 
     84   !!---------------------------------------------------------------------- 
     85   !!           Stokes drift parametrization definition 
    8686   !!---------------------------------------------------------------------- 
    8787   INTEGER , PUBLIC, PARAMETER ::   jp_breivik_2014 = 0     !: Breivik  2014: v_z=v_0*[exp(2*k*z)/(1-8*k*z)] 
    88    INTEGER , PUBLIC, PARAMETER ::   jp_li_2017      = 1     !: Li et al 2017: Stokes drift based on Phillips spectrum (Breivik 2016)  
    89                                                             !  with depth averaged profile 
    90    INTEGER , PUBLIC, PARAMETER ::   jp_peakfr       = 2     !: Li et al 2017: using the peak wave number read from wave model instead  
    91                                                             !  of the inverse depth scale 
     88   INTEGER , PUBLIC, PARAMETER ::   jp_li_2017      = 1     !: Li et al 2017: Stokes drift based on Phillips spectrum (Breivik 2016) 
     89   !  with depth averaged profile 
     90   INTEGER , PUBLIC, PARAMETER ::   jp_peakfr       = 2     !: Li et al 2017: using the peak wave number read from wave model instead 
     91   !  of the inverse depth scale 
    9292   LOGICAL , PUBLIC            ::   ll_st_bv2014  = .FALSE. !  logical indicator, .true. if Breivik 2014 parameterisation is active. 
    9393   LOGICAL , PUBLIC            ::   ll_st_li2017  = .FALSE. !  logical indicator, .true. if Li 2017 parameterisation is active. 
     
    9898   !!           component definition 
    9999   !!---------------------------------------------------------------------- 
    100    INTEGER , PUBLIC, PARAMETER ::   jp_iam_nemo = 0      !: Initial single executable configuration  
    101                                                          !  (no internal OASIS coupling) 
     100   INTEGER , PUBLIC, PARAMETER ::   jp_iam_nemo = 0      !: Initial single executable configuration 
     101   !  (no internal OASIS coupling) 
    102102   INTEGER , PUBLIC, PARAMETER ::   jp_iam_opa  = 1      !: Multi executable configuration - OPA component 
    103                                                          !  (internal OASIS coupling) 
     103   !  (internal OASIS coupling) 
    104104   INTEGER , PUBLIC, PARAMETER ::   jp_iam_sas  = 2      !: Multi executable configuration - SAS component 
    105                                                          !  (internal OASIS coupling) 
     105   !  (internal OASIS coupling) 
    106106   !!---------------------------------------------------------------------- 
    107107   !!              Ocean Surface Boundary Condition fields 
     
    112112   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   utau   , utau_b   !: sea surface i-stress (ocean referential)     [N/m2] 
    113113   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   vtau   , vtau_b   !: sea surface j-stress (ocean referential)     [N/m2] 
    114    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   taum              !: module of sea surface stress (at T-point)    [N/m2]  
     114   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   taum              !: module of sea surface stress (at T-point)    [N/m2] 
    115115   !! wndm is used compute surface gases exchanges in ice-free ocean or leads 
    116116   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   wndm              !: wind speed module at T-point (=|U10m-Uoce|)  [m/s] 
    117    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   rhoa              !: air density at "rn_zu" m above the sea       [kg/m3] !LB 
     117   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   rhoa              !: air density at "rn_zu" m above the sea       [kg/m3] 
    118118   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   qsr               !: sea heat flux:     solar                     [W/m2] 
    119119   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   qns    , qns_b    !: sea heat flux: non solar                     [W/m2] 
     
    124124   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   emp_tot           !: total E-P over ocean and ice                 [Kg/m2/s] 
    125125   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fmmflx            !: freshwater budget: freezing/melting          [Kg/m2/s] 
    126    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   rnf    , rnf_b    !: river runoff                                 [Kg/m2/s]   
    127    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fwficb , fwficb_b !: iceberg melting                              [Kg/m2/s]   
     126   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   rnf    , rnf_b    !: river runoff                                 [Kg/m2/s] 
     127   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fwficb , fwficb_b !: iceberg melting                              [Kg/m2/s] 
    128128   !! 
    129129   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::  sbc_tsc, sbc_tsc_b  !: sbc content trend                      [K.m/s] jpi,jpj,jpts 
     
    138138 
    139139   !!--------------------------------------------------------------------- 
    140    !! ABL Vertical Domain size   
     140   !! ABL Vertical Domain size 
    141141   !!--------------------------------------------------------------------- 
    142142   INTEGER , PUBLIC            ::   jpka   = 2     !: ABL number of vertical levels (default definition) 
     
    154154   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sss_m     !: mean (nn_fsbc time-step) surface sea salinity            [psu] 
    155155   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   ssh_m     !: mean (nn_fsbc time-step) sea surface height                [m] 
     156   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   tsk_m     !: mean (nn_fsbc time-step) SKIN surface sea temperature      [K] 
    156157   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   e3t_m     !: mean (nn_fsbc time-step) sea surface layer thickness       [m] 
    157158   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   frq_m     !: mean (nn_fsbc time-step) fraction of solar net radiation absorbed in the 1st T level [-] 
     
    175176      ! 
    176177      ALLOCATE( utau(jpi,jpj) , utau_b(jpi,jpj) , taum(jpi,jpj) ,     & 
    177          &      vtau(jpi,jpj) , vtau_b(jpi,jpj) , wndm(jpi,jpj) , rhoa(jpi,jpj) , STAT=ierr(1) )  
    178          ! 
     178         &      vtau(jpi,jpj) , vtau_b(jpi,jpj) , wndm(jpi,jpj) , rhoa(jpi,jpj) , STAT=ierr(1) ) 
     179      ! 
    179180      ALLOCATE( qns_tot(jpi,jpj) , qns  (jpi,jpj) , qns_b(jpi,jpj),        & 
    180181         &      qsr_tot(jpi,jpj) , qsr  (jpi,jpj) ,                        & 
    181182         &      emp    (jpi,jpj) , emp_b(jpi,jpj) ,                        & 
    182183         &      sfx    (jpi,jpj) , sfx_b(jpi,jpj) , emp_tot(jpi,jpj), fmmflx(jpi,jpj), STAT=ierr(2) ) 
    183          ! 
     184      ! 
    184185      ALLOCATE( rnf  (jpi,jpj) , sbc_tsc  (jpi,jpj,jpts) , qsr_hc  (jpi,jpj,jpk) ,  & 
    185186         &      rnf_b(jpi,jpj) , sbc_tsc_b(jpi,jpj,jpts) , qsr_hc_b(jpi,jpj,jpk) ,  & 
    186187         &      fwficb  (jpi,jpj), fwficb_b(jpi,jpj), STAT=ierr(3) ) 
    187          ! 
     188      ! 
    188189      ALLOCATE( tprecip(jpi,jpj) , sprecip(jpi,jpj) , fr_i(jpi,jpj) ,     & 
    189          &      atm_co2(jpi,jpj) ,                                        & 
     190         &      atm_co2(jpi,jpj) , tsk_m(jpi,jpj) ,                       & 
    190191         &      ssu_m  (jpi,jpj) , sst_m(jpi,jpj) , frq_m(jpi,jpj) ,      & 
    191192         &      ssv_m  (jpi,jpj) , sss_m(jpi,jpj) , ssh_m(jpi,jpj) , STAT=ierr(4) ) 
     
    203204      !!--------------------------------------------------------------------- 
    204205      !!                    ***  ROUTINE sbc_tau2wnd  *** 
    205       !!                    
    206       !! ** Purpose : Estimation of wind speed as a function of wind stress    
     206      !! 
     207      !! ** Purpose : Estimation of wind speed as a function of wind stress 
    207208      !! 
    208209      !! ** Method  : |tau|=rhoa*Cd*|U|^2 
     
    215216      INTEGER  ::   ji, jj                ! dummy indices 
    216217      !!--------------------------------------------------------------------- 
    217       zcoef = 0.5 / ( zrhoa * zcdrag )  
     218      zcoef = 0.5 / ( zrhoa * zcdrag ) 
    218219      DO jj = 2, jpjm1 
    219220         DO ji = fs_2, fs_jpim1   ! vect. opt. 
    220             ztx = utau(ji-1,jj  ) + utau(ji,jj)  
    221             zty = vtau(ji  ,jj-1) + vtau(ji,jj)  
     221            ztx = utau(ji-1,jj  ) + utau(ji,jj) 
     222            zty = vtau(ji  ,jj-1) + vtau(ji,jj) 
    222223            ztau = SQRT( ztx * ztx + zty * zty ) 
    223224            wndm(ji,jj) = SQRT ( ztau * zcoef ) * tmask(ji,jj,1) 
  • NEMO/branches/2019/dev_r12072_MERGE_OPTION2_2019/src/OCE/SBC/sbcblk.F90

    r12155 r12179  
    434434            &                sf(jp_slp )%fnow(:,:,1), sst_m, ssu_m, ssv_m,       &   !   <<= in 
    435435            &                sf(jp_qsr )%fnow(:,:,1), sf(jp_qlw )%fnow(:,:,1),   &   !   <<= in (wl/cs) 
    436             &                zssq, zcd_du, zsen, zevp )                              !   =>> out 
     436            &                tsk_m, zssq, zcd_du, zsen, zevp )                       !   =>> out 
    437437 
    438438         CALL blk_oce_2(     sf(jp_tair)%fnow(:,:,1), sf(jp_qsr )%fnow(:,:,1),   &   !   <<= in 
    439439            &                sf(jp_qlw )%fnow(:,:,1), sf(jp_prec)%fnow(:,:,1),   &   !   <<= in 
    440             &                sf(jp_snow)%fnow(:,:,1), sst_m,                     &   !   <<= in 
     440            &                sf(jp_snow)%fnow(:,:,1), tsk_m,                     &   !   <<= in 
    441441            &                zsen, zevp )                                            !   <=> in out 
    442442      ENDIF 
     
    472472 
    473473   SUBROUTINE blk_oce_1( kt, pwndi, pwndj , ptair, phumi, &  ! inp 
    474       &              pslp , pst   , pu   , pv,    &  ! inp 
    475       &              pqsr , pqlw  ,               &  ! inp 
    476       &              pssq , pcd_du, psen , pevp   )  ! out 
     474      &                  pslp , pst   , pu   , pv,        &  ! inp 
     475      &                  pqsr , pqlw  ,                   &  ! inp 
     476      &                  ptsk, pssq , pcd_du, psen , pevp   )  ! out 
    477477      !!--------------------------------------------------------------------- 
    478478      !!                     ***  ROUTINE blk_oce_1  *** 
     
    501501      REAL(wp), INTENT(in   ), DIMENSION(:,:) ::   pqsr   ! 
    502502      REAL(wp), INTENT(in   ), DIMENSION(:,:) ::   pqlw   ! 
     503      REAL(wp), INTENT(  out), DIMENSION(:,:) ::   ptsk   ! skin temp. (or SST if CS & WL not used)  [K] 
    503504      REAL(wp), INTENT(  out), DIMENSION(:,:) ::   pssq   ! specific humidity at pst                 [kg/kg] 
    504505      REAL(wp), INTENT(  out), DIMENSION(:,:) ::   pcd_du ! Cd x |dU| at T-points                    [m/s] 
     
    509510      REAL(wp) ::   zztmp                ! local variable 
    510511      REAL(wp), DIMENSION(jpi,jpj) ::   zwnd_i, zwnd_j    ! wind speed components at T-point 
    511       REAL(wp), DIMENSION(jpi,jpj) ::   zst               ! surface temperature in Kelvin 
    512512      REAL(wp), DIMENSION(jpi,jpj) ::   zU_zu             ! bulk wind speed at height zu  [m/s] 
    513513      REAL(wp), DIMENSION(jpi,jpj) ::   ztpot             ! potential temperature of air at z=rn_zqt [K] 
     
    521521      ! 
    522522      ! local scalars ( place there for vector optimisation purposes) 
    523       zst(:,:) = pst(:,:) + rt0      ! convert SST from Celcius to Kelvin (and set minimum value far above 0 K) 
     523      !                            ! convert "bulk SST" from Celcius to Kelvin (and set minimum value far above 0 K) 
     524      ptsk(:,:) = pst(:,:) + rt0    ! by default, skin temperature = "bulk SST" (will remain this way if NCAR algorithm used!) 
    524525 
    525526      ! ----------------------------------------------------------------------------- ! 
     
    568569 
    569570      ! specific humidity at SST 
    570       pssq(:,:) = rdct_qsat_salt * q_sat( zst(:,:), pslp(:,:) ) 
     571      pssq(:,:) = rdct_qsat_salt * q_sat( ptsk(:,:), pslp(:,:) ) 
    571572 
    572573      IF( ln_skin_cs .OR. ln_skin_wl ) THEN 
    573          zztmp1(:,:) = zst(:,:) 
     574         !! Backup "bulk SST" and associated spec. hum. 
     575         zztmp1(:,:) = ptsk(:,:) 
    574576         zztmp2(:,:) = pssq(:,:) 
    575577      ENDIF 
     
    610612 
    611613      CASE( np_NCAR      ) 
    612          CALL turb_ncar    ( rn_zqt, rn_zu, zst, ztpot, pssq, zqair, wndm,                              & 
     614         CALL turb_ncar    ( rn_zqt, rn_zu, ptsk, ztpot, pssq, zqair, wndm,                              & 
    613615            &                zcd_oce, zch_oce, zce_oce, t_zu, q_zu, zU_zu, cdn_oce, chn_oce, cen_oce ) 
    614616 
    615617      CASE( np_COARE_3p0 ) 
    616          CALL turb_coare3p0 ( kt, rn_zqt, rn_zu, zst, ztpot, pssq, zqair, wndm, ln_skin_cs, ln_skin_wl, & 
     618         CALL turb_coare3p0 ( kt, rn_zqt, rn_zu, ptsk, ztpot, pssq, zqair, wndm, ln_skin_cs, ln_skin_wl, & 
    617619            &                zcd_oce, zch_oce, zce_oce, t_zu, q_zu, zU_zu, cdn_oce, chn_oce, cen_oce,   & 
    618620            &                Qsw=qsr(:,:), rad_lw=pqlw(:,:), slp=pslp(:,:) ) 
    619621 
    620622      CASE( np_COARE_3p6 ) 
    621          CALL turb_coare3p6 ( kt, rn_zqt, rn_zu, zst, ztpot, pssq, zqair, wndm, ln_skin_cs, ln_skin_wl, & 
     623         CALL turb_coare3p6 ( kt, rn_zqt, rn_zu, ptsk, ztpot, pssq, zqair, wndm, ln_skin_cs, ln_skin_wl, & 
    622624            &                zcd_oce, zch_oce, zce_oce, t_zu, q_zu, zU_zu, cdn_oce, chn_oce, cen_oce,   & 
    623625            &                Qsw=qsr(:,:), rad_lw=pqlw(:,:), slp=pslp(:,:) ) 
    624626 
    625627      CASE( np_ECMWF     ) 
    626          CALL turb_ecmwf   ( kt, rn_zqt, rn_zu, zst, ztpot, pssq, zqair, wndm, ln_skin_cs, ln_skin_wl,  & 
     628         CALL turb_ecmwf   ( kt, rn_zqt, rn_zu, ptsk, ztpot, pssq, zqair, wndm, ln_skin_cs, ln_skin_wl,  & 
    627629            &                zcd_oce, zch_oce, zce_oce, t_zu, q_zu, zU_zu, cdn_oce, chn_oce, cen_oce,   & 
    628630            &                Qsw=qsr(:,:), rad_lw=pqlw(:,:), slp=pslp(:,:) ) 
     
    634636 
    635637      IF( ln_skin_cs .OR. ln_skin_wl ) THEN 
    636          !! In the presence of sea-ice we forget about the cool-skin/warm-layer update of zst and pssq: 
    637          WHERE ( fr_i < 0.001_wp ) 
    638             ! zst and pssq have been updated by cool-skin/warm-layer scheme and we keep it!!! 
    639             zst(:,:)  =  zst(:,:)*tmask(:,:,1) 
     638         !! ptsk and pssq have been updated!!! 
     639         !! 
     640         !! In the presence of sea-ice we forget about the cool-skin/warm-layer update of ptsk and pssq: 
     641         WHERE ( fr_i(:,:) > 0.001_wp ) 
     642            ! sea-ice present, we forget about the update, using what we backed up before call to turb_*() 
     643            ptsk(:,:) = zztmp1(:,:) 
     644            pssq(:,:) = zztmp2(:,:) 
     645         ELSEWHERE 
     646            ! no sea-ice! 
     647            ! ptsk and zsq have been updated by cool-skin/warm-layer scheme and we keep them !!! 
     648            ptsk(:,:) = ptsk(:,:)*tmask(:,:,1) 
    640649            pssq(:,:) = pssq(:,:)*tmask(:,:,1) 
    641          ELSEWHERE 
    642             ! we forget about the update... 
    643             zst(:,:)  = zztmp1(:,:) !#LB: using what we backed up before skin-algo 
    644             pssq(:,:) = zztmp2(:,:) !#LB:  "   "   " 
    645650         END WHERE 
    646651      END IF 
     
    671676         END DO 
    672677      ELSE                      !==  BLK formulation  ==!   turbulent fluxes computation 
    673          CALL BULK_FORMULA( rn_zu, zst(:,:), pssq(:,:), t_zu(:,:), q_zu(:,:), & 
     678         CALL BULK_FORMULA( rn_zu, ptsk(:,:), pssq(:,:), t_zu(:,:), q_zu(:,:), & 
    674679            &               zcd_oce(:,:), zch_oce(:,:), zce_oce(:,:),         & 
    675680            &               wndm(:,:), zU_zu(:,:), pslp(:,:),                 & 
     
    709714         ENDIF 
    710715         ! 
    711       ENDIF 
    712       ! 
     716      ENDIF !IF( ln_abl ) 
     717 
     718      IF( ln_skin_cs .OR. ln_skin_wl ) THEN 
     719         CALL iom_put( "t_skin" ,  (ptsk -  rt0)      * tmask(:,:,1) )  ! T_skin in Celsius 
     720         CALL iom_put( "dt_skin" , (ptsk - pst - rt0) * tmask(:,:,1) )  ! T_skin - SST temperature difference... 
     721      ENDIF 
     722 
    713723      IF(ln_ctl) THEN 
    714724         CALL prt_ctl( tab2d_1=pevp  , clinfo1=' blk_oce_1: pevp   : ' ) 
     
    721731 
    722732   SUBROUTINE blk_oce_2( ptair, pqsr, pqlw, pprec,   &   ! <<= in 
    723       &          psnow, pst , psen, pevp     )   ! <<= in 
     733      &                  psnow, ptsk , psen, pevp     )  ! <<= in 
    724734      !!--------------------------------------------------------------------- 
    725735      !!                     ***  ROUTINE blk_oce_2  *** 
     
    742752      REAL(wp), INTENT(in), DIMENSION(:,:) ::   pprec 
    743753      REAL(wp), INTENT(in), DIMENSION(:,:) ::   psnow 
    744       REAL(wp), INTENT(in), DIMENSION(:,:) ::   pst   ! surface temperature                      [Celcius] 
     754      REAL(wp), INTENT(in), DIMENSION(:,:) ::   ptsk   ! SKIN surface temperature   [K] 
    745755      REAL(wp), INTENT(in), DIMENSION(:,:) ::   psen 
    746756      REAL(wp), INTENT(in), DIMENSION(:,:) ::   pevp 
     
    750760      REAL(wp), DIMENSION(jpi,jpj) ::   zqlw              ! long wave and sensible heat fluxes 
    751761      REAL(wp), DIMENSION(jpi,jpj) ::   zqla              ! latent heat fluxes and evaporation 
    752       REAL(wp), DIMENSION(jpi,jpj) ::   zst               ! surface temperature in Kelvin 
    753762      !!--------------------------------------------------------------------- 
    754763      ! 
    755764      ! local scalars ( place there for vector optimisation purposes) 
    756       zst(:,:) = pst(:,:) + rt0      ! convert SST from Celcius to Kelvin (and set minimum value far above 0 K) 
    757765 
    758766 
     
    762770 
    763771      !! LB: now moved after Turbulent fluxes because must use the skin temperature rather that the SST 
    764       !! (zst is skin temperature if ln_skin_cs==.TRUE. .OR. ln_skin_wl==.TRUE.) 
    765       zqlw(:,:) = emiss_w * ( pqlw(:,:) - stefan*zst(:,:)*zst(:,:)*zst(:,:)*zst(:,:) ) * tmask(:,:,1)   ! Net radiative longwave flux 
    766  
    767       !  Turbulent fluxes over ocean 
    768       ! ----------------------------- 
     772      !! (ptsk is skin temperature if ln_skin_cs==.TRUE. .OR. ln_skin_wl==.TRUE.) 
     773      zqlw(:,:) = emiss_w * ( pqlw(:,:) - stefan*ptsk(:,:)*ptsk(:,:)*ptsk(:,:)*ptsk(:,:) ) * tmask(:,:,1)   ! Net radiative longwave flux 
     774 
     775      !  Latent flux over ocean 
     776      ! ----------------------- 
    769777 
    770778      ! use scalar version of L_vap() for AGRIF compatibility 
    771779      DO jj = 1, jpj 
    772780         DO ji = 1, jpi 
    773             zqla(ji,jj) = L_vap( zst(ji,jj) ) * pevp(ji,jj) * -1._wp    ! Latent Heat flux !!GS: possibility to add a global qla to avoid recomputation after abl update 
     781            zqla(ji,jj) = L_vap( ptsk(ji,jj) ) * pevp(ji,jj) * -1._wp    ! Latent Heat flux !!GS: possibility to add a global qla to avoid recomputation after abl update 
    774782         ENDDO 
    775783      ENDDO 
     
    790798      qns(:,:) = zqlw(:,:) + psen(:,:) + zqla(:,:)                   &   ! Downward Non Solar 
    791799         &     - psnow(:,:) * rn_pfac * rLfus                        &   ! remove latent melting heat for solid precip 
    792          &     - pevp(:,:) * pst(:,:) * rcp                          &   ! remove evap heat content at SST !LB??? pst is Celsius !? 
     800         &     - pevp(:,:) * (ptsk(:,:) -rt0) * rcp                          &   ! remove evap heat content at SST !LB??? ptsk is Celsius !? 
    793801         &     + ( pprec(:,:) - psnow(:,:) ) * rn_pfac               &   ! add liquid precip heat content at Tair 
    794802         &     * ( ptair(:,:) - rt0 ) * rcp                          & 
     
    817825         CALL iom_put( "qsr_oce"  ,   qsr  )               ! output downward solar heat over the ocean 
    818826         CALL iom_put( "qt_oce"   ,   qns+qsr )            ! output total downward heat over the ocean 
    819       ENDIF 
    820       ! 
    821       IF( ln_skin_cs .OR. ln_skin_wl ) THEN 
    822          CALL iom_put( "t_skin" ,  (zst - rt0) * tmask(:,:,1) )           ! T_skin in Celsius 
    823          CALL iom_put( "dt_skin" , (zst - pst - rt0) * tmask(:,:,1) )     ! T_skin - SST temperature difference... 
    824827      ENDIF 
    825828      ! 
     
    11071110 
    11081111      IF( iom_use('evap_ao_cea') .OR. iom_use('hflx_evap_cea') ) THEN 
    1109          ztmp(:,:) = zevap(:,:) * ( 1._wp - at_i_b(:,:) )  
     1112         ztmp(:,:) = zevap(:,:) * ( 1._wp - at_i_b(:,:) ) 
    11101113         IF( iom_use('evap_ao_cea'  ) )  CALL iom_put( 'evap_ao_cea'  , ztmp(:,:) * tmask(:,:,1) )   ! ice-free oce evap (cell average) 
    11111114         IF( iom_use('hflx_evap_cea') )  CALL iom_put( 'hflx_evap_cea', ztmp(:,:) * sst_m(:,:) * rcp * tmask(:,:,1) )   ! heat flux from evap (cell average) 
     
    11161119      ENDIF 
    11171120      IF( iom_use('hflx_snow_cea') .OR. iom_use('hflx_snow_ao_cea') .OR. iom_use('hflx_snow_ai_cea')  )  THEN 
    1118           WHERE( SUM( a_i_b, dim=3 ) > 1.e-10 ) ;   ztmp(:,:) = rcpi * SUM( (ptsu-rt0) * a_i_b, dim=3 ) / SUM( a_i_b, dim=3 ) 
    1119           ELSEWHERE                             ;   ztmp(:,:) = rcp * sst_m(:,:)     
    1120           ENDWHERE 
    1121           ztmp2(:,:) = sprecip(:,:) * ( ztmp(:,:) - rLfus )  
    1122           IF( iom_use('hflx_snow_cea')    ) CALL iom_put('hflx_snow_cea'   , ztmp2(:,:) ) ! heat flux from snow (cell average) 
    1123           IF( iom_use('hflx_snow_ao_cea') ) CALL iom_put('hflx_snow_ao_cea', ztmp2(:,:) * ( 1._wp - zsnw(:,:) ) ) ! heat flux from snow (over ocean) 
    1124           IF( iom_use('hflx_snow_ai_cea') ) CALL iom_put('hflx_snow_ai_cea', ztmp2(:,:) *           zsnw(:,:)   ) ! heat flux from snow (over ice) 
     1121         WHERE( SUM( a_i_b, dim=3 ) > 1.e-10 ) 
     1122            ztmp(:,:) = rcpi * SUM( (ptsu-rt0) * a_i_b, dim=3 ) / SUM( a_i_b, dim=3 ) 
     1123         ELSEWHERE 
     1124            ztmp(:,:) = rcp * sst_m(:,:) 
     1125         ENDWHERE 
     1126         ztmp2(:,:) = sprecip(:,:) * ( ztmp(:,:) - rLfus ) 
     1127         IF( iom_use('hflx_snow_cea')    ) CALL iom_put('hflx_snow_cea'   , ztmp2(:,:) ) ! heat flux from snow (cell average) 
     1128         IF( iom_use('hflx_snow_ao_cea') ) CALL iom_put('hflx_snow_ao_cea', ztmp2(:,:) * ( 1._wp - zsnw(:,:) ) ) ! heat flux from snow (over ocean) 
     1129         IF( iom_use('hflx_snow_ai_cea') ) CALL iom_put('hflx_snow_ai_cea', ztmp2(:,:) *           zsnw(:,:)   ) ! heat flux from snow (over ice) 
    11251130      ENDIF 
    11261131      ! 
Note: See TracChangeset for help on using the changeset viewer.