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 3625 for branches/2012/dev_NOC_2012_rev3555/NEMOGCM/NEMO/LIM_SRC_2/limsbc_2.F90 – NEMO

Ignore:
Timestamp:
2012-11-21T14:19:18+01:00 (11 years ago)
Author:
acc
Message:

Branch dev_NOC_2012_r3555. #1006. Step 7. Check in code now merged with dev_r3385_NOCS04_HAMF

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2012/dev_NOC_2012_rev3555/NEMOGCM/NEMO/LIM_SRC_2/limsbc_2.F90

    r3294 r3625  
    99   !!            3.3  ! 2009-05 (G. Garric, C. Bricaud) addition of the lim2_evp case 
    1010   !!             -   ! 2010-11 (G. Madec) ice-ocean stress computed at each ocean time-step 
    11    !!            4.0  ! 2011-01  (A. R. Porter, STFC Daresbury) dynamical allocation 
     11   !!           3.3.1 ! 2011-01 (A. R. Porter, STFC Daresbury) dynamical allocation 
     12   !!            3.5  ! 2012-11 ((G. Madec, Y. Aksenov, A. Coward) salt and heat fluxes associated with e-p 
    1213   !!---------------------------------------------------------------------- 
    1314#if defined key_lim2 
     
    2829   USE sbc_oce          ! surface boundary condition: ocean 
    2930   USE sbccpl 
    30  
     31   USE cpl_oasis3, ONLY : lk_cpl 
     32   USE oce       , ONLY : sshn, sshb, snwice_mass, snwice_mass_b, snwice_fmass  
    3133   USE albedo           ! albedo parameters 
    3234   USE lbclnk           ! ocean lateral boundary condition - MPP exchanges 
     
    3739   USE iom              ! I/O library 
    3840   USE prtctl           ! Print control 
    39    USE cpl_oasis3, ONLY : lk_cpl 
     41   USE lib_fortran      ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)   
    4042 
    4143   IMPLICIT NONE 
     
    8890      !!              - Update the fluxes provided to the ocean 
    8991      !!      
    90       !! ** Outputs : - qsr     : sea heat flux:    solar  
    91       !!              - qns     : sea heat flux: non solar 
    92       !!              - emp     : freshwater budget: volume flux  
    93       !!              - emps    : freshwater budget: concentration/dillution  
     92      !! ** Outputs : - qsr     : sea heat flux    : solar  
     93      !!              - qns     : sea heat flux    : non solar (including heat content of the mass flux) 
     94      !!              - emp     : freshwater budget: mass flux  
     95      !!              - sfx     : freshwater budget: salt flux due to Freezing/Melting 
    9496      !!              - utau    : sea surface i-stress (ocean referential) 
    9597      !!              - vtau    : sea surface j-stress (ocean referential) 
     
    107109      INTEGER  ::   ifvt, i1mfr, idfr, iflt    !   -       - 
    108110      INTEGER  ::   ial, iadv, ifral, ifrdv    !   -       - 
    109       REAL(wp) ::   zqsr, zqns, zfm            ! local scalars 
    110       REAL(wp) ::   zinda, zfons, zemp         !   -      - 
     111      REAL(wp) ::   zqsr,     zqns,   zfmm     ! local scalars 
     112      REAL(wp) ::   zinda,    zfsalt, zemp     !   -      - 
     113      REAL(wp) ::   zemp_snw, zqhc,   zcd      !   -      - 
     114      REAL(wp) ::   zswitch                    !   -      - 
    111115      REAL(wp), POINTER, DIMENSION(:,:)   ::   zqnsoce       ! 2D workspace 
    112116      REAL(wp), POINTER, DIMENSION(:,:,:) ::   zalb, zalbp   ! 2D/3D workspace 
     
    115119      CALL wrk_alloc( jpi, jpj, zqnsoce ) 
    116120      CALL wrk_alloc( jpi, jpj, 1, zalb, zalbp ) 
     121 
     122      SELECT CASE( nn_ice_embd )                 ! levitating or embedded sea-ice option 
     123        CASE( 0    )   ;   zswitch = 1           ! (0) standard levitating sea-ice : salt exchange only 
     124        CASE( 1, 2 )   ;   zswitch = 0           ! (1) levitating sea-ice: salt and volume exchange but no pressure effect 
     125                                                 ! (2) embedded sea-ice : salt and volume fluxes and pressure 
     126      END SELECT                                 !     
    117127 
    118128      !------------------------------------------! 
     
    133143            ifrdv   = ( 1  - ifral * ( 1 - ial ) ) * iadv  
    134144 
    135 !!$            zinda   = 1.0 - AINT( pfrld(ji,jj) )                   !   = 0. if pure ocean else 1. (at previous time) 
    136 !!$ 
    137 !!$            i1mfr   = 1.0 - AINT(  frld(ji,jj) )                   !   = 0. if pure ocean else 1. (at current  time) 
    138 !!$ 
    139 !!$            IF( phicif(ji,jj) <= 0. ) THEN   ;   ifvt = zinda      !   = 1. if (snow and no ice at previous time) else 0. ??? 
    140 !!$            ELSE                             ;   ifvt = 0. 
     145!!$            attempt to explain the tricky flags set above.... 
     146!!$            zinda   = 1.0 - AINT( pfrld(ji,jj) )                   ! = 0. if ice-free ocean else 1. (after ice adv, but before ice thermo) 
     147!!$            i1mfr   = 1.0 - AINT(  frld(ji,jj) )                   ! = 0. if ice-free ocean else 1. (after ice thermo) 
     148!!$ 
     149!!$            IF( phicif(ji,jj) <= 0. ) THEN   ;   ifvt = zinda      ! = zinda if previous thermodynamic step overmelted the ice??? 
     150!!$            ELSE                             ;   ifvt = 0.         !  
    141151!!$            ENDIF 
    142152!!$ 
    143 !!$            IF( frld(ji,jj) >= pfrld(ji,jj) ) THEN   ;   idfr = 0.  !   = 0. if lead fraction increases from previous to current 
     153!!$            IF( frld(ji,jj) >= pfrld(ji,jj) ) THEN   ;   idfr = 0.  !   = 0. if lead fraction increases due to ice thermodynamics 
    144154!!$            ELSE                                     ;   idfr = 1.    
    145155!!$            ENDIF 
    146156!!$ 
    147 !!$            iflt    = zinda  * (1 - i1mfr) * (1 - ifvt )    !   = 1. if ice (not only snow) at previous and pure ocean at current 
     157!!$            iflt    = zinda  * (1 - i1mfr) * (1 - ifvt )    !   = 1. if ice (not only snow) at previous time and ice-free ocean currently 
    148158!!$ 
    149159!!$            ial     = ifvt   * i1mfr    +    ( 1 - ifvt ) * idfr 
     160!!$                    = i1mfr if ifvt = 1 i.e.  
     161!!$                    = idfr  if ifvt = 0 
    150162!!$!                 snow no ice   ice         ice or nothing  lead fraction increases 
    151163!!$!                 at previous   now           at previous 
    152 !!$!                -> ice aera increases  ???         -> ice aera decreases ??? 
     164!!$!                -> ice area increases  ???         -> ice area decreases ??? 
    153165!!$ 
    154166!!$            iadv    = ( 1  - i1mfr ) * zinda 
     
    174186#endif             
    175187            !  computation the non solar heat flux at ocean surface 
    176             zqns    =  - ( 1. - thcm(ji,jj) ) * zqsr   &   ! part of the solar energy used in leads 
    177                &       + iflt    * ( fscmbq(ji,jj) + ffltbif(ji,jj) )                            & 
    178                &       + ifral   * ( ial * qcmif(ji,jj) + (1 - ial) * qldif(ji,jj) ) * r1_rdtice    & 
    179                &       + ifrdv   * ( qfvbq(ji,jj) + qdtcn(ji,jj) )                   * r1_rdtice  
    180  
    181             fsbbq(ji,jj) = ( 1.0 - ( ifvt + iflt ) ) * fscmbq(ji,jj)     ! ??? 
    182             ! 
     188            zqns    =  - ( 1. - thcm(ji,jj) ) * zqsr                                              &   ! part of the solar energy used in leads 
     189               &       + iflt    * ( fscmbq(ji,jj) + ffltbif(ji,jj) )                             & 
     190               &       + ifral   * ( ial * qcmif(ji,jj) + (1 - ial) * qldif(ji,jj) ) * r1_rdtice  & 
     191               &       + ifrdv   * (       qfvbq(ji,jj) +             qdtcn(ji,jj) ) * r1_rdtice  
     192 
     193            fsbbq(ji,jj) = ( 1.0 - ( ifvt + iflt ) ) * fscmbq(ji,jj)     ! store residual heat flux (to put into the ocean at the next time-step) 
     194            zqhc = ( rdq_snw(ji,jj)                                     & 
     195                 & + rdq_ice(ji,jj) * ( 1.- zswitch) ) * r1_rdtice       ! heat flux due to snow ( & ice heat content,  
     196            !                                                            !           if ice/ocean mass exchange active)  
    183197            qsr  (ji,jj) = zqsr                                          ! solar heat flux  
    184             qns  (ji,jj) = zqns - fdtcn(ji,jj)                           ! non solar heat flux 
     198            qns  (ji,jj) = zqns - fdtcn(ji,jj) + zqhc                    ! non solar heat flux  
     199            ! 
     200            !                          !------------------------------------------! 
     201            !                          !  mass and salt flux at the ocean surface ! 
     202            !                          !------------------------------------------! 
     203            ! 
     204            ! mass flux at the ocean-atmosphere interface (open ocean fraction = leads area) 
     205#if defined key_coupled 
     206            !                                                  ! coupled mode:  
     207            zemp = + emp_tot(ji,jj)                            &     ! net mass flux over the grid cell (ice+ocean area) 
     208               &   - emp_ice(ji,jj) * ( 1. - pfrld(ji,jj) )          ! minus the mass flux intercepted by sea-ice 
     209#else 
     210            !                                                  ! forced  mode:  
     211            zemp = + emp(ji,jj)     *         frld(ji,jj)      &     ! mass flux over open ocean fraction  
     212               &   - tprecip(ji,jj) * ( 1. -  frld(ji,jj) )    &     ! liquid precip. over ice reaches directly the ocean 
     213               &   + sprecip(ji,jj) * ( 1. - pfrld(ji,jj) )          ! snow is intercepted by sea-ice (previous frld) 
     214#endif             
     215            ! 
     216            ! mass flux at the ocean/ice interface (sea ice fraction) 
     217            zemp_snw = rdm_snw(ji,jj) * r1_rdtice                    ! snow melting = pure water that enters the ocean 
     218            zfmm     = rdm_ice(ji,jj) * r1_rdtice                    ! Freezing minus Melting (F-M) 
     219 
     220            ! salt flux at the ice/ocean interface (sea ice fraction) [PSU*kg/m2/s] 
     221            zfsalt = - sice_0(ji,jj) * zfmm                          ! F-M salt exchange 
     222            zcd    =   soce_0(ji,jj) * zfmm                          ! concentration/dilution term due to F-M 
     223            ! 
     224            ! salt flux only       : add concentration dilution term in salt flux  and no  F-M term in volume flux 
     225            ! salt and mass fluxes : non concentration dilution term in salt flux  and add F-M term in volume flux 
     226            sfx (ji,jj) = zfsalt +                  zswitch  * zcd   ! salt flux (+ C/D if no ice/ocean mass exchange) 
     227            emp (ji,jj) = zemp   + zemp_snw + ( 1.- zswitch) * zfmm  ! mass flux (+ F/M mass flux if ice/ocean mass exchange) 
     228            ! 
    185229         END DO 
    186230      END DO 
     231      !                                !------------------------------------------! 
     232      !                                !    mass of snow and ice per unit area    ! 
     233      !                                !------------------------------------------! 
     234      IF( nn_ice_embd /= 0 ) THEN      ! embedded sea-ice (mass required) 
     235         snwice_mass_b(:,:) = snwice_mass(:,:)                  ! save mass from the previous ice time step 
     236         !                                                      ! new mass per unit area 
     237         snwice_mass  (:,:) = tms(:,:) * ( rhosn * hsnif(:,:) + rhoic * hicif(:,:)  ) * ( 1.0 - frld(:,:) ) 
     238         !                                                      ! time evolution of snow+ice mass 
     239         snwice_fmass (:,:) = ( snwice_mass(:,:) - snwice_mass_b(:,:) ) / rdt_ice 
     240      ENDIF 
    187241 
    188242      CALL iom_put( 'hflx_ice_cea', - fdtcn(:,:) )       
     
    190244      CALL iom_put( 'qsr_io_cea', fstric(:,:) * (1.e0 - pfrld(:,:)) ) 
    191245 
    192       !------------------------------------------! 
    193       !      mass flux at the ocean surface      ! 
    194       !------------------------------------------! 
    195       DO jj = 1, jpj 
    196          DO ji = 1, jpi 
    197             ! 
    198 #if defined key_coupled 
    199             ! freshwater exchanges at the ice-atmosphere / ocean interface (coupled mode) 
    200             zemp = emp_tot(ji,jj) - emp_ice(ji,jj) * ( 1. - pfrld(ji,jj) )    &   !  
    201                &   + rdmsnif(ji,jj) * r1_rdtice                                   !  freshwaterflux due to snow melting  
    202 #else 
    203             !  computing freshwater exchanges at the ice/ocean interface 
    204             zemp = + emp(ji,jj)     *         frld(ji,jj)      &   !  e-p budget over open ocean fraction  
    205                &   - tprecip(ji,jj) * ( 1. -  frld(ji,jj) )    &   !  liquid precipitation reaches directly the ocean 
    206                &   + sprecip(ji,jj) * ( 1. - pfrld(ji,jj) )    &   !  change in ice cover within the time step 
    207                &   + rdmsnif(ji,jj) * r1_rdtice                    !  freshwater flux due to snow melting  
    208 #endif             
    209             ! 
    210             !  computing salt exchanges at the ice/ocean interface 
    211             zfons = ( soce_0(ji,jj) - sice_0(ji,jj) ) * ( rdmicif(ji,jj) * r1_rdtice )  
    212             ! 
    213             !  converting the salt flux from ice to a freshwater flux from ocean 
    214             zfm  = zfons / ( sss_m(ji,jj) + epsi16 ) 
    215             ! 
    216             emps(ji,jj) = zemp + zfm      ! surface ocean concentration/dilution effect (use on SSS evolution) 
    217             emp (ji,jj) = zemp            ! surface ocean volume flux (use on sea-surface height evolution) 
    218             ! 
    219          END DO 
    220       END DO 
    221  
    222246      IF( lk_diaar5 ) THEN       ! AR5 diagnostics 
    223          CALL iom_put( 'isnwmlt_cea'  ,                 rdmsnif(:,:) * r1_rdtice ) 
    224          CALL iom_put( 'fsal_virt_cea',   soce_0(:,:) * rdmicif(:,:) * r1_rdtice ) 
    225          CALL iom_put( 'fsal_real_cea', - sice_0(:,:) * rdmicif(:,:) * r1_rdtice ) 
     247         CALL iom_put( 'isnwmlt_cea'  ,                 rdm_snw(:,:) * r1_rdtice ) 
     248         CALL iom_put( 'fsal_virt_cea',   soce_0(:,:) * rdm_ice(:,:) * r1_rdtice ) 
     249         CALL iom_put( 'fsal_real_cea', - sice_0(:,:) * rdm_ice(:,:) * r1_rdtice ) 
    226250      ENDIF 
    227251 
     
    243267      IF(ln_ctl) THEN            ! control print 
    244268         CALL prt_ctl(tab2d_1=qsr   , clinfo1=' lim_sbc: qsr    : ', tab2d_2=qns   , clinfo2=' qns     : ') 
    245          CALL prt_ctl(tab2d_1=emp   , clinfo1=' lim_sbc: emp    : ', tab2d_2=emps  , clinfo2=' emps    : ') 
     269         CALL prt_ctl(tab2d_1=emp   , clinfo1=' lim_sbc: emp    : ', tab2d_2=sfx   , clinfo2=' sfx     : ') 
    246270         CALL prt_ctl(tab2d_1=utau  , clinfo1=' lim_sbc: utau   : ', mask1=umask,   & 
    247271            &         tab2d_2=vtau  , clinfo2=' vtau    : '        , mask2=vmask ) 
     
    439463         END WHERE 
    440464      ENDIF 
     465      !                                      ! embedded sea ice 
     466      IF( nn_ice_embd /= 0 ) THEN            ! mass exchanges between ice and ocean (case 1 or 2) set the snow+ice mass 
     467         snwice_mass  (:,:) = tms(:,:) * ( rhosn * hsnif(:,:) + rhoic * hicif(:,:)  ) * ( 1.0 - frld(:,:) ) 
     468         snwice_mass_b(:,:) = snwice_mass(:,:) 
     469      ELSE 
     470         snwice_mass  (:,:) = 0.e0           ! no mass exchanges 
     471         snwice_mass_b(:,:) = 0.e0           ! no mass exchanges 
     472      ENDIF 
     473      IF( nn_ice_embd == 2 .AND.          &  ! full embedment (case 2) & no restart :  
     474         &   .NOT.ln_rstart ) THEN           ! deplete the initial ssh below sea-ice area 
     475         sshn(:,:) = sshn(:,:) - snwice_mass(:,:) * r1_rau0 
     476         sshb(:,:) = sshb(:,:) - snwice_mass(:,:) * r1_rau0 
     477      ENDIF 
    441478      ! 
    442479   END SUBROUTINE lim_sbc_init_2 
Note: See TracChangeset for help on using the changeset viewer.