source: LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/iniphysiq_mod.F90 @ 5098

Last change on this file since 5098 was 5098, checked in by abarral, 4 months ago

Remove CRAY key (obsolete calls to functions that don't exist anymore, bugs in some implementations, irrelevant now)
Replace usage of CPP_XIOS key by using_xios logical
Remove always unused testcpu bits
Replace most uses of CPP_StratAer by the corresponding logical defined in lmdz_cppkeys_wrapper.F90 [this breaks iso compilation because phyiso doesn't define all aerosols - to be fixed later]
Replaces uses of include "yomcst.h" by the lmdz_yomcst.f90 module in .[fF]90 files

  • 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: 6.1 KB
Line 
1!
2! $Id: iniphysiq_mod.F90 5098 2024-07-22 16:53:44Z abarral $
3!
4MODULE iniphysiq_mod
5
6CONTAINS
7
8SUBROUTINE iniphysiq(ii,jj,nlayer, &
9                     nbp, communicator, &
10                     punjours, pdayref,ptimestep, &
11                     rlatudyn,rlatvdyn,rlonudyn,rlonvdyn,airedyn,cudyn,cvdyn, &
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: nbp_lon,nbp_lat,nbp_lev,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: nbtr, type_trac
19
20#ifdef REPROBUS
21  USE CHEM_REP, ONLY : Init_chem_rep_phys
22#ifdef CPP_PARA
23  USE parallel_lmdz, ONLY : mpi_size, mpi_rank
24  USE bands, ONLY : distrib_phys
25#endif
26  USE mod_phys_lmdz_omp_data, ONLY: klon_omp
27#endif
28  USE control_mod, ONLY: dayref,anneeref,day_step,nday,offline, iphysiq
29  USE inifis_mod, ONLY: inifis
30  USE time_phylmdz_mod, ONLY: init_time
31  USE temps_mod, ONLY: annee_ref, day_ini, day_ref, start_time, calend, year_len
32  USE infotrac_phy, ONLY: init_infotrac_phy
33  USE phystokenc_mod, ONLY: init_phystokenc
34  USE phyaqua_mod, ONLY: iniaqua
35  USE comconst_mod, ONLY: omeg, rad
36  USE indice_sol_mod, ONLY: nbsrf, is_oce, is_sic, is_ter, is_lic
37#ifdef CPP_PARA
38  USE parallel_lmdz, ONLY : mpi_size, mpi_rank
39  USE bands, ONLY : distrib_phys
40#endif
41  USE mod_phys_lmdz_omp_data, ONLY: klon_omp
42  USE ioipsl_getin_p_mod, ONLY: getin_p
43  USE slab_heat_transp_mod, ONLY: ini_slab_transp_geom
44  USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA
45  IMPLICIT NONE
46
47  ! =======================================================================
48  ! Initialisation of the physical constants and some positional and
49  ! geometrical arrays for the physics
50  ! =======================================================================
51
52  include "dimensions.h"
53  include "paramet.h"
54  include "iniprint.h"
55  include "tracstoke.h"
56  include "comgeom.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) :: rlatudyn(jj+1) ! latitudes of the physics grid
69  REAL, INTENT (IN) :: rlatvdyn(jj) ! latitude boundaries of the physics grid
70  REAL, INTENT (IN) :: rlonvdyn(ii+1) ! longitudes of the physics grid
71  REAL, INTENT (IN) :: rlonudyn(ii+1) ! longitude boundaries of the physics grid
72  REAL, INTENT (IN) :: airedyn(ii+1,jj+1) ! area of the dynamics grid (m2)
73  REAL, INTENT (IN) :: cudyn((ii+1)*(jj+1)) ! cu coeff. (u_covariant = cu * u)
74  REAL, INTENT (IN) :: cvdyn((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  LOGICAL :: slab_hdiff
85  INTEGER :: slab_ekman
86  CHARACTER (LEN = 6) :: type_ocean
87
88#ifndef CPP_PARA
89  INTEGER,PARAMETER :: mpi_rank=0
90  INTEGER, PARAMETER :: mpi_size = 1
91  INTEGER :: distrib_phys(mpi_rank:mpi_rank)=(jjm-1)*iim+2
92#endif
93
94  ! --> initialize physics distribution, global fields and geometry
95  ! (i.e. things in phy_common or dynphy_lonlat)
96  CALL inigeomphy(ii,jj,nlayer, &
97               nbp, communicator, &
98               rlatudyn,rlatvdyn, &
99               rlonudyn,rlonvdyn, &
100               airedyn,cudyn,cvdyn)
101
102  ! --> now initialize things specific to the phylmd physics package
103 
104!!$OMP PARALLEL DEFAULT(SHARED) COPYIN(/temps/)
105!       Copy all threadprivate variables in temps_mod
106!$OMP PARALLEL DEFAULT(SHARED) COPYIN(annee_ref,day_ini,day_ref,start_time)
107
108  ! Initialize physical constants in physics:
109  CALL inifis(punjours,prad,pg,pr,pcpp)
110
111  CALL init_time(annee_ref,day_ref,day_ini,start_time,nday,ptimestep)
112
113  ! Initialize dimphy module (unless in 1D where it has already been done)
114!  IF (klon_glo>1) CALL Init_dimphy(klon_omp,nlayer)
115
116  ! Copy over "offline" settings
117  CALL init_phystokenc(offline,istphy)
118
119  ! Initialization for slab heat transport
120  type_ocean="force"
121  CALL getin_p('type_ocean',type_ocean)
122  slab_hdiff=.FALSE.
123  CALL getin_p('slab_hdiff',slab_hdiff)
124  slab_ekman=0
125  CALL getin_p('slab_ekman',slab_ekman)
126  IF ((type_ocean=='slab').AND.(slab_hdiff.OR.(slab_ekman>0))) THEN
127     CALL ini_slab_transp_geom(ip1jm,ip1jmp1,unsairez,fext,unsaire,&
128                                  cu,cuvsurcv,cv,cvusurcu, &
129                                  aire,apoln,apols, &
130                                  aireu,airev,rlatvdyn,rad,omeg)
131  END IF
132
133  ! Initialize tracer names, numbers, etc. for physics
134  CALL init_infotrac_phy
135
136  ! Initializations for Reprobus
137  IF (type_trac == 'repr') THEN
138#ifdef REPROBUS
139    call Init_chem_rep_phys(klon_omp,nlayer)
140    call init_reprobus_para( &
141          nbp_lon,nbp_lat,nbp_lev,klon_glo,mpi_size, &
142          distrib_phys,communicator)
143#endif
144  ENDIF
145!$OMP END PARALLEL
146
147
148  IF (type_trac == 'repr') THEN
149#ifdef REPROBUS
150    call init_reprobus_para( &
151          nbp_lon,nbp_lat,nbp_lev,klon_glo,mpi_size, &
152          distrib_phys,communicator)
153#endif
154  ENDIF
155
156!!$OMP PARALLEL DEFAULT(SHARED) COPYIN(/temps/)
157!$OMP PARALLEL DEFAULT(SHARED)
158  ! Additional initializations for aquaplanets
159  IF (iflag_phys>=100) THEN
160    CALL iniaqua(klon_omp,year_len,iflag_phys)
161  END IF
162
163  IF (ANY(type_trac == ['inca','inco'])) THEN
164  IF (CPPKEY_INCA) THEN
165     CALL init_inca_dim_reg(nbp_lon, nbp_lat - 1, &
166          rlonudyn, rlatudyn, rlonvdyn, rlatvdyn)
167  END IF
168  END IF
169
170!$OMP END PARALLEL
171
172END SUBROUTINE iniphysiq
173
174END MODULE iniphysiq_mod
Note: See TracBrowser for help on using the repository browser.