Ignore:
Timestamp:
07/06/11 13:55:03 (13 years ago)
Author:
hozdoba
Message:

Ajout d'une partie d'Interface fortran pour la version 4
Ajout des sorties netcdf4 pour la version 4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XMLIO_V2/dev/dev_rv/src4/xmlio/main_server.cpp

    r242 r249  
    1616#include "xmlioserver_spl.hpp" 
    1717 
    18 #include "inetcdf4.hpp" 
    19 #include "inetcdf4_impl.hpp" 
    20 #include "inetcdf4_adv.hpp" 
    21 #include "inetcdf4_adv_impl.hpp" 
    22 #include "lscereader.hpp" 
     18#include "mpi_interface.hpp" 
     19#include "onetcdf4.hpp" 
     20#include "onetcdf4_impl.hpp" 
    2321 
    2422namespace xios = xmlioserver; 
     
    2725//~ using namespace xios::tree; 
    2826//~ using namespace xios::xml; 
    29 //~ using namespace xios::comm; 
     27using namespace xios::comm; 
    3028//~ using namespace xios::func; 
    31 using namespace xios::vtk; 
    3229 
    3330// Point d'entrée du programme serveur principal. 
    34 int main (int XIOS_UNUSED (argc), char ** XIOS_UNUSED (argv), char ** XIOS_UNUSED (env)) 
     31int main (int argc, char ** argv, char ** XIOS_UNUSED (env)) 
    3532{ 
    3633   try 
    3734   { 
     35      CMPIManager::Initialise(&argc, &argv); 
     36      { 
     37         MPI_Comm cworld = CMPIManager::GetCommWorld(); 
     38         int rank = CMPIManager::GetCommRank(); 
     39         int size = CMPIManager::GetCommSize(); 
     40          
     41         CONetCDF4 output("wk/data/herve.nc", false, &cworld); 
     42          
     43         CONetCDF4::CNetCDF4Path path; 
     44         path.push_back("ozdoba"); 
     45          
     46         output.addGroup("ozdoba"); 
     47         output.setCurrentPath(path); 
     48         output.addDimension("time"); 
     49         output.addDimension("x", 10); 
     50         output.addDimension("y", 10); 
     51          
     52         std::vector<std::string> dims; 
     53         dims.push_back("time"); 
     54         dims.push_back("x"); 
     55         dims.push_back("y"); 
     56          
     57         std::string toto("toto"); 
     58         output.addVariable(toto, NC_INT, dims); 
    3859 
     60         output.writeAttribute("att1", "llo"); 
     61          
     62         std::vector<int> vvv; 
     63         vvv.push_back(1); 
     64         output.writeAttribute("att1", vvv, &toto); 
     65         vvv.push_back(5); 
     66         output.writeAttribute("att5", vvv, &toto); 
     67          
     68         boost::multi_array<int, 2> data(boost::extents[2][10]); 
     69         boost::multi_array<int, 2>::iterator it = data.begin(), end = data.end(); 
     70          
     71         for (std::size_t i = 0; i < data.num_elements(); i++) data.data()[i] = rank; 
    3972 
     73         std::vector<std::size_t> _start; 
     74         std::vector<std::size_t> _count; 
     75         _start.push_back(10*rank/size); 
     76         _count.push_back(2); 
     77         _start.push_back(0); 
     78         _count.push_back(10); 
     79          
     80         output.writeData( data, toto, 0, false, &_start, &_count); 
     81      } 
    4082 
     83      CMPIManager::Finalize(); 
    4184   } 
    4285   catch (xios::CException & _exception) 
    4386   { 
    4487      std::cerr << _exception.getMessage() << std::endl; 
     88      CMPIManager::Finalize(); 
    4589      return (-1); 
    4690   } 
Note: See TracChangeset for help on using the changeset viewer.