From 3271fd61df8098fe3662a362ed9b3b4cf028d656 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=92=D0=B8=D0=BA=D1=82=D0=BE=D1=80=D0=B8=D1=8F=20=D0=A1?=
 =?UTF-8?q?=D1=83=D1=8F=D0=B7=D0=BE=D0=B2=D0=B0?=
 <viktoriasuazova@MacBook-Pro-Viktoria.local>
Date: Thu, 31 Oct 2024 17:11:57 +0300
Subject: [PATCH] esm for Alexandra

---
 srcF/sfx_config.f90    |  2 +-
 srcF/sfx_esm.f90       |  6 +++++-
 srcF/sfx_most_snow.f90 | 26 ++++----------------------
 3 files changed, 10 insertions(+), 24 deletions(-)

diff --git a/srcF/sfx_config.f90 b/srcF/sfx_config.f90
index b1a84f6..107a029 100644
--- a/srcF/sfx_config.f90
+++ b/srcF/sfx_config.f90
@@ -11,7 +11,7 @@
     ! --------------------------------------------------------------------------------
     implicit none
     ! --------------------------------------------------------------------------------
-    
+    public :: set_dataset
     public
 
     !> @brief model enum def.
diff --git a/srcF/sfx_esm.f90 b/srcF/sfx_esm.f90
index d7732c6..c331669 100644
--- a/srcF/sfx_esm.f90
+++ b/srcF/sfx_esm.f90
@@ -174,6 +174,7 @@ contains
         real :: Tsemi   !< semi-sum of potential temperature at 'h' and at surface [K]
         real :: dQ      !< difference between humidity at 'h' and at surface [g/g]
         real :: z0_m    !< surface aerodynamic roughness (should be < 0 for water bodies surface)
+        real :: z0_map    !< surface aerodynamic roughness (should be < 0 for water bodies surface)
         ! ----------------------------------------------------------------------------
 
         ! --- local variables
@@ -232,6 +233,8 @@ contains
         dQ = meteo%dQ
         h = meteo%h
         z0_m = meteo%z0_m
+        z0_map = meteo%z0_m
+
 
         ! --- define surface type
         if (z0_m < 0.0) then
@@ -242,7 +245,8 @@ contains
 
         if (surface_type == surface_ocean) then
             ! --- define surface roughness [momentum] & dynamic velocity in neutral conditions
-            call get_charnock_roughness(z0_m, u_dyn0, U, h, numerics%maxiters_charnock)
+            !call get_charnock_roughness(z0_m, u_dyn0, U, h, numerics%maxiters_charnock)
+            call get_dynamic_roughness_all(z0_m, u_dyn0, U, depth, h, numerics%maxiters_charnock, z0_map, 1)
             ! --- define relative height
             h0_m = h / z0_m
         endif
diff --git a/srcF/sfx_most_snow.f90 b/srcF/sfx_most_snow.f90
index 06e0026..0599d14 100644
--- a/srcF/sfx_most_snow.f90
+++ b/srcF/sfx_most_snow.f90
@@ -11,6 +11,7 @@ module sfx_most_snow
     use sfx_data
     use sfx_surface
     use sfx_most_snow_param
+    use sfx_config
     ! --------------------------------------------------------------------------------
 
     ! directives list
@@ -159,31 +160,12 @@ contains
         z0_map = meteo%z0_m
 
         
-        call get_dynamic_roughness_definition(surface_type, ocean_z0m_id, land_z0m_id, lake_z0m_id, snow_z0m_id, &
+        call get_dynamic_roughness_definition(1, ocean_z0m_id, land_z0m_id, lake_z0m_id, snow_z0m_id, &
         forest_z0m_id, usersf_z0m_id, z0m_id)
         
         call get_dynamic_roughness_all(z0_m, u_dyn0, U, depth, h, numerics%maxiters_charnock, z0_map, z0m_id)
-        ! --- define surface type
-        if (z0_m < 0.0) then
-            surface_type = surface_ocean
-        else if (z0_m == 0.0) then
-            surface_type = surface_snow
-        else
-            surface_type = surface_land
-        end if
-
-       ! if (surface_type == surface_ocean) then
-       !     ! --- define surface roughness [momentum] & dynamic velocity in neutral conditions
-        !    call get_charnock_roughness(z0_m, u_dyn0, U, h, numerics%maxiters_charnock)
-        !    ! --- define relative height
-        !    h0_m = h / z0_m
-        !endif
-        !if (surface_type == surface_land) then
-        !    ! --- define relative height
-        !    h0_m = h / z0_m
-        !    ! --- define dynamic velocity in neutral conditions
-        !    u_dyn0 = U * kappa / log(h0_m)
-        !end if
+        
+       
        ! --- define relative height
             h0_m = h / z0_m
         ! --- define thermal roughness & B = log(z0_m / z0_h)
-- 
GitLab