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

model setup update

parent 8ce1f52b
No related branches found
No related tags found
No related merge requests found
...@@ -3,3 +3,4 @@ ...@@ -3,3 +3,4 @@
!#define SFX_FORCE_DEPRECATED_ESM_CODE !#define SFX_FORCE_DEPRECATED_ESM_CODE
!#define SFX_CHECK_NAN !#define SFX_CHECK_NAN
!#define USE_CONFIG_PARSER !#define USE_CONFIG_PARSER
#define DATASET_DIR "data/"
#include "../includeF/sfx_def.fi"
!> @brief surface flux model config subroutines !> @brief surface flux model config subroutines
module sfx_config module sfx_config
...@@ -40,6 +42,7 @@ module sfx_config ...@@ -40,6 +42,7 @@ module sfx_config
character(len = 16), parameter :: dataset_toga_tag = 'toga' character(len = 16), parameter :: dataset_toga_tag = 'toga'
character(len = 16), parameter :: dataset_user_tag = 'user' character(len = 16), parameter :: dataset_user_tag = 'user'
contains contains
function get_model_id(tag) result(id) function get_model_id(tag) result(id)
...@@ -56,7 +59,7 @@ contains ...@@ -56,7 +59,7 @@ contains
id = model_most id = model_most
else if (trim(tag) == trim(model_sheba_tag)) then else if (trim(tag) == trim(model_sheba_tag)) then
id = model_sheba id = model_sheba
endif end if
end function end function
...@@ -65,7 +68,7 @@ contains ...@@ -65,7 +68,7 @@ contains
integer :: id integer :: id
character(len=:), allocatable :: tag character(len=:), allocatable :: tag
tag = "undefined" tag = 'undefined'
if (id == model_esm) then if (id == model_esm) then
tag = model_esm_tag tag = model_esm_tag
else if (id == model_log) then else if (id == model_log) then
...@@ -74,7 +77,7 @@ contains ...@@ -74,7 +77,7 @@ contains
tag = model_most_tag tag = model_most_tag
else if (id == model_sheba) then else if (id == model_sheba) then
tag = model_sheba_tag tag = model_sheba_tag
endif end if
end function end function
...@@ -98,7 +101,7 @@ contains ...@@ -98,7 +101,7 @@ contains
id = dataset_toga id = dataset_toga
else if (trim(tag) == trim(dataset_user_tag)) then else if (trim(tag) == trim(dataset_user_tag)) then
id = dataset_user id = dataset_user
endif end if
end function end function
...@@ -107,7 +110,7 @@ contains ...@@ -107,7 +110,7 @@ contains
integer :: id integer :: id
character(len=:), allocatable :: tag character(len=:), allocatable :: tag
tag = "undefined" tag = 'undefined'
if (id == dataset_mosaic) then if (id == dataset_mosaic) then
tag = dataset_mosaic_tag tag = dataset_mosaic_tag
else if (id == dataset_irgason) then else if (id == dataset_irgason) then
...@@ -122,7 +125,51 @@ contains ...@@ -122,7 +125,51 @@ contains
tag = dataset_toga_tag tag = dataset_toga_tag
else if (id == dataset_user) then else if (id == dataset_user) then
tag = dataset_user_tag tag = dataset_user_tag
endif end if
end function
function get_dataset_filename(id) result(filename)
implicit none
integer :: id
character(len=:), allocatable :: filename
filename = ''
if (id == dataset_mosaic) then
filename = DATASET_DIR // 'MOSAiC.txt'
else if (id == dataset_irgason) then
filename = DATASET_DIR // 'Irgason1.txt'
else if (id == dataset_sheba) then
filename = DATASET_DIR // 'Sheba1.txt'
else if (id == dataset_lake) then
filename = DATASET_DIR // 'Kuivajarvi.txt'
else if (id == dataset_papa) then
filename = DATASET_DIR // 'Papa.txt'
else if (id == dataset_toga) then
filename = DATASET_DIR // 'Toga.txt'
end if
end function
function get_dataset_param_filename(id) result(filename)
implicit none
integer :: id
character(len=:), allocatable :: filename
filename = ""
if (id == dataset_mosaic) then
filename = DATASET_DIR // 'MOSAiC_zh.txt'
else if (id == dataset_irgason) then
filename = DATASET_DIR // 'IRGASON_zh.txt'
else if (id == dataset_sheba) then
filename = DATASET_DIR // 'Sheba1_zh.txt'
else if (id == dataset_lake) then
filename = DATASET_DIR // 'Kuivajarvi_zh.txt'
else if (id == dataset_papa) then
filename = DATASET_DIR // 'Papa_zh.txt'
else if (id == dataset_toga) then
filename = DATASET_DIR // 'Toga_zh.txt'
end if
end function end function
......
...@@ -249,32 +249,14 @@ program sfx_main ...@@ -249,32 +249,14 @@ program sfx_main
!< @brief set name & filenames for specific dataset !< @brief set name & filenames for specific dataset
dataset_name = get_dataset_tag(dataset_id) dataset_name = get_dataset_tag(dataset_id)
if (dataset_id == dataset_mosaic) then if (dataset_id /= dataset_user) then
filename_in_common = 'data/MOSAiC_zh.txt' filename_in_common = get_dataset_param_filename(dataset_id)
filename_in = 'data/MOSAiC.txt' filename_in = get_dataset_filename(dataset_id)
else if (dataset_id == dataset_irgason) then end if
filename_in_common = 'data/IRGASON_zh.txt'
filename_in = 'data/Irgason1.txt'
else if (dataset_id == dataset_sheba) then
filename_in_common = 'data/Sheba1_zh.txt'
filename_in = 'data/Sheba1.txt'
else if (dataset_id == dataset_lake) then
filename_in_common = 'data/Kuivajarvi_zh.txt'
filename_in = 'data/Kuivajarvi.txt'
else if (dataset_id == dataset_papa) then
filename_in_common = 'data/Papa_zh.txt'
filename_in = 'data/Papa.txt'
else if (dataset_id == dataset_toga) then
filename_in_common = 'data/Toga_zh.txt'
filename_in = 'data/Toga.txt'
else if (dataset_id == dataset_user) then
! ---> skipping
else
write(*, *) ' FAILURE! > unknown dataset id: ', dataset_id
stop
end if
if (is_output_set == 0) filename_out = 'output-' // trim(dataset_name) // '.txt' if (is_output_set == 0) filename_out = 'output-' // trim(dataset_name) // '.txt'
write(*, *) ' Running SFX model' write(*, *) ' Running SFX model'
write(*, *) ' model = ', trim(model_name) write(*, *) ' model = ', trim(model_name)
write(*, *) ' dataset = ', trim(dataset_name) write(*, *) ' dataset = ', trim(dataset_name)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment