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 12377 for NEMO/trunk/src/OCE/SBC/sbccpl.F90 – NEMO

Ignore:
Timestamp:
2020-02-12T15:39:06+01:00 (4 years ago)
Author:
acc
Message:

The big one. Merging all 2019 developments from the option 1 branch back onto the trunk.

This changeset reproduces 2019/dev_r11943_MERGE_2019 on the trunk using a 2-URL merge
onto a working copy of the trunk. I.e.:

svn merge --ignore-ancestry \

svn+ssh://acc@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/NEMO/trunk \
svn+ssh://acc@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/NEMO/branches/2019/dev_r11943_MERGE_2019 ./

The --ignore-ancestry flag avoids problems that may otherwise arise from the fact that
the merge history been trunk and branch may have been applied in a different order but
care has been taken before this step to ensure that all applicable fixes and updates
are present in the merge branch.

The trunk state just before this step has been branched to releases/release-4.0-HEAD
and that branch has been immediately tagged as releases/release-4.0.2. Any fixes
or additions in response to tickets on 4.0, 4.0.1 or 4.0.2 should be done on
releases/release-4.0-HEAD. From now on future 'point' releases (e.g. 4.0.2) will
remain unchanged with periodic releases as needs demand. Note release-4.0-HEAD is a
transitional naming convention. Future full releases, say 4.2, will have a release-4.2
branch which fulfills this role and the first point release (e.g. 4.2.0) will be made
immediately following the release branch creation.

2020 developments can be started from any trunk revision later than this one.

