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/OPA_SRC/SBC/sbcice_cice.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/OPA_SRC/SBC/sbcice_cice.F90

    r3294 r3625  
    1515   USE dom_oce         ! ocean space and time domain 
    1616   USE domvvl 
    17    USE phycst, only : rcp, rau0 
     17   USE phycst, only : rcp, rau0, r1_rau0, rhosn, rhoic 
    1818   USE in_out_manager  ! I/O manager 
    1919   USE lib_mpp         ! distributed memory computing library 
     
    3737   USE ice_gather_scatter 
    3838   USE ice_calendar, only: dt 
    39    USE ice_state, only: aice,aicen,uvel,vvel,vsnon,vicen 
     39   USE ice_state, only: aice,aicen,uvel,vvel,vsno,vsnon,vice,vicen 
    4040   USE ice_flux, only: strax,stray,strocnx,strocny,frain,fsnow,  & 
    4141                sst,sss,uocn,vocn,ss_tltx,ss_tlty,fsalt_gbm,     & 
     
    5959   PUBLIC cice_sbc_final  ! routine called by sbc_final 
    6060   PUBLIC sbc_ice_cice    ! routine called by sbc 
     61 
     62   INTEGER , PARAMETER ::   ji_off = INT ( (jpiglo - nx_global) / 2 ) 
     63   INTEGER , PARAMETER ::   jj_off = INT ( (jpjglo - ny_global) / 2 ) 
    6164 
    6265   INTEGER , PARAMETER ::   jpfld   = 13   ! maximum number of files to read  
     
    107110      !! ** Action  : - time evolution of the CICE sea-ice model 
    108111      !!              - update all sbc variables below sea-ice: 
    109       !!                utau, vtau, qns , qsr, emp , emps 
     112      !!                utau, vtau, qns , qsr, emp , sfx 
    110113      !!--------------------------------------------------------------------- 
    111114      INTEGER, INTENT(in) ::   kt      ! ocean time step 
     
    143146      !! ** Purpose: Initialise ice related fields for NEMO and coupling 
    144147      !! 
    145       INTEGER, INTENT( in  ) ::   nsbc ! surface forcing type 
    146       !!--------------------------------------------------------------------- 
    147  
    148       INTEGER  ::   ji, jj, jpl                        ! dummy loop indices 
     148      INTEGER, INTENT( in  ) ::   nsbc                ! surface forcing type 
     149      REAL(wp), DIMENSION(:,:), POINTER :: ztmp1, ztmp2 
     150      REAL(wp) ::   zcoefu, zcoefv, zcoeff            ! local scalar 
     151      INTEGER  ::   ji, jj, jl                        ! dummy loop indices 
     152      !!--------------------------------------------------------------------- 
    149153 
    150154      IF( nn_timing == 1 )  CALL timing_start('cice_sbc_init') 
     155      ! 
     156      CALL wrk_alloc( jpi,jpj, ztmp1, ztmp2 ) 
    151157      ! 
    152158      IF(lwp) WRITE(numout,*)'cice_sbc_init' 
     
    182188      CALL cice2nemo(aice,fr_i, 'T', 1. ) 
    183189      IF ( (nsbc == 2).OR.(nsbc == 5) ) THEN 
    184          DO jpl=1,ncat 
    185             CALL cice2nemo(aicen(:,:,jpl,:),a_i(:,:,jpl), 'T', 1. ) 
     190         DO jl=1,ncat 
     191            CALL cice2nemo(aicen(:,:,jl,:),a_i(:,:,jl), 'T', 1. ) 
    186192         ENDDO 
    187193      ENDIF 
     
    198204      CALL lbc_lnk ( fr_iu , 'U', 1. ) 
    199205      CALL lbc_lnk ( fr_iv , 'V', 1. ) 
     206 
     207      !                                      ! embedded sea ice 
     208      IF( nn_ice_embd /= 0 ) THEN            ! mass exchanges between ice and ocean (case 1 or 2) set the snow+ice mass 
     209         CALL cice2nemo(vsno(:,:,:),ztmp1,'T', 1. ) 
     210         CALL cice2nemo(vice(:,:,:),ztmp2,'T', 1. ) 
     211         snwice_mass  (:,:) = ( rhosn * ztmp1(:,:) + rhoic * ztmp2(:,:)  ) 
     212         snwice_mass_b(:,:) = snwice_mass(:,:) 
     213      ELSE 
     214         snwice_mass  (:,:) = 0.0_wp         ! no mass exchanges 
     215         snwice_mass_b(:,:) = 0.0_wp         ! no mass exchanges 
     216      ENDIF 
     217      IF( nn_ice_embd == 2 .AND.          &  ! full embedment (case 2) & no restart :  
     218         &   .NOT.ln_rstart ) THEN           ! deplete the initial ssh belew sea-ice area 
     219         sshn(:,:) = sshn(:,:) - snwice_mass(:,:) * r1_rau0 
     220         sshb(:,:) = sshb(:,:) - snwice_mass(:,:) * r1_rau0 
     221         ! 
     222         ! Note: Changed the initial values of sshb and sshn=>  need to recompute ssh[u,v,f]_[b,n]  
     223         !       which were previously set in domvvl 
     224         IF ( lk_vvl ) THEN            ! Is this necessary? embd 2 should be restricted to vvl only??? 
     225            DO jj = 1, jpjm1 
     226               DO ji = 1, jpim1                    ! caution: use of Vector Opt. not possible 
     227                  zcoefu = 0.5  * umask(ji,jj,1) / ( e1u(ji,jj) * e2u(ji,jj) ) 
     228                  zcoefv = 0.5  * vmask(ji,jj,1) / ( e1v(ji,jj) * e2v(ji,jj) ) 
     229                  zcoeff = 0.25 * umask(ji,jj,1) * umask(ji,jj+1,1) 
     230                  sshu_b(ji,jj) = zcoefu * ( e1t(ji  ,jj) * e2t(ji  ,jj) * sshb(ji  ,jj)     & 
     231                     &                     + e1t(ji+1,jj) * e2t(ji+1,jj) * sshb(ji+1,jj) ) 
     232                  sshv_b(ji,jj) = zcoefv * ( e1t(ji,jj  ) * e2t(ji,jj  ) * sshb(ji,jj  )     & 
     233                     &                     + e1t(ji,jj+1) * e2t(ji,jj+1) * sshb(ji,jj+1) ) 
     234                  sshu_n(ji,jj) = zcoefu * ( e1t(ji  ,jj) * e2t(ji  ,jj) * sshn(ji  ,jj)     & 
     235                     &                     + e1t(ji+1,jj) * e2t(ji+1,jj) * sshn(ji+1,jj) ) 
     236                  sshv_n(ji,jj) = zcoefv * ( e1t(ji,jj  ) * e2t(ji,jj  ) * sshn(ji,jj  )     & 
     237                     &                     + e1t(ji,jj+1) * e2t(ji,jj+1) * sshn(ji,jj+1) ) 
     238               END DO 
     239            END DO 
     240            CALL lbc_lnk( sshu_b, 'U', 1. )   ;   CALL lbc_lnk( sshu_n, 'U', 1. ) 
     241            CALL lbc_lnk( sshv_b, 'V', 1. )   ;   CALL lbc_lnk( sshv_n, 'V', 1. ) 
     242            DO jj = 1, jpjm1 
     243               DO ji = 1, jpim1      ! NO Vector Opt. 
     244                  sshf_n(ji,jj) = 0.5  * umask(ji,jj,1) * umask(ji,jj+1,1)                   & 
     245                       &               / ( e1f(ji,jj  ) * e2f(ji,jj  ) )                     & 
     246                       &               * ( e1u(ji,jj  ) * e2u(ji,jj  ) * sshu_n(ji,jj  )     & 
     247                       &                 + e1u(ji,jj+1) * e2u(ji,jj+1) * sshu_n(ji,jj+1) ) 
     248               END DO 
     249            END DO 
     250            CALL lbc_lnk( sshf_n, 'F', 1. ) 
     251          ENDIF 
     252      ENDIF 
     253  
     254      CALL wrk_dealloc( jpi,jpj, ztmp1, ztmp2 ) 
    200255      ! 
    201256      IF( nn_timing == 1 )  CALL timing_stop('cice_sbc_init') 
     
    212267      INTEGER, INTENT(in   ) ::   nsbc ! surface forcing type 
    213268 
    214       INTEGER  ::   ji, jj, jpl                   ! dummy loop indices       
    215       REAL(wp), DIMENSION(:,:), POINTER :: ztmp 
     269      INTEGER  ::   ji, jj, jl                   ! dummy loop indices       
     270      REAL(wp), DIMENSION(:,:), POINTER :: ztmp, zpice 
    216271      REAL(wp), DIMENSION(:,:,:), POINTER :: ztmpn 
     272      REAL(wp) ::   zintb, zintn  ! dummy argument 
    217273      !!--------------------------------------------------------------------- 
    218274 
    219275      IF( nn_timing == 1 )  CALL timing_start('cice_sbc_in') 
    220276      ! 
    221       CALL wrk_alloc( jpi,jpj, ztmp ) 
     277      CALL wrk_alloc( jpi,jpj, ztmp, zpice ) 
    222278      CALL wrk_alloc( jpi,jpj,ncat, ztmpn ) 
    223279 
     
    259315! Surface downward latent heat flux (CI_5) 
    260316         IF (nsbc == 2) THEN 
    261             DO jpl=1,ncat 
    262                ztmpn(:,:,jpl)=qla_ice(:,:,1)*a_i(:,:,jpl) 
     317            DO jl=1,ncat 
     318               ztmpn(:,:,jl)=qla_ice(:,:,1)*a_i(:,:,jl) 
    263319            ENDDO 
    264320         ELSE 
     
    269325               DO ji=1,jpi 
    270326                  IF (fr_i(ji,jj).eq.0.0) THEN 
    271                      DO jpl=1,ncat 
    272                         ztmpn(ji,jj,jpl)=0.0 
     327                     DO jl=1,ncat 
     328                        ztmpn(ji,jj,jl)=0.0 
    273329                     ENDDO 
    274330                     ! This will then be conserved in CICE 
    275331                     ztmpn(ji,jj,1)=qla_ice(ji,jj,1) 
    276332                  ELSE 
    277                      DO jpl=1,ncat 
    278                         ztmpn(ji,jj,jpl)=qla_ice(ji,jj,1)*a_i(ji,jj,jpl)/fr_i(ji,jj) 
     333                     DO jl=1,ncat 
     334                        ztmpn(ji,jj,jl)=qla_ice(ji,jj,1)*a_i(ji,jj,jl)/fr_i(ji,jj) 
    279335                     ENDDO 
    280336                  ENDIF 
     
    282338            ENDDO 
    283339         ENDIF 
    284          DO jpl=1,ncat 
    285             CALL nemo2cice(ztmpn(:,:,jpl),flatn_f(:,:,jpl,:),'T', 1. ) 
     340         DO jl=1,ncat 
     341            CALL nemo2cice(ztmpn(:,:,jl),flatn_f(:,:,jl,:),'T', 1. ) 
    286342 
    287343! GBM conductive flux through ice (CI_6) 
    288344!  Convert to GBM 
    289345            IF (nsbc == 2) THEN 
    290                ztmp(:,:) = botmelt(:,:,jpl)*a_i(:,:,jpl) 
     346               ztmp(:,:) = botmelt(:,:,jl)*a_i(:,:,jl) 
    291347            ELSE 
    292                ztmp(:,:) = botmelt(:,:,jpl) 
     348               ztmp(:,:) = botmelt(:,:,jl) 
    293349            ENDIF 
    294             CALL nemo2cice(ztmp,fcondtopn_f(:,:,jpl,:),'T', 1. ) 
     350            CALL nemo2cice(ztmp,fcondtopn_f(:,:,jl,:),'T', 1. ) 
    295351 
    296352! GBM surface heat flux (CI_7) 
    297353!  Convert to GBM 
    298354            IF (nsbc == 2) THEN 
    299                ztmp(:,:) = (topmelt(:,:,jpl)+botmelt(:,:,jpl))*a_i(:,:,jpl)  
     355               ztmp(:,:) = (topmelt(:,:,jl)+botmelt(:,:,jl))*a_i(:,:,jl)  
    300356            ELSE 
    301                ztmp(:,:) = (topmelt(:,:,jpl)+botmelt(:,:,jpl)) 
     357               ztmp(:,:) = (topmelt(:,:,jl)+botmelt(:,:,jl)) 
    302358            ENDIF 
    303             CALL nemo2cice(ztmp,fsurfn_f(:,:,jpl,:),'T', 1. ) 
     359            CALL nemo2cice(ztmp,fsurfn_f(:,:,jl,:),'T', 1. ) 
    304360         ENDDO 
    305361 
     
    383439      CALL nemo2cice(ztmp,vocn,'F', -1. ) 
    384440 
     441      IF( nn_ice_embd == 2 ) THEN             !== embedded sea ice: compute representative ice top surface ==! 
     442          ! 
     443          ! average interpolation coeff as used in dynspg = (1/nn_fsbc) * {SUM[n/nn_fsbc], n=0,nn_fsbc-1} 
     444          !                                               = (1/nn_fsbc)^2 * {SUM[n], n=0,nn_fsbc-1} 
     445         zintn = REAL( nn_fsbc - 1 ) / REAL( nn_fsbc ) * 0.5_wp 
     446          ! 
     447          ! average interpolation coeff as used in dynspg = (1/nn_fsbc) * {SUM[1-n/nn_fsbc], n=0,nn_fsbc-1} 
     448          !                                               = (1/nn_fsbc)^2 * (nn_fsbc^2 - {SUM[n], n=0,nn_fsbc-1}) 
     449         zintb = REAL( nn_fsbc + 1 ) / REAL( nn_fsbc ) * 0.5_wp 
     450          ! 
     451         zpice(:,:) = ssh_m(:,:) + (  zintn * snwice_mass(:,:) +  zintb * snwice_mass_b(:,:)  ) * r1_rau0 
     452          ! 
     453         ! 
     454      ELSE                                    !== non-embedded sea ice: use ocean surface for slope calculation ==! 
     455         zpice(:,:) = ssh_m(:,:) 
     456      ENDIF 
     457 
    385458! x comp and y comp of sea surface slope (on F points) 
    386459! T point to F point 
    387460      DO jj=1,jpjm1 
    388461         DO ji=1,jpim1 
    389             ztmp(ji,jj)=0.5 * (  (ssh_m(ji+1,jj  )-ssh_m(ji,jj  ))/e1u(ji,jj  )   & 
    390                                + (ssh_m(ji+1,jj+1)-ssh_m(ji,jj+1))/e1u(ji,jj+1) ) &  
     462            ztmp(ji,jj)=0.5 * (  (zpice(ji+1,jj  )-zpice(ji,jj  ))/e1u(ji,jj  )   & 
     463                               + (zpice(ji+1,jj+1)-zpice(ji,jj+1))/e1u(ji,jj+1) ) &  
    391464                            *  fmask(ji,jj,1) 
    392465         ENDDO 
     
    397470      DO jj=1,jpjm1 
    398471         DO ji=1,jpim1 
    399             ztmp(ji,jj)=0.5 * (  (ssh_m(ji  ,jj+1)-ssh_m(ji  ,jj))/e2v(ji  ,jj)   & 
    400                                + (ssh_m(ji+1,jj+1)-ssh_m(ji+1,jj))/e2v(ji+1,jj) ) & 
     472            ztmp(ji,jj)=0.5 * (  (zpice(ji  ,jj+1)-zpice(ji  ,jj))/e2v(ji  ,jj)   & 
     473                               + (zpice(ji+1,jj+1)-zpice(ji+1,jj))/e2v(ji+1,jj) ) & 
    401474                            *  fmask(ji,jj,1) 
    402475         ENDDO 
     
    420493      INTEGER, INTENT( in  ) ::   nsbc ! surface forcing type 
    421494       
    422       INTEGER  ::   ji, jj, jpl                 ! dummy loop indices 
    423       REAL(wp), DIMENSION(:,:), POINTER :: ztmp 
     495      INTEGER  ::   ji, jj, jl                 ! dummy loop indices 
     496      REAL(wp), DIMENSION(:,:), POINTER :: ztmp1, ztmp2 
    424497      !!--------------------------------------------------------------------- 
    425498 
    426499      IF( nn_timing == 1 )  CALL timing_start('cice_sbc_out') 
    427500      ! 
    428       CALL wrk_alloc( jpi,jpj, ztmp ) 
     501      CALL wrk_alloc( jpi,jpj, ztmp1, ztmp2 ) 
    429502       
    430503      IF( kt == nit000 )  THEN 
     
    433506       
    434507! x comp of ocean-ice stress  
    435       CALL cice2nemo(strocnx,ztmp,'F', -1. ) 
     508      CALL cice2nemo(strocnx,ztmp1,'F', -1. ) 
    436509      ss_iou(:,:)=0.0 
    437510! F point to U point 
    438511      DO jj=2,jpjm1 
    439512         DO ji=2,jpim1 
    440             ss_iou(ji,jj) = 0.5 * ( ztmp(ji,jj-1) + ztmp(ji,jj) ) * umask(ji,jj,1) 
     513            ss_iou(ji,jj) = 0.5 * ( ztmp1(ji,jj-1) + ztmp1(ji,jj) ) * umask(ji,jj,1) 
    441514         ENDDO 
    442515      ENDDO 
     
    444517 
    445518! y comp of ocean-ice stress  
    446       CALL cice2nemo(strocny,ztmp,'F', -1. ) 
     519      CALL cice2nemo(strocny,ztmp1,'F', -1. ) 
    447520      ss_iov(:,:)=0.0 
    448521! F point to V point 
     
    450523      DO jj=1,jpjm1 
    451524         DO ji=2,jpim1 
    452             ss_iov(ji,jj) = 0.5 * ( ztmp(ji-1,jj) + ztmp(ji,jj) ) * vmask(ji,jj,1) 
     525            ss_iov(ji,jj) = 0.5 * ( ztmp1(ji-1,jj) + ztmp1(ji,jj) ) * vmask(ji,jj,1) 
    453526         ENDDO 
    454527      ENDDO 
     
    473546         emp(:,:)  = (1.0-fr_i(:,:))*emp(:,:)         
    474547      ELSE IF (nsbc ==5) THEN 
    475 ! emp_tot is set in sbc_cpl_ice_flx (call from cice_sbc_in above)  
     548! emp_tot is set in sbc_cpl_ice_flx (called from cice_sbc_in above)  
     549! This is currently as required with the coupling fields from the UM atmosphere 
    476550         emp(:,:) = emp_tot(:,:)+tprecip(:,:)*fr_i(:,:)  
    477551      ENDIF 
    478552 
    479 ! Subtract fluxes from CICE to get freshwater equivalent flux used in  
    480 ! salinity calculation 
    481       CALL cice2nemo(fresh_gbm,ztmp,'T', 1. ) 
    482       emps(:,:)=emp(:,:)-ztmp(:,:) 
    483 ! Note the 1000.0 is to convert from kg salt to g salt (needed for PSU) 
    484       CALL cice2nemo(fsalt_gbm,ztmp,'T', 1. ) 
    485       DO jj=1,jpj 
    486          DO ji=1,jpi 
    487             IF (sss_m(ji,jj).gt.0.0) THEN 
    488                emps(ji,jj)=emps(ji,jj)+ztmp(ji,jj)*1000.0/sss_m(ji,jj) 
    489             ENDIF 
    490          ENDDO 
    491       ENDDO 
    492  
    493 ! No longer remove precip over ice from free surface calculation on basis that the 
    494 ! weight of the precip will affect the free surface even if it falls on the ice 
    495 ! (same to the argument that freezing / melting of ice doesn't change the free surface)  
    496 ! Sublimation from the ice is treated in a similar way (included in emp but not emps)   
    497 ! 
    498 ! This should not be done in the variable volume case 
    499  
    500       IF (.NOT. lk_vvl) THEN 
    501  
    502          emp(:,:)  = emp(:,:) - tprecip(:,:)*fr_i(:,:) 
    503  
    504 ! Take sublimation into account 
    505          IF (nsbc == 5 ) THEN  
    506             emp(:,:) = emp(:,:) + ( emp_ice(:,:) + sprecip(:,:) ) 
    507          ELSE IF (nsbc == 2 ) THEN 
    508             emp(:,:) = emp(:,:) - qla_ice(:,:,1) / Lsub 
    509          ENDIF 
    510  
    511       ENDIF 
    512  
     553      CALL cice2nemo(fresh_gbm,ztmp1,'T', 1. ) 
     554      CALL cice2nemo(fsalt_gbm,ztmp2,'T', 1. ) 
     555 
     556! Check to avoid unphysical expression when ice is forming (ztmp1 negative) 
     557! Otherwise we are effectively allowing ice of higher salinity than the ocean to form 
     558! which has to be compensated for by the ocean salinity potentially going negative 
     559! This check breaks conservation but seems reasonable until we have prognostic ice salinity 
     560! Note the 1000.0 below is to convert from kg salt to g salt (needed for PSU) 
     561      WHERE (ztmp1(:,:).lt.0.0) ztmp2(:,:)=MAX(ztmp2(:,:),ztmp1(:,:)*sss_m(:,:)/1000.0) 
     562      sfx(:,:)=ztmp2(:,:)*1000.0 
     563      emp(:,:)=emp(:,:)-ztmp1(:,:) 
     564  
    513565      CALL lbc_lnk( emp , 'T', 1. ) 
    514       CALL lbc_lnk( emps , 'T', 1. ) 
     566      CALL lbc_lnk( sfx , 'T', 1. ) 
    515567 
    516568! Solar penetrative radiation and non solar surface heat flux 
     
    532584! Now add in ice / snow related terms 
    533585! [fswthru will be zero unless running with calc_Tsfc=T in CICE] 
    534       CALL cice2nemo(fswthru_gbm,ztmp,'T', 1. ) 
    535       qsr(:,:)=qsr(:,:)+ztmp(:,:) 
     586      CALL cice2nemo(fswthru_gbm,ztmp1,'T', 1. ) 
     587      qsr(:,:)=qsr(:,:)+ztmp1(:,:) 
    536588      CALL lbc_lnk( qsr , 'T', 1. ) 
    537589 
     
    542594      ENDDO 
    543595 
    544       CALL cice2nemo(fhocn_gbm,ztmp,'T', 1. ) 
    545       qns(:,:)=qns(:,:)+nfrzmlt(:,:)+ztmp(:,:) 
     596      CALL cice2nemo(fhocn_gbm,ztmp1,'T', 1. ) 
     597      qns(:,:)=qns(:,:)+nfrzmlt(:,:)+ztmp1(:,:) 
    546598 
    547599      CALL lbc_lnk( qns , 'T', 1. ) 
     
    551603      CALL cice2nemo(aice,fr_i,'T', 1. ) 
    552604      IF ( (nsbc == 2).OR.(nsbc == 5) ) THEN 
    553          DO jpl=1,ncat 
    554             CALL cice2nemo(aicen(:,:,jpl,:),a_i(:,:,jpl), 'T', 1. ) 
     605         DO jl=1,ncat 
     606            CALL cice2nemo(aicen(:,:,jl,:),a_i(:,:,jl), 'T', 1. ) 
    555607         ENDDO 
    556608      ENDIF 
     
    568620      CALL lbc_lnk ( fr_iv , 'V', 1. ) 
    569621 
     622      !                                      ! embedded sea ice 
     623      IF( nn_ice_embd /= 0 ) THEN            ! mass exchanges between ice and ocean (case 1 or 2) set the snow+ice mass 
     624         CALL cice2nemo(vsno(:,:,:),ztmp1,'T', 1. ) 
     625         CALL cice2nemo(vice(:,:,:),ztmp2,'T', 1. ) 
     626         snwice_mass  (:,:) = ( rhosn * ztmp1(:,:) + rhoic * ztmp2(:,:)  ) 
     627         snwice_mass_b(:,:) = snwice_mass(:,:) 
     628         snwice_fmass (:,:) = ( snwice_mass(:,:) - snwice_mass_b(:,:) ) / dt 
     629      ENDIF 
     630 
    570631! Release work space 
    571632 
    572       CALL wrk_dealloc( jpi,jpj, ztmp ) 
     633      CALL wrk_dealloc( jpi,jpj, ztmp1, ztmp2 ) 
    573634      ! 
    574635      IF( nn_timing == 1 )  CALL timing_stop('cice_sbc_out') 
     
    587648      !!--------------------------------------------------------------------- 
    588649 
    589       INTEGER  ::   jpl                        ! dummy loop index 
     650      INTEGER  ::   jl                        ! dummy loop index 
    590651      INTEGER  ::   ierror 
    591652 
     
    610671! Snow and ice thicknesses (CO_2 and CO_3) 
    611672 
    612       DO jpl = 1,ncat 
    613          CALL cice2nemo(vsnon(:,:,jpl,:),ht_s(:,:,jpl),'T', 1. ) 
    614          CALL cice2nemo(vicen(:,:,jpl,:),ht_i(:,:,jpl),'T', 1. ) 
     673      DO jl = 1,ncat 
     674         CALL cice2nemo(vsnon(:,:,jl,:),ht_s(:,:,jl),'T', 1. ) 
     675         CALL cice2nemo(vicen(:,:,jl,:),ht_i(:,:,jl),'T', 1. ) 
    615676      ENDDO 
    616677      ! 
     
    780841      REAL(wp), DIMENSION(jpi,jpj) :: pn 
    781842#if !defined key_nemocice_decomp 
     843      REAL(wp), DIMENSION(jpiglo,jpjglo) :: png2 
    782844      REAL (kind=dbl_kind), dimension(nx_global,ny_global) :: pcg 
    783845#endif 
     
    798860      ! Copy local domain data from NEMO to CICE field 
    799861      pc(:,:,1)=0.0 
    800       DO jj=2,ny_block 
    801          DO ji=2,nx_block 
    802             pc(ji,jj,1)=pn(ji,jj-1) 
     862      DO jj=2,ny_block-1 
     863         DO ji=2,nx_block-1 
     864            pc(ji,jj,1)=pn(ji-1+ji_off,jj-1+jj_off) 
    803865         ENDDO 
    804866      ENDDO 
     
    824886!        pcg(:,:)=0.0 
    825887         DO jn=1,jpnij 
    826             DO jj=1,nlcjt(jn)-1 
    827                DO ji=2,nlcit(jn)-1 
    828                   pcg(ji+nimppt(jn)-2,jj+njmppt(jn)-1)=png(ji,jj,jn)        
     888            DO jj=nldjt(jn),nlejt(jn) 
     889               DO ji=nldit(jn),nleit(jn) 
     890                  png2(ji+nimppt(jn)-1,jj+njmppt(jn)-1)=png(ji,jj,jn) 
    829891               ENDDO 
     892            ENDDO 
     893         ENDDO 
     894         DO jj=1,ny_global 
     895            DO ji=1,nx_global 
     896               pcg(ji,jj)=png2(ji+ji_off,jj+jj_off) 
    830897            ENDDO 
    831898         ENDDO 
     
    922989      DO jj=1,jpjm1 
    923990         DO ji=1,jpim1 
    924             pn(ji,jj)=pc(ji,jj+1,1) 
     991            pn(ji,jj)=pc(ji+1-ji_off,jj+1-jj_off,1) 
    925992         ENDDO 
    926993      ENDDO 
     
    9361003! Need to make sure this is robust to changes in NEMO halo rows.... 
    9371004! (may be OK but not spent much time thinking about it) 
     1005! Note that non-existent pcg elements may be used below, but 
     1006! the lbclnk call on pn will replace these with sensible values 
    9381007 
    9391008      IF (nproc==0) THEN 
    9401009         png(:,:,:)=0.0 
    9411010         DO jn=1,jpnij 
    942             DO jj=1,nlcjt(jn)-1 
    943                DO ji=2,nlcit(jn)-1 
    944                   png(ji,jj,jn)=pcg(ji+nimppt(jn)-2,jj+njmppt(jn)-1)       
     1011            DO jj=nldjt(jn),nlejt(jn) 
     1012               DO ji=nldit(jn),nleit(jn) 
     1013                  png(ji,jj,jn)=pcg(ji+nimppt(jn)-1-ji_off,jj+njmppt(jn)-1-jj_off) 
    9451014               ENDDO 
    9461015            ENDDO 
Note: See TracChangeset for help on using the changeset viewer.