From 563f198b3bbd5c1fbe7f08f56cc64f21aff58cc2 Mon Sep 17 00:00:00 2001
From: Evgeny Mortikov <evgeny.mortikov@gmail.com>
Date: Mon, 18 Dec 2023 03:42:27 +0300
Subject: [PATCH] minor code update

---
 srcF/sfx_data.f90 | 27 +++++++++++++++++++++++++++
 srcF/sfx_esm.f90  | 25 +------------------------
 srcF/sfx_log.f90  | 25 +------------------------
 3 files changed, 29 insertions(+), 48 deletions(-)

diff --git a/srcF/sfx_data.f90 b/srcF/sfx_data.f90
index 7ab691c..5e252d7 100644
--- a/srcF/sfx_data.f90
+++ b/srcF/sfx_data.f90
@@ -17,6 +17,7 @@ module sfx_data
 
     ! public interface
     ! --------------------------------------------------------------------------------
+    public :: push_sfx_data
     ! --------------------------------------------------------------------------------
 
     ! --------------------------------------------------------------------------------
@@ -79,4 +80,30 @@ module sfx_data
     end type
     ! --------------------------------------------------------------------------------
 
+contains
+
+    ! --------------------------------------------------------------------------------
+    subroutine push_sfx_data(sfx, sfx_cell, idx)
+        !> @brief helper subroutine for copying data in sfxDataVecType
+        ! ----------------------------------------------------------------------------
+        type (sfxDataVecType), intent(inout) :: sfx
+        type (sfxDataType), intent(in) :: sfx_cell
+        integer, intent(in) :: idx
+        ! ----------------------------------------------------------------------------
+
+        sfx%zeta(idx) = sfx_cell%zeta
+        sfx%Rib(idx) = sfx_cell%Rib
+        sfx%Re(idx) = sfx_cell%Re
+        sfx%B(idx) = sfx_cell%B
+        sfx%z0_m(idx) = sfx_cell%z0_m
+        sfx%z0_t(idx) = sfx_cell%z0_t
+        sfx%Rib_conv_lim(idx) = sfx_cell%Rib_conv_lim
+        sfx%Cm(idx) = sfx_cell%Cm
+        sfx%Ct(idx) = sfx_cell%Ct
+        sfx%Km(idx) = sfx_cell%Km
+        sfx%Pr_t_inv(idx) = sfx_cell%Pr_t_inv
+
+    end subroutine push_sfx_data
+    ! --------------------------------------------------------------------------------
+
 end module sfx_data
\ No newline at end of file
diff --git a/srcF/sfx_esm.f90 b/srcF/sfx_esm.f90
index 9dbe10c..dd38ce4 100644
--- a/srcF/sfx_esm.f90
+++ b/srcF/sfx_esm.f90
@@ -69,30 +69,6 @@ contains
     end subroutine get_surface_fluxes_vec
     ! --------------------------------------------------------------------------------
 
-    ! --------------------------------------------------------------------------------
-    subroutine push_sfx_data(sfx, sfx_cell, idx)
-        !> @brief helper subroutine for copying data in sfxDataVecType
-        ! ----------------------------------------------------------------------------
-        type (sfxDataVecType), intent(inout) :: sfx
-        type (sfxDataType), intent(in) :: sfx_cell
-        integer, intent(in) :: idx
-        ! ----------------------------------------------------------------------------
-
-        sfx%zeta(idx) = sfx_cell%zeta
-        sfx%Rib(idx) = sfx_cell%Rib
-        sfx%Re(idx) = sfx_cell%Re
-        sfx%B(idx) = sfx_cell%B
-        sfx%z0_m(idx) = sfx_cell%z0_m
-        sfx%z0_t(idx) = sfx_cell%z0_t
-        sfx%Rib_conv_lim(idx) = sfx_cell%Rib_conv_lim
-        sfx%Cm(idx) = sfx_cell%Cm
-        sfx%Ct(idx) = sfx_cell%Ct
-        sfx%Km(idx) = sfx_cell%Km
-        sfx%Pr_t_inv(idx) = sfx_cell%Pr_t_inv
-
-    end subroutine push_sfx_data
-    ! --------------------------------------------------------------------------------
-
     ! --------------------------------------------------------------------------------
     subroutine get_surface_fluxes(sfx, meteo, numerics)
         !> @brief surface flux calculation for single cell
@@ -263,6 +239,7 @@ contains
             phi_m = (1.0 - alpha_m * zeta)**(-0.25)
             phi_h = 1.0 / (Pr_t_0_inv * sqrt(1.0 - alpha_h_fix * zeta))
         end if
+        ! ----------------------------------------------------------------------------
 
         ! --- define transfer coeff. (momentum) & (heat)
         Cm = kappa / psi_m
diff --git a/srcF/sfx_log.f90 b/srcF/sfx_log.f90
index 1781544..225eb37 100644
--- a/srcF/sfx_log.f90
+++ b/srcF/sfx_log.f90
@@ -65,30 +65,6 @@ contains
     end subroutine get_surface_fluxes_vec
     ! --------------------------------------------------------------------------------
 
-    ! --------------------------------------------------------------------------------
-    subroutine push_sfx_data(sfx, sfx_cell, idx)
-        !> @brief helper subroutine for copying data in sfxDataVecType
-        ! ----------------------------------------------------------------------------
-        type (sfxDataVecType), intent(inout) :: sfx
-        type (sfxDataType), intent(in) :: sfx_cell
-        integer, intent(in) :: idx
-        ! ----------------------------------------------------------------------------
-
-        sfx%zeta(idx) = sfx_cell%zeta
-        sfx%Rib(idx) = sfx_cell%Rib
-        sfx%Re(idx) = sfx_cell%Re
-        sfx%B(idx) = sfx_cell%B
-        sfx%z0_m(idx) = sfx_cell%z0_m
-        sfx%z0_t(idx) = sfx_cell%z0_t
-        sfx%Rib_conv_lim(idx) = sfx_cell%Rib_conv_lim
-        sfx%Cm(idx) = sfx_cell%Cm
-        sfx%Ct(idx) = sfx_cell%Ct
-        sfx%Km(idx) = sfx_cell%Km
-        sfx%Pr_t_inv(idx) = sfx_cell%Pr_t_inv
-
-    end subroutine push_sfx_data
-    ! --------------------------------------------------------------------------------
-
     ! --------------------------------------------------------------------------------
     subroutine get_surface_fluxes(sfx, meteo, numerics)
         !> @brief surface flux calculation for single cell
@@ -212,6 +188,7 @@ contains
         ! --- get the fluxes
         ! ----------------------------------------------------------------------------
         call get_psi_neutral(psi_m, psi_h, zeta, h0_m, h0_t, B)
+        ! ----------------------------------------------------------------------------
 
         phi_m = 1.0
         phi_h = 1.0 / Pr_t_0_inv
-- 
GitLab