1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2024-11-03 20:54:07 +01:00

working write_num [fortran]

This commit is contained in:
q-posev 2021-03-23 14:57:11 +01:00
parent ac44fc29a6
commit d680120efe
2 changed files with 9 additions and 3 deletions

View File

@ -314,7 +314,10 @@ DEBUG
return NULL;
}
uint64_t size_$group_dset$ = 1;
// workaround for the case of missing blocks in the file
uint64_t size_$group_dset$ = 0;
if ($group$->rank_$group_dset$ != 0) size_$group_dset$ = 1;
for (unsigned int i=0; i<$group$->rank_$group_dset$; i++){
unsigned int j=-1;
@ -462,7 +465,10 @@ trexio_exit_code trexio_text_flush_$group$(const trexio_text_t* file) {
fprintf(f, "rank_$group_dset$ %d\n", $group$->rank_$group_dset$);
uint64_t size_$group_dset$ = 1;
// workaround for the case of missing blocks in the file
uint64_t size_$group_dset$ = 0;
if ($group$->rank_$group_dset$ != 0) size_$group_dset$ = 1;
for (unsigned int i=0; i<$group$->rank_$group_dset$; i++){
fprintf(f, "dims_$group_dset$ %d %ld\n", i, $group$->dims_$group_dset$[i]);
size_$group_dset$ *= $group$->dims_$group_dset$[i];

View File

@ -12,7 +12,7 @@ program test_trexio
rc = 0
num = 10
file1 = trexio_open('test_fort' // c_null_char, 'w', 1)
file1 = trexio_open('trexio_test' // c_null_char, 'w', 1)
! file1 = trexio_open('test_fort.h5' // c_null_char, 'w', 0)
rc = trexio_write_nucleus_num(file1, num)