23 use iso_c_binding,
only: c_int, c_char, c_double, c_null_char, c_loc, c_ptr, &
44 bind(C, name="get_component_name")
48 integer(kind=c_int) :: bmi_status
69 integer(kind=c_int) :: bmi_status
95 function bmi_update()
result(bmi_status)
bind(C, name="update")
98 integer(kind=c_int) :: bmi_status
100 logical :: hasconverged
117 integer(kind=c_int) :: bmi_status
133 bind(C, name="get_start_time")
136 real(kind=c_double),
intent(out) :: start_time
137 integer(kind=c_int) :: bmi_status
149 function get_end_time(end_time)
result(bmi_status)
bind(C, name="get_end_time")
154 real(kind=c_double),
intent(out) :: end_time
155 integer(kind=c_int) :: bmi_status
168 bind(C, name="get_current_time")
173 real(kind=c_double),
intent(out) :: current_time
174 integer(kind=c_int) :: bmi_status
187 bind(C, name="get_time_step")
192 real(kind=c_double),
intent(out) :: time_step
193 integer(kind=c_int) :: bmi_status
205 bind(C, name="get_input_item_count")
208 integer(kind=c_int),
intent(out) :: count
209 integer(kind=c_int) :: bmi_status
222 bind(C, name="get_output_item_count")
225 integer(kind=c_int),
intent(out) :: count
226 integer(kind=c_int) :: bmi_status
249 bind(C, name="get_input_var_names")
252 character(kind=c_char, len=1),
intent(inout) :: c_names(*)
253 integer(kind=c_int) :: bmi_status
255 integer(I4B) :: start, i
258 character(len=LENMEMADDRESS) :: var_address
262 do while (itr%has_next())
266 do i = 1, len(trim(var_address))
267 c_names(start + i - 1) = var_address(i:i)
269 c_names(start + i) = c_null_char
284 bind(C, name="get_output_var_names")
287 character(kind=c_char, len=1),
intent(inout) :: c_names(*)
288 integer(kind=c_int) :: bmi_status
290 integer(I4B) :: start, i
293 character(len=LENMEMADDRESS) :: var_address
297 do while (itr%has_next())
301 do i = 1, len(trim(var_address))
302 c_names(start + i - 1) = var_address(i:i)
304 c_names(start + i) = c_null_char
315 bind(C, name="get_var_itemsize")
318 character(kind=c_char),
intent(in) :: c_var_address(*)
319 integer(kind=c_int),
intent(out) :: var_size
320 integer(kind=c_int) :: bmi_status
322 character(len=LENMEMPATH) :: mem_path
323 character(len=LENVARNAME) :: var_name
324 logical(LGP) :: valid
329 if (.not. valid)
then
342 bind(C, name="get_var_nbytes")
345 character(kind=c_char),
intent(in) :: c_var_address(*)
346 integer(kind=c_int),
intent(out) :: var_nbytes
347 integer(kind=c_int) :: bmi_status
349 integer(I4B) :: var_size, isize
350 character(len=LENMEMPATH) :: mem_path
351 character(len=LENVARNAME) :: var_name
352 logical(LGP) :: valid
357 if (.not. valid)
then
364 call get_isize(var_name, mem_path, isize)
367 var_nbytes = var_size * isize
379 bind(C, name="get_value_double")
384 character(kind=c_char),
intent(in) :: c_var_address(*)
385 type(c_ptr),
intent(in) :: c_arr_ptr
386 integer(kind=c_int) :: bmi_status
388 character(len=LENMEMPATH) :: mem_path
389 character(len=LENVARNAME) :: var_name
390 logical(LGP) :: valid
392 real(dp),
pointer :: src_ptr, tgt_ptr
393 real(dp),
dimension(:),
pointer,
contiguous :: src1d_ptr, tgt1d_ptr
394 real(dp),
dimension(:, :),
pointer,
contiguous :: src2d_ptr, tgt2d_ptr
395 real(dp),
dimension(:, :, :),
pointer,
contiguous :: src3d_ptr, tgt3d_ptr
396 integer(I4B) :: i, j, k
401 if (.not. valid)
then
413 call c_f_pointer(c_arr_ptr, tgt_ptr)
415 else if (rank == 1)
then
416 call mem_setptr(src1d_ptr, var_name, mem_path)
417 call c_f_pointer(c_arr_ptr, tgt1d_ptr, shape(src1d_ptr))
418 do i = 1,
size(tgt1d_ptr)
419 tgt1d_ptr(i) = src1d_ptr(i)
421 else if (rank == 2)
then
422 call mem_setptr(src2d_ptr, var_name, mem_path)
423 call c_f_pointer(c_arr_ptr, tgt2d_ptr, shape(src2d_ptr))
424 do j = 1,
size(tgt2d_ptr, 2)
425 do i = 1,
size(tgt2d_ptr, 1)
426 tgt2d_ptr(i, j) = src2d_ptr(i, j)
429 else if (rank == 3)
then
430 call mem_setptr(src3d_ptr, var_name, mem_path)
431 call c_f_pointer(c_arr_ptr, tgt3d_ptr, shape(src3d_ptr))
432 do k = 1,
size(tgt3d_ptr, 3)
433 do j = 1,
size(tgt3d_ptr, 2)
434 do i = 1,
size(tgt3d_ptr, 1)
435 tgt3d_ptr(i, j, k) = src3d_ptr(i, j, k)
456 bind(C, name="get_value_int")
461 character(kind=c_char),
intent(in) :: c_var_address(*)
462 type(c_ptr),
intent(in) :: c_arr_ptr
463 integer(kind=c_int) :: bmi_status
465 character(len=LENMEMPATH) :: mem_path
466 character(len=LENVARNAME) :: var_name
467 logical(LGP) :: valid
469 integer(I4B),
pointer :: src_ptr, tgt_ptr
470 integer(I4B),
dimension(:),
pointer,
contiguous :: src1d_ptr, tgt1d_ptr
471 integer(I4B),
dimension(:, :),
pointer,
contiguous :: src2d_ptr, tgt2d_ptr
472 integer(I4B),
dimension(:, :, :),
pointer,
contiguous :: src3d_ptr, tgt3d_ptr
473 integer(I4B) :: i, j, k
478 if (.not. valid)
then
490 call c_f_pointer(c_arr_ptr, tgt_ptr)
492 else if (rank == 1)
then
493 call mem_setptr(src1d_ptr, var_name, mem_path)
494 call c_f_pointer(c_arr_ptr, tgt1d_ptr, shape(src1d_ptr))
495 do i = 1,
size(tgt1d_ptr)
496 tgt1d_ptr(i) = src1d_ptr(i)
498 else if (rank == 2)
then
499 call mem_setptr(src2d_ptr, var_name, mem_path)
500 call c_f_pointer(c_arr_ptr, tgt2d_ptr, shape(src2d_ptr))
501 do j = 1,
size(tgt2d_ptr, 2)
502 do i = 1,
size(tgt2d_ptr, 1)
503 tgt2d_ptr(i, j) = src2d_ptr(i, j)
506 else if (rank == 3)
then
507 call mem_setptr(src3d_ptr, var_name, mem_path)
508 call c_f_pointer(c_arr_ptr, tgt3d_ptr, shape(src3d_ptr))
509 do k = 1,
size(tgt3d_ptr, 3)
510 do j = 1,
size(tgt3d_ptr, 2)
511 do i = 1,
size(tgt3d_ptr, 1)
512 tgt3d_ptr(i, j, k) = src3d_ptr(i, j, k)
531 bind(C, name="get_value_bool")
536 character(kind=c_char),
intent(in) :: c_var_address(*)
537 type(c_ptr),
intent(in) :: c_arr_ptr
538 integer(kind=c_int) :: bmi_status
540 character(len=LENMEMPATH) :: mem_path
541 character(len=LENVARNAME) :: var_name
542 logical(LGP) :: valid
544 logical(LGP),
pointer :: src_ptr, tgt_ptr
549 if (.not. valid)
then
560 call c_f_pointer(c_arr_ptr, tgt_ptr)
579 bind(C, name="get_value_string")
583 character(kind=c_char),
intent(in) :: c_var_address(*)
584 type(c_ptr),
intent(in) :: c_arr_ptr
585 integer(kind=c_int) :: bmi_status
587 character(len=LENMEMPATH) :: mem_path
588 character(len=LENVARNAME) :: var_name
589 logical(LGP) :: valid
591 character(len=:),
pointer :: srcstr
592 character(kind=c_char),
pointer :: tgtstr(:)
594 character(kind=c_char),
pointer :: tgtstr1d(:, :)
595 character(:),
allocatable :: tempstr
596 integer(I4B) :: i, ilen, isize
601 if (.not. valid)
then
614 call c_f_pointer(c_arr_ptr, tgtstr, shape=[ilen + 1])
618 else if (rank == 1)
then
620 call mem_setptr(srccharstr1d, var_name, mem_path)
621 if (.not.
associated(srccharstr1d))
then
629 call get_isize(var_name, mem_path, isize)
631 call c_f_pointer(c_arr_ptr, tgtstr1d, shape=[ilen + 1, isize])
635 allocate (
character(ilen) :: tempstr)
637 tempstr = srccharstr1d(i)
657 function get_value(c_var_address, c_arr_ptr)
result(bmi_status) &
658 bind(C, name="get_value")
663 character(kind=c_char),
intent(in) :: c_var_address(*)
664 type(c_ptr),
intent(inout) :: c_arr_ptr
665 integer(kind=c_int) :: bmi_status
667 character(len=LENMEMPATH) :: mem_path
668 character(len=LENMEMTYPE) :: mem_type
669 character(len=LENVARNAME) :: var_name
670 logical(LGP) :: valid
675 if (.not. valid)
then
682 if (index(mem_type,
"DOUBLE") /= 0)
then
684 else if (index(mem_type,
"INTEGER") /= 0)
then
686 else if (index(mem_type,
"LOGICAL") /= 0)
then
688 else if (index(mem_type,
"STRING") /= 0)
then
707 bind(C, name="get_value_ptr")
712 character(kind=c_char),
intent(in) :: c_var_address(*)
713 type(c_ptr),
intent(inout) :: c_arr_ptr
714 integer(kind=c_int) :: bmi_status
716 character(len=LENMEMPATH) :: mem_path
717 character(len=LENMEMTYPE) :: mem_type
718 character(len=LENVARNAME) :: var_name
719 logical(LGP) :: valid
724 if (.not. valid)
then
731 if (index(mem_type,
"DOUBLE") /= 0)
then
733 else if (index(mem_type,
"INTEGER") /= 0)
then
735 else if (index(mem_type,
"LOGICAL") /= 0)
then
754 bind(C, name="get_value_ptr_double")
757 character(kind=c_char),
intent(in) :: c_var_address(*)
758 type(c_ptr),
intent(inout) :: c_arr_ptr
759 integer(kind=c_int) :: bmi_status
761 character(len=LENMEMPATH) :: mem_path
762 character(len=LENVARNAME) :: var_name
763 logical(LGP) :: valid
764 real(dp),
pointer :: scalar_ptr
765 real(dp),
dimension(:),
pointer,
contiguous :: array_ptr
766 real(dp),
dimension(:, :),
pointer,
contiguous :: array2d_ptr
767 real(dp),
dimension(:, :, :),
pointer,
contiguous :: array3d_ptr
773 if (.not. valid)
then
781 call mem_setptr(scalar_ptr, var_name, mem_path)
782 c_arr_ptr = c_loc(scalar_ptr)
783 else if (rank == 1)
then
784 call mem_setptr(array_ptr, var_name, mem_path)
785 c_arr_ptr = c_loc(array_ptr)
786 else if (rank == 2)
then
787 call mem_setptr(array2d_ptr, var_name, mem_path)
788 c_arr_ptr = c_loc(array2d_ptr)
789 else if (rank == 3)
then
790 call mem_setptr(array3d_ptr, var_name, mem_path)
791 c_arr_ptr = c_loc(array3d_ptr)
808 bind(C, name="get_value_ptr_int")
811 character(kind=c_char),
intent(in) :: c_var_address(*)
812 type(c_ptr),
intent(inout) :: c_arr_ptr
813 integer(kind=c_int) :: bmi_status
815 character(len=LENMEMPATH) :: mem_path
816 character(len=LENVARNAME) :: var_name
817 logical(LGP) :: valid
819 integer(I4B),
pointer :: scalar_ptr
820 integer(I4B),
dimension(:),
pointer,
contiguous :: array_ptr
821 integer(I4B),
dimension(:, :),
pointer,
contiguous :: array2d_ptr
822 integer(I4B),
dimension(:, :, :),
pointer,
contiguous :: array3d_ptr
827 if (.not. valid)
then
836 call mem_setptr(scalar_ptr, var_name, mem_path)
837 c_arr_ptr = c_loc(scalar_ptr)
838 else if (rank == 1)
then
839 call mem_setptr(array_ptr, var_name, mem_path)
840 c_arr_ptr = c_loc(array_ptr)
841 else if (rank == 2)
then
842 call mem_setptr(array2d_ptr, var_name, mem_path)
843 c_arr_ptr = c_loc(array2d_ptr)
844 else if (rank == 3)
then
845 call mem_setptr(array3d_ptr, var_name, mem_path)
846 c_arr_ptr = c_loc(array3d_ptr)
861 bind(C, name="get_value_ptr_bool")
864 character(kind=c_char),
intent(in) :: c_var_address(*)
865 type(c_ptr),
intent(inout) :: c_arr_ptr
866 integer(kind=c_int) :: bmi_status
868 character(len=LENMEMPATH) :: mem_path
869 character(len=LENVARNAME) :: var_name
870 logical(LGP) :: valid
871 logical(LGP),
pointer :: scalar_ptr
877 if (.not. valid)
then
885 call mem_setptr(scalar_ptr, var_name, mem_path)
886 c_arr_ptr = c_loc(scalar_ptr)
902 function set_value(c_var_address, c_arr_ptr)
result(bmi_status) &
903 bind(C, name="set_value")
908 character(kind=c_char),
intent(in) :: c_var_address(*)
909 type(c_ptr),
intent(inout) :: c_arr_ptr
910 integer(kind=c_int) :: bmi_status
912 character(len=LENMEMPATH) :: mem_path
913 character(len=LENMEMTYPE) :: mem_type
914 character(len=LENVARNAME) :: var_name
915 logical(LGP) :: valid
920 if (.not. valid)
then
927 if (index(mem_type,
"DOUBLE") /= 0)
then
929 else if (index(mem_type,
"INTEGER") /= 0)
then
931 else if (index(mem_type,
"LOGICAL") /= 0)
then
949 bind(C, name="set_value_double")
954 character(kind=c_char),
intent(in) :: c_var_address(*)
955 type(c_ptr),
intent(in) :: c_arr_ptr
956 integer(kind=c_int) :: bmi_status
958 character(len=LENMEMPATH) :: mem_path
959 character(len=LENVARNAME) :: var_name
960 logical(LGP) :: valid
962 real(dp),
pointer :: src_ptr, tgt_ptr
963 real(dp),
dimension(:),
pointer,
contiguous :: src1d_ptr, tgt1d_ptr
964 real(dp),
dimension(:, :),
pointer,
contiguous :: src2d_ptr, tgt2d_ptr
966 integer(I4B) :: status
971 if (.not. valid)
then
982 call c_f_pointer(c_arr_ptr, src_ptr)
984 else if (rank == 1)
then
985 call mem_setptr(tgt1d_ptr, var_name, mem_path)
986 call c_f_pointer(c_arr_ptr, src1d_ptr, shape(tgt1d_ptr))
987 do i = 1,
size(tgt1d_ptr)
988 tgt1d_ptr(i) = src1d_ptr(i)
990 else if (rank == 2)
then
991 call mem_setptr(tgt2d_ptr, var_name, mem_path)
992 call c_f_pointer(c_arr_ptr, src2d_ptr, shape(tgt2d_ptr))
993 do j = 1,
size(tgt2d_ptr, 2)
994 do i = 1,
size(tgt2d_ptr, 1)
995 tgt2d_ptr(i, j) = src2d_ptr(i, j)
1007 if (status /= 0)
then
1022 bind(C, name="set_value_int")
1027 character(kind=c_char),
intent(in) :: c_var_address(*)
1028 type(c_ptr),
intent(in) :: c_arr_ptr
1029 integer(kind=c_int) :: bmi_status
1031 character(len=LENMEMPATH) :: mem_path
1032 character(len=LENVARNAME) :: var_name
1033 logical(LGP) :: valid
1034 integer(I4B) :: rank
1035 integer(I4B),
pointer :: src_ptr, tgt_ptr
1036 integer(I4B),
dimension(:),
pointer,
contiguous :: src1d_ptr, tgt1d_ptr
1037 integer(I4B),
dimension(:, :),
pointer,
contiguous :: src2d_ptr, tgt2d_ptr
1038 integer(I4B) :: i, j
1039 integer(I4B) :: status
1043 call split_address(c_var_address, mem_path, var_name, valid)
1044 if (.not. valid)
then
1055 call c_f_pointer(c_arr_ptr, src_ptr)
1057 else if (rank == 1)
then
1058 call mem_setptr(tgt1d_ptr, var_name, mem_path)
1059 call c_f_pointer(c_arr_ptr, src1d_ptr, shape(tgt1d_ptr))
1060 do i = 1,
size(tgt1d_ptr)
1061 tgt1d_ptr(i) = src1d_ptr(i)
1063 else if (rank == 2)
then
1064 call mem_setptr(tgt2d_ptr, var_name, mem_path)
1065 call c_f_pointer(c_arr_ptr, src2d_ptr, shape(tgt2d_ptr))
1066 do j = 1,
size(tgt2d_ptr, 2)
1067 do i = 1,
size(tgt2d_ptr, 1)
1068 tgt2d_ptr(i, j) = src2d_ptr(i, j)
1080 if (status /= 0)
then
1095 bind(C, name="set_value_bool")
1100 character(kind=c_char),
intent(in) :: c_var_address(*)
1101 type(c_ptr),
intent(in) :: c_arr_ptr
1102 integer(kind=c_int) :: bmi_status
1104 character(len=LENMEMPATH) :: mem_path
1105 character(len=LENVARNAME) :: var_name
1106 logical(LGP) :: valid
1107 integer(I4B) :: rank
1108 logical(LGP),
pointer :: src_ptr, tgt_ptr
1109 integer(I4B) :: status
1113 call split_address(c_var_address, mem_path, var_name, valid)
1114 if (.not. valid)
then
1125 call c_f_pointer(c_arr_ptr, src_ptr)
1136 if (status /= 0)
then
1152 bind(C, name="get_var_type")
1157 character(kind=c_char),
intent(in) :: c_var_address(*)
1158 character(kind=c_char),
intent(out) :: c_var_type(
bmi_lenvartype)
1159 integer(kind=c_int) :: bmi_status
1161 character(len=LENMEMPATH) :: mem_path
1162 character(len=LENVARNAME) :: var_name
1163 character(len=LENMEMTYPE) :: mem_type
1164 logical(LGP) :: valid
1168 call split_address(c_var_address, mem_path, var_name, valid)
1169 if (.not. valid)
then
1175 c_var_type(1:len(trim(mem_type)) + 1) = &
1178 if (mem_type ==
'UNKNOWN')
then
1192 bind(C, name="get_var_rank")
1195 character(kind=c_char),
intent(in) :: c_var_address(*)
1196 integer(kind=c_int),
intent(out) :: c_var_rank
1197 integer(kind=c_int) :: bmi_status
1199 character(len=LENMEMPATH) :: mem_path
1200 character(len=LENVARNAME) :: var_name
1201 logical(LGP) :: valid
1205 call split_address(c_var_address, mem_path, var_name, valid)
1206 if (.not. valid)
then
1212 if (c_var_rank == -1)
then
1230 bind(C, name="get_var_shape")
1235 character(kind=c_char),
intent(in) :: c_var_address(*)
1236 integer(c_int),
intent(inout) :: c_var_shape(*)
1237 integer(kind=c_int) :: bmi_status
1239 integer(I4B),
dimension(MAXMEMRANK) :: var_shape
1240 integer(I4B) :: var_rank
1241 character(len=LENMEMPATH) :: mem_path
1242 character(len=LENVARNAME) :: var_name
1243 logical(LGP) :: valid
1247 call split_address(c_var_address, mem_path, var_name, valid)
1248 if (.not. valid)
then
1257 if (var_shape(1) == -1 .or. var_rank == -1)
then
1266 c_var_shape(1:var_rank) = var_shape(var_rank:1:-1)
This module contains simulation constants.
integer(i4b), parameter lenvarname
maximum length of a variable name
integer(i4b), parameter, public maxmemrank
maximum memory manager length (up to 3-dimensional arrays)
integer(i4b), parameter, public lenmemtype
maximum length of a memory manager type
integer(i4b), parameter lenmempath
maximum length of the memory path
This module defines variable data types.
character(len=lenmemaddress) function create_mem_address(mem_path, var_name)
returns the address string of the memory object
subroutine, public get_mem_type(name, mem_path, var_type)
@ brief Get the variable memory type
subroutine, public get_mem_shape(name, mem_path, mem_shape)
@ brief Get the variable memory shape
type(memorystoretype), public memorystore
subroutine, public get_isize(name, mem_path, isize)
@ brief Get the number of elements for this variable
subroutine, public get_mem_rank(name, mem_path, rank)
@ brief Get the variable rank
subroutine, public get_mem_elem_size(name, mem_path, size)
@ brief Get the memory size of a single element of the stored variable
subroutine, public on_memory_set(var_name, mem_path, status)
Triggers the calling of the side effect handler for this variable.
This module contains the MODFLOW 6 BMI.
integer(kind=c_int) function get_end_time(end_time)
Get the end time of the simulation.
integer(kind=c_int) function get_input_var_names(c_names)
Returns all input variables in the simulation.
integer(kind=c_int) function get_input_item_count(count)
Get the number of input variables in the simulation.
integer(kind=c_int) function get_value_ptr_double(c_var_address, c_arr_ptr)
Get a pointer to the array of double precision numbers.
integer(kind=c_int) function get_value_ptr_int(c_var_address, c_arr_ptr)
Get a pointer to the array of integer numbers.
integer(kind=c_int) function get_current_time(current_time)
Get the current time of the simulation.
integer(kind=c_int) function get_var_rank(c_var_address, c_var_rank)
Get the variable rank (non-BMI)
integer(kind=c_int) function get_output_item_count(count)
Get the number of output variables in the simulation.
integer(kind=c_int) function get_value_ptr_bool(c_var_address, c_arr_ptr)
Get a pointer to the logical scalar value.
integer(kind=c_int) function set_value(c_var_address, c_arr_ptr)
Set new values for a given variable.
integer(kind=c_int) function get_time_step(time_step)
Get the time step for the simulation.
integer(kind=c_int) function get_var_nbytes(c_var_address, var_nbytes)
Get size of the variable, in bytes.
integer(kind=c_int) function set_value_double(c_var_address, c_arr_ptr)
Set new values for a variable of type double.
integer(kind=c_int) function get_start_time(start_time)
Get the start time of the simulation.
integer(kind=c_int) function set_value_int(c_var_address, c_arr_ptr)
Set new values for a variable of type integer.
integer(kind=c_int) function get_var_itemsize(c_var_address, var_size)
Get the size (in bytes) of a single element of a variable.
integer(kind=c_int) function bmi_get_component_name(name)
integer(kind=c_int) function bmi_update()
Perform a computational time step.
integer(kind=c_int) function get_value_ptr(c_var_address, c_arr_ptr)
Get a pointer to an array.
integer(kind=c_int) function get_var_shape(c_var_address, c_var_shape)
Get the shape of the array for the variable (non-BMI)
integer(kind=c_int) function bmi_initialize()
Initialize the computational core.
integer(kind=c_int) function bmi_finalize()
Clean up the initialized simulation.
integer(kind=c_int) function get_value_int(c_var_address, c_arr_ptr)
Copy the integer values of a variable into the array.
integer(kind=c_int) function get_output_var_names(c_names)
Returns all output variables in the simulation.
integer(kind=c_int) function get_var_type(c_var_address, c_var_type)
Get the variable type as a string.
integer(kind=c_int) function get_value_double(c_var_address, c_arr_ptr)
Copy the double precision values of a variable into the array.
integer(kind=c_int) function set_value_bool(c_var_address, c_arr_ptr)
Set new value for a logical scalar variable.
integer(kind=c_int) function get_value(c_var_address, c_arr_ptr)
Copy the value of a variable into the array.
integer(kind=c_int) function get_value_string(c_var_address, c_arr_ptr)
Copy the string(s) of a variable into the array.
integer(kind=c_int) function get_value_bool(c_var_address, c_arr_ptr)
Copy the logical scalar value into the array.
integer(c_int), bind(C, name="ISTDOUTTOFILE") istdout_to_file
output control: =0 to screen, >0 to file
Detailed error information for the BMI.
character(len= *), parameter fmt_general_err
integer, parameter bmi_failure
BMI status code for failure (taken from bmi.f90, CSDMS)
character(len= *), parameter fmt_unsupported_type
character(len=lenerrmessage) bmi_last_error
module variable containing the last error as a Fortran string
subroutine report_bmi_error(err_msg)
Sets the last BMI error message and copies it to an exported C-string.
character(len= *), parameter fmt_invalid_mem_access
character(len= *), parameter fmt_unsupported_rank
integer, parameter bmi_success
BMI status code for success (taken from bmi.f90, CSDMS)
This module contains helper routines and parameters for the MODFLOW 6 BMI.
integer(c_int), bind(C, name="BMI_LENVARTYPE") bmi_lenvartype
max. length for variable type C-strings
integer(c_int), bind(C, name="BMI_LENCOMPONENTNAME") bmi_lencomponentname
component name length, i.e. 'MODFLOW 6'
subroutine split_address(c_var_address, mem_path, var_name, success)
Split the variable address string.
pure character(kind=c_char, len=1) function, dimension(length+1) string_to_char_array(string, length)
Convert Fortran string to C-style character string.
integer(c_int), bind(C, name="BMI_LENVARADDRESS") bmi_lenvaraddress
max. length for the variable's address C-string
logical(lgp) function mf6update()
Run a time step.
subroutine mf6initialize()
Initialize a simulation.
subroutine mf6finalize()
Finalize the simulation.
This module contains simulation variables.
integer(i4b) iforcestop
forced stop flag (1) forces a call to ustop(..) when the simulation has ended, (0) doesn't
character(len=linelength) simstdout
name of standard out file if screen output is piped to a file
integer(i4b) istdout
unit number for stdout
real(dp), pointer, public totim
time relative to start of simulation
real(dp), pointer, public totalsimtime
time at end of simulation
integer(i4b), pointer, public kstp
current time step number
integer(i4b), pointer, public kper
current stress period number
real(dp), pointer, public delt
length of the current time step
This class is used to store a single deferred-length character string. It was designed to work in an ...
An iterator used to iterate through a MemoryContainer.