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