source: dynamico_lmdz/simple_physics/phyparam/dynphy_lonlat/iniphysiq_mod.F90 @ 4228

Last change on this file since 4228 was 4223, checked in by dubos, 5 years ago

simple_physics : cleanup phyparam and iniphyparam

File size: 4.7 KB
Line 
1!
2! $Id: iniphysiq.F 1403 2010-07-01 09:02:53Z fairhead $
3!
4MODULE iniphysiq_mod
5  IMPLICIT NONE
6 
7CONTAINS
8 
9  SUBROUTINE iniphysiq(iim,jjm,nlayer, &
10       &               nbp, communicator, &
11       &               punjours, pdayref,ptimestep, &
12       &               rlatu,rlatv,rlonu,rlonv,aire,cu,cv, &
13       &               prad,pg,pr,pcpp,iflag_phys)
14    USE dimphy, ONLY: init_dimphy
15    USE inigeomphy_mod, ONLY: inigeomphy
16    USE iniphyparam_mod, ONLY : iniphyparam
17    USE mod_phys_lmdz_para, ONLY: klon_omp ! number of columns (on local omp grid)
18    USE infotrac, ONLY: nqtot, type_trac
19    USE infotrac_phy, ONLY: init_infotrac_phy
20    USE inifis_mod, ONLY: inifis
21    USE phyaqua_mod, ONLY: iniaqua
22    USE nrtype, ONLY: pi
23!    USE vertical_layers_mod, ONLY : presnivs
24
25    !
26    !=======================================================================
27    !   Initialisation of the physical constants and some positional and
28    !   geometrical arrays for the physics
29    !=======================================================================   
30   
31    include "iniprint.h"
32   
33    REAL,INTENT(IN) :: prad ! radius of the planet (m)
34    REAL,INTENT(IN) :: pg ! gravitational acceleration (m/s2)
35    REAL,INTENT(IN) :: pr ! ! reduced gas constant R/mu
36    REAL,INTENT(IN) :: pcpp ! specific heat Cp
37    REAL,INTENT(IN) :: punjours ! length (in s) of a standard day
38    INTEGER, INTENT (IN) :: nlayer ! number of atmospheric layers
39    INTEGER, INTENT (IN) :: iim ! number of atmospheric coulumns along longitudes
40    INTEGER, INTENT (IN) :: jjm  ! number of atompsheric columns along latitudes
41    INTEGER, INTENT(IN) :: nbp ! number of physics columns for this MPI process
42    INTEGER, INTENT(IN) :: communicator ! MPI communicator
43    REAL, INTENT (IN) :: rlatu(jjm+1) ! latitudes of the physics grid
44    REAL, INTENT (IN) :: rlatv(jjm) ! latitude boundaries of the physics grid
45    REAL, INTENT (IN) :: rlonv(iim+1) ! longitudes of the physics grid
46    REAL, INTENT (IN) :: rlonu(iim+1) ! longitude boundaries of the physics grid
47    REAL, INTENT (IN) :: aire(iim+1,jjm+1) ! area of the dynamics grid (m2)
48    REAL, INTENT (IN) :: cu((iim+1)*(jjm+1)) ! cu coeff. (u_covariant = cu * u)
49    REAL, INTENT (IN) :: cv((iim+1)*jjm) ! cv coeff. (v_covariant = cv * v)
50    INTEGER, INTENT (IN) :: pdayref ! reference day of for the simulation
51    REAL,INTENT(IN) :: ptimestep !physics time step (s)
52    INTEGER,INTENT(IN) :: iflag_phys ! type of physics to be called
53   
54    INTEGER :: ibegin,iend,offset
55    INTEGER :: i,j,k
56    CHARACTER (LEN=20) :: modname='iniphysiq'
57    CHARACTER (LEN=80) :: abort_message
58   
59   
60    print*,'INInnn   iniphysiq_mod'
61   
62    ! --> initialize physics distribution, global fields and geometry
63    ! (i.e. things in phy_common or dynphy_lonlat)
64    CALL inigeomphy(iim,jjm,nlayer, &
65         nbp, communicator, &
66         rlatu,rlatv, &
67         rlonu,rlonv, &
68         aire,cu,cv)
69   
70    ! --> now initialize things specific to the phydev physics package
71   
72    !$OMP PARALLEL
73   
74    ! Initialize physical constants in physics:
75    CALL inifis(prad,pg,pr,pcpp)
76   
77    ! Initialize tracer names, numbers, etc. for physics
78    CALL init_infotrac_phy(nqtot,type_trac)
79   
80    ! Additional initializations for aquaplanets
81    IF (iflag_phys>=100) THEN
82       CALL iniaqua(klon_omp,iflag_phys)
83    ENDIF
84!
85!    call iophys_ini('phys.nc    ',presnivs)
86
87    CALL setup_phyparam
88
89    CALL iniphyparam(klon_omp,nlayer, &
90         punjours, &
91         pdayref,ptimestep, &
92         prad,pg,pr,pcpp)
93   
94    !$OMP END PARALLEL
95   
96   
97  END SUBROUTINE iniphysiq
98 
99  SUBROUTINE setup_phyparam
100    USE comgeomfi,          ONLY : nlayermx, init_comgeomfi
101    USE dimphy,             ONLY : klon, klev
102    USE mod_grid_phy_lmdz,  ONLY : klon_glo
103    USE mod_phys_lmdz_para, ONLY : klon_omp
104    USE geometry_mod,       ONLY : longitude,latitude
105    USE read_param_mod
106    USE phyparam_plugins_lmdz
107
108    read_paramr_plugin => read_paramr
109    read_parami_plugin => read_parami
110    read_paramb_plugin => read_paramb
111
112    CALL init_comgeomfi(klon_omp, klev, longitude, latitude)
113
114    IF (klon.NE.klon_omp) THEN
115       PRINT*,'STOP in setup_phyparam'
116       PRINT*,'Probleme de dimensions :'
117       PRINT*,'klon     = ',klon
118       PRINT*,'klon_omp   = ',klon_omp
119       STOP
120    ENDIF
121
122    IF (klev.NE.nlayermx) THEN
123       PRINT*,'STOP in setup_phyparam'
124       PRINT*,'Probleme de dimensions :'
125       PRINT*,'nlayer     = ',klev
126       PRINT*,'nlayermx   = ',nlayermx
127       STOP
128    ENDIF
129
130    IF (klon_omp.NE.klon_glo) THEN
131       PRINT*,'STOP in setup_phyparam'
132       PRINT*,'Probleme de dimensions :'
133       PRINT*,'ngrid     = ', klon_omp
134       PRINT*,'ngridmax   = ',klon_glo
135       STOP
136    ENDIF
137
138  END SUBROUTINE setup_phyparam
139 
140END MODULE iniphysiq_mod
Note: See TracBrowser for help on using the repository browser.