Changeset 734


Ignore:
Timestamp:
10/13/15 15:51:17 (5 years ago)
Author:
mhnguyen
Message:

Correcting a bug concerning the range of longitude and latitude of auto-generated domain

+) Modify range of auto-generated longitude and latitude
+) Update test_remap

Test
+) On Curie
+) auto-generating domain source and domain dest
+) result is correct

Location:
XIOS/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/inputs/REMAP/iodef.xml

    r721 r734  
    99     <field id="src_field"  operation="instant" grid_ref="src_grid"/> 
    1010     <field id="dst_field"  operation="instant" field_ref="src_field" grid_ref="dst_grid"/> 
    11      <field id="dst_field_regular"  operation="instant" field_ref="tmp_field" grid_ref="dst_grid_regular"/> 
     11     <field id="dst_field_regular"  operation="instant" field_ref="tmp_field" grid_ref="dst_grid_regular"  read_access="true"/> 
    1212     <field id="tmp_field"  operation="instant" grid_ref="src_grid_regular"/> 
    1313   </field_definition> 
     
    2222     </file> 
    2323     <file id="output_dst_regular" name="output_dst_regular" type="one_file"> 
    24 <!--        <field field_ref="dst_field_regular" name="field" />--> 
     24        <field field_ref="dst_field_regular" name="field" /> 
    2525     </file> 
    26  
    2726     <file id="output_src_regular" name="output_src_regular" mode="read" type="multiple_file"> 
    28 <!--        <field id="src_field_regular" name="field" grid_ref="src_grid_regular" operation="instant"/>--> 
    29      </file> 
    30      <file id="output_regular" name="output_regular" mode="write"> 
    31 <!--        <field field_ref="field_regular" name="field" />--> 
     27        <field id="src_field_regular" name="field" grid_ref="src_grid_regular" operation="instant"/> 
    3228     </file> 
    3329   </file_definition> 
     
    4036     <domain id="src_domain" /> 
    4137     <domain id="dst_domain" domain_src="src_domain"> 
    42 <!--       <interpolate_domain file="weight.nc"/>--> 
    4338       <interpolate_domain/> 
    4439     </domain> 
    45      <domain id="dst_domain_regular" domain_src="src_domain_regular" ni_glo="90" nj_glo="60" type="rectilinear"> 
     40     <domain id="dst_domain_regular" domain_src="src_domain_regular" ni_glo="360" nj_glo="180" type="rectilinear"> 
    4641       <generate_rectilinear_domain /> 
    4742       <interpolate_domain/> 
    4843     </domain> 
    4944     <domain id="src_domain_regular" ni_glo="180" nj_glo="90" type="rectilinear"> 
    50        <generate_rectilinear_domain /> 
     45       <generate_rectilinear_domain bounds_lat_start="-90" bounds_lat_end="90" lon_start="2" lon_end="360" /> 
    5146     </domain> 
    5247   </domain_definition> 
     
    7469            <variable id="optimal_buffer_size" type="string">performance</variable> 
    7570            <variable id="buffer_size_factor" type="double">30.0</variable> 
     71            <variable id="buffer_size_min" type="double">800000</variable> 
    7672         </variable_group> 
    7773 
  • XIOS/trunk/src/node/domain.cpp

    r731 r734  
    338338     double latRange = lat_end - lat_start; 
    339339 
    340      double lonStep = lonRange/double(ni_glo.getValue()); 
    341      double latStep = latRange/double(nj_glo.getValue()); 
     340     double lonStep = (1 == ni_glo.getValue()) ? lonRange : lonRange/double(ni_glo.getValue()-1); 
     341     double latStep = (1 == nj_glo.getValue()) ? latRange : latRange/double(nj_glo.getValue()-1); 
    342342 
    343343     // Assign lon value 
     
    423423         int nbClient; 
    424424         MPI_Comm_size(client->intraComm,&nbClient); 
     425         it->second->checkValid(this); 
    425426         this->redistribute(nbClient); 
    426427         break; 
  • XIOS/trunk/src/node/generate_rectilinear_domain.cpp

    r727 r734  
    7171               << "Define only one attribute: 'bounds_lat_start' or 'lat_start'."); 
    7272 
    73     if (!bounds_lon_start.isEmpty() && !lat_start.isEmpty()) 
    74          ERROR("CGenerateRectilinearDomain::checkValid(CDomain* domainDst)", 
    75                << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 
    76                << "Only one latitude boundary attribute or latitude can be used but both 'bounds_lon_start' and 'lat_start' are defined." << std::endl 
    77                << "Define only one pair of attributes: ('bounds_lon_start' and 'bounds_lat_start') or ('lon_start' and 'lat_start')."); 
    78  
    79     if (!bounds_lat_start.isEmpty() && !lon_start.isEmpty()) 
    80          ERROR("CGenerateRectilinearDomain::checkValid(CDomain* domainDst)", 
    81                << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 
    82                << "Only one latitude boundary attribute or latitude can be used but both 'bounds_lat_start' and 'lon_start' are defined." << std::endl 
    83                << "Define only one pair of attributes: ('bounds_lon_start' and 'bounds_lat_start') or ('lon_start' and 'lat_start')."); 
    84  
    85     if (bounds_lon_start.isEmpty() && bounds_lat_start.isEmpty() && 
    86         lon_start.isEmpty() && lat_start.isEmpty()) 
     73    if (bounds_lon_start.isEmpty() && lon_start.isEmpty()) 
    8774    { 
    8875      bounds_lon_start.setValue(defaultBndsLonStart); 
    8976      bounds_lon_end.setValue(defaultBndsLonEnd); 
     77    } 
     78 
     79    if (bounds_lat_start.isEmpty() && lat_start.isEmpty()) 
     80    { 
    9081      bounds_lat_start.setValue(defaultBndsLatStart); 
    9182      bounds_lat_end.setValue(defaultBndsLatEnd); 
     
    9788 
    9889      double boundsLonRange = bounds_lon_end - bounds_lon_start; 
    99       double boundsLonStep = boundsLonRange/double(niGlo); 
     90      double boundsLonStep = boundsLonRange/(double(niGlo)); 
    10091      domainDst->bounds_lon_start = bounds_lon_start; 
    10192      domainDst->bounds_lon_end   = bounds_lon_end; 
     
    109100 
    110101      double boundsLatRange = bounds_lat_end - bounds_lat_start; 
    111       double boundsLatStep = boundsLatRange/double(njGlo); 
     102      double boundsLatStep = boundsLatRange/(double(njGlo)); 
    112103      domainDst->bounds_lat_start = bounds_lat_start; 
    113104      domainDst->bounds_lat_end   = bounds_lat_end; 
     
    123114 
    124115      double lonRange = lon_end - lon_start; 
    125       double lonStep = lonRange/double(niGlo); 
     116      double lonStep = (1 == niGlo) ? lonRange : lonRange/(double(niGlo)-1); 
    126117      domainDst->lon_start = lon_start; 
    127118      domainDst->lon_end   = lon_end; 
     
    135126 
    136127      double latRange = lat_end - lat_start; 
    137       double latStep = latRange/double(njGlo); 
     128      double latStep = (1 == njGlo) ? latRange : latRange/(double(njGlo)-1); 
    138129      domainDst->lat_start = lat_start; 
    139130      domainDst->lat_end   = lat_end; 
  • XIOS/trunk/src/test/test_remap.f90

    r721 r734  
    129129 
    130130  DO ts=1,1 
    131 !    CALL xios_recv_field("src_field_regular", tmp_field) 
     131    CALL xios_recv_field("src_field_regular", tmp_field) 
    132132    CALL xios_update_calendar(ts) 
    133133    CALL xios_send_field("src_field",src_field) 
    134 !    CALL xios_send_field("tmp_field",tmp_field) 
     134    CALL xios_send_field("tmp_field",tmp_field) 
    135135    CALL wait_us(5000) ; 
    136136  ENDDO 
  • XIOS/trunk/src/transformation/grid_transformation.cpp

    r689 r734  
    5454    CDomain* domain = CDomain::createDomain(); 
    5555    domain->setAttributes(domainSrcTmp[idx]); 
     56    domain->solveInheritanceTransformation(); 
    5657    domain->checkAttributesOnClient(); 
    5758    domainSrc.push_back(domain); 
Note: See TracChangeset for help on using the changeset viewer.