Location:
NEMO/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk

    • Property svn:externals
      •  

        old new  
        33^/utils/build/mk@HEAD         mk 
        44^/utils/tools@HEAD            tools 
        5 ^/vendors/AGRIF/dev@HEAD      ext/AGRIF 
         5^/vendors/AGRIF/dev_r11615_ENHANCE-04_namelists_as_internalfiles_agrif@HEAD      ext/AGRIF 
        66^/vendors/FCM@HEAD            ext/FCM 
        77^/vendors/IOIPSL@HEAD         ext/IOIPSL 
  • NEMO/trunk/src/OCE/SBC/sbccpl.F90

    r12288 r12377  
    2727   USE sbcwave         ! surface boundary condition: waves 
    2828   USE phycst          ! physical constants 
     29   USE isf_oce , ONLY : l_isfoasis, fwfisf_oasis ! ice shelf boundary condition 
    2930#if defined key_si3 
    3031   USE ice            ! ice variables 
     
    3233   USE cpl_oasis3     ! OASIS3 coupling 
    3334   USE geo2ocean      !  
    34    USE oce     , ONLY : tsn, un, vn, sshn, ub, vb, sshb, fraqsr_1lev 
     35   USE oce     , ONLY : ts, uu, vv, ssh, fraqsr_1lev 
    3536   USE ocealb         !  
    3637   USE eosbn2         !  
    3738   USE sbcrnf  , ONLY : l_rnfcpl 
    38    USE sbcisf  , ONLY : l_isfcpl 
    3939#if defined key_cice 
    4040   USE ice_domain_size, only: ncat 
     
    198198 
    199199   !! Substitution 
    200 #  include "vectopt_loop_substitute.h90" 
     200#  include "do_loop_substitute.h90" 
    201201   !!---------------------------------------------------------------------- 
    202202   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    264264      ! ================================ ! 
    265265      ! 
    266       REWIND( numnam_ref )              ! Namelist namsbc_cpl in reference namelist : Variables for OASIS coupling 
    267266      READ  ( numnam_ref, namsbc_cpl, IOSTAT = ios, ERR = 901) 
    268267901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namsbc_cpl in reference namelist' ) 
    269268      ! 
    270       REWIND( numnam_cfg )              ! Namelist namsbc_cpl in configuration namelist : Variables for OASIS coupling 
    271269      READ  ( numnam_cfg, namsbc_cpl, IOSTAT = ios, ERR = 902 ) 
    272270902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namsbc_cpl in configuration namelist' ) 
     
    453451      CASE( 'conservative'  ) 
    454452         srcv( (/jpr_rain, jpr_snow, jpr_ievp, jpr_tevp/) )%laction = .TRUE. 
    455          IF ( k_ice <= 1 )  srcv(jpr_ievp)%laction = .FALSE. 
     453         IF( k_ice <= 1 )  srcv(jpr_ievp)%laction = .FALSE. 
    456454      CASE( 'oce and ice'   )   ;   srcv( (/jpr_ievp, jpr_sbpr, jpr_semp, jpr_oemp/) )%laction = .TRUE. 
    457455      CASE default              ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of sn_rcv_emp%cldes' ) 
     
    474472      srcv(jpr_icb)%clname = 'OIceberg'   ;  IF( TRIM( sn_rcv_icb%cldes) == 'coupled' )   srcv(jpr_icb)%laction = .TRUE. 
    475473 
    476       IF( srcv(jpr_isf)%laction .AND. ln_isf ) THEN 
    477          l_isfcpl             = .TRUE.                      ! -> no need to read isf in sbcisf 
     474      IF( srcv(jpr_isf)%laction ) THEN 
     475         l_isfoasis = .TRUE.  ! -> isf fwf comes from oasis 
    478476         IF(lwp) WRITE(numout,*) 
    479477         IF(lwp) WRITE(numout,*) '   iceshelf received from oasis ' 
     478         CALL ctl_stop('STOP','not coded') 
    480479      ENDIF 
    481480      ! 
     
    533532      !                                                      ! ------------------------- ! 
    534533      srcv(jpr_taum)%clname = 'O_TauMod'   ;   IF( TRIM(sn_rcv_taumod%cldes) == 'coupled' )   srcv(jpr_taum)%laction = .TRUE. 
    535       lhftau = srcv(jpr_taum)%laction 
    536534      ! 
    537535      !                                                      ! ------------------------- ! 
     
    558556      srcv(jpr_botm )%clname = 'OBotMlt' 
    559557      IF( TRIM(sn_rcv_iceflx%cldes) == 'coupled' ) THEN 
    560          IF ( TRIM( sn_rcv_iceflx%clcat ) == 'yes' ) THEN 
     558         IF( TRIM( sn_rcv_iceflx%clcat ) == 'yes' ) THEN 
    561559            srcv(jpr_topm:jpr_botm)%nct = nn_cats_cpl 
    562560         ELSE 
     
    569567      !                                                      ! ------------------------- ! 
    570568      srcv(jpr_ts_ice)%clname = 'OTsfIce'    ! needed by Met Office 
    571       IF ( TRIM( sn_rcv_ts_ice%cldes ) == 'ice' )   srcv(jpr_ts_ice)%laction = .TRUE. 
    572       IF ( TRIM( sn_rcv_ts_ice%clcat ) == 'yes' )   srcv(jpr_ts_ice)%nct     = nn_cats_cpl 
    573       IF ( TRIM( sn_rcv_emp%clcat    ) == 'yes' )   srcv(jpr_ievp)%nct       = nn_cats_cpl 
     569      IF( TRIM( sn_rcv_ts_ice%cldes ) == 'ice' )   srcv(jpr_ts_ice)%laction = .TRUE. 
     570      IF( TRIM( sn_rcv_ts_ice%clcat ) == 'yes' )   srcv(jpr_ts_ice)%nct     = nn_cats_cpl 
     571      IF( TRIM( sn_rcv_emp%clcat    ) == 'yes' )   srcv(jpr_ievp)%nct       = nn_cats_cpl 
    574572 
    575573#if defined key_si3 
     
    699697         ! for example O_Runoff received by OPA from SAS and therefore O_Runoff received by SAS from the Atmosphere 
    700698         DO jn = 1, jprcv 
    701             IF ( srcv(jn)%clname(1:1) == "O" ) srcv(jn)%clname = "S"//srcv(jn)%clname(2:LEN(srcv(jn)%clname)) 
     699            IF( srcv(jn)%clname(1:1) == "O" ) srcv(jn)%clname = "S"//srcv(jn)%clname(2:LEN(srcv(jn)%clname)) 
    702700         END DO 
    703701         ! 
     
    726724      ! =================================================== ! 
    727725      DO jn = 1, jprcv 
    728          IF ( srcv(jn)%laction ) ALLOCATE( frcv(jn)%z3(jpi,jpj,srcv(jn)%nct) ) 
     726         IF( srcv(jn)%laction ) ALLOCATE( frcv(jn)%z3(jpi,jpj,srcv(jn)%nct) ) 
    729727      END DO 
    730728      ! Allocate taum part of frcv which is used even when not received as coupling field 
    731       IF ( .NOT. srcv(jpr_taum)%laction ) ALLOCATE( frcv(jpr_taum)%z3(jpi,jpj,srcv(jpr_taum)%nct) ) 
     729      IF( .NOT. srcv(jpr_taum)%laction ) ALLOCATE( frcv(jpr_taum)%z3(jpi,jpj,srcv(jpr_taum)%nct) ) 
    732730      ! Allocate w10m part of frcv which is used even when not received as coupling field 
    733       IF ( .NOT. srcv(jpr_w10m)%laction ) ALLOCATE( frcv(jpr_w10m)%z3(jpi,jpj,srcv(jpr_w10m)%nct) ) 
     731      IF( .NOT. srcv(jpr_w10m)%laction ) ALLOCATE( frcv(jpr_w10m)%z3(jpi,jpj,srcv(jpr_w10m)%nct) ) 
    734732      ! Allocate jpr_otx1 part of frcv which is used even when not received as coupling field 
    735       IF ( .NOT. srcv(jpr_otx1)%laction ) ALLOCATE( frcv(jpr_otx1)%z3(jpi,jpj,srcv(jpr_otx1)%nct) ) 
    736       IF ( .NOT. srcv(jpr_oty1)%laction ) ALLOCATE( frcv(jpr_oty1)%z3(jpi,jpj,srcv(jpr_oty1)%nct) ) 
     733      IF( .NOT. srcv(jpr_otx1)%laction ) ALLOCATE( frcv(jpr_otx1)%z3(jpi,jpj,srcv(jpr_otx1)%nct) ) 
     734      IF( .NOT. srcv(jpr_oty1)%laction ) ALLOCATE( frcv(jpr_oty1)%z3(jpi,jpj,srcv(jpr_oty1)%nct) ) 
    737735      ! Allocate itx1 and ity1 as they are used in sbc_cpl_ice_tau even if srcv(jpr_itx1)%laction = .FALSE. 
    738736      IF( k_ice /= 0 ) THEN 
    739          IF ( .NOT. srcv(jpr_itx1)%laction ) ALLOCATE( frcv(jpr_itx1)%z3(jpi,jpj,srcv(jpr_itx1)%nct) ) 
    740          IF ( .NOT. srcv(jpr_ity1)%laction ) ALLOCATE( frcv(jpr_ity1)%z3(jpi,jpj,srcv(jpr_ity1)%nct) ) 
    741       END IF 
     737         IF( .NOT. srcv(jpr_itx1)%laction ) ALLOCATE( frcv(jpr_itx1)%z3(jpi,jpj,srcv(jpr_itx1)%nct) ) 
     738         IF( .NOT. srcv(jpr_ity1)%laction ) ALLOCATE( frcv(jpr_ity1)%z3(jpi,jpj,srcv(jpr_ity1)%nct) ) 
     739      ENDIF 
    742740 
    743741      ! ================================ ! 
     
    763761      CASE( 'oce and ice' , 'weighted oce and ice' , 'oce and weighted ice' ) 
    764762         ssnd( (/jps_toce, jps_tice/) )%laction = .TRUE. 
    765          IF ( TRIM( sn_snd_temp%clcat ) == 'yes' )  ssnd(jps_tice)%nct = nn_cats_cpl 
     763         IF( TRIM( sn_snd_temp%clcat ) == 'yes' )  ssnd(jps_tice)%nct = nn_cats_cpl 
    766764      CASE( 'mixed oce-ice'                        )   ;   ssnd( jps_tmix )%laction = .TRUE. 
    767765      CASE default   ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of sn_snd_temp%cldes' ) 
     
    783781      !     1. sending mixed oce-ice albedo or 
    784782      !     2. receiving mixed oce-ice solar radiation  
    785       IF ( TRIM ( sn_snd_alb%cldes ) == 'mixed oce-ice' .OR. TRIM ( sn_rcv_qsr%cldes ) == 'mixed oce-ice' ) THEN 
     783      IF( TRIM ( sn_snd_alb%cldes ) == 'mixed oce-ice' .OR. TRIM ( sn_rcv_qsr%cldes ) == 'mixed oce-ice' ) THEN 
    786784         CALL oce_alb( zaos, zacs ) 
    787785         ! Due to lack of information on nebulosity : mean clear/overcast sky 
     
    802800         ssnd(jps_fice1)%laction = .TRUE.                 ! First-order regridded ice concentration, to be used producing atmos-to-ice fluxes (Met Office requirement) 
    803801! Currently no namelist entry to determine sending of multi-category ice fraction so use the thickness entry for now 
    804          IF ( TRIM( sn_snd_thick%clcat  ) == 'yes' ) ssnd(jps_fice)%nct  = nn_cats_cpl 
    805          IF ( TRIM( sn_snd_thick1%clcat ) == 'yes' ) ssnd(jps_fice1)%nct = nn_cats_cpl 
     802         IF( TRIM( sn_snd_thick%clcat  ) == 'yes' ) ssnd(jps_fice)%nct  = nn_cats_cpl 
     803         IF( TRIM( sn_snd_thick1%clcat ) == 'yes' ) ssnd(jps_fice1)%nct = nn_cats_cpl 
    806804      ENDIF 
    807805       
    808       IF (TRIM( sn_snd_ifrac%cldes )  == 'coupled') ssnd(jps_ficet)%laction = .TRUE.  
     806      IF(TRIM( sn_snd_ifrac%cldes )  == 'coupled') ssnd(jps_ficet)%laction = .TRUE.  
    809807 
    810808      SELECT CASE ( TRIM( sn_snd_thick%cldes ) ) 
     
    812810      CASE( 'ice and snow' )  
    813811         ssnd(jps_hice:jps_hsnw)%laction = .TRUE. 
    814          IF ( TRIM( sn_snd_thick%clcat ) == 'yes' ) THEN 
     812         IF( TRIM( sn_snd_thick%clcat ) == 'yes' ) THEN 
    815813            ssnd(jps_hice:jps_hsnw)%nct = nn_cats_cpl 
    816814         ENDIF 
    817815      CASE ( 'weighted ice and snow' )  
    818816         ssnd(jps_hice:jps_hsnw)%laction = .TRUE. 
    819          IF ( TRIM( sn_snd_thick%clcat ) == 'yes' ) ssnd(jps_hice:jps_hsnw)%nct = nn_cats_cpl 
     817         IF( TRIM( sn_snd_thick%clcat ) == 'yes' ) ssnd(jps_hice:jps_hsnw)%nct = nn_cats_cpl 
    820818      CASE default   ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of sn_snd_thick%cldes' ) 
    821819      END SELECT 
     
    834832         ssnd(jps_a_p)%laction  = .TRUE.  
    835833         ssnd(jps_ht_p)%laction = .TRUE.  
    836          IF ( TRIM( sn_snd_mpnd%clcat ) == 'yes' ) THEN  
     834         IF( TRIM( sn_snd_mpnd%clcat ) == 'yes' ) THEN  
    837835            ssnd(jps_a_p)%nct  = nn_cats_cpl  
    838836            ssnd(jps_ht_p)%nct = nn_cats_cpl  
    839837         ELSE  
    840             IF ( nn_cats_cpl > 1 ) THEN  
     838            IF( nn_cats_cpl > 1 ) THEN  
    841839               CALL ctl_stop( 'sbc_cpl_init: use weighted ice option for sn_snd_mpnd%cldes if not exchanging category fields' )  
    842840            ENDIF  
     
    845843         ssnd(jps_a_p)%laction  = .TRUE.  
    846844         ssnd(jps_ht_p)%laction = .TRUE.  
    847          IF ( TRIM( sn_snd_mpnd%clcat ) == 'yes' ) THEN  
     845         IF( TRIM( sn_snd_mpnd%clcat ) == 'yes' ) THEN  
    848846            ssnd(jps_a_p)%nct  = nn_cats_cpl   
    849847            ssnd(jps_ht_p)%nct = nn_cats_cpl   
     
    919917      CASE ( 'ice only' )  
    920918         ssnd(jps_ttilyr)%laction = .TRUE.  
    921          IF ( TRIM( sn_snd_ttilyr%clcat ) == 'yes' ) THEN  
     919         IF( TRIM( sn_snd_ttilyr%clcat ) == 'yes' ) THEN  
    922920            ssnd(jps_ttilyr)%nct = nn_cats_cpl  
    923921         ELSE  
    924             IF ( nn_cats_cpl > 1 ) THEN  
     922            IF( nn_cats_cpl > 1 ) THEN  
    925923               CALL ctl_stop( 'sbc_cpl_init: use weighted ice option for sn_snd_ttilyr%cldes if not exchanging category fields' )  
    926924            ENDIF  
     
    928926      CASE ( 'weighted ice' )  
    929927         ssnd(jps_ttilyr)%laction = .TRUE.  
    930          IF ( TRIM( sn_snd_ttilyr%clcat ) == 'yes' ) ssnd(jps_ttilyr)%nct = nn_cats_cpl  
     928         IF( TRIM( sn_snd_ttilyr%clcat ) == 'yes' ) ssnd(jps_ttilyr)%nct = nn_cats_cpl  
    931929      CASE default   ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of sn_snd_ttilyr%cldes;'//sn_snd_ttilyr%cldes )  
    932930      END SELECT  
     
    938936      CASE ( 'ice only' )  
    939937         ssnd(jps_kice)%laction = .TRUE.  
    940          IF ( TRIM( sn_snd_cond%clcat ) == 'yes' ) THEN  
     938         IF( TRIM( sn_snd_cond%clcat ) == 'yes' ) THEN  
    941939            ssnd(jps_kice)%nct = nn_cats_cpl  
    942940         ELSE  
    943             IF ( nn_cats_cpl > 1 ) THEN  
     941            IF( nn_cats_cpl > 1 ) THEN  
    944942               CALL ctl_stop( 'sbc_cpl_init: use weighted ice option for sn_snd_cond%cldes if not exchanging category fields' )  
    945943            ENDIF  
     
    947945      CASE ( 'weighted ice' )  
    948946         ssnd(jps_kice)%laction = .TRUE.  
    949          IF ( TRIM( sn_snd_cond%clcat ) == 'yes' ) ssnd(jps_kice)%nct = nn_cats_cpl  
     947         IF( TRIM( sn_snd_cond%clcat ) == 'yes' ) ssnd(jps_kice)%nct = nn_cats_cpl  
    950948      CASE default   ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of sn_snd_cond%cldes;'//sn_snd_cond%cldes )  
    951949      END SELECT  
     
    10081006         ! for example O_SSTSST sent by OPA to SAS and therefore S_SSTSST sent by SAS to the Atmosphere 
    10091007         DO jn = 1, jpsnd 
    1010             IF ( ssnd(jn)%clname(1:1) == "O" ) ssnd(jn)%clname = "S"//ssnd(jn)%clname(2:LEN(ssnd(jn)%clname)) 
     1008            IF( ssnd(jn)%clname(1:1) == "O" ) ssnd(jn)%clname = "S"//ssnd(jn)%clname(2:LEN(ssnd(jn)%clname)) 
    10111009         END DO 
    10121010         ! 
     
    10351033      CALL cpl_define(jprcv, jpsnd, nn_cplmodel) 
    10361034       
    1037       IF (ln_usecplmask) THEN  
     1035      IF(ln_usecplmask) THEN  
    10381036         xcplmask(:,:,:) = 0. 
    10391037         CALL iom_open( 'cplmask', inum ) 
     
    10491047 
    10501048 
    1051    SUBROUTINE sbc_cpl_rcv( kt, k_fsbc, k_ice )      
     1049   SUBROUTINE sbc_cpl_rcv( kt, k_fsbc, k_ice, Kbb, Kmm )      
    10521050      !!---------------------------------------------------------------------- 
    10531051      !!             ***  ROUTINE sbc_cpl_rcv  *** 
     
    10991097      INTEGER, INTENT(in) ::   k_fsbc      ! frequency of sbc (-> ice model) computation  
    11001098      INTEGER, INTENT(in) ::   k_ice       ! ice management in the sbc (=0/1/2/3) 
     1099      INTEGER, INTENT(in) ::   Kbb, Kmm    ! ocean model time level indices 
    11011100      !! 
    11021101      LOGICAL  ::   llnewtx, llnewtau      ! update wind stress components and module?? 
     
    11661165            !                               
    11671166            IF( srcv(jpr_otx1)%clgrid == 'T' ) THEN 
    1168                DO jj = 2, jpjm1                                          ! T ==> (U,V) 
    1169                   DO ji = fs_2, fs_jpim1   ! vector opt. 
    1170                      frcv(jpr_otx1)%z3(ji,jj,1) = 0.5 * ( frcv(jpr_otx1)%z3(ji+1,jj  ,1) + frcv(jpr_otx1)%z3(ji,jj,1) ) 
    1171                      frcv(jpr_oty1)%z3(ji,jj,1) = 0.5 * ( frcv(jpr_oty1)%z3(ji  ,jj+1,1) + frcv(jpr_oty1)%z3(ji,jj,1) ) 
    1172                   END DO 
    1173                END DO 
     1167               DO_2D_00_00 
     1168                  frcv(jpr_otx1)%z3(ji,jj,1) = 0.5 * ( frcv(jpr_otx1)%z3(ji+1,jj  ,1) + frcv(jpr_otx1)%z3(ji,jj,1) ) 
     1169                  frcv(jpr_oty1)%z3(ji,jj,1) = 0.5 * ( frcv(jpr_oty1)%z3(ji  ,jj+1,1) + frcv(jpr_oty1)%z3(ji,jj,1) ) 
     1170               END_2D 
    11741171               CALL lbc_lnk_multi( 'sbccpl', frcv(jpr_otx1)%z3(:,:,1), 'U',  -1., frcv(jpr_oty1)%z3(:,:,1), 'V',  -1. ) 
    11751172            ENDIF 
     
    11921189         ! => need to be done only when otx1 was changed 
    11931190         IF( llnewtx ) THEN 
    1194             DO jj = 2, jpjm1 
    1195                DO ji = fs_2, fs_jpim1   ! vect. opt. 
    1196                   zzx = frcv(jpr_otx1)%z3(ji-1,jj  ,1) + frcv(jpr_otx1)%z3(ji,jj,1) 
    1197                   zzy = frcv(jpr_oty1)%z3(ji  ,jj-1,1) + frcv(jpr_oty1)%z3(ji,jj,1) 
    1198                   frcv(jpr_taum)%z3(ji,jj,1) = 0.5 * SQRT( zzx * zzx + zzy * zzy ) 
    1199                END DO 
    1200             END DO 
     1191            DO_2D_00_00 
     1192               zzx = frcv(jpr_otx1)%z3(ji-1,jj  ,1) + frcv(jpr_otx1)%z3(ji,jj,1) 
     1193               zzy = frcv(jpr_oty1)%z3(ji  ,jj-1,1) + frcv(jpr_oty1)%z3(ji,jj,1) 
     1194               frcv(jpr_taum)%z3(ji,jj,1) = 0.5 * SQRT( zzx * zzx + zzy * zzy ) 
     1195            END_2D 
    12011196            CALL lbc_lnk( 'sbccpl', frcv(jpr_taum)%z3(:,:,1), 'T', 1. ) 
    12021197            llnewtau = .TRUE. 
     
    12191214         IF( llnewtau ) THEN  
    12201215            zcoef = 1. / ( zrhoa * zcdrag )  
    1221             DO jj = 1, jpj 
    1222                DO ji = 1, jpi  
    1223                   frcv(jpr_w10m)%z3(ji,jj,1) = SQRT( frcv(jpr_taum)%z3(ji,jj,1) * zcoef ) 
    1224                END DO 
    1225             END DO 
     1216            DO_2D_11_11 
     1217               frcv(jpr_w10m)%z3(ji,jj,1) = SQRT( frcv(jpr_taum)%z3(ji,jj,1) * zcoef ) 
     1218            END_2D 
    12261219         ENDIF 
    12271220      ENDIF 
     
    12621255     
    12631256          IF( kt == nit000 ) ssh_ibb(:,:) = ssh_ib(:,:)  ! correct this later (read from restart if possible)  
    1264       END IF  
     1257      ENDIF  
    12651258      ! 
    12661259      IF( ln_sdw ) THEN  ! Stokes Drift correction activated 
     
    12981291         IF( srcv(jpr_sdrftx)%laction .OR. srcv(jpr_sdrfty)%laction .OR. srcv(jpr_wper)%laction & 
    12991292                                      .OR. srcv(jpr_hsig)%laction   .OR. srcv(jpr_wfreq)%laction) THEN 
    1300             CALL sbc_stokes() 
     1293            CALL sbc_stokes( Kmm ) 
    13011294         ENDIF 
    13021295      ENDIF 
     
    13501343      IF( srcv(jpr_ocx1)%laction ) THEN                      ! received by sas in case of opa <-> sas coupling 
    13511344         ssu_m(:,:) = frcv(jpr_ocx1)%z3(:,:,1) 
    1352          ub (:,:,1) = ssu_m(:,:)                             ! will be used in icestp in the call of ice_forcing_tau 
    1353          un (:,:,1) = ssu_m(:,:)                             ! will be used in sbc_cpl_snd if atmosphere coupling 
     1345         uu(:,:,1,Kbb) = ssu_m(:,:)                          ! will be used in icestp in the call of ice_forcing_tau 
     1346         uu(:,:,1,Kmm) = ssu_m(:,:)                          ! will be used in sbc_cpl_snd if atmosphere coupling 
    13541347         CALL iom_put( 'ssu_m', ssu_m ) 
    13551348      ENDIF 
    13561349      IF( srcv(jpr_ocy1)%laction ) THEN 
    13571350         ssv_m(:,:) = frcv(jpr_ocy1)%z3(:,:,1) 
    1358          vb (:,:,1) = ssv_m(:,:)                             ! will be used in icestp in the call of ice_forcing_tau 
    1359          vn (:,:,1) = ssv_m(:,:)                             ! will be used in sbc_cpl_snd if atmosphere coupling 
     1351         vv(:,:,1,Kbb) = ssv_m(:,:)                          ! will be used in icestp in the call of ice_forcing_tau 
     1352         vv(:,:,1,Kmm) = ssv_m(:,:)                          ! will be used in sbc_cpl_snd if atmosphere coupling 
    13601353         CALL iom_put( 'ssv_m', ssv_m ) 
    13611354      ENDIF 
     
    14011394             rnf(:,:)    = rnf(:,:) + fwficb(:,:)   ! iceberg added to runfofs 
    14021395         ENDIF 
    1403          IF( srcv(jpr_isf)%laction )  fwfisf(:,:) = - frcv(jpr_isf)%z3(:,:,1)  ! fresh water flux from the isf (fwfisf <0 mean melting)   
     1396         ! 
     1397         ! ice shelf fwf 
     1398         IF( srcv(jpr_isf)%laction )  THEN 
     1399            fwfisf_oasis(:,:) = - frcv(jpr_isf)%z3(:,:,1)  ! fresh water flux from the isf (fwfisf <0 mean melting)   
     1400         END IF 
    14041401         
    14051402         IF( ln_mixcpl ) THEN   ;   emp(:,:) = emp(:,:) * xcplmask(:,:,0) + zemp(:,:) * zmsk(:,:) 
     
    14111408         ELSE IF( srcv(jpr_qnsmix)%laction ) THEN   ;   zqns(:,:) = frcv(jpr_qnsmix)%z3(:,:,1) 
    14121409         ELSE                                       ;   zqns(:,:) = 0._wp 
    1413          END IF 
     1410         ENDIF 
    14141411         ! update qns over the free ocean with: 
    14151412         IF( nn_components /= jp_iam_opa ) THEN 
     
    15461543            p_tauj(:,:) = frcv(jpr_ity1)%z3(:,:,1) 
    15471544         CASE( 'F' ) 
    1548             DO jj = 2, jpjm1                                   ! F ==> (U,V) 
    1549                DO ji = fs_2, fs_jpim1   ! vector opt. 
    1550                   p_taui(ji,jj) = 0.5 * ( frcv(jpr_itx1)%z3(ji,jj,1) + frcv(jpr_itx1)%z3(ji  ,jj-1,1) ) 
    1551                   p_tauj(ji,jj) = 0.5 * ( frcv(jpr_ity1)%z3(ji,jj,1) + frcv(jpr_ity1)%z3(ji-1,jj  ,1) ) 
    1552                END DO 
    1553             END DO 
     1545            DO_2D_00_00 
     1546               p_taui(ji,jj) = 0.5 * ( frcv(jpr_itx1)%z3(ji,jj,1) + frcv(jpr_itx1)%z3(ji  ,jj-1,1) ) 
     1547               p_tauj(ji,jj) = 0.5 * ( frcv(jpr_ity1)%z3(ji,jj,1) + frcv(jpr_ity1)%z3(ji-1,jj  ,1) ) 
     1548            END_2D 
    15541549         CASE( 'T' ) 
    1555             DO jj = 2, jpjm1                                   ! T ==> (U,V) 
    1556                DO ji = fs_2, fs_jpim1   ! vector opt. 
    1557                   p_taui(ji,jj) = 0.5 * ( frcv(jpr_itx1)%z3(ji+1,jj  ,1) + frcv(jpr_itx1)%z3(ji,jj,1) ) 
    1558                   p_tauj(ji,jj) = 0.5 * ( frcv(jpr_ity1)%z3(ji  ,jj+1,1) + frcv(jpr_ity1)%z3(ji,jj,1) ) 
    1559                END DO 
    1560             END DO 
     1550            DO_2D_00_00 
     1551               p_taui(ji,jj) = 0.5 * ( frcv(jpr_itx1)%z3(ji+1,jj  ,1) + frcv(jpr_itx1)%z3(ji,jj,1) ) 
     1552               p_tauj(ji,jj) = 0.5 * ( frcv(jpr_ity1)%z3(ji  ,jj+1,1) + frcv(jpr_ity1)%z3(ji,jj,1) ) 
     1553            END_2D 
    15611554         CASE( 'I' ) 
    1562             DO jj = 2, jpjm1                                   ! I ==> (U,V) 
    1563                DO ji = 2, jpim1   ! NO vector opt. 
    1564                   p_taui(ji,jj) = 0.5 * ( frcv(jpr_itx1)%z3(ji+1,jj+1,1) + frcv(jpr_itx1)%z3(ji+1,jj  ,1) ) 
    1565                   p_tauj(ji,jj) = 0.5 * ( frcv(jpr_ity1)%z3(ji+1,jj+1,1) + frcv(jpr_ity1)%z3(ji  ,jj+1,1) ) 
    1566                END DO 
    1567             END DO 
     1555            DO_2D_00_00 
     1556               p_taui(ji,jj) = 0.5 * ( frcv(jpr_itx1)%z3(ji+1,jj+1,1) + frcv(jpr_itx1)%z3(ji+1,jj  ,1) ) 
     1557               p_tauj(ji,jj) = 0.5 * ( frcv(jpr_ity1)%z3(ji+1,jj+1,1) + frcv(jpr_ity1)%z3(ji  ,jj+1,1) ) 
     1558            END_2D 
    15681559         END SELECT 
    15691560         IF( srcv(jpr_itx1)%clgrid /= 'U' ) THEN  
     
    16831674      ! --- evaporation over ice (kg/m2/s) --- ! 
    16841675      DO jl=1,jpl 
    1685          IF (sn_rcv_emp%clcat == 'yes') THEN   ;   zevap_ice(:,:,jl) = frcv(jpr_ievp)%z3(:,:,jl) 
     1676         IF(sn_rcv_emp%clcat == 'yes') THEN   ;   zevap_ice(:,:,jl) = frcv(jpr_ievp)%z3(:,:,jl) 
    16861677         ELSE                                  ;   zevap_ice(:,:,jl) = frcv(jpr_ievp)%z3(:,:,1 )   ;   ENDIF 
    16871678      ENDDO 
     
    17041695      ENDIF 
    17051696      IF( srcv(jpr_isf)%laction ) THEN   ! iceshelf (fwfisf <0 mean melting) 
    1706         fwfisf(:,:) = - frcv(jpr_isf)%z3(:,:,1)   
     1697        fwfisf_oasis(:,:) = - frcv(jpr_isf)%z3(:,:,1)   
    17071698      ENDIF 
    17081699 
     
    17431734      ENDIF 
    17441735      IF( srcv(jpr_isf)%laction ) THEN   ! iceshelf (fwfisf <0 mean melting) 
    1745         fwfisf(:,:) = - frcv(jpr_isf)%z3(:,:,1) 
     1736        fwfisf_oasis(:,:) = - frcv(jpr_isf)%z3(:,:,1) 
    17461737      ENDIF 
    17471738      ! 
     
    17651756      IF( srcv(jpr_cal)%laction )   CALL iom_put( 'calving_cea' , frcv(jpr_cal)%z3(:,:,1) * tmask(:,:,1)                )  ! calving 
    17661757      IF( srcv(jpr_icb)%laction )   CALL iom_put( 'iceberg_cea' , frcv(jpr_icb)%z3(:,:,1) * tmask(:,:,1)                )  ! icebergs 
    1767       CALL iom_put( 'snowpre'     , sprecip(:,:)                                          )  ! Snow 
    1768       CALL iom_put( 'precip'      , tprecip(:,:)                                          )  ! total  precipitation 
    1769       IF ( iom_use('rain') ) CALL iom_put( 'rain'        , tprecip(:,:) - sprecip(:,:)                           )  ! liquid precipitation  
    1770       IF ( iom_use('snow_ao_cea') ) CALL iom_put( 'snow_ao_cea' , sprecip(:,:) * ( 1._wp - zsnw(:,:) )                  )  ! Snow over ice-free ocean  (cell average) 
    1771       IF ( iom_use('snow_ai_cea') ) CALL iom_put( 'snow_ai_cea' , sprecip(:,:) *           zsnw(:,:)                    )  ! Snow over sea-ice         (cell average) 
    1772       IF ( iom_use('rain_ao_cea') ) CALL iom_put( 'rain_ao_cea' , ( tprecip(:,:) - sprecip(:,:) ) * picefr(:,:)         )  ! liquid precipitation over ocean (cell average) 
    1773       IF ( iom_use('subl_ai_cea') ) CALL iom_put( 'subl_ai_cea' , frcv(jpr_ievp)%z3(:,:,1) * picefr(:,:) * tmask(:,:,1) )  ! Sublimation over sea-ice (cell average) 
    1774       IF ( iom_use('evap_ao_cea') ) CALL iom_put( 'evap_ao_cea' , ( frcv(jpr_tevp)%z3(:,:,1)  & 
     1758      IF( iom_use('snowpre') )      CALL iom_put( 'snowpre'     , sprecip(:,:)                                          )  ! Snow 
     1759      IF( iom_use('precip') )       CALL iom_put( 'precip'      , tprecip(:,:)                                          )  ! total  precipitation 
     1760      IF( iom_use('rain') )        CALL iom_put( 'rain'        , tprecip(:,:) - sprecip(:,:)                           )  ! liquid precipitation  
     1761      IF( iom_use('snow_ao_cea') ) CALL iom_put( 'snow_ao_cea' , sprecip(:,:) * ( 1._wp - zsnw(:,:) )                  )  ! Snow over ice-free ocean  (cell average) 
     1762      IF( iom_use('snow_ai_cea') ) CALL iom_put( 'snow_ai_cea' , sprecip(:,:) *           zsnw(:,:)                    )  ! Snow over sea-ice         (cell average) 
     1763      IF( iom_use('rain_ao_cea') ) CALL iom_put( 'rain_ao_cea' , ( tprecip(:,:) - sprecip(:,:) ) * picefr(:,:)         )  ! liquid precipitation over ocean (cell average) 
     1764      IF( iom_use('subl_ai_cea') ) CALL iom_put( 'subl_ai_cea' , frcv(jpr_ievp)%z3(:,:,1) * picefr(:,:) * tmask(:,:,1) )  ! Sublimation over sea-ice (cell average) 
     1765      IF( iom_use('evap_ao_cea') ) CALL iom_put( 'evap_ao_cea' , ( frcv(jpr_tevp)%z3(:,:,1)  & 
    17751766         &                                                        - frcv(jpr_ievp)%z3(:,:,1) * picefr(:,:) ) * tmask(:,:,1) )  ! ice-free oce evap (cell average) 
    17761767      ! note: runoff output is done in sbcrnf (which includes icebergs too) and iceshelf output is done in sbcisf 
     
    17831774      CASE( 'conservative' )     ! the required fields are directly provided 
    17841775         zqns_tot(:,:) = frcv(jpr_qnsmix)%z3(:,:,1) 
    1785          IF ( TRIM(sn_rcv_qns%clcat) == 'yes' ) THEN 
     1776         IF( TRIM(sn_rcv_qns%clcat) == 'yes' ) THEN 
    17861777            zqns_ice(:,:,1:jpl) = frcv(jpr_qnsice)%z3(:,:,1:jpl) 
    17871778         ELSE 
     
    17921783      CASE( 'oce and ice' )      ! the total flux is computed from ocean and ice fluxes 
    17931784         zqns_tot(:,:) =  ziceld(:,:) * frcv(jpr_qnsoce)%z3(:,:,1) 
    1794          IF ( TRIM(sn_rcv_qns%clcat) == 'yes' ) THEN 
     1785         IF( TRIM(sn_rcv_qns%clcat) == 'yes' ) THEN 
    17951786            DO jl=1,jpl 
    17961787               zqns_tot(:,:   ) = zqns_tot(:,:) + a_i(:,:,jl) * frcv(jpr_qnsice)%z3(:,:,jl)    
     
    19041895#endif 
    19051896      ! outputs 
    1906       IF ( srcv(jpr_cal)%laction ) CALL iom_put('hflx_cal_cea'    , - frcv(jpr_cal)%z3(:,:,1) * rLfus )   ! latent heat from calving 
    1907       IF ( srcv(jpr_icb)%laction ) CALL iom_put('hflx_icb_cea'    , - frcv(jpr_icb)%z3(:,:,1) * rLfus )   ! latent heat from icebergs melting 
    1908       IF ( iom_use(   'hflx_rain_cea') ) CALL iom_put('hflx_rain_cea' , ( tprecip(:,:) - sprecip(:,:) ) * zcptrain(:,:) )        ! heat flux from rain (cell average) 
    1909       IF ( iom_use(   'hflx_evap_cea') ) CALL iom_put('hflx_evap_cea' , ( frcv(jpr_tevp)%z3(:,:,1) - frcv(jpr_ievp)%z3(:,:,1) * picefr(:,:) )  & 
    1910            &                         * zcptn(:,:) * tmask(:,:,1) )            ! heat flux from evap (cell average) 
    1911       IF ( iom_use(   'hflx_prec_cea') ) CALL iom_put('hflx_prec_cea' ,    sprecip(:,:) * ( zcptsnw(:,:) - rLfus )  &                    ! heat flux from all precip (cell avg) 
    1912          &                          + ( tprecip(:,:) - sprecip(:,:) ) * zcptrain(:,:) ) 
    1913       IF ( iom_use(   'hflx_snow_cea') ) CALL iom_put('hflx_snow_cea'   , sprecip(:,:) * ( zcptsnw(:,:) - rLfus )  )               ! heat flux from snow (cell average) 
    1914       IF ( iom_use('hflx_snow_ao_cea') ) CALL iom_put('hflx_snow_ao_cea', sprecip(:,:) * ( zcptsnw(:,:) - rLfus ) * ( 1._wp - zsnw(:,:) ) )   ! heat flux from snow (over ocean) 
    1915       IF ( iom_use('hflx_snow_ai_cea') ) CALL iom_put('hflx_snow_ai_cea', sprecip(:,:) * ( zcptsnw(:,:) - rLfus ) *  zsnw(:,:) )              ! heat flux from snow (over ice) 
     1897      IF( srcv(jpr_cal)%laction       ) CALL iom_put('hflx_cal_cea'    , - frcv(jpr_cal)%z3(:,:,1) * rLfus )                      ! latent heat from calving 
     1898      IF( srcv(jpr_icb)%laction       ) CALL iom_put('hflx_icb_cea'    , - frcv(jpr_icb)%z3(:,:,1) * rLfus )                      ! latent heat from icebergs melting 
     1899      IF( iom_use('hflx_rain_cea')    ) CALL iom_put('hflx_rain_cea'   , ( tprecip(:,:) - sprecip(:,:) ) * zcptrain(:,:) )        ! heat flux from rain (cell average) 
     1900      IF( iom_use('hflx_evap_cea')    ) CALL iom_put('hflx_evap_cea'   , ( frcv(jpr_tevp)%z3(:,:,1) - frcv(jpr_ievp)%z3(:,:,1) & 
     1901           &                                                              * picefr(:,:) ) * zcptn(:,:) * tmask(:,:,1) )            ! heat flux from evap (cell average) 
     1902      IF( iom_use('hflx_prec_cea')    ) CALL iom_put('hflx_prec_cea'   ,  sprecip(:,:) * ( zcptsnw(:,:) - rLfus ) +  &                    ! heat flux from all precip (cell avg) 
     1903         &                                                               ( tprecip(:,:) - sprecip(:,:) ) * zcptrain(:,:) ) 
     1904      IF( iom_use('hflx_snow_cea')    ) CALL iom_put('hflx_snow_cea'   , sprecip(:,:) * ( zcptsnw(:,:) - rLfus )  )               ! heat flux from snow (cell average) 
     1905      IF( iom_use('hflx_snow_ao_cea') ) CALL iom_put('hflx_snow_ao_cea', sprecip(:,:) * ( zcptsnw(:,:) - rLfus ) & 
     1906           &                                                              * ( 1._wp - zsnw(:,:) )                  )               ! heat flux from snow (over ocean) 
     1907      IF( iom_use('hflx_snow_ai_cea') ) CALL iom_put('hflx_snow_ai_cea', sprecip(:,:) * ( zcptsnw(:,:) - rLfus ) &  
     1908           &                                                              *           zsnw(:,:)                    )               ! heat flux from snow (over ice) 
    19161909      ! note: hflx for runoff and iceshelf are done in sbcrnf and sbcisf resp. 
    19171910      ! 
     
    19231916      CASE( 'conservative' ) 
    19241917         zqsr_tot(:,:  ) = frcv(jpr_qsrmix)%z3(:,:,1) 
    1925          IF ( TRIM(sn_rcv_qsr%clcat) == 'yes' ) THEN 
     1918         IF( TRIM(sn_rcv_qsr%clcat) == 'yes' ) THEN 
    19261919            zqsr_ice(:,:,1:jpl) = frcv(jpr_qsrice)%z3(:,:,1:jpl) 
    19271920         ELSE 
     
    19331926      CASE( 'oce and ice' ) 
    19341927         zqsr_tot(:,:  ) =  ziceld(:,:) * frcv(jpr_qsroce)%z3(:,:,1) 
    1935          IF ( TRIM(sn_rcv_qsr%clcat) == 'yes' ) THEN 
     1928         IF( TRIM(sn_rcv_qsr%clcat) == 'yes' ) THEN 
    19361929            DO jl = 1, jpl 
    19371930               zqsr_tot(:,:   ) = zqsr_tot(:,:) + a_i(:,:,jl) * frcv(jpr_qsrice)%z3(:,:,jl)    
     
    19991992      !                                                      ! ========================= ! 
    20001993      CASE ('coupled') 
    2001          IF ( TRIM(sn_rcv_dqnsdt%clcat) == 'yes' ) THEN 
     1994         IF( TRIM(sn_rcv_dqnsdt%clcat) == 'yes' ) THEN 
    20021995            zdqns_ice(:,:,1:jpl) = frcv(jpr_dqnsdt)%z3(:,:,1:jpl) 
    20031996         ELSE 
     
    20882081    
    20892082    
    2090    SUBROUTINE sbc_cpl_snd( kt ) 
     2083   SUBROUTINE sbc_cpl_snd( kt, Kbb, Kmm ) 
    20912084      !!---------------------------------------------------------------------- 
    20922085      !!             ***  ROUTINE sbc_cpl_snd  *** 
     
    20982091      !!---------------------------------------------------------------------- 
    20992092      INTEGER, INTENT(in) ::   kt 
     2093      INTEGER, INTENT(in) ::   Kbb, Kmm    ! ocean model time level index 
    21002094      ! 
    21012095      INTEGER ::   ji, jj, jl   ! dummy loop indices 
     
    21142108      IF( ssnd(jps_toce)%laction .OR. ssnd(jps_tice)%laction .OR. ssnd(jps_tmix)%laction ) THEN 
    21152109          
    2116          IF ( nn_components == jp_iam_opa ) THEN 
    2117             ztmp1(:,:) = tsn(:,:,1,jp_tem)   ! send temperature as it is (potential or conservative) -> use of l_useCT on the received part 
     2110         IF( nn_components == jp_iam_opa ) THEN 
     2111            ztmp1(:,:) = ts(:,:,1,jp_tem,Kmm)   ! send temperature as it is (potential or conservative) -> use of l_useCT on the received part 
    21182112         ELSE 
    21192113            ! we must send the surface potential temperature  
    2120             IF( l_useCT )  THEN    ;   ztmp1(:,:) = eos_pt_from_ct( tsn(:,:,1,jp_tem), tsn(:,:,1,jp_sal) ) 
    2121             ELSE                   ;   ztmp1(:,:) = tsn(:,:,1,jp_tem) 
     2114            IF( l_useCT )  THEN    ;   ztmp1(:,:) = eos_pt_from_ct( ts(:,:,1,jp_tem,Kmm), ts(:,:,1,jp_sal,Kmm) ) 
     2115            ELSE                   ;   ztmp1(:,:) = ts(:,:,1,jp_tem,Kmm) 
    21222116            ENDIF 
    21232117            ! 
     
    21472141               CASE default                  ;   CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_temp%clcat' ) 
    21482142               END SELECT 
    2149             CASE( 'oce and weighted ice')    ;   ztmp1(:,:) =   tsn(:,:,1,jp_tem) + rt0   
     2143            CASE( 'oce and weighted ice')    ;   ztmp1(:,:) =   ts(:,:,1,jp_tem,Kmm) + rt0   
    21502144               SELECT CASE( sn_snd_temp%clcat )  
    21512145               CASE( 'yes' )     
     
    23532347      !                                                      !  CO2 flux from PISCES     !  
    23542348      !                                                      ! ------------------------- ! 
    2355       IF( ssnd(jps_co2)%laction .AND. l_co2cpl )   THEN   
    2356          ztmp1(:,:) = oce_co2(:,:) * 1000.  ! conversion in molC/m2/s  
    2357          CALL cpl_snd( jps_co2, isec, RESHAPE ( ztmp1, (/jpi,jpj,1/) ) , info )  
    2358       ENDIF  
     2349      IF( ssnd(jps_co2)%laction .AND. l_co2cpl )   THEN  
     2350         ztmp1(:,:) = oce_co2(:,:) * 1000.  ! conversion in molC/m2/s 
     2351         CALL cpl_snd( jps_co2, isec, RESHAPE ( ztmp1, (/jpi,jpj,1/) ) , info ) 
     2352      ENDIF 
    23592353      ! 
    23602354      !                                                      ! ------------------------- ! 
     
    23712365         !                                                               i      i+1 (for I) 
    23722366         IF( nn_components == jp_iam_opa ) THEN 
    2373             zotx1(:,:) = un(:,:,1 
    2374             zoty1(:,:) = vn(:,:,1 
     2367            zotx1(:,:) = uu(:,:,1,Kmm 
     2368            zoty1(:,:) = vv(:,:,1,Kmm 
    23752369         ELSE         
    23762370            SELECT CASE( TRIM( sn_snd_crt%cldes ) ) 
    23772371            CASE( 'oce only'             )      ! C-grid ==> T 
    2378                DO jj = 2, jpjm1 
    2379                   DO ji = fs_2, fs_jpim1   ! vector opt. 
    2380                      zotx1(ji,jj) = 0.5 * ( un(ji,jj,1) + un(ji-1,jj  ,1) ) 
    2381                      zoty1(ji,jj) = 0.5 * ( vn(ji,jj,1) + vn(ji  ,jj-1,1) )  
    2382                   END DO 
    2383                END DO 
     2372               DO_2D_00_00 
     2373                  zotx1(ji,jj) = 0.5 * ( uu(ji,jj,1,Kmm) + uu(ji-1,jj  ,1,Kmm) ) 
     2374                  zoty1(ji,jj) = 0.5 * ( vv(ji,jj,1,Kmm) + vv(ji  ,jj-1,1,Kmm) )  
     2375               END_2D 
    23842376            CASE( 'weighted oce and ice' )      ! Ocean and Ice on C-grid ==> T   
    2385                DO jj = 2, jpjm1 
    2386                   DO ji = fs_2, fs_jpim1   ! vector opt. 
    2387                      zotx1(ji,jj) = 0.5 * ( un   (ji,jj,1) + un   (ji-1,jj  ,1) ) * zfr_l(ji,jj)   
    2388                      zoty1(ji,jj) = 0.5 * ( vn   (ji,jj,1) + vn   (ji  ,jj-1,1) ) * zfr_l(ji,jj) 
    2389                      zitx1(ji,jj) = 0.5 * ( u_ice(ji,jj  ) + u_ice(ji-1,jj    ) ) *  fr_i(ji,jj) 
    2390                      zity1(ji,jj) = 0.5 * ( v_ice(ji,jj  ) + v_ice(ji  ,jj-1  ) ) *  fr_i(ji,jj) 
    2391                   END DO 
    2392                END DO 
     2377               DO_2D_00_00 
     2378                  zotx1(ji,jj) = 0.5 * ( uu   (ji,jj,1,Kmm) + uu   (ji-1,jj  ,1,Kmm) ) * zfr_l(ji,jj)   
     2379                  zoty1(ji,jj) = 0.5 * ( vv   (ji,jj,1,Kmm) + vv   (ji  ,jj-1,1,Kmm) ) * zfr_l(ji,jj) 
     2380                  zitx1(ji,jj) = 0.5 * ( u_ice(ji,jj  )     + u_ice(ji-1,jj    )     ) *  fr_i(ji,jj) 
     2381                  zity1(ji,jj) = 0.5 * ( v_ice(ji,jj  )     + v_ice(ji  ,jj-1  )     ) *  fr_i(ji,jj) 
     2382               END_2D 
    23932383               CALL lbc_lnk_multi( 'sbccpl', zitx1, 'T', -1., zity1, 'T', -1. ) 
    23942384            CASE( 'mixed oce-ice'        )      ! Ocean and Ice on C-grid ==> T 
    2395                DO jj = 2, jpjm1 
    2396                   DO ji = fs_2, fs_jpim1   ! vector opt. 
    2397                      zotx1(ji,jj) = 0.5 * ( un   (ji,jj,1) + un   (ji-1,jj  ,1) ) * zfr_l(ji,jj)   & 
    2398                         &         + 0.5 * ( u_ice(ji,jj  ) + u_ice(ji-1,jj    ) ) *  fr_i(ji,jj) 
    2399                      zoty1(ji,jj) = 0.5 * ( vn   (ji,jj,1) + vn   (ji  ,jj-1,1) ) * zfr_l(ji,jj)   & 
    2400                         &         + 0.5 * ( v_ice(ji,jj  ) + v_ice(ji  ,jj-1  ) ) *  fr_i(ji,jj) 
    2401                   END DO 
    2402                END DO 
     2385               DO_2D_00_00 
     2386                  zotx1(ji,jj) = 0.5 * ( uu   (ji,jj,1,Kmm) + uu   (ji-1,jj  ,1,Kmm) ) * zfr_l(ji,jj)   & 
     2387                     &         + 0.5 * ( u_ice(ji,jj  )     + u_ice(ji-1,jj    )     ) *  fr_i(ji,jj) 
     2388                  zoty1(ji,jj) = 0.5 * ( vv   (ji,jj,1,Kmm) + vv   (ji  ,jj-1,1,Kmm) ) * zfr_l(ji,jj)   & 
     2389                     &         + 0.5 * ( v_ice(ji,jj  )     + v_ice(ji  ,jj-1  )     ) *  fr_i(ji,jj) 
     2390               END_2D 
    24032391            END SELECT 
    24042392            CALL lbc_lnk_multi( 'sbccpl', zotx1, ssnd(jps_ocx1)%clgrid, -1.,  zoty1, ssnd(jps_ocy1)%clgrid, -1. ) 
     
    24592447          SELECT CASE( TRIM( sn_snd_crtw%cldes ) )  
    24602448          CASE( 'oce only'             )      ! C-grid ==> T  
    2461              DO jj = 2, jpjm1  
    2462                 DO ji = fs_2, fs_jpim1   ! vector opt.  
    2463                    zotx1(ji,jj) = 0.5 * ( un(ji,jj,1) + un(ji-1,jj  ,1) )  
    2464                    zoty1(ji,jj) = 0.5 * ( vn(ji,jj,1) + vn(ji , jj-1,1) )   
    2465                 END DO  
    2466              END DO  
     2449             DO_2D_00_00 
     2450                zotx1(ji,jj) = 0.5 * ( uu(ji,jj,1,Kmm) + uu(ji-1,jj  ,1,Kmm) )  
     2451                zoty1(ji,jj) = 0.5 * ( vv(ji,jj,1,Kmm) + vv(ji , jj-1,1,Kmm) )   
     2452             END_2D 
    24672453          CASE( 'weighted oce and ice' )      ! Ocean and Ice on C-grid ==> T    
    2468              DO jj = 2, jpjm1  
    2469                 DO ji = fs_2, fs_jpim1   ! vector opt.  
    2470                    zotx1(ji,jj) = 0.5 * ( un   (ji,jj,1) + un   (ji-1,jj  ,1) ) * zfr_l(ji,jj)    
    2471                    zoty1(ji,jj) = 0.5 * ( vn   (ji,jj,1) + vn   (ji  ,jj-1,1) ) * zfr_l(ji,jj)  
    2472                    zitx1(ji,jj) = 0.5 * ( u_ice(ji,jj  ) + u_ice(ji-1,jj    ) ) *  fr_i(ji,jj)  
    2473                    zity1(ji,jj) = 0.5 * ( v_ice(ji,jj  ) + v_ice(ji  ,jj-1  ) ) *  fr_i(ji,jj)  
    2474                 END DO 
    2475              END DO 
     2454             DO_2D_00_00 
     2455                zotx1(ji,jj) = 0.5 * ( uu   (ji,jj,1,Kmm) + uu   (ji-1,jj  ,1,Kmm) ) * zfr_l(ji,jj)    
     2456                zoty1(ji,jj) = 0.5 * ( vv   (ji,jj,1,Kmm) + vv   (ji  ,jj-1,1,Kmm) ) * zfr_l(ji,jj)  
     2457                zitx1(ji,jj) = 0.5 * ( u_ice(ji,jj  ) + u_ice(ji-1,jj    ) ) *  fr_i(ji,jj)  
     2458                zity1(ji,jj) = 0.5 * ( v_ice(ji,jj  ) + v_ice(ji  ,jj-1  ) ) *  fr_i(ji,jj)  
     2459             END_2D 
    24762460             CALL lbc_lnk_multi( 'sbccpl', zitx1, 'T', -1.,  zity1, 'T', -1. )  
    24772461          CASE( 'mixed oce-ice'        )      ! Ocean and Ice on C-grid ==> T   
    2478              DO jj = 2, jpjm1  
    2479                 DO ji = fs_2, fs_jpim1   ! vector opt.  
    2480                    zotx1(ji,jj) = 0.5 * ( un   (ji,jj,1) + un   (ji-1,jj  ,1) ) * zfr_l(ji,jj)   &  
    2481                       &         + 0.5 * ( u_ice(ji,jj  ) + u_ice(ji-1,jj    ) ) *  fr_i(ji,jj)  
    2482                    zoty1(ji,jj) = 0.5 * ( vn   (ji,jj,1) + vn   (ji  ,jj-1,1) ) * zfr_l(ji,jj)   &  
    2483                       &         + 0.5 * ( v_ice(ji,jj  ) + v_ice(ji  ,jj-1  ) ) *  fr_i(ji,jj)  
    2484                 END DO 
    2485              END DO 
     2462             DO_2D_00_00 
     2463                zotx1(ji,jj) = 0.5 * ( uu   (ji,jj,1,Kmm) + uu   (ji-1,jj  ,1,Kmm) ) * zfr_l(ji,jj)   &  
     2464                   &         + 0.5 * ( u_ice(ji,jj  ) + u_ice(ji-1,jj    ) ) *  fr_i(ji,jj)  
     2465                zoty1(ji,jj) = 0.5 * ( vv   (ji,jj,1,Kmm) + vv   (ji  ,jj-1,1,Kmm) ) * zfr_l(ji,jj)   &  
     2466                   &         + 0.5 * ( v_ice(ji,jj  ) + v_ice(ji  ,jj-1  ) ) *  fr_i(ji,jj)  
     2467             END_2D 
    24862468          END SELECT 
    24872469         CALL lbc_lnk_multi( 'sbccpl', zotx1, ssnd(jps_ocxw)%clgrid, -1., zoty1, ssnd(jps_ocyw)%clgrid, -1. )  
     
    25222504      IF( ssnd(jps_ficet)%laction ) THEN  
    25232505         CALL cpl_snd( jps_ficet, isec, RESHAPE ( fr_i, (/jpi,jpj,1/) ), info )  
    2524       END IF  
     2506      ENDIF  
    25252507      !                                                      ! ------------------------- !  
    25262508      !                                                      !   Water levels to waves   !  
     
    25292511         IF( ln_apr_dyn ) THEN   
    25302512            IF( kt /= nit000 ) THEN   
    2531                ztmp1(:,:) = sshb(:,:) - 0.5 * ( ssh_ib(:,:) + ssh_ibb(:,:) )   
     2513               ztmp1(:,:) = ssh(:,:,Kbb) - 0.5 * ( ssh_ib(:,:) + ssh_ibb(:,:) )   
    25322514            ELSE   
    2533                ztmp1(:,:) = sshb(:,: 
     2515               ztmp1(:,:) = ssh(:,:,Kbb 
    25342516            ENDIF   
    25352517         ELSE   
    2536             ztmp1(:,:) = sshn(:,: 
     2518            ztmp1(:,:) = ssh(:,:,Kmm 
    25372519         ENDIF   
    25382520         CALL cpl_snd( jps_wlev  , isec, RESHAPE ( ztmp1, (/jpi,jpj,1/) ), info )  
    2539       END IF  
     2521      ENDIF  
    25402522      ! 
    25412523      !  Fields sent by OPA to SAS when doing OPA<->SAS coupling 
     
    25442526         !                          ! removed inverse barometer ssh when Patm 
    25452527         !                          forcing is used (for sea-ice dynamics) 
    2546          IF( ln_apr_dyn ) THEN   ;   ztmp1(:,:) = sshb(:,:) - 0.5 * ( ssh_ib(:,:) + ssh_ibb(:,:) ) 
    2547          ELSE                    ;   ztmp1(:,:) = sshn(:,:) 
     2528         IF( ln_apr_dyn ) THEN   ;   ztmp1(:,:) = ssh(:,:,Kbb) - 0.5 * ( ssh_ib(:,:) + ssh_ibb(:,:) ) 
     2529         ELSE                    ;   ztmp1(:,:) = ssh(:,:,Kmm) 
    25482530         ENDIF 
    25492531         CALL cpl_snd( jps_ssh   , isec, RESHAPE ( ztmp1            , (/jpi,jpj,1/) ), info ) 
     
    25522534      !                                                        ! SSS 
    25532535      IF( ssnd(jps_soce  )%laction )  THEN 
    2554          CALL cpl_snd( jps_soce  , isec, RESHAPE ( tsn(:,:,1,jp_sal), (/jpi,jpj,1/) ), info ) 
     2536         CALL cpl_snd( jps_soce  , isec, RESHAPE ( ts(:,:,1,jp_sal,Kmm), (/jpi,jpj,1/) ), info ) 
    25552537      ENDIF 
    25562538      !                                                        ! first T level thickness  
    25572539      IF( ssnd(jps_e3t1st )%laction )  THEN 
    2558          CALL cpl_snd( jps_e3t1st, isec, RESHAPE ( e3t_n(:,:,1)   , (/jpi,jpj,1/) ), info ) 
     2540         CALL cpl_snd( jps_e3t1st, isec, RESHAPE ( e3t(:,:,1,Kmm)   , (/jpi,jpj,1/) ), info ) 
    25592541      ENDIF 
    25602542      !                                                        ! Qsr fraction 
     
    25792561      !                                                      ! ------------------------- ! 
    25802562      ! needed by Met Office 
    2581       CALL eos_fzp(tsn(:,:,1,jp_sal), sstfrz) 
     2563      CALL eos_fzp(ts(:,:,1,jp_sal,Kmm), sstfrz) 
    25822564      ztmp1(:,:) = sstfrz(:,:) + rt0 
    25832565      IF( ssnd(jps_sstfrz)%laction )  CALL cpl_snd( jps_sstfrz, isec, RESHAPE ( ztmp1, (/jpi,jpj,1/) ), info) 
Note: See TracChangeset for help on using the changeset viewer.