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 |
---|
11 | REAL(rstd),SAVE :: preff=101325. |
---|
12 | REAL(rstd),SAVE :: pa=50000. |
---|
13 | REAL(rstd),SAVE :: scale_height=8000. ! atmospheric scale height (m) |
---|
14 | REAL(rstd),SAVE :: scale_factor=1. |
---|
15 | REAL(rstd),SAVE :: gas_constant = 8.3144621 |
---|
16 | REAL(rstd),SAVE :: mu ! molar mass of the atmosphere |
---|
17 | |
---|
18 | LOGICAL, SAVE :: boussinesq, hydrostatic |
---|
19 | !$OMP THREADPRIVATE(boussinesq, hydrostatic) |
---|
20 | |
---|
21 | CONTAINS |
---|
22 | |
---|
23 | SUBROUTINE init_earth_const |
---|
24 | USE getin_mod |
---|
25 | IMPLICIT NONE |
---|
26 | REAL(rstd) :: X=1 |
---|
27 | |
---|
28 | CALL getin("radius",radius) |
---|
29 | CALL getin("g",g) |
---|
30 | CALL getin("scale_factor",scale_factor) |
---|
31 | CALL getin("omega",omega) |
---|
32 | CALL getin("kappa",kappa) |
---|
33 | CALL getin("cpp",cpp) |
---|
34 | CALL getin("preff",preff) |
---|
35 | CALL getin("scale_height",scale_height) |
---|
36 | |
---|
37 | boussinesq=.FALSE. |
---|
38 | CALL getin("boussinesq",boussinesq) |
---|
39 | hydrostatic=.TRUE. |
---|
40 | CALL getin("hydrostatic",hydrostatic) |
---|
41 | IF(boussinesq .AND. .NOT. hydrostatic) THEN |
---|
42 | PRINT *, 'boussinesq=.TRUE. and hydrostatic=.FALSE. : Non-hydrostatic boussinesq equations are not supported' |
---|
43 | STOP |
---|
44 | END IF |
---|
45 | |
---|
46 | mu=kappa/cpp |
---|
47 | radius=radius/scale_factor |
---|
48 | omega=omega*scale_factor |
---|
49 | |
---|
50 | END SUBROUTINE init_earth_const |
---|
51 | |
---|
52 | |
---|
53 | END MODULE earth_const |
---|