diff --git a/src/arome/externals/budget.F90 b/src/arome/aux/budget.F90 similarity index 100% rename from src/arome/externals/budget.F90 rename to src/arome/aux/budget.F90 diff --git a/src/arome/externals/gradient_m.F90 b/src/arome/aux/gradient_m.F90 similarity index 100% rename from src/arome/externals/gradient_m.F90 rename to src/arome/aux/gradient_m.F90 diff --git a/src/arome/externals/gradient_u.F90 b/src/arome/aux/gradient_u.F90 similarity index 100% rename from src/arome/externals/gradient_u.F90 rename to src/arome/aux/gradient_u.F90 diff --git a/src/arome/externals/gradient_v.F90 b/src/arome/aux/gradient_v.F90 similarity index 100% rename from src/arome/externals/gradient_v.F90 rename to src/arome/aux/gradient_v.F90 diff --git a/src/arome/externals/gradient_w.F90 b/src/arome/aux/gradient_w.F90 similarity index 100% rename from src/arome/externals/gradient_w.F90 rename to src/arome/aux/gradient_w.F90 diff --git a/src/arome/externals/modd_precision.F90 b/src/arome/aux/modd_precision.F90 similarity index 100% rename from src/arome/externals/modd_precision.F90 rename to src/arome/aux/modd_precision.F90 diff --git a/src/arome/micro/moddb_intbudget.F90 b/src/arome/aux/moddb_intbudget.F90 similarity index 100% rename from src/arome/micro/moddb_intbudget.F90 rename to src/arome/aux/moddb_intbudget.F90 diff --git a/src/arome/externals/mode_msg.F90 b/src/arome/aux/mode_msg.F90 similarity index 100% rename from src/arome/externals/mode_msg.F90 rename to src/arome/aux/mode_msg.F90 diff --git a/src/arome/externals/modi_gradient_m.F90 b/src/arome/aux/modi_gradient_m.F90 similarity index 100% rename from src/arome/externals/modi_gradient_m.F90 rename to src/arome/aux/modi_gradient_m.F90 diff --git a/src/arome/externals/modi_gradient_u.F90 b/src/arome/aux/modi_gradient_u.F90 similarity index 100% rename from src/arome/externals/modi_gradient_u.F90 rename to src/arome/aux/modi_gradient_u.F90 diff --git a/src/arome/externals/modi_gradient_v.F90 b/src/arome/aux/modi_gradient_v.F90 similarity index 100% rename from src/arome/externals/modi_gradient_v.F90 rename to src/arome/aux/modi_gradient_v.F90 diff --git a/src/arome/externals/modi_gradient_w.F90 b/src/arome/aux/modi_gradient_w.F90 similarity index 100% rename from src/arome/externals/modi_gradient_w.F90 rename to src/arome/aux/modi_gradient_w.F90 diff --git a/src/arome/externals/modi_shumanaro.F90 b/src/arome/aux/modi_shuman.F90 similarity index 100% rename from src/arome/externals/modi_shumanaro.F90 rename to src/arome/aux/modi_shuman.F90 diff --git a/src/arome/externals/shumanaro.F90 b/src/arome/aux/shuman.F90 similarity index 100% rename from src/arome/externals/shumanaro.F90 rename to src/arome/aux/shuman.F90 diff --git a/src/arome/gmkpack_ignored_files b/src/arome/gmkpack_ignored_files index 45075fc85384251ba29db7e9f0da0200986082cd..7af0d1bb463932619f28e92a77d6674ec13b36a1 100644 --- a/src/arome/gmkpack_ignored_files +++ b/src/arome/gmkpack_ignored_files @@ -50,3 +50,11 @@ phyex/micro/ice4_sedimentation_stat.F90 phyex/micro/modi_ice4_sedimentation_split.F90 phyex/micro/ice4_sedimentation_split.F90 phyex/micro/modi_ice4_sedimentation_stat.F90 +phyex/micro/modd_blank.F90 +phyex/micro/gamma.F90 +phyex/micro/gamma_inc.F90 +phyex/micro/general_gamma.F90 +phyex/micro/modi_gamma.F90 +phyex/micro/modi_gamma_inc.F90 +phyex/micro/modi_general_gamma.F90 +phyex/micro/moddb_intbudget.F90 diff --git a/src/arome/micro/gamma_inc.F90 b/src/arome/micro/gamma_inc.F90 deleted file mode 100644 index 305969d036520572aaffbfc2414f2abc1affb227..0000000000000000000000000000000000000000 --- a/src/arome/micro/gamma_inc.F90 +++ /dev/null @@ -1,140 +0,0 @@ -! ######spl - FUNCTION GAMMA_INC(PA,PX) RESULT(PGAMMA_INC) - USE PARKIND1, ONLY : JPRB - USE YOMHOOK , ONLY : LHOOK, DR_HOOK -! ############################################# -! -! -!!**** *GAMMA_INC * - Generalized gamma function -!! -!! -!! PURPOSE -!! ------- -! The purpose of this function is to compute the generalized -!! incomplete Gamma function of its argument. -!! -!! /X -!! 1 | -!! GAMMA_INC(A,X)= -------- | Z**(A-1) EXP(-Z) dZ -!! GAMMA(A) | -!! /0 -!! -!!** METHOD -!! ------ -!! -!! EXTERNAL -!! -------- -!! NONE -!! -!! IMPLICIT ARGUMENTS -!! ------------------ -!! MODULE MODI_GAMMA : computation of the Gamma function -!! -!! REFERENCE -!! --------- -!! Press, Teukolsky, Vetterling and Flannery: Numerical Recipes, 209-213 -!! -!! -!! AUTHOR -!! ------ -!! Jean-Pierre Pinty *LA/OMP* -!! -!! MODIFICATIONS -!! ------------- -!! Original 7/12/95 -! -!* 0. DECLARATIONS -! ------------ -! -USE MODI_GAMMA -! -IMPLICIT NONE -! -!* 0.1 declarations of arguments and result -! -REAL, INTENT(IN) :: PA -REAL, INTENT(IN) :: PX -REAL :: PGAMMA_INC -! -!* 0.2 declarations of local variables -! -INTEGER :: JN -INTEGER :: ITMAX=100 -REAL :: ZEPS=3.E-7 -REAL :: ZFPMIN=1.E-30 -REAL :: ZAP,ZDEL,ZSUM -REAL :: ZAN,ZB,ZC,ZD,ZH -! -REAL(KIND=JPRB) :: ZHOOK_HANDLE -IF (LHOOK) CALL DR_HOOK('GAMMA_INC',0,ZHOOK_HANDLE) -IF( (PX.LT.0.0).OR.(PA.LE.0.0) ) THEN - PRINT *,' BAD ARGUMENTS IN GAMMA_INC' -!callabortstop -CALL ABORT - STOP -END IF -! -IF( (PX.LT.PA+1.0) ) THEN - ZAP = PA - ZSUM = 1.0/PA - ZDEL = ZSUM - JN = 1 -! - LOOP_SERIES: DO - ZAP = ZAP +1.0 - ZDEL = ZDEL*PX/ZAP - ZSUM = ZSUM + ZDEL - IF( ABS(ZDEL).LT.ABS(ZSUM)*ZEPS ) EXIT LOOP_SERIES - JN = JN + 1 - IF( JN.GT.ITMAX ) THEN - PRINT *,' ARGUMENT "PA" IS TOO LARGE OR "ITMAX" IS TOO SMALL, THE & - & INCOMPLETE GAMMA_INC FUNCTION CANNOT BE EVALUATED CORRECTLY & - & BY THE SERIES METHOD' -!callabortstop -CALL ABORT - STOP - END IF - END DO LOOP_SERIES - PGAMMA_INC = ZSUM * EXP( -PX+PA*ALOG(PX)-ALOG(GAMMA(PA)) ) -! - ELSE -! - ZB = PX + 1.0 - PA - ZC = 1.0/TINY(PX) - ZD = 1.0/ZB - ZH = ZD - JN = 1 -! - LOOP_FRACTION: DO - ZAN = -FLOAT(JN)*(FLOAT(JN)-PA) - ZB = ZB + 2.0 - ZD = ZAN*ZD + ZB - IF( ABS(ZD).LT.TINY(PX) ) THEN - ZD = ZFPMIN - END IF - ZC = ZB + ZAN/ZC - IF( ABS(ZC).LT.TINY(PX) ) THEN - ZC = ZFPMIN - END IF - ZD = 1.0/ZD - ZDEL = ZD*ZC - ZH = ZH*ZDEL - IF( ABS(ZDEL-1.0).LT.ZEPS ) EXIT LOOP_FRACTION - JN = JN + 1 - IF( JN.GT.ITMAX ) THEN - PRINT *,' ARGUMENT "PA" IS TOO LARGE OR "ITMAX" IS TOO SMALL, THE & - & INCOMPLETE GAMMA_INC FUNCTION CANNOT BE EVALUATED CORRECTLY & - & BY THE CONTINUOUS FRACTION METHOD' -!callabortstop -CALL ABORT - STOP - END IF - END DO LOOP_FRACTION - PGAMMA_INC = 1.0 - ZH*EXP( -PX+PA*ALOG(PX)-ALOG(GAMMA(PA)) ) -! -END IF -! -IF (LHOOK) CALL DR_HOOK('GAMMA_INC',1,ZHOOK_HANDLE) -RETURN -! -END FUNCTION GAMMA_INC diff --git a/src/arome/micro/modd_blank.F90 b/src/arome/micro/modd_blank.F90 deleted file mode 100644 index 257cab502ba17c6fa577b67e300281aecc9a4e87..0000000000000000000000000000000000000000 --- a/src/arome/micro/modd_blank.F90 +++ /dev/null @@ -1,61 +0,0 @@ -! ######spl - MODULE MODD_BLANK -! ################# -! -!!**** *MODD_BLANK* - Declarative module for MesoNH developpers namelist -!! -!! PURPOSE -!! ------- -!! -!! Offer dummy real, integer, logical and character variables for -!! test and debugging purposes. -!! -!!** METHOD -!! ------ -!! -!! Eight dummy real, integer, logical and character*80 variables are -!! defined and passed through the namelist read operations. None of the -!! MesoNH routines uses any of those variables. When a developper choses -!! to introduce temporarily a parameter to some subroutine, he has to -!! introduce a USE MODD_BLANK statement into that subroutine. Then he -!! can use any of the variables defined here and change them easily via -!! the namelist input. -!! -!! REFERENCE -!! --------- -!! None -!! -!! AUTHOR -!! ------ -!! K. Suhre *Laboratoire d'Aerologie* -!! -!! MODIFICATIONS -!! ------------- -!! -!! Original 25/04/96 -!! updated 17/11/00 (P Jabouille) Use dummy array -!! -!------------------------------------------------------------------------------- -! -!* 0. DECLARATIONS -! ------------ -! -USE MODD_PARAMETERS, ONLY : JPDUMMY -! -IMPLICIT NONE -! -REAL, SAVE :: XDUMMY1, XDUMMY2, XDUMMY3, XDUMMY4, & - XDUMMY5, XDUMMY6, XDUMMY7, XDUMMY8 -INTEGER, SAVE :: NDUMMY1, NDUMMY2, NDUMMY3, NDUMMY4, & - NDUMMY5, NDUMMY6, NDUMMY7, NDUMMY8 -LOGICAL, SAVE :: LDUMMY1, LDUMMY2, LDUMMY3, LDUMMY4, & - LDUMMY5, LDUMMY6, LDUMMY7, LDUMMY8 -CHARACTER*80, SAVE :: CDUMMY1, CDUMMY2, CDUMMY3, CDUMMY4, & - CDUMMY5, CDUMMY6, CDUMMY7, CDUMMY8 -! -REAL, SAVE, DIMENSION(JPDUMMY) :: XDUMMY -INTEGER, SAVE, DIMENSION(JPDUMMY) :: NDUMMY -LOGICAL, SAVE, DIMENSION(JPDUMMY) :: LDUMMY -CHARACTER*80, SAVE, DIMENSION(JPDUMMY) :: CDUMMY -! -END MODULE MODD_BLANK diff --git a/src/arome/turb/turb_ver.F90 b/src/arome/turb/turb_ver.F90 index a08586c54e10444aa4ba401dab8bc8bd04798a32..3d8b6dd0defd8f3a6c120f463490b327dfc9dcc3 100644 --- a/src/arome/turb/turb_ver.F90 +++ b/src/arome/turb/turb_ver.F90 @@ -211,7 +211,6 @@ USE MODD_CTURB USE MODD_PARAMETERS USE MODD_LES USE MODD_NSV, ONLY : NSV -USE MODD_BLANK ! USE MODI_PRANDTL USE MODI_EMOIST diff --git a/src/arome/micro/gamma.F90 b/src/common/aux/gamma.F90 similarity index 85% rename from src/arome/micro/gamma.F90 rename to src/common/aux/gamma.F90 index 810890d2ae8f426b1bfe27e2ae9e17a7e5643c21..6969c28cd46d69740ad6356478f1ba46ff2b6edf 100644 --- a/src/arome/micro/gamma.F90 +++ b/src/common/aux/gamma.F90 @@ -1,4 +1,16 @@ -! ######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. +!######################## +! +!-------------------------------------------------------------------------- +! +! +!* 1. FUNCTION GAMMA FOR SCALAR VARIABLE +! +! +! ###################################### FUNCTION GAMMA_X0D(PX) RESULT(PGAMMA) USE PARKIND1, ONLY : JPRB USE YOMHOOK , ONLY : LHOOK, DR_HOOK @@ -35,11 +47,9 @@ !! !! MODIFICATIONS !! ------------- -!! Original 7/12/95 +!! Original 7/11/95 !! C. Barthe 9/11/09 add a function for 1D arguments -!! -!!------------------------------------------------------------------------------- - +! !* 0. DECLARATIONS ! ------------ ! @@ -105,7 +115,11 @@ END FUNCTION GAMMA_X0D ! !------------------------------------------------------------------------------- ! -! ######spl +! +!* 1. FUNCTION GAMMA FOR 1D ARRAY +! +! +! ###################################### FUNCTION GAMMA_X1D(PX) RESULT(PGAMMA) USE PARKIND1, ONLY : JPRB USE YOMHOOK , ONLY : LHOOK, DR_HOOK @@ -153,14 +167,14 @@ IMPLICIT NONE ! !* 0.1 declarations of arguments and result ! -REAL,DIMENSION(:), INTENT(IN) :: PX -REAL,DIMENSION(SIZE(PX)) :: PGAMMA +REAL, DIMENSION(:), INTENT(IN) :: PX +REAL, DIMENSION(SIZE(PX)) :: PGAMMA ! !* 0.2 declarations of local variables ! INTEGER :: JJ ! Loop index INTEGER :: JI ! Loop index -REAL :: ZSER,ZSTP,ZTMP,ZX,ZY,ZCOEF(6) +REAL :: ZSER, ZSTP, ZTMP, ZX, ZY, ZCOEF(6) REAL :: ZPI ! REAL(KIND=JPRB) :: ZHOOK_HANDLE diff --git a/src/mesonh/micro/gamma_inc.f90 b/src/common/aux/gamma_inc.F90 similarity index 77% rename from src/mesonh/micro/gamma_inc.f90 rename to src/common/aux/gamma_inc.F90 index 93e6247d062f1142e4365d64204aeac782c73a6c..abb9ebad8c19156a6108c0ce88c34806c7e70464 100644 --- a/src/mesonh/micro/gamma_inc.f90 +++ b/src/common/aux/gamma_inc.F90 @@ -2,33 +2,18 @@ !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_GAMMA_INC -!#################### -! -INTERFACE -! -FUNCTION GAMMA_INC(PA,PX) RESULT(PGAMMA_INC) -REAL, INTENT(IN) :: PA -REAL, INTENT(IN) :: PX -REAL :: PGAMMA_INC -END FUNCTION GAMMA_INC -! -END INTERFACE -! -END MODULE MODI_GAMMA_INC -! ############################################# FUNCTION GAMMA_INC(PA,PX) RESULT(PGAMMA_INC) + USE PARKIND1, ONLY : JPRB + USE YOMHOOK , ONLY : LHOOK, DR_HOOK ! ############################################# -! ! -!!**** *GAMMA_INC * - Generalized gamma function -!! +! +!!**** *GAMMA_INC * - Generalized gamma function +!! !! !! PURPOSE !! ------- -! The purpose of this function is to compute the generalized +! The purpose of this function is to compute the generalized !! incomplete Gamma function of its argument. !! !! /X @@ -55,7 +40,7 @@ END MODULE MODI_GAMMA_INC !! !! AUTHOR !! ------ -!! Jean-Pierre Pinty *LA/OMP* +!! Jean-Pierre Pinty *LA/OMP* !! !! MODIFICATIONS !! ------------- @@ -66,7 +51,7 @@ END MODULE MODI_GAMMA_INC !* 0. DECLARATIONS ! ------------ ! -use mode_msg +USE MODE_MSG ! USE MODI_GAMMA ! @@ -87,7 +72,11 @@ REAL :: ZFPMIN=1.E-30 REAL :: ZAP,ZDEL,ZSUM REAL :: ZAN,ZB,ZC,ZD,ZH ! -IF( PX<0.0 .OR. PA<=0.0 ) call Print_msg(NVERB_FATAL,'GEN','GAMMA_INC','invalid arguments: PX<0.0 .OR. PA<=0.0') +REAL(KIND=JPRB) :: ZHOOK_HANDLE +IF (LHOOK) CALL DR_HOOK('GAMMA_INC',0,ZHOOK_HANDLE) +IF(PX<0.0 .OR. PA<=0.0) THEN + CALL PRINT_MSG(NVERB_FATAL, 'GEN', 'GAMMA_INC', 'invalid arguments: PX<0.0 .OR. PA<=0.0') +END IF ! IF( (PX.LT.PA+1.0) ) THEN ZAP = PA @@ -102,7 +91,7 @@ IF( (PX.LT.PA+1.0) ) THEN IF( ABS(ZDEL).LT.ABS(ZSUM)*ZEPS ) EXIT LOOP_SERIES JN = JN + 1 IF( JN.GT.ITMAX ) THEN - call Print_msg(NVERB_FATAL,'GEN','GAMMA_INC','PA argument is too large or ITMAX is too small,'// & + CALL PRINT_MSG(NVERB_FATAL, 'GEN', 'GAMMA_INC', 'PA argument is too large or ITMAX is too small,'// & ' the incomplete GAMMA_INC function cannot be evaluated correctly'// & ' by the series method') END IF @@ -134,7 +123,7 @@ IF( (PX.LT.PA+1.0) ) THEN IF( ABS(ZDEL-1.0).LT.ZEPS ) EXIT LOOP_FRACTION JN = JN + 1 IF( JN.GT.ITMAX ) THEN - call Print_msg(NVERB_FATAL,'GEN','GAMMA_INC','PA argument is too large or ITMAX is too small,'// & + CALL PRINT_MSG(NVERB_FATAL, 'GEN', 'GAMMA_INC', 'PA argument is too large or ITMAX is too small,'// & ' the incomplete GAMMA_INC function cannot be evaluated correctly'// & ' by the continuous fraction method') END IF @@ -143,6 +132,7 @@ IF( (PX.LT.PA+1.0) ) THEN ! END IF ! +IF (LHOOK) CALL DR_HOOK('GAMMA_INC',1,ZHOOK_HANDLE) RETURN ! END FUNCTION GAMMA_INC diff --git a/src/arome/micro/general_gamma.F90 b/src/common/aux/general_gamma.F90 similarity index 85% rename from src/arome/micro/general_gamma.F90 rename to src/common/aux/general_gamma.F90 index ccc96510cf8c3abbd22dd8cdb94e7697ae067aba..7938d74fa1845b69c8871fb7e29f73f3210c2afb 100644 --- a/src/arome/micro/general_gamma.F90 +++ b/src/common/aux/general_gamma.F90 @@ -1,4 +1,7 @@ -! ######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. FUNCTION GENERAL_GAMMA(PALPHA,PNU,PLBDA,PX) RESULT(PGENERAL_GAMMA) USE PARKIND1, ONLY : JPRB USE YOMHOOK , ONLY : LHOOK, DR_HOOK diff --git a/src/arome/externals/modd_io.F90 b/src/common/aux/modd_io.F90 similarity index 100% rename from src/arome/externals/modd_io.F90 rename to src/common/aux/modd_io.F90 diff --git a/src/arome/micro/modi_gamma.F90 b/src/common/aux/modi_gamma.F90 similarity index 60% rename from src/arome/micro/modi_gamma.F90 rename to src/common/aux/modi_gamma.F90 index f61f40fd376254aa6bf2644b791717ea240530db..4f10dab67e1a8d1d68ade60fa71f6f5cb19f9767 100644 --- a/src/arome/micro/modi_gamma.F90 +++ b/src/common/aux/modi_gamma.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 MODI_GAMMA ! ################# ! diff --git a/src/arome/micro/modi_gamma_inc.F90 b/src/common/aux/modi_gamma_inc.F90 similarity index 54% rename from src/arome/micro/modi_gamma_inc.F90 rename to src/common/aux/modi_gamma_inc.F90 index 831e3889f7c33d534b701b439a33a90f609ad0fd..2b54c25acdd9fa4d45c450acf758e1bce0f0f0aa 100644 --- a/src/arome/micro/modi_gamma_inc.F90 +++ b/src/common/aux/modi_gamma_inc.F90 @@ -1,4 +1,8 @@ -! ######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 MODI_GAMMA_INC !#################### ! diff --git a/src/arome/micro/modi_general_gamma.F90 b/src/common/aux/modi_general_gamma.F90 similarity index 63% rename from src/arome/micro/modi_general_gamma.F90 rename to src/common/aux/modi_general_gamma.F90 index 6535090b9bd331109959352b53481255f35ba223..7868333a612a9b5866f88c6d856d071ae1eb1773 100644 --- a/src/arome/micro/modi_general_gamma.F90 +++ b/src/common/aux/modi_general_gamma.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 MODI_GENERAL_GAMMA !######################## ! diff --git a/src/mesonh/micro/gamma.f90 b/src/mesonh/micro/gamma.f90 deleted file mode 100644 index cd7e04fbd7df5d80dd5e439b691f0f512197c981..0000000000000000000000000000000000000000 --- a/src/mesonh/micro/gamma.f90 +++ /dev/null @@ -1,224 +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_GAMMA -!######################## -! -INTERFACE GAMMA -! -FUNCTION GAMMA_X0D(PX) RESULT(PGAMMA) -REAL, INTENT(IN) :: PX -REAL :: PGAMMA -END FUNCTION GAMMA_X0D -! -FUNCTION GAMMA_X1D(PX) RESULT(PGAMMA) -REAL, DIMENSION(:), INTENT(IN) :: PX -REAL, DIMENSION(SIZE(PX)) :: PGAMMA -END FUNCTION GAMMA_X1D -! -END INTERFACE -END MODULE MODI_GAMMA -! -!-------------------------------------------------------------------------- -! -! -!* 1. FUNCTION GAMMA FOR SCALAR VARIABLE -! -! -! ###################################### - FUNCTION GAMMA_X0D(PX) RESULT(PGAMMA) -! ###################################### -! -! -!!**** *GAMMA * - Gamma function -!! -!! -!! PURPOSE -!! ------- -! The purpose of this function is to compute the Generalized gamma -! function of its argument. -! -! -!!** METHOD -!! ------ -!! -!! EXTERNAL -!! -------- -!! NONE -!! -!! IMPLICIT ARGUMENTS -!! ------------------ -!! None -!! -!! REFERENCE -!! --------- -!! Press, Teukolsky, Vetterling and Flannery: Numerical Recipes, 206-207 -!! -!! AUTHOR -!! ------ -!! Jean-Pierre Pinty *LA/OMP* -!! -!! MODIFICATIONS -!! ------------- -!! Original 7/11/95 -!! C. Barthe 9/11/09 add a function for 1D arguments -! -!* 0. DECLARATIONS -! ------------ -! -IMPLICIT NONE -! -!* 0.1 declarations of arguments and result -! -REAL, INTENT(IN) :: PX -REAL :: PGAMMA -! -!* 0.2 declarations of local variables -! -INTEGER :: JJ ! Loop index -REAL :: ZSER,ZSTP,ZTMP,ZX,ZY,ZCOEF(6) -REAL :: ZPI -! -!------------------------------------------------------------------------------- -! -!* 1. SOME CONSTANTS -! -------------- -! -ZCOEF(1) = 76.18009172947146 -ZCOEF(2) =-86.50532032941677 -ZCOEF(3) = 24.01409824083091 -ZCOEF(4) = -1.231739572450155 -ZCOEF(5) = 0.1208650973866179E-2 -ZCOEF(6) = -0.5395239384953E-5 -ZSTP = 2.5066282746310005 -! -ZPI = 3.141592654 -! -!------------------------------------------------------------------------------- -! -!* 2. COMPUTE GAMMA -! ------------- -! -IF (PX .LT. 0.) THEN - ZX = 1. - PX -ELSE - ZX = PX -END IF -ZY = ZX -ZTMP = ZX + 5.5 -ZTMP = (ZX + 0.5) * ALOG(ZTMP) - ZTMP -ZSER = 1.000000000190015 -! -DO JJ = 1, 6 - ZY = ZY + 1.0 - ZSER = ZSER + ZCOEF(JJ) / ZY -END DO -! -IF (PX .LT. 0.) THEN - PGAMMA = ZPI / SIN(ZPI*PX) / EXP(ZTMP + ALOG(ZSTP*ZSER/ZX)) -ELSE - PGAMMA = EXP(ZTMP + ALOG(ZSTP*ZSER/ZX)) -END IF -RETURN -! -END FUNCTION GAMMA_X0D -! -!------------------------------------------------------------------------------- -! -! -!* 1. FUNCTION GAMMA FOR 1D ARRAY -! -! -! ###################################### - FUNCTION GAMMA_X1D(PX) RESULT(PGAMMA) -! ###################################### -! -! -!!**** *GAMMA * - Gamma function -!! -!! -!! PURPOSE -!! ------- -! The purpose of this function is to compute the Generalized gamma -! function of its argument. -! -! -!!** METHOD -!! ------ -!! -!! EXTERNAL -!! -------- -!! NONE -!! -!! IMPLICIT ARGUMENTS -!! ------------------ -!! None -!! -!! REFERENCE -!! --------- -!! Press, Teukolsky, Vetterling and Flannery: Numerical Recipes, 206-207 -!! -!! AUTHOR -!! ------ -!! Jean-Pierre Pinty *LA/OMP* -!! -!! MODIFICATIONS -!! ------------- -!! Original 7/11/95 -!! -!------------------------------------------------------------------------------- -! -!* 0. DECLARATIONS -! ------------ -! -IMPLICIT NONE -! -!* 0.1 declarations of arguments and result -! -REAL, DIMENSION(:), INTENT(IN) :: PX -REAL, DIMENSION(SIZE(PX)) :: PGAMMA -! -!* 0.2 declarations of local variables -! -INTEGER :: JJ ! Loop index -REAL, DIMENSION(SIZE(PX)) :: ZSER,ZSTP,ZTMP,ZX,ZY -REAL :: ZCOEF(6) -REAL :: ZPI -! -!------------------------------------------------------------------------------- -! -!* 1. SOME CONSTANTS -! -------------- -! -ZCOEF(1) = 76.18009172947146 -ZCOEF(2) =-86.50532032941677 -ZCOEF(3) = 24.01409824083091 -ZCOEF(4) = -1.231739572450155 -ZCOEF(5) = 0.1208650973866179E-2 -ZCOEF(6) = -0.5395239384953E-5 -ZSTP = 2.5066282746310005 -! -ZPI = 3.141592654 -ZX(:) = PX(:) -WHERE ( PX(:)<0.0 ) - ZX(:) = 1.- PX(:) -END WHERE -ZY(:) = ZX(:) -ZTMP(:) = ZX(:) + 5.5 -ZTMP(:) = (ZX(:) + 0.5)*ALOG(ZTMP(:)) - ZTMP(:) -ZSER(:) = 1.000000000190015 -! -DO JJ = 1 , 6 - ZY(:) = ZY(:) + 1.0 - ZSER(:) = ZSER(:) + ZCOEF(JJ)/ZY(:) -END DO -! -PGAMMA(:) = EXP( ZTMP(:) + ALOG( ZSTP*ZSER(:)/ZX(:) ) ) -WHERE ( PX(:)<0.0 ) - PGAMMA(:) = ZPI/SIN(ZPI*PX(:))/PGAMMA(:) -END WHERE -RETURN -! -END FUNCTION GAMMA_X1D diff --git a/src/mesonh/micro/general_gamma.f90 b/src/mesonh/micro/general_gamma.f90 deleted file mode 100644 index 9aa715a3cb09cf3b8558f007ddddc4b8f504d8a0..0000000000000000000000000000000000000000 --- a/src/mesonh/micro/general_gamma.f90 +++ /dev/null @@ -1,91 +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 operators 2006/05/18 13:07:25 -!----------------------------------------------------------------- -!######################## -MODULE MODI_GENERAL_GAMMA -!######################## -! -INTERFACE -! -FUNCTION GENERAL_GAMMA(PALPHA,PNU,PLBDA,PX) RESULT(PGENERAL_GAMMA) -REAL, INTENT(IN) :: PALPHA -REAL, INTENT(IN) :: PNU -REAL, INTENT(IN) :: PLBDA -REAL, INTENT(IN) :: PX -REAL :: PGENERAL_GAMMA -END FUNCTION GENERAL_GAMMA -! -END INTERFACE -! -END MODULE MODI_GENERAL_GAMMA -! ################################################################### - FUNCTION GENERAL_GAMMA(PALPHA,PNU,PLBDA,PX) RESULT(PGENERAL_GAMMA) -! ################################################################### -! -! -!!**** *GENERAL_GAMMA * - Generalized gamma function -!! -!! -!! PURPOSE -!! ------- -! The purpose of this function is to compute the Generalized gamma -! function of its argument. -! -! -!!** METHOD -!! ------ -!! -!! EXTERNAL -!! -------- -!! NONE -!! -!! IMPLICIT ARGUMENTS -!! ------------------ -!! MODULE MODI_GAMMA : computation of the Gamma function -!! -!! REFERENCE -!! --------- -!! Book2 of documentation (routine CONDENS) -!! -!! -!! AUTHOR -!! ------ -!! Jean-Pierre Pinty *LA/OMP* -!! -!! MODIFICATIONS -!! ------------- -!! Original 7/11/95 -! -!* 0. DECLARATIONS -! ------------ -! -USE MODI_GAMMA -! -IMPLICIT NONE -! -!* 0.1 declarations of arguments and result -! -REAL, INTENT(IN) :: PALPHA -REAL, INTENT(IN) :: PNU -REAL, INTENT(IN) :: PLBDA -REAL, INTENT(IN) :: PX -REAL :: PGENERAL_GAMMA -! -!* 0.2 declarations of local variables -! -REAL :: ZARG,ZPOWER -! -ZARG = PLBDA*PX -ZPOWER = PALPHA*PNU - 1.0 -! -PGENERAL_GAMMA = (PALPHA/GAMMA(PNU))*(ZARG**ZPOWER)*PLBDA*EXP(-(ZARG**PALPHA)) -RETURN -! -END FUNCTION GENERAL_GAMMA