- Timestamp:
- 03/10/22 13:47:59 (3 years ago)
- Location:
- XIOS/dev/dev_ym/XIOS_COUPLING/src/io
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_ym/XIOS_COUPLING/src/io/inetcdf4.cpp
r2274 r2308 708 708 scount.push_back(1); 709 709 it++; 710 } 711 for (int i = 0; it != dimlist.end(); it++, i++) 710 711 if ( it == dimlist.end()) // scalar case 712 { 713 if (start && count) 714 { 715 scount.pop_back(); 716 scount.push_back((*count)[0]); 717 array_size *= (*count)[0]; 718 } 719 return ; 720 } 721 } 722 723 if ( it == dimlist.end()) // scalar case 712 724 { 713 725 if (start && count) 714 726 { 715 sstart.push_back((*start)[ i]);716 scount.push_back((*count)[ i]);717 array_size *= (*count)[ i];727 sstart.push_back((*start)[0]); 728 scount.push_back((*count)[0]); 729 array_size *= (*count)[0]; 718 730 } 719 731 else 720 732 { 721 733 sstart.push_back(0); 722 scount.push_back(dimmap[*it]); 723 array_size *= dimmap[*it]; 734 scount.push_back(1); 735 array_size *= 1; 736 } 737 738 } 739 else 740 { 741 for (int i = 0; it != dimlist.end(); it++, i++) 742 { 743 if (start && count) 744 { 745 sstart.push_back((*start)[i]); 746 scount.push_back((*count)[i]); 747 array_size *= (*count)[i]; 748 } 749 else 750 { 751 sstart.push_back(0); 752 scount.push_back(dimmap[*it]); 753 array_size *= dimmap[*it]; 754 } 724 755 } 725 756 } -
XIOS/dev/dev_ym/XIOS_COUPLING/src/io/inetcdf4_impl.hpp
r782 r2308 31 31 << " ] Invalid array size"); 32 32 } 33 34 CNetCdfInterface::getVaraType(ncidp, varid, &sstart[0], &scount[0], data.dataFirst()); 33 34 if (data.numElements()==0) 35 { 36 T data ; 37 CNetCdfInterface::getVaraType(ncidp, varid, &sstart[0], &scount[0], &data); // netcdf is very bad 38 } 39 else CNetCdfInterface::getVaraType(ncidp, varid, &sstart[0], &scount[0], data.dataFirst()); 35 40 } 36 41 -
XIOS/dev/dev_ym/XIOS_COUPLING/src/io/nc4_data_input.cpp
r1930 r2308 66 66 std::vector<StdString> domainList = grid->getDomainList(); 67 67 std::vector<StdString> axisList = grid->getAxisList(); 68 std::vector<StdString> scalarList = grid->getScalarList(); 68 69 int numElement = axisDomainOrder.numElements(); 69 int idxDomain = domainList.size() - 1, idxAxis = axisList.size() - 1 ;70 int idxDomain = domainList.size() - 1, idxAxis = axisList.size() - 1 ; 70 71 int idx = domainList.size() * 2 + axisList.size() - 1; 71 72 … … 98 99 if (1 == axisDomainOrder.numElements()) 99 100 { 101 CScalar* scalar = CScalar::get(scalarList[0]); 100 102 start.push_back(0); 101 count.push_back( 1);103 count.push_back(scalar->n); 102 104 } 103 105 }
Note: See TracChangeset
for help on using the changeset viewer.