Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sfx
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
inmcm-mirror
sfx
Commits
0198819a
Commit
0198819a
authored
5 months ago
by
Evgeny Mortikov
Browse files
Options
Downloads
Patches
Plain Diff
config parser module update
parent
fe277867
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
config-parser/config-parser.f90
+4
-9
4 additions, 9 deletions
config-parser/config-parser.f90
with
4 additions
and
9 deletions
config-parser/config-parser.f90
+
4
−
9
View file @
0198819a
module
config_parser
module
config_parser
implicit
none
public
!< @brief C->Fortran interface
!< @brief C->Fortran interface
interface
interface
!< process configuration file [filename], status = [0 (ERROR), 1 (OK)]
!< process configuration file [filename], status = [0 (ERROR), 1 (OK)]
subroutine
c_config_run
(
filename
,
status
)
BIND
(
C
)
subroutine
c_config_run
(
filename
,
status
)
BIND
(
C
)
use
,
intrinsic
::
iso_c_binding
,
only
:
C_CHAR
,
C_INT
use
,
intrinsic
::
iso_c_binding
,
only
:
C_CHAR
,
C_INT
implicit
none
character
(
kind
=
C_CHAR
),
intent
(
in
)
::
filename
(
*
)
character
(
kind
=
C_CHAR
),
intent
(
in
)
::
filename
(
*
)
integer
(
kind
=
C_INT
),
intent
(
out
)
::
status
integer
(
kind
=
C_INT
),
intent
(
out
)
::
status
end
subroutine
c_config_run
end
subroutine
c_config_run
...
@@ -13,7 +15,6 @@ module config_parser
...
@@ -13,7 +15,6 @@ module config_parser
!< check if variable [name] is defined, status = [0 (FALSE), 1 (TRUE)]
!< check if variable [name] is defined, status = [0 (FALSE), 1 (TRUE)]
subroutine
c_config_is_varname
(
name
,
status
)
BIND
(
C
)
subroutine
c_config_is_varname
(
name
,
status
)
BIND
(
C
)
use
,
intrinsic
::
iso_c_binding
,
only
:
C_CHAR
,
C_INT
use
,
intrinsic
::
iso_c_binding
,
only
:
C_CHAR
,
C_INT
implicit
none
character
(
kind
=
C_CHAR
),
intent
(
in
)
::
name
(
*
)
character
(
kind
=
C_CHAR
),
intent
(
in
)
::
name
(
*
)
integer
(
kind
=
C_INT
),
intent
(
out
)
::
status
integer
(
kind
=
C_INT
),
intent
(
out
)
::
status
end
subroutine
c_config_is_varname
end
subroutine
c_config_is_varname
...
@@ -21,7 +22,6 @@ module config_parser
...
@@ -21,7 +22,6 @@ module config_parser
!< get (int) [value] of variable [name], status = [0 (ERROR), 1 (OK)]
!< get (int) [value] of variable [name], status = [0 (ERROR), 1 (OK)]
subroutine
c_config_get_int
(
name
,
value
,
status
)
BIND
(
C
)
subroutine
c_config_get_int
(
name
,
value
,
status
)
BIND
(
C
)
use
,
intrinsic
::
iso_c_binding
,
only
:
C_CHAR
,
C_INT
use
,
intrinsic
::
iso_c_binding
,
only
:
C_CHAR
,
C_INT
implicit
none
character
(
kind
=
C_CHAR
),
intent
(
in
)
::
name
(
*
)
character
(
kind
=
C_CHAR
),
intent
(
in
)
::
name
(
*
)
integer
(
kind
=
C_INT
),
intent
(
out
)
::
value
integer
(
kind
=
C_INT
),
intent
(
out
)
::
value
integer
(
kind
=
C_INT
),
intent
(
out
)
::
status
integer
(
kind
=
C_INT
),
intent
(
out
)
::
status
...
@@ -30,7 +30,6 @@ module config_parser
...
@@ -30,7 +30,6 @@ module config_parser
!< get (float) [value] of variable [name], status = [0 (ERROR), 1 (OK)]
!< get (float) [value] of variable [name], status = [0 (ERROR), 1 (OK)]
subroutine
c_config_get_float
(
name
,
value
,
status
)
BIND
(
C
)
subroutine
c_config_get_float
(
name
,
value
,
status
)
BIND
(
C
)
use
,
intrinsic
::
iso_c_binding
,
only
:
C_CHAR
,
C_INT
,
C_FLOAT
use
,
intrinsic
::
iso_c_binding
,
only
:
C_CHAR
,
C_INT
,
C_FLOAT
implicit
none
character
(
kind
=
C_CHAR
),
intent
(
in
)
::
name
(
*
)
character
(
kind
=
C_CHAR
),
intent
(
in
)
::
name
(
*
)
real
(
kind
=
C_FLOAT
),
intent
(
out
)
::
value
real
(
kind
=
C_FLOAT
),
intent
(
out
)
::
value
integer
(
kind
=
C_INT
),
intent
(
out
)
::
status
integer
(
kind
=
C_INT
),
intent
(
out
)
::
status
...
@@ -39,7 +38,6 @@ module config_parser
...
@@ -39,7 +38,6 @@ module config_parser
!< get (double) [value] of variable [name], status = [0 (ERROR), 1 (OK)]
!< get (double) [value] of variable [name], status = [0 (ERROR), 1 (OK)]
subroutine
c_config_get_double
(
name
,
value
,
status
)
BIND
(
C
)
subroutine
c_config_get_double
(
name
,
value
,
status
)
BIND
(
C
)
use
,
intrinsic
::
iso_c_binding
,
only
:
C_CHAR
,
C_INT
,
C_DOUBLE
use
,
intrinsic
::
iso_c_binding
,
only
:
C_CHAR
,
C_INT
,
C_DOUBLE
implicit
none
character
(
kind
=
C_CHAR
),
intent
(
in
)
::
name
(
*
)
character
(
kind
=
C_CHAR
),
intent
(
in
)
::
name
(
*
)
real
(
kind
=
C_DOUBLE
),
intent
(
out
)
::
value
real
(
kind
=
C_DOUBLE
),
intent
(
out
)
::
value
integer
(
kind
=
C_INT
),
intent
(
out
)
::
status
integer
(
kind
=
C_INT
),
intent
(
out
)
::
status
...
@@ -49,7 +47,6 @@ module config_parser
...
@@ -49,7 +47,6 @@ module config_parser
!< [len] = 0 if variable is not defined or not a string
!< [len] = 0 if variable is not defined or not a string
subroutine
c_config_get_string_len
(
name
,
len
)
BIND
(
C
)
subroutine
c_config_get_string_len
(
name
,
len
)
BIND
(
C
)
use
,
intrinsic
::
iso_c_binding
,
only
:
C_CHAR
,
C_INT
use
,
intrinsic
::
iso_c_binding
,
only
:
C_CHAR
,
C_INT
implicit
none
character
(
kind
=
C_CHAR
),
intent
(
in
)
::
name
(
*
)
character
(
kind
=
C_CHAR
),
intent
(
in
)
::
name
(
*
)
integer
(
kind
=
C_INT
),
intent
(
out
)
::
len
integer
(
kind
=
C_INT
),
intent
(
out
)
::
len
end
subroutine
c_config_get_string_len
end
subroutine
c_config_get_string_len
...
@@ -59,7 +56,6 @@ module config_parser
...
@@ -59,7 +56,6 @@ module config_parser
!< *: [c_str] output doesn't contain the null terminated character
!< *: [c_str] output doesn't contain the null terminated character
subroutine
c_config_get_string_unsafe
(
name
,
c_str
,
status
)
BIND
(
C
)
subroutine
c_config_get_string_unsafe
(
name
,
c_str
,
status
)
BIND
(
C
)
use
,
intrinsic
::
iso_c_binding
,
only
:
C_CHAR
,
C_INT
use
,
intrinsic
::
iso_c_binding
,
only
:
C_CHAR
,
C_INT
implicit
none
character
(
kind
=
C_CHAR
),
intent
(
in
)
::
name
(
*
)
character
(
kind
=
C_CHAR
),
intent
(
in
)
::
name
(
*
)
character
(
kind
=
C_CHAR
),
intent
(
out
)
::
c_str
(
*
)
character
(
kind
=
C_CHAR
),
intent
(
out
)
::
c_str
(
*
)
integer
(
kind
=
C_INT
),
intent
(
out
)
::
status
integer
(
kind
=
C_INT
),
intent
(
out
)
::
status
...
@@ -77,7 +73,6 @@ module config_parser
...
@@ -77,7 +73,6 @@ module config_parser
! *: [c_str] output doesn't contain the null terminated character
! *: [c_str] output doesn't contain the null terminated character
subroutine
c_config_get_string
(
name
,
c_str
,
status
)
subroutine
c_config_get_string
(
name
,
c_str
,
status
)
use
,
intrinsic
::
iso_c_binding
,
only
:
C_CHAR
,
C_INT
use
,
intrinsic
::
iso_c_binding
,
only
:
C_CHAR
,
C_INT
implicit
none
character
(
kind
=
C_CHAR
),
intent
(
in
)
::
name
(
*
)
character
(
kind
=
C_CHAR
),
intent
(
in
)
::
name
(
*
)
character
(
kind
=
C_CHAR
),
allocatable
,
intent
(
out
)
::
c_str
(:)
character
(
kind
=
C_CHAR
),
allocatable
,
intent
(
out
)
::
c_str
(:)
integer
(
kind
=
C_INT
),
intent
(
out
)
::
status
integer
(
kind
=
C_INT
),
intent
(
out
)
::
status
...
@@ -100,4 +95,4 @@ module config_parser
...
@@ -100,4 +95,4 @@ module config_parser
! --------------------------------------------------------------------------------
! --------------------------------------------------------------------------------
! --------------------------------------------------------------------------------
! --------------------------------------------------------------------------------
end
module
config_parser
end
module
config_parser
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment