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
34d1cad2
Commit
34d1cad2
authored
5 months ago
by
Evgeny Mortikov
Browse files
Options
Downloads
Patches
Plain Diff
minor update in main driver
parent
809c181f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
srcF/sfx_main.f90
+4
-2
4 additions, 2 deletions
srcF/sfx_main.f90
srcF/sfx_run.f90
+30
-40
30 additions, 40 deletions
srcF/sfx_run.f90
with
34 additions
and
42 deletions
srcF/sfx_main.f90
+
4
−
2
View file @
34d1cad2
program
sfx_main
!< @brief main driver
! modules used
! --------------------------------------------------------------------------------
...
...
@@ -19,11 +20,12 @@ program sfx_main
! --------------------------------------------------------------------------------
!
< @brief run setup
!
--- setting run
call
set_run
(
filename_out
,
dataset
,
model
)
!
< @brief
running main driver
!
---
running main driver
call
run_dataset
(
filename_out
,
dataset
,
model
)
! *: explicit call to stop to print exceptions raised
stop
end
program
This diff is collapsed.
Click to expand it.
srcF/sfx_run.f90
+
30
−
40
View file @
34d1cad2
module
sfx_run
!< @brief sfx driver
! directives list
! --------------------------------------------------------------------------------
...
...
@@ -14,7 +15,7 @@ module sfx_run
contains
!> @brief
main
run sfx on dataset
subroutine
!> @brief run sfx on dataset
! ----------------------------------------------------------------------------
subroutine
run_dataset
(
filename_out
,
dataset
,
model
)
...
...
@@ -40,11 +41,6 @@ contains
numericsType_sheba
=>
numericsType
! --------------------------------------------------------------------------------
! directives list
! --------------------------------------------------------------------------------
implicit
none
! --------------------------------------------------------------------------------
character
(
len
=*
),
intent
(
in
)
::
filename_out
type
(
sfxDatasetType
),
intent
(
in
)
::
dataset
integer
,
intent
(
in
)
::
model
...
...
@@ -70,19 +66,19 @@ contains
integer
::
io
,
status
! --------------------------------------------------------------------------------
write
(
*
,
*
)
' Running SFX:'
write
(
*
,
'(a,a)'
)
' model = '
,
trim
(
get_model_tag
(
model
))
write
(
*
,
'(a,a)'
)
' dataset = '
,
trim
(
get_dataset_tag
(
dataset
%
id
))
write
(
*
,
'(a,a)'
)
' filename[IN] = '
,
trim
(
dataset
%
filename
)
write
(
*
,
'(a,a)'
)
' filename[OUT] = '
,
trim
(
filename_out
)
write
(
*
,
'(a,
g0)'
)
' surface type = '
,
dataset
%
surface_type
write
(
*
,
'(a,
g0)'
)
' h = '
,
dataset
%
h
write
(
*
,
'(a,
g0)'
)
' z0(m) = '
,
dataset
%
z0_m
write
(
*
,
'(a,
g0)'
)
' z0(h) = '
,
dataset
%
z0_h
write
(
*
,
'(a,a)'
)
' model
= '
,
trim
(
get_model_tag
(
model
))
write
(
*
,
'(a,a)'
)
' dataset
= '
,
trim
(
get_dataset_tag
(
dataset
%
id
))
write
(
*
,
'(a,a)'
)
' filename[IN]
= '
,
trim
(
dataset
%
filename
)
write
(
*
,
'(a,a)'
)
' filename[OUT]
= '
,
trim
(
filename_out
)
write
(
*
,
'(a,g0)'
)
' surface type
= '
,
dataset
%
surface_type
write
(
*
,
'(a,g0)'
)
' h
= '
,
dataset
%
h
write
(
*
,
'(a,g0)'
)
' z0(m)
= '
,
dataset
%
z0_m
write
(
*
,
'(a,g0)'
)
' z0(h)
= '
,
dataset
%
z0_h
!
< @brief
define number of
c
el
l
s
!
---
define number of el
ement
s
open
(
newunit
=
io
,
file
=
dataset
%
filename
,
iostat
=
status
,
status
=
'old'
)
if
(
status
/
=
0
)
then
write
(
*
,
*
)
' FAILURE! > unable to open file: '
,
trim
(
dataset
%
filename
)
...
...
@@ -100,23 +96,23 @@ contains
close
(
io
)
! --- print number of elements in dataset
write
(
*
,
'(a,
g0)'
)
' size = '
,
num
write
(
*
,
'(a,g0)'
)
' size
= '
,
num
if
(
dataset
%
nmax
>
0
)
then
write
(
*
,
'(a,
g0)'
)
' nmax = '
,
dataset
%
nmax
write
(
*
,
'(a,g0)'
)
' nmax
= '
,
dataset
%
nmax
num
=
min
(
num
,
dataset
%
nmax
)
end
if
!
< @brief
allocate input & output data
!
---
allocate input & output data
call
allocate_meteo_vec
(
meteo
,
num
)
call
allocate_sfx_vec
(
sfx
,
num
)
!
< @brief
setting height & roughness
!
---
setting height & roughness
meteo_cell
%
h
=
dataset
%
h
meteo_cell
%
z0_m
=
dataset
%
z0_m
!
< @brief
read input data
!
---
read input data
open
(
newunit
=
io
,
file
=
dataset
%
filename
,
iostat
=
status
,
status
=
'old'
)
if
(
status
/
=
0
)
then
write
(
*
,
*
)
' FAILURE! > unable to open file: '
,
trim
(
dataset
%
filename
)
...
...
@@ -135,7 +131,7 @@ contains
close
(
io
)
!
< @brief
calling flux module
!
---
calling flux module
if
(
model
==
model_esm
)
then
call
get_surface_fluxes_vec_esm
(
sfx
,
meteo
,
numerics_esm
,
num
)
else
if
(
model
==
model_log
)
then
...
...
@@ -147,7 +143,7 @@ contains
end
if
!
< @brief
write output data
!
---
write output data
call
write_ascii_vec11
(
filename_out
,
&
sfx
%
zeta
,
sfx
%
Rib
,
&
sfx
%
Re
,
sfx
%
B
,
sfx
%
z0_m
,
sfx
%
z0_t
,
&
...
...
@@ -155,32 +151,27 @@ contains
sfx
%
Cm
,
sfx
%
Ct
,
sfx
%
Km
,
sfx
%
Pr_t_inv
,
num
,
'(11(f10.4,3x))'
,
status
)
!
< @brief
deallocate input & output data
!
---
deallocate input & output data
call
deallocate_meteo_vec
(
meteo
)
call
deallocate_sfx_vec
(
sfx
)
end
subroutine
!> @brief
main
set
up
sfx
&
dataset
subroutine
!> @brief set sfx
run on
dataset
! ----------------------------------------------------------------------------
subroutine
set_run
(
filename_out
,
dataset
,
model
)
! modules used
! --------------------------------------------------------------------------------
#ifdef USE_CONFIG_PARSER
use
config_parser
use
iso_c_binding
,
only
:
C_NULL_CHAR
use
config_parser
#endif
use
sfx_common
use
sfx_config
! --------------------------------------------------------------------------------
! directives list
! --------------------------------------------------------------------------------
implicit
none
! --------------------------------------------------------------------------------
character
(
len
=
:),
allocatable
,
intent
(
out
)
::
filename_out
type
(
sfxDatasetType
),
intent
(
out
)
::
dataset
integer
,
intent
(
out
)
::
model
...
...
@@ -202,22 +193,21 @@ contains
! local variables
! --------------------------------------------------------------------------------
integer
::
i
integer
::
status
integer
::
i
,
status
integer
::
id
,
nmax
#ifdef USE_CONFIG_PARSER
character
,
allocatable
::
config_field
(:)
#endif
! --------------------------------------------------------------------------------
! --- default model & dataset
model
=
model_esm
! default = ESM
call
set_dataset
(
dataset
,
dataset_mosaic
)
! default = MOSAiC
is_output_set
=
0
! default = auto define output filename
!< define default model & dataset
model
=
model_esm
!< default = ESM
call
set_dataset
(
dataset
,
dataset_mosaic
)
!< default = MOSAiC
is_output_set
=
0
!< default = auto define output filename
!< command line arguments processing
! --- command line arguments processing
num_args
=
command_argument_count
()
do
i
=
1
,
num_args
call
get_command_argument
(
i
,
arg
)
...
...
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