[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 |
---|
[4368] | 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 | |
---|
[4368] | 20 | USE infotrac_phy, ONLY: nbtr, types_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 | |
---|
[4368] | 31 | !--- COHERENCE TEST BETWEEN "type_trac" AND "config_inca" |
---|
| 32 | IF((ANY(types_trac == 'inca') .OR. ANY(types_trac == 'inco')) .AND. ALL(config_inca /= ['aero', 'aeNP', 'chem']))& |
---|
| 33 | CALL abort_gcm('tracinca_init', 'INCA enabled, but unknown config_inca = "'//TRIM(config_inca)//'".' & |
---|
| 34 | //'Please modify "run.def"', 1) |
---|
| 35 | |
---|
| 36 | !--- PROBLEM IF "config_inca" DIFFERS FROM "none" AND INCA HAS NOT BEEN ACTIVATED |
---|
| 37 | IF(ALL(types_trac /= 'inca') .AND. ALL(types_trac /= 'inco') .AND. config_inca /= 'none') & |
---|
| 38 | CALL abort_gcm('tracinca_init', 'INCA disabled, but config_inca = "'//TRIM(config_inca)//'" should be "none".'& |
---|
| 39 | //'Please modify "run.def"', 1) |
---|
| 40 | |
---|
[1191] | 41 | END SUBROUTINE tracinca_init |
---|
| 42 | |
---|
| 43 | SUBROUTINE tracinca( & |
---|
| 44 | nstep, julien, gmtime, lafin, & |
---|
| 45 | pdtphys, t_seri, paprs, pplay, & |
---|
[2146] | 46 | pmfu, upwd, ftsol, pctsrf, pphis, & |
---|
[2784] | 47 | pphi, albsol, sh, ch, rh, & |
---|
[1191] | 48 | cldfra, rneb, diafra, cldliq, & |
---|
| 49 | itop_con, ibas_con, pmflxr, pmflxs, & |
---|
| 50 | prfl, psfl, aerosol_couple, flxmass_w, & |
---|
| 51 | tau_aero, piz_aero, cg_aero, ccm, & |
---|
| 52 | rfname, & |
---|
[2180] | 53 | tr_seri, source) |
---|
[1191] | 54 | |
---|
| 55 | !======================================================== |
---|
| 56 | ! -- CHIMIE INCA -- |
---|
| 57 | !======================================================== |
---|
| 58 | |
---|
| 59 | USE dimphy |
---|
[2320] | 60 | USE infotrac_phy, ONLY: nbtr |
---|
[1191] | 61 | USE vampir |
---|
[1785] | 62 | USE indice_sol_mod |
---|
[2363] | 63 | USE geometry_mod, ONLY: cell_area |
---|
| 64 | USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat |
---|
[2394] | 65 | USE aero_mod, ONLY : naero_grp |
---|
[1191] | 66 | IMPLICIT NONE |
---|
| 67 | |
---|
| 68 | !========================================================================== |
---|
| 69 | ! -- DESCRIPTION DES ARGUMENTS -- |
---|
| 70 | !========================================================================== |
---|
| 71 | |
---|
| 72 | |
---|
| 73 | ! EN ENTREE ... |
---|
| 74 | ! |
---|
| 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 |
---|
| 81 | |
---|
| 82 | |
---|
| 83 | !Physique: |
---|
| 84 | !-------- |
---|
| 85 | REAL,DIMENSION(klon,klev),INTENT(IN) :: t_seri ! Temperature |
---|
| 86 | REAL,DIMENSION(klon,klev),INTENT(IN) :: sh ! humidite specifique |
---|
[2784] | 87 | REAL,DIMENSION(klon,klev),INTENT(IN) :: ch ! eau liquide |
---|
[1191] | 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 liquide nuageuse |
---|
| 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 |
---|
| 100 | ! |
---|
| 101 | !Convection: |
---|
| 102 | !---------- |
---|
[2146] | 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 | |
---|
| 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] |
---|
| 109 | |
---|
| 110 | LOGICAL,INTENT(IN) :: aerosol_couple |
---|
| 111 | REAL,DIMENSION(klon,klev),INTENT(IN) :: flxmass_w |
---|
[2394] | 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 |
---|
[1191] | 116 | REAL,DIMENSION(klon,klev,2),INTENT(IN) :: ccm |
---|
| 117 | |
---|
| 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) |
---|
| 121 | |
---|
| 122 | |
---|
| 123 | ! InOutput argument |
---|
| 124 | REAL,DIMENSION(klon,klev,nbtr),INTENT(INOUT) :: tr_seri ! Concentration Traceur [U/KgA] |
---|
| 125 | |
---|
| 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 | |
---|
| 133 | INTEGER :: k |
---|
| 134 | REAL,DIMENSION(klon,klev) :: pdel |
---|
[2146] | 135 | REAL,DIMENSION(klon,klev) :: zpmfu ! flux de masse dans le panache montant |
---|
[1191] | 136 | REAL :: calday |
---|
| 137 | INTEGER :: ncsec |
---|
| 138 | |
---|
| 139 | CALL VTe(VTphysiq) |
---|
| 140 | CALL VTb(VTinca) |
---|
| 141 | |
---|
[1403] | 142 | calday = REAL(julien) + gmtime |
---|
[1191] | 143 | ncsec = NINT (86400.*gmtime) |
---|
| 144 | |
---|
| 145 | DO k = 1, klev |
---|
| 146 | pdel(:,k) = paprs(:,k) - paprs (:,k+1) |
---|
| 147 | END DO |
---|
[2180] | 148 | |
---|
[1191] | 149 | #ifdef INCA |
---|
[2624] | 150 | IF (config_inca == 'aero' .OR. config_inca == 'chem') THEN |
---|
[2180] | 151 | zpmfu(:,:)=pmfu(:,:) |
---|
| 152 | ELSE IF (config_inca == 'aeNP') THEN |
---|
| 153 | zpmfu(:,:)=upwd(:,:) |
---|
| 154 | ENDIF |
---|
[2171] | 155 | |
---|
[2180] | 156 | CALL aerosolmain( & |
---|
| 157 | aerosol_couple,tr_seri,pdtphys, & |
---|
| 158 | pplay,pdel,prfl,pmflxr,psfl, & |
---|
| 159 | pmflxs,zpmfu,itop_con,ibas_con, & |
---|
[2363] | 160 | pphi,cell_area,nstep,rneb,t_seri, & |
---|
[2180] | 161 | rh,tau_aero,piz_aero,cg_aero, & |
---|
[2609] | 162 | rfname,ccm,lafin) |
---|
[2146] | 163 | #endif |
---|
| 164 | |
---|
| 165 | |
---|
| 166 | #ifdef INCA |
---|
[1191] | 167 | CALL chemmain (tr_seri, & !mmr |
---|
| 168 | nstep, & !nstep |
---|
| 169 | calday, & !calday |
---|
| 170 | julien, & !ncdate |
---|
| 171 | ncsec, & !ncsec |
---|
| 172 | 1, & !lat |
---|
| 173 | pdtphys, & !delt |
---|
| 174 | paprs(1,1), & !ps |
---|
| 175 | pplay, & !pmid |
---|
| 176 | pdel, & !pdel |
---|
[2363] | 177 | cell_area, & |
---|
[1191] | 178 | pctsrf(1,1),& !oro |
---|
| 179 | ftsol, & !tsurf |
---|
| 180 | albsol, & !albs |
---|
| 181 | pphi, & !zma |
---|
| 182 | pphis, & !phis |
---|
| 183 | cldfra, & !cldfr |
---|
| 184 | rneb, & !cldfr_st |
---|
| 185 | diafra, & !cldfr_cv |
---|
| 186 | itop_con, & !cldtop |
---|
| 187 | ibas_con, & !cldbot |
---|
| 188 | cldliq, & !cwat |
---|
| 189 | prfl, & !flxrst |
---|
| 190 | pmflxr, & !flxrcv |
---|
| 191 | psfl, & !flxsst |
---|
| 192 | pmflxs, & !flxscv |
---|
[2146] | 193 | zpmfu, & !flxupd !--now depends on whether AP or NP |
---|
[1191] | 194 | flxmass_w, & !flxmass_w |
---|
| 195 | t_seri, & !tfld |
---|
| 196 | sh, & !sh |
---|
[2784] | 197 | ch, & !ql |
---|
[1191] | 198 | rh, & !rh |
---|
[2480] | 199 | nbp_lon, & !nx |
---|
[2363] | 200 | nbp_lat, & !ny |
---|
[2180] | 201 | source ) |
---|
[1191] | 202 | #endif |
---|
| 203 | |
---|
| 204 | CALL VTe(VTinca) |
---|
| 205 | CALL VTb(VTphysiq) |
---|
| 206 | |
---|
| 207 | |
---|
| 208 | END SUBROUTINE tracinca |
---|
| 209 | |
---|
| 210 | |
---|
| 211 | END MODULE tracinca_mod |
---|