From 3f5cd616845327f7db252bb8a333799a899a2eb5 Mon Sep 17 00:00:00 2001 From: Quentin Rodier <quentin.rodier@meteo.fr> Date: Mon, 28 Feb 2022 17:09:44 +0100 Subject: [PATCH] Quentin 28/02/2022: turb directories cleaning (mesonh) --- src/{arome => common}/turb/modd_cturb.F90 | 10 +- src/mesonh/turb/mf_turb.f90 | 332 ------ src/mesonh/turb/mf_turb_greyzone.f90 | 340 ------ src/mesonh/turb/modd_cturb.f90 | 92 -- src/mesonh/turb/modd_turb_cloud.f90 | 58 - .../turb/modd_turb_flux_aircraft_balloon.f90 | 54 - src/mesonh/turb/mode_turb_ver.f90 | 663 ----------- src/mesonh/turb/mode_turb_ver_dyn_flux.f90 | 864 -------------- src/mesonh/turb/mode_turb_ver_sv_corr.f90 | 185 --- src/mesonh/turb/mode_turb_ver_sv_flux.f90 | 446 ------- src/mesonh/turb/mode_turb_ver_thermo_corr.f90 | 862 -------------- src/mesonh/turb/mode_turb_ver_thermo_flux.f90 | 1034 ----------------- src/mesonh/turb/modn_turb.f90 | 47 - src/mesonh/turb/modn_turb_cloud.f90 | 49 - src/mesonh/turb/modn_turbn.f90 | 167 --- src/mesonh/turb/turb_cloud_index.f90 | 344 ------ src/mesonh/turb/turb_hor.f90 | 469 -------- src/mesonh/turb/turb_hor_dyn_corr.f90 | 625 ---------- src/mesonh/turb/turb_hor_splt.f90 | 632 ---------- src/mesonh/turb/turb_hor_sv_corr.f90 | 218 ---- src/mesonh/turb/turb_hor_sv_flux.f90 | 364 ------ src/mesonh/turb/turb_hor_thermo_corr.f90 | 468 -------- src/mesonh/turb/turb_hor_thermo_flux.f90 | 752 ------------ src/mesonh/turb/turb_hor_tke.f90 | 246 ---- src/mesonh/turb/turb_hor_uv.f90 | 355 ------ src/mesonh/turb/turb_hor_uw.f90 | 299 ----- src/mesonh/turb/turb_hor_vw.f90 | 307 ----- 27 files changed, 7 insertions(+), 10275 deletions(-) rename src/{arome => common}/turb/modd_cturb.F90 (90%) delete mode 100644 src/mesonh/turb/mf_turb.f90 delete mode 100644 src/mesonh/turb/mf_turb_greyzone.f90 delete mode 100644 src/mesonh/turb/modd_cturb.f90 delete mode 100644 src/mesonh/turb/modd_turb_cloud.f90 delete mode 100644 src/mesonh/turb/modd_turb_flux_aircraft_balloon.f90 delete mode 100644 src/mesonh/turb/mode_turb_ver.f90 delete mode 100644 src/mesonh/turb/mode_turb_ver_dyn_flux.f90 delete mode 100644 src/mesonh/turb/mode_turb_ver_sv_corr.f90 delete mode 100644 src/mesonh/turb/mode_turb_ver_sv_flux.f90 delete mode 100644 src/mesonh/turb/mode_turb_ver_thermo_corr.f90 delete mode 100644 src/mesonh/turb/mode_turb_ver_thermo_flux.f90 delete mode 100644 src/mesonh/turb/modn_turb.f90 delete mode 100644 src/mesonh/turb/modn_turb_cloud.f90 delete mode 100644 src/mesonh/turb/modn_turbn.f90 delete mode 100644 src/mesonh/turb/turb_cloud_index.f90 delete mode 100644 src/mesonh/turb/turb_hor.f90 delete mode 100644 src/mesonh/turb/turb_hor_dyn_corr.f90 delete mode 100644 src/mesonh/turb/turb_hor_splt.f90 delete mode 100644 src/mesonh/turb/turb_hor_sv_corr.f90 delete mode 100644 src/mesonh/turb/turb_hor_sv_flux.f90 delete mode 100644 src/mesonh/turb/turb_hor_thermo_corr.f90 delete mode 100644 src/mesonh/turb/turb_hor_thermo_flux.f90 delete mode 100644 src/mesonh/turb/turb_hor_tke.f90 delete mode 100644 src/mesonh/turb/turb_hor_uv.f90 delete mode 100644 src/mesonh/turb/turb_hor_uw.f90 delete mode 100644 src/mesonh/turb/turb_hor_vw.f90 diff --git a/src/arome/turb/modd_cturb.F90 b/src/common/turb/modd_cturb.F90 similarity index 90% rename from src/arome/turb/modd_cturb.F90 rename to src/common/turb/modd_cturb.F90 index 9b18f803f..a446914f7 100644 --- a/src/arome/turb/modd_cturb.F90 +++ b/src/common/turb/modd_cturb.F90 @@ -1,4 +1,8 @@ -! ######spl +!MNH_LIC Copyright 1994-2014 CNRS, Meteo-France and Universite Paul Sabatier +!MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence +!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt +!MNH_LIC for details. version 1. +! ####################### MODULE MODD_CTURB ! ####################### ! @@ -28,6 +32,7 @@ !! Original 08/08/94 !! Nov 06, 2002 (V. Masson) add XALPSBL and XASBL !! May 06 Remove EPS +!! Jan 2019 (Q. Rodier) Remove XASBL !---------------------------------------------------------------------------- ! !* 0. DECLARATIONS @@ -64,7 +69,6 @@ REAL,SAVE :: XLINI ! initial value for BL mixing length REAL,SAVE :: XLINF ! to prevent division by zero in the BL algorithm ! REAL,SAVE :: XALPSBL ! constant linking TKE and friction velocity in the SBL -REAL,SAVE :: XASBL ! constant used to define mixing length in the SBL ! REAL,SAVE :: XCEP ! Constant for wind pressure-correlations REAL,SAVE :: XA0 ! Constant a0 for wind pressure-correlations @@ -77,6 +81,6 @@ REAL,SAVE :: XCTP ! Constant for temperature and vapor pressure-correlat REAL,SAVE :: XPHI_LIM ! Threshold value for Phi3 and Psi3 REAL,SAVE :: XSBL_O_BL ! SBL height / BL height ratio REAL,SAVE :: XFTOP_O_FSURF! Fraction of surface (heat or momentum) flux used to define top of BL -! LOGICAL,SAVE :: LHARAT ! SWITCH HARATU +! END MODULE MODD_CTURB diff --git a/src/mesonh/turb/mf_turb.f90 b/src/mesonh/turb/mf_turb.f90 deleted file mode 100644 index 3ac54d317..000000000 --- a/src/mesonh/turb/mf_turb.f90 +++ /dev/null @@ -1,332 +0,0 @@ -!MNH_LIC Copyright 1994-2014 CNRS, Meteo-France and Universite Paul Sabatier -!MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence -!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt -!MNH_LIC for details. version 1. -! ###################### - MODULE MODI_MF_TURB -! ###################### -! -INTERFACE -! ################################################################# - SUBROUTINE MF_TURB(KKA,KKB,KKE,KKU,KKL,OMIXUV, & - ONOMIXLG,KSV_LGBEG,KSV_LGEND, & - PIMPL, PTSTEP, & - PDZZ, & - PRHODJ, & - PTHLM,PTHVM,PRTM,PUM,PVM,PSVM, & - PTHLDT,PRTDT,PUDT,PVDT,PSVDT, & - PEMF,PTHL_UP,PTHV_UP,PRT_UP,PU_UP,PV_UP,PSV_UP, & - PFLXZTHMF,PFLXZTHVMF,PFLXZRMF,PFLXZUMF,PFLXZVMF, & - PFLXZSVMF ) - -! ################################################################# -! -! -!* 1.1 Declaration of Arguments -! -! -INTEGER, INTENT(IN) :: KKA ! near ground array index -INTEGER, INTENT(IN) :: KKB ! near ground physical index -INTEGER, INTENT(IN) :: KKE ! uppest atmosphere physical index -INTEGER, INTENT(IN) :: KKU ! uppest atmosphere array index -INTEGER, INTENT(IN) :: KKL ! +1 if grid goes from ground to atmosphere top, -1 otherwise - -LOGICAL, INTENT(IN) :: OMIXUV ! True if mixing of momentum -LOGICAL, INTENT(IN) :: ONOMIXLG ! False if mixing of lagrangian tracer -INTEGER, INTENT(IN) :: KSV_LGBEG ! first index of lag. tracer -INTEGER, INTENT(IN) :: KSV_LGEND ! last index of lag. tracer -REAL, INTENT(IN) :: PIMPL ! degree of implicitness -REAL, INTENT(IN) :: PTSTEP ! Dynamical timestep -! -REAL, DIMENSION(:,:), INTENT(IN) :: PDZZ ! metric coefficients - -REAL, DIMENSION(:,:), INTENT(IN) :: PRHODJ ! dry density * Grid size - -! Conservative var. at t-dt -REAL, DIMENSION(:,:), INTENT(IN) :: PTHLM ! conservative pot. temp. -REAL, DIMENSION(:,:), INTENT(IN) :: PRTM ! water var. where -! Virtual potential temperature at t-dt -REAL, DIMENSION(:,:), INTENT(IN) :: PTHVM -! Momentum at t-dt -REAL, DIMENSION(:,:), INTENT(IN) :: PUM -REAL, DIMENSION(:,:), INTENT(IN) :: PVM -! scalar variables at t-dt -REAL, DIMENSION(:,:,:), INTENT(IN) :: PSVM -! -! Tendencies of conservative variables -REAL, DIMENSION(:,:), INTENT(OUT) :: PTHLDT - -REAL, DIMENSION(:,:), INTENT(OUT) :: PRTDT -! Tendencies of momentum -REAL, DIMENSION(:,:), INTENT(OUT) :: PUDT -REAL, DIMENSION(:,:), INTENT(OUT) :: PVDT -! Tendencies of scalar variables -REAL, DIMENSION(:,:,:), INTENT(OUT) :: PSVDT - - -! Updraft characteritics -REAL, DIMENSION(:,:), INTENT(IN) :: PEMF,PTHL_UP,PTHV_UP,PRT_UP,PU_UP,PV_UP -REAL, DIMENSION(:,:,:), INTENT(IN) :: PSV_UP -! Fluxes -REAL, DIMENSION(:,:), INTENT(OUT) :: PFLXZTHMF,PFLXZTHVMF,PFLXZRMF,PFLXZUMF,PFLXZVMF - -REAL, DIMENSION(:,:,:), INTENT(OUT):: PFLXZSVMF - -END SUBROUTINE MF_TURB - -END INTERFACE -! -END MODULE MODI_MF_TURB - - -! ################################################################# - SUBROUTINE MF_TURB(KKA,KKB,KKE,KKU,KKL,OMIXUV, & - ONOMIXLG,KSV_LGBEG,KSV_LGEND, & - PIMPL, PTSTEP, & - PDZZ, & - PRHODJ, & - PTHLM,PTHVM,PRTM,PUM,PVM,PSVM, & - PTHLDT,PRTDT,PUDT,PVDT,PSVDT, & - PEMF,PTHL_UP,PTHV_UP,PRT_UP,PU_UP,PV_UP,PSV_UP, & - PFLXZTHMF,PFLXZTHVMF,PFLXZRMF,PFLXZUMF,PFLXZVMF, & - PFLXZSVMF ) - -! ################################################################# -! -! -!!**** *MF_TURB* - computes the MF_turbulent source terms for the prognostic -!! variables. -!! -!! PURPOSE -!! ------- -!!**** The purpose of this routine is to compute the source terms in -!! the evolution equations due to the MF turbulent mixing. -!! The source term is computed as the divergence of the turbulent fluxes. -! -!!** METHOD -!! ------ -!! -!! -!! EXTERNAL -!! -------- -!! -!! IMPLICIT ARGUMENTS -!! ------------------ -!! -!! -!! REFERENCE -!! --------- -!! -!! AUTHOR -!! ------ -!! -!! -!! MODIFICATIONS -!! ------------- -!! 10/2009 (C.Lac) Introduction of different PTSTEP according to the -!! advection schemes -!! 09/2010 (V.Masson) Optimization -!! S. Riette Jan 2012: support for both order of vertical levels -!! suppression of useless initialisations -!! -!! -------------------------------------------------------------------------- -! -!* 0. DECLARATIONS -! ------------ -! -USE MODD_PARAM_MFSHALL_n -! -USE MODI_SHUMAN_MF -USE MODE_TRIDIAG_MASSFLUX, ONLY: TRIDIAG_MASSFLUX -! -IMPLICIT NONE -! -! -!* 0.1 declarations of arguments -! -! -INTEGER, INTENT(IN) :: KKA ! near ground array index -INTEGER, INTENT(IN) :: KKB ! near ground physical index -INTEGER, INTENT(IN) :: KKE ! uppest atmosphere physical index -INTEGER, INTENT(IN) :: KKU ! uppest atmosphere array index -INTEGER, INTENT(IN) :: KKL ! +1 if grid goes from ground to atmosphere top, -1 otherwise -LOGICAL, INTENT(IN) :: OMIXUV ! True if mixing of momentum -LOGICAL, INTENT(IN) :: ONOMIXLG ! False if mixing of lagrangian tracer -INTEGER, INTENT(IN) :: KSV_LGBEG ! first index of lag. tracer -INTEGER, INTENT(IN) :: KSV_LGEND ! last index of lag. tracer -REAL, INTENT(IN) :: PIMPL ! degree of implicitness -REAL, INTENT(IN) :: PTSTEP ! Dynamical timestep -! -REAL, DIMENSION(:,:), INTENT(IN) :: PDZZ ! metric coefficients - -REAL, DIMENSION(:,:), INTENT(IN) :: PRHODJ ! dry density * Grid size - -! Conservative var. at t-dt -REAL, DIMENSION(:,:), INTENT(IN) :: PTHLM ! conservative pot. temp. -REAL, DIMENSION(:,:), INTENT(IN) :: PRTM ! water var. where -! Virtual potential temperature at t-dt -REAL, DIMENSION(:,:), INTENT(IN) :: PTHVM -! Momentum at t-dt -REAL, DIMENSION(:,:), INTENT(IN) :: PUM -REAL, DIMENSION(:,:), INTENT(IN) :: PVM -! scalar variables at t-dt -REAL, DIMENSION(:,:,:), INTENT(IN) :: PSVM -! -! Tendencies of conservative variables -REAL, DIMENSION(:,:), INTENT(OUT) :: PTHLDT - -REAL, DIMENSION(:,:), INTENT(OUT) :: PRTDT -! Tendencies of momentum -REAL, DIMENSION(:,:), INTENT(OUT) :: PUDT -REAL, DIMENSION(:,:), INTENT(OUT) :: PVDT -! Tendencies of scalar variables -REAL, DIMENSION(:,:,:), INTENT(OUT) :: PSVDT - - -! Updraft characteritics -REAL, DIMENSION(:,:), INTENT(IN) :: PEMF,PTHL_UP,PTHV_UP,PRT_UP,PU_UP,PV_UP -REAL, DIMENSION(:,:,:), INTENT(IN) :: PSV_UP -! Fluxes -REAL, DIMENSION(:,:), INTENT(OUT) :: PFLXZTHMF,PFLXZTHVMF,PFLXZRMF,PFLXZUMF,PFLXZVMF - -REAL, DIMENSION(:,:,:), INTENT(OUT):: PFLXZSVMF -! -! -! -!------------------------------------------------------------------------------- -! -! 0.2 declaration of local variables -! - -REAL, DIMENSION(SIZE(PTHLM,1),SIZE(PTHLM,2)) :: ZVARS - -! -INTEGER :: ISV,JSV !number of scalar variables and Loop counter -! -!---------------------------------------------------------------------------- -! -!* 1.PRELIMINARIES -! ------------- -! -! -! number of scalar var -ISV=SIZE(PSVM,3) - -! -PFLXZSVMF = 0. -PSVDT = 0. - -! -!---------------------------------------------------------------------------- -! -!* 2. COMPUTE THE MEAN FLUX OF CONSERVATIVE VARIABLES at time t-dt -! (equation (3) of Soares et al) -! + THE MEAN FLUX OF THETA_V (buoyancy flux) -! ----------------------------------------------- -! ( Resulting fluxes are in flux level (w-point) as PEMF and PTHL_UP ) -! - -PFLXZTHMF(:,:) = PEMF(:,:)*(PTHL_UP(:,:)-MZM_MF(KKA,KKU,KKL,PTHLM(:,:))) - -PFLXZRMF(:,:) = PEMF(:,:)*(PRT_UP(:,:)-MZM_MF(KKA,KKU,KKL,PRTM(:,:))) - -PFLXZTHVMF(:,:) = PEMF(:,:)*(PTHV_UP(:,:)-MZM_MF(KKA,KKU,KKL,PTHVM(:,:))) - -IF (OMIXUV) THEN - PFLXZUMF(:,:) = PEMF(:,:)*(PU_UP(:,:)-MZM_MF(KKA,KKU,KKL,PUM(:,:))) - PFLXZVMF(:,:) = PEMF(:,:)*(PV_UP(:,:)-MZM_MF(KKA,KKU,KKL,PVM(:,:))) -ELSE - PFLXZUMF(:,:) = 0. - PFLXZVMF(:,:) = 0. -ENDIF -! -! -!---------------------------------------------------------------------------- -! -!* 3. COMPUTE TENDENCIES OF CONSERVATIVE VARIABLES (or treated as such...) -! (implicit formulation) -! -------------------------------------------- -! - -! -! -! 3.1 Compute the tendency for the conservative potential temperature -! (PDZZ and flux in w-point and PRHODJ is mass point, result in mass point) -! -CALL TRIDIAG_MASSFLUX(KKA,KKB,KKE,KKU,KKL,PTHLM,PFLXZTHMF,-PEMF,PTSTEP,PIMPL, & - PDZZ,PRHODJ,ZVARS ) -! compute new flux -PFLXZTHMF(:,:) = PEMF(:,:)*(PTHL_UP(:,:)-MZM_MF(KKA,KKU,KKL,ZVARS(:,:))) - -!!! compute THL tendency -! -PTHLDT(:,:)= (ZVARS(:,:)-PTHLM(:,:))/PTSTEP - -! -! 3.2 Compute the tendency for the conservative mixing ratio -! -CALL TRIDIAG_MASSFLUX(KKA,KKB,KKE,KKU,KKL,PRTM(:,:),PFLXZRMF,-PEMF,PTSTEP,PIMPL, & - PDZZ,PRHODJ,ZVARS ) -! compute new flux -PFLXZRMF(:,:) = PEMF(:,:)*(PRT_UP(:,:)-MZM_MF(KKA,KKU,KKL,ZVARS(:,:))) - -!!! compute RT tendency -PRTDT(:,:) = (ZVARS(:,:)-PRTM(:,:))/PTSTEP -! - -IF (OMIXUV) THEN - ! - ! 3.3 Compute the tendency for the (non conservative but treated as it) zonal momentum - ! (PDZZ and flux in w-point and PRHODJ is mass point, result in mass point) - ! - - CALL TRIDIAG_MASSFLUX(KKA,KKB,KKE,KKU,KKL,PUM,PFLXZUMF,-PEMF,PTSTEP,PIMPL, & - PDZZ,PRHODJ,ZVARS ) - ! compute new flux - PFLXZUMF(:,:) = PEMF(:,:)*(PU_UP(:,:)-MZM_MF(KKA,KKU,KKL,ZVARS(:,:))) - - ! compute U tendency - PUDT(:,:)= (ZVARS(:,:)-PUM(:,:))/PTSTEP - - ! - ! - ! 3.4 Compute the tendency for the (non conservative but treated as it for the time beiing) - ! meridian momentum - ! (PDZZ and flux in w-point and PRHODJ is mass point, result in mass point) - ! - CALL TRIDIAG_MASSFLUX(KKA,KKB,KKE,KKU,KKL,PVM,PFLXZVMF,-PEMF,PTSTEP,PIMPL, & - PDZZ,PRHODJ,ZVARS ) - ! compute new flux - PFLXZVMF(:,:) = PEMF(:,:)*(PV_UP(:,:)-MZM_MF(KKA,KKU,KKL,ZVARS(:,:))) - - ! compute V tendency - PVDT(:,:)= (ZVARS(:,:)-PVM(:,:))/PTSTEP -ELSE - PUDT(:,:)=0. - PVDT(:,:)=0. -ENDIF - -DO JSV=1,ISV - - IF (ONOMIXLG .AND. JSV >= KSV_LGBEG .AND. JSV<= KSV_LGEND) CYCLE - - !* compute mean flux of scalar variables at time t-dt - ! ( Resulting fluxes are in flux level (w-point) as PEMF and PTHL_UP ) - - PFLXZSVMF(:,:,JSV) = PEMF(:,:)*(PSV_UP(:,:,JSV)-MZM_MF(KKA,KKU,KKL,PSVM(:,:,JSV))) - - ! - ! 3.5 Compute the tendency for scalar variables - ! (PDZZ and flux in w-point and PRHODJ is mass point, result in mass point) - ! - CALL TRIDIAG_MASSFLUX(KKA,KKB,KKE,KKU,KKL,PSVM(:,:,JSV),PFLXZSVMF(:,:,JSV),& - -PEMF,PTSTEP,PIMPL,PDZZ,PRHODJ,ZVARS ) - ! compute new flux - PFLXZSVMF(:,:,JSV) = PEMF(:,:)*(PSV_UP(:,:,JSV)-MZM_MF(KKA,KKU,KKL,ZVARS)) - - ! compute Sv tendency - PSVDT(:,:,JSV)= (ZVARS(:,:)-PSVM(:,:,JSV))/PTSTEP - -ENDDO -! -END SUBROUTINE MF_TURB diff --git a/src/mesonh/turb/mf_turb_greyzone.f90 b/src/mesonh/turb/mf_turb_greyzone.f90 deleted file mode 100644 index cec9cf165..000000000 --- a/src/mesonh/turb/mf_turb_greyzone.f90 +++ /dev/null @@ -1,340 +0,0 @@ -!MNH_LIC Copyright 1994-2014 CNRS, Meteo-France and Universite Paul Sabatier -!MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence -!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt -!MNH_LIC for details. version 1. -! ######spl - MODULE MODI_MF_TURB_GREYZONE -! ###################### -! -INTERFACE -! ################################################################# - SUBROUTINE MF_TURB_GREYZONE(KKA,KKB,KKE,KKU,KKL,OMIXUV, & - ONOMIXLG,KSV_LGBEG,KSV_LGEND, & - PIMPL, PTSTEP, & - PDZZ, & - PRHODJ, & - PTHLM,PTHVM,PRTM,PUM,PVM,PSVM, & - PTHLDT,PRTDT,PUDT,PVDT,PSVDT, & - PEMF,PTHL_UP,PTHV_UP,PRT_UP,PU_UP,PV_UP,PSV_UP, & - PTHL_DO,PTHV_DO,PRT_DO,PU_DO,PV_DO,PSV_DO, & - PFLXZTHMF,PFLXZTHVMF,PFLXZRMF,PFLXZUMF,PFLXZVMF, & - PFLXZSVMF ) - -! ################################################################# -! -! -!* 1.1 Declaration of Arguments -! -! -INTEGER, INTENT(IN) :: KKA ! near ground array index -INTEGER, INTENT(IN) :: KKB ! near ground physical index -INTEGER, INTENT(IN) :: KKE ! uppest atmosphere physical index -INTEGER, INTENT(IN) :: KKU ! uppest atmosphere array index -INTEGER, INTENT(IN) :: KKL ! +1 if grid goes from ground to atmosphere top, -1 otherwise - -LOGICAL, INTENT(IN) :: OMIXUV ! True if mixing of momentum -LOGICAL, INTENT(IN) :: ONOMIXLG ! False if mixing of lagrangian tracer -INTEGER, INTENT(IN) :: KSV_LGBEG ! first index of lag. tracer -INTEGER, INTENT(IN) :: KSV_LGEND ! last index of lag. tracer -REAL, INTENT(IN) :: PIMPL ! degree of implicitness -REAL, INTENT(IN) :: PTSTEP ! Dynamical timestep -! -REAL, DIMENSION(:,:), INTENT(IN) :: PDZZ ! metric coefficients - -REAL, DIMENSION(:,:), INTENT(IN) :: PRHODJ ! dry density * Grid size - -! Conservative var. at t-dt -REAL, DIMENSION(:,:), INTENT(IN) :: PTHLM ! conservative pot. temp. -REAL, DIMENSION(:,:), INTENT(IN) :: PRTM ! water var. where -! Virtual potential temperature at t-dt -REAL, DIMENSION(:,:), INTENT(IN) :: PTHVM -! Momentum at t-dt -REAL, DIMENSION(:,:), INTENT(IN) :: PUM -REAL, DIMENSION(:,:), INTENT(IN) :: PVM -! scalar variables at t-dt -REAL, DIMENSION(:,:,:), INTENT(IN) :: PSVM -! -! Tendencies of conservative variables -REAL, DIMENSION(:,:), INTENT(OUT) :: PTHLDT - -REAL, DIMENSION(:,:), INTENT(OUT) :: PRTDT -! Tendencies of momentum -REAL, DIMENSION(:,:), INTENT(OUT) :: PUDT -REAL, DIMENSION(:,:), INTENT(OUT) :: PVDT -! Tendencies of scalar variables -REAL, DIMENSION(:,:,:), INTENT(OUT) :: PSVDT - - -! Updraft characteritics -REAL, DIMENSION(:,:), INTENT(IN) :: PEMF,PTHL_UP,PTHV_UP,PRT_UP,PU_UP,PV_UP -REAL, DIMENSION(:,:), INTENT(IN) :: PTHL_DO,PTHV_DO,PRT_DO,PU_DO,PV_DO -REAL, DIMENSION(:,:,:), INTENT(IN) :: PSV_UP, PSV_DO -! Fluxes -REAL, DIMENSION(:,:), INTENT(OUT) :: PFLXZTHMF,PFLXZTHVMF,PFLXZRMF,PFLXZUMF,PFLXZVMF - -REAL, DIMENSION(:,:,:), INTENT(OUT):: PFLXZSVMF - -END SUBROUTINE MF_TURB_GREYZONE - -END INTERFACE -! -END MODULE MODI_MF_TURB_GREYZONE -! ################################################################# - SUBROUTINE MF_TURB_GREYZONE(KKA, KKB, KKE, KKU, KKL,OMIXUV, & - ONOMIXLG,KSV_LGBEG,KSV_LGEND, & - PIMPL, PTSTEP, & - PDZZ, & - PRHODJ, & - PTHLM,PTHVM,PRTM,PUM,PVM,PSVM, & - PTHLDT,PRTDT,PUDT,PVDT,PSVDT, & - PEMF,PTHL_UP,PTHV_UP,PRT_UP,PU_UP,PV_UP,PSV_UP, & - PTHL_DO,PTHV_DO,PRT_DO,PU_DO,PV_DO,PSV_DO, & - PFLXZTHMF,PFLXZTHVMF,PFLXZRMF,PFLXZUMF,PFLXZVMF, & - PFLXZSVMF ) - -! ################################################################# -! -! -!!**** *MF_TURB_GREYZONE* - computes the MF_turbulent source terms for the prognostic -!! variables. -!! -!! PURPOSE -!! ------- -!!**** The purpose of this routine is to compute the source terms in -!! the evolution equations due to the MF turbulent mixing. -!! The source term is computed as the divergence of the turbulent fluxes. -! -!!** METHOD -!! ------ -!! -!! -!! EXTERNAL -!! -------- -!! -!! IMPLICIT ARGUMENTS -!! ------------------ -!! -!! -!! REFERENCE -!! --------- -!! -!! AUTHOR -!! ------ -!! -!! -!! MODIFICATIONS -!! ------------- -!! 10/2009 (C.Lac) Introduction of different PTSTEP according to the -!! advection schemes -!! 09/2010 (V.Masson) Optimization -!! S. Riette Jan 2012: support for both order of vertical levels -!! suppression of useless initialisations -!! -!! -------------------------------------------------------------------------- -! -!* 0. DECLARATIONS -! ------------ -! -USE MODD_PARAM_MFSHALL_n -! -USE MODI_SHUMAN_MF -USE MODE_TRIDIAG_MASSFLUX, ONLY: TRIDIAG_MASSFLUX -! -IMPLICIT NONE -! -! -!* 0.1 declarations of arguments -! -! -INTEGER, INTENT(IN) :: KKA ! near ground array index -INTEGER, INTENT(IN) :: KKB ! near ground physical index -INTEGER, INTENT(IN) :: KKE ! uppest atmosphere physical index -INTEGER, INTENT(IN) :: KKU ! uppest atmosphere array index -INTEGER, INTENT(IN) :: KKL ! +1 if grid goes from ground to atmosphere top, -1 otherwise -LOGICAL, INTENT(IN) :: OMIXUV ! True if mixing of momentum -LOGICAL, INTENT(IN) :: ONOMIXLG ! False if mixing of lagrangian tracer -INTEGER, INTENT(IN) :: KSV_LGBEG ! first index of lag. tracer -INTEGER, INTENT(IN) :: KSV_LGEND ! last index of lag. tracer -REAL, INTENT(IN) :: PIMPL ! degree of implicitness -REAL, INTENT(IN) :: PTSTEP ! Dynamical timestep -! -REAL, DIMENSION(:,:), INTENT(IN) :: PDZZ ! metric coefficients - -REAL, DIMENSION(:,:), INTENT(IN) :: PRHODJ ! dry density * Grid size - -! Conservative var. at t-dt -REAL, DIMENSION(:,:), INTENT(IN) :: PTHLM ! conservative pot. temp. -REAL, DIMENSION(:,:), INTENT(IN) :: PRTM ! water var. where -! Virtual potential temperature at t-dt -REAL, DIMENSION(:,:), INTENT(IN) :: PTHVM -! Momentum at t-dt -REAL, DIMENSION(:,:), INTENT(IN) :: PUM -REAL, DIMENSION(:,:), INTENT(IN) :: PVM -! scalar variables at t-dt -REAL, DIMENSION(:,:,:), INTENT(IN) :: PSVM -! -! Tendencies of conservative variables -REAL, DIMENSION(:,:), INTENT(OUT) :: PTHLDT - -REAL, DIMENSION(:,:), INTENT(OUT) :: PRTDT -! Tendencies of momentum -REAL, DIMENSION(:,:), INTENT(OUT) :: PUDT -REAL, DIMENSION(:,:), INTENT(OUT) :: PVDT -! Tendencies of scalar variables -REAL, DIMENSION(:,:,:), INTENT(OUT) :: PSVDT - - -! Updraft/environment characteritics -REAL, DIMENSION(:,:), INTENT(IN) :: PEMF,PTHL_UP,PTHV_UP,PRT_UP,PU_UP,PV_UP -REAL, DIMENSION(:,:), INTENT(IN) :: PTHL_DO,PTHV_DO,PRT_DO,PU_DO,PV_DO -REAL, DIMENSION(:,:,:), INTENT(IN) :: PSV_UP,PSV_DO -! Fluxes -REAL, DIMENSION(:,:), INTENT(OUT) :: PFLXZTHMF,PFLXZTHVMF,PFLXZRMF,PFLXZUMF,PFLXZVMF - -REAL, DIMENSION(:,:,:), INTENT(OUT):: PFLXZSVMF -! -! -! -!------------------------------------------------------------------------------- -! -! 0.2 declaration of local variables -! - -REAL, DIMENSION(SIZE(PTHLM,1),SIZE(PTHLM,2)) :: ZVARS - -! -INTEGER :: ISV,JSV !number of scalar variables and Loop counter -! -!---------------------------------------------------------------------------- -! -!* 1.PRELIMINARIES -! ------------- -! -! -! number of scalar var -ISV=SIZE(PSVM,3) - -! -PFLXZSVMF = 0. -PSVDT = 0. - -! -!---------------------------------------------------------------------------- -! -!* 2. COMPUTE THE MEAN FLUX OF CONSERVATIVE VARIABLES at time t-dt -! (equation (3) of Soares et al) -! + THE MEAN FLUX OF THETA_V (buoyancy flux) -! ----------------------------------------------- -! ( Resulting fluxes are in flux level (w-point) as PEMF and PTHL_UP ) -! -! downdraft data are on the flux points -PFLXZTHMF(:,:) = PEMF(:,:)*(PTHL_UP(:,:)-PTHL_DO(:,:)) - -PFLXZRMF(:,:) = PEMF(:,:)*(PRT_UP(:,:)-PRT_DO(:,:)) - -PFLXZTHVMF(:,:) = PEMF(:,:)*(PTHV_UP(:,:)-PTHV_DO(:,:)) - -IF (OMIXUV) THEN - PFLXZUMF(:,:) = PEMF(:,:)*(PU_UP(:,:)-PU_DO(:,:)) - PFLXZVMF(:,:) = PEMF(:,:)*(PV_UP(:,:)-PV_DO(:,:)) -ELSE - PFLXZUMF(:,:) = 0. - PFLXZVMF(:,:) = 0. -ENDIF -! -! -!---------------------------------------------------------------------------- -! -!* 3. COMPUTE TENDENCIES OF CONSERVATIVE VARIABLES (or treated as such...) -! (implicit formulation) -! -------------------------------------------- -! - -! -! -! 3.1 Compute the tendency for the conservative potential temperature -! (PDZZ and flux in w-point and PRHODJ is mass point, result in mass point) -! -CALL TRIDIAG_MASSFLUX(KKA,KKB,KKE,KKU,KKL,PTHLM,PFLXZTHMF,-PEMF,PTSTEP,PIMPL, & - PDZZ,PRHODJ,ZVARS ) -! compute new flux -!!!!!!!!!!!!!!!!!!!!!!!!!! -! Pourquoi on le recalcule ici alors qu'il n'est pas utilisé ailleurs -! sauf pour l'écriture ? -! Est ce que ZVARS est au point de masse pour qu'il doivent être remis au point -! de flux ? -!!!!!!!!!!!!!!!!!!!!!!!!!! -PFLXZTHMF(:,:) = PEMF(:,:)*(PTHL_UP(:,:)-MZM_MF(ZVARS(:,:),KKA,KKU,KKL)) - -!!! compute THL tendency -! -PTHLDT(:,:)= (ZVARS(:,:)-PTHLM(:,:))/PTSTEP - -! -! 3.2 Compute the tendency for the conservative mixing ratio -! -CALL TRIDIAG_MASSFLUX(KKA,KKB,KKE,KKU,KKL,PRTM(:,:),PFLXZRMF,-PEMF,PTSTEP,PIMPL, & - PDZZ,PRHODJ,ZVARS ) -! compute new flux -PFLXZRMF(:,:) = PEMF(:,:)*(PRT_UP(:,:)-MZM_MF(ZVARS(:,:),KKA,KKU,KKL)) - -!!! compute RT tendency -PRTDT(:,:) = (ZVARS(:,:)-PRTM(:,:))/PTSTEP -! - -IF (OMIXUV) THEN - ! - ! 3.3 Compute the tendency for the (non conservative but treated as it) zonal momentum - ! (PDZZ and flux in w-point and PRHODJ is mass point, result in mass point) - ! - - CALL TRIDIAG_MASSFLUX(KKA,KKB,KKE,KKU,KKL,PUM,PFLXZUMF,-PEMF,PTSTEP,PIMPL, & - PDZZ,PRHODJ,ZVARS ) - ! compute new flux - PFLXZUMF(:,:) = PEMF(:,:)*(PU_UP(:,:)-MZM_MF(ZVARS(:,:),KKA,KKU,KKL)) - - ! compute U tendency - PUDT(:,:)= (ZVARS(:,:)-PUM(:,:))/PTSTEP - - ! - ! - ! 3.4 Compute the tendency for the (non conservative but treated as it for the time beiing) - ! meridian momentum - ! (PDZZ and flux in w-point and PRHODJ is mass point, result in mass point) - ! - CALL TRIDIAG_MASSFLUX(KKA,KKB,KKE,KKU,KKL,PVM,PFLXZVMF,-PEMF,PTSTEP,PIMPL, & - PDZZ,PRHODJ,ZVARS ) - ! compute new flux - PFLXZVMF(:,:) = PEMF(:,:)*(PV_UP(:,:)-MZM_MF(ZVARS(:,:),KKA,KKU,KKL)) - - ! compute V tendency - PVDT(:,:)= (ZVARS(:,:)-PVM(:,:))/PTSTEP -ELSE - PUDT(:,:)=0. - PVDT(:,:)=0. -ENDIF - -DO JSV=1,ISV - - IF (ONOMIXLG .AND. JSV >= KSV_LGBEG .AND. JSV<= KSV_LGEND) CYCLE - - !* compute mean flux of scalar variables at time t-dt - ! ( Resulting fluxes are in flux level (w-point) as PEMF and PTHL_UP ) - - PFLXZSVMF(:,:,JSV) = PEMF(:,:)*(PSV_UP(:,:,JSV)-MZM_MF(PSVM(:,:,JSV),KKA,KKU,KKL)) - - ! - ! 3.5 Compute the tendency for scalar variables - ! (PDZZ and flux in w-point and PRHODJ is mass point, result in mass point) - ! - CALL TRIDIAG_MASSFLUX(KKA,KKB,KKE,KKU,KKL,PSVM(:,:,JSV),PFLXZSVMF(:,:,JSV),& - -PEMF,PTSTEP,PIMPL,PDZZ,PRHODJ,ZVARS ) - ! compute new flux - PFLXZSVMF(:,:,JSV) = PEMF(:,:)*(PSV_UP(:,:,JSV)-MZM_MF(ZVARS,KKA,KKU,KKL)) - - ! compute Sv tendency - PSVDT(:,:,JSV)= (ZVARS(:,:)-PSVM(:,:,JSV))/PTSTEP - -ENDDO -! -END SUBROUTINE MF_TURB_GREYZONE diff --git a/src/mesonh/turb/modd_cturb.f90 b/src/mesonh/turb/modd_cturb.f90 deleted file mode 100644 index 67ca557fa..000000000 --- a/src/mesonh/turb/modd_cturb.f90 +++ /dev/null @@ -1,92 +0,0 @@ -!MNH_LIC Copyright 1994-2014 CNRS, Meteo-France and Universite Paul Sabatier -!MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence -!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt -!MNH_LIC for details. version 1. -!----------------------------------------------------------------- -!--------------- special set of characters for RCS information -!----------------------------------------------------------------- -! $Source$ $Revision$ -! MASDEV4_7 modd 2006/05/23 10:10:13 -!----------------------------------------------------------------- -! ####################### - MODULE MODD_CTURB -! ####################### -! -!!**** *MODD_CTURB* - declaration of the turbulent scheme constants -!! -!! PURPOSE -!! ------- -! The purpose of this declarative module is to declare the -! turbulence scheme constants. -! -!! -!!** IMPLICIT ARGUMENTS -!! ------------------ -!! NONE -!! -!! REFERENCE -!! --------- -!! Book 2 of Meso-NH documentation (MODD_CTURB) -!! Book 1 of Meso-NH documentation (Chapter Turbulence) -!! -!! AUTHOR -!! ------ -!1 Joan Cuxart * INM and Meteo-France * -!! -!! MODIFICATIONS -!! ------------- -!! Original 08/08/94 -!! Nov 06, 2002 (V. Masson) add XALPSBL and XASBL -!! May 06 Remove EPS -!! Jan 2019 (Q. Rodier) Remove XASBL -!---------------------------------------------------------------------------- -! -!* 0. DECLARATIONS -! ------------ -! -IMPLICIT NONE -! -REAL,SAVE :: XCMFS ! constant for the momentum flux due to shear -REAL,SAVE :: XCMFB ! constant for the momentum flux due to buoyancy -REAL,SAVE :: XCSHF ! constant for the sensible heat flux -REAL,SAVE :: XCHF ! constant for the humidity flux -REAL,SAVE :: XCTV ! constant for the temperature variance -REAL,SAVE :: XCHV ! constant for the humidity variance -REAL,SAVE :: XCHT1 ! first ct. for the humidity-temperature correlation -REAL,SAVE :: XCHT2 ! second ct. for the humidity-temperature correlation -! -REAL,SAVE :: XCPR1 ! first ct. for the turbulent Prandtl numbers -REAL,SAVE :: XCPR2 ! second ct. for the turbulent Prandtl numbers -REAL,SAVE :: XCPR3 ! third ct. for the turbulent Prandtl numbers -REAL,SAVE :: XCPR4 ! fourth ct. for the turbulent Prandtl numbers -REAL,SAVE :: XCPR5 ! fifth ct. for the turbulent Prandtl numbers -! -REAL,SAVE :: XCET ! constant into the transport term of the TKE eq. -REAL,SAVE :: XCED ! constant into the dissipation term of the TKE eq. -! -REAL,SAVE :: XCDP ! ct. for the production term in the dissipation eq. -REAL,SAVE :: XCDD ! ct. for the destruction term in the dissipation eq. -REAL,SAVE :: XCDT ! ct. for the transport term in the dissipation eq. -! -REAL,SAVE :: XTKEMIN ! mimimum value for the TKE -REAL,SAVE :: XRM17 ! Rodier et al 2017 constant in shear term for mixing length -! -REAL,SAVE :: XLINI ! initial value for BL mixing length -REAL,SAVE :: XLINF ! to prevent division by zero in the BL algorithm -! -REAL,SAVE :: XALPSBL ! constant linking TKE and friction velocity in the SBL -! -REAL,SAVE :: XCEP ! Constant for wind pressure-correlations -REAL,SAVE :: XA0 ! Constant a0 for wind pressure-correlations -REAL,SAVE :: XA2 ! Constant a2 for wind pressure-correlations -REAL,SAVE :: XA3 ! Constant a3 for wind pressure-correlations -REAL,SAVE :: XA5 ! Constant a5 for temperature pressure-correlations -REAL,SAVE :: XCTD ! Constant for temperature and vapor dissipation -REAL,SAVE :: XCTP ! Constant for temperature and vapor pressure-correlations -! -REAL,SAVE :: XPHI_LIM ! Threshold value for Phi3 and Psi3 -REAL,SAVE :: XSBL_O_BL ! SBL height / BL height ratio -REAL,SAVE :: XFTOP_O_FSURF! Fraction of surface (heat or momentum) flux used to define top of BL -LOGICAL,SAVE :: LHARAT ! SWITCH HARATU -! -END MODULE MODD_CTURB diff --git a/src/mesonh/turb/modd_turb_cloud.f90 b/src/mesonh/turb/modd_turb_cloud.f90 deleted file mode 100644 index 28b1f106f..000000000 --- a/src/mesonh/turb/modd_turb_cloud.f90 +++ /dev/null @@ -1,58 +0,0 @@ -!MNH_LIC Copyright 1994-2014 CNRS, Meteo-France and Universite Paul Sabatier -!MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence -!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt -!MNH_LIC for details. version 1. -!----------------------------------------------------------------- -!--------------- special set of characters for RCS information -!----------------------------------------------------------------- -! $Source$ $Revision$ -! MASDEV4_7 modd 2006/05/18 13:07:25 -!----------------------------------------------------------------- -! ################## - MODULE MODD_TURB_CLOUD -! ################## -! -!!**** *MODD_TURB_CLOUD* - declaration of parameters for cloud mixing length -!! -!! PURPOSE -!! ------- -! The purpose of this declarative module is to declare the -! variables that may be set by namelist for the cloud mixing length -! -!! -!!** IMPLICIT ARGUMENTS -!! ------------------ -!! None -!! -!! REFERENCE -!! --------- -!! -!! AUTHOR -!! ------ -!! M. Tomasini *Meteo France* -!! -!! MODIFICATIONS -!! ------------- -!! Original September, 2004 -!------------------------------------------------------------------------------- -! -!* 0. DECLARATIONS -! ------------ -! -IMPLICIT NONE -! -INTEGER,SAVE :: NMODEL_CLOUD ! model number where the modification ! of the mixing length in the clouds is computed -CHARACTER (LEN=4),SAVE :: CTURBLEN_CLOUD ! type of length in the clouds - ! 'DEAR' Deardorff mixing length - ! 'BL89' Bougeault and Lacarrere scheme - ! 'DELT' length = ( volum) ** 1/3 -REAL,SAVE :: XCOEF_AMPL_SAT ! saturation of the amplification coefficient -REAL,SAVE :: XCEI_MIN ! minimum threshold for the instability index CEI - !(beginning of the amplification) -REAL,SAVE :: XCEI_MAX ! maximum threshold for the instability index CEI - !(beginning of the saturation of the amplification) -REAL,SAVE,DIMENSION(:,:,:), ALLOCATABLE :: XCEI ! Cloud Entrainment instability - ! index to emphasize localy - ! turbulent fluxes -! -END MODULE MODD_TURB_CLOUD diff --git a/src/mesonh/turb/modd_turb_flux_aircraft_balloon.f90 b/src/mesonh/turb/modd_turb_flux_aircraft_balloon.f90 deleted file mode 100644 index cd3e40b62..000000000 --- a/src/mesonh/turb/modd_turb_flux_aircraft_balloon.f90 +++ /dev/null @@ -1,54 +0,0 @@ -!MNH_LIC Copyright 1994-2014 CNRS, Meteo-France and Universite Paul Sabatier -!MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence -!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt -!MNH_LIC for details. version 1. -!----------------------------------------------------------------- -!--------------- special set of characters for RCS information -!----------------------------------------------------------------- -! $Source$ $Revision$ $Date$ -!----------------------------------------------------------------- -!----------------------------------------------------------------- -!----------------------------------------------------------------- -! ###################################### - MODULE MODD_TURB_FLUX_AIRCRAFT_BALLOON -! ###################################### -! -!!**** *MODD_CVERT* - Declares work arrays for vertical cross-sections -!! -!! PURPOSE -!! ------- -! For vertical cross-sections only, this declarative module declares -! the arrays containing the sea-level altitudes and the model topography -! of the oblique cross-section points. -!! -!!** IMPLICIT ARGUMENTS -!! ------------------ -!! None -!! -!! REFERENCE -!! --------- -!! -!! Book2 of the TRACE volume of the Meso-NH user manual -!! (MODD_CVERT) -!! -!! AUTHOR -!! ------ -!! P.Lacarrere -!! -!! MODIFICATIONS -!! ------------- -!! Original 18/09/06 -!! -!------------------------------------------------------------------------------- -! -!* 0. DECLARATIONS -! ------------ -! -! -IMPLICIT NONE -! -REAL,DIMENSION(:,:,:) ,ALLOCATABLE,SAVE :: XTHW_FLUX !sensible flux -REAL,DIMENSION(:,:,:) ,ALLOCATABLE,SAVE :: XRCW_FLUX !Latent flux -REAL,DIMENSION(:,:,:,:),ALLOCATABLE,SAVE :: XSVW_FLUX !turb scalar flux -! -END MODULE MODD_TURB_FLUX_AIRCRAFT_BALLOON diff --git a/src/mesonh/turb/mode_turb_ver.f90 b/src/mesonh/turb/mode_turb_ver.f90 deleted file mode 100644 index bdd4f3299..000000000 --- a/src/mesonh/turb/mode_turb_ver.f90 +++ /dev/null @@ -1,663 +0,0 @@ -!MNH_LIC Copyright 1994-2022 CNRS, Meteo-France and Universite Paul Sabatier -!MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence -!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt -!MNH_LIC for details. version 1. -MODULE MODE_TURB_VER -IMPLICIT NONE -CONTAINS -SUBROUTINE TURB_VER(KKA,KKU,KKL,KRR,KRRL,KRRI, & - OTURB_FLX, & - HTURBDIM,HTOM,PIMPL,PEXPL, & - PTSTEP, TPFILE, & - PDXX,PDYY,PDZZ,PDZX,PDZY,PDIRCOSZW,PZZ, & - PCOSSLOPE,PSINSLOPE, & - PRHODJ,PTHVREF, & - PSFTHM,PSFRM,PSFSVM,PSFTHP,PSFRP,PSFSVP, & - PCDUEFF,PTAU11M,PTAU12M,PTAU33M, & - PUM,PVM,PWM,PUSLOPEM,PVSLOPEM,PTHLM,PRM,PSVM, & - PTKEM,PLM,PLENGTHM,PLENGTHH,PLEPS,MFMOIST, & - PLOCPEXNM,PATHETA,PAMOIST,PSRCM,PFRAC_ICE, & - PFWTH,PFWR,PFTH2,PFR2,PFTHR,PBL_DEPTH, & - PSBL_DEPTH,PLMO, & - PRUS,PRVS,PRWS,PRTHLS,PRRS,PRSVS, & - PDP,PTP,PSIGS,PWTH,PWRC,PWSV ) -! ############################################################### -! -! -!!**** *TURB_VER* -compute the source terms due to the vertical turbulent -!! fluxes. -!! -!! PURPOSE -!! ------- -! The purpose of this routine is to compute the vertical turbulent -! fluxes of the evolutive variables and give back the source -! terms to the main program. In the case of large horizontal meshes, -! the divergence of these vertical turbulent fluxes represent the whole -! effect of the turbulence but when the three-dimensionnal version of -! the turbulence scheme is activated (CTURBDIM="3DIM"), these divergences -! are completed in the next routine TURB_HOR. -! An arbitrary degree of implicitness has been implemented for the -! temporal treatment of these diffusion terms. -! The vertical boundary conditions are as follows: -! * at the bottom, the surface fluxes are prescribed at the same -! as the other turbulent fluxes -! * at the top, the turbulent fluxes are set to 0. -! It should be noted that the condensation has been implicitely included -! in this turbulence scheme by using conservative variables and computing -! the subgrid variance of a statistical variable s indicating the presence -! or not of condensation in a given mesh. -! -!!** METHOD -!! ------ -!! 1D type calculations are made; -!! The vertical turbulent fluxes are computed in an off-centered -!! implicit scheme (a Crank-Nicholson type with coefficients different -!! than 0.5), which allows to vary the degree of implicitness of the -!! formulation. -!! The different prognostic variables are treated one by one. -!! The contributions of each turbulent fluxes are cumulated into the -!! tendency PRvarS, and into the dynamic and thermal production of -!! TKE if necessary. -!! -!! In section 2 and 3, the thermodynamical fields are considered. -!! Only the turbulent fluxes of the conservative variables -!! (Thetal and Rnp stored in PRx(:,:,:,1)) are computed. -!! Note that the turbulent fluxes at the vertical -!! boundaries are given either by the soil scheme for the surface one -!! ( at the same instant as the others fluxes) and equal to 0 at the -!! top of the model. The thermal production is computed by vertically -!! averaging the turbulent flux and multiply this flux at the mass point by -!! a function ETHETA or EMOIST, which preform the transformation from the -!! conservative variables to the virtual potential temperature. -!! -!! In section 4, the variance of the statistical variable -!! s indicating presence or not of condensation, is determined in function -!! of the turbulent moments of the conservative variables and its -!! squarred root is stored in PSIGS. This information will be completed in -!! the horizontal turbulence if the turbulence dimensionality is not -!! equal to "1DIM". -!! -!! In section 5, the x component of the stress tensor is computed. -!! The surface flux <u'w'> is computed from the value of the surface -!! fluxes computed in axes linked to the orography ( i", j" , k"): -!! i" is parallel to the surface and in the direction of the maximum -!! slope -!! j" is also parallel to the surface and in the normal direction of -!! the maximum slope -!! k" is the normal to the surface -!! In order to prevent numerical instability, the implicit scheme has -!! been extended to the surface flux regarding to its dependence in -!! function of U. The dependence in function of the other components -!! introduced by the different rotations is only explicit. -!! The turbulent fluxes are used to compute the dynamic production of -!! TKE. For the last TKE level ( located at PDZZ(:,:,IKB)/2 from the -!! ground), an harmonic extrapolation from the dynamic production at -!! PDZZ(:,:,IKB) is used to avoid an evaluation of the gradient of U -!! in the surface layer. -!! -!! In section 6, the same steps are repeated but for the y direction -!! and in section 7, a diagnostic computation of the W variance is -!! performed. -!! -!! In section 8, the turbulent fluxes for the scalar variables are -!! computed by the same way as the conservative thermodynamical variables -!! -!! -!! EXTERNAL -!! -------- -!! GX_U_M, GY_V_M, GZ_W_M : cartesian gradient operators -!! GX_U_UW,GY_V_VW (X,Y,Z) represent the direction of the gradient -!! _(M,U,...)_ represent the localization of the -!! field to be derivated -!! _(M,UW,...) represent the localization of the -!! field derivated -!! -!! SUBROUTINE TRIDIAG : to compute the split implicit evolution -!! of a variable located at a mass point -!! -!! SUBROUTINE TRIDIAG_WIND: to compute the split implicit evolution -!! of a variable located at a wind point -!! -!! FUNCTIONs ETHETA and EMOIST : -!! allows to compute: -!! - the coefficients for the turbulent correlation between -!! any variable and the virtual potential temperature, of its -!! correlations with the conservative potential temperature and -!! the humidity conservative variable: -!! ------- ------- ------- -!! A' Thv' = ETHETA A' Thl' + EMOIST A' Rnp' -!! -!! -!! IMPLICIT ARGUMENTS -!! ------------------ -!! Module MODD_CST : contains physical constants -!! -!! XG : gravity constant -!! -!! Module MODD_CTURB: contains the set of constants for -!! the turbulence scheme -!! -!! XCMFS,XCMFB : cts for the momentum flux -!! XCSHF : ct for the sensible heat flux -!! XCHF : ct for the moisture flux -!! XCTV,XCHV : cts for the T and moisture variances -!! -!! Module MODD_PARAMETERS -!! -!! JPVEXT_TURB : number of vertical external points -!! JPHEXT : number of horizontal external points -!! -!! -!! REFERENCE -!! --------- -!! Book 1 of documentation (Chapter: Turbulence) -!! -!! AUTHOR -!! ------ -!! Joan Cuxart * INM and Meteo-France * -!! -!! MODIFICATIONS -!! ------------- -!! Original August 19, 1994 -!! Modifications: February 14, 1995 (J.Cuxart and J.Stein) -!! Doctorization and Optimization -!! Modifications: March 21, 1995 (J.M. Carriere) -!! Introduction of cloud water -!! Modifications: June 14, 1995 (J.Cuxart and J. Stein) -!! Phi3 and Psi3 at w-point + bug in the all -!! or nothing condens. -!! Modifications: Sept 15, 1995 (J.Cuxart and J. Stein) -!! Change the DP computation at the ground -!! Modifications: October 10, 1995 (J.Cuxart and J. Stein) -!! Psi for scal var and LES tools -!! Modifications: November 10, 1995 (J. Stein) -!! change the surface relations -!! Modifications: February 20, 1995 (J. Stein) optimization -!! Modifications: May 21, 1996 (J. Stein) -!! bug in the vertical flux of the V wind -!! component for explicit computation -!! Modifications: May 21, 1996 (N. wood) -!! modify the computation of the vertical -!! part or the surface tangential flux -!! Modifications: May 21, 1996 (P. Jabouille) -!! same modification in the Y direction -!! -!! Modifications: Sept 17, 1996 (J. Stein) change the moist case by using -!! Pi instead of Piref + use Atheta and Amoist -!! -!! Modifications: Nov 24, 1997 (V. Masson) removes the DO loops -!! Modifications: Mar 31, 1998 (V. Masson) splits the routine TURB_VER -!! Nov 06, 2002 (V. Masson) LES budgets -!! Feb 20, 2003 (JP Pinty) Add PFRAC_ICE -!! July 2005 (S. Tomas, V. Masson) -!! Add 3rd order moments and -!! implicitation of PHI3, PSI3 -!! Oct.2009 (C.Lac) Introduction of different PTSTEP according to the -!! advection schemes -!! Feb. 2012 (Y. Seity) add possibility to run with -!! reversed vertical levels -!! 10/2012 (J.Escobar) Bypass PGI bug , redefine some allocatable array inplace of automatic -!! 08/2014 (J.Escobar) Bypass PGI memory leak bug , replace IF statement with IF THEN ENDIF -!! Modifications: July, 2015 (Wim de Rooy) switch for HARATU (Racmo turbulence scheme) -!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O -!! JL Redelsperger 03/2021 : add Ocean LES case -!!-------------------------------------------------------------------------- -! -!* 0. DECLARATIONS -! ------------ -! -USE PARKIND1, ONLY : JPRB -USE YOMHOOK , ONLY : LHOOK, DR_HOOK -! -USE MODD_CST -USE MODD_CTURB -USE MODD_DYN_n, ONLY: LOCEAN -USE MODD_FIELD, ONLY: TFIELDDATA, TYPEREAL -USE MODD_IO, ONLY: TFILEDATA -USE MODD_PARAMETERS -USE MODD_LES -USE MODD_NSV, ONLY: NSV -! -!USE MODE_PRANDTL, ONLY: PRANDTL -USE MODE_EMOIST, ONLY: EMOIST -USE MODE_ETHETA, ONLY: ETHETA -USE MODI_GRADIENT_M -USE MODI_GRADIENT_W -!USE MODI_TURB -USE MODE_TURB_VER_THERMO_FLUX, ONLY: TURB_VER_THERMO_FLUX -USE MODE_TURB_VER_THERMO_CORR, ONLY: TURB_VER_THERMO_CORR -USE MODE_TURB_VER_DYN_FLUX, ONLY: TURB_VER_DYN_FLUX -USE MODE_TURB_VER_SV_FLUX, ONLY: TURB_VER_SV_FLUX -USE MODE_TURB_VER_SV_CORR, ONLY: TURB_VER_SV_CORR -USE MODI_LES_MEAN_SUBGRID -USE MODE_SBL_DEPTH, ONLY: SBL_DEPTH -USE MODI_SECOND_MNH -! -USE MODE_IO_FIELD_WRITE, only: IO_Field_write -USE MODE_PRANDTL -! -! -IMPLICIT NONE -! -!* 0.1 declarations of arguments -! -! -! -INTEGER, INTENT(IN) :: KKA !near ground array index -INTEGER, INTENT(IN) :: KKU !uppest atmosphere array index -INTEGER, INTENT(IN) :: KKL !vert. levels type 1=MNH -1=ARO -INTEGER, INTENT(IN) :: KRR ! number of moist var. -INTEGER, INTENT(IN) :: KRRL ! number of liquid water var. -INTEGER, INTENT(IN) :: KRRI ! number of ice water var. -LOGICAL, INTENT(IN) :: OTURB_FLX ! switch to write the - ! turbulent fluxes in the syncronous FM-file -CHARACTER(len=4), INTENT(IN) :: HTURBDIM ! dimensionality of the - ! turbulence scheme -CHARACTER(len=4), INTENT(IN) :: HTOM ! type of Third Order Moment -REAL, INTENT(IN) :: PIMPL, PEXPL ! Coef. for temporal disc. -REAL, INTENT(IN) :: PTSTEP ! timestep -TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! Output file -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PDXX, PDYY, PDZZ, PDZX, PDZY - ! Metric coefficients -REAL, DIMENSION(:,:), INTENT(IN) :: PDIRCOSZW ! Director Cosinus of the - ! normal to the ground surface -REAL, DIMENSION(:,:,:), INTENT(IN) :: PZZ ! altitudes at flux points -REAL, DIMENSION(:,:), INTENT(IN) :: PCOSSLOPE ! cosinus of the angle - ! between i and the slope vector -REAL, DIMENSION(:,:), INTENT(IN) :: PSINSLOPE ! sinus of the angle - ! between i and the slope vector -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! dry density * grid volum -! MFMOIST used in case of LHARATU -REAL, DIMENSION(:,:,:), INTENT(IN) :: MFMOIST ! moist mass flux dual scheme - -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHVREF ! ref. state Virtual - ! Potential Temperature -! -REAL, DIMENSION(:,:), INTENT(IN) :: PSFTHM,PSFRM ! surface fluxes at time -REAL, DIMENSION(:,:,:), INTENT(IN) :: PSFSVM ! t - deltat -! -REAL, DIMENSION(:,:), INTENT(IN) :: PSFTHP,PSFRP ! surface fluxes at time -REAL, DIMENSION(:,:,:), INTENT(IN) :: PSFSVP ! t + deltat -! -REAL, DIMENSION(:,:), INTENT(IN) :: PCDUEFF ! Cd * || u || at time t -REAL, DIMENSION(:,:), INTENT(IN) :: PTAU11M ! <uu> in the axes linked - ! to the maximum slope direction and the surface normal and the binormal - ! at time t - dt -REAL, DIMENSION(:,:), INTENT(IN) :: PTAU12M ! <uv> in the same axes -REAL, DIMENSION(:,:), INTENT(IN) :: PTAU33M ! <ww> in the same axes -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PUM,PVM,PWM,PTHLM - ! Wind and potential temperature at t-Delta t -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRM ! Mixing ratios - ! at t-Delta t -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PSVM ! scalar var. at t-Delta t -REAL, DIMENSION(:,:), INTENT(IN) :: PUSLOPEM ! wind component along the - ! maximum slope direction -REAL, DIMENSION(:,:), INTENT(IN) :: PVSLOPEM ! wind component along the - ! direction normal to the maximum slope one -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTKEM ! TKE at time t -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLM ! Turb. mixing length -! PLENGTHM PLENGTHH used in case of LHARATU -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLENGTHM ! Turb. mixing length momentum -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLENGTHH ! Turb. mixing length heat/moisture -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLEPS ! dissipative length -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLOCPEXNM ! Lv(T)/Cp/Exnref at time t-1 -REAL, DIMENSION(:,:,:), INTENT(IN) :: PATHETA ! coefficients between -REAL, DIMENSION(:,:,:), INTENT(IN) :: PAMOIST ! s and Thetal and Rnp -REAL, DIMENSION(:,:,:), INTENT(IN) :: PSRCM ! normalized - ! 2nd-order flux s'r'c/2Sigma_s2 at t-1 multiplied by Lambda_3 -REAL, DIMENSION(:,:,:), INTENT(IN) :: PFRAC_ICE ! ri fraction of rc+ri -REAL, DIMENSION(:,:,:), INTENT(IN) :: PFWTH ! d(w'2th' )/dz -REAL, DIMENSION(:,:,:), INTENT(IN) :: PFWR ! d(w'2r' )/dz -REAL, DIMENSION(:,:,:), INTENT(IN) :: PFTH2 ! d(w'th'2 )/dz -REAL, DIMENSION(:,:,:), INTENT(IN) :: PFR2 ! d(w'r'2 )/dz -REAL, DIMENSION(:,:,:), INTENT(IN) :: PFTHR ! d(w'th'r')/dz -REAL, DIMENSION(:,:), INTENT(INOUT):: PBL_DEPTH ! BL depth -REAL, DIMENSION(:,:), INTENT(INOUT):: PSBL_DEPTH ! SBL depth -REAL, DIMENSION(:,:), INTENT(IN) :: PLMO ! Monin-Obukhov length -! -REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRUS, PRVS, PRWS, PRTHLS -REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRSVS,PRRS - ! cumulated sources for the prognostic variables -! -REAL, DIMENSION(:,:,:), INTENT(OUT) :: PDP,PTP ! Dynamic and thermal - ! TKE production terms -REAL, DIMENSION(:,:,:), INTENT(OUT) :: PSIGS ! Vert. part of Sigma_s at t -REAL, DIMENSION(:,:,:), INTENT(OUT) :: PWTH ! heat flux -REAL, DIMENSION(:,:,:), INTENT(OUT) :: PWRC ! cloud water flux -REAL, DIMENSION(:,:,:,:),INTENT(OUT) :: PWSV ! scalar flux - -! -! -! -! -!* 0.2 declaration of local variables -! -!JUAN BUG PGI -!!$REAL, DIMENSION(SIZE(PTHLM,1),SIZE(PTHLM,2),SIZE(PTHLM,3)) :: & -REAL, ALLOCATABLE, DIMENSION(:,:,:) :: & - ZBETA, & ! buoyancy coefficient - ZSQRT_TKE,& ! sqrt(e) - ZDTH_DZ, & ! d(th)/dz - ZDR_DZ, & ! d(rt)/dz - ZRED2TH3, & ! 3D Redeslperger number R*2_th - ZRED2R3, & ! 3D Redeslperger number R*2_r - ZRED2THR3,& ! 3D Redeslperger number R*2_thr - ZBLL_O_E, & ! beta * Lk * Leps / tke - ZETHETA, & ! Coefficient for theta in theta_v computation - ZEMOIST, & ! Coefficient for r in theta_v computation - ZREDTH1, & ! 1D Redelsperger number for Th - ZREDR1, & ! 1D Redelsperger number for r - ZPHI3, & ! phi3 Prandtl number - ZPSI3, & ! psi3 Prandtl number for vapor - ZD, & ! denominator in phi3 terms - ZWTHV, & ! buoyancy flux - ZWU, & ! (u'w') - ZWV, & ! (v'w') - ZTHLP, & ! guess of potential temperature due to vert. turbulent flux - ZRP ! guess of total water due to vert. turbulent flux - -!!$REAL, DIMENSION(SIZE(PTHLM,1),SIZE(PTHLM,2),SIZE(PTHLM,3),NSV) :: & -REAL, ALLOCATABLE, DIMENSION(:,:,:,:) :: & - ZPSI_SV, & ! Prandtl number for scalars - ZREDS1, & ! 1D Redelsperger number R_sv - ZRED2THS, & ! 3D Redelsperger number R*2_thsv - ZRED2RS ! 3D Redelsperger number R*2_rsv -REAL, DIMENSION(SIZE(PLM,1),SIZE(PLM,2),SIZE(PLM,3)) :: ZLM -! -LOGICAL :: GUSERV ! flag to use water vapor -INTEGER :: IKB,IKE ! index value for the Beginning - ! and the End of the physical domain for the mass points -INTEGER :: JSV ! loop counter on scalar variables -REAL :: ZTIME1 -REAL :: ZTIME2 -REAL(KIND=JPRB) :: ZHOOK_HANDLE -TYPE(TFIELDDATA) :: TZFIELD -!---------------------------------------------------------------------------- -ALLOCATE ( ZBETA(SIZE(PTHLM,1),SIZE(PTHLM,2),SIZE(PTHLM,3)) ,& - ZSQRT_TKE(SIZE(PTHLM,1),SIZE(PTHLM,2),SIZE(PTHLM,3)),& - ZDTH_DZ(SIZE(PTHLM,1),SIZE(PTHLM,2),SIZE(PTHLM,3)) ,& - ZDR_DZ(SIZE(PTHLM,1),SIZE(PTHLM,2),SIZE(PTHLM,3)) ,& - ZRED2TH3(SIZE(PTHLM,1),SIZE(PTHLM,2),SIZE(PTHLM,3)) ,& - ZRED2R3(SIZE(PTHLM,1),SIZE(PTHLM,2),SIZE(PTHLM,3)) ,& - ZRED2THR3(SIZE(PTHLM,1),SIZE(PTHLM,2),SIZE(PTHLM,3)),& - ZBLL_O_E(SIZE(PTHLM,1),SIZE(PTHLM,2),SIZE(PTHLM,3)) ,& - ZETHETA(SIZE(PTHLM,1),SIZE(PTHLM,2),SIZE(PTHLM,3)) ,& - ZEMOIST(SIZE(PTHLM,1),SIZE(PTHLM,2),SIZE(PTHLM,3)) ,& - ZREDTH1(SIZE(PTHLM,1),SIZE(PTHLM,2),SIZE(PTHLM,3)) ,& - ZREDR1(SIZE(PTHLM,1),SIZE(PTHLM,2),SIZE(PTHLM,3)) ,& - ZPHI3(SIZE(PTHLM,1),SIZE(PTHLM,2),SIZE(PTHLM,3)) ,& - ZPSI3(SIZE(PTHLM,1),SIZE(PTHLM,2),SIZE(PTHLM,3)) ,& - ZD(SIZE(PTHLM,1),SIZE(PTHLM,2),SIZE(PTHLM,3)) ,& - ZWTHV(SIZE(PTHLM,1),SIZE(PTHLM,2),SIZE(PTHLM,3)) ,& - ZWU(SIZE(PTHLM,1),SIZE(PTHLM,2),SIZE(PTHLM,3)) ,& - ZWV(SIZE(PTHLM,1),SIZE(PTHLM,2),SIZE(PTHLM,3)) ,& - ZTHLP(SIZE(PTHLM,1),SIZE(PTHLM,2),SIZE(PTHLM,3)) ,& - ZRP(SIZE(PTHLM,1),SIZE(PTHLM,2),SIZE(PTHLM,3)) ) - -ALLOCATE ( & - ZPSI_SV(SIZE(PTHLM,1),SIZE(PTHLM,2),SIZE(PTHLM,3),NSV), & - ZREDS1(SIZE(PTHLM,1),SIZE(PTHLM,2),SIZE(PTHLM,3),NSV), & - ZRED2THS(SIZE(PTHLM,1),SIZE(PTHLM,2),SIZE(PTHLM,3),NSV), & - ZRED2RS(SIZE(PTHLM,1),SIZE(PTHLM,2),SIZE(PTHLM,3),NSV) ) - -!---------------------------------------------------------------------------- -! -!* 1. PRELIMINARIES -! ------------- -! -IF (LHOOK) CALL DR_HOOK('TURB_VER',0,ZHOOK_HANDLE) -! -IKB=KKA+JPVEXT_TURB*KKL -IKE=KKU-JPVEXT_TURB*KKL -! -! -! 3D Redelsperger numbers -! -! -CALL PRANDTL(KKA,KKU,KKL,KRR,KRRI,OTURB_FLX, & - HTURBDIM, & - TPFILE, & - PDXX,PDYY,PDZZ,PDZX,PDZY, & - PTHVREF,PLOCPEXNM,PATHETA,PAMOIST, & - PLM,PLEPS,PTKEM,PTHLM,PRM,PSVM,PSRCM, & - ZREDTH1, ZREDR1, & - ZRED2TH3, ZRED2R3, ZRED2THR3, & - ZREDS1,ZRED2THS, ZRED2RS, & - ZBLL_O_E, & - ZETHETA, ZEMOIST ) -! -! Buoyancy coefficient -! -IF (LOCEAN) THEN - ZBETA = XG*XALPHAOC -ELSE - ZBETA = XG/PTHVREF -END IF -! -! Square root of Tke -! -ZSQRT_TKE = SQRT(PTKEM) -! -! gradients of mean quantities at previous time-step -! -ZDTH_DZ = GZ_M_W(KKA, KKU, KKL,PTHLM(:,:,:),PDZZ) -ZDR_DZ = 0. -IF (KRR>0) ZDR_DZ = GZ_M_W(KKA, KKU, KKL,PRM(:,:,:,1),PDZZ) -! -! -! Denominator factor in 3rd order terms -! -IF (.NOT. LHARAT) THEN - ZD(:,:,:) = (1.+ZREDTH1+ZREDR1) * (1.+0.5*(ZREDTH1+ZREDR1)) -ELSE - ZD(:,:,:) = 1. -ENDIF -! -! Phi3 and Psi3 Prandtl numbers -! -GUSERV = KRR/=0 -! -ZPHI3 = PHI3(ZREDTH1,ZREDR1,ZRED2TH3,ZRED2R3,ZRED2THR3,HTURBDIM,GUSERV) -IF(KRR/=0) & -ZPSI3 = PSI3(ZREDR1,ZREDTH1,ZRED2R3,ZRED2TH3,ZRED2THR3,HTURBDIM,GUSERV) -! -! Prandtl numbers for scalars -! -ZPSI_SV = PSI_SV(ZREDTH1,ZREDR1,ZREDS1,ZRED2THS,ZRED2RS,ZPHI3,ZPSI3) -! -! LES diagnostics -! -IF (LLES_CALL) THEN - CALL SECOND_MNH(ZTIME1) - CALL LES_MEAN_SUBGRID(ZPHI3,X_LES_SUBGRID_PHI3) - IF(KRR/=0) THEN - CALL LES_MEAN_SUBGRID(ZPSI3,X_LES_SUBGRID_PSI3) - END IF - CALL SECOND_MNH(ZTIME2) - XTIME_LES = XTIME_LES + ZTIME2 - ZTIME1 -END IF -!---------------------------------------------------------------------------- -! -! -!* 2. SOURCES OF CONSERVATIVE POTENTIAL TEMPERATURE AND -! PARTIAL THERMAL PRODUCTION -! --------------------------------------------------------------- -! -!* 3. SOURCES OF CONSERVATIVE AND CLOUD MIXING RATIO AND -! COMPLETE THERMAL PRODUCTION -! ------------------------------------------------------ -! -!* 4. TURBULENT CORRELATIONS : <w Rc>, <THl THl>, <THl Rnp>, <Rnp Rnp> -! ---------------------------------------------------------------- -! - -IF (LHARAT) THEN - ZLM=PLENGTHH -ELSE - ZLM=PLM -ENDIF -! - CALL TURB_VER_THERMO_FLUX(KKA,KKU,KKL,KRR,KRRL,KRRI, & - OTURB_FLX,HTURBDIM,HTOM, & - PIMPL,PEXPL,PTSTEP, & - TPFILE, & - PDXX,PDYY,PDZZ,PDZX,PDZY,PDIRCOSZW,PZZ, & - PRHODJ,PTHVREF, & - PSFTHM,PSFRM,PSFTHP,PSFRP, & - PWM,PTHLM,PRM,PSVM, & - PTKEM,ZLM,PLEPS, & - PLOCPEXNM,PATHETA,PAMOIST,PSRCM,PFRAC_ICE, & - ZBETA, ZSQRT_TKE, ZDTH_DZ, ZDR_DZ, ZRED2TH3, & - ZRED2R3, ZRED2THR3, ZBLL_O_E, ZETHETA, & - ZEMOIST, ZREDTH1, ZREDR1, ZPHI3, ZPSI3, ZD, & - PFWTH,PFWR,PFTH2,PFR2,PFTHR, & - MFMOIST,PBL_DEPTH,ZWTHV, & - PRTHLS,PRRS,ZTHLP,ZRP,PTP,PWTH,PWRC ) -! - CALL TURB_VER_THERMO_CORR(KKA,KKU,KKL,KRR,KRRL,KRRI, & - OTURB_FLX,HTURBDIM,HTOM, & - PIMPL,PEXPL, & - TPFILE, & - PDXX,PDYY,PDZZ,PDZX,PDZY,PDIRCOSZW, & - PRHODJ,PTHVREF, & - PSFTHM,PSFRM,PSFTHP,PSFRP, & - PWM,PTHLM,PRM,PSVM, & - PTKEM,ZLM,PLEPS, & - PLOCPEXNM,PATHETA,PAMOIST,PSRCM, & - ZBETA, ZSQRT_TKE, ZDTH_DZ, ZDR_DZ, ZRED2TH3, & - ZRED2R3, ZRED2THR3, ZBLL_O_E, ZETHETA, & - ZEMOIST, ZREDTH1, ZREDR1, ZPHI3, ZPSI3, ZD, & - PFWTH,PFWR,PFTH2,PFR2,PFTHR, & - ZTHLP,ZRP,MFMOIST,PSIGS ) -! -!---------------------------------------------------------------------------- -! -! -! -!* 5. SOURCES OF U,W WIND COMPONENTS AND PARTIAL DYNAMIC PRODUCTION -! ------------------------------------------------------------- -! -!* 6. SOURCES OF V,W WIND COMPONENTS AND COMPLETE 1D DYNAMIC PRODUCTION -! ----------------------------------------------------------------- -! -!* 7. DIAGNOSTIC COMPUTATION OF THE 1D <W W> VARIANCE -! ----------------------------------------------- -! -! -IF (LHARAT) ZLM=PLENGTHM -! -CALL TURB_VER_DYN_FLUX(KKA,KKU,KKL, & - OTURB_FLX,KRR, & - HTURBDIM,PIMPL,PEXPL,PTSTEP, & - TPFILE, & - PDXX,PDYY,PDZZ,PDZX,PDZY,PDIRCOSZW,PZZ, & - PCOSSLOPE,PSINSLOPE, & - PRHODJ, & - PCDUEFF,PTAU11M,PTAU12M,PTAU33M, & - PTHLM,PRM,PSVM,PUM,PVM,PWM,PUSLOPEM,PVSLOPEM, & - PTKEM,ZLM,MFMOIST,ZWU,ZWV, & - PRUS,PRVS,PRWS, & - PDP,PTP ) -! -!---------------------------------------------------------------------------- -! -! -!* 8. SOURCES OF PASSIVE SCALAR VARIABLES -! ----------------------------------- -! -IF (LHARAT) ZLM=PLENGTHH -! -IF (SIZE(PSVM,4)>0) & -CALL TURB_VER_SV_FLUX(KKA,KKU,KKL, & - OTURB_FLX,HTURBDIM, & - PIMPL,PEXPL,PTSTEP, & - TPFILE, & - PDZZ,PDIRCOSZW, & - PRHODJ,PWM, & - PSFSVM,PSFSVP, & - PSVM, & - PTKEM,ZLM,MFMOIST,ZPSI_SV, & - PRSVS,PWSV ) -! -! -IF (SIZE(PSVM,4)>0 .AND. LLES_CALL) & -CALL TURB_VER_SV_CORR(KKA,KKU,KKL,KRR,KRRL,KRRI, & - PDZZ, & - PTHLM,PRM,PTHVREF, & - PLOCPEXNM,PATHETA,PAMOIST,PSRCM,ZPHI3,ZPSI3, & - PWM,PSVM, & - PTKEM,ZLM,PLEPS,ZPSI_SV ) -! -! -!---------------------------------------------------------------------------- -! -!* 9. DIAGNOSTIC OF Surface Boundary Layer Depth -! ------------------------------------------ -! -IF (SIZE(PSBL_DEPTH)>0) CALL SBL_DEPTH(IKB,IKE,PZZ,ZWU,ZWV,ZWTHV,PLMO,PSBL_DEPTH) -! -!---------------------------------------------------------------------------- -! -! -!* 10. PRINTS -! ------ -! -! -IF ( OTURB_FLX .AND. TPFILE%LOPENED .AND. .NOT. LHARAT) THEN -! -! stores the Turbulent Prandtl number -! - TZFIELD%CMNHNAME = 'PHI3' - TZFIELD%CSTDNAME = '' - TZFIELD%CLONGNAME = 'PHI3' - TZFIELD%CUNITS = '1' - TZFIELD%CDIR = 'XY' - TZFIELD%CCOMMENT = 'Turbulent Prandtl number' - TZFIELD%NGRID = 4 - TZFIELD%NTYPE = TYPEREAL - TZFIELD%NDIMS = 3 - TZFIELD%LTIMEDEP = .TRUE. - CALL IO_Field_write(TPFILE,TZFIELD,ZPHI3) -! -! stores the Turbulent Schmidt number -! - TZFIELD%CMNHNAME = 'PSI3' - TZFIELD%CSTDNAME = '' - TZFIELD%CLONGNAME = 'PSI3' - TZFIELD%CUNITS = '1' - TZFIELD%CDIR = 'XY' - TZFIELD%CCOMMENT = 'Turbulent Schmidt number' - TZFIELD%NGRID = 4 - TZFIELD%NTYPE = TYPEREAL - TZFIELD%NDIMS = 3 - TZFIELD%LTIMEDEP = .TRUE. - CALL IO_Field_write(TPFILE,TZFIELD,ZPSI3) -! -! -! stores the Turbulent Schmidt number for the scalar variables -! - TZFIELD%CSTDNAME = '' - TZFIELD%CUNITS = '1' - TZFIELD%CDIR = 'XY' - TZFIELD%NGRID = 4 - TZFIELD%NTYPE = TYPEREAL - TZFIELD%NDIMS = 3 - TZFIELD%LTIMEDEP = .TRUE. - DO JSV=1,NSV - WRITE(TZFIELD%CMNHNAME, '("PSI_SV_",I3.3)') JSV - TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) - TZFIELD%CCOMMENT = 'X_Y_Z_'//TRIM(TZFIELD%CMNHNAME) - CALL IO_Field_write(TPFILE,TZFIELD,ZPSI_SV(:,:,:,JSV)) - END DO -! -END IF -! -! -!---------------------------------------------------------------------------- -IF (LHOOK) CALL DR_HOOK('TURB_VER',1,ZHOOK_HANDLE) -END SUBROUTINE TURB_VER -END MODULE MODE_TURB_VER diff --git a/src/mesonh/turb/mode_turb_ver_dyn_flux.f90 b/src/mesonh/turb/mode_turb_ver_dyn_flux.f90 deleted file mode 100644 index 4e01503a6..000000000 --- a/src/mesonh/turb/mode_turb_ver_dyn_flux.f90 +++ /dev/null @@ -1,864 +0,0 @@ -!MNH_LIC Copyright 1994-2021 CNRS, Meteo-France and Universite Paul Sabatier -!MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence -!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt -!MNH_LIC for details. version 1. -MODULE MODE_TURB_VER_DYN_FLUX -IMPLICIT NONE -CONTAINS -SUBROUTINE TURB_VER_DYN_FLUX(KKA,KKU,KKL, & - OTURB_FLX,KRR, & - HTURBDIM,PIMPL,PEXPL, & - PTSTEP, & - TPFILE, & - PDXX,PDYY,PDZZ,PDZX,PDZY,PDIRCOSZW,PZZ, & - PCOSSLOPE,PSINSLOPE, & - PRHODJ, & - PCDUEFF,PTAU11M,PTAU12M,PTAU33M, & - PTHLM,PRM,PSVM,PUM,PVM,PWM,PUSLOPEM,PVSLOPEM, & - PTKEM,PLM,MFMOIST,PWU,PWV, & - PRUS,PRVS,PRWS, & - PDP,PTP ) -! ############################################################### -! -! -!!**** *TURB_VER_DYN_FLUX* -compute the source terms due to the vertical turbulent -!! fluxes. -!! -!! PURPOSE -!! ------- -! The purpose of this routine is to compute the vertical turbulent -! fluxes of the evolutive variables and give back the source -! terms to the main program. In the case of large horizontal meshes, -! the divergence of these vertical turbulent fluxes represent the whole -! effect of the turbulence but when the three-dimensionnal version of -! the turbulence scheme is activated (CTURBDIM="3DIM"), these divergences -! are completed in the next routine TURB_HOR. -! An arbitrary degree of implicitness has been implemented for the -! temporal treatment of these diffusion terms. -! The vertical boundary conditions are as follows: -! * at the bottom, the surface fluxes are prescribed at the same -! as the other turbulent fluxes -! * at the top, the turbulent fluxes are set to 0. -! It should be noted that the condensation has been implicitely included -! in this turbulence scheme by using conservative variables and computing -! the subgrid variance of a statistical variable s indicating the presence -! or not of condensation in a given mesh. -! -!!** METHOD -!! ------ -!! 1D type calculations are made; -!! The vertical turbulent fluxes are computed in an off-centered -!! implicit scheme (a Crank-Nicholson type with coefficients different -!! than 0.5), which allows to vary the degree of implicitness of the -!! formulation. -!! The different prognostic variables are treated one by one. -!! The contributions of each turbulent fluxes are cumulated into the -!! tendency PRvarS, and into the dynamic and thermal production of -!! TKE if necessary. -!! -!! In section 2 and 3, the thermodynamical fields are considered. -!! Only the turbulent fluxes of the conservative variables -!! (Thetal and Rnp stored in PRx(:,:,:,1)) are computed. -!! Note that the turbulent fluxes at the vertical -!! boundaries are given either by the soil scheme for the surface one -!! ( at the same instant as the others fluxes) and equal to 0 at the -!! top of the model. The thermal production is computed by vertically -!! averaging the turbulent flux and multiply this flux at the mass point by -!! a function ETHETA or EMOIST, which preform the transformation from the -!! conservative variables to the virtual potential temperature. -!! -!! In section 4, the variance of the statistical variable -!! s indicating presence or not of condensation, is determined in function -!! of the turbulent moments of the conservative variables and its -!! squarred root is stored in PSIGS. This information will be completed in -!! the horizontal turbulence if the turbulence dimensionality is not -!! equal to "1DIM". -!! -!! In section 5, the x component of the stress tensor is computed. -!! The surface flux <u'w'> is computed from the value of the surface -!! fluxes computed in axes linked to the orography ( i", j" , k"): -!! i" is parallel to the surface and in the direction of the maximum -!! slope -!! j" is also parallel to the surface and in the normal direction of -!! the maximum slope -!! k" is the normal to the surface -!! In order to prevent numerical instability, the implicit scheme has -!! been extended to the surface flux regarding to its dependence in -!! function of U. The dependence in function of the other components -!! introduced by the different rotations is only explicit. -!! The turbulent fluxes are used to compute the dynamic production of -!! TKE. For the last TKE level ( located at PDZZ(:,:,IKB)/2 from the -!! ground), an harmonic extrapolation from the dynamic production at -!! PDZZ(:,:,IKB) is used to avoid an evaluation of the gradient of U -!! in the surface layer. -!! -!! In section 6, the same steps are repeated but for the y direction -!! and in section 7, a diagnostic computation of the W variance is -!! performed. -!! -!! In section 8, the turbulent fluxes for the scalar variables are -!! computed by the same way as the conservative thermodynamical variables -!! -!! -!! EXTERNAL -!! -------- -!! GX_U_M, GY_V_M, GZ_W_M : cartesian gradient operators -!! GX_U_UW,GY_V_VW (X,Y,Z) represent the direction of the gradient -!! _(M,U,...)_ represent the localization of the -!! field to be derivated -!! _(M,UW,...) represent the localization of the -!! field derivated -!! -!! -!! MXM,MXF,MYM,MYF,MZM,MZF -!! : Shuman functions (mean operators) -!! DXF,DYF,DZF,DZM -!! : Shuman functions (difference operators) -!! -!! SUBROUTINE TRIDIAG_WIND: to compute the split implicit evolution -!! of a variable located at a wind point -!! -!! FUNCTIONs ETHETA and EMOIST : -!! allows to compute: -!! - the coefficients for the turbulent correlation between -!! any variable and the virtual potential temperature, of its -!! correlations with the conservative potential temperature and -!! the humidity conservative variable: -!! ------- ------- ------- -!! A' Thv' = ETHETA A' Thl' + EMOIST A' Rnp' -!! -!! -!! IMPLICIT ARGUMENTS -!! ------------------ -!! Module MODD_CST : contains physical constants -!! -!! XG : gravity constant -!! -!! Module MODD_CTURB: contains the set of constants for -!! the turbulence scheme -!! -!! XCMFS,XCMFB : cts for the momentum flux -!! XCSHF : ct for the sensible heat flux -!! XCHF : ct for the moisture flux -!! XCTV,XCHV : cts for the T and moisture variances -!! -!! Module MODD_PARAMETERS -!! -!! JPVEXT_TURB : number of vertical external points -!! JPHEXT : number of horizontal external points -!! -!! -!! REFERENCE -!! --------- -!! Book 1 of documentation (Chapter: Turbulence) -!! -!! AUTHOR -!! ------ -!! Joan Cuxart * INM and Meteo-France * -!! -!! MODIFICATIONS -!! ------------- -!! Original August 19, 1994 -!! Modifications: February 14, 1995 (J.Cuxart and J.Stein) -!! Doctorization and Optimization -!! Modifications: March 21, 1995 (J.M. Carriere) -!! Introduction of cloud water -!! Modifications: June 14, 1995 (J.Cuxart and J. Stein) -!! Phi3 and Psi3 at w-point + bug in the all -!! or nothing condens. -!! Modifications: Sept 15, 1995 (J.Cuxart and J. Stein) -!! Change the DP computation at the ground -!! Modifications: October 10, 1995 (J.Cuxart and J. Stein) -!! Psi for scal var and LES tools -!! Modifications: November 10, 1995 (J. Stein) -!! change the surface relations -!! Modifications: February 20, 1995 (J. Stein) optimization -!! Modifications: May 21, 1996 (J. Stein) -!! bug in the vertical flux of the V wind -!! component for explicit computation -!! Modifications: May 21, 1996 (N. wood) -!! modify the computation of the vertical -!! part or the surface tangential flux -!! Modifications: May 21, 1996 (P. Jabouille) -!! same modification in the Y direction -!! -!! Modifications: Sept 17, 1996 (J. Stein) change the moist case by using -!! Pi instead of Piref + use Atheta and Amoist -!! -!! Modifications: Nov 24, 1997 (V. Masson) removes the DO loops -!! Modifications: Mar 31, 1998 (V. Masson) splits the routine TURB_VER_DYN_FLUX -!! Modifications: Oct 18, 2000 (J. Stein) Bug in some computations for IKB level -!! Modifications: Oct 18, 2000 (V. Masson) LES computations + LFLAT switch -!! Nov 06, 2002 (V. Masson) LES budgets -!! October 2009 (G. Tanguy) add ILENCH=LEN(YCOMMENT) after -!! change of YCOMMENT -!! 2012-02 Y. Seity, add possibility to run with reversed vertical levels -!! Modifications July 2015 (Wim de Rooy) LHARATU switch -!! J.Escobar : 15/09/2015 : WENO5 & JPHEXT <> 1 -!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O -!! Q. Rodier 17/01/2019 : cleaning : remove cyclic conditions on DP and ZA -!! JL Redelsperger 03/2021 : Add Ocean & O-A Autocoupling LES Cases -!!-------------------------------------------------------------------------- -! -!* 0. DECLARATIONS -! ------------ -! -USE PARKIND1, ONLY : JPRB -USE YOMHOOK , ONLY : LHOOK, DR_HOOK -! -USE MODD_CONF -USE MODD_CST -USE MODD_CTURB -USE MODD_DYN_n, ONLY: LOCEAN -USE MODD_FIELD, ONLY: TFIELDDATA, TYPEREAL -USE MODD_IO, ONLY: TFILEDATA -USE MODD_LES -USE MODD_NSV -USE MODD_OCEANH -USE MODD_PARAMETERS -USE MODD_REF, ONLY : LCOUPLES -USE MODD_TURB_n -! -! -USE MODI_GRADIENT_U -USE MODI_GRADIENT_V -USE MODI_GRADIENT_W -USE MODI_GRADIENT_M -USE MODI_SECOND_MNH -USE MODI_SHUMAN , ONLY: MZM, MZF, MXM, MXF, MYM, MYF,& - & DZM, DXF, DXM, DYF, DYM -USE MODE_TRIDIAG_WIND, ONLY: TRIDIAG_WIND -USE MODI_LES_MEAN_SUBGRID -! -USE MODE_IO_FIELD_WRITE, only: IO_Field_write -USE MODE_ll -! -IMPLICIT NONE -! -!* 0.1 declarations of arguments -! -! -! -INTEGER, INTENT(IN) :: KKA !near ground array index -INTEGER, INTENT(IN) :: KKU !uppest atmosphere array index -INTEGER, INTENT(IN) :: KKL !vert. levels type 1=MNH -1=ARO -LOGICAL, INTENT(IN) :: OTURB_FLX ! switch to write the - ! turbulent fluxes in the syncronous FM-file -INTEGER, INTENT(IN) :: KRR ! number of moist var. -CHARACTER(len=4), INTENT(IN) :: HTURBDIM ! dimensionality of the - ! turbulence scheme -REAL, INTENT(IN) :: PIMPL, PEXPL ! Coef. for temporal disc. -REAL, INTENT(IN) :: PTSTEP ! Double Time Step -TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! Output file -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PDXX, PDYY, PDZZ, PDZX, PDZY - ! Metric coefficients -REAL, DIMENSION(:,:), INTENT(IN) :: PDIRCOSZW ! Director Cosinus of the - ! normal to the ground surface -REAL, DIMENSION(:,:,:), INTENT(IN) :: PZZ ! altitude of flux points -REAL, DIMENSION(:,:), INTENT(IN) :: PCOSSLOPE ! cosinus of the angle - ! between i and the slope vector -REAL, DIMENSION(:,:), INTENT(IN) :: PSINSLOPE ! sinus of the angle - ! between i and the slope vector -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! dry density * grid volum -REAL, DIMENSION(:,:,:), INTENT(IN) :: MFMOIST ! moist mass flux dual scheme - -! -REAL, DIMENSION(:,:), INTENT(IN) :: PCDUEFF ! Cd * || u || at time t -REAL, DIMENSION(:,:), INTENT(IN) :: PTAU11M ! <uu> in the axes linked - ! to the maximum slope direction and the surface normal and the binormal - ! at time t - dt -REAL, DIMENSION(:,:), INTENT(IN) :: PTAU12M ! <uv> in the same axes -REAL, DIMENSION(:,:), INTENT(IN) :: PTAU33M ! <ww> in the same axes -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PUM,PVM,PWM, PTHLM - ! Wind at t-Delta t -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRM -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PSVM -REAL, DIMENSION(:,:), INTENT(IN) :: PUSLOPEM ! wind component along the - ! maximum slope direction -REAL, DIMENSION(:,:), INTENT(IN) :: PVSLOPEM ! wind component along the - ! direction normal to the maximum slope one -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTKEM ! TKE at time t -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLM ! Turb. mixing length -REAL, DIMENSION(:,:,:), INTENT(OUT) :: PWU ! momentum flux u'w' -REAL, DIMENSION(:,:,:), INTENT(OUT) :: PWV ! momentum flux v'w' -! -REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRUS, PRVS, PRWS - ! cumulated sources for the prognostic variables -! -REAL, DIMENSION(:,:,:), INTENT(OUT) :: PDP ! Dynamic TKE production term -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTP ! Thermal TKE production term -! -! -! -! -!* 0.2 declaration of local variables -! -! -REAL, DIMENSION(SIZE(PUM,1),SIZE(PUM,2)) :: ZDIRSINZW ! sinus of the angle - ! between the normal and the vertical at the surface -REAL, DIMENSION(SIZE(PUM,1),SIZE(PUM,2),1):: ZCOEFS ! coeff. for the - ! implicit scheme for the wind at the surface -REAL, DIMENSION(SIZE(PUM,1),SIZE(PUM,2),SIZE(PUM,3)) :: & - ZA, & ! under diagonal elements of the tri-diagonal matrix involved - ! in the temporal implicit scheme (also used to store coefficient - ! J in Section 5) - ZRES, & ! guess of the treated variable at t+ deltat when the turbu- - ! lence is the only source of evolution added to the ones - ! considered in ZSOURCE - ZFLXZ, & ! vertical flux of the treated variable - ZSOURCE, & ! source of evolution for the treated variable - ZKEFF ! effectif diffusion coeff = LT * SQRT( TKE ) -INTEGER :: IIB,IIE, & ! I index values for the Beginning and End - IJB,IJE, & ! mass points of the domain in the 3 direct. - IKB,IKE ! -INTEGER :: IKT ! array size in k direction -INTEGER :: IKTB,IKTE ! start, end of k loops in physical domain -INTEGER :: JSV ! scalar loop counter -REAL, DIMENSION(SIZE(PDZZ,1),SIZE(PDZZ,2),1) :: ZCOEFFLXU, & - ZCOEFFLXV, ZUSLOPEM, ZVSLOPEM - ! coefficients for the surface flux - ! evaluation and copy of PUSLOPEM and - ! PVSLOPEM in local 3D arrays -INTEGER :: IIU,IJU ! size of array in x,y,z directions -! -REAL :: ZTIME1, ZTIME2, ZCMFS -TYPE(TFIELDDATA) :: TZFIELD -!---------------------------------------------------------------------------- -! -!* 1. PRELIMINARIES -! ------------- -REAL(KIND=JPRB) :: ZHOOK_HANDLE -IF (LHOOK) CALL DR_HOOK('TURB_VER_DYN_FLUX',0,ZHOOK_HANDLE) -! -ZA=XUNDEF -PDP=XUNDEF -! -IIU=SIZE(PUM,1) -IJU=SIZE(PUM,2) -CALL GET_INDICE_ll (IIB,IJB,IIE,IJE,IIU,IJU) -IKB=KKA+JPVEXT_TURB*KKL -IKE=KKU-JPVEXT_TURB*KKL -IKB=KKA+JPVEXT_TURB*KKL -IKE=KKU-JPVEXT_TURB*KKL -IKT=SIZE(PUM,3) -IKTB=1+JPVEXT_TURB -IKTE=IKT-JPVEXT_TURB -! -ZSOURCE = 0. -ZFLXZ = 0. -ZCMFS = XCMFS -IF (LHARAT) ZCMFS=1. -! -ZDIRSINZW(:,:) = SQRT(1.-PDIRCOSZW(:,:)**2) -! compute the coefficients for the uncentred gradient computation near the -! ground -! -! With LHARATU length scale and TKE are at half levels so remove MZM -! -IF (LHARAT) THEN - ZKEFF(:,:,:) = PLM(:,:,:) * SQRT(PTKEM(:,:,:)) + 50*MFMOIST(:,:,:) -ELSE - ZKEFF(:,:,:) = MZM(PLM(:,:,:) * SQRT(PTKEM(:,:,:)), KKA, KKU, KKL) -ENDIF - -! -ZUSLOPEM(:,:,1)=PUSLOPEM(:,:) -ZVSLOPEM(:,:,1)=PVSLOPEM(:,:) -! -!---------------------------------------------------------------------------- -! -! -!* 5. SOURCES OF U,W WIND COMPONENTS AND PARTIAL DYNAMIC PRODUCTION -! ------------------------------------------------------------- -! -!* 5.1 Source of U wind component -! -! Preparation of the arguments for TRIDIAG_WIND -! -ZA(:,:,:) = -PTSTEP * ZCMFS * & - MXM( ZKEFF ) * MXM(MZM(PRHODJ, KKA, KKU, KKL)) / & - MXM( PDZZ )**2 -! -! -! Compute the source of U wind component -! -! compute the coefficient between the vertical flux and the 2 components of the -! wind following the slope -ZCOEFFLXU(:,:,1) = PCDUEFF(:,:) * (PDIRCOSZW(:,:)**2 - ZDIRSINZW(:,:)**2) & - * PCOSSLOPE(:,:) -ZCOEFFLXV(:,:,1) = PCDUEFF(:,:) * PDIRCOSZW(:,:) * PSINSLOPE(:,:) - -! prepare the implicit scheme coefficients for the surface flux -ZCOEFS(:,:,1)= ZCOEFFLXU(:,:,1) * PCOSSLOPE(:,:) * PDIRCOSZW(:,:) & - +ZCOEFFLXV(:,:,1) * PSINSLOPE(:,:) -! -! average this flux to be located at the U,W vorticity point -ZCOEFS(:,:,1:1)=MXM(ZCOEFS(:,:,1:1) / PDZZ(:,:,IKB:IKB) ) -! -! -! ZSOURCE= FLUX /DZ -IF (LOCEAN) THEN ! OCEAN MODEL ONLY - ! Sfx flux assumed to be in SI & at vorticity point - IF (LCOUPLES) THEN - ZSOURCE(:,:,IKE:IKE) = XSSUFL_C(:,:,1:1)/PDZZ(:,:,IKE:IKE) & - *0.5 * ( 1. + MXM(PRHODJ(:,:,KKU:KKU)) / MXM(PRHODJ(:,:,IKE:IKE))) - ELSE - ZSOURCE(:,:,IKE) = XSSUFL(:,:) - ZSOURCE(:,:,IKE:IKE) = ZSOURCE (:,:,IKE:IKE) /PDZZ(:,:,IKE:IKE) & - *0.5 * ( 1. + MXM(PRHODJ(:,:,KKU:KKU)) / MXM(PRHODJ(:,:,IKE:IKE)) ) - ENDIF - !No flux at the ocean domain bottom - ZSOURCE(:,:,IKB) = 0. - ZSOURCE(:,:,IKTB+1:IKTE-1) = 0 -! -ELSE !ATMOS MODEL ONLY - IF (LCOUPLES) THEN - ZSOURCE(:,:,IKB:IKB) = XSSUFL_C(:,:,1:1)/PDZZ(:,:,IKB:IKB) & - * 0.5 * ( 1. + MXM(PRHODJ(:,:,KKA:KKA)) / MXM(PRHODJ(:,:,IKB:IKB)) ) - ELSE - ! compute the explicit tangential flux at the W point - ZSOURCE(:,:,IKB) = & - PTAU11M(:,:) * PCOSSLOPE(:,:) * PDIRCOSZW(:,:) * ZDIRSINZW(:,:) & - -PTAU12M(:,:) * PSINSLOPE(:,:) * ZDIRSINZW(:,:) & - -PTAU33M(:,:) * PCOSSLOPE(:,:) * ZDIRSINZW(:,:) * PDIRCOSZW(:,:) -! - ! add the vertical part or the surface flux at the U,W vorticity point -! - ZSOURCE(:,:,IKB:IKB) = & - ( MXM( ZSOURCE(:,:,IKB:IKB) / PDZZ(:,:,IKB:IKB) ) & - + MXM( ZCOEFFLXU(:,:,1:1) / PDZZ(:,:,IKB:IKB) & - *ZUSLOPEM(:,:,1:1) & - -ZCOEFFLXV(:,:,1:1) / PDZZ(:,:,IKB:IKB) & - *ZVSLOPEM(:,:,1:1) ) & - - ZCOEFS(:,:,1:1) * PUM(:,:,IKB:IKB) * PIMPL & - ) * 0.5 * ( 1. + MXM(PRHODJ(:,:,KKA:KKA)) / MXM(PRHODJ(:,:,IKB:IKB)) ) - ENDIF -! - ZSOURCE(:,:,IKTB+1:IKTE-1) = 0. - ZSOURCE(:,:,IKE) = 0. -ENDIF !end ocean or atmosphere cases -! -! Obtention of the split U at t+ deltat -! -CALL TRIDIAG_WIND(KKA,KKU,KKL,PUM,ZA,ZCOEFS(:,:,1),PTSTEP,PEXPL,PIMPL, & - MXM(PRHODJ),ZSOURCE,ZRES) -! -! Compute the equivalent tendency for the U wind component -! -PRUS(:,:,:)=PRUS(:,:,:)+MXM(PRHODJ(:,:,:))*(ZRES(:,:,:)-PUM(:,:,:))/PTSTEP -! -! -!* 5.2 Partial Dynamic Production -! -! vertical flux of the U wind component -! -ZFLXZ(:,:,:) = -ZCMFS * MXM(ZKEFF) * & - DZM(PIMPL*ZRES + PEXPL*PUM, KKA, KKU, KKL) / MXM(PDZZ) -! -! surface flux -ZFLXZ(:,:,IKB:IKB) = MXM(PDZZ(:,:,IKB:IKB)) * & - ( ZSOURCE(:,:,IKB:IKB) & - +ZCOEFS(:,:,1:1) * ZRES(:,:,IKB:IKB) * PIMPL & - ) / 0.5 / ( 1. + MXM(PRHODJ(:,:,KKA:KKA)) / MXM(PRHODJ(:,:,IKB:IKB)) ) -! -ZFLXZ(:,:,KKA) = ZFLXZ(:,:,IKB) - -IF (LOCEAN) THEN !ocean model at phys sfc (ocean domain top) - ZFLXZ(:,:,IKE:IKE) = MXM(PDZZ(:,:,IKE:IKE)) * & - ZSOURCE(:,:,IKE:IKE) & - / 0.5 / ( 1. + MXM(PRHODJ(:,:,KKU:KKU)) / MXM(PRHODJ(:,:,IKE:IKE)) ) - ZFLXZ(:,:,KKU) = ZFLXZ(:,:,IKE) -END IF -! -IF ( OTURB_FLX .AND. TPFILE%LOPENED ) THEN - ! stores the U wind component vertical flux - TZFIELD%CMNHNAME = 'UW_VFLX' - TZFIELD%CSTDNAME = '' - TZFIELD%CLONGNAME = 'UW_VFLX' - TZFIELD%CUNITS = 'm2 s-2' - TZFIELD%CDIR = 'XY' - TZFIELD%CCOMMENT = 'U wind component vertical flux' - TZFIELD%NGRID = 4 - TZFIELD%NTYPE = TYPEREAL - TZFIELD%NDIMS = 3 - TZFIELD%LTIMEDEP = .TRUE. - CALL IO_Field_write(TPFILE,TZFIELD,ZFLXZ) -END IF -! -! first part of total momentum flux -! -PWU(:,:,:) = ZFLXZ(:,:,:) -! -! Contribution to the dynamic production of TKE -! compute the dynamic production at the mass point -! -PDP(:,:,:) = - MZF(MXF(ZFLXZ * GZ_U_UW(PUM,PDZZ, KKA, KKU, KKL)), KKA, KKU, KKL) -! -! evaluate the dynamic production at w(IKB+KKL) in PDP(IKB) -PDP(:,:,IKB:IKB) = - MXF ( & - ZFLXZ(:,:,IKB+KKL:IKB+KKL) * (PUM(:,:,IKB+KKL:IKB+KKL)-PUM(:,:,IKB:IKB)) & - / MXM(PDZZ(:,:,IKB+KKL:IKB+KKL)) & - ) -! -IF (LOCEAN) THEN - ! evaluate the dynamic production at w(IKE-KKL) in PDP(IKE) - PDP(:,:,IKE:IKE) = - MXF ( & - ZFLXZ(:,:,IKE-KKL:IKE-KKL) * (PUM(:,:,IKE:IKE)-PUM(:,:,IKE-KKL:IKE-KKL)) & - / MXM(PDZZ(:,:,IKE-KKL:IKE-KKL)) & - ) -END IF -! -! Storage in the LES configuration -! -IF (LLES_CALL) THEN - CALL SECOND_MNH(ZTIME1) - CALL LES_MEAN_SUBGRID(MZF(MXF(ZFLXZ), KKA, KKU, KKL), X_LES_SUBGRID_WU ) - CALL LES_MEAN_SUBGRID(MZF(MXF(GZ_U_UW(PUM,PDZZ, KKA, KKU, KKL) & - & *ZFLXZ), KKA, KKU, KKL), X_LES_RES_ddxa_U_SBG_UaU ) - CALL LES_MEAN_SUBGRID( ZCMFS * ZKEFF, X_LES_SUBGRID_Km ) - CALL SECOND_MNH(ZTIME2) - XTIME_LES = XTIME_LES + ZTIME2 - ZTIME1 -END IF -! -!* 5.3 Source of W wind component -! -! -IF(HTURBDIM=='3DIM') THEN - ! Compute the source for the W wind component - ! used to compute the W source at the ground - ZFLXZ(:,:,KKA) = 2 * ZFLXZ(:,:,IKB) - ZFLXZ(:,:,IKB+KKL) ! extrapolation - IF (LOCEAN) THEN - ZFLXZ(:,:,KKU) = 2 * ZFLXZ(:,:,IKE) - ZFLXZ(:,:,IKE-KKL) ! extrapolation - END IF - - ! - IF (.NOT. LFLAT) THEN - PRWS(:,:,:)= PRWS & - -DXF( MZM(MXM(PRHODJ) /PDXX, KKA, KKU, KKL) * ZFLXZ ) & - +DZM(PRHODJ / MZF(PDZZ, KKA, KKU, KKL) * & - MXF(MZF(ZFLXZ*PDZX, KKA, KKU, KKL) / PDXX ), & - KKA, KKU, KKL) - ELSE - PRWS(:,:,:)= PRWS -DXF(MZM(MXM(PRHODJ) /PDXX, KKA, KKU, KKL) * ZFLXZ ) - END IF - ! - ! Complete the Dynamical production with the W wind component - ! - ZA(:,:,:)=-MZF(MXF(ZFLXZ * GX_W_UW(PWM,PDXX,PDZZ,PDZX, KKA, KKU, KKL)), KKA, KKU, KKL) - ! - ! - ! evaluate the dynamic production at w(IKB+KKL) in PDP(IKB) - ZA(:,:,IKB:IKB) = - MXF ( & - ZFLXZ(:,:,IKB+KKL:IKB+KKL) * & - ( DXM( PWM(:,:,IKB+KKL:IKB+KKL) ) & - -MXM( (PWM(:,:,IKB+2*KKL:IKB+2*KKL )-PWM(:,:,IKB+KKL:IKB+KKL)) & - /(PDZZ(:,:,IKB+2*KKL:IKB+2*KKL)+PDZZ(:,:,IKB+KKL:IKB+KKL)) & - +(PWM(:,:,IKB+KKL:IKB+KKL)-PWM(:,:,IKB:IKB )) & - /(PDZZ(:,:,IKB+KKL:IKB+KKL)+PDZZ(:,:,IKB:IKB )) & - ) & - * PDZX(:,:,IKB+KKL:IKB+KKL) & - ) / (0.5*(PDXX(:,:,IKB+KKL:IKB+KKL)+PDXX(:,:,IKB:IKB))) & - ) - ! -IF (LOCEAN) THEN - ! evaluate the dynamic production at w(IKE-KKL) in PDP(IKE) - ZA(:,:,IKE:IKE) = - MXF ( & - ZFLXZ(:,:,IKE-KKL:IKE-KKL) * & - ( DXM( PWM(:,:,IKE-KKL:IKE-KKL) ) & - -MXM( (PWM(:,:,IKE-2*KKL:IKE-2*KKL )-PWM(:,:,IKE-KKL:IKE-KKL)) & - /(PDZZ(:,:,IKE-2*KKL:IKE-2*KKL)+PDZZ(:,:,IKE-KKL:IKE-KKL)) & - +(PWM(:,:,IKE-KKL:IKE-KKL)-PWM(:,:,IKE:IKE )) & - /(PDZZ(:,:,IKE-KKL:IKE-KKL)+PDZZ(:,:,IKE:IKE )) & - ) & - * PDZX(:,:,IKE-KKL:IKE-KKL) & - ) / (0.5*(PDXX(:,:,IKE-KKL:IKE-KKL)+PDXX(:,:,IKE:IKE))) & - ) -END IF - ! - PDP(:,:,:)=PDP(:,:,:)+ZA(:,:,:) - ! - ! Storage in the LES configuration - ! - IF (LLES_CALL) THEN - CALL SECOND_MNH(ZTIME1) - CALL LES_MEAN_SUBGRID(MZF(MXF(GX_W_UW(PWM,PDXX,& - PDZZ,PDZX, KKA, KKU, KKL)*ZFLXZ), KKA, KKU, KKL), X_LES_RES_ddxa_W_SBG_UaW ) - CALL LES_MEAN_SUBGRID(MXF(GX_M_U(KKA, KKU, KKL,PTHLM,PDXX,PDZZ,PDZX)& - * MZF(ZFLXZ, KKA, KKU, KKL)), X_LES_RES_ddxa_Thl_SBG_UaW ) - IF (KRR>=1) THEN - CALL LES_MEAN_SUBGRID(MXF(GX_U_M(PRM(:,:,:,1),PDXX,PDZZ,PDZX, KKA, KKU, KKL)& - *MZF(ZFLXZ, KKA, KKU, KKL)),X_LES_RES_ddxa_Rt_SBG_UaW ) - END IF - DO JSV=1,NSV - CALL LES_MEAN_SUBGRID( MXF(GX_U_M(PSVM(:,:,:,JSV),PDXX,PDZZ,& - PDZX, KKA, KKU, KKL)*MZF(ZFLXZ, KKA, KKU, KKL)),X_LES_RES_ddxa_Sv_SBG_UaW(:,:,:,JSV) ) - END DO - CALL SECOND_MNH(ZTIME2) - XTIME_LES = XTIME_LES + ZTIME2 - ZTIME1 - END IF -END IF -! -!---------------------------------------------------------------------------- -! -! -!* 6. SOURCES OF V,W WIND COMPONENTS AND COMPLETE 1D DYNAMIC PRODUCTION -! ----------------------------------------------------------------- -! -!* 6.1 Source of V wind component -! -! Preparation of the arguments for TRIDIAG_WIND -!! -ZA(:,:,:) = - PTSTEP * ZCMFS * & - MYM( ZKEFF ) * MYM(MZM(PRHODJ, KKA, KKU, KKL)) / & - MYM( PDZZ )**2 -! -! -! -! Compute the source of V wind component -! compute the coefficient between the vertical flux and the 2 components of the -! wind following the slope -ZCOEFFLXU(:,:,1) = PCDUEFF(:,:) * (PDIRCOSZW(:,:)**2 - ZDIRSINZW(:,:)**2) & - * PSINSLOPE(:,:) -ZCOEFFLXV(:,:,1) = PCDUEFF(:,:) * PDIRCOSZW(:,:) * PCOSSLOPE(:,:) - -! prepare the implicit scheme coefficients for the surface flux -ZCOEFS(:,:,1)= ZCOEFFLXU(:,:,1) * PSINSLOPE(:,:) * PDIRCOSZW(:,:) & - +ZCOEFFLXV(:,:,1) * PCOSSLOPE(:,:) -! -! average this flux to be located at the V,W vorticity point -ZCOEFS(:,:,1:1)=MYM(ZCOEFS(:,:,1:1) / PDZZ(:,:,IKB:IKB) ) -! -IF (LOCEAN) THEN ! Ocean case - IF (LCOUPLES) THEN - ZSOURCE(:,:,IKE:IKE) = XSSVFL_C(:,:,1:1)/PDZZ(:,:,IKE:IKE) & - *0.5 * ( 1. + MYM(PRHODJ(:,:,KKU:KKU)) / MYM(PRHODJ(:,:,IKE:IKE)) ) - ELSE - ZSOURCE(:,:,IKE) = XSSVFL(:,:) - ZSOURCE(:,:,IKE:IKE) = ZSOURCE(:,:,IKE:IKE)/PDZZ(:,:,IKE:IKE) & - *0.5 * ( 1. + MYM(PRHODJ(:,:,KKU:KKU)) / MYM(PRHODJ(:,:,IKE:IKE)) ) - END IF - !No flux at the ocean domain bottom - ZSOURCE(:,:,IKB) = 0. -ELSE ! Atmos case - IF (.NOT.LCOUPLES) THEN ! only atmosp without coupling - ! compute the explicit tangential flux at the W point - ZSOURCE(:,:,IKB) = & - PTAU11M(:,:) * PSINSLOPE(:,:) * PDIRCOSZW(:,:) * ZDIRSINZW(:,:) & - +PTAU12M(:,:) * PCOSSLOPE(:,:) * ZDIRSINZW(:,:) & - -PTAU33M(:,:) * PSINSLOPE(:,:) * ZDIRSINZW(:,:) * PDIRCOSZW(:,:) -! - ! add the vertical part or the surface flux at the V,W vorticity point - ZSOURCE(:,:,IKB:IKB) = & - ( MYM( ZSOURCE(:,:,IKB:IKB) / PDZZ(:,:,IKB:IKB) ) & - + MYM( ZCOEFFLXU(:,:,1:1) / PDZZ(:,:,IKB:IKB) & - *ZUSLOPEM(:,:,1:1) & - +ZCOEFFLXV(:,:,1:1) / PDZZ(:,:,IKB:IKB) & - *ZVSLOPEM(:,:,1:1) ) & - - ZCOEFS(:,:,1:1) * PVM(:,:,IKB:IKB) * PIMPL & - ) * 0.5 * ( 1. + MYM(PRHODJ(:,:,KKA:KKA)) / MYM(PRHODJ(:,:,IKB:IKB)) ) -! - ELSE !atmosphere when coupling - ! input flux assumed to be in SI and at vorticity point - ZSOURCE(:,:,IKB:IKB) = -XSSVFL_C(:,:,1:1)/(1.*PDZZ(:,:,IKB:IKB)) & - * 0.5 * ( 1. + MYM(PRHODJ(:,:,KKA:KKA)) / MYM(PRHODJ(:,:,IKB:IKB)) ) - ENDIF - !No flux at the atmosphere top - ZSOURCE(:,:,IKE) = 0. -ENDIF ! End of Ocean or Atmospher Cases -ZSOURCE(:,:,IKTB+1:IKTE-1) = 0. -! -! Obtention of the split V at t+ deltat -CALL TRIDIAG_WIND(KKA,KKU,KKL,PVM,ZA,ZCOEFS(:,:,1),PTSTEP,PEXPL,PIMPL, & - MYM(PRHODJ),ZSOURCE,ZRES) -! -! Compute the equivalent tendency for the V wind component -! -PRVS(:,:,:)=PRVS(:,:,:)+MYM(PRHODJ(:,:,:))*(ZRES(:,:,:)-PVM(:,:,:))/PTSTEP -! -! -!* 6.2 Complete 1D dynamic Production -! -! vertical flux of the V wind component -! -ZFLXZ(:,:,:) = -ZCMFS * MYM(ZKEFF) * & - DZM(PIMPL*ZRES + PEXPL*PVM, KKA, KKU, KKL) / MYM(PDZZ) -! -ZFLXZ(:,:,IKB:IKB) = MYM(PDZZ(:,:,IKB:IKB)) * & - ( ZSOURCE(:,:,IKB:IKB) & - +ZCOEFS(:,:,1:1) * ZRES(:,:,IKB:IKB) * PIMPL & - ) / 0.5 / ( 1. + MYM(PRHODJ(:,:,KKA:KKA)) / MYM(PRHODJ(:,:,IKB:IKB)) ) -! -! -ZFLXZ(:,:,KKA) = ZFLXZ(:,:,IKB) -! -IF (LOCEAN) THEN - ZFLXZ(:,:,IKE:IKE) = MYM(PDZZ(:,:,IKE:IKE)) * & - ZSOURCE(:,:,IKE:IKE) & - / 0.5 / ( 1. + MYM(PRHODJ(:,:,KKU:KKU)) / MYM(PRHODJ(:,:,IKE:IKE)) ) - ZFLXZ(:,:,KKU) = ZFLXZ(:,:,IKE) -END IF -! -IF ( OTURB_FLX .AND. TPFILE%LOPENED ) THEN - ! stores the V wind component vertical flux - TZFIELD%CMNHNAME = 'VW_VFLX' - TZFIELD%CSTDNAME = '' - TZFIELD%CLONGNAME = 'VW_VFLX' - TZFIELD%CUNITS = 'm2 s-2' - TZFIELD%CDIR = 'XY' - TZFIELD%CCOMMENT = 'V wind component vertical flux' - TZFIELD%NGRID = 4 - TZFIELD%NTYPE = TYPEREAL - TZFIELD%NDIMS = 3 - TZFIELD%LTIMEDEP = .TRUE. - CALL IO_Field_write(TPFILE,TZFIELD,ZFLXZ) -END IF -! -! second part of total momentum flux -! -PWV(:,:,:) = ZFLXZ(:,:,:) -! -! Contribution to the dynamic production of TKE -! compute the dynamic production contribution at the mass point -! -ZA(:,:,:) = - MZF(MYF(ZFLXZ * GZ_V_VW(PVM,PDZZ, KKA, KKU, KKL)), KKA, KKU, KKL) -! -! evaluate the dynamic production at w(IKB+KKL) in PDP(IKB) -ZA(:,:,IKB:IKB) = & - - MYF ( & -ZFLXZ(:,:,IKB+KKL:IKB+KKL) * (PVM(:,:,IKB+KKL:IKB+KKL)-PVM(:,:,IKB:IKB)) & - / MYM(PDZZ(:,:,IKB+KKL:IKB+KKL)) & - ) -! -IF (LOCEAN) THEN - ! evaluate the dynamic production at w(IKE-KKL) in PDP(IKE) - ZA(:,:,IKE:IKE) = - MYF ( & - ZFLXZ(:,:,IKE-KKL:IKE-KKL) * (PVM(:,:,IKE:IKE)-PVM(:,:,IKE-KKL:IKE-KKL)) & - / MYM(PDZZ(:,:,IKE-KKL:IKE-KKL)) & - ) -END IF -! -PDP(:,:,:)=PDP(:,:,:)+ZA(:,:,:) -! -! Storage in the LES configuration -! -IF (LLES_CALL) THEN - CALL SECOND_MNH(ZTIME1) - CALL LES_MEAN_SUBGRID(MZF(MYF(ZFLXZ), KKA, KKU, KKL), X_LES_SUBGRID_WV ) - CALL LES_MEAN_SUBGRID(MZF(MYF(GZ_V_VW(PVM,PDZZ, KKA, KKU, KKL)*& - & ZFLXZ), KKA, KKU, KKL), X_LES_RES_ddxa_V_SBG_UaV ) - CALL SECOND_MNH(ZTIME2) - XTIME_LES = XTIME_LES + ZTIME2 - ZTIME1 -END IF -! -! -!* 6.3 Source of W wind component -! -IF(HTURBDIM=='3DIM') THEN - ! Compute the source for the W wind component - ZFLXZ(:,:,KKA) = 2 * ZFLXZ(:,:,IKB) - ZFLXZ(:,:,IKB+KKL) ! extrapolation - IF (LOCEAN) THEN - ZFLXZ(:,:,KKU) = 2 * ZFLXZ(:,:,IKE) - ZFLXZ(:,:,IKE-KKL) ! extrapolation - END IF - ! - IF (.NOT. L2D) THEN - IF (.NOT. LFLAT) THEN - PRWS(:,:,:)= PRWS(:,:,:) & - -DYF( MZM(MYM(PRHODJ) /PDYY, KKA, KKU, KKL) * ZFLXZ ) & - +DZM(PRHODJ / MZF(PDZZ, KKA, KKU, KKL) * & - MYF(MZF(ZFLXZ*PDZY, KKA, KKU, KKL) / PDYY ), & - KKA, KKU, KKL) - ELSE - PRWS(:,:,:)= PRWS(:,:,:) -DYF(MZM(MYM(PRHODJ) /PDYY, KKA, KKU, KKL) * ZFLXZ ) - END IF - END IF - ! - ! Complete the Dynamical production with the W wind component - IF (.NOT. L2D) THEN - ZA(:,:,:) = - MZF(MYF(ZFLXZ * GY_W_VW(PWM,PDYY,PDZZ,PDZY, KKA, KKU, KKL)), KKA, KKU, KKL) - ! - ! evaluate the dynamic production at w(IKB+KKL) in PDP(IKB) - ZA(:,:,IKB:IKB) = - MYF ( & - ZFLXZ(:,:,IKB+KKL:IKB+KKL) * & - ( DYM( PWM(:,:,IKB+KKL:IKB+KKL) ) & - -MYM( (PWM(:,:,IKB+2*KKL:IKB+2*KKL)-PWM(:,:,IKB+KKL:IKB+KKL)) & - /(PDZZ(:,:,IKB+2*KKL:IKB+2*KKL)+PDZZ(:,:,IKB+KKL:IKB+KKL)) & - +(PWM(:,:,IKB+KKL:IKB+KKL)-PWM(:,:,IKB:IKB )) & - /(PDZZ(:,:,IKB+KKL:IKB+KKL)+PDZZ(:,:,IKB:IKB )) & - ) & - * PDZY(:,:,IKB+KKL:IKB+KKL) & - ) / (0.5*(PDYY(:,:,IKB+KKL:IKB+KKL)+PDYY(:,:,IKB:IKB))) & - ) - ! - IF (LOCEAN) THEN - ZA(:,:,IKE:IKE) = - MYF ( & - ZFLXZ(:,:,IKE-KKL:IKE-KKL) * & - ( DYM( PWM(:,:,IKE-KKL:IKE-KKL) ) & - -MYM( (PWM(:,:,IKE-2*KKL:IKE-2*KKL)-PWM(:,:,IKE-KKL:IKE-KKL)) & - /(PDZZ(:,:,IKE-2*KKL:IKE-2*KKL)+PDZZ(:,:,IKE-KKL:IKE-KKL)) & - +(PWM(:,:,IKE-KKL:IKE-KKL)-PWM(:,:,IKE:IKE )) & - /(PDZZ(:,:,IKE-KKL:IKE-KKL)+PDZZ(:,:,IKE:IKE )) & - ) & - * PDZY(:,:,IKE-KKL:IKE-KKL) & - ) / (0.5*(PDYY(:,:,IKE-KKL:IKE-KKL)+PDYY(:,:,IKE:IKE))) & - ) - END IF -! - PDP(:,:,:)=PDP(:,:,:)+ZA(:,:,:) - ! - END IF - ! - ! Storage in the LES configuration - ! - IF (LLES_CALL) THEN - CALL SECOND_MNH(ZTIME1) - CALL LES_MEAN_SUBGRID(MZF(MYF(GY_W_VW(PWM,PDYY,& - &PDZZ,PDZY, KKA, KKU, KKL)*ZFLXZ), KKA, KKU, KKL), & - &X_LES_RES_ddxa_W_SBG_UaW , .TRUE. ) - CALL LES_MEAN_SUBGRID(MYF(GY_M_V(KKA, KKU, KKL,PTHLM,PDYY,PDZZ,PDZY)*& - &MZF(ZFLXZ, KKA, KKU, KKL)), & - &X_LES_RES_ddxa_Thl_SBG_UaW , .TRUE. ) - IF (KRR>=1) THEN - CALL LES_MEAN_SUBGRID(MYF(GY_V_M(PRM(:,:,:,1),PDYY,PDZZ,& - &PDZY, KKA, KKU, KKL)*MZF(ZFLXZ, KKA, KKU, KKL)),& - &X_LES_RES_ddxa_Rt_SBG_UaW , .TRUE. ) - END IF - CALL SECOND_MNH(ZTIME2) - XTIME_LES = XTIME_LES + ZTIME2 - ZTIME1 - END IF - ! -END IF -! -! -!---------------------------------------------------------------------------- -! -!* 7. DIAGNOSTIC COMPUTATION OF THE 1D <W W> VARIANCE -! ----------------------------------------------- -! -IF ( OTURB_FLX .AND. TPFILE%LOPENED .AND. HTURBDIM == '1DIM') THEN - ZFLXZ(:,:,:)= (2./3.) * PTKEM(:,:,:) & - -ZCMFS*PLM(:,:,:)*SQRT(PTKEM(:,:,:))*GZ_W_M(PWM,PDZZ, KKA, KKU, KKL) - ! to be tested & - ! +XCMFB*(4./3.)*PLM(:,:,:)/SQRT(PTKEM(:,:,:))*PTP(:,:,:) - ! stores the W variance - TZFIELD%CMNHNAME = 'W_VVAR' - TZFIELD%CSTDNAME = '' - TZFIELD%CLONGNAME = 'W_VVAR' - TZFIELD%CUNITS = 'm2 s-2' - TZFIELD%CDIR = 'XY' - TZFIELD%CCOMMENT = 'X_Y_Z_W_VVAR' - TZFIELD%NGRID = 1 - TZFIELD%NTYPE = TYPEREAL - TZFIELD%NDIMS = 3 - TZFIELD%LTIMEDEP = .TRUE. - CALL IO_Field_write(TPFILE,TZFIELD,ZFLXZ) -END IF -! -!---------------------------------------------------------------------------- -! -IF (LHOOK) CALL DR_HOOK('TURB_VER_DYN_FLUX',1,ZHOOK_HANDLE) -END SUBROUTINE TURB_VER_DYN_FLUX -END MODULE MODE_TURB_VER_DYN_FLUX diff --git a/src/mesonh/turb/mode_turb_ver_sv_corr.f90 b/src/mesonh/turb/mode_turb_ver_sv_corr.f90 deleted file mode 100644 index 4deb47ce7..000000000 --- a/src/mesonh/turb/mode_turb_ver_sv_corr.f90 +++ /dev/null @@ -1,185 +0,0 @@ -!MNH_LIC Copyright 2002-2020 CNRS, Meteo-France and Universite Paul Sabatier -!MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence -!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt -!MNH_LIC for details. version 1. -MODULE MODE_TURB_VER_SV_CORR -IMPLICIT NONE -CONTAINS -SUBROUTINE TURB_VER_SV_CORR(KKA,KKU,KKL,KRR,KRRL,KRRI, & - PDZZ, & - PTHLM,PRM,PTHVREF, & - PLOCPEXNM,PATHETA,PAMOIST,PSRCM,PPHI3,PPSI3, & - PWM,PSVM, & - PTKEM,PLM,PLEPS,PPSI_SV ) -! ############################################################### -! -! -!!**** *TURB_VER_SV_CORR* -compute the subgrid Sv2 and SvThv terms -!! -!! PURPOSE -!! ------- -!! -!! -!! EXTERNAL -!! -------- -!! -!! FUNCTIONs ETHETA and EMOIST : -!! allows to compute: -!! - the coefficients for the turbulent correlation between -!! any variable and the virtual potential temperature, of its -!! correlations with the conservative potential temperature and -!! the humidity conservative variable: -!! ------- ------- ------- -!! A' Thv' = ETHETA A' Thl' + EMOIST A' Rnp' -!! -!! -!! IMPLICIT ARGUMENTS -!! ------------------ -!! -!! REFERENCE -!! --------- -!! -!! AUTHOR -!! ------ -!! V. Masson * Meteo-France * -!! -!! MODIFICATIONS -!! ------------- -!! Original October 29, 2002 -!! JP Pinty Feb 20, 2003 Add PFRAC_ICE -!!-------------------------------------------------------------------------- -! -!* 0. DECLARATIONS -! ------------ -! -USE PARKIND1, ONLY : JPRB -USE YOMHOOK , ONLY : LHOOK, DR_HOOK -! -USE MODD_CST -USE MODD_CTURB -USE MODD_PARAMETERS -USE MODD_LES -USE MODD_CONF -USE MODD_NSV, ONLY : NSV,NSV_LGBEG,NSV_LGEND -USE MODD_BLOWSNOW -! -! -USE MODI_GRADIENT_U -USE MODI_GRADIENT_V -USE MODI_GRADIENT_W -USE MODI_GRADIENT_M -USE MODI_SHUMAN , ONLY : MZF -USE MODE_EMOIST, ONLY: EMOIST -USE MODE_ETHETA, ONLY: ETHETA -USE MODI_LES_MEAN_SUBGRID -! -USE MODI_SECOND_MNH -! -IMPLICIT NONE -! -!* 0.1 declarations of arguments -! -! -! -INTEGER, INTENT(IN) :: KKA, KKU ! near ground and uppest atmosphere array indexes -INTEGER, INTENT(IN) :: KKL ! +1 if grid goes from ground to atmosphere top, -1 otherwise -INTEGER, INTENT(IN) :: KRR ! number of moist var. -INTEGER, INTENT(IN) :: KRRL ! number of liquid var. -INTEGER, INTENT(IN) :: KRRI ! number of ice var. -REAL, DIMENSION(:,:,:), INTENT(IN) :: PDZZ - ! Metric coefficients -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHLM ! potential temperature at t-Delta t -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRM ! Mixing ratios at t-Delta t -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHVREF ! reference Thv -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLOCPEXNM ! Lv(T)/Cp/Exnref at time t-1 -REAL, DIMENSION(:,:,:), INTENT(IN) :: PATHETA ! coefficients between -REAL, DIMENSION(:,:,:), INTENT(IN) :: PAMOIST ! s and Thetal and Rnp -REAL, DIMENSION(:,:,:), INTENT(IN) :: PSRCM ! normalized - ! 2nd-order flux s'r'c/2Sigma_s2 at t-1 multiplied by Lambda_3 -REAL, DIMENSION(:,:,:), INTENT(IN) :: PPHI3 ! Inv.Turb.Sch.for temperature -REAL, DIMENSION(:,:,:), INTENT(IN) :: PPSI3 ! Inv.Turb.Sch.for humidity -REAL, DIMENSION(:,:,:), INTENT(IN) :: PWM ! w at time t -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PSVM ! scalar var. at t-Delta t -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTKEM ! TKE at time t -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLM ! Turb. mixing length -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLEPS ! dissipative length -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PPSI_SV ! Inv.Turb.Sch.for scalars - ! cumulated sources for the prognostic variables -! -! -! -! -!* 0.2 declaration of local variables -! -! -REAL, DIMENSION(SIZE(PSVM,1),SIZE(PSVM,2),SIZE(PSVM,3)) :: & - ZA, ZFLXZ -! -REAL :: ZCSV !constant for the scalar flux -! -INTEGER :: JSV ! loop counters -! -REAL :: ZTIME1, ZTIME2 -! -REAL :: ZCSVD = 1.2 ! constant for scalar variance dissipation -REAL :: ZCTSVD = 2.4 ! constant for temperature - scalar covariance dissipation -REAL :: ZCQSVD = 2.4 ! constant for humidity - scalar covariance dissipation -!---------------------------------------------------------------------------- -! -REAL(KIND=JPRB) :: ZHOOK_HANDLE -IF (LHOOK) CALL DR_HOOK('TURB_VER_SV_CORR',0,ZHOOK_HANDLE) -CALL SECOND_MNH(ZTIME1) -! -IF(LBLOWSNOW) THEN -! See Vionnet (PhD, 2012) for a complete discussion around the value of the Schmidt number for blowing snow variables - ZCSV= XCHF/XRSNOW -ELSE - ZCSV= XCHF -ENDIF -! -DO JSV=1,NSV - ! - IF (LNOMIXLG .AND. JSV >= NSV_LGBEG .AND. JSV<= NSV_LGEND) CYCLE - ! - ! variance Sv2 - ! - IF (LLES_CALL) THEN - ! approximation: diagnosed explicitely (without implicit term) - ZFLXZ(:,:,:) = PPSI_SV(:,:,:,JSV)*GZ_M_W(KKA, KKU, KKL,PSVM(:,:,:,JSV),PDZZ)**2 - ZFLXZ(:,:,:) = ZCSV / ZCSVD * PLM * PLEPS * MZF(ZFLXZ(:,:,:), KKA, KKU, KKL) - CALL LES_MEAN_SUBGRID(-2.*ZCSVD*SQRT(PTKEM)*ZFLXZ/PLEPS, X_LES_SUBGRID_DISS_Sv2(:,:,:,JSV) ) - CALL LES_MEAN_SUBGRID(MZF(PWM, KKA, KKU, KKL)*ZFLXZ, X_LES_RES_W_SBG_Sv2(:,:,:,JSV) ) - END IF - ! - ! covariance ThvSv - ! - IF (LLES_CALL) THEN - ! approximation: diagnosed explicitely (without implicit term) - ZA(:,:,:) = ETHETA(KRR,KRRI,PTHLM,PRM,PLOCPEXNM,PATHETA,PSRCM) - ZFLXZ(:,:,:)= ( XCSHF * PPHI3 + ZCSV * PPSI_SV(:,:,:,JSV) ) & - * GZ_M_W(KKA, KKU, KKL,PTHLM,PDZZ) & - * GZ_M_W(KKA, KKU, KKL,PSVM(:,:,:,JSV),PDZZ) - ZFLXZ(:,:,:)= PLM * PLEPS / (2.*ZCTSVD) * MZF(ZFLXZ, KKA, KKU, KKL) - CALL LES_MEAN_SUBGRID( ZA*ZFLXZ, X_LES_SUBGRID_SvThv(:,:,:,JSV) ) - CALL LES_MEAN_SUBGRID( -XG/PTHVREF/3.*ZA*ZFLXZ, X_LES_SUBGRID_SvPz(:,:,:,JSV), .TRUE.) - ! - IF (KRR>=1) THEN - ZA(:,:,:) = EMOIST(KRR,KRRI,PTHLM,PRM,PLOCPEXNM,PAMOIST,PSRCM) - ZFLXZ(:,:,:)= ( ZCSV * PPSI3 + ZCSV * PPSI_SV(:,:,:,JSV) ) & - * GZ_M_W(KKA, KKU, KKL,PRM(:,:,:,1),PDZZ) & - * GZ_M_W(KKA, KKU, KKL,PSVM(:,:,:,JSV),PDZZ) - ZFLXZ(:,:,:)= PLM * PLEPS / (2.*ZCQSVD) * MZF(ZFLXZ, KKA, KKU, KKL) - CALL LES_MEAN_SUBGRID( ZA*ZFLXZ, X_LES_SUBGRID_SvThv(:,:,:,JSV) , .TRUE.) - CALL LES_MEAN_SUBGRID( -XG/PTHVREF/3.*ZA*ZFLXZ, X_LES_SUBGRID_SvPz(:,:,:,JSV), .TRUE.) - END IF - END IF - ! -END DO ! end of scalar loop -! -CALL SECOND_MNH(ZTIME2) -XTIME_LES = XTIME_LES + ZTIME2 - ZTIME1 -!---------------------------------------------------------------------------- -! -IF (LHOOK) CALL DR_HOOK('TURB_VER_SV_CORR',1,ZHOOK_HANDLE) -END SUBROUTINE TURB_VER_SV_CORR -END MODULE MODE_TURB_VER_SV_CORR diff --git a/src/mesonh/turb/mode_turb_ver_sv_flux.f90 b/src/mesonh/turb/mode_turb_ver_sv_flux.f90 deleted file mode 100644 index 271ee734e..000000000 --- a/src/mesonh/turb/mode_turb_ver_sv_flux.f90 +++ /dev/null @@ -1,446 +0,0 @@ -!MNH_LIC Copyright 1994-2021 CNRS, Meteo-France and Universite Paul Sabatier -!MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence -!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt -!MNH_LIC for details. version 1. -MODULE MODE_TURB_VER_SV_FLUX -IMPLICIT NONE -CONTAINS -SUBROUTINE TURB_VER_SV_FLUX(KKA,KKU,KKL, & - OTURB_FLX,HTURBDIM, & - PIMPL,PEXPL, & - PTSTEP, & - TPFILE, & - PDZZ,PDIRCOSZW, & - PRHODJ,PWM, & - PSFSVM,PSFSVP, & - PSVM, & - PTKEM,PLM,MFMOIST,PPSI_SV, & - PRSVS,PWSV ) -! -! -! -!!**** *TURB_VER_SV_FLUX* -compute the source terms due to the vertical turbulent -!! fluxes. -!! -!! PURPOSE -!! ------- -! The purpose of this routine is to compute the vertical turbulent -! fluxes of the evolutive variables and give back the source -! terms to the main program. In the case of large horizontal meshes, -! the divergence of these vertical turbulent fluxes represent the whole -! effect of the turbulence but when the three-dimensionnal version of -! the turbulence scheme is activated (CTURBDIM="3DIM"), these divergences -! are completed in the next routine TURB_HOR. -! An arbitrary degree of implicitness has been implemented for the -! temporal treatment of these diffusion terms. -! The vertical boundary conditions are as follows: -! * at the bottom, the surface fluxes are prescribed at the same -! as the other turbulent fluxes -! * at the top, the turbulent fluxes are set to 0. -! It should be noted that the condensation has been implicitely included -! in this turbulence scheme by using conservative variables and computing -! the subgrid variance of a statistical variable s indicating the presence -! or not of condensation in a given mesh. -! -!!** METHOD -!! ------ -!! 1D type calculations are made; -!! The vertical turbulent fluxes are computed in an off-centered -!! implicit scheme (a Crank-Nicholson type with coefficients different -!! than 0.5), which allows to vary the degree of implicitness of the -!! formulation. -!! The different prognostic variables are treated one by one. -!! The contributions of each turbulent fluxes are cumulated into the -!! tendency PRvarS, and into the dynamic and thermal production of -!! TKE if necessary. -!! -!! In section 2 and 3, the thermodynamical fields are considered. -!! Only the turbulent fluxes of the conservative variables -!! (Thetal and Rnp stored in PRx(:,:,:,1)) are computed. -!! Note that the turbulent fluxes at the vertical -!! boundaries are given either by the soil scheme for the surface one -!! ( at the same instant as the others fluxes) and equal to 0 at the -!! top of the model. The thermal production is computed by vertically -!! averaging the turbulent flux and multiply this flux at the mass point by -!! a function ETHETA or EMOIST, which preform the transformation from the -!! conservative variables to the virtual potential temperature. -!! -!! In section 4, the variance of the statistical variable -!! s indicating presence or not of condensation, is determined in function -!! of the turbulent moments of the conservative variables and its -!! squarred root is stored in PSIGS. This information will be completed in -!! the horizontal turbulence if the turbulence dimensionality is not -!! equal to "1DIM". -!! -!! In section 5, the x component of the stress tensor is computed. -!! The surface flux <u'w'> is computed from the value of the surface -!! fluxes computed in axes linked to the orography ( i", j" , k"): -!! i" is parallel to the surface and in the direction of the maximum -!! slope -!! j" is also parallel to the surface and in the normal direction of -!! the maximum slope -!! k" is the normal to the surface -!! In order to prevent numerical instability, the implicit scheme has -!! been extended to the surface flux regarding to its dependence in -!! function of U. The dependence in function of the other components -!! introduced by the different rotations is only explicit. -!! The turbulent fluxes are used to compute the dynamic production of -!! TKE. For the last TKE level ( located at PDZZ(:,:,IKB)/2 from the -!! ground), an harmonic extrapolation from the dynamic production at -!! PDZZ(:,:,IKB) is used to avoid an evaluation of the gradient of U -!! in the surface layer. -!! -!! In section 6, the same steps are repeated but for the y direction -!! and in section 7, a diagnostic computation of the W variance is -!! performed. -!! -!! In section 8, the turbulent fluxes for the scalar variables are -!! computed by the same way as the conservative thermodynamical variables -!! -!! -!! EXTERNAL -!! -------- -!! GX_U_M, GY_V_M, GZ_W_M : cartesian gradient operators -!! GX_U_UW,GY_V_VW (X,Y,Z) represent the direction of the gradient -!! _(M,U,...)_ represent the localization of the -!! field to be derivated -!! _(M,UW,...) represent the localization of the -!! field derivated -!! -!! -!! MXM,MXF,MYM,MYF,MZM,MZF -!! : Shuman functions (mean operators) -!! DXF,DYF,DZF,DZM -!! : Shuman functions (difference operators) -!! -!! SUBROUTINE TRIDIAG : to compute the split implicit evolution -!! of a variable located at a mass point -!! -!! SUBROUTINE TRIDIAG_WIND: to compute the split implicit evolution -!! of a variable located at a wind point -!! -!! FUNCTIONs ETHETA and EMOIST : -!! allows to compute: -!! - the coefficients for the turbulent correlation between -!! any variable and the virtual potential temperature, of its -!! correlations with the conservative potential temperature and -!! the humidity conservative variable: -!! ------- ------- ------- -!! A' Thv' = ETHETA A' Thl' + EMOIST A' Rnp' -!! -!! -!! IMPLICIT ARGUMENTS -!! ------------------ -!! Module MODD_CST : contains physical constants -!! -!! XG : gravity constant -!! -!! Module MODD_CTURB: contains the set of constants for -!! the turbulence scheme -!! -!! XCMFS,XCMFB : cts for the momentum flux -!! XCSHF : ct for the sensible heat flux -!! XCHF : ct for the moisture flux -!! XCTV,XCHV : cts for the T and moisture variances -!! -!! Module MODD_PARAMETERS -!! -!! JPVEXT_TURB : number of vertical external points -!! JPHEXT : number of horizontal external points -!! -!! -!! REFERENCE -!! --------- -!! Book 1 of documentation (Chapter: Turbulence) -!! -!! AUTHOR -!! ------ -!! Joan Cuxart * INM and Meteo-France * -!! -!! MODIFICATIONS -!! ------------- -!! Original August 19, 1994 -!! Modifications: February 14, 1995 (J.Cuxart and J.Stein) -!! Doctorization and Optimization -!! Modifications: March 21, 1995 (J.M. Carriere) -!! Introduction of cloud water -!! Modifications: June 14, 1995 (J.Cuxart and J. Stein) -!! Phi3 and Psi3 at w-point + bug in the all -!! or nothing condens. -!! Modifications: Sept 15, 1995 (J.Cuxart and J. Stein) -!! Change the DP computation at the ground -!! Modifications: October 10, 1995 (J.Cuxart and J. Stein) -!! Psi for scal var and LES tools -!! Modifications: November 10, 1995 (J. Stein) -!! change the surface relations -!! Modifications: February 20, 1995 (J. Stein) optimization -!! Modifications: May 21, 1996 (J. Stein) -!! bug in the vertical flux of the V wind -!! component for explicit computation -!! Modifications: May 21, 1996 (N. wood) -!! modify the computation of the vertical -!! part or the surface tangential flux -!! Modifications: May 21, 1996 (P. Jabouille) -!! same modification in the Y direction -!! -!! Modifications: Sept 17, 1996 (J. Stein) change the moist case by using -!! Pi instead of Piref + use Atheta and Amoist -!! -!! Modifications: Nov 24, 1997 (V. Masson) removes the DO loops -!! Modifications: Mar 31, 1998 (V. Masson) splits the routine TURB_VER_SV_FLUX -!! Modifications: Dec 01, 2000 (V. Masson) conservation of scalar emission -!! from surface in 1DIM case -!! when slopes are present -!! Jun 20, 2001 (J Stein) case of lagragian variables -!! Nov 06, 2002 (V. Masson) LES budgets -!! October 2009 (G. Tanguy) add ILENCH=LEN(YCOMMENT) after -!! change of YCOMMENT -!! Feb 2012(Y. Seity) add possibility to run with reversed -!! vertical levels -!! Modifications: July 2015 (Wim de Rooy) LHARAT switch -!! Feb 2017(M. Leriche) add initialisation of ZSOURCE -!! to avoid unknwon values outside physical domain -!! and avoid negative values in sv tendencies -!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O -!!-------------------------------------------------------------------------- -! -!* 0. DECLARATIONS -! ------------ -! -USE PARKIND1, ONLY : JPRB -USE YOMHOOK , ONLY : LHOOK, DR_HOOK -! -USE MODD_CST -USE MODD_CTURB -USE MODD_FIELD, ONLY: TFIELDDATA, TYPEREAL -USE MODD_IO, ONLY: TFILEDATA -USE MODD_PARAMETERS -USE MODD_LES -USE MODD_CONF -USE MODD_NSV, ONLY: XSVMIN, NSV_LGBEG, NSV_LGEND -USE MODD_BLOWSNOW -USE MODE_IO_FIELD_WRITE, ONLY: IO_FIELD_WRITE -! -USE MODI_GRADIENT_U -USE MODI_GRADIENT_V -USE MODI_GRADIENT_W -USE MODI_GRADIENT_M -USE MODI_SHUMAN , ONLY : DZM, MZM, MZF -USE MODE_TRIDIAG, ONLY: TRIDIAG -USE MODE_EMOIST, ONLY: EMOIST -USE MODE_ETHETA, ONLY: ETHETA -USE MODI_LES_MEAN_SUBGRID -! -USE MODI_SECOND_MNH -! -IMPLICIT NONE -! -!* 0.1 declarations of arguments -! -! -INTEGER, INTENT(IN) :: KKA !near ground array index -INTEGER, INTENT(IN) :: KKU !uppest atmosphere array index -INTEGER, INTENT(IN) :: KKL !vert. levels type 1=MNH -1=ARO -LOGICAL, INTENT(IN) :: OTURB_FLX ! switch to write the - ! turbulent fluxes in the syncronous FM-file -CHARACTER(len=4), INTENT(IN) :: HTURBDIM ! dimensionality of the - ! turbulence scheme -REAL, INTENT(IN) :: PIMPL, PEXPL ! Coef. for temporal disc. -REAL, INTENT(IN) :: PTSTEP ! Double Time Step -TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! Output file -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PDZZ - ! Metric coefficients -REAL, DIMENSION(:,:), INTENT(IN) :: PDIRCOSZW ! Director Cosinus of the - ! normal to the ground surface -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! dry density * grid volum -REAL, DIMENSION(:,:,:), INTENT(IN) :: MFMOIST ! moist mf dual scheme - -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PSFSVM ! t - deltat -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PSFSVP ! t + deltat -! -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PSVM ! scalar var. at t-Delta t -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PWM ! vertical wind -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTKEM ! TKE at time t -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLM ! Turb. mixing length -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PPSI_SV ! Inv.Turb.Sch.for scalars -! -REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRSVS - ! cumulated sources for the prognostic variables -REAL, DIMENSION(:,:,:,:), INTENT(OUT) :: PWSV ! scalar flux -! -! -! -! -!* 0.2 declaration of local variables -! -! -REAL, DIMENSION(SIZE(PSVM,1),SIZE(PSVM,2),SIZE(PSVM,3)) :: & - ZA, & ! under diagonal elements of the tri-diagonal matrix involved - ! in the temporal implicit scheme (also used to store coefficient - ! J in Section 5) - ZRES, & ! guess of the treated variable at t+ deltat when the turbu- - ! lence is the only source of evolution added to the ones - ! considered in ZSOURCE - ZFLXZ, & ! vertical flux of the treated variable - ZSOURCE, & ! source of evolution for the treated variable - ZKEFF ! effectif diffusion coeff = LT * SQRT( TKE ) -INTEGER :: IKB,IKE ! I index values for the Beginning and End - ! mass points of the domain in the 3 direct. -INTEGER :: IKT ! array size in k direction -INTEGER :: IKTB,IKTE ! start, end of k loops in physical domain -INTEGER :: JSV ! loop counters -INTEGER :: JK ! loop -INTEGER :: ISV ! number of scalar var. -! -REAL :: ZTIME1, ZTIME2 - -REAL :: ZCSVP = 4.0 ! constant for scalar flux presso-correlation (RS81) -REAL :: ZCSV !constant for the scalar flux -! -TYPE(TFIELDDATA) :: TZFIELD -!---------------------------------------------------------------------------- -! -!* 1. PRELIMINARIES -! ------------- -! - -REAL(KIND=JPRB) :: ZHOOK_HANDLE -IF (LHOOK) CALL DR_HOOK('TURB_VER_SV_FLUX',0,ZHOOK_HANDLE) -IKB=KKA+JPVEXT_TURB*KKL -IKE=KKU-JPVEXT_TURB*KKL -IKT=SIZE(PSVM,3) -IKTE =IKT-JPVEXT_TURB -IKTB =1+JPVEXT_TURB -! -ISV=SIZE(PSVM,4) -! -IF (LHARAT) THEN - ZKEFF(:,:,:) = PLM(:,:,:) * SQRT(PTKEM(:,:,:)) + 50.*MFMOIST(:,:,:) -ELSE - ZKEFF(:,:,:) = MZM(PLM(:,:,:) * SQRT(PTKEM(:,:,:)), KKA, KKU, KKL) -ENDIF -! -IF(LBLOWSNOW) THEN -! See Vionnet (PhD, 2012) for a complete discussion around the value of the Schmidt number for blowing snow variables - ZCSV= XCHF/XRSNOW -ELSE - ZCSV= XCHF -ENDIF -!---------------------------------------------------------------------------- -! -!* 8. SOURCES OF PASSIVE SCALAR VARIABLES -! ----------------------------------- -! -DO JSV=1,ISV -! - IF (LNOMIXLG .AND. JSV >= NSV_LGBEG .AND. JSV<= NSV_LGEND) CYCLE -! -! Preparation of the arguments for TRIDIAG - IF (LHARAT) THEN - ZA(:,:,:) = -PTSTEP* & - ZKEFF * MZM(PRHODJ, KKA, KKU, KKL) / & - PDZZ**2 - ELSE - ZA(:,:,:) = -PTSTEP*ZCSV*PPSI_SV(:,:,:,JSV) * & - ZKEFF * MZM(PRHODJ, KKA, KKU, KKL) / & - PDZZ**2 - ENDIF - ZSOURCE(:,:,:) = 0. -! -! Compute the sources for the JSVth scalar variable - -!* in 3DIM case, a part of the flux goes vertically, and another goes horizontally -! (in presence of slopes) -!* in 1DIM case, the part of energy released in horizontal flux -! is taken into account in the vertical part - IF (HTURBDIM=='3DIM') THEN - ZSOURCE(:,:,IKB) = (PIMPL*PSFSVP(:,:,JSV) + PEXPL*PSFSVM(:,:,JSV)) / & - PDZZ(:,:,IKB) * PDIRCOSZW(:,:) & - * 0.5 * (1. + PRHODJ(:,:,KKA) / PRHODJ(:,:,IKB)) - ELSE - - ZSOURCE(:,:,IKB) = (PIMPL*PSFSVP(:,:,JSV) + PEXPL*PSFSVM(:,:,JSV)) / & - PDZZ(:,:,IKB) / PDIRCOSZW(:,:) & - * 0.5 * (1. + PRHODJ(:,:,KKA) / PRHODJ(:,:,IKB)) - END IF - ZSOURCE(:,:,IKTB+1:IKTE-1) = 0. - ZSOURCE(:,:,IKE) = 0. -! -! Obtention of the split JSV scalar variable at t+ deltat - CALL TRIDIAG(KKA,KKU,KKL,PSVM(:,:,:,JSV),ZA,PTSTEP,PEXPL,PIMPL,PRHODJ,ZSOURCE,ZRES) -! -! Compute the equivalent tendency for the JSV scalar variable - PRSVS(:,:,:,JSV)= PRSVS(:,:,:,JSV)+ & - PRHODJ(:,:,:)*(ZRES(:,:,:)-PSVM(:,:,:,JSV))/PTSTEP -! - IF ( (OTURB_FLX .AND. TPFILE%LOPENED) .OR. LLES_CALL ) THEN - ! Diagnostic of the cartesian vertical flux - ! - ZFLXZ(:,:,:) = -ZCSV * PPSI_SV(:,:,:,JSV) * MZM(PLM*SQRT(PTKEM), KKA, KKU, KKL) / PDZZ * & - DZM(PIMPL*ZRES(:,:,:) + PEXPL*PSVM(:,:,:,JSV), KKA, KKU, KKL) - ! surface flux - !* in 3DIM case, a part of the flux goes vertically, and another goes horizontally - ! (in presence of slopes) - !* in 1DIM case, the part of energy released in horizontal flux - ! is taken into account in the vertical part - IF (HTURBDIM=='3DIM') THEN - ZFLXZ(:,:,IKB) = (PIMPL*PSFSVP(:,:,JSV) + PEXPL*PSFSVM(:,:,JSV)) & - * PDIRCOSZW(:,:) - ELSE - ZFLXZ(:,:,IKB) = (PIMPL*PSFSVP(:,:,JSV) + PEXPL*PSFSVM(:,:,JSV)) & - / PDIRCOSZW(:,:) - END IF - ! extrapolates the flux under the ground so that the vertical average with - ! the IKB flux gives the ground value - ZFLXZ(:,:,KKA) = ZFLXZ(:,:,IKB) - DO JK=IKTB+1,IKTE-1 - PWSV(:,:,JK,JSV)=0.5*(ZFLXZ(:,:,JK)+ZFLXZ(:,:,JK+KKL)) - END DO - PWSV(:,:,IKB,JSV)=0.5*(ZFLXZ(:,:,IKB)+ZFLXZ(:,:,IKB+KKL)) - PWSV(:,:,IKE,JSV)=PWSV(:,:,IKE-KKL,JSV) - END IF - ! - IF (OTURB_FLX .AND. TPFILE%LOPENED) THEN - ! stores the JSVth vertical flux - WRITE(TZFIELD%CMNHNAME,'("WSV_FLX_",I3.3)') JSV - TZFIELD%CSTDNAME = '' - TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) - !PW: TODO: use the correct units of the JSV variable (and multiply it by m s-1) - TZFIELD%CUNITS = 'SVUNIT m s-1' - TZFIELD%CDIR = 'XY' - TZFIELD%CCOMMENT = 'X_Y_Z_'//TRIM(TZFIELD%CMNHNAME) - TZFIELD%NGRID = 4 - TZFIELD%NTYPE = TYPEREAL - TZFIELD%NDIMS = 3 - TZFIELD%LTIMEDEP = .TRUE. - ! - CALL IO_Field_write(TPFILE,TZFIELD,ZFLXZ) - END IF - ! - ! Storage in the LES configuration - ! - IF (LLES_CALL) THEN - CALL SECOND_MNH(ZTIME1) - CALL LES_MEAN_SUBGRID(MZF(ZFLXZ, KKA, KKU, KKL), X_LES_SUBGRID_WSv(:,:,:,JSV) ) - CALL LES_MEAN_SUBGRID(GZ_W_M(PWM,PDZZ, KKA, KKU, KKL)*MZF(ZFLXZ, KKA, KKU, KKL), & - X_LES_RES_ddxa_W_SBG_UaSv(:,:,:,JSV) ) - CALL LES_MEAN_SUBGRID(MZF(GZ_M_W(KKA, KKU, KKL,PSVM(:,:,:,JSV),PDZZ)*ZFLXZ, KKA, KKU, KKL), & - X_LES_RES_ddxa_Sv_SBG_UaSv(:,:,:,JSV) ) - CALL LES_MEAN_SUBGRID(-ZCSVP*SQRT(PTKEM)/PLM*MZF(ZFLXZ, KKA, KKU, KKL), X_LES_SUBGRID_SvPz(:,:,:,JSV) ) - CALL LES_MEAN_SUBGRID(MZF(PWM*ZFLXZ, KKA, KKU, KKL), X_LES_RES_W_SBG_WSv(:,:,:,JSV) ) - CALL SECOND_MNH(ZTIME2) - XTIME_LES = XTIME_LES + ZTIME2 - ZTIME1 - END IF - ! -END DO ! end of scalar loop -! -!---------------------------------------------------------------------------- -! -IF (LHOOK) CALL DR_HOOK('TURB_VER_SV_FLUX',1,ZHOOK_HANDLE) -END SUBROUTINE TURB_VER_SV_FLUX -END MODULE MODE_TURB_VER_SV_FLUX diff --git a/src/mesonh/turb/mode_turb_ver_thermo_corr.f90 b/src/mesonh/turb/mode_turb_ver_thermo_corr.f90 deleted file mode 100644 index db08f0ce6..000000000 --- a/src/mesonh/turb/mode_turb_ver_thermo_corr.f90 +++ /dev/null @@ -1,862 +0,0 @@ -!MNH_LIC Copyright 1994-2021 CNRS, Meteo-France and Universite Paul Sabatier -!MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence -!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt -!MNH_LIC for details. version 1. -MODULE MODE_TURB_VER_THERMO_CORR -IMPLICIT NONE -CONTAINS -SUBROUTINE TURB_VER_THERMO_CORR(KKA,KKU,KKL,KRR,KRRL,KRRI, & - OTURB_FLX,HTURBDIM,HTOM, & - PIMPL,PEXPL, & - TPFILE, & - PDXX,PDYY,PDZZ,PDZX,PDZY,PDIRCOSZW, & - PRHODJ,PTHVREF, & - PSFTHM,PSFRM,PSFTHP,PSFRP, & - PWM,PTHLM,PRM,PSVM, & - PTKEM,PLM,PLEPS, & - PLOCPEXNM,PATHETA,PAMOIST,PSRCM, & - PBETA, PSQRT_TKE, PDTH_DZ, PDR_DZ, PRED2TH3, & - PRED2R3, PRED2THR3, PBLL_O_E, PETHETA, & - PEMOIST, PREDTH1, PREDR1, PPHI3, PPSI3, PD, & - PFWTH,PFWR,PFTH2,PFR2,PFTHR, & - PTHLP,PRP,MFMOIST,PSIGS ) -! ############################################################### -! -! -!!**** *TURB_VER_THERMO_FLUX* -compute the source terms due to the vertical turbulent -!! fluxes. -!! -!! PURPOSE -!! ------- -! The purpose of this routine is to compute the vertical turbulent -! fluxes of the evolutive variables and give back the source -! terms to the main program. In the case of large horizontal meshes, -! the divergence of these vertical turbulent fluxes represent the whole -! effect of the turbulence but when the three-dimensionnal version of -! the turbulence scheme is activated (CTURBDIM="3DIM"), these divergences -! are completed in the next routine TURB_HOR. -! An arbitrary degree of implicitness has been implemented for the -! temporal treatment of these diffusion terms. -! The vertical boundary conditions are as follows: -! * at the bottom, the surface fluxes are prescribed at the same -! as the other turbulent fluxes -! * at the top, the turbulent fluxes are set to 0. -! It should be noted that the condensation has been implicitely included -! in this turbulence scheme by using conservative variables and computing -! the subgrid variance of a statistical variable s indicating the presence -! or not of condensation in a given mesh. -! -!!** METHOD -!! ------ -!! 1D type calculations are made; -!! The vertical turbulent fluxes are computed in an off-centered -!! implicit scheme (a Crank-Nicholson type with coefficients different -!! than 0.5), which allows to vary the degree of implicitness of the -!! formulation. -!! The different prognostic variables are treated one by one. -!! The contributions of each turbulent fluxes are cumulated into the -!! tendency PRvarS, and into the dynamic and thermal production of -!! TKE if necessary. -!! -!! In section 2 and 3, the thermodynamical fields are considered. -!! Only the turbulent fluxes of the conservative variables -!! (Thetal and Rnp stored in PRx(:,:,:,1)) are computed. -!! Note that the turbulent fluxes at the vertical -!! boundaries are given either by the soil scheme for the surface one -!! ( at the same instant as the others fluxes) and equal to 0 at the -!! top of the model. The thermal production is computed by vertically -!! averaging the turbulent flux and multiply this flux at the mass point by -!! a function ETHETA or EMOIST, which preform the transformation from the -!! conservative variables to the virtual potential temperature. -!! -!! In section 4, the variance of the statistical variable -!! s indicating presence or not of condensation, is determined in function -!! of the turbulent moments of the conservative variables and its -!! squarred root is stored in PSIGS. This information will be completed in -!! the horizontal turbulence if the turbulence dimensionality is not -!! equal to "1DIM". -!! -!! In section 5, the x component of the stress tensor is computed. -!! The surface flux <u'w'> is computed from the value of the surface -!! fluxes computed in axes linked to the orography ( i", j" , k"): -!! i" is parallel to the surface and in the direction of the maximum -!! slope -!! j" is also parallel to the surface and in the normal direction of -!! the maximum slope -!! k" is the normal to the surface -!! In order to prevent numerical instability, the implicit scheme has -!! been extended to the surface flux regarding to its dependence in -!! function of U. The dependence in function of the other components -!! introduced by the different rotations is only explicit. -!! The turbulent fluxes are used to compute the dynamic production of -!! TKE. For the last TKE level ( located at PDZZ(:,:,IKB)/2 from the -!! ground), an harmonic extrapolation from the dynamic production at -!! PDZZ(:,:,IKB) is used to avoid an evaluation of the gradient of U -!! in the surface layer. -!! -!! In section 6, the same steps are repeated but for the y direction -!! and in section 7, a diagnostic computation of the W variance is -!! performed. -!! -!! In section 8, the turbulent fluxes for the scalar variables are -!! computed by the same way as the conservative thermodynamical variables -!! -!! -!! EXTERNAL -!! -------- -!! GX_U_M, GY_V_M, GZ_W_M : cartesian gradient operators -!! GX_U_UW,GY_V_VW (X,Y,Z) represent the direction of the gradient -!! _(M,U,...)_ represent the localization of the -!! field to be derivated -!! _(M,UW,...) represent the localization of the -!! field derivated -!! -!! -!! MXM,MXF,MYM,MYF,MZM,MZF -!! : Shuman functions (mean operators) -!! DXF,DYF,DZF,DZM -!! : Shuman functions (difference operators) -!! -!! FUNCTIONs ETHETA and EMOIST : -!! allows to compute: -!! - the coefficients for the turbulent correlation between -!! any variable and the virtual potential temperature, of its -!! correlations with the conservative potential temperature and -!! the humidity conservative variable: -!! ------- ------- ------- -!! A' Thv' = ETHETA A' Thl' + EMOIST A' Rnp' -!! -!! -!! IMPLICIT ARGUMENTS -!! ------------------ -!! Module MODD_CST : contains physical constants -!! -!! XG : gravity constant -!! -!! Module MODD_CTURB: contains the set of constants for -!! the turbulence scheme -!! -!! XCMFS,XCMFB : cts for the momentum flux -!! XCSHF : ct for the sensible heat flux -!! XCHF : ct for the moisture flux -!! XCTV,XCHV : cts for the T and moisture variances -!! -!! Module MODD_PARAMETERS -!! -!! JPVEXT_TURB : number of vertical external points -!! JPHEXT : number of horizontal external points -!! -!! -!! REFERENCE -!! --------- -!! Book 1 of documentation (Chapter: Turbulence) -!! -!! AUTHOR -!! ------ -!! Joan Cuxart * INM and Meteo-France * -!! -!! MODIFICATIONS -!! ------------- -!! Original August 19, 1994 -!! Modifications: February 14, 1995 (J.Cuxart and J.Stein) -!! Doctorization and Optimization -!! Modifications: March 21, 1995 (J.M. Carriere) -!! Introduction of cloud water -!! Modifications: June 14, 1995 (J.Cuxart and J. Stein) -!! Phi3 and Psi3 at w-point + bug in the all -!! or nothing condens. -!! Modifications: Sept 15, 1995 (J.Cuxart and J. Stein) -!! Change the DP computation at the ground -!! Modifications: October 10, 1995 (J.Cuxart and J. Stein) -!! Psi for scal var and LES tools -!! Modifications: November 10, 1995 (J. Stein) -!! change the surface relations -!! Modifications: February 20, 1995 (J. Stein) optimization -!! Modifications: May 21, 1996 (J. Stein) -!! bug in the vertical flux of the V wind -!! component for explicit computation -!! Modifications: May 21, 1996 (N. wood) -!! modify the computation of the vertical -!! part or the surface tangential flux -!! Modifications: May 21, 1996 (P. Jabouille) -!! same modification in the Y direction -!! -!! Modifications: Sept 17, 1996 (J. Stein) change the moist case by using -!! Pi instead of Piref + use Atheta and Amoist -!! -!! Modifications: Nov 24, 1997 (V. Masson) removes the DO loops -!! Modifications: Mar 31, 1998 (V. Masson) splits the routine TURB_VER_THERMO_FLUX -!! Modifications: Oct 18, 2000 (V. Masson) LES computations -!! Modifications: Dec 01, 2000 (V. Masson) conservation of energy from -!! surface flux in 1DIM case -!! when slopes are present -!! Nov 06, 2002 (V. Masson) LES budgets -!! October 2009 (G. Tanguy) add ILENCH=LEN(YCOMMENT) after -!! change of YCOMMENT -!! 2012-02 (Y. Seity) add possibility to run with reversed -!! vertical levels -!! Modifications July 2015 (Wim de Rooy) LHARAT switch -!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O -!!-------------------------------------------------------------------------- -! -!* 0. DECLARATIONS -! ------------ -! -USE PARKIND1, ONLY : JPRB -USE YOMHOOK , ONLY : LHOOK, DR_HOOK -USE MODD_CST -USE MODD_CTURB -USE MODD_FIELD, ONLY: TFIELDDATA, TYPEREAL -USE MODD_IO, ONLY: TFILEDATA -USE MODD_PARAMETERS -USE MODD_CONF -USE MODD_LES -! -USE MODI_GRADIENT_U -USE MODI_GRADIENT_V -USE MODI_GRADIENT_W -USE MODI_GRADIENT_M -USE MODI_SHUMAN , ONLY : DZM, MZM, MZF -USE MODI_LES_MEAN_SUBGRID -! -USE MODE_IO_FIELD_WRITE, only: IO_Field_write -USE MODE_PRANDTL -! -USE MODI_SECOND_MNH -! -IMPLICIT NONE -! -!* 0.1 declarations of arguments -! -! -! -INTEGER, INTENT(IN) :: KKA !near ground array index -INTEGER, INTENT(IN) :: KKU !uppest atmosphere array index -INTEGER, INTENT(IN) :: KKL !vert. levels type 1=MNH -1=ARO -INTEGER, INTENT(IN) :: KRR ! number of moist var. -INTEGER, INTENT(IN) :: KRRL ! number of liquid water var. -INTEGER, INTENT(IN) :: KRRI ! number of ice water var. -LOGICAL, INTENT(IN) :: OTURB_FLX ! switch to write the - ! turbulent fluxes in the syncronous FM-file -CHARACTER(len=4), INTENT(IN) :: HTURBDIM ! dimensionality of the - ! turbulence scheme -CHARACTER(len=4), INTENT(IN) :: HTOM ! type of Third Order Moment -REAL, INTENT(IN) :: PIMPL, PEXPL ! Coef. for temporal disc. -TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! Output file -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PDZZ, PDXX, PDYY, PDZX, PDZY - ! Metric coefficients -REAL, DIMENSION(:,:), INTENT(IN) :: PDIRCOSZW ! Director Cosinus of the - ! normal to the ground surface -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! dry density * grid volum -REAL, DIMENSION(:,:,:), INTENT(IN) :: MFMOIST ! moist mass flux dual scheme - -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHVREF ! ref. state Virtual - ! Potential Temperature -! -REAL, DIMENSION(:,:), INTENT(IN) :: PSFTHM,PSFRM ! surface fluxes at time -! ! t - deltat -! -REAL, DIMENSION(:,:), INTENT(IN) :: PSFTHP,PSFRP ! surface fluxes at time -! ! t + deltat -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PWM -! Vertical wind -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHLM -! potential temperature at t-Delta t -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRM ! Mixing ratios - ! at t-Delta t -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PSVM ! Mixing ratios -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTKEM ! TKE at time t -! In case LHARATU=TRUE, PLM already includes all stability corrections -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLM ! Turb. mixing length -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLEPS ! dissipative length -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLOCPEXNM ! Lv(T)/Cp/Exnref at time t-1 -REAL, DIMENSION(:,:,:), INTENT(IN) :: PATHETA ! coefficients between -REAL, DIMENSION(:,:,:), INTENT(IN) :: PAMOIST ! s and Thetal and Rnp -REAL, DIMENSION(:,:,:), INTENT(IN) :: PSRCM ! normalized -! 2nd-order flux s'r'c/2Sigma_s2 at t-1 multiplied by Lambda_3 -REAL, DIMENSION(:,:,:), INTENT(IN) :: PBETA ! buoyancy coefficient -REAL, DIMENSION(:,:,:), INTENT(IN) :: PSQRT_TKE ! sqrt(e) -REAL, DIMENSION(:,:,:), INTENT(IN) :: PDTH_DZ ! d(th)/dz -REAL, DIMENSION(:,:,:), INTENT(IN) :: PDR_DZ ! d(rt)/dz -REAL, DIMENSION(:,:,:), INTENT(IN) :: PRED2TH3 ! 3D Redeslperger number R*2_th -REAL, DIMENSION(:,:,:), INTENT(IN) :: PRED2R3 ! 3D Redeslperger number R*2_r -REAL, DIMENSION(:,:,:), INTENT(IN) :: PRED2THR3 ! 3D Redeslperger number R*2_thr -REAL, DIMENSION(:,:,:), INTENT(IN) :: PBLL_O_E ! beta * Lk * Leps / tke -REAL, DIMENSION(:,:,:), INTENT(IN) :: PETHETA ! Coefficient for theta in theta_v computation -REAL, DIMENSION(:,:,:), INTENT(IN) :: PEMOIST ! Coefficient for r in theta_v computation -REAL, DIMENSION(:,:,:), INTENT(IN) :: PREDTH1 ! 1D Redelsperger number for Th -REAL, DIMENSION(:,:,:), INTENT(IN) :: PREDR1 ! 1D Redelsperger number for r -REAL, DIMENSION(:,:,:), INTENT(IN) :: PPHI3 ! Prandtl number for temperature -REAL, DIMENSION(:,:,:), INTENT(IN) :: PPSI3 ! Prandtl number for vapor -REAL, DIMENSION(:,:,:), INTENT(IN) :: PD ! Denominator in Prandtl numbers -REAL, DIMENSION(:,:,:), INTENT(IN) :: PFWTH ! d(w'2th' )/dz (at flux point) -REAL, DIMENSION(:,:,:), INTENT(IN) :: PFWR ! d(w'2r' )/dz (at flux point) -REAL, DIMENSION(:,:,:), INTENT(IN) :: PFTH2 ! d(w'th'2 )/dz (at mass point) -REAL, DIMENSION(:,:,:), INTENT(IN) :: PFR2 ! d(w'r'2 )/dz (at mass point) -REAL, DIMENSION(:,:,:), INTENT(IN) :: PFTHR ! d(w'th'r')/dz (at mass point) -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHLP ! guess of thl at t+ deltat -REAL, DIMENSION(:,:,:), INTENT(IN) :: PRP ! guess of r at t+ deltat -! -REAL, DIMENSION(:,:,:), INTENT(OUT) :: PSIGS ! Vert. part of Sigma_s at t -! -! -! -!* 0.2 declaration of local variables -! -! -REAL, DIMENSION(SIZE(PTHLM,1),SIZE(PTHLM,2),SIZE(PTHLM,3)) :: & - ZA, & ! work variable for wrc - ZFLXZ, & ! vertical flux of the treated variable - ZSOURCE, & ! source of evolution for the treated variable - ZKEFF, & ! effectif diffusion coeff = LT * SQRT( TKE ) - ZF, & ! Flux in dTh/dt =-dF/dz (evaluated at t-1)(or rt instead of Th) - ZDFDDTDZ, & ! dF/d(dTh/dz) - ZDFDDRDZ, & ! dF/d(dr/dz) - Z3RDMOMENT, & ! 3 order term in flux or variance equation -! Estimate of full level length and dissipation length scale in case LHARATU - PLMF, & ! estimate full level length scale from half levels (sub optimal) - PLEPSF ! estimate full level diss length scale from half levels (sub optimal) - -INTEGER :: IRESP ! Return code of FM routines -INTEGER :: IGRID ! C-grid indicator in LFIFM file -INTEGER :: ILENCH ! Length of comment string in LFIFM file -INTEGER :: IKB,IKE ! I index values for the Beginning and End -INTEGER :: IKU ! array sizes - - ! mass points of the domain in the 3 direct. -INTEGER :: I1,I2 ! For ZCOEFF allocation -CHARACTER (LEN=100) :: YCOMMENT ! comment string in LFIFM file -CHARACTER (LEN=16) :: YRECFM ! Name of the desired field in LFIFM file -REAL, DIMENSION(:,:,:),ALLOCATABLE :: ZCOEFF - ! coefficients for the uncentred gradient - ! computation near the ground -! -REAL :: ZTIME1, ZTIME2 -! -LOGICAL :: GUSERV ! flag to use water -LOGICAL :: GFTH2 ! flag to use w'th'2 -LOGICAL :: GFWTH ! flag to use w'2th' -LOGICAL :: GFR2 ! flag to use w'r'2 -LOGICAL :: GFWR ! flag to use w'2r' -LOGICAL :: GFTHR ! flag to use w'th'r' -TYPE(TFIELDDATA) :: TZFIELD -!---------------------------------------------------------------------------- -! -!* 1. PRELIMINARIES -! ------------- -! -REAL(KIND=JPRB) :: ZHOOK_HANDLE -IF (LHOOK) CALL DR_HOOK('TURB_VER_THERMO_CORR',0,ZHOOK_HANDLE) - -IKU=SIZE(PTKEM,3) -IKB=KKA+JPVEXT_TURB*KKL -IKE=KKU-JPVEXT_TURB*KKL -I1=MIN(KKA+JPVEXT_TURB*KKL,KKA+JPVEXT_TURB*KKL+2*KKL) -I2=MAX(KKA+JPVEXT_TURB*KKL,KKA+JPVEXT_TURB*KKL+2*KKL) - -ALLOCATE(ZCOEFF(SIZE(PDZZ,1),SIZE(PDZZ,2),I1:I2)) -! -GUSERV = (KRR/=0) -! -! compute the coefficients for the uncentred gradient computation near the -! ground -ZCOEFF(:,:,IKB+2*KKL)= - PDZZ(:,:,IKB+KKL) / & - ( (PDZZ(:,:,IKB+2*KKL)+PDZZ(:,:,IKB+KKL)) * PDZZ(:,:,IKB+2*KKL) ) -ZCOEFF(:,:,IKB+KKL)= (PDZZ(:,:,IKB+2*KKL)+PDZZ(:,:,IKB+KKL)) / & - ( PDZZ(:,:,IKB+KKL) * PDZZ(:,:,IKB+2*KKL) ) -ZCOEFF(:,:,IKB)= - (PDZZ(:,:,IKB+2*KKL)+2.*PDZZ(:,:,IKB+KKL)) / & - ( (PDZZ(:,:,IKB+2*KKL)+PDZZ(:,:,IKB+KKL)) * PDZZ(:,:,IKB+KKL) ) -! -! -IF (LHARAT) THEN -PLMF=MZF(PLM, KKA, KKU, KKL) -PLEPSF=PLMF -! function MZF produces -999 for level IKU (82 for 80 levels) -! so put these to normal value as this level (82) is indeed calculated -PLMF(:,:,IKU)=0.001 -PLEPSF(:,:,IKU)=0.001 -ZKEFF(:,:,:) = PLM(:,:,:) * SQRT(PTKEM(:,:,:)) + 50*MFMOIST(:,:,:) -ELSE -ZKEFF(:,:,:) = MZM(PLM(:,:,:) * SQRT(PTKEM(:,:,:)), KKA, KKU, KKL) -ENDIF -! - -! -! Flags for 3rd order quantities -! -GFTH2 = .FALSE. -GFR2 = .FALSE. -GFTHR = .FALSE. -GFWTH = .FALSE. -GFWR = .FALSE. -! -IF (HTOM/='NONE') THEN - GFTH2 = ANY(PFTH2/=0.) - GFR2 = ANY(PFR2 /=0.) .AND. GUSERV - GFTHR = ANY(PFTHR/=0.) .AND. GUSERV - GFWTH = ANY(PFWTH/=0.) - GFWR = ANY(PFWR /=0.) .AND. GUSERV -END IF -!---------------------------------------------------------------------------- -! -! -!* 4. TURBULENT CORRELATIONS : <THl THl>, <THl Rnp>, <Rnp Rnp> -! -------------------------------------------------------- -! -! -!* 4.2 <THl THl> -! -! Compute the turbulent variance F and F' at time t-dt. -! -IF (LHARAT) THEN - ZF (:,:,:) = PLMF*PLEPSF*MZF(PDTH_DZ**2, KKA, KKU, KKL) -ELSE - ZF (:,:,:) = XCTV*PLM*PLEPS*MZF(PPHI3*PDTH_DZ**2, KKA, KKU, KKL) -ENDIF - ZDFDDTDZ(:,:,:) = 0. ! this term, because of discretization, is treated separately - ! - ! Effect of 3rd order terms in temperature flux (at mass point) - ! - ! d(w'th'2)/dz - IF (GFTH2) THEN - ZF = ZF + M3_TH2_WTH2(KKA,KKU,KKL,PREDTH1,PREDR1,PD,PLEPS,& - & PSQRT_TKE) * PFTH2 - ZDFDDTDZ = ZDFDDTDZ + D_M3_TH2_WTH2_O_DDTDZ(KKA,KKU,KKL,PREDTH1,PREDR1,& - & PD,PLEPS,PSQRT_TKE,PBLL_O_E,PETHETA) * PFTH2 - END IF - ! - ! d(w'2th')/dz - IF (GFWTH) THEN - ZF = ZF + M3_TH2_W2TH(KKA,KKU,KKL,PREDTH1,PREDR1,PD,PDTH_DZ,& - & PLM,PLEPS,PTKEM) * MZF(PFWTH, KKA, KKU, KKL) - ZDFDDTDZ = ZDFDDTDZ + D_M3_TH2_W2TH_O_DDTDZ(KKA,KKU,KKL,PREDTH1,PREDR1,PD,& - & PLM,PLEPS,PTKEM,GUSERV) * MZF(PFWTH, KKA, KKU, KKL) - END IF - ! - IF (KRR/=0) THEN - ! d(w'r'2)/dz - IF (GFR2) THEN - ZF = ZF + M3_TH2_WR2(KKA,KKU,KKL,PD,PLEPS,PSQRT_TKE,PBLL_O_E,& - & PEMOIST,PDTH_DZ) * PFR2 - ZDFDDTDZ = ZDFDDTDZ + D_M3_TH2_WR2_O_DDTDZ(KKA,KKU,KKL,PREDTH1,PREDR1,PD,& - & PLEPS,PSQRT_TKE,PBLL_O_E,PEMOIST,PDTH_DZ) * PFR2 - END IF - ! - ! d(w'2r')/dz - IF (GFWR) THEN - ZF = ZF + M3_TH2_W2R(KKA,KKU,KKL,PD,PLM,PLEPS,PTKEM,PBLL_O_E,& - & PEMOIST,PDTH_DZ) * MZF(PFWR, KKA, KKU, KKL) - ZDFDDTDZ = ZDFDDTDZ + D_M3_TH2_W2R_O_DDTDZ(KKA,KKU,KKL,PREDTH1,PREDR1,PD,& - & PLM,PLEPS,PTKEM,PBLL_O_E,PEMOIST,PDTH_DZ) * MZF(PFWR, KKA, KKU, KKL) - END IF - ! - ! d(w'th'r')/dz - IF (GFTHR) THEN - ZF = ZF + M3_TH2_WTHR(KKA,KKU,KKL,PREDR1,PD,PLEPS,PSQRT_TKE,& - & PBLL_O_E,PEMOIST,PDTH_DZ) * PFTHR - ZDFDDTDZ = ZDFDDTDZ + D_M3_TH2_WTHR_O_DDTDZ(KKA,KKU,KKL,PREDTH1,PREDR1,& - & PD,PLEPS,PSQRT_TKE,PBLL_O_E,PEMOIST,PDTH_DZ) * PFTHR - END IF - - END IF - ! - ZFLXZ(:,:,:) = ZF & - ! + PIMPL * XCTV*PLM*PLEPS & - ! *MZF(D_PHI3DTDZ2_O_DDTDZ(PPHI3,PREDTH1,PREDR1,PRED2TH3,PRED2THR3,PDTH_DZ,HTURBDIM,GUSERV) & - ! *DZM(PTHLP - PTHLM, KKA, KKU, KKL) / PDZZ ) & - + PIMPL * ZDFDDTDZ * MZF(DZM(PTHLP - PTHLM, KKA, KKU, KKL) / PDZZ, KKA, KKU, KKL) - ! - ! special case near the ground ( uncentred gradient ) - IF (LHARAT) THEN - ZFLXZ(:,:,IKB) = PLMF(:,:,IKB) & - * PLEPSF(:,:,IKB) & - *( PEXPL * & - ( ZCOEFF(:,:,IKB+2*KKL)*PTHLM(:,:,IKB+2*KKL) & - +ZCOEFF(:,:,IKB+KKL )*PTHLM(:,:,IKB+KKL ) & - +ZCOEFF(:,:,IKB )*PTHLM(:,:,IKB ) )**2 & - +PIMPL * & - ( ZCOEFF(:,:,IKB+2*KKL)*PTHLP(:,:,IKB+2*KKL) & - +ZCOEFF(:,:,IKB+KKL )*PTHLP(:,:,IKB+KKL ) & - +ZCOEFF(:,:,IKB )*PTHLP(:,:,IKB ) )**2 & - ) - ELSE - ZFLXZ(:,:,IKB) = XCTV * PPHI3(:,:,IKB+KKL) * PLM(:,:,IKB) & - * PLEPS(:,:,IKB) & - *( PEXPL * & - ( ZCOEFF(:,:,IKB+2*KKL)*PTHLM(:,:,IKB+2*KKL) & - +ZCOEFF(:,:,IKB+KKL )*PTHLM(:,:,IKB+KKL ) & - +ZCOEFF(:,:,IKB )*PTHLM(:,:,IKB ) )**2 & - +PIMPL * & - ( ZCOEFF(:,:,IKB+2*KKL)*PTHLP(:,:,IKB+2*KKL) & - +ZCOEFF(:,:,IKB+KKL )*PTHLP(:,:,IKB+KKL ) & - +ZCOEFF(:,:,IKB )*PTHLP(:,:,IKB ) )**2 & - ) - ENDIF - ! - ZFLXZ(:,:,KKA) = ZFLXZ(:,:,IKB) - ! - ZFLXZ = MAX(0., ZFLXZ) - ! - IF (KRRL > 0) THEN - PSIGS(:,:,:) = ZFLXZ(:,:,:) * PATHETA(:,:,:)**2 - END IF - ! - ! - ! stores <THl THl> - IF ( OTURB_FLX .AND. TPFILE%LOPENED ) THEN - TZFIELD%CMNHNAME = 'THL_VVAR' - TZFIELD%CSTDNAME = '' - TZFIELD%CLONGNAME = 'THL_VVAR' - TZFIELD%CUNITS = 'K2' - TZFIELD%CDIR = 'XY' - TZFIELD%CCOMMENT = 'X_Y_Z_THL_VVAR' - TZFIELD%NGRID = 1 - TZFIELD%NTYPE = TYPEREAL - TZFIELD%NDIMS = 3 - TZFIELD%LTIMEDEP = .TRUE. - CALL IO_Field_write(TPFILE,TZFIELD,ZFLXZ) - END IF -! -! and we store in LES configuration -! - IF (LLES_CALL) THEN - CALL SECOND_MNH(ZTIME1) - CALL LES_MEAN_SUBGRID(ZFLXZ, X_LES_SUBGRID_Thl2 ) - CALL LES_MEAN_SUBGRID(MZF(PWM, KKA, KKU, KKL)*ZFLXZ, X_LES_RES_W_SBG_Thl2 ) - CALL LES_MEAN_SUBGRID(-2.*XCTD*PSQRT_TKE*ZFLXZ/PLEPS, X_LES_SUBGRID_DISS_Thl2 ) - CALL LES_MEAN_SUBGRID(PETHETA*ZFLXZ, X_LES_SUBGRID_ThlThv ) - CALL LES_MEAN_SUBGRID(-XA3*PBETA*PETHETA*ZFLXZ, X_LES_SUBGRID_ThlPz, .TRUE. ) - CALL SECOND_MNH(ZTIME2) - XTIME_LES = XTIME_LES + ZTIME2 - ZTIME1 - END IF -! - IF ( KRR /= 0 ) THEN -! -!* 4.3 <THl Rnp> -! -! - ! Compute the turbulent variance F and F' at time t-dt. -IF (LHARAT) THEN - ZF (:,:,:) = PLMF*PLEPSF*MZF(PDTH_DZ*PDR_DZ, KKA, KKU, KKL) -ELSE - ZF (:,:,:) = XCTV*PLM*PLEPS*MZF(0.5*(PPHI3+PPSI3)*PDTH_DZ*PDR_DZ, KKA, KKU, KKL) -ENDIF - ZDFDDTDZ(:,:,:) = 0. ! this term, because of discretization, is treated separately - ZDFDDRDZ(:,:,:) = 0. ! this term, because of discretization, is treated separately - ! - ! Effect of 3rd order terms in temperature flux (at mass point) - ! - ! d(w'th'2)/dz - IF (GFTH2) THEN - ZF = ZF + M3_THR_WTH2(KKA,KKU,KKL,PREDR1,PD,PLEPS,PSQRT_TKE,& - & PBLL_O_E,PETHETA,PDR_DZ) * PFTH2 - ZDFDDTDZ = ZDFDDTDZ + D_M3_THR_WTH2_O_DDTDZ(KKA,KKU,KKL,PREDTH1,PREDR1,& - & PD,PLEPS,PSQRT_TKE,PBLL_O_E,PETHETA,PDR_DZ) * PFTH2 - ZDFDDRDZ = ZDFDDRDZ + D_M3_THR_WTH2_O_DDRDZ(KKA,KKU,KKL,PREDTH1,PREDR1,& - & PD,PLEPS,PSQRT_TKE,PBLL_O_E,PETHETA) * PFTH2 - END IF - ! - ! d(w'2th')/dz - IF (GFWTH) THEN - ZF = ZF + M3_THR_W2TH(KKA,KKU,KKL,PREDR1,PD,PLM,PLEPS,PTKEM,& - & PDR_DZ) * MZF(PFWTH, KKA, KKU, KKL) - ZDFDDTDZ = ZDFDDTDZ + D_M3_THR_W2TH_O_DDTDZ(KKA,KKU,KKL,PREDTH1,PREDR1,& - & PD,PLM,PLEPS,PTKEM,PBLL_O_E,PDR_DZ,PETHETA) * MZF(PFWTH, KKA, KKU, KKL) - ZDFDDRDZ = ZDFDDRDZ + D_M3_THR_W2TH_O_DDRDZ(KKA,KKU,KKL,PREDTH1,PREDR1,& - & PD,PLM,PLEPS,PTKEM) * MZF(PFWTH, KKA, KKU, KKL) - END IF - ! - ! d(w'r'2)/dz - IF (GFR2) THEN - ZF = ZF + M3_THR_WR2(KKA,KKU,KKL,PREDTH1,PD,PLEPS,PSQRT_TKE,& - & PBLL_O_E,PEMOIST,PDTH_DZ) * PFR2 - ZDFDDTDZ = ZDFDDTDZ + D_M3_THR_WR2_O_DDTDZ(KKA,KKU,KKL,PREDR1,PREDTH1,PD,& - & PLEPS,PSQRT_TKE,PBLL_O_E,PEMOIST) * PFR2 - ZDFDDRDZ = ZDFDDRDZ + D_M3_THR_WR2_O_DDRDZ(KKA,KKU,KKL,PREDR1,PREDTH1,PD,& - & PLEPS,PSQRT_TKE,PBLL_O_E,PEMOIST,PDTH_DZ) * PFR2 - END IF - ! - ! d(w'2r')/dz - IF (GFWR) THEN - ZF = ZF + M3_THR_W2R(KKA,KKU,KKL,PREDTH1,PD,PLM,PLEPS,PTKEM,& - & PDTH_DZ) * MZF(PFWR, KKA, KKU, KKL) - ZDFDDTDZ = ZDFDDTDZ + D_M3_THR_W2R_O_DDTDZ(KKA,KKU,KKL,PREDR1,PREDTH1,PD,& - & PLM,PLEPS,PTKEM) * MZF(PFWR, KKA, KKU, KKL) - ZDFDDRDZ = ZDFDDRDZ + D_M3_THR_W2R_O_DDRDZ(KKA,KKU,KKL,PREDR1,PREDTH1,PD,& - & PLM,PLEPS,PTKEM,PBLL_O_E,PDTH_DZ,PEMOIST) * MZF(PFWR, KKA, KKU, KKL) - END IF - ! - ! d(w'th'r')/dz - IF (GFTHR) THEN - ZF = ZF + M3_THR_WTHR(KKA,KKU,KKL,PREDTH1,PREDR1,PD,PLEPS,& - & PSQRT_TKE) * PFTHR - ZDFDDTDZ = ZDFDDTDZ + D_M3_THR_WTHR_O_DDTDZ(KKA,KKU,KKL,PREDTH1,PREDR1,& - & PD,PLEPS,PSQRT_TKE,PBLL_O_E,PETHETA) * PFTHR - ZDFDDRDZ = ZDFDDRDZ + D_M3_THR_WTHR_O_DDRDZ(KKA,KKU,KKL,PREDR1,PREDTH1,& - & PD,PLEPS,PSQRT_TKE,PBLL_O_E,PEMOIST) * PFTHR - END IF - ! - IF (LHARAT) THEN - ZFLXZ(:,:,:) = ZF & - + PIMPL * PLMF*PLEPSF*0.5 & - * MZF(( 2. & - ) *PDR_DZ *DZM(PTHLP - PTHLM, KKA, KKU, KKL ) / PDZZ & - +( 2. & - ) *PDTH_DZ *DZM(PRP - PRM(:,:,:,1), KKA, KKU, KKL) / PDZZ & - , KKA, KKU, KKL) & - + PIMPL * ZDFDDTDZ * MZF(DZM(PTHLP - PTHLM(:,:,:), KKA, KKU, KKL) / PDZZ, KKA, KKU, KKL) & - + PIMPL * ZDFDDRDZ * MZF(DZM(PRP - PRM(:,:,:,1), KKA, KKU, KKL) / PDZZ, KKA, KKU, KKL) - ELSE - ZFLXZ(:,:,:) = ZF & - + PIMPL * XCTV*PLM*PLEPS*0.5 & - * MZF(( D_PHI3DTDZ_O_DDTDZ(PPHI3,PREDTH1,PREDR1,PRED2TH3,PRED2THR3,HTURBDIM,GUSERV) & ! d(phi3*dthdz)/ddthdz term - +D_PSI3DTDZ_O_DDTDZ(PPSI3,PREDR1,PREDTH1,PRED2R3,PRED2THR3,HTURBDIM,GUSERV) & ! d(psi3*dthdz)/ddthdz term - ) *PDR_DZ *DZM(PTHLP - PTHLM, KKA, KKU, KKL) / PDZZ & - +( D_PHI3DRDZ_O_DDRDZ(PPHI3,PREDTH1,PREDR1,PRED2TH3,PRED2THR3,HTURBDIM,GUSERV) & ! d(phi3*drdz )/ddrdz term - +D_PSI3DRDZ_O_DDRDZ(PPSI3,PREDR1,PREDTH1,PRED2R3,PRED2THR3,HTURBDIM,GUSERV) & ! d(psi3*drdz )/ddrdz term - ) *PDTH_DZ *DZM(PRP - PRM(:,:,:,1), KKA, KKU, KKL) / PDZZ & - , KKA, KKU, KKL) & - + PIMPL * ZDFDDTDZ * MZF(DZM(PTHLP - PTHLM(:,:,:), KKA, KKU, KKL) / PDZZ, KKA, KKU, KKL) & - + PIMPL * ZDFDDRDZ * MZF(DZM(PRP - PRM(:,:,:,1), KKA, KKU, KKL) / PDZZ, KKA, KKU, KKL) - ENDIF - ! - ! special case near the ground ( uncentred gradient ) - IF (LHARAT) THEN - ZFLXZ(:,:,IKB) = & - (1. ) & - *( PEXPL * & - ( ZCOEFF(:,:,IKB+2*KKL)*PTHLM(:,:,IKB+2*KKL) & - +ZCOEFF(:,:,IKB+KKL )*PTHLM(:,:,IKB+KKL ) & - +ZCOEFF(:,:,IKB )*PTHLM(:,:,IKB )) & - *( ZCOEFF(:,:,IKB+2*KKL)*PRM(:,:,IKB+2*KKL,1) & - +ZCOEFF(:,:,IKB+KKL )*PRM(:,:,IKB+KKL,1 ) & - +ZCOEFF(:,:,IKB )*PRM(:,:,IKB ,1 )) & - +PIMPL * & - ( ZCOEFF(:,:,IKB+2*KKL)*PTHLP(:,:,IKB+2*KKL) & - +ZCOEFF(:,:,IKB+KKL )*PTHLP(:,:,IKB+KKL ) & - +ZCOEFF(:,:,IKB )*PTHLP(:,:,IKB )) & - *( ZCOEFF(:,:,IKB+2*KKL)*PRP(:,:,IKB+2*KKL ) & - +ZCOEFF(:,:,IKB+KKL )*PRP(:,:,IKB+KKL ) & - +ZCOEFF(:,:,IKB )*PRP(:,:,IKB )) & - ) - ELSE - ZFLXZ(:,:,IKB) = & - (XCHT1 * PPHI3(:,:,IKB+KKL) + XCHT2 * PPSI3(:,:,IKB+KKL)) & - *( PEXPL * & - ( ZCOEFF(:,:,IKB+2*KKL)*PTHLM(:,:,IKB+2*KKL) & - +ZCOEFF(:,:,IKB+KKL )*PTHLM(:,:,IKB+KKL ) & - +ZCOEFF(:,:,IKB )*PTHLM(:,:,IKB )) & - *( ZCOEFF(:,:,IKB+2*KKL)*PRM(:,:,IKB+2*KKL,1) & - +ZCOEFF(:,:,IKB+KKL )*PRM(:,:,IKB+KKL,1 ) & - +ZCOEFF(:,:,IKB )*PRM(:,:,IKB ,1 )) & - +PIMPL * & - ( ZCOEFF(:,:,IKB+2*KKL)*PTHLP(:,:,IKB+2*KKL) & - +ZCOEFF(:,:,IKB+KKL )*PTHLP(:,:,IKB+KKL ) & - +ZCOEFF(:,:,IKB )*PTHLP(:,:,IKB )) & - *( ZCOEFF(:,:,IKB+2*KKL)*PRP(:,:,IKB+2*KKL ) & - +ZCOEFF(:,:,IKB+KKL )*PRP(:,:,IKB+KKL ) & - +ZCOEFF(:,:,IKB )*PRP(:,:,IKB )) & - ) - ENDIF - ! - ZFLXZ(:,:,KKA) = ZFLXZ(:,:,IKB) - ! - IF ( KRRL > 0 ) THEN -! -! -! NB PATHETA is -b in Chaboureau Bechtold 2002 which explains the + sign here - - PSIGS(:,:,:) = PSIGS(:,:,:) + & - 2. * PATHETA(:,:,:) * PAMOIST(:,:,:) * ZFLXZ(:,:,:) - END IF - ! stores <THl Rnp> - IF ( OTURB_FLX .AND. TPFILE%LOPENED ) THEN - TZFIELD%CMNHNAME = 'THLRCONS_VCOR' - TZFIELD%CSTDNAME = '' - TZFIELD%CLONGNAME = 'THLRCONS_VCOR' - TZFIELD%CUNITS = 'K kg kg-1' - TZFIELD%CDIR = 'XY' - TZFIELD%CCOMMENT = 'X_Y_Z_THLRCONS_VCOR' - TZFIELD%NGRID = 1 - TZFIELD%NTYPE = TYPEREAL - TZFIELD%NDIMS = 3 - TZFIELD%LTIMEDEP = .TRUE. - CALL IO_Field_write(TPFILE,TZFIELD,ZFLXZ) - END IF -! -! and we store in LES configuration -! -IF (LLES_CALL) THEN - CALL SECOND_MNH(ZTIME1) - CALL LES_MEAN_SUBGRID(ZFLXZ, X_LES_SUBGRID_THlRt ) - CALL LES_MEAN_SUBGRID(MZF(PWM, KKA, KKU, KKL)*ZFLXZ, X_LES_RES_W_SBG_ThlRt ) - CALL LES_MEAN_SUBGRID(-2.*XCTD*PSQRT_TKE*ZFLXZ/PLEPS, X_LES_SUBGRID_DISS_ThlRt ) - CALL LES_MEAN_SUBGRID(PETHETA*ZFLXZ, X_LES_SUBGRID_RtThv ) - CALL LES_MEAN_SUBGRID(-XA3*PBETA*PETHETA*ZFLXZ, X_LES_SUBGRID_RtPz, .TRUE. ) - CALL LES_MEAN_SUBGRID(PEMOIST*ZFLXZ, X_LES_SUBGRID_ThlThv , .TRUE. ) - CALL LES_MEAN_SUBGRID(-XA3*PBETA*PEMOIST*ZFLXZ, X_LES_SUBGRID_ThlPz, .TRUE. ) - CALL SECOND_MNH(ZTIME2) - XTIME_LES = XTIME_LES + ZTIME2 - ZTIME1 -END IF -! -! -!* 4.4 <Rnp Rnp> -! -! - ! Compute the turbulent variance F and F' at time t-dt. -IF (LHARAT) THEN - ZF (:,:,:) = PLMF*PLEPSF*MZF(PDR_DZ**2, KKA, KKU, KKL) - ELSE - ZF (:,:,:) = XCTV*PLM*PLEPS*MZF(PPSI3*PDR_DZ**2, KKA, KKU, KKL) -ENDIF - ZDFDDRDZ(:,:,:) = 0. ! this term, because of discretization, is treated separately - ! - ! Effect of 3rd order terms in temperature flux (at mass point) - ! - ! d(w'r'2)/dz - IF (GFR2) THEN - ZF = ZF + M3_R2_WR2(KKA,KKU,KKL,PREDR1,PREDTH1,PD,PLEPS,& - & PSQRT_TKE) * PFR2 - ZDFDDRDZ = ZDFDDRDZ + D_M3_R2_WR2_O_DDRDZ(KKA,KKU,KKL,PREDR1,PREDTH1,& - & PD,PLEPS,PSQRT_TKE,PBLL_O_E,PEMOIST) * PFR2 - END IF - ! - ! d(w'2r')/dz - IF (GFWR) THEN - ZF = ZF + M3_R2_W2R(KKA,KKU,KKL,PREDR1,PREDTH1,PD,PDR_DZ,& - & PLM,PLEPS,PTKEM) * MZF(PFWR, KKA, KKU, KKL) - ZDFDDRDZ = ZDFDDRDZ + D_M3_R2_W2R_O_DDRDZ(KKA,KKU,KKL,PREDR1,PREDTH1,& - & PD,PLM,PLEPS,PTKEM,GUSERV) * MZF(PFWR, KKA, KKU, KKL) - END IF - ! - IF (KRR/=0) THEN - ! d(w'r'2)/dz - IF (GFTH2) THEN - ZF = ZF + M3_R2_WTH2(KKA,KKU,KKL,PD,PLEPS,PSQRT_TKE,& - & PBLL_O_E,PETHETA,PDR_DZ) * PFTH2 - ZDFDDRDZ = ZDFDDRDZ + D_M3_R2_WTH2_O_DDRDZ(KKA,KKU,KKL,PREDR1,& - & PREDTH1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PETHETA,PDR_DZ) * PFTH2 - END IF - ! - ! d(w'2r')/dz - IF (GFWTH) THEN - ZF = ZF + M3_R2_W2TH(KKA,KKU,KKL,PD,PLM,PLEPS,PTKEM,& - & PBLL_O_E,PETHETA,PDR_DZ) * MZF(PFWTH, KKA, KKU, KKL) - ZDFDDRDZ = ZDFDDRDZ + D_M3_R2_W2TH_O_DDRDZ(KKA,KKU,KKL,PREDR1,PREDTH1,& - & PD,PLM,PLEPS,PTKEM,PBLL_O_E,PETHETA,PDR_DZ) * MZF(PFWTH, KKA, KKU, KKL) - END IF - ! - ! d(w'th'r')/dz - IF (GFTHR) THEN - ZF = ZF + M3_R2_WTHR(KKA,KKU,KKL,PREDTH1,PD,PLEPS,& - & PSQRT_TKE,PBLL_O_E,PETHETA,PDR_DZ) * PFTHR - ZDFDDRDZ = ZDFDDRDZ + D_M3_R2_WTHR_O_DDRDZ(KKA,KKU,KKL,PREDR1,PREDTH1,& - & PD,PLEPS,PSQRT_TKE,PBLL_O_E,PETHETA,PDR_DZ) * PFTHR - END IF - - END IF - ! - IF (LHARAT) THEN - ZFLXZ(:,:,:) = ZF & - + PIMPL * PLMF*PLEPSF & - *MZF(2.*PDR_DZ* & - DZM(PRP - PRM(:,:,:,1), KKA, KKU, KKL) / PDZZ, KKA, KKU, KKL) & - + PIMPL * ZDFDDRDZ * MZF(DZM(PRP - PRM(:,:,:,1), KKA, KKU, KKL) / PDZZ, KKA, KKU, KKL) - ELSE - ZFLXZ(:,:,:) = ZF & - + PIMPL * XCTV*PLM*PLEPS & - *MZF(D_PSI3DRDZ2_O_DDRDZ(PPSI3,PREDR1,PREDTH1,PRED2R3,PRED2THR3,PDR_DZ,HTURBDIM,GUSERV) & - *DZM(PRP - PRM(:,:,:,1), KKA, KKU, KKL) / PDZZ, KKA, KKU, KKL) & - + PIMPL * ZDFDDRDZ * MZF(DZM(PRP - PRM(:,:,:,1), KKA, KKU, KKL) / PDZZ, KKA, KKU, KKL) - ENDIF - ! - ! special case near the ground ( uncentred gradient ) - IF (LHARAT) THEN - ZFLXZ(:,:,IKB) = PLMF(:,:,IKB) & - * PLEPSF(:,:,IKB) & - *( PEXPL * & - ( ZCOEFF(:,:,IKB+2*KKL)*PRM(:,:,IKB+2*KKL,1) & - +ZCOEFF(:,:,IKB+KKL )*PRM(:,:,IKB+KKL,1 ) & - +ZCOEFF(:,:,IKB )*PRM(:,:,IKB ,1 ))**2 & - +PIMPL * & - ( ZCOEFF(:,:,IKB+2*KKL)*PRP(:,:,IKB+2*KKL) & - +ZCOEFF(:,:,IKB+KKL )*PRP(:,:,IKB+KKL ) & - +ZCOEFF(:,:,IKB )*PRP(:,:,IKB ))**2 & - ) - ELSE - ZFLXZ(:,:,IKB) = XCHV * PPSI3(:,:,IKB+KKL) * PLM(:,:,IKB) & - * PLEPS(:,:,IKB) & - *( PEXPL * & - ( ZCOEFF(:,:,IKB+2*KKL)*PRM(:,:,IKB+2*KKL,1) & - +ZCOEFF(:,:,IKB+KKL )*PRM(:,:,IKB+KKL,1 ) & - +ZCOEFF(:,:,IKB )*PRM(:,:,IKB ,1 ))**2 & - +PIMPL * & - ( ZCOEFF(:,:,IKB+2*KKL)*PRP(:,:,IKB+2*KKL) & - +ZCOEFF(:,:,IKB+KKL )*PRP(:,:,IKB+KKL ) & - +ZCOEFF(:,:,IKB )*PRP(:,:,IKB ))**2 & - ) - ENDIF - ! - ZFLXZ(:,:,KKA) = ZFLXZ(:,:,IKB) - ! - IF ( KRRL > 0 ) THEN - PSIGS(:,:,:) = PSIGS(:,:,:) + PAMOIST(:,:,:) **2 * ZFLXZ(:,:,:) - END IF - ! stores <Rnp Rnp> - IF ( OTURB_FLX .AND. TPFILE%LOPENED ) THEN - TZFIELD%CMNHNAME = 'RTOT_VVAR' - TZFIELD%CSTDNAME = '' - TZFIELD%CLONGNAME = 'RTOT_VVAR' - TZFIELD%CUNITS = 'kg2 kg-2' - TZFIELD%CDIR = 'XY' - TZFIELD%CCOMMENT = 'X_Y_Z_RTOT_VVAR' - TZFIELD%NGRID = 1 - TZFIELD%NTYPE = TYPEREAL - TZFIELD%NDIMS = 3 - TZFIELD%LTIMEDEP = .TRUE. - CALL IO_Field_write(TPFILE,TZFIELD,ZFLXZ) - END IF - ! - ! and we store in LES configuration - ! - IF (LLES_CALL) THEN - CALL SECOND_MNH(ZTIME1) - CALL LES_MEAN_SUBGRID(ZFLXZ, X_LES_SUBGRID_Rt2 ) - CALL LES_MEAN_SUBGRID(MZF(PWM, KKA, KKU, KKL)*ZFLXZ, X_LES_RES_W_SBG_Rt2 ) - CALL LES_MEAN_SUBGRID(PEMOIST*ZFLXZ, X_LES_SUBGRID_RtThv , .TRUE. ) - CALL LES_MEAN_SUBGRID(-XA3*PBETA*PEMOIST*ZFLXZ, X_LES_SUBGRID_RtPz, .TRUE. ) - CALL LES_MEAN_SUBGRID(-2.*XCTD*PSQRT_TKE*ZFLXZ/PLEPS, X_LES_SUBGRID_DISS_Rt2 ) - CALL SECOND_MNH(ZTIME2) - XTIME_LES = XTIME_LES + ZTIME2 - ZTIME1 - END IF - ! - END IF ! end if KRR ne 0 -! -! -! 4.5 Vertical part of Sigma_s -! - IF ( KRRL > 0 ) THEN - ! Extrapolate PSIGS at the ground and at the top - PSIGS(:,:,KKA) = PSIGS(:,:,IKB) - PSIGS(:,:,KKU) = PSIGS(:,:,IKE) -#ifdef REPRO48 - PSIGS(:,:,:) = MAX (PSIGS(:,:,:) , 0.) - PSIGS(:,:,:) = SQRT(PSIGS(:,:,:)) -#else - PSIGS(:,:,:) = SQRT( MAX (PSIGS(:,:,:) , 1.E-12) ) -#endif - END IF - -! -! 4.6 Deallocate -! - DEALLOCATE(ZCOEFF) -!---------------------------------------------------------------------------- -IF (LHOOK) CALL DR_HOOK('TURB_VER_THERMO_CORR',1,ZHOOK_HANDLE) -END SUBROUTINE TURB_VER_THERMO_CORR -END MODULE MODE_TURB_VER_THERMO_CORR diff --git a/src/mesonh/turb/mode_turb_ver_thermo_flux.f90 b/src/mesonh/turb/mode_turb_ver_thermo_flux.f90 deleted file mode 100644 index 6d0f1a009..000000000 --- a/src/mesonh/turb/mode_turb_ver_thermo_flux.f90 +++ /dev/null @@ -1,1034 +0,0 @@ -!MNH_LIC Copyright 1994-2021 CNRS, Meteo-France and Universite Paul Sabatier -!MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence -!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt -!MNH_LIC for details. version 1. -MODULE MODE_TURB_VER_THERMO_FLUX -IMPLICIT NONE -CONTAINS - -SUBROUTINE TURB_VER_THERMO_FLUX(KKA,KKU,KKL,KRR,KRRL,KRRI, & - OTURB_FLX,HTURBDIM,HTOM, & - PIMPL,PEXPL, & - PTSTEP, & - TPFILE, & - PDXX,PDYY,PDZZ,PDZX,PDZY,PDIRCOSZW,PZZ, & - PRHODJ,PTHVREF, & - PSFTHM,PSFRM,PSFTHP,PSFRP, & - PWM,PTHLM,PRM,PSVM, & - PTKEM,PLM,PLEPS, & - PLOCPEXNM,PATHETA,PAMOIST,PSRCM,PFRAC_ICE, & - PBETA, PSQRT_TKE, PDTH_DZ, PDR_DZ, PRED2TH3, & - PRED2R3, PRED2THR3, PBLL_O_E, PETHETA, & - PEMOIST, PREDTH1, PREDR1, PPHI3, PPSI3, PD, & - PFWTH,PFWR,PFTH2,PFR2,PFTHR,MFMOIST,PBL_DEPTH,& - PWTHV,PRTHLS,PRRS,PTHLP,PRP,PTP,PWTH,PWRC ) -! ############################################################### -! -! -!!**** *TURB_VER_THERMO_FLUX* -compute the source terms due to the vertical turbulent -!! fluxes. -!! -!! PURPOSE -!! ------- -! The purpose of this routine is to compute the vertical turbulent -! fluxes of the evolutive variables and give back the source -! terms to the main program. In the case of large horizontal meshes, -! the divergence of these vertical turbulent fluxes represent the whole -! effect of the turbulence but when the three-dimensionnal version of -! the turbulence scheme is activated (CTURBDIM="3DIM"), these divergences -! are completed in the next routine TURB_HOR. -! An arbitrary degree of implicitness has been implemented for the -! temporal treatment of these diffusion terms. -! The vertical boundary conditions are as follows: -! * at the bottom, the surface fluxes are prescribed at the same -! as the other turbulent fluxes -! * at the top, the turbulent fluxes are set to 0. -! It should be noted that the condensation has been implicitely included -! in this turbulence scheme by using conservative variables and computing -! the subgrid variance of a statistical variable s indicating the presence -! or not of condensation in a given mesh. -! -!!** METHOD -!! ------ -!! 1D type calculations are made; -!! The vertical turbulent fluxes are computed in an off-centered -!! implicit scheme (a Crank-Nicholson type with coefficients different -!! than 0.5), which allows to vary the degree of implicitness of the -!! formulation. -!! The different prognostic variables are treated one by one. -!! The contributions of each turbulent fluxes are cumulated into the -!! tendency PRvarS, and into the dynamic and thermal production of -!! TKE if necessary. -!! -!! In section 2 and 3, the thermodynamical fields are considered. -!! Only the turbulent fluxes of the conservative variables -!! (Thetal and Rnp stored in PRx(:,:,:,1)) are computed. -!! Note that the turbulent fluxes at the vertical -!! boundaries are given either by the soil scheme for the surface one -!! ( at the same instant as the others fluxes) and equal to 0 at the -!! top of the model. The thermal production is computed by vertically -!! averaging the turbulent flux and multiply this flux at the mass point by -!! a function ETHETA or EMOIST, which preform the transformation from the -!! conservative variables to the virtual potential temperature. -!! -!! In section 4, the variance of the statistical variable -!! s indicating presence or not of condensation, is determined in function -!! of the turbulent moments of the conservative variables and its -!! squarred root is stored in PSIGS. This information will be completed in -!! the horizontal turbulence if the turbulence dimensionality is not -!! equal to "1DIM". -!! -!! In section 5, the x component of the stress tensor is computed. -!! The surface flux <u'w'> is computed from the value of the surface -!! fluxes computed in axes linked to the orography ( i", j" , k"): -!! i" is parallel to the surface and in the direction of the maximum -!! slope -!! j" is also parallel to the surface and in the normal direction of -!! the maximum slope -!! k" is the normal to the surface -!! In order to prevent numerical instability, the implicit scheme has -!! been extended to the surface flux regarding to its dependence in -!! function of U. The dependence in function of the other components -!! introduced by the different rotations is only explicit. -!! The turbulent fluxes are used to compute the dynamic production of -!! TKE. For the last TKE level ( located at PDZZ(:,:,IKB)/2 from the -!! ground), an harmonic extrapolation from the dynamic production at -!! PDZZ(:,:,IKB) is used to avoid an evaluation of the gradient of U -!! in the surface layer. -!! -!! In section 6, the same steps are repeated but for the y direction -!! and in section 7, a diagnostic computation of the W variance is -!! performed. -!! -!! In section 8, the turbulent fluxes for the scalar variables are -!! computed by the same way as the conservative thermodynamical variables -!! -!! -!! EXTERNAL -!! -------- -!! GX_U_M, GY_V_M, GZ_W_M : cartesian gradient operators -!! GX_U_UW,GY_V_VW (X,Y,Z) represent the direction of the gradient -!! _(M,U,...)_ represent the localization of the -!! field to be derivated -!! _(M,UW,...) represent the localization of the -!! field derivated -!! -!! -!! MXM,MXF,MYM,MYF,MZM,MZF -!! : Shuman functions (mean operators) -!! DXF,DYF,DZF,DZM -!! : Shuman functions (difference operators) -!! -!! SUBROUTINE TRIDIAG : to compute the split implicit evolution -!! of a variable located at a mass point -!! -!! SUBROUTINE TRIDIAG_WIND: to compute the split implicit evolution -!! of a variable located at a wind point -!! -!! FUNCTIONs ETHETA and EMOIST : -!! allows to compute: -!! - the coefficients for the turbulent correlation between -!! any variable and the virtual potential temperature, of its -!! correlations with the conservative potential temperature and -!! the humidity conservative variable: -!! ------- ------- ------- -!! A' Thv' = ETHETA A' Thl' + EMOIST A' Rnp' -!! -!! -!! IMPLICIT ARGUMENTS -!! ------------------ -!! Module MODD_CST : contains physical constants -!! -!! XG : gravity constant -!! -!! Module MODD_CTURB: contains the set of constants for -!! the turbulence scheme -!! -!! XCMFS,XCMFB : cts for the momentum flux -!! XCSHF : ct for the sensible heat flux -!! XCHF : ct for the moisture flux -!! XCTV,XCHV : cts for the T and moisture variances -!! -!! Module MODD_PARAMETERS -!! -!! JPVEXT_TURB : number of vertical external points -!! JPHEXT : number of horizontal external points -!! -!! -!! REFERENCE -!! --------- -!! Book 1 of documentation (Chapter: Turbulence) -!! -!! AUTHOR -!! ------ -!! Joan Cuxart * INM and Meteo-France * -!! -!! MODIFICATIONS -!! ------------- -!! Original August 19, 1994 -!! Modifications: February 14, 1995 (J.Cuxart and J.Stein) -!! Doctorization and Optimization -!! Modifications: March 21, 1995 (J.M. Carriere) -!! Introduction of cloud water -!! Modifications: June 14, 1995 (J.Cuxart and J. Stein) -!! Phi3 and Psi3 at w-point + bug in the all -!! or nothing condens. -!! Modifications: Sept 15, 1995 (J.Cuxart and J. Stein) -!! Change the DP computation at the ground -!! Modifications: October 10, 1995 (J.Cuxart and J. Stein) -!! Psi for scal var and LES tools -!! Modifications: November 10, 1995 (J. Stein) -!! change the surface relations -!! Modifications: February 20, 1995 (J. Stein) optimization -!! Modifications: May 21, 1996 (J. Stein) -!! bug in the vertical flux of the V wind -!! component for explicit computation -!! Modifications: May 21, 1996 (N. wood) -!! modify the computation of the vertical -!! part or the surface tangential flux -!! Modifications: May 21, 1996 (P. Jabouille) -!! same modification in the Y direction -!! -!! Modifications: Sept 17, 1996 (J. Stein) change the moist case by using -!! Pi instead of Piref + use Atheta and Amoist -!! -!! Modifications: Nov 24, 1997 (V. Masson) removes the DO loops -!! Modifications: Mar 31, 1998 (V. Masson) splits the routine TURB_VER_THERMO_FLUX -!! Modifications: Oct 18, 2000 (V. Masson) LES computations -!! Modifications: Dec 01, 2000 (V. Masson) conservation of energy from -!! surface flux in 1DIM case -!! when slopes are present -!! Nov 06, 2002 (V. Masson) LES budgets -!! Feb 20, 2003 (JP Pinty) Add PFRAC_ICE -!! May 20, 2003 (JP Pinty) Correction of ETHETA -!! and EMOIST calls -!! July 2005 (S. Tomas, V. Masson) -!! Add 3rd order moments -!! and implicitation of PHI3 and PSI3 -!! October 2009 (G. Tanguy) add ILENCH=LEN(YCOMMENT) after -!! change of YCOMMENT -!! 2012-02 (Y. Seity) add possibility to run with reversed -!! vertical levels -!! Modifications July 2015 (Wim de Rooy) LHARAT switch -!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O -!! 2021 (D. Ricard) last version of HGRAD turbulence scheme -!! Leronard terms instead of Reynolds terms -!! applied to vertical fluxes of r_np and Thl -!! for implicit version of turbulence scheme -!! corrections and cleaning -!! June 2020 (B. Vie) Patch preventing negative rc and ri in 2.3 and 3.3 -!! JL Redelsperger : 03/2021: Ocean and Autocoupling O-A LES Cases -!! Sfc flux shape for LDEEPOC Case -!!-------------------------------------------------------------------------- -! -!* 0. DECLARATIONS -! ------------ -! -USE PARKIND1, ONLY : JPRB -USE YOMHOOK , ONLY : LHOOK, DR_HOOK -! -USE MODD_CST -USE MODD_CONF, ONLY: CPROGRAM -USE MODD_CTURB -USE MODD_FIELD, ONLY: TFIELDDATA, TYPEREAL -USE MODD_GRID_n, ONLY: XZS, XXHAT, XYHAT -USE MODD_IO, ONLY: TFILEDATA -USE MODD_METRICS_n, ONLY: XDXX, XDYY, XDZX, XDZY, XDZZ -USE MODD_PARAMETERS -USE MODD_TURB_n, ONLY: LHGRAD, XCOEFHGRADTHL, XCOEFHGRADRM, XALTHGRAD, XCLDTHOLD -USE MODD_CONF -USE MODD_LES -USE MODD_DIM_n -USE MODD_DYN_n, ONLY: LOCEAN -USE MODD_OCEANH -USE MODD_REF, ONLY: LCOUPLES -USE MODD_TURB_n -USE MODD_FRC -! -USE MODI_GRADIENT_U -USE MODI_GRADIENT_V -USE MODI_GRADIENT_W -USE MODI_GRADIENT_M -USE MODI_SHUMAN , ONLY : DZF, DZM, MZF, MZM, MYF, MXF -USE MODE_TRIDIAG, ONLY: TRIDIAG -USE MODI_LES_MEAN_SUBGRID -USE MODE_TRIDIAG_THERMO, ONLY: TRIDIAG_THERMO -USE MODE_TM06_H, ONLY: TM06_H -! -USE MODE_IO_FIELD_WRITE, ONLY: IO_FIELD_WRITE -USE MODE_PRANDTL -! -USE MODI_SECOND_MNH -USE MODE_ll -USE MODE_GATHER_ll -! -IMPLICIT NONE -! -!* 0.1 declarations of arguments -! -! -! -INTEGER, INTENT(IN) :: KKA !near ground array index -INTEGER, INTENT(IN) :: KKU !uppest atmosphere array index -INTEGER, INTENT(IN) :: KKL !vert. levels type 1=MNH -1=ARO -INTEGER, INTENT(IN) :: KRR ! number of moist var. -INTEGER, INTENT(IN) :: KRRL ! number of liquid water var. -INTEGER, INTENT(IN) :: KRRI ! number of ice water var. -LOGICAL, INTENT(IN) :: OTURB_FLX ! switch to write the - ! turbulent fluxes in the syncronous FM-file -CHARACTER(len=4), INTENT(IN) :: HTURBDIM ! dimensionality of the - ! turbulence scheme -CHARACTER(len=4), INTENT(IN) :: HTOM ! type of Third Order Moment -REAL, INTENT(IN) :: PIMPL, PEXPL ! Coef. for temporal disc. -REAL, INTENT(IN) :: PTSTEP ! Double Time Step -TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! Output file -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PDZZ, PDXX, PDYY, PDZX, PDZY - ! Metric coefficients -REAL, DIMENSION(:,:), INTENT(IN) :: PDIRCOSZW ! Director Cosinus of the - ! normal to the ground surface -REAL, DIMENSION(:,:,:), INTENT(IN) :: PZZ ! altitudes -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! dry density * grid volum -REAL, DIMENSION(:,:,:), INTENT(IN) :: MFMOIST ! moist mass flux dual scheme -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHVREF ! ref. state Virtual - ! Potential Temperature -! -REAL, DIMENSION(:,:), INTENT(IN) :: PSFTHM,PSFRM ! surface fluxes at time -! ! t - deltat -! -REAL, DIMENSION(:,:), INTENT(IN) :: PSFTHP,PSFRP ! surface fluxes at time -! ! t + deltat -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PWM -! Vertical wind -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHLM -! potential temperature at t-Delta t -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRM ! Mixing ratios - ! at t-Delta t -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PSVM ! Mixing ratios -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTKEM ! TKE at time t -! -! In case LHARAT=TRUE, PLM already includes all stability corrections -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLM ! Turb. mixing length -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLEPS ! dissipative length -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLOCPEXNM ! Lv(T)/Cp/Exnref at time t-1 -REAL, DIMENSION(:,:,:), INTENT(IN) :: PATHETA ! coefficients between -REAL, DIMENSION(:,:,:), INTENT(IN) :: PAMOIST ! s and Thetal and Rnp -REAL, DIMENSION(:,:,:), INTENT(IN) :: PSRCM ! normalized -! 2nd-order flux s'r'c/2Sigma_s2 at t-1 multiplied by Lambda_3 -REAL, DIMENSION(:,:,:), INTENT(IN) :: PFRAC_ICE ! ri fraction of rc+ri -REAL, DIMENSION(:,:,:), INTENT(IN) :: PBETA ! buoyancy coefficient -REAL, DIMENSION(:,:,:), INTENT(IN) :: PSQRT_TKE ! sqrt(e) -REAL, DIMENSION(:,:,:), INTENT(IN) :: PDTH_DZ ! d(th)/dz -REAL, DIMENSION(:,:,:), INTENT(IN) :: PDR_DZ ! d(rt)/dz -REAL, DIMENSION(:,:,:), INTENT(IN) :: PRED2TH3 ! 3D Redeslperger number R*2_th -REAL, DIMENSION(:,:,:), INTENT(IN) :: PRED2R3 ! 3D Redeslperger number R*2_r -REAL, DIMENSION(:,:,:), INTENT(IN) :: PRED2THR3 ! 3D Redeslperger number R*2_thr -REAL, DIMENSION(:,:,:), INTENT(IN) :: PBLL_O_E ! beta * Lk * Leps / tke -REAL, DIMENSION(:,:,:), INTENT(IN) :: PETHETA ! Coefficient for theta in theta_v computation -REAL, DIMENSION(:,:,:), INTENT(IN) :: PEMOIST ! Coefficient for r in theta_v computation -REAL, DIMENSION(:,:,:), INTENT(IN) :: PREDTH1 ! 1D Redelsperger number for Th -REAL, DIMENSION(:,:,:), INTENT(IN) :: PREDR1 ! 1D Redelsperger number for r -REAL, DIMENSION(:,:,:), INTENT(IN) :: PPHI3 ! Prandtl number for temperature -REAL, DIMENSION(:,:,:), INTENT(IN) :: PPSI3 ! Prandtl number for vapor -REAL, DIMENSION(:,:,:), INTENT(IN) :: PD ! Denominator in Prandtl numbers -REAL, DIMENSION(:,:,:), INTENT(IN) :: PFWTH ! d(w'2th' )/dz (at flux point) -REAL, DIMENSION(:,:,:), INTENT(IN) :: PFWR ! d(w'2r' )/dz (at flux point) -REAL, DIMENSION(:,:,:), INTENT(IN) :: PFTH2 ! d(w'th'2 )/dz (at mass point) -REAL, DIMENSION(:,:,:), INTENT(IN) :: PFR2 ! d(w'r'2 )/dz (at mass point) -REAL, DIMENSION(:,:,:), INTENT(IN) :: PFTHR ! d(w'th'r')/dz (at mass point) -REAL, DIMENSION(:,:), INTENT(INOUT):: PBL_DEPTH ! BL depth -REAL, DIMENSION(:,:,:), INTENT(OUT) :: PWTHV ! buoyancy flux -! -REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRTHLS ! cumulated source for theta -REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRRS ! cumulated source for rt -REAL, DIMENSION(:,:,:), INTENT(OUT) :: PTHLP ! guess of thl at t+ deltat -REAL, DIMENSION(:,:,:), INTENT(OUT) :: PRP ! guess of r at t+ deltat -! -REAL, DIMENSION(:,:,:), INTENT(OUT) :: PTP ! Dynamic and thermal - ! TKE production terms -! -REAL, DIMENSION(:,:,:), INTENT(OUT) :: PWTH ! heat flux -REAL, DIMENSION(:,:,:), INTENT(OUT) :: PWRC ! cloud water flux -! -! -!* 0.2 declaration of local variables -! -! -REAL, DIMENSION(SIZE(PTHLM,1),SIZE(PTHLM,2),SIZE(PTHLM,3)) :: & - ZA, & ! work variable for wrc or LES computation - ZFLXZ, & ! vertical flux of the treated variable - ZSOURCE, & ! source of evolution for the treated variable - ZKEFF, & ! effectif diffusion coeff = LT * SQRT( TKE ) - ZF, & ! Flux in dTh/dt =-dF/dz (evaluated at t-1)(or rt instead of Th) - ZDFDDTDZ, & ! dF/d(dTh/dz) - ZDFDDRDZ, & ! dF/d(dr/dz) - Z3RDMOMENT,& ! 3 order term in flux or variance equation - ZF_LEONARD,& ! Leonard terms - ZRWTHL, & - ZRWRNP, & - ZCLD_THOLD -! -REAL,DIMENSION(SIZE(XZS,1),SIZE(XZS,2),KKU) :: ZALT -! -INTEGER :: IKB,IKE ! I index values for the Beginning and End - ! mass points of the domain in the 3 direct. -INTEGER :: IKT ! array size in k direction -INTEGER :: IKTB,IKTE ! start, end of k loops in physical domain -INTEGER :: JI, JJ ! loop indexes -! -INTEGER :: IIB,IJB ! Lower bounds of the physical - ! sub-domain in x and y directions -INTEGER :: IIE,IJE ! Upper bounds of the physical - ! sub-domain in x and y directions -! -REAL, DIMENSION(:), ALLOCATABLE :: ZXHAT_ll ! Position x in the conformal - ! plane (array on the complete domain) -REAL, DIMENSION(:), ALLOCATABLE :: ZYHAT_ll ! Position y in the conformal - ! plane (array on the complete domain) -! -! -REAL :: ZTIME1, ZTIME2 -REAL :: ZDELTAX -REAL :: ZXBEG,ZXEND,ZYBEG,ZYEND ! Forcing size for ocean deep convection -REAL, DIMENSION(SIZE(XXHAT),SIZE(XYHAT)) :: ZDIST ! distance - ! from the center of the cooling -REAL :: ZFLPROV -INTEGER :: JKM ! vertical index loop -INTEGER :: JSW -REAL :: ZSWA ! index for time flux interpolation -! -INTEGER :: IIU, IJU -INTEGER :: IRESP -INTEGER :: JK -LOGICAL :: GUSERV ! flag to use water -LOGICAL :: GFTH2 ! flag to use w'th'2 -LOGICAL :: GFWTH ! flag to use w'2th' -LOGICAL :: GFR2 ! flag to use w'r'2 -LOGICAL :: GFWR ! flag to use w'2r' -LOGICAL :: GFTHR ! flag to use w'th'r' -TYPE(TFIELDDATA) :: TZFIELD -!---------------------------------------------------------------------------- -! -!* 1. PRELIMINARIES -! ------------- -! -REAL(KIND=JPRB) :: ZHOOK_HANDLE -IF (LHOOK) CALL DR_HOOK('TURB_VER_THERMO_FLUX',0,ZHOOK_HANDLE) -! -! Size for a given proc & a given model -IIU=SIZE(PTHLM,1) -IJU=SIZE(PTHLM,2) -! -!! Compute Shape of sfc flux for Oceanic Deep Conv Case -! -IF (LOCEAN .AND. LDEEPOC) THEN - !* COMPUTES THE PHYSICAL SUBDOMAIN BOUNDS - ALLOCATE(ZXHAT_ll(NIMAX_ll+2*JPHEXT),ZYHAT_ll(NJMAX_ll+2*JPHEXT)) - !compute ZXHAT_ll = position in the (0:Lx) domain 1 (Lx=Size of domain1 ) - !compute XXHAT_ll = position in the (L0_subproc,Lx_subproc) domain for the current subproc - ! L0_subproc as referenced in the full domain 1 - CALL GATHERALL_FIELD_ll('XX',XXHAT,ZXHAT_ll,IRESP) - CALL GATHERALL_FIELD_ll('YY',XYHAT,ZYHAT_ll,IRESP) - CALL GET_DIM_EXT_ll('B',IIU,IJU) - CALL GET_INDICE_ll(IIB,IJB,IIE,IJE,IIU,IJU) - DO JJ = IJB,IJE - DO JI = IIB,IIE - ZDIST(JI,JJ) = SQRT( & - (( (XXHAT(JI)+XXHAT(JI+1))*0.5 - XCENTX_OC ) / XRADX_OC)**2 + & - (( (XYHAT(JJ)+XYHAT(JJ+1))*0.5 - XCENTY_OC ) / XRADY_OC)**2 & - ) - END DO - END DO - DO JJ=IJB,IJE - DO JI=IIB,IIE - IF ( ZDIST(JI,JJ) > 1.) XSSTFL(JI,JJ)=0. - END DO - END DO -END IF !END DEEP OCEAN CONV CASE -! -IKT =SIZE(PTHLM,3) -IKTE =IKT-JPVEXT_TURB -IKTB =1+JPVEXT_TURB -IKB=KKA+JPVEXT_TURB*KKL -IKE=KKU-JPVEXT_TURB*KKL -! -GUSERV = (KRR/=0) -! -! compute the coefficients for the uncentred gradient computation near the -! ground -! -IF (LHARAT) THEN -! LHARAT so TKE and length scales at half levels! - ZKEFF(:,:,:) = PLM(:,:,:) * SQRT(PTKEM(:,:,:)) +50.*MFMOIST(:,:,:) -ELSE - ZKEFF(:,:,:) = MZM(PLM(:,:,:) * SQRT(PTKEM(:,:,:)), KKA, KKU, KKL) -ENDIF -! -! Define a cloud mask with ri and rc (used after with a threshold) for Leonard terms -! -IF(LHGRAD) THEN - IF ( KRRL >= 1 ) THEN - IF ( KRRI >= 1 ) THEN - ZCLD_THOLD(:,:,:) = PRM(:,:,:,2) + PRM(:,:,:,4) - ELSE - ZCLD_THOLD(:,:,:) = PRM(:,:,:,2) - END IF - END IF -END IF -! -! Flags for 3rd order quantities -! -GFTH2 = .FALSE. -GFR2 = .FALSE. -GFTHR = .FALSE. -GFWTH = .FALSE. -GFWR = .FALSE. -! -IF (HTOM/='NONE') THEN - GFTH2 = ANY(PFTH2/=0.) - GFR2 = ANY(PFR2 /=0.) .AND. GUSERV - GFTHR = ANY(PFTHR/=0.) .AND. GUSERV - GFWTH = ANY(PFWTH/=0.) - GFWR = ANY(PFWR /=0.) .AND. GUSERV -END IF -!---------------------------------------------------------------------------- -! -!* 2. SOURCES OF CONSERVATIVE POTENTIAL TEMPERATURE AND -! PARTIAL THERMAL PRODUCTION -! --------------------------------------------------------------- -! -!* 2.1 Splitted value for cons. potential temperature at t+deltat -! -! Compute the turbulent flux F and F' at time t-dt. -! -IF (LHARAT) THEN - ZF (:,:,:) = -ZKEFF*DZM(PTHLM, KKA, KKU, KKL)/PDZZ - ZDFDDTDZ(:,:,:) = -ZKEFF -ELSE - ZF (:,:,:) = -XCSHF*PPHI3*ZKEFF*DZM(PTHLM, KKA, KKU, KKL)/PDZZ - ZDFDDTDZ(:,:,:) = -XCSHF*ZKEFF*D_PHI3DTDZ_O_DDTDZ(PPHI3,PREDTH1,PREDR1,PRED2TH3,PRED2THR3,HTURBDIM,GUSERV) -END IF -! -IF (LHGRAD) THEN - ! Compute the Leonard terms for thl - ZDELTAX= XXHAT(3) - XXHAT(2) - ZF_LEONARD (:,:,:)= XCOEFHGRADTHL*ZDELTAX*ZDELTAX/12.0*( & - MXF(GX_W_UW(PWM(:,:,:), XDXX, XDZZ, XDZX))& - *MZM(GX_M_M(PTHLM(:,:,:),XDXX,XDZZ,XDZX)) & - + MYF(GY_W_VW(PWM(:,:,:), XDYY,XDZZ,XDZY)) & - *MZM(GY_M_M(PTHLM(:,:,:),XDYY,XDZZ,XDZY)) ) -END IF -! -! Effect of 3rd order terms in temperature flux (at flux point) -! -! d(w'2th')/dz -IF (GFWTH) THEN - Z3RDMOMENT= M3_WTH_W2TH(KKA,KKU,KKL,PREDTH1,PREDR1,PD,ZKEFF,PTKEM) -! - ZF = ZF + Z3RDMOMENT * PFWTH - ZDFDDTDZ = ZDFDDTDZ + D_M3_WTH_W2TH_O_DDTDZ(KKA,KKU,KKL,PREDTH1,PREDR1,& - & PD,PBLL_O_E,PETHETA,ZKEFF,PTKEM) * PFWTH -END IF -! -! d(w'th'2)/dz -IF (GFTH2) THEN - Z3RDMOMENT= M3_WTH_WTH2(PREDTH1,PREDR1,PD,PBLL_O_E,PETHETA) -! - ZF = ZF + Z3RDMOMENT * MZM(PFTH2, KKA, KKU, KKL) - ZDFDDTDZ = ZDFDDTDZ + D_M3_WTH_WTH2_O_DDTDZ(Z3RDMOMENT,PREDTH1,PREDR1,& - & PD,PBLL_O_E,PETHETA) * MZM(PFTH2, KKA, KKU, KKL) -END IF -! -! d(w'2r')/dz -IF (GFWR) THEN - ZF = ZF + M3_WTH_W2R(KKA,KKU,KKL,PD,ZKEFF,& - & PTKEM,PBLL_O_E,PEMOIST,PDTH_DZ) * PFWR - ZDFDDTDZ = ZDFDDTDZ + D_M3_WTH_W2R_O_DDTDZ(KKA,KKU,KKL,PREDTH1,PREDR1,& - & PD,ZKEFF,PTKEM,PBLL_O_E,PEMOIST) * PFWR -END IF -! -! d(w'r'2)/dz -IF (GFR2) THEN - ZF = ZF + M3_WTH_WR2(KKA,KKU,KKL,PD,ZKEFF,PTKEM,& - & PSQRT_TKE,PBLL_O_E,PBETA,PLEPS,PEMOIST,PDTH_DZ) * MZM(PFR2, KKA, KKU, KKL) - ZDFDDTDZ = ZDFDDTDZ + D_M3_WTH_WR2_O_DDTDZ(KKA,KKU,KKL,PREDTH1,PREDR1,PD,& - & ZKEFF,PTKEM,PSQRT_TKE,PBLL_O_E,PBETA,PLEPS,PEMOIST) * MZM(PFR2, KKA, KKU, KKL) -END IF -! -! d(w'th'r')/dz -IF (GFTHR) THEN - Z3RDMOMENT= M3_WTH_WTHR(KKA,KKU,KKL,PREDR1,PD,ZKEFF,PTKEM,PSQRT_TKE,PBETA,& - & PLEPS,PEMOIST) -! - ZF = ZF + Z3RDMOMENT * MZM(PFTHR, KKA, KKU, KKL) - ZDFDDTDZ = ZDFDDTDZ + D_M3_WTH_WTHR_O_DDTDZ(Z3RDMOMENT,PREDTH1,& - & PREDR1,PD,PBLL_O_E,PETHETA) * MZM(PFTHR, KKA, KKU, KKL) -END IF -! compute interface flux -IF (LCOUPLES) THEN ! Autocoupling O-A LES - IF (LOCEAN) THEN ! ocean model in coupled case - ZF(:,:,IKE) = (XSSTFL_C(:,:,1)+XSSRFL_C(:,:,1)) & - *0.5* ( 1. + PRHODJ(:,:,KKU)/PRHODJ(:,:,IKE) ) - ELSE ! atmosph model in coupled case - ZF(:,:,IKB) = XSSTFL_C(:,:,1) & - *0.5* ( 1. + PRHODJ(:,:,KKA)/PRHODJ(:,:,IKB) ) - ENDIF -! -ELSE ! No coupling O and A cases - ! atmosp bottom - !*In 3D, a part of the flux goes vertically, - ! and another goes horizontally (in presence of slopes) - !*In 1D, part of energy released in horizontal flux is taken into account in the vertical part - IF (HTURBDIM=='3DIM') THEN - ZF(:,:,IKB) = ( PIMPL*PSFTHP(:,:) + PEXPL*PSFTHM(:,:) ) & - * PDIRCOSZW(:,:) & - * 0.5 * (1. + PRHODJ(:,:,KKA) / PRHODJ(:,:,IKB)) - ELSE - ZF(:,:,IKB) = ( PIMPL*PSFTHP(:,:) + PEXPL*PSFTHM(:,:) ) & - / PDIRCOSZW(:,:) & - * 0.5 * (1. + PRHODJ(:,:,KKA) / PRHODJ(:,:,IKB)) - END IF -! - IF (LOCEAN) THEN - ZF(:,:,IKE) = XSSTFL(:,:) *0.5*(1. + PRHODJ(:,:,KKU) / PRHODJ(:,:,IKE)) - ELSE !end ocean case (in nocoupled case) - ! atmos top -#ifdef REPRO48 -#else - ZF(:,:,IKE)=0. -#endif - END IF -END IF !end no coupled cases -! -! Compute the split conservative potential temperature at t+deltat -CALL TRIDIAG_THERMO(KKA,KKU,KKL,PTHLM,ZF,ZDFDDTDZ,PTSTEP,PIMPL,PDZZ,& - PRHODJ,PTHLP) -! -! Compute the equivalent tendency for the conservative potential temperature -! -ZRWTHL(:,:,:)= PRHODJ(:,:,:)*(PTHLP(:,:,:)-PTHLM(:,:,:))/PTSTEP -! replace the flux by the Leonard terms above ZALT and ZCLD_THOLD -IF (LHGRAD) THEN - DO JK=1,KKU - ZALT(:,:,JK) = PZZ(:,:,JK)-XZS(:,:) - END DO - WHERE ( (ZCLD_THOLD(:,:,:) >= XCLDTHOLD) .AND. ( ZALT(:,:,:) >= XALTHGRAD) ) - ZRWTHL(:,:,:) = -GZ_W_M(MZM(PRHODJ(:,:,:))*ZF_LEONARD(:,:,:),XDZZ) - END WHERE -END IF -! -PRTHLS(:,:,:)= PRTHLS(:,:,:) + ZRWTHL(:,:,:) -! -!* 2.2 Partial Thermal Production -! -! Conservative potential temperature flux : -! -ZFLXZ(:,:,:) = ZF & - + PIMPL * ZDFDDTDZ * DZM(PTHLP - PTHLM) / PDZZ -! replace the flux by the Leonard terms -IF (LHGRAD) THEN - WHERE ( (ZCLD_THOLD(:,:,:) >= XCLDTHOLD) .AND. ( ZALT(:,:,:) >= XALTHGRAD) ) - ZFLXZ(:,:,:) = ZF_LEONARD(:,:,:) - END WHERE -END IF -! -ZFLXZ(:,:,KKA) = ZFLXZ(:,:,IKB) -IF (LOCEAN) THEN - ZFLXZ(:,:,KKU) = ZFLXZ(:,:,IKE) -END IF -! -DO JK=IKTB+1,IKTE-1 - PWTH(:,:,JK)=0.5*(ZFLXZ(:,:,JK)+ZFLXZ(:,:,JK+KKL)) -END DO -! -PWTH(:,:,IKB)=0.5*(ZFLXZ(:,:,IKB)+ZFLXZ(:,:,IKB+KKL)) -! -IF (LOCEAN) THEN - PWTH(:,:,IKE)=0.5*(ZFLXZ(:,:,IKE)+ZFLXZ(:,:,IKE+KKL)) - PWTH(:,:,KKA)=0. - PWTH(:,:,KKU)=ZFLXZ(:,:,KKU) -ELSE - PWTH(:,:,KKA)=0.5*(ZFLXZ(:,:,KKA)+ZFLXZ(:,:,KKA+KKL)) - PWTH(:,:,IKE)=PWTH(:,:,IKE-KKL) -END IF -! -IF ( OTURB_FLX .AND. TPFILE%LOPENED ) THEN - ! stores the conservative potential temperature vertical flux - TZFIELD%CMNHNAME = 'THW_FLX' - TZFIELD%CSTDNAME = '' - TZFIELD%CLONGNAME = 'THW_FLX' - TZFIELD%CUNITS = 'K m s-1' - TZFIELD%CDIR = 'XY' - TZFIELD%CCOMMENT = 'Conservative potential temperature vertical flux' - TZFIELD%NGRID = 4 - TZFIELD%NTYPE = TYPEREAL - TZFIELD%NDIMS = 3 - TZFIELD%LTIMEDEP = .TRUE. - CALL IO_Field_write(TPFILE,TZFIELD,ZFLXZ) -END IF -! -! Contribution of the conservative temperature flux to the buoyancy flux -IF (LOCEAN) THEN - PTP(:,:,:)= XG*XALPHAOC * MZF(ZFLXZ,KKA, KKU, KKL ) -ELSE - IF (KRR /= 0) THEN - PTP(:,:,:) = PBETA * MZF( MZM(PETHETA,KKA, KKU, KKL) * ZFLXZ,KKA, KKU, KKL ) - PTP(:,:,IKB)= PBETA(:,:,IKB) * PETHETA(:,:,IKB) * & - 0.5 * ( ZFLXZ (:,:,IKB) + ZFLXZ (:,:,IKB+KKL) ) - ELSE - PTP(:,:,:)= PBETA * MZF( ZFLXZ,KKA, KKU, KKL ) - END IF -END IF -! -! Buoyancy flux at flux points -! -PWTHV = MZM(PETHETA, KKA, KKU, KKL) * ZFLXZ -PWTHV(:,:,IKB) = PETHETA(:,:,IKB) * ZFLXZ(:,:,IKB) -! -IF (LOCEAN) THEN - ! temperature contribution to Buy flux - PWTHV(:,:,IKE) = PETHETA(:,:,IKE) * ZFLXZ(:,:,IKE) -END IF -!* 2.3 Partial vertical divergence of the < Rc w > flux -! Correction for qc and qi negative in AROME -IF(CPROGRAM/='AROME ') THEN - IF ( KRRL >= 1 ) THEN - IF ( KRRI >= 1 ) THEN - PRRS(:,:,:,2) = PRRS(:,:,:,2) - & - PRHODJ*PATHETA*2.*PSRCM*DZF(ZFLXZ/PDZZ, KKA, KKU, KKL) & - *(1.0-PFRAC_ICE(:,:,:)) - PRRS(:,:,:,4) = PRRS(:,:,:,4) - & - PRHODJ*PATHETA*2.*PSRCM*DZF(ZFLXZ/PDZZ, KKA, KKU, KKL) & - *PFRAC_ICE(:,:,:) - ELSE - PRRS(:,:,:,2) = PRRS(:,:,:,2) - & - PRHODJ*PATHETA*2.*PSRCM*DZF(ZFLXZ/PDZZ, KKA, KKU, KKL) - END IF - END IF -END IF -! -!* 2.4 Storage in LES configuration -! -IF (LLES_CALL) THEN - CALL SECOND_MNH(ZTIME1) - CALL LES_MEAN_SUBGRID(MZF(ZFLXZ, KKA, KKU, KKL), X_LES_SUBGRID_WThl ) - CALL LES_MEAN_SUBGRID(MZF(PWM*ZFLXZ, KKA, KKU, KKL), X_LES_RES_W_SBG_WThl ) - CALL LES_MEAN_SUBGRID(GZ_W_M(PWM,PDZZ, KKA, KKU, KKL)*MZF(ZFLXZ, KKA, KKU, KKL),& - & X_LES_RES_ddxa_W_SBG_UaThl ) - CALL LES_MEAN_SUBGRID(MZF(PDTH_DZ*ZFLXZ, KKA, KKU, KKL), X_LES_RES_ddxa_Thl_SBG_UaThl ) - CALL LES_MEAN_SUBGRID(-XCTP*PSQRT_TKE/PLM*MZF(ZFLXZ, KKA, KKU, KKL), X_LES_SUBGRID_ThlPz ) - CALL LES_MEAN_SUBGRID(MZF(MZM(PETHETA, KKA, KKU, KKL)*ZFLXZ, KKA, KKU, KKL), X_LES_SUBGRID_WThv ) - IF (KRR>=1) THEN - CALL LES_MEAN_SUBGRID(MZF(PDR_DZ*ZFLXZ, KKA, KKU, KKL), X_LES_RES_ddxa_Rt_SBG_UaThl ) - END IF - !* diagnostic of mixing coefficient for heat - ZA = DZM(PTHLP, KKA, KKU, KKL) - WHERE (ZA==0.) ZA=1.E-6 - ZA = - ZFLXZ / ZA * PDZZ - ZA(:,:,IKB) = XCSHF*PPHI3(:,:,IKB)*ZKEFF(:,:,IKB) - ZA = MZF(ZA, KKA, KKU, KKL) - ZA = MIN(MAX(ZA,-1000.),1000.) - CALL LES_MEAN_SUBGRID( ZA, X_LES_SUBGRID_Kh ) - ! - CALL SECOND_MNH(ZTIME2) - XTIME_LES = XTIME_LES + ZTIME2 - ZTIME1 -END IF -! -!* 2.5 New boundary layer depth for TOMs -! -IF (HTOM=='TM06') CALL TM06_H(IKB,IKTB,IKTE,PTSTEP,PZZ,ZFLXZ,PBL_DEPTH) -! -!---------------------------------------------------------------------------- -! -! -!* 3. SOURCES OF CONSERVATIVE AND CLOUD MIXING RATIO AND -! COMPLETE THERMAL PRODUCTION -! ------------------------------------------------------ -! -!* 3.1 Splitted value for cons. mixing ratio at t+deltat -! -! -IF (KRR /= 0) THEN - ! Compute the turbulent flux F and F' at time t-dt. - ! - IF (LHARAT) THEN - ZF (:,:,:) = -ZKEFF*DZM(PRM(:,:,:,1), KKA, KKU, KKL)/PDZZ - ZDFDDRDZ(:,:,:) = -ZKEFF - ELSE - ZF (:,:,:) = -XCSHF*PPSI3*ZKEFF*DZM(PRM(:,:,:,1), KKA, KKU, KKL)/PDZZ - ZDFDDRDZ(:,:,:) = -XCSHF*ZKEFF*D_PSI3DRDZ_O_DDRDZ(PPSI3,PREDR1,PREDTH1,PRED2R3,PRED2THR3,HTURBDIM,GUSERV) - ENDIF - ! - ! Compute Leonard Terms for Cloud mixing ratio - IF (LHGRAD) THEN - ZDELTAX= XXHAT(3) - XXHAT(2) - ZF_LEONARD (:,:,:)= XCOEFHGRADRM*ZDELTAX*ZDELTAX/12.0*( & - MXF(GX_W_UW(PWM(:,:,:), XDXX, XDZZ, XDZX)) & - *MZM(GX_M_M(PRM(:,:,:,1),XDXX,XDZZ,XDZX)) & - +MYF(GY_W_VW(PWM(:,:,:), XDYY,XDZZ,XDZY)) & - *MZM(GY_M_M(PRM(:,:,:,1),XDYY,XDZZ,XDZY)) ) - END IF - ! - ! Effect of 3rd order terms in temperature flux (at flux point) - ! - ! d(w'2r')/dz - IF (GFWR) THEN - Z3RDMOMENT= M3_WR_W2R(KKA,KKU,KKL,PREDR1,PREDTH1,PD,ZKEFF,PTKEM) - ! - ZF = ZF + Z3RDMOMENT * PFWR - ZDFDDRDZ = ZDFDDRDZ + D_M3_WR_W2R_O_DDRDZ(KKA,KKU,KKL,PREDR1,PREDTH1,PD,& - & PBLL_O_E,PEMOIST,ZKEFF,PTKEM) * PFWR - END IF - ! - ! d(w'r'2)/dz - IF (GFR2) THEN - Z3RDMOMENT= M3_WR_WR2(PREDR1,PREDTH1,PD,PBLL_O_E,PEMOIST) - ! - ZF = ZF + Z3RDMOMENT * MZM(PFR2, KKA, KKU, KKL) - ZDFDDRDZ = ZDFDDRDZ + D_M3_WR_WR2_O_DDRDZ(Z3RDMOMENT,PREDR1,& - & PREDTH1,PD,PBLL_O_E,PEMOIST) * MZM(PFR2, KKA, KKU, KKL) - END IF - ! - ! d(w'2th')/dz - IF (GFWTH) THEN - ZF = ZF + M3_WR_W2TH(KKA,KKU,KKL,PD,ZKEFF,& - & PTKEM,PBLL_O_E,PETHETA,PDR_DZ) * PFWTH - ZDFDDRDZ = ZDFDDRDZ + D_M3_WR_W2TH_O_DDRDZ(KKA,KKU,KKL,PREDR1,PREDTH1,& - & PD,ZKEFF,PTKEM,PBLL_O_E,PETHETA) * PFWTH - END IF - ! - ! d(w'th'2)/dz - IF (GFTH2) THEN - ZF = ZF + M3_WR_WTH2(KKA,KKU,KKL,PD,ZKEFF,PTKEM,& - & PSQRT_TKE,PBLL_O_E,PBETA,PLEPS,PETHETA,PDR_DZ) * MZM(PFTH2, KKA, KKU, KKL) - ZDFDDRDZ = ZDFDDRDZ + D_M3_WR_WTH2_O_DDRDZ(KKA,KKU,KKL,PREDR1,PREDTH1,PD,& - &ZKEFF,PTKEM,PSQRT_TKE,PBLL_O_E,PBETA,PLEPS,PETHETA) * MZM(PFTH2, KKA, KKU, KKL) - END IF - ! - ! d(w'th'r')/dz - IF (GFTHR) THEN - Z3RDMOMENT= M3_WR_WTHR(KKA,KKU,KKL,PREDTH1,PD,ZKEFF,PTKEM,PSQRT_TKE,PBETA,& - & PLEPS,PETHETA) - ! - ZF = ZF + Z3RDMOMENT * MZM(PFTHR, KKA, KKU, KKL) - ZDFDDRDZ = ZDFDDRDZ + D_M3_WR_WTHR_O_DDRDZ(KKA,KKU,KKL,Z3RDMOMENT,PREDR1, & - & PREDTH1,PD,PBLL_O_E,PEMOIST) * MZM(PFTHR, KKA, KKU, KKL) - END IF - ! - ! compute interface flux - IF (LCOUPLES) THEN ! coupling NH O-A - IF (LOCEAN) THEN ! ocean model in coupled case - ! evap effect on salinity to be added later !!! - ZF(:,:,IKE) = 0. - ELSE ! atmosph model in coupled case - ZF(:,:,IKB) = 0. - ! AJOUTER FLUX EVAP SUR MODELE ATMOS - ENDIF - ! - ELSE ! No coupling NH OA case - ! atmosp bottom - !* in 3DIM case, a part of the flux goes vertically, and another goes horizontally - ! (in presence of slopes) - !* in 1DIM case, the part of energy released in horizontal flux - ! is taken into account in the vertical part - ! - IF (HTURBDIM=='3DIM') THEN - ZF(:,:,IKB) = ( PIMPL*PSFRP(:,:) + PEXPL*PSFRM(:,:) ) & - * PDIRCOSZW(:,:) & - * 0.5 * (1. + PRHODJ(:,:,KKA) / PRHODJ(:,:,IKB)) - ELSE - ZF(:,:,IKB) = ( PIMPL*PSFRP(:,:) + PEXPL*PSFRM(:,:) ) & - / PDIRCOSZW(:,:) & - * 0.5 * (1. + PRHODJ(:,:,KKA) / PRHODJ(:,:,IKB)) - END IF - ! - IF (LOCEAN) THEN - ! General ocean case - ! salinity/evap effect to be added later !!!!! - ZF(:,:,IKE) = 0. - ELSE !end ocean case (in nocoupled case) - ! atmos top -#ifdef REPRO48 -#else - ZF(:,:,IKE)=0. -#endif - END IF - END IF!end no coupled cases - ! Compute the split conservative potential temperature at t+deltat - CALL TRIDIAG_THERMO(KKA,KKU,KKL,PRM(:,:,:,1),ZF,ZDFDDRDZ,PTSTEP,PIMPL,& - PDZZ,PRHODJ,PRP) - ! - ! Compute the equivalent tendency for the conservative mixing ratio - ! - ZRWRNP (:,:,:) = PRHODJ(:,:,:)*(PRP(:,:,:)-PRM(:,:,:,1))/PTSTEP - ! - ! replace the flux by the Leonard terms above ZALT and ZCLD_THOLD - IF (LHGRAD) THEN - DO JK=1,KKU - ZALT(:,:,JK) = PZZ(:,:,JK)-XZS(:,:) - END DO - WHERE ( (ZCLD_THOLD(:,:,:) >= XCLDTHOLD ) .AND. ( ZALT(:,:,:) >= XALTHGRAD ) ) - ZRWRNP (:,:,:) = -GZ_W_M(MZM(PRHODJ(:,:,:),KKA,KKU,KKL)*ZF_LEONARD(:,:,:),XDZZ,KKA,KKU,KKL) - END WHERE - END IF - ! - PRRS(:,:,:,1) = PRRS(:,:,:,1) + ZRWRNP (:,:,:) - ! - !* 3.2 Complete thermal production - ! - ! cons. mixing ratio flux : - ! - ZFLXZ(:,:,:) = ZF & - + PIMPL * ZDFDDRDZ * DZM(PRP - PRM(:,:,:,1), KKA, KKU, KKL) / PDZZ - ! - ! replace the flux by the Leonard terms above ZALT and ZCLD_THOLD - IF (LHGRAD) THEN - WHERE ( (ZCLD_THOLD(:,:,:) >= XCLDTHOLD ) .AND. ( ZALT(:,:,:) >= XALTHGRAD ) ) - ZFLXZ(:,:,:) = ZF_LEONARD(:,:,:) - END WHERE - END IF - ! - ZFLXZ(:,:,KKA) = ZFLXZ(:,:,IKB) - ! - DO JK=IKTB+1,IKTE-1 - PWRC(:,:,JK)=0.5*(ZFLXZ(:,:,JK)+ZFLXZ(:,:,JK+KKL)) - END DO - PWRC(:,:,IKB)=0.5*(ZFLXZ(:,:,IKB)+ZFLXZ(:,:,IKB+KKL)) - PWRC(:,:,KKA)=0.5*(ZFLXZ(:,:,KKA)+ZFLXZ(:,:,KKA+KKL)) - PWRC(:,:,IKE)=PWRC(:,:,IKE-KKL) - ! - ! - IF ( OTURB_FLX .AND. TPFILE%LOPENED ) THEN - ! stores the conservative mixing ratio vertical flux - TZFIELD%CMNHNAME = 'RCONSW_FLX' - TZFIELD%CSTDNAME = '' - TZFIELD%CLONGNAME = 'RCONSW_FLX' - TZFIELD%CUNITS = 'kg m s-1 kg-1' - TZFIELD%CDIR = 'XY' - TZFIELD%CCOMMENT = 'Conservative mixing ratio vertical flux' - TZFIELD%NGRID = 4 - TZFIELD%NTYPE = TYPEREAL - TZFIELD%NDIMS = 3 - TZFIELD%LTIMEDEP = .TRUE. - CALL IO_Field_write(TPFILE,TZFIELD,ZFLXZ) - END IF - ! - ! Contribution of the conservative water flux to the Buoyancy flux - IF (LOCEAN) THEN - ZA(:,:,:)= -XG*XBETAOC * MZF(ZFLXZ, KKA, KKU, KKL ) - ELSE - ZA(:,:,:) = PBETA * MZF( MZM(PEMOIST, KKA, KKU, KKL) * ZFLXZ,KKA,KKU,KKL ) - ZA(:,:,IKB) = PBETA(:,:,IKB) * PEMOIST(:,:,IKB) * & - 0.5 * ( ZFLXZ (:,:,IKB) + ZFLXZ (:,:,IKB+KKL) ) - PTP(:,:,:) = PTP(:,:,:) + ZA(:,:,:) - END IF - ! - ! Buoyancy flux at flux points - ! - PWTHV = PWTHV + MZM(PEMOIST, KKA, KKU, KKL) * ZFLXZ - PWTHV(:,:,IKB) = PWTHV(:,:,IKB) + PEMOIST(:,:,IKB) * ZFLXZ(:,:,IKB) - IF (LOCEAN) THEN - PWTHV(:,:,IKE) = PWTHV(:,:,IKE) + PEMOIST(:,:,IKE)* ZFLXZ(:,:,IKE) - END IF -! -!* 3.3 Complete vertical divergence of the < Rc w > flux -! Correction of qc and qi negative for AROME -IF(CPROGRAM/='AROME ') THEN - IF ( KRRL >= 1 ) THEN - IF ( KRRI >= 1 ) THEN - PRRS(:,:,:,2) = PRRS(:,:,:,2) - & - PRHODJ*PAMOIST*2.*PSRCM*DZF(ZFLXZ/PDZZ,KKA,KKU,KKL ) & - *(1.0-PFRAC_ICE(:,:,:)) - PRRS(:,:,:,4) = PRRS(:,:,:,4) - & - PRHODJ*PAMOIST*2.*PSRCM*DZF(ZFLXZ/PDZZ,KKA,KKU,KKL ) & - *PFRAC_ICE(:,:,:) - ELSE - PRRS(:,:,:,2) = PRRS(:,:,:,2) - & - PRHODJ*PAMOIST*2.*PSRCM*DZF(ZFLXZ/PDZZ,KKA,KKU,KKL ) - END IF - END IF -END IF -! -!* 3.4 Storage in LES configuration -! - IF (LLES_CALL) THEN - CALL SECOND_MNH(ZTIME1) - CALL LES_MEAN_SUBGRID(MZF(ZFLXZ, KKA, KKU, KKL), X_LES_SUBGRID_WRt ) - CALL LES_MEAN_SUBGRID(MZF(PWM*ZFLXZ, KKA, KKU, KKL), X_LES_RES_W_SBG_WRt ) - CALL LES_MEAN_SUBGRID(GZ_W_M(PWM,PDZZ, KKA, KKU, KKL)*MZF(ZFLXZ, KKA, KKU, KKL),& - & X_LES_RES_ddxa_W_SBG_UaRt ) - CALL LES_MEAN_SUBGRID(MZF(PDTH_DZ*ZFLXZ, KKA, KKU, KKL), X_LES_RES_ddxa_Thl_SBG_UaRt ) - CALL LES_MEAN_SUBGRID(MZF(PDR_DZ*ZFLXZ, KKA, KKU, KKL), X_LES_RES_ddxa_Rt_SBG_UaRt ) - CALL LES_MEAN_SUBGRID(MZF(MZM(PEMOIST, KKA, KKU, KKL)*ZFLXZ, KKA, KKU, KKL), X_LES_SUBGRID_WThv , .TRUE. ) - CALL LES_MEAN_SUBGRID(-XCTP*PSQRT_TKE/PLM*MZF(ZFLXZ, KKA, KKU, KKL), X_LES_SUBGRID_RtPz ) - CALL SECOND_MNH(ZTIME2) - XTIME_LES = XTIME_LES + ZTIME2 - ZTIME1 - END IF -! -END IF -! -!---------------------------------------------------------------------------- -! -! -!* 4. TURBULENT CORRELATIONS : <w Rc> -! ------------------------------- -! -! -!* 4.1 <w Rc> -! -IF ( ((OTURB_FLX .AND. TPFILE%LOPENED) .OR. LLES_CALL) .AND. (KRRL > 0) ) THEN -! -! recover the Conservative potential temperature flux : -! With LHARAT is true tke and length scales at half levels -! yet modify to use length scale and tke at half levels from vdfexcuhl - IF (LHARAT) THEN - ZA(:,:,:) = DZM(PIMPL * PTHLP + PEXPL * PTHLM, KKA, KKU, KKL) / PDZZ * & - (-PLM*PSQRT_TKE) - ELSE - ZA(:,:,:) = DZM(PIMPL * PTHLP + PEXPL * PTHLM, KKA, KKU, KKL) / PDZZ * & - (-PPHI3*MZM(PLM*PSQRT_TKE, KKA, KKU, KKL)) * XCSHF - ENDIF - ZA(:,:,IKB) = ( PIMPL*PSFTHP(:,:) + PEXPL*PSFTHM(:,:) ) & - * PDIRCOSZW(:,:) - ! - ! compute <w Rc> - ZFLXZ(:,:,:) = MZM(PAMOIST * 2.* PSRCM, KKA, KKU, KKL) * ZFLXZ(:,:,:) + & - MZM(PATHETA * 2.* PSRCM, KKA, KKU, KKL) * ZA(:,:,:) - ZFLXZ(:,:,KKA) = ZFLXZ(:,:,IKB) - ! - ! store the liquid water mixing ratio vertical flux - IF ( OTURB_FLX .AND. TPFILE%LOPENED ) THEN - TZFIELD%CMNHNAME = 'RCW_FLX' - TZFIELD%CSTDNAME = '' - TZFIELD%CLONGNAME = 'RCW_FLX' - TZFIELD%CUNITS = 'kg m s-1 kg-1' - TZFIELD%CDIR = 'XY' - TZFIELD%CCOMMENT = 'Liquid water mixing ratio vertical flux' - TZFIELD%NGRID = 4 - TZFIELD%NTYPE = TYPEREAL - TZFIELD%NDIMS = 3 - TZFIELD%LTIMEDEP = .TRUE. - CALL IO_Field_write(TPFILE,TZFIELD,ZFLXZ) - END IF - ! -! and we store in LES configuration this subgrid flux <w'rc'> -! - IF (LLES_CALL) THEN - CALL SECOND_MNH(ZTIME1) - CALL LES_MEAN_SUBGRID( MZF(ZFLXZ, KKA, KKU, KKL), X_LES_SUBGRID_WRc ) - CALL SECOND_MNH(ZTIME2) - XTIME_LES = XTIME_LES + ZTIME2 - ZTIME1 - END IF -! -END IF !end of <w Rc> -IF (LOCEAN .AND. LDEEPOC) THEN - DEALLOCATE(ZXHAT_ll,ZYHAT_ll) -END IF -! -!---------------------------------------------------------------------------- -IF (LHOOK) CALL DR_HOOK('TURB_VER_THERMO_FLUX',1,ZHOOK_HANDLE) -END SUBROUTINE TURB_VER_THERMO_FLUX -END MODULE MODE_TURB_VER_THERMO_FLUX diff --git a/src/mesonh/turb/modn_turb.f90 b/src/mesonh/turb/modn_turb.f90 deleted file mode 100644 index a7c794abd..000000000 --- a/src/mesonh/turb/modn_turb.f90 +++ /dev/null @@ -1,47 +0,0 @@ -!MNH_LIC Copyright 1994-2014 CNRS, Meteo-France and Universite Paul Sabatier -!MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence -!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt -!MNH_LIC for details. version 1. -!----------------------------------------------------------------- -!--------------- special set of characters for RCS information -!----------------------------------------------------------------- -! $Source$ $Revision$ -! MASDEV4_7 modn 2006/05/18 13:07:25 -!----------------------------------------------------------------- -! ################### - MODULE MODN_TURB -! ################### -! -!!**** *MODN_TURB* - declaration of namelist NAM_TURB -!! -!! PURPOSE -!! ------- -! The purpose of this module is to specify the namelist NAM_TURB -! which concern the parameters of the turbulence scheme for all models -! -!! -!!** IMPLICIT ARGUMENTS -!! ------------------ -!! -!! REFERENCE -!! --------- -!! -!! AUTHOR -!! ------ -!! V. Masson * Meteo-France * -!! -!! MODIFICATIONS -!! ------------- -!! Original November 2005 -!------------------------------------------------------------------------------- -! -!* 0. DECLARATIONS -! ------------ -! -USE MODD_CTURB -! -IMPLICIT NONE -! -NAMELIST/NAM_TURB/XPHI_LIM, XSBL_O_BL, XFTOP_O_FSURF -! -END MODULE MODN_TURB diff --git a/src/mesonh/turb/modn_turb_cloud.f90 b/src/mesonh/turb/modn_turb_cloud.f90 deleted file mode 100644 index f4929a58c..000000000 --- a/src/mesonh/turb/modn_turb_cloud.f90 +++ /dev/null @@ -1,49 +0,0 @@ -!MNH_LIC Copyright 1994-2014 CNRS, Meteo-France and Universite Paul Sabatier -!MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence -!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt -!MNH_LIC for details. version 1. -!----------------------------------------------------------------- -!--------------- special set of characters for RCS information -!----------------------------------------------------------------- -! $Source$ $Revision$ -! MASDEV4_7 modn 2006/05/18 13:07:25 -!----------------------------------------------------------------- -! ################## - MODULE MODN_TURB_CLOUD -! ################## -! -!!**** *MODN_TURB_CLOUD* - declaration of namelist NAM_TURB_CLOUD -!! -!! PURPOSE -!! ------- -! The purpose of this module is to specify the namelist NAM_TURB_CLOUD -! which concern the parameters of the cloud mixing length for a given model. -! -!! -!!** IMPLICIT ARGUMENTS -!! ------------------ -!! Module MODD_TURB_CLOUD -!! -!! REFERENCE -!! --------- -!! -!! AUTHOR -!! ------ -!! M. Tomasini *Meteo France* -!! -!! MODIFICATIONS -!! ------------- -!! Original September, 2004 -!------------------------------------------------------------------------------- -! -!* 0. DECLARATIONS -! ------------ -! -USE MODD_TURB_CLOUD -! -IMPLICIT NONE -! -NAMELIST/NAM_TURB_CLOUD/NMODEL_CLOUD, CTURBLEN_CLOUD, & - XCOEF_AMPL_SAT, XCEI_MIN, XCEI_MAX -! -END MODULE MODN_TURB_CLOUD diff --git a/src/mesonh/turb/modn_turbn.f90 b/src/mesonh/turb/modn_turbn.f90 deleted file mode 100644 index 3e777d2da..000000000 --- a/src/mesonh/turb/modn_turbn.f90 +++ /dev/null @@ -1,167 +0,0 @@ -!MNH_LIC Copyright 1995-2021 CNRS, Meteo-France and Universite Paul Sabatier -!MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence -!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt -!MNH_LIC for details. version 1. -!----------------------------------------------------------------- -! ################### - MODULE MODN_TURB_n -! ################### -! -!!**** *MODN_TURB$n* - declaration of namelist NAM_TURBn -!! -!! PURPOSE -!! ------- -! The purpose of this module is to specify the namelist NAM_TURBn -! which concern the parameters of the turbulence scheme for one nested -! model. -! -!! -!!** IMPLICIT ARGUMENTS -!! ------------------ -!! Module MODD_TURB$n : contains declaration of turbulence scheme -!! variables entering by a namelist -!! -!! XIMPL,CTURBLEN,CTURBDIM,LTURB_FLX -!! LTURB_DIAG,LSUBG_COND,LTGT_FLX -!! -!! REFERENCE -!! --------- -!! Book2 of documentation of Meso-NH (module MODD_TURBn) -!! -!! AUTHOR -!! ------ -!! J. Cuxart and J. Stein * I.N.M. and Meteo-France * -!! -!! MODIFICATIONS -!! ------------- -!! Original January 9, 1995 -!! J.Cuxart February 15, 1995 add the switches for diagnostic storages -!! J. Stein June 14, 1995 add the subgrid condensation switch -!! J. Stein October, 1999 add the tangential fluxes switch -!! M. Tomasini Jul 05, 2001 add the subgrid autoconversion -!! P. Bechtold Feb 11, 2002 add switch for Sigma_s computation -!! P. Jabouille Apr 4, 2002 add switch for Sigma_s convection -!! V. Masson Nov 13 2002 add switch for SBL lengths -!! D. Ricard May, 2021 add switch for Leonard Terms -!------------------------------------------------------------------------------- -! -!* 0. DECLARATIONS -! ------------ -! -USE MODD_TURB_n, ONLY: & - XIMPL_n => XIMPL, & - XKEMIN_n => XKEMIN, & - XCEDIS_n => XCEDIS, & - XCADAP_n => XCADAP, & - CTURBLEN_n => CTURBLEN, & - CTURBDIM_n => CTURBDIM, & - LTURB_FLX_n => LTURB_FLX, & - LTURB_DIAG_n => LTURB_DIAG, & - LSUBG_COND_n => LSUBG_COND, & - LSIGMAS_n => LSIGMAS, & - LSIG_CONV_n => LSIG_CONV, & - LRMC01_n => LRMC01, & - CTOM_n => CTOM, & - CSUBG_AUCV_n => CSUBG_AUCV, & - VSIGQSAT_n => VSIGQSAT, & - CSUBG_AUCV_RI_n => CSUBG_AUCV_RI, & - CCONDENS_n => CCONDENS, & - CLAMBDA3_n => CLAMBDA3, & - CSUBG_MF_PDF_n => CSUBG_MF_PDF, & - LHGRAD_n => LHGRAD, & - XCOEFHGRADTHL_n => XCOEFHGRADTHL, & - XCOEFHGRADRM_n => XCOEFHGRADRM, & - XALTHGRAD_n => XALTHGRAD, & - XCLDTHOLD_n => XCLDTHOLD -! -IMPLICIT NONE -! -REAL,SAVE :: XIMPL -REAL,SAVE :: XKEMIN -REAL,SAVE :: XCEDIS -REAL,SAVE :: XCADAP -CHARACTER (LEN=4),SAVE :: CTURBLEN -CHARACTER (LEN=4),SAVE :: CTURBDIM -LOGICAL,SAVE :: LTURB_FLX -LOGICAL,SAVE :: LTURB_DIAG -LOGICAL,SAVE :: LSUBG_COND -LOGICAL,SAVE :: LSIGMAS -LOGICAL,SAVE :: LSIG_CONV -LOGICAL,SAVE :: LRMC01 -CHARACTER (LEN=4),SAVE :: CTOM -CHARACTER (LEN=4),SAVE :: CSUBG_AUCV -CHARACTER (LEN=80),SAVE :: CSUBG_AUCV_RI -CHARACTER (LEN=80),SAVE :: CCONDENS -CHARACTER (LEN=4),SAVE :: CLAMBDA3 -CHARACTER (LEN=80),SAVE :: CSUBG_MF_PDF -REAL,SAVE :: VSIGQSAT -LOGICAL,SAVE :: LHGRAD -REAL,SAVE :: XCOEFHGRADTHL -REAL,SAVE :: XCOEFHGRADRM -REAL,SAVE :: XALTHGRAD -REAL,SAVE :: XCLDTHOLD -! -NAMELIST/NAM_TURBn/XIMPL,CTURBLEN,CTURBDIM,LTURB_FLX,LTURB_DIAG, & - LSUBG_COND,LSIGMAS,LSIG_CONV,LRMC01,CTOM,CSUBG_AUCV,& - XKEMIN,VSIGQSAT,XCEDIS,XCADAP,CSUBG_AUCV_RI,CCONDENS,& - CLAMBDA3,CSUBG_MF_PDF,LHGRAD,XCOEFHGRADTHL, XCOEFHGRADRM, & - XALTHGRAD, XCLDTHOLD - -! -CONTAINS -! -SUBROUTINE INIT_NAM_TURBn - XIMPL = XIMPL_n - XKEMIN = XKEMIN_n - XCEDIS = XCEDIS_n - XCADAP = XCADAP_n - CTURBLEN = CTURBLEN_n - CTURBDIM = CTURBDIM_n - LTURB_FLX = LTURB_FLX_n - LTURB_DIAG = LTURB_DIAG_n - LSUBG_COND = LSUBG_COND_n - LSIGMAS = LSIGMAS_n - LSIG_CONV = LSIG_CONV_n - LRMC01 = LRMC01_n - CTOM = CTOM_n - CSUBG_AUCV = CSUBG_AUCV_n - VSIGQSAT = VSIGQSAT_n - CSUBG_AUCV_RI = CSUBG_AUCV_RI_n - CCONDENS = CCONDENS_n - CLAMBDA3 = CLAMBDA3_n - CSUBG_MF_PDF = CSUBG_MF_PDF_n - LHGRAD = LHGRAD_n - XCOEFHGRADTHL = XCOEFHGRADTHL_n - XCOEFHGRADRM = XCOEFHGRADRM_n - XALTHGRAD = XALTHGRAD_n - XCLDTHOLD = XCLDTHOLD_n -END SUBROUTINE INIT_NAM_TURBn - -SUBROUTINE UPDATE_NAM_TURBn - XIMPL_n = XIMPL - XKEMIN_n = XKEMIN - XCEDIS_n = XCEDIS - XCADAP_n = XCADAP - CTURBLEN_n = CTURBLEN - CTURBDIM_n = CTURBDIM - LTURB_FLX_n = LTURB_FLX - LTURB_DIAG_n = LTURB_DIAG - LSUBG_COND_n = LSUBG_COND - LSIGMAS_n = LSIGMAS - LSIG_CONV_n = LSIG_CONV - LRMC01_n = LRMC01 - CTOM_n = CTOM - CSUBG_AUCV_n = CSUBG_AUCV - VSIGQSAT_n = VSIGQSAT - CSUBG_AUCV_RI_n = CSUBG_AUCV_RI - CCONDENS_n = CCONDENS - CLAMBDA3_n = CLAMBDA3 - CSUBG_MF_PDF_n = CSUBG_MF_PDF - LHGRAD_n = LHGRAD - XCOEFHGRADTHL_n = XCOEFHGRADTHL - XCOEFHGRADRM_n = XCOEFHGRADRM - XALTHGRAD_n = XALTHGRAD - XCLDTHOLD_n = XCLDTHOLD -END SUBROUTINE UPDATE_NAM_TURBn - -END MODULE MODN_TURB_n diff --git a/src/mesonh/turb/turb_cloud_index.f90 b/src/mesonh/turb/turb_cloud_index.f90 deleted file mode 100644 index c194db611..000000000 --- a/src/mesonh/turb/turb_cloud_index.f90 +++ /dev/null @@ -1,344 +0,0 @@ -!MNH_LIC Copyright 1994-2021 CNRS, Meteo-France and Universite Paul Sabatier -!MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence -!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt -!MNH_LIC for details. version 1. -!----------------------------------------------------------------- -! ################ - MODULE MODI_TURB_CLOUD_INDEX -! ################ -! -INTERFACE -! - SUBROUTINE TURB_CLOUD_INDEX(PTSTEP,TPFILE, & - OTURB_DIAG,KRRI, & - PRRS,PRM,PRHODJ,PDXX,PDYY,PDZZ,PDZX,PDZY, & - PCEI ) -! -USE MODD_IO, ONLY: TFILEDATA -! -REAL, INTENT(IN) :: PTSTEP ! Double Time step -TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! Output file -LOGICAL, INTENT(IN) :: OTURB_DIAG ! switch to write some - ! diagnostic fields in the syncronous FM-file -INTEGER, INTENT(IN) :: KRRI ! number of ice water var. -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRRS ! Sources term of RR -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRM ! Variable at t-dt -REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! Jacobian * dry density of - ! the reference state -REAL, DIMENSION(:,:,:), INTENT(IN) :: PDXX,PDYY,PDZZ,PDZX,PDZY - ! metric coefficients -REAL, DIMENSION(:,:,:), INTENT(OUT):: PCEI ! Cloud Entrainment instability - ! index to emphasize locally - ! turbulent fluxes -! -END SUBROUTINE TURB_CLOUD_INDEX -! -END INTERFACE -! -END MODULE MODI_TURB_CLOUD_INDEX -! -! ####################### - SUBROUTINE TURB_CLOUD_INDEX(PTSTEP,TPFILE, & - OTURB_DIAG,KRRI, & - PRRS,PRM,PRHODJ,PDXX,PDYY,PDZZ,PDZX,PDZY, & - PCEI ) -! ####################### - ! -!! PURPOSE -!! ------- -!! CEI (cloud Entrainment Instability) index calculation -!! It permits to localize cloudy points where a different mixing length -!! from the one in clear sky can be applicated -!! It permits to quantify also, at those cloudy points, an instability -!! that can emphasize sub-grid turbulence. -!! If such an instability exists, mixing length is increased proportionnaly -!! to that CEI criterium -!! -!!** METHOD -!! ------ -!! -!! Criteria: For a cloudy point or a point adjacent to a cloudy point, -!! G = NORM( dVAR/dx_j ) > threshold -!! Q_j = DG_j/Dt of the same sign as G_j -!! where VAR=rv+rc+ri and j=x or y -!! then CEI= NORM(Q) -!! -!! EXTERNAL -!! -------- -!! GX_M_M, GY_M_M : Cartesian gradient operators -!! FMWRIT : FM-routine to write a record -!! -!! IMPLICIT ARGUMENTS -!! ------------------ -!! Module MODI_GRADIENT_M : GX_M_M, GY_M_M -!! -!! AUTHOR -!! ------ -!! M. Tomasini * Meteo-France * -!! -!! MODIFICATIONS -!! ------------- -!! Original 15/09/94 -!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O -! -!------------------------------------------------------------------------------- -! -use modd_field, only: tfielddata, TYPEREAL -USE MODD_IO, ONLY: TFILEDATA -USE MODD_PARAMETERS, ONLY: JPVEXT -! -USE MODE_IO_FIELD_WRITE, only: IO_Field_write -use mode_tools_ll, only: GET_INDICE_ll -! -USE MODI_GRADIENT_M -! -IMPLICIT NONE -! -!* 0. DECLARATIONS -! ------------ -! -!* 0.1 declarations of arguments -! -REAL, INTENT(IN) :: PTSTEP ! Double Time step -TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! Output file -LOGICAL, INTENT(IN) :: OTURB_DIAG ! switch to write some - ! diagnostic fields in the syncronous FM-file -INTEGER, INTENT(IN) :: KRRI ! number of ice water var. -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRRS ! Sources term of RR -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRM ! Variable at t-dt -REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! Jacobian * dry density of - ! the reference state -REAL, DIMENSION(:,:,:), INTENT(IN) :: PDXX,PDYY,PDZZ,PDZX,PDZY - ! metric coefficients -REAL, DIMENSION(:,:,:), INTENT(OUT):: PCEI ! Cloud Entrainment instability - ! index to emphasize locally - ! turbulent fluxes -! -!* 0.2 declarations of local variables -! -REAL, DIMENSION(SIZE(PRM,1),SIZE(PRM,2),SIZE(PRM,3)) :: ZWORK,ZRVCI0 ! Work arrays -REAL, DIMENSION(SIZE(PRM,1),SIZE(PRM,2),SIZE(PRM,3)) :: ZCLOUD - ! rc+ri at time after ADVECTION routine - ! for the CEI criterium -REAL, DIMENSION(SIZE(PRM,1),SIZE(PRM,2),SIZE(PRM,3)) :: ZRVCI,ZGNORM_RVCI,ZQNORM_RVCI - ! rv+rc+ri at time after ADVECTION routine - ! horizontal norm of the vector PG_RVCI - ! horizontal norm of the vector PQ_RVCI -REAL, DIMENSION(SIZE(PRM,1),SIZE(PRM,2),SIZE(PRM,3),2) :: ZG_RVCI,ZQ_RVCI - ! x and y gradient of rv+rc+ri - ! x and y gradient of the advection of rv+rc+ri -! -INTEGER :: JI,JJ,JK ! loop counters -INTEGER :: IIB,IJB,IKB ! Begin of physical dimensions -INTEGER :: IIE,IJE,IKE ! End of physical dimensions -INTEGER, DIMENSION(SIZE(PRM,1),SIZE(PRM,2),SIZE(PRM,3)) :: IMASK_CLOUD - ! 0 except cloudy points or adjacent points (1) -TYPE(TFIELDDATA) :: TZFIELD -! -!------------------------------------------------------------------------------- -! -!* 1. INITIALISATION -! -------------- -! -CALL GET_INDICE_ll (IIB,IJB,IIE,IJE) -IKB = 1 + JPVEXT -IKE = SIZE(PRM,3) - JPVEXT -! -IMASK_CLOUD(:,:,:) = 0 -PCEI(:,:,:) = 0. -! -!------------------------------------------------------------------------------- -! -!* 2. CALCULATION -! ----------- -!* 2.1 Gradients calculation of the variable : -! VAR at time (t+1)=VAR at time (t-1) + 2*dt*ADV at time t -! VAR is a source term (i.e. x by RHODJ) -! -! To avoid negative mixing ratios at external points -! but also in the physical domain ! -ZRVCI0(:,:,:) = MAX ( PRRS(:,:,:,1) , 0. ) + MAX ( PRRS(:,:,:,2) , 0. ) -IF (KRRI>=1) ZRVCI0(:,:,:) = ZRVCI0(:,:,:) + MAX ( PRRS(:,:,:,4) , 0. ) -! -ZRVCI(:,:,:)= PTSTEP *ZRVCI0(:,:,:) /PRHODJ(:,:,:) -ZG_RVCI(:,:,:,1) = GX_M_M(ZRVCI,PDXX,PDZZ,PDZX) -ZG_RVCI(:,:,:,2) = GY_M_M(ZRVCI,PDYY,PDZZ,PDZY) -! -ZGNORM_RVCI(:,:,:) = SQRT( ZG_RVCI(:,:,:,1)*ZG_RVCI(:,:,:,1) + & - ZG_RVCI(:,:,:,2)*ZG_RVCI(:,:,:,2) ) -! -! -!* 2.2 Frontogenetic terms calculation -! (gradient of the advection) -! Q_j=DG_j/Dt=d(DVAR/Dt)dx_j - d(u_k*dVAR/dx_k)/dx_j -! As DVAR/Dt=0 if the VAR is conserved during the movement, -! Q_j = dADV/dx_j -! VAR=rv+rc+ri -! -ZWORK(:,:,:) = ZRVCI0 / PRHODJ(:,:,:) - & - ( PRM(:,:,:,1)+ PRM(:,:,:,2) ) / PTSTEP -IF (KRRI>=1) ZWORK(:,:,:) = ZWORK(:,:,:) - PRM(:,:,:,4) / PTSTEP -! -ZQ_RVCI(:,:,:,1) = GX_M_M(ZWORK,PDXX,PDZZ,PDZX) -ZQ_RVCI(:,:,:,2) = GY_M_M(ZWORK,PDYY,PDZZ,PDZY) -! -ZQNORM_RVCI(:,:,:) = SQRT( ZQ_RVCI(:,:,:,1)*ZQ_RVCI(:,:,:,1) + & - ZQ_RVCI(:,:,:,2)*ZQ_RVCI(:,:,:,2) ) -! -! -!* 2.3 Cloud mask -! -ZCLOUD(:,:,:)= MAX ( PRRS(:,:,:,2) , 0. ) -IF (KRRI>=1) ZCLOUD(:,:,:) = ZCLOUD(:,:,:) + MAX ( PRRS(:,:,:,4) , 0. ) -ZCLOUD(:,:,:) = PTSTEP * ZCLOUD / PRHODJ(:,:,:) -! -DO JK=IKB,IKE -DO JJ=IJB,IJE -DO JI=IIB,IIE - ! rc+ri threshold to avoid white noise and calculations - IF ( ZCLOUD(JI,JJ,JK) > 1.E-6 ) THEN - IMASK_CLOUD(JI-1,JJ ,JK ) = 1 - IMASK_CLOUD(JI ,JJ ,JK ) = 1 - IMASK_CLOUD(JI+1,JJ ,JK ) = 1 - IMASK_CLOUD(JI ,JJ-1,JK ) = 1 - IMASK_CLOUD(JI ,JJ+1,JK ) = 1 - IMASK_CLOUD(JI ,JJ ,JK-1) = 1 - IMASK_CLOUD(JI ,JJ ,JK+1) = 1 - ! The cloudy points where the criteria will not be satisfied - ! will have the cloudy mixing length not amplified - ! We put in the CEI index a negative number to mark those points - ! in turb.f90 - PCEI(JI,JJ,JK) = -1. - ENDIF -ENDDO -ENDDO -ENDDO -! -!* 2.4 Cloud Entrainment Instability index -! -! CEI(:,:,:)=NORM_Q -! -! if the considered point is cloudy or surrounded by at least one cloudy point -! -! and if the characteristic time >0 in at least one direction that is to say -! |grad(rv+rc+ri)| increasing with time that is to say -! grad(rv+rc+ri) has the same sign as Q_RVCI -! -! and if NORM_G_RVCI >= 0.1 g/kg/km -! -DO JK=IKB,IKE -DO JJ=IJB,IJE -DO JI=IIB,IIE - IF ( IMASK_CLOUD(JI,JJ,JK) == 1 ) THEN - IF ( ZGNORM_RVCI(JI,JJ,JK) >= 1.E-07 ) THEN - IF ( SIGN(1.0,ZG_RVCI(JI,JJ,JK,1))==SIGN(1.0,ZQ_RVCI(JI,JJ,JK,1)) .OR. & - SIGN(1.0,ZG_RVCI(JI,JJ,JK,2))==SIGN(1.0,ZQ_RVCI(JI,JJ,JK,2)) ) THEN - PCEI(JI,JJ,JK) = ZQNORM_RVCI(JI,JJ,JK) - ENDIF - ENDIF - ENDIF -ENDDO -ENDDO -ENDDO -! -!* 2.5 Writing -! -IF ( OTURB_DIAG .AND. tpfile%lopened ) THEN - TZFIELD%CMNHNAME = 'RVCI' - TZFIELD%CSTDNAME = '' - TZFIELD%CLONGNAME = 'RVCI' - TZFIELD%CUNITS = 'kg kg-1' - TZFIELD%CDIR = 'XY' - TZFIELD%CCOMMENT = 'X_Y_Z_RVCI' - TZFIELD%NGRID = 1 - TZFIELD%NTYPE = TYPEREAL - TZFIELD%NDIMS = 3 - TZFIELD%LTIMEDEP = .TRUE. - CALL IO_Field_write(TPFILE,TZFIELD,ZRVCI) - ! - TZFIELD%CMNHNAME = 'GX_RVCI' - TZFIELD%CSTDNAME = '' - TZFIELD%CLONGNAME = 'GX_RVCI' - TZFIELD%CUNITS = 'kg kg-1 m-1' - TZFIELD%CDIR = 'XY' - TZFIELD%CCOMMENT = 'X_Y_Z_GX_RVCI' - TZFIELD%NGRID = 1 - TZFIELD%NTYPE = TYPEREAL - TZFIELD%NDIMS = 3 - TZFIELD%LTIMEDEP = .TRUE. - CALL IO_Field_write(TPFILE,TZFIELD,ZG_RVCI(:,:,:,1)) - ! - TZFIELD%CMNHNAME = 'GY_RVCI' - TZFIELD%CSTDNAME = '' - TZFIELD%CLONGNAME = 'GY_RVCI' - TZFIELD%CUNITS = 'kg kg-1 m-1' - TZFIELD%CDIR = 'XY' - TZFIELD%CCOMMENT = 'X_Y_Z_GY_RVCI' - TZFIELD%NGRID = 1 - TZFIELD%NTYPE = TYPEREAL - TZFIELD%NDIMS = 3 - TZFIELD%LTIMEDEP = .TRUE. - CALL IO_Field_write(TPFILE,TZFIELD,ZG_RVCI(:,:,:,2)) - ! - TZFIELD%CMNHNAME = 'GNORM_RVCI' - TZFIELD%CSTDNAME = '' - TZFIELD%CLONGNAME = 'GNORM_RVCI' - TZFIELD%CUNITS = 'kg kg-1 m-1' - TZFIELD%CDIR = 'XY' - TZFIELD%CCOMMENT = 'X_Y_Z_NORM G' - TZFIELD%NGRID = 1 - TZFIELD%NTYPE = TYPEREAL - TZFIELD%NDIMS = 3 - TZFIELD%LTIMEDEP = .TRUE. - CALL IO_Field_write(TPFILE,TZFIELD,ZGNORM_RVCI) - ! - TZFIELD%CMNHNAME = 'QX_RVCI' - TZFIELD%CSTDNAME = '' - TZFIELD%CLONGNAME = 'QX_RVCI' - TZFIELD%CUNITS = 'kg kg-1 m-1' - TZFIELD%CDIR = 'XY' - TZFIELD%CCOMMENT = 'X_Y_Z_QX_RVCI' - TZFIELD%NGRID = 1 - TZFIELD%NTYPE = TYPEREAL - TZFIELD%NDIMS = 3 - TZFIELD%LTIMEDEP = .TRUE. - CALL IO_Field_write(TPFILE,TZFIELD,ZQ_RVCI(:,:,:,1)) - ! - TZFIELD%CMNHNAME = 'QY_RVCI' - TZFIELD%CSTDNAME = '' - TZFIELD%CLONGNAME = 'QY_RVCI' - TZFIELD%CUNITS = 'kg kg-1 m-1' - TZFIELD%CDIR = 'XY' - TZFIELD%CCOMMENT = 'X_Y_Z_QY_RVCI' - TZFIELD%NGRID = 1 - TZFIELD%NTYPE = TYPEREAL - TZFIELD%NDIMS = 3 - TZFIELD%LTIMEDEP = .TRUE. - CALL IO_Field_write(TPFILE,TZFIELD,ZQ_RVCI(:,:,:,2)) - ! - TZFIELD%CMNHNAME = 'QNORM_RVCI' - TZFIELD%CSTDNAME = '' - TZFIELD%CLONGNAME = 'QNORM_RVCI' - TZFIELD%CUNITS = 'kg kg-1 m-1' - TZFIELD%CDIR = 'XY' - TZFIELD%CCOMMENT = 'X_Y_Z_QNORM_RVCI' - TZFIELD%NGRID = 1 - TZFIELD%NTYPE = TYPEREAL - TZFIELD%NDIMS = 3 - TZFIELD%LTIMEDEP = .TRUE. - CALL IO_Field_write(TPFILE,TZFIELD,ZQNORM_RVCI) - ! - TZFIELD%CMNHNAME = 'CEI' - TZFIELD%CSTDNAME = '' - TZFIELD%CLONGNAME = 'CEI' - TZFIELD%CUNITS = 'kg kg-1 m-1 s-1' - TZFIELD%CDIR = 'XY' - TZFIELD%CCOMMENT = 'X_Y_Z_CEI' - TZFIELD%NGRID = 1 - TZFIELD%NTYPE = TYPEREAL - TZFIELD%NDIMS = 3 - TZFIELD%LTIMEDEP = .TRUE. - CALL IO_Field_write(TPFILE,TZFIELD,PCEI) -END IF -! -END SUBROUTINE TURB_CLOUD_INDEX diff --git a/src/mesonh/turb/turb_hor.f90 b/src/mesonh/turb/turb_hor.f90 deleted file mode 100644 index 8c872dcee..000000000 --- a/src/mesonh/turb/turb_hor.f90 +++ /dev/null @@ -1,469 +0,0 @@ -!MNH_LIC Copyright 1994-2021 CNRS, Meteo-France and Universite Paul Sabatier -!MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence -!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt -!MNH_LIC for details. version 1. -!----------------------------------------------------------------- -! #################### - MODULE MODI_TURB_HOR -! #################### -! -INTERFACE -! - SUBROUTINE TURB_HOR(KSPLT, KRR, KRRL, KRRI, PTSTEP, & - OTURB_FLX,OSUBG_COND, & - TPFILE, & - PDXX,PDYY,PDZZ,PDZX,PDZY,PZZ, & - PDIRCOSXW,PDIRCOSYW,PDIRCOSZW, & - PCOSSLOPE,PSINSLOPE, & - PINV_PDXX, PINV_PDYY, PINV_PDZZ, PMZM_PRHODJ, & - PK, & - PRHODJ,PTHVREF, & - PSFTHM,PSFRM,PSFSVM, & - PCDUEFF,PTAU11M,PTAU12M,PTAU22M,PTAU33M, & - PUM,PVM,PWM,PUSLOPEM,PVSLOPEM,PTHLM,PRM,PSVM, & - PTKEM,PLM,PLEPS, & - PLOCPEXNM,PATHETA,PAMOIST,PSRCM,PFRAC_ICE, & - PDP,PTP,PSIGS, & - PRUS,PRVS,PRWS,PRTHLS,PRRS,PRSVS ) - -! -USE MODD_IO, ONLY: TFILEDATA -! -INTEGER, INTENT(IN) :: KSPLT ! current split index -INTEGER, INTENT(IN) :: KRR ! number of moist var. -INTEGER, INTENT(IN) :: KRRL ! number of liquid water var. -INTEGER, INTENT(IN) :: KRRI ! number of ice water var. -REAL, INTENT(IN) :: PTSTEP ! -LOGICAL, INTENT(IN) :: OTURB_FLX ! switch to write the - ! turbulent fluxes in the syncronous FM-file -LOGICAL, INTENT(IN) :: OSUBG_COND ! Switch for sub-grid -! condensation -TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! Output file -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PDXX, PDYY, PDZZ, PDZX, PDZY - ! Metric coefficients -REAL, DIMENSION(:,:,:), INTENT(IN) :: PZZ ! vertical grid -REAL, DIMENSION(:,:), INTENT(IN) :: PDIRCOSXW, PDIRCOSYW, PDIRCOSZW -! Director Cosinus along x, y and z directions at surface w-point -REAL, DIMENSION(:,:), INTENT(IN) :: PCOSSLOPE ! cosinus of the angle - ! between i and the slope vector -REAL, DIMENSION(:,:), INTENT(IN) :: PSINSLOPE ! sinus of the angle - ! between i and the slope vector -REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! density * grid volume -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHVREF ! ref. state VPT -! -REAL, DIMENSION(:,:), INTENT(IN) :: PSFTHM,PSFRM -REAL, DIMENSION(:,:,:), INTENT(IN) :: PSFSVM ! surface fluxes -! -REAL, DIMENSION(:,:), INTENT(IN) :: PCDUEFF ! Cd * || u || at time t -REAL, DIMENSION(:,:), INTENT(IN) :: PTAU11M ! <uu> in the axes linked - ! to the maximum slope direction and the surface normal and the binormal - ! at time t - dt -REAL, DIMENSION(:,:), INTENT(IN) :: PTAU12M ! <uv> in the same axes -REAL, DIMENSION(:,:), INTENT(IN) :: PTAU22M ! <vv> in the same axes -REAL, DIMENSION(:,:), INTENT(IN) :: PTAU33M ! <ww> in the same axes -! -! Variables at t-1 -REAL, DIMENSION(:,:,:), INTENT(IN) :: PUM,PVM,PWM,PTHLM -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRM ! mixing ratios at t-1, - ! where PRM(:,:,:,1) = conservative mixing ratio -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PSVM ! scalar var. at t-1 -REAL, DIMENSION(:,:), INTENT(IN) :: PUSLOPEM ! wind component along the - ! maximum slope direction -REAL, DIMENSION(:,:), INTENT(IN) :: PVSLOPEM ! wind component along the - ! direction normal to the maximum slope one - -REAL, DIMENSION(:,:,:), INTENT(IN) :: PK ! Turbulent diffusion doef. - ! PK = PLM * SQRT(PTKEM) -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDXX ! 1./PDXX -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDYY ! 1./PDYY -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDZZ ! 1./PDZZ -REAL, DIMENSION(:,:,:), INTENT(IN) :: PMZM_PRHODJ ! MZM(PRHODJ) -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTKEM ! TKE at time t- dt -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLM ! Turb. mixing length -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLEPS ! dissipative length -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLOCPEXNM ! Lv(T)/Cp/Exner at time t-1 -REAL, DIMENSION(:,:,:), INTENT(IN) :: PATHETA ! coefficients between -REAL, DIMENSION(:,:,:), INTENT(IN) :: PAMOIST ! s and Thetal and Rnp - -REAL, DIMENSION(:,:,:), INTENT(IN) :: PSRCM - ! normalized 2nd-order flux - ! s'r'c/2Sigma_s2 at t-1 multiplied by Lambda_3 -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PFRAC_ICE ! ri fraction of rc+ri -! -REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRUS, PRVS, PRWS, PRTHLS -REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRSVS,PRRS ! var. at t+1 -split- -REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PDP,PTP ! TKE production terms -REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PSIGS - ! IN: Vertical part of Sigma_s at t - ! OUT: Total Sigma_s at t -! -! -! -END SUBROUTINE TURB_HOR -! -END INTERFACE -! -END MODULE MODI_TURB_HOR -! ################################################################ - SUBROUTINE TURB_HOR(KSPLT, KRR, KRRL, KRRI, PTSTEP, & - OTURB_FLX,OSUBG_COND, & - TPFILE, & - PDXX,PDYY,PDZZ,PDZX,PDZY,PZZ, & - PDIRCOSXW,PDIRCOSYW,PDIRCOSZW, & - PCOSSLOPE,PSINSLOPE, & - PINV_PDXX, PINV_PDYY, PINV_PDZZ, PMZM_PRHODJ, & - PK, & - PRHODJ,PTHVREF, & - PSFTHM,PSFRM,PSFSVM, & - PCDUEFF,PTAU11M,PTAU12M,PTAU22M,PTAU33M, & - PUM,PVM,PWM,PUSLOPEM,PVSLOPEM,PTHLM,PRM,PSVM, & - PTKEM,PLM,PLEPS, & - PLOCPEXNM,PATHETA,PAMOIST,PSRCM,PFRAC_ICE, & - PDP,PTP,PSIGS, & - PRUS,PRVS,PRWS,PRTHLS,PRRS,PRSVS ) -! ################################################################ -! -! -!!**** *TURB_HOR* -routine to compute the source terms in the meso-NH -!! model equations due to the non-vertical turbulent fluxes. -!! -!! PURPOSE -!! ------- -! The purpose of this routine is to compute the non-vertical -! turbulent fluxes of the evolutive variables and give back the -! source terms to the main program. -! -!!** METHOD -!! ------ -!! Complementary 3D calculations when running at high resolution; -!! The non-vertical turbulent fluxes are computed explicitly. The -!! contributions are cumulated in PRvarS and in DP and TP of TKE -! -! d(rho*T) = -d(rho*u'T'/dxx) -d(-rho*u'T'*dzx/dxx/dzz) -! / dt / dx /dz -!! -!! -!! Near the bottom of the model, uncentred evaluation of vertical -!! gradients are required because no field values are available under -!! the level where the gradient must be evaluated. In this case, the -!! gradient is computed with a second order accurate uncentred scheme -!! according to: -!! -!! D FF dzz3 (dzz3+dzz4) -!! ---- = - ----------------- FF(4) + ----------------- FF(3) -!! D z (dzz3+dzz4) dzz4 dzz3 dzz4 -!! -!! dzz4 + 2 dzz3 -!! - ----------------- FF(2) -!! (dzz3+dzz4) dzz3 -!! -!! where the values are taken from: -!! -!! ----- FF(5) -!! | -!! | dzz5 -!! | -!! ----- FF(4) -!! | -!! | dzz4 -!! | -!! ----- FF(3) -!! | -!! | dzz3 -!! | -!! ----- FF(2) , (D FF / DZ) -!! | dzz2 * 0.5 -!! ----- ground -!! -!! -!! -!! EXTERNAL -!! -------- -!! -!! -!! IMPLICIT ARGUMENTS -!! ------------------ -!! Module MODD_CST : contains physical constants -!! -!! XG : gravity constant -!! -!! Module MODD_CTURB: contains the set of constants for -!! the turbulence scheme -!! -!! XCMFS,XCMFB : cts for the momentum flux -!! XCSHF : ct for the sensible heat flux -!! XCHF : ct for the moisture flux -!! XCTV,XCHV : cts for the T and moisture variances -!! -!! Module MODD_PARAMETERS -!! -!! JPVEXT : number of vertical external points -!! -!! -!! -!! -!! REFERENCE -!! --------- -!! Book 2 of documentation (routine TURB_HOR) -!! Book 1 of documentation (Chapter: Turbulence) -!! -!! AUTHOR -!! ------ -!! Joan Cuxart * INM and Meteo-France * -!! -!! MODIFICATIONS -!! ------------- -!! Original Aug 29, 1994 -!! Modifications: Feb 14, 1995 (J.Cuxart and J.Stein) -!! Doctorization and Optimization -!! March 21, 1995 (J.M. Carriere) -!! Introduction of cloud water -!! June 14, 1995 (J. Stein) -!! rm the ZVTPV computation + bug in the all -!! or nothing condens. case -!! June 28, 1995 (J.Cuxart) Add the LES tools -!! Sept 19, 1995 (J. Stein) change the surface flux -!! computations -!! Nov 13, 1995 (J. Stein) include the tangential fluxes -!! bug in <u'w'> at the surface -!! Nov 27, 1997 (V. Saravane) spliting of the routine -!! Nov 27, 1997 (V. Masson) clearing of the routine -!! Nov 06, 2002 (V. Masson) LES budgets -!! Feb 20, 2003 (JP Pinty) Add PFRAC_ICE -!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O -!! -------------------------------------------------------------------------- -! -!* 0. DECLARATIONS -! ------------ -! -USE MODD_CST -USE MODD_CTURB -USE MODD_IO, ONLY: TFILEDATA -USE MODD_PARAMETERS -USE MODD_LES -! -USE MODI_TURB_HOR_THERMO_FLUX -USE MODI_TURB_HOR_THERMO_CORR -USE MODI_TURB_HOR_DYN_CORR -USE MODI_TURB_HOR_UV -USE MODI_TURB_HOR_UW -USE MODI_TURB_HOR_VW -USE MODI_TURB_HOR_SV_FLUX -USE MODI_TURB_HOR_SV_CORR -! -IMPLICIT NONE -! -! -!* 0.1 declaration of arguments -! -! -INTEGER, INTENT(IN) :: KSPLT ! current split index -INTEGER, INTENT(IN) :: KRR ! number of moist var. -INTEGER, INTENT(IN) :: KRRL ! number of liquid water var. -INTEGER, INTENT(IN) :: KRRI ! number of ice water var. -REAL, INTENT(IN) :: PTSTEP ! -LOGICAL, INTENT(IN) :: OTURB_FLX ! switch to write the - ! turbulent fluxes in the syncronous FM-file -LOGICAL, INTENT(IN) :: OSUBG_COND ! Switch for sub-grid -! condensation -TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! Output file -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PDXX, PDYY, PDZZ, PDZX, PDZY - ! Metric coefficients -REAL, DIMENSION(:,:,:), INTENT(IN) :: PZZ ! vertical grid -REAL, DIMENSION(:,:), INTENT(IN) :: PDIRCOSXW, PDIRCOSYW, PDIRCOSZW -! Director Cosinus along x, y and z directions at surface w-point -REAL, DIMENSION(:,:), INTENT(IN) :: PCOSSLOPE ! cosinus of the angle - ! between i and the slope vector -REAL, DIMENSION(:,:), INTENT(IN) :: PSINSLOPE ! sinus of the angle - ! between i and the slope vector - -REAL, DIMENSION(:,:,:), INTENT(IN) :: PK ! Turbulent diffusion doef. - ! PK = PLM * SQRT(PTKEM) -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDXX ! 1./PDXX -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDYY ! 1./PDYY -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDZZ ! 1./PDZZ -REAL, DIMENSION(:,:,:), INTENT(IN) :: PMZM_PRHODJ ! MZM(PRHODJ) - -REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! density * grid volume -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHVREF ! ref. state VPT -! -REAL, DIMENSION(:,:), INTENT(IN) :: PSFTHM,PSFRM -REAL, DIMENSION(:,:,:), INTENT(IN) :: PSFSVM ! surface fluxes -! -REAL, DIMENSION(:,:), INTENT(IN) :: PCDUEFF ! Cd * || u || at time t -REAL, DIMENSION(:,:), INTENT(IN) :: PTAU11M ! <uu> in the axes linked - ! to the maximum slope direction and the surface normal and the binormal - ! at time t - dt -REAL, DIMENSION(:,:), INTENT(IN) :: PTAU12M ! <uv> in the same axes -REAL, DIMENSION(:,:), INTENT(IN) :: PTAU22M ! <vv> in the same axes -REAL, DIMENSION(:,:), INTENT(IN) :: PTAU33M ! <ww> in the same axes -! -! Variables at t-1 -REAL, DIMENSION(:,:,:), INTENT(IN) :: PUM,PVM,PWM,PTHLM -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRM ! mixing ratios at t-1, - ! where PRM(:,:,:,1) = conservative mixing ratio -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PSVM ! scalar var. at t-1 -REAL, DIMENSION(:,:), INTENT(IN) :: PUSLOPEM ! wind component along the - ! maximum slope direction -REAL, DIMENSION(:,:), INTENT(IN) :: PVSLOPEM ! wind component along the - ! direction normal to the maximum slope one -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTKEM ! TKE at time t- dt -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLM ! Turb. mixing length -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLEPS ! dissipative length -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLOCPEXNM ! Lv(T)/Cp/Exner at time t-1 -REAL, DIMENSION(:,:,:), INTENT(IN) :: PATHETA ! coefficients between -REAL, DIMENSION(:,:,:), INTENT(IN) :: PAMOIST ! s and Thetal and Rnp - -REAL, DIMENSION(:,:,:), INTENT(IN) :: PSRCM - ! normalized 2nd-order flux - ! s'r'c/2Sigma_s2 at t-1 multiplied by Lambda_3 -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PFRAC_ICE ! ri fraction of rc+ri -! -REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRUS, PRVS, PRWS, PRTHLS -REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRSVS,PRRS ! var. at t+1 -split- -REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PDP,PTP ! TKE production terms -REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PSIGS - ! IN: Vertical part of Sigma_s at t - ! OUT: Total Sigma_s at t -! -! -! -!* 0.2 declaration of local variables -! -! --------------------------------------------------------------------------- -! -!* 1. PRELIMINARY COMPUTATIONS -! ------------------------ -! -!* Exchange coefficient is limited in order to insure numerical stability -! -!! -!* 2. < U' THETA'l > -!* 3. < U' R'np > -!* 4. < U' TPV' > -!* 5. < V' THETA'l > -!* 6. < V' R'np > -!* 7. < V' TPV' > -! - CALL TURB_HOR_THERMO_FLUX(KSPLT, KRR, KRRL, KRRI, & - OTURB_FLX,OSUBG_COND, & - TPFILE, & - PK,PINV_PDXX,PINV_PDYY,PINV_PDZZ,PMZM_PRHODJ, & - PDXX,PDYY,PDZZ,PDZX,PDZY, & - PDIRCOSXW,PDIRCOSYW, & - PRHODJ, & - PSFTHM,PSFRM, & - PWM,PTHLM,PRM, & - PATHETA,PAMOIST,PSRCM,PFRAC_ICE, & - PRTHLS,PRRS ) -! -! -!* 8. TURBULENT CORRELATIONS : <THl THl>, <THl Rnp>, <Rnp Rnp>, Sigma_s -! - IF (KSPLT==1) & - CALL TURB_HOR_THERMO_CORR(KRR, KRRL, KRRI, & - OTURB_FLX,OSUBG_COND, & - TPFILE, & - PINV_PDXX,PINV_PDYY, & - PDXX,PDYY,PDZZ,PDZX,PDZY, & - PTHVREF, & - PWM,PTHLM,PRM, & - PTKEM,PLM,PLEPS, & - PLOCPEXNM,PATHETA,PAMOIST,PSRCM, & - PSIGS ) -! -! -!* 9. < U'U'> -!* 10. < V'V'> -!* 11. < W'W'> -! - CALL TURB_HOR_DYN_CORR(KSPLT, PTSTEP, & - OTURB_FLX,KRR, & - TPFILE, & - PK,PINV_PDZZ, & - PDXX,PDYY,PDZZ,PDZX,PDZY,PZZ, & - PDIRCOSZW, & - PCOSSLOPE,PSINSLOPE, & - PRHODJ, & - PCDUEFF,PTAU11M,PTAU12M,PTAU22M,PTAU33M, & - PUM,PVM,PWM, PUSLOPEM,PVSLOPEM, & - PTHLM,PRM,PSVM, & - PTKEM,PLM, & - PDP,PTP, & - PRUS,PRVS,PRWS ) -! -! -!* 12. < U'V'> -! - CALL TURB_HOR_UV(KSPLT, & - OTURB_FLX, & - TPFILE, & - PK,PINV_PDXX,PINV_PDYY,PINV_PDZZ,PMZM_PRHODJ, & - PDXX,PDYY,PDZZ,PDZX,PDZY, & - PDIRCOSZW, & - PCOSSLOPE,PSINSLOPE, & - PRHODJ, & - PCDUEFF,PTAU11M,PTAU12M,PTAU22M,PTAU33M, & - PUM,PVM,PUSLOPEM,PVSLOPEM, & - PDP, & - PRUS,PRVS ) -! -! -!* 13. < U'W'> -! - CALL TURB_HOR_UW(KSPLT, & - OTURB_FLX,KRR, & - TPFILE, & - PK,PINV_PDXX,PINV_PDZZ,PMZM_PRHODJ, & - PDXX,PDZZ,PDZX, & - PRHODJ,PTHVREF, & - PUM,PWM,PTHLM,PRM,PSVM, & - PTKEM,PLM, & - PDP, & - PRUS,PRWS ) -! -! -!* 14. < V'W'> -! - CALL TURB_HOR_VW(KSPLT, & - OTURB_FLX,KRR, & - TPFILE, & - PK,PINV_PDYY,PINV_PDZZ,PMZM_PRHODJ, & - PDYY,PDZZ,PDZY, & - PRHODJ,PTHVREF, & - PVM,PWM,PTHLM,PRM,PSVM, & - PTKEM,PLM, & - PDP, & - PRVS,PRWS ) - -! -! -!* 15. HORIZONTAL FLUXES OF PASSIVE SCALARS -! - CALL TURB_HOR_SV_FLUX(KSPLT, & - OTURB_FLX, & - TPFILE, & - PK,PINV_PDXX,PINV_PDYY,PINV_PDZZ,PMZM_PRHODJ, & - PDXX,PDYY,PDZZ,PDZX,PDZY, & - PDIRCOSXW,PDIRCOSYW, & - PRHODJ,PWM, & - PSFSVM, & - PSVM, & - PRSVS ) -! - IF (KSPLT==1 .AND. LLES_CALL) & - CALL TURB_HOR_SV_CORR(KRR,KRRL,KRRI, & - PDXX,PDYY,PDZZ,PDZX,PDZY, & - PLM,PLEPS,PTKEM,PTHVREF, & - PTHLM,PRM, & - PLOCPEXNM,PATHETA,PAMOIST,PSRCM, & - PWM,PSVM ) -! -! -END SUBROUTINE TURB_HOR diff --git a/src/mesonh/turb/turb_hor_dyn_corr.f90 b/src/mesonh/turb/turb_hor_dyn_corr.f90 deleted file mode 100644 index 2a4a3e98d..000000000 --- a/src/mesonh/turb/turb_hor_dyn_corr.f90 +++ /dev/null @@ -1,625 +0,0 @@ -!MNH_LIC Copyright 1994-2021 CNRS, Meteo-France and Universite Paul Sabatier -!MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence -!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt -!MNH_LIC for details. version 1. -!----------------------------------------------------------------- -MODULE MODI_TURB_HOR_DYN_CORR -! -INTERFACE -! - SUBROUTINE TURB_HOR_DYN_CORR(KSPLT, PTSTEP, & - OTURB_FLX,KRR, & - TPFILE, & - PK,PINV_PDZZ, & - PDXX,PDYY,PDZZ,PDZX,PDZY,PZZ, & - PDIRCOSZW, & - PCOSSLOPE,PSINSLOPE, & - PRHODJ, & - PCDUEFF,PTAU11M,PTAU12M,PTAU22M,PTAU33M, & - PUM,PVM,PWM,PUSLOPEM,PVSLOPEM, & - PTHLM,PRM,PSVM, & - PTKEM,PLM, & - PDP,PTP, & - PRUS,PRVS,PRWS ) -! -USE MODD_IO, ONLY: TFILEDATA -! -INTEGER, INTENT(IN) :: KSPLT ! split process index -REAL, INTENT(IN) :: PTSTEP ! timestep -LOGICAL, INTENT(IN) :: OTURB_FLX ! switch to write the - ! turbulent fluxes in the syncronous FM-file -INTEGER, INTENT(IN) :: KRR ! number of moist var. -TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! Output file -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PK ! Turbulent diffusion doef. - ! PK = PLM * SQRT(PTKEM) -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDZZ ! 1./PDZZ -REAL, DIMENSION(:,:,:), INTENT(IN) :: PDXX, PDYY, PDZZ, PDZX, PDZY - ! Metric coefficients -REAL, DIMENSION(:,:,:), INTENT(IN) :: PZZ ! vertical grid -REAL, DIMENSION(:,:), INTENT(IN) :: PDIRCOSZW -! Director Cosinus along z directions at surface w-point -REAL, DIMENSION(:,:), INTENT(IN) :: PCOSSLOPE ! cosinus of the angle - ! between i and the slope vector -REAL, DIMENSION(:,:), INTENT(IN) :: PSINSLOPE ! sinus of the angle - ! between i and the slope vector -REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! density * grid volume -! -REAL, DIMENSION(:,:), INTENT(IN) :: PCDUEFF ! Cd * || u || at time t -REAL, DIMENSION(:,:), INTENT(IN) :: PTAU11M ! <uu> in the axes linked - ! to the maximum slope direction and the surface normal and the binormal - ! at time t - dt -REAL, DIMENSION(:,:), INTENT(IN) :: PTAU12M ! <uv> in the same axes -REAL, DIMENSION(:,:), INTENT(IN) :: PTAU22M ! <vv> in the same axes -REAL, DIMENSION(:,:), INTENT(IN) :: PTAU33M ! <ww> in the same axes -! -! Variables at t-1 -REAL, DIMENSION(:,:,:), INTENT(IN) :: PUM,PVM,PWM,PTHLM -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRM -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PSVM -REAL, DIMENSION(:,:), INTENT(IN) :: PUSLOPEM ! wind component along the - ! maximum slope direction -REAL, DIMENSION(:,:), INTENT(IN) :: PVSLOPEM ! wind component along the - ! direction normal to the maximum slope one -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTKEM ! TKE at time t- dt -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLM ! Turb. mixing length -! -REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRUS, PRVS, PRWS -REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PDP,PTP ! TKE production terms -! -! -! -END SUBROUTINE TURB_HOR_DYN_CORR -! -END INTERFACE -! -END MODULE MODI_TURB_HOR_DYN_CORR -! ################################################################ - SUBROUTINE TURB_HOR_DYN_CORR(KSPLT, PTSTEP, & - OTURB_FLX,KRR, & - TPFILE, & - PK,PINV_PDZZ, & - PDXX,PDYY,PDZZ,PDZX,PDZY,PZZ, & - PDIRCOSZW, & - PCOSSLOPE,PSINSLOPE, & - PRHODJ, & - PCDUEFF,PTAU11M,PTAU12M,PTAU22M,PTAU33M, & - PUM,PVM,PWM,PUSLOPEM,PVSLOPEM, & - PTHLM,PRM,PSVM, & - PTKEM,PLM, & - PDP,PTP, & - PRUS,PRVS,PRWS ) -! ################################################################ -! -!!**** *TURB_HOR* -routine to compute the source terms in the meso-NH -!! model equations due to the non-vertical turbulent fluxes. -!! -!! PURPOSE -!! ------- -!! -!! see TURB_HOR -!! -!!** METHOD -!! ------ -!! -!! EXTERNAL -!! -------- -!! -!! IMPLICIT ARGUMENTS -!! ------------------ -!! -!! REFERENCE -!! --------- -!! -!! AUTHOR -!! ------ -!! -!! Joan Cuxart * INM and Meteo-France * -!! -!! MODIFICATIONS -!! ------------- -!! Aug , 1997 (V. Saravane) spliting of TURB_HOR -!! Nov 27, 1997 (V. Masson) clearing of the routine -!! Oct 18, 2000 (V. Masson) LES computations + LFLAT switch -!! Feb 15, 2001 (J. Stein) remove the use of w=0 at the -!! ground -!! Mar 12, 2001 (V. Masson and J. Stein) major bugs -!! + change of discretization at the surface -!! Nov 06, 2002 (V. Masson) LES budgets -!! October 2009 (G. Tanguy) add ILENCH=LEN(YCOMMENT) after -!! change of YCOMMENT -!! July 2012 (V.Masson) Implicitness of W -!! March 2014 (V.Masson) tridiag_w : bug between -!! mass and flux position -!! J.Escobar : 15/09/2015 : WENO5 & JPHEXT <> 1 -!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O -! P. Wautelet 20/05/2019: add name argument to ADDnFIELD_ll + new ADD4DFIELD_ll subroutine -!! -------------------------------------------------------------------------- -! -!* 0. DECLARATIONS -! ------------ -! -USE MODD_ARGSLIST_ll, ONLY: LIST_ll -USE MODD_CST -USE MODD_CONF -USE MODD_CTURB -use modd_field, only: tfielddata, TYPEREAL -USE MODD_IO, ONLY: TFILEDATA -USE MODD_PARAMETERS -USE MODD_LES -USE MODD_NSV -! -USE MODE_ll -USE MODE_IO_FIELD_WRITE, only: IO_Field_write -! -USE MODI_GRADIENT_M -USE MODI_GRADIENT_U -USE MODI_GRADIENT_V -USE MODI_GRADIENT_W -USE MODI_SHUMAN -USE MODI_COEFJ -USE MODI_LES_MEAN_SUBGRID -USE MODI_TRIDIAG_W -! -USE MODI_SECOND_MNH -USE MODE_MPPDB -! -IMPLICIT NONE -! -! -!* 0.1 declaration of arguments -! -! -! -INTEGER, INTENT(IN) :: KSPLT ! split process index -REAL, INTENT(IN) :: PTSTEP ! timestep -LOGICAL, INTENT(IN) :: OTURB_FLX ! switch to write the - ! turbulent fluxes in the syncronous FM-file -INTEGER, INTENT(IN) :: KRR ! number of moist var. -TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! Output file -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PK ! Turbulent diffusion doef. - ! PK = PLM * SQRT(PTKEM) -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDZZ ! 1./PDZZ -REAL, DIMENSION(:,:,:), INTENT(IN) :: PDXX, PDYY, PDZZ, PDZX, PDZY - ! Metric coefficients -REAL, DIMENSION(:,:,:), INTENT(IN) :: PZZ ! vertical grid -REAL, DIMENSION(:,:), INTENT(IN) :: PDIRCOSZW -! Director Cosinus along z directions at surface w-point -REAL, DIMENSION(:,:), INTENT(IN) :: PCOSSLOPE ! cosinus of the angle - ! between i and the slope vector -REAL, DIMENSION(:,:), INTENT(IN) :: PSINSLOPE ! sinus of the angle - ! between i and the slope vector -REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! density * grid volume -! -REAL, DIMENSION(:,:), INTENT(IN) :: PCDUEFF ! Cd * || u || at time t -REAL, DIMENSION(:,:), INTENT(IN) :: PTAU11M ! <uu> in the axes linked - ! to the maximum slope direction and the surface normal and the binormal - ! at time t - dt -REAL, DIMENSION(:,:), INTENT(IN) :: PTAU12M ! <uv> in the same axes -REAL, DIMENSION(:,:), INTENT(IN) :: PTAU22M ! <vv> in the same axes -REAL, DIMENSION(:,:), INTENT(IN) :: PTAU33M ! <ww> in the same axes -! -! Variables at t-1 -REAL, DIMENSION(:,:,:), INTENT(IN) :: PUM,PVM,PWM,PTHLM -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRM -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PSVM -REAL, DIMENSION(:,:), INTENT(IN) :: PUSLOPEM ! wind component along the - ! maximum slope direction -REAL, DIMENSION(:,:), INTENT(IN) :: PVSLOPEM ! wind component along the - ! direction normal to the maximum slope one -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTKEM ! TKE at time t- dt -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLM ! Turb. mixing length -! -REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRUS, PRVS, PRWS -REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PDP,PTP ! TKE production terms -! -! -! -!* 0.2 declaration of local variables -! -REAL, DIMENSION(SIZE(PUM,1),SIZE(PUM,2),SIZE(PUM,3)) & - :: ZFLX,ZWORK - ! work arrays, PK is the turb. mixing coef. -! -REAL, DIMENSION(SIZE(PUM,1),SIZE(PUM,2)) ::ZDIRSINZW - ! sinus of the angle between the vertical and the normal to the orography -INTEGER :: IKB,IKE - ! Index values for the Beginning and End - ! mass points of the domain -INTEGER :: IKU -INTEGER :: JSV ! scalar loop counter -! -REAL, DIMENSION(SIZE(PUM,1),SIZE(PUM,2),SIZE(PUM,3)) :: GX_U_M_PUM -REAL, DIMENSION(SIZE(PVM,1),SIZE(PVM,2),SIZE(PVM,3)) :: GY_V_M_PVM -REAL, DIMENSION(SIZE(PWM,1),SIZE(PWM,2),SIZE(PWM,3)) :: GZ_W_M_PWM -REAL, DIMENSION(SIZE(PWM,1),SIZE(PWM,2),SIZE(PWM,3)) :: GZ_W_M_ZWP -REAL, DIMENSION(SIZE(PWM,1),SIZE(PWM,2),SIZE(PWM,3)) :: ZMZF_DZZ ! MZF(PDZZ) -REAL, DIMENSION(SIZE(PWM,1),SIZE(PWM,2),SIZE(PWM,3)) :: ZDFDDWDZ ! formal derivative of the -! ! flux (variable: dW/dz) -REAL, DIMENSION(SIZE(PWM,1),SIZE(PWM,2),SIZE(PWM,3)) :: ZWP ! W at future time-step -! -REAL, DIMENSION(SIZE(PWM,1),SIZE(PWM,2),1) :: ZDU_DZ_DZS_DX ! du/dz*dzs/dx surf -REAL, DIMENSION(SIZE(PWM,1),SIZE(PWM,2),1) :: ZDV_DZ_DZS_DY ! dv/dz*dzs/dy surf -REAL, DIMENSION(SIZE(PWM,1),SIZE(PWM,2),1) :: ZDU_DX ! du/dx surf -REAL, DIMENSION(SIZE(PWM,1),SIZE(PWM,2),1) :: ZDV_DY ! dv/dy surf -REAL, DIMENSION(SIZE(PWM,1),SIZE(PWM,2),1) :: ZDW_DZ ! dw/dz surf -! -INTEGER :: IINFO_ll ! return code of parallel routine -TYPE(LIST_ll), POINTER :: TZFIELDS_ll ! list of fields to exchange - -REAL :: ZTIME1, ZTIME2 - - -REAL, DIMENSION(SIZE(PDZZ,1),SIZE(PDZZ,2),1+JPVEXT:3+JPVEXT) :: ZCOEFF , ZDZZ - ! coefficients for the uncentred gradient - ! computation near the ground -TYPE(TFIELDDATA) :: TZFIELD -! -------------------------------------------------------------------------- -! -!* 1. PRELIMINARY COMPUTATIONS -! ------------------------ -NULLIFY(TZFIELDS_ll) -! -IKB = 1+JPVEXT -IKE = SIZE(PUM,3)-JPVEXT -IKU = SIZE(PUM,3) -! -! -ZDIRSINZW(:,:) = SQRT( 1. - PDIRCOSZW(:,:)**2 ) -! -GX_U_M_PUM = GX_U_M(PUM,PDXX,PDZZ,PDZX) -IF (.NOT. L2D) GY_V_M_PVM = GY_V_M(PVM,PDYY,PDZZ,PDZY) -GZ_W_M_PWM = GZ_W_M(PWM,PDZZ) -! -ZMZF_DZZ = MZF(PDZZ) -! -CALL ADD3DFIELD_ll( TZFIELDS_ll, ZFLX, 'TURB_HOR_DYN_CORR::ZFLX' ) - - -! compute the coefficients for the uncentred gradient computation near the -! ground -! -!* 9. < U'U'> -! ------- -! -! Computes the U variance -IF (.NOT. L2D) THEN - ZFLX(:,:,:)= (2./3.) * PTKEM & - - XCMFS * PK *( (4./3.) * GX_U_M_PUM & - -(2./3.) * ( GY_V_M_PVM & - +GZ_W_M_PWM ) ) - !! & to be tested later - !! + XCMFB * PLM / SQRT(PTKEM) * (-2./3.) * PTP -ELSE - ZFLX(:,:,:)= (2./3.) * PTKEM & - - XCMFS * PK *( (4./3.) * GX_U_M_PUM & - -(2./3.) * ( GZ_W_M_PWM ) ) - !! & to be tested later - !! + XCMFB * PLM / SQRT(PTKEM) * (-2./3.) * PTP -END IF -! -ZFLX(:,:,IKE+1) = ZFLX(:,:,IKE) -! -!* prescription of du/dz and dv/dz with uncentered gradient at the surface -! prescription of dw/dz at Dz/2 above ground using the continuity equation -! using a Boussinesq hypothesis to remove the z dependance of rhod_ref -! (div u = 0) -! -ZDZZ(:,:,:) = MXM(PDZZ(:,:,IKB:IKB+2)) -ZCOEFF(:,:,IKB+2)= - ZDZZ(:,:,2) / & - ( (ZDZZ(:,:,3)+ZDZZ(:,:,2)) * ZDZZ(:,:,3) ) -ZCOEFF(:,:,IKB+1)= (ZDZZ(:,:,3)+ZDZZ(:,:,2)) / & - ( ZDZZ(:,:,2) * ZDZZ(:,:,3) ) -ZCOEFF(:,:,IKB)= - (ZDZZ(:,:,3)+2.*ZDZZ(:,:,2)) / & - ( (ZDZZ(:,:,3)+ZDZZ(:,:,2)) * ZDZZ(:,:,2) ) -! -ZDU_DZ_DZS_DX(:,:,:)=MXF ((ZCOEFF(:,:,IKB+2:IKB+2)*PUM(:,:,IKB+2:IKB+2) & - +ZCOEFF(:,:,IKB+1:IKB+1)*PUM(:,:,IKB+1:IKB+1) & - +ZCOEFF(:,:,IKB :IKB )*PUM(:,:,IKB :IKB ) & - )* 0.5 * ( PDZX(:,:,IKB+1:IKB+1)+PDZX(:,:,IKB:IKB)) & - )/ MXF(PDXX(:,:,IKB:IKB)) -! -ZDZZ(:,:,:) = MYM(PDZZ(:,:,IKB:IKB+2)) -ZCOEFF(:,:,IKB+2)= - ZDZZ(:,:,2) / & - ( (ZDZZ(:,:,3)+ZDZZ(:,:,2)) * ZDZZ(:,:,3) ) -ZCOEFF(:,:,IKB+1)= (ZDZZ(:,:,3)+ZDZZ(:,:,2)) / & - ( ZDZZ(:,:,2) * ZDZZ(:,:,3) ) -ZCOEFF(:,:,IKB)= - (ZDZZ(:,:,3)+2.*ZDZZ(:,:,2)) / & - ( (ZDZZ(:,:,3)+ZDZZ(:,:,2)) * ZDZZ(:,:,2) ) -! - -ZDV_DZ_DZS_DY(:,:,:)=MYF ((ZCOEFF(:,:,IKB+2:IKB+2)*PVM(:,:,IKB+2:IKB+2) & - +ZCOEFF(:,:,IKB+1:IKB+1)*PVM(:,:,IKB+1:IKB+1) & - +ZCOEFF(:,:,IKB :IKB )*PVM(:,:,IKB :IKB ) & - )* 0.5 * ( PDZY(:,:,IKB+1:IKB+1)+PDZY(:,:,IKB:IKB)) & - )/ MYF(PDYY(:,:,IKB:IKB)) -! -! -ZDU_DX(:,:,:)= DXF(PUM(:,:,IKB:IKB)) / MXF(PDXX(:,:,IKB:IKB)) & - - ZDU_DZ_DZS_DX(:,:,:) - -ZDV_DY(:,:,:)= DYF(PVM(:,:,IKB:IKB)) / MYF(PDYY(:,:,IKB:IKB)) & - - ZDV_DZ_DZS_DY(:,:,:) -! -ZDW_DZ(:,:,:)=-ZDU_DX(:,:,:)-ZDV_DY(:,:,:) -! -!* computation -! -ZFLX(:,:,IKB) = (2./3.) * PTKEM(:,:,IKB) & - - XCMFS * PK(:,:,IKB) * 2. * ZDU_DX(:,:,1) - - -!! & to be tested later -!! + XCMFB * PLM(:,:,IKB:IKB) /SQRT(PTKEM(:,:,IKB:IKB)) * & -!! (-2./3.) * PTP(:,:,IKB:IKB) -! -! extrapolates this flux under the ground with the surface flux -ZFLX(:,:,IKB-1) = & - PTAU11M(:,:) * PCOSSLOPE(:,:)**2 * PDIRCOSZW(:,:)**2 & - -2. * PTAU12M(:,:) * PCOSSLOPE(:,:)* PSINSLOPE(:,:) * PDIRCOSZW(:,:) & - + PTAU22M(:,:) * PSINSLOPE(:,:)**2 & - + PTAU33M(:,:) * PCOSSLOPE(:,:)**2 * ZDIRSINZW(:,:)**2 & - +2. * PCDUEFF(:,:) * ( & - PVSLOPEM(:,:) * PCOSSLOPE(:,:) * PSINSLOPE(:,:) * ZDIRSINZW(:,:) & - - PUSLOPEM(:,:) * PCOSSLOPE(:,:)**2 * ZDIRSINZW(:,:) * PDIRCOSZW(:,:) ) -! -ZFLX(:,:,IKB-1) = 2. * ZFLX(:,:,IKB-1) - ZFLX(:,:,IKB) -! -CALL UPDATE_HALO_ll(TZFIELDS_ll, IINFO_ll) -IF ( tpfile%lopened .AND. OTURB_FLX ) THEN - ! stores <U U> - TZFIELD%CMNHNAME = 'U_VAR' - TZFIELD%CSTDNAME = '' - TZFIELD%CLONGNAME = 'U_VAR' - TZFIELD%CUNITS = 'm2 s-2' - TZFIELD%CDIR = 'XY' - TZFIELD%CCOMMENT = 'X_Y_Z_U_VAR' - TZFIELD%NGRID = 1 - TZFIELD%NTYPE = TYPEREAL - TZFIELD%NDIMS = 3 - TZFIELD%LTIMEDEP = .TRUE. - CALL IO_Field_write(TPFILE,TZFIELD,ZFLX) -END IF -! -! Complete the U tendency -IF (.NOT. LFLAT) THEN -CALL MPPDB_CHECK3DM("before turb_corr:PRUS,PRHODJ,ZFLX,PDXX,PDZX,PINV_PDZZ",PRECISION,& - & PRUS,PRHODJ,ZFLX,PDXX,PDZX,PINV_PDZZ ) - - PRUS(:,:,:)=PRUS & - -DXM(PRHODJ * ZFLX / MXF(PDXX) ) & - +DZF( PDZX / MZM(PDXX) * MXM( MZM(PRHODJ*ZFLX) * PINV_PDZZ ) ) -CALL MPPDB_CHECK3DM("after turb_corr:PRUS,PRHODJ,ZFLX,PDXX,PDZX,PINV_PDZZ",PRECISION,& - & PRUS,PRHODJ,ZFLX,PDXX,PDZX,PINV_PDZZ ) -ELSE - PRUS(:,:,:)=PRUS -DXM(PRHODJ * ZFLX / MXF(PDXX) ) -END IF -! -IF (KSPLT==1) THEN - ! Contribution to the dynamic production of TKE: - ZWORK(:,:,:) = - ZFLX(:,:,:) * GX_U_M_PUM - ! - ! evaluate the dynamic production at w(IKB+1) in PDP(IKB) - ! - ZWORK(:,:,IKB) = 0.5* ( -ZFLX(:,:,IKB)*ZDU_DX(:,:,1) + ZWORK(:,:,IKB+1) ) - ! - PDP(:,:,:) = PDP(:,:,:) + ZWORK(:,:,:) -END IF -! -! Storage in the LES configuration -! -IF (LLES_CALL .AND. KSPLT==1) THEN - CALL SECOND_MNH(ZTIME1) - CALL LES_MEAN_SUBGRID( ZFLX, X_LES_SUBGRID_U2 ) - CALL LES_MEAN_SUBGRID( -ZWORK, X_LES_RES_ddxa_U_SBG_UaU , .TRUE.) - CALL SECOND_MNH(ZTIME2) - XTIME_LES = XTIME_LES + ZTIME2 - ZTIME1 -END IF - -! -!* 10. < V'V'> -! ------- -! -! Computes the V variance -IF (.NOT. L2D) THEN - ZFLX(:,:,:)= (2./3.) * PTKEM & - - XCMFS * PK *( (4./3.) * GY_V_M_PVM & - -(2./3.) * ( GX_U_M_PUM & - +GZ_W_M_PWM ) ) - !! & to be tested - !! + XCMFB * PLM / SQRT(PTKEM) * (-2./3.) * PTP - ! -ELSE - ZFLX(:,:,:)= (2./3.) * PTKEM & - - XCMFS * PK *(-(2./3.) * ( GX_U_M_PUM & - +GZ_W_M_PWM ) ) - !! & to be tested - !! + XCMFB * PLM / SQRT(PTKEM) * (-2./3.) * PTP - ! -END IF -! -ZFLX(:,:,IKE+1) = ZFLX(:,:,IKE) -! -ZFLX(:,:,IKB) = (2./3.) * PTKEM(:,:,IKB) & - - XCMFS * PK(:,:,IKB) * 2. * ZDV_DY(:,:,1) - -!! & to be tested -!! + XCMFB * PLM(:,:,IKB:IKB) /SQRT(PTKEM(:,:,IKB:IKB)) * & -!! (-2./3.) * PTP(:,:,IKB:IKB) -! -! extrapolates this flux under the ground with the surface flux -ZFLX(:,:,IKB-1) = & - PTAU11M(:,:) * PSINSLOPE(:,:)**2 * PDIRCOSZW(:,:)**2 & - +2. * PTAU12M(:,:) * PCOSSLOPE(:,:)* PSINSLOPE(:,:) * PDIRCOSZW(:,:) & - + PTAU22M(:,:) * PCOSSLOPE(:,:)**2 & - + PTAU33M(:,:) * PSINSLOPE(:,:)**2 * ZDIRSINZW(:,:)**2 & - -2. * PCDUEFF(:,:)* ( & - PUSLOPEM(:,:) * PSINSLOPE(:,:)**2 * ZDIRSINZW(:,:) * PDIRCOSZW(:,:) & - + PVSLOPEM(:,:) * PCOSSLOPE(:,:) * PSINSLOPE(:,:) * ZDIRSINZW(:,:) ) -! -ZFLX(:,:,IKB-1) = 2. * ZFLX(:,:,IKB-1) - ZFLX(:,:,IKB) -! -CALL UPDATE_HALO_ll(TZFIELDS_ll, IINFO_ll) -! -IF ( tpfile%lopened .AND. OTURB_FLX ) THEN - ! stores <V V> - TZFIELD%CMNHNAME = 'V_VAR' - TZFIELD%CSTDNAME = '' - TZFIELD%CLONGNAME = 'V_VAR' - TZFIELD%CUNITS = 'm2 s-2' - TZFIELD%CDIR = 'XY' - TZFIELD%CCOMMENT = 'X_Y_Z_V_VAR' - TZFIELD%NGRID = 1 - TZFIELD%NTYPE = TYPEREAL - TZFIELD%NDIMS = 3 - TZFIELD%LTIMEDEP = .TRUE. - CALL IO_Field_write(TPFILE,TZFIELD,ZFLX) -END IF -! -! Complete the V tendency -IF (.NOT. L2D) THEN - IF (.NOT. LFLAT) THEN - PRVS(:,:,:)=PRVS & - -DYM(PRHODJ * ZFLX / MYF(PDYY) ) & - +DZF( PDZY / MZM(PDYY) * & - MYM( MZM(PRHODJ*ZFLX) * PINV_PDZZ ) ) - ELSE - PRVS(:,:,:)=PRVS -DYM(PRHODJ * ZFLX / MYF(PDYY) ) - END IF -! -! Contribution to the dynamic production of TKE: - IF (KSPLT==1) ZWORK(:,:,:) = - ZFLX(:,:,:) * GY_V_M_PVM -ELSE - ZWORK(:,:,:) = 0. -END IF -! -IF (KSPLT==1) THEN - ! - ! evaluate the dynamic production at w(IKB+1) in PDP(IKB) - ! - ZWORK(:,:,IKB) = 0.5* ( -ZFLX(:,:,IKB)*ZDV_DY(:,:,1) + ZWORK(:,:,IKB+1) ) - ! - PDP(:,:,:) = PDP(:,:,:) + ZWORK(:,:,:) -END IF -! -! Storage in the LES configuration -! -IF (LLES_CALL .AND. KSPLT==1) THEN - CALL SECOND_MNH(ZTIME1) - CALL LES_MEAN_SUBGRID( ZFLX, X_LES_SUBGRID_V2 ) - CALL LES_MEAN_SUBGRID( -ZWORK, X_LES_RES_ddxa_V_SBG_UaV , .TRUE.) - CALL SECOND_MNH(ZTIME2) - XTIME_LES = XTIME_LES + ZTIME2 - ZTIME1 -END IF -! -!* 11. < W'W'> -! ------- -! -! Computes the W variance -IF (.NOT. L2D) THEN - ZFLX(:,:,:)= (2./3.) * PTKEM & - - XCMFS * PK *( (4./3.) * GZ_W_M_PWM & - -(2./3.) * ( GX_U_M_PUM & - +GY_V_M_PVM ) ) - !! & to be tested - !! -2.* XCMFB * PLM / SQRT(PTKEM) * (-2./3.) * PTP -ELSE - ZFLX(:,:,:)= (2./3.) * PTKEM & - - XCMFS * PK *( (4./3.) * GZ_W_M_PWM & - -(2./3.) * ( GX_U_M_PUM ) ) - !! & to be tested - !! -2.* XCMFB * PLM / SQRT(PTKEM) * (-2./3.) * PTP -END IF -! -ZFLX(:,:,IKE+1)= ZFLX(:,:,IKE) -! -ZFLX(:,:,IKB) = (2./3.) * PTKEM(:,:,IKB) & - - XCMFS * PK(:,:,IKB) * 2. * ZDW_DZ(:,:,1) - -! & to be tested -! - 2.* XCMFB * PLM(:,:,IKB:IKB) /SQRT(PTKEM(:,:,IKB:IKB)) * & -! (-2./3.) * PTP(:,:,IKB:IKB) -! -! extrapolates this flux under the ground with the surface flux -ZFLX(:,:,IKB-1) = & - PTAU11M(:,:) * ZDIRSINZW(:,:)**2 & - + PTAU33M(:,:) * PDIRCOSZW(:,:)**2 & - +2. * PCDUEFF(:,:)* PUSLOPEM(:,:) * ZDIRSINZW(:,:) * PDIRCOSZW(:,:) - ! -ZFLX(:,:,IKB-1) = 2. * ZFLX(:,:,IKB-1) - ZFLX(:,:,IKB) -! -IF ( tpfile%lopened .AND. OTURB_FLX ) THEN - ! stores <W W> - TZFIELD%CMNHNAME = 'W_VAR' - TZFIELD%CSTDNAME = '' - TZFIELD%CLONGNAME = 'W_VAR' - TZFIELD%CUNITS = 'm2 s-2' - TZFIELD%CDIR = 'XY' - TZFIELD%CCOMMENT = 'X_Y_Z_W_VAR' - TZFIELD%NGRID = 1 - TZFIELD%NTYPE = TYPEREAL - TZFIELD%NDIMS = 3 - TZFIELD%LTIMEDEP = .TRUE. - CALL IO_Field_write(TPFILE,TZFIELD,ZFLX) -END IF -! -! Complete the W tendency -! -!PRWS(:,:,:)=PRWS(:,:,:) - DZM( PRHODJ*ZFLX/MZF(PDZZ) ) -ZDFDDWDZ(:,:,:) = - XCMFS * PK(:,:,:) * (4./3.) -ZDFDDWDZ(:,:,:IKB) = 0. -! -CALL TRIDIAG_W(PWM,ZFLX,ZDFDDWDZ,PTSTEP,ZMZF_DZZ,PRHODJ,ZWP) -! -PRWS = PRWS(:,:,:) + MZM(PRHODJ(:,:,:))*(ZWP(:,:,:)-PWM(:,:,:))/PTSTEP -! -!* recomputes flux using guess of W -! -GZ_W_M_ZWP = GZ_W_M(ZWP,PDZZ) -ZFLX(:,:,IKB+1:)=ZFLX(:,:,IKB+1:) & - - XCMFS * PK(:,:,IKB+1:) * (4./3.) * (GZ_W_M_ZWP(:,:,IKB+1:) - GZ_W_M_PWM(:,:,IKB+1:)) -! -IF (KSPLT==1) THEN - !Contribution to the dynamic production of TKE: -! ZWORK(:,:,:) = - ZFLX(:,:,:) * GZ_W_M_PWM - ZWORK(:,:,:) = - ZFLX(:,:,:) * GZ_W_M_ZWP - ! - ! evaluate the dynamic production at w(IKB+1) in PDP(IKB) - ! - ZWORK(:,:,IKB) = 0.5* ( -ZFLX(:,:,IKB)*ZDW_DZ(:,:,1) + ZWORK(:,:,IKB+1) ) - ! - PDP(:,:,:) = PDP(:,:,:) + ZWORK(:,:,:) -END IF -! -! Storage in the LES configuration -! -! -IF (LLES_CALL .AND. KSPLT==1) THEN - CALL SECOND_MNH(ZTIME1) - CALL LES_MEAN_SUBGRID( ZFLX, X_LES_SUBGRID_W2 ) - CALL LES_MEAN_SUBGRID( -ZWORK, X_LES_RES_ddxa_W_SBG_UaW , .TRUE.) - CALL LES_MEAN_SUBGRID( GZ_M_M(PTHLM,PDZZ)*ZFLX, X_LES_RES_ddxa_Thl_SBG_UaW , .TRUE.) - CALL LES_MEAN_SUBGRID(ZFLX*MZF(GZ_M_W(1,IKU,1,PTHLM,PDZZ)),X_LES_RES_ddz_Thl_SBG_W2) - IF (KRR>=1) THEN - CALL LES_MEAN_SUBGRID( GZ_M_M(PRM(:,:,:,1),PDZZ)*ZFLX, & - X_LES_RES_ddxa_Rt_SBG_UaW , .TRUE.) - CALL LES_MEAN_SUBGRID(ZFLX*MZF(GZ_M_W(1,IKU,1,PRM(:,:,:,1),PDZZ)), & - X_LES_RES_ddz_Rt_SBG_W2) - END IF - DO JSV=1,NSV - CALL LES_MEAN_SUBGRID( GZ_M_M(PSVM(:,:,:,JSV),PDZZ)*ZFLX, & - X_LES_RES_ddxa_Sv_SBG_UaW(:,:,:,JSV) , .TRUE.) - CALL LES_MEAN_SUBGRID(ZFLX*MZF(GZ_M_W(1,IKU,1,PSVM(:,:,:,JSV),PDZZ)), & - X_LES_RES_ddz_Sv_SBG_W2(:,:,:,JSV)) - END DO - CALL SECOND_MNH(ZTIME2) - XTIME_LES = XTIME_LES + ZTIME2 - ZTIME1 -END IF -! -CALL CLEANLIST_ll(TZFIELDS_ll) -! -! -END SUBROUTINE TURB_HOR_DYN_CORR diff --git a/src/mesonh/turb/turb_hor_splt.f90 b/src/mesonh/turb/turb_hor_splt.f90 deleted file mode 100644 index 2de0ca9a8..000000000 --- a/src/mesonh/turb/turb_hor_splt.f90 +++ /dev/null @@ -1,632 +0,0 @@ -!MNH_LIC Copyright 1994-2021 CNRS, Meteo-France and Universite Paul Sabatier -!MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence -!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt -!MNH_LIC for details. version 1. -!----------------------------------------------------------------- -! ######################### - MODULE MODI_TURB_HOR_SPLT -! ######################### -! -INTERFACE -! - SUBROUTINE TURB_HOR_SPLT(KSPLIT, KRR, KRRL, KRRI, PTSTEP, & - HLBCX,HLBCY,OTURB_FLX,OSUBG_COND, & - TPFILE, & - PDXX,PDYY,PDZZ,PDZX,PDZY,PZZ, & - PDIRCOSXW,PDIRCOSYW,PDIRCOSZW, & - PCOSSLOPE,PSINSLOPE, & - PRHODJ,PTHVREF, & - PSFTHM,PSFRM,PSFSVM, & - PCDUEFF,PTAU11M,PTAU12M,PTAU22M,PTAU33M, & - PUM,PVM,PWM,PUSLOPEM,PVSLOPEM,PTHLM,PRM,PSVM, & - PTKEM,PLM,PLEPS, & - PLOCPEXNM,PATHETA,PAMOIST,PSRCM,PFRAC_ICE, & - PDP,PTP,PSIGS, & - PTRH, & - PRUS,PRVS,PRWS,PRTHLS,PRRS,PRSVS ) - -! -USE MODD_IO, ONLY: TFILEDATA -! -INTEGER, INTENT(IN) :: KSPLIT ! number of time splitting -INTEGER, INTENT(IN) :: KRR ! number of moist var. -INTEGER, INTENT(IN) :: KRRL ! number of liquid water var. -INTEGER, INTENT(IN) :: KRRI ! number of ice water var. -REAL, INTENT(IN) :: PTSTEP ! timestep -CHARACTER (LEN=*), DIMENSION(:), INTENT(IN) :: HLBCX,HLBCY -LOGICAL, INTENT(IN) :: OTURB_FLX ! switch to write the - ! turbulent fluxes in the syncronous FM-file -LOGICAL, INTENT(IN) :: OSUBG_COND ! Switch for sub-grid -! condensation -TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! Output file -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PDXX, PDYY, PDZZ, PDZX, PDZY - ! Metric coefficients -REAL, DIMENSION(:,:,:), INTENT(IN) :: PZZ ! vertical grid -REAL, DIMENSION(:,:), INTENT(IN) :: PDIRCOSXW, PDIRCOSYW, PDIRCOSZW -! Director Cosinus along x, y and z directions at surface w-point -REAL, DIMENSION(:,:), INTENT(IN) :: PCOSSLOPE ! cosinus of the angle - ! between i and the slope vector -REAL, DIMENSION(:,:), INTENT(IN) :: PSINSLOPE ! sinus of the angle - ! between i and the slope vector -REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! density * grid volume -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHVREF ! ref. state VPT -! -REAL, DIMENSION(:,:), INTENT(IN) :: PSFTHM,PSFRM -REAL, DIMENSION(:,:,:), INTENT(IN) :: PSFSVM ! surface fluxes -! -REAL, DIMENSION(:,:), INTENT(IN) :: PCDUEFF ! Cd * || u || at time t -REAL, DIMENSION(:,:), INTENT(IN) :: PTAU11M ! <uu> in the axes linked - ! to the maximum slope direction and the surface normal and the binormal - ! at time t - dt -REAL, DIMENSION(:,:), INTENT(IN) :: PTAU12M ! <uv> in the same axes -REAL, DIMENSION(:,:), INTENT(IN) :: PTAU22M ! <vv> in the same axes -REAL, DIMENSION(:,:), INTENT(IN) :: PTAU33M ! <ww> in the same axes -! -! Variables at t-1 -REAL, DIMENSION(:,:,:), INTENT(IN) :: PUM,PVM,PWM,PTHLM -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRM ! mixing ratios at t-1, - ! where PRM(:,:,:,1) = conservative mixing ratio -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PSVM ! scalar var. at t-1 -REAL, DIMENSION(:,:), INTENT(IN) :: PUSLOPEM ! wind component along the - ! maximum slope direction -REAL, DIMENSION(:,:), INTENT(IN) :: PVSLOPEM ! wind component along the - ! direction normal to the maximum slope one -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTKEM ! TKE at time t- dt -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLM ! Turb. mixing length -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLEPS ! dissipative length -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLOCPEXNM ! Lv(T)/Cp/Exner at time t-1 -REAL, DIMENSION(:,:,:), INTENT(IN) :: PATHETA ! coefficients between -REAL, DIMENSION(:,:,:), INTENT(IN) :: PAMOIST ! s and Thetal and Rnp - -REAL, DIMENSION(:,:,:), INTENT(IN) :: PSRCM - ! normalized 2nd-order flux - ! s'r'c/2Sigma_s2 at t-1 multiplied by Lambda_3 -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PFRAC_ICE ! ri fraction of rc+ri -! -REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRUS, PRVS, PRWS, PRTHLS -REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRSVS,PRRS ! var. at t+1 -split- -REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PDP,PTP ! TKE production terms -REAL, DIMENSION(:,:,:), INTENT(OUT) :: PTRH - -REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PSIGS - ! IN: Vertical part of Sigma_s at t - ! OUT: Total Sigma_s at t -! -! -! -END SUBROUTINE TURB_HOR_SPLT -! -END INTERFACE -! -END MODULE MODI_TURB_HOR_SPLT -! ################################################################ - SUBROUTINE TURB_HOR_SPLT(KSPLIT, KRR, KRRL, KRRI, PTSTEP, & - HLBCX,HLBCY,OTURB_FLX,OSUBG_COND, & - TPFILE, & - PDXX,PDYY,PDZZ,PDZX,PDZY,PZZ, & - PDIRCOSXW,PDIRCOSYW,PDIRCOSZW, & - PCOSSLOPE,PSINSLOPE, & - PRHODJ,PTHVREF, & - PSFTHM,PSFRM,PSFSVM, & - PCDUEFF,PTAU11M,PTAU12M,PTAU22M,PTAU33M, & - PUM,PVM,PWM,PUSLOPEM,PVSLOPEM,PTHLM,PRM,PSVM, & - PTKEM,PLM,PLEPS, & - PLOCPEXNM,PATHETA,PAMOIST,PSRCM,PFRAC_ICE, & - PDP,PTP,PSIGS, & - PTRH, & - PRUS,PRVS,PRWS,PRTHLS,PRRS,PRSVS ) -! ################################################################ -! -! -!!**** *TURB_HOR* -routine to compute the source terms in the meso-NH -!! model equations due to the non-vertical turbulent fluxes. -!! -!! PURPOSE -!! ------- -! The purpose of this routine is to compute the non-vertical -! turbulent fluxes of the evolutive variables and give back the -! source terms to the main program. -! -!!** METHOD -!! ------ -!! Complementary 3D calculations when running at high resolution; -!! The non-vertical turbulent fluxes are computed explicitly. The -!! contributions are cumulated in PRvarS and in DP and TP of TKE -! -! d(rho*T) = -d(rho*u'T'/dxx) -d(-rho*u'T'*dzx/dxx/dzz) -! / dt / dx /dz -!! -!! -!! Near the bottom of the model, uncentred evaluation of vertical -!! gradients are required because no field values are available under -!! the level where the gradient must be evaluated. In this case, the -!! gradient is computed with a second order accurate uncentred scheme -!! according to: -!! -!! D FF dzz3 (dzz3+dzz4) -!! ---- = - ----------------- FF(4) + ----------------- FF(3) -!! D z (dzz3+dzz4) dzz4 dzz3 dzz4 -!! -!! dzz4 + 2 dzz3 -!! - ----------------- FF(2) -!! (dzz3+dzz4) dzz3 -!! -!! where the values are taken from: -!! -!! ----- FF(5) -!! | -!! | dzz5 -!! | -!! ----- FF(4) -!! | -!! | dzz4 -!! | -!! ----- FF(3) -!! | -!! | dzz3 -!! | -!! ----- FF(2) , (D FF / DZ) -!! | dzz2 * 0.5 -!! ----- ground -!! -!! -!! -!! EXTERNAL -!! -------- -!! GX_M_U, GY_M_V -!! GX_M_M, GY_M_M, GZ_M_M -!! GY_U_UV,GX_V_UV -!! GX_U_M, GY_V_M, GZ_W_M -!! GX_W_UW,GY_W_UW -!! : Cartesian vertical gradient operators -!! -!! -!! MXM,MXF,MYM,MYF,MZM,MZF -!! : Shuman functions (mean operators) -!! DXM,DXF.DYM,DYF,DZM,DZF -!! : Shuman functions (difference operators) -!! -!! -!! IMPLICIT ARGUMENTS -!! ------------------ -!! Module MODD_CST : contains physical constants -!! -!! XG : gravity constant -!! -!! Module MODD_CTURB: contains the set of constants for -!! the turbulence scheme -!! -!! XCMFS,XCMFB : cts for the momentum flux -!! XCSHF : ct for the sensible heat flux -!! XCHF : ct for the moisture flux -!! XCTV,XCHV : cts for the T and moisture variances -!! -!! Module MODD_PARAMETERS -!! -!! JPVEXT : number of vertical external points -!! -!! Module MODD_CONF -!! -!! CPROGRAM -!! -!! -!! REFERENCE -!! --------- -!! Book 2 of documentation (routine TURB_HOR) -!! Book 1 of documentation (Chapter: Turbulence) -!! -!! AUTHOR -!! ------ -!! Joan Cuxart * INM and Meteo-France * -!! -!! MODIFICATIONS -!! ------------- -!! Original Aug 29, 1994 -!! Modifications: Feb 14, 1995 (J.Cuxart and J.Stein) -!! Doctorization and Optimization -!! March 21, 1995 (J.M. Carriere) -!! Introduction of cloud water -!! June 14, 1995 (J. Stein) -!! rm the ZVTPV computation + bug in the all -!! or nothing condens. case -!! June 28, 1995 (J.Cuxart) Add the LES tools -!! Sept 19, 1995 (J. Stein) change the surface flux -!! computations -!! Nov 13, 1995 (J. Stein) include the tangential fluxes -!! bug in <u'w'> at the surface -!! Nov 27, 1997 (V. Saravane) spliting of the routine -!! Nov 27, 1997 (V. Masson) clearing of the routine -!! Mar 07, 2001 (V. Masson and J. Stein) time splitting -!! + major bugs correction for slopes -!! Nov 06, 2002 (V. Masson) LES budgets -!! Feb 20, 2003 (JP Pinty) Add PFRAC_ICE -!! Oct.2009 (C.Lac) Introduction of different PTSTEP according to the -!! advection schemes -!! J.Escobar : 15/09/2015 : WENO5 & JPHEXT <> 1 -!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O -! P. Wautelet 20/05/2019: add name argument to ADDnFIELD_ll + new ADD4DFIELD_ll subroutine -!! -------------------------------------------------------------------------- -! -!* 0. DECLARATIONS -! ------------ -! -USE MODD_CONF -USE MODD_CST -USE MODD_CTURB -USE MODD_IO, ONLY: TFILEDATA -USE MODD_PARAMETERS -! -! -USE MODI_SHUMAN -USE MODI_TURB_HOR -USE MODI_TURB_HOR_TKE -! -USE MODE_ll -! -IMPLICIT NONE -! -! -!* 0.1 declaration of arguments -! -! -INTEGER, INTENT(IN) :: KSPLIT ! number of time splitting -INTEGER, INTENT(IN) :: KRR ! number of moist var. -INTEGER, INTENT(IN) :: KRRL ! number of liquid water var. -INTEGER, INTENT(IN) :: KRRI ! number of ice water var. -REAL, INTENT(IN) :: PTSTEP ! timestep -CHARACTER (LEN=*), DIMENSION(:), INTENT(IN) :: HLBCX,HLBCY -LOGICAL, INTENT(IN) :: OTURB_FLX ! switch to write the - ! turbulent fluxes in the syncronous FM-file -LOGICAL, INTENT(IN) :: OSUBG_COND ! Switch for sub-grid -! condensation -TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! Output file -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PDXX, PDYY, PDZZ, PDZX, PDZY - ! Metric coefficients -REAL, DIMENSION(:,:,:), INTENT(IN) :: PZZ ! vertical grid -REAL, DIMENSION(:,:), INTENT(IN) :: PDIRCOSXW, PDIRCOSYW, PDIRCOSZW -! Director Cosinus along x, y and z directions at surface w-point -REAL, DIMENSION(:,:), INTENT(IN) :: PCOSSLOPE ! cosinus of the angle - ! between i and the slope vector -REAL, DIMENSION(:,:), INTENT(IN) :: PSINSLOPE ! sinus of the angle - ! between i and the slope vector -REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! density * grid volume -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHVREF ! ref. state VPT -! -REAL, DIMENSION(:,:), INTENT(IN) :: PSFTHM,PSFRM -REAL, DIMENSION(:,:,:), INTENT(IN) :: PSFSVM ! surface fluxes -! -REAL, DIMENSION(:,:), INTENT(IN) :: PCDUEFF ! Cd * || u || at time t -REAL, DIMENSION(:,:), INTENT(IN) :: PTAU11M ! <uu> in the axes linked - ! to the maximum slope direction and the surface normal and the binormal - ! at time t - dt -REAL, DIMENSION(:,:), INTENT(IN) :: PTAU12M ! <uv> in the same axes -REAL, DIMENSION(:,:), INTENT(IN) :: PTAU22M ! <vv> in the same axes -REAL, DIMENSION(:,:), INTENT(IN) :: PTAU33M ! <ww> in the same axes -! -! Variables at t-1 -REAL, DIMENSION(:,:,:), INTENT(IN) :: PUM,PVM,PWM,PTHLM -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRM ! mixing ratios at t-1, - ! where PRM(:,:,:,1) = conservative mixing ratio -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PSVM ! scalar var. at t-1 -REAL, DIMENSION(:,:), INTENT(IN) :: PUSLOPEM ! wind component along the - ! maximum slope direction -REAL, DIMENSION(:,:), INTENT(IN) :: PVSLOPEM ! wind component along the - ! direction normal to the maximum slope one -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTKEM ! TKE at time t- dt -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLM ! Turb. mixing length -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLEPS ! dissipative length -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLOCPEXNM ! Lv(T)/Cp/Exner at time t-1 -REAL, DIMENSION(:,:,:), INTENT(IN) :: PATHETA ! coefficients between -REAL, DIMENSION(:,:,:), INTENT(IN) :: PAMOIST ! s and Thetal and Rnp - -REAL, DIMENSION(:,:,:), INTENT(IN) :: PSRCM - ! normalized 2nd-order flux - ! s'r'c/2Sigma_s2 at t-1 multiplied by Lambda_3 -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PFRAC_ICE ! ri fraction of rc+ri -! -REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRUS, PRVS, PRWS, PRTHLS -REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRSVS,PRRS ! var. at t+1 -split- -REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PDP,PTP ! TKE production terms -REAL, DIMENSION(:,:,:), INTENT(OUT) :: PTRH -REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PSIGS - ! IN: Vertical part of Sigma_s at t - ! OUT: Total Sigma_s at t -! -! -! -!* 0.2 declaration of local variables -! -REAL,ALLOCATABLE,DIMENSION(:,:,:) :: ZK ! Turbulent diffusion doef. - ! ZK = PLM * SQRT(PTKEM) -REAL,ALLOCATABLE,DIMENSION(:,:,:) :: ZINV_PDXX ! 1./PDXX -REAL,ALLOCATABLE,DIMENSION(:,:,:) :: ZINV_PDYY ! 1./PDYY -REAL,ALLOCATABLE,DIMENSION(:,:,:) :: ZINV_PDZZ ! 1./PDZZ -REAL,ALLOCATABLE,DIMENSION(:,:,:) :: ZMZM_PRHODJ ! MZM(PRHODJ) -! -INTEGER :: JSPLT ! current split -! -INTEGER :: IKB, IKE, IIB, IIE, IJB, IJE -INTEGER :: JRR, JSV -! -INTEGER :: ISV -INTEGER :: IINFO_ll -! -REAL,ALLOCATABLE,DIMENSION(:,:,:) :: ZUM, ZVM, ZWM, ZTHLM, ZTKEM -REAL,ALLOCATABLE,DIMENSION(:,:,:,:) :: ZRM, ZSVM -REAL,ALLOCATABLE,DIMENSION(:,:,:) :: ZRUS, ZRVS, ZRWS, ZRTHLS -REAL,ALLOCATABLE,DIMENSION(:,:,:,:) :: ZRRS, ZRSVS -! -! -TYPE(LIST_ll), POINTER, SAVE :: TZFIELDS_ll -! -! --------------------------------------------------------------------------- -! -!* 1. PRELIMINARY COMPUTATIONS -! ------------------------ -! -IKB = 1.+JPVEXT -IKE = SIZE(PUM,3) - JPVEXT -CALL GET_INDICE_ll (IIB,IJB,IIE,IJE) -ISV=SIZE(PSVM,4) -! -ALLOCATE(ZK(SIZE(PTHLM,1),SIZE(PTHLM,2),SIZE(PTHLM,3))) -ALLOCATE(ZINV_PDXX(SIZE(PDXX,1),SIZE(PDXX,2),SIZE(PDXX,3))) -ALLOCATE(ZINV_PDYY(SIZE(PDYY,1),SIZE(PDYY,2),SIZE(PDYY,3))) -ALLOCATE(ZINV_PDZZ(SIZE(PDZZ,1),SIZE(PDZZ,2),SIZE(PDZZ,3))) -ALLOCATE(ZMZM_PRHODJ(SIZE(PRHODJ,1),SIZE(PRHODJ,2),SIZE(PRHODJ,3))) -! -ZINV_PDXX = 1./PDXX -ZINV_PDYY = 1./PDYY -ZINV_PDZZ = 1./PDZZ -ZMZM_PRHODJ = MZM(PRHODJ) -! -ZK(:,:,:) = PLM(:,:,:) * SQRT(PTKEM(:,:,:)) -! -NULLIFY(TZFIELDS_ll) -! -!-------------------------------------------------------------------- -! -!* 2. SPLIT PROCESS LOOP -! ------------------ -! -IF (KSPLIT>1 .AND. CPROGRAM=='MESONH') THEN -! -!* 2.1 allocations -! ----------- -! - ALLOCATE(ZUM(SIZE(PUM,1),SIZE(PUM,2),SIZE(PUM,3))) - ALLOCATE(ZVM(SIZE(PVM,1),SIZE(PVM,2),SIZE(PVM,3))) - ALLOCATE(ZWM(SIZE(PWM,1),SIZE(PWM,2),SIZE(PWM,3))) - ALLOCATE(ZSVM(SIZE(PSVM,1),SIZE(PSVM,2),SIZE(PSVM,3),SIZE(PSVM,4))) - ALLOCATE(ZTHLM(SIZE(PTHLM,1),SIZE(PTHLM,2),SIZE(PTHLM,3))) - ALLOCATE(ZTKEM(SIZE(PTKEM,1),SIZE(PTKEM,2),SIZE(PTKEM,3))) - ALLOCATE(ZRM(SIZE(PRM,1),SIZE(PRM,2),SIZE(PRM,3),SIZE(PRM,4))) - ALLOCATE(ZRUS(SIZE(PRUS,1),SIZE(PRUS,2),SIZE(PRUS,3))) - ALLOCATE(ZRVS(SIZE(PRVS,1),SIZE(PRVS,2),SIZE(PRVS,3))) - ALLOCATE(ZRWS(SIZE(PRWS,1),SIZE(PRWS,2),SIZE(PRWS,3))) - ALLOCATE(ZRSVS(SIZE(PRSVS,1),SIZE(PRSVS,2),SIZE(PRSVS,3),SIZE(PRSVS,4))) - ALLOCATE(ZRTHLS(SIZE(PRTHLS,1),SIZE(PRTHLS,2),SIZE(PRTHLS,3))) - ALLOCATE(ZRRS(SIZE(PRRS,1),SIZE(PRRS,2),SIZE(PRRS,3),SIZE(PRRS,4))) -! -! -!* 2.2 list for parallel exchanges -! --------------------------- -! - CALL ADD3DFIELD_ll( TZFIELDS_ll, ZUM, 'TURB_HOR_SPLT::ZUM' ) - CALL ADD3DFIELD_ll( TZFIELDS_ll, ZVM, 'TURB_HOR_SPLT::ZVM' ) - CALL ADD3DFIELD_ll( TZFIELDS_ll, ZWM, 'TURB_HOR_SPLT::ZWM' ) - CALL ADD3DFIELD_ll( TZFIELDS_ll, ZTHLM, 'TURB_HOR_SPLT::ZTHLM' ) - CALL ADD3DFIELD_ll( TZFIELDS_ll, ZTKEM, 'TURB_HOR_SPLT::ZTKEM' ) - CALL ADD4DFIELD_ll( TZFIELDS_ll, ZSVM(:,:,:,1:ISV), 'TURB_HOR_SPLT::ZSVM(:,:,:,1:ISV)' ) - CALL ADD4DFIELD_ll( TZFIELDS_ll, ZRM(:,:,:,1:KRR), 'TURB_HOR_SPLT::ZRM(:,:,:,1:KRR)' ) -! -! -!* 2.3 initializations -! --------------- -! -! - ZUM=PUM - ZVM=PVM - ZWM=PWM - IF (ISV>0) ZSVM=PSVM - ZTHLM=PTHLM - ZTKEM=PTKEM - IF (KRR>0) ZRM=PRM - ! - ZRUS=PRUS*KSPLIT - ZRVS=PRVS*KSPLIT - ZRWS=PRWS*KSPLIT - IF (ISV>0) ZRSVS=PRSVS*KSPLIT - ZRTHLS=PRTHLS*KSPLIT - IF (KRR>0) ZRRS=PRRS*KSPLIT - -! -!* 2.4 split process -! ------------- -! - DO JSPLT=1,KSPLIT -! -! compute the turbulent tendencies for the small time step - CALL TURB_HOR(JSPLT, KRR, KRRL, KRRI, PTSTEP, & - OTURB_FLX,OSUBG_COND, & - TPFILE, & - PDXX,PDYY,PDZZ,PDZX,PDZY,PZZ, & - PDIRCOSXW,PDIRCOSYW,PDIRCOSZW, & - PCOSSLOPE,PSINSLOPE, & - ZINV_PDXX, ZINV_PDYY, ZINV_PDZZ, ZMZM_PRHODJ, & - ZK, & - PRHODJ,PTHVREF, & - PSFTHM,PSFRM,PSFSVM, & - PCDUEFF,PTAU11M,PTAU12M,PTAU22M,PTAU33M, & - ZUM,ZVM,ZWM,PUSLOPEM,PVSLOPEM,ZTHLM,ZRM,ZSVM, & - PTKEM,PLM,PLEPS, & - PLOCPEXNM,PATHETA,PAMOIST,PSRCM,PFRAC_ICE, & - PDP,PTP,PSIGS, & - ZRUS,ZRVS,ZRWS,ZRTHLS,ZRRS,ZRSVS ) -! -! horizontal transport of Tke -! - CALL TURB_HOR_TKE(JSPLT, & - PDXX,PDYY,PDZZ,PDZX,PDZY, & - ZINV_PDXX, ZINV_PDYY, ZINV_PDZZ, ZMZM_PRHODJ, & - ZK, PRHODJ, ZTKEM, & - PTRH ) -! -! -! split temporal advance - - ZUM=PUM+(ZRUS/KSPLIT-PRUS)/MXM(PRHODJ)*PTSTEP - ZVM=PVM+(ZRVS/KSPLIT-PRVS)/MYM(PRHODJ)*PTSTEP - ZWM=PWM+(ZRWS/KSPLIT-PRWS)/ZMZM_PRHODJ*PTSTEP - DO JSV=1,ISV - ZSVM(:,:,:,JSV)=PSVM(:,:,:,JSV)+ & - (ZRSVS(:,:,:,JSV)/KSPLIT-PRSVS(:,:,:,JSV))/PRHODJ*PTSTEP - END DO - ZTHLM=PTHLM+(ZRTHLS/KSPLIT-PRTHLS)/PRHODJ*PTSTEP - ZTKEM=ZTKEM+PTRH*PTSTEP/KSPLIT - DO JRR=1,KRR - ZRM(:,:,:,JRR)=PRM(:,:,:,JRR)+ & - (ZRRS(:,:,:,JRR)/KSPLIT-PRRS(:,:,:,JRR))/PRHODJ*PTSTEP - END DO -! -! reinforce boundary conditions -! - IF (JSPLT<KSPLIT-NHALO+1) CALL UPDATE_HALO_ll(TZFIELDS_ll,IINFO_ll) - ! - IF ( HLBCX(1) /= "CYCL" .AND. LWEST_ll()) THEN - ZUM(IIB ,:,:)=PUM(IIB ,:,:) - ZVM(IIB-1,:,:)=PVM(IIB-1,:,:) - ZWM(IIB-1,:,:)=PWM(IIB-1,:,:) - ZTHLM(IIB-1,:,:)=PTHLM(IIB-1,:,:) - ZTKEM(IIB-1,:,:)=PTKEM(IIB-1,:,:) - IF (ISV>0) ZSVM(IIB-1,:,:,:)=PSVM(IIB-1,:,:,:) - IF (KRR>0) ZRM (IIB-1,:,:,:)=PRM (IIB-1,:,:,:) - ENDIF - ! - IF ( HLBCX(2) /= "CYCL" .AND. LEAST_ll()) THEN - ZUM(IIE+1,:,:)=PUM(IIE+1,:,:) - ZVM(IIE+1,:,:)=PVM(IIE+1,:,:) - ZWM(IIE+1,:,:)=PWM(IIE+1,:,:) - ZTHLM(IIE+1,:,:)=PTHLM(IIE+1,:,:) - ZTKEM(IIE+1,:,:)=PTKEM(IIE+1,:,:) - IF (ISV>0) ZSVM(IIE+1,:,:,:)=PSVM(IIE+1,:,:,:) - IF (KRR>0) ZRM (IIE+1,:,:,:)=PRM(IIE+1,:,:,:) - ENDIF - ! - IF ( HLBCY(1) /= "CYCL" .AND. LSOUTH_ll()) THEN - ZUM(:,IJB-1,:)=PUM(:,IJB-1,:) - ZVM(:,IJB ,:)=PVM(:,IJB ,:) - ZWM(:,IJB-1,:)=PWM(:,IJB-1,:) - ZTHLM(:,IJB-1,:)=PTHLM(:,IJB-1,:) - ZTKEM(:,IJB-1,:)=PTKEM(:,IJB-1,:) - IF (ISV>0) ZSVM(:,IJB-1,:,:)=PSVM(:,IJB-1,:,:) - IF (KRR>0) ZRM (:,IJB-1,:,:)=PRM (:,IJB-1,:,:) - ENDIF - ! - IF ( HLBCY(2) /= "CYCL" .AND. LNORTH_ll()) THEN - ZUM(:,IJE+1,:)=PUM(:,IJE+1,:) - ZVM(:,IJE+1,:)=PVM(:,IJE+1,:) - ZWM(:,IJE+1,:)=PWM(:,IJE+1,:) - ZTHLM(:,IJE+1,:)=PTHLM(:,IJE+1,:) - ZTKEM(:,IJE+1,:)=PTKEM(:,IJE+1,:) - IF (ISV>0) ZSVM(:,IJE+1,:,:)=PSVM(:,IJE+1,:,:) - IF (KRR>0) ZRM (:,IJE+1,:,:)=PRM(:,IJE+1,:,:) - ENDIF - ! - ZUM(:,:,IKB-1)=ZUM(:,:,IKB) - ZVM(:,:,IKB-1)=ZVM(:,:,IKB) - ZWM(:,:,IKB-1)=ZWM(:,:,IKB) - ZTHLM(:,:,IKB-1)=ZTHLM(:,:,IKB) - ZTKEM(:,:,IKB-1)=ZTKEM(:,:,IKB) - IF (ISV>0) ZSVM(:,:,IKB-1,:)=ZSVM(:,:,IKB,:) - IF (KRR>0) ZRM (:,:,IKB-1,:)=ZRM (:,:,IKB,:) - ! - ZUM(:,:,IKE+1)=ZUM(:,:,IKE) - ZVM(:,:,IKE+1)=ZVM(:,:,IKE) - ZWM(:,:,IKE+1)=ZWM(:,:,IKE) - ZTHLM(:,:,IKE+1)=ZTHLM(:,:,IKE) - ZTKEM(:,:,IKE+1)=ZTKEM(:,:,IKE) - IF (ISV>0) ZSVM(:,:,IKE+1,:)=ZSVM(:,:,IKE,:) - IF (KRR>0) ZRM (:,:,IKE+1,:)=ZRM (:,:,IKE,:) - ! - END DO -! -!* 2.5 update the complete tendencies -! ------------------------------ -! - PRUS=ZRUS/KSPLIT - PRVS=ZRVS/KSPLIT - PRWS=ZRWS/KSPLIT - IF (ISV>0) PRSVS=ZRSVS/KSPLIT - PRTHLS=ZRTHLS/KSPLIT - IF (KRR>0) PRRS=ZRRS/KSPLIT - PTRH=(ZTKEM-PTKEM)/PTSTEP -! -!* 2.6 deallocations -! ------------- -! - DEALLOCATE(ZUM) - DEALLOCATE(ZVM) - DEALLOCATE(ZWM) - DEALLOCATE(ZSVM) - DEALLOCATE(ZTHLM) - DEALLOCATE(ZTKEM) - DEALLOCATE(ZRM) - DEALLOCATE(ZRUS) - DEALLOCATE(ZRVS) - DEALLOCATE(ZRWS) - DEALLOCATE(ZRSVS) - DEALLOCATE(ZRTHLS) - DEALLOCATE(ZRRS) - ! - CALL CLEANLIST_ll(TZFIELDS_ll) -! -!------------------------------------------------------------------- -! -!* 4. NO SPLIT PROCESS CASE -! --------------------- -! -ELSE -! - CALL TURB_HOR(1, KRR, KRRL, KRRI, PTSTEP, & - OTURB_FLX,OSUBG_COND, & - TPFILE, & - PDXX,PDYY,PDZZ,PDZX,PDZY,PZZ, & - PDIRCOSXW,PDIRCOSYW,PDIRCOSZW, & - PCOSSLOPE,PSINSLOPE, & - ZINV_PDXX, ZINV_PDYY, ZINV_PDZZ, ZMZM_PRHODJ, & - ZK, & - PRHODJ,PTHVREF, & - PSFTHM,PSFRM,PSFSVM, & - PCDUEFF,PTAU11M,PTAU12M,PTAU22M,PTAU33M, & - PUM,PVM,PWM,PUSLOPEM,PVSLOPEM,PTHLM,PRM,PSVM, & - PTKEM,PLM,PLEPS, & - PLOCPEXNM,PATHETA,PAMOIST,PSRCM,PFRAC_ICE, & - PDP,PTP,PSIGS, & - PRUS,PRVS,PRWS,PRTHLS,PRRS,PRSVS ) - -! horizontal transport of Tke -! - - CALL TURB_HOR_TKE(1, & - PDXX,PDYY,PDZZ,PDZX,PDZY, & - ZINV_PDXX, ZINV_PDYY, ZINV_PDZZ, ZMZM_PRHODJ, & - ZK, PRHODJ, PTKEM, & - PTRH ) -! -END IF -!-------------------------------------------------------------------- -! -DEALLOCATE(ZK) -DEALLOCATE(ZINV_PDXX) -DEALLOCATE(ZINV_PDYY) -DEALLOCATE(ZINV_PDZZ) -DEALLOCATE(ZMZM_PRHODJ) -! -END SUBROUTINE TURB_HOR_SPLT diff --git a/src/mesonh/turb/turb_hor_sv_corr.f90 b/src/mesonh/turb/turb_hor_sv_corr.f90 deleted file mode 100644 index f9f4b2da7..000000000 --- a/src/mesonh/turb/turb_hor_sv_corr.f90 +++ /dev/null @@ -1,218 +0,0 @@ -!MNH_LIC Copyright 2002-2020 CNRS, Meteo-France and Universite Paul Sabatier -!MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence -!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt -!MNH_LIC for details. version 1. -!----------------------------------------------------------------- -! ############################ - MODULE MODI_TURB_HOR_SV_CORR -! ############################ -! -INTERFACE -! - SUBROUTINE TURB_HOR_SV_CORR(KRR,KRRL,KRRI, & - PDXX,PDYY,PDZZ,PDZX,PDZY, & - PLM,PLEPS,PTKEM,PTHVREF, & - PTHLM,PRM, & - PLOCPEXNM,PATHETA,PAMOIST,PSRCM, & - PWM,PSVM ) -! -INTEGER, INTENT(IN) :: KRR ! number of moist var. -INTEGER, INTENT(IN) :: KRRL ! number of liquid var. -INTEGER, INTENT(IN) :: KRRI ! number of ice var. -REAL, DIMENSION(:,:,:), INTENT(IN) :: PDXX, PDYY, PDZZ, PDZX, PDZY - ! Metric coefficients -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLM ! mixing length -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLEPS ! dissipative length -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTKEM ! tke -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHVREF ! reference Thv -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHLM ! potential temperature at t-Delta t -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRM ! Mixing ratios at t-Delta t -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLOCPEXNM ! Lv(T)/Cp/Exnref at time t-1 -REAL, DIMENSION(:,:,:), INTENT(IN) :: PATHETA ! coefficients between -REAL, DIMENSION(:,:,:), INTENT(IN) :: PAMOIST ! s and Thetal and Rnp -REAL, DIMENSION(:,:,:), INTENT(IN) :: PSRCM ! normalized - ! 2nd-order flux s'r'c/2Sigma_s2 at t-1 multiplied by Lambda_3 -REAL, DIMENSION(:,:,:), INTENT(IN) :: PWM ! w at t-1 -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PSVM ! scalar var. at t-1 -! -! -END SUBROUTINE TURB_HOR_SV_CORR -! -END INTERFACE -! -END MODULE MODI_TURB_HOR_SV_CORR -! ################################################################ - SUBROUTINE TURB_HOR_SV_CORR(KRR,KRRL,KRRI, & - PDXX,PDYY,PDZZ,PDZX,PDZY, & - PLM,PLEPS,PTKEM,PTHVREF, & - PTHLM,PRM, & - PLOCPEXNM,PATHETA,PAMOIST,PSRCM, & - PWM,PSVM ) -! ################################################################ -! -! -!!**** *TURB_HOT_SV_CORR* computes subgrid Sv2 and SvThv terms -!! -!! PURPOSE -!! ------- -!! -!! see TURB_HOR -!! -!!** METHOD -!! ------ -!! -!! EXTERNAL -!! -------- -!! -!! IMPLICIT ARGUMENTS -!! ------------------ -!! -!! REFERENCE -!! --------- -!! -!! AUTHOR -!! ------ -!! -!! V. Masson * Meteo-France * -!! -!! MODIFICATIONS -!! ------------- -!! Original 06/11/02 -!! JP Pinty Feb 20, 2003 Add PFRAC_ICE -!! -------------------------------------------------------------------------- -! -!* 0. DECLARATIONS -! ------------ -! -USE MODD_CST -USE MODD_CONF -USE MODD_CTURB -USE MODD_PARAMETERS -USE MODD_NSV, ONLY : NSV,NSV_LGBEG,NSV_LGEND -USE MODD_LES -USE MODD_BLOWSNOW -! -USE MODI_GRADIENT_M -USE MODI_GRADIENT_U -USE MODI_GRADIENT_V -USE MODI_GRADIENT_W -USE MODI_SHUMAN -USE MODI_LES_MEAN_SUBGRID -USE MODE_EMOIST -USE MODE_ETHETA -! -USE MODI_SECOND_MNH -! -IMPLICIT NONE -! -! -!* 0.1 declaration of arguments -! -! -! -INTEGER, INTENT(IN) :: KRR ! number of moist var. -INTEGER, INTENT(IN) :: KRRL ! number of liquid var. -INTEGER, INTENT(IN) :: KRRI ! number of ice var. -REAL, DIMENSION(:,:,:), INTENT(IN) :: PDXX, PDYY, PDZZ, PDZX, PDZY - ! Metric coefficients -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLM ! mixing length -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLEPS ! dissipative length -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTKEM ! tke -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHVREF ! reference Thv -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHLM ! potential temperature at t-Delta t -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRM ! Mixing ratios at t-Delta t -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLOCPEXNM ! Lv(T)/Cp/Exnref at time t-1 -REAL, DIMENSION(:,:,:), INTENT(IN) :: PATHETA ! coefficients between -REAL, DIMENSION(:,:,:), INTENT(IN) :: PAMOIST ! s and Thetal and Rnp -REAL, DIMENSION(:,:,:), INTENT(IN) :: PSRCM ! normalized - ! 2nd-order flux s'r'c/2Sigma_s2 at t-1 multiplied by Lambda_3 -REAL, DIMENSION(:,:,:), INTENT(IN) :: PWM ! w at t-1 -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PSVM ! scalar var. at t-1 -! -! -! -!* 0.2 declaration of local variables -! -REAL, DIMENSION(SIZE(PSVM,1),SIZE(PSVM,2),SIZE(PSVM,3)) & - :: ZFLX, ZA -! -INTEGER :: JSV ! loop counter -! -REAL :: ZTIME1, ZTIME2 -! -REAL :: ZCSVD = 1.2 ! constant for scalar variance dissipation -REAL :: ZCTSVD = 2.4 ! constant for temperature - scalar covariance dissipation -REAL :: ZCQSVD = 2.4 ! constant for humidity - scalar covariance dissipation -! -REAL :: ZCSV !constant for the scalar flux -! --------------------------------------------------------------------------- -! -CALL SECOND_MNH(ZTIME1) -! -IF(LBLOWSNOW) THEN -! See Vionnet (PhD, 2012) for a complete discussion around the value of the Schmidt number for blowing snow variables - ZCSV= XCHF/XRSNOW -ELSE - ZCSV= XCHF -ENDIF -! -DO JSV=1,NSV -! - IF (LNOMIXLG .AND. JSV >= NSV_LGBEG .AND. JSV<= NSV_LGEND) CYCLE - ! - ! variance Sv2 - ! - IF (LLES_CALL) THEN - IF (.NOT. L2D) THEN - ZFLX(:,:,:) = ZCSV / ZCSVD * PLM(:,:,:) * PLEPS(:,:,:) * & - ( GX_M_M(PSVM(:,:,:,JSV),PDXX,PDZZ,PDZX)**2 & - + GY_M_M(PSVM(:,:,:,JSV),PDYY,PDZZ,PDZY)**2 ) - ELSE - ZFLX(:,:,:) = ZCSV / ZCSVD * PLM(:,:,:) * PLEPS(:,:,:) * & - GX_M_M(PSVM(:,:,:,JSV),PDXX,PDZZ,PDZX)**2 - END IF - CALL LES_MEAN_SUBGRID( -2.*ZCSVD*SQRT(PTKEM)*ZFLX/PLEPS, & - X_LES_SUBGRID_DISS_Sv2(:,:,:,JSV), .TRUE. ) - CALL LES_MEAN_SUBGRID( MZF(PWM)*ZFLX, X_LES_RES_W_SBG_Sv2(:,:,:,JSV), .TRUE. ) - END IF - ! - ! covariance SvThv - ! - IF (LLES_CALL) THEN - ZA(:,:,:) = ETHETA(KRR,KRRI,PTHLM,PRM,PLOCPEXNM,PATHETA,PSRCM) - IF (.NOT. L2D) THEN - ZFLX(:,:,:)= PLM(:,:,:) * PLEPS(:,:,:) & - * ( GX_M_M(PTHLM,PDXX,PDZZ,PDZX) * GX_M_M(PSVM(:,:,:,JSV),PDXX,PDZZ,PDZX) & - + GY_M_M(PTHLM,PDYY,PDZZ,PDZY) * GY_M_M(PSVM(:,:,:,JSV),PDYY,PDZZ,PDZY) & - ) * (XCSHF+ZCSV) / (2.*ZCTSVD) - ELSE - ZFLX(:,:,:)= PLM(:,:,:) * PLEPS(:,:,:) & - * GX_M_M(PTHLM,PDXX,PDZZ,PDZX) * GX_M_M(PSVM(:,:,:,JSV),PDXX,PDZZ,PDZX) & - * (XCSHF+ZCSV) / (2.*ZCTSVD) - END IF - CALL LES_MEAN_SUBGRID( ZA*ZFLX, X_LES_SUBGRID_SvThv(:,:,:,JSV) , .TRUE.) - CALL LES_MEAN_SUBGRID( -XG/PTHVREF/3.*ZA*ZFLX, X_LES_SUBGRID_SvPz(:,:,:,JSV), .TRUE. ) - ! - IF (KRR>=1) THEN - ZA(:,:,:) = EMOIST(KRR,KRRI,PTHLM,PRM,PLOCPEXNM,PAMOIST,PSRCM) - IF (.NOT. L2D) THEN - ZFLX(:,:,:)= PLM(:,:,:) * PLEPS(:,:,:) & - * ( GX_M_M(PRM(:,:,:,1),PDXX,PDZZ,PDZX) * GX_M_M(PSVM(:,:,:,JSV),PDXX,PDZZ,PDZX) & - + GY_M_M(PRM(:,:,:,1),PDYY,PDZZ,PDZY) * GY_M_M(PSVM(:,:,:,JSV),PDYY,PDZZ,PDZY) & - ) * (XCHF+ZCSV) / (2.*ZCQSVD) - ELSE - ZFLX(:,:,:)= PLM(:,:,:) * PLEPS(:,:,:) & - * GX_M_M(PRM(:,:,:,1),PDXX,PDZZ,PDZX) * GX_M_M(PSVM(:,:,:,JSV),PDXX,PDZZ,PDZX) & - * (XCHF+ZCSV) / (2.*ZCQSVD) - END IF - CALL LES_MEAN_SUBGRID( ZA*ZFLX, X_LES_SUBGRID_SvThv(:,:,:,JSV) , .TRUE.) - CALL LES_MEAN_SUBGRID( -XG/PTHVREF/3.*ZA*ZFLX, X_LES_SUBGRID_SvPz(:,:,:,JSV), .TRUE. ) - END IF - END IF -! -END DO ! end loop JSV -! -CALL SECOND_MNH(ZTIME2) -XTIME_LES = XTIME_LES + ZTIME2 - ZTIME1 -! -END SUBROUTINE TURB_HOR_SV_CORR diff --git a/src/mesonh/turb/turb_hor_sv_flux.f90 b/src/mesonh/turb/turb_hor_sv_flux.f90 deleted file mode 100644 index 163ee3d02..000000000 --- a/src/mesonh/turb/turb_hor_sv_flux.f90 +++ /dev/null @@ -1,364 +0,0 @@ -!MNH_LIC Copyright 1994-2021 CNRS, Meteo-France and Universite Paul Sabatier -!MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence -!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt -!MNH_LIC for details. version 1. -!----------------------------------------------------------------- -! ############################ - MODULE MODI_TURB_HOR_SV_FLUX -! ############################ -! -INTERFACE -! - SUBROUTINE TURB_HOR_SV_FLUX(KSPLT, & - OTURB_FLX, & - TPFILE, & - PK,PINV_PDXX,PINV_PDYY,PINV_PDZZ,PMZM_PRHODJ, & - PDXX,PDYY,PDZZ,PDZX,PDZY, & - PDIRCOSXW,PDIRCOSYW, & - PRHODJ,PWM, & - PSFSVM, & - PSVM, & - PRSVS ) -! -USE MODD_IO, ONLY: TFILEDATA -! -INTEGER, INTENT(IN) :: KSPLT ! split process index -LOGICAL, INTENT(IN) :: OTURB_FLX ! switch to write the - ! turbulent fluxes in the syncronous FM-file -TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! Output file -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PK ! Turbulent diffusion doef. - ! PK = PLM * SQRT(PTKEM) -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDXX ! 1./PDXX -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDYY ! 1./PDYY -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDZZ ! 1./PDZZ -REAL, DIMENSION(:,:,:), INTENT(IN) :: PMZM_PRHODJ ! MZM(PRHODJ) -REAL, DIMENSION(:,:,:), INTENT(IN) :: PDXX, PDYY, PDZZ, PDZX, PDZY - ! Metric coefficients -REAL, DIMENSION(:,:), INTENT(IN) :: PDIRCOSXW, PDIRCOSYW -! Director Cosinus along x and y directions at surface w-point -REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! density * grid volume -REAL, DIMENSION(:,:,:), INTENT(IN) :: PWM ! vertical wind -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PSFSVM ! surface fluxes -! -! -! Variables at t-1 -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PSVM ! scalar var. at t-1 -! -REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRSVS ! var. at t+1 -split- -! -! -! -END SUBROUTINE TURB_HOR_SV_FLUX -! -END INTERFACE -! -END MODULE MODI_TURB_HOR_SV_FLUX -! ################################################################ - SUBROUTINE TURB_HOR_SV_FLUX(KSPLT, & - OTURB_FLX, & - TPFILE, & - PK,PINV_PDXX,PINV_PDYY,PINV_PDZZ,PMZM_PRHODJ, & - PDXX,PDYY,PDZZ,PDZX,PDZY, & - PDIRCOSXW,PDIRCOSYW, & - PRHODJ,PWM, & - PSFSVM, & - PSVM, & - PRSVS ) -! ################################################################ -! -! -!!**** *TURB_HOR* -routine to compute the source terms in the meso-NH -!! model equations due to the non-vertical turbulent fluxes. -!! -!! PURPOSE -!! ------- -!! -!! see TURB_HOR -!! -!!** METHOD -!! ------ -!! -!! EXTERNAL -!! -------- -!! -!! IMPLICIT ARGUMENTS -!! ------------------ -!! -!! REFERENCE -!! --------- -!! -!! AUTHOR -!! ------ -!! -!! Joan Cuxart * INM and Meteo-France * -!! -!! MODIFICATIONS -!! ------------- -!! Aug , 1997 (V. Saravane) spliting of TURB_HOR -!! Nov 27, 1997 (V. Masson) clearing of the routine -!! Oct 18, 2000 (V. Masson) LES computations + LFLAT swith -!! + bug on Y scalar flux -!! Jun 20, 2001 (J Stein) case of lagragian variables -!! Nov 06, 2002 (V. Masson) LES budgets -!! October 2009 (G. Tanguy) add ILENCH=LEN(YCOMMENT) after -!! change of YCOMMENT -!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O -!! -------------------------------------------------------------------------- -! -!* 0. DECLARATIONS -! ------------ -! -USE MODD_CST -USE MODD_CONF -USE MODD_CTURB -use modd_field, only: tfielddata, TYPEREAL -USE MODD_IO, ONLY: TFILEDATA -USE MODD_PARAMETERS -USE MODD_NSV, ONLY: NSV_LGBEG, NSV_LGEND -USE MODD_LES -USE MODD_BLOWSNOW -! -USE MODE_IO_FIELD_WRITE, only: IO_Field_write -! -USE MODI_GRADIENT_M -USE MODI_GRADIENT_U -USE MODI_GRADIENT_V -USE MODI_GRADIENT_W -USE MODI_SHUMAN -USE MODI_COEFJ -USE MODI_LES_MEAN_SUBGRID -! -USE MODI_SECOND_MNH -! -IMPLICIT NONE -! -! -!* 0.1 declaration of arguments -! -! -! -INTEGER, INTENT(IN) :: KSPLT ! split process index -LOGICAL, INTENT(IN) :: OTURB_FLX ! switch to write the - ! turbulent fluxes in the syncronous FM-file -TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! Output file -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PK ! Turbulent diffusion doef. - ! PK = PLM * SQRT(PTKEM) -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDXX ! 1./PDXX -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDYY ! 1./PDYY -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDZZ ! 1./PDZZ -REAL, DIMENSION(:,:,:), INTENT(IN) :: PMZM_PRHODJ ! MZM(PRHODJ) -REAL, DIMENSION(:,:,:), INTENT(IN) :: PDXX, PDYY, PDZZ, PDZX, PDZY - ! Metric coefficients -REAL, DIMENSION(:,:), INTENT(IN) :: PDIRCOSXW, PDIRCOSYW -! Director Cosinus along x and y directions at surface w-point -REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! density * grid volume -REAL, DIMENSION(:,:,:), INTENT(IN) :: PWM ! vertical wind -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PSFSVM ! surface fluxes -! -! -! Variables at t-1 -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PSVM ! scalar var. at t-1 -! -REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRSVS ! var. at t+1 -split- -! -! -! -!* 0.2 declaration of local variables -! -REAL, DIMENSION(SIZE(PSVM,1),SIZE(PSVM,2),SIZE(PSVM,3)) & - :: ZFLXX,ZFLXY - ! work arrays -REAL, DIMENSION(SIZE(PSVM,1),SIZE(PSVM,2),1) :: ZWORK2D -! -REAL :: ZCSV !constant for the scalar flux - -INTEGER :: IKB,IKE - ! Index values for the Beginning and End - ! mass points of the domain -INTEGER :: JSV ! loop counter -INTEGER :: ISV ! number of scalar var. -REAL, DIMENSION(SIZE(PDZZ,1),SIZE(PDZZ,2),1+JPVEXT:3+JPVEXT) :: ZCOEFF - ! coefficients for the uncentred gradient - ! computation near the ground -! -INTEGER :: IKU -TYPE(TFIELDDATA) :: TZFIELD -REAL :: ZTIME1, ZTIME2 -! --------------------------------------------------------------------------- -! -!* 1. PRELIMINARY COMPUTATIONS -! ------------------------ -! -IKB = 1+JPVEXT -IKE = SIZE(PSVM,3)-JPVEXT -IKU = SIZE(PSVM,3) -! -ISV = SIZE(PSVM,4) -! -IF(LBLOWSNOW) THEN -! See Vionnet (PhD, 2012) for a complete discussion around the value of the Schmidt number for blowing snow variables - ZCSV= XCHF/XRSNOW -ELSE - ZCSV= XCHF -ENDIF -! -! compute the coefficients for the uncentred gradient computation near the -! ground -ZCOEFF(:,:,IKB+2)= - PDZZ(:,:,IKB+1) / & - ( (PDZZ(:,:,IKB+2)+PDZZ(:,:,IKB+1)) * PDZZ(:,:,IKB+2) ) -ZCOEFF(:,:,IKB+1)= (PDZZ(:,:,IKB+2)+PDZZ(:,:,IKB+1)) / & - ( PDZZ(:,:,IKB+1) * PDZZ(:,:,IKB+2) ) -ZCOEFF(:,:,IKB)= - (PDZZ(:,:,IKB+2)+2.*PDZZ(:,:,IKB+1)) / & - ( (PDZZ(:,:,IKB+2)+PDZZ(:,:,IKB+1)) * PDZZ(:,:,IKB+1) ) -! -! -!* 15. HORIZONTAL FLUXES OF PASSIVE SCALARS -! ------------------------------------ -! -! -DO JSV=1,ISV -! - IF (LNOMIXLG .AND. JSV >= NSV_LGBEG .AND. JSV<= NSV_LGEND) CYCLE -! -! 15.1 <U' SVth'> -! ---------- -! - ! Computes the flux in the X direction - ZFLXX(:,:,:) = -ZCSV * MXM(PK) * GX_M_U(1,IKU,1,PSVM(:,:,:,JSV),PDXX,PDZZ,PDZX) - ZFLXX(:,:,IKE+1) = ZFLXX(:,:,IKE) -! -! Compute the flux at the first inner U-point with an uncentred vertical -! gradient - ZFLXX(:,:,IKB:IKB) = -ZCSV * MXM( PK(:,:,IKB:IKB) ) * & - ( DXM(PSVM(:,:,IKB:IKB,JSV)) * PINV_PDXX(:,:,IKB:IKB) & - -MXM ( ZCOEFF(:,:,IKB+2:IKB+2)*PSVM(:,:,IKB+2:IKB+2,JSV) & - +ZCOEFF(:,:,IKB+1:IKB+1)*PSVM(:,:,IKB+1:IKB+1,JSV) & - +ZCOEFF(:,:,IKB :IKB )*PSVM(:,:,IKB :IKB ,JSV) & - ) * 0.5 * ( PDZX(:,:,IKB+1:IKB+1)+PDZX(:,:,IKB:IKB) ) & - * PINV_PDXX(:,:,IKB:IKB) & - ) -! extrapolates the flux under the ground so that the vertical average with -! the IKB flux gives the ground value - ZWORK2D(:,:,1)=PSFSVM(:,:,JSV) * PDIRCOSXW(:,:) - ZFLXX(:,:,IKB-1:IKB-1) = 2. * MXM( ZWORK2D(:,:,1:1) ) - ZFLXX(:,:,IKB:IKB) - ! - ! stores <U SVth> - IF ( tpfile%lopened .AND. OTURB_FLX ) THEN - WRITE(TZFIELD%CMNHNAME,'("USV_FLX_",I3.3)') JSV - TZFIELD%CSTDNAME = '' - TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) - TZFIELD%CUNITS = 'SVUNIT m s-1' - TZFIELD%CDIR = 'XY' - TZFIELD%CCOMMENT = 'X_Y_Z_'//TRIM(TZFIELD%CMNHNAME) - TZFIELD%NGRID = 2 - TZFIELD%NTYPE = TYPEREAL - TZFIELD%NDIMS = 3 - TZFIELD%LTIMEDEP = .TRUE. - CALL IO_Field_write(TPFILE,TZFIELD,ZFLXX) - END IF -! - IF (LLES_CALL .AND. KSPLT==1) THEN - CALL SECOND_MNH(ZTIME1) - CALL LES_MEAN_SUBGRID( MXF(ZFLXX), X_LES_SUBGRID_USv(:,:,:,JSV) ) - CALL LES_MEAN_SUBGRID( MZF(MXF(GX_W_UW(PWM,PDXX,PDZZ,PDZX)*MZM(ZFLXX))), & - X_LES_RES_ddxa_W_SBG_UaSv(:,:,:,JSV) , .TRUE. ) - CALL LES_MEAN_SUBGRID( GX_M_M(PSVM(:,:,:,JSV),PDXX,PDZZ,PDZX)*MXF(ZFLXX), & - X_LES_RES_ddxa_Sv_SBG_UaSv(:,:,:,JSV), .TRUE. ) - CALL SECOND_MNH(ZTIME2) - XTIME_LES = XTIME_LES + ZTIME2 - ZTIME1 - END IF -! -! 15.2 <V' SVth'> -! ---------- -! - IF (.NOT. L2D) THEN -! -! Computes the flux in the Y direction - ZFLXY(:,:,:)=-ZCSV * MYM(PK) * GY_M_V(1,IKU,1,PSVM(:,:,:,JSV),PDYY,PDZZ,PDZY) - ZFLXY(:,:,IKE+1) = ZFLXY(:,:,IKE) -! -! Compute the flux at the first inner V-point with an uncentred vertical -! gradient -! - ZFLXY(:,:,IKB:IKB) = -ZCSV * MYM( PK(:,:,IKB:IKB) ) * & - ( DYM(PSVM(:,:,IKB:IKB,JSV)) * PINV_PDYY(:,:,IKB:IKB) & - -MYM ( ZCOEFF(:,:,IKB+2:IKB+2)*PSVM(:,:,IKB+2:IKB+2,JSV) & - +ZCOEFF(:,:,IKB+1:IKB+1)*PSVM(:,:,IKB+1:IKB+1,JSV) & - +ZCOEFF(:,:,IKB :IKB )*PSVM(:,:,IKB :IKB ,JSV) & - ) * 0.5 * ( PDZY(:,:,IKB+1:IKB+1)+PDZY(:,:,IKB:IKB) ) & - * PINV_PDYY(:,:,IKB:IKB) & - ) -! extrapolates the flux under the ground so that the vertical average with -! the IKB flux gives the ground value - ZWORK2D(:,:,1)=PSFSVM(:,:,JSV) * PDIRCOSYW(:,:) - ZFLXY(:,:,IKB-1:IKB-1) = 2. * MYM( ZWORK2D(:,:,1:1) ) - ZFLXY(:,:,IKB:IKB) - ! - ! stores <V SVth> - IF ( tpfile%lopened .AND. OTURB_FLX ) THEN - WRITE(TZFIELD%CMNHNAME,'("VSV_FLX_",I3.3)') JSV - TZFIELD%CSTDNAME = '' - TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) - TZFIELD%CUNITS = 'SVUNIT m s-1' - TZFIELD%CDIR = 'XY' - TZFIELD%CCOMMENT = 'X_Y_Z_'//TRIM(TZFIELD%CMNHNAME) - TZFIELD%NGRID = 3 - TZFIELD%NTYPE = TYPEREAL - TZFIELD%NDIMS = 3 - TZFIELD%LTIMEDEP = .TRUE. - CALL IO_Field_write(TPFILE,TZFIELD,ZFLXY) - END IF -! - ELSE - ZFLXY=0. - END IF -! - IF (LLES_CALL .AND. KSPLT==1) THEN - CALL SECOND_MNH(ZTIME1) - CALL LES_MEAN_SUBGRID( MYF(ZFLXY), X_LES_SUBGRID_VSv(:,:,:,JSV) ) - CALL LES_MEAN_SUBGRID( MZF(MYF(GY_W_VW(PWM,PDYY,PDZZ,PDZY)*MZM(ZFLXY))), & - X_LES_RES_ddxa_W_SBG_UaSv(:,:,:,JSV) , .TRUE. ) - CALL LES_MEAN_SUBGRID( GY_M_M(PSVM(:,:,:,JSV),PDYY,PDZZ,PDZY)*MYF(ZFLXY), & - X_LES_RES_ddxa_Sv_SBG_UaSv(:,:,:,JSV) , .TRUE. ) - CALL SECOND_MNH(ZTIME2) - XTIME_LES = XTIME_LES + ZTIME2 - ZTIME1 - END IF -! -! -! 15.3 Horizontal source terms -! ----------------------- -! - IF (.NOT. L2D) THEN - IF (.NOT. LFLAT) THEN - PRSVS(:,:,:,JSV)= PRSVS(:,:,:,JSV) & - -DXF( MXM(PRHODJ) * ZFLXX * PINV_PDXX ) & - -DYF( MYM(PRHODJ) * ZFLXY * PINV_PDYY ) & - +DZF( PMZM_PRHODJ * PINV_PDZZ * & - ( MXF( MZM(ZFLXX * PINV_PDXX) * PDZX ) + MYF( MZM(ZFLXY * PINV_PDYY) * PDZY ) ) & - ) - ELSE - PRSVS(:,:,:,JSV)= PRSVS(:,:,:,JSV) & - -DXF( MXM(PRHODJ) * ZFLXX * PINV_PDXX ) & - -DYF( MYM(PRHODJ) * ZFLXY * PINV_PDYY ) - END IF - ELSE - IF (.NOT. LFLAT) THEN - PRSVS(:,:,:,JSV)= PRSVS(:,:,:,JSV) & - -DXF( MXM(PRHODJ) * ZFLXX * PINV_PDXX ) & - +DZF( PMZM_PRHODJ * PINV_PDZZ * & - ( MXF( MZM(ZFLXX * PINV_PDXX) * PDZX ) ) & - ) - ELSE - PRSVS(:,:,:,JSV)= PRSVS(:,:,:,JSV) & - -DXF( MXM(PRHODJ) *ZFLXX * PINV_PDXX ) - END IF - END IF -! -! -END DO ! end loop JSV -! -! -END SUBROUTINE TURB_HOR_SV_FLUX diff --git a/src/mesonh/turb/turb_hor_thermo_corr.f90 b/src/mesonh/turb/turb_hor_thermo_corr.f90 deleted file mode 100644 index cf29a349b..000000000 --- a/src/mesonh/turb/turb_hor_thermo_corr.f90 +++ /dev/null @@ -1,468 +0,0 @@ -!MNH_LIC Copyright 1994-2021 CNRS, Meteo-France and Universite Paul Sabatier -!MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence -!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt -!MNH_LIC for details. version 1. -!----------------------------------------------------------------- -! ################################ - MODULE MODI_TURB_HOR_THERMO_CORR -! ################################ -! -INTERFACE -! - SUBROUTINE TURB_HOR_THERMO_CORR(KRR, KRRL, KRRI, & - OTURB_FLX,OSUBG_COND, & - TPFILE, & - PINV_PDXX,PINV_PDYY, & - PDXX,PDYY,PDZZ,PDZX,PDZY, & - PTHVREF, & - PWM,PTHLM,PRM, & - PTKEM,PLM,PLEPS, & - PLOCPEXNM,PATHETA,PAMOIST,PSRCM, & - PSIGS ) -! -USE MODD_IO, ONLY: TFILEDATA -! -INTEGER, INTENT(IN) :: KRR ! number of moist var. -INTEGER, INTENT(IN) :: KRRL ! number of liquid water var. -INTEGER, INTENT(IN) :: KRRI ! number of ice water var. -LOGICAL, INTENT(IN) :: OTURB_FLX ! switch to write the - ! turbulent fluxes in the syncronous FM-file -LOGICAL, INTENT(IN) :: OSUBG_COND ! Switch for sub-grid -! condensation -TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! Output file -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDXX ! 1./PDXX -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDYY ! 1./PDYY -REAL, DIMENSION(:,:,:), INTENT(IN) :: PDXX, PDYY, PDZZ, PDZX, PDZY - ! Metric coefficients -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHVREF ! ref. state Virtual - ! Potential Temperature -! -! Variables at t-1 -REAL, DIMENSION(:,:,:), INTENT(IN) :: PWM -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHLM -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRM ! mixing ratios at t-1, - ! where PRM(:,:,:,1) = conservative mixing ratio -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTKEM ! Turb. Kin. Energy -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLM ! Turb. mixing length -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLEPS ! dissipative length -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLOCPEXNM ! Lv(T)/Cp/Exnref at time t-1 -REAL, DIMENSION(:,:,:), INTENT(IN) :: PATHETA ! coefficients between -REAL, DIMENSION(:,:,:), INTENT(IN) :: PAMOIST ! s and Thetal and Rnp -REAL, DIMENSION(:,:,:), INTENT(IN) :: PSRCM ! normalized - ! 2nd-order flux s'r'c/2Sigma_s2 at t-1 multiplied by Lambda_3 -! -! -REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PSIGS - ! IN: Vertical part of Sigma_s at t - ! OUT: Total Sigma_s at t -! -! -! -END SUBROUTINE TURB_HOR_THERMO_CORR -! -END INTERFACE -! -END MODULE MODI_TURB_HOR_THERMO_CORR -! ################################################################ - SUBROUTINE TURB_HOR_THERMO_CORR(KRR, KRRL, KRRI, & - OTURB_FLX,OSUBG_COND, & - TPFILE, & - PINV_PDXX,PINV_PDYY, & - PDXX,PDYY,PDZZ,PDZX,PDZY, & - PTHVREF, & - PWM,PTHLM,PRM, & - PTKEM,PLM,PLEPS, & - PLOCPEXNM,PATHETA,PAMOIST,PSRCM, & - PSIGS ) -! ################################################################ -! -! -!!**** *TURB_HOR* -routine to compute the source terms in the meso-NH -!! model equations due to the non-vertical turbulent fluxes. -!! -!! PURPOSE -!! ------- -!! -!! see TURB_HOR -!! -!!** METHOD -!! ------ -!! -!! EXTERNAL -!! -------- -!! -!! IMPLICIT ARGUMENTS -!! ------------------ -!! -!! REFERENCE -!! --------- -!! -!! AUTHOR -!! ------ -!! -!! Joan Cuxart * INM and Meteo-France * -!! -!! MODIFICATIONS -!! ------------- -!! Aug , 1997 (V. Saravane) spliting of TURB_HOR -!! Nov 27, 1997 (V. Masson) clearing of the routine -!! Nov 06, 2002 (V. Masson) LES budgets -!! Feb 20, 2003 (JP Pinty) Add PFRAC_ICE -!! October 2009 (G. Tanguy) add ILENCH=LEN(YCOMMENT) after -!! change of YCOMMENT -!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O -!! -------------------------------------------------------------------------- -! -!* 0. DECLARATIONS -! ------------ -! -USE MODD_CST -USE MODD_CONF -USE MODD_CTURB -use modd_field, only: tfielddata, TYPEREAL -USE MODD_IO, ONLY: TFILEDATA -USE MODD_PARAMETERS -USE MODD_LES -! -USE MODE_IO_FIELD_WRITE, only: IO_Field_write -! -USE MODI_GRADIENT_M -USE MODI_GRADIENT_U -USE MODI_GRADIENT_V -USE MODI_GRADIENT_W -USE MODI_SHUMAN -USE MODI_LES_MEAN_SUBGRID -! -USE MODE_EMOIST -USE MODE_ETHETA -! -USE MODI_SECOND_MNH -! -IMPLICIT NONE -! -! -!* 0.1 declaration of arguments -! -! -! -INTEGER, INTENT(IN) :: KRR ! number of moist var. -INTEGER, INTENT(IN) :: KRRL ! number of liquid water var. -INTEGER, INTENT(IN) :: KRRI ! number of ice water var. -LOGICAL, INTENT(IN) :: OTURB_FLX ! switch to write the - ! turbulent fluxes in the syncronous FM-file -LOGICAL, INTENT(IN) :: OSUBG_COND ! Switch for sub-grid -! condensation -TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! Output file -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDXX ! 1./PDXX -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDYY ! 1./PDYY -REAL, DIMENSION(:,:,:), INTENT(IN) :: PDXX, PDYY, PDZZ, PDZX, PDZY - ! Metric coefficients -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHVREF ! ref. state Virtual - ! Potential Temperature -! -! Variables at t-1 -REAL, DIMENSION(:,:,:), INTENT(IN) :: PWM -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHLM -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRM ! mixing ratios at t-1, - ! where PRM(:,:,:,1) = conservative mixing ratio -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTKEM ! Turb. Kin. Energy -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLM ! Turb. mixing length -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLEPS ! dissipative length -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLOCPEXNM ! Lv(T)/Cp/Exnref at time t-1 -REAL, DIMENSION(:,:,:), INTENT(IN) :: PATHETA ! coefficients between -REAL, DIMENSION(:,:,:), INTENT(IN) :: PAMOIST ! s and Thetal and Rnp -REAL, DIMENSION(:,:,:), INTENT(IN) :: PSRCM ! normalized -! -! -! -! -REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PSIGS - ! IN: Vertical part of Sigma_s at t - ! OUT: Total Sigma_s at t -! -!* 0.2 declaration of local variables -! -REAL, DIMENSION(SIZE(PTHLM,1),SIZE(PTHLM,2),SIZE(PTHLM,3)) & - :: ZFLX,ZWORK,ZA - ! work arrays -! -INTEGER :: IKB,IKE - ! Index values for the Beginning and End - ! mass points of the domain -REAL, DIMENSION(SIZE(PDZZ,1),SIZE(PDZZ,2),1+JPVEXT:3+JPVEXT) :: ZCOEFF - ! coefficients for the uncentred gradient - ! computation near the ground -REAL :: ZTIME1, ZTIME2 -TYPE(TFIELDDATA) :: TZFIELD -! -! --------------------------------------------------------------------------- -! -!* 1. PRELIMINARY COMPUTATIONS -! ------------------------ -! -IKB = 1+JPVEXT -IKE = SIZE(PTHLM,3)-JPVEXT -! -! -! -! compute the coefficients for the uncentred gradient computation near the -! ground -ZCOEFF(:,:,IKB+2)= - PDZZ(:,:,IKB+1) / & - ( (PDZZ(:,:,IKB+2)+PDZZ(:,:,IKB+1)) * PDZZ(:,:,IKB+2) ) -ZCOEFF(:,:,IKB+1)= (PDZZ(:,:,IKB+2)+PDZZ(:,:,IKB+1)) / & - ( PDZZ(:,:,IKB+1) * PDZZ(:,:,IKB+2) ) -ZCOEFF(:,:,IKB)= - (PDZZ(:,:,IKB+2)+2.*PDZZ(:,:,IKB+1)) / & - ( (PDZZ(:,:,IKB+2)+PDZZ(:,:,IKB+1)) * PDZZ(:,:,IKB+1) ) -! -! -!* 8. TURBULENT CORRELATIONS : <THl THl>, <THl Rnp>, <Rnp Rnp>, Sigma_s -! ----------------------------------------------------------------- -! -! -! -IF ( ( KRRL > 0 .AND. OSUBG_COND) .OR. ( OTURB_FLX .AND. tpfile%lopened ) & - .OR. ( LLES_CALL ) ) THEN -! -!* 8.1 <THl THl> -! - ! Computes the horizontal variance <THl THl> - IF (.NOT. L2D) THEN - ZFLX(:,:,:) = XCTV * PLM(:,:,:) * PLEPS(:,:,:) * & - ( GX_M_M(PTHLM,PDXX,PDZZ,PDZX)**2 + GY_M_M(PTHLM,PDYY,PDZZ,PDZY)**2 ) - ELSE - ZFLX(:,:,:) = XCTV * PLM(:,:,:) * PLEPS(:,:,:) * & - GX_M_M(PTHLM,PDXX,PDZZ,PDZX)**2 - END IF -! -! Compute the flux at the first inner U-point with an uncentred vertical -! gradient -! - ZFLX(:,:,IKB:IKB) = XCTV * PLM(:,:,IKB:IKB) & - * PLEPS(:,:,IKB:IKB) * ( & - ( MXF(DXM(PTHLM(:,:,IKB:IKB)) * PINV_PDXX(:,:,IKB:IKB)) & - - ( ZCOEFF(:,:,IKB+2:IKB+2)*PTHLM(:,:,IKB+2:IKB+2) & - +ZCOEFF(:,:,IKB+1:IKB+1)*PTHLM(:,:,IKB+1:IKB+1) & - +ZCOEFF(:,:,IKB :IKB )*PTHLM(:,:,IKB :IKB ) & - ) * 0.5 * ( PDZX(:,:,IKB+1:IKB+1)+PDZX(:,:,IKB:IKB) ) & - / MXF(PDXX(:,:,IKB:IKB)) & - ) ** 2 + & - ( MYF(DYM(PTHLM(:,:,IKB:IKB)) * PINV_PDYY(:,:,IKB:IKB)) & - - ( ZCOEFF(:,:,IKB+2:IKB+2)*PTHLM(:,:,IKB+2:IKB+2) & - +ZCOEFF(:,:,IKB+1:IKB+1)*PTHLM(:,:,IKB+1:IKB+1) & - +ZCOEFF(:,:,IKB :IKB )*PTHLM(:,:,IKB :IKB ) & - ) * 0.5 * ( PDZY(:,:,IKB+1:IKB+1)+PDZY(:,:,IKB:IKB) ) & - / MYF(PDYY(:,:,IKB:IKB)) & - ) ** 2 ) - ! - ZFLX(:,:,IKB-1) = ZFLX(:,:,IKB) - ! - IF ( KRRL > 0 ) THEN - ZWORK(:,:,:) = ZFLX(:,:,:) * PATHETA(:,:,:) * PATHETA(:,:,:) - END IF - ! - ! stores <THl THl> - IF ( OTURB_FLX .AND. tpfile%lopened ) THEN - TZFIELD%CMNHNAME = 'THL_HVAR' - TZFIELD%CSTDNAME = '' - TZFIELD%CLONGNAME = 'THL_HVAR' - TZFIELD%CUNITS = 'K2' - TZFIELD%CDIR = 'XY' - TZFIELD%CCOMMENT = 'X_Y_Z_THL_HVAR' - TZFIELD%NGRID = 1 - TZFIELD%NTYPE = TYPEREAL - TZFIELD%NDIMS = 3 - TZFIELD%LTIMEDEP = .TRUE. - CALL IO_Field_write(TPFILE,TZFIELD,ZFLX) - END IF -! -! Storage in the LES configuration (addition to TURB_VER computation) -! - IF (LLES_CALL) THEN - CALL SECOND_MNH(ZTIME1) - CALL LES_MEAN_SUBGRID( ZFLX, X_LES_SUBGRID_Thl2, .TRUE. ) - CALL LES_MEAN_SUBGRID( MZF(PWM)*ZFLX, X_LES_RES_W_SBG_Thl2, .TRUE. ) - CALL LES_MEAN_SUBGRID( -2.*XCTD*SQRT(PTKEM)*ZFLX/PLEPS ,X_LES_SUBGRID_DISS_Thl2, .TRUE. ) - ZA(:,:,:) = ETHETA(KRR,KRRI,PTHLM,PRM,PLOCPEXNM,PATHETA,PSRCM) - CALL LES_MEAN_SUBGRID( ZA*ZFLX, X_LES_SUBGRID_ThlThv, .TRUE. ) - CALL LES_MEAN_SUBGRID( -XG/PTHVREF/3.*ZA*ZFLX, X_LES_SUBGRID_ThlPz, .TRUE. ) - CALL SECOND_MNH(ZTIME2) - XTIME_LES = XTIME_LES + ZTIME2 - ZTIME1 - END IF -! - IF ( KRR /= 0 ) THEN -! -!* 8.3 <THl Rnp> -! - ! Computes the horizontal correlation <THl Rnp> - IF (.NOT. L2D) THEN - ZFLX(:,:,:)= & - PLM(:,:,:) * PLEPS(:,:,:) * & - (GX_M_M(PTHLM,PDXX,PDZZ,PDZX) * GX_M_M(PRM(:,:,:,1),PDXX,PDZZ,PDZX) & - + GY_M_M(PTHLM,PDYY,PDZZ,PDZY) * GY_M_M(PRM(:,:,:,1),PDYY,PDZZ,PDZY) & - ) * (XCHT1+XCHT2) - ELSE - ZFLX(:,:,:)= & - PLM(:,:,:) * PLEPS(:,:,:) * & - (GX_M_M(PTHLM,PDXX,PDZZ,PDZX) * GX_M_M(PRM(:,:,:,1),PDXX,PDZZ,PDZX) & - ) * (XCHT1+XCHT2) - - END IF -! -! Compute the flux at the first inner U-point with an uncentred vertical -! gradient - ZFLX(:,:,IKB:IKB) = (XCHT1+XCHT2) * PLM(:,:,IKB:IKB) & - * PLEPS(:,:,IKB:IKB) * ( & - ( MXF(DXM(PTHLM(:,:,IKB:IKB)) * PINV_PDXX(:,:,IKB:IKB)) & - - ( ZCOEFF(:,:,IKB+2:IKB+2)*PTHLM(:,:,IKB+2:IKB+2) & - +ZCOEFF(:,:,IKB+1:IKB+1)*PTHLM(:,:,IKB+1:IKB+1) & - +ZCOEFF(:,:,IKB :IKB )*PTHLM(:,:,IKB :IKB ) & - ) * 0.5 * ( PDZX(:,:,IKB+1:IKB+1)+PDZX(:,:,IKB:IKB) ) & - / MXF(PDXX(:,:,IKB:IKB)) & - ) * & - ( MXF(DXM(PRM(:,:,IKB:IKB,1)) * PINV_PDXX(:,:,IKB:IKB)) & - - ( ZCOEFF(:,:,IKB+2:IKB+2)*PRM(:,:,IKB+2:IKB+2,1) & - +ZCOEFF(:,:,IKB+1:IKB+1)*PRM(:,:,IKB+1:IKB+1,1) & - +ZCOEFF(:,:,IKB :IKB )*PRM(:,:,IKB :IKB ,1) & - ) * 0.5 * ( PDZX(:,:,IKB+1:IKB+1)+PDZX(:,:,IKB:IKB) ) & - / MXF(PDXX(:,:,IKB:IKB)) & - ) + & - ( MYF(DYM(PTHLM(:,:,IKB:IKB)) * PINV_PDYY(:,:,IKB:IKB)) & - - ( ZCOEFF(:,:,IKB+2:IKB+2)*PTHLM(:,:,IKB+2:IKB+2) & - +ZCOEFF(:,:,IKB+1:IKB+1)*PTHLM(:,:,IKB+1:IKB+1) & - +ZCOEFF(:,:,IKB :IKB )*PTHLM(:,:,IKB :IKB ) & - ) * 0.5 * ( PDZY(:,:,IKB+1:IKB+1)+PDZY(:,:,IKB:IKB) ) & - / MYF(PDYY(:,:,IKB:IKB)) & - ) * & - ( MYF(DYM(PRM(:,:,IKB:IKB,1)) * PINV_PDYY(:,:,IKB:IKB)) & - - ( ZCOEFF(:,:,IKB+2:IKB+2)*PRM(:,:,IKB+2:IKB+2,1) & - +ZCOEFF(:,:,IKB+1:IKB+1)*PRM(:,:,IKB+1:IKB+1,1) & - +ZCOEFF(:,:,IKB :IKB )*PRM(:,:,IKB :IKB ,1) & - ) * 0.5 * ( PDZY(:,:,IKB+1:IKB+1)+PDZY(:,:,IKB:IKB) ) & - / MYF(PDYY(:,:,IKB:IKB)) & - ) ) - ! - ZFLX(:,:,IKB-1) = ZFLX(:,:,IKB) - ! - IF ( KRRL > 0 ) THEN - ZWORK(:,:,:) = ZWORK(:,:,:) + & - 2. * PATHETA(:,:,:) * PAMOIST(:,:,:) * ZFLX(:,:,:) - END IF - ! - ! stores <THl Rnp> - IF ( OTURB_FLX .AND. tpfile%lopened ) THEN - TZFIELD%CMNHNAME = 'THLR_HCOR' - TZFIELD%CSTDNAME = '' - TZFIELD%CLONGNAME = 'THLR_HCOR' - TZFIELD%CUNITS = 'K kg kg-1' - TZFIELD%CDIR = 'XY' - TZFIELD%CCOMMENT = 'X_Y_Z_THLR_HCOR' - TZFIELD%NGRID = 1 - TZFIELD%NTYPE = TYPEREAL - TZFIELD%NDIMS = 3 - TZFIELD%LTIMEDEP = .TRUE. - CALL IO_Field_write(TPFILE,TZFIELD,ZFLX) - END IF -! -! Storage in the LES configuration (addition to TURB_VER computation) -! - IF (LLES_CALL) THEN - CALL SECOND_MNH(ZTIME1) - CALL LES_MEAN_SUBGRID( ZFLX, X_LES_SUBGRID_ThlRt, .TRUE. ) - CALL LES_MEAN_SUBGRID( MZF(PWM)*ZFLX, X_LES_RES_W_SBG_ThlRt, .TRUE. ) - CALL LES_MEAN_SUBGRID( -XCTD*SQRT(PTKEM)*ZFLX/PLEPS ,X_LES_SUBGRID_DISS_ThlRt, .TRUE. ) - CALL LES_MEAN_SUBGRID( ZA*ZFLX, X_LES_SUBGRID_RtThv, .TRUE. ) - CALL LES_MEAN_SUBGRID( -XG/PTHVREF/3.*ZA*ZFLX, X_LES_SUBGRID_RtPz,.TRUE.) - ZA(:,:,:) = EMOIST(KRR,KRRI,PTHLM,PRM,PLOCPEXNM,PAMOIST,PSRCM) - CALL LES_MEAN_SUBGRID( ZA*ZFLX, X_LES_SUBGRID_ThlThv, .TRUE. ) - CALL LES_MEAN_SUBGRID( -XG/PTHVREF/3.*ZA*ZFLX, X_LES_SUBGRID_ThlPz,.TRUE.) - CALL SECOND_MNH(ZTIME2) - XTIME_LES = XTIME_LES + ZTIME2 - ZTIME1 - END IF -! -!* 8.4 <Rnp Rnp> -! - ! Computes the horizontal variance <Rnp Rnp> - IF (.NOT. L2D) THEN - ZFLX(:,:,:) = XCHV * PLM(:,:,:) * PLEPS(:,:,:) * & - ( GX_M_M(PRM(:,:,:,1),PDXX,PDZZ,PDZX)**2 + & - GY_M_M(PRM(:,:,:,1),PDYY,PDZZ,PDZY)**2 ) - ELSE - ZFLX(:,:,:) = XCHV * PLM(:,:,:) * PLEPS(:,:,:) * & - ( GX_M_M(PRM(:,:,:,1),PDXX,PDZZ,PDZX)**2 ) - END IF -! -! Compute the flux at the first inner U-point with an uncentred vertical -! gradient - ZFLX(:,:,IKB:IKB) = XCHV * PLM(:,:,IKB:IKB) & - * PLEPS(:,:,IKB:IKB) * ( & - ( MXF(DXM(PRM(:,:,IKB:IKB,1)) * PINV_PDXX(:,:,IKB:IKB)) & - - ( ZCOEFF(:,:,IKB+2:IKB+2)*PRM(:,:,IKB+2:IKB+2,1) & - +ZCOEFF(:,:,IKB+1:IKB+1)*PRM(:,:,IKB+1:IKB+1,1) & - +ZCOEFF(:,:,IKB :IKB )*PRM(:,:,IKB :IKB ,1) & - ) * 0.5 * ( PDZX(:,:,IKB+1:IKB+1)+PDZX(:,:,IKB:IKB) ) & - / MXF(PDXX(:,:,IKB:IKB)) & - ) ** 2 + & - ( MYF(DYM(PRM(:,:,IKB:IKB,1)) * PINV_PDYY(:,:,IKB:IKB)) & - - ( ZCOEFF(:,:,IKB+2:IKB+2)*PRM(:,:,IKB+2:IKB+2,1) & - +ZCOEFF(:,:,IKB+1:IKB+1)*PRM(:,:,IKB+1:IKB+1,1) & - +ZCOEFF(:,:,IKB :IKB )*PRM(:,:,IKB :IKB ,1) & - ) * 0.5 * ( PDZY(:,:,IKB+1:IKB+1)+PDZY(:,:,IKB:IKB) ) & - / MYF(PDYY(:,:,IKB:IKB)) & - ) ** 2 ) -! - ZFLX(:,:,IKB-1) = ZFLX(:,:,IKB) - ! - IF ( KRRL > 0 ) THEN - ZWORK(:,:,:) = ZWORK(:,:,:)+ PAMOIST(:,:,:) * PAMOIST(:,:,:) * ZFLX(:,:,:) - END IF - ! - ! stores <Rnp Rnp> - IF ( OTURB_FLX .AND. tpfile%lopened ) THEN - TZFIELD%CMNHNAME = 'R_HVAR' - TZFIELD%CSTDNAME = '' - TZFIELD%CLONGNAME = 'R_HVAR' - TZFIELD%CUNITS = 'kg2 kg-2' - TZFIELD%CDIR = 'XY' - TZFIELD%CCOMMENT = 'X_Y_Z_R_HVAR' - TZFIELD%NGRID = 1 - TZFIELD%NTYPE = TYPEREAL - TZFIELD%NDIMS = 3 - TZFIELD%LTIMEDEP = .TRUE. - CALL IO_Field_write(TPFILE,TZFIELD,ZFLX) - END IF - ! - ! Storage in the LES configuration (addition to TURB_VER computation) - ! - IF (LLES_CALL) THEN - CALL SECOND_MNH(ZTIME1) - CALL LES_MEAN_SUBGRID( ZFLX, X_LES_SUBGRID_Rt2, .TRUE. ) - CALL LES_MEAN_SUBGRID( MZF(PWM)*ZFLX, X_LES_RES_W_SBG_Rt2, .TRUE. ) - CALL LES_MEAN_SUBGRID( ZA*ZFLX, X_LES_SUBGRID_RtThv, .TRUE. ) - CALL LES_MEAN_SUBGRID( -XG/PTHVREF/3.*ZA*ZFLX, X_LES_SUBGRID_RtPz,.TRUE.) - CALL LES_MEAN_SUBGRID( -2.*XCTD*SQRT(PTKEM)*ZFLX/PLEPS, X_LES_SUBGRID_DISS_Rt2, .TRUE. ) - CALL SECOND_MNH(ZTIME2) - XTIME_LES = XTIME_LES + ZTIME2 - ZTIME1 - END IF - ! - END IF -! -! 8.5 Complete the Sigma_s computation: -! - IF ( KRRL > 0 ) THEN - ! - PSIGS(:,:,:)=PSIGS(:,:,:)*PSIGS(:,:,:) + ZWORK(:,:,:) - ! Extrapolate PSIGS at the ground and at the top - PSIGS(:,:,IKB-1) = PSIGS(:,:,IKB) - PSIGS(:,:,IKE+1) = PSIGS(:,:,IKE) - PSIGS(:,:,:) = SQRT(MAX ( PSIGS(:,:,:),1.E-12) ) - END IF -! -END IF -! -! -! -END SUBROUTINE TURB_HOR_THERMO_CORR diff --git a/src/mesonh/turb/turb_hor_thermo_flux.f90 b/src/mesonh/turb/turb_hor_thermo_flux.f90 deleted file mode 100644 index 90d189a2b..000000000 --- a/src/mesonh/turb/turb_hor_thermo_flux.f90 +++ /dev/null @@ -1,752 +0,0 @@ -!MNH_LIC Copyright 1994-2021 CNRS, Meteo-France and Universite Paul Sabatier -!MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence -!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt -!MNH_LIC for details. version 1. -!----------------------------------------------------------------- -! ################################ - MODULE MODI_TURB_HOR_THERMO_FLUX -! ################################ -! -INTERFACE -! - SUBROUTINE TURB_HOR_THERMO_FLUX(KSPLT, KRR, KRRL, KRRI, & - OTURB_FLX,OSUBG_COND, & - TPFILE, & - PK,PINV_PDXX,PINV_PDYY,PINV_PDZZ,PMZM_PRHODJ, & - PDXX,PDYY,PDZZ,PDZX,PDZY, & - PDIRCOSXW,PDIRCOSYW, & - PRHODJ, & - PSFTHM,PSFRM, & - PWM,PTHLM,PRM, & - PATHETA,PAMOIST,PSRCM,PFRAC_ICE, & - PRTHLS,PRRS ) -! -USE MODD_IO, ONLY: TFILEDATA -! -INTEGER, INTENT(IN) :: KSPLT ! split process index -INTEGER, INTENT(IN) :: KRR ! number of moist var. -INTEGER, INTENT(IN) :: KRRL ! number of liquid water var. -INTEGER, INTENT(IN) :: KRRI ! number of ice water var. -LOGICAL, INTENT(IN) :: OTURB_FLX ! switch to write the - ! turbulent fluxes in the syncronous FM-file -LOGICAL, INTENT(IN) :: OSUBG_COND ! Switch for sub-grid -! condensation -TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! Output file -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PK ! Turbulent diffusion doef. - ! PK = PLM * SQRT(PTKEM) -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDXX ! 1./PDXX -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDYY ! 1./PDYY -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDZZ ! 1./PDZZ -REAL, DIMENSION(:,:,:), INTENT(IN) :: PMZM_PRHODJ ! MZM(PRHODJ) -REAL, DIMENSION(:,:,:), INTENT(IN) :: PDXX, PDYY, PDZZ, PDZX, PDZY - ! Metric coefficients -REAL, DIMENSION(:,:), INTENT(IN) :: PDIRCOSXW, PDIRCOSYW -! Director Cosinus along x, y and z directions at surface w-point -REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! density * grid volume -! -REAL, DIMENSION(:,:), INTENT(IN) :: PSFTHM,PSFRM -! -! Variables at t-1 -REAL, DIMENSION(:,:,:), INTENT(IN) :: PWM -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHLM -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRM ! mixing ratios at t-1, - ! where PRM(:,:,:,1) = conservative mixing ratio -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PATHETA ! coefficients between -REAL, DIMENSION(:,:,:), INTENT(IN) :: PAMOIST ! s and Thetal and Rnp - -REAL, DIMENSION(:,:,:), INTENT(IN) :: PSRCM - ! normalized 2nd-order flux - ! s'r'c/2Sigma_s2 at t-1 multiplied by Lambda_3 -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PFRAC_ICE ! ri fraction of rc+ri -! -REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRTHLS -REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRRS ! var. at t+1 -split- -! -! -END SUBROUTINE TURB_HOR_THERMO_FLUX -! -END INTERFACE -! -END MODULE MODI_TURB_HOR_THERMO_FLUX -! ################################################################ - SUBROUTINE TURB_HOR_THERMO_FLUX(KSPLT, KRR, KRRL, KRRI, & - OTURB_FLX,OSUBG_COND, & - TPFILE, & - PK,PINV_PDXX,PINV_PDYY,PINV_PDZZ,PMZM_PRHODJ, & - PDXX,PDYY,PDZZ,PDZX,PDZY, & - PDIRCOSXW,PDIRCOSYW, & - PRHODJ, & - PSFTHM,PSFRM, & - PWM,PTHLM,PRM, & - PATHETA,PAMOIST,PSRCM,PFRAC_ICE, & - PRTHLS,PRRS ) -! ################################################################ -! -! -!!**** *TURB_HOR* -routine to compute the source terms in the meso-NH -!! model equations due to the non-vertical turbulent fluxes. -!! -!! PURPOSE -!! ------- -!! -!! see TURB_HOR -!! -!!** METHOD -!! ------ -!! -!! EXTERNAL -!! -------- -!! -!! IMPLICIT ARGUMENTS -!! ------------------ -!! -!! REFERENCE -!! --------- -!! -!! AUTHOR -!! ------ -!! -!! Joan Cuxart * INM and Meteo-France * -!! -!! MODIFICATIONS -!! ------------- -!! Aug , 1997 (V. Saravane) spliting of TURB_HOR -!! Nov 27, 1997 (V. Masson) clearing of the routine -!! Feb. 18, 1998 (J. Stein) bug for v'RC' -!! Oct 18, 2000 (V. Masson) LES computations + LFLAT switch -!! Nov 06, 2002 (V. Masson) LES budgets -!! Feb 20, 2003 (JP Pinty) Add PFRAC_ICE -!! October 2009 (G. Tanguy) add ILENCH=LEN(YCOMMENT) after -!! change of YCOMMENT -!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O -!! -------------------------------------------------------------------------- -! -!* 0. DECLARATIONS -! ------------ -! -USE MODD_CST -USE MODD_CONF -USE MODD_CTURB -use modd_field, only: tfielddata, TYPEREAL -USE MODD_IO, ONLY: TFILEDATA -USE MODD_PARAMETERS -USE MODD_LES -! -USE MODE_IO_FIELD_WRITE, only: IO_Field_write -! -USE MODI_GRADIENT_M -USE MODI_GRADIENT_U -USE MODI_GRADIENT_V -USE MODI_GRADIENT_W -USE MODI_SHUMAN -USE MODI_LES_MEAN_SUBGRID -!!USE MODI_EMOIST -!!USE MODI_ETHETA -! -USE MODI_SECOND_MNH -! -IMPLICIT NONE -! -! -!* 0.1 declaration of arguments -! -! -! -INTEGER, INTENT(IN) :: KSPLT ! split process index -INTEGER, INTENT(IN) :: KRR ! number of moist var. -INTEGER, INTENT(IN) :: KRRL ! number of liquid water var. -INTEGER, INTENT(IN) :: KRRI ! number of ice water var. -LOGICAL, INTENT(IN) :: OTURB_FLX ! switch to write the - ! turbulent fluxes in the syncronous FM-file -LOGICAL, INTENT(IN) :: OSUBG_COND ! Switch for sub-grid -! condensation -TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! Output file -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PK ! Turbulent diffusion doef. - ! PK = PLM * SQRT(PTKEM) -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDXX ! 1./PDXX -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDYY ! 1./PDYY -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDZZ ! 1./PDZZ -REAL, DIMENSION(:,:,:), INTENT(IN) :: PMZM_PRHODJ ! MZM(PRHODJ) -REAL, DIMENSION(:,:,:), INTENT(IN) :: PDXX, PDYY, PDZZ, PDZX, PDZY - ! Metric coefficients -REAL, DIMENSION(:,:), INTENT(IN) :: PDIRCOSXW, PDIRCOSYW -! Director Cosinus along x, y and z directions at surface w-point -REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! density * grid volume -! -REAL, DIMENSION(:,:), INTENT(IN) :: PSFTHM,PSFRM -! -! Variables at t-1 -REAL, DIMENSION(:,:,:), INTENT(IN) :: PWM -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHLM -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRM ! mixing ratios at t-1, - ! where PRM(:,:,:,1) = conservative mixing ratio -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PATHETA ! coefficients between -REAL, DIMENSION(:,:,:), INTENT(IN) :: PAMOIST ! s and Thetal and Rnp - -REAL, DIMENSION(:,:,:), INTENT(IN) :: PSRCM - ! normalized 2nd-order flux - ! s'r'c/2Sigma_s2 at t-1 multiplied by Lambda_3 -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PFRAC_ICE ! ri fraction of rc+ri -! -REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRTHLS -REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRRS ! var. at t+1 -split- -! -! -! -!* 0.2 declaration of local variables -! -REAL, DIMENSION(SIZE(PTHLM,1),SIZE(PTHLM,2),SIZE(PTHLM,3)) & - :: ZFLX,ZFLXC - ! work arrays -! -!! REAL, DIMENSION(SIZE(PTHLM,1),SIZE(PTHLM,2),SIZE(PTHLM,3)) :: ZVPTV -INTEGER :: IKB,IKE,IKU - ! Index values for the Beginning and End - ! mass points of the domain -REAL, DIMENSION(SIZE(PDZZ,1),SIZE(PDZZ,2),1+JPVEXT:3+JPVEXT) :: ZCOEFF - ! coefficients for the uncentred gradient - ! computation near the ground -! -REAL :: ZTIME1, ZTIME2 -TYPE(TFIELDDATA) :: TZFIELD -! --------------------------------------------------------------------------- -! -!* 1. PRELIMINARY COMPUTATIONS -! ------------------------ -! -IKB = 1+JPVEXT -IKE = SIZE(PTHLM,3)-JPVEXT -IKU = SIZE(PTHLM,3) -! -! -! compute the coefficients for the uncentred gradient computation near the -! ground -ZCOEFF(:,:,IKB+2)= - PDZZ(:,:,IKB+1) / & - ( (PDZZ(:,:,IKB+2)+PDZZ(:,:,IKB+1)) * PDZZ(:,:,IKB+2) ) -ZCOEFF(:,:,IKB+1)= (PDZZ(:,:,IKB+2)+PDZZ(:,:,IKB+1)) / & - ( PDZZ(:,:,IKB+1) * PDZZ(:,:,IKB+2) ) -ZCOEFF(:,:,IKB)= - (PDZZ(:,:,IKB+2)+2.*PDZZ(:,:,IKB+1)) / & - ( (PDZZ(:,:,IKB+2)+PDZZ(:,:,IKB+1)) * PDZZ(:,:,IKB+1) ) -! -!* 2. < U' THETA'l > -! -------------- -! -! -ZFLX(:,:,:) = -XCSHF * MXM( PK ) * GX_M_U(1,IKU,1,PTHLM,PDXX,PDZZ,PDZX) -ZFLX(:,:,IKE+1) = ZFLX(:,:,IKE) -! -! Compute the flux at the first inner U-point with an uncentred vertical -! gradient -ZFLX(:,:,IKB:IKB) = -XCSHF * MXM( PK(:,:,IKB:IKB) ) * & - ( DXM(PTHLM(:,:,IKB:IKB)) * PINV_PDXX(:,:,IKB:IKB) & - -MXM( ZCOEFF(:,:,IKB+2:IKB+2)*PTHLM(:,:,IKB+2:IKB+2) & - +ZCOEFF(:,:,IKB+1:IKB+1)*PTHLM(:,:,IKB+1:IKB+1) & - +ZCOEFF(:,:,IKB :IKB )*PTHLM(:,:,IKB :IKB )) & - *0.5* ( PDZX(:,:,IKB+1:IKB+1)+PDZX(:,:,IKB:IKB)) & - * PINV_PDXX(:,:,IKB:IKB) ) -! extrapolates the flux under the ground so that the vertical average with -! the IKB flux gives the ground value ( warning the tangential surface -! flux has been set to 0 for the moment !! to be improved ) -ZFLX(:,:,IKB-1:IKB-1) = 2. * MXM( SPREAD( PSFTHM(:,:)* PDIRCOSXW(:,:), 3,1) ) & - - ZFLX(:,:,IKB:IKB) -! -! Add this source to the Theta_l sources -! -IF (.NOT. LFLAT) THEN - PRTHLS(:,:,:) = PRTHLS & - - DXF( MXM(PRHODJ) * ZFLX * PINV_PDXX ) & - + DZF( PMZM_PRHODJ *MXF(PDZX*(MZM(ZFLX * PINV_PDXX))) * PINV_PDZZ ) -ELSE - PRTHLS(:,:,:) = PRTHLS - DXF( MXM(PRHODJ) * ZFLX * PINV_PDXX ) -END IF -! -! Compute the equivalent tendancy for Rc and Ri -! -IF ( KRRL >= 1 ) THEN - IF (.NOT. LFLAT) THEN - ZFLXC = 2.*( MXF( MXM( PRHODJ*PATHETA*PSRCM )*ZFLX ) & - +MZF( MZM( PRHODJ*PATHETA*PSRCM )*MXF( & - PDZX*(MZM( ZFLX*PINV_PDXX )) ) )& - ) - IF ( KRRI >= 1 ) THEN - PRRS(:,:,:,2) = PRRS(:,:,:,2) + 2. * & - (- DXF( MXM( PRHODJ*PATHETA*PSRCM )*ZFLX*PINV_PDXX ) & - + DZF( MZM( PRHODJ*PATHETA*PSRCM )*MXF( PDZX*(MZM( ZFLX*PINV_PDXX )) )& - *PINV_PDZZ ) & - )*(1.0-PFRAC_ICE(:,:,:)) - PRRS(:,:,:,4) = PRRS(:,:,:,4) + 2. * & - (- DXF( MXM( PRHODJ*PATHETA*PSRCM )*ZFLX*PINV_PDXX ) & - + DZF( MZM( PRHODJ*PATHETA*PSRCM )*MXF( PDZX*(MZM( ZFLX*PINV_PDXX )) )& - *PINV_PDZZ ) & - )*PFRAC_ICE(:,:,:) - ELSE - PRRS(:,:,:,2) = PRRS(:,:,:,2) + 2. * & - (- DXF( MXM( PRHODJ*PATHETA*PSRCM )*ZFLX*PINV_PDXX ) & - + DZF( MZM( PRHODJ*PATHETA*PSRCM )*MXF( PDZX*(MZM( ZFLX*PINV_PDXX )) )& - *PINV_PDZZ ) & - ) - END IF - ELSE - ZFLXC = 2.*MXF( MXM( PRHODJ*PATHETA*PSRCM )*ZFLX ) - IF ( KRRI >= 1 ) THEN - PRRS(:,:,:,2) = PRRS(:,:,:,2) - 2. * & - DXF( MXM( PRHODJ*PATHETA*PSRCM )*ZFLX*PINV_PDXX )*(1.0-PFRAC_ICE(:,:,:)) - PRRS(:,:,:,4) = PRRS(:,:,:,4) - 2. * & - DXF( MXM( PRHODJ*PATHETA*PSRCM )*ZFLX*PINV_PDXX )*PFRAC_ICE(:,:,:) - ELSE - PRRS(:,:,:,2) = PRRS(:,:,:,2) - 2. * & - DXF( MXM( PRHODJ*PATHETA*PSRCM )*ZFLX*PINV_PDXX ) - END IF - END IF -END IF -! -!! stores this flux in ZWORK to compute later <U' VPT'> -!!ZWORK(:,:,:) = ZFLX(:,:,:) -! -! stores the horizontal <U THl> -IF ( tpfile%lopened .AND. OTURB_FLX ) THEN - TZFIELD%CMNHNAME = 'UTHL_FLX' - TZFIELD%CSTDNAME = '' - TZFIELD%CLONGNAME = 'UTHL_FLX' - TZFIELD%CUNITS = 'K m s-1' - TZFIELD%CDIR = 'XY' - TZFIELD%CCOMMENT = 'X_Y_Z_UTHL_FLX' - TZFIELD%NGRID = 2 - TZFIELD%NTYPE = TYPEREAL - TZFIELD%NDIMS = 3 - TZFIELD%LTIMEDEP = .TRUE. - CALL IO_Field_write(TPFILE,TZFIELD,ZFLX) -END IF -! -IF (KSPLT==1 .AND. LLES_CALL) THEN - CALL SECOND_MNH(ZTIME1) - CALL LES_MEAN_SUBGRID( MXF(ZFLX), X_LES_SUBGRID_UThl ) - CALL LES_MEAN_SUBGRID( MZF(MXF(GX_W_UW(PWM,PDXX,PDZZ,PDZX)*MZM(ZFLX))),& - X_LES_RES_ddxa_W_SBG_UaThl , .TRUE. ) - CALL LES_MEAN_SUBGRID( GX_M_M(PTHLM,PDXX,PDZZ,PDZX)*MXF(ZFLX),& - X_LES_RES_ddxa_Thl_SBG_UaThl , .TRUE. ) - IF (KRR>=1) THEN - CALL LES_MEAN_SUBGRID( GX_M_M(PRM(:,:,:,1),PDXX,PDZZ,PDZX)*MXF(ZFLX), & - X_LES_RES_ddxa_Rt_SBG_UaThl , .TRUE. ) - END IF - CALL SECOND_MNH(ZTIME2) - XTIME_LES = XTIME_LES + ZTIME2 - ZTIME1 -END IF -! -!* 3. < U' R'np > -! ----------- -IF (KRR/=0) THEN - ! - ZFLX(:,:,:) = -XCHF * MXM( PK ) * GX_M_U(1,IKU,1,PRM(:,:,:,1),PDXX,PDZZ,PDZX) - ZFLX(:,:,IKE+1) = ZFLX(:,:,IKE) -! -! Compute the flux at the first inner U-point with an uncentred vertical -! gradient - ZFLX(:,:,IKB:IKB) = -XCHF * MXM( PK(:,:,IKB:IKB) ) * & - ( DXM(PRM(:,:,IKB:IKB,1)) * PINV_PDXX(:,:,IKB:IKB) & - -MXM( ZCOEFF(:,:,IKB+2:IKB+2)*PRM(:,:,IKB+2:IKB+2,1) & - +ZCOEFF(:,:,IKB+1:IKB+1)*PRM(:,:,IKB+1:IKB+1,1) & - +ZCOEFF(:,:,IKB :IKB )*PRM(:,:,IKB :IKB ,1)) & - *0.5* ( PDZX(:,:,IKB+1:IKB+1)+PDZX(:,:,IKB:IKB)) & - * PINV_PDXX(:,:,IKB:IKB) ) -! extrapolates the flux under the ground so that the vertical average with -! the IKB flux gives the ground value ( warning the tangential surface -! flux has been set to 0 for the moment !! to be improved ) - ZFLX(:,:,IKB-1:IKB-1) = 2. * MXM( SPREAD( PSFRM(:,:)* PDIRCOSXW(:,:), 3,1) ) & - - ZFLX(:,:,IKB:IKB) - ! - ! Add this source to the conservative mixing ratio sources - ! - IF (.NOT. LFLAT) THEN - PRRS(:,:,:,1) = PRRS(:,:,:,1) & - - DXF( MXM(PRHODJ) * ZFLX * PINV_PDXX ) & - + DZF( PMZM_PRHODJ *MXF(PDZX*(MZM(ZFLX * PINV_PDXX))) * PINV_PDZZ ) - ELSE - PRRS(:,:,:,1) = PRRS(:,:,:,1) - DXF( MXM(PRHODJ) * ZFLX * PINV_PDXX ) - END IF - ! - ! Compute the equivalent tendancy for Rc and Ri - ! - IF ( KRRL >= 1 ) THEN - IF (.NOT. LFLAT) THEN - ZFLXC = ZFLXC & - + 2.*( MXF( MXM( PRHODJ*PAMOIST*PSRCM )*ZFLX ) & - +MZF( MZM( PRHODJ*PAMOIST*PSRCM )*MXF( & - PDZX*(MZM( ZFLX*PINV_PDXX )) ) )& - ) - IF ( KRRI >= 1 ) THEN - PRRS(:,:,:,2) = PRRS(:,:,:,2) + 2. * & - (- DXF( MXM( PRHODJ*PAMOIST*PSRCM )*ZFLX*PINV_PDXX ) & - + DZF( MZM( PRHODJ*PAMOIST*PSRCM )*MXF( PDZX*(MZM( ZFLX*PINV_PDXX )) )& - *PINV_PDZZ ) & - )*(1.0-PFRAC_ICE(:,:,:)) - PRRS(:,:,:,2) = PRRS(:,:,:,2) + 2. * & - (- DXF( MXM( PRHODJ*PAMOIST*PSRCM )*ZFLX*PINV_PDXX ) & - + DZF( MZM( PRHODJ*PAMOIST*PSRCM )*MXF( PDZX*(MZM( ZFLX*PINV_PDXX )) )& - *PINV_PDZZ ) & - )*PFRAC_ICE(:,:,:) - ELSE - PRRS(:,:,:,2) = PRRS(:,:,:,2) + 2. * & - (- DXF( MXM( PRHODJ*PAMOIST*PSRCM )*ZFLX*PINV_PDXX ) & - + DZF( MZM( PRHODJ*PAMOIST*PSRCM )*MXF( PDZX*(MZM( ZFLX*PINV_PDXX )) )& - *PINV_PDZZ ) & - ) - END IF - ELSE - ZFLXC = ZFLXC + 2.*MXF( MXM( PRHODJ*PAMOIST*PSRCM )*ZFLX ) - IF ( KRRI >= 1 ) THEN - PRRS(:,:,:,2) = PRRS(:,:,:,2) - 2. * & - DXF( MXM( PRHODJ*PAMOIST*PSRCM )*ZFLX*PINV_PDXX )*(1.0-PFRAC_ICE(:,:,:)) - PRRS(:,:,:,4) = PRRS(:,:,:,4) - 2. * & - DXF( MXM( PRHODJ*PAMOIST*PSRCM )*ZFLX*PINV_PDXX )*PFRAC_ICE(:,:,:) - ELSE - PRRS(:,:,:,2) = PRRS(:,:,:,2) - 2. * & - DXF( MXM( PRHODJ*PAMOIST*PSRCM )*ZFLX*PINV_PDXX ) - END IF - END IF - END IF - ! - ! stores the horizontal <U Rnp> - IF ( tpfile%lopened .AND. OTURB_FLX ) THEN - TZFIELD%CMNHNAME = 'UR_FLX' - TZFIELD%CSTDNAME = '' - TZFIELD%CLONGNAME = 'UR_FLX' - TZFIELD%CUNITS = 'kg kg-1 m s-1' - TZFIELD%CDIR = 'XY' - TZFIELD%CCOMMENT = 'X_Y_Z_UR_FLX' - TZFIELD%NGRID = 2 - TZFIELD%NTYPE = TYPEREAL - TZFIELD%NDIMS = 3 - TZFIELD%LTIMEDEP = .TRUE. - CALL IO_Field_write(TPFILE,TZFIELD,ZFLX) - END IF - ! - IF (KSPLT==1 .AND. LLES_CALL) THEN - CALL SECOND_MNH(ZTIME1) - CALL LES_MEAN_SUBGRID( MXF(ZFLX), X_LES_SUBGRID_URt ) - CALL LES_MEAN_SUBGRID( MZF(MXF(GX_W_UW(PWM,PDXX,PDZZ,PDZX)*MZM(ZFLX))),& - X_LES_RES_ddxa_W_SBG_UaRt , .TRUE. ) - CALL LES_MEAN_SUBGRID( GX_M_M(PTHLM,PDXX,PDZZ,PDZX)*MXF(ZFLX),& - X_LES_RES_ddxa_Thl_SBG_UaRt , .TRUE. ) - CALL LES_MEAN_SUBGRID( GX_M_M(PRM(:,:,:,1),PDXX,PDZZ,PDZX)*MXF(ZFLX),& - X_LES_RES_ddxa_Rt_SBG_UaRt , .TRUE. ) - CALL SECOND_MNH(ZTIME2) - XTIME_LES = XTIME_LES + ZTIME2 - ZTIME1 - END IF -! - ! - IF (KRRL>0 .AND. KSPLT==1 .AND. LLES_CALL) THEN - CALL SECOND_MNH(ZTIME1) - CALL LES_MEAN_SUBGRID(MXF(ZFLXC), X_LES_SUBGRID_URc ) - CALL SECOND_MNH(ZTIME2) - XTIME_LES = XTIME_LES + ZTIME2 - ZTIME1 - END IF -! -END IF -! -!* 4. < U' TPV' > -! ----------- -! -!! to be tested later -!!IF (KRR/=0) THEN -!! ! here ZFLX= <U'Rnp'> and ZWORK= <U'Thetal'> -!! ! -!! ZVPTU(:,:,:) = & -!! ZWORK(:,:,:)*MXM(ETHETA(KRR,KRRI,PTHLT,PEXNREF,PRT,PLOCPT,PSRCM)) + & -!! ZFLX(:,:,:)*MXM(EMOIST(KRR,KRRI,PTHLT,PEXNREF,PRT,PLOCPT,PSRCM)) -!! ! -!! ! stores the horizontal <U VPT> -!! IF ( tpfile%lopened .AND. OTURB_FLX ) THEN -!! TZFIELD%CMNHNAME = 'UVPT_FLX' -!! TZFIELD%CSTDNAME = '' -!! TZFIELD%CLONGNAME = 'UVPT_FLX' -!! TZFIELD%CUNITS = 'K m s-1' -!! TZFIELD%CDIR = 'XY' -!! TZFIELD%CCOMMENT = 'X_Y_Z_UVPT_FLX' -!! TZFIELD%NGRID = 2 -!! TZFIELD%NTYPE = TYPEREAL -!! TZFIELD%NDIMS = 3 -!! TZFIELD%LTIMEDEP = .TRUE. -!! CALL IO_Field_write(TPFILE,TZFIELD,ZVPTU) -!! END IF -!!! -!!ELSE -!! ZVPTU(:,:,:)=ZWORK(:,:,:) -!!END IF -! -! -!* 5. < V' THETA'l > -! -------------- -! -! -IF (.NOT. L2D) THEN - ZFLX(:,:,:) = -XCSHF * MYM( PK ) * GY_M_V(1,IKU,1,PTHLM,PDYY,PDZZ,PDZY) - ZFLX(:,:,IKE+1) = ZFLX(:,:,IKE) -ELSE - ZFLX(:,:,:) = 0. -END IF -! -! -! Compute the flux at the first inner U-point with an uncentred vertical -! gradient -ZFLX(:,:,IKB:IKB) = -XCSHF * MYM( PK(:,:,IKB:IKB) ) * & - ( DYM(PTHLM(:,:,IKB:IKB)) * PINV_PDYY(:,:,IKB:IKB) & - -MYM( ZCOEFF(:,:,IKB+2:IKB+2)*PTHLM(:,:,IKB+2:IKB+2) & - +ZCOEFF(:,:,IKB+1:IKB+1)*PTHLM(:,:,IKB+1:IKB+1) & - +ZCOEFF(:,:,IKB :IKB )*PTHLM(:,:,IKB :IKB ) ) & - *0.5* ( PDZY(:,:,IKB+1:IKB+1)+PDZY(:,:,IKB:IKB)) & - * PINV_PDYY(:,:,IKB:IKB) ) -! extrapolates the flux under the ground so that the vertical average with -! the IKB flux gives the ground value ( warning the tangential surface -! flux has been set to 0 for the moment !! to be improved ) -ZFLX(:,:,IKB-1:IKB-1) = 2. * MYM( SPREAD( PSFTHM(:,:)* PDIRCOSYW(:,:), 3,1) ) & - - ZFLX(:,:,IKB:IKB) -! -! Add this source to the Theta_l sources -! -IF (.NOT. L2D) THEN - IF (.NOT. LFLAT) THEN - PRTHLS(:,:,:) = PRTHLS & - - DYF( MYM(PRHODJ) * ZFLX * PINV_PDYY ) & - + DZF( PMZM_PRHODJ *MYF(PDZY*(MZM(ZFLX * PINV_PDYY))) * PINV_PDZZ ) - ELSE - PRTHLS(:,:,:) = PRTHLS - DYF( MYM(PRHODJ) * ZFLX * PINV_PDYY ) - END IF -END IF -! -! Compute the equivalent tendancy for Rc and Ri -! -!IF ( OSUBG_COND .AND. KRRL > 0 .AND. .NOT. L2D) THEN -IF ( KRRL >= 1 .AND. .NOT. L2D) THEN - IF (.NOT. LFLAT) THEN - ZFLXC = 2.*( MYF( MYM( PRHODJ*PATHETA*PSRCM )*ZFLX ) & - +MZF( MZM( PRHODJ*PATHETA*PSRCM )*MYF( & - PDZY*(MZM( ZFLX*PINV_PDYY )) ) )& - ) - IF ( KRRI >= 1 ) THEN - PRRS(:,:,:,2) = PRRS(:,:,:,2) + 2. * & - (- DYF( MYM( PRHODJ*PATHETA*PSRCM )*ZFLX*PINV_PDYY ) & - + DZF( MZM( PRHODJ*PATHETA*PSRCM )*MYF( PDZY*(MZM( ZFLX*PINV_PDYY )) )& - *PINV_PDZZ ) & - )*(1.0-PFRAC_ICE(:,:,:)) - PRRS(:,:,:,4) = PRRS(:,:,:,4) + 2. * & - (- DYF( MYM( PRHODJ*PATHETA*PSRCM )*ZFLX*PINV_PDYY ) & - + DZF( MZM( PRHODJ*PATHETA*PSRCM )*MYF( PDZY*(MZM( ZFLX*PINV_PDYY )) )& - *PINV_PDZZ ) & - )*PFRAC_ICE(:,:,:) - ELSE - PRRS(:,:,:,2) = PRRS(:,:,:,2) + 2. * & - (- DYF( MYM( PRHODJ*PATHETA*PSRCM )*ZFLX*PINV_PDYY ) & - + DZF( MZM( PRHODJ*PATHETA*PSRCM )*MYF( PDZY*(MZM( ZFLX*PINV_PDYY )) )& - *PINV_PDZZ ) & - ) - END IF - ELSE - ZFLXC = 2.*MYF( MYM( PRHODJ*PATHETA*PSRCM )*ZFLX ) - IF ( KRRI >= 1 ) THEN - PRRS(:,:,:,2) = PRRS(:,:,:,2) - 2. * & - DYF( MYM( PRHODJ*PATHETA*PSRCM )*ZFLX*PINV_PDYY )*(1.0-PFRAC_ICE(:,:,:)) - PRRS(:,:,:,4) = PRRS(:,:,:,4) - 2. * & - DYF( MYM( PRHODJ*PATHETA*PSRCM )*ZFLX*PINV_PDYY )*PFRAC_ICE(:,:,:) - ELSE - PRRS(:,:,:,2) = PRRS(:,:,:,2) - 2. * & - DYF( MYM( PRHODJ*PATHETA*PSRCM )*ZFLX*PINV_PDYY ) - END IF - END IF -END IF -! -!! stores this flux in ZWORK to compute later <V' VPT'> -!!ZWORK(:,:,:) = ZFLX(:,:,:) -! -! stores the horizontal <V THl> -IF ( tpfile%lopened .AND. OTURB_FLX ) THEN - TZFIELD%CMNHNAME = 'VTHL_FLX' - TZFIELD%CSTDNAME = '' - TZFIELD%CLONGNAME = 'VTHL_FLX' - TZFIELD%CUNITS = 'K m s-1' - TZFIELD%CDIR = 'XY' - TZFIELD%CCOMMENT = 'X_Y_Z_VTHL_FLX' - TZFIELD%NGRID = 3 - TZFIELD%NTYPE = TYPEREAL - TZFIELD%NDIMS = 3 - TZFIELD%LTIMEDEP = .TRUE. - CALL IO_Field_write(TPFILE,TZFIELD,ZFLX) -END IF -! -IF (KSPLT==1 .AND. LLES_CALL) THEN - CALL SECOND_MNH(ZTIME1) - CALL LES_MEAN_SUBGRID( MYF(ZFLX), X_LES_SUBGRID_VThl ) - CALL LES_MEAN_SUBGRID( MZF(MYF(GY_W_VW(PWM,PDYY,PDZZ,PDZY)*MZM(ZFLX))),& - X_LES_RES_ddxa_W_SBG_UaThl , .TRUE. ) - CALL LES_MEAN_SUBGRID( GY_M_M(PTHLM,PDYY,PDZZ,PDZY)*MYF(ZFLX),& - X_LES_RES_ddxa_Thl_SBG_UaThl , .TRUE. ) - IF (KRR>=1) THEN - CALL LES_MEAN_SUBGRID( GY_M_M(PRM(:,:,:,1),PDYY,PDZZ,PDZY)*MYF(ZFLX),& - X_LES_RES_ddxa_Rt_SBG_UaThl , .TRUE. ) - END IF - CALL SECOND_MNH(ZTIME2) - XTIME_LES = XTIME_LES + ZTIME2 - ZTIME1 -END IF -! -! -!* 6. < V' R'np > -! ----------- -! -IF (KRR/=0) THEN - ! - IF (.NOT. L2D) THEN - ZFLX(:,:,:) = -XCHF * MYM( PK ) * GY_M_V(1,IKU,1,PRM(:,:,:,1),PDYY,PDZZ,PDZY) - ZFLX(:,:,IKE+1) = ZFLX(:,:,IKE) - ELSE - ZFLX(:,:,:) = 0. - END IF -! -! Compute the flux at the first inner U-point with an uncentred vertical -! gradient - ZFLX(:,:,IKB:IKB) = -XCHF * MYM( PK(:,:,IKB:IKB) ) * & - ( DYM(PRM(:,:,IKB:IKB,1)) * PINV_PDYY(:,:,IKB:IKB) & - -MYM( ZCOEFF(:,:,IKB+2:IKB+2)*PRM(:,:,IKB+2:IKB+2,1) & - +ZCOEFF(:,:,IKB+1:IKB+1)*PRM(:,:,IKB+1:IKB+1,1) & - +ZCOEFF(:,:,IKB :IKB )*PRM(:,:,IKB :IKB ,1) ) & - *0.5* ( PDZY(:,:,IKB+1:IKB+1)+PDZY(:,:,IKB:IKB)) & - * PINV_PDYY(:,:,IKB:IKB) ) -! extrapolates the flux under the ground so that the vertical average with -! the IKB flux gives the ground value ( warning the tangential surface -! flux has been set to 0 for the moment !! to be improved ) - ZFLX(:,:,IKB-1:IKB-1) = 2. * MYM( SPREAD( PSFRM(:,:)* PDIRCOSYW(:,:), 3,1) ) & - - ZFLX(:,:,IKB:IKB) - ! - ! Add this source to the conservative mixing ratio sources - ! - IF (.NOT. L2D) THEN - IF (.NOT. LFLAT) THEN - PRRS(:,:,:,1) = PRRS(:,:,:,1) & - - DYF( MYM(PRHODJ) * ZFLX * PINV_PDYY ) & - - + DZF( PMZM_PRHODJ *MYF(PDZY*(MZM(ZFLX * PINV_PDYY))) * PINV_PDZZ ) - ELSE - PRRS(:,:,:,1) = PRRS(:,:,:,1) - DYF( MYM(PRHODJ) * ZFLX * PINV_PDYY ) - END IF - END IF - ! - ! Compute the equivalent tendancy for Rc and Ri - ! - IF ( KRRL >= 1 .AND. .NOT. L2D) THEN ! Sub-grid condensation - IF (.NOT. LFLAT) THEN - ZFLXC = ZFLXC & - + 2.*( MXF( MYM( PRHODJ*PAMOIST*PSRCM )*ZFLX ) & - + MZF( MZM( PRHODJ*PAMOIST*PSRCM )*MYF( & - PDZY*(MZM( ZFLX*PINV_PDYY )) ) )& - ) - IF ( KRRI >= 1 ) THEN - PRRS(:,:,:,2) = PRRS(:,:,:,2) + 2. * & - (- DYF( MYM( PRHODJ*PAMOIST*PSRCM )*ZFLX/PDYY ) & - + DZF( MZM( PRHODJ*PAMOIST*PSRCM )*MYF( PDZY*(MZM( ZFLX*PINV_PDYY )) )& - * PINV_PDZZ ) & - )*(1.0-PFRAC_ICE(:,:,:)) - PRRS(:,:,:,4) = PRRS(:,:,:,4) + 2. * & - (- DYF( MYM( PRHODJ*PAMOIST*PSRCM )*ZFLX/PDYY ) & - + DZF( MZM( PRHODJ*PAMOIST*PSRCM )*MYF( PDZY*(MZM( ZFLX*PINV_PDYY )) )& - * PINV_PDZZ ) & - )*PFRAC_ICE(:,:,:) - ELSE - PRRS(:,:,:,2) = PRRS(:,:,:,2) + 2. * & - (- DYF( MYM( PRHODJ*PAMOIST*PSRCM )*ZFLX/PDYY ) & - + DZF( MZM( PRHODJ*PAMOIST*PSRCM )*MYF( PDZY*(MZM( ZFLX*PINV_PDYY )) )& - * PINV_PDZZ ) & - ) - END IF - ELSE - ZFLXC = ZFLXC + 2.*MXF( MYM( PRHODJ*PAMOIST*PSRCM )*ZFLX ) - IF ( KRRI >= 1 ) THEN - PRRS(:,:,:,2) = PRRS(:,:,:,2) - 2. * & - DYF( MYM( PRHODJ*PAMOIST*PSRCM )*ZFLX/PDYY )*(1.0-PFRAC_ICE(:,:,:)) - PRRS(:,:,:,4) = PRRS(:,:,:,4) - 2. * & - DYF( MYM( PRHODJ*PAMOIST*PSRCM )*ZFLX/PDYY )*PFRAC_ICE(:,:,:) - ELSE - PRRS(:,:,:,2) = PRRS(:,:,:,2) - 2. * & - DYF( MYM( PRHODJ*PAMOIST*PSRCM )*ZFLX/PDYY ) - END IF - END IF - END IF - ! - ! stores the horizontal <V Rnp> - IF ( tpfile%lopened .AND. OTURB_FLX ) THEN - TZFIELD%CMNHNAME = 'VR_FLX' - TZFIELD%CSTDNAME = '' - TZFIELD%CLONGNAME = 'VR_FLX' - TZFIELD%CUNITS = 'kg kg-1 m s-1' - TZFIELD%CDIR = 'XY' - TZFIELD%CCOMMENT = 'X_Y_Z_VR_FLX' - TZFIELD%NGRID = 3 - TZFIELD%NTYPE = TYPEREAL - TZFIELD%NDIMS = 3 - TZFIELD%LTIMEDEP = .TRUE. - CALL IO_Field_write(TPFILE,TZFIELD,ZFLX) - END IF - ! - IF (KSPLT==1 .AND. LLES_CALL) THEN - CALL SECOND_MNH(ZTIME1) - CALL LES_MEAN_SUBGRID( MYF(ZFLX), X_LES_SUBGRID_VRt ) - CALL LES_MEAN_SUBGRID( MZF(MYF(GY_W_VW(PWM,PDYY,PDZZ,PDZY)*MZM(ZFLX))),& - X_LES_RES_ddxa_W_SBG_UaRt , .TRUE. ) - CALL LES_MEAN_SUBGRID( GY_M_M(PTHLM,PDYY,PDZZ,PDZY)*MYF(ZFLX), & - X_LES_RES_ddxa_Thl_SBG_UaRt , .TRUE. ) - CALL LES_MEAN_SUBGRID( GY_M_M(PRM(:,:,:,1),PDYY,PDZZ,PDZY)*MYF(ZFLX), & - X_LES_RES_ddxa_Rt_SBG_UaRt , .TRUE. ) - CALL SECOND_MNH(ZTIME2) - XTIME_LES = XTIME_LES + ZTIME2 - ZTIME1 - END IF -! - ! - IF (KRRL>0 .AND. KSPLT==1 .AND. LLES_CALL) THEN - CALL SECOND_MNH(ZTIME1) - CALL LES_MEAN_SUBGRID(MYF(ZFLXC), X_LES_SUBGRID_VRc ) - CALL SECOND_MNH(ZTIME2) - XTIME_LES = XTIME_LES + ZTIME2 - ZTIME1 - END IF - ! -END IF -! -!* 7. < V' TPV' > -! ----------- -! -!! to be tested later -!!IF (KRR/=0) THEN -!! ! here ZFLX= <V'R'np> and ZWORK= <V'Theta'l> -!! ! -!! IF (.NOT. L2D) THEN & -!! ZVPTV(:,:,:) = & -!! ZWORK(:,:,:)*MYM(ETHETA(KRR,KRRI,PTHLT,PEXNREF,PRT,PLOCPT,PSRCM)) + & -!! ZFLX(:,:,:)*MYM(EMOIST(KRR,KRRI,PTHLT,PEXNREF,PRT,PLOCPT,PSRCM)) -!! ELSE -!! ZVPTV(:,:,:) = 0. -!! END IF -!! ! -!! ! stores the horizontal <V VPT> -!! IF ( tpfile%lopened .AND. OTURB_FLX ) THEN -!! TZFIELD%CMNHNAME = 'VVPT_FLX' -!! TZFIELD%CSTDNAME = '' -!! TZFIELD%CLONGNAME = 'VVPT_FLX' -!! TZFIELD%CUNITS = 'K m s-1' -!! TZFIELD%CDIR = 'XY' -!! TZFIELD%CCOMMENT = 'X_Y_Z_VVPT_FLX' -!! TZFIELD%NGRID = 3 -!! TZFIELD%NTYPE = TYPEREAL -!! TZFIELD%NDIMS = 3 -!! TZFIELD%LTIMEDEP = .TRUE. -!! CALL IO_Field_write(TPFILE,TZFIELD,ZVPTV) -!! END IF -!!! -!!ELSE -!! ZVPTV(:,:,:)=ZWORK(:,:,:) -!!END IF -! -! -END SUBROUTINE TURB_HOR_THERMO_FLUX diff --git a/src/mesonh/turb/turb_hor_tke.f90 b/src/mesonh/turb/turb_hor_tke.f90 deleted file mode 100644 index ec8e9e2b6..000000000 --- a/src/mesonh/turb/turb_hor_tke.f90 +++ /dev/null @@ -1,246 +0,0 @@ -!MNH_LIC Copyright 1994-2020 CNRS, Meteo-France and Universite Paul Sabatier -!MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence -!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt -!MNH_LIC for details. version 1. -!----------------------------------------------------------------- -! #################### - MODULE MODI_TURB_HOR_TKE -! #################### -! -INTERFACE -! - SUBROUTINE TURB_HOR_TKE(KSPLT, & - PDXX,PDYY,PDZZ,PDZX,PDZY, & - PINV_PDXX, PINV_PDYY, PINV_PDZZ, PMZM_PRHODJ, & - PK, PRHODJ, PTKEM, & - PTRH ) - -! -INTEGER, INTENT(IN) :: KSPLT ! current split index -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PDXX, PDYY, PDZZ, PDZX, PDZY - ! Metric coefficients -REAL, DIMENSION(:,:,:), INTENT(IN) :: PK ! Turbulent diffusion doef. - ! PK = PLM * SQRT(PTKEM) -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDXX ! 1./PDXX -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDYY ! 1./PDYY -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDZZ ! 1./PDZZ -REAL, DIMENSION(:,:,:), INTENT(IN) :: PMZM_PRHODJ ! MZM(PRHODJ) -REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! density * grid volume -! -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTKEM ! TKE at time t- dt -REAL, DIMENSION(:,:,:), INTENT(OUT) :: PTRH ! horizontal transport of Tke -! -! -! -END SUBROUTINE TURB_HOR_TKE -! -END INTERFACE -! -END MODULE MODI_TURB_HOR_TKE -! ################################################################ - SUBROUTINE TURB_HOR_TKE(KSPLT, & - PDXX, PDYY, PDZZ,PDZX,PDZY, & - PINV_PDXX, PINV_PDYY, PINV_PDZZ, PMZM_PRHODJ, & - PK, PRHODJ, PTKEM, & - PTRH ) -! ################################################################ -! -! -!!**** *TURB_HOR_TKE* computes the horizontal turbulant transports of Tke -!! -!! PURPOSE -!! ------- - -!!** METHOD -!! ------ -!! -!! -!! -!! EXTERNAL -!! -------- -!! -!! IMPLICIT ARGUMENTS -!! ------------------ -!! -!! -!! REFERENCE -!! --------- -!! -!! AUTHOR -!! ------ -!! Joan Cuxart * INM and Meteo-France * -!! -!! MODIFICATIONS -!! ------------- -!! Original Aug 29, 1994 -!! Mar 07 2001 (V. Masson and J. Stein) new routine -!! Nov 06, 2002 (V. Masson) LES budgets -!! -------------------------------------------------------------------------- -! -!* 0. DECLARATIONS -! ------------ -! -USE MODD_CONF -USE MODD_CST -USE MODD_CTURB -USE MODD_PARAMETERS -USE MODD_LES -! -! -USE MODI_SHUMAN -USE MODI_GRADIENT_M -USE MODI_LES_MEAN_SUBGRID -! -USE MODI_SECOND_MNH -! -IMPLICIT NONE -! -! -!* 0.1 declaration of arguments -! -! -INTEGER, INTENT(IN) :: KSPLT ! current split index -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PDXX, PDYY, PDZZ, PDZX, PDZY - ! Metric coefficients -REAL, DIMENSION(:,:,:), INTENT(IN) :: PK ! Turbulent diffusion doef. - ! PK = PLM * SQRT(PTKEM) -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDXX ! 1./PDXX -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDYY ! 1./PDYY -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDZZ ! 1./PDZZ -REAL, DIMENSION(:,:,:), INTENT(IN) :: PMZM_PRHODJ ! MZM(PRHODJ) -REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! density * grid volume -! -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTKEM ! TKE at time t- dt -REAL, DIMENSION(:,:,:), INTENT(OUT) :: PTRH ! horizontal transport of Tke -! -! -! -!* 0.2 declaration of local variables -! -INTEGER :: IKB, IKU -! -REAL, DIMENSION(SIZE(PDZZ,1),SIZE(PDZZ,2),1+JPVEXT:3+JPVEXT) :: ZCOEFF - ! coefficients for the uncentred gradient - ! computation near the ground -! -REAL, DIMENSION(SIZE(PTKEM,1),SIZE(PTKEM,2),SIZE(PTKEM,3)):: ZFLX -! -REAL :: ZTIME1, ZTIME2 -! --------------------------------------------------------------------------- -! -!* 1. PRELIMINARY COMPUTATIONS -! ------------------------ -! -IKB = 1.+JPVEXT -IKU = SIZE(PTKEM,3) -! -! compute the coefficients for the uncentred gradient computation near the -! ground -! -ZCOEFF(:,:,IKB+2)= - PDZZ(:,:,IKB+1) / & - ( (PDZZ(:,:,IKB+2)+PDZZ(:,:,IKB+1)) * PDZZ(:,:,IKB+2) ) -ZCOEFF(:,:,IKB+1)= (PDZZ(:,:,IKB+2)+PDZZ(:,:,IKB+1)) / & - ( PDZZ(:,:,IKB+1) * PDZZ(:,:,IKB+2) ) -ZCOEFF(:,:,IKB)= - (PDZZ(:,:,IKB+2)+2.*PDZZ(:,:,IKB+1)) / & - ( (PDZZ(:,:,IKB+2)+PDZZ(:,:,IKB+1)) * PDZZ(:,:,IKB+1) ) -! -!-------------------------------------------------------------------- -! -!* 2. horizontal transport of Tke u'e -! ------------------------------- -! -! -ZFLX = -XCET * MXM(PK) * GX_M_U(1,IKU,1,PTKEM,PDXX,PDZZ,PDZX) ! < u'e > -! -! special case near the ground ( uncentred gradient ) -! -ZFLX(:,:,IKB) = ZCOEFF(:,:,IKB+2)*PTKEM(:,:,IKB+2) & - + ZCOEFF(:,:,IKB+1)*PTKEM(:,:,IKB+1) & - + ZCOEFF(:,:,IKB )*PTKEM(:,:,IKB ) -! -ZFLX(:,:,IKB:IKB) = & - - XCET * MXM( PK(:,:,IKB:IKB) ) * ( & - DXM ( PTKEM(:,:,IKB:IKB) ) * PINV_PDXX(:,:,IKB:IKB) & - -MXM ( ZFLX (:,:,IKB:IKB) ) * PINV_PDXX(:,:,IKB:IKB) & - * 0.5 * ( PDZX(:,:,IKB+1:IKB+1) + PDZX(:,:,IKB:IKB) ) ) -! -! extrapolate the fluxes to obtain < u'e > = 0 at the ground -! -ZFLX(:,:,IKB-1) = - ZFLX(:,:,IKB) -! -! let the same flux at IKU-1 and IKU level -! -ZFLX(:,:,IKU) = ZFLX(:,:,IKU-1) -! -IF (.NOT. LFLAT) THEN - PTRH =-( DXF( MXM(PRHODJ) * ZFLX * PINV_PDXX)& - - DZF( PMZM_PRHODJ * MXF( PDZX * MZM(ZFLX*PINV_PDXX)) * PINV_PDZZ)& - ) /PRHODJ -ELSE - PTRH =-( DXF( MXM(PRHODJ) * ZFLX * PINV_PDXX)& - ) /PRHODJ -END IF -! -IF (LLES_CALL .AND. KSPLT==1) THEN - CALL SECOND_MNH(ZTIME1) - CALL LES_MEAN_SUBGRID( MXF(ZFLX), X_LES_SUBGRID_UTke ) - CALL SECOND_MNH(ZTIME2) - XTIME_LES = XTIME_LES + ZTIME2 - ZTIME1 -END IF -! -! -!-------------------------------------------------------------------- -! -!* 3. horizontal transport of Tke v'e -! ------------------------------- -! -IF (.NOT. L2D) THEN - ZFLX =-XCET * MYM(PK) * GY_M_V(1,IKU,1,PTKEM,PDYY,PDZZ,PDZY) ! < v'e > -! -! special case near the ground ( uncentred gradient ) -! - ZFLX(:,:,IKB) = ZCOEFF(:,:,IKB+2)*PTKEM(:,:,IKB+2) & - + ZCOEFF(:,:,IKB+1)*PTKEM(:,:,IKB+1) & - + ZCOEFF(:,:,IKB )*PTKEM(:,:,IKB ) -! - ZFLX(:,:,IKB:IKB) = & - - XCET * MYM( PK(:,:,IKB:IKB) ) * ( & - DYM ( PTKEM(:,:,IKB:IKB) ) * PINV_PDYY(:,:,IKB:IKB) & - - MYM ( ZFLX (:,:,IKB:IKB) ) * PINV_PDYY(:,:,IKB:IKB) & - * 0.5 * ( PDZY(:,:,IKB+1:IKB+1) + PDZY(:,:,IKB:IKB) ) ) -! -! extrapolate the fluxes to obtain < v'e > = 0 at the ground -! - ZFLX(:,:,IKB-1) = - ZFLX(:,:,IKB) -! -! let the same flux at IKU-1 and IKU level -! - ZFLX(:,:,IKU) = ZFLX(:,:,IKU-1) -! -! complete the explicit turbulent transport -! - IF (.NOT. LFLAT) THEN - PTRH = PTRH - ( DYF( MYM(PRHODJ) * ZFLX * PINV_PDYY ) & - - DZF( PMZM_PRHODJ * MYF( PDZY * MZM(ZFLX*PINV_PDYY) ) * PINV_PDZZ ) & - ) /PRHODJ - ELSE - PTRH = PTRH - ( DYF( MYM(PRHODJ) * ZFLX * PINV_PDYY ) & - ) /PRHODJ - END IF -! - IF (LLES_CALL .AND. KSPLT==1) THEN - CALL SECOND_MNH(ZTIME1) - CALL LES_MEAN_SUBGRID( MYF(ZFLX), X_LES_SUBGRID_VTke ) - CALL SECOND_MNH(ZTIME2) - XTIME_LES = XTIME_LES + ZTIME2 - ZTIME1 - END IF -! -END IF -! -!---------------------------------------------------------------------------- -! -END SUBROUTINE TURB_HOR_TKE diff --git a/src/mesonh/turb/turb_hor_uv.f90 b/src/mesonh/turb/turb_hor_uv.f90 deleted file mode 100644 index 3fcecc20e..000000000 --- a/src/mesonh/turb/turb_hor_uv.f90 +++ /dev/null @@ -1,355 +0,0 @@ -!MNH_LIC Copyright 1994-2021 CNRS, Meteo-France and Universite Paul Sabatier -!MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence -!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt -!MNH_LIC for details. version 1. -!----------------------------------------------------------------- -! ####################### - MODULE MODI_TURB_HOR_UV -! ####################### -! -INTERFACE -! - SUBROUTINE TURB_HOR_UV(KSPLT, & - OTURB_FLX, & - TPFILE, & - PK,PINV_PDXX,PINV_PDYY,PINV_PDZZ,PMZM_PRHODJ, & - PDXX,PDYY,PDZZ,PDZX,PDZY, & - PDIRCOSZW, & - PCOSSLOPE,PSINSLOPE, & - PRHODJ, & - PCDUEFF,PTAU11M,PTAU12M,PTAU22M,PTAU33M, & - PUM,PVM,PUSLOPEM,PVSLOPEM, & - PDP, & - PRUS,PRVS ) -! -USE MODD_IO, ONLY: TFILEDATA -! -INTEGER, INTENT(IN) :: KSPLT ! split process index -LOGICAL, INTENT(IN) :: OTURB_FLX ! switch to write the - ! turbulent fluxes in the syncronous FM-file -TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! Output file -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PK ! Turbulent diffusion doef. - ! PK = PLM * SQRT(PTKEM) -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDXX ! 1./PDXX -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDYY ! 1./PDYY -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDZZ ! 1./PDZZ -REAL, DIMENSION(:,:,:), INTENT(IN) :: PMZM_PRHODJ ! MZM(PRHODJ) -REAL, DIMENSION(:,:,:), INTENT(IN) :: PDXX, PDYY, PDZZ, PDZX, PDZY - ! Metric coefficients -REAL, DIMENSION(:,:), INTENT(IN) :: PDIRCOSZW -! Director Cosinus along z directions at surface w-point -REAL, DIMENSION(:,:), INTENT(IN) :: PCOSSLOPE ! cosinus of the angle - ! between i and the slope vector -REAL, DIMENSION(:,:), INTENT(IN) :: PSINSLOPE ! sinus of the angle - ! between i and the slope vector -REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! density * grid volume -! -REAL, DIMENSION(:,:), INTENT(IN) :: PCDUEFF ! Cd * || u || at time t -REAL, DIMENSION(:,:), INTENT(IN) :: PTAU11M ! <uu> in the axes linked - ! to the maximum slope direction and the surface normal and the binormal - ! at time t - dt -REAL, DIMENSION(:,:), INTENT(IN) :: PTAU12M ! <uv> in the same axes -REAL, DIMENSION(:,:), INTENT(IN) :: PTAU22M ! <vv> in the same axes -REAL, DIMENSION(:,:), INTENT(IN) :: PTAU33M ! <ww> in the same axes -! -! Variables at t-1 -REAL, DIMENSION(:,:,:), INTENT(IN) :: PUM,PVM -REAL, DIMENSION(:,:), INTENT(IN) :: PUSLOPEM ! wind component along the - ! maximum slope direction -REAL, DIMENSION(:,:), INTENT(IN) :: PVSLOPEM ! wind component along the - ! direction normal to the maximum slope one -! -! -REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRUS, PRVS ! var. at t+1 -split- -REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PDP ! TKE production terms -! -! -END SUBROUTINE TURB_HOR_UV -! -END INTERFACE -! -END MODULE MODI_TURB_HOR_UV -! ################################################################ - SUBROUTINE TURB_HOR_UV(KSPLT, & - OTURB_FLX, & - TPFILE, & - PK,PINV_PDXX,PINV_PDYY,PINV_PDZZ,PMZM_PRHODJ, & - PDXX,PDYY,PDZZ,PDZX,PDZY, & - PDIRCOSZW, & - PCOSSLOPE,PSINSLOPE, & - PRHODJ, & - PCDUEFF,PTAU11M,PTAU12M,PTAU22M,PTAU33M, & - PUM,PVM,PUSLOPEM,PVSLOPEM, & - PDP, & - PRUS,PRVS ) -! ################################################################ -! -! -!!**** *TURB_HOR* -routine to compute the source terms in the meso-NH -!! model equations due to the non-vertical turbulent fluxes. -!! -!! PURPOSE -!! ------- -!! -!! see TURB_HOR -!! -!!** METHOD -!! ------ -!! -!! EXTERNAL -!! -------- -!! -!! IMPLICIT ARGUMENTS -!! ------------------ -!! -!! REFERENCE -!! --------- -!! -!! AUTHOR -!! ------ -!! -!! Joan Cuxart * INM and Meteo-France * -!! -!! MODIFICATIONS -!! ------------- -!! Aug , 1997 (V. Saravane) spliting of TURB_HOR -!! Nov 27, 1997 (V. Masson) clearing of the routine -!! Oct 18, 2000 (V. Masson) LES computations + LFLAT switch -!! Nov 06, 2002 (V. Masson) LES budgets -!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O -!! -------------------------------------------------------------------------- -! -!* 0. DECLARATIONS -! ------------ -! -USE MODD_CST -USE MODD_CONF -USE MODD_CTURB -use modd_field, only: tfielddata, TYPEREAL -USE MODD_IO, ONLY: TFILEDATA -USE MODD_PARAMETERS -USE MODD_LES -! -USE MODE_IO_FIELD_WRITE, only: IO_Field_write -! -USE MODI_GRADIENT_M -USE MODI_GRADIENT_U -USE MODI_GRADIENT_V -USE MODI_GRADIENT_W -USE MODI_SHUMAN -USE MODI_COEFJ -USE MODI_LES_MEAN_SUBGRID -! -USE MODI_SECOND_MNH -! -IMPLICIT NONE -! -! -!* 0.1 declaration of arguments -! -! -! -INTEGER, INTENT(IN) :: KSPLT ! split process index -LOGICAL, INTENT(IN) :: OTURB_FLX ! switch to write the - ! turbulent fluxes in the syncronous FM-file -TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! Output file -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PK ! Turbulent diffusion doef. - ! PK = PLM * SQRT(PTKEM) -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDXX ! 1./PDXX -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDYY ! 1./PDYY -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDZZ ! 1./PDZZ -REAL, DIMENSION(:,:,:), INTENT(IN) :: PMZM_PRHODJ ! MZM(PRHODJ) -REAL, DIMENSION(:,:,:), INTENT(IN) :: PDXX, PDYY, PDZZ, PDZX, PDZY - ! Metric coefficients -REAL, DIMENSION(:,:), INTENT(IN) :: PDIRCOSZW -! Director Cosinus along z directions at surface w-point -REAL, DIMENSION(:,:), INTENT(IN) :: PCOSSLOPE ! cosinus of the angle - ! between i and the slope vector -REAL, DIMENSION(:,:), INTENT(IN) :: PSINSLOPE ! sinus of the angle - ! between i and the slope vector -REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! density * grid volume -! -REAL, DIMENSION(:,:), INTENT(IN) :: PCDUEFF ! Cd * || u || at time t -REAL, DIMENSION(:,:), INTENT(IN) :: PTAU11M ! <uu> in the axes linked - ! to the maximum slope direction and the surface normal and the binormal - ! at time t - dt -REAL, DIMENSION(:,:), INTENT(IN) :: PTAU12M ! <uv> in the same axes -REAL, DIMENSION(:,:), INTENT(IN) :: PTAU22M ! <vv> in the same axes -REAL, DIMENSION(:,:), INTENT(IN) :: PTAU33M ! <ww> in the same axes -! -! Variables at t-1 -REAL, DIMENSION(:,:,:), INTENT(IN) :: PUM,PVM -REAL, DIMENSION(:,:), INTENT(IN) :: PUSLOPEM ! wind component along the - ! maximum slope direction -REAL, DIMENSION(:,:), INTENT(IN) :: PVSLOPEM ! wind component along the - ! direction normal to the maximum slope one -! -! -REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRUS, PRVS ! var. at t+1 -split- -REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PDP ! TKE production terms -! -! -! -!* 0.2 declaration of local variables -! -REAL, DIMENSION(SIZE(PUM,1),SIZE(PUM,2),SIZE(PUM,3)) & - :: ZFLX,ZWORK - ! work arrays -! -REAL, DIMENSION(SIZE(PUM,1),SIZE(PUM,2)) ::ZDIRSINZW - ! sinus of the angle between the vertical and the normal to the orography -INTEGER :: IKB,IKE - ! Index values for the Beginning and End - ! mass points of the domain -! -REAL, DIMENSION(SIZE(PUM,1),SIZE(PUM,2),SIZE(PUM,3)) :: GY_U_UV_PUM -REAL, DIMENSION(SIZE(PVM,1),SIZE(PVM,2),SIZE(PVM,3)) :: GX_V_UV_PVM -! -REAL :: ZTIME1, ZTIME2 -TYPE(TFIELDDATA) :: TZFIELD -! --------------------------------------------------------------------------- -! -!* 1. PRELIMINARY COMPUTATIONS -! ------------------------ -! -IKB = 1+JPVEXT -IKE = SIZE(PUM,3)-JPVEXT -! -ZDIRSINZW(:,:) = SQRT( 1. - PDIRCOSZW(:,:)**2 ) -! -GX_V_UV_PVM = GX_V_UV(PVM,PDXX,PDZZ,PDZX) -IF (.NOT. L2D) GY_U_UV_PUM = GY_U_UV(PUM,PDYY,PDZZ,PDZY) -! -! -!* 12. < U'V'> -! ------- -! -! -IF (.NOT. L2D) THEN - ZFLX(:,:,:)= - XCMFS * MYM(MXM(PK)) * & - (GY_U_UV_PUM + GX_V_UV_PVM) -ELSE - ZFLX(:,:,:)= - XCMFS * MYM(MXM(PK)) * & - (GX_V_UV_PVM) -END IF -! -ZFLX(:,:,IKE+1)= ZFLX(:,:,IKE) -! -! -! Compute the correlation at the first physical level with the following -! hypothesis du/dz vary in 1/z and w=0 at the ground -ZFLX(:,:,IKB:IKB) = - XCMFS * MYM(MXM(PK(:,:,IKB:IKB))) * ( & - ( DYM( PUM(:,:,IKB:IKB) ) & - -MYM( (PUM(:,:,IKB+1:IKB+1)-PUM(:,:,IKB:IKB)) & - *(1./MXM(PDZZ(:,:,IKB+1:IKB+1))+1./MXM(PDZZ(:,:,IKB:IKB))))& - *0.5*MXM((PDZY(:,:,IKB+1:IKB+1)+PDZY(:,:,IKB:IKB))) & - ) / MXM(PDYY(:,:,IKB:IKB)) & - +( DXM( PVM(:,:,IKB:IKB) ) & - -MXM( (PVM(:,:,IKB+1:IKB+1)-PVM(:,:,IKB:IKB)) & - *(1./MYM(PDZZ(:,:,IKB+1:IKB+1))+1./MYM(PDZZ(:,:,IKB:IKB))))& - *0.5*MYM((PDZX(:,:,IKB+1:IKB+1)+PDZX(:,:,IKB:IKB))) & - ) / MYM(PDXX(:,:,IKB:IKB)) ) -! -! extrapolates this flux under the ground with the surface flux -ZFLX(:,:,IKB-1) = & - PTAU11M(:,:) * PCOSSLOPE(:,:) * PSINSLOPE(:,:) * PDIRCOSZW(:,:)**2 & - +PTAU12M(:,:) * (PCOSSLOPE(:,:)**2 - PSINSLOPE(:,:)**2) * & - PDIRCOSZW(:,:)**2 & - -PTAU22M(:,:) * PCOSSLOPE(:,:) * PSINSLOPE(:,:) & - +PTAU33M(:,:) * PCOSSLOPE(:,:) * PSINSLOPE(:,:) * ZDIRSINZW(:,:)**2 & - -PCDUEFF(:,:) * ( & - 2. * PUSLOPEM(:,:) * PCOSSLOPE(:,:) * PSINSLOPE(:,:) * & - PDIRCOSZW(:,:) * ZDIRSINZW(:,:) & - +PVSLOPEM(:,:) * (PCOSSLOPE(:,:)**2 - PSINSLOPE(:,:)**2) * ZDIRSINZW(:,:) & - ) -! -ZFLX(:,:,IKB-1:IKB-1) = 2. * MXM( MYM( ZFLX(:,:,IKB-1:IKB-1) ) ) & - - ZFLX(:,:,IKB:IKB) -! -! stores <U V> -IF ( tpfile%lopened .AND. OTURB_FLX ) THEN - TZFIELD%CMNHNAME = 'UV_FLX' - TZFIELD%CSTDNAME = '' - TZFIELD%CLONGNAME = 'UV_FLX' - TZFIELD%CUNITS = 'm2 s-2' - TZFIELD%CDIR = 'XY' - TZFIELD%CCOMMENT = 'X_Y_Z_UV_FLX' - TZFIELD%NGRID = 5 - TZFIELD%NTYPE = TYPEREAL - TZFIELD%NDIMS = 3 - TZFIELD%LTIMEDEP = .TRUE. - CALL IO_Field_write(TPFILE,TZFIELD,ZFLX) -END IF -! -! -! -!computation of the source for rho*V due to this flux -IF (.NOT. LFLAT) THEN - PRUS(:,:,:) = PRUS(:,:,:) & - - DYF(ZFLX * MXM(MYM(PRHODJ) * PINV_PDYY) ) & - + DZF( MYF( MZM(ZFLX)*MXM(PDZY/MZM(PDYY))) & - * MXM(PMZM_PRHODJ * PINV_PDZZ) ) -ELSE - PRUS(:,:,:) = PRUS(:,:,:) - DYF(ZFLX * MXM(MYM(PRHODJ) * PINV_PDYY) ) -END IF -! -!computation of the source for rho*V due to this flux -IF (.NOT. LFLAT) THEN - PRVS(:,:,:) = PRVS(:,:,:) & - - DXF(ZFLX * MYM(MXM(PRHODJ) * PINV_PDXX) ) & - + DZF( MXF( MZM(ZFLX)*MYM(PDZX/MZM(PDXX))) & - * MYM(PMZM_PRHODJ * PINV_PDZZ) ) -ELSE - PRVS(:,:,:) = PRVS(:,:,:) - DXF(ZFLX * MYM(MXM(PRHODJ) * PINV_PDXX) ) -END IF -! -IF (KSPLT==1) THEN - ! - !Contribution to the dynamic production of TKE: - ! - IF (.NOT. L2D) THEN - ZWORK(:,:,:) = - MXF( MYF( ZFLX * & - (GY_U_UV_PUM + GX_V_UV_PVM) ) ) - ELSE - ZWORK(:,:,:) = - MXF( MYF( ZFLX * & - (GX_V_UV_PVM) ) ) - ENDIF - ! - ! evaluate the dynamic production at w(IKB+1) in PDP(IKB) - ! - ZWORK(:,:,IKB:IKB) = - & - MXF ( MYF( 0.5 * (ZFLX(:,:,IKB+1:IKB+1)+ZFLX(:,:,IKB:IKB)) ) ) & - *(MXF ( MYF( & - DYM( 0.5 * (PUM(:,:,IKB+1:IKB+1)+PUM(:,:,IKB:IKB)) ) & - / MXM( 0.5*(PDYY(:,:,IKB:IKB)+PDYY(:,:,IKB+1:IKB+1)) ) & - +DXM( 0.5 * (PVM(:,:,IKB+1:IKB+1)+PVM(:,:,IKB:IKB)) ) & - / MYM( 0.5*(PDXX(:,:,IKB:IKB)+PDXX(:,:,IKB+1:IKB+1)) ) & - ) ) & - -MXF( (PUM(:,:,IKB+1:IKB+1)-PUM(:,:,IKB:IKB)) / & - MXM(PDZZ(:,:,IKB+1:IKB+1)) * PDZY(:,:,IKB+1:IKB+1) & - ) / MYF(MXM( 0.5*(PDYY(:,:,IKB:IKB)+PDYY(:,:,IKB+1:IKB+1)) ) )& - -MYF( (PVM(:,:,IKB+1:IKB+1)-PVM(:,:,IKB:IKB)) / & - MYM(PDZZ(:,:,IKB+1:IKB+1)) * PDZX(:,:,IKB+1:IKB+1) & - ) / MXF(MYM( 0.5*(PDXX(:,:,IKB:IKB)+PDXX(:,:,IKB+1:IKB+1)) ) )& - ) - ! - ! dynamic production - PDP(:,:,:) = PDP(:,:,:) + ZWORK(:,:,:) - ! -END IF -! -! Storage in the LES configuration -! -IF (LLES_CALL .AND. KSPLT==1) THEN - CALL SECOND_MNH(ZTIME1) - CALL LES_MEAN_SUBGRID( MXF(MYF(ZFLX)), X_LES_SUBGRID_UV ) - CALL LES_MEAN_SUBGRID( MXF(MYF(GY_U_UV(PUM,PDYY,PDZZ,PDZY)*ZFLX)), X_LES_RES_ddxa_U_SBG_UaU , .TRUE.) - CALL LES_MEAN_SUBGRID( MXF(MYF(GX_V_UV(PVM,PDXX,PDZZ,PDZX)*ZFLX)), X_LES_RES_ddxa_V_SBG_UaV , .TRUE.) - CALL SECOND_MNH(ZTIME2) - XTIME_LES = XTIME_LES + ZTIME2 - ZTIME1 -END IF -! -! -END SUBROUTINE TURB_HOR_UV diff --git a/src/mesonh/turb/turb_hor_uw.f90 b/src/mesonh/turb/turb_hor_uw.f90 deleted file mode 100644 index d19c68bae..000000000 --- a/src/mesonh/turb/turb_hor_uw.f90 +++ /dev/null @@ -1,299 +0,0 @@ -!MNH_LIC Copyright 1994-2021 CNRS, Meteo-France and Universite Paul Sabatier -!MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence -!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt -!MNH_LIC for details. version 1. -!----------------------------------------------------------------- -! ####################### - MODULE MODI_TURB_HOR_UW -! ####################### -! -INTERFACE -! - SUBROUTINE TURB_HOR_UW(KSPLT, & - OTURB_FLX,KRR, & - TPFILE, & - PK,PINV_PDXX,PINV_PDZZ,PMZM_PRHODJ, & - PDXX,PDZZ,PDZX, & - PRHODJ,PTHVREF, & - PUM,PWM,PTHLM,PRM,PSVM, & - PTKEM,PLM, & - PDP, & - PRUS,PRWS ) -! -USE MODD_IO, ONLY: TFILEDATA -! -INTEGER, INTENT(IN) :: KSPLT ! split process index -LOGICAL, INTENT(IN) :: OTURB_FLX ! switch to write the - ! turbulent fluxes in the syncronous FM-file -INTEGER, INTENT(IN) :: KRR ! number of moist var. -TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! Output file -! - -REAL, DIMENSION(:,:,:), INTENT(IN) :: PK ! Turbulent diffusion doef. - ! PK = PLM * SQRT(PTKEM) -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDXX ! 1./PDXX -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDZZ ! 1./PDZZ -REAL, DIMENSION(:,:,:), INTENT(IN) :: PMZM_PRHODJ ! MZM(PRHODJ) -REAL, DIMENSION(:,:,:), INTENT(IN) :: PDXX, PDZZ, PDZX - ! Metric coefficients -REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! density * grid volume -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHVREF ! ref. state VPT -! -! Variables at t-1 -REAL, DIMENSION(:,:,:), INTENT(IN) :: PUM,PWM,PTHLM -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRM -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PSVM -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTKEM ! TKE at time t- dt -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLM ! Turb. mixing length -! -REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRUS, PRWS -REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PDP ! TKE production terms -! -! -! -! -END SUBROUTINE TURB_HOR_UW -! -END INTERFACE -! -END MODULE MODI_TURB_HOR_UW -! ################################################################ - SUBROUTINE TURB_HOR_UW(KSPLT, & - OTURB_FLX,KRR, & - TPFILE, & - PK,PINV_PDXX,PINV_PDZZ,PMZM_PRHODJ, & - PDXX,PDZZ,PDZX, & - PRHODJ,PTHVREF, & - PUM,PWM,PTHLM,PRM,PSVM, & - PTKEM,PLM, & - PDP, & - PRUS,PRWS ) -! ################################################################ -! -! -!!**** *TURB_HOR* -routine to compute the source terms in the meso-NH -!! model equations due to the non-vertical turbulent fluxes. -!! -!! PURPOSE -!! ------- -!! -!! see TURB_HOR -!! -!!** METHOD -!! ------ -!! -!! EXTERNAL -!! -------- -!! -!! IMPLICIT ARGUMENTS -!! ------------------ -!! -!! REFERENCE -!! --------- -!! -!! AUTHOR -!! ------ -!! -!! Joan Cuxart * INM and Meteo-France * -!! -!! MODIFICATIONS -!! ------------- -!! Aug , 1997 (V. Saravane) spliting of TURB_HOR -!! Nov 27, 1997 (V. Masson) clearing of the routine -!! Oct 18, 2000 (V. Masson) LES computations + LFLAT switch -!! Feb 14, 2001 (V. Masson and J. Stein) DZF bug on PRWS -!! + remove the use of W=0 at the ground -!! + extrapolation under the ground -!! Nov 06, 2002 (V. Masson) LES budgets -!! October 2009 (G. Tanguy) add ILENCH=LEN(YCOMMENT) after -!! change of YCOMMENT -!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O -!! -------------------------------------------------------------------------- -! -!* 0. DECLARATIONS -! ------------ -! -USE MODD_CST -USE MODD_CONF -USE MODD_CTURB -use modd_field, only: tfielddata, TYPEREAL -USE MODD_IO, ONLY: TFILEDATA -USE MODD_PARAMETERS -USE MODD_LES -USE MODD_NSV -! -USE MODE_IO_FIELD_WRITE, only: IO_Field_write -! -USE MODI_GRADIENT_M -USE MODI_GRADIENT_U -USE MODI_GRADIENT_V -USE MODI_GRADIENT_W -USE MODI_SHUMAN -USE MODI_COEFJ -USE MODI_LES_MEAN_SUBGRID -! -USE MODI_SECOND_MNH -! -IMPLICIT NONE -! -! -!* 0.1 declaration of arguments -! -! -! -INTEGER, INTENT(IN) :: KSPLT ! split process index -LOGICAL, INTENT(IN) :: OTURB_FLX ! switch to write the - ! turbulent fluxes in the syncronous FM-file -INTEGER, INTENT(IN) :: KRR ! number of moist var. -TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! Output file -! - -REAL, DIMENSION(:,:,:), INTENT(IN) :: PK ! Turbulent diffusion doef. - ! PK = PLM * SQRT(PTKEM) -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDXX ! 1./PDXX -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDZZ ! 1./PDZZ -REAL, DIMENSION(:,:,:), INTENT(IN) :: PMZM_PRHODJ ! MZM(PRHODJ) -REAL, DIMENSION(:,:,:), INTENT(IN) :: PDXX, PDZZ, PDZX - ! Metric coefficients -REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! density * grid volume -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHVREF ! ref. state VPT -! -! Variables at t-1 -REAL, DIMENSION(:,:,:), INTENT(IN) :: PUM,PWM,PTHLM -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRM -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PSVM -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTKEM ! TKE at time t- dt -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLM ! Turb. mixing length -! -REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRUS, PRWS -REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PDP ! TKE production terms -! -! -! -! -!* 0.2 declaration of local variables -! -REAL, DIMENSION(SIZE(PWM,1),SIZE(PWM,2),SIZE(PWM,3)) & - :: ZFLX,ZWORK - ! work arrays -! -INTEGER :: IKB,IKE,IKU - ! Index values for the Beginning and End - ! mass points of the domain -INTEGER :: JSV ! scalar loop counter -! -REAL, DIMENSION(SIZE(PWM,1),SIZE(PWM,2),SIZE(PWM,3)) :: GX_W_UW_PWM -! -REAL :: ZTIME1, ZTIME2 -TYPE(TFIELDDATA) :: TZFIELD -! --------------------------------------------------------------------------- -! -!* 1. PRELIMINARY COMPUTATIONS -! ------------------------ -! -IKB = 1+JPVEXT -IKE = SIZE(PWM,3)-JPVEXT -IKU = SIZE(PWM,3) -! -! -GX_W_UW_PWM = GX_W_UW(PWM,PDXX,PDZZ,PDZX) -! -! -!* 13. < U'W'> -! ------- -! -! residual part of < U'W'> depending on dw/dx -! -ZFLX(:,:,:) = & - - XCMFS * MXM(MZM(PK)) * GX_W_UW_PWM -!! & to be tested -!! - (2./3.) * XCMFB * MZM( ZVPTU * MXM( PLM / SQRT(PTKEM) * XG / PTHVREF ) ) -! -ZFLX(:,:,IKE+1) = 0. ! rigid wall condition => no turbulent flux -! -! Nullify the flux at the ground level because it has been fully taken into -! account in turb_ver and extrapolate the flux under the ground -ZFLX(:,:,IKB) = 0. -ZFLX(:,:,IKB-1)=2.*ZFLX(:,:,IKB)- ZFLX(:,:,IKB+1) -! -! stores <U W> -IF ( tpfile%lopened .AND. OTURB_FLX ) THEN - TZFIELD%CMNHNAME = 'UW_HFLX' - TZFIELD%CSTDNAME = '' - TZFIELD%CLONGNAME = 'UW_HFLX' - TZFIELD%CUNITS = 'm2 s-2' - TZFIELD%CDIR = 'XY' - TZFIELD%CCOMMENT = 'X_Y_Z_UW_HFLX' - TZFIELD%NGRID = 6 - TZFIELD%NTYPE = TYPEREAL - TZFIELD%NDIMS = 3 - TZFIELD%LTIMEDEP = .TRUE. - CALL IO_Field_write(TPFILE,TZFIELD,ZFLX) -END IF -! -! -! compute the source for rho*U due to this residual flux ( the other part is -! taken into account in TURB_VER) -PRUS(:,:,:) = PRUS(:,:,:) - DZF( ZFLX* MXM( PMZM_PRHODJ ) / MXM( PDZZ ) ) -! -!computation of the source for rho*W due to this flux -IF (.NOT. LFLAT) THEN - PRWS(:,:,:) = PRWS(:,:,:) & - -DXF( MZM( MXM(PRHODJ) * PINV_PDXX) * ZFLX) & - +DZM( PRHODJ * MXF( MZF( ZFLX*PDZX ) * PINV_PDXX ) / MZF(PDZZ) ) -ELSE - PRWS(:,:,:) = PRWS(:,:,:) -DXF( MZM( MXM(PRHODJ) * PINV_PDXX) * ZFLX) -END IF -! -IF (KSPLT==1) THEN - ! - !Contribution to the dynamic production of TKE: - ! - ZWORK(:,:,:) =-MZF( MXF( & - ZFLX *( GZ_U_UW(PUM,PDZZ) + GX_W_UW_PWM ) ) ) - ! - ! - ! evaluate the dynamic production at w(IKB+1) in PDP(IKB) - ZWORK(:,:,IKB:IKB) = - MXF ( & - ZFLX(:,:,IKB+1:IKB+1) * & - ( (PUM(:,:,IKB+1:IKB+1)-PUM(:,:,IKB:IKB)) / MXM(PDZZ(:,:,IKB+1:IKB+1))& - + ( DXM( PWM(:,:,IKB+1:IKB+1) ) & - -MXM( (PWM(:,:,IKB+2:IKB+2)-PWM(:,:,IKB+1:IKB+1)) & - /(PDZZ(:,:,IKB+2:IKB+2)+PDZZ(:,:,IKB+1:IKB+1)) & - +(PWM(:,:,IKB+1:IKB+1)-PWM(:,:,IKB :IKB )) & - /(PDZZ(:,:,IKB+1:IKB+1)+PDZZ(:,:,IKB :IKB )) & - ) & - * PDZX(:,:,IKB+1:IKB+1) & - ) / (0.5*(PDXX(:,:,IKB+1:IKB+1)+PDXX(:,:,IKB:IKB))) & - ) ) - ! - ! dynamic production computation - PDP(:,:,:) = PDP(:,:,:) + ZWORK(:,:,:) - ! -END IF -! -! Storage in the LES configuration (addition to TURB_VER computation) -! -IF (LLES_CALL .AND. KSPLT==1) THEN - CALL SECOND_MNH(ZTIME1) - CALL LES_MEAN_SUBGRID( MZF(MXF(ZFLX)), X_LES_SUBGRID_WU , .TRUE. ) - CALL LES_MEAN_SUBGRID( MZF(MXF(GZ_U_UW(PUM,PDZZ)*ZFLX)), X_LES_RES_ddxa_U_SBG_UaU , .TRUE.) - CALL LES_MEAN_SUBGRID( MZF(MXF(GX_W_UW_PWM*ZFLX)), X_LES_RES_ddxa_W_SBG_UaW , .TRUE.) - CALL LES_MEAN_SUBGRID( MXF(GX_M_U(1,IKU,1,PTHLM,PDXX,PDZZ,PDZX)*MZF(ZFLX)),& - X_LES_RES_ddxa_Thl_SBG_UaW , .TRUE.) - IF (KRR>=1) THEN - CALL LES_MEAN_SUBGRID( MXF(GX_M_U(1,IKU,1,PRM(:,:,:,1),PDXX,PDZZ,PDZX)*MZF(ZFLX)), & - X_LES_RES_ddxa_Rt_SBG_UaW , .TRUE.) - END IF - DO JSV=1,NSV - CALL LES_MEAN_SUBGRID( MXF(GX_M_U(1,IKU,1,PSVM(:,:,:,JSV),PDXX,PDZZ,PDZX)*MZF(ZFLX)), & - X_LES_RES_ddxa_Sv_SBG_UaW(:,:,:,JSV) , .TRUE.) - END DO - CALL SECOND_MNH(ZTIME2) - XTIME_LES = XTIME_LES + ZTIME2 - ZTIME1 -END IF - -! -END SUBROUTINE TURB_HOR_UW diff --git a/src/mesonh/turb/turb_hor_vw.f90 b/src/mesonh/turb/turb_hor_vw.f90 deleted file mode 100644 index df888c2c7..000000000 --- a/src/mesonh/turb/turb_hor_vw.f90 +++ /dev/null @@ -1,307 +0,0 @@ -!MNH_LIC Copyright 1994-2021 CNRS, Meteo-France and Universite Paul Sabatier -!MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence -!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt -!MNH_LIC for details. version 1. -!----------------------------------------------------------------- -! ####################### - MODULE MODI_TURB_HOR_VW -! ####################### -! -INTERFACE -! - SUBROUTINE TURB_HOR_VW(KSPLT, & - OTURB_FLX,KRR, & - TPFILE, & - PK,PINV_PDYY,PINV_PDZZ,PMZM_PRHODJ, & - PDYY,PDZZ,PDZY, & - PRHODJ,PTHVREF, & - PVM,PWM,PTHLM,PRM,PSVM, & - PTKEM,PLM, & - PDP, & - PRVS,PRWS ) -! -USE MODD_IO, ONLY: TFILEDATA -! -INTEGER, INTENT(IN) :: KSPLT ! split process index -LOGICAL, INTENT(IN) :: OTURB_FLX ! switch to write the - ! turbulent fluxes in the syncronous FM-file -INTEGER, INTENT(IN) :: KRR ! number of moist var. -TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! Output file -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PK ! Turbulent diffusion doef. - ! PK = PLM * SQRT(PTKEM) -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDYY ! 1./PDYY -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDZZ ! 1./PDZZ -REAL, DIMENSION(:,:,:), INTENT(IN) :: PMZM_PRHODJ ! MZM(PRHODJ) -REAL, DIMENSION(:,:,:), INTENT(IN) :: PDYY, PDZZ, PDZY - ! Metric coefficients -REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! density * grid volume -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHVREF ! ref. state VPT -! -! Variables at t-1 -REAL, DIMENSION(:,:,:), INTENT(IN) :: PVM,PWM,PTHLM -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRM -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PSVM -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTKEM ! TKE at time t- dt -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLM ! Turb. mixing length -! -REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRVS, PRWS ! var. at t+1 -split- -REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PDP ! TKE production terms -! -END SUBROUTINE TURB_HOR_VW -! -END INTERFACE -! -END MODULE MODI_TURB_HOR_VW -! ################################################################ - SUBROUTINE TURB_HOR_VW(KSPLT, & - OTURB_FLX,KRR, & - TPFILE, & - PK,PINV_PDYY,PINV_PDZZ,PMZM_PRHODJ, & - PDYY,PDZZ,PDZY, & - PRHODJ,PTHVREF, & - PVM,PWM,PTHLM,PRM,PSVM, & - PTKEM,PLM, & - PDP, & - PRVS,PRWS ) -! ################################################################ -! -! -!!**** *TURB_HOR* -routine to compute the source terms in the meso-NH -!! model equations due to the non-vertical turbulent fluxes. -!! -!! PURPOSE -!! ------- -!! -!! see TURB_HOR -!! -!!** METHOD -!! ------ -!! -!! EXTERNAL -!! -------- -!! -!! IMPLICIT ARGUMENTS -!! ------------------ -!! -!! REFERENCE -!! --------- -!! -!! AUTHOR -!! ------ -!! -!! Joan Cuxart * INM and Meteo-France * -!! -!! MODIFICATIONS -!! ------------- -!! Aug , 1997 (V. Saravane) spliting of TURB_HOR -!! Nov 27, 1997 (V. Masson) clearing of the routine -!! Oct 18, 2000 (V. Masson) LES computations + LFLAT switch -!! Feb 14, 2001 (V. Masson and J. Stein) DZF bug on PRWS -!! + remove the use of W=0 at the ground -!! + extrapolataion under the ground -!! Nov 06, 2002 (V. Masson) LES budgets -!! October 2009 (G. Tanguy) add ILENCH=LEN(YCOMMENT) after -!! change of YCOMMENT -!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O -!! -------------------------------------------------------------------------- -! -!* 0. DECLARATIONS -! ------------ -! -USE MODD_CST -USE MODD_CONF -USE MODD_CTURB -use modd_field, only: tfielddata, TYPEREAL -USE MODD_IO, ONLY: TFILEDATA -USE MODD_PARAMETERS -USE MODD_LES -USE MODD_NSV -! -USE MODE_IO_FIELD_WRITE, only: IO_Field_write -! -USE MODI_GRADIENT_M -USE MODI_GRADIENT_U -USE MODI_GRADIENT_V -USE MODI_GRADIENT_W -USE MODI_SHUMAN -USE MODI_COEFJ -USE MODI_LES_MEAN_SUBGRID -! -USE MODI_SECOND_MNH -! -IMPLICIT NONE -! -! -!* 0.1 declaration of arguments -! -! -! -INTEGER, INTENT(IN) :: KSPLT ! split process index -LOGICAL, INTENT(IN) :: OTURB_FLX ! switch to write the - ! turbulent fluxes in the syncronous FM-file -INTEGER, INTENT(IN) :: KRR ! number of moist var. -TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! Output file -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PK ! Turbulent diffusion doef. - ! PK = PLM * SQRT(PTKEM) -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDYY ! 1./PDYY -REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDZZ ! 1./PDZZ -REAL, DIMENSION(:,:,:), INTENT(IN) :: PMZM_PRHODJ ! MZM(PRHODJ) -REAL, DIMENSION(:,:,:), INTENT(IN) :: PDYY, PDZZ, PDZY - ! Metric coefficients -REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! density * grid volume -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHVREF ! ref. state VPT -! -! Variables at t-1 -REAL, DIMENSION(:,:,:), INTENT(IN) :: PVM,PWM,PTHLM -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRM -REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PSVM -! -REAL, DIMENSION(:,:,:), INTENT(IN) :: PTKEM ! TKE at time t- dt -REAL, DIMENSION(:,:,:), INTENT(IN) :: PLM ! Turb. mixing length -! -REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRVS, PRWS ! var. at t+1 -split- -REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PDP ! TKE production terms -! -! -! -!* 0.2 declaration of local variables -! -REAL, DIMENSION(SIZE(PWM,1),SIZE(PWM,2),SIZE(PWM,3)) & - :: ZFLX,ZWORK - ! work arrays -! -!! REAL, DIMENSION(SIZE(PWM,1),SIZE(PWM,2),SIZE(PWM,3)) :: ZVPTV -INTEGER :: IKB,IKE,IKU - ! Index values for the Beginning and End - ! mass points of the domain -INTEGER :: JSV ! scalar loop counter -! -REAL, DIMENSION(SIZE(PWM,1),SIZE(PWM,2),SIZE(PWM,3)) :: GY_W_VW_PWM -! -REAL :: ZTIME1, ZTIME2 -TYPE(TFIELDDATA) :: TZFIELD -! --------------------------------------------------------------------------- -! -!* 1. PRELIMINARY COMPUTATIONS -! ------------------------ -! -IKB = 1+JPVEXT -IKE = SIZE(PWM,3)-JPVEXT -IKU = SIZE(PWM,3) -! -! -IF (.NOT. L2D) GY_W_VW_PWM = GY_W_VW(PWM,PDYY,PDZZ,PDZY) -! -! -!* 14. < V'W'> -! ------- -! -! residual part of < V'W'> depending on dw/dy -! -IF (.NOT. L2D) THEN - ZFLX(:,:,:) = & - - XCMFS * MYM(MZM(PK)) * GY_W_VW_PWM - !! & to be tested - !! - (2./3.) * XCMFB * MZM( ZVPTV * MYM( PLM / SQRT(PTKEM) * XG / PTHVREF ) ) -ELSE - ZFLX(:,:,:) = 0. - !! & to be tested - !! - (2./3.) * XCMFB * MZM( ZVPTV * MYM( PLM / SQRT(PTKEM) * XG / PTHVREF ) ) -END IF -! -ZFLX(:,:,IKE+1) = 0. ! rigid wall condition => no turbulent flux -! -! -! Nullify the flux at the ground level because it has been fully taken into -! account in turb_ver and extrapolate the flux under the ground -ZFLX(:,:,IKB) = 0. -ZFLX(:,:,IKB-1)= 2.*ZFLX(:,:,IKB) - ZFLX(:,:,IKB+1) -! -! stores <V W> -IF ( tpfile%lopened .AND. OTURB_FLX ) THEN - TZFIELD%CMNHNAME = 'VW_HFLX' - TZFIELD%CSTDNAME = '' - TZFIELD%CLONGNAME = 'VW_HFLX' - TZFIELD%CUNITS = 'm2 s-2' - TZFIELD%CDIR = 'XY' - TZFIELD%CCOMMENT = 'X_Y_Z_VW_HFLX' - TZFIELD%NGRID = 7 - TZFIELD%NTYPE = TYPEREAL - TZFIELD%NDIMS = 3 - TZFIELD%LTIMEDEP = .TRUE. - CALL IO_Field_write(TPFILE,TZFIELD,ZFLX) -END IF -! -! compute the source for rho*V due to this residual flux ( the other part is -! taken into account in TURB_VER) -IF (.NOT. L2D) & -PRVS(:,:,:) = PRVS(:,:,:) - DZF( ZFLX* MYM( PMZM_PRHODJ ) / MYM ( PDZZ ) ) -! -!computation of the source for rho*W due to this flux -IF (.NOT. L2D) THEN - IF (.NOT. LFLAT) THEN - PRWS(:,:,:) = PRWS(:,:,:) & - -DYF( MZM( MYM(PRHODJ) * PINV_PDYY) * ZFLX) & - +DZM( PRHODJ * MYF( MZF( ZFLX*PDZY ) * PINV_PDYY ) / MZF(PDZZ) ) - ELSE - PRWS(:,:,:) = PRWS(:,:,:) - DYF( MZM( MYM(PRHODJ) * PINV_PDYY) * ZFLX) - END IF -END IF -! -IF (KSPLT==1) THEN - ! - !Contribution to the dynamic production of TKE: - ! - IF (.NOT. L2D) THEN - ZWORK(:,:,:) =-MZF( MYF( ZFLX *( GZ_V_VW(PVM,PDZZ) + GY_W_VW_PWM ) ) ) - ! - ! - ! evaluate the dynamic production at w(IKB+1) in PDP(IKB) - ZWORK(:,:,IKB:IKB) = - MYF ( & - ZFLX(:,:,IKB+1:IKB+1) * & - ( (PVM(:,:,IKB+1:IKB+1)-PVM(:,:,IKB:IKB)) / MYM(PDZZ(:,:,IKB+1:IKB+1)) & - + ( DYM( PWM(:,:,IKB+1:IKB+1) ) & - -MYM( (PWM(:,:,IKB+2:IKB+2)-PWM(:,:,IKB+1:IKB+1)) & - /(PDZZ(:,:,IKB+2:IKB+2)+PDZZ(:,:,IKB+1:IKB+1)) & - +(PWM(:,:,IKB+1:IKB+1)-PWM(:,:,IKB :IKB )) & - /(PDZZ(:,:,IKB+1:IKB+1)+PDZZ(:,:,IKB :IKB )) & - ) * PDZY(:,:,IKB+1:IKB+1) & - ) / (0.5*(PDYY(:,:,IKB+1:IKB+1)+PDYY(:,:,IKB:IKB))) & - ) ) - ENDIF - ! - ! dynamic production computation - IF (.NOT. L2D) & - PDP(:,:,:) = PDP(:,:,:) + ZWORK(:,:,:) - ! -END IF -! -! Storage in the LES configuration (addition to TURB_VER computation) -! -IF (LLES_CALL .AND. KSPLT==1) THEN - CALL SECOND_MNH(ZTIME1) - CALL LES_MEAN_SUBGRID( MZF(MYF(ZFLX)), X_LES_SUBGRID_WV , .TRUE. ) - CALL LES_MEAN_SUBGRID( MZF(MYF(GZ_V_VW(PVM,PDZZ)*ZFLX)),& - X_LES_RES_ddxa_V_SBG_UaV , .TRUE.) - CALL LES_MEAN_SUBGRID( MZF(MYF(GY_W_VW(PWM,PDYY,PDZZ,PDZY)*ZFLX)),& - X_LES_RES_ddxa_W_SBG_UaW , .TRUE.) - CALL LES_MEAN_SUBGRID( MXF(GY_M_V(1,IKU,1,PTHLM,PDYY,PDZZ,PDZY)*MZF(ZFLX)),& - X_LES_RES_ddxa_Thl_SBG_UaW , .TRUE.) - IF (KRR>=1) THEN - CALL LES_MEAN_SUBGRID( MXF(GY_M_V(1,IKU,1,PRM(:,:,:,1),PDYY,PDZZ,PDZY)*MZF(ZFLX)), & - X_LES_RES_ddxa_Rt_SBG_UaW , .TRUE.) - END IF - DO JSV=1,NSV - CALL LES_MEAN_SUBGRID( MXF(GY_M_V(1,IKU,1,PSVM(:,:,:,JSV),PDYY,PDZZ,PDZY)*MZF(ZFLX)), & - X_LES_RES_ddxa_Sv_SBG_UaW(:,:,:,JSV), .TRUE.) - END DO - CALL SECOND_MNH(ZTIME2) - XTIME_LES = XTIME_LES + ZTIME2 - ZTIME1 -END IF -! -! -! -END SUBROUTINE TURB_HOR_VW -- GitLab