Last change
on this file since 3393 was
3095,
checked in by emillour, 13 months ago
|
Mars PCM:
Some code tidying:
Made pi in module comcstfi_h a parameter (and not a variable recomputed at
various points by various routines) and added module routine init_comcstfi_h
to cleanly initialize module variables.
Moved iniorbit.F to be a module routine of planete_h since it initializes
(some of ) the module variables it contains.
EM
|
File size:
822 bytes
|
Line | |
---|
1 | MODULE comcstfi_h |
---|
2 | IMPLICIT NONE |
---|
3 | |
---|
4 | REAL,PARAMETER :: pi=acos(-1.d0) ! something like 3.14159 |
---|
5 | REAL,SAVE :: rad ! radius of the planet (m) |
---|
6 | REAL,SAVE :: g ! gravity (m/s2) |
---|
7 | !$OMP THREADPRIVATE(rad,g) |
---|
8 | REAL,SAVE :: r ! reduced gas constant (r=8.314511/(mugaz/1000.0)) |
---|
9 | REAL,SAVE :: cpp ! Cp of the atmosphere |
---|
10 | REAL,SAVE :: rcp ! r/cpp |
---|
11 | !$OMP THREADPRIVATE(r,cpp,rcp) |
---|
12 | REAL,SAVE :: mugaz ! molar mass of the atmosphere (g/mol) |
---|
13 | REAL,SAVE :: omeg ! planet rotation rate (rad/s) |
---|
14 | !$OMP THREADPRIVATE(mugaz,omeg) |
---|
15 | |
---|
16 | ! NB: Ideally all module variables should be "protected"... |
---|
17 | |
---|
18 | CONTAINS |
---|
19 | |
---|
20 | SUBROUTINE init_comcstfi_h(prad,pcpp,pg,pr) |
---|
21 | IMPLICIT NONE |
---|
22 | |
---|
23 | REAL,INTENT(IN) :: prad |
---|
24 | REAL,INTENT(IN) :: pcpp |
---|
25 | REAL,INTENT(IN) :: pg |
---|
26 | REAL,INTENT(IN) :: pr |
---|
27 | |
---|
28 | rad=prad |
---|
29 | cpp=pcpp |
---|
30 | g=pg |
---|
31 | r=pr |
---|
32 | rcp=r/cpp |
---|
33 | |
---|
34 | END SUBROUTINE init_comcstfi_h |
---|
35 | |
---|
36 | END MODULE comcstfi_h |
---|
Note: See
TracBrowser
for help on using the repository browser.