@@ -78,6 +78,7 @@ module json_file_module
78
78
procedure ,public :: destroy = > json_file_destroy
79
79
procedure ,public :: move = > json_file_move_pointer
80
80
generic,public :: info = > MAYBEWRAP(json_file_variable_info)
81
+ generic,public :: matrix_info = > MAYBEWRAP(json_file_variable_matrix_info)
81
82
82
83
! error checking:
83
84
procedure ,public :: failed = > json_file_failed
@@ -125,8 +126,9 @@ module json_file_module
125
126
procedure :: initialize_json_core_in_file
126
127
procedure :: set_json_core_in_file
127
128
128
- ! git info:
129
+ ! get info:
129
130
procedure :: MAYBEWRAP(json_file_variable_info)
131
+ procedure :: MAYBEWRAP(json_file_variable_matrix_info)
130
132
131
133
! get:
132
134
procedure :: MAYBEWRAP(json_file_get_object)
@@ -693,6 +695,70 @@ subroutine wrap_json_file_variable_info(me,path,found,var_type,n_children,name)
693
695
end subroutine wrap_json_file_variable_info
694
696
! *****************************************************************************************
695
697
698
+ ! *****************************************************************************************
699
+ ! > author: Jacob Williams
700
+ ! date: 6/26/2016
701
+ !
702
+ ! Returns matrix information about a variable in a [[json_file(type)]].
703
+ !
704
+ ! @note If `found` is present, no exceptions will be thrown if an
705
+ ! error occurs. Otherwise, an exception will be thrown if the
706
+ ! variable is not found.
707
+
708
+ subroutine json_file_variable_matrix_info (me ,path ,is_matrix ,found ,&
709
+ var_type ,n_sets ,set_size ,name )
710
+
711
+ implicit none
712
+
713
+ class(json_file),intent (inout ) :: me
714
+ character (kind= CK,len=* ),intent (in ) :: path ! ! path to the variable
715
+ logical (LK),intent (out ) :: is_matrix ! ! true if it is a valid matrix
716
+ logical (LK),intent (out ),optional :: found ! ! true if it was found
717
+ integer (IK),intent (out ),optional :: var_type ! ! variable type of data in
718
+ ! ! the matrix (if all elements have
719
+ ! ! the same type)
720
+ integer (IK),intent (out ),optional :: n_sets ! ! number of data sets (i.e., matrix
721
+ ! ! rows if using row-major order)
722
+ integer (IK),intent (out ),optional :: set_size ! ! size of each data set (i.e., matrix
723
+ ! ! cols if using row-major order)
724
+ character (kind= CK,len= :),allocatable ,intent (out ),optional :: name ! ! variable name
725
+
726
+ call me% core% matrix_info(me% p,path,is_matrix,found,var_type,n_sets,set_size,name)
727
+
728
+ end subroutine json_file_variable_matrix_info
729
+ ! *****************************************************************************************
730
+
731
+ ! *****************************************************************************************
732
+ ! >
733
+ ! Alternate version of [[json_file_variable_matrix_info]], where "path" is kind=CDK.
734
+ !
735
+ ! @note If `found` is present, no exceptions will be thrown if an
736
+ ! error occurs. Otherwise, an exception will be thrown if the
737
+ ! variable is not found.
738
+
739
+ subroutine wrap_json_file_variable_matrix_info (me ,path ,is_matrix ,found ,&
740
+ var_type ,n_sets ,set_size ,name )
741
+
742
+ implicit none
743
+
744
+ class(json_file),intent (inout ) :: me
745
+ character (kind= CDK,len=* ),intent (in ) :: path ! ! path to the variable
746
+ logical (LK),intent (out ) :: is_matrix ! ! true if it is a valid matrix
747
+ logical (LK),intent (out ),optional :: found ! ! true if it was found
748
+ integer (IK),intent (out ),optional :: var_type ! ! variable type of data in
749
+ ! ! the matrix (if all elements have
750
+ ! ! the same type)
751
+ integer (IK),intent (out ),optional :: n_sets ! ! number of data sets (i.e., matrix
752
+ ! ! rows if using row-major order)
753
+ integer (IK),intent (out ),optional :: set_size ! ! size of each data set (i.e., matrix
754
+ ! ! cols if using row-major order)
755
+ character (kind= CK,len= :),allocatable ,intent (out ),optional :: name ! ! variable name
756
+
757
+ call me% matrix_info(to_unicode(path),is_matrix,found,var_type,n_sets,set_size,name)
758
+
759
+ end subroutine wrap_json_file_variable_matrix_info
760
+ ! *****************************************************************************************
761
+
696
762
! *****************************************************************************************
697
763
! > author: Izaak Beekman
698
764
! date: 7/23/2015
0 commit comments