Changeset 2228


Ignore:
Timestamp:
09/14/21 09:37:55 (3 months ago)
Author:
jderouillat
Message:

Fix in exclude masked points from transformation definition (domain_extract)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_extract.cpp

    r2227 r2228  
    189189  { 
    190190    { 
    191       int iIdxSrc = sourceWorkflowIdx(i)%domainSource->ni_glo-destIBegin; 
    192       int jIdxSrc = sourceWorkflowIdx(i)/domainSource->ni_glo-destJBegin; 
     191      int iIdxSrc = sourceWorkflowIdx(i)%domainSource->ni-destIBegin; 
     192      int jIdxSrc = sourceWorkflowIdx(i)/domainSource->ni-destJBegin; 
    193193      int extractedSrcWFIdx = jIdxSrc * niDest + iIdxSrc; 
    194194      if ((extractedSrcWFIdx>=0)&&(extractedSrcWFIdx<niDest*njDest)) 
     
    198198    } 
    199199  } 
     200 
     201  int iIdxSrcMin = INT_MAX; 
     202  int jIdxSrcMin = INT_MAX; 
     203  for (int countSrc = 0; countSrc < indexSize ; ++countSrc) 
     204  { 
     205      if ( sourceGlobalIdx(countSrc)%domainSource->ni_glo < iIdxSrcMin ) 
     206          iIdxSrcMin = sourceGlobalIdx(countSrc)%domainSource->ni_glo; 
     207      if ( sourceGlobalIdx(countSrc)/domainSource->ni_glo < jIdxSrcMin ) 
     208          jIdxSrcMin = sourceGlobalIdx(countSrc)/domainSource->ni_glo; 
     209  } 
    200210   
    201211  int countDest(0); // increment of the position in destination domain  
    202   for (int countSrc = 0; countSrc < indexSize ; ++countSrc) { 
     212  for (int countSrc = 0; countSrc < indexSize ; ++countSrc) 
     213  { 
    203214    int iIdxSrc = sourceGlobalIdx(countSrc)%domainSource->ni_glo; 
    204215    int jIdxSrc = sourceGlobalIdx(countSrc)/domainSource->ni_glo; 
     
    211222      domainDest_->j_index(countDest) = jIdxSrc-extractJBegin_; 
    212223 
     224      // ------------------ define transformation only if in the WF ------------------  
     225      int convert_locally_global_idx = (jIdxSrc-jIdxSrcMin)*domainSource->ni + (iIdxSrc-iIdxSrcMin) ; 
    213226      bool concerned_by_WF(false); 
    214227      for ( int i = 0 ; i<sourceWorkflowIdx.numElements() ; ++i ) 
    215228      { 
    216         if (sourceWorkflowIdx(i)==countSrc) 
     229        if (sourceWorkflowIdx(i)==convert_locally_global_idx) 
    217230        {       
    218231          concerned_by_WF = true; 
     
    224237        transformationMapping_[extractNi_*(jIdxSrc-extractJBegin_)+iIdxSrc-extractIBegin_]=sourceGlobalIdx(countSrc); 
    225238      } 
     239      // ----------------------------------------------------------------------------- 
    226240 
    227241      int iIdxDestLocal = countDest%niDest; 
Note: See TracChangeset for help on using the changeset viewer.