Changeset 655 for trunk/LMDZ.MARS/libf/aeronomars
- Timestamp:
- May 11, 2012, 2:23:57 PM (13 years ago)
- Location:
- trunk/LMDZ.MARS/libf/aeronomars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/libf/aeronomars/chimiedata.h
r517 r655 1 ! ------------------------------------ 2 ! --- Data for chemical routines---3 ! ------------------------------------ 4 ! 1 ! ----------------------------------------- 2 ! --- Data for photolysis lookup table --- 3 ! ----------------------------------------- 4 5 5 integer nd, nozo, nr, nsza, ntemp, ntau 6 ! 6 7 7 parameter (nd = 29) 8 8 parameter (nozo = 7) … … 11 11 parameter (ntemp = 4) 12 12 parameter (ntau = 8) 13 ! 13 14 14 real kb 15 15 parameter (kb = 1.3806e-23) 16 ! 16 17 17 common/chimiedata/jphot,colairtab,table_ozo 18 ! 18 19 19 real jphot(ntemp,nsza,0:200,nozo,ntau,nd) 20 20 real colairtab(0:200) … … 22 22 real table_ozo(nozo) 23 23 real tautab(ntau) 24 ! 24 25 25 data szatab/0., 5., 10., 15., 20., 25., & 26 26 & 30., 35., 40., 45., 50., 55., & … … 28 28 & 84., 86., 88., 90., 91., 92., & 29 29 & 93., 94., 95./ 30 ! 30 31 31 data tautab/0., 0.2, 0.4, 0.6, 0.8, 1., 2., 4./ 32 !33 integer ncomp34 parameter (ncomp = 15)35 character*10 nomchem(ncomp)36 data nomchem/"co2","co","o","o1d","o2","o3","h","h2", &37 & "oh","ho2","h2o2", "ch4", "n2", "ar", "h2o"/38 !39 real mmolchem(ncomp)40 data mmolchem/44.,28.,16.,16.,32.,48., 1., &41 & 2.,17.,33.,34.,16.,28.,40.,18./ -
trunk/LMDZ.MARS/libf/aeronomars/conc.h
r517 r655 4 4 5 5 !********************************************************************** 6 7 integer ncomptot8 9 parameter (ncomptot=ncomp+1)10 6 11 7 common/conc/mmean,Akknew,cpnew,rnew -
trunk/LMDZ.MARS/libf/aeronomars/inichim_newstart.F90
r618 r655 58 58 59 59 integer, parameter :: nalt = 252 ! number of altitudes in the initialization files 60 integer , parameter :: nspe = 14! number of species in the initialization files61 integer, dimension(nspe) :: niq! local index of species in initialization files60 integer :: nspe ! number of species in the initialization files 61 integer, allocatable :: niq(:) ! local index of species in initialization files 62 62 real, dimension(nalt) :: tinit, zzfile ! temperature in initialization files 63 63 real, dimension(nalt) :: pinit ! pressure in initialization files 64 64 real, dimension(nalt) :: densinit ! total number density in initialization files 65 real, dimension(nalt,nspe) :: vmrinit! mixing ratios in initialization files66 real, dimension(nspe) :: vmrint! mixing ratio interpolated onto the gcm vertical grid65 real, allocatable :: vmrinit(:,:) ! mixing ratios in initialization files 66 real, allocatable :: vmrint(:) ! mixing ratio interpolated onto the gcm vertical grid 67 67 real :: vmr 68 68 69 69 character(len=20) :: txt ! to store some text 70 logical :: flagnitro ! checks if N species present 70 71 71 72 ! 1. identify tracers by their names: (and set corresponding values of mmol) … … 107 108 igcm_n2plus = 0 108 109 igcm_hplus = 0 110 igcm_hco2plus = 0 109 111 igcm_elec = 0 110 112 … … 342 344 nbqchem = nbqchem + 1 343 345 end if 346 if (noms(iq) == "hco2plus") then 347 igcm_hco2plus = iq 348 mmol(igcm_hco2plus) = 45. 349 count = count + 1 350 nbqchem = nbqchem + 1 351 end if 344 352 if (noms(iq) == "elec") then 345 353 igcm_elec = iq … … 373 381 end do 374 382 end if 383 384 ! 1.7 check if nitrogen species are present: 385 386 if(igcm_no == 0) then 387 !check that no N species is in traceur.def 388 if(igcm_n /= 0 .or. igcm_no2 /= 0 .or. igcm_n2d /= 0) then 389 write(*,*)'inichim_newstart error:' 390 write(*,*)'N, NO2 and/or N2D are in traceur.def, but not NO' 391 write(*,*)'stop' 392 stop 393 endif 394 flagnitro = .false. 395 nspe = 14 396 else 397 !check that all N species are in traceur.def 398 if(igcm_n == 0 .or. igcm_no2 == 0 .or. igcm_n2d == 0) then 399 write(*,*)'inichim_newstart error:' 400 write(*,*)'if NO is in traceur.def, N, NO2 and N2D must also be' 401 write(*,*)'stop' 402 stop 403 endif 404 flagnitro = .true. 405 nspe = 18 406 endif 407 408 ! 1.8 allocate arrays 409 410 allocate(niq(nspe)) 411 allocate(vmrinit(nalt,nspe)) 412 allocate(vmrint(nspe)) 375 413 376 414 ! 2. load in chemistry data for initialization: … … 395 433 ! 6: o1d 396 434 ! 7: o3 435 ! 436 ! order of nitrogen species in initialization file: 437 ! 438 ! 1: n 439 ! 2: no 440 ! 3: no2 441 ! 4: n2d 397 442 398 443 ! major species: … … 416 461 niq(14) = igcm_o3 417 462 463 ! nitrogen species: 464 465 if (flagnitro) then 466 niq(15) = igcm_n 467 niq(16) = igcm_no 468 niq(17) = igcm_no2 469 niq(18) = igcm_n2d 470 end if 471 418 472 ! 2.1 open initialization files 419 473 420 open(210, iostat=ierr,file=trim(datafile)// & 421 '/atmosfera_LMD_may.dat') 474 open(210, iostat=ierr,file=trim(datafile)//'/atmosfera_LMD_may.dat') 422 475 if (ierr /= 0) then 423 476 write(*,*)'Error : cannot open file atmosfera_LMD_may.dat ' 424 write(*,*)'(in aeronomars/inichim .F)'477 write(*,*)'(in aeronomars/inichim_newstart.F)' 425 478 write(*,*)'It should be in :', trim(datafile),'/' 426 479 write(*,*)'1) You can change this path in callphys.def with' … … 431 484 stop 432 485 end if 433 open(220, iostat=ierr,file=trim(datafile)// & 434 '/atmosfera_LMD_min.dat') 486 open(220, iostat=ierr,file=trim(datafile)//'/atmosfera_LMD_min.dat') 435 487 if (ierr /= 0) then 436 488 write(*,*)'Error : cannot open file atmosfera_LMD_min.dat ' 437 write(*,*)'(in aeronomars/inichim .F)'489 write(*,*)'(in aeronomars/inichim_newstart.F)' 438 490 write(*,*)'It should be in :', trim(datafile),'/' 439 491 write(*,*)'1) You can change this path in callphys.def with' … … 444 496 stop 445 497 end if 498 if(flagnitro) then 499 open(230, iostat=ierr,file=trim(datafile)//'/atmosfera_LMD_nitr.dat') 500 if (ierr.ne.0) then 501 write(*,*)'Error : cannot open file atmosfera_LMD_nitr.dat ' 502 write(*,*)'(in aeronomars/inichim_newstart.F)' 503 write(*,*)'It should be in :', datafile 504 write(*,*)'1) You can change this directory address in ' 505 write(*,*)' file phymars/datafile.h' 506 write(*,*)'2) If necessary atmosfera_LMD_nitr.dat (and others)' 507 write(*,*)' can be obtained online on:' 508 write(*,*)' http://www.lmd.jussieu.fr/~forget/datagcm/datafile' 509 STOP 510 endif 511 endif ! Of if(flagnitro) 446 512 447 513 ! 2.2 read initialization files … … 466 532 close(220) 467 533 534 ! nitrogen species 535 536 if (flagnitro) then 537 read(230,*) 538 do l = 1,nalt 539 read(230,*) dummy, (vmrinit(l,n), n = 15,18) 540 end do 541 close(230) 542 end if 543 468 544 ! 3. initialization of tracers 469 545 … … 488 564 ! - with our without h2o 489 565 490 if (flagthermo == 0 .or. (flagthermo == 1 .and. exp(pgcm) < 1.e-3)) then566 if (flagthermo == 0 .or. (flagthermo == 1 .and. exp(pgcm) < 0.1)) then 491 567 do n = 1,nspe 492 568 iq = niq(n) … … 501 577 end do 502 578 503 ! set surface values of chemistry tracers to zero 579 ! set surface values of chemistry tracers to zero 580 504 581 if (flagthermo == 0) then 505 ! NB: no problem for "surface water vapour" tracer which is always 0 506 do n=1,nspe 507 iq=niq(n) 508 qsurf(1:ngridmx,iq)=0 509 enddo 510 endif 511 582 ! NB: no problem for "surface water vapour" tracer which is always 0 583 do n = 1,nspe 584 iq = niq(n) 585 qsurf(1:ngridmx,iq) = 0. 586 end do 587 end if 512 588 513 589 ! 3.3 initialization of tracers not contained in the initialization files … … 525 601 end do 526 602 ! set surface value to zero 527 qsurf(1:ngridmx,igcm_ch4) =0603 qsurf(1:ngridmx,igcm_ch4) = 0. 528 604 end if 529 605 606 ! ions: 0 607 608 if (igcm_co2plus /= 0) then 609 !check that all required ions are in traceur.def 610 if (igcm_o2plus == 0 .or. igcm_oplus == 0 .or. igcm_coplus == 0 & 611 .or. igcm_cplus == 0 .or. igcm_nplus == 0 .or. igcm_noplus == 0 & 612 .or. igcm_n2plus == 0 .or. igcm_hplus == 0 .or. igcm_hco2plus == 0 & 613 .or. igcm_elec == 0) then 614 write(*,*)'inichim_newstart error:' 615 write(*,*)'if co2plus is in traceur.def, all other ions must also be' 616 write(*,*)'o2plus, oplus, coplus, cplus, nplus, noplus, n2plus' 617 write(*,*)'hplus, hco2plus and elec' 618 write(*,*)'stop' 619 stop 620 end if 621 622 do i = 1,iip1 623 do j = 1,jjp1 624 do l = 1,llm 625 ! all ions to 0 626 pq(i,j,l,igcm_co2plus) = 0. 627 pq(i,j,l,igcm_o2plus) = 0. 628 pq(i,j,l,igcm_oplus) = 0. 629 pq(i,j,l,igcm_coplus) = 0. 630 pq(i,j,l,igcm_cplus) = 0. 631 pq(i,j,l,igcm_nplus) = 0. 632 pq(i,j,l,igcm_noplus) = 0. 633 pq(i,j,l,igcm_n2plus) = 0. 634 pq(i,j,l,igcm_hplus) = 0. 635 pq(i,j,l,igcm_hco2plus) = 0. 636 pq(i,j,l,igcm_elec) = 0. 637 end do 638 end do 639 end do 640 641 ! surface value to 0 642 643 qsurf(1:ngridmx,igcm_co2plus) = 0. 644 qsurf(1:ngridmx,igcm_o2plus) = 0. 645 qsurf(1:ngridmx,igcm_oplus) = 0. 646 qsurf(1:ngridmx,igcm_coplus) = 0. 647 qsurf(1:ngridmx,igcm_cplus) = 0. 648 qsurf(1:ngridmx,igcm_nplus) = 0. 649 qsurf(1:ngridmx,igcm_noplus) = 0. 650 qsurf(1:ngridmx,igcm_n2plus) = 0. 651 qsurf(1:ngridmx,igcm_hplus) = 0. 652 qsurf(1:ngridmx,igcm_hco2plus) = 0. 653 qsurf(1:ngridmx,igcm_elec) = 0. 654 655 else 656 657 if (igcm_o2plus /= 0 .or. igcm_oplus /= 0 .or. igcm_coplus /= 0 & 658 .or. igcm_cplus /= 0 .or. igcm_nplus /= 0 .or. igcm_noplus /= 0 & 659 .or. igcm_n2plus /= 0 .or. igcm_hplus /= 0 .or. igcm_hco2plus /= 0 & 660 .or. igcm_elec /= 0) then 661 write(*,*)'inichim_newstart error:' 662 write(*,*)'some ions are in traceur.def, but not co2plus' 663 write(*,*)'stop' 664 stop 665 end if 666 end if ! of if(igcm_co2 /= 0) 667 668 ! deallocations 669 670 deallocate(niq) 671 deallocate(vmrinit) 672 deallocate(vmrint) 673 530 674 end
Note: See TracChangeset
for help on using the changeset viewer.