[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 |
---|
[5091] | 64 | USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA |
---|
[1191] | 65 | IMPLICIT NONE |
---|
| 66 | |
---|
| 67 | !========================================================================== |
---|
| 68 | ! -- DESCRIPTION DES ARGUMENTS -- |
---|
| 69 | !========================================================================== |
---|
| 70 | |
---|
| 71 | |
---|
| 72 | ! EN ENTREE ... |
---|
| 73 | ! |
---|
| 74 | !Configuration grille,temps: |
---|
| 75 | INTEGER,INTENT(IN) :: nstep ! Appel physique |
---|
| 76 | INTEGER,INTENT(IN) :: julien ! Jour julien |
---|
| 77 | REAL,INTENT(IN) :: gmtime |
---|
| 78 | REAL,INTENT(IN) :: pdtphys ! Pas d'integration pour la physique (seconde) |
---|
| 79 | LOGICAL,INTENT(IN) :: lafin ! le flag de la fin de la physique |
---|
| 80 | |
---|
| 81 | |
---|
| 82 | !Physique: |
---|
| 83 | !-------- |
---|
| 84 | REAL,DIMENSION(klon,klev),INTENT(IN) :: t_seri ! Temperature |
---|
| 85 | REAL,DIMENSION(klon,klev),INTENT(IN) :: sh ! humidite specifique |
---|
[2784] | 86 | REAL,DIMENSION(klon,klev),INTENT(IN) :: ch ! eau liquide |
---|
[1191] | 87 | REAL,DIMENSION(klon,klev),INTENT(IN) :: rh ! humidite relative |
---|
| 88 | REAL,DIMENSION(klon,klev+1),INTENT(IN) :: paprs ! pression pour chaque inter-couche (en Pa) |
---|
| 89 | REAL,DIMENSION(klon,klev),INTENT(IN) :: pplay ! pression pour le mileu de chaque couche (en Pa) |
---|
| 90 | REAL,DIMENSION(klon,klev),INTENT(IN) :: pphi ! geopotentiel |
---|
| 91 | REAL,DIMENSION(klon),INTENT(IN) :: pphis |
---|
[4412] | 92 | REAL,DIMENSION(klon,klev),INTENT(IN) :: cldliq ! eau condensee pour le radiatif |
---|
[1191] | 93 | REAL,DIMENSION(klon,klev),INTENT(IN) :: cldfra ! fraction nuageuse (tous les nuages) |
---|
| 94 | REAL,DIMENSION(klon,klev),INTENT(IN) :: diafra ! fraction nuageuse (convection ou stratus artificiels) |
---|
| 95 | REAL,DIMENSION(klon,klev),INTENT(IN) :: rneb ! fraction nuageuse (grande echelle) |
---|
| 96 | INTEGER,DIMENSION(klon),INTENT(IN) :: itop_con |
---|
| 97 | INTEGER,DIMENSION(klon),INTENT(IN) :: ibas_con |
---|
| 98 | REAL,DIMENSION(klon),INTENT(IN) :: albsol ! albedo surface |
---|
| 99 | ! |
---|
| 100 | !Convection: |
---|
| 101 | !---------- |
---|
[2146] | 102 | REAL,DIMENSION(klon,klev),INTENT(IN) :: pmfu ! flux de masse dans le panache montant - Tiedtke |
---|
| 103 | REAL,DIMENSION(klon,klev),INTENT(IN) :: upwd ! flux de masse dans le panache montant - Emanuel |
---|
[1191] | 104 | |
---|
| 105 | !...Tiedke |
---|
| 106 | REAL,DIMENSION(klon,klev+1),INTENT(IN) :: pmflxr, pmflxs ! Flux precipitant de pluie, neige aux interfaces [convection] |
---|
| 107 | REAL,DIMENSION(klon,klev+1),INTENT(IN) :: prfl, psfl ! Flux precipitant de pluie, neige aux interfaces [large-scale] |
---|
| 108 | |
---|
| 109 | LOGICAL,INTENT(IN) :: aerosol_couple |
---|
| 110 | REAL,DIMENSION(klon,klev),INTENT(IN) :: flxmass_w |
---|
[2394] | 111 | REAL,DIMENSION(klon,klev,naero_grp,2),INTENT(IN) :: tau_aero |
---|
| 112 | REAL,DIMENSION(klon,klev,naero_grp,2),INTENT(IN) :: piz_aero |
---|
| 113 | REAL,DIMENSION(klon,klev,naero_grp,2),INTENT(IN) :: cg_aero |
---|
| 114 | CHARACTER(len=4),DIMENSION(naero_grp),INTENT(IN) :: rfname |
---|
[1191] | 115 | REAL,DIMENSION(klon,klev,2),INTENT(IN) :: ccm |
---|
| 116 | |
---|
| 117 | ! Arguments necessaires pour les sources et puits de traceur: |
---|
| 118 | REAL,DIMENSION(klon,nbsrf),INTENT(IN) :: ftsol ! Temperature du sol (surf)(Kelvin) |
---|
| 119 | REAL,DIMENSION(klon,nbsrf),INTENT(IN) :: pctsrf ! Pourcentage de sol f(nature du sol) |
---|
| 120 | |
---|
| 121 | |
---|
| 122 | ! InOutput argument |
---|
| 123 | REAL,DIMENSION(klon,klev,nbtr),INTENT(INOUT) :: tr_seri ! Concentration Traceur [U/KgA] |
---|
| 124 | |
---|
| 125 | ! Output arguments |
---|
| 126 | REAL,DIMENSION(klon,nbtr), INTENT(OUT) :: source ! a voir lorsque le flux de surface est prescrit |
---|
| 127 | |
---|
| 128 | !======================================================================================= |
---|
| 129 | ! -- VARIABLES LOCALES TRACEURS -- |
---|
| 130 | !======================================================================================= |
---|
| 131 | |
---|
| 132 | INTEGER :: k |
---|
| 133 | REAL,DIMENSION(klon,klev) :: pdel |
---|
[2146] | 134 | REAL,DIMENSION(klon,klev) :: zpmfu ! flux de masse dans le panache montant |
---|
[1191] | 135 | REAL :: calday |
---|
| 136 | INTEGER :: ncsec |
---|
| 137 | |
---|
| 138 | CALL VTe(VTphysiq) |
---|
| 139 | CALL VTb(VTinca) |
---|
| 140 | |
---|
[1403] | 141 | calday = REAL(julien) + gmtime |
---|
[1191] | 142 | ncsec = NINT (86400.*gmtime) |
---|
| 143 | |
---|
| 144 | DO k = 1, klev |
---|
| 145 | pdel(:,k) = paprs(:,k) - paprs (:,k+1) |
---|
| 146 | END DO |
---|
[2180] | 147 | |
---|
[5091] | 148 | IF (CPPKEY_INCA) THEN |
---|
[2624] | 149 | IF (config_inca == 'aero' .OR. config_inca == 'chem') THEN |
---|
[2180] | 150 | zpmfu(:,:)=pmfu(:,:) |
---|
| 151 | ELSE IF (config_inca == 'aeNP') THEN |
---|
| 152 | zpmfu(:,:)=upwd(:,:) |
---|
| 153 | ENDIF |
---|
[2171] | 154 | |
---|
[2180] | 155 | CALL aerosolmain( & |
---|
| 156 | aerosol_couple,tr_seri,pdtphys, & |
---|
| 157 | pplay,pdel,prfl,pmflxr,psfl, & |
---|
| 158 | pmflxs,zpmfu,itop_con,ibas_con, & |
---|
[2363] | 159 | pphi,cell_area,nstep,rneb,t_seri, & |
---|
[2180] | 160 | rh,tau_aero,piz_aero,cg_aero, & |
---|
[2609] | 161 | rfname,ccm,lafin) |
---|
[2146] | 162 | |
---|
[1191] | 163 | CALL chemmain (tr_seri, & !mmr |
---|
| 164 | nstep, & !nstep |
---|
| 165 | calday, & !calday |
---|
| 166 | julien, & !ncdate |
---|
| 167 | ncsec, & !ncsec |
---|
| 168 | 1, & !lat |
---|
| 169 | pdtphys, & !delt |
---|
| 170 | paprs(1,1), & !ps |
---|
| 171 | pplay, & !pmid |
---|
| 172 | pdel, & !pdel |
---|
[2363] | 173 | cell_area, & |
---|
[1191] | 174 | pctsrf(1,1),& !oro |
---|
| 175 | ftsol, & !tsurf |
---|
| 176 | albsol, & !albs |
---|
| 177 | pphi, & !zma |
---|
| 178 | pphis, & !phis |
---|
| 179 | cldfra, & !cldfr |
---|
| 180 | rneb, & !cldfr_st |
---|
| 181 | diafra, & !cldfr_cv |
---|
| 182 | itop_con, & !cldtop |
---|
| 183 | ibas_con, & !cldbot |
---|
| 184 | cldliq, & !cwat |
---|
| 185 | prfl, & !flxrst |
---|
| 186 | pmflxr, & !flxrcv |
---|
| 187 | psfl, & !flxsst |
---|
| 188 | pmflxs, & !flxscv |
---|
[2146] | 189 | zpmfu, & !flxupd !--now depends on whether AP or NP |
---|
[1191] | 190 | flxmass_w, & !flxmass_w |
---|
| 191 | t_seri, & !tfld |
---|
| 192 | sh, & !sh |
---|
[2784] | 193 | ch, & !ql |
---|
[1191] | 194 | rh, & !rh |
---|
[2480] | 195 | nbp_lon, & !nx |
---|
[2363] | 196 | nbp_lat, & !ny |
---|
[2180] | 197 | source ) |
---|
[5091] | 198 | END IF |
---|
[1191] | 199 | |
---|
| 200 | CALL VTe(VTinca) |
---|
| 201 | CALL VTb(VTphysiq) |
---|
| 202 | |
---|
| 203 | |
---|
| 204 | END SUBROUTINE tracinca |
---|
| 205 | |
---|
| 206 | |
---|
| 207 | END MODULE tracinca_mod |
---|