From f76273d9470176445f4a6bf458832d9623ffacaa 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: Tue, 3 Dec 2024 17:50:23 +0300
Subject: [PATCH] changes in z0t_re

---
 srcF/sfx_config.f90          |  4 ++--
 srcF/sfx_surface.f90         |  2 +-
 srcF/sfx_z0m_all_surface.f90 |  2 +-
 srcF/sfx_z0t_all_surface.f90 | 19 +++++++++++++------
 4 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/srcF/sfx_config.f90 b/srcF/sfx_config.f90
index b679e59..3700639 100644
--- a/srcF/sfx_config.f90
+++ b/srcF/sfx_config.f90
@@ -167,8 +167,8 @@ contains
         dataset%filename = get_dataset_filename(id)
         dataset%nmax = 0
 
-        dataset%surface = surface_land
-        dataset%surface_type = surface_land
+        dataset%surface = surface_lake
+        dataset%surface_type = surface_lake
         dataset%z0_h = -1.0
         dataset%lai = 1.0
         dataset%depth = 10.0
diff --git a/srcF/sfx_surface.f90 b/srcF/sfx_surface.f90
index b20c202..ced62f4 100644
--- a/srcF/sfx_surface.f90
+++ b/srcF/sfx_surface.f90
@@ -98,7 +98,7 @@ module sfx_surface
 
     integer, public, parameter :: ocean_z0t_id = z0t_kl_water     !< ocean surface
     integer, public, parameter :: land_z0t_id = z0t_kl_land        !< land surface
-    integer, public, parameter :: lake_z0t_id = z0t_re        !< lake surface
+    integer, public, parameter :: lake_z0t_id = z0t_br        !< lake surface
     integer, public, parameter :: snow_z0t_id = z0t_kl_land         !< snow covered surface    
     integer, public, parameter :: forest_z0t_id = z0t_du      !< forest csurface  
     integer, public, parameter :: usersf_z0t_id = z0t_mix       !< user surface  
diff --git a/srcF/sfx_z0m_all_surface.f90 b/srcF/sfx_z0m_all_surface.f90
index e0a224b..4d6f2ed 100644
--- a/srcF/sfx_z0m_all_surface.f90
+++ b/srcF/sfx_z0m_all_surface.f90
@@ -200,7 +200,7 @@ subroutine get_dynamic_roughness_map(z0_m, u_dyn0, U, h, z0m_map)
         z0_m=z0m_map  
         h0_m = h / z0_m
         u_dyn0 = U * kappa / log(h0_m)
-        write(*,*) z0_m, 'map'
+        
         end subroutine
      ! --------------------------------------------------------------------------------
 
diff --git a/srcF/sfx_z0t_all_surface.f90 b/srcF/sfx_z0t_all_surface.f90
index 9ab7ecc..72fc052 100644
--- a/srcF/sfx_z0t_all_surface.f90
+++ b/srcF/sfx_z0t_all_surface.f90
@@ -266,19 +266,26 @@ module sfx_z0t_all_surface
 
         real, intent(in) :: z0_m                !< aerodynamic roughness [m]
         real, intent(in) :: Re                  !< roughness Reynolds number [n/d]
-       
-       
+         
+        real Re1, Re_min
+        
+        Re_min =0.75
       
+        Re1=max(Re, Re_min)
        
         
-        z0_t = z0_m*(-0.56*(4.0*(Re)**(0.5)-3.4))
-
+        z0_t = z0_m*(-0.56*(4.0*(Re1)**(0.5)-3.4))
+        if (z0_t<0)  z0_t = z0_m*0.9
+        if (z0_m>z0_t) then
         B=alog(z0_m/z0_t) 
-       
+        else
+        z0_t = z0_m*0.9 
+        B=alog(z0_m/z0_t)   
+        end if
 
        ! --- define roughness [thermal]
         !z0_t = z0_m / exp(B)   
-        !write(*,*)  z0_t, B, Re, 're'
+        !write(*,*)  z0_m, z0_t, B, Re1, 're'
     end subroutine
  
 
-- 
GitLab