Changeset 1036 for trunk/LMDZ.MARS/libf/phymars/initracer.F
- Timestamp:
- Sep 11, 2013, 2:34:44 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/libf/phymars/initracer.F
r1005 r1036 1 SUBROUTINE initracer(qsurf,co2ice) 2 1 SUBROUTINE initracer(ngrid,nq,qsurf,co2ice) 2 3 use infotrac, only: tnom 4 use tracer_mod 3 5 IMPLICIT NONE 4 6 c======================================================================= … … 11 13 c 12 14 c Test of dimension : 13 c Initialize COMMON tracer in tracer.h, using tracer names provided14 c by the dynamics in " advtrac.h"15 c Initialize tracer related data in tracer_mod, using tracer names provided 16 c by the dynamics in "infotrac" 15 17 c 16 18 c … … 26 28 #include "comcstfi.h" 27 29 #include "callkeys.h" 28 #include "tracer.h"29 #include "advtrac.h"30 !#include "tracer.h" 31 !#include "advtrac.h" 30 32 #include "comgeomfi.h" 31 33 32 34 #include "surfdat.h" 33 35 34 real qsurf(ngridmx,nqmx) ! tracer on surface (e.g. kg.m-2) 35 real co2ice(ngridmx) ! co2 ice mass on surface (e.g. kg.m-2) 36 integer,intent(in) :: ngrid ! number of atmospheric columns 37 integer,intent(in) :: nq ! number of tracers 38 real,intent(out) :: qsurf(ngrid,nq) ! tracer on surface (e.g. kg.m-2) 39 real,intent(out) :: co2ice(ngrid) ! co2 ice mass on surface (e.g. kg.m-2) 40 36 41 integer iq,ig,count 37 42 real r0_lift , reff_lift, nueff_lift … … 43 48 44 49 c----------------------------------------------------------------------- 45 c radius(nq mx) ! aerosol particle radius (m)46 c rho_q(nq mx) ! tracer densities (kg.m-3)47 c alpha_lift(nq mx) ! saltation vertical flux/horiz flux ratio (m-1)48 c alpha_devil(nq mx) ! lifting coeeficient by dust devil50 c radius(nq) ! aerosol particle radius (m) 51 c rho_q(nq) ! tracer densities (kg.m-3) 52 c alpha_lift(nq) ! saltation vertical flux/horiz flux ratio (m-1) 53 c alpha_devil(nq) ! lifting coeeficient by dust devil 49 54 c rho_dust ! Mars dust density 50 55 c rho_ice ! Water ice density … … 55 60 c----------------------------------------------------------------------- 56 61 62 ! Initialization: allocate arrays in tracer_mod 63 allocate(noms(nq)) 64 allocate(mmol(nq)) 65 allocate(radius(nq)) 66 allocate(rho_q(nq)) 67 allocate(alpha_lift(nq)) 68 allocate(alpha_devil(nq)) 69 allocate(dryness(ngridmx)) 70 allocate(igcm_dustbin(nq)) 71 57 72 ! Initialization: get tracer names from the dynamics and check if we are 58 73 ! using 'old' tracer convention ('q01',q02',...) … … 60 75 ! check if tracers have 'old' names 61 76 count=0 62 do iq=1,nq mx77 do iq=1,nq 63 78 txt=" " 64 79 write(txt,'(a1,i2.2)') 'q',iq … … 66 81 count=count+1 67 82 endif 68 enddo ! of do iq=1,nq mx83 enddo ! of do iq=1,nq 69 84 70 if (count.eq.nq mx) then85 if (count.eq.nq) then 71 86 write(*,*) "initracer: tracers seem to follow old naming ", 72 87 & "convention (q01,q02,...)" … … 76 91 77 92 ! copy tracer names from dynamics 78 do iq=1,nq mx93 do iq=1,nq 79 94 noms(iq)=tnom(iq) 80 95 enddo … … 86 101 ! Identify tracers by their names: (and set corresponding values of mmol) 87 102 ! 0. initialize tracer indexes to zero: 88 do iq=1,nqmx 89 igcm_dustbin(iq)=0 90 enddo 103 igcm_dustbin(1:nq)=0 104 91 105 igcm_dust_mass=0 92 106 igcm_dust_number=0 … … 130 144 count=0 131 145 if (dustbin.gt.0) then 132 do iq=1,nq mx146 do iq=1,nq 133 147 txt=" " 134 148 write(txt,'(a4,i2.2)')'dust',count+1 … … 138 152 mmol(iq)=100. 139 153 endif 140 enddo !do iq=1,nq mx154 enddo !do iq=1,nq 141 155 endif ! of if (dustbin.gt.0) 142 156 if (doubleq) then 143 do iq=1,nq mx157 do iq=1,nq 144 158 if (noms(iq).eq."dust_mass") then 145 159 igcm_dust_mass=iq … … 153 167 endif ! of if (doubleq) 154 168 if (microphys) then 155 do iq=1,nq mx169 do iq=1,nq 156 170 if (noms(iq).eq."ccn_mass") then 157 171 igcm_ccn_mass=iq … … 165 179 endif ! of if (microphys) 166 180 if (submicron) then 167 do iq=1,nq mx181 do iq=1,nq 168 182 if (noms(iq).eq."dust_submicron") then 169 183 igcm_dust_submicron=iq … … 174 188 endif ! of if (submicron) 175 189 ! 2. find chemistry and water tracers 176 do iq=1,nq mx190 do iq=1,nq 177 191 if (noms(iq).eq."co2") then 178 192 igcm_co2=iq … … 337 351 endif 338 352 339 enddo ! of do iq=1,nq mx353 enddo ! of do iq=1,nq 340 354 341 355 ! check that we identified all tracers: 342 if (count.ne.nq mx) then356 if (count.ne.nq) then 343 357 write(*,*) "initracer: found only ",count," tracers" 344 write(*,*) " expected ",nq mx358 write(*,*) " expected ",nq 345 359 do iq=1,count 346 360 write(*,*)' ',iq,' ',trim(noms(iq)) … … 349 363 else 350 364 write(*,*) "initracer: found all expected tracers, namely:" 351 do iq=1,nq mx365 do iq=1,nq 352 366 write(*,*)' ',iq,' ',trim(noms(iq)) 353 367 enddo … … 365 379 ! as qsurf(i_h2o_vap) & as qsurf(i_h2o_ice), so to be clean: 366 380 if (igcm_h2o_vap.ne.0) then 367 qsurf(1:ngrid mx,igcm_h2o_vap)=0381 qsurf(1:ngrid,igcm_h2o_vap)=0 368 382 endif 369 383 endif 370 384 371 385 c------------------------------------------------------------ 372 c Initialize tracers .... (in tracer .h)386 c Initialize tracers .... (in tracer_mod) 373 387 c------------------------------------------------------------ 374 388 ! start by setting everything to (default) zero 375 rho_q(1:nq mx)=0 ! tracer density (kg.m-3)376 radius(1:nq mx)=0. ! tracer particle radius (m)377 alpha_lift(1:nq mx) =0. ! tracer saltation vertical flux/horiz flux ratio (m-1)378 alpha_devil(1:nq mx)=0. ! tracer lifting coefficient by dust devils389 rho_q(1:nq)=0 ! tracer density (kg.m-3) 390 radius(1:nq)=0. ! tracer particle radius (m) 391 alpha_lift(1:nq) =0. ! tracer saltation vertical flux/horiz flux ratio (m-1) 392 alpha_devil(1:nq)=0. ! tracer lifting coefficient by dust devils 379 393 380 394 … … 393 407 c iq=1: Q mass mixing ratio, iq=2: N number mixing ratio 394 408 395 if( (nq mx.lt.2).or.(water.and.(nqmx.lt.4)) ) then396 write(*,*)'initracer: nq mx is too low : nqmx=', nqmx409 if( (nq.lt.2).or.(water.and.(nq.lt.4)) ) then 410 write(*,*)'initracer: nq is too low : nq=', nq 397 411 write(*,*)'water= ',water,' doubleq= ',doubleq 398 412 end if … … 499 513 alpha_lift(igcm_h2o_vap) =0. 500 514 alpha_devil(igcm_h2o_vap)=0. 501 if(water.and.(nq mx.ge.2)) then515 if(water.and.(nq.ge.2)) then 502 516 radius(igcm_h2o_ice)=3.e-6 503 517 rho_q(igcm_h2o_ice)=rho_ice 504 518 alpha_lift(igcm_h2o_ice) =0. 505 519 alpha_devil(igcm_h2o_ice)=0. 506 elseif(water.and.(nq mx.lt.2)) then507 write(*,*) 'nq mx is too low : nqmx=', nqmx520 elseif(water.and.(nq.lt.2)) then 521 write(*,*) 'nq is too low : nq=', nq 508 522 write(*,*) 'water= ',water 509 523 endif
Note: See TracChangeset
for help on using the changeset viewer.