[1191] | 1 | !$Id $ |
---|
[5099] | 2 | |
---|
[1191] | 3 | MODULE tracinca_mod |
---|
[5099] | 4 | |
---|
[5111] | 5 | ! This module prepares and calls the INCA main subroutines. |
---|
[5099] | 6 | |
---|
[5111] | 7 | IMPLICIT NONE |
---|
[1191] | 8 | |
---|
[5111] | 9 | CHARACTER(len = 4), SAVE :: config_inca |
---|
| 10 | !$OMP THREADPRIVATE(config_inca) |
---|
| 11 | ! config_inca='none' => without INCA |
---|
| 12 | ! config_inca='chem' => INCA with chemistry |
---|
| 13 | ! config_inca='aero' => INCA with aerosols |
---|
| 14 | ! config_inca='aeNP' => INCA with aerosols NP (?) |
---|
[1191] | 15 | CONTAINS |
---|
| 16 | |
---|
[5111] | 17 | SUBROUTINE tracinca_init(aerosol, lessivage) |
---|
[5103] | 18 | ! This SUBROUTINE initialize some control varaibles. |
---|
[1191] | 19 | |
---|
[4389] | 20 | USE infotrac_phy, ONLY: nbtr, type_trac |
---|
[5111] | 21 | USE lmdz_abort_physic, ONLY: abort_physic |
---|
[1191] | 22 | IMPLICIT NONE |
---|
[5111] | 23 | |
---|
[1191] | 24 | ! Output variables |
---|
[5111] | 25 | LOGICAL, DIMENSION(nbtr), INTENT(OUT) :: aerosol |
---|
| 26 | LOGICAL, INTENT(OUT) :: lessivage |
---|
| 27 | |
---|
[1191] | 28 | ! Initialization |
---|
[5111] | 29 | lessivage = .FALSE. |
---|
[1191] | 30 | aerosol(:) = .FALSE. |
---|
[2345] | 31 | |
---|
[4358] | 32 | !--- COHERENCE TEST BETWEEN "type_trac" AND "config_inca" |
---|
[5111] | 33 | IF(ANY(type_trac == ['inca', 'inco']) .AND. ALL(config_inca /= ['aero', 'aeNP', 'chem'])) CALL abort_physic('tracinca_init', & |
---|
| 34 | 'INCA enabled, but unknown config_inca = "' // TRIM(config_inca) // '". Please modify "run.def"', 1) |
---|
[4358] | 35 | |
---|
| 36 | !--- PROBLEM IF "config_inca" DIFFERS FROM "none" AND INCA HAS NOT BEEN ACTIVATED |
---|
[5111] | 37 | IF(ALL(type_trac /= ['inca', 'inco']) .AND. config_inca /= 'none') CALL abort_physic('tracinca_init', & |
---|
| 38 | 'INCA disabled, but config_inca = "' // TRIM(config_inca) // '" should be "none". Please modify "run.def"', 1) |
---|
[4358] | 39 | |
---|
[1191] | 40 | END SUBROUTINE tracinca_init |
---|
| 41 | |
---|
[5111] | 42 | SUBROUTINE tracinca(& |
---|
| 43 | nstep, julien, gmtime, lafin, & |
---|
| 44 | pdtphys, t_seri, paprs, pplay, & |
---|
| 45 | pmfu, upwd, ftsol, pctsrf, pphis, & |
---|
| 46 | pphi, albsol, sh, ch, rh, & |
---|
| 47 | cldfra, rneb, diafra, cldliq, & |
---|
| 48 | itop_con, ibas_con, pmflxr, pmflxs, & |
---|
| 49 | prfl, psfl, aerosol_couple, flxmass_w, & |
---|
| 50 | tau_aero, piz_aero, cg_aero, ccm, & |
---|
| 51 | rfname, & |
---|
| 52 | tr_seri, source) |
---|
[1191] | 53 | |
---|
[5111] | 54 | !======================================================== |
---|
| 55 | ! -- CHIMIE INCA -- |
---|
| 56 | !======================================================== |
---|
[1191] | 57 | |
---|
| 58 | USE dimphy |
---|
[2320] | 59 | USE infotrac_phy, ONLY: nbtr |
---|
[5117] | 60 | USE lmdz_vampir |
---|
[1785] | 61 | USE indice_sol_mod |
---|
[5112] | 62 | USE lmdz_geometry, ONLY: cell_area |
---|
[5110] | 63 | USE lmdz_grid_phy, ONLY: nbp_lon, nbp_lat |
---|
[5101] | 64 | USE aero_mod, ONLY: naero_grp |
---|
[5091] | 65 | USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA |
---|
[1191] | 66 | IMPLICIT NONE |
---|
| 67 | |
---|
[5111] | 68 | !========================================================================== |
---|
| 69 | ! -- DESCRIPTION DES ARGUMENTS -- |
---|
| 70 | !========================================================================== |
---|
[1191] | 71 | |
---|
[5099] | 72 | |
---|
[5111] | 73 | ! EN ENTREE ... |
---|
[1191] | 74 | |
---|
[5111] | 75 | !Configuration grille,temps: |
---|
| 76 | INTEGER, INTENT(IN) :: nstep ! Appel physique |
---|
| 77 | INTEGER, INTENT(IN) :: julien ! Jour julien |
---|
| 78 | REAL, INTENT(IN) :: gmtime |
---|
| 79 | REAL, INTENT(IN) :: pdtphys ! Pas d'integration pour la physique (seconde) |
---|
| 80 | LOGICAL, INTENT(IN) :: lafin ! le flag de la fin de la physique |
---|
[5099] | 81 | |
---|
[1191] | 82 | |
---|
[5111] | 83 | !Physique: |
---|
| 84 | !-------- |
---|
| 85 | REAL, DIMENSION(klon, klev), INTENT(IN) :: t_seri ! Temperature |
---|
| 86 | REAL, DIMENSION(klon, klev), INTENT(IN) :: sh ! humidite specifique |
---|
| 87 | REAL, DIMENSION(klon, klev), INTENT(IN) :: ch ! eau liquide |
---|
| 88 | REAL, DIMENSION(klon, klev), INTENT(IN) :: rh ! humidite relative |
---|
| 89 | REAL, DIMENSION(klon, klev + 1), INTENT(IN) :: paprs ! pression pour chaque inter-couche (en Pa) |
---|
| 90 | REAL, DIMENSION(klon, klev), INTENT(IN) :: pplay ! pression pour le mileu de chaque couche (en Pa) |
---|
| 91 | REAL, DIMENSION(klon, klev), INTENT(IN) :: pphi ! geopotentiel |
---|
| 92 | REAL, DIMENSION(klon), INTENT(IN) :: pphis |
---|
| 93 | REAL, DIMENSION(klon, klev), INTENT(IN) :: cldliq ! eau condensee pour le radiatif |
---|
| 94 | REAL, DIMENSION(klon, klev), INTENT(IN) :: cldfra ! fraction nuageuse (tous les nuages) |
---|
| 95 | REAL, DIMENSION(klon, klev), INTENT(IN) :: diafra ! fraction nuageuse (convection ou stratus artificiels) |
---|
| 96 | REAL, DIMENSION(klon, klev), INTENT(IN) :: rneb ! fraction nuageuse (grande echelle) |
---|
| 97 | INTEGER, DIMENSION(klon), INTENT(IN) :: itop_con |
---|
| 98 | INTEGER, DIMENSION(klon), INTENT(IN) :: ibas_con |
---|
| 99 | REAL, DIMENSION(klon), INTENT(IN) :: albsol ! albedo surface |
---|
[1191] | 100 | |
---|
[5111] | 101 | !Convection: |
---|
| 102 | !---------- |
---|
| 103 | REAL, DIMENSION(klon, klev), INTENT(IN) :: pmfu ! flux de masse dans le panache montant - Tiedtke |
---|
| 104 | REAL, DIMENSION(klon, klev), INTENT(IN) :: upwd ! flux de masse dans le panache montant - Emanuel |
---|
[1191] | 105 | |
---|
[5111] | 106 | !...Tiedke |
---|
| 107 | REAL, DIMENSION(klon, klev + 1), INTENT(IN) :: pmflxr, pmflxs ! Flux precipitant de pluie, neige aux interfaces [convection] |
---|
| 108 | REAL, DIMENSION(klon, klev + 1), INTENT(IN) :: prfl, psfl ! Flux precipitant de pluie, neige aux interfaces [large-scale] |
---|
[1191] | 109 | |
---|
[5111] | 110 | LOGICAL, INTENT(IN) :: aerosol_couple |
---|
| 111 | REAL, DIMENSION(klon, klev), INTENT(IN) :: flxmass_w |
---|
| 112 | REAL, DIMENSION(klon, klev, naero_grp, 2), INTENT(IN) :: tau_aero |
---|
| 113 | REAL, DIMENSION(klon, klev, naero_grp, 2), INTENT(IN) :: piz_aero |
---|
| 114 | REAL, DIMENSION(klon, klev, naero_grp, 2), INTENT(IN) :: cg_aero |
---|
| 115 | CHARACTER(len = 4), DIMENSION(naero_grp), INTENT(IN) :: rfname |
---|
| 116 | REAL, DIMENSION(klon, klev, 2), INTENT(IN) :: ccm |
---|
[1191] | 117 | |
---|
[5111] | 118 | ! Arguments necessaires pour les sources et puits de traceur: |
---|
| 119 | REAL, DIMENSION(klon, nbsrf), INTENT(IN) :: ftsol ! Temperature du sol (surf)(Kelvin) |
---|
| 120 | REAL, DIMENSION(klon, nbsrf), INTENT(IN) :: pctsrf ! Pourcentage de sol f(nature du sol) |
---|
[1191] | 121 | |
---|
| 122 | |
---|
[5111] | 123 | ! InOutput argument |
---|
| 124 | REAL, DIMENSION(klon, klev, nbtr), INTENT(INOUT) :: tr_seri ! Concentration Traceur [U/KgA] |
---|
[1191] | 125 | |
---|
[5111] | 126 | ! Output arguments |
---|
| 127 | REAL, DIMENSION(klon, nbtr), INTENT(OUT) :: source ! a voir lorsque le flux de surface est prescrit |
---|
| 128 | |
---|
| 129 | !======================================================================================= |
---|
| 130 | ! -- VARIABLES LOCALES TRACEURS -- |
---|
| 131 | !======================================================================================= |
---|
| 132 | |
---|
[1191] | 133 | INTEGER :: k |
---|
[5111] | 134 | REAL, DIMENSION(klon, klev) :: pdel |
---|
| 135 | REAL, DIMENSION(klon, klev) :: zpmfu ! flux de masse dans le panache montant |
---|
| 136 | REAL :: calday |
---|
[1191] | 137 | INTEGER :: ncsec |
---|
| 138 | |
---|
| 139 | CALL VTe(VTphysiq) |
---|
| 140 | CALL VTb(VTinca) |
---|
[5111] | 141 | |
---|
[1403] | 142 | calday = REAL(julien) + gmtime |
---|
[5111] | 143 | ncsec = NINT (86400. * gmtime) |
---|
| 144 | |
---|
[1191] | 145 | DO k = 1, klev |
---|
[5111] | 146 | pdel(:, k) = paprs(:, k) - paprs (:, k + 1) |
---|
[1191] | 147 | END DO |
---|
[2171] | 148 | |
---|
[5111] | 149 | IF (CPPKEY_INCA) THEN |
---|
| 150 | IF (config_inca == 'aero' .OR. config_inca == 'chem') THEN |
---|
| 151 | zpmfu(:, :) = pmfu(:, :) |
---|
| 152 | ELSE IF (config_inca == 'aeNP') THEN |
---|
| 153 | zpmfu(:, :) = upwd(:, :) |
---|
| 154 | ENDIF |
---|
[2146] | 155 | |
---|
[5111] | 156 | CALL aerosolmain(& |
---|
| 157 | aerosol_couple, tr_seri, pdtphys, & |
---|
| 158 | pplay, pdel, prfl, pmflxr, psfl, & |
---|
| 159 | pmflxs, zpmfu, itop_con, ibas_con, & |
---|
| 160 | pphi, cell_area, nstep, rneb, t_seri, & |
---|
| 161 | rh, tau_aero, piz_aero, cg_aero, & |
---|
| 162 | rfname, ccm, lafin) |
---|
| 163 | |
---|
| 164 | CALL chemmain (tr_seri, & !mmr |
---|
| 165 | nstep, & !nstep |
---|
| 166 | calday, & !calday |
---|
| 167 | julien, & !ncdate |
---|
| 168 | ncsec, & !ncsec |
---|
| 169 | 1, & !lat |
---|
| 170 | pdtphys, & !delt |
---|
| 171 | paprs(1, 1), & !ps |
---|
| 172 | pplay, & !pmid |
---|
| 173 | pdel, & !pdel |
---|
| 174 | cell_area, & |
---|
| 175 | pctsrf(1, 1), & !oro |
---|
| 176 | ftsol, & !tsurf |
---|
| 177 | albsol, & !albs |
---|
| 178 | pphi, & !zma |
---|
| 179 | pphis, & !phis |
---|
| 180 | cldfra, & !cldfr |
---|
| 181 | rneb, & !cldfr_st |
---|
| 182 | diafra, & !cldfr_cv |
---|
| 183 | itop_con, & !cldtop |
---|
| 184 | ibas_con, & !cldbot |
---|
| 185 | cldliq, & !cwat |
---|
| 186 | prfl, & !flxrst |
---|
| 187 | pmflxr, & !flxrcv |
---|
| 188 | psfl, & !flxsst |
---|
| 189 | pmflxs, & !flxscv |
---|
| 190 | zpmfu, & !flxupd !--now depends on whether AP or NP |
---|
| 191 | flxmass_w, & !flxmass_w |
---|
| 192 | t_seri, & !tfld |
---|
| 193 | sh, & !sh |
---|
| 194 | ch, & !ql |
---|
| 195 | rh, & !rh |
---|
| 196 | nbp_lon, & !nx |
---|
| 197 | nbp_lat, & !ny |
---|
| 198 | source) |
---|
| 199 | END IF |
---|
| 200 | |
---|
[1191] | 201 | CALL VTe(VTinca) |
---|
| 202 | CALL VTb(VTphysiq) |
---|
[5111] | 203 | |
---|
[1191] | 204 | END SUBROUTINE tracinca |
---|
| 205 | |
---|
| 206 | |
---|
| 207 | END MODULE tracinca_mod |
---|