From 101b88ba7b76ce68ead9de0131ebaa475c1b35f4 Mon Sep 17 00:00:00 2001 From: Tom Clune Date: Thu, 26 Jan 2023 13:04:26 -0500 Subject: [PATCH 1/8] Workarounds for intel 2021.7 --- CMakeLists.txt | 2 +- ChangeLog.md | 7 +++++++ Examples/Iterators/iterator.F90 | 10 +++++----- Examples/JSON/integer-array/test-integer-array.f90 | 2 +- .../nested-object-array/test-nested-object-array.f90 | 2 +- Examples/JSON/trivial/test-trivial.f90 | 8 +++++--- Examples/JSON/trivial/trivial.json | 1 + Examples/Simple/simple.F90 | 4 ++-- Examples/Simple/simple2.F90 | 2 +- Examples/Trivial/trivial.F90 | 5 +++-- src/Nodes/Nodes.F90 | 2 ++ src/Parser.F90 | 9 +++++++-- 12 files changed, 36 insertions(+), 18 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f8c93cb..a656f24 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.12) project (YAFYAML - VERSION 1.0.5 + VERSION 1.0.6 LANGUAGES Fortran) # Most users of this software do not (should not?) have permissions to diff --git a/ChangeLog.md b/ChangeLog.md index 2d4a9df..f74d1da 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -5,6 +5,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.0.6] - 2023-01-26 + +### Fixed + +- Workarounds for Intel 2021.7 +- Out of date examples have been updated + ## [1.0.5] - 2023-01-23 ### Fixed diff --git a/Examples/Iterators/iterator.F90 b/Examples/Iterators/iterator.F90 index 4607e57..c554f44 100644 --- a/Examples/Iterators/iterator.F90 +++ b/Examples/Iterators/iterator.F90 @@ -9,7 +9,7 @@ program main implicit none type(Parser) :: p - class(AbstractNode), allocatable :: node + class(YAML_Node), allocatable :: node integer :: status p = Parser('core') @@ -24,11 +24,11 @@ program main ! This procedure does not check any potential errors ! but is easier to follow as a result. subroutine optimistic(node) - class(AbstractNode), intent(in) :: node + class(YAML_Node), intent(in) :: node integer :: i integer :: prime - class(AbstractNode), pointer :: subcfg, subsubcfg + class(YAML_Node), pointer :: subcfg, subsubcfg class(NodeIterator), allocatable :: iter character(:), pointer :: shape integer :: n_edges @@ -58,11 +58,11 @@ end subroutine optimistic ! This procedure carefully checks all return codes. subroutine pessimistic(node) - class(AbstractNode), intent(in) :: node + class(YAML_Node), intent(in) :: node integer :: i integer :: prime - class(AbstractNode), pointer :: subcfg, subsubcfg + class(YAML_Node), pointer :: subcfg, subsubcfg class(NodeIterator), allocatable :: iter character(:), pointer :: shape, key integer :: n_edges diff --git a/Examples/JSON/integer-array/test-integer-array.f90 b/Examples/JSON/integer-array/test-integer-array.f90 index d32881e..8666f5b 100644 --- a/Examples/JSON/integer-array/test-integer-array.f90 +++ b/Examples/JSON/integer-array/test-integer-array.f90 @@ -6,7 +6,7 @@ program main class(YAML_Node), allocatable :: c integer, allocatable :: nodes(:) - p = Parser('core') + p = Parser() c = p%load('integer-array.json') call c%get(nodes, 'nodes') diff --git a/Examples/JSON/nested-object-array/test-nested-object-array.f90 b/Examples/JSON/nested-object-array/test-nested-object-array.f90 index 421eb09..b4bbb7c 100644 --- a/Examples/JSON/nested-object-array/test-nested-object-array.f90 +++ b/Examples/JSON/nested-object-array/test-nested-object-array.f90 @@ -18,7 +18,7 @@ program main integer :: i, j, status - p = Parser('core') + p = Parser() c = p%load('nested-object-array.json') dag_vertices => c%at('dag', 'vertices', rc=status) if (status /= YAFYAML_SUCCESS) error stop "did not find 'dag' 'vertices'" diff --git a/Examples/JSON/trivial/test-trivial.f90 b/Examples/JSON/trivial/test-trivial.f90 index 5fb272c..535abf5 100644 --- a/Examples/JSON/trivial/test-trivial.f90 +++ b/Examples/JSON/trivial/test-trivial.f90 @@ -1,13 +1,15 @@ program main - use yafyaml, only : Parser, YAML_Node, assignment(=) + use yafyaml + use fy_CoreSchema implicit none type(Parser) p class(YAML_Node), allocatable :: c logical :: science = .false. + integer :: rc - p = Parser('core') - c = p%load('trivial.json') + p = Parser() + c = p%load('trivial.json', rc=rc) science = c%at('science') ! this should overwrite science with .true. if (.not. science) error stop "Test failed" diff --git a/Examples/JSON/trivial/trivial.json b/Examples/JSON/trivial/trivial.json index 4ddc1c5..964d2e9 100644 --- a/Examples/JSON/trivial/trivial.json +++ b/Examples/JSON/trivial/trivial.json @@ -1 +1,2 @@ { "science" : true } + diff --git a/Examples/Simple/simple.F90 b/Examples/Simple/simple.F90 index a595975..679eb97 100644 --- a/Examples/Simple/simple.F90 +++ b/Examples/Simple/simple.F90 @@ -5,8 +5,8 @@ program main implicit none type(Parser) :: p - class(AbstractNode), allocatable :: node - class(AbstractNode), pointer :: subnode + class(YAML_Node), allocatable :: node + class(YAML_Node), pointer :: subnode real :: x character(:), allocatable :: name diff --git a/Examples/Simple/simple2.F90 b/Examples/Simple/simple2.F90 index ca147fc..1e99a28 100644 --- a/Examples/Simple/simple2.F90 +++ b/Examples/Simple/simple2.F90 @@ -7,7 +7,7 @@ program Simple2 implicit none type(Parser) :: p - class(AbstractNode), allocatable :: node + class(YAML_Node), allocatable :: node character(:), allocatable :: name ! Define the parser object and load the file diff --git a/Examples/Trivial/trivial.F90 b/Examples/Trivial/trivial.F90 index 1fe5498..d55847f 100644 --- a/Examples/Trivial/trivial.F90 +++ b/Examples/Trivial/trivial.F90 @@ -3,11 +3,12 @@ program main implicit none type(Parser) :: p - class(AbstractNode), allocatable :: node + class(YAML_Node), allocatable :: node integer :: prime integer :: status - p = Parser('core') +!!$ p = Parser('core') + p = Parser() node = p%load(FileStream('trivial.yaml')) prime = node%of('prime') diff --git a/src/Nodes/Nodes.F90 b/src/Nodes/Nodes.F90 index 09bef29..e91b07c 100644 --- a/src/Nodes/Nodes.F90 +++ b/src/Nodes/Nodes.F90 @@ -27,6 +27,8 @@ subroutine assign_to_logical(flag, this) logical, intent(out) :: flag class(YAML_Node), intent(in) :: this + logical, pointer :: ptr + flag = to_bool(this) end subroutine assign_to_logical diff --git a/src/Parser.F90 b/src/Parser.F90 index e1cd634..3a079d3 100644 --- a/src/Parser.F90 +++ b/src/Parser.F90 @@ -74,8 +74,9 @@ module fy_Parser function new_Parser_default() result(p) type(Parser) :: p - - p = Parser(CoreSchema()) + type(CoreSchema) :: c + c = CoreSchema() + p = Parser(c) end function new_Parser_default @@ -94,12 +95,16 @@ function new_Parser_schema_name(schema_name,unusable,rc) result(p) class(KeywordEnforcer), optional, intent(in) :: unusable integer, optional, intent(out) :: rc + print*,__FILE__,__LINE__ select case (schema_name) case ('json','JSON') + print*,__FILE__,__LINE__ p = Parser(JSONSchema()) case ('core','Core') + print*,__FILE__,__LINE__ p = Parser(CoreSchema()) case ('failsafe','Failsafe') + print*,__FILE__,__LINE__ p = Parser(FailsafeSchema()) case default __FAIL__(YAFYAML_PARSER_ERROR) From b15e3f770c727763241a8557802411ba7d3bd219 Mon Sep 17 00:00:00 2001 From: Tom Clune Date: Thu, 26 Jan 2023 13:05:59 -0500 Subject: [PATCH 2/8] Update src/Nodes/Nodes.F90 --- src/Nodes/Nodes.F90 | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Nodes/Nodes.F90 b/src/Nodes/Nodes.F90 index e91b07c..09bef29 100644 --- a/src/Nodes/Nodes.F90 +++ b/src/Nodes/Nodes.F90 @@ -27,8 +27,6 @@ subroutine assign_to_logical(flag, this) logical, intent(out) :: flag class(YAML_Node), intent(in) :: this - logical, pointer :: ptr - flag = to_bool(this) end subroutine assign_to_logical From 02000d236d0c64990441e7b929ed3330e9b58219 Mon Sep 17 00:00:00 2001 From: Tom Clune Date: Thu, 26 Jan 2023 13:06:24 -0500 Subject: [PATCH 3/8] Update src/Parser.F90 --- src/Parser.F90 | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Parser.F90 b/src/Parser.F90 index 3a079d3..65edf7c 100644 --- a/src/Parser.F90 +++ b/src/Parser.F90 @@ -95,7 +95,6 @@ function new_Parser_schema_name(schema_name,unusable,rc) result(p) class(KeywordEnforcer), optional, intent(in) :: unusable integer, optional, intent(out) :: rc - print*,__FILE__,__LINE__ select case (schema_name) case ('json','JSON') print*,__FILE__,__LINE__ From b8bdb0850a84b73b0eaf40f367f924e6aac23211 Mon Sep 17 00:00:00 2001 From: Tom Clune Date: Thu, 26 Jan 2023 13:06:52 -0500 Subject: [PATCH 4/8] Update src/Parser.F90 --- src/Parser.F90 | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Parser.F90 b/src/Parser.F90 index 65edf7c..2ee13c9 100644 --- a/src/Parser.F90 +++ b/src/Parser.F90 @@ -103,7 +103,6 @@ function new_Parser_schema_name(schema_name,unusable,rc) result(p) print*,__FILE__,__LINE__ p = Parser(CoreSchema()) case ('failsafe','Failsafe') - print*,__FILE__,__LINE__ p = Parser(FailsafeSchema()) case default __FAIL__(YAFYAML_PARSER_ERROR) From 660b1e3548237ac3610849dd3ccf048fe1116e3b Mon Sep 17 00:00:00 2001 From: Tom Clune Date: Thu, 26 Jan 2023 13:07:09 -0500 Subject: [PATCH 5/8] Update src/Parser.F90 --- src/Parser.F90 | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Parser.F90 b/src/Parser.F90 index 2ee13c9..24a489c 100644 --- a/src/Parser.F90 +++ b/src/Parser.F90 @@ -97,7 +97,6 @@ function new_Parser_schema_name(schema_name,unusable,rc) result(p) select case (schema_name) case ('json','JSON') - print*,__FILE__,__LINE__ p = Parser(JSONSchema()) case ('core','Core') print*,__FILE__,__LINE__ From 069fa89316af8e5c4c45ad8c9dd0f7d7f07e8271 Mon Sep 17 00:00:00 2001 From: Tom Clune Date: Thu, 26 Jan 2023 13:07:28 -0500 Subject: [PATCH 6/8] Update Examples/Trivial/trivial.F90 --- Examples/Trivial/trivial.F90 | 1 - 1 file changed, 1 deletion(-) diff --git a/Examples/Trivial/trivial.F90 b/Examples/Trivial/trivial.F90 index d55847f..d1dfa1d 100644 --- a/Examples/Trivial/trivial.F90 +++ b/Examples/Trivial/trivial.F90 @@ -7,7 +7,6 @@ program main integer :: prime integer :: status -!!$ p = Parser('core') p = Parser() node = p%load(FileStream('trivial.yaml')) From 1134f34b0dcad5175ae7a7ff679737c090aa4352 Mon Sep 17 00:00:00 2001 From: Tom Clune Date: Thu, 26 Jan 2023 13:07:44 -0500 Subject: [PATCH 7/8] Update src/Parser.F90 --- src/Parser.F90 | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Parser.F90 b/src/Parser.F90 index 24a489c..f094186 100644 --- a/src/Parser.F90 +++ b/src/Parser.F90 @@ -99,7 +99,6 @@ function new_Parser_schema_name(schema_name,unusable,rc) result(p) case ('json','JSON') p = Parser(JSONSchema()) case ('core','Core') - print*,__FILE__,__LINE__ p = Parser(CoreSchema()) case ('failsafe','Failsafe') p = Parser(FailsafeSchema()) From 90233d9c4e7f694bcfdd3a77b068d3a76211e5b3 Mon Sep 17 00:00:00 2001 From: Tom Clune Date: Thu, 26 Jan 2023 14:33:01 -0500 Subject: [PATCH 8/8] Update Examples/Iterators/iterator.F90 Co-authored-by: Matthew Thompson --- Examples/Iterators/iterator.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Examples/Iterators/iterator.F90 b/Examples/Iterators/iterator.F90 index c554f44..c8cd083 100644 --- a/Examples/Iterators/iterator.F90 +++ b/Examples/Iterators/iterator.F90 @@ -12,7 +12,7 @@ program main class(YAML_Node), allocatable :: node integer :: status - p = Parser('core') + p = Parser() node = p%load('iterator.yaml') write(10,'(dt)', iostat=status) node