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 10679 for NEMO/branches/2019/fix_ticket2238_solution2/src/OCE/ICB/icblbc.F90 – NEMO

Ignore:
Timestamp:
2019-02-14T14:11:43+01:00 (5 years ago)
Author:
mathiot
Message:

branch for solution 2 of ticket #2238

Location:
NEMO/branches/2019/fix_ticket2238_solution2
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/fix_ticket2238_solution2/src/OCE/ICB/icblbc.F90

    r10570 r10679  
    5656 
    5757   INTEGER, PARAMETER, PRIVATE ::   jp_delta_buf = 25             ! Size by which to increment buffers 
    58    INTEGER, PARAMETER, PRIVATE ::   jp_buffer_width = 15+nkounts  ! items to store for each berg 
     58   INTEGER, PARAMETER, PRIVATE ::   jp_buffer_width = 47+nkounts  ! items to store for each berg 
    5959 
    6060#endif 
     
    9090         DO WHILE( ASSOCIATED(this) ) 
    9191            pt => this%current_point 
    92             iine = INT( pt%xi + 0.5 ) 
     92            iine = INT( pt%xi + 0.5_wp ) 
    9393            IF( iine > mig(nicbei) ) THEN 
    9494               pt%xi = ricb_right + MOD(pt%xi, 1._wp ) - 1._wp 
     
    125125      DO WHILE( ASSOCIATED(this) ) 
    126126         pt => this%current_point 
    127          ijne = INT( pt%yj + 0.5 ) 
     127         ijne = INT( pt%yj + 0.5_wp ) 
    128128         IF( ijne .GT. mjg(nicbej) ) THEN 
    129129            ! 
    130             iine = INT( pt%xi + 0.5 ) 
     130            iine = INT( pt%xi + 0.5_wp ) 
    131131            ipts  = nicbfldpts (mi1(iine)) 
    132132            ! 
     
    232232         DO WHILE (ASSOCIATED(this)) 
    233233            pt => this%current_point 
    234             iine = INT( pt%xi + 0.5 ) 
     234            iine = INT( pt%xi + 0.5_wp ) 
    235235            IF( ipe_E >= 0 .AND. iine > mig(nicbei) ) THEN 
    236236               tmpberg => this 
     
    242242               ENDIF 
    243243               ! deal with periodic case 
    244                tmpberg%current_point%xi = ricb_right + MOD(tmpberg%current_point%xi, 1._wp ) - 1._wp 
     244               tmpberg%current_point%xi      = ricb_right + MOD(tmpberg%current_point%xi, 1._wp ) - 1._wp 
     245               tmpberg%current_point%xRK1(1) = ricb_right + MOD(tmpberg%current_point%xRK1(1), 1._wp ) - 1._wp 
     246               tmpberg%current_point%xRK2(1) = ricb_right + MOD(tmpberg%current_point%xRK2(1), 1._wp ) - 1._wp 
     247               tmpberg%current_point%xRK3(1) = ricb_right + MOD(tmpberg%current_point%xRK3(1), 1._wp ) - 1._wp 
     248               tmpberg%current_point%xRK4(1) = ricb_right + MOD(tmpberg%current_point%xRK4(1), 1._wp ) - 1._wp 
    245249               ! now pack it into buffer and delete from list 
    246250               CALL icb_pack_into_buffer( tmpberg, obuffer_e, ibergs_to_send_e) 
     
    255259               ENDIF 
    256260               ! deal with periodic case 
    257                tmpberg%current_point%xi = ricb_left + MOD(tmpberg%current_point%xi, 1._wp ) 
     261               tmpberg%current_point%xi      = ricb_left + MOD(tmpberg%current_point%xi, 1._wp ) 
     262               tmpberg%current_point%xRK1(1) = ricb_left + MOD(tmpberg%current_point%xRK1(1), 1._wp ) 
     263               tmpberg%current_point%xRK2(1) = ricb_left + MOD(tmpberg%current_point%xRK2(1), 1._wp ) 
     264               tmpberg%current_point%xRK3(1) = ricb_left + MOD(tmpberg%current_point%xRK3(1), 1._wp ) 
     265               tmpberg%current_point%xRK4(1) = ricb_left + MOD(tmpberg%current_point%xRK4(1), 1._wp ) 
    258266               ! now pack it into buffer and delete from list 
    259267               CALL icb_pack_into_buffer( tmpberg, obuffer_w, ibergs_to_send_w) 
     
    370378         DO WHILE (ASSOCIATED(this)) 
    371379            pt => this%current_point 
    372             ijne = INT( pt%yj + 0.5 ) 
     380            ijne = INT( pt%yj + 0.5_wp ) 
    373381            IF( ipe_N >= 0 .AND. ijne .GT. mjg(nicbej) ) THEN 
    374382               tmpberg => this 
     
    537545         DO WHILE (ASSOCIATED(this)) 
    538546            pt => this%current_point 
    539             iine = INT( pt%xi + 0.5 ) 
    540             ijne = INT( pt%yj + 0.5 ) 
     547            iine = INT( pt%xi + 0.5_wp ) 
     548            ijne = INT( pt%yj + 0.5_wp ) 
    541549            IF( iine .LT. mig(nicbdi) .OR. & 
    542550                iine .GT. mig(nicbei) .OR. & 
     
    544552                ijne .GT. mjg(nicbej)) THEN 
    545553               i = i + 1 
    546                WRITE(numicb,*) 'berg lost in halo: ', this%number(:),iine,ijne 
    547                WRITE(numicb,*) '                   ', nimpp, njmpp 
    548                WRITE(numicb,*) '                   ', nicbdi, nicbei, nicbdj, nicbej 
     554               WRITE(numicb,*) 'berg lost in halo:  ', this%number(:),iine,ijne, pt%xi, pt%yj 
     555               WRITE(numicb,*) 'nimpp, njmpp        ', nimpp, njmpp 
     556               WRITE(numicb,*) 'nicb di, ei, dj, ej ', nicbdi     , nicbei     , nicbdj     , nicbej 
     557               WRITE(numicb,*) 'mijg di, ei, dj, ej ', mig(nicbdi), mig(nicbei), mjg(nicbdj), mjg(nicbej) 
    549558               CALL flush( numicb ) 
    550559            ENDIF 
     
    611620               DO WHILE (ASSOCIATED(this)) 
    612621                  pt => this%current_point 
    613                   iine = INT( pt%xi + 0.5 ) 
    614                   ijne = INT( pt%yj + 0.5 ) 
     622                  iine = INT( pt%xi + 0.5_wp ) 
     623                  ijne = INT( pt%yj + 0.5_wp ) 
    615624                  iproc = nicbflddest(mi1(iine)) 
    616625                  IF( ijne .GT. mjg(nicbej) ) THEN 
     
    691700               DO WHILE (ASSOCIATED(this)) 
    692701                  pt => this%current_point 
    693                   iine = INT( pt%xi + 0.5 ) 
    694                   ijne = INT( pt%yj + 0.5 ) 
     702                  iine = INT( pt%xi + 0.5_wp ) 
     703                  ijne = INT( pt%yj + 0.5_wp ) 
    695704                  ipts  = nicbfldpts (mi1(iine)) 
    696705                  iproc = nicbflddest(mi1(iine)) 
     
    791800      IF( .NOT. ASSOCIATED(pbuff) ) CALL icb_increase_buffer( pbuff, jp_delta_buf ) 
    792801      IF( kb .GT. pbuff%size ) CALL icb_increase_buffer( pbuff, jp_delta_buf ) 
     802      IF( kb .GT. pbuff%size ) PRINT *, 'SHOULD NOT SEE THIS' 
    793803 
    794804      !! pack points into buffer 
     
    809819      pbuff%data(14,kb) = berg%current_point%heat_density 
    810820 
    811       pbuff%data(15,kb) = berg%mass_scaling 
     821      pbuff%data(15:18,kb) = berg%current_point%xRK1 
     822      pbuff%data(19:22,kb) = berg%current_point%xRK2 
     823      pbuff%data(23:26,kb) = berg%current_point%xRK3 
     824      pbuff%data(27:30,kb) = berg%current_point%xRK4 
     825 
     826      pbuff%data(31:34,kb) = berg%current_point%yRK1 
     827      pbuff%data(35:38,kb) = berg%current_point%yRK2 
     828      pbuff%data(39:42,kb) = berg%current_point%yRK3 
     829      pbuff%data(43:46,kb) = berg%current_point%yRK4 
     830 
     831      pbuff%data(47,kb) = berg%mass_scaling 
    812832      DO k=1,nkounts 
    813          pbuff%data(15+k,kb) = REAL( berg%number(k), wp ) 
     833         pbuff%data(47+k,kb) = REAL( berg%number(k), wp ) 
    814834      END DO 
    815835      ! 
     
    844864      pt%heat_density   =      pbuff%data(14,kb) 
    845865 
    846       currentberg%mass_scaling =      pbuff%data(15,kb) 
     866      pt%xRK1 = pbuff%data(15:18,kb) 
     867      pt%xRK2 = pbuff%data(19:22,kb)  
     868      pt%xRK3 = pbuff%data(23:26,kb) 
     869      pt%xRK4 = pbuff%data(27:30,kb) 
     870 
     871      pt%yRK1 = pbuff%data(31:34,kb) 
     872      pt%yRK2 = pbuff%data(35:38,kb) 
     873      pt%yRK3 = pbuff%data(39:42,kb) 
     874      pt%yRK4 = pbuff%data(43:46,kb) 
     875 
     876      currentberg%mass_scaling =      pbuff%data(47,kb) 
    847877      DO ik = 1, nkounts 
    848          currentberg%number(ik) = INT( pbuff%data(15+ik,kb) ) 
     878         currentberg%number(ik) = INT( pbuff%data(47+ik,kb) ) 
    849879      END DO 
    850880      ! 
Note: See TracChangeset for help on using the changeset viewer.