Skip to content
Snippets Groups Projects
Commit ad58b9da authored by Evgeny Mortikov's avatar Evgeny Mortikov
Browse files

model setup and run update

parent 6fc11e10
No related branches found
No related tags found
No related merge requests found
......@@ -55,23 +55,14 @@ subroutine run_dataset(filename_out, dataset, model)
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(*, *) ' model = ', trim(get_model_tag(model))
write(*, *) ' dataset = ', trim(get_dataset_tag(dataset%id))
write(*, *) ' filename[IN] = ', trim(dataset%filename)
write(*, *) ' filename[OUT] = ', trim(filename_out)
write(*, *) ' surface type = ', dataset%surface_type
write(*, *) ' h = ', dataset%h
write(*, *) ' z0(m) = ', dataset%z0_m
write(*, *) ' 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 cells
......@@ -190,6 +181,7 @@ program sfx_main
character(len = 128), parameter :: arg_key_output = '--output'
character(len = 128), parameter :: arg_key_nmax = '--nmax'
character(len = 128), parameter :: arg_key_help = '--help'
character(len = 128), parameter :: arg_key_config = "--config"
integer :: is_output_set
! --------------------------------------------------------------------------------
......@@ -198,7 +190,7 @@ program sfx_main
! --------------------------------------------------------------------------------
integer :: i
integer :: status
integer :: id
integer :: id, nmax
! --------------------------------------------------------------------------------
#ifdef USE_CONFIG_PARSER
......@@ -227,6 +219,8 @@ program sfx_main
write(*, *) ' param = [h] [z0(m)] [z0(h)]'
write(*, *) ' --output [filename]'
write(*, *) ' set output filename'
write(*, *) ' --config [filename]'
write(*, *) ' use configuration file'
write(*, *) ' --nmax [value]'
write(*, *) ' max number of data points > 0'
stop
......@@ -255,7 +249,10 @@ program sfx_main
write(*, *) ' FAILURE! > unknown dataset [key]: ', trim(arg)
stop
end if
!< save nmax if previously set
nmax = dataset%nmax
call set_dataset(dataset, id)
dataset%nmax = nmax
if (dataset%id == dataset_user) then
!< @brief user-defined dataset
......@@ -264,10 +261,10 @@ program sfx_main
stop
end if
!< @brief filename
!< filename
call get_command_argument(i + 2, dataset%filename)
!< @brief reading 'h'
!< reading 'h'
call get_command_argument(i + 3, arg)
call str2real(dataset%h, arg, status)
if (status /= 0) then
......@@ -279,7 +276,7 @@ program sfx_main
stop
end if
!< @brief reading 'z0(m)'
!< reading 'z0(m)'
call get_command_argument(i + 4, arg)
call str2real(dataset%z0_m, arg, status)
if (status /= 0) then
......@@ -287,7 +284,7 @@ program sfx_main
stop
end if
!< @brief reading 'z0(h)'
!< reading 'z0(h)'
call get_command_argument(i + 5, arg)
call str2real(dataset%z0_h, arg, status)
if (status /= 0) then
......@@ -318,11 +315,15 @@ program sfx_main
write(*, *) ' FAILURE! > nmax [value] should be positive'
stop
end if
else if (trim(arg) == trim(arg_key_config)) then
if (i == num_args) then
write(*, *) ' FAILURE! > missing configuration file [key] argument'
stop
end if
end do
call get_command_argument(i + 1, arg)
#ifdef USE_CONFIG_PARSER
call run("config.txt"//C_NULL_CHAR)
call run(trim(arg)//C_NULL_CHAR)
call is_varname("model.id"//C_NULL_CHAR, status)
if (status /= 0) then
......@@ -367,21 +368,16 @@ program sfx_main
is_output_set = 1
end if
deallocate(config_field)
if (allocated(config_field)) deallocate(config_field)
#endif
end if
end do
!< @bried set auto-defined output filename
if (is_output_set == 0) then
filename_out = 'output-' // trim(get_dataset_tag(dataset%id)) // '.txt'
end if
open(32, file = "data/MOSAiC_zh.txt", iostat = status, status = 'old')
if (status /= 0) then
stop
end if
read(32, *) dataset%h, dataset%z0_m
close(32)
!< @brief running main driver
call run_dataset(filename_out, dataset, model)
stop
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment