mirror of
https://github.com/TREX-CoE/trexio.git
synced 2024-12-22 12:23:54 +01:00
Correct rank in Fortran interface
This commit is contained in:
parent
cd8332a3e5
commit
692f45ed7f
@ -22,7 +22,13 @@ PKG_LIBS=""
|
||||
PKG_CFLAGS=""
|
||||
# Checks for programs.
|
||||
AC_PROG_CC
|
||||
AC_PROG_CC_C_O
|
||||
|
||||
AC_PROG_FC
|
||||
AC_FC_FREEFORM
|
||||
AC_FC_SRCEXT([f90])
|
||||
|
||||
AC_PROG_FC_C_O
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_LN_S
|
||||
AC_PROG_CC_C99
|
||||
|
@ -723,6 +723,8 @@ end interface
|
||||
| ~$group_dset_dtype_double$~ | Double precision type of the dataset [C] | ~double~ |
|
||||
| ~$group_dset_f_dtype_single$~ | Single precision type of the dataset [Fortran] | ~real(4)~ |
|
||||
| ~$group_dset_f_dtype_double$~ | Double precision type of the dataset [Fortran] | ~real(8)~ |
|
||||
| ~$group_dset_f_dims$~ | Dimensions in Fortran | ~(:,:)~ |
|
||||
|
||||
|
||||
Note: parent group name is always added to the child objects upon
|
||||
construction of TREXIO (e.g. ~num~ of ~nucleus~ group becomes
|
||||
@ -1301,7 +1303,7 @@ interface
|
||||
integer function trexio_write_$group$_$group_dset$_64 (trex_file, dset) bind(C)
|
||||
use, intrinsic :: iso_c_binding
|
||||
integer(8), intent(in), value :: trex_file
|
||||
$group_dset_f_dtype_double$, intent(in) :: dset(*)
|
||||
$group_dset_f_dtype_double$, intent(in) :: dset$group_dset_f_dims$
|
||||
end function trexio_write_$group$_$group_dset$_64
|
||||
end interface
|
||||
#+end_src
|
||||
@ -1311,7 +1313,7 @@ interface
|
||||
integer function trexio_read_$group$_$group_dset$_64 (trex_file, dset) bind(C)
|
||||
use, intrinsic :: iso_c_binding
|
||||
integer(8), intent(in), value :: trex_file
|
||||
$group_dset_f_dtype_double$, intent(out) :: dset(*)
|
||||
$group_dset_f_dtype_double$, intent(out) :: dset$group_dset_f_dims$
|
||||
end function trexio_read_$group$_$group_dset$_64
|
||||
end interface
|
||||
#+end_src
|
||||
@ -1321,7 +1323,7 @@ interface
|
||||
integer function trexio_write_$group$_$group_dset$_32 (trex_file, dset) bind(C)
|
||||
use, intrinsic :: iso_c_binding
|
||||
integer(8), intent(in), value :: trex_file
|
||||
$group_dset_f_dtype_single$, intent(in) :: dset(*)
|
||||
$group_dset_f_dtype_single$, intent(in) :: dset$group_dset_f_dims$
|
||||
end function trexio_write_$group$_$group_dset$_32
|
||||
end interface
|
||||
#+end_src
|
||||
@ -1331,7 +1333,7 @@ interface
|
||||
integer function trexio_read_$group$_$group_dset$_32 (trex_file, dset) bind(C)
|
||||
use, intrinsic :: iso_c_binding
|
||||
integer(8), intent(in), value :: trex_file
|
||||
$group_dset_f_dtype_single$, intent(out) :: dset(*)
|
||||
$group_dset_f_dtype_single$, intent(out) :: dset$group_dset_f_dims$
|
||||
end function trexio_read_$group$_$group_dset$_32
|
||||
end interface
|
||||
#+end_src
|
||||
@ -1341,7 +1343,7 @@ interface
|
||||
integer function trexio_write_$group$_$group_dset$ (trex_file, dset) bind(C)
|
||||
use, intrinsic :: iso_c_binding
|
||||
integer(8), intent(in), value :: trex_file
|
||||
$group_dset_f_dtype_double$, intent(in) :: dset(*)
|
||||
$group_dset_f_dtype_double$, intent(in) :: dset$group_dset_f_dims$
|
||||
end function trexio_write_$group$_$group_dset$
|
||||
end interface
|
||||
#+end_src
|
||||
@ -1351,7 +1353,7 @@ interface
|
||||
integer function trexio_read_$group$_$group_dset$ (trex_file, dset) bind(C)
|
||||
use, intrinsic :: iso_c_binding
|
||||
integer(8), intent(in), value :: trex_file
|
||||
$group_dset_f_dtype_double$, intent(out) :: dset(*)
|
||||
$group_dset_f_dtype_double$, intent(out) :: dset$group_dset_f_dims$
|
||||
end function trexio_read_$group$_$group_dset$
|
||||
end interface
|
||||
#+end_src
|
||||
|
@ -312,6 +312,12 @@ for fname in files_funcs_dsets:
|
||||
templine1 = templine2.replace('$group$', grname)
|
||||
templine2 = templine1.replace('$GROUP$', grname.upper())
|
||||
|
||||
if "$group_dset_f_dims$" in templine2:
|
||||
dims = "(" + ",".join([":" for _ in range(params['rank'])]) + ")"
|
||||
if dims == "()": dims = ""
|
||||
templine1 = templine2.replace("$group_dset_f_dims$", dims)
|
||||
templine2 = templine1
|
||||
|
||||
f_out.write(templine2)
|
||||
else:
|
||||
f_out.write(line)
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
"ecp": {
|
||||
"lmax_plus_1" : [ "int" , [ "nucleus.num" ] ]
|
||||
, "z_core" : [ "int" , [ "nucleus.num" ] ]
|
||||
, "z_core" : [ "float", [ "nucleus.num" ] ]
|
||||
, "local_n" : [ "int" , [ "nucleus.num" ] ]
|
||||
, "local_num_n_max" : [ "int" , [ ] ]
|
||||
, "local_exponent" : [ "float", [ "nucleus.num", "ecp.local_num_n_max" ] ]
|
||||
|
Loading…
Reference in New Issue
Block a user