Changeset 1672 for trunk/LMDZ.TITAN/libf
- Timestamp:
- Mar 8, 2017, 10:37:31 AM (8 years ago)
- Location:
- trunk/LMDZ.TITAN/libf
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.TITAN/libf/chimtitan/disso.c
r1126 r1672 179 179 double f,**flux; 180 180 double flact; 181 char name[60],dir[2 4];181 char name[60],dir[27]; 182 182 FILE *fp,*out; 183 183 … … 186 186 /* lecture des flux actiniques: 187 187 - suppose que l'executable est dans $LMDGCM/RUN/xxx/ 188 - et les moyennes dans $LMDGCM/ INPUT/PHOT(NLAT)/Moy_(lat:1 a NLAT)188 - et les moyennes dans $LMDGCM/datagcm/PHOT(NLAT)/Moy_(lat:1 a NLAT) 189 189 */ 190 strcpy( dir, "../../ INPUT/PHOT" );190 strcpy( dir, "../../datagcm/PHOT" ); 191 191 if( (*NLAT) < 10 ) 192 192 { -
trunk/LMDZ.TITAN/libf/phytitan/callkeys_mod.F90
r1670 r1672 4 4 logical,save :: callrad,corrk,calldifv,UseTurbDiff 5 5 !$OMP THREADPRIVATE(callrad,corrk,calldifv,UseTurbDiff) 6 logical,save :: calladj,callsoil 7 !$OMP THREADPRIVATE(calladj,callsoil )6 logical,save :: calladj,callsoil,callchim 7 !$OMP THREADPRIVATE(calladj,callsoil,callchim) 8 8 logical,save :: season,diurnal,tlocked,rings_shadow,lwrite 9 9 !$OMP THREADPRIVATE(season,diurnal,tlocked,rings_shadow,lwrite) … … 38 38 logical,save :: oblate 39 39 !$OMP THREADPRIVATE(nosurf,oblate) 40 40 41 integer,save :: ichim 41 42 integer,save :: iddist 42 43 integer,save :: iaervar 43 44 integer,save :: iradia 44 45 integer,save :: startype 45 !$OMP THREADPRIVATE(i ddist,iaervar,iradia,startype)46 !$OMP THREADPRIVATE(ichim,iddist,iaervar,iradia,startype) 46 47 47 48 real,save :: Fat1AU -
trunk/LMDZ.TITAN/libf/phytitan/comcstfi_mod.F90
r1524 r1672 11 11 REAL,SAVE :: omeg ! planet rotation rate (rad/s) 12 12 REAL,SAVE :: avocado ! something like 6.022e23 13 !$OMP THREADPRIVATE(pi,rad,g,r,cpp,rcp,mugaz,omeg,avocado) 13 REAL,SAVE :: kbol ! something like 1.380649e-23 14 !$OMP THREADPRIVATE(pi,rad,g,r,cpp,rcp,mugaz,omeg,avocado,kbol) 14 15 15 16 END MODULE comcstfi_mod -
trunk/LMDZ.TITAN/libf/phytitan/disr_haze.F90
r1663 r1672 59 59 press_PL(:)=press_PL(:)*1E-2 60 60 61 ! Correction of the table according to Lavvas et al. 2010 (ext coeff = constant < 80 km / 20 mbar ) because of condensation62 ! do i=1,4963 ! ext_PL(i,:) = ext_PL(50,:)64 ! enddo65 66 61 firstcall=.false. 67 62 endif … … 101 96 ! Lin-Log interpolation : linear on wln, logarithmic on press 102 97 98 if ((iw.ne.nbwl_PL).and.(ip.ne.nblev_PL)) then 103 99 taeros = ( ext_PL(ip,iw)*(1.-factw) + ext_PL(ip,iw+1) *factw ) ** (1.-factp) & 104 100 *( ext_PL(ip+1,iw)*(1.-factw) + ext_PL(ip+1,iw+1)*factw ) ** factp … … 109 105 cbar = ( asf_PL(ip,iw)*(1.-factw) + asf_PL(ip,iw+1) *factw ) ** (1.-factp) & 110 106 *( asf_PL(ip+1,iw)*(1.-factw) + asf_PL(ip+1,iw+1)*factw ) ** factp 107 else if ((iw.eq.nbwl_PL).and.(ip.ne.nblev_PL)) then 108 taeros = ext_PL(ip,iw) ** (1.-factp) * ext_PL(ip+1,iw) ** factp 109 110 ssa = ssa_PL(ip,iw) ** (1.-factp) * ssa_PL(ip+1,iw) ** factp 111 112 cbar = asf_PL(ip,iw) ** (1.-factp) * asf_PL(ip+1,iw) ** factp 111 113 112 114 ! In case of vertical extension over the max of the table … … 114 116 ! Arbitray threshold pressure value, just to deal with the last level press=0 115 117 116 if(ip.eq.nblev_PL) then118 else if(ip.eq.nblev_PL) then 117 119 118 120 tmp_p = press … … 122 124 endif 123 125 124 fact_t = log10( ( ext_PL(ip,iw)*(1.-factw) + ext_PL(ip,iw+1) *factw ) & 125 / ( ext_PL(ip-5,iw)*(1.-factw) + ext_PL(ip-5,iw+1) *factw ) ) 126 fact_s = log10( ( ssa_PL(ip,iw)*(1.-factw) + ssa_PL(ip,iw+1) *factw ) & 127 / ( ssa_PL(ip-5,iw)*(1.-factw) + ssa_PL(ip-5,iw+1) *factw ) ) 128 fact_c = log10( ( asf_PL(ip,iw)*(1.-factw) + asf_PL(ip,iw+1) *factw ) & 129 / ( asf_PL(ip-5,iw)*(1.-factw) + asf_PL(ip-5,iw+1) *factw ) ) 126 if (iw.ne.nbwl_PL) then 127 fact_t = log10( ( ext_PL(ip,iw)*(1.-factw) + ext_PL(ip,iw+1) *factw ) & 128 / ( ext_PL(ip-5,iw)*(1.-factw) + ext_PL(ip-5,iw+1) *factw ) ) 129 fact_s = log10( ( ssa_PL(ip,iw)*(1.-factw) + ssa_PL(ip,iw+1) *factw ) & 130 / ( ssa_PL(ip-5,iw)*(1.-factw) + ssa_PL(ip-5,iw+1) *factw ) ) 131 fact_c = log10( ( asf_PL(ip,iw)*(1.-factw) + asf_PL(ip,iw+1) *factw ) & 132 / ( asf_PL(ip-5,iw)*(1.-factw) + asf_PL(ip-5,iw+1) *factw ) ) 133 else 134 fact_t = log10( ext_PL(ip,iw) / ext_PL(ip-5,iw) ) 135 fact_s = log10( ssa_PL(ip,iw) / ssa_PL(ip-5,iw) ) 136 fact_c = log10( asf_PL(ip,iw) / asf_PL(ip-5,iw) ) 137 endif 130 138 131 139 fact_t = fact_t / log10( press_PL(ip) / press_PL(ip-5) ) -
trunk/LMDZ.TITAN/libf/phytitan/inifis_mod.F90
r1670 r1672 18 18 init_time, daysec, dtphys 19 19 use comcstfi_mod, only: rad, cpp, g, r, rcp, & 20 mugaz, pi, avocado 20 mugaz, pi, avocado, kbol 21 21 use planete_mod, only: nres 22 22 use planetwide_mod, only: planetwide_sumval … … 84 84 pi=2.*asin(1.) 85 85 avocado = 6.02214179e23 ! added by RW 86 kbol = 1.38064852e-23 ! added by JVO for Titan chem 86 87 87 88 ! Initialize some "temporal and calendar" related variables … … 162 163 flatten = 0.0 163 164 call getin_p("flatten", flatten) 164 write(*,*) "flatten = ", flatten 165 165 write(*,*) "flatten = ", flatten 166 166 167 167 write(*,*) "Needed if oblate=.true.: J2" … … 300 300 call getin_p("graybody",graybody) 301 301 write(*,*)" graybody = ",graybody 302 303 ! Chemistry 304 305 write(*,*) "Run with or without chemistry?" 306 callchim=.false. ! default value 307 call getin_p("callchim",callchim) 308 write(*,*) " callchim = ",callchim 309 310 ! sanity check 311 if (callchim.and.(.not.tracer)) then 312 print*,"You are running chemistry without tracer" 313 print*,"Please start again with tracer =.true." 314 stop 315 endif 316 317 write(*,*)"Chemistry is computed every ichim", & 318 " physical timestep" 319 ichim=1 ! default value 320 call getin_p("ichim",ichim) 321 write(*,*)" ichim = ",ichim 302 322 303 323 ! Soil model … … 497 517 PRINT*,' or each ',iradia*dtphys,' seconds' 498 518 PRINT* 499 519 PRINT*,'inifis: Chemistry is computed:' 520 PRINT*,' each ',ichim,' physical time-step' 521 PRINT*,' or each ',ichim*dtphys,' seconds' 522 PRINT* 500 523 501 524 !----------------------------------------------------------------------- -
trunk/LMDZ.TITAN/libf/phytitan/initracer.F
r1668 r1672 19 19 c ------ 20 20 c Ehouarn Millour (oct. 2008) identify tracers by their names 21 c Jan Vatant d'Ollone (fev. 2017) chemical species for Titan 21 22 c======================================================================= 22 23 … … 26 27 character(len=20) :: txt ! to store some text 27 28 integer iq,ig,count 28 real r0_lift , reff_lift29 29 ! logical :: oldnames ! =.true. if old tracer naming convention (q01,...) 30 30 … … 65 65 enddo 66 66 67 68 67 ! Identify tracers by their names: (and set corresponding values of mmol) 69 68 ! 0. initialize tracer indexes to zero: 70 69 ! NB: igcm_* indexes are commons in 'tracer.h' 71 igcm_n2=0 72 70 71 igcm_h =0 72 igcm_h2 =0 73 igcm_ch =0 74 igcm_ch2s =0 75 igcm_ch2 =0 76 igcm_ch3 =0 77 igcm_ch4 =0 78 igcm_c2 =0 79 igcm_c2h =0 80 igcm_c2h2 =0 81 igcm_c2h3 =0 82 igcm_c2h4 =0 83 igcm_c2h5 =0 84 igcm_c2h6 =0 85 igcm_c3h3 =0 86 igcm_c3h5 =0 87 igcm_c3h6 =0 88 igcm_c3h7 =0 89 igcm_c4h =0 90 igcm_c4h3 =0 91 igcm_c4h4 =0 92 igcm_c4h2s =0 93 igcm_ch2cch2 =0 94 igcm_ch3cch =0 95 igcm_c3h8 =0 96 igcm_c4h2 =0 97 igcm_c4h6 =0 98 igcm_c4h10 =0 99 igcm_ac6h6 =0 100 igcm_c3h2 =0 101 igcm_c4h5 =0 102 igcm_ac6h5 =0 103 igcm_n2 =0 104 igcm_n4s =0 105 igcm_cn =0 106 igcm_hcn =0 107 igcm_h2cn =0 108 igcm_chcn =0 109 igcm_ch2cn =0 110 igcm_ch3cn =0 111 igcm_c3n =0 112 igcm_hc3n =0 113 igcm_nccn =0 114 igcm_c4n2 =0 115 73 116 write(*,*) 'initracer: noms() ', noms 74 117 75 118 76 119 ! 1. find chemistry tracers 77 count = 0. 78 120 count = 0. 121 122 do iq=1,nq 123 124 if (noms(iq).eq."h") then 125 igcm_h=iq 126 mmol(igcm_h)=1.01 127 count=count+1 128 endif 129 if (noms(iq).eq."h2") then 130 igcm_h2=iq 131 mmol(igcm_h2)=2.0158 132 count=count+1 133 endif 134 if (noms(iq).eq."ch") then 135 igcm_ch=iq 136 mmol(igcm_ch)=13.02 137 count=count+1 138 endif 139 if (noms(iq).eq."ch2s") then 140 igcm_ch2s=iq 141 mmol(igcm_ch2s)=14.03 142 count=count+1 143 endif 144 if (noms(iq).eq."ch2") then 145 igcm_ch2=iq 146 mmol(igcm_ch2)=14.03 147 count=count+1 148 endif 149 if (noms(iq).eq."ch3") then 150 igcm_ch3=iq 151 mmol(igcm_ch3)=15.03 152 count=count+1 153 endif 154 if (noms(iq).eq."ch4") then 155 igcm_ch4=iq 156 mmol(igcm_ch4)=16.04 157 count=count+1 158 endif 159 if (noms(iq).eq."c2") then 160 igcm_c2=iq 161 mmol(igcm_c2)=24.02 162 count=count+1 163 endif 164 if (noms(iq).eq."c2h") then 165 igcm_c2h=iq 166 mmol(igcm_c2h)=25.03 167 count=count+1 168 endif 169 if (noms(iq).eq."c2h2") then 170 igcm_c2h2=iq 171 mmol(igcm_c2h2)=26.04 172 count=count+1 173 endif 174 if (noms(iq).eq."c2h3") then 175 igcm_c2h3=iq 176 mmol(igcm_c2h3)=27.05 177 count=count+1 178 endif 179 if (noms(iq).eq."c2h4") then 180 igcm_c2h4=iq 181 mmol(igcm_c2h4)=28.05 182 count=count+1 183 endif 184 if (noms(iq).eq."c2h5") then 185 igcm_c2h5=iq 186 mmol(igcm_c2h5)=29.06 187 count=count+1 188 endif 189 if (noms(iq).eq."c2h6") then 190 igcm_c2h6=iq 191 mmol(igcm_c2h6)=30.07 192 count=count+1 193 endif 194 if (noms(iq).eq."c3h3") then 195 igcm_c3h3=iq 196 mmol(igcm_c3h3)=39.06 197 count=count+1 198 endif 199 if (noms(iq).eq."c3h5") then 200 igcm_c3h5=iq 201 mmol(igcm_c3h5)=41.07 202 count=count+1 203 endif 204 if (noms(iq).eq."c3h6") then 205 igcm_c3h6=iq 206 mmol(igcm_c3h6)=42.08 207 count=count+1 208 endif 209 if (noms(iq).eq."c3h7") then 210 igcm_c3h7=iq 211 mmol(igcm_c3h7)=43.09 212 count=count+1 213 endif 214 if (noms(iq).eq."c4h") then 215 igcm_c4h=iq 216 mmol(igcm_c4h)=49.05 217 count=count+1 218 endif 219 if (noms(iq).eq."c4h3") then 220 igcm_c4h3=iq 221 mmol(igcm_c4h3)=51.07 222 count=count+1 223 endif 224 if (noms(iq).eq."c4h4") then 225 igcm_c4h4=iq 226 mmol(igcm_c4h4)=52.08 227 count=count+1 228 endif 229 if (noms(iq).eq."c4h2s") then 230 igcm_c4h2s=iq 231 mmol(igcm_c4h2s)=50.06 232 count=count+1 233 endif 234 if (noms(iq).eq."ch2cch2") then 235 igcm_ch2cch2=iq 236 mmol(igcm_ch2cch2)=40.07 237 count=count+1 238 endif 239 if (noms(iq).eq."ch3cch") then 240 igcm_ch3cch=iq 241 mmol(igcm_ch3cch)=40.07 242 count=count+1 243 endif 244 if (noms(iq).eq."c3h8") then 245 igcm_c3h8=iq 246 mmol(igcm_c3h8)=44.11 247 count=count+1 248 endif 249 if (noms(iq).eq."c4h2") then 250 igcm_c4h2=iq 251 mmol(igcm_c4h2)=50.06 252 count=count+1 253 endif 254 if (noms(iq).eq."c4h6") then 255 igcm_c4h6=iq 256 mmol(igcm_c4h6)=54.09 257 count=count+1 258 endif 259 if (noms(iq).eq."c4h10") then 260 igcm_c4h10=iq 261 mmol(igcm_c4h10)=58.13 262 count=count+1 263 endif 264 if (noms(iq).eq."ac6h6") then 265 igcm_ac6h6=iq 266 mmol(igcm_ac6h6)=78.1136 267 count=count+1 268 endif 269 if (noms(iq).eq."c3h2") then 270 igcm_c3h2=iq 271 mmol(igcm_c3h2)=38.05 272 count=count+1 273 endif 274 if (noms(iq).eq."c4h5") then 275 igcm_c4h5=iq 276 mmol(igcm_c4h5)=53.07 277 count=count+1 278 endif 279 if (noms(iq).eq."ac6h5") then 280 igcm_ac6h5=iq 281 mmol(igcm_ac6h5)=77.1136 282 count=count+1 283 endif 284 if (noms(iq).eq."n2") then 285 igcm_n2=iq 286 mmol(igcm_n2)=28.0134 287 count=count+1 288 endif 289 if (noms(iq).eq."n4s") then 290 igcm_n4s=iq 291 mmol(igcm_n4s)=14.01 292 count=count+1 293 endif 294 if (noms(iq).eq."cn") then 295 igcm_cn=iq 296 mmol(igcm_cn)=26.02 297 count=count+1 298 endif 299 if (noms(iq).eq."hcn") then 300 igcm_hcn=iq 301 mmol(igcm_hcn)=27.04 302 count=count+1 303 endif 304 if (noms(iq).eq."h2cn") then 305 igcm_h2cn=iq 306 mmol(igcm_h2cn)=28.05 307 count=count+1 308 endif 309 if (noms(iq).eq."chcn") then 310 igcm_chcn=iq 311 mmol(igcm_chcn)=39.05 312 count=count+1 313 endif 314 if (noms(iq).eq."ch2cn") then 315 igcm_ch2cn=iq 316 mmol(igcm_cn)=40.04 317 count=count+1 318 endif 319 if (noms(iq).eq."ch3cn") then 320 igcm_ch3cn=iq 321 mmol(igcm_ch3cn)=41.05 322 count=count+1 323 endif 324 if (noms(iq).eq."c3n") then 325 igcm_c3n=iq 326 mmol(igcm_c3n)=50.04 327 count=count+1 328 endif 329 if (noms(iq).eq."hc3n") then 330 igcm_hc3n=iq 331 mmol(igcm_hc3n)=51.05 332 count=count+1 333 endif 334 if (noms(iq).eq."nccn") then 335 igcm_nccn=iq 336 mmol(igcm_nccn)=52.04 337 count=count+1 338 endif 339 if (noms(iq).eq."c4n2") then 340 igcm_c4n2=iq 341 mmol(igcm_c4n2)=76.1 342 count=count+1 343 endif 344 345 346 enddo ! of do iq=1,nq 79 347 80 348 ! check that we identified all tracers: -
trunk/LMDZ.TITAN/libf/phytitan/physiq_mod.F90
r1670 r1672 33 33 use comcstfi_mod, only: pi, g, rcp, r, rad, mugaz, cpp 34 34 use time_phylmdz_mod, only: daysec 35 use logic_mod, only: moyzon_ch 36 use moyzon_mod, only: tmoy, playmoy, zphibar, zphisbar, zplevbar, & 37 zplaybar, zzlevbar, zzlaybar, ztfibar 35 38 use callkeys_mod 36 39 use vertical_layers_mod, only: presnivs, pseudoalt … … 70 73 ! 71 74 ! V. Tracers 72 ! V.1. Aerosols and particles. 73 ! V.2. Updates (pressure variations, surface budget). 74 ! V.3. Surface Tracer Update. 75 ! V.1. Chemistry 76 ! V.2. Aerosols and particles. 77 ! V.3. Updates (pressure variations, surface budget). 78 ! V.4. Surface Tracer Update. 75 79 ! 76 80 ! VI. Surface and sub-surface soil temperature. … … 140 144 ! No more ngridmx/nqmx, F90 commons and adaptation to parallel: A. Spiga (2012) 141 145 ! Purge of the code : M. Turbet (2015) 142 ! Fork for Titan and clean of all too-generic (ocean, water, co2 ...) routines : J. Vatant d'Ollone (2017) 146 ! Fork for Titan : J. Vatant d'Ollone (2017) 147 ! + clean of all too-generic (ocean, water, co2 ...) routines 148 ! + Titan's chemistry 143 149 !============================================================================================ 144 150 … … 277 283 real zdqsed(ngrid,nlayer,nq) ! Callsedim routine. 278 284 real zdqmr(ngrid,nlayer,nq) ! Mass_redistribution routine. 285 286 real zdqchi(ngrid,nlayer,nq) ! Chemical tendency ( chemistry routine ). 287 real zdqmph(ngrid,nlayer,nq) ! Microphysical tendency ( condensation routine only for now, no microphysical routines ). 279 288 280 289 ! For Winds : (m/s/s) … … 357 366 real reffcol(ngrid,naerkind) 358 367 359 368 ! Local variables for Titan chemistry and microphysics (JVO 2017) 369 ! ---------------------------------------------------------------------------- 370 371 integer,parameter :: nmicro=0 ! Temporary ! To be put in start/def 372 373 real ctimestep ! Chemistry timestep (s) 374 375 ! Grandeurs en moyennes zonales ------------------------ 376 real temp_eq(nlayer), press_eq(nlayer) 377 real zplev(ngrid,nlayer+1),zplay(ngrid,nlayer) 378 ! real zzlev(ngrid,nlayer+1),zzlay(ngrid,nlayer) 379 real ztemp(ngrid,nlayer) 380 381 real ychim(ngrid,nlayer,nq-nmicro) 382 383 ! 2D vmr tendencies ( chemistry and condensation ) 384 real,dimension(:,:,:),allocatable,save :: dycchi 385 ! Must be saved since chemistry is not called every step 386 387 real dycmph(ngrid,nlayer,nq-nmicro) 388 ! ---------------------------------------------------------- 389 390 real,dimension(:,:),allocatable,save :: qysat 391 392 character*10,dimension(:),allocatable,save :: nomqy 393 !$OMP THREADPRIVATE(dycchi,qysat,nomqy) 394 395 !----------------------------------------------------------------------------- 396 360 397 !================================================================================================== 361 398 … … 401 438 ALLOCATE(zdtsw(ngrid,nlayer)) 402 439 ALLOCATE(tau_col(ngrid)) 403 440 ALLOCATE(dycchi(ngrid,nlayer,nq-nmicro)) 441 ALLOCATE(qysat(nlayer,nq-nmicro)) 442 ALLOCATE(nomqy(nq-nmicro+1)) 443 404 444 ! This is defined in comsaison_h 405 445 ALLOCATE(mu0(ngrid)) … … 433 473 ! Read 'startfi.nc' file. 434 474 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 435 call phyetat0(startphy_file, & 436 ngrid,nlayer,"startfi.nc",0,0,nsoilmx,nq, & 437 day_ini,time_phys,tsurf,tsoil,emis,q2,qsurf) 475 call phyetat0(startphy_file,ngrid,nlayer,"startfi.nc",0,0,nsoilmx,nq, & 476 day_ini,time_phys,tsurf,tsoil,emis,q2,qsurf) 438 477 if (.not.startphy_file) then 439 478 ! additionnal "academic" initialization of physics … … 514 553 ptimestep,pday+nday,time_phys,cell_area, & 515 554 albedo_bareground,inertiedat,zmea,zstd,zsig,zgam,zthe) 555 endif 556 557 ! Sanity check for chemistry 558 if ( ((moyzon_ch).and.(.not.callchim)) .or. ((.not.moyzon_ch).and.(callchim)) ) then 559 print *, "moyzon_ch=",moyzon_ch," and callchim=",callchim 560 print *, "This is not compatible..." 561 stop 562 endif 563 564 ! Initialize names, timestep and saturation profiles for chemistry 565 566 if ( callchim .and. (nq.gt.nmicro) ) then 567 568 ctimestep = ptimestep*REAL(ichim) 569 570 do iq=nmicro+1,nq 571 nomqy(iq-nmicro) = nametrac(iq) 572 enddo 573 574 nomqy(nq-nmicro+1) = "HV" 575 576 ! qysat is taken at the equator ( small variations of t,p) 577 temp_eq(:) = tmoy(:) 578 press_eq(:) = playmoy(:)/100. ! en mbar 579 580 call inicondens(nq-nmicro,press_eq,temp_eq,nomqy,qysat) 581 516 582 endif 517 583 … … 601 667 enddo 602 668 669 ! -------------------------------Taken from old Titan -------------------------- 670 ! zonal averages needed 671 if (moyzon_ch) then 672 673 zzlaybar(1,:)=(zphibar(1,:)+zphisbar(1))/g 674 ! SI ON TIENT COMPTE DE LA VARIATION DE G AVEC L'ALTITUDE: 675 ! zzlaybar(1,:)=RG*RA*RA/(RG*RA-(zphibar(1,:)+zphisbar(1)))-RA 676 zzlevbar(1,1)=zphisbar(1)/g 677 DO l=2,nlayer 678 z1=(zplaybar(1,l-1)+zplevbar(1,l))/(zplevbar(1,l-1)-zplevbar(1,l)) 679 z2=(zplevbar(1,l) +zplaybar(1,l))/(zplevbar(1,l) -zplaybar(1,l)) 680 zzlevbar(1,l)=(z1*zzlaybar(1,l-1)+z2*zzlaybar(1,l))/(z1+z2) 681 ENDDO 682 zzlevbar(1,nlayer+1)=zzlaybar(1,nlayer)+(zzlaybar(1,nlayer)-zzlevbar(1,nlayer)) 683 684 DO ig=2,ngrid 685 if (latitude(ig).ne.latitude(ig-1)) then 686 DO l=1,nlayer 687 zzlaybar(ig,l)=(zphibar(ig,l)+zphisbar(ig))/g 688 ! SI ON TIENT COMPTE DE LA VARIATION DE G AVEC L'ALTITUDE: 689 !zzlaybar(ig,l)=RG*RA*RA/(RG*RA-(zphibar(ig,l)+zphisbar(ig)))-RA 690 ENDDO 691 zzlevbar(ig,1)=zphisbar(ig)/g 692 DO l=2,nlayer 693 z1=(zplaybar(ig,l-1)+zplevbar(ig,l))/ (zplevbar(ig,l-1)-zplevbar(ig,l)) 694 z2=(zplevbar(ig,l) +zplaybar(ig,l))/(zplevbar(ig,l) -zplaybar(ig,l)) 695 zzlevbar(ig,l)=(z1*zzlaybar(ig,l-1)+z2*zzlaybar(ig,l))/(z1+z2) 696 ENDDO 697 zzlevbar(ig,nlayer+1)=zzlaybar(ig,nlayer)+(zzlaybar(ig,nlayer)-zzlevbar(ig,nlayer)) 698 else 699 zzlaybar(ig,:)=zzlaybar(ig-1,:) 700 zzlevbar(ig,:)=zzlevbar(ig-1,:) 701 endif 702 ENDDO 703 704 endif ! moyzon 705 ! ------------------------------------------------------------------------------------- 706 603 707 ! Compute potential temperature 604 708 ! Note : Potential temperature calculation may not be the same in physiq and dynamic... … … 896 1000 if (tracer) then 897 1001 898 899 1002 ! ------------------------- 900 ! V.1. Aerosol particles 1003 ! V.1. Chemistry 1004 ! ------------------------- 1005 if (callchim) then 1006 1007 zplev(:,:) = zplevbar(:,:) 1008 zplay(:,:) = zplaybar(:,:) 1009 zzlev(:,:) = zzlevbar(:,:) 1010 zzlay(:,:) = zzlaybar(:,:) 1011 ztemp(:,:) = ztfibar(:,:) 1012 1013 if (nq.gt.nmicro) then 1014 do iq = nmicro+1,nq 1015 ychim(:,:,iq-nmicro) = pq(:,:,iq) 1016 enddo 1017 endif 1018 1019 ! Condensation tendency after the transport 1020 do iq=1,nq-nmicro 1021 do l=1,nlayer 1022 do ig=1,ngrid 1023 if ( ychim(ig,l,iq).gt.qysat(l,iq) ) then 1024 dycmph(ig,l,nmicro+iq)= ( -ychim(ig,l,iq)+qysat(l,iq) ) / ptimestep 1025 endif 1026 enddo 1027 enddo 1028 enddo 1029 1030 if( mod(icount-1,ichim).eq.0.) then 1031 1032 print *, "On passe dans la chimie..." 1033 1034 call calchim(ngrid,nq-nmicro,ychim,nomqy,declin,zls,ctimestep, & 1035 ztemp,zplay,zplev,zzlay,zzlev,dycchi,nlayer+70) 1036 1037 ! JVO 2017 : NLEV = nlayer+70, en accord avec le C. Quid si nlay=/ 55 ? 1038 1039 endif 1040 1041 if (nq.gt.nmicro) then 1042 ! We convert tendencies back to 3D and mass mixing ratio 1043 do iq=nmicro+1,nq 1044 zdqchi(:,:,iq) = dycchi(:,:,iq-nmicro)*pq(:,:,iq) / ychim(:,:,iq-nmicro) 1045 zdqmph(:,:,iq) = dycmph(:,:,iq-nmicro)*pq(:,:,iq) / ychim(:,:,iq-nmicro) 1046 enddo 1047 1048 pdq(1:ngrid,1:nlayer,1:nq) = pdq(1:ngrid,1:nlayer,1:nq) + & 1049 zdqchi(1:ngrid,1:nlayer,1:nq) + zdqmph(1:ngrid,1:nlayer,1:nq) 1050 1051 endif 1052 1053 endif 1054 1055 ! ------------------------- 1056 ! V.2. Aerosol particles 901 1057 ! ------------------------- 902 1058 … … 919 1075 920 1076 ! --------------- 921 ! V. 2.Updates1077 ! V.3 Updates 922 1078 ! --------------- 923 1079 … … 951 1107 952 1108 ! ----------------------------- 953 ! V. 3. Surface Tracer Update1109 ! V.4. Surface Tracer Update 954 1110 ! ----------------------------- 955 1111 -
trunk/LMDZ.TITAN/libf/phytitan/tracer_h.F90
r1668 r1672 21 21 ! tracer indexes: these are initialized in initracer and should be 0 if the 22 22 ! corresponding tracer does not exist 23 23 24 ! chemistry: 25 26 integer :: igcm_h 27 integer :: igcm_h2 28 integer :: igcm_ch 29 integer :: igcm_ch2s 30 integer :: igcm_ch2 31 integer :: igcm_ch3 32 integer :: igcm_ch4 33 integer :: igcm_c2 34 integer :: igcm_c2h 35 integer :: igcm_c2h2 36 integer :: igcm_c2h3 37 integer :: igcm_c2h4 38 integer :: igcm_c2h5 39 integer :: igcm_c2h6 40 integer :: igcm_c3h3 41 integer :: igcm_c3h5 42 integer :: igcm_c3h6 43 integer :: igcm_c3h7 44 integer :: igcm_c4h 45 integer :: igcm_c4h3 46 integer :: igcm_c4h4 47 integer :: igcm_c4h2s 48 integer :: igcm_ch2cch2 49 integer :: igcm_ch3cch 50 integer :: igcm_c3h8 51 integer :: igcm_c4h2 52 integer :: igcm_c4h6 53 integer :: igcm_c4h10 54 integer :: igcm_ac6h6 55 integer :: igcm_c3h2 56 integer :: igcm_c4h5 57 integer :: igcm_ac6h5 24 58 integer :: igcm_n2 25 !$OMP THREADPRIVATE(igcm_n2) 59 integer :: igcm_n4s 60 integer :: igcm_cn 61 integer :: igcm_hcn 62 integer :: igcm_h2cn 63 integer :: igcm_chcn 64 integer :: igcm_ch2cn 65 integer :: igcm_ch3cn 66 integer :: igcm_c3n 67 integer :: igcm_hc3n 68 integer :: igcm_nccn 69 integer :: igcm_c4n2 70 71 72 !$OMP THREADPRIVATE(igcm_h,igcm_h2,igcm_ch,igcm_ch2s,igcm_ch2,igcm_ch3,igcm_ch4, & 73 !$OMP igcm_c2,igcm_c2h,igcm_c2h2,igcm_c2h3,igcm_c2h4,igcm_c2h5,igcm_c2h6, & 74 !$OMP igcm_c3h3,igcm_c3h5,igcm_c3h6,igcm_c3h7,igcm_c4h,igcm_c4h3,igcm_c4h4, & 75 !$OMP igcm_c4h2s,igcm_ch2cch2,igcm_ch3cch,igcm_c3h8,igcm_c4h2,igcm_c4h6, & 76 !$OMP igcm_c4h10,igcm_ac6h6,igcm_c3h2,igcm_c4h5,igcm_ac6h5,igcm_n2,igcm_n4s, & 77 !$OMP igcm_cn,igcm_hcn,igcm_h2cn,igcm_chcn,igcm_ch2cn,igcm_ch3cn,igcm_c3n, & 78 !$OMP igcm_hc3n,igcm_nccn,igcm_c4n2) 26 79 27 80 end module tracer_h
Note: See TracChangeset
for help on using the changeset viewer.