Ignore:
Timestamp:
10/04/16 18:59:37 (5 years ago)
Author:
mhnguyen
Message:

Fortran interface: Receiving scalar value

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/interface/c/icdata.cpp

    r932 r961  
    698698   // ---------------------- Lecture des données ------------------------------ 
    699699 
     700   void cxios_read_data_k80(const char* fieldid, int fieldid_size, double* data_k8, int data_Xsize) 
     701   { 
     702      std::string fieldid_str; 
     703      if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 
     704 
     705      CTimer::get("XIOS").resume(); 
     706      CTimer::get("XIOS recv field").resume(); 
     707 
     708      CContext* context = CContext::getCurrent(); 
     709      if (!context->hasServer && !context->client->isAttachedModeEnabled()) 
     710        context->checkBuffersAndListen(); 
     711 
     712      CArray<double, 1> data(data_k8, shape(data_Xsize), neverDeleteData); 
     713      CField::get(fieldid_str)->getData(data); 
     714 
     715      CTimer::get("XIOS recv field").suspend(); 
     716      CTimer::get("XIOS").suspend(); 
     717   } 
     718 
    700719   void cxios_read_data_k81(const char* fieldid, int fieldid_size, double* data_k8, int data_Xsize) 
    701720   { 
     
    840859   } 
    841860 
     861   void cxios_read_data_k40(const char* fieldid, int fieldid_size, float* data_k4, int data_Xsize) 
     862   { 
     863      std::string fieldid_str; 
     864      if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 
     865 
     866      CTimer::get("XIOS").resume(); 
     867      CTimer::get("XIOS recv field").resume(); 
     868 
     869      CContext* context = CContext::getCurrent(); 
     870      if (!context->hasServer && !context->client->isAttachedModeEnabled()) 
     871        context->checkBuffersAndListen(); 
     872 
     873      CArray<double, 1> data(data_Xsize); 
     874      CField::get(fieldid_str)->getData(data); 
     875      CArray<float, 1> data_tmp(data_k4, shape(data_Xsize), neverDeleteData); 
     876      data_tmp = data; 
     877 
     878      CTimer::get("XIOS recv field").suspend(); 
     879      CTimer::get("XIOS").suspend(); 
     880   } 
     881 
    842882   void cxios_read_data_k41(const char* fieldid, int fieldid_size, float* data_k4, int data_Xsize) 
    843883   { 
Note: See TracChangeset for help on using the changeset viewer.