source: trunk/WRF.COMMON/INTERFACES/dynphy_wrf_mars_lmd/iniphysiq_mod.F

Last change on this file was 2511, checked in by aslmd, 4 years ago

update of r2507: streamlining day_end from dynamics to physics to avoid using a dynamical module in the physics. put changes in 3 interfaces: LMDZ, DYNAMICO, and WRF

File size: 3.3 KB
Line 
1MODULE iniphysiq_mod
2
3CONTAINS
4
5subroutine iniphysiq(ngrid,nlayer,nq,piphysiq,&
6                     punjours, pdayref, &
7                     prad,pg,pr,pcpp,iflag_phys)
8
9use phys_state_var_init_mod, only: phys_state_var_init
10use time_phylmdz_mod, only: iphysiq, day_step, ecritstart,ecritphy,&
11                            dtphys,daysec,day_ini,hour_ini
12use update_inputs_physiq_mod, only: traceurs
13USE 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
17USE mod_phys_lmdz_para, ONLY: Init_phys_lmdz_para
18
19implicit none
20
21INCLUDE 'mpif.h'
22
23real,intent(in) :: prad ! radius of the planet (m)
24real,intent(in) :: pg ! gravitational acceleration (m/s2)
25real,intent(in) :: pr ! ! reduced gas constant R/mu
26real,intent(in) :: pcpp ! specific heat Cp
27real,intent(in) :: punjours ! length (in s) of a standard day [daysec]
28integer,intent(in) :: pdayref ! reference day of for the simulation [day_ini]
29!real*8,intent(in) :: ptimestep !physics time step (s) [dtphys]
30integer,intent(in) :: iflag_phys ! type of physics to be called
31
32integer,intent(in) :: ngrid ! number of physics columns for this MPI process
33integer,intent(in) :: nlayer ! number of atmospheric layers
34integer,intent(in) :: nq ! number of tracers
35!real,intent(in) :: phour_ini   ! start time (fraction of day) of the run 0=<phour_ini<1
36real,intent(in) :: piphysiq   ! call physics every piphysiq dynamical timesteps
37
38! used in GCM but not in mesoscale. dummy initialization.
39integer :: pdayend=0 ! end day of for the simulation [day_end]
40
41! isotopes
42INTEGER :: nqperes
43INTEGER, 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
48nqperes=nq
49allocate(nqfils(nq))
50nqfils(:)=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
60call 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
66CALL Init_phys_lmdz_para(1,1,1,MPI_COMM_WORLD) ! initializes MPI communicator
67                                               ! ... necessary for getin_p in conf_phys
68call 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)
73day_step=punjours/zdt_split
74iphysiq=piphysiq
75ecritstart=0 !! not used in MESOSCALE
76ecritphy=0 !! not used in MESOSCALE
77
78!! check
79PRINT*,'Call to LMD physics:',day_step,' per Martian day'
80PRINT*,'Call to LMD physics: every',iphysiq,' dynamical timesteps'
81PRINT*,'Call to LMD physics: every',dtphys,' seconds'
82PRINT*,'Call to LMD physics: length of day is',daysec,' seconds'
83PRINT*,'Call to LMD physics: initial day is',day_ini
84PRINT*,'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
90end subroutine iniphysiq
91
92END MODULE iniphysiq_mod
Note: See TracBrowser for help on using the repository browser.