[2347] | 1 | ! |
---|
[1403] | 2 | ! $Id: iniphysiq_mod.F90 3924 2021-06-08 16:33:45Z crisi $ |
---|
[2347] | 3 | ! |
---|
| 4 | MODULE iniphysiq_mod |
---|
[1671] | 5 | |
---|
[2347] | 6 | CONTAINS |
---|
[1671] | 7 | |
---|
[2351] | 8 | SUBROUTINE iniphysiq(ii,jj,nlayer, & |
---|
| 9 | nbp, communicator, & |
---|
| 10 | punjours, pdayref,ptimestep, & |
---|
[2656] | 11 | rlatudyn,rlatvdyn,rlonudyn,rlonvdyn,airedyn,cudyn,cvdyn, & |
---|
[2225] | 12 | prad,pg,pr,pcpp,iflag_phys) |
---|
[2351] | 13 | USE dimphy, ONLY: init_dimphy |
---|
[2588] | 14 | USE inigeomphy_mod, ONLY: inigeomphy |
---|
[2608] | 15 | USE mod_grid_phy_lmdz, ONLY: nbp_lon,nbp_lat,nbp_lev,klon_glo ! number of atmospheric columns (on full grid) |
---|
[2588] | 16 | USE mod_phys_lmdz_para, ONLY: klon_omp ! number of columns (on local omp grid) |
---|
[2315] | 17 | USE vertical_layers_mod, ONLY : init_vertical_layers |
---|
[3870] | 18 | USE infotrac, ONLY: nqtot,nqo,nbtr,nqCO2,tname,ttext,type_trac,& |
---|
[2320] | 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,& |
---|
[3924] | 26 | niso,ntraceurs_zone,ntraciso,nqtottr,itr_indice |
---|
[3677] | 27 | #ifdef CPP_StratAer |
---|
| 28 | USE infotrac, ONLY: nbtr_bin, nbtr_sulgas, id_OCS_strat, & |
---|
| 29 | id_SO2_strat, id_H2SO4_strat, id_BIN01_strat |
---|
| 30 | |
---|
| 31 | #endif |
---|
[2351] | 32 | #ifdef REPROBUS |
---|
| 33 | USE CHEM_REP, ONLY : Init_chem_rep_phys |
---|
[3666] | 34 | #ifdef CPP_PARA |
---|
| 35 | USE parallel_lmdz, ONLY : mpi_size, mpi_rank |
---|
| 36 | USE bands, ONLY : distrib_phys |
---|
[2351] | 37 | #endif |
---|
[3666] | 38 | USE mod_phys_lmdz_omp_data, ONLY: klon_omp |
---|
| 39 | #endif |
---|
[2609] | 40 | USE control_mod, ONLY: dayref,anneeref,day_step,nday,offline, iphysiq, config_inca |
---|
[2311] | 41 | USE inifis_mod, ONLY: inifis |
---|
[2343] | 42 | USE time_phylmdz_mod, ONLY: init_time |
---|
[3579] | 43 | USE temps_mod, ONLY: annee_ref, day_ini, day_ref, start_time, calend, year_len |
---|
[2320] | 44 | USE infotrac_phy, ONLY: init_infotrac_phy |
---|
[2343] | 45 | USE phystokenc_mod, ONLY: init_phystokenc |
---|
[1992] | 46 | USE phyaqua_mod, ONLY: iniaqua |
---|
[3435] | 47 | USE comconst_mod, ONLY: omeg, rad |
---|
[2372] | 48 | #ifdef INCA |
---|
| 49 | USE indice_sol_mod, ONLY: nbsrf, is_oce, is_sic, is_ter, is_lic |
---|
[2457] | 50 | #ifdef CPP_PARA |
---|
| 51 | USE parallel_lmdz, ONLY : mpi_size, mpi_rank |
---|
[2372] | 52 | USE bands, ONLY : distrib_phys |
---|
[2457] | 53 | #endif |
---|
[2372] | 54 | USE mod_phys_lmdz_omp_data, ONLY: klon_omp |
---|
| 55 | #endif |
---|
[2656] | 56 | USE ioipsl_getin_p_mod, ONLY: getin_p |
---|
| 57 | USE slab_heat_transp_mod, ONLY: ini_slab_transp_geom |
---|
[1992] | 58 | IMPLICIT NONE |
---|
[1671] | 59 | |
---|
[1992] | 60 | ! ======================================================================= |
---|
| 61 | ! Initialisation of the physical constants and some positional and |
---|
| 62 | ! geometrical arrays for the physics |
---|
| 63 | ! ======================================================================= |
---|
[1403] | 64 | |
---|
[2315] | 65 | include "dimensions.h" |
---|
[2656] | 66 | include "paramet.h" |
---|
[1992] | 67 | include "iniprint.h" |
---|
[2343] | 68 | include "tracstoke.h" |
---|
[2656] | 69 | include "comgeom.h" |
---|
[1992] | 70 | |
---|
| 71 | REAL, INTENT (IN) :: prad ! radius of the planet (m) |
---|
| 72 | REAL, INTENT (IN) :: pg ! gravitational acceleration (m/s2) |
---|
| 73 | REAL, INTENT (IN) :: pr ! ! reduced gas constant R/mu |
---|
| 74 | REAL, INTENT (IN) :: pcpp ! specific heat Cp |
---|
| 75 | REAL, INTENT (IN) :: punjours ! length (in s) of a standard day |
---|
| 76 | INTEGER, INTENT (IN) :: nlayer ! number of atmospheric layers |
---|
[2315] | 77 | INTEGER, INTENT (IN) :: ii ! number of atmospheric columns along longitudes |
---|
| 78 | INTEGER, INTENT (IN) :: jj ! number of atompsheric columns along latitudes |
---|
[2351] | 79 | INTEGER, INTENT(IN) :: nbp ! number of physics columns for this MPI process |
---|
| 80 | INTEGER, INTENT(IN) :: communicator ! MPI communicator |
---|
[2656] | 81 | REAL, INTENT (IN) :: rlatudyn(jj+1) ! latitudes of the physics grid |
---|
| 82 | REAL, INTENT (IN) :: rlatvdyn(jj) ! latitude boundaries of the physics grid |
---|
| 83 | REAL, INTENT (IN) :: rlonvdyn(ii+1) ! longitudes of the physics grid |
---|
| 84 | REAL, INTENT (IN) :: rlonudyn(ii+1) ! longitude boundaries of the physics grid |
---|
| 85 | REAL, INTENT (IN) :: airedyn(ii+1,jj+1) ! area of the dynamics grid (m2) |
---|
| 86 | REAL, INTENT (IN) :: cudyn((ii+1)*(jj+1)) ! cu coeff. (u_covariant = cu * u) |
---|
| 87 | REAL, INTENT (IN) :: cvdyn((ii+1)*jj) ! cv coeff. (v_covariant = cv * v) |
---|
[1992] | 88 | INTEGER, INTENT (IN) :: pdayref ! reference day of for the simulation |
---|
| 89 | REAL, INTENT (IN) :: ptimestep !physics time step (s) |
---|
| 90 | INTEGER, INTENT (IN) :: iflag_phys ! type of physics to be called |
---|
| 91 | |
---|
| 92 | INTEGER :: ibegin, iend, offset |
---|
[2351] | 93 | INTEGER :: i,j,k |
---|
[1992] | 94 | CHARACTER (LEN=20) :: modname = 'iniphysiq' |
---|
| 95 | CHARACTER (LEN=80) :: abort_message |
---|
[2656] | 96 | |
---|
| 97 | LOGICAL :: slab_hdiff |
---|
| 98 | INTEGER :: slab_ekman |
---|
| 99 | CHARACTER (LEN = 6) :: type_ocean |
---|
[1992] | 100 | |
---|
[2457] | 101 | #ifndef CPP_PARA |
---|
| 102 | INTEGER,PARAMETER :: mpi_rank=0 |
---|
| 103 | INTEGER, PARAMETER :: mpi_size = 1 |
---|
| 104 | INTEGER :: distrib_phys(mpi_rank:mpi_rank)=(jjm-1)*iim+2 |
---|
| 105 | #endif |
---|
| 106 | |
---|
[2588] | 107 | ! --> initialize physics distribution, global fields and geometry |
---|
| 108 | ! (i.e. things in phy_common or dynphy_lonlat) |
---|
| 109 | CALL inigeomphy(ii,jj,nlayer, & |
---|
| 110 | nbp, communicator, & |
---|
[2656] | 111 | rlatudyn,rlatvdyn, & |
---|
| 112 | rlonudyn,rlonvdyn, & |
---|
| 113 | airedyn,cudyn,cvdyn) |
---|
[2346] | 114 | |
---|
[2588] | 115 | ! --> now initialize things specific to the phylmd physics package |
---|
[2351] | 116 | |
---|
[2601] | 117 | !!$OMP PARALLEL DEFAULT(SHARED) COPYIN(/temps/) |
---|
| 118 | !$OMP PARALLEL DEFAULT(SHARED) & |
---|
| 119 | ! Copy all threadprivate variables in temps_mod |
---|
| 120 | !$OMP COPYIN(annee_ref, day_ini, day_ref, start_time) |
---|
[2351] | 121 | |
---|
[2311] | 122 | ! Initialize physical constants in physics: |
---|
| 123 | CALL inifis(punjours,prad,pg,pr,pcpp) |
---|
[2351] | 124 | |
---|
[2343] | 125 | CALL init_time(annee_ref,day_ref,day_ini,start_time,nday,ptimestep) |
---|
| 126 | |
---|
[2354] | 127 | ! Initialize dimphy module (unless in 1D where it has already been done) |
---|
[3435] | 128 | ! IF (klon_glo>1) CALL Init_dimphy(klon_omp,nlayer) |
---|
[2351] | 129 | |
---|
[2343] | 130 | ! Copy over "offline" settings |
---|
| 131 | CALL init_phystokenc(offline,istphy) |
---|
| 132 | |
---|
[2656] | 133 | ! Initialization for slab heat transport |
---|
| 134 | type_ocean="force" |
---|
| 135 | CALL getin_p('type_ocean',type_ocean) |
---|
| 136 | slab_hdiff=.FALSE. |
---|
| 137 | CALL getin_p('slab_hdiff',slab_hdiff) |
---|
| 138 | slab_ekman=0 |
---|
| 139 | CALL getin_p('slab_ekman',slab_ekman) |
---|
| 140 | IF ((type_ocean=='slab').AND.(slab_hdiff.OR.(slab_ekman.GT.0))) THEN |
---|
| 141 | CALL ini_slab_transp_geom(ip1jm,ip1jmp1,unsairez,fext,unsaire,& |
---|
| 142 | cu,cuvsurcv,cv,cvusurcu, & |
---|
| 143 | aire,apoln,apols, & |
---|
[3435] | 144 | aireu,airev,rlatvdyn,rad,omeg) |
---|
[2656] | 145 | END IF |
---|
| 146 | |
---|
[2320] | 147 | ! Initialize tracer names, numbers, etc. for physics |
---|
[3924] | 148 | CALL init_infotrac_phy(nqtot,nqo,nbtr,nqtottr,nqCO2,tname,ttext,type_trac,& |
---|
[2320] | 149 | niadv,conv_flg,pbl_flg,solsym,& |
---|
| 150 | nqfils,nqdesc,nqdesc_tot,iqfils,iqpere,& |
---|
| 151 | ok_isotopes,ok_iso_verif,ok_isotrac,& |
---|
| 152 | ok_init_iso,niso_possibles,tnat,& |
---|
| 153 | alpha_ideal,use_iso,iqiso,iso_num,& |
---|
| 154 | iso_indnum,zone_num,phase_num,& |
---|
| 155 | indnum_fn_num,index_trac,& |
---|
[3924] | 156 | niso,ntraceurs_zone,ntraciso,itr_indice & |
---|
[3677] | 157 | #ifdef CPP_StratAer |
---|
| 158 | ,nbtr_bin,nbtr_sulgas& |
---|
| 159 | ,id_OCS_strat,id_SO2_strat,id_H2SO4_strat,id_BIN01_strat& |
---|
| 160 | #endif |
---|
| 161 | ) |
---|
[2320] | 162 | |
---|
[2351] | 163 | ! Initializations for Reprobus |
---|
| 164 | IF (type_trac == 'repr') THEN |
---|
| 165 | #ifdef REPROBUS |
---|
[3666] | 166 | call Init_chem_rep_phys(klon_omp,nlayer) |
---|
| 167 | call init_reprobus_para( & |
---|
| 168 | nbp_lon,nbp_lat,nbp_lev,klon_glo,mpi_size, & |
---|
| 169 | distrib_phys,communicator) |
---|
[2351] | 170 | #endif |
---|
| 171 | ENDIF |
---|
[2372] | 172 | !$OMP END PARALLEL |
---|
[2225] | 173 | |
---|
[3865] | 174 | IF (type_trac == 'inca' .OR. type_trac == 'inco') THEN |
---|
[2372] | 175 | #ifdef INCA |
---|
| 176 | call init_const_lmdz( & |
---|
[2457] | 177 | anneeref,dayref, iphysiq,day_step,nday, & |
---|
[2609] | 178 | nbsrf, is_oce,is_sic, is_ter,is_lic, calend, & |
---|
| 179 | config_inca) |
---|
[2372] | 180 | call init_inca_para( & |
---|
| 181 | nbp_lon,nbp_lat,nbp_lev,klon_glo,mpi_size, & |
---|
[2457] | 182 | distrib_phys,communicator) |
---|
[2372] | 183 | #endif |
---|
| 184 | END IF |
---|
[3666] | 185 | IF (type_trac == 'repr') THEN |
---|
| 186 | #ifdef REPROBUS |
---|
| 187 | call init_reprobus_para( & |
---|
| 188 | nbp_lon,nbp_lat,nbp_lev,klon_glo,mpi_size, & |
---|
| 189 | distrib_phys,communicator) |
---|
| 190 | #endif |
---|
| 191 | ENDIF |
---|
[2372] | 192 | |
---|
[2601] | 193 | !!$OMP PARALLEL DEFAULT(SHARED) COPYIN(/temps/) |
---|
| 194 | !$OMP PARALLEL DEFAULT(SHARED) |
---|
[2311] | 195 | ! Additional initializations for aquaplanets |
---|
[1992] | 196 | IF (iflag_phys>=100) THEN |
---|
[3579] | 197 | CALL iniaqua(klon_omp,year_len,iflag_phys) |
---|
[1992] | 198 | END IF |
---|
[2372] | 199 | |
---|
[3865] | 200 | IF (type_trac == 'inca' .OR. type_trac == 'inco') THEN |
---|
[2372] | 201 | #ifdef INCA |
---|
| 202 | CALL init_inca_dim(klon_omp,nbp_lev,nbp_lon,nbp_lat - 1, & |
---|
[2656] | 203 | rlonudyn,rlatudyn,rlonvdyn,rlatvdyn) |
---|
[2372] | 204 | #endif |
---|
[3125] | 205 | IF (type_trac == 'repr') THEN |
---|
| 206 | #ifdef REPROBUS |
---|
| 207 | CALL Init_chem_rep_phys(klon_omp,nbp_lev) |
---|
| 208 | #endif |
---|
| 209 | END IF |
---|
[2372] | 210 | END IF |
---|
| 211 | |
---|
[2225] | 212 | !$OMP END PARALLEL |
---|
[1992] | 213 | |
---|
| 214 | END SUBROUTINE iniphysiq |
---|
[2347] | 215 | |
---|
| 216 | END MODULE iniphysiq_mod |
---|