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 6736 for branches/NERC/dev_r3874_FASTNEt/NEMOGCM/NEMO/LIM_SRC_2/limsbc_2.F90 – NEMO

Ignore:
Timestamp:
2016-06-24T09:50:27+02:00 (8 years ago)
Author:
jamesharle
Message:

FASTNEt code modifications

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/NERC/dev_r3874_FASTNEt/NEMOGCM/NEMO/LIM_SRC_2/limsbc_2.F90

    r3625 r6736  
    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    !!           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 
     11   !!            4.0  ! 2011-01  (A. R. Porter, STFC Daresbury) dynamical allocation 
    1312   !!---------------------------------------------------------------------- 
    1413#if defined key_lim2 
     
    2928   USE sbc_oce          ! surface boundary condition: ocean 
    3029   USE sbccpl 
    31    USE cpl_oasis3, ONLY : lk_cpl 
    32    USE oce       , ONLY : sshn, sshb, snwice_mass, snwice_mass_b, snwice_fmass  
     30 
    3331   USE albedo           ! albedo parameters 
    3432   USE lbclnk           ! ocean lateral boundary condition - MPP exchanges 
     
    3937   USE iom              ! I/O library 
    4038   USE prtctl           ! Print control 
    41    USE lib_fortran      ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)   
     39   USE lib_fortran      ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 
     40   USE cpl_oasis3, ONLY : lk_cpl 
    4241 
    4342   IMPLICIT NONE 
     
    9089      !!              - Update the fluxes provided to the ocean 
    9190      !!      
    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 
     91      !! ** Outputs : - qsr     : sea heat flux:    solar  
     92      !!              - qns     : sea heat flux: non solar 
     93      !!              - emp     : freshwater budget: volume flux  
     94      !!              - emps    : freshwater budget: concentration/dillution  
    9695      !!              - utau    : sea surface i-stress (ocean referential) 
    9796      !!              - vtau    : sea surface j-stress (ocean referential) 
     
    109108      INTEGER  ::   ifvt, i1mfr, idfr, iflt    !   -       - 
    110109      INTEGER  ::   ial, iadv, ifral, ifrdv    !   -       - 
    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                    !   -      - 
     110      REAL(wp) ::   zqsr, zqns, zfm            ! local scalars 
     111      REAL(wp) ::   zinda, zfons, zemp         !   -      - 
    115112      REAL(wp), POINTER, DIMENSION(:,:)   ::   zqnsoce       ! 2D workspace 
    116113      REAL(wp), POINTER, DIMENSION(:,:,:) ::   zalb, zalbp   ! 2D/3D workspace 
     
    119116      CALL wrk_alloc( jpi, jpj, zqnsoce ) 
    120117      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                                 !     
    127118 
    128119      !------------------------------------------! 
     
    143134            ifrdv   = ( 1  - ifral * ( 1 - ial ) ) * iadv  
    144135 
    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.         !  
     136!!$            zinda   = 1.0 - AINT( pfrld(ji,jj) )                   !   = 0. if pure ocean else 1. (at previous time) 
     137!!$ 
     138!!$            i1mfr   = 1.0 - AINT(  frld(ji,jj) )                   !   = 0. if pure ocean else 1. (at current  time) 
     139!!$ 
     140!!$            IF( phicif(ji,jj) <= 0. ) THEN   ;   ifvt = zinda      !   = 1. if (snow and no ice at previous time) else 0. ??? 
     141!!$            ELSE                             ;   ifvt = 0. 
    151142!!$            ENDIF 
    152143!!$ 
    153 !!$            IF( frld(ji,jj) >= pfrld(ji,jj) ) THEN   ;   idfr = 0.  !   = 0. if lead fraction increases due to ice thermodynamics 
     144!!$            IF( frld(ji,jj) >= pfrld(ji,jj) ) THEN   ;   idfr = 0.  !   = 0. if lead fraction increases from previous to current 
    154145!!$            ELSE                                     ;   idfr = 1.    
    155146!!$            ENDIF 
    156147!!$ 
    157 !!$            iflt    = zinda  * (1 - i1mfr) * (1 - ifvt )    !   = 1. if ice (not only snow) at previous time and ice-free ocean currently 
     148!!$            iflt    = zinda  * (1 - i1mfr) * (1 - ifvt )    !   = 1. if ice (not only snow) at previous and pure ocean at current 
    158149!!$ 
    159150!!$            ial     = ifvt   * i1mfr    +    ( 1 - ifvt ) * idfr 
    160 !!$                    = i1mfr if ifvt = 1 i.e.  
    161 !!$                    = idfr  if ifvt = 0 
    162151!!$!                 snow no ice   ice         ice or nothing  lead fraction increases 
    163152!!$!                 at previous   now           at previous 
    164 !!$!                -> ice area increases  ???         -> ice area decreases ??? 
     153!!$!                -> ice aera increases  ???         -> ice aera decreases ??? 
    165154!!$ 
    166155!!$            iadv    = ( 1  - i1mfr ) * zinda 
     
    186175#endif             
    187176            !  computation the non solar heat flux at ocean surface 
    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)  
     177            zqns    =  - ( 1. - thcm(ji,jj) ) * zqsr   &   ! part of the solar energy used in leads 
     178               &       + iflt    * ( fscmbq(ji,jj) + ffltbif(ji,jj) )                            & 
     179               &       + ifral   * ( ial * qcmif(ji,jj) + (1 - ial) * qldif(ji,jj) ) * r1_rdtice    & 
     180               &       + ifrdv   * ( qfvbq(ji,jj) + qdtcn(ji,jj) )                   * r1_rdtice  
     181 
     182            fsbbq(ji,jj) = ( 1.0 - ( ifvt + iflt ) ) * fscmbq(ji,jj)     ! ??? 
     183            ! 
    197184            qsr  (ji,jj) = zqsr                                          ! 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             ! 
     185            qns  (ji,jj) = zqns - fdtcn(ji,jj)                           ! non solar heat flux 
    229186         END DO 
    230187      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 
    241188 
    242189      CALL iom_put( 'hflx_ice_cea', - fdtcn(:,:) )       
     
    244191      CALL iom_put( 'qsr_io_cea', fstric(:,:) * (1.e0 - pfrld(:,:)) ) 
    245192 
     193      !------------------------------------------! 
     194      !      mass flux at the ocean surface      ! 
     195      !------------------------------------------! 
     196      DO jj = 1, jpj 
     197         DO ji = 1, jpi 
     198            ! 
     199#if defined key_coupled 
     200            ! freshwater exchanges at the ice-atmosphere / ocean interface (coupled mode) 
     201            zemp = emp_tot(ji,jj) - emp_ice(ji,jj) * ( 1. - pfrld(ji,jj) )    &   !  
     202               &   + rdmsnif(ji,jj) * r1_rdtice                                   !  freshwaterflux due to snow melting  
     203#else 
     204            !  computing freshwater exchanges at the ice/ocean interface 
     205            zemp = + emp(ji,jj)     *         frld(ji,jj)      &   !  e-p budget over open ocean fraction  
     206               &   - tprecip(ji,jj) * ( 1. -  frld(ji,jj) )    &   !  liquid precipitation reaches directly the ocean 
     207               &   + sprecip(ji,jj) * ( 1. - pfrld(ji,jj) )    &   !  change in ice cover within the time step 
     208               &   + rdmsnif(ji,jj) * r1_rdtice                    !  freshwater flux due to snow melting  
     209#endif             
     210            ! 
     211            !  computing salt exchanges at the ice/ocean interface 
     212            zfons = ( soce_0(ji,jj) - sice_0(ji,jj) ) * ( rdmicif(ji,jj) * r1_rdtice )  
     213            ! 
     214            !  converting the salt flux from ice to a freshwater flux from ocean 
     215            zfm  = zfons / ( sss_m(ji,jj) + epsi16 ) 
     216            ! 
     217            emps(ji,jj) = zemp + zfm      ! surface ocean concentration/dilution effect (use on SSS evolution) 
     218            emp (ji,jj) = zemp            ! surface ocean volume flux (use on sea-surface height evolution) 
     219            ! 
     220         END DO 
     221      END DO 
     222 
    246223      IF( lk_diaar5 ) THEN       ! AR5 diagnostics 
    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 ) 
     224         CALL iom_put( 'isnwmlt_cea'  ,                 rdmsnif(:,:) * r1_rdtice ) 
     225         CALL iom_put( 'fsal_virt_cea',   soce_0(:,:) * rdmicif(:,:) * r1_rdtice ) 
     226         CALL iom_put( 'fsal_real_cea', - sice_0(:,:) * rdmicif(:,:) * r1_rdtice ) 
    250227      ENDIF 
    251228 
     
    267244      IF(ln_ctl) THEN            ! control print 
    268245         CALL prt_ctl(tab2d_1=qsr   , clinfo1=' lim_sbc: qsr    : ', tab2d_2=qns   , clinfo2=' qns     : ') 
    269          CALL prt_ctl(tab2d_1=emp   , clinfo1=' lim_sbc: emp    : ', tab2d_2=sfx   , clinfo2=' sfx     : ') 
     246         CALL prt_ctl(tab2d_1=emp   , clinfo1=' lim_sbc: emp    : ', tab2d_2=emps  , clinfo2=' emps    : ') 
    270247         CALL prt_ctl(tab2d_1=utau  , clinfo1=' lim_sbc: utau   : ', mask1=umask,   & 
    271248            &         tab2d_2=vtau  , clinfo2=' vtau    : '        , mask2=vmask ) 
     
    463440         END WHERE 
    464441      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 
    478442      ! 
    479443   END SUBROUTINE lim_sbc_init_2 
Note: See TracChangeset for help on using the changeset viewer.