[207] | 1 | MODULE earth_const |
---|
| 2 | USE prec |
---|
| 3 | USE math_const |
---|
| 4 | |
---|
| 5 | REAL(rstd),SAVE :: radius=6.37122E6 |
---|
| 6 | REAL(rstd),SAVE :: g=9.80616 |
---|
| 7 | REAL(rstd),PARAMETER :: daysec=86400 |
---|
| 8 | REAL(rstd),SAVE :: omega=7.292E-5 |
---|
| 9 | REAL(rstd),SAVE :: kappa=0.2857143 |
---|
| 10 | REAL(rstd),SAVE :: cpp=1004.70885 |
---|
[404] | 11 | REAL(rstd),SAVE :: cppv=1860. |
---|
[401] | 12 | REAL(rstd),SAVE :: Rv=461.5 |
---|
| 13 | REAL(rstd),SAVE :: Treff=273. |
---|
[207] | 14 | REAL(rstd),SAVE :: preff=101325. |
---|
| 15 | REAL(rstd),SAVE :: pa=50000. |
---|
[266] | 16 | REAL(rstd),SAVE :: scale_height=8000. ! atmospheric scale height (m) |
---|
[207] | 17 | REAL(rstd),SAVE :: scale_factor=1. |
---|
[266] | 18 | REAL(rstd),SAVE :: gas_constant = 8.3144621 |
---|
| 19 | REAL(rstd),SAVE :: mu ! molar mass of the atmosphere |
---|
[207] | 20 | |
---|
[406] | 21 | INTEGER, PARAMETER,PUBLIC :: thermo_theta=1, thermo_entropy=2, & |
---|
[413] | 22 | thermo_moist=3, thermo_moist_debug=10, thermo_dry=4, thermo_fake_moist=5 |
---|
[406] | 23 | INTEGER, PUBLIC :: caldyn_thermo, physics_thermo |
---|
[401] | 24 | !$OMP THREADPRIVATE(caldyn_thermo) |
---|
[406] | 25 | !$OMP THREADPRIVATE(physics_thermo) |
---|
[401] | 26 | |
---|
[366] | 27 | LOGICAL, SAVE :: boussinesq, hydrostatic |
---|
[207] | 28 | |
---|
| 29 | CONTAINS |
---|
| 30 | |
---|
| 31 | SUBROUTINE init_earth_const |
---|
| 32 | USE getin_mod |
---|
| 33 | IMPLICIT NONE |
---|
| 34 | REAL(rstd) :: X=1 |
---|
| 35 | |
---|
| 36 | CALL getin("radius",radius) |
---|
| 37 | CALL getin("g",g) |
---|
| 38 | CALL getin("scale_factor",scale_factor) |
---|
| 39 | CALL getin("omega",omega) |
---|
| 40 | CALL getin("kappa",kappa) |
---|
| 41 | CALL getin("cpp",cpp) |
---|
[404] | 42 | CALL getin("cppv",cppv) |
---|
| 43 | CALL getin("Rv",Rv) |
---|
[207] | 44 | CALL getin("preff",preff) |
---|
[401] | 45 | CALL getin("Treff",Treff) |
---|
[266] | 46 | CALL getin("scale_height",scale_height) |
---|
[207] | 47 | |
---|
| 48 | boussinesq=.FALSE. |
---|
| 49 | CALL getin("boussinesq",boussinesq) |
---|
[366] | 50 | hydrostatic=.TRUE. |
---|
| 51 | CALL getin("hydrostatic",hydrostatic) |
---|
| 52 | IF(boussinesq .AND. .NOT. hydrostatic) THEN |
---|
| 53 | PRINT *, 'boussinesq=.TRUE. and hydrostatic=.FALSE. : Non-hydrostatic boussinesq equations are not supported' |
---|
| 54 | STOP |
---|
| 55 | END IF |
---|
[207] | 56 | |
---|
[366] | 57 | mu=kappa/cpp |
---|
[207] | 58 | radius=radius/scale_factor |
---|
| 59 | omega=omega*scale_factor |
---|
| 60 | |
---|
| 61 | END SUBROUTINE init_earth_const |
---|
| 62 | |
---|
| 63 | |
---|
| 64 | END MODULE earth_const |
---|