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 13226 for NEMO/trunk/src/OCE/ICB/icblbc.F90 – NEMO

Ignore:
Timestamp:
2020-07-02T16:24:31+02:00 (4 years ago)
Author:
orioltp
Message:

Merging dev_r12512_HPC-04_mcastril_Mixed_Precision_implementation into the trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/src/OCE/ICB/icblbc.F90

    r12377 r13226  
    8181      TYPE(iceberg), POINTER ::   this 
    8282      TYPE(point)  , POINTER ::   pt 
    83       INTEGER                ::   iine 
    8483      !!---------------------------------------------------------------------- 
    8584 
     
    9291         DO WHILE( ASSOCIATED(this) ) 
    9392            pt => this%current_point 
    94             iine = INT( pt%xi + 0.5 ) 
    95             IF( iine > mig(nicbei) ) THEN 
     93            IF( pt%xi > REAL(mig(nicbei),wp) + 0.5_wp ) THEN 
    9694               pt%xi = ricb_right + MOD(pt%xi, 1._wp ) - 1._wp 
    97             ELSE IF( iine < mig(nicbdi) ) THEN 
     95            ELSE IF( pt%xi < REAL(mig(nicbdi),wp) - 0.5_wp ) THEN 
    9896               pt%xi = ricb_left + MOD(pt%xi, 1._wp ) 
    9997            ENDIF 
     
    128126         pt => this%current_point 
    129127         ijne = INT( pt%yj + 0.5 ) 
    130          IF( ijne .GT. mjg(nicbej) ) THEN 
     128         IF( pt%yj > REAL(mjg(nicbej),wp) + 0.5_wp ) THEN 
    131129            ! 
    132130            iine = INT( pt%xi + 0.5 ) 
     
    170168      INTEGER                             ::   ibergs_rcvd_from_n, ibergs_rcvd_from_s 
    171169      INTEGER                             ::   i, ibergs_start, ibergs_end 
    172       INTEGER                             ::   iine, ijne 
    173170      INTEGER                             ::   ipe_N, ipe_S, ipe_W, ipe_E 
    174171      REAL(wp), DIMENSION(2)              ::   zewbergs, zwebergs, znsbergs, zsnbergs 
     
    234231         DO WHILE (ASSOCIATED(this)) 
    235232            pt => this%current_point 
    236             iine = INT( pt%xi + 0.5 ) 
    237             IF( ipe_E >= 0 .AND. iine > mig(nicbei) ) THEN 
     233            IF( ipe_E >= 0 .AND. pt%xi > REAL(mig(nicbei),wp) + 0.5_wp ) THEN 
    238234               tmpberg => this 
    239235               this => this%next 
     
    248244               CALL icb_pack_into_buffer( tmpberg, obuffer_e, ibergs_to_send_e) 
    249245               CALL icb_utl_delete(first_berg, tmpberg) 
    250             ELSE IF( ipe_W >= 0 .AND. iine < mig(nicbdi) ) THEN 
     246            ELSE IF( ipe_W >= 0 .AND. pt%xi < REAL(mig(nicbdi),wp) - 0.5_wp ) THEN 
    251247               tmpberg => this 
    252248               this => this%next 
     
    372368         DO WHILE (ASSOCIATED(this)) 
    373369            pt => this%current_point 
    374             ijne = INT( pt%yj + 0.5 ) 
    375             IF( ipe_N >= 0 .AND. ijne .GT. mjg(nicbej) ) THEN 
     370            IF( ipe_N >= 0 .AND. pt%yj > REAL(mjg(nicbej),wp) + 0.5_wp ) THEN 
    376371               tmpberg => this 
    377372               this => this%next 
     
    383378               CALL icb_pack_into_buffer( tmpberg, obuffer_n, ibergs_to_send_n) 
    384379               CALL icb_utl_delete(first_berg, tmpberg) 
    385             ELSE IF( ipe_S >= 0 .AND. ijne .LT. mjg(nicbdj) ) THEN 
     380            ELSE IF( ipe_S >= 0 .AND. pt%yj < REAL(mjg(nicbdj),wp) - 0.5_wp ) THEN 
    386381               tmpberg => this 
    387382               this => this%next 
     
    539534         DO WHILE (ASSOCIATED(this)) 
    540535            pt => this%current_point 
    541             iine = INT( pt%xi + 0.5 ) 
    542             ijne = INT( pt%yj + 0.5 ) 
    543             IF( iine .LT. mig(nicbdi) .OR. & 
    544                 iine .GT. mig(nicbei) .OR. & 
    545                 ijne .LT. mjg(nicbdj) .OR. & 
    546                 ijne .GT. mjg(nicbej)) THEN 
     536            IF( pt%xi < REAL(mig(nicbdi),wp) - 0.5_wp .OR. & 
     537                pt%xi > REAL(mig(nicbei),wp) + 0.5_wp .OR. & 
     538                pt%yj < REAL(mjg(nicbdj),wp) - 0.5_wp .OR. & 
     539                pt%yj > REAL(mjg(nicbej),wp) + 0.5_wp ) THEN 
    547540               i = i + 1 
    548                WRITE(numicb,*) 'berg lost in halo: ', this%number(:),iine,ijne 
     541               WRITE(numicb,*) 'berg lost in halo: ', this%number(:) 
    549542               WRITE(numicb,*) '                   ', nimpp, njmpp 
    550543               WRITE(numicb,*) '                   ', nicbdi, nicbei, nicbdj, nicbej 
     
    614607                  pt => this%current_point 
    615608                  iine = INT( pt%xi + 0.5 ) 
    616                   ijne = INT( pt%yj + 0.5 ) 
    617609                  iproc = nicbflddest(mi1(iine)) 
    618                   IF( ijne .GT. mjg(nicbej) ) THEN 
     610                  IF( pt%yj > REAL(mjg(nicbej),wp) + 0.5_wp ) THEN 
    619611                     IF( iproc == ifldproc ) THEN 
    620612                        ! 
     
    696688                  ipts  = nicbfldpts (mi1(iine)) 
    697689                  iproc = nicbflddest(mi1(iine)) 
    698                   IF( ijne .GT. mjg(nicbej) ) THEN 
     690                  IF( pt%yj > REAL(mjg(nicbej),wp) + 0.5_wp ) THEN 
    699691                     IF( iproc == ifldproc ) THEN 
    700692                        ! 
Note: See TracChangeset for help on using the changeset viewer.