Changeset 660
- Timestamp:
- 07/30/15 15:18:00 (9 years ago)
- Location:
- XIOS/trunk
- Files:
-
- 6 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/arch/arch-X64_CURIE.path
r574 r660 1 1 NETCDF_INCDIR="-I $NETCDF_INCDIR" 2 2 NETCDF_LIBDIR="-L $NETCDF_LIBDIR" 3 NETCDF_LIB="-lnetcdf "3 NETCDF_LIB="-lnetcdf -lnetcdff" 4 4 5 5 MPI_INCDIR="" -
XIOS/trunk/bld.cfg
r657 r660 31 31 bld::target libxios.a 32 32 #bld::target generate_fortran_interface.exe 33 bld::target xios_server.exe test_client.exe parse_xml.exe test_complete.exe test_xios_interface.exe test_new_features.exe test_unstruct_complete.exe 33 bld::target xios_server.exe test_remap.exe 34 bld::target test_new_features.exe test_unstruct_complete.exe 35 bld::target test_client.exe test_complete.exe 34 36 bld::exe_dep 35 37 … … 56 58 bld::excl_dep use::mod_prism_proto 57 59 bld::excl_dep use::mod_prism 60 bld::excl_dep use::netcdf 58 61 bld::excl_dep inc::mpif.h -
XIOS/trunk/make_xios
r601 r660 156 156 157 157 XIOS_CINCDIR="$NETCDF_INCDIR $HDF5_INCDIR $MPI_INCDIR" 158 XIOS_FINCDIR="$ XIOS_FINCDIR $MPI_INCDIR"158 XIOS_FINCDIR="$NETCDF_INCDIR $XIOS_FINCDIR $MPI_INCDIR" 159 159 160 160 XIOS_LIB="$XIOS_LIB $NETCDF_LIBDIR $HDF5_LIBDIR $MPI_LIBDIR $NETCDF_LIB $HDF5_LIB $MPI_LIB" -
XIOS/trunk/src/distribution_client.cpp
r657 r660 196 196 nZoomEnd_.at((indexMap_[idx]+1)) = domList[domIndex]->global_zoom_jbegin + domList[domIndex]->global_zoom_nj-1; 197 197 198 dataBegin_.at(indexMap_[idx]+1) = (2 == domList[domIndex]->data_dim) ? domList[domIndex]->data_jbegin.getValue() : -1;198 dataBegin_.at(indexMap_[idx]+1) = domList[domIndex]->data_jbegin.getValue(); //(2 == domList[domIndex]->data_dim) ? domList[domIndex]->data_jbegin.getValue() : -1; 199 199 dataIndex_.at(indexMap_[idx]+1).resize(domList[domIndex]->data_j_index.numElements()); 200 200 dataIndex_.at(indexMap_[idx]+1) = domList[domIndex]->data_j_index; … … 212 212 dataIndex_.at(indexMap_[idx]) = domList[domIndex]->data_i_index; 213 213 214 dataNIndex_.at(idx) = domList[domIndex]->data_ n_index.getValue();214 dataNIndex_.at(idx) = domList[domIndex]->data_i_index.numElements(); 215 215 dataDims_.at(idx) = domList[domIndex]->data_dim.getValue(); 216 216 … … 617 617 const int& dataDim, const int& ni, int& j) 618 618 { 619 // int tempI = dataIIndex + dataIBegin, 620 // tempJ = (1 == dataDim) ? -1 621 // : (dataJIndex + dataJBegin); 622 // int i = (dataDim == 1) ? (tempI - 1) % ni 623 // : (tempI - 1) ; 624 // j = (dataDim == 1) ? (tempI - 1) / ni 625 // : (tempJ - 1) ; 626 619 627 int tempI = dataIIndex + dataIBegin, 620 tempJ = (1 == dataDim) ? -1 621 : (dataJIndex + dataJBegin); 622 int i = (dataDim == 1) ? (tempI - 1) % ni 623 : (tempI - 1) ; 624 j = (dataDim == 1) ? (tempI - 1) / ni 625 : (tempJ - 1) ; 628 tempJ = (dataJIndex + dataJBegin); 629 int i = (dataDim == 1) ? (tempI) % ni 630 : (tempI) ; 631 j = (dataDim == 1) ? (tempI) / ni 632 : (tempJ) ; 626 633 627 634 return i; -
XIOS/trunk/src/node/domain.cpp
r657 r660 135 135 if (!area.isEmpty()) 136 136 area.transposeSelf(1, 0); 137 138 // ni=1 ;139 // ibegin=0 ;140 // iend=0 ;141 142 137 } 143 138 else if ((ni_glo.isEmpty() || ni_glo.getValue() <= 0 ) || … … 332 327 else if (data_dim.isEmpty()) 333 328 { 334 ERROR("CDomain::checkAttributes(void)", 335 << "Data dimension undefined !") ; 329 data_dim.setValue(1); 330 // ERROR("CDomain::checkAttributes(void)", 331 // << "Data dimension undefined !") ; 336 332 } 337 333 338 334 if (data_ibegin.isEmpty()) 339 335 data_ibegin.setValue(0) ; 340 if (data_jbegin.isEmpty() && (data_dim.getValue() == 2))336 if (data_jbegin.isEmpty()) 341 337 data_jbegin.setValue(0) ; 342 338 … … 353 349 } 354 350 355 if (data_dim.getValue() == 2) 356 { 357 if (!data_nj.isEmpty() && (data_nj.getValue() <= 0) ) 351 if (!data_nj.isEmpty() && (data_nj.getValue() <= 0) ) 352 { 353 ERROR("CDomain::checkAttributes(void)", 354 << "Data dimension is negative (data_nj).") ; 355 } 356 357 if (data_nj.isEmpty()) 358 data_nj.setValue((data_dim.getValue() == 1) 359 ? (ni.getValue() * nj.getValue()) 360 : nj.getValue()); 361 362 } 363 364 //---------------------------------------------------------------- 365 366 void CDomain::checkCompression(void) 367 { 368 if (!data_i_index.isEmpty()) 369 { 370 // int ssize = data_i_index.numElements(); 371 // if (!data_n_index.isEmpty() && 372 // (data_n_index.getValue() != ssize)) 373 // { 374 // ERROR("CDomain::checkAttributes(void)", 375 // <<"Dimension data_i_index incompatible with data_n_index.") ; 376 // } 377 // else if (data_n_index.isEmpty()) 378 // data_n_index.setValue(ssize) ; 379 if (!data_j_index.isEmpty() && 380 (data_j_index.numElements() != data_i_index.numElements())) 381 { 382 ERROR("CDomain::checkAttributes(void)", 383 <<"Dimension data_j_index incompatible with data_i_index.") ; 384 } 385 386 if (2 == data_dim.getValue()) 358 387 { 359 ERROR("CDomain::checkAttributes(void)", 360 << "Data dimension is negative (data_nj).") ; 361 } 362 else if (data_nj.isEmpty()) 363 data_nj.setValue(nj.getValue()) ; 364 } 365 366 } 367 368 //---------------------------------------------------------------- 369 370 void CDomain::checkCompression(void) 371 { 372 if (!data_i_index.isEmpty()) 373 { 374 int ssize = data_i_index.numElements(); 375 if (!data_n_index.isEmpty() && 376 (data_n_index.getValue() != ssize)) 377 { 378 ERROR("CDomain::checkAttributes(void)", 379 <<"Dimension data_i_index incompatible with data_n_index.") ; 380 } 381 else if (data_n_index.isEmpty()) 382 data_n_index.setValue(ssize) ; 383 384 if (data_dim.getValue() == 2) 385 { 386 if (!data_j_index.isEmpty() && 387 (data_j_index.numElements() != data_i_index.numElements())) 388 { 389 ERROR("CDomain::checkAttributes(void)", 390 <<"Dimension data_j_index incompatible with data_i_index.") ; 391 } 392 else if (data_j_index.isEmpty()) 388 if (data_j_index.isEmpty()) 393 389 { 394 390 ERROR("CDomain::checkAttributes(void)", … … 396 392 } 397 393 } 394 else // (1 == data_dim.getValue()) 395 { 396 if (data_j_index.isEmpty()) 397 { 398 const int dni = data_ni.getValue(); 399 data_j_index.resize(dni); 400 for (int j = 0; j < dni; ++j) data_j_index(j) = 0; 401 } 402 403 } 398 404 } 399 405 else 400 406 { 401 if (!data_n_index.isEmpty() || 402 ((data_dim.getValue() == 2) && (!data_j_index.isEmpty()))) 407 // if (!data_n_index.isEmpty() || 408 // ((data_dim.getValue() == 2) && (!data_j_index.isEmpty()))) 409 // ERROR("CDomain::checkAttributes(void)", << "data_i_index undefined") ; 410 if ((data_dim.getValue() == 2) && (!data_j_index.isEmpty())) 403 411 ERROR("CDomain::checkAttributes(void)", << "data_i_index undefined") ; 404 } 405 406 if (data_n_index.isEmpty()) 407 { // -> bloc re-vérifié OK 408 if (data_dim.getValue() == 1) 412 413 if (1 == data_dim.getValue()) 409 414 { 410 415 const int dni = data_ni.getValue(); 411 416 data_i_index.resize(dni) ; 417 data_j_index.resize(dni) ; 412 418 data_n_index.setValue(dni); 413 for (int i = 0; i < dni; i++) data_i_index(i) = i+1 ; 419 for (int i = 0; i < dni; ++i) 420 { 421 data_i_index(i) = i; 422 data_j_index(i) = 0; 423 } 414 424 } 415 425 else // (data_dim == 2) … … 421 431 data_n_index.setValue(dni); 422 432 423 for(int count = 0, j = 0; j < data_nj.getValue(); j++)433 for(int count = 0, j = 0; j < data_nj.getValue(); ++j) 424 434 { 425 for(int i = 0; i < data_ni.getValue(); i++, count++)435 for(int i = 0; i < data_ni.getValue(); ++i, ++count) 426 436 { 427 data_i_index(count) = i +1;428 data_j_index(count) = j +1;437 data_i_index(count) = i; 438 data_j_index(count) = j; 429 439 } 430 440 } 431 441 } 432 442 } 443 444 // if (data_n_index.isEmpty()) 445 // { // -> bloc re-vérifié OK 446 // if (data_dim.getValue() == 1) 447 // { 448 // const int dni = data_ni.getValue(); 449 // data_i_index.resize(dni) ; 450 // data_n_index.setValue(dni); 451 // for (int i = 0; i < dni; i++) data_i_index(i) = i+1 ; 452 // } 453 // else // (data_dim == 2) 454 // { 455 // const int dni = data_ni.getValue() * data_nj.getValue(); 456 // data_i_index.resize(dni) ; 457 // data_j_index.resize(dni) ; 458 // 459 // data_n_index.setValue(dni); 460 // 461 // for(int count = 0, j = 0; j < data_nj.getValue(); j++) 462 // { 463 // for(int i = 0; i < data_ni.getValue(); i++, count++) 464 // { 465 // data_i_index(count) = i+1 ; 466 // data_j_index(count) = j+1 ; 467 // } 468 // } 469 // } 470 // } 433 471 } 434 472 -
XIOS/trunk/src/node/grid.cpp
r657 r660 15 15 #include "server_distribution_description.hpp" 16 16 #include "client_server_mapping_distributed.hpp" 17 #include "distribution_client.hpp" 18 #include "grid_transformation.hpp" 17 19 18 20 namespace xios { -
XIOS/trunk/src/node/grid.hpp
r657 r660 11 11 #include "array_new.hpp" 12 12 #include "attribute_array.hpp" 13 #include "distribution_client.hpp"14 13 #include "distribution_server.hpp" 15 14 #include "client_server_mapping.hpp" 16 15 #include "utils.hpp" 17 16 #include "transformation_enum.hpp" 18 #include "grid_transformation.hpp"19 17 20 18 namespace xios { -
XIOS/trunk/src/test/test_unstruct_complete.f90
r659 r660 190 190 IF (mask(ind)) THEN 191 191 data_n_index=data_n_index+1 192 data_i_index(data_n_index)=ind 192 data_i_index(data_n_index)=ind-1 193 193 field_A_compressed(data_n_index,:)=field_A_srf(ind,:) 194 194 ENDIF … … 200 200 201 201 CALL xios_set_axis_attr("axis_srf",size=llm ,value=lval) ; 202 ! CALL xios_set_domain_attr("domain_srf",ni_glo=ncell_glo, ni=ncell, ibegin=1, i_index=RESHAPE(i_index,(/ncell,1/) ))203 202 CALL xios_set_domain_attr("domain_srf", ni_glo=ncell_glo, ni=ncell, ibegin=1, i_index=i_index) 204 203 CALL xios_set_domain_attr("domain_srf", type='unstructured', data_dim=1, data_ni=data_n_index, & … … 206 205 CALL xios_set_domain_attr("domain_srf", lonvalue=lon, latvalue=lat) 207 206 CALL xios_set_domain_attr("domain_srf", nvertex=4, bounds_lon=bounds_lon, bounds_lat=bounds_lat) 208 ! CALL xios_set_domain_attr("domain_srf", mask=RESHAPE(mask,(/ncell,1/) )) 207 209 208 210 209 -
XIOS/trunk/src/transformation/domain_algorithm_interpolate_from_file.cpp
r657 r660 13 13 #include "distribution_client.hpp" 14 14 #include "client_server_mapping_distributed.hpp" 15 #include "netcdf.hpp" 15 16 16 17 namespace xios { … … 34 35 std::string filename = interpDomain_->file.getValue(); 35 36 std::map<int,std::vector<std::pair<int,double> > > interpMapValue; 36 //readInterpolationInfo(filename, interpMapValue);37 38 randomizeInterpolationInfo(interpMapValue);37 readInterpolationInfo(filename, interpMapValue); 38 39 //randomizeInterpolationInfo(interpMapValue); 39 40 boost::unordered_map<size_t,int> globalIndexOfDomainDest; 40 41 int ni = domainDest_->ni.getValue(); … … 232 233 std::map<int,std::vector<std::pair<int,double> > >& interpMapValue) 233 234 { 234 235 } 236 237 } 235 int ncid ; 236 int weightDimId ; 237 size_t nbWeightGlo ; 238 239 CContext* context = CContext::getCurrent(); 240 CContextClient* client=context->client; 241 int clientRank = client->clientRank; 242 int clientSize = client->clientSize; 243 244 nc_open(filename.c_str(),NC_NOWRITE, &ncid) ; 245 nc_inq_dimid(ncid,"n_weight",&weightDimId) ; 246 nc_inq_dimlen(ncid,weightDimId,&nbWeightGlo) ; 247 248 size_t nbWeight ; 249 size_t start ; 250 size_t div = nbWeightGlo/clientSize ; 251 size_t mod = nbWeightGlo%clientSize ; 252 if (clientRank < mod) 253 { 254 nbWeight=div+1 ; 255 start=clientRank*(div+1) ; 256 } 257 else 258 { 259 nbWeight=div ; 260 start= mod * (div+1) + (clientRank-mod) * div ; 261 } 262 263 264 265 double* weight=new double[nbWeight] ; 266 int weightId ; 267 nc_inq_varid (ncid, "weight", &weightId) ; 268 nc_get_vara_double(ncid, weightId, &start, &nbWeight, weight) ; 269 270 long* srcIndex=new long[nbWeight] ; 271 int srcIndexId ; 272 nc_inq_varid (ncid, "src_idx", &srcIndexId) ; 273 nc_get_vara_long(ncid, srcIndexId, &start, &nbWeight, srcIndex) ; 274 275 long* dstIndex=new long[nbWeight] ; 276 int dstIndexId ; 277 nc_inq_varid (ncid, "dst_idx", &dstIndexId) ; 278 nc_get_vara_long(ncid, dstIndexId, &start, &nbWeight, dstIndex) ; 279 280 for(size_t ind=0; ind<nbWeight;++ind) 281 interpMapValue[dstIndex[ind]].push_back(make_pair(srcIndex[ind],weight[ind])); 282 } 283 284 } -
XIOS/trunk/src/transformation/grid_transformation.cpp
r657 r660 17 17 #include "transformation_mapping.hpp" 18 18 #include "axis_algorithm_transformation.hpp" 19 #include "distribution_client.hpp" 19 20 20 21 namespace xios {
Note: See TracChangeset
for help on using the changeset viewer.