Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ Compiler | Version(s) Tested | Known Issues
LLVM `flang-new` | 19, 20 | none
NAG `nagfor` | 7.2 Build 7227 | none
GCC `gfortran` | 13, 14, 15 | see 1 below
Intel `ifx` | 2025.4 Build 20241205 | see 2 below
Intel `ifx` | 2025.1.1 Build 20250418 | see 2 below

1. `gfortran` issues:
- With GCC 14 or earlier, the `test_description_t` constructor's
Expand Down Expand Up @@ -287,8 +287,9 @@ where the `-ffree-line-length-none` turns on support for lines exceeding the For

#### Intel (`ifx`) compiler
```
fpm test --compiler ifx --flag "-fpp -O3 -coarray" --profile release
fpm test --compiler ifx --flag "-fpp -O3" --profile release
```
Older versions of `ifx` might require adding `-coarray` to the quoted argument just after `--flag` above.

Documentation
-------------
Expand Down
4 changes: 2 additions & 2 deletions src/julienne/julienne_formats_m.F90
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ module julienne_formats_m
!! Useful strings for formatting `print` and `write` statements
implicit none

character(len=*), parameter :: csv = "(*(G0,:,','))" !! comma-separated values
character(len=*), parameter :: cscv = "(*('(',G0,',',G0,')',:,',')))" !! comma-separated complex values
character(len=*), parameter :: csv = "(*(G25.20,:,','))" !! comma-separated values
character(len=*), parameter :: cscv = "(*('(',G25.20,',',G25.20,')',:,',')))" !! comma-separated complex values

#ifndef _CRAYFTN

Expand Down
5 changes: 3 additions & 2 deletions src/julienne/julienne_formats_s.F90
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@

module procedure separated_values
character(len=*), parameter :: prefix = "(*(G0,:,'"
character(len=*), parameter :: suffix = "'))"
character(len=*), parameter :: double_prefix = "(*(G25.20,:,'"
character(len=*), parameter :: complex_prefix = "(*('(',G0,',',G0,')',:,'"
character(len=*), parameter :: suffix = "'))"

