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
e9dd977a
Commit
e9dd977a
authored
6 months ago
by
Evgeny Mortikov
Browse files
Options
Downloads
Patches
Plain Diff
configuration files coupling update
parent
f1d27e57
No related branches found
Branches containing commit
No related tags found
Tags containing commit
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
includeF/sfx_def.fi
+2
-1
2 additions, 1 deletion
includeF/sfx_def.fi
srcF/sfx_main.f90
+78
-24
78 additions, 24 deletions
srcF/sfx_main.f90
with
81 additions
and
25 deletions
.gitignore
+
1
−
0
View file @
e9dd977a
/drag.exe
/build/
/srcF/*.mod
.idea
This diff is collapsed.
Click to expand it.
includeF/sfx_def.fi
+
2
−
1
View file @
e9dd977a
! sfx model macro definitions
!#define SFX_FORCE_DEPRECATED_ESM_CODE
!#define SFX_CHECK_NAN
\ No newline at end of file
!#define SFX_CHECK_NAN
!#define USE_CONFIG_PARSER
This diff is collapsed.
Click to expand it.
srcF/sfx_main.f90
+
78
−
24
View file @
e9dd977a
...
...
@@ -108,6 +108,9 @@ 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
...
...
@@ -216,6 +219,70 @@ program sfx_main
end
if
end
do
#ifdef USE_CONFIG_PARSER
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
model_id
=
model_esm
else
if
(
compare_char_arrays
(
config_model_name
,
trim
(
arg_key_model_log
),
size
(
config_model_name
)))
then
model_id
=
model_log
else
if
(
compare_char_arrays
(
config_model_name
,
trim
(
arg_key_model_most
),
size
(
config_model_name
)))
then
model_id
=
model_most
else
if
(
compare_char_arrays
(
config_model_name
,
trim
(
arg_key_model_sheba
),
size
(
config_model_name
)))
then
model_id
=
model_sheba
else
write
(
*
,
*
)
' FAILURE! > unknown model [key]: '
,
config_model_name
stop
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
dataset_id
=
dataset_MOSAiC
else
if
(
compare_char_arrays
(
config_dataset_name
,
trim
(
arg_key_dataset_irgason
),
size
(
config_dataset_name
)))
then
dataset_id
=
dataset_IRGASON
else
if
(
compare_char_arrays
(
config_dataset_name
,
trim
(
arg_key_dataset_sheba
),
size
(
config_dataset_name
)))
then
dataset_id
=
dataset_SHEBA
else
if
(
compare_char_arrays
(
config_dataset_name
,
trim
(
arg_key_dataset_lake
),
size
(
config_dataset_name
)))
then
dataset_id
=
dataset_LAKE
else
if
(
compare_char_arrays
(
config_dataset_name
,
trim
(
arg_key_dataset_papa
),
size
(
config_dataset_name
)))
then
dataset_id
=
dataset_PAPA
else
if
(
compare_char_arrays
(
config_dataset_name
,
trim
(
arg_key_dataset_toga
),
size
(
config_dataset_name
)))
then
dataset_id
=
dataset_TOGA
else
if
(
compare_char_arrays
(
config_dataset_name
,
trim
(
arg_key_dataset_user
),
size
(
config_dataset_name
)))
then
dataset_id
=
dataset_USER
!call get_charf("dataset.filename"//C_NULL_CHAR, config_dataset_filename)
!call get_charf("dataset.filename_params"//C_NULL_CHAR, config_dataset_filename_params)
write
(
*
,
*
)
' FAILURE! > user dataset is not supported: '
,
config_dataset_name
stop
!call get_command_argument(i + 2, filename_in_common)
!call get_command_argument(i + 3, filename_in)
!call get_command_argument(i + 4, filename_out)
else
write
(
*
,
*
)
' FAILURE! > unknown dataset [key]: '
,
config_dataset_name
stop
end
if
!call get_charf("input_files.filename_in_common"//C_NULL_CHAR, fn_in_common)
!call get_charf("input_files.filename_in"//C_NULL_CHAR, fn_in)
!if (is_output_set == 0) call get_charf("input_files.filename_out"//C_NULL_CHAR, fn_out)
!sfx_type = get_sfx_type("surface.surface_type"//C_NULL_CHAR)
!if ( (sfx_type == surface_ocean) .or. (sfx_type == surface_lake) ) then
! call get_float("surface.z0_m"//C_NULL_CHAR, z0_m)
!end if
!write(*, *) "fn_in_common: ", fn_in_common
!write(*, *) "fn_in: ", fn_in
!if (is_output_set == 0) write(*, *) "fn_out: ", fn_out
!write(*, *) "sfx_type: ", sfx_type
!if ( (sfx_type == surface_ocean) .or. (sfx_type == surface_lake) ) then
! write(*, *) "z0_m: ", z0_m
!end if
#endif
!< @brief set name for specific model
if
(
model_id
==
model_esm
)
then
...
...
@@ -231,27 +298,6 @@ program sfx_main
stop
end
if
#ifdef USE_CONFIG_PARSER
call
run
(
"config.txt"
//
C_NULL_CHAR
)
call
get_charf
(
"input_files.filename_in_common"
//
C_NULL_CHAR
,
fn_in_common
)
call
get_charf
(
"input_files.filename_in"
//
C_NULL_CHAR
,
fn_in
)
if
(
is_output_set
==
0
)
call
get_charf
(
"input_files.filename_out"
//
C_NULL_CHAR
,
fn_out
)
sfx_type
=
get_sfx_type
(
"surface.surface_type"
//
C_NULL_CHAR
)
if
(
(
sfx_type
==
surface_ocean
)
.or.
(
sfx_type
==
surface_lake
)
)
then
call
get_float
(
"surface.z0_m"
//
C_NULL_CHAR
,
z0_m
)
end
if
write
(
*
,
*
)
"fn_in_common: "
,
fn_in_common
write
(
*
,
*
)
"fn_in: "
,
fn_in
if
(
is_output_set
==
0
)
write
(
*
,
*
)
"fn_out: "
,
fn_out
write
(
*
,
*
)
"sfx_type: "
,
sfx_type
if
(
(
sfx_type
==
surface_ocean
)
.or.
(
sfx_type
==
surface_lake
)
)
then
write
(
*
,
*
)
"z0_m: "
,
z0_m
end
if
#endif
!< @brief set name & filenames for specific dataset
if
(
dataset_id
==
dataset_MOSAiC
)
then
dataset_name
=
'MOSAiC'
...
...
@@ -334,10 +380,15 @@ program sfx_main
call
allocate_sfx_vec
(
sfx
,
num
)
#ifdef USE_CONFIG_PARSER
call
get_float
(
"dataset.h"
//
C_NULL_CHAR
,
meteo_cell
%
h
)
call
get_float
(
"dataset.z0_m"
//
C_NULL_CHAR
,
meteo_cell
%
z0_m
)
#else
!< @brief read input data common parameters
open
(
1
,
file
=
filename_in_common
,
status
=
'old'
)
read
(
1
,
*
)
meteo_cell
%
h
,
meteo_cell
%
z0_m
close
(
1
)
#endif
!< @brief read input data
...
...
@@ -380,9 +431,12 @@ program sfx_main
call
deallocate_sfx_vec
(
sfx
)
#ifdef USE_CONFIG_PARSER
deallocate
(
fn_in_common
)
deallocate
(
fn_in
)
if
(
is_output_set
==
0
)
deallocate
(
fn_out
)
deallocate
(
config_model_name
)
deallocate
(
config_dataset_name
)
!deallocate( fn_in_common )
!deallocate( fn_in )
!if (is_output_set == 0) deallocate( fn_out )
#endif
...
...
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