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
d8a4b4bd
Commit
d8a4b4bd
authored
6 months ago
by
Evgeny Mortikov
Browse files
Options
Downloads
Patches
Plain Diff
adding char array to string conversion
parent
c04d514f
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
srcF/sfx_common.f90
+17
-0
17 additions, 0 deletions
srcF/sfx_common.f90
srcF/sfx_main.f90
+12
-12
12 additions, 12 deletions
srcF/sfx_main.f90
with
30 additions
and
12 deletions
.gitignore
+
1
−
0
View file @
d8a4b4bd
/drag.exe
/build/
/srcF/*.mod
/parser/*.mod
.idea
This diff is collapsed.
Click to expand it.
srcF/sfx_common.f90
+
17
−
0
View file @
d8a4b4bd
...
...
@@ -18,7 +18,24 @@ contains
end
subroutine
str2int
! ----------------------------------------------------------------------------
!> @brief character array to string conversion
function
char_array2str
(
char_array
)
result
(
str
)
! ----------------------------------------------------------------------------
implicit
none
character
,
intent
(
in
)
::
char_array
(:)
character
(
len
=
:),
allocatable
::
str
integer
::
i
! ----------------------------------------------------------------------------
str
=
""
do
i
=
1
,
size
(
char_array
)
str
=
str
(:)
//
char_array
(
i
)
end
do
end
function
! ----------------------------------------------------------------------------
!> @brief check if value is finite
elemental
function
is_finite
(
value
)
! ----------------------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
srcF/sfx_main.f90
+
12
−
12
View file @
d8a4b4bd
...
...
@@ -110,7 +110,7 @@ program sfx_main
#ifdef USE_CONFIG_PARSER
character
,
allocatable
::
config_model_name
(:)
character
,
allocatable
::
config_dataset_name
(:)
character
,
allocatable
::
fn_in_common
(:),
fn_in
(:),
fn_out
(:)
integer
::
sfx_type
real
::
z0_m
...
...
@@ -223,13 +223,13 @@ program sfx_main
call
run
(
"config.txt"
//
C_NULL_CHAR
)
call
get_charf
(
"model.type"
//
C_NULL_CHAR
,
config_model_name
)
if
(
compare_char_arrays
(
config_model_name
,
trim
(
arg_key_model_esm
)
,
size
(
config_model_name
)
))
then
if
(
compare_char_arrays
(
config_model_name
,
trim
(
arg_key_model_esm
)))
then
model_id
=
model_esm
else
if
(
compare_char_arrays
(
config_model_name
,
trim
(
arg_key_model_log
)
,
size
(
config_model_name
)
))
then
else
if
(
compare_char_arrays
(
config_model_name
,
trim
(
arg_key_model_log
)))
then
model_id
=
model_log
else
if
(
compare_char_arrays
(
config_model_name
,
trim
(
arg_key_model_most
)
,
size
(
config_model_name
)
))
then
else
if
(
compare_char_arrays
(
config_model_name
,
trim
(
arg_key_model_most
)))
then
model_id
=
model_most
else
if
(
compare_char_arrays
(
config_model_name
,
trim
(
arg_key_model_sheba
)
,
size
(
config_model_name
)
))
then
else
if
(
compare_char_arrays
(
config_model_name
,
trim
(
arg_key_model_sheba
)))
then
model_id
=
model_sheba
else
write
(
*
,
*
)
' FAILURE! > unknown model [key]: '
,
config_model_name
...
...
@@ -237,19 +237,19 @@ program sfx_main
end
if
call
get_charf
(
"dataset.type"
//
C_NULL_CHAR
,
config_dataset_name
)
if
(
compare_char_arrays
(
config_dataset_name
,
trim
(
arg_key_dataset_mosaic
)
,
size
(
config_dataset_name
)
))
then
if
(
compare_char_arrays
(
config_dataset_name
,
trim
(
arg_key_dataset_mosaic
)))
then
dataset_id
=
dataset_MOSAiC
else
if
(
compare_char_arrays
(
config_dataset_name
,
trim
(
arg_key_dataset_irgason
)
,
size
(
config_dataset_name
)
))
then
else
if
(
compare_char_arrays
(
config_dataset_name
,
trim
(
arg_key_dataset_irgason
)))
then
dataset_id
=
dataset_IRGASON
else
if
(
compare_char_arrays
(
config_dataset_name
,
trim
(
arg_key_dataset_sheba
)
,
size
(
config_dataset_name
)
))
then
else
if
(
compare_char_arrays
(
config_dataset_name
,
trim
(
arg_key_dataset_sheba
)))
then
dataset_id
=
dataset_SHEBA
else
if
(
compare_char_arrays
(
config_dataset_name
,
trim
(
arg_key_dataset_lake
)
,
size
(
config_dataset_name
)
))
then
else
if
(
compare_char_arrays
(
config_dataset_name
,
trim
(
arg_key_dataset_lake
)))
then
dataset_id
=
dataset_LAKE
else
if
(
compare_char_arrays
(
config_dataset_name
,
trim
(
arg_key_dataset_papa
)
,
size
(
config_dataset_name
)
))
then
else
if
(
compare_char_arrays
(
config_dataset_name
,
trim
(
arg_key_dataset_papa
)))
then
dataset_id
=
dataset_PAPA
else
if
(
compare_char_arrays
(
config_dataset_name
,
trim
(
arg_key_dataset_toga
)
,
size
(
config_dataset_name
)
))
then
else
if
(
compare_char_arrays
(
config_dataset_name
,
trim
(
arg_key_dataset_toga
)))
then
dataset_id
=
dataset_TOGA
else
if
(
compare_char_arrays
(
config_dataset_name
,
trim
(
arg_key_dataset_user
)
,
size
(
config_dataset_name
)
))
then
else
if
(
compare_char_arrays
(
config_dataset_name
,
trim
(
arg_key_dataset_user
)))
then
dataset_id
=
dataset_USER
!call get_charf("dataset.filename"//C_NULL_CHAR, config_dataset_filename)
...
...
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