Ignore:
Timestamp:
11/02/15 11:46:25 (9 years ago)
Author:
mhnguyen
Message:

Implementing the reading of attributes of an axis from a file

+) 3d grid can be read directly from a file
+) Clean some redundant codes
+) Add new attribute declaration that allows to output only desired attributes

Test
+) On Curie
+) test_remap passes and result is correct

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/node/file.cpp

    r773 r775  
    2424      : CObjectTemplate<CFile>(), CFileAttributes() 
    2525      , vFieldGroup(), data_out(), enabledFields(), fileComm(MPI_COMM_NULL) 
     26      , allDomainEmpty(false), isOpen(false) 
    2627   { 
    2728     setVirtualFieldGroup(); 
     
    3233      : CObjectTemplate<CFile>(id), CFileAttributes() 
    3334      , vFieldGroup(), data_out(), enabledFields(), fileComm(MPI_COMM_NULL) 
     35      , allDomainEmpty(false), isOpen(false) 
    3436    { 
    3537      setVirtualFieldGroup(); 
     
    543545   //---------------------------------------------------------------- 
    544546 
     547   void CFile::readAttributesOfEnabledFieldsInReadMode() 
     548   { 
     549     if (enabledFields.empty()) return; 
     550 
     551     // Just check file and try to open it 
     552     CContext* context = CContext::getCurrent(); 
     553     CContextClient* client=context->client; 
     554 
     555     MPI_Comm_dup(client->intraComm, &fileComm); 
     556     checkFile(); 
     557     for (int idx = 0; idx < enabledFields.size(); ++idx) 
     558     { 
     559        // First of all, find out which domain and axis associated with this field 
     560        enabledFields[idx]->solveGridReference(); 
     561 
     562        // Read attributes of domain and axis from this file 
     563        this->data_in->readFieldAttributesMetaData(enabledFields[idx]); 
     564 
     565        // Now complete domain and axis associated with this field 
     566        enabledFields[idx]->solveGenerateGrid(); 
     567 
     568        // Read necessary value from file 
     569        this->data_in->readFieldAttributesValues(enabledFields[idx]); 
     570 
     571        // Fill attributes for base reference 
     572        enabledFields[idx]->solveGridDomainAxisBaseRef(); 
     573     } 
     574 
     575     // Now everything is ok, close it 
     576     close(); 
     577 
     578   } 
     579 
     580 
    545581   /*! 
    546582   \brief Parse xml file and write information into file object 
Note: See TracChangeset for help on using the changeset viewer.