diff --git a/srcF/sfx_config.f90 b/srcF/sfx_config.f90 index 5933c53d6ea1b2c617e49b32a774c73b8c30df5c..99f7b22e57e362426e34c9f20a0275bc9ddef4cb 100644 --- a/srcF/sfx_config.f90 +++ b/srcF/sfx_config.f90 @@ -17,8 +17,8 @@ module sfx_config !> @brief model enum def. integer, parameter :: model_esm = 0 !< ESM model integer, parameter :: model_log = 1 !< LOG simplified model - integer, parameter :: model_most = 2 !< MOST simplified model - integer, parameter :: model_sheba = 3 !< SHEBA simplified model + integer, parameter :: model_most = 2 !< MOST model + integer, parameter :: model_sheba = 3 !< SHEBA model character(len = 16), parameter :: model_esm_tag = 'esm' character(len = 16), parameter :: model_log_tag = 'log' @@ -47,7 +47,7 @@ module sfx_config character(len = 256) :: filename integer :: nmax - integer :: surface_type + integer :: surface real :: h, z0_m, z0_h end type @@ -139,6 +139,7 @@ contains end function subroutine set_dataset(dataset, id) + use sfx_surface implicit none type(sfxDatasetType), intent(out) :: dataset integer, intent(in) :: id @@ -151,8 +152,8 @@ contains dataset%id = id dataset%filename = get_dataset_filename(id) dataset%nmax = 0 - ! *: temporary surface type & z0(h) def. - dataset%surface_type = 1 + + dataset%surface = surface_land dataset%z0_h = -1.0 if (id == dataset_mosaic) then @@ -167,13 +168,16 @@ contains else if (id == dataset_lake) then ! *: check & fix values dataset%h = 10.0 + dataset%surface = surface_lake dataset%z0_m = -1.0 else if (id == dataset_papa) then dataset%h = 10.0 + dataset%surface = surface_ocean dataset%z0_m = -1.0 else if (id == dataset_toga) then ! *: check & fix values dataset%h = 15.0 + dataset%surface = surface_ocean dataset%z0_m = -1.0 end if diff --git a/srcF/sfx_main.f90 b/srcF/sfx_main.f90 index ac25fec22bee96d6c13ca7db58ec6d93dd1d7938..266de8c4a91f81323fe23fcb615457f5a07a9913 100644 --- a/srcF/sfx_main.f90 +++ b/srcF/sfx_main.f90 @@ -12,7 +12,6 @@ program sfx_main implicit none ! -------------------------------------------------------------------------------- - type(sfxDatasetType) :: dataset integer :: model diff --git a/srcF/sfx_run.f90 b/srcF/sfx_run.f90 index a05706bb48f49a7c4ab8b0928fd7bab509d0cc04..531a77bfea6e8f27a28b51b8cbb68d4194a9273f 100644 --- a/srcF/sfx_run.f90 +++ b/srcF/sfx_run.f90 @@ -65,14 +65,14 @@ contains integer :: i 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)') ' surface type = ', dataset%surface write(*, '(a,g0)') ' h = ', dataset%h write(*, '(a,g0)') ' z0(m) = ', dataset%z0_m write(*, '(a,g0)') ' z0(h) = ', dataset%z0_h diff --git a/srcF/sfx_surface.f90 b/srcF/sfx_surface.f90 index 0d8d2cc7278d323ac0266ec691fef3c09c2e7cee..d5e369902c2992bfec5620cf08e1e4ea95637fb9 100644 --- a/srcF/sfx_surface.f90 +++ b/srcF/sfx_surface.f90 @@ -24,6 +24,12 @@ module sfx_surface integer, public, parameter :: surface_ocean = 0 !< ocean surface integer, public, parameter :: surface_land = 1 !< land surface integer, public, parameter :: surface_lake = 2 !< lake surface + integer, public, parameter :: surface_snow = 3 !< snow covered surface + + character(len = 16), parameter :: surface_ocean_tag = 'ocean' + character(len = 16), parameter :: surface_land_tag = 'land' + character(len = 16), parameter :: surface_lake_tag = 'lake' + character(len = 16), parameter :: surface_snow_tag = 'snow' ! -------------------------------------------------------------------------------- real, parameter, private :: kappa = 0.40 !< von Karman constant [n/d] @@ -60,6 +66,44 @@ module sfx_surface contains + ! surface type definition + ! -------------------------------------------------------------------------------- + function get_surface_id(tag) result(id) + implicit none + character(len=*), intent(in) :: tag + integer :: id + + id = - 1 + if (trim(tag) == trim(surface_ocean_tag)) then + id = surface_ocean + else if (trim(tag) == trim(surface_land_tag)) then + id = surface_land + else if (trim(tag) == trim(surface_lake_tag)) then + id = surface_lake + else if (trim(tag) == trim(surface_snow_tag)) then + id = surface_snow + end if + + end function + + function get_surface_tag(id) result(tag) + implicit none + integer :: id + character(len=:), allocatable :: tag + + tag = 'undefined' + if (id == surface_ocean) then + tag = surface_ocean_tag + else if (id == surface_land) then + tag = surface_land_tag + else if (id == surface_lake) then + tag = surface_lake_tag + else if (id == surface_snow) then + tag = surface_snow_tag + end if + + end function + ! charnock roughness definition ! -------------------------------------------------------------------------------- subroutine get_charnock_roughness(z0_m, u_dyn0, U, h, maxiters)