From fef9ac31afa63f8920e5b27c82965ac7fd6122e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Riette?= <sebastien.riette@meteo.fr> Date: Wed, 1 Dec 2021 09:22:02 +0100 Subject: [PATCH] =?UTF-8?q?S=C3=A9bastien=2001/12/2021=20AROME->COMMON=20r?= =?UTF-8?q?=3Fcol*?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/arome/gmkpack_ignored_files | 30 +- src/arome/micro/ini_lima_cold_mixed.F90 | 6 +- src/arome/micro/ini_rain_ice.F90 | 6 +- src/arome/micro/modi_rrcolss.F90 | 44 --- src/arome/micro/modi_rscolrg.F90 | 44 --- src/arome/micro/modi_rzcolx.F90 | 44 --- .../micro/mode_rrcolss.F90} | 32 +- .../micro/mode_rscolrg.F90} | 32 +- .../micro/mode_rzcolx.F90} | 32 +- src/mesonh/micro/ini_lima_cold_mixed.f90 | 6 +- src/mesonh/micro/ini_rain_ice.f90 | 6 +- src/mesonh/micro/ini_rain_ice_elec.f90 | 6 +- src/mesonh/micro/rrcolss.f90 | 312 ------------------ src/mesonh/micro/rscolrg.f90 | 312 ------------------ src/mesonh/micro/rzcolx.f90 | 271 --------------- 15 files changed, 99 insertions(+), 1084 deletions(-) delete mode 100644 src/arome/micro/modi_rrcolss.F90 delete mode 100644 src/arome/micro/modi_rscolrg.F90 delete mode 100644 src/arome/micro/modi_rzcolx.F90 rename src/{arome/micro/rrcolss.F90 => common/micro/mode_rrcolss.F90} (91%) rename src/{arome/micro/rscolrg.F90 => common/micro/mode_rscolrg.F90} (91%) rename src/{arome/micro/rzcolx.F90 => common/micro/mode_rzcolx.F90} (89%) delete mode 100644 src/mesonh/micro/rrcolss.f90 delete mode 100644 src/mesonh/micro/rscolrg.f90 delete mode 100644 src/mesonh/micro/rzcolx.f90 diff --git a/src/arome/gmkpack_ignored_files b/src/arome/gmkpack_ignored_files index 3202323fe..3d2cd872c 100644 --- a/src/arome/gmkpack_ignored_files +++ b/src/arome/gmkpack_ignored_files @@ -58,15 +58,21 @@ phyex/micro/modi_gamma.F90 phyex/micro/modi_gamma_inc.F90 phyex/micro/modi_general_gamma.F90 phyex/micro/moddb_intbudget.F90 -arome/micro/read_xker_gweth.F90 -arome/micro/read_xker_raccs.F90 -arome/micro/read_xker_rdryg.F90 -arome/micro/read_xker_rweth.F90 -arome/micro/read_xker_sdryg.F90 -arome/micro/read_xker_sweth.F90 -arome/micro/modi_read_xker_gweth.F90 -arome/micro/modi_read_xker_raccs.F90 -arome/micro/modi_read_xker_rdryg.F90 -arome/micro/modi_read_xker_rweth.F90 -arome/micro/modi_read_xker_sdryg.F90 -arome/micro/modi_read_xker_sweth.F90 +phyex/micro/read_xker_gweth.F90 +phyex/micro/read_xker_raccs.F90 +phyex/micro/read_xker_rdryg.F90 +phyex/micro/read_xker_rweth.F90 +phyex/micro/read_xker_sdryg.F90 +phyex/micro/read_xker_sweth.F90 +phyex/micro/modi_read_xker_gweth.F90 +phyex/micro/modi_read_xker_raccs.F90 +phyex/micro/modi_read_xker_rdryg.F90 +phyex/micro/modi_read_xker_rweth.F90 +phyex/micro/modi_read_xker_sdryg.F90 +phyex/micro/modi_read_xker_sweth.F90 +phyex/micro/modi_rrcolss.F90 +phyex/micro/modi_rscolrg.F90 +phyex/micro/modi_rzcolx.F90 +phyex/micro/rrcolss.F90 +phyex/micro/rscolrg.F90 +phyex/micro/rzcolx.F90 diff --git a/src/arome/micro/ini_lima_cold_mixed.F90 b/src/arome/micro/ini_lima_cold_mixed.F90 index e7382825f..79d0d993b 100644 --- a/src/arome/micro/ini_lima_cold_mixed.F90 +++ b/src/arome/micro/ini_lima_cold_mixed.F90 @@ -53,9 +53,9 @@ USE MODD_LUNIT USE MODI_LIMA_FUNCTIONS USE MODI_GAMMA USE MODI_GAMMA_INC -USE MODI_RRCOLSS -USE MODI_RZCOLX -USE MODI_RSCOLRG +USE MODE_RRCOLSS, ONLY: RRCOLSS +USE MODE_RZCOLX, ONLY: RZCOLX +USE MODE_RSCOLRG, ONLY: RSCOLRG USE MODI_READ_XKER_RACCS, ONLY: READ_XKER_RACCS USE MODI_READ_XKER_SDRYG, ONLY: READ_XKER_SDRYG USE MODI_READ_XKER_RDRYG, ONLY: READ_XKER_RDRYG diff --git a/src/arome/micro/ini_rain_ice.F90 b/src/arome/micro/ini_rain_ice.F90 index 906baadaa..023e0e268 100644 --- a/src/arome/micro/ini_rain_ice.F90 +++ b/src/arome/micro/ini_rain_ice.F90 @@ -91,9 +91,9 @@ USE MODD_REF ! USE MODI_GAMMA USE MODI_GAMMA_INC -USE MODI_RRCOLSS -USE MODI_RZCOLX -USE MODI_RSCOLRG +USE MODE_RRCOLSS, ONLY: RRCOLSS +USE MODE_RZCOLX, ONLY: RZCOLX +USE MODE_RSCOLRG, ONLY: RSCOLRG USE MODE_READ_XKER_RACCS, ONLY: READ_XKER_RACCS USE MODE_READ_XKER_SDRYG, ONLY: READ_XKER_SDRYG USE MODE_READ_XKER_RDRYG, ONLY: READ_XKER_RDRYG diff --git a/src/arome/micro/modi_rrcolss.F90 b/src/arome/micro/modi_rrcolss.F90 deleted file mode 100644 index 0b338486c..000000000 --- a/src/arome/micro/modi_rrcolss.F90 +++ /dev/null @@ -1,44 +0,0 @@ -! ######spl - MODULE MODI_RRCOLSS -! ################### -! -INTERFACE -! - SUBROUTINE RRCOLSS( KND, PALPHAS, PNUS, PALPHAR, PNUR, & - PESR, PEXMASSR, PFALLS, PEXFALLS, PFALLR, PEXFALLR, & - PLBDASMAX, PLBDARMAX, PLBDASMIN, PLBDARMIN, & - PDINFTY, PRRCOLSS, PAG, PBS, PAS ) -! -INTEGER, INTENT(IN) :: KND ! Number of discrete size intervals in DS and DR -! -REAL, INTENT(IN) :: PALPHAS ! First shape parameter of the aggregates - ! size distribution (generalized gamma law) -REAL, INTENT(IN) :: PNUS ! Second shape parameter of the aggregates - ! size distribution (generalized gamma law) -REAL, INTENT(IN) :: PALPHAR ! First shape parameter of the rain - ! size distribution (generalized gamma law) -REAL, INTENT(IN) :: PNUR ! Second shape parameter of the rain - ! size distribution (generalized gamma law) -REAL, INTENT(IN) :: PESR ! Efficiency of aggregates collecting rain -REAL, INTENT(IN) :: PEXMASSR ! Mass exponent of rain -REAL, INTENT(IN) :: PFALLS ! Fall speed constant of aggregates -REAL, INTENT(IN) :: PEXFALLS ! Fall speed exponent of aggregates -REAL, INTENT(IN) :: PFALLR ! Fall speed constant of rain -REAL, INTENT(IN) :: PEXFALLR ! Fall speed exponent of rain -REAL, INTENT(IN) :: PLBDASMAX ! Maximun slope of size distribution of aggregates -REAL, INTENT(IN) :: PLBDARMAX ! Maximun slope of size distribution of rain -REAL, INTENT(IN) :: PLBDASMIN ! Minimun slope of size distribution of aggregates -REAL, INTENT(IN) :: PLBDARMIN ! Minimun slope of size distribution of rain -REAL, INTENT(IN) :: PDINFTY ! Factor to define the largest diameter up to - ! which the diameter integration is performed -REAL, INTENT(IN) :: PAG, PBS, PAS -! -REAL, DIMENSION(:,:), INTENT(INOUT) :: PRRCOLSS! Scaled fall speed difference in - ! the mass collection kernel as a - ! function of LAMBDAX and LAMBDAZ -! - END SUBROUTINE RRCOLSS -! -END INTERFACE -! - END MODULE MODI_RRCOLSS diff --git a/src/arome/micro/modi_rscolrg.F90 b/src/arome/micro/modi_rscolrg.F90 deleted file mode 100644 index b757707ee..000000000 --- a/src/arome/micro/modi_rscolrg.F90 +++ /dev/null @@ -1,44 +0,0 @@ -! ######spl - MODULE MODI_RSCOLRG -! ################### -! -INTERFACE -! - SUBROUTINE RSCOLRG( KND, PALPHAS, PZNUS, PALPHAR, PNUR, & - PESR, PEXMASSS, PFALLS, PEXFALLS, PFALLR, PEXFALLR, & - PLBDASMAX, PLBDARMAX, PLBDASMIN, PLBDARMIN, & - PDINFTY, PRSCOLRG,PAG, PBS, PAS ) -! -INTEGER, INTENT(IN) :: KND ! Number of discrete size intervals in DS and DR -! -REAL, INTENT(IN) :: PALPHAS ! First shape parameter of the aggregates - ! size distribution (generalized gamma law) -REAL, INTENT(IN) :: PZNUS ! Second shape parameter of the aggregates - ! size distribution (generalized gamma law) -REAL, INTENT(IN) :: PALPHAR ! First shape parameter of the rain - ! size distribution (generalized gamma law) -REAL, INTENT(IN) :: PNUR ! Second shape parameter of the rain - ! size distribution (generalized gamma law) -REAL, INTENT(IN) :: PESR ! Efficiency of the aggregates collecting rain -REAL, INTENT(IN) :: PEXMASSS ! Mass exponent of the aggregates -REAL, INTENT(IN) :: PFALLS ! Fall speed constant of the aggregates -REAL, INTENT(IN) :: PEXFALLS ! Fall speed exponent of the aggregates -REAL, INTENT(IN) :: PFALLR ! Fall speed constant of rain -REAL, INTENT(IN) :: PEXFALLR ! Fall speed exponent of rain -REAL, INTENT(IN) :: PLBDASMAX ! Maximun slope of size distribution of the aggregates -REAL, INTENT(IN) :: PLBDARMAX ! Maximun slope of size distribution of rain -REAL, INTENT(IN) :: PLBDASMIN ! Minimun slope of size distribution of the aggregates -REAL, INTENT(IN) :: PLBDARMIN ! Minimun slope of size distribution of rain -REAL, INTENT(IN) :: PDINFTY ! Factor to define the largest diameter up to - ! which the diameter integration is performed -REAL, INTENT(IN) :: PAG, PBS, PAS -! -REAL, DIMENSION(:,:), INTENT(INOUT) :: PRSCOLRG! Scaled fall speed difference in - ! the mass collection kernel as a - ! function of LAMBDAX and LAMBDAZ -! - END SUBROUTINE RSCOLRG -! -END INTERFACE -! - END MODULE MODI_RSCOLRG diff --git a/src/arome/micro/modi_rzcolx.F90 b/src/arome/micro/modi_rzcolx.F90 deleted file mode 100644 index c097817ab..000000000 --- a/src/arome/micro/modi_rzcolx.F90 +++ /dev/null @@ -1,44 +0,0 @@ -! ######spl - MODULE MODI_RZCOLX -! ################## -! -INTERFACE -! - SUBROUTINE RZCOLX( KND, PALPHAX, PNUX, PALPHAZ, PNUZ, & - PEXZ, PEXMASSZ, PFALLX, PEXFALLX, PFALLZ, PEXFALLZ, & - PLBDAXMAX, PLBDAZMAX, PLBDAXMIN, PLBDAZMIN, & - PDINFTY, PRZCOLX ) -! -INTEGER, INTENT(IN) :: KND ! Number of discrete size intervals in DX and DZ -! -! -REAL, INTENT(IN) :: PALPHAX ! First shape parameter of the specy X - ! size distribution (generalized gamma law) -REAL, INTENT(IN) :: PNUX ! Second shape parameter of the specy X - ! size distribution (generalized gamma law) -REAL, INTENT(IN) :: PALPHAZ ! First shape parameter of the specy Z - ! size distribution (generalized gamma law) -REAL, INTENT(IN) :: PNUZ ! Second shape parameter of the specy Z - ! size distribution (generalized gamma law) -REAL, INTENT(IN) :: PEXZ ! Efficiency of specy X collecting specy Z -REAL, INTENT(IN) :: PEXMASSZ ! Mass exponent of specy Z -REAL, INTENT(IN) :: PFALLX ! Fall speed constant of specy X -REAL, INTENT(IN) :: PEXFALLX ! Fall speed exponent of specy X -REAL, INTENT(IN) :: PFALLZ ! Fall speed constant of specy Z -REAL, INTENT(IN) :: PEXFALLZ ! Fall speed exponent of specy Z -REAL, INTENT(IN) :: PLBDAXMAX ! Maximun slope of size distribution of specy X -REAL, INTENT(IN) :: PLBDAZMAX ! Maximun slope of size distribution of specy Z -REAL, INTENT(IN) :: PLBDAXMIN ! Minimun slope of size distribution of specy X -REAL, INTENT(IN) :: PLBDAZMIN ! Minimun slope of size distribution of specy Z -REAL, INTENT(IN) :: PDINFTY ! Factor to define the largest diameter up to - ! which the diameter integration is performed -! -REAL, DIMENSION(:,:), INTENT(INOUT) :: PRZCOLX ! Scaled fall speed difference in - ! the mass collection kernel as a - ! function of LAMBDAX and LAMBDAZ -! - END SUBROUTINE RZCOLX -! -END INTERFACE -! - END MODULE MODI_RZCOLX diff --git a/src/arome/micro/rrcolss.F90 b/src/common/micro/mode_rrcolss.F90 similarity index 91% rename from src/arome/micro/rrcolss.F90 rename to src/common/micro/mode_rrcolss.F90 index 75c4b2673..44a16802e 100644 --- a/src/arome/micro/rrcolss.F90 +++ b/src/common/micro/mode_rrcolss.F90 @@ -1,4 +1,14 @@ -! ######spl +!MNH_LIC Copyright 1995-2019 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_RRCOLSS +! ################### +! +IMPLICIT NONE +CONTAINS SUBROUTINE RRCOLSS( KND, PALPHAS, PNUS, PALPHAR, PNUR, & PESR, PEXMASSR, PFALLS, PEXFALLS, PFALLR, PEXFALLR, & PLBDASMAX, PLBDARMAX, PLBDASMIN, PLBDARMIN, & @@ -69,7 +79,8 @@ !! ------------- !! Original 8/11/95 !! -!! +! P. Wautelet 26/04/2019: replace non-standard FLOAT function by REAL function +! !------------------------------------------------------------------------------- ! ! @@ -171,8 +182,8 @@ ZCST1 = (3.0/XPI)/XRHOLW ! !* 1.1 Compute the growth rate of the slope factors LAMBDA ! -ZDLBDAS = EXP( LOG(PLBDASMAX/PLBDASMIN)/FLOAT(SIZE(PRRCOLSS(:,:),1)-1) ) -ZDLBDAR = EXP( LOG(PLBDARMAX/PLBDARMIN)/FLOAT(SIZE(PRRCOLSS(:,:),2)-1) ) +ZDLBDAS = EXP( LOG(PLBDASMAX/PLBDASMIN)/REAL(SIZE(PRRCOLSS(:,:),1)-1) ) +ZDLBDAR = EXP( LOG(PLBDARMAX/PLBDARMIN)/REAL(SIZE(PRRCOLSS(:,:),2)-1) ) ! !* 1.2 Scan the slope factors LAMBDAX and LAMBDAZ ! @@ -181,7 +192,7 @@ DO JLBDAS = 1,SIZE(PRRCOLSS(:,:),1) ! !* 1.3 Compute the diameter steps ! - ZDDS = PDINFTY / (FLOAT(KND) * ZLBDAS) + ZDDS = PDINFTY / (REAL(KND) * ZLBDAS) DO JLBDAR = 1,SIZE(PRRCOLSS(:,:),2) ZLBDAR = PLBDARMIN * ZDLBDAR ** (JLBDAR-1) ! @@ -192,16 +203,16 @@ DO JLBDAS = 1,SIZE(PRRCOLSS(:,:),1) ! !* 1.5 Compute the diameter steps ! - ZDDSCALR = PDINFTY / (FLOAT(KND) * ZLBDAR) + ZDDSCALR = PDINFTY / (REAL(KND) * ZLBDAR) ! !* 1.6 Scan over the diameters DS and DR ! DO JDS = 1,KND-1 - ZDS = ZDDS * FLOAT(JDS) + ZDS = ZDDS * REAL(JDS) ZSCALR = 0.0 ZCOLLR = 0.0 DO JDR = 1,KND-1 - ZDR = ZDDSCALR * FLOAT(JDR) + ZDR = ZDDSCALR * REAL(JDR) ! !* 1.7 Compute the normalization factor by integration over the ! dimensional spectrum of rain @@ -223,13 +234,13 @@ DO JLBDAS = 1,SIZE(PRRCOLSS(:,:),1) ! corresponding to a maximal density of the aggregates of XRHOLW IF( ZDRMAX >= 0.5*ZDDSCALR ) THEN INR = CEILING( ZDRMAX/ZDDSCALR ) - ZDDCOLLR = ZDRMAX / FLOAT(INR) + ZDDCOLLR = ZDRMAX / REAL(INR) IF (INR>=KND ) THEN INR = KND ZDDCOLLR = ZDDSCALR END IF DO JDR = 1,INR-1 - ZDR = ZDDCOLLR * FLOAT(JDR) + ZDR = ZDDCOLLR * REAL(JDR) ZCOLLR = ZCOLLR + (ZDS+ZDR)**2 * ZDR**PEXMASSR & * PESR * ABS(PFALLS*ZDS**PEXFALLS-PFALLR*ZDR**PEXFALLR) & * GENERAL_GAMMA(PALPHAR,PNUR,ZLBDAR,ZDR) @@ -265,3 +276,4 @@ END DO ! IF (LHOOK) CALL DR_HOOK('RRCOLSS',1,ZHOOK_HANDLE) END SUBROUTINE RRCOLSS +END MODULE MODE_RRCOLSS diff --git a/src/arome/micro/rscolrg.F90 b/src/common/micro/mode_rscolrg.F90 similarity index 91% rename from src/arome/micro/rscolrg.F90 rename to src/common/micro/mode_rscolrg.F90 index 8889cbe57..127bb24f1 100644 --- a/src/arome/micro/rscolrg.F90 +++ b/src/common/micro/mode_rscolrg.F90 @@ -1,4 +1,14 @@ -! ######spl +!MNH_LIC Copyright 1995-2019 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_RSCOLRG +! ################### +! +IMPLICIT NONE +CONTAINS SUBROUTINE RSCOLRG( KND, PALPHAS, PZNUS, PALPHAR, PNUR, & PESR, PEXMASSS, PFALLS, PEXFALLS, PFALLR, PEXFALLR, & PLBDASMAX, PLBDARMAX, PLBDASMIN, PLBDARMIN, & @@ -69,7 +79,8 @@ !! ------------- !! Original 8/11/95 !! -!! +! P. Wautelet 26/04/2019: replace non-standard FLOAT function by REAL function +! !------------------------------------------------------------------------------- ! ! @@ -168,8 +179,8 @@ ZCST1 = (3.0/XPI)/XRHOLW ! !* 1.1 Compute the growth rate of the slope factors LAMBDA ! -ZDLBDAR = EXP( LOG(PLBDARMAX/PLBDARMIN)/FLOAT(SIZE(PRSCOLRG(:,:),1)-1) ) -ZDLBDAS = EXP( LOG(PLBDASMAX/PLBDASMIN)/FLOAT(SIZE(PRSCOLRG(:,:),2)-1) ) +ZDLBDAR = EXP( LOG(PLBDARMAX/PLBDARMIN)/REAL(SIZE(PRSCOLRG(:,:),1)-1) ) +ZDLBDAS = EXP( LOG(PLBDASMAX/PLBDASMIN)/REAL(SIZE(PRSCOLRG(:,:),2)-1) ) ! !* 1.2 Scan the slope factors LAMBDAX and LAMBDAZ ! @@ -179,7 +190,7 @@ DO JLBDAR = 1,SIZE(PRSCOLRG(:,:),1) ! !* 1.3 Compute the diameter steps ! - ZDDSCALR = PDINFTY / (FLOAT(KND) * ZLBDAR) + ZDDSCALR = PDINFTY / (REAL(KND) * ZLBDAR) DO JLBDAS = 1,SIZE(PRSCOLRG(:,:),2) ZLBDAS = PLBDASMIN * ZDLBDAS ** (JLBDAS-1) ! @@ -190,16 +201,16 @@ DO JLBDAR = 1,SIZE(PRSCOLRG(:,:),1) ! !* 1.5 Compute the diameter steps ! - ZDDS = PDINFTY / (FLOAT(KND) * ZLBDAS) + ZDDS = PDINFTY / (REAL(KND) * ZLBDAS) ! !* 1.6 Scan over the diameters DS and DR ! DO JDS = 1,KND-1 - ZDS = ZDDS * FLOAT(JDS) + ZDS = ZDDS * REAL(JDS) ZSCALR = 0.0 ZCOLLR = 0.0 DO JDR = 1,KND-1 - ZDR = ZDDSCALR * FLOAT(JDR) + ZDR = ZDDSCALR * REAL(JDR) ! !* 1.7 Compute the normalization factor by integration over the ! dimensional spectrum of rain @@ -220,9 +231,9 @@ DO JLBDAR = 1,SIZE(PRSCOLRG(:,:),1) ! corresponding to a maximal density of the aggregates of XRHOLW IF( (ZDRMAX-ZDRMIN) >= 0.5*ZDDSCALR ) THEN INR = CEILING( (ZDRMAX-ZDRMIN)/ZDDSCALR ) - ZDDCOLLR = (ZDRMAX-ZDRMIN) / FLOAT(INR) + ZDDCOLLR = (ZDRMAX-ZDRMIN) / REAL(INR) DO JDR = 1,INR-1 - ZDR = ZDDCOLLR * FLOAT(JDR) + ZDRMIN + ZDR = ZDDCOLLR * REAL(JDR) + ZDRMIN ZCOLLR = ZCOLLR + (ZDS+ZDR)**2 & * GENERAL_GAMMA(PALPHAR,PNUR,ZLBDAR,ZDR) & * PESR * ABS(PFALLS*ZDS**PEXFALLS-PFALLR*ZDR**PEXFALLR) @@ -265,3 +276,4 @@ END DO ! IF (LHOOK) CALL DR_HOOK('RSCOLRG',1,ZHOOK_HANDLE) END SUBROUTINE RSCOLRG +END MODULE MODE_RSCOLRG diff --git a/src/arome/micro/rzcolx.F90 b/src/common/micro/mode_rzcolx.F90 similarity index 89% rename from src/arome/micro/rzcolx.F90 rename to src/common/micro/mode_rzcolx.F90 index 76b291335..72e419b41 100644 --- a/src/arome/micro/rzcolx.F90 +++ b/src/common/micro/mode_rzcolx.F90 @@ -1,4 +1,14 @@ -! ######spl +!MNH_LIC Copyright 1995-2019 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_RZCOLX +! ################## +! +IMPLICIT NONE +CONTAINS SUBROUTINE RZCOLX( KND, PALPHAX, PNUX, PALPHAZ, PNUZ, & PEXZ, PEXMASSZ, PFALLX, PEXFALLX, PFALLZ, PEXFALLZ, & PLBDAXMAX, PLBDAZMAX, PLBDAXMIN, PLBDAZMIN, & @@ -73,7 +83,8 @@ !! ------------- !! Original 8/11/95 !! -!! +! P. Wautelet 26/04/2019: replace non-standard FLOAT function by REAL function +! !------------------------------------------------------------------------------- ! ! @@ -114,8 +125,8 @@ REAL, INTENT(IN) :: PDINFTY ! Factor to define the largest diameter up to ! which the diameter integration is performed ! REAL, DIMENSION(:,:), INTENT(INOUT) :: PRZCOLX ! Scaled fall speed difference in - ! the mass collection kernel as a - ! function of LAMBDAX and LAMBDAZ + ! the mass collection kernel as a + ! function of LAMBDAX and LAMBDAZ ! ! !* 0.2 Declarations of local variables @@ -160,8 +171,8 @@ REAL :: ZFUNC ! Ancillary function ! REAL(KIND=JPRB) :: ZHOOK_HANDLE IF (LHOOK) CALL DR_HOOK('RZCOLX',0,ZHOOK_HANDLE) -ZDLBDAX = EXP( LOG(PLBDAXMAX/PLBDAXMIN)/FLOAT(SIZE(PRZCOLX(:,:),1)-1) ) -ZDLBDAZ = EXP( LOG(PLBDAZMAX/PLBDAZMIN)/FLOAT(SIZE(PRZCOLX(:,:),2)-1) ) +ZDLBDAX = EXP( LOG(PLBDAXMAX/PLBDAXMIN)/REAL(SIZE(PRZCOLX(:,:),1)-1) ) +ZDLBDAZ = EXP( LOG(PLBDAZMAX/PLBDAZMIN)/REAL(SIZE(PRZCOLX(:,:),2)-1) ) ! !* 1.2 Scan the slope factors LAMBDAX and LAMBDAZ ! @@ -177,18 +188,18 @@ DO JLBDAX = 1,SIZE(PRZCOLX(:,:),1) ! !* 1.4 Compute the diameter steps ! - ZDDX = PDINFTY / (FLOAT(KND) * ZLBDAX) - ZDDZ = PDINFTY / (FLOAT(KND) * ZLBDAZ) + ZDDX = PDINFTY / (REAL(KND) * ZLBDAX) + ZDDZ = PDINFTY / (REAL(KND) * ZLBDAZ) ! !* 1.5 Scan over the diameters DX and DZ ! DO JDX = 1,KND-1 - ZDX = ZDDX * FLOAT(JDX) + ZDX = ZDDX * REAL(JDX) ! ZSCALZ = 0.0 ZCOLLZ = 0.0 DO JDZ = 1,KND-1 - ZDZ = ZDDZ * FLOAT(JDZ) + ZDZ = ZDDZ * REAL(JDZ) ! !* 1.6 Compute the normalization factor by integration over the ! dimensional spectrum of specy Z @@ -224,3 +235,4 @@ END DO ! IF (LHOOK) CALL DR_HOOK('RZCOLX',1,ZHOOK_HANDLE) END SUBROUTINE RZCOLX +END MODULE MODE_RZCOLX diff --git a/src/mesonh/micro/ini_lima_cold_mixed.f90 b/src/mesonh/micro/ini_lima_cold_mixed.f90 index cb427cdb4..101626b4d 100644 --- a/src/mesonh/micro/ini_lima_cold_mixed.f90 +++ b/src/mesonh/micro/ini_lima_cold_mixed.f90 @@ -61,9 +61,9 @@ use mode_msg USE MODI_LIMA_FUNCTIONS USE MODI_GAMMA USE MODI_GAMMA_INC -USE MODI_RRCOLSS -USE MODI_RZCOLX -USE MODI_RSCOLRG +USE MODE_RRCOLSS, ONLY: RRCOLSS +USE MODE_RZCOLX, ONLY: RZCOLX +USE MODE_RSCOLRG, ONLY: RSCOLRG USE MODI_LIMA_READ_XKER_RACCS USE MODI_LIMA_READ_XKER_SDRYG USE MODI_LIMA_READ_XKER_RDRYG diff --git a/src/mesonh/micro/ini_rain_ice.f90 b/src/mesonh/micro/ini_rain_ice.f90 index e07e02723..7f8bb85b0 100644 --- a/src/mesonh/micro/ini_rain_ice.f90 +++ b/src/mesonh/micro/ini_rain_ice.f90 @@ -118,9 +118,9 @@ USE MODD_REF ! USE MODI_GAMMA USE MODI_GAMMA_INC -USE MODI_RRCOLSS -USE MODI_RZCOLX -USE MODI_RSCOLRG +USE MODE_RRCOLSS, ONLY: RRCOLSS +USE MODE_RZCOLX, ONLY: RZCOLX +USE MODE_RSCOLRG, ONLY: RSCOLRG USE MODE_READ_XKER_RACCS, ONLY: READ_XKER_RACCS USE MODE_READ_XKER_SDRYG, ONLY: READ_XKER_SDRYG USE MODE_READ_XKER_RDRYG, ONLY: READ_XKER_RDRYG diff --git a/src/mesonh/micro/ini_rain_ice_elec.f90 b/src/mesonh/micro/ini_rain_ice_elec.f90 index 9a98c8b0f..85fbe6fea 100644 --- a/src/mesonh/micro/ini_rain_ice_elec.f90 +++ b/src/mesonh/micro/ini_rain_ice_elec.f90 @@ -106,9 +106,9 @@ USE MODD_ELEC_DESCR, ONLY : XFS USE MODI_MOMG USE MODI_GAMMA USE MODI_GAMMA_INC -USE MODI_RRCOLSS -USE MODI_RZCOLX -USE MODI_RSCOLRG +USE MODE_RRCOLSS, ONLY: RRCOLSS +USE MODE_RZCOLX, ONLY: RZCOLX +USE MODE_RSCOLRG, ONLY: RSCOLRG USE MODE_READ_XKER_RACCS, ONLY: READ_XKER_RACCS USE MODE_READ_XKER_SDRYG, ONLY: READ_XKER_SDRYG USE MODE_READ_XKER_RDRYG, ONLY: READ_XKER_RDRYG diff --git a/src/mesonh/micro/rrcolss.f90 b/src/mesonh/micro/rrcolss.f90 deleted file mode 100644 index 527165111..000000000 --- a/src/mesonh/micro/rrcolss.f90 +++ /dev/null @@ -1,312 +0,0 @@ -!MNH_LIC Copyright 1995-2019 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_RRCOLSS -! ################### -! -INTERFACE -! - SUBROUTINE RRCOLSS( KND, PALPHAS, PNUS, PALPHAR, PNUR, & - PESR, PEXMASSR, PFALLS, PEXFALLS, PFALLR, PEXFALLR, & - PLBDASMAX, PLBDARMAX, PLBDASMIN, PLBDARMIN, & - PDINFTY, PRRCOLSS, PAG, PBS, PAS ) -! -INTEGER, INTENT(IN) :: KND ! Number of discrete size intervals in DS and DR -! -REAL, INTENT(IN) :: PALPHAS ! First shape parameter of the aggregates - ! size distribution (generalized gamma law) -REAL, INTENT(IN) :: PNUS ! Second shape parameter of the aggregates - ! size distribution (generalized gamma law) -REAL, INTENT(IN) :: PALPHAR ! First shape parameter of the rain - ! size distribution (generalized gamma law) -REAL, INTENT(IN) :: PNUR ! Second shape parameter of the rain - ! size distribution (generalized gamma law) -REAL, INTENT(IN) :: PESR ! Efficiency of aggregates collecting rain -REAL, INTENT(IN) :: PEXMASSR ! Mass exponent of rain -REAL, INTENT(IN) :: PFALLS ! Fall speed constant of aggregates -REAL, INTENT(IN) :: PEXFALLS ! Fall speed exponent of aggregates -REAL, INTENT(IN) :: PFALLR ! Fall speed constant of rain -REAL, INTENT(IN) :: PEXFALLR ! Fall speed exponent of rain -REAL, INTENT(IN) :: PLBDASMAX ! Maximun slope of size distribution of aggregates -REAL, INTENT(IN) :: PLBDARMAX ! Maximun slope of size distribution of rain -REAL, INTENT(IN) :: PLBDASMIN ! Minimun slope of size distribution of aggregates -REAL, INTENT(IN) :: PLBDARMIN ! Minimun slope of size distribution of rain -REAL, INTENT(IN) :: PDINFTY ! Factor to define the largest diameter up to - ! which the diameter integration is performed -REAL, INTENT(IN) :: PAG, PBS, PAS -! -REAL, DIMENSION(:,:), INTENT(INOUT) :: PRRCOLSS! Scaled fall speed difference in - ! the mass collection kernel as a - ! function of LAMBDAX and LAMBDAZ -! - END SUBROUTINE RRCOLSS -! -END INTERFACE -! - END MODULE MODI_RRCOLSS -! ######################################################################## - SUBROUTINE RRCOLSS( KND, PALPHAS, PNUS, PALPHAR, PNUR, & - PESR, PEXMASSR, PFALLS, PEXFALLS, PFALLR, PEXFALLR, & - PLBDASMAX, PLBDARMAX, PLBDASMIN, PLBDARMIN, & - PDINFTY, PRRCOLSS, PAG, PBS, PAS ) -! ######################################################################## -! -! -! -!!**** * - Build up a look-up table containing the scaled fall speed -!! difference between size distributed particles of aggregates and Z -!! -!! -!! PURPOSE -!! ------- -!! The purpose of this routine is to integrate numerically the scaled fall -!! speed difference between aggregates and rain for use in collection -!! kernels. A first integral of the form -!! -!! infty Dz_max -!! / / -!! |{| } -!! |{| E_xz (Dx+Dz)^2 |cxDx^dx-czDz^dz| Dz^bz n(Dz) dDz} n(Dx) dDx -!! |{| } -!! / / -!! 0 Dz_min -!! -!! is evaluated and normalised by a second integral of the form -!! -!! infty -!! / / -!! |{| } -!! |{| (Dx+Dz)^2 Dz^bz n(Dz) dDz} n(Dx) dDx -!! |{| } -!! / / -!! 0 -!! -!! The result is stored in a two-dimensional array. -!! -!!** METHOD -!! ------ -!! The free parameters of the size distribution function of aggregates and Z -!! (slope parameter LAMBDA) are discretized with a geometrical rate in a -!! specific range -!! LAMBDA = exp( (Log(LAMBDA_max) - Log(LAMBDA_min))/N_interval ) -!! The two above integrals are performed using the trapezoidal scheme. -!! -!! EXTERNAL -!! -------- -!! MODI_GENERAL_GAMMA: Generalized gamma distribution law -!! -!! IMPLICIT ARGUMENTS -!! ------------------ -!! MODD_CST : XPI,XRHOLW -!! MODD_RAIN_ICE_DESCR: XAS,XAS,XBS -!! -!! REFERENCE -!! --------- -!! B.S. Ferrier , 1994 : A Double-Moment Multiple-Phase Four-Class -!! Bulk Ice Scheme,JAS,51,249-280. -!! -!! AUTHOR -!! ------ -!! J.-P. Pinty * Laboratoire d'Aerologie * -!! -!! MODIFICATIONS -!! ------------- -!! Original 8/11/95 -!! -! P. Wautelet 26/04/2019: replace non-standard FLOAT function by REAL function -! -!------------------------------------------------------------------------------- -! -! -!* 0. DECLARATIONS -! ------------ -! -! -USE MODI_GENERAL_GAMMA -! -USE MODD_CST -USE MODD_RAIN_ICE_DESCR -! -IMPLICIT NONE -! -! -!* 0.1 Declarations of dummy arguments -! ------------------------------- -! -! -INTEGER, INTENT(IN) :: KND ! Number of discrete size intervals in DS and DR -! -REAL, INTENT(IN) :: PALPHAS ! First shape parameter of the aggregates - ! size distribution (generalized gamma law) -REAL, INTENT(IN) :: PNUS ! Second shape parameter of the aggregates - ! size distribution (generalized gamma law) -REAL, INTENT(IN) :: PALPHAR ! First shape parameter of the rain - ! size distribution (generalized gamma law) -REAL, INTENT(IN) :: PNUR ! Second shape parameter of the rain - ! size distribution (generalized gamma law) -REAL, INTENT(IN) :: PESR ! Efficiency of aggregates collecting rain -REAL, INTENT(IN) :: PEXMASSR ! Mass exponent of rain -REAL, INTENT(IN) :: PFALLS ! Fall speed constant of aggregates -REAL, INTENT(IN) :: PEXFALLS ! Fall speed exponent of aggregates -REAL, INTENT(IN) :: PFALLR ! Fall speed constant of rain -REAL, INTENT(IN) :: PEXFALLR ! Fall speed exponent of rain -REAL, INTENT(IN) :: PLBDASMAX ! Maximun slope of size distribution of aggregates -REAL, INTENT(IN) :: PLBDARMAX ! Maximun slope of size distribution of rain -REAL, INTENT(IN) :: PLBDASMIN ! Minimun slope of size distribution of aggregates -REAL, INTENT(IN) :: PLBDARMIN ! Minimun slope of size distribution of rain -REAL, INTENT(IN) :: PDINFTY ! Factor to define the largest diameter up to - ! which the diameter integration is performed -REAL, INTENT(IN) :: PAG, PBS, PAS -! -REAL, DIMENSION(:,:), INTENT(INOUT) :: PRRCOLSS! Scaled fall speed difference in - ! the mass collection kernel as a - ! function of LAMBDAX and LAMBDAZ -! -! -!* 0.2 Declarations of local variables -! ------------------------------- -! -! -INTEGER :: JLBDAS ! Slope index of the size distribution of aggregates -INTEGER :: JLBDAR ! Slope index of the size distribution of rain -INTEGER :: JDS ! Diameter index of a particle of aggregates -INTEGER :: JDR ! Diameter index of a particle of rain -! -INTEGER :: INR ! Number of diameter step for the partial integration -! -! -REAL :: ZLBDAS ! Current slope parameter LAMBDA of aggregates -REAL :: ZLBDAR ! Current slope parameter LAMBDA of rain -REAL :: ZDLBDAS ! Growth rate of the slope parameter LAMBDA of aggregates -REAL :: ZDLBDAR ! Growth rate of the slope parameter LAMBDA of rain -REAL :: ZDDS ! Integration step of the diameter of aggregates -REAL :: ZDDSCALR! Integration step of the diameter of rain (scaling integral) -REAL :: ZDDCOLLR! Integration step of the diameter of rain (fallspe integral) -REAL :: ZDS ! Current diameter of the particle aggregates -REAL :: ZDR ! Current diameter of the rain -REAL :: ZDRMAX ! Maximal diameter of the raindrops where the integration ends -REAL :: ZCOLLR ! Single integral of the mass weighted fall speed difference - ! over the spectrum of rain -REAL :: ZCOLLDRMAX ! Maximum ending point for the partial integral -REAL :: ZCOLLSR ! Double integral of the mass weighted fall speed difference - ! over the spectra of aggregates and rain -REAL :: ZSCALR ! Single integral of the scaling factor over - ! the spectrum of rain -REAL :: ZSCALSR ! Double integral of the scaling factor over - ! the spectra of aggregates and rain -REAL :: ZFUNC ! Ancillary function -REAL :: ZCST1 -! -! -!------------------------------------------------------------------------------- -! -! -!* 1 COMPUTE THE SCALED VELOCITY DIFFERENCE IN THE MASS -!* COLLECTION KERNEL, -! ------------------------------------------------- -! -! -! -!* 1.0 Initialization -! -PRRCOLSS(:,:) = 0.0 -ZCST1 = (3.0/XPI)/XRHOLW -! -!* 1.1 Compute the growth rate of the slope factors LAMBDA -! -ZDLBDAS = EXP( LOG(PLBDASMAX/PLBDASMIN)/REAL(SIZE(PRRCOLSS(:,:),1)-1) ) -ZDLBDAR = EXP( LOG(PLBDARMAX/PLBDARMIN)/REAL(SIZE(PRRCOLSS(:,:),2)-1) ) -! -!* 1.2 Scan the slope factors LAMBDAX and LAMBDAZ -! -DO JLBDAS = 1,SIZE(PRRCOLSS(:,:),1) - ZLBDAS = PLBDASMIN * ZDLBDAS ** (JLBDAS-1) -! -!* 1.3 Compute the diameter steps -! - ZDDS = PDINFTY / (REAL(KND) * ZLBDAS) - DO JLBDAR = 1,SIZE(PRRCOLSS(:,:),2) - ZLBDAR = PLBDARMIN * ZDLBDAR ** (JLBDAR-1) -! -!* 1.4 Initialize the collection integrals -! - ZSCALSR = 0.0 - ZCOLLSR = 0.0 -! -!* 1.5 Compute the diameter steps -! - ZDDSCALR = PDINFTY / (REAL(KND) * ZLBDAR) -! -!* 1.6 Scan over the diameters DS and DR -! - DO JDS = 1,KND-1 - ZDS = ZDDS * REAL(JDS) - ZSCALR = 0.0 - ZCOLLR = 0.0 - DO JDR = 1,KND-1 - ZDR = ZDDSCALR * REAL(JDR) -! -!* 1.7 Compute the normalization factor by integration over the -! dimensional spectrum of rain -! - ZSCALR = ZSCALR + (ZDS+ZDR)**2 * ZDR**PEXMASSR & - * GENERAL_GAMMA(PALPHAR,PNUR,ZLBDAR,ZDR) - END DO -! -!* 1.8 Compute the scaled fall speed difference by partial -! integration over the dimensional spectrum of rain -! - ZFUNC = PAG - PAS*ZDS**(PBS-3.0) ! approximate limit is Ds=240 microns - IF( ZFUNC>0.0 ) THEN - ZDRMAX = ZDS*( ZCST1*ZFUNC )**0.3333333 - ELSE - ZDRMAX = PDINFTY / ZLBDAR - END IF - IF( ZDS>1.0E-4 ) THEN ! allow computation if Ds>100 microns - ! corresponding to a maximal density of the aggregates of XRHOLW - IF( ZDRMAX >= 0.5*ZDDSCALR ) THEN - INR = CEILING( ZDRMAX/ZDDSCALR ) - ZDDCOLLR = ZDRMAX / REAL(INR) - IF (INR>=KND ) THEN - INR = KND - ZDDCOLLR = ZDDSCALR - END IF - DO JDR = 1,INR-1 - ZDR = ZDDCOLLR * REAL(JDR) - ZCOLLR = ZCOLLR + (ZDS+ZDR)**2 * ZDR**PEXMASSR & - * PESR * ABS(PFALLS*ZDS**PEXFALLS-PFALLR*ZDR**PEXFALLR) & - * GENERAL_GAMMA(PALPHAR,PNUR,ZLBDAR,ZDR) - END DO - ZCOLLDRMAX = (ZDS+ZDRMAX)**2 * ZDRMAX**PEXMASSR & - * PESR * ABS(PFALLS*ZDS**PEXFALLS-PFALLR*ZDRMAX**PEXFALLR) & - * GENERAL_GAMMA(PALPHAR,PNUR,ZLBDAR,ZDRMAX) - ZCOLLR = (ZCOLLR + 0.5*ZCOLLDRMAX)*(ZDDCOLLR/ZDDSCALR) -! -!* 1.9 Compute the normalization factor by integration over the -! dimensional spectrum of aggregates -! - ZFUNC = GENERAL_GAMMA(PALPHAS,PNUS,ZLBDAS,ZDS) - ZSCALSR = ZSCALSR + ZSCALR * ZFUNC -! -!* 1.10 Compute the scaled fall speed difference by integration over -! the dimensional spectrum of aggregates -! - ZCOLLSR = ZCOLLSR + ZCOLLR * ZFUNC - END IF -! -! Otherwise ZDRMAX = 0.0 so the density of the graupel cannot be reached -! and so PRRCOLSS(JLBDAS,JLBDAR) = 0.0 ! -! - END IF - END DO -! -!* 1.11 Scale the fall speed difference -! - IF( ZSCALSR>0.0 ) PRRCOLSS(JLBDAS,JLBDAR) = ZCOLLSR / ZSCALSR - END DO -END DO -! -END SUBROUTINE RRCOLSS diff --git a/src/mesonh/micro/rscolrg.f90 b/src/mesonh/micro/rscolrg.f90 deleted file mode 100644 index caa868e91..000000000 --- a/src/mesonh/micro/rscolrg.f90 +++ /dev/null @@ -1,312 +0,0 @@ -!MNH_LIC Copyright 1995-2019 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_RSCOLRG -! ################### -! -INTERFACE -! - SUBROUTINE RSCOLRG( KND, PALPHAS, PZNUS, PALPHAR, PNUR, & - PESR, PEXMASSS, PFALLS, PEXFALLS, PFALLR, PEXFALLR, & - PLBDASMAX, PLBDARMAX, PLBDASMIN, PLBDARMIN, & - PDINFTY, PRSCOLRG,PAG, PBS, PAS ) -! -INTEGER, INTENT(IN) :: KND ! Number of discrete size intervals in DS and DR -! -REAL, INTENT(IN) :: PALPHAS ! First shape parameter of the aggregates - ! size distribution (generalized gamma law) -REAL, INTENT(IN) :: PZNUS ! Second shape parameter of the aggregates - ! size distribution (generalized gamma law) -REAL, INTENT(IN) :: PALPHAR ! First shape parameter of the rain - ! size distribution (generalized gamma law) -REAL, INTENT(IN) :: PNUR ! Second shape parameter of the rain - ! size distribution (generalized gamma law) -REAL, INTENT(IN) :: PESR ! Efficiency of the aggregates collecting rain -REAL, INTENT(IN) :: PEXMASSS ! Mass exponent of the aggregates -REAL, INTENT(IN) :: PFALLS ! Fall speed constant of the aggregates -REAL, INTENT(IN) :: PEXFALLS ! Fall speed exponent of the aggregates -REAL, INTENT(IN) :: PFALLR ! Fall speed constant of rain -REAL, INTENT(IN) :: PEXFALLR ! Fall speed exponent of rain -REAL, INTENT(IN) :: PLBDASMAX ! Maximun slope of size distribution of the aggregates -REAL, INTENT(IN) :: PLBDARMAX ! Maximun slope of size distribution of rain -REAL, INTENT(IN) :: PLBDASMIN ! Minimun slope of size distribution of the aggregates -REAL, INTENT(IN) :: PLBDARMIN ! Minimun slope of size distribution of rain -REAL, INTENT(IN) :: PDINFTY ! Factor to define the largest diameter up to - ! which the diameter integration is performed -REAL, INTENT(IN) :: PAG, PBS, PAS -! -REAL, DIMENSION(:,:), INTENT(INOUT) :: PRSCOLRG! Scaled fall speed difference in - ! the mass collection kernel as a - ! function of LAMBDAX and LAMBDAZ -! - END SUBROUTINE RSCOLRG -! -END INTERFACE -! - END MODULE MODI_RSCOLRG -! ######################################################################## - SUBROUTINE RSCOLRG( KND, PALPHAS, PZNUS, PALPHAR, PNUR, & - PESR, PEXMASSS, PFALLS, PEXFALLS, PFALLR, PEXFALLR, & - PLBDASMAX, PLBDARMAX, PLBDASMIN, PLBDARMIN, & - PDINFTY, PRSCOLRG,PAG, PBS, PAS ) -! ######################################################################## -! -! -! -!!**** * - Build up a look-up table containing the scaled fall speed -!! difference between size distributed particles of the aggregates and Z -!! -!! -!! PURPOSE -!! ------- -!! The purpose of this routine is to integrate numerically the scaled fall -!! speed difference between aggregates and rain for use in collection -!! kernels. A first integral of the form -!! -!! infty Dz_max -!! / / -!! |{| } -!! |{| E_xz (Dx+Dz)^2 |cxDx^dx-czDz^dz| Dz^bz n(Dz) dDz} n(Dx) dDx -!! |{| } -!! / / -!! 0 Dz_min -!! -!! is evaluated and normalised by a second integral of the form -!! -!! infty -!! / / -!! |{| } -!! |{| (Dx+Dz)^2 Dz^bz n(Dz) dDz} n(Dx) dDx -!! |{| } -!! / / -!! 0 -!! -!! The result is stored in a two-dimensional array. -!! -!!** METHOD -!! ------ -!! The free parameters of the size distribution function of the aggregates -!! and Z (slope parameter LAMBDA) are discretized with a geometrical rate -!! in a specific range -!! LAMBDA = exp( (Log(LAMBDA_max) - Log(LAMBDA_min))/N_interval ) -!! The two above integrals are performed using the trapezoidal scheme. -!! -!! EXTERNAL -!! -------- -!! MODI_GENERAL_GAMMA: Generalized gamma distribution law -!! -!! IMPLICIT ARGUMENTS -!! ------------------ -!! MODD_CST : XPI,XRHOLW -!! MODD_RAIN_ICE_DESCR: XAS,XAS,XBS -!! -!! REFERENCE -!! --------- -!! B.S. Ferrier , 1994 : A Double-Moment Multiple-Phase Four-Class -!! Bulk Ice Scheme,JAS,51,249-280. -!! -!! AUTHOR -!! ------ -!! J.-P. Pinty * Laboratoire d'Aerologie * -!! -!! MODIFICATIONS -!! ------------- -!! Original 8/11/95 -!! -! P. Wautelet 26/04/2019: replace non-standard FLOAT function by REAL function -! -!------------------------------------------------------------------------------- -! -! -!* 0. DECLARATIONS -! ------------ -! -USE MODI_GENERAL_GAMMA -! -USE MODD_CST -USE MODD_RAIN_ICE_DESCR -! -IMPLICIT NONE -! -!* 0.1 Declarations of dummy arguments -! ------------------------------- -! -! -INTEGER, INTENT(IN) :: KND ! Number of discrete size intervals in DS and DR -! -REAL, INTENT(IN) :: PALPHAS ! First shape parameter of the aggregates - ! size distribution (generalized gamma law) -REAL, INTENT(IN) :: PZNUS ! Second shape parameter of the aggregates - ! size distribution (generalized gamma law) -REAL, INTENT(IN) :: PALPHAR ! First shape parameter of the rain - ! size distribution (generalized gamma law) -REAL, INTENT(IN) :: PNUR ! Second shape parameter of the rain - ! size distribution (generalized gamma law) -REAL, INTENT(IN) :: PESR ! Efficiency of the aggregates collecting rain -REAL, INTENT(IN) :: PEXMASSS ! Mass exponent of the aggregates -REAL, INTENT(IN) :: PFALLS ! Fall speed constant of the aggregates -REAL, INTENT(IN) :: PEXFALLS ! Fall speed exponent of the aggregates -REAL, INTENT(IN) :: PFALLR ! Fall speed constant of rain -REAL, INTENT(IN) :: PEXFALLR ! Fall speed exponent of rain -REAL, INTENT(IN) :: PLBDASMAX ! Maximun slope of size distribution of the aggregates -REAL, INTENT(IN) :: PLBDARMAX ! Maximun slope of size distribution of rain -REAL, INTENT(IN) :: PLBDASMIN ! Minimun slope of size distribution of the aggregates -REAL, INTENT(IN) :: PLBDARMIN ! Minimun slope of size distribution of rain -REAL, INTENT(IN) :: PDINFTY ! Factor to define the largest diameter up to - ! which the diameter integration is performed -REAL, INTENT(IN) :: PAG, PBS, PAS -! -REAL, DIMENSION(:,:), INTENT(INOUT) :: PRSCOLRG! Scaled fall speed difference in - ! the mass collection kernel as a - ! function of LAMBDAX and LAMBDAZ -! -! -!* 0.2 Declarations of local variables -! ------------------------------- -! -! -INTEGER :: JLBDAS ! Slope index of the size distribution of the aggregates -INTEGER :: JLBDAR ! Slope index of the size distribution of rain -INTEGER :: JDS ! Diameter index of a particle of the aggregates -INTEGER :: JDR ! Diameter index of a particle of rain -! -INTEGER :: INR ! Number of diameter step for the partial integration -! -REAL :: ZLBDAS ! Current slope parameter LAMBDA of the aggregates -REAL :: ZLBDAR ! Current slope parameter LAMBDA of rain -REAL :: ZDLBDAS ! Growth rate of the slope parameter LAMBDA of the aggregates -REAL :: ZDLBDAR ! Growth rate of the slope parameter LAMBDA of rain -REAL :: ZDDS ! Integration step of the diameter of the aggregates -REAL :: ZDDSCALR! Integration step of the diameter of rain (scaling integral) -REAL :: ZDDCOLLR! Integration step of the diameter of rain (fallspe integral) -REAL :: ZDS ! Current diameter of the particle aggregates -REAL :: ZDR ! Current diameter of the raindrops -REAL :: ZDRMIN ! Minimal diameter of the raindrops where the integration starts -REAL :: ZDRMAX ! Maximal diameter of the raindrops where the integration ends -REAL :: ZCOLLR ! Single integral of the mass weighted fall speed difference - ! over the spectrum of rain -REAL :: ZCOLLDRMIN ! Minimum ending point for the partial integral -REAL :: ZCOLLSR ! Double integral of the mass weighted fall speed difference - ! over the spectra of the aggregates and rain -REAL :: ZSCALR ! Single integral of the scaling factor over - ! the spectrum of rain -REAL :: ZSCALSR ! Double integral of the scaling factor over - ! the spectra of the aggregates and rain -REAL :: ZFUNC ! Ancillary function -REAL :: ZCST1 -! -! -!------------------------------------------------------------------------------- -! -! -!* 1 COMPUTE THE SCALED VELOCITY DIFFERENCE IN THE MASS -!* COLLECTION KERNEL, -! ------------------------------------------------- -! -! -!* 1.0 Initialization -! -PRSCOLRG(:,:) = 0.0 -ZCST1 = (3.0/XPI)/XRHOLW -! -!* 1.1 Compute the growth rate of the slope factors LAMBDA -! -ZDLBDAR = EXP( LOG(PLBDARMAX/PLBDARMIN)/REAL(SIZE(PRSCOLRG(:,:),1)-1) ) -ZDLBDAS = EXP( LOG(PLBDASMAX/PLBDASMIN)/REAL(SIZE(PRSCOLRG(:,:),2)-1) ) -! -!* 1.2 Scan the slope factors LAMBDAX and LAMBDAZ -! -DO JLBDAR = 1,SIZE(PRSCOLRG(:,:),1) - ZLBDAR = PLBDARMIN * ZDLBDAR ** (JLBDAR-1) - ZDRMAX = PDINFTY / ZLBDAR -! -!* 1.3 Compute the diameter steps -! - ZDDSCALR = PDINFTY / (REAL(KND) * ZLBDAR) - DO JLBDAS = 1,SIZE(PRSCOLRG(:,:),2) - ZLBDAS = PLBDASMIN * ZDLBDAS ** (JLBDAS-1) -! -!* 1.4 Initialize the collection integrals -! - ZSCALSR = 0.0 - ZCOLLSR = 0.0 -! -!* 1.5 Compute the diameter steps -! - ZDDS = PDINFTY / (REAL(KND) * ZLBDAS) -! -!* 1.6 Scan over the diameters DS and DR -! - DO JDS = 1,KND-1 - ZDS = ZDDS * REAL(JDS) - ZSCALR = 0.0 - ZCOLLR = 0.0 - DO JDR = 1,KND-1 - ZDR = ZDDSCALR * REAL(JDR) -! -!* 1.7 Compute the normalization factor by integration over the -! dimensional spectrum of rain -! - ZSCALR = ZSCALR + (ZDS+ZDR)**2 * GENERAL_GAMMA(PALPHAR,PNUR,ZLBDAR,ZDR) - END DO -! -!* 1.8 Compute the scaled fall speed difference by partial -! integration over the dimensional spectrum of rain -! - ZFUNC = PAG - PAS*ZDS**(PBS-3.0) ! approximate limit is Ds=240 microns - IF( ZFUNC>0.0 ) THEN - ZDRMIN = ZDS*( ZCST1*ZFUNC )**0.3333333 - ELSE - ZDRMIN = 0.0 - END IF - IF( ZDS>1.0E-4 ) THEN ! allow computation if Ds>100 microns - ! corresponding to a maximal density of the aggregates of XRHOLW - IF( (ZDRMAX-ZDRMIN) >= 0.5*ZDDSCALR ) THEN - INR = CEILING( (ZDRMAX-ZDRMIN)/ZDDSCALR ) - ZDDCOLLR = (ZDRMAX-ZDRMIN) / REAL(INR) - DO JDR = 1,INR-1 - ZDR = ZDDCOLLR * REAL(JDR) + ZDRMIN - ZCOLLR = ZCOLLR + (ZDS+ZDR)**2 & - * GENERAL_GAMMA(PALPHAR,PNUR,ZLBDAR,ZDR) & - * PESR * ABS(PFALLS*ZDS**PEXFALLS-PFALLR*ZDR**PEXFALLR) - END DO - IF( ZDRMIN>0.0 ) THEN - ZCOLLDRMIN = (ZDS+ZDRMIN)**2 & - * GENERAL_GAMMA(PALPHAR,PNUR,ZLBDAR,ZDRMIN) & - * PESR * ABS(PFALLS*ZDS**PEXFALLS-PFALLR*ZDRMIN**PEXFALLR) - ELSE - ZCOLLDRMIN = 0.0 - END IF - ZCOLLR = (ZCOLLR + 0.5*ZCOLLDRMIN)*(ZDDCOLLR/ZDDSCALR) -! -!* 1.9 Compute the normalization factor by integration over the -! dimensional spectrum of the aggregates -! - ZFUNC = (ZDS**PEXMASSS) * GENERAL_GAMMA(PALPHAS,PZNUS,ZLBDAS,ZDS) - ZSCALSR = ZSCALSR + ZSCALR * ZFUNC -! -!* 1.10 Compute the scaled fall speed difference by integration over -! the dimensional spectrum of the aggregates -! - ZCOLLSR = ZCOLLSR + ZCOLLR * ZFUNC -! -! Otherwise ZDRMIN>ZDRMAX so PRRCOLSS(JLBDAS,JLBDAR) = 0.0 ! -! - END IF -! -! Otherwise ZDRMAX = 0.0 so the density of the graupel cannot be reached -! and so PRRCOLSS(JLBDAS,JLBDAR) = 0.0 ! -! - END IF - END DO -! -!* 1.10 Scale the fall speed difference -! - IF( ZSCALSR>0.0 ) PRSCOLRG(JLBDAR,JLBDAS) = ZCOLLSR / ZSCALSR - END DO -END DO -! -END SUBROUTINE RSCOLRG diff --git a/src/mesonh/micro/rzcolx.f90 b/src/mesonh/micro/rzcolx.f90 deleted file mode 100644 index 28658241c..000000000 --- a/src/mesonh/micro/rzcolx.f90 +++ /dev/null @@ -1,271 +0,0 @@ -!MNH_LIC Copyright 1995-2019 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_RZCOLX -! ################## -! -INTERFACE -! - SUBROUTINE RZCOLX( KND, PALPHAX, PNUX, PALPHAZ, PNUZ, & - PEXZ, PEXMASSZ, PFALLX, PEXFALLX, PFALLZ, PEXFALLZ, & - PLBDAXMAX, PLBDAZMAX, PLBDAXMIN, PLBDAZMIN, & - PDINFTY, PRZCOLX ) -! -INTEGER, INTENT(IN) :: KND ! Number of discrete size intervals in DX and DZ -! -! -REAL, INTENT(IN) :: PALPHAX ! First shape parameter of the specy X - ! size distribution (generalized gamma law) -REAL, INTENT(IN) :: PNUX ! Second shape parameter of the specy X - ! size distribution (generalized gamma law) -REAL, INTENT(IN) :: PALPHAZ ! First shape parameter of the specy Z - ! size distribution (generalized gamma law) -REAL, INTENT(IN) :: PNUZ ! Second shape parameter of the specy Z - ! size distribution (generalized gamma law) -REAL, INTENT(IN) :: PEXZ ! Efficiency of specy X collecting specy Z -REAL, INTENT(IN) :: PEXMASSZ ! Mass exponent of specy Z -REAL, INTENT(IN) :: PFALLX ! Fall speed constant of specy X -REAL, INTENT(IN) :: PEXFALLX ! Fall speed exponent of specy X -REAL, INTENT(IN) :: PFALLZ ! Fall speed constant of specy Z -REAL, INTENT(IN) :: PEXFALLZ ! Fall speed exponent of specy Z -REAL, INTENT(IN) :: PLBDAXMAX ! Maximun slope of size distribution of specy X -REAL, INTENT(IN) :: PLBDAZMAX ! Maximun slope of size distribution of specy Z -REAL, INTENT(IN) :: PLBDAXMIN ! Minimun slope of size distribution of specy X -REAL, INTENT(IN) :: PLBDAZMIN ! Minimun slope of size distribution of specy Z -REAL, INTENT(IN) :: PDINFTY ! Factor to define the largest diameter up to - ! which the diameter integration is performed -! -REAL, DIMENSION(:,:), INTENT(INOUT) :: PRZCOLX ! Scaled fall speed difference in - ! the mass collection kernel as a - ! function of LAMBDAX and LAMBDAZ -! - END SUBROUTINE RZCOLX -! -END INTERFACE -! - END MODULE MODI_RZCOLX -! ######################################################################## - SUBROUTINE RZCOLX( KND, PALPHAX, PNUX, PALPHAZ, PNUZ, & - PEXZ, PEXMASSZ, PFALLX, PEXFALLX, PFALLZ, PEXFALLZ, & - PLBDAXMAX, PLBDAZMAX, PLBDAXMIN, PLBDAZMIN, & - PDINFTY, PRZCOLX ) -! ######################################################################## -! -! -! -!!**** * - Build up a look-up table containing the scaled fall speed -!! difference between size distributed particles of specy X and Z -!! -!! -!! PURPOSE -!! ------- -!! The purpose of this routine is to integrate numerically the scaled fall -!! speed difference between specy X and specy Z for use in collection -!! kernels. A first integral of the form -!! -!! infty -!! / / -!! |{| } -!! |{| E_xz (Dx+Dz)^2 |cxDx^dx-czDz^dz| Dz^bz g(Dz) dDz} g(Dx) dDx -!! |{| } -!! / / -!! 0 -!! -!! is evaluated and normalised by a second integral of the form -!! -!! infty -!! / / -!! |{| } -!! |{| (Dx+Dz)^2 Dz^bz g(Dz) dDz} g(Dx) dDx -!! |{| } -!! / / -!! 0 -!! -!! where E_xz is a collection efficiency, g(D) is the generalized Gamma -!! distribution law. The 'infty' diameter is defined according to the -!! current value of the Lbda that is D_x=PDINFTY/Lbda_x or -!! D_z=PINFTY/Lbda_z. -!! The result is stored in a two-dimensional array. -!! -!!** METHOD -!! ------ -!! The free parameters of the size distribution function of specy X and Z -!! (slope parameter LAMBDA) are discretized with a geometrical rate in a -!! specific range -!! LAMBDA = exp( (Log(LAMBDA_max) - Log(LAMBDA_min))/N_interval ) -!! The two above integrals are performed using the trapezoidal scheme and -!! the [0,infty] interval is discretized over KND values of D_x or D_z. -!! -!! EXTERNAL -!! -------- -!! MODI_GENERAL_GAMMA: Generalized gamma distribution law -!! -!! IMPLICIT ARGUMENTS -!! ------------------ -!! None -!! -!! REFERENCE -!! --------- -!! B.S. Ferrier , 1994 : A Double-Moment Multiple-Phase Four-Class -!! Bulk Ice Scheme,JAS,51,249-280. -!! -!! AUTHOR -!! ------ -!! J.-P. Pinty * Laboratoire d'Aerologie * -!! -!! MODIFICATIONS -!! ------------- -!! Original 8/11/95 -!! -! P. Wautelet 26/04/2019: replace non-standard FLOAT function by REAL function -! -!------------------------------------------------------------------------------- -! -! -!* 0. DECLARATIONS -! ------------ -! -USE MODI_GENERAL_GAMMA -! -IMPLICIT NONE -! -! -!* 0.1 Declarations of dummy arguments -! ------------------------------- -! -! -INTEGER, INTENT(IN) :: KND ! Number of discrete size intervals in DX and DZ -! -! -REAL, INTENT(IN) :: PALPHAX ! First shape parameter of the specy X - ! size distribution (generalized gamma law) -REAL, INTENT(IN) :: PNUX ! Second shape parameter of the specy X - ! size distribution (generalized gamma law) -REAL, INTENT(IN) :: PALPHAZ ! First shape parameter of the specy Z - ! size distribution (generalized gamma law) -REAL, INTENT(IN) :: PNUZ ! Second shape parameter of the specy Z - ! size distribution (generalized gamma law) -REAL, INTENT(IN) :: PEXZ ! Efficiency of specy X collecting specy Z -REAL, INTENT(IN) :: PEXMASSZ ! Mass exponent of specy Z -REAL, INTENT(IN) :: PFALLX ! Fall speed constant of specy X -REAL, INTENT(IN) :: PEXFALLX ! Fall speed exponent of specy X -REAL, INTENT(IN) :: PFALLZ ! Fall speed constant of specy Z -REAL, INTENT(IN) :: PEXFALLZ ! Fall speed exponent of specy Z -REAL, INTENT(IN) :: PLBDAXMAX ! Maximun slope of size distribution of specy X -REAL, INTENT(IN) :: PLBDAZMAX ! Maximun slope of size distribution of specy Z -REAL, INTENT(IN) :: PLBDAXMIN ! Minimun slope of size distribution of specy X -REAL, INTENT(IN) :: PLBDAZMIN ! Minimun slope of size distribution of specy Z -REAL, INTENT(IN) :: PDINFTY ! Factor to define the largest diameter up to - ! which the diameter integration is performed -! -REAL, DIMENSION(:,:), INTENT(INOUT) :: PRZCOLX ! Scaled fall speed difference in - ! the mass collection kernel as a - ! function of LAMBDAX and LAMBDAZ -! -! -!* 0.2 Declarations of local variables -! ------------------------------- -! -! -INTEGER :: JLBDAX ! Slope index of the size distribution of specy X -INTEGER :: JLBDAZ ! Slope index of the size distribution of specy Z -INTEGER :: JDX ! Diameter index of a particle of specy X -INTEGER :: JDZ ! Diameter index of a particle of specy Z -! -! -REAL :: ZLBDAX ! Current slope parameter LAMBDA of specy X -REAL :: ZLBDAZ ! Current slope parameter LAMBDA of specy Z -REAL :: ZDLBDAX ! Growth rate of the slope parameter LAMBDA of specy X -REAL :: ZDLBDAZ ! Growth rate of the slope parameter LAMBDA of specy Z -REAL :: ZDDX ! Integration step of the diameter of specy X -REAL :: ZDDZ ! Integration step of the diameter of specy Z -REAL :: ZDX ! Current diameter of the particle specy X -REAL :: ZDZ ! Current diameter of the particle specy Z -REAL :: ZCOLLZ ! Single integral of the mass weighted fall speed difference - ! over the spectrum of specy Z -REAL :: ZCOLLXZ ! Double integral of the mass weighted fall speed difference - ! over the spectra of specy X and specy Z -REAL :: ZSCALZ ! Single integral of the scaling factor over - ! the spectrum of specy Z -REAL :: ZSCALXZ ! Double integral of the scaling factor over - ! the spectra of specy X and specy Z -REAL :: ZFUNC ! Ancillary function -! -! -!------------------------------------------------------------------------------- -! -! -!* 1 COMPUTE THE SCALED VELOCITZ DIFFERENCE IN THE MASS -!* COLLECTION KERNEL, -! ------------------------------------------------- -! -! -! -!* 1.1 Compute the growth rate of the slope factors LAMBDA -! -ZDLBDAX = EXP( LOG(PLBDAXMAX/PLBDAXMIN)/REAL(SIZE(PRZCOLX(:,:),1)-1) ) -ZDLBDAZ = EXP( LOG(PLBDAZMAX/PLBDAZMIN)/REAL(SIZE(PRZCOLX(:,:),2)-1) ) -! -!* 1.2 Scan the slope factors LAMBDAX and LAMBDAZ -! -DO JLBDAX = 1,SIZE(PRZCOLX(:,:),1) - ZLBDAX = PLBDAXMIN * ZDLBDAX ** (JLBDAX-1) - DO JLBDAZ = 1,SIZE(PRZCOLX(:,:),2) - ZLBDAZ = PLBDAZMIN * ZDLBDAZ ** (JLBDAZ-1) -! -!* 1.3 Initialize the collection integrals -! - ZSCALXZ = 0.0 - ZCOLLXZ = 0.0 -! -!* 1.4 Compute the diameter steps -! - ZDDX = PDINFTY / (REAL(KND) * ZLBDAX) - ZDDZ = PDINFTY / (REAL(KND) * ZLBDAZ) -! -!* 1.5 Scan over the diameters DX and DZ -! - DO JDX = 1,KND-1 - ZDX = ZDDX * REAL(JDX) -! - ZSCALZ = 0.0 - ZCOLLZ = 0.0 - DO JDZ = 1,KND-1 - ZDZ = ZDDZ * REAL(JDZ) -! -!* 1.6 Compute the normalization factor by integration over the -! dimensional spectrum of specy Z -! - ZFUNC = (ZDX+ZDZ)**2 * ZDZ**PEXMASSZ & - * GENERAL_GAMMA(PALPHAZ,PNUZ,ZLBDAZ,ZDZ) - ZSCALZ = ZSCALZ + ZFUNC -! -!* 1.7 Compute the scaled fall speed difference by integration over -! the dimensional spectrum of specy Z -! - ZCOLLZ = ZCOLLZ + ZFUNC & - * PEXZ * ABS(PFALLX*ZDX**PEXFALLX-PFALLZ*ZDZ**PEXFALLZ) - END DO -! -!* 1.8 Compute the normalization factor by integration over the -! dimensional spectrum of specy X -! - ZFUNC = GENERAL_GAMMA(PALPHAX,PNUX,ZLBDAX,ZDX) - ZSCALXZ = ZSCALXZ + ZSCALZ * ZFUNC -! -!* 1.9 Compute the scaled fall speed difference by integration over -! the dimensional spectrum of specy X -! - ZCOLLXZ = ZCOLLXZ + ZCOLLZ * ZFUNC - END DO -! -!* 1.10 Scale the fall speed difference -! - PRZCOLX(JLBDAX,JLBDAZ) = ZCOLLXZ / ZSCALXZ - END DO -END DO -! -END SUBROUTINE RZCOLX -- GitLab