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/icbutl.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/icbutl.F90

    r14400 r15043  
    300300         zwj = pj - 0.5_wp - REAL(kij,wp) 
    301301      END SELECT 
     302      kii = kii + (nn_hls-1) 
     303      kij = kij + (nn_hls-1) 
    302304      ! 
    303305      ! compute weight 
     
    461463 
    462464      ! conversion to local domain (no need to do a sanity check already done in icbpos) 
    463       ii = mi1(ii) 
    464       ij = mj1(ij) 
     465      ii = mi1(ii) + (nn_hls-1) 
     466      ij = mj1(ij) + (nn_hls-1) 
    465467      ! 
    466468      IF(    0.0_wp <= zi .AND. zi < 0.5_wp   ) THEN 
Note: See TracChangeset for help on using the changeset viewer.