Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
ocean-mixing
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
ocean-mixing
Commits
0ddc8885
Commit
0ddc8885
authored
7 months ago
by
Evgeny Mortikov
Browse files
Options
Downloads
Patches
Plain Diff
minor setup update
parent
c4824763
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
obl_config.f90
+55
-49
55 additions, 49 deletions
obl_config.f90
obl_main.f90
+17
-17
17 additions, 17 deletions
obl_main.f90
with
72 additions
and
66 deletions
obl_config.f90
+
55
−
49
View file @
0ddc8885
...
...
@@ -19,51 +19,53 @@ module obl_config
public
!> @brief setup enum def.
integer
,
parameter
::
setup
_kato
=
0
!< Kato-Phillips setup
integer
,
parameter
::
setup
_papa_fluxes
=
1
!< Papa-station (fluxes) setup
integer
,
parameter
::
setup
_papa_meteo
=
2
!< Papa-station (meteo) setup
integer
,
parameter
::
obl_config
_kato
=
0
!< Kato-Phillips setup
integer
,
parameter
::
obl_config
_papa_fluxes
=
1
!< Papa-station (fluxes) setup
integer
,
parameter
::
obl_config
_papa_meteo
=
2
!< Papa-station (meteo) setup
character
(
len
=
16
),
parameter
::
setup
_kato_tag
=
'kato'
character
(
len
=
16
),
parameter
::
setup
_papa_fluxes_tag
=
'papa-fluxes'
character
(
len
=
16
),
parameter
::
setup
_papa_meteo_tag
=
'papa-meteo'
character
(
len
=
16
),
parameter
::
obl_config
_kato_tag
=
'kato'
character
(
len
=
16
),
parameter
::
obl_config
_papa_fluxes_tag
=
'papa-fluxes'
character
(
len
=
16
),
parameter
::
obl_config
_papa_meteo_tag
=
'papa-meteo'
contains
function
get_setup_id
(
tag
)
result
(
id
)
! --------------------------------------------------------------------------------
function
get_obl_config_id
(
tag
)
result
(
id
)
implicit
none
character
(
len
=*
),
intent
(
in
)
::
tag
integer
::
id
id
=
-
1
if
(
trim
(
tag
)
==
trim
(
setup
_kato_tag
))
then
id
=
setup
_kato
else
if
(
trim
(
tag
)
==
trim
(
setup
_papa_fluxes_tag
))
then
id
=
setup
_papa_fluxes
else
if
(
trim
(
tag
)
==
trim
(
setup
_papa_meteo_tag
))
then
id
=
setup
_papa_meteo
if
(
trim
(
tag
)
==
trim
(
obl_config
_kato_tag
))
then
id
=
obl_config
_kato
else
if
(
trim
(
tag
)
==
trim
(
obl_config
_papa_fluxes_tag
))
then
id
=
obl_config
_papa_fluxes
else
if
(
trim
(
tag
)
==
trim
(
obl_config
_papa_meteo_tag
))
then
id
=
obl_config
_papa_meteo
end
if
end
function
function
get_setup_tag
(
id
)
result
(
tag
)
! --------------------------------------------------------------------------------
function
get_obl_config_tag
(
id
)
result
(
tag
)
implicit
none
integer
::
id
character
(
len
=
:),
allocatable
::
tag
tag
=
'undefined'
if
(
id
==
setup
_kato
)
then
tag
=
setup
_kato_tag
else
if
(
id
==
setup
_papa_fluxes
)
then
tag
=
setup
_papa_fluxes_tag
else
if
(
id
==
setup
_papa_meteo
)
then
tag
=
setup
_papa_meteo_tag
if
(
id
==
obl_config
_kato
)
then
tag
=
obl_config
_kato_tag
else
if
(
id
==
obl_config
_papa_fluxes
)
then
tag
=
obl_config
_papa_fluxes_tag
else
if
(
id
==
obl_config
_papa_meteo
)
then
tag
=
obl_config
_papa_meteo_tag
end
if
end
function
! --------------------------------------------------------------------------------
subroutine
set_grid
(
grid
,
setup
_id
,
ierr
)
subroutine
set_grid
(
grid
,
config
_id
,
ierr
)
!> @brief grid parameters setup
! ----------------------------------------------------------------------------
use
obl_grid
...
...
@@ -72,21 +74,22 @@ contains
use
obl_run_papa_meteo
,
only
:
set_grid_papa_meteo
=>
set_grid
type
(
gridDataType
),
intent
(
inout
)
::
grid
integer
,
intent
(
in
)
::
setup
_id
integer
,
intent
(
in
)
::
config
_id
integer
,
intent
(
out
)
::
ierr
! ----------------------------------------------------------------------------
ierr
=
0
! = OK
if
(
setup_id
==
setup_kato
)
then
!< bultin modes
if
(
config_id
==
obl_config_kato
)
then
call
set_grid_kato
(
grid
)
return
endif
if
(
setup
_id
==
setup
_papa_fluxes
)
then
if
(
config
_id
==
obl_config
_papa_fluxes
)
then
call
set_grid_papa_fluxes
(
grid
)
return
endif
if
(
setup
_id
==
setup
_papa_meteo
)
then
if
(
config
_id
==
obl_config
_papa_meteo
)
then
call
set_grid_papa_meteo
(
grid
)
return
endif
...
...
@@ -113,13 +116,13 @@ contains
call
set_uniform_grid
(
grid
,
-
depth
,
depth
,
cz
)
end
block
#else
!> unable to define without config
!> unable to define without config
uration file
ierr
=
1
#endif
end
subroutine
set_grid
! --------------------------------------------------------------------------------
subroutine
set_time
(
time_begin
,
time_end
,
dt
,
setup
_id
,
ierr
)
subroutine
set_time
(
time_begin
,
time_end
,
dt
,
config
_id
,
ierr
)
!> @brief time parameters setup
! ----------------------------------------------------------------------------
use
obl_run_kato
,
only
:
set_time_kato
=>
set_time
...
...
@@ -127,21 +130,22 @@ contains
use
obl_run_papa_meteo
,
only
:
set_time_papa_meteo
=>
set_time
real
,
intent
(
out
)
::
time_begin
,
time_end
,
dt
integer
,
intent
(
in
)
::
setup
_id
integer
,
intent
(
in
)
::
config
_id
integer
,
intent
(
out
)
::
ierr
! ----------------------------------------------------------------------------
ierr
=
0
! = OK
if
(
setup_id
==
setup_kato
)
then
!< bultin modes
if
(
config_id
==
obl_config_kato
)
then
call
set_time_kato
(
time_begin
,
time_end
,
dt
)
return
endif
if
(
setup
_id
==
setup
_papa_fluxes
)
then
if
(
config
_id
==
obl_config
_papa_fluxes
)
then
call
set_time_papa_fluxes
(
time_begin
,
time_end
,
dt
)
return
endif
if
(
setup
_id
==
setup
_papa_meteo
)
then
if
(
config
_id
==
obl_config
_papa_meteo
)
then
call
set_time_papa_meteo
(
time_begin
,
time_end
,
dt
)
return
endif
...
...
@@ -170,13 +174,13 @@ contains
end
block
#else
!> unable to define without config
!> unable to define without config
uration file
ierr
=
1
#endif
end
subroutine
set_time
! --------------------------------------------------------------------------------
subroutine
set_phys
(
setup
_id
,
ierr
)
subroutine
set_phys
(
config
_id
,
ierr
)
!> @brief phys parameters setup
! ----------------------------------------------------------------------------
use
obl_scm
...
...
@@ -184,21 +188,21 @@ contains
use
obl_run_papa_fluxes
,
only
:
set_phys_papa_fluxes
=>
set_phys
use
obl_run_papa_meteo
,
only
:
set_phys_papa_meteo
=>
set_phys
integer
,
intent
(
in
)
::
setup
_id
integer
,
intent
(
in
)
::
config
_id
integer
,
intent
(
out
)
::
ierr
! ----------------------------------------------------------------------------
ierr
=
0
! = OK
if
(
setup
_id
==
setup
_kato
)
then
if
(
config
_id
==
obl_config
_kato
)
then
call
set_phys_kato
return
endif
if
(
setup
_id
==
setup
_papa_fluxes
)
then
if
(
config
_id
==
obl_config
_papa_fluxes
)
then
call
set_phys_papa_fluxes
return
endif
if
(
setup
_id
==
setup
_papa_meteo
)
then
if
(
config
_id
==
obl_config
_papa_meteo
)
then
call
set_phys_papa_meteo
return
endif
...
...
@@ -239,41 +243,41 @@ contains
end
block
#else
!> unable to define without config
!> unable to define without config
uration file
ierr
=
1
#endif
end
subroutine
set_phys
! --------------------------------------------------------------------------------
subroutine
set_forcing
(
setup
_id
,
ierr
)
subroutine
set_forcing
(
config
_id
,
ierr
)
!> @brief phys parameters setup
! ----------------------------------------------------------------------------
use
obl_fluxes
use
obl_tforcing
use
obl_math
!< using char_array2str()
use
obl_run_kato
,
only
:
set_forcing_kato
=>
set_forcing
use
obl_run_papa_fluxes
,
only
:
set_forcing_papa_fluxes
=>
set_forcing
use
obl_run_papa_meteo
,
only
:
set_forcing_papa_meteo
=>
set_forcing
integer
,
intent
(
in
)
::
setup
_id
integer
,
intent
(
in
)
::
config
_id
integer
,
intent
(
out
)
::
ierr
! ----------------------------------------------------------------------------
ierr
=
0
! = OK
if
(
setup
_id
==
setup
_kato
)
then
if
(
config
_id
==
obl_config
_kato
)
then
call
set_forcing_kato
return
endif
if
(
setup
_id
==
setup
_papa_fluxes
)
then
if
(
config
_id
==
obl_config
_papa_fluxes
)
then
call
set_forcing_papa_fluxes
return
endif
if
(
setup
_id
==
setup
_papa_meteo
)
then
if
(
config
_id
==
obl_config
_papa_meteo
)
then
call
set_forcing_papa_meteo
return
endif
!< assuming that forcing def. is optional
block
call
set_config_tforcing
(
tau_x_surf
,
"atm.tau_x"
,
ierr
)
if
(
ierr
/
=
0
)
return
...
...
@@ -346,7 +350,7 @@ contains
end
subroutine
set_forcing
! --------------------------------------------------------------------------------
subroutine
set_initial_conditions
(
grid
,
setup
_id
,
ierr
)
subroutine
set_initial_conditions
(
grid
,
config
_id
,
ierr
)
!> @brief initial conditions setup
! ----------------------------------------------------------------------------
use
obl_state
...
...
@@ -358,26 +362,28 @@ contains
type
(
gridDataType
),
intent
(
in
)
::
grid
integer
,
intent
(
in
)
::
setup
_id
integer
,
intent
(
in
)
::
config
_id
integer
,
intent
(
out
)
::
ierr
! ----------------------------------------------------------------------------
ierr
=
0
! = OK
if
(
setup
_id
==
setup
_kato
)
then
if
(
config
_id
==
obl_config
_kato
)
then
call
set_initial_conditions_kato
(
grid
)
return
endif
if
(
setup
_id
==
setup
_papa_fluxes
)
then
if
(
config
_id
==
obl_config
_papa_fluxes
)
then
call
set_initial_conditions_papa_fluxes
(
grid
)
return
endif
if
(
setup
_id
==
setup
_papa_meteo
)
then
if
(
config
_id
==
obl_config
_papa_meteo
)
then
call
set_initial_conditions_papa_meteo
(
grid
)
return
endif
block
!< *: will fail without configuration file
call
set_config_profile
(
Theta
,
"initial_conditions.Theta"
,
grid
,
ierr
)
if
(
ierr
/
=
0
)
then
return
...
...
This diff is collapsed.
Click to expand it.
obl_main.f90
+
17
−
17
View file @
0ddc8885
...
...
@@ -45,10 +45,10 @@ program obl_main
! model data
! --------------------------------------------------------------------------------
integer
::
obl_
setup
! --- OBL builtin
setup
! = setup
_kato: Kato-Phillips
! = setup
_papa_fluxes: Papa-station (fluxes)
! = setup
_papa_meteo: Papa-station (meteo)
integer
::
obl_
config_id
! --- OBL builtin
configs
! = obl_config
_kato: Kato-Phillips
! = obl_config
_papa_fluxes: Papa-station (fluxes)
! = obl_config
_papa_meteo: Papa-station (meteo)
integer
::
closure_mode
! --- OBL closure def.
! = 1 - pacanowski-philander
...
...
@@ -105,12 +105,12 @@ program obl_main
! --------------------------------------------------------------------------------
!< default
setup = setup
_kato (Kato-Phiilps)
!< default
config = obl_config
_kato (Kato-Phiilps)
!< possible values:
!<
setup
_kato
!<
setup
_papa_fluxes
!<
setup
_papa_meteo
obl_
setup
=
setup
_kato
!<
obl_config
_kato
!<
obl_config
_papa_fluxes
!<
obl_config
_papa_meteo
obl_
config_id
=
obl_config
_kato
!< default closure = 4, k-epsilon (implicit)
!< poissible values:
...
...
@@ -150,8 +150,8 @@ program obl_main
end
if
call
get_command_argument
(
i
+
1
,
arg
)
obl_
setup
=
get_setup
_id
(
arg
)
if
(
obl_
setup
==
-1
)
then
obl_
config_id
=
get_obl_config
_id
(
arg
)
if
(
obl_
config_id
==
-1
)
then
#ifdef USE_CONFIG_PARSER
!< try reading configuration file
call
c_config_run
(
trim
(
arg
)//
C_NULL_CHAR
,
status
)
...
...
@@ -162,7 +162,7 @@ program obl_main
end
if
!< forcing configuration file setup
obl_
setup
=
999
obl_
config_id
=
999
#else
write
(
*
,
*
)
' FAILURE! > unknown config [key]: '
,
trim
(
arg
)
ierr
=
1
! signal ERROR
...
...
@@ -174,7 +174,7 @@ program obl_main
!< setting grid
! ----------------------------------------------------------------------------
call
set_grid
(
grid
,
obl_
setup
,
ierr
)
call
set_grid
(
grid
,
obl_
config_id
,
ierr
)
if
(
ierr
/
=
0
)
then
write
(
*
,
*
)
' FAILURE! > unable to set grid '
return
...
...
@@ -186,7 +186,7 @@ program obl_main
!< setting model time
! ----------------------------------------------------------------------------
call
set_time
(
time_begin
,
time_end
,
dt
,
obl_
setup
,
ierr
)
call
set_time
(
time_begin
,
time_end
,
dt
,
obl_
config_id
,
ierr
)
if
(
ierr
/
=
0
)
then
write
(
*
,
*
)
' FAILURE! > unable to set time '
return
...
...
@@ -207,7 +207,7 @@ program obl_main
!< setting phys
! ----------------------------------------------------------------------------
call
set_phys
(
obl_
setup
,
ierr
)
call
set_phys
(
obl_
config_id
,
ierr
)
if
(
ierr
/
=
0
)
then
write
(
*
,
*
)
' FAILURE! > unable to set phys parameters '
return
...
...
@@ -216,7 +216,7 @@ program obl_main
!< setting forcing
! ----------------------------------------------------------------------------
call
set_forcing
(
obl_
setup
,
ierr
)
call
set_forcing
(
obl_
config_id
,
ierr
)
if
(
ierr
/
=
0
)
then
write
(
*
,
*
)
' FAILURE! > unable to set forcing '
return
...
...
@@ -225,7 +225,7 @@ program obl_main
!< initialization of main fields
! ----------------------------------------------------------------------------
call
set_initial_conditions
(
grid
,
obl_
setup
,
ierr
)
call
set_initial_conditions
(
grid
,
obl_
config_id
,
ierr
)
if
(
ierr
/
=
0
)
then
write
(
*
,
*
)
' FAILURE! > unable to set initial conditions '
return
...
...
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