source: trunk/LMDZ.MARS/libf/phymars/phys_state_var_init_mod.F90 @ 2167

Last change on this file since 2167 was 2162, checked in by emillour, 6 years ago

Mars GCM:
Some code cleanup (and preparing next steps):

  • Turn calchim into a module and make tendencies module variables in calchim_mod and watercloud_mod
  • Externalize in "physiq" the computation of solar zenithal angle (it should be computed at every physics timestep, regardless of iradia)

AB+EM

File size: 4.0 KB
Line 
1MODULE phys_state_var_init_mod
2
3CONTAINS
4
5      SUBROUTINE phys_state_var_init(ngrid,nlayer,nq,tname, &
6                                     day_ini,hour_ini,pdaysec,ptimestep, &
7                                     prad,pg,pr,pcpp)
8
9!=======================================================================
10!
11!   purpose:
12!   -------
13!
14!   Allocate arrays in modules
15!   Fill geometrical arrays
16!   Fill a first set of physical constants
17!   -- was done previously in inifis
18!
19!=======================================================================
20!   
21!   authors: Ehouarn Millour and Aymeric Spiga
22!            14/04/2014
23!
24!   arguments:
25!   ----------
26!
27!   input:
28!   ------
29!
30!    ngrid                 Size of the horizontal grid.
31!    nlayer                Number of vertical layers.
32!    nq                    Number of tracers.
33!
34!=======================================================================
35
36      use slope_mod, only: ini_slope_mod,end_slope_mod
37      use comsaison_h, only: ini_comsaison_h,end_comsaison_h
38      use surfdat_h, only: ini_surfdat_h,end_surfdat_h
39      use comgeomfi_h, only: ini_comgeomfi_h,end_comgeomfi_h
40      use comsoil_h, only: ini_comsoil_h,end_comsoil_h
41      use dimradmars_mod, only: ini_dimradmars_mod,end_dimradmars_mod
42      use yomlw_h, only: ini_yomlw_h,end_yomlw_h
43      use conc_mod, only: ini_conc_mod,end_conc_mod
44      use turb_mod, only: ini_turb_mod,end_turb_mod
45      use comcstfi_h, only: pi,rad,cpp,g,r,rcp
46      use tracer_mod, only: ini_tracer_mod,end_tracer_mod
47      use time_phylmdz_mod, only: init_time
48      use co2cloud_mod, only: ini_co2cloud,end_co2cloud
49      use rocketduststorm_mod, only: ini_rocketduststorm_mod, &
50                                     end_rocketduststorm_mod
51      use calchim_mod, only: ini_calchim_mod,end_calchim_mod
52      use watercloud_mod, only: ini_watercloud_mod, &
53                                end_watercloud_mod
54
55      IMPLICIT NONE
56     
57      INTEGER,INTENT(IN) :: ngrid,nlayer,nq
58      CHARACTER(len=*),INTENT(IN) :: tname(nq)
59      INTEGER,INTENT(IN) :: day_ini
60      REAL,INTENT(IN) :: hour_ini
61      REAL,INTENT(IN) :: pdaysec,ptimestep,prad,pg,pr,pcpp
62
63      ! set dimension and allocate arrays in tracer_mod
64      call end_tracer_mod
65      call ini_tracer_mod(nq,tname)
66
67      ! set parameters in comcstfi_h
68      pi=2.*asin(1.)
69      rad=prad
70      cpp=pcpp
71      g=pg
72      r=pr
73      rcp=r/cpp
74
75      ! Initialize some "temporal and calendar" related variables
76      call init_time(day_ini,hour_ini,pdaysec,ptimestep)
77
78      ! allocate "slope_mod" arrays
79      call end_slope_mod
80      call ini_slope_mod(ngrid)
81
82      ! allocate "comsaison_h" arrays
83      call end_comsaison_h
84      call ini_comsaison_h(ngrid)
85
86      ! allocate "surfdat_h" arrays
87      call end_surfdat_h
88      call ini_surfdat_h(ngrid,nq)
89
90      ! allocate "comgeomfi_h" arrays
91      call end_comgeomfi_h
92      call ini_comgeomfi_h(ngrid)
93
94      ! allocate "comsoil_h" arrays
95      call end_comsoil_h
96      call ini_comsoil_h(ngrid)
97
98      ! set some variables in "dimradmars_mod"
99      call end_dimradmars_mod
100      call ini_dimradmars_mod(ngrid,nlayer)
101
102      ! allocate arrays in "yomlw_h"
103      call end_yomlw_h
104      call ini_yomlw_h(ngrid)
105
106      ! allocate arrays in "conc_mod" (aeronomars)
107      call end_conc_mod
108      call ini_conc_mod(ngrid,nlayer)
109
110      ! allocate arrays in "turb_mod"
111      call end_turb_mod
112      call ini_turb_mod(ngrid,nlayer)
113     
114      ! allocate arrays in "co2cloud" :
115      ! Memory of the origin of the co2 particles     
116      call end_co2cloud
117      call ini_co2cloud(ngrid,nlayer)
118     
119      ! allocate arrays in "rocketduststorm_mod":
120      call end_rocketduststorm_mod
121      call ini_rocketduststorm_mod(ngrid)
122     
123      ! allocate arrays in "calchim_mod" (aeronomars)
124      call end_calchim_mod
125      call ini_calchim_mod(ngrid,nlayer,nq)
126
127      ! allocate arrays in "watercloud_mod"
128      call end_watercloud_mod
129      call ini_watercloud_mod(ngrid,nlayer,nq)
130
131      END SUBROUTINE phys_state_var_init
132
133END MODULE phys_state_var_init_mod
Note: See TracBrowser for help on using the repository browser.