[2347] | 1 | ! |
---|
[1403] | 2 | ! $Id: iniphysiq_mod.F90 2588 2016-07-13 06:54:39Z emillour $ |
---|
[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 |
---|
[2588] | 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) |
---|
[2315] | 17 | USE vertical_layers_mod, ONLY : init_vertical_layers |
---|
[2320] | 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 |
---|
[2351] | 27 | #ifdef REPROBUS |
---|
| 28 | USE CHEM_REP, ONLY : Init_chem_rep_phys |
---|
| 29 | #endif |
---|
[2372] | 30 | USE control_mod, ONLY: dayref,anneeref,day_step,nday,offline, iphysiq |
---|
[2311] | 31 | USE inifis_mod, ONLY: inifis |
---|
[2343] | 32 | USE time_phylmdz_mod, ONLY: init_time |
---|
[2320] | 33 | USE infotrac_phy, ONLY: init_infotrac_phy |
---|
[2343] | 34 | USE phystokenc_mod, ONLY: init_phystokenc |
---|
[1992] | 35 | USE phyaqua_mod, ONLY: iniaqua |
---|
[2372] | 36 | #ifdef INCA |
---|
| 37 | USE indice_sol_mod, ONLY: nbsrf, is_oce, is_sic, is_ter, is_lic |
---|
[2457] | 38 | #ifdef CPP_PARA |
---|
| 39 | USE parallel_lmdz, ONLY : mpi_size, mpi_rank |
---|
[2372] | 40 | USE bands, ONLY : distrib_phys |
---|
[2457] | 41 | #endif |
---|
[2372] | 42 | USE mod_phys_lmdz_omp_data, ONLY: klon_omp |
---|
| 43 | #endif |
---|
[1992] | 44 | IMPLICIT NONE |
---|
[1671] | 45 | |
---|
[1992] | 46 | ! ======================================================================= |
---|
| 47 | ! Initialisation of the physical constants and some positional and |
---|
| 48 | ! geometrical arrays for the physics |
---|
| 49 | ! ======================================================================= |
---|
[1403] | 50 | |
---|
[2315] | 51 | include "dimensions.h" |
---|
| 52 | include "comvert.h" |
---|
[2346] | 53 | include "comconst.h" |
---|
[1992] | 54 | include "iniprint.h" |
---|
[2343] | 55 | include "temps.h" |
---|
| 56 | include "tracstoke.h" |
---|
[1992] | 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 |
---|
[2315] | 64 | INTEGER, INTENT (IN) :: ii ! number of atmospheric columns along longitudes |
---|
| 65 | INTEGER, INTENT (IN) :: jj ! number of atompsheric columns along latitudes |
---|
[2351] | 66 | INTEGER, INTENT(IN) :: nbp ! number of physics columns for this MPI process |
---|
| 67 | INTEGER, INTENT(IN) :: communicator ! MPI communicator |
---|
[2315] | 68 | REAL, INTENT (IN) :: rlatu(jj+1) ! latitudes of the physics grid |
---|
[2346] | 69 | REAL, INTENT (IN) :: rlatv(jj) ! latitude boundaries of the physics grid |
---|
[2315] | 70 | REAL, INTENT (IN) :: rlonv(ii+1) ! longitudes of the physics grid |
---|
[2346] | 71 | REAL, INTENT (IN) :: rlonu(ii+1) ! longitude boundaries of the physics grid |
---|
[2315] | 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) |
---|
[1992] | 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 |
---|
[2351] | 80 | INTEGER :: i,j,k |
---|
[1992] | 81 | CHARACTER (LEN=20) :: modname = 'iniphysiq' |
---|
| 82 | CHARACTER (LEN=80) :: abort_message |
---|
| 83 | |
---|
[2225] | 84 | |
---|
[2457] | 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 | |
---|
[2588] | 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) |
---|
[2346] | 98 | |
---|
[2588] | 99 | ! --> now initialize things specific to the phylmd physics package |
---|
[2351] | 100 | |
---|
[2343] | 101 | !$OMP PARALLEL DEFAULT(SHARED) COPYIN(/temps/) |
---|
[2351] | 102 | |
---|
| 103 | ! copy over preff , ap(), bp(), etc |
---|
| 104 | CALL init_vertical_layers(nlayer,preff,scaleheight, & |
---|
| 105 | ap,bp,presnivs,pseudoalt) |
---|
| 106 | |
---|
[2311] | 107 | ! Initialize physical constants in physics: |
---|
| 108 | CALL inifis(punjours,prad,pg,pr,pcpp) |
---|
[2351] | 109 | |
---|
[2343] | 110 | CALL init_time(annee_ref,day_ref,day_ini,start_time,nday,ptimestep) |
---|
| 111 | |
---|
[2354] | 112 | ! Initialize dimphy module (unless in 1D where it has already been done) |
---|
| 113 | IF (klon_glo>1) CALL Init_dimphy(klon_omp,nlayer) |
---|
[2351] | 114 | |
---|
[2343] | 115 | ! Copy over "offline" settings |
---|
| 116 | CALL init_phystokenc(offline,istphy) |
---|
| 117 | |
---|
[2320] | 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 | |
---|
[2351] | 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 |
---|
[2372] | 135 | !$OMP END PARALLEL |
---|
[2225] | 136 | |
---|
[2372] | 137 | IF (type_trac == 'inca') THEN |
---|
| 138 | #ifdef INCA |
---|
| 139 | call init_const_lmdz( & |
---|
[2457] | 140 | anneeref,dayref, iphysiq,day_step,nday, & |
---|
| 141 | nbsrf, is_oce,is_sic, is_ter,is_lic, calend) |
---|
[2372] | 142 | call init_inca_para( & |
---|
| 143 | nbp_lon,nbp_lat,nbp_lev,klon_glo,mpi_size, & |
---|
[2457] | 144 | distrib_phys,communicator) |
---|
[2372] | 145 | #endif |
---|
| 146 | END IF |
---|
| 147 | !$OMP PARALLEL DEFAULT(SHARED) COPYIN(/temps/) |
---|
| 148 | |
---|
[2311] | 149 | ! Additional initializations for aquaplanets |
---|
[1992] | 150 | IF (iflag_phys>=100) THEN |
---|
[2351] | 151 | CALL iniaqua(klon_omp,iflag_phys) |
---|
[1992] | 152 | END IF |
---|
[2372] | 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 | |
---|
[2225] | 161 | !$OMP END PARALLEL |
---|
[1992] | 162 | |
---|
| 163 | END SUBROUTINE iniphysiq |
---|
[2347] | 164 | |
---|
| 165 | END MODULE iniphysiq_mod |
---|