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 6225 for branches/2014/dev_r4704_NOC5_MPP_BDY_UPDATE/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_lim_2.F90 – NEMO

Ignore:
Timestamp:
2016-01-08T10:35:19+01:00 (8 years ago)
Author:
jamesharle
Message:

Update MPP_BDY_UPDATE branch to be consistent with head of trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2014/dev_r4704_NOC5_MPP_BDY_UPDATE/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_lim_2.F90

    r4621 r6225  
    5454# endif 
    5555 
     56#if defined key_bdy  
     57   USE bdyice_lim       ! unstructured open boundary data  (bdy_ice_lim routine) 
     58#endif 
     59 
    5660   IMPLICIT NONE 
    5761   PRIVATE 
     
    6064 
    6165   !! * Substitutions 
    62 #  include "domzgr_substitute.h90" 
    6366#  include "vectopt_loop_substitute.h90" 
    6467   !!---------------------------------------------------------------------- 
     
    9396      !! 
    9497      INTEGER  ::   ji, jj   ! dummy loop indices 
    95       REAL(wp), DIMENSION(:,:,:), POINTER :: zalb_ice_os   ! albedo of the ice under overcast sky 
    96       REAL(wp), DIMENSION(:,:,:), POINTER :: zalb_ice_cs   ! albedo of ice under clear sky 
    97       REAL(wp), DIMENSION(:,:,:), POINTER :: zsist         ! surface ice temperature (K) 
     98      REAL(wp), DIMENSION(:,:,:), POINTER :: zalb_os   ! ice albedo under overcast sky 
     99      REAL(wp), DIMENSION(:,:,:), POINTER :: zalb_cs   ! ice albedo under clear sky 
     100      REAL(wp), DIMENSION(:,:,:), POINTER :: zalb_ice  ! mean ice albedo 
     101      REAL(wp), DIMENSION(:,:,:), POINTER :: zsist     ! ice surface temperature (K) 
     102      REAL(wp), DIMENSION(:,:  ), POINTER :: zutau_ice, zvtau_ice  
    98103      !!---------------------------------------------------------------------- 
    99  
    100       CALL wrk_alloc( jpi,jpj,1, zalb_ice_os, zalb_ice_cs, zsist ) 
    101104 
    102105      IF( kt == nit000 ) THEN 
     
    119122         &*Agrif_PArent(nn_fsbc)/REAL(nn_fsbc)) + 1 
    120123# endif 
     124 
     125         CALL wrk_alloc( jpi,jpj  , zutau_ice, zvtau_ice) 
     126         CALL wrk_alloc( jpi,jpj,1, zalb_os, zalb_cs, zalb_ice, zsist ) 
     127 
    121128         !  Bulk Formulea ! 
    122129         !----------------! 
     
    126133            DO jj = 2, jpj 
    127134               DO ji = 2, jpi   ! NO vector opt. possible 
    128                   u_oce(ji,jj) = 0.5_wp * ( ssu_m(ji-1,jj  ) + ssu_m(ji-1,jj-1) ) * tmu(ji,jj) 
    129                   v_oce(ji,jj) = 0.5_wp * ( ssv_m(ji  ,jj-1) + ssv_m(ji-1,jj-1) ) * tmu(ji,jj) 
     135                  u_oce(ji,jj) = 0.5_wp * ( ssu_m(ji-1,jj  ) * umask(ji-1,jj  ,1) & 
     136                     &                    + ssu_m(ji-1,jj-1) * umask(ji-1,jj-1,1) ) * tmu(ji,jj) 
     137                  v_oce(ji,jj) = 0.5_wp * ( ssv_m(ji  ,jj-1) * vmask(ji  ,jj-1,1) & 
     138                     &                    + ssv_m(ji-1,jj-1) * vmask(ji-1,jj-1,1) ) * tmu(ji,jj) 
    130139               END DO 
    131140            END DO 
     
    134143            ! 
    135144         CASE( 'C' )                  !== C-grid ice dynamics :   U & V-points (same as ocean) 
    136             u_oce(:,:) = ssu_m(:,:)                     ! mean surface ocean current at ice velocity point 
    137             v_oce(:,:) = ssv_m(:,:) 
     145            u_oce(:,:) = ssu_m(:,:) * umask(:,:,1)                     ! mean surface ocean current at ice velocity point 
     146            v_oce(:,:) = ssv_m(:,:) * vmask(:,:,1) 
    138147            ! 
    139148         END SELECT 
    140149 
    141150         ! ... masked sea surface freezing temperature [Kelvin] (set to rt0 over land) 
    142          tfu(:,:) = tfreez( sss_m ) +  rt0  
     151         CALL eos_fzp( sss_m(:,:), tfu(:,:) ) 
     152         tfu(:,:) = tfu(:,:) + rt0 
    143153 
    144154         zsist (:,:,1) = sist (:,:) + rt0 * ( 1. - tmask(:,:,1) ) 
    145155 
    146          ! ... ice albedo (clear sky and overcast sky) 
     156         ! Ice albedo 
     157 
    147158         CALL albedo_ice( zsist, reshape( hicif, (/jpi,jpj,1/) ), & 
    148159                                 reshape( hsnif, (/jpi,jpj,1/) ), & 
    149                           zalb_ice_cs, zalb_ice_os ) 
     160                          zalb_cs, zalb_os ) 
     161 
     162         SELECT CASE( ksbc ) 
     163         CASE( jp_core , jp_purecpl )   ! CORE and COUPLED bulk formulations 
     164 
     165            ! albedo depends on cloud fraction because of non-linear spectral effects 
     166            zalb_ice(:,:,:) = ( 1. - cldf_ice ) * zalb_cs(:,:,:) + cldf_ice * zalb_os(:,:,:) 
     167            ! In CLIO the cloud fraction is read in the climatology and the all-sky albedo  
     168            ! (zalb_ice) is computed within the bulk routine 
     169 
     170         END SELECT 
    150171 
    151172         ! ... Sea-ice surface boundary conditions output from bulk formulae : 
     
    163184         ! 
    164185         SELECT CASE( ksbc ) 
    165          CASE( 3 )           ! CLIO bulk formulation 
    166             CALL blk_ice_clio( zsist, zalb_ice_cs, zalb_ice_os,                         & 
    167                &                      utau_ice   , vtau_ice   , qns_ice    , qsr_ice,   & 
    168                &                      qla_ice    , dqns_ice   , dqla_ice   ,            & 
    169                &                      tprecip    , sprecip    ,                         & 
    170                &                      fr1_i0     , fr2_i0     , cp_ice_msh , jpl  ) 
    171  
    172          CASE( 4 )           ! CORE bulk formulation 
    173             CALL blk_ice_core( zsist, u_ice      , v_ice      , zalb_ice_cs,            & 
    174                &                      utau_ice   , vtau_ice   , qns_ice    , qsr_ice,   & 
    175                &                      qla_ice    , dqns_ice   , dqla_ice   ,            & 
    176                &                      tprecip    , sprecip    ,                         & 
    177                &                      fr1_i0     , fr2_i0     , cp_ice_msh , jpl  ) 
    178             IF( ltrcdm2dc_ice )   CALL blk_ice_meanqsr( zalb_ice_cs, qsr_ice_mean, jpl ) 
    179  
    180          CASE( 5 )           ! Coupled formulation : atmosphere-ice stress only (fluxes provided after ice dynamics) 
     186         CASE( jp_clio )           ! CLIO bulk formulation 
     187!           CALL blk_ice_clio( zsist, zalb_cs    , zalb_os    , zalb_ice   ,            & 
     188!              &                      utau_ice   , vtau_ice   , qns_ice    , qsr_ice,   & 
     189!              &                      qla_ice    , dqns_ice   , dqla_ice   ,            & 
     190!              &                      tprecip    , sprecip    ,                         & 
     191!              &                      fr1_i0     , fr2_i0     , cp_ice_msh , jpl  ) 
     192            CALL blk_ice_clio_tau 
     193            CALL blk_ice_clio_flx( zsist, zalb_cs, zalb_os, zalb_ice ) 
     194 
     195         CASE( jp_core )           ! CORE bulk formulation 
     196            CALL blk_ice_core_tau 
     197            CALL blk_ice_core_flx( zsist, zalb_ice ) 
     198 
     199         CASE( jp_purecpl )            ! Coupled formulation : atmosphere-ice stress only (fluxes provided after ice dynamics) 
    181200            CALL sbc_cpl_ice_tau( utau_ice , vtau_ice ) 
    182201         END SELECT 
     202          
     203         IF( ln_mixcpl) THEN 
     204            CALL sbc_cpl_ice_tau( zutau_ice , zvtau_ice ) 
     205            utau_ice(:,:) = utau_ice(:,:) * xcplmask(:,:,0) + zutau_ice(:,:) * ( 1. - xcplmask(:,:,0) ) 
     206            vtau_ice(:,:) = vtau_ice(:,:) * xcplmask(:,:,0) + zvtau_ice(:,:) * ( 1. - xcplmask(:,:,0) ) 
     207         ENDIF 
    183208 
    184209         CALL iom_put( 'utau_ice', utau_ice )     ! Wind stress over ice along i-axis at I-point 
     
    205230                           CALL lim_trp_2      ( kt )      ! Ice transport   ( Advection/diffusion ) 
    206231           IF( ln_limdmp ) CALL lim_dmp_2      ( kt )      ! Ice damping  
     232#if defined key_bdy 
     233                           CALL bdy_ice_lim( kt ) ! bdy ice thermo 
     234#endif 
    207235         END IF 
    208 #if defined key_coupled 
    209236         !                                             ! Ice surface fluxes in coupled mode  
    210          IF( ksbc == 5 )   THEN 
     237         IF( ln_cpl ) THEN   ! pure coupled and mixed forced-coupled configurations 
    211238            a_i(:,:,1)=fr_i 
    212239            CALL sbc_cpl_ice_flx( frld,                                              & 
    213240            !                                optional arguments, used only in 'mixed oce-ice' case 
    214             &                                             palbi = zalb_ice_cs, psst = sst_m, pist = zsist ) 
     241            &                                             palbi=zalb_ice, psst=sst_m, pist=zsist ) 
    215242            sprecip(:,:) = - emp_ice(:,:)   ! Ugly patch, WARNING, in coupled mode, sublimation included in snow (parsub = 0.) 
    216243         ENDIF 
    217 #endif 
    218244                           CALL lim_thd_2      ( kt )      ! Ice thermodynamics  
    219245                           CALL lim_sbc_flx_2  ( kt )      ! update surface ocean mass, heat & salt fluxes  
    220 #if defined key_top 
    221         IF( ltrcdm2dc_ice )CALL lim_bio_meanqsr_2 
    222 #endif 
    223246 
    224247         IF(  .NOT. lk_mpp )THEN 
     
    234257         IF( .NOT. Agrif_Root() )   CALL agrif_update_lim2( kt ) 
    235258# endif 
     259         ! 
     260         CALL wrk_dealloc( jpi,jpj  , zutau_ice, zvtau_ice) 
     261         CALL wrk_dealloc( jpi,jpj,1, zalb_os, zalb_cs, zalb_ice, zsist ) 
    236262         ! 
    237263      ENDIF                                    ! End sea-ice time step only 
     
    245271      IF( ln_limdyn    )   CALL lim_sbc_tau_2( kt, ub(:,:,1), vb(:,:,1) )  ! using before instantaneous surf. currents 
    246272      ! 
    247       CALL wrk_dealloc( jpi,jpj,1, zalb_ice_os, zalb_ice_cs, zsist ) 
    248       ! 
    249273   END SUBROUTINE sbc_ice_lim_2 
    250274 
Note: See TracChangeset for help on using the changeset viewer.