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 1870 for branches/DEV_r1837_MLF/NEMO/OPA_SRC/TRA – NEMO

Ignore:
Timestamp:
2010-05-12T17:36:00+02:00 (14 years ago)
Author:
gm
Message:

ticket: #663 step-1 : introduce the modified forcing term

Location:
branches/DEV_r1837_MLF/NEMO/OPA_SRC/TRA
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/DEV_r1837_MLF/NEMO/OPA_SRC/TRA/tranxt.F90

    r1847 r1870  
    1515   !!            3.0  !  2008-06  (G. Madec)  time stepping always done in trazdf 
    1616   !!            3.1  !  2009-02  (G. Madec, R. Benshila)  re-introduce the vvl option 
    17    !!            3.3  !  2010-04  (M. Leclair, G. Madec)  semi-implicit hpg with asselin filter 
     17   !!            3.3  !  2010-04  (M. Leclair, G. Madec)  semi-implicit hpg with asselin filter + modified LF-RA 
    1818   !!---------------------------------------------------------------------- 
    1919 
     
    8181      !! ** Action  : - (tb,sb) and (tn,sn) ready for the next time step 
    8282      !!              - (ta,sa) time averaged (t,s)   (ln_dynhpg_imp = T) 
     83      !! 
     84      !! Reference  : Leclair, M., and G. Madec, 2009, Ocean Modelling. 
    8385      !!---------------------------------------------------------------------- 
    8486      USE oce, ONLY :    ztrdt => ua   ! use ua as 3D workspace    
     
    9193      !!---------------------------------------------------------------------- 
    9294 
    93       IF( kt == nit000 ) THEN 
     95      IF( kt == nit000 ) THEN          !==  initialisation  ==! 
    9496         IF(lwp) WRITE(numout,*) 
    9597         IF(lwp) WRITE(numout,*) 'tra_nxt : achieve the time stepping by Asselin filter and array swap' 
     
    99101         r1_2bcp = 1.e0 - 2.e0 * rbcp 
    100102      ENDIF 
    101  
    102       ! Update after tracer on domain lateral boundaries 
     103      !                                      ! set time step size (Euler/Leapfrog) 
     104      IF( neuler == 0 .AND. kt == nit000 ) THEN   ;   r2dt_t(:) =     rdttra(:)      ! at nit000             (Euler) 
     105      ELSEIF( kt <= nit000 + 1 )           THEN   ;   r2dt_t(:) = 2.* rdttra(:)      ! at nit000 or nit000+1 (Leapfrog) 
     106      ENDIF 
     107 
     108      !                                !==  Update after tracer on domain lateral boundaries  ==! 
    103109      !  
    104       CALL lbc_lnk( ta, 'T', 1. )      ! local domain boundaries  (T-point, unchanged sign) 
     110      CALL lbc_lnk( ta, 'T', 1. )            ! local domain boundaries  (T-point, unchanged sign) 
    105111      CALL lbc_lnk( sa, 'T', 1. ) 
    106112      ! 
    107113#if defined key_obc 
    108       CALL obc_tra( kt )               ! OBC open boundaries 
     114      CALL obc_tra( kt )                     ! OBC open boundaries 
    109115#endif 
    110116#if defined key_bdy 
    111       CALL bdy_tra( kt )               ! BDY open boundaries 
     117      CALL bdy_tra( kt )                     ! BDY open boundaries 
    112118#endif 
    113119#if defined key_agrif 
    114       CALL Agrif_tra                   ! AGRIF zoom boundaries 
     120      CALL Agrif_tra                         ! AGRIF zoom boundaries 
    115121#endif 
    116122  
    117       ! set time step size (Euler/Leapfrog) 
    118       IF( neuler == 0 .AND. kt == nit000 ) THEN   ;   r2dt_t(:) =     rdttra(:)      ! at nit000             (Euler) 
    119       ELSEIF( kt <= nit000 + 1 )           THEN   ;   r2dt_t(:) = 2.* rdttra(:)      ! at nit000 or nit000+1 (Leapfrog) 
    120       ENDIF 
    121  
    122       ! trends computation initialisation 
    123       IF( l_trdtra ) THEN              ! store now fields before applying the Asselin filter 
     123      IF( l_trdtra ) THEN              ! trends computation: store now fields before applying the Asselin filter 
    124124         ztrdt(:,:,:) = tn(:,:,:)       
    125125         ztrds(:,:,:) = sn(:,:,:) 
    126126      ENDIF 
    127127 
    128       ! Leap-Frog + Asselin filter time stepping 
     128      !                                !==  modifed Leap-Frog + Asselin filter (modified LF-RA) scheme  ==! 
    129129      IF( lk_vvl )   THEN   ;   CALL tra_nxt_vvl( kt )      ! variable volume level (vvl) 
    130130      ELSE                  ;   CALL tra_nxt_fix( kt )      ! fixed    volume level 
     
    132132 
    133133#if defined key_agrif 
    134       ! Update tracer at AGRIF zoom boundaries 
    135       IF( .NOT.Agrif_Root() )    CALL Agrif_Update_Tra( kt )      ! children only 
     134      IF( .NOT.Agrif_Root() )    CALL Agrif_Update_Tra( kt )   ! Update tracer at AGRIF zoom boundaries (children only) 
    136135#endif       
    137136 
    138       ! trends computation 
    139       IF( l_trdtra ) THEN              ! trend of the Asselin filter (tb filtered - tb)/dt      
     137      IF( l_trdtra ) THEN              ! trends computation: trend of the Asselin filter (tb filtered - tb)/dt      
    140138         DO jk = 1, jpkm1 
    141139            zfact = 1.e0 / r2dt_t(jk)              
     
    176174      !!              - (ta,sa) time averaged (t,s)   (ln_dynhpg_imp = T) 
    177175      !!---------------------------------------------------------------------- 
    178       INTEGER, INTENT(in) ::   kt    ! ocean time-step index 
    179       !! 
    180       INTEGER  ::   ji, jj, jk   ! dummy loop indices 
    181       REAL(wp) ::   ztm, ztf     ! temporary scalars 
    182       REAL(wp) ::   zsm, zsf     !    -         - 
     176      INTEGER, INTENT(in) ::   kt   ! ocean time-step index 
     177      !! 
     178      INTEGER  ::   ji, jj, jk      ! dummy loop indices 
     179      REAL(wp) ::   ztm, ztf, zac   ! temporary scalars 
     180      REAL(wp) ::   zsm, zsf        !    -         - 
    183181      !!---------------------------------------------------------------------- 
    184182 
     
    225223               sn(:,:,jk) = sa(:,:,jk) 
    226224            END DO 
    227          ELSE                                             ! general case (Leapfrog + Asselin filter 
     225         ELSE                                             ! general case (Leapfrog + Asselin filter) 
    228226            DO jk = 1, jpkm1 
    229227               DO jj = 1, jpj 
     
    239237            END DO 
    240238         ENDIF 
     239      ENDIF 
     240      ! 
     241!!gm from Matthieu : unchecked 
     242      IF( neuler /= 0 .OR. kt /= nit000 ) THEN           ! remove the forcing from the Asselin filter 
     243         zac = atfp * rdttra(1) 
     244         tb(:,:,1) = tb(:,:,1) - zac * ( qns (:,:) - qns_b (:,:) )         ! non solar surface flux 
     245         sb(:,:,1) = sn(:,:,1) - zac * ( emps(:,:) - emps_b(:,:) )         ! surface salt flux 
     246         ! 
     247         IF( ln_traqsr )                                                   ! solar penetrating flux 
     248            DO jk = 1, nksr 
     249                  DO jj = 1, jpj 
     250                     DO ji = 1, jpi 
     251                        IF( ln_sco ) THEN 
     252                           z_cor_qsr = etot3(ji,jj,jk) * ( qsr(ji,jj) - qsrb(ji,jj) ) 
     253                        ELSEIF( ln_zps .OR. ln_zco ) THEN 
     254                           z_cor_qsr = ( qsr(ji,jj) - qsrb(ji,jj) ) *   & 
     255                                &   ( gdsr(jk) * tmask(ji,jj,jk) - gdsr(jk+1) * tmask(ji,jj,jk+1) ) 
     256                        ENDIF 
     257                        zt = zt - zfact1 * z_cor_qsr 
     258                     END DO 
     259                  END DO 
    241260      ENDIF 
    242261      ! 
     
    372391         ENDIF 
    373392      ENDIF 
     393!!gm from Matthieu : unchecked 
     394      ! 
     395      IF( neuler /= 0 .OR. kt /= nit000 ) THEN           ! remove the forcing from the Asselin filter 
     396               IF( lk_vvl ) THEN                                        ! Varying levels 
     397                  DO jj = 1, jpj 
     398                     DO ji = 1, jpi 
     399                        ! - ML - modification for varaiance diagnostics 
     400                        zssh1 = tmask(ji,jj,jk) / ( fse3t(ji,jj,jk) + atfp * ( zfse3ta(ji,jj,jk) - 2*fse3t(ji,jj,jk) & 
     401                           &                                                 + fse3tb(ji,jj,jk) ) ) 
     402                        zt = zssh1 * ( tn(ji,jj,jk) +  atfp * ( ta(ji,jj,jk) - 2 * tn(ji,jj,jk) + tb(ji,jj,jk) ) ) 
     403                        zs = zssh1 * ( sn(ji,jj,jk) +  atfp * ( sa(ji,jj,jk) - 2 * sn(ji,jj,jk) + sb(ji,jj,jk) ) ) 
     404                        ! filter correction for global conservation 
     405                        !------------------------------------------ 
     406                        zfact1 = atfp * rdttra(1) * zssh1 
     407                        IF (jk == 1) THEN                        ! remove sbc trend from time filter 
     408                           zt = zt - zfact1 * ( qn(ji,jj) - qb(ji,jj) ) 
     409!!???                           zs = zs - zfact1 * ( - emp( ji,jj) + empb(ji,jj) ) * zsrau * 35.5e0 
     410                        ENDIF 
     411                        ! remove qsr trend from time filter 
     412                        IF (jk <= nksr) THEN 
     413                           IF( ln_sco ) THEN 
     414                              z_cor_qsr = etot3(ji,jj,jk) * ( qsr(ji,jj) - qsrb(ji,jj) ) 
     415                           ELSEIF( ln_zps .OR. ln_zco ) THEN 
     416                              z_cor_qsr = ( qsr(ji,jj) - qsrb(ji,jj) ) *   & 
     417                                   &   ( gdsr(jk) * tmask(ji,jj,jk) - gdsr(jk+1) * tmask(ji,jj,jk+1) ) 
     418                           ENDIF 
     419                           zt = zt - zfact1 * z_cor_qsr 
     420                           IF (jk == nksr) qsrb(ji,jj) = qsr(ji,jj) 
     421                        ENDIF 
     422                        ! - ML - end of modification 
     423                        zssh1 = tmask(ji,jj,1) / zfse3ta(ji,jj,jk) 
     424                        tn(ji,jj,jk) = ta(ji,jj,jk) * zssh1 
     425                        sn(ji,jj,jk) = sa(ji,jj,jk) * zssh1 
     426                     END DO 
     427                  END DO 
     428      ENDIF 
     429!!gm end 
    374430      ! 
    375431   END SUBROUTINE tra_nxt_vvl 
  • branches/DEV_r1837_MLF/NEMO/OPA_SRC/TRA/traqsr.F90

    r1756 r1870  
    1010   !!             -   !  2005-11  (G. Madec) zco, zps, sco coordinate 
    1111   !!            3.2  !  2009-04  (G. Madec & NEMO team)  
     12   !!            3.3  !  2010-04  (M. Leclair, G. Madec)  Forcing averaged over 2 time steps 
    1213   !!---------------------------------------------------------------------- 
    1314 
     
    4445   REAL(wp), PUBLIC ::   rn_si2     = 61.8_wp   !: deepest depth of extinction (blue & 0.01 mg.m-3)     (RGB) 
    4546    
    46    ! Module variables 
    4747   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_chl   ! structure of input Chl (file informations, fields read) 
    48    INTEGER ::   nksr   ! levels below which the light cannot penetrate ( depth larger than 391 m) 
    49    REAL(wp), DIMENSION(3,61) ::   rkrgb   !: tabulated attenuation coefficients for RGB absorption 
     48    
     49   INTEGER                   ::   nksr    ! levels below which the light cannot penetrate (depth larger than 391 m) 
     50   REAL(wp), DIMENSION(3,61) ::   rkrgb   ! tabulated attenuation coefficients for RGB absorption 
    5051 
    5152   !! * Substitutions 
     
    5354#  include "vectopt_loop_substitute.h90" 
    5455   !!---------------------------------------------------------------------- 
    55    !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009)  
     56   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010)  
    5657   !! $Id$ 
    5758   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
     
    9697      REAL(wp) ::   zchl, zcoef, zsi0r   ! temporary scalars 
    9798      REAL(wp) ::   zc0, zc1, zc2, zc3   !    -         - 
     99      REAL(wp) ::   zqsr                 !    -         - 
    98100      REAL(wp), DIMENSION(jpi,jpj)     ::   zekb, zekg, zekr            ! 2D workspace 
    99101      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   ze0, ze1 , ze2, ze3, zea    ! 3D workspace 
     
    105107         IF(lwp) WRITE(numout,*) '~~~~~~~' 
    106108         CALL tra_qsr_init 
    107          IF( .NOT.ln_traqsr )   RETURN 
     109         IF( .NOT.ln_traqsr )   RETURN             !!gm not authirized by Coding rules 
    108110      ENDIF 
    109111 
     
    120122            DO jj = 2, jpjm1 
    121123               DO ji = fs_2, fs_jpim1   ! vector opt. 
     124!!gm  how to stecify the mean of time step here : TOP versus OPA time stepping strategy not obvious 
    122125                  ta(ji,jj,jk) = ta(ji,jj,jk) + ro0cpr * ( etot3(ji,jj,jk) - etot3(ji,jj,jk+1) ) / fse3t(ji,jj,jk)  
    123126               END DO 
     
    135138            IF( nn_chldta ==1 ) THEN                             !*  Variable Chlorophyll 
    136139               ! 
    137                CALL fld_read( kt, 1, sf_chl )                         ! Read Chl data and provides it at the current time step 
     140               CALL fld_read( kt, 1, sf_chl )                        ! Read Chl data and provides it at the current time step 
    138141               !          
    139142!CDIR COLLAPSE 
    140143!CDIR NOVERRCHK 
    141                DO jj = 1, jpj                                         ! Separation in R-G-B depending of the surface Chl 
     144               DO jj = 1, jpj                                        ! Separation in R-G-B depending of the surface Chl 
    142145!CDIR NOVERRCHK 
    143146                  DO ji = 1, jpi 
     
    149152                  END DO 
    150153               END DO 
    151                ! 
     154               !                                                     ! surface value 
    152155               zsi0r = 1.e0 / rn_si0 
    153                zcoef  = ( 1. - rn_abs ) / 3.e0                        ! equi-partition in R-G-B 
    154                ze0(:,:,1) = rn_abs  * qsr(:,:) 
    155                ze1(:,:,1) = zcoef * qsr(:,:) 
    156                ze2(:,:,1) = zcoef * qsr(:,:) 
    157                ze3(:,:,1) = zcoef * qsr(:,:) 
    158                zea(:,:,1) =         qsr(:,:) 
    159                ! 
    160                DO jk = 2, nksr+1 
     156               zcoef = ( 1. - rn_abs ) / 3.e0                           ! equi-partition in R-G-B 
     157!!gm bug !!! zqsr only a constant not an array 
     158               zqsr  = 0.5 * ( qsr_b(:,:) + qsr(:,:) )                  ! mean over 2 time steps 
     159               ze0(:,:,1) = rn_abs  * zqsr 
     160               ze1(:,:,1) = zcoef   * zqsr 
     161               ze2(:,:,1) = zcoef   * zqsr 
     162               ze3(:,:,1) = zcoef   * zqsr 
     163               zea(:,:,1) =           zqsr 
     164               ! 
     165               DO jk = 2, nksr+1                                     ! deeper values 
    161166!CDIR NOVERRCHK 
    162167                  DO jj = 1, jpj 
    163168!CDIR NOVERRCHK    
    164169                     DO ji = 1, jpi 
    165                         zc0 = ze0(ji,jj,jk-1) * EXP( - fse3t(ji,jj,jk-1) * zsi0r     ) 
     170                        zc0 = ze0(ji,jj,jk-1) * EXP( - fse3t(ji,jj,jk-1) * zsi0r       ) 
    166171                        zc1 = ze1(ji,jj,jk-1) * EXP( - fse3t(ji,jj,jk-1) * zekb(ji,jj) ) 
    167172                        zc2 = ze2(ji,jj,jk-1) * EXP( - fse3t(ji,jj,jk-1) * zekg(ji,jj) ) 
     
    175180                  END DO 
    176181               END DO 
    177                ! 
    178                DO jk = 1, nksr                                        ! compute and add qsr trend to ta 
     182!!gm add here  etot3(:,:,jk) = ( zea(:,:,jk) - zea(:,:,jk+1) ) / fse3t(:,:,jk) 
     183               ! 
     184               DO jk = 1, nksr                                       ! compute and add qsr trend to ta 
    179185                  ta(:,:,jk) = ta(:,:,jk) + ro0cpr * ( zea(:,:,jk) - zea(:,:,jk+1) ) / fse3t(:,:,jk) 
    180186               END DO 
     
    184190            ELSE                                                 !*  Constant Chlorophyll 
    185191               DO jk = 1, nksr 
    186                   ta(:,:,jk) = ta(:,:,jk) + etot3(:,:,jk) * qsr(:,:) 
     192                  ta(:,:,jk) = ta(:,:,jk) + etot3(:,:,jk) * 0.5 * ( qsr_b(:,:) + qsr(:,:) ) 
    187193               END DO 
    188194            ENDIF 
    189  
     195            ! 
    190196         ENDIF 
    191197         !                                                ! ------------------------- ! 
    192198         IF( ln_qsr_2bd ) THEN                            !  2 band light penetration ! 
    193199            !                                             ! ------------------------- ! 
    194             ! 
    195200            DO jk = 1, nksr 
    196201               DO jj = 2, jpjm1 
    197202                  DO ji = fs_2, fs_jpim1   ! vector opt. 
    198                      ta(ji,jj,jk) = ta(ji,jj,jk) + etot3(ji,jj,jk) * qsr(ji,jj) 
     203                     ta(ji,jj,jk) = ta(ji,jj,jk) + etot3(ji,jj,jk) * 0.5 * ( qsr_b(:,:) + qsr(:,:) ) 
    199204                  END DO 
    200205               END DO 
  • branches/DEV_r1837_MLF/NEMO/OPA_SRC/TRA/trasbc.F90

    r1739 r1870  
    44   !! Ocean active tracers:  surface boundary condition 
    55   !!============================================================================== 
    6    !! History :  8.2  !  98-10  (G. Madec, G. Roullet, M. Imbard)  Original code 
    7    !!            8.2  !  01-02  (D. Ludicone)  sea ice and free surface 
    8    !!            8.5  !  02-06  (G. Madec)  F90: Free form and module 
     6   !! History :  OPA  !  2998-10  (G. Madec, G. Roullet, M. Imbard)  Original code 
     7   !!            8.2  !  2001-02  (D. Ludicone)  sea ice and free surface 
     8   !!   NEMO     1.0  !  2002-06  (G. Madec)  F90: Free form and module 
     9   !!            3.3  !  2010-04  (M. Leclair, G. Madec)  Forcing averaged over 2 time steps 
    910   !!---------------------------------------------------------------------- 
    1011 
     
    3132#  include "vectopt_loop_substitute.h90" 
    3233   !!---------------------------------------------------------------------- 
    33    !!   OPA 9.0 , LOCEAN-IPSL (2005)  
     34   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010)  
    3435   !! $Id$ 
    3536   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
     
    4647      !!      and add it to the general trend of tracer equations. 
    4748      !! 
    48       !! ** Method : 
    49       !!      Following Roullet and Madec (2000), the air-sea flux can be divided  
    50       !!      into three effects: (1) Fext, external forcing;  
     49      !! ** Method  :   Following Roullet and Madec (2000), the air-sea flux  
     50      !!      can be divided into three effects:  
     51      !!      (1) Fext, external forcing;  
    5152      !!      (2) Fwi, concentration/dilution effect due to water exchanged  
    5253      !!         at the surface by evaporation, precipitations and runoff (E-P-R);  
     
    5859      !!         solar part is added in traqsr.F routine. 
    5960      !!            ta = ta + q /(rau0 rcp e3t)  for k=1 
    60       !!            - salinity    : no salt flux 
     61      !!            - salinity    : only salt flux exchanged with sea-ice 
    6162      !! 
    6263      !!      The formulation for Fwb and Fwi vary according to the free  
     
    123124      ENDIF 
    124125 
    125       IF( .NOT.ln_traqsr )   qsr(:,:) = 0.e0   ! no solar radiation penetration 
     126!!gm      IF( .NOT.ln_traqsr )   qsr(:,:) = 0.e0   ! no solar radiation penetration 
     127      IF( .NOT.ln_traqsr ) THEN     ! no solar radiation penetration 
     128         qns(:,:) = qns(:,:) + qsr(:,:)      ! total heat flux in qns 
     129         qsr(:,:) = 0.e0                     ! qsr set to zero 
     130         IF( kt == nit000 ) THEN             ! idem on before field at nit000 
     131            qns_b(:,:) = qns_b(:,:) + qsr_b(:,:)   
     132            qsr_b(:,:) = 0.e0                      
     133         ENDIF 
     134      ENDIF 
    126135 
    127136      ! Concentration dillution effect on (t,s) 
    128       DO jj = 2, jpj 
    129          DO ji = fs_2, fs_jpim1   ! vector opt. 
    130 #if ! defined key_zco 
    131             zse3t = 1. / fse3t(ji,jj,1) 
    132 #endif 
    133             IF( lk_vvl) THEN 
    134                zta = ro0cpr * qns(ji,jj) * zse3t &                   ! temperature : heat flux 
    135                 &    - emp(ji,jj) * zsrau * tn(ji,jj,1)  * zse3t     ! & cooling/heating effet of EMP flux 
    136                zsa = 0.e0                                            ! No salinity concent./dilut. effect 
    137             ELSE 
    138                zta = ro0cpr * qns(ji,jj) * zse3t     ! temperature : heat flux 
    139                zsa = emps(ji,jj) * zsrau * sn(ji,jj,1)   * zse3t     ! salinity :  concent./dilut. effect 
    140             ENDIF 
    141             ta(ji,jj,1) = ta(ji,jj,1) + zta                          ! add the trend to the general tracer trend 
    142             sa(ji,jj,1) = sa(ji,jj,1) + zsa 
     137!!      DO jj = 2, jpj 
     138!!         DO ji = fs_2, fs_jpim1   ! vector opt. 
     139!!#if ! defined key_zco 
     140!!            zse3t = 1. / fse3t(ji,jj,1) 
     141!!#endif 
     142!!            IF( lk_vvl) THEN 
     143!!               zta = ro0cpr * qns(ji,jj) * zse3t &                   ! temperature : heat flux 
     144!!                &    - emp(ji,jj) * zsrau * tn(ji,jj,1)  * zse3t     ! & cooling/heating effet of EMP flux 
     145!!               zsa = 0.e0                                            ! No salinity concent./dilut. effect 
     146!!            ELSE 
     147!!               zta = ro0cpr * qns(ji,jj) * zse3t     ! temperature : heat flux 
     148!!               zsa = emps(ji,jj) * zsrau * sn(ji,jj,1)   * zse3t     ! salinity :  concent./dilut. effect 
     149!!            ENDIF 
     150!!            ta(ji,jj,1) = ta(ji,jj,1) + zta                          ! add the trend to the general tracer trend 
     151!!            sa(ji,jj,1) = sa(ji,jj,1) + zsa 
     152!!         END DO 
     153!!      END DO 
     154 
     155      !                             ! ---------------------- ! 
     156      IF( lk_vvl ) THEN             !  Variable Volume case  ! 
     157         !                          ! ---------------------- ! 
     158         DO jj = 2, jpj 
     159            DO ji = fs_2, fs_jpim1   ! vector opt. 
     160               zse3t = 0.5 / fse3t(ji,jj,1) 
     161               !                           ! temperature: heat flux + cooling/heating effet of EMP flux 
     162               ta(ji,jj,1) = ta(ji,jj,1) + (  ro0cpr * ( qns(ji,jj) + qns_b(ji,jj) )                &  
     163                  &                         - zsrau  * ( emp(ji,jj) + emp_b(ji,jj) ) * tn(ji,jj,1)  ) * zse3t 
     164               !                           ! salinity: salt flux 
     165               sa(ji,jj,1) = sa(ji,jj,1) + ( emps(ji,jj) + emps_b(ji,jj) ) * zse3t 
     166 
     167!!gm BUG : in key_vvl emps must be modified to only include the salt flux due to with sea-ice freezing/melting 
     168!!gm       otherwise this flux will be missing  ==> modification required in limsbc,  limsbc_2 and CICE interface. 
     169 
     170            END DO 
    143171         END DO 
    144       END DO 
     172         !                          ! ---------------------- ! 
     173      ELSE                          !  Constant Volume case  ! 
     174         !                          ! ---------------------- ! 
     175         DO jj = 2, jpj 
     176            DO ji = fs_2, fs_jpim1   ! vector opt. 
     177               zse3t = 0.5 / fse3t(ji,jj,1) 
     178               !                           ! temperature: heat flux  
     179               ta(ji,jj,1) = ta(ji,jj,1) + ro0cpr * ( qns (ji,jj) + qns_b (ji,jj) )               * zse3t  
     180               !                           ! salinity: salt flux + concent./dilut. effect (both in emps) 
     181               sa(ji,jj,1) = sa(ji,jj,1) + zsrau  * ( emps(ji,jj) + emps_b(ji,jj) ) * sn(ji,jj,1) * zse3t 
     182            END DO 
     183         END DO 
     184         ! 
     185      ENDIF 
    145186 
    146       IF( l_trdtra ) THEN      ! save the sbc trends for diagnostic 
     187      IF( l_trdtra ) THEN        ! save the sbc trends for diagnostic 
    147188         ztrdt(:,:,:) = ta(:,:,:) - ztrdt(:,:,:) 
    148189         ztrds(:,:,:) = sa(:,:,:) - ztrds(:,:,:) 
    149190         CALL trd_mod(ztrdt, ztrds, jptra_trd_nsr, 'TRA', kt) 
    150191      ENDIF 
    151       ! 
     192      !                          ! control print 
    152193      IF(ln_ctl)   CALL prt_ctl( tab3d_1=ta, clinfo1=' sbc  - Ta: ', mask1=tmask,   & 
    153194         &                       tab3d_2=sa, clinfo2=       ' Sa: ', mask2=tmask, clinfo3='tra' ) 
Note: See TracChangeset for help on using the changeset viewer.