source: LMDZ5/trunk/libf/dynphy_lonlat/phylmd/iniphysiq_mod.F90 @ 2588

Last change on this file since 2588 was 2588, checked in by Ehouarn Millour, 8 years ago

-Small change in the dynamics/physics interface organization:
externalize (from iniphysiq) operations wich initialize settings
common to all physics packages (e.g. global grid definitions;
in practice initializations for routines either in phy_common
or in dynphy_lonlat) in inigeomphy (located in dynphy_lonlat).
iniphysiq should only initialize settings in the corresponding
physics package (e.g. phylmd for dynphy_lonlat/phylmd/iniphysiq).

  • Bug fix in phydev/iophy: is_south_pole_dyn replaces

is_south_pole since rev. 2429.

EM

  • Property copyright set to
    Name of program: LMDZ
    Creation date: 1984
    Version: LMDZ5
    License: CeCILL version 2
    Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
    See the license file in the root directory
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.9 KB
Line 
1!
2! $Id: iniphysiq_mod.F90 2588 2016-07-13 06:54:39Z emillour $
3!
4MODULE iniphysiq_mod
5
6CONTAINS
7
8SUBROUTINE iniphysiq(ii,jj,nlayer, &
9                     nbp, communicator, &
10                     punjours, pdayref,ptimestep, &
11                     rlatu,rlatv,rlonu,rlonv,aire,cu,cv,       &
12                     prad,pg,pr,pcpp,iflag_phys)
13  USE dimphy, ONLY: init_dimphy
14  USE inigeomphy_mod, ONLY: inigeomphy
15  USE mod_grid_phy_lmdz, ONLY: klon_glo ! number of atmospheric columns (on full grid)
16  USE mod_phys_lmdz_para, ONLY: klon_omp ! number of columns (on local omp grid)
17  USE vertical_layers_mod, ONLY : init_vertical_layers
18  USE infotrac, ONLY: nqtot,nqo,nbtr,tname,ttext,type_trac,&
19                      niadv,conv_flg,pbl_flg,solsym,&
20                      nqfils,nqdesc,nqdesc_tot,iqfils,iqpere,&
21                      ok_isotopes,ok_iso_verif,ok_isotrac,&
22                      ok_init_iso,niso_possibles,tnat,&
23                      alpha_ideal,use_iso,iqiso,iso_num,&
24                      iso_indnum,zone_num,phase_num,&
25                      indnum_fn_num,index_trac,&
26                      niso,ntraceurs_zone,ntraciso
27#ifdef REPROBUS
28  USE CHEM_REP, ONLY : Init_chem_rep_phys
29#endif
30  USE control_mod, ONLY: dayref,anneeref,day_step,nday,offline, iphysiq
31  USE inifis_mod, ONLY: inifis
32  USE time_phylmdz_mod, ONLY: init_time
33  USE infotrac_phy, ONLY: init_infotrac_phy
34  USE phystokenc_mod, ONLY: init_phystokenc
35  USE phyaqua_mod, ONLY: iniaqua
36#ifdef INCA
37  USE indice_sol_mod, ONLY: nbsrf, is_oce, is_sic, is_ter, is_lic
38#ifdef CPP_PARA
39  USE parallel_lmdz, ONLY : mpi_size, mpi_rank
40  USE bands, ONLY : distrib_phys
41#endif
42  USE mod_phys_lmdz_omp_data, ONLY: klon_omp
43#endif
44  IMPLICIT NONE
45
46  ! =======================================================================
47  ! Initialisation of the physical constants and some positional and
48  ! geometrical arrays for the physics
49  ! =======================================================================
50
51  include "dimensions.h"
52  include "comvert.h"
53  include "comconst.h"
54  include "iniprint.h"
55  include "temps.h"
56  include "tracstoke.h"
57
58  REAL, INTENT (IN) :: prad ! radius of the planet (m)
59  REAL, INTENT (IN) :: pg ! gravitational acceleration (m/s2)
60  REAL, INTENT (IN) :: pr ! ! reduced gas constant R/mu
61  REAL, INTENT (IN) :: pcpp ! specific heat Cp
62  REAL, INTENT (IN) :: punjours ! length (in s) of a standard day
63  INTEGER, INTENT (IN) :: nlayer ! number of atmospheric layers
64  INTEGER, INTENT (IN) :: ii ! number of atmospheric columns along longitudes
65  INTEGER, INTENT (IN) :: jj ! number of atompsheric columns along latitudes
66  INTEGER, INTENT(IN) :: nbp ! number of physics columns for this MPI process
67  INTEGER, INTENT(IN) :: communicator ! MPI communicator
68  REAL, INTENT (IN) :: rlatu(jj+1) ! latitudes of the physics grid
69  REAL, INTENT (IN) :: rlatv(jj) ! latitude boundaries of the physics grid
70  REAL, INTENT (IN) :: rlonv(ii+1) ! longitudes of the physics grid
71  REAL, INTENT (IN) :: rlonu(ii+1) ! longitude boundaries of the physics grid
72  REAL, INTENT (IN) :: aire(ii+1,jj+1) ! area of the dynamics grid (m2)
73  REAL, INTENT (IN) :: cu((ii+1)*(jj+1)) ! cu coeff. (u_covariant = cu * u)
74  REAL, INTENT (IN) :: cv((ii+1)*jj) ! cv coeff. (v_covariant = cv * v)
75  INTEGER, INTENT (IN) :: pdayref ! reference day of for the simulation
76  REAL, INTENT (IN) :: ptimestep !physics time step (s)
77  INTEGER, INTENT (IN) :: iflag_phys ! type of physics to be called
78
79  INTEGER :: ibegin, iend, offset
80  INTEGER :: i,j,k
81  CHARACTER (LEN=20) :: modname = 'iniphysiq'
82  CHARACTER (LEN=80) :: abort_message
83
84
85#ifndef CPP_PARA
86  INTEGER,PARAMETER :: mpi_rank=0
87  INTEGER, PARAMETER :: mpi_size = 1
88  INTEGER :: distrib_phys(mpi_rank:mpi_rank)=(jjm-1)*iim+2
89#endif
90
91  ! --> initialize physics distribution, global fields and geometry
92  ! (i.e. things in phy_common or dynphy_lonlat)
93  CALL inigeomphy(ii,jj,nlayer, &
94               nbp, communicator, &
95               rlatu,rlatv, &
96               rlonu,rlonv, &
97               aire,cu,cv)
98
99  ! --> now initialize things specific to the phylmd physics package
100 
101!$OMP PARALLEL DEFAULT(SHARED) COPYIN(/temps/)
102
103  ! copy over preff , ap(), bp(), etc
104  CALL init_vertical_layers(nlayer,preff,scaleheight, &
105                            ap,bp,presnivs,pseudoalt)
106
107  ! Initialize physical constants in physics:
108  CALL inifis(punjours,prad,pg,pr,pcpp)
109
110  CALL init_time(annee_ref,day_ref,day_ini,start_time,nday,ptimestep)
111
112  ! Initialize dimphy module (unless in 1D where it has already been done)
113  IF (klon_glo>1) CALL Init_dimphy(klon_omp,nlayer)
114
115  ! Copy over "offline" settings
116  CALL init_phystokenc(offline,istphy)
117
118  ! Initialize tracer names, numbers, etc. for physics
119  CALL init_infotrac_phy(nqtot,nqo,nbtr,tname,ttext,type_trac,&
120                         niadv,conv_flg,pbl_flg,solsym,&
121                         nqfils,nqdesc,nqdesc_tot,iqfils,iqpere,&
122                         ok_isotopes,ok_iso_verif,ok_isotrac,&
123                         ok_init_iso,niso_possibles,tnat,&
124                         alpha_ideal,use_iso,iqiso,iso_num,&
125                         iso_indnum,zone_num,phase_num,&
126                         indnum_fn_num,index_trac,&
127                         niso,ntraceurs_zone,ntraciso)
128
129  ! Initializations for Reprobus
130  IF (type_trac == 'repr') THEN
131#ifdef REPROBUS
132    CALL Init_chem_rep_phys(klon_omp,nlayer)
133#endif
134  ENDIF
135!$OMP END PARALLEL
136
137  IF (type_trac == 'inca') THEN
138#ifdef INCA
139     call init_const_lmdz( &
140          anneeref,dayref, iphysiq,day_step,nday,  &
141          nbsrf, is_oce,is_sic, is_ter,is_lic, calend)
142     call init_inca_para( &
143          nbp_lon,nbp_lat,nbp_lev,klon_glo,mpi_size, &
144          distrib_phys,communicator)
145#endif
146  END IF
147!$OMP PARALLEL DEFAULT(SHARED) COPYIN(/temps/)
148
149  ! Additional initializations for aquaplanets
150  IF (iflag_phys>=100) THEN
151    CALL iniaqua(klon_omp,iflag_phys)
152  END IF
153
154  IF (type_trac == 'inca') THEN
155#ifdef INCA
156     CALL init_inca_dim(klon_omp,nbp_lev,nbp_lon,nbp_lat - 1, &
157          rlonu,rlatu,rlonv,rlatv)
158#endif
159  END IF
160
161!$OMP END PARALLEL
162
163END SUBROUTINE iniphysiq
164
165END MODULE iniphysiq_mod
Note: See TracBrowser for help on using the repository browser.