1 | MODULE iniphysiq_mod |
---|
2 | |
---|
3 | CONTAINS |
---|
4 | |
---|
5 | subroutine iniphysiq(ngrid,nlayer,nq,piphysiq,& |
---|
6 | punjours, pdayref, & |
---|
7 | prad,pg,pr,pcpp,iflag_phys) |
---|
8 | |
---|
9 | use phys_state_var_init_mod, only: phys_state_var_init |
---|
10 | use time_phylmdz_mod, only: iphysiq, day_step, ecritstart,ecritphy,& |
---|
11 | dtphys,daysec,day_ini,hour_ini |
---|
12 | use update_inputs_physiq_mod, only: traceurs |
---|
13 | USE variables_mod, only: phour_ini,zdt_split !! zdt_split <> pttimestep |
---|
14 | !real*8,intent(in) :: ptimestep !physics time step (s) [dtphys] |
---|
15 | |
---|
16 | ! this is necessary to initialize getin_p |
---|
17 | USE mod_phys_lmdz_para, ONLY: Init_phys_lmdz_para |
---|
18 | |
---|
19 | implicit none |
---|
20 | |
---|
21 | INCLUDE 'mpif.h' |
---|
22 | |
---|
23 | real,intent(in) :: prad ! radius of the planet (m) |
---|
24 | real,intent(in) :: pg ! gravitational acceleration (m/s2) |
---|
25 | real,intent(in) :: pr ! ! reduced gas constant R/mu |
---|
26 | real,intent(in) :: pcpp ! specific heat Cp |
---|
27 | real,intent(in) :: punjours ! length (in s) of a standard day [daysec] |
---|
28 | integer,intent(in) :: pdayref ! reference day of for the simulation [day_ini] |
---|
29 | !real*8,intent(in) :: ptimestep !physics time step (s) [dtphys] |
---|
30 | integer,intent(in) :: iflag_phys ! type of physics to be called |
---|
31 | |
---|
32 | integer,intent(in) :: ngrid ! number of physics columns for this MPI process |
---|
33 | integer,intent(in) :: nlayer ! number of atmospheric layers |
---|
34 | integer,intent(in) :: nq ! number of tracers |
---|
35 | !real,intent(in) :: phour_ini ! start time (fraction of day) of the run 0=<phour_ini<1 |
---|
36 | real,intent(in) :: piphysiq ! call physics every piphysiq dynamical timesteps |
---|
37 | |
---|
38 | ! used in GCM but not in mesoscale. dummy initialization. |
---|
39 | integer :: pdayend=0 ! end day of for the simulation [day_end] |
---|
40 | |
---|
41 | ! isotopes |
---|
42 | INTEGER :: nqperes |
---|
43 | INTEGER, ALLOCATABLE, DIMENSION(:) :: nqfils |
---|
44 | |
---|
45 | ! isotopes variables initialisation |
---|
46 | ! -- for the moment, interface with dynamics is inactive |
---|
47 | ! -- all tracers are parents with no children |
---|
48 | nqperes=nq |
---|
49 | allocate(nqfils(nq)) |
---|
50 | nqfils(:)=0 |
---|
51 | |
---|
52 | ! copy some fundamental parameters to physics |
---|
53 | ! and do some initializations |
---|
54 | |
---|
55 | !! Initialize dimphy module |
---|
56 | !call init_dimphy(klon_omp,nlayer) |
---|
57 | !...useless in mesoscale |
---|
58 | |
---|
59 | !! initialize physical constants and arrays |
---|
60 | call phys_state_var_init(ngrid,nlayer,nq, traceurs, & |
---|
61 | pdayref,pdayend,phour_ini,punjours,zdt_split, & |
---|
62 | prad,pg,pr,pcpp, & |
---|
63 | nqperes,nqfils) |
---|
64 | |
---|
65 | !! read callphys.def |
---|
66 | CALL Init_phys_lmdz_para(1,1,1,MPI_COMM_WORLD) ! initializes MPI communicator |
---|
67 | ! ... necessary for getin_p in conf_phys |
---|
68 | call conf_phys(ngrid,nlayer,nq) |
---|
69 | |
---|
70 | !! a few time constants initialization |
---|
71 | !! not done by init_time in phys_state_var_init |
---|
72 | !! and supposed to be done in conf_phys (but not done in mesoscale) |
---|
73 | day_step=punjours/zdt_split |
---|
74 | iphysiq=piphysiq |
---|
75 | ecritstart=0 !! not used in MESOSCALE |
---|
76 | ecritphy=0 !! not used in MESOSCALE |
---|
77 | |
---|
78 | !! check |
---|
79 | PRINT*,'Call to LMD physics:',day_step,' per Martian day' |
---|
80 | PRINT*,'Call to LMD physics: every',iphysiq,' dynamical timesteps' |
---|
81 | PRINT*,'Call to LMD physics: every',dtphys,' seconds' |
---|
82 | PRINT*,'Call to LMD physics: length of day is',daysec,' seconds' |
---|
83 | PRINT*,'Call to LMD physics: initial day is',day_ini |
---|
84 | PRINT*,'Call to LMD physics: initial fractional time is',hour_ini |
---|
85 | |
---|
86 | ! Initialize some "temporal and calendar" related variables |
---|
87 | !CALL init_time(day_ini,hour_ini,punjours,ptimestep) |
---|
88 | !...done in phys_state_var_init |
---|
89 | |
---|
90 | end subroutine iniphysiq |
---|
91 | |
---|
92 | END MODULE iniphysiq_mod |
---|