select rank(mold)
rank(1)
select type(mold)
type is(complex)
format_string = complex_prefix // separator // suffix
type is(double precision)
format_string = prefix // separator // suffix
format_string = double_prefix // separator // "'))"
type is(real)
format_string = prefix // separator // suffix
type is(integer)
Expand Down
21 changes: 15 additions & 6 deletions src/julienne/julienne_string_m.f90
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,24 @@ module julienne_string_m
generic :: operator(/=) => string_t_ne_string_t, string_t_ne_character, character_ne_string_t
generic :: operator(==) => string_t_eq_string_t, string_t_eq_character, character_eq_string_t
generic :: assignment(= ) => assign_string_t_to_character, assign_character_to_string_t
generic :: get_json_value => get_string, get_string_t_array_with_character_key, get_string_t_array_with_string_t_key &
generic :: get_json_value => get_string_with_string_key, get_string_with_character_key &
,get_character_with_string_key, get_character_with_character_key &
,get_string_t_array_with_character_key, get_string_t_array_with_string_t_key &
,get_real, get_real_with_character_key &
,get_character, get_character_with_character_key &
,get_logical, get_logical_with_character_key &
,get_real_array ,get_real_array_with_character_key &
,get_integer_array, get_integer_array_with_character_key &
,get_integer, get_integer_with_character_key &
,get_double_precision, get_double_precision_with_character_key &
,get_double_precision_array, get_double_precision_array_with_character_key
procedure, private :: get_string_with_string_key, get_string_with_character_key
procedure, private :: get_character_with_string_key, get_character_with_character_key
procedure, private :: get_string_t_array_with_character_key, get_string_t_array_with_string_t_key
procedure, private :: get_real, get_real_with_character_key
procedure, private :: get_string, get_string_t_array_with_character_key, get_string_t_array_with_string_t_key
procedure, private :: get_logical, get_logical_with_character_key
procedure, private :: get_integer, get_integer_with_character_key
procedure, private :: get_real_array, get_real_array_with_character_key
procedure, private :: get_integer_array, get_integer_array_with_character_key
procedure, private :: get_character, get_character_with_character_key
procedure, private :: get_double_precision, get_double_precision_with_character_key
procedure, private :: get_double_precision_array, get_double_precision_array_with_character_key
procedure, private :: string_t_ne_string_t, string_t_ne_character
Expand Down Expand Up @@ -250,7 +252,7 @@ pure module function get_double_precision_array_with_character_key(self, key, mo
double precision, allocatable :: value_(:)
end function

pure module function get_character(self, key, mold) result(value_)
pure module function get_character_with_string_key(self, key, mold) result(value_)
implicit none
class(string_t), intent(in) :: self, key
character(len=*), intent(in) :: mold
Expand All @@ -264,12 +266,19 @@ pure module function get_character_with_character_key(self, key, mold) result(va
character(len=:), allocatable :: value_
end function

elemental module function get_string(self, key, mold) result(value_)
elemental module function get_string_with_string_key(self, key, mold) result(value_)
implicit none
class(string_t), intent(in) :: self, key, mold
type(string_t) :: value_
end function

pure module function get_string_with_character_key(self, key, mold) result(value_)
implicit none
class(string_t), intent(in) :: self, mold
character(len=*), intent(in) :: key
type(string_t) :: value_
end function

pure module function get_string_t_array_with_string_t_key(self, key, mold) result(value_)
implicit none
class(string_t), intent(in) :: self
Expand Down
14 changes: 10 additions & 4 deletions src/julienne/julienne_string_s.F90
Original file line number Diff line number Diff line change
Expand Up @@ -220,14 +220,20 @@

end procedure

module procedure get_character
associate(string_value => self%get_string(key, string_t(mold)))
module procedure get_character_with_string_key
associate(string_value => self%get_string_with_string_key(key, string_t(mold)))
value_ = string_value%string()
end associate
end procedure

module procedure get_character_with_character_key
associate(string_value => self%get_string(string_t(key), string_t(mold)))
associate(string_value => self%get_string_with_string_key(string_t(key), string_t(mold)))
value_ = string_value%string()
end associate
end procedure

module procedure get_string_with_character_key
associate(string_value => self%get_string_with_string_key(string_t(key), mold))
value_ = string_value%string()
end associate
end procedure
Expand Down Expand Up @@ -265,7 +271,7 @@
end associate
end procedure

module procedure get_string
module procedure get_string_with_string_key

character(len=:), allocatable :: raw_line

Expand Down
9 changes: 7 additions & 2 deletions src/julienne/julienne_test_diagnosis_m.F90
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module julienne_test_diagnosis_m
public :: julienne_assert
public :: operator(.all.)
public :: operator(.and.)
public :: operator(.also.)
public :: operator(.approximates.)
public :: operator(.isAtLeast.)
public :: operator(.isAtMost.)
Expand Down Expand Up @@ -181,16 +182,20 @@ pure module function aggregate_rank15_diagnosis(diagnoses) result(diagnosis)
#endif
end interface

interface operator(.and.)
interface operator(.also.)

elemental module function and(lhs, rhs) result(diagnosis)
elemental module function also(lhs, rhs) result(diagnosis)
implicit none
type(test_diagnosis_t), intent(in) :: lhs, rhs
type(test_diagnosis_t) diagnosis
end function

end interface

interface operator(.and.)
module procedure also
end interface

interface operator(.approximates.)

elemental module function approximates_real(actual, expected) result(operands)
Expand Down
2 changes: 1 addition & 1 deletion src/julienne/julienne_test_diagnosis_s.F90
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
implicit none
contains

module procedure and
module procedure also
diagnosis = .all. ([lhs,rhs])
end procedure

Expand Down
1 change: 1 addition & 0 deletions src/julienne_m.f90
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module julienne_m
,julienne_assert &
,operator(.all.) &
,operator(.and.) &
,operator(.also.) &
,operator(.approximates.) &
,operator(.equalsExpected.) &
,operator(.isAtLeast.) &
Expand Down
2 changes: 1 addition & 1 deletion test/modules/formats_test_m.F90
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ function check_csv_character() result(test_diagnosis)
character(len=200) captured_output
character(len=*), parameter :: expected_output = "Yodel, Ay, Hee, Hoo!"

write(captured_output, fmt = separated_values(separator=", ", mold=[integer::])) "Yodel", "Ay", "Hee", "Hoo!"
write(captured_output, fmt = separated_values(separator=", ", mold=[character::])) "Yodel", "Ay", "Hee", "Hoo!"

test_diagnosis = test_diagnosis_t( &
test_passed = expected_output == captured_output &
Expand Down
Loading