source: trunk/WRF.COMMON/INTERFACES_V4/dynphy_wrf_generic_lmd/iniphysiq_mod.F @ 4126

Last change on this file since 4126 was 4126, checked in by aslmd, 2 weeks ago

a few fixes taken from the Titan model

File size: 5.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
9!use control_mod, only: nday
10!use surf_heat_transp_mod, only: ini_surf_heat_transp
11!use infotrac, only : nqtot ! number of advected tracers
12!USE comvert_mod, ONLY: ap,bp,preff
13use inifis_mod, only: inifis
14use ioipsl_getin_p_mod, only: getin_p
15
16!use inigeomphy_mod, only: inigeomphy
17!use geometry_mod, only: cell_area, & ! physics grid area (m2)
18!                        longitude, & ! longitudes (rad)
19!                        latitude ! latitudes (rad)
20! necessary to get klon_omp
21!USE mod_phys_lmdz_para, ONLY: klon_omp ! number of columns (on local omp grid)
22USE mod_phys_lmdz_para, ONLY: Init_phys_lmdz_para
23USE dimphy, ONLY: init_dimphy
24USE phys_state_var_mod
25!use planete_mod, only: year_day, periastr, apoastr, peri_day,&
26!                       obliquit, z0, lmixmin, emin_turb
27!                       init_planete_mod
28use planete_mod
29use time_phylmdz_mod, only: dtphys, daysec,day_ini
30use planete_mod, only: year_day, periastr, apoastr, peri_day,&
31                   obliquit, z0!, lmixmin, emin_turb
32use surfdat_h,  only: emissiv,iceradius, &
33                    emisice,dtemisice
34use comcstfi_mod, only: omeg,mugaz
35use tracer_h, only: nqtot
36!use comm_wrf, only : allocate_comm_wrf
37use mod_grid_phy_lmdz, only: nbp_lev, klon_glo
38     
39implicit none
40
41INCLUDE 'mpif.h'
42
43REAL,intent(in) :: prad
44REAL,intent(in) :: pg
45REAL,intent(in) :: pr
46REAL,intent(in) :: pcpp
47REAL,intent(in) :: punjours
48!DOUBLE PRECISION,intent(in) :: ptimestep
49
50!real,intent(in) :: prad ! radius of the planet (m)
51!real,intent(in) :: pg ! gravitational acceleration (m/s2)
52!real,intent(in) :: pr ! ! reduced gas constant R/mu
53!real,intent(in) :: pcpp ! specific heat Cp
54!real,intent(in) :: punjours ! length (in s) of a standard day [daysec]
55integer,intent(in) :: pdayref ! reference day of for the simulation [day_ini]
56integer,intent(in) :: iflag_phys ! type of physics to be called
57
58integer :: nday=0 ! this is dummy for mesoscale (in dyn3d/control_mod)
59
60integer,intent(in) :: ngrid ! number of physics columns for this MPI process
61integer,intent(in) :: nlayer ! number of atmospheric layers
62integer,intent(in) :: nq ! number of tracers
63!real,intent(in) :: phour_ini   ! start time (fraction of day) of the run
64!0=<phour_ini<1
65real,intent(in) :: piphysiq   ! call physics every piphysiq dynamical timesteps
66!real :: latitude(ngrid),longitude(ngrid),cell_area(ngrid)
67!  real,intent(in) :: prefff ! reference surface pressure (Pa)
68!  real,intent(in) :: apf(nlayer+1) ! hybrid coordinate at interfaces
69!  real,intent(in) :: bpf(nlayer+1)
70logical :: ok_slab_ocean
71real*8 :: lat(ngrid),long(ngrid),cellarea(ngrid)
72REAL*8 :: pprad,ppg,ppr,ppcpp,ppunjours
73REAL*8 :: dummy
74  ! the common part for all planetary physics
75  !------------------------------------------
76  ! --> initialize physics distribution, global fields and geometry
77  ! (i.e. things in phy_common or dynphy_lonlat)
78
79  ! the distinct part for all planetary physics (ie. things in phystd)
80  !------------------------------------------
81
82nbp_lev = nlayer          ! emoisan
83klon_glo = 1 !emoisan !we run the physics as if we were in 1D
84CALL Init_phys_lmdz_para(1,1,1,MPI_COMM_WORLD)
85
86!call phys_state_var_init
87print*,'ngrid',ngrid,'nlayer',nlayer
88call init_dimphy(ngrid,nlayer)
89call phys_state_var_init(nqtot)
90! copy over preff , ap() and bp()
91!call ini_planete_mod(nlayer,prefff,apf,bpf)
92
93! for slab ocean, copy over some arrays
94ok_slab_ocean=.false. ! default value
95!call getin_p("ok_slab_ocean",ok_slab_ocean)
96!if (ok_slab_ocean) then
97!  call ini_surf_heat_transp(ip1jm,ip1jmp1,unsairez,fext,unsaire, &
98!                            cu,cuvsurcv,cv,cvusurcu,aire,apoln,apols, &
99!                            aireu,airev)
100!endif
101
102dummy=1.
103lat(:)=0.
104long(:)=0.
105cellarea(:)=1.
106print*,'pg',pg
107!ppunjours=punjours
108ppunjours=1.
109pprad=prad
110ppg=pg
111ppr=pr
112ppcpp=pcpp
113call inifis(ngrid,nlayer,nq,pdayref,ppunjours,nday,dummy, &
114            lat,long,cellarea,pprad,ppg,ppr,ppcpp)
115
116     open(17,file='controle.txt',form='formatted',status='old')
117     rewind(17)
118     read(17,*)
119     read(17,*)
120     read(17,*) day_ini !(tab0+3)
121     read(17,*)
122     read(17,*) !tab0+5)
123     read(17,*) !omeg !(tab0+6)
124     read(17,*) !(tab0+7)
125     read(17,*) !mugaz
126     read(17,*)  !(tab0+9)
127     read(17,*) daysec
128     read(17,*) dtphys !tab0+11)
129     read(17,*)
130     read(17,*)
131     read(17,*) year_day !(tab0+14)
132     read(17,*) periastr !tab0+15)
133     read(17,*) apoastr !tab0+16)
134     read(17,*) peri_day !tab0+17)
135     read(17,*) obliquit !tab0+18)
136     read(17,*) z0
137     read(17,*)
138     read(17,*)
139     read(17,*)
140     read(17,*)
141     read(17,*) emisice(1)
142     read(17,*) emisice(2)
143     read(17,*) emissiv
144     read(17,*)
145     read(17,*)
146     read(17,*)
147     read(17,*)
148     read(17,*) iceradius(1)
149     read(17,*) iceradius(2)
150     read(17,*) dtemisice(1)
151     read(17,*) dtemisice(2)
152     close(17)
153     !print*,'g',g
154
155     !emissiv(:)=EMIS
156     cloudfrac(:,:)=0.5
157     totcloudfrac(:)=0.5
158     hice(:)=0.
159     rnat(:)=0.
160     pctsrf_sic(:)=0.
161     tsea_ice(:)=0.
162     !qsurf(:,:) = 0.
163     print*,'check'
164     print*,'iceradius',iceradius,'dtemisice',dtemisice
165     print*,'apoastr,periastr,year_day,peri_day,obliq',apoastr,periastr,year_day,peri_day,obliquit
166     print*,'emissiv',emissiv
167     print*,'mugaz',mugaz
168     
169end subroutine iniphysiq
170
171
172END MODULE iniphysiq_mod
Note: See TracBrowser for help on using the repository browser.