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 15043 for NEMO/branches/2021/ticket2696_icb_halo1_halo2_compatibility/src/OCE/ICB/icbini.F90 – NEMO

Ignore:
Timestamp:
2021-06-22T13:26:16+02:00 (3 years ago)
Author:
acc
Message:

#2696 .A possible fix for obtaining identical results with icebergs active and with either
nn_hls=1 or nn_hls=2. This solution works by ensuring the real-valued iceberg position
calculations are done with identical numbers in both cases. Iceberg positions are stored
as a continuous local grid-cell value and a factor of (nn_hls-1) is subtracted from
initial positions to ensure equivalence in both cases. This factor needs to be added
back whenever iceberg positions are converted to local indices. The changes in this
commit are enough to ensure a full ORCA2_ICE_PISCES SETTE test is passed in both case
(992 timesteps) and provides identical results. Suitability of this solution for inclusion
in the trunk needs to be discussed and verified on other platforms and compilers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2021/ticket2696_icb_halo1_halo2_compatibility/src/OCE/ICB/icbini.F90

    r14433 r15043  
    182182      i3 = INT( src_calving(i1,jpj/2) ) 
    183183      jj = INT( i3/nicbpack ) 
    184       ricb_left = REAL( i3 - nicbpack*jj, wp ) 
     184      ricb_left = REAL( i3 - nicbpack*jj, wp ) - (nn_hls-1) 
    185185      i1 = MIN( nicbei+1, jpi ) 
    186186      i3 = INT( src_calving(i1,jpj/2) ) 
    187187      jj = INT( i3/nicbpack ) 
    188       ricb_right = REAL( i3 - nicbpack*jj, wp ) 
     188      ricb_right = REAL( i3 - nicbpack*jj, wp ) - (nn_hls-1) 
    189189       
    190190      ! north fold 
     
    360360                rn_test_box(3) < gphit(ji,jj) .AND. gphit(ji,jj) < rn_test_box(4) ) THEN 
    361361               localberg%mass_scaling = rn_mass_scaling(iberg) 
    362                localpt%xi = REAL( mig(ji), wp ) 
    363                localpt%yj = REAL( mjg(jj), wp ) 
     362               localpt%xi = REAL( mig(ji) - (nn_hls-1), wp ) 
     363               localpt%yj = REAL( mjg(jj) - (nn_hls-1), wp ) 
    364364               CALL icb_utl_interp( localpt%xi, localpt%yj, plat=localpt%lat, plon=localpt%lon )    
    365365               localpt%mass      = rn_initial_mass     (iberg) 
Note: See TracChangeset for help on using the changeset viewer.