Changeset 2294


Ignore:
Timestamp:
02/03/22 09:48:58 (2 years ago)
Author:
jderouillat
Message:

Fix for the average reduction in the new implementation of the GatherConnector::transfer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/distribution/gatherer_connector.hpp

    r2291 r2294  
    218218                    { 
    219219                      if (*(count+connector[j])==0) *(output+connector[j]) = *(input + i) ; 
    220                       else *(output+connector[j]) += *(input + i) ; 
     220                      else *(output+connector[j]) = *(output+connector[j])* (*(count+connector[j])) + *(input + i) ; 
    221221                      (*(count+connector[j]))++ ; 
    222222                    }  
    223223                    j++ ; 
    224224                  } 
     225                for(int i=0, j=0; i<srcSize; i++) 
     226                    if (mask[i])  
     227                    { 
     228                      if (!std::isnan(*(input + i))) 
     229                        *(output+connector[j]) /= (*(count+connector[j])); 
     230                      j++ ; 
     231                    } 
    225232                break ; 
    226233              default : 
Note: See TracChangeset for help on using the changeset viewer.