1! Copyright (c) 2019, NVIDIA CORPORATION.  All rights reserved.
2!
3! Licensed under the Apache License, Version 2.0 (the "License");
4! you may not use this file except in compliance with the License.
5! You may obtain a copy of the License at
6!
7!     http://www.apache.org/licenses/LICENSE-2.0
8!
9! Unless required by applicable law or agreed to in writing, software
10! distributed under the License is distributed on an "AS IS" BASIS,
11! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12! See the License for the specific language governing permissions and
13! limitations under the License.
14
15! See Fortran 2018, clause 16.10.2
16! TODO: These are placeholder values so that some tests can be run.
17
18module iso_fortran_env
19
20  integer, parameter :: atomic_int_kind = 8
21  integer, parameter :: atomic_logical_kind = 8
22
23  integer, parameter :: character_kinds(*) = [1, 2, 4]
24  integer, parameter :: int8 = 1, int16 = 2, int32 = 4, int64 = 8, int128 = 16
25  integer, parameter :: integer_kinds(*) = [int8, int16, int32, int64, int128]
26  integer, parameter :: &
27    logical8 = 1, logical16 = 2, logical32 = 4, logical64 = 8
28  integer, parameter :: logical_kinds(*) = &
29    [logical8, logical16, logical32, logical64]
30  integer, parameter :: &
31    real16 = 2, real32 = 4, real64 = 8, real80 = 10, real128 = 16
32  integer, parameter :: real_kinds(*) = &
33    [real16, 3, real32, real64, real80, real128]
34
35  integer, parameter :: current_team = -1, initial_team = -2, parent_team = -3
36
37  integer, parameter :: input_unit = 5, output_unit = 6, error_unit = 0
38  integer, parameter :: iostat_end = -1, iostat_eor = -2
39  integer, parameter :: iostat_inquire_internal_unit = -1
40
41  integer, parameter :: character_storage_size = 8
42  integer, parameter :: file_storage_size = 8
43  integer, parameter :: numeric_storage_size = 32
44
45  integer, parameter :: stat_failed_image = -1
46  integer, parameter :: stat_locked = 2
47  integer, parameter :: stat_locked_other_image = 3
48  integer, parameter :: stat_stopped_image = 4
49  integer, parameter :: stat_unlocked = 5
50  integer, parameter :: stat_unlocked_failed_image = 6
51
52  type :: event_type
53    private
54    integer(kind=atomic_int_kind) :: count = 0
55  end type event_type
56
57  type :: lock_type
58    private
59    integer(kind=atomic_int_kind) :: count = 0
60  end type lock_type
61
62  type :: team_type
63    private
64    integer(kind=int64) :: id = 0
65  end type team_type
66
67 contains
68
69  character(len=80) function compiler_options()
70    compiler_options = 'COMPILER_OPTIONS() not yet implemented'
71  end function compiler_options
72
73  character(len=80) function compiler_version()
74    compiler_version = 'f18 in development'
75  end function compiler_version
76end module iso_fortran_env
77
78