GCC Code Coverage Report


Directory: ./
File: dyn_phys_sub/iniphysiq_mod.f90
Date: 2022-01-11 19:19:34
Exec Total Coverage
Lines: 15 17 88.2%
Branches: 2 8 25.0%

Line Branch Exec Source
1 !
2 ! $Id: iniphysiq_mod.F90 3924 2021-06-08 16:33:45Z fairhead $
3 !
4 MODULE iniphysiq_mod
5
6 CONTAINS
7
8 1 SUBROUTINE 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: nqtot,nqo,nbtr,nqCO2,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,nqtottr,itr_indice
27 USE control_mod, ONLY: dayref,anneeref,day_step,nday,offline, iphysiq, config_inca
28 USE inifis_mod, ONLY: inifis
29 USE time_phylmdz_mod, ONLY: init_time
30 USE temps_mod, ONLY: annee_ref, day_ini, day_ref, start_time, calend, year_len
31 USE infotrac_phy, ONLY: init_infotrac_phy
32 USE phystokenc_mod, ONLY: init_phystokenc
33 USE phyaqua_mod, ONLY: iniaqua
34 USE comconst_mod, ONLY: omeg, rad
35 USE ioipsl_getin_p_mod, ONLY: getin_p
36 USE slab_heat_transp_mod, ONLY: ini_slab_transp_geom
37 IMPLICIT NONE
38
39 ! =======================================================================
40 ! Initialisation of the physical constants and some positional and
41 ! geometrical arrays for the physics
42 ! =======================================================================
43
44 include "dimensions.h"
45 include "paramet.h"
46 include "iniprint.h"
47 include "tracstoke.h"
48 include "comgeom.h"
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
55 INTEGER, INTENT (IN) :: nlayer ! number of atmospheric layers
56 INTEGER, INTENT (IN) :: ii ! number of atmospheric columns along longitudes
57 INTEGER, INTENT (IN) :: jj ! number of atompsheric columns along latitudes
58 INTEGER, INTENT(IN) :: nbp ! number of physics columns for this MPI process
59 INTEGER, INTENT(IN) :: communicator ! MPI communicator
60 REAL, INTENT (IN) :: rlatudyn(jj+1) ! latitudes of the physics grid
61 REAL, INTENT (IN) :: rlatvdyn(jj) ! latitude boundaries of the physics grid
62 REAL, INTENT (IN) :: rlonvdyn(ii+1) ! longitudes of the physics grid
63 REAL, INTENT (IN) :: rlonudyn(ii+1) ! longitude boundaries of the physics grid
64 REAL, INTENT (IN) :: airedyn(ii+1,jj+1) ! area of the dynamics grid (m2)
65 REAL, INTENT (IN) :: cudyn((ii+1)*(jj+1)) ! cu coeff. (u_covariant = cu * u)
66 REAL, INTENT (IN) :: cvdyn((ii+1)*jj) ! cv coeff. (v_covariant = cv * v)
67 INTEGER, INTENT (IN) :: pdayref ! reference day of for the simulation
68 REAL, INTENT (IN) :: ptimestep !physics time step (s)
69 INTEGER, INTENT (IN) :: iflag_phys ! type of physics to be called
70
71 INTEGER :: ibegin, iend, offset
72 INTEGER :: i,j,k
73 CHARACTER (LEN=20) :: modname = 'iniphysiq'
74 CHARACTER (LEN=80) :: abort_message
75
76 LOGICAL :: slab_hdiff
77 INTEGER :: slab_ekman
78 CHARACTER (LEN = 6) :: type_ocean
79
80 INTEGER,PARAMETER :: mpi_rank=0
81 INTEGER, PARAMETER :: mpi_size = 1
82 INTEGER :: distrib_phys(mpi_rank:mpi_rank)=(jjm-1)*iim+2
83
84 ! --> initialize physics distribution, global fields and geometry
85 ! (i.e. things in phy_common or dynphy_lonlat)
86 CALL inigeomphy(ii,jj,nlayer, &
87 nbp, communicator, &
88 rlatudyn,rlatvdyn, &
89 rlonudyn,rlonvdyn, &
90 1 airedyn,cudyn,cvdyn)
91
92 ! --> now initialize things specific to the phylmd physics package
93
94 !!$OMP PARALLEL DEFAULT(SHARED) COPYIN(/temps/)
95 !$OMP PARALLEL DEFAULT(SHARED) &
96 ! Copy all threadprivate variables in temps_mod
97 !$OMP COPYIN(annee_ref, day_ini, day_ref, start_time)
98
99 ! Initialize physical constants in physics:
100 1 CALL inifis(punjours,prad,pg,pr,pcpp)
101
102 1 CALL init_time(annee_ref,day_ref,day_ini,start_time,nday,ptimestep)
103
104 ! Initialize dimphy module (unless in 1D where it has already been done)
105 ! IF (klon_glo>1) CALL Init_dimphy(klon_omp,nlayer)
106
107 ! Copy over "offline" settings
108 1 CALL init_phystokenc(offline,istphy)
109
110 ! Initialization for slab heat transport
111 1 type_ocean="force"
112 1 CALL getin_p('type_ocean',type_ocean)
113 1 slab_hdiff=.FALSE.
114 1 CALL getin_p('slab_hdiff',slab_hdiff)
115 1 slab_ekman=0
116 1 CALL getin_p('slab_ekman',slab_ekman)
117
1/6
✗ Branch 0 not taken.
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
1 IF ((type_ocean=='slab').AND.(slab_hdiff.OR.(slab_ekman.GT.0))) THEN
118 CALL ini_slab_transp_geom(ip1jm,ip1jmp1,unsairez,fext,unsaire,&
119 cu,cuvsurcv,cv,cvusurcu, &
120 aire,apoln,apols, &
121 aireu,airev,rlatvdyn,rad,omeg)
122 END IF
123
124 ! Initialize tracer names, numbers, etc. for physics
125 CALL init_infotrac_phy(nqtot,nqo,nbtr,nqtottr,nqCO2,tname,ttext,type_trac,&
126 niadv,conv_flg,pbl_flg,solsym,&
127 nqfils,nqdesc,nqdesc_tot,iqfils,iqpere,&
128 ok_isotopes,ok_iso_verif,ok_isotrac,&
129 ok_init_iso,niso_possibles,tnat,&
130 alpha_ideal,use_iso,iqiso,iso_num,&
131 iso_indnum,zone_num,phase_num,&
132 indnum_fn_num,index_trac,&
133 niso,ntraceurs_zone,ntraciso,itr_indice &
134 1 )
135
136 ! Initializations for Reprobus
137 IF (type_trac == 'repr') THEN
138 ENDIF
139 !$OMP END PARALLEL
140
141 IF (type_trac == 'inca' .OR. type_trac == 'inco') THEN
142 END IF
143 IF (type_trac == 'repr') THEN
144 ENDIF
145
146 !!$OMP PARALLEL DEFAULT(SHARED) COPYIN(/temps/)
147 !$OMP PARALLEL DEFAULT(SHARED)
148 ! Additional initializations for aquaplanets
149
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 times.
1 IF (iflag_phys>=100) THEN
150 CALL iniaqua(klon_omp,year_len,iflag_phys)
151 END IF
152
153 IF (type_trac == 'inca' .OR. type_trac == 'inco') THEN
154 IF (type_trac == 'repr') THEN
155 END IF
156 END IF
157
158 !$OMP END PARALLEL
159
160 1 END SUBROUTINE iniphysiq
161
162 END MODULE iniphysiq_mod
163