source: trunk/LMDZ.MARS/libf/phymars/comcstfi_h.F90 @ 3393

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 
1MODULE comcstfi_h
2IMPLICIT NONE
3
4REAL,PARAMETER :: pi=acos(-1.d0) ! something like 3.14159
5REAL,SAVE :: rad ! radius of the planet (m)
6REAL,SAVE :: g ! gravity (m/s2)
7!$OMP THREADPRIVATE(rad,g)
8REAL,SAVE :: r ! reduced gas constant (r=8.314511/(mugaz/1000.0))
9REAL,SAVE :: cpp ! Cp of the atmosphere
10REAL,SAVE :: rcp ! r/cpp
11!$OMP THREADPRIVATE(r,cpp,rcp)
12REAL,SAVE :: mugaz ! molar mass of the atmosphere (g/mol)
13REAL,SAVE :: omeg ! planet rotation rate (rad/s)
14!$OMP THREADPRIVATE(mugaz,omeg)
15
16! NB: Ideally all module variables should be "protected"...
17
18CONTAINS
19
20SUBROUTINE init_comcstfi_h(prad,pcpp,pg,pr)
21IMPLICIT NONE
22
23REAL,INTENT(IN) :: prad
24REAL,INTENT(IN) :: pcpp
25REAL,INTENT(IN) :: pg
26REAL,INTENT(IN) :: pr
27
28  rad=prad
29  cpp=pcpp
30  g=pg
31  r=pr
32  rcp=r/cpp
33
34END SUBROUTINE init_comcstfi_h
35
36END MODULE comcstfi_h
Note: See TracBrowser for help on using the repository browser.