Changeset 2312


Ignore:
Timestamp:
03/21/22 15:25:14 (2 years ago)
Author:
ymipsl
Message:

temporary fix when reading grid from file. Some part of code must rewrite in future.
YM

Location:
XIOS/dev/dev_ym/XIOS_COUPLING/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/config/domain_attribute_private.conf

    r1553 r2312  
    11/* PRIVATE ATTRIBUTES */ 
    2 DECLARE_ATTRIBUTE_PRIVATE(double,  lon_start) 
    3 DECLARE_ATTRIBUTE_PRIVATE(double,  lon_end) 
    4 DECLARE_ATTRIBUTE_PRIVATE(double,  lat_start) 
    5 DECLARE_ATTRIBUTE_PRIVATE(double,  lat_end) 
     2DECLARE_ATTRIBUTE_PRIVATE(double,  lon_start, false) 
     3DECLARE_ATTRIBUTE_PRIVATE(double,  lon_end, false) 
     4DECLARE_ATTRIBUTE_PRIVATE(double,  lat_start, false) 
     5DECLARE_ATTRIBUTE_PRIVATE(double,  lat_end, false) 
    66 
    7 DECLARE_ATTRIBUTE_PRIVATE(double,  bounds_lon_start) 
    8 DECLARE_ATTRIBUTE_PRIVATE(double,  bounds_lon_end) 
    9 DECLARE_ATTRIBUTE_PRIVATE(double,  bounds_lat_start) 
    10 DECLARE_ATTRIBUTE_PRIVATE(double,  bounds_lat_end) 
     7DECLARE_ATTRIBUTE_PRIVATE(double,  bounds_lon_start, false) 
     8DECLARE_ATTRIBUTE_PRIVATE(double,  bounds_lon_end, false) 
     9DECLARE_ATTRIBUTE_PRIVATE(double,  bounds_lat_start, false) 
     10DECLARE_ATTRIBUTE_PRIVATE(double,  bounds_lat_end, false) 
    1111 
     12DECLARE_ATTRIBUTE(bool             , hasLatInReadFile, false) 
     13DECLARE_ATTRIBUTE(bool             , hasLonInReadFile, false) 
     14DECLARE_ATTRIBUTE(bool             , hasBoundsLatInReadFile, false) 
     15DECLARE_ATTRIBUTE(bool             , hasBoundsLonInReadFile, false) 
    1216//  Array contain whole value (non distributed) of longitude and latitude read from a file 
    13 DECLARE_ARRAY_PRIVATE(double, 1, lonvalue_rectilinear_read_from_file) 
    14 DECLARE_ARRAY_PRIVATE(double, 1, latvalue_rectilinear_read_from_file) 
     17DECLARE_ARRAY_PRIVATE(double, 1, lonvalue_rectilinear_read_from_file, false) 
     18DECLARE_ARRAY_PRIVATE(double, 1, latvalue_rectilinear_read_from_file, false) 
    1519 
    1620// Array containing longitude and latitude of LOCAL curvilinear domain to be read from a file 
    17 DECLARE_ARRAY_PRIVATE(double, 2, lonvalue_curvilinear_read_from_file) 
    18 DECLARE_ARRAY_PRIVATE(double, 2, latvalue_curvilinear_read_from_file) 
    19 DECLARE_ARRAY_PRIVATE(double, 3, bounds_lonvalue_curvilinear_read_from_file) 
    20 DECLARE_ARRAY_PRIVATE(double, 3, bounds_latvalue_curvilinear_read_from_file) 
     21DECLARE_ARRAY_PRIVATE(double, 2, lonvalue_curvilinear_read_from_file, false) 
     22DECLARE_ARRAY_PRIVATE(double, 2, latvalue_curvilinear_read_from_file, false) 
     23DECLARE_ARRAY_PRIVATE(double, 3, bounds_lonvalue_curvilinear_read_from_file, false) 
     24DECLARE_ARRAY_PRIVATE(double, 3, bounds_latvalue_curvilinear_read_from_file, false) 
    2125 
    2226// Array containing longitude and latitude of LOCAL unstructured domain to be read from a file 
    23 DECLARE_ARRAY_PRIVATE(double, 1, lonvalue_unstructured_read_from_file) 
    24 DECLARE_ARRAY_PRIVATE(double, 1, latvalue_unstructured_read_from_file) 
    25 DECLARE_ARRAY_PRIVATE(double, 2, bounds_lonvalue_unstructured_read_from_file) 
    26 DECLARE_ARRAY_PRIVATE(double, 2, bounds_latvalue_unstructured_read_from_file) 
     27DECLARE_ARRAY_PRIVATE(double, 1, lonvalue_unstructured_read_from_file, false) 
     28DECLARE_ARRAY_PRIVATE(double, 1, latvalue_unstructured_read_from_file, false) 
     29DECLARE_ARRAY_PRIVATE(double, 2, bounds_lonvalue_unstructured_read_from_file, false) 
     30DECLARE_ARRAY_PRIVATE(double, 2, bounds_latvalue_unstructured_read_from_file, false) 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/io/nc4_data_input.cpp

    r2308 r2312  
    495495    { 
    496496      // Ok, try to read some attributes such as longitude and latitude 
    497       domain->hasLatInReadFile_ = SuperClassWriter::hasVariable(itMapNj->first); 
    498       domain->hasLonInReadFile_ = SuperClassWriter::hasVariable(itMapNi->first); 
     497      domain->hasLatInReadFile = SuperClassWriter::hasVariable(itMapNj->first); 
     498      domain->hasLonInReadFile = SuperClassWriter::hasVariable(itMapNi->first); 
    499499    } 
    500500    else if ((CDomain::type_attr::curvilinear == domain->type) || (CDomain::type_attr::unstructured == domain->type) ) 
    501501    { 
    502502      StdString latName = this->getLatCoordName(fieldId); 
    503       domain->hasLatInReadFile_ = SuperClassWriter::hasVariable(latName) ; 
     503      domain->hasLatInReadFile = SuperClassWriter::hasVariable(latName) ; 
    504504      StdString lonName = this->getLonCoordName(fieldId);         
    505       domain->hasLonInReadFile_ = SuperClassWriter::hasVariable(lonName) ;  
     505      domain->hasLonInReadFile = SuperClassWriter::hasVariable(lonName) ;  
    506506      StdString boundsLatName = this->getBoundsId(latName); 
    507       domain->hasBoundsLatInReadFile_ = SuperClassWriter::hasVariable(boundsLatName) ;  
     507      domain->hasBoundsLatInReadFile = SuperClassWriter::hasVariable(boundsLatName) ;  
    508508      StdString boundsLonName = this->getBoundsId(lonName); 
    509       domain->hasBoundsLonInReadFile_ = SuperClassWriter::hasVariable(boundsLonName) ; 
     509      domain->hasBoundsLonInReadFile = SuperClassWriter::hasVariable(boundsLonName) ; 
    510510    } 
    511511  } 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/domain.cpp

    r2304 r2312  
    4242      , isRedistributed_(false), hasPole(false) 
    4343      , lonvalue(), latvalue(), bounds_lonvalue(), bounds_latvalue() 
    44       , clients(), hasLatInReadFile_(false), hasBoundsLatInReadFile_(false) 
    45       , hasLonInReadFile_(false), hasBoundsLonInReadFile_(false) 
     44      , clients() 
    4645   { 
    4746   } 
     
    5453      , isRedistributed_(false), hasPole(false) 
    5554      , lonvalue(), latvalue(), bounds_lonvalue(), bounds_latvalue() 
    56       , clients(), hasLatInReadFile_(false), hasBoundsLatInReadFile_(false) 
    57       , hasLonInReadFile_(false), hasBoundsLonInReadFile_(false) 
    58    { 
     55      , clients() 
     56    { 
    5957    } 
    6058 
     
    494492   TRY 
    495493   { 
    496      if (!lonvalue_rectilinear_read_from_file.isEmpty() && lonvalue_2d.isEmpty() && lonvalue_1d.isEmpty()) 
     494     if (!lonvalue_rectilinear_read_from_file.isEmpty() && lonvalue_2d.isEmpty() && lonvalue_1d.isEmpty() ) 
    497495     { 
    498496       lonvalue_1d.resize(ni); 
     
    502500       lon_end.setValue(lonvalue_rectilinear_read_from_file(ni_glo-1)); 
    503501     } 
    504      else if (!hasLonInReadFile_) 
     502     else if (hasLonInReadFile.isEmpty() || !hasLonInReadFile) 
    505503     { 
    506504       if (!lonvalue_2d.isEmpty()) lonvalue_2d.free(); 
     
    536534       lat_end.setValue(latvalue_rectilinear_read_from_file(nj_glo-1)); 
    537535     } 
    538      else if (!hasLatInReadFile_) 
     536     else if (hasLatInReadFile.isEmpty() || !hasLatInReadFile) 
    539537     { 
    540538       if (!latvalue_2d.isEmpty()) latvalue_1d.free(); 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/domain.hpp

    r2304 r2312  
    219219         bool hasLonLat; 
    220220         bool hasPole ; 
    221          bool hasLatInReadFile_ ; // specify if latitude is defined on read file, so it can be read later when grid distribution will be defined 
    222          bool hasBoundsLatInReadFile_ ; // specify if latitude boundarues are defined on read file, so it can be read later when grid distribution will be defined 
    223          bool hasLonInReadFile_ ; // specify if longitude is defined on read file, so it can be read later when grid distribution will be defined 
    224          bool hasBoundsLonInReadFile_ ; // specify if longitude boundaries are defined on read file, so it can be read later when grid distribution will be defined 
    225  
     221         
    226222         void computeLocalMask(void) ; 
    227223       
Note: See TracChangeset for help on using the changeset viewer.