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