Changeset 593
- Timestamp:
- 05/26/15 16:13:45 (9 years ago)
- Location:
- XIOS/trunk/src
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/config/field_attribute.conf
r538 r593 13 13 14 14 DECLARE_ATTRIBUTE(bool, enabled) 15 DECLARE_ATTRIBUTE(bool, read_access) 15 16 16 17 DECLARE_ATTRIBUTE(StdString, domain_ref) -
XIOS/trunk/src/interface/c/icdata.cpp
r591 r593 36 36 typedef enum { NETCDF4 = 0 } XFileType; 37 37 38 typedef xios::CContext 38 typedef xios::CContext* XContextPtr; 39 39 40 40 // -------------------- Traitement des données ------------------------------ … … 52 52 } 53 53 54 void cxios_init_client(const char 54 void cxios_init_client(const char* client_id , int len_client_id, MPI_Fint* f_local_comm, MPI_Fint* f_return_comm ) 55 55 { 56 56 std::string str; 57 MPI_Comm local_comm 58 MPI_Comm return_comm 57 MPI_Comm local_comm; 58 MPI_Comm return_comm; 59 59 60 60 if (!cstr2string(client_id, len_client_id, str)) return; 61 61 62 int initialized 63 MPI_Initialized(&initialized) 64 if (initialized) local_comm=MPI_Comm_f2c(*f_local_comm) 65 else local_comm=MPI_COMM_NULL 66 CXios::initClientSide(str, local_comm,return_comm);67 *f_return_comm=MPI_Comm_c2f(return_comm) 68 CTimer::get("XIOS init").suspend() 69 CTimer::get("XIOS").suspend() 70 } 71 72 void cxios_context_initialize(const char 62 int initialized; 63 MPI_Initialized(&initialized); 64 if (initialized) local_comm=MPI_Comm_f2c(*f_local_comm); 65 else local_comm=MPI_COMM_NULL; 66 CXios::initClientSide(str, local_comm, return_comm); 67 *f_return_comm=MPI_Comm_c2f(return_comm); 68 CTimer::get("XIOS init").suspend(); 69 CTimer::get("XIOS").suspend(); 70 } 71 72 void cxios_context_initialize(const char* context_id , int len_context_id, MPI_Fint* f_comm) 73 73 { 74 74 std::string str; 75 MPI_Comm comm 75 MPI_Comm comm; 76 76 77 77 if (!cstr2string(context_id, len_context_id, str)) return; 78 CTimer::get("XIOS").resume() 79 CTimer::get("XIOS init context").resume() 80 comm=MPI_Comm_f2c(*f_comm) 81 CClient::registerContext(str, comm);82 CTimer::get("XIOS init context").suspend() 83 CTimer::get("XIOS").suspend() 84 } 85 86 void cxios_context_is_initialized(const char 78 CTimer::get("XIOS").resume(); 79 CTimer::get("XIOS init context").resume(); 80 comm=MPI_Comm_f2c(*f_comm); 81 CClient::registerContext(str, comm); 82 CTimer::get("XIOS init context").suspend(); 83 CTimer::get("XIOS").suspend(); 84 } 85 86 void cxios_context_is_initialized(const char* context_id , int len_context_id, bool* initialized) 87 87 { 88 88 std::string str; 89 89 90 90 if (!cstr2string(context_id, len_context_id, str)) return; 91 CTimer::get("XIOS").resume() 92 CContext* context = CContext::get(str, str);93 *initialized=context->isInitialized() 94 CTimer::get("XIOS").suspend() 91 CTimer::get("XIOS").resume(); 92 CContext* context = CContext::get(str, str); 93 *initialized=context->isInitialized(); 94 CTimer::get("XIOS").suspend(); 95 95 } 96 96 97 97 void cxios_context_close_definition() 98 98 { 99 CTimer::get("XIOS").resume() 100 CTimer::get("XIOS close definition").resume() 101 CContext* context = CContext::getCurrent() 102 context->closeDefinition() 103 CTimer::get("XIOS close definition").suspend() 104 CTimer::get("XIOS").suspend() 99 CTimer::get("XIOS").resume(); 100 CTimer::get("XIOS close definition").resume(); 101 CContext* context = CContext::getCurrent(); 102 context->closeDefinition(); 103 CTimer::get("XIOS close definition").suspend(); 104 CTimer::get("XIOS").suspend(); 105 105 } 106 106 107 107 void cxios_context_finalize() 108 108 { 109 CTimer::get("XIOS").resume() 110 CTimer::get("XIOS context finalize").resume() 111 CContext* context = CContext::getCurrent() 112 context->finalize() 113 CTimer::get("XIOS context finalize").suspend() 114 CTimer::get("XIOS").suspend() 109 CTimer::get("XIOS").resume(); 110 CTimer::get("XIOS context finalize").resume(); 111 CContext* context = CContext::getCurrent(); 112 context->finalize(); 113 CTimer::get("XIOS context finalize").suspend(); 114 CTimer::get("XIOS").suspend(); 115 115 } 116 116 117 117 void cxios_finalize() 118 118 { 119 CTimer::get("XIOS").resume() 120 CTimer::get("XIOS finalize").resume() 121 CXios::clientFinalize() 119 CTimer::get("XIOS").resume(); 120 CTimer::get("XIOS finalize").resume(); 121 CXios::clientFinalize(); 122 122 } 123 123 124 124 void cxios_solve_inheritance() 125 125 { 126 CTimer::get("XIOS").resume() 127 CContext* context = CContext::getCurrent() 128 context->solveAllInheritance(false) 129 CTimer::get("XIOS").suspend() 126 CTimer::get("XIOS").resume(); 127 CContext* context = CContext::getCurrent(); 128 context->solveAllInheritance(false); 129 CTimer::get("XIOS").suspend(); 130 130 } 131 131 … … 140 140 * \param isVarExisted [in/out] Verify whether variable with varId exists 141 141 */ 142 void cxios_get_variable_data_k8(const char * varId, int varIdSize, double * data, bool* isVarExisted)142 void cxios_get_variable_data_k8(const char* varId, int varIdSize, double* data, bool* isVarExisted) 143 143 { 144 144 std::string varIdStr; … … 153 153 if (*isVarExisted) 154 154 { 155 *data = CVariable::get(context->getId(), varIdStr)->getData<double>();156 } 157 158 CTimer::get("XIOS get variable data").suspend() 159 CTimer::get("XIOS").suspend() 160 } 161 162 void cxios_get_variable_data_k4(const char * varId, int varIdSize, float * data, bool* isVarExisted)155 *data = CVariable::get(context->getId(), varIdStr)->getData<double>(); 156 } 157 158 CTimer::get("XIOS get variable data").suspend(); 159 CTimer::get("XIOS").suspend(); 160 } 161 162 void cxios_get_variable_data_k4(const char* varId, int varIdSize, float* data, bool* isVarExisted) 163 163 { 164 164 std::string varIdStr; … … 173 173 if (*isVarExisted) 174 174 { 175 *data = CVariable::get(context->getId(), varIdStr)->getData<float>();176 } 177 178 CTimer::get("XIOS get variable data").suspend() 179 CTimer::get("XIOS").suspend() 180 } 181 182 void cxios_get_variable_data_int(const char * varId, int varIdSize, int * data, bool* isVarExisted)175 *data = CVariable::get(context->getId(), varIdStr)->getData<float>(); 176 } 177 178 CTimer::get("XIOS get variable data").suspend(); 179 CTimer::get("XIOS").suspend(); 180 } 181 182 void cxios_get_variable_data_int(const char* varId, int varIdSize, int* data, bool* isVarExisted) 183 183 { 184 184 std::string varIdStr; … … 193 193 if (*isVarExisted) 194 194 { 195 *data = CVariable::get(context->getId(), varIdStr)->getData<int>();196 } 197 198 CTimer::get("XIOS get variable data").suspend() 199 CTimer::get("XIOS").suspend() 200 } 201 202 void cxios_get_variable_data_logic(const char * varId, int varIdSize, bool * data, bool* isVarExisted)195 *data = CVariable::get(context->getId(), varIdStr)->getData<int>(); 196 } 197 198 CTimer::get("XIOS get variable data").suspend(); 199 CTimer::get("XIOS").suspend(); 200 } 201 202 void cxios_get_variable_data_logic(const char* varId, int varIdSize, bool* data, bool* isVarExisted) 203 203 { 204 204 std::string varIdStr; … … 213 213 if (*isVarExisted) 214 214 { 215 *data = CVariable::get(context->getId(), varIdStr)->getData<bool>();216 } 217 218 CTimer::get("XIOS get variable data").suspend() 219 CTimer::get("XIOS").suspend() 220 } 221 222 void cxios_get_variable_data_char(const char * varId, int varIdSize, char * data, int dataSizeIn, bool* isVarExisted)215 *data = CVariable::get(context->getId(), varIdStr)->getData<bool>(); 216 } 217 218 CTimer::get("XIOS get variable data").suspend(); 219 CTimer::get("XIOS").suspend(); 220 } 221 222 void cxios_get_variable_data_char(const char* varId, int varIdSize, char* data, int dataSizeIn, bool* isVarExisted) 223 223 { 224 224 std::string varIdStr; … … 233 233 if (*isVarExisted) 234 234 { 235 int dataSizeOut = CVariable::get(context->getId(), varIdStr)->getData<string>().length();236 strncpy(data, CVariable::get(context->getId(), varIdStr)->getData<string>().c_str(), std::min(dataSizeIn, dataSizeOut));237 } 238 239 CTimer::get("XIOS get variable data").suspend() 240 CTimer::get("XIOS").suspend() 235 int dataSizeOut = CVariable::get(context->getId(), varIdStr)->getData<string>().length(); 236 strncpy(data, CVariable::get(context->getId(), varIdStr)->getData<string>().c_str(), std::min(dataSizeIn, dataSizeOut)); 237 } 238 239 CTimer::get("XIOS get variable data").suspend(); 240 CTimer::get("XIOS").suspend(); 241 241 } 242 242 … … 251 251 * \param isVarExisted [in/out] Verify whether variable with varId exists 252 252 */ 253 void cxios_set_variable_data_k8(const char * varId, int varIdSize, double data, bool* isVarExisted)253 void cxios_set_variable_data_k8(const char* varId, int varIdSize, double data, bool* isVarExisted) 254 254 { 255 255 std::string varIdStr; … … 259 259 CTimer::get("XIOS set variable data").resume(); 260 260 261 CContext* context = CContext::getCurrent() 262 *isVarExisted = CVariable::has(context->getId(), varIdStr); 263 264 if (*isVarExisted) 265 { 266 CVariable::get(context->getId(), varIdStr)->setData<double>(data);267 //CVariable::get(context->getId(), varIdStr)->sendValue();268 } 269 270 CTimer::get("XIOS set variable data").suspend() 271 CTimer::get("XIOS").suspend() 272 } 273 274 void cxios_set_variable_data_k4(const char * varId, int varIdSize, float data, bool* isVarExisted)261 CContext* context = CContext::getCurrent(); 262 *isVarExisted = CVariable::has(context->getId(), varIdStr); 263 264 if (*isVarExisted) 265 { 266 CVariable::get(context->getId(), varIdStr)->setData<double>(data); 267 //CVariable::get(context->getId(), varIdStr)->sendValue(); 268 } 269 270 CTimer::get("XIOS set variable data").suspend(); 271 CTimer::get("XIOS").suspend(); 272 } 273 274 void cxios_set_variable_data_k4(const char* varId, int varIdSize, float data, bool* isVarExisted) 275 275 { 276 276 std::string varIdStr; … … 280 280 CTimer::get("XIOS set variable data").resume(); 281 281 282 CContext* context = CContext::getCurrent() 283 *isVarExisted = CVariable::has(context->getId(), varIdStr); 284 285 if (*isVarExisted) 286 { 287 CVariable::get(context->getId(), varIdStr)->setData<float>(data);288 //CVariable::get(context->getId(), varIdStr)->sendValue();289 } 290 291 CTimer::get("XIOS set variable data").suspend() 292 CTimer::get("XIOS").suspend() 293 } 294 295 void cxios_set_variable_data_int(const char * varId, int varIdSize, int data, bool* isVarExisted)282 CContext* context = CContext::getCurrent(); 283 *isVarExisted = CVariable::has(context->getId(), varIdStr); 284 285 if (*isVarExisted) 286 { 287 CVariable::get(context->getId(), varIdStr)->setData<float>(data); 288 //CVariable::get(context->getId(), varIdStr)->sendValue(); 289 } 290 291 CTimer::get("XIOS set variable data").suspend(); 292 CTimer::get("XIOS").suspend(); 293 } 294 295 void cxios_set_variable_data_int(const char* varId, int varIdSize, int data, bool* isVarExisted) 296 296 { 297 297 std::string varIdStr; … … 301 301 CTimer::get("XIOS set variable data").resume(); 302 302 303 CContext* context = CContext::getCurrent() 304 *isVarExisted = CVariable::has(context->getId(), varIdStr); 305 306 if (*isVarExisted) 307 { 308 CVariable::get(context->getId(), varIdStr)->setData<int>(data);309 //CVariable::get(context->getId(), varIdStr)->sendValue();310 } 311 312 313 CTimer::get("XIOS set variable data").suspend() 314 CTimer::get("XIOS").suspend() 315 } 316 317 void cxios_set_variable_data_logic(const char * varId, int varIdSize, bool data, bool* isVarExisted)303 CContext* context = CContext::getCurrent(); 304 *isVarExisted = CVariable::has(context->getId(), varIdStr); 305 306 if (*isVarExisted) 307 { 308 CVariable::get(context->getId(), varIdStr)->setData<int>(data); 309 //CVariable::get(context->getId(), varIdStr)->sendValue(); 310 } 311 312 313 CTimer::get("XIOS set variable data").suspend(); 314 CTimer::get("XIOS").suspend(); 315 } 316 317 void cxios_set_variable_data_logic(const char* varId, int varIdSize, bool data, bool* isVarExisted) 318 318 { 319 319 std::string varIdStr; … … 323 323 CTimer::get("XIOS set variable data").resume(); 324 324 325 CContext* context = CContext::getCurrent() 326 *isVarExisted = CVariable::has(context->getId(), varIdStr); 327 328 if (*isVarExisted) 329 { 330 CVariable::get(context->getId(), varIdStr)->setData<bool>(data);331 //CVariable::get(context->getId(), varIdStr)->sendValue();332 } 333 334 CTimer::get("XIOS set variable data").suspend() 335 CTimer::get("XIOS").suspend() 336 } 337 338 void cxios_set_variable_data_char(const char * varId, int varIdSize, const char * data, int dataSizeIn, bool* isVarExisted)325 CContext* context = CContext::getCurrent(); 326 *isVarExisted = CVariable::has(context->getId(), varIdStr); 327 328 if (*isVarExisted) 329 { 330 CVariable::get(context->getId(), varIdStr)->setData<bool>(data); 331 //CVariable::get(context->getId(), varIdStr)->sendValue(); 332 } 333 334 CTimer::get("XIOS set variable data").suspend(); 335 CTimer::get("XIOS").suspend(); 336 } 337 338 void cxios_set_variable_data_char(const char* varId, int varIdSize, const char* data, int dataSizeIn, bool* isVarExisted) 339 339 { 340 340 std::string varIdStr, dataStr; … … 349 349 CTimer::get("XIOS set variable data").resume(); 350 350 351 CContext* context = CContext::getCurrent() 352 *isVarExisted = CVariable::has(context->getId(), varIdStr); 353 354 if (*isVarExisted) 355 { 356 CVariable::get(context->getId(), varIdStr)->setData<string>(dataStr);357 //CVariable::get(context->getId(), varIdStr)->sendValue();358 } 359 360 CTimer::get("XIOS set variable data").suspend() 361 CTimer::get("XIOS").suspend() 351 CContext* context = CContext::getCurrent(); 352 *isVarExisted = CVariable::has(context->getId(), varIdStr); 353 354 if (*isVarExisted) 355 { 356 CVariable::get(context->getId(), varIdStr)->setData<string>(dataStr); 357 //CVariable::get(context->getId(), varIdStr)->sendValue(); 358 } 359 360 CTimer::get("XIOS set variable data").suspend(); 361 CTimer::get("XIOS").suspend(); 362 362 } 363 363 … … 365 365 // ---------------------- Ecriture des données ------------------------------ 366 366 367 void cxios_write_data_k80(const char * fieldid, int fieldid_size, double * data_k8, int data_Xsize) 368 { 369 std::string fieldid_str; 370 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 371 372 CTimer::get("XIOS").resume() ; 373 CTimer::get("XIOS send field").resume() ; 374 CContext* context = CContext::getCurrent() ; 375 if (!context->hasServer) context->client->checkBuffers() ; 376 CArray<double,(StdSize)1> data(data_k8,shape(data_Xsize),neverDeleteData) ; 377 CField::get(fieldid_str)->setData(data) ; 378 CTimer::get("XIOS send field").suspend() ; 379 CTimer::get("XIOS").suspend() ; 380 } 381 382 void cxios_write_data_k40(const char * fieldid, int fieldid_size, float * data_k4, int data_Xsize) 383 { 384 std::string fieldid_str; 385 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 386 387 CTimer::get("XIOS").resume() ; 388 CTimer::get("XIOS send field").resume() ; 389 CContext* context = CContext::getCurrent() ; 390 if (!context->hasServer) context->client->checkBuffers() ; 391 392 CArray<float,1> data_tmp(data_k4,shape(data_Xsize),neverDeleteData) ; 393 CArray<double,1> data(data_Xsize) ; 394 data=data_tmp ; 395 CField::get(fieldid_str)->setData(data) ; 396 CTimer::get("XIOS send field").suspend() ; 397 CTimer::get("XIOS").suspend() ; 398 } 399 400 void cxios_write_data_k81(const char * fieldid, int fieldid_size, double * data_k8, int data_Xsize) 401 { 402 std::string fieldid_str; 403 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 404 405 CTimer::get("XIOS").resume() ; 406 CTimer::get("XIOS send field").resume() ; 407 CContext* context = CContext::getCurrent() ; 408 if (!context->hasServer) context->client->checkBuffers() ; 409 CArray<double,(StdSize)1> data(data_k8,shape(data_Xsize),neverDeleteData) ; 410 CField::get(fieldid_str)->setData(data) ; 411 CTimer::get("XIOS send field").suspend() ; 412 CTimer::get("XIOS").suspend() ; 413 } 414 415 void cxios_write_data_k82(const char * fieldid, int fieldid_size, double * data_k8, int data_Xsize, int data_Ysize) 416 { 417 std::string fieldid_str; 418 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 419 420 CTimer::get("XIOS").resume() ; 421 CTimer::get("XIOS send field").resume() ; 422 CContext* context = CContext::getCurrent() ; 423 if (!context->hasServer) context->client->checkBuffers() ; 424 425 CArray<double,2>data(data_k8,shape(data_Xsize,data_Ysize),neverDeleteData) ; 426 CField::get(fieldid_str)->setData(data) ; 427 CTimer::get("XIOS send field").suspend() ; 428 CTimer::get("XIOS").suspend() ; 429 } 430 431 void cxios_write_data_k83(const char * fieldid, int fieldid_size, double * data_k8, int data_Xsize, int data_Ysize, int data_Zsize) 432 { 433 std::string fieldid_str; 434 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 435 436 CTimer::get("XIOS").resume() ; 437 CTimer::get("XIOS send field").resume() ; 438 CContext* context = CContext::getCurrent() ; 439 if (!context->hasServer) context->client->checkBuffers() ; 440 441 CArray<double,3>data(data_k8,shape(data_Xsize,data_Ysize,data_Zsize),neverDeleteData) ; 442 CField::get(fieldid_str)->setData(data) ; 443 CTimer::get("XIOS send field").suspend() ; 444 CTimer::get("XIOS").suspend() ; 445 } 446 447 void cxios_write_data_k41(const char * fieldid, int fieldid_size, float * data_k4, int data_Xsize) 448 { 449 std::string fieldid_str; 450 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 451 452 CTimer::get("XIOS").resume() ; 453 CTimer::get("XIOS send field").resume() ; 454 CContext* context = CContext::getCurrent() ; 455 if (!context->hasServer) context->client->checkBuffers() ; 456 457 CArray<float,1> data_tmp(data_k4,shape(data_Xsize),neverDeleteData) ; 458 CArray<double,1> data(data_Xsize) ; 459 data=data_tmp ; 460 CField::get(fieldid_str)->setData(data) ; 461 CTimer::get("XIOS send field").suspend() ; 462 CTimer::get("XIOS").suspend() ; 463 } 464 465 void cxios_write_data_k42(const char * fieldid, int fieldid_size, float * data_k4, int data_Xsize, int data_Ysize) 466 { 467 std::string fieldid_str; 468 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 469 470 CTimer::get("XIOS").resume() ; 471 CTimer::get("XIOS send field").resume() ; 472 CContext* context = CContext::getCurrent() ; 473 if (!context->hasServer) context->client->checkBuffers() ; 474 475 CArray<float,2> data_tmp(data_k4,shape(data_Xsize,data_Ysize),neverDeleteData) ; 476 CArray<double,2> data(data_Xsize,data_Ysize) ; 477 data=data_tmp ; 478 CField::get(fieldid_str)->setData(data) ; 479 CTimer::get("XIOS send field").suspend() ; 480 CTimer::get("XIOS").suspend() ; 481 } 482 483 void cxios_write_data_k43(const char * fieldid, int fieldid_size, float * data_k4, int data_Xsize, int data_Ysize, int data_Zsize) 484 { 485 std::string fieldid_str; 486 487 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 488 489 CTimer::get("XIOS").resume() ; 490 CTimer::get("XIOS send field").resume() ; 491 CContext* context = CContext::getCurrent() ; 492 if (!context->hasServer) context->client->checkBuffers() ; 493 494 CArray<float,3> data_tmp(data_k4,shape(data_Xsize,data_Ysize,data_Zsize),neverDeleteData) ; 495 CArray<double,3> data(data_Xsize,data_Ysize,data_Zsize) ; 496 data=data_tmp ; 497 498 CField::get(fieldid_str)->setData(data) ; 499 CTimer::get("XIOS send field").suspend() ; 500 CTimer::get("XIOS").suspend() ; 501 367 void cxios_write_data_k80(const char* fieldid, int fieldid_size, double* data_k8, int data_Xsize) 368 { 369 std::string fieldid_str; 370 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 371 372 CTimer::get("XIOS").resume(); 373 CTimer::get("XIOS send field").resume(); 374 CContext* context = CContext::getCurrent(); 375 if (!context->hasServer) context->client->checkBuffers(); 376 CArray<double, 1> data(data_k8, shape(data_Xsize), neverDeleteData); 377 CField::get(fieldid_str)->setData(data); 378 CTimer::get("XIOS send field").suspend(); 379 CTimer::get("XIOS").suspend(); 380 } 381 382 void cxios_write_data_k81(const char* fieldid, int fieldid_size, double* data_k8, int data_Xsize) 383 { 384 std::string fieldid_str; 385 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 386 387 CTimer::get("XIOS").resume(); 388 CTimer::get("XIOS send field").resume(); 389 390 CContext* context = CContext::getCurrent(); 391 if (!context->hasServer) context->client->checkBuffers(); 392 393 CArray<double, 1> data(data_k8, shape(data_Xsize), neverDeleteData); 394 CField::get(fieldid_str)->setData(data); 395 396 CTimer::get("XIOS send field").suspend(); 397 CTimer::get("XIOS").suspend(); 398 } 399 400 void cxios_write_data_k82(const char* fieldid, int fieldid_size, double* data_k8, int data_Xsize, int data_Ysize) 401 { 402 std::string fieldid_str; 403 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 404 405 CTimer::get("XIOS").resume(); 406 CTimer::get("XIOS send field").resume(); 407 408 CContext* context = CContext::getCurrent(); 409 if (!context->hasServer) context->client->checkBuffers(); 410 411 CArray<double, 2>data(data_k8, shape(data_Xsize, data_Ysize), neverDeleteData); 412 CField::get(fieldid_str)->setData(data); 413 414 CTimer::get("XIOS send field").suspend(); 415 CTimer::get("XIOS").suspend(); 416 } 417 418 void cxios_write_data_k83(const char* fieldid, int fieldid_size, double* data_k8, int data_Xsize, int data_Ysize, int data_Zsize) 419 { 420 std::string fieldid_str; 421 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 422 423 CTimer::get("XIOS").resume(); 424 CTimer::get("XIOS send field").resume(); 425 426 CContext* context = CContext::getCurrent(); 427 if (!context->hasServer) context->client->checkBuffers(); 428 429 CArray<double, 3>data(data_k8, shape(data_Xsize, data_Ysize, data_Zsize), neverDeleteData); 430 CField::get(fieldid_str)->setData(data); 431 432 CTimer::get("XIOS send field").suspend(); 433 CTimer::get("XIOS").suspend(); 434 } 435 436 void cxios_write_data_k40(const char* fieldid, int fieldid_size, float* data_k4, int data_Xsize) 437 { 438 std::string fieldid_str; 439 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 440 441 CTimer::get("XIOS").resume(); 442 CTimer::get("XIOS send field").resume(); 443 CContext* context = CContext::getCurrent(); 444 if (!context->hasServer) context->client->checkBuffers(); 445 446 CArray<float, 1> data_tmp(data_k4, shape(data_Xsize), neverDeleteData); 447 CArray<double, 1> data(data_Xsize) ; 448 data = data_tmp; 449 CField::get(fieldid_str)->setData(data); 450 CTimer::get("XIOS send field").suspend(); 451 CTimer::get("XIOS").suspend(); 452 } 453 454 void cxios_write_data_k41(const char* fieldid, int fieldid_size, float* data_k4, int data_Xsize) 455 { 456 std::string fieldid_str; 457 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 458 459 CTimer::get("XIOS").resume(); 460 CTimer::get("XIOS send field").resume(); 461 462 CContext* context = CContext::getCurrent(); 463 if (!context->hasServer) context->client->checkBuffers(); 464 465 CArray<float, 1> data_tmp(data_k4, shape(data_Xsize), neverDeleteData); 466 CArray<double, 1> data(data_Xsize); 467 data = data_tmp; 468 CField::get(fieldid_str)->setData(data); 469 470 CTimer::get("XIOS send field").suspend(); 471 CTimer::get("XIOS").suspend(); 472 } 473 474 void cxios_write_data_k42(const char* fieldid, int fieldid_size, float* data_k4, int data_Xsize, int data_Ysize) 475 { 476 std::string fieldid_str; 477 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 478 479 CTimer::get("XIOS").resume(); 480 CTimer::get("XIOS send field").resume(); 481 482 CContext* context = CContext::getCurrent(); 483 if (!context->hasServer) context->client->checkBuffers(); 484 485 CArray<float, 2> data_tmp(data_k4, shape(data_Xsize, data_Ysize), neverDeleteData); 486 CArray<double, 2> data(data_Xsize, data_Ysize); 487 data = data_tmp; 488 CField::get(fieldid_str)->setData(data); 489 490 CTimer::get("XIOS send field").suspend(); 491 CTimer::get("XIOS").suspend(); 492 } 493 494 void cxios_write_data_k43(const char* fieldid, int fieldid_size, float* data_k4, int data_Xsize, int data_Ysize, int data_Zsize) 495 { 496 std::string fieldid_str; 497 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 498 499 CTimer::get("XIOS").resume(); 500 CTimer::get("XIOS send field").resume(); 501 502 CContext* context = CContext::getCurrent(); 503 if (!context->hasServer) context->client->checkBuffers(); 504 505 CArray<float, 3> data_tmp(data_k4, shape(data_Xsize, data_Ysize, data_Zsize), neverDeleteData); 506 CArray<double, 3> data(data_Xsize, data_Ysize, data_Zsize); 507 data = data_tmp; 508 CField::get(fieldid_str)->setData(data); 509 510 CTimer::get("XIOS send field").suspend(); 511 CTimer::get("XIOS").suspend(); 502 512 } 503 513 514 // ---------------------- Lecture des données ------------------------------ 515 516 void cxios_read_data_k81(const char* fieldid, int fieldid_size, double* data_k8, int data_Xsize) 517 { 518 std::string fieldid_str; 519 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 520 521 CTimer::get("XIOS").resume(); 522 CTimer::get("XIOS recv field").resume(); 523 524 CContext* context = CContext::getCurrent(); 525 if (!context->hasServer) context->client->checkBuffers(); 526 527 CArray<double, 1> data(data_k8, shape(data_Xsize), neverDeleteData); 528 CField::get(fieldid_str)->getData(data); 529 530 CTimer::get("XIOS recv field").suspend(); 531 CTimer::get("XIOS").suspend(); 532 } 533 534 void cxios_read_data_k82(const char* fieldid, int fieldid_size, double* data_k8, int data_Xsize, int data_Ysize) 535 { 536 std::string fieldid_str; 537 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 538 539 CTimer::get("XIOS").resume(); 540 CTimer::get("XIOS recv field").resume(); 541 542 CContext* context = CContext::getCurrent(); 543 if (!context->hasServer) context->client->checkBuffers(); 544 545 CArray<double, 2>data(data_k8, shape(data_Xsize, data_Ysize), neverDeleteData); 546 CField::get(fieldid_str)->getData(data); 547 548 CTimer::get("XIOS recv field").suspend(); 549 CTimer::get("XIOS").suspend(); 550 } 551 552 void cxios_read_data_k83(const char* fieldid, int fieldid_size, double* data_k8, int data_Xsize, int data_Ysize, int data_Zsize) 553 { 554 std::string fieldid_str; 555 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 556 557 CTimer::get("XIOS").resume(); 558 CTimer::get("XIOS recv field").resume(); 559 560 CContext* context = CContext::getCurrent(); 561 if (!context->hasServer) context->client->checkBuffers(); 562 563 CArray<double, 3>data(data_k8, shape(data_Xsize, data_Ysize, data_Zsize), neverDeleteData); 564 CField::get(fieldid_str)->getData(data); 565 566 CTimer::get("XIOS recv field").suspend(); 567 CTimer::get("XIOS").suspend(); 568 } 569 570 void cxios_read_data_k41(const char* fieldid, int fieldid_size, float* data_k4, int data_Xsize) 571 { 572 std::string fieldid_str; 573 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 574 575 CTimer::get("XIOS").resume(); 576 CTimer::get("XIOS recv field").resume(); 577 578 CContext* context = CContext::getCurrent(); 579 if (!context->hasServer) context->client->checkBuffers(); 580 581 CArray<double, 1> data(data_Xsize); 582 CField::get(fieldid_str)->getData(data); 583 CArray<float, 1> data_tmp(data_k4, shape(data_Xsize), neverDeleteData); 584 data_tmp = data; 585 586 CTimer::get("XIOS recv field").suspend(); 587 CTimer::get("XIOS").suspend(); 588 } 589 590 void cxios_read_data_k42(const char* fieldid, int fieldid_size, float* data_k4, int data_Xsize, int data_Ysize) 591 { 592 std::string fieldid_str; 593 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 594 595 CTimer::get("XIOS").resume(); 596 CTimer::get("XIOS recv field").resume(); 597 598 CContext* context = CContext::getCurrent(); 599 if (!context->hasServer) context->client->checkBuffers(); 600 601 CArray<double, 2> data(data_Xsize, data_Ysize); 602 CField::get(fieldid_str)->getData(data); 603 CArray<float, 2> data_tmp(data_k4, shape(data_Xsize, data_Ysize), neverDeleteData); 604 data_tmp = data; 605 606 CTimer::get("XIOS recv field").suspend(); 607 CTimer::get("XIOS").suspend(); 608 } 609 610 void cxios_read_data_k43(const char* fieldid, int fieldid_size, float* data_k4, int data_Xsize, int data_Ysize, int data_Zsize) 611 { 612 std::string fieldid_str; 613 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 614 615 CTimer::get("XIOS").resume(); 616 CTimer::get("XIOS recv field").resume(); 617 618 CContext* context = CContext::getCurrent(); 619 if (!context->hasServer) context->client->checkBuffers(); 620 621 CArray<double, 3> data(data_Xsize, data_Ysize, data_Zsize); 622 CField::get(fieldid_str)->getData(data); 623 CArray<float, 3> data_tmp(data_k4, shape(data_Xsize, data_Ysize, data_Zsize), neverDeleteData); 624 data_tmp = data; 625 626 CTimer::get("XIOS recv field").suspend(); 627 CTimer::get("XIOS").suspend(); 628 } 504 629 } // extern "C" -
XIOS/trunk/src/interface/c_attr/icfield_attr.cpp
r591 r593 414 414 415 415 416 void cxios_set_field_read_access(field_Ptr field_hdl, bool read_access) 417 { 418 CTimer::get("XIOS").resume(); 419 field_hdl->read_access.setValue(read_access); 420 CTimer::get("XIOS").suspend(); 421 } 422 423 void cxios_get_field_read_access(field_Ptr field_hdl, bool* read_access) 424 { 425 CTimer::get("XIOS").resume(); 426 *read_access = field_hdl->read_access.getInheritedValue(); 427 CTimer::get("XIOS").suspend(); 428 } 429 430 bool cxios_is_defined_field_read_access(field_Ptr field_hdl) 431 { 432 CTimer::get("XIOS").resume(); 433 bool isDefined = field_hdl->read_access.hasInheritedValue(); 434 CTimer::get("XIOS").suspend(); 435 return isDefined; 436 } 437 438 416 439 void cxios_set_field_scale_factor(field_Ptr field_hdl, double scale_factor) 417 440 { -
XIOS/trunk/src/interface/c_attr/icfieldgroup_attr.cpp
r591 r593 440 440 441 441 442 void cxios_set_fieldgroup_read_access(fieldgroup_Ptr fieldgroup_hdl, bool read_access) 443 { 444 CTimer::get("XIOS").resume(); 445 fieldgroup_hdl->read_access.setValue(read_access); 446 CTimer::get("XIOS").suspend(); 447 } 448 449 void cxios_get_fieldgroup_read_access(fieldgroup_Ptr fieldgroup_hdl, bool* read_access) 450 { 451 CTimer::get("XIOS").resume(); 452 *read_access = fieldgroup_hdl->read_access.getInheritedValue(); 453 CTimer::get("XIOS").suspend(); 454 } 455 456 bool cxios_is_defined_fieldgroup_read_access(fieldgroup_Ptr fieldgroup_hdl) 457 { 458 CTimer::get("XIOS").resume(); 459 bool isDefined = fieldgroup_hdl->read_access.hasInheritedValue(); 460 CTimer::get("XIOS").suspend(); 461 return isDefined; 462 } 463 464 442 465 void cxios_set_fieldgroup_scale_factor(fieldgroup_Ptr fieldgroup_hdl, double scale_factor) 443 466 { -
XIOS/trunk/src/interface/fortran/idata.F90
r587 r593 113 113 INTEGER (kind = C_INT) , VALUE :: data_Xsize, data_Ysize, data_Zsize 114 114 END SUBROUTINE cxios_write_data_k43 115 116 SUBROUTINE cxios_read_data_k81(fieldid, fieldid_size, data_k8, data_Xsize) BIND(C) 117 USE ISO_C_BINDING 118 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: fieldid 119 REAL (kind = C_DOUBLE), DIMENSION(*) :: data_k8 120 INTEGER (kind = C_INT) , VALUE :: fieldid_size 121 INTEGER (kind = C_INT) , VALUE :: data_Xsize 122 END SUBROUTINE cxios_read_data_k81 123 124 SUBROUTINE cxios_read_data_k82(fieldid, fieldid_size, data_k8, data_Xsize, data_Ysize) BIND(C) 125 USE ISO_C_BINDING 126 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: fieldid 127 REAL (kind = C_DOUBLE), DIMENSION(*) :: data_k8 128 INTEGER (kind = C_INT) , VALUE :: fieldid_size 129 INTEGER (kind = C_INT) , VALUE :: data_Xsize, data_Ysize 130 END SUBROUTINE cxios_read_data_k82 131 132 SUBROUTINE cxios_read_data_k83(fieldid, fieldid_size, data_k8, data_Xsize, data_Ysize, data_Zsize) BIND(C) 133 USE ISO_C_BINDING 134 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: fieldid 135 REAL (kind = C_DOUBLE), DIMENSION(*) :: data_k8 136 INTEGER (kind = C_INT) , VALUE :: fieldid_size 137 INTEGER (kind = C_INT) , VALUE :: data_Xsize, data_Ysize, data_Zsize 138 END SUBROUTINE cxios_read_data_k83 139 140 SUBROUTINE cxios_read_data_k41(fieldid, fieldid_size, data_k4, data_Xsize) BIND(C) 141 USE ISO_C_BINDING 142 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: fieldid 143 REAL (kind = C_FLOAT) , DIMENSION(*) :: data_k4 144 INTEGER (kind = C_INT) , VALUE :: fieldid_size 145 INTEGER (kind = C_INT) , VALUE :: data_Xsize 146 END SUBROUTINE cxios_read_data_k41 147 148 SUBROUTINE cxios_read_data_k42(fieldid, fieldid_size, data_k4, data_Xsize, data_Ysize) BIND(C) 149 USE ISO_C_BINDING 150 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: fieldid 151 REAL (kind = C_FLOAT) , DIMENSION(*) :: data_k4 152 INTEGER (kind = C_INT) , VALUE :: fieldid_size 153 INTEGER (kind = C_INT) , VALUE :: data_Xsize, data_Ysize 154 END SUBROUTINE cxios_read_data_k42 155 156 SUBROUTINE cxios_read_data_k43(fieldid, fieldid_size, data_k4, data_Xsize, data_Ysize, data_Zsize) BIND(C) 157 USE ISO_C_BINDING 158 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: fieldid 159 REAL (kind = C_FLOAT) , DIMENSION(*) :: data_k4 160 INTEGER (kind = C_INT) , VALUE :: fieldid_size 161 INTEGER (kind = C_INT) , VALUE :: data_Xsize, data_Ysize, data_Zsize 162 END SUBROUTINE cxios_read_data_k43 115 163 116 164 ! Binding C and Fortran interface of get_variable (icdata.cpp) … … 276 324 END SUBROUTINE xios(solve_inheritance) 277 325 278 326 ! Send field functions 279 327 SUBROUTINE xios(send_scalar_r8)(fieldid, data_k8) 280 328 IMPLICIT NONE … … 335 383 END SUBROUTINE xios(send_field_r4_3d) 336 384 385 ! Receive field functions 386 SUBROUTINE xios(recv_field_r8_1d)(fieldid, data1d_k8) 387 IMPLICIT NONE 388 CHARACTER(len = *) , INTENT(IN) :: fieldid 389 REAL (kind = 8), DIMENSION(*), INTENT(OUT) :: data1d_k8(:) 390 CALL cxios_read_data_k81(fieldid, len(fieldid), data1d_k8, size(data1d_k8, 1)) 391 END SUBROUTINE xios(recv_field_r8_1d) 392 393 SUBROUTINE xios(recv_field_r8_2d)(fieldid, data2d_k8) 394 IMPLICIT NONE 395 CHARACTER(len = *) , INTENT(IN) :: fieldid 396 REAL (kind = 8), DIMENSION(*), INTENT(OUT) :: data2d_k8(:,:) 397 CALL cxios_read_data_k82(fieldid, len(fieldid), data2d_k8, size(data2d_k8, 1), size(data2d_k8, 2)) 398 END SUBROUTINE xios(recv_field_r8_2d) 399 400 SUBROUTINE xios(recv_field_r8_3d)(fieldid, data3d_k8) 401 IMPLICIT NONE 402 CHARACTER(len = *) , INTENT(IN) :: fieldid 403 REAL (kind = 8), DIMENSION(*), INTENT(OUT) :: data3d_k8(:,:,:) 404 CALL cxios_read_data_k83(fieldid, len(fieldid), data3d_k8, size(data3d_k8, 1), size(data3d_k8, 2), size(data3d_k8, 3)) 405 END SUBROUTINE xios(recv_field_r8_3d) 406 407 SUBROUTINE xios(recv_field_r4_1d)(fieldid, data1d_k4) 408 IMPLICIT NONE 409 CHARACTER(len = *) , INTENT(IN) :: fieldid 410 REAL (kind = 4), DIMENSION(*), INTENT(OUT) :: data1d_k4(:) 411 CALL cxios_read_data_k41(fieldid, len(fieldid), data1d_k4, size(data1d_k4, 1)) 412 END SUBROUTINE xios(recv_field_r4_1d) 413 414 SUBROUTINE xios(recv_field_r4_2d)(fieldid, data2d_k4) 415 IMPLICIT NONE 416 CHARACTER(len = *) , INTENT(IN) :: fieldid 417 REAL (kind = 4), DIMENSION(*), INTENT(OUT) :: data2d_k4(:,:) 418 CALL cxios_read_data_k42(fieldid, len(fieldid), data2d_k4, size(data2d_k4, 1), size(data2d_k4, 2)) 419 END SUBROUTINE xios(recv_field_r4_2d) 420 421 SUBROUTINE xios(recv_field_r4_3d)(fieldid, data3d_k4) 422 IMPLICIT NONE 423 CHARACTER(len = *) , INTENT(IN) :: fieldid 424 REAL (kind = 4), DIMENSION(*), INTENT(OUT) :: data3d_k4(:,:,:) 425 CALL cxios_read_data_k43(fieldid, len(fieldid), data3d_k4, size(data3d_k4, 1), size(data3d_k4, 2), size(data3d_k4, 3)) 426 END SUBROUTINE xios(recv_field_r4_3d) 427 337 428 ! Get variable functions 338 429 LOGICAL FUNCTION xios(getVar_k8)(varId, data_k8) -
XIOS/trunk/src/interface/fortran/ixios.F90
r587 r593 67 67 USE iaxisgroup_attr, ONLY : xios(set_axisgroup_attr), xios(get_axisgroup_attr), xios(is_defined_axisgroup_attr) 68 68 69 USE XIOS_INTERFACES, ONLY : xios(set_attr), xios(get_attr), xios(is_defined_attr), xios(get_handle), &70 xios( add_child), xios(send_field), xios(send_scalar), xios(field_is_active), xios(getVar), xios(setVar)69 USE XIOS_INTERFACES, ONLY : xios(set_attr), xios(get_attr), xios(is_defined_attr), xios(get_handle), xios(add_child), & 70 xios(send_field), xios(send_scalar), xios(recv_field), xios(field_is_active), xios(getVar), xios(setVar) 71 71 72 72 END MODULE XIOS -
XIOS/trunk/src/interface/fortran/ixios_interfaces.F90
r587 r593 7 7 USE icontext_attr, ONLY : xios(set_context_attr_hdl), xios(get_context_attr_hdl), xios(is_defined_context_attr_hdl) 8 8 9 USE idata, ONLY : xios(send_scalar_r8), xios(send_field_r8_1d), xios(send_field_r8_2d), xios(send_field_r8_3d), & 10 xios(send_scalar_r4), xios(send_field_r4_1d), xios(send_field_r4_2d), xios(send_field_r4_3d), & 11 xios(getVar_k8), xios(getVar_k4), xios(getVar_int), xios(getVar_logic), xios(getVar_char), & 9 USE idata, ONLY : xios(send_scalar_r8), xios(send_field_r8_1d), xios(send_field_r8_2d), xios(send_field_r8_3d), & 10 xios(send_scalar_r4), xios(send_field_r4_1d), xios(send_field_r4_2d), xios(send_field_r4_3d), & 11 xios(recv_field_r8_1d), xios(recv_field_r8_2d), xios(recv_field_r8_3d), & 12 xios(recv_field_r4_1d), xios(recv_field_r4_2d), xios(recv_field_r4_3d), & 13 xios(getVar_k8), xios(getVar_k4), xios(getVar_int), xios(getVar_logic), xios(getVar_char), & 12 14 xios(setVar_k8), xios(setVar_k4), xios(setVar_int), xios(setVar_logic), xios(setVar_char) 13 15 … … 96 98 END INTERFACE xios(add_child) 97 99 98 99 100 INTERFACE xios(send_field) 100 101 MODULE PROCEDURE xios(send_field_r8_1d), xios(send_field_r8_2d), xios(send_field_r8_3d), & … … 105 106 MODULE PROCEDURE xios(send_scalar_r8), xios(send_scalar_r4) 106 107 END INTERFACE xios(send_scalar) 108 109 INTERFACE xios(recv_field) 110 MODULE PROCEDURE xios(recv_field_r8_1d), xios(recv_field_r8_2d), xios(recv_field_r8_3d), & 111 xios(recv_field_r4_1d), xios(recv_field_r4_2d), xios(recv_field_r4_3d) 112 END INTERFACE xios(recv_field) 107 113 108 114 INTERFACE xios(field_is_active) … … 118 124 END INTERFACE xios(setVar) 119 125 120 PUBLIC :: xios(set_attr), xios(get_attr), xios(is_defined_attr), xios(get_handle), &121 xios( add_child), xios(send_field), xios(field_is_active), xios(getVar), xios(setVar), xios(send_scalar)126 PUBLIC :: xios(set_attr), xios(get_attr), xios(is_defined_attr), xios(get_handle), xios(add_child), & 127 xios(send_scalar), xios(send_field), xios(recv_field), xios(field_is_active), xios(getVar), xios(setVar) 122 128 123 129 END MODULE XIOS_INTERFACES -
XIOS/trunk/src/interface/fortran_attr/field_interface_attr.F90
r581 r593 313 313 314 314 315 SUBROUTINE cxios_set_field_read_access(field_hdl, read_access) BIND(C) 316 USE ISO_C_BINDING 317 INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl 318 LOGICAL (KIND=C_BOOL) , VALUE :: read_access 319 END SUBROUTINE cxios_set_field_read_access 320 321 SUBROUTINE cxios_get_field_read_access(field_hdl, read_access) BIND(C) 322 USE ISO_C_BINDING 323 INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl 324 LOGICAL (KIND=C_BOOL) :: read_access 325 END SUBROUTINE cxios_get_field_read_access 326 327 FUNCTION cxios_is_defined_field_read_access(field_hdl) BIND(C) 328 USE ISO_C_BINDING 329 LOGICAL(kind=C_BOOL) :: cxios_is_defined_field_read_access 330 INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl 331 END FUNCTION cxios_is_defined_field_read_access 332 333 315 334 SUBROUTINE cxios_set_field_scale_factor(field_hdl, scale_factor) BIND(C) 316 335 USE ISO_C_BINDING -
XIOS/trunk/src/interface/fortran_attr/fieldgroup_interface_attr.F90
r581 r593 334 334 335 335 336 SUBROUTINE cxios_set_fieldgroup_read_access(fieldgroup_hdl, read_access) BIND(C) 337 USE ISO_C_BINDING 338 INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl 339 LOGICAL (KIND=C_BOOL) , VALUE :: read_access 340 END SUBROUTINE cxios_set_fieldgroup_read_access 341 342 SUBROUTINE cxios_get_fieldgroup_read_access(fieldgroup_hdl, read_access) BIND(C) 343 USE ISO_C_BINDING 344 INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl 345 LOGICAL (KIND=C_BOOL) :: read_access 346 END SUBROUTINE cxios_get_fieldgroup_read_access 347 348 FUNCTION cxios_is_defined_fieldgroup_read_access(fieldgroup_hdl) BIND(C) 349 USE ISO_C_BINDING 350 LOGICAL(kind=C_BOOL) :: cxios_is_defined_fieldgroup_read_access 351 INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl 352 END FUNCTION cxios_is_defined_fieldgroup_read_access 353 354 336 355 SUBROUTINE cxios_set_fieldgroup_scale_factor(fieldgroup_hdl, scale_factor) BIND(C) 337 356 USE ISO_C_BINDING -
XIOS/trunk/src/interface/fortran_attr/ifield_attr.F90
r581 r593 13 13 SUBROUTINE xios(set_field_attr) & 14 14 ( field_id, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled, field_ref & 15 , freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor, standard_name&16 , unit, valid_max, valid_min )15 , freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, read_access, scale_factor & 16 , standard_name, unit, valid_max, valid_min ) 17 17 18 18 IMPLICIT NONE … … 36 36 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: operation 37 37 INTEGER , OPTIONAL, INTENT(IN) :: prec 38 LOGICAL , OPTIONAL, INTENT(IN) :: read_access 39 LOGICAL (KIND=C_BOOL) :: read_access_tmp 38 40 REAL (KIND=8) , OPTIONAL, INTENT(IN) :: scale_factor 39 41 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name … … 45 47 CALL xios(set_field_attr_hdl_) & 46 48 ( field_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled & 47 , field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor&48 , s tandard_name, unit, valid_max, valid_min )49 , field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, read_access & 50 , scale_factor, standard_name, unit, valid_max, valid_min ) 49 51 50 52 END SUBROUTINE xios(set_field_attr) … … 52 54 SUBROUTINE xios(set_field_attr_hdl) & 53 55 ( field_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled & 54 , field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor&55 , s tandard_name, unit, valid_max, valid_min )56 , field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, read_access & 57 , scale_factor, standard_name, unit, valid_max, valid_min ) 56 58 57 59 IMPLICIT NONE … … 74 76 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: operation 75 77 INTEGER , OPTIONAL, INTENT(IN) :: prec 78 LOGICAL , OPTIONAL, INTENT(IN) :: read_access 79 LOGICAL (KIND=C_BOOL) :: read_access_tmp 76 80 REAL (KIND=8) , OPTIONAL, INTENT(IN) :: scale_factor 77 81 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name … … 82 86 CALL xios(set_field_attr_hdl_) & 83 87 ( field_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled & 84 , field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor&85 , s tandard_name, unit, valid_max, valid_min )88 , field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, read_access & 89 , scale_factor, standard_name, unit, valid_max, valid_min ) 86 90 87 91 END SUBROUTINE xios(set_field_attr_hdl) … … 90 94 ( field_hdl, add_offset_, axis_ref_, default_value_, detect_missing_value_, domain_ref_, enabled_ & 91 95 , field_ref_, freq_offset_, freq_op_, grid_ref_, level_, long_name_, name_, operation_, prec_ & 92 , scale_factor_, standard_name_, unit_, valid_max_, valid_min_ )96 , read_access_, scale_factor_, standard_name_, unit_, valid_max_, valid_min_ ) 93 97 94 98 IMPLICIT NONE … … 111 115 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: operation_ 112 116 INTEGER , OPTIONAL, INTENT(IN) :: prec_ 117 LOGICAL , OPTIONAL, INTENT(IN) :: read_access_ 118 LOGICAL (KIND=C_BOOL) :: read_access__tmp 113 119 REAL (KIND=8) , OPTIONAL, INTENT(IN) :: scale_factor_ 114 120 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name_ … … 179 185 ENDIF 180 186 187 IF (PRESENT(read_access_)) THEN 188 read_access__tmp = read_access_ 189 CALL cxios_set_field_read_access(field_hdl%daddr, read_access__tmp) 190 ENDIF 191 181 192 IF (PRESENT(scale_factor_)) THEN 182 193 CALL cxios_set_field_scale_factor(field_hdl%daddr, scale_factor_) … … 203 214 SUBROUTINE xios(get_field_attr) & 204 215 ( field_id, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled, field_ref & 205 , freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor, standard_name&206 , unit, valid_max, valid_min )216 , freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, read_access, scale_factor & 217 , standard_name, unit, valid_max, valid_min ) 207 218 208 219 IMPLICIT NONE … … 226 237 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: operation 227 238 INTEGER , OPTIONAL, INTENT(OUT) :: prec 239 LOGICAL , OPTIONAL, INTENT(OUT) :: read_access 240 LOGICAL (KIND=C_BOOL) :: read_access_tmp 228 241 REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: scale_factor 229 242 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name … … 235 248 CALL xios(get_field_attr_hdl_) & 236 249 ( field_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled & 237 , field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor&238 , s tandard_name, unit, valid_max, valid_min )250 , field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, read_access & 251 , scale_factor, standard_name, unit, valid_max, valid_min ) 239 252 240 253 END SUBROUTINE xios(get_field_attr) … … 242 255 SUBROUTINE xios(get_field_attr_hdl) & 243 256 ( field_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled & 244 , field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor&245 , s tandard_name, unit, valid_max, valid_min )257 , field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, read_access & 258 , scale_factor, standard_name, unit, valid_max, valid_min ) 246 259 247 260 IMPLICIT NONE … … 264 277 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: operation 265 278 INTEGER , OPTIONAL, INTENT(OUT) :: prec 279 LOGICAL , OPTIONAL, INTENT(OUT) :: read_access 280 LOGICAL (KIND=C_BOOL) :: read_access_tmp 266 281 REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: scale_factor 267 282 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name … … 272 287 CALL xios(get_field_attr_hdl_) & 273 288 ( field_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled & 274 , field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor&275 , s tandard_name, unit, valid_max, valid_min )289 , field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, read_access & 290 , scale_factor, standard_name, unit, valid_max, valid_min ) 276 291 277 292 END SUBROUTINE xios(get_field_attr_hdl) … … 280 295 ( field_hdl, add_offset_, axis_ref_, default_value_, detect_missing_value_, domain_ref_, enabled_ & 281 296 , field_ref_, freq_offset_, freq_op_, grid_ref_, level_, long_name_, name_, operation_, prec_ & 282 , scale_factor_, standard_name_, unit_, valid_max_, valid_min_ )297 , read_access_, scale_factor_, standard_name_, unit_, valid_max_, valid_min_ ) 283 298 284 299 IMPLICIT NONE … … 301 316 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: operation_ 302 317 INTEGER , OPTIONAL, INTENT(OUT) :: prec_ 318 LOGICAL , OPTIONAL, INTENT(OUT) :: read_access_ 319 LOGICAL (KIND=C_BOOL) :: read_access__tmp 303 320 REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: scale_factor_ 304 321 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name_ … … 369 386 ENDIF 370 387 388 IF (PRESENT(read_access_)) THEN 389 CALL cxios_get_field_read_access(field_hdl%daddr, read_access__tmp) 390 read_access_ = read_access__tmp 391 ENDIF 392 371 393 IF (PRESENT(scale_factor_)) THEN 372 394 CALL cxios_get_field_scale_factor(field_hdl%daddr, scale_factor_) … … 393 415 SUBROUTINE xios(is_defined_field_attr) & 394 416 ( field_id, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled, field_ref & 395 , freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor, standard_name&396 , unit, valid_max, valid_min )417 , freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, read_access, scale_factor & 418 , standard_name, unit, valid_max, valid_min ) 397 419 398 420 IMPLICIT NONE … … 429 451 LOGICAL, OPTIONAL, INTENT(OUT) :: prec 430 452 LOGICAL(KIND=C_BOOL) :: prec_tmp 453 LOGICAL, OPTIONAL, INTENT(OUT) :: read_access 454 LOGICAL(KIND=C_BOOL) :: read_access_tmp 431 455 LOGICAL, OPTIONAL, INTENT(OUT) :: scale_factor 432 456 LOGICAL(KIND=C_BOOL) :: scale_factor_tmp … … 443 467 CALL xios(is_defined_field_attr_hdl_) & 444 468 ( field_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled & 445 , field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor&446 , s tandard_name, unit, valid_max, valid_min )469 , field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, read_access & 470 , scale_factor, standard_name, unit, valid_max, valid_min ) 447 471 448 472 END SUBROUTINE xios(is_defined_field_attr) … … 450 474 SUBROUTINE xios(is_defined_field_attr_hdl) & 451 475 ( field_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled & 452 , field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor&453 , s tandard_name, unit, valid_max, valid_min )476 , field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, read_access & 477 , scale_factor, standard_name, unit, valid_max, valid_min ) 454 478 455 479 IMPLICIT NONE … … 485 509 LOGICAL, OPTIONAL, INTENT(OUT) :: prec 486 510 LOGICAL(KIND=C_BOOL) :: prec_tmp 511 LOGICAL, OPTIONAL, INTENT(OUT) :: read_access 512 LOGICAL(KIND=C_BOOL) :: read_access_tmp 487 513 LOGICAL, OPTIONAL, INTENT(OUT) :: scale_factor 488 514 LOGICAL(KIND=C_BOOL) :: scale_factor_tmp … … 498 524 CALL xios(is_defined_field_attr_hdl_) & 499 525 ( field_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled & 500 , field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor&501 , s tandard_name, unit, valid_max, valid_min )526 , field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, read_access & 527 , scale_factor, standard_name, unit, valid_max, valid_min ) 502 528 503 529 END SUBROUTINE xios(is_defined_field_attr_hdl) … … 506 532 ( field_hdl, add_offset_, axis_ref_, default_value_, detect_missing_value_, domain_ref_, enabled_ & 507 533 , field_ref_, freq_offset_, freq_op_, grid_ref_, level_, long_name_, name_, operation_, prec_ & 508 , scale_factor_, standard_name_, unit_, valid_max_, valid_min_ )534 , read_access_, scale_factor_, standard_name_, unit_, valid_max_, valid_min_ ) 509 535 510 536 IMPLICIT NONE … … 540 566 LOGICAL, OPTIONAL, INTENT(OUT) :: prec_ 541 567 LOGICAL(KIND=C_BOOL) :: prec__tmp 568 LOGICAL, OPTIONAL, INTENT(OUT) :: read_access_ 569 LOGICAL(KIND=C_BOOL) :: read_access__tmp 542 570 LOGICAL, OPTIONAL, INTENT(OUT) :: scale_factor_ 543 571 LOGICAL(KIND=C_BOOL) :: scale_factor__tmp … … 626 654 ENDIF 627 655 656 IF (PRESENT(read_access_)) THEN 657 read_access__tmp = cxios_is_defined_field_read_access(field_hdl%daddr) 658 read_access_ = read_access__tmp 659 ENDIF 660 628 661 IF (PRESENT(scale_factor_)) THEN 629 662 scale_factor__tmp = cxios_is_defined_field_scale_factor(field_hdl%daddr) -
XIOS/trunk/src/interface/fortran_attr/ifieldgroup_attr.F90
r581 r593 14 14 ( fieldgroup_id, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled & 15 15 , field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name, name, operation, prec & 16 , scale_factor, standard_name, unit, valid_max, valid_min )16 , read_access, scale_factor, standard_name, unit, valid_max, valid_min ) 17 17 18 18 IMPLICIT NONE … … 37 37 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: operation 38 38 INTEGER , OPTIONAL, INTENT(IN) :: prec 39 LOGICAL , OPTIONAL, INTENT(IN) :: read_access 40 LOGICAL (KIND=C_BOOL) :: read_access_tmp 39 41 REAL (KIND=8) , OPTIONAL, INTENT(IN) :: scale_factor 40 42 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name … … 47 49 ( fieldgroup_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled & 48 50 , field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name, name, operation, prec & 49 , scale_factor, standard_name, unit, valid_max, valid_min )51 , read_access, scale_factor, standard_name, unit, valid_max, valid_min ) 50 52 51 53 END SUBROUTINE xios(set_fieldgroup_attr) … … 54 56 ( fieldgroup_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled & 55 57 , field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name, name, operation, prec & 56 , scale_factor, standard_name, unit, valid_max, valid_min )58 , read_access, scale_factor, standard_name, unit, valid_max, valid_min ) 57 59 58 60 IMPLICIT NONE … … 76 78 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: operation 77 79 INTEGER , OPTIONAL, INTENT(IN) :: prec 80 LOGICAL , OPTIONAL, INTENT(IN) :: read_access 81 LOGICAL (KIND=C_BOOL) :: read_access_tmp 78 82 REAL (KIND=8) , OPTIONAL, INTENT(IN) :: scale_factor 79 83 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name … … 85 89 ( fieldgroup_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled & 86 90 , field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name, name, operation, prec & 87 , scale_factor, standard_name, unit, valid_max, valid_min )91 , read_access, scale_factor, standard_name, unit, valid_max, valid_min ) 88 92 89 93 END SUBROUTINE xios(set_fieldgroup_attr_hdl) … … 92 96 ( fieldgroup_hdl, add_offset_, axis_ref_, default_value_, detect_missing_value_, domain_ref_ & 93 97 , enabled_, field_ref_, freq_offset_, freq_op_, grid_ref_, group_ref_, level_, long_name_, name_ & 94 , operation_, prec_, scale_factor_, standard_name_, unit_, valid_max_, valid_min_ ) 98 , operation_, prec_, read_access_, scale_factor_, standard_name_, unit_, valid_max_, valid_min_ & 99 ) 95 100 96 101 IMPLICIT NONE … … 114 119 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: operation_ 115 120 INTEGER , OPTIONAL, INTENT(IN) :: prec_ 121 LOGICAL , OPTIONAL, INTENT(IN) :: read_access_ 122 LOGICAL (KIND=C_BOOL) :: read_access__tmp 116 123 REAL (KIND=8) , OPTIONAL, INTENT(IN) :: scale_factor_ 117 124 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name_ … … 186 193 ENDIF 187 194 195 IF (PRESENT(read_access_)) THEN 196 read_access__tmp = read_access_ 197 CALL cxios_set_fieldgroup_read_access(fieldgroup_hdl%daddr, read_access__tmp) 198 ENDIF 199 188 200 IF (PRESENT(scale_factor_)) THEN 189 201 CALL cxios_set_fieldgroup_scale_factor(fieldgroup_hdl%daddr, scale_factor_) … … 211 223 ( fieldgroup_id, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled & 212 224 , field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name, name, operation, prec & 213 , scale_factor, standard_name, unit, valid_max, valid_min )225 , read_access, scale_factor, standard_name, unit, valid_max, valid_min ) 214 226 215 227 IMPLICIT NONE … … 234 246 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: operation 235 247 INTEGER , OPTIONAL, INTENT(OUT) :: prec 248 LOGICAL , OPTIONAL, INTENT(OUT) :: read_access 249 LOGICAL (KIND=C_BOOL) :: read_access_tmp 236 250 REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: scale_factor 237 251 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name … … 244 258 ( fieldgroup_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled & 245 259 , field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name, name, operation, prec & 246 , scale_factor, standard_name, unit, valid_max, valid_min )260 , read_access, scale_factor, standard_name, unit, valid_max, valid_min ) 247 261 248 262 END SUBROUTINE xios(get_fieldgroup_attr) … … 251 265 ( fieldgroup_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled & 252 266 , field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name, name, operation, prec & 253 , scale_factor, standard_name, unit, valid_max, valid_min )267 , read_access, scale_factor, standard_name, unit, valid_max, valid_min ) 254 268 255 269 IMPLICIT NONE … … 273 287 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: operation 274 288 INTEGER , OPTIONAL, INTENT(OUT) :: prec 289 LOGICAL , OPTIONAL, INTENT(OUT) :: read_access 290 LOGICAL (KIND=C_BOOL) :: read_access_tmp 275 291 REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: scale_factor 276 292 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name … … 282 298 ( fieldgroup_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled & 283 299 , field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name, name, operation, prec & 284 , scale_factor, standard_name, unit, valid_max, valid_min )300 , read_access, scale_factor, standard_name, unit, valid_max, valid_min ) 285 301 286 302 END SUBROUTINE xios(get_fieldgroup_attr_hdl) … … 289 305 ( fieldgroup_hdl, add_offset_, axis_ref_, default_value_, detect_missing_value_, domain_ref_ & 290 306 , enabled_, field_ref_, freq_offset_, freq_op_, grid_ref_, group_ref_, level_, long_name_, name_ & 291 , operation_, prec_, scale_factor_, standard_name_, unit_, valid_max_, valid_min_ ) 307 , operation_, prec_, read_access_, scale_factor_, standard_name_, unit_, valid_max_, valid_min_ & 308 ) 292 309 293 310 IMPLICIT NONE … … 311 328 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: operation_ 312 329 INTEGER , OPTIONAL, INTENT(OUT) :: prec_ 330 LOGICAL , OPTIONAL, INTENT(OUT) :: read_access_ 331 LOGICAL (KIND=C_BOOL) :: read_access__tmp 313 332 REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: scale_factor_ 314 333 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name_ … … 383 402 ENDIF 384 403 404 IF (PRESENT(read_access_)) THEN 405 CALL cxios_get_fieldgroup_read_access(fieldgroup_hdl%daddr, read_access__tmp) 406 read_access_ = read_access__tmp 407 ENDIF 408 385 409 IF (PRESENT(scale_factor_)) THEN 386 410 CALL cxios_get_fieldgroup_scale_factor(fieldgroup_hdl%daddr, scale_factor_) … … 408 432 ( fieldgroup_id, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled & 409 433 , field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name, name, operation, prec & 410 , scale_factor, standard_name, unit, valid_max, valid_min )434 , read_access, scale_factor, standard_name, unit, valid_max, valid_min ) 411 435 412 436 IMPLICIT NONE … … 445 469 LOGICAL, OPTIONAL, INTENT(OUT) :: prec 446 470 LOGICAL(KIND=C_BOOL) :: prec_tmp 471 LOGICAL, OPTIONAL, INTENT(OUT) :: read_access 472 LOGICAL(KIND=C_BOOL) :: read_access_tmp 447 473 LOGICAL, OPTIONAL, INTENT(OUT) :: scale_factor 448 474 LOGICAL(KIND=C_BOOL) :: scale_factor_tmp … … 460 486 ( fieldgroup_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled & 461 487 , field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name, name, operation, prec & 462 , scale_factor, standard_name, unit, valid_max, valid_min )488 , read_access, scale_factor, standard_name, unit, valid_max, valid_min ) 463 489 464 490 END SUBROUTINE xios(is_defined_fieldgroup_attr) … … 467 493 ( fieldgroup_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled & 468 494 , field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name, name, operation, prec & 469 , scale_factor, standard_name, unit, valid_max, valid_min )495 , read_access, scale_factor, standard_name, unit, valid_max, valid_min ) 470 496 471 497 IMPLICIT NONE … … 503 529 LOGICAL, OPTIONAL, INTENT(OUT) :: prec 504 530 LOGICAL(KIND=C_BOOL) :: prec_tmp 531 LOGICAL, OPTIONAL, INTENT(OUT) :: read_access 532 LOGICAL(KIND=C_BOOL) :: read_access_tmp 505 533 LOGICAL, OPTIONAL, INTENT(OUT) :: scale_factor 506 534 LOGICAL(KIND=C_BOOL) :: scale_factor_tmp … … 517 545 ( fieldgroup_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled & 518 546 , field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name, name, operation, prec & 519 , scale_factor, standard_name, unit, valid_max, valid_min )547 , read_access, scale_factor, standard_name, unit, valid_max, valid_min ) 520 548 521 549 END SUBROUTINE xios(is_defined_fieldgroup_attr_hdl) … … 524 552 ( fieldgroup_hdl, add_offset_, axis_ref_, default_value_, detect_missing_value_, domain_ref_ & 525 553 , enabled_, field_ref_, freq_offset_, freq_op_, grid_ref_, group_ref_, level_, long_name_, name_ & 526 , operation_, prec_, scale_factor_, standard_name_, unit_, valid_max_, valid_min_ ) 554 , operation_, prec_, read_access_, scale_factor_, standard_name_, unit_, valid_max_, valid_min_ & 555 ) 527 556 528 557 IMPLICIT NONE … … 560 589 LOGICAL, OPTIONAL, INTENT(OUT) :: prec_ 561 590 LOGICAL(KIND=C_BOOL) :: prec__tmp 591 LOGICAL, OPTIONAL, INTENT(OUT) :: read_access_ 592 LOGICAL(KIND=C_BOOL) :: read_access__tmp 562 593 LOGICAL, OPTIONAL, INTENT(OUT) :: scale_factor_ 563 594 LOGICAL(KIND=C_BOOL) :: scale_factor__tmp … … 651 682 ENDIF 652 683 684 IF (PRESENT(read_access_)) THEN 685 read_access__tmp = cxios_is_defined_fieldgroup_read_access(fieldgroup_hdl%daddr) 686 read_access_ = read_access__tmp 687 ENDIF 688 653 689 IF (PRESENT(scale_factor_)) THEN 654 690 scale_factor__tmp = cxios_is_defined_fieldgroup_scale_factor(fieldgroup_hdl%daddr) -
XIOS/trunk/src/node/context.cpp
r591 r593 350 350 this->solveAllRefOfEnabledFields(true); 351 351 this->buildAllExpressionOfEnabledFields(); 352 buildAllExpressionOfFieldsWithReadAccess(); 352 353 } 353 354 … … 382 383 } 383 384 } 385 386 void CContext::findFieldsWithReadAccess(void) 387 { 388 fieldsWithReadAccess.clear(); 389 const vector<CField*> allFields = CField::getAll(); 390 for (size_t i = 0; i < allFields.size(); ++i) 391 { 392 if (!allFields[i]->read_access.isEmpty() && allFields[i]->read_access.getValue()) 393 fieldsWithReadAccess.push_back(allFields[i]); 394 } 395 } 396 397 void CContext::solveAllRefOfFieldsWithReadAccess() 398 { 399 for (size_t i = 0; i < fieldsWithReadAccess.size(); ++i) 400 { 401 fieldsWithReadAccess[i]->solveAllReferenceEnabledField(false); 402 // Ensure that the instant data will be properly saved 403 fieldsWithReadAccess[i]->getInstantData(); 404 } 405 } 406 407 void CContext::buildAllExpressionOfFieldsWithReadAccess() 408 { 409 for (size_t i = 0; i < fieldsWithReadAccess.size(); ++i) 410 fieldsWithReadAccess[i]->buildAllExpressionEnabledField(); 411 } 384 412 385 413 void CContext::solveAllInheritance(bool apply) … … 638 666 // Search and rebuild all reference object of enabled fields 639 667 this->solveAllRefOfEnabledFields(false); 668 669 // Find all fields with read access from the public API 670 findFieldsWithReadAccess(); 671 // and solve the all reference for them 672 solveAllRefOfFieldsWithReadAccess(); 673 640 674 isPostProcessed = true; 641 675 } -
XIOS/trunk/src/node/context.hpp
r591 r593 110 110 void solveAllRefOfEnabledFields(bool sendToServer); 111 111 void buildAllExpressionOfEnabledFields(); 112 void findFieldsWithReadAccess(void); 113 void solveAllRefOfFieldsWithReadAccess(); 114 void buildAllExpressionOfFieldsWithReadAccess(); 112 115 void postProcessing(); 113 116 … … 187 190 std::vector<CFile*> enabledFiles; 188 191 192 // List of all fields whose instant data is accessible from the public API 193 std::vector<CField*> fieldsWithReadAccess; 194 189 195 // Context root 190 196 static shared_ptr<CContextGroup> root; -
XIOS/trunk/src/node/field.hpp
r591 r593 81 81 82 82 CArray<double, 1> getData(void) const; 83 83 template <int N> void getData(CArray<double, N>& _data) const; 84 84 85 85 -
XIOS/trunk/src/node/field_decl.cpp
r501 r593 3 3 namespace xios 4 4 { 5 template void CField::setData<1>(const CArray<double, 1>& _data) 6 template void CField::setData<2>(const CArray<double, 2>& _data) 7 template void CField::setData<3>(const CArray<double, 3>& _data) 5 template void CField::setData<1>(const CArray<double, 1>& _data); 6 template void CField::setData<2>(const CArray<double, 2>& _data); 7 template void CField::setData<3>(const CArray<double, 3>& _data); 8 8 9 template void CField::getData<1>(CArray<double, 1>& _data) const; 10 template void CField::getData<2>(CArray<double, 2>& _data) const; 11 template void CField::getData<3>(CArray<double, 3>& _data) const; 9 12 } -
XIOS/trunk/src/node/field_impl.hpp
r591 r593 179 179 } 180 180 181 template <int N> 182 void CField::getData(CArray<double, N>& _data) const 183 { 184 if (!read_access.isEmpty() && read_access.getValue() && hasInstantData) 185 { 186 grid->outputField(instantData, _data); 187 } 188 else 189 { 190 ERROR("void CField::getData(CArray<double, N>& _data) const", 191 << "Impossible to access field data, the field [ id = " << getId() << " ] does not have read access."); 192 } 193 } 181 194 } // namespace xios 182 195 -
XIOS/trunk/src/node/grid.cpp
r591 r593 519 519 } 520 520 521 void CGrid::restoreField_arr 522 (const CArray<double, 1>& stored, double * const data) const 523 { 524 const StdSize size = storeIndex_client.numElements() ; 525 526 for(StdSize i = 0; i < size; i++) data[storeIndex_client(i)] = stored(i) ; 527 } 528 521 529 void CGrid::computeIndexScalarGrid() 522 530 { -
XIOS/trunk/src/node/grid.hpp
r591 r593 99 99 /// Entrées-sorties de champs /// 100 100 template <int n> 101 void inputField(const CArray<double,n>& field, CArray<double,1>& stored) const; 101 void inputField(const CArray<double,n>& field, CArray<double,1>& stored) const; 102 template <int n> 103 void outputField(const CArray<double,1>& stored, CArray<double,n>& field) const; 102 104 103 105 void inputFieldServer(const std::deque< CArray<double, 1>* > storedClient, … … 131 133 /// Entrées-sorties de champs (interne) /// 132 134 void storeField_arr(const double * const data, CArray<double,1>& stored) const; 135 void restoreField_arr(const CArray<double,1>& stored, double * const data) const; 133 136 134 137 /// Traitements protégés /// … … 183 186 std::deque< CArray<int, 1>* > storeIndex ; 184 187 CArray<int, 1> storeIndex_client ; 185 186 188 187 189 map<int, CArray<int, 1>* > storeIndex_toSrv ; … … 242 244 << "The array of data has not the good size !") 243 245 this->storeField_arr(field.dataFirst(), stored) ; 246 } 247 248 template <int n> 249 void CGrid::outputField(const CArray<double,1>& stored, CArray<double,n>& field) const 250 { 251 if (this->getDataSize() != field.numElements()) 252 ERROR("void CGrid::outputField(const CArray<double,1>& stored, CArray<double,n>& field) const", 253 << "[ Size of the data = " << this->getDataSize() << ", " 254 << "Output data size = " << field.numElements() << " ] " 255 << "The ouput array does not have not the right size!") 256 this->restoreField_arr(stored, field.dataFirst()); 244 257 } 245 258
Note: See TracChangeset
for help on using the changeset viewer.