Changeset 1047 for trunk/LMDZ.MARS/libf/aeronomars/calchim.F90
- Timestamp:
- Sep 23, 2013, 9:56:47 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/libf/aeronomars/calchim.F90
r1036 r1047 1 subroutine calchim(n q,&1 subroutine calchim(ngrid,nlayer,nq, & 2 2 ptimestep,pplay,pplev,pt,pdt,dist_sol,mu0, & 3 3 zzlev,zzlay,zday,pq,pdq,dqchim,dqschim,dqcloud, & … … 13 13 igcm_noplus, igcm_n2plus, igcm_hplus, & 14 14 igcm_hco2plus, igcm_elec, mmol 15 use conc_mod, only: mmean ! mean molecular mass of the atmosphere 16 15 17 implicit none 16 18 … … 38 40 ! 39 41 ! ptimestep timestep (s) 40 ! pplay(ngrid mx,nlayermx) Pressure at the middle of the layers (Pa)41 ! pplev(ngrid mx,nlayermx+1) Intermediate pressure levels (Pa)42 ! pt(ngrid mx,nlayermx) Temperature (K)43 ! pdt(ngrid mx,nlayermx) Temperature tendency (K)44 ! pu(ngrid mx,nlayermx) u component of the wind (ms-1)45 ! pdu(ngrid mx,nlayermx) u component tendency (K)46 ! pv(ngrid mx,nlayermx) v component of the wind (ms-1)47 ! pdv(ngrid mx,nlayermx) v component tendency (K)42 ! pplay(ngrid,nlayer) Pressure at the middle of the layers (Pa) 43 ! pplev(ngrid,nlayer+1) Intermediate pressure levels (Pa) 44 ! pt(ngrid,nlayer) Temperature (K) 45 ! pdt(ngrid,nlayer) Temperature tendency (K) 46 ! pu(ngrid,nlayer) u component of the wind (ms-1) 47 ! pdu(ngrid,nlayer) u component tendency (K) 48 ! pv(ngrid,nlayer) v component of the wind (ms-1) 49 ! pdv(ngrid,nlayer) v component tendency (K) 48 50 ! dist_sol distance of the sun (AU) 49 ! mu0(ngrid mx) cos of solar zenith angle (=1 when sun at zenith)50 ! pq(ngrid mx,nlayermx,nqmx) Advected fields, ie chemical species here51 ! pdq(ngrid mx,nlayermx,nqmx) Previous tendencies on pq52 ! tauref(ngrid mx) Optical depth at 7 hPa53 ! co2ice(ngrid mx) co2 ice surface layer (kg.m-2)54 ! surfdust(ngrid mx,nlayermx) dust surface area (m2/m3)55 ! surfice(ngrid mx,nlayermx) ice surface area (m2/m3)51 ! mu0(ngrid) cos of solar zenith angle (=1 when sun at zenith) 52 ! pq(ngrid,nlayer,nq) Advected fields, ie chemical species here 53 ! pdq(ngrid,nlayer,nq) Previous tendencies on pq 54 ! tauref(ngrid) Optical depth at 7 hPa 55 ! co2ice(ngrid) co2 ice surface layer (kg.m-2) 56 ! surfdust(ngrid,nlayer) dust surface area (m2/m3) 57 ! surfice(ngrid,nlayer) ice surface area (m2/m3) 56 58 ! 57 59 ! Output: 58 60 ! 59 ! dqchim(ngrid mx,nlayermx,nqmx) ! tendencies on pq due to chemistry60 ! dqschim(ngrid mx,nqmx) ! tendencies on qsurf61 ! 62 !======================================================================= 63 64 #include "dimensions.h"65 #include "dimphys.h"61 ! dqchim(ngrid,nlayer,nq) ! tendencies on pq due to chemistry 62 ! dqschim(ngrid,nq) ! tendencies on qsurf 63 ! 64 !======================================================================= 65 66 !#include "dimensions.h" 67 !#include "dimphys.h" 66 68 #include "chimiedata.h" 67 69 !#include "tracer.h" 68 70 #include "comcstfi.h" 69 71 #include "callkeys.h" 70 #include "conc.h"72 !#include "conc.h" 71 73 72 74 ! input: 73 75 76 integer,intent(in) :: ngrid ! number of atmospheric columns 77 integer,intent(in) :: nlayer ! number of atmospheric layers 74 78 integer,intent(in) :: nq ! number of tracers 75 79 real :: ptimestep 76 real :: pplay(ngrid mx,nlayermx) ! pressure at the middle of the layers77 real :: zzlay(ngrid mx,nlayermx) ! pressure at the middle of the layers78 real :: pplev(ngrid mx,nlayermx+1) ! intermediate pressure levels79 real :: zzlev(ngrid mx,nlayermx+1) ! altitude at layer boundaries80 real :: pt(ngrid mx,nlayermx) ! temperature81 real :: pdt(ngrid mx,nlayermx) ! temperature tendency82 real :: pu(ngrid mx,nlayermx) ! u component of the wind (m.s-1)83 real :: pdu(ngrid mx,nlayermx) ! u component tendency84 real :: pv(ngrid mx,nlayermx) ! v component of the wind (m.s-1)85 real :: pdv(ngrid mx,nlayermx) ! v component tendency80 real :: pplay(ngrid,nlayer) ! pressure at the middle of the layers 81 real :: zzlay(ngrid,nlayer) ! pressure at the middle of the layers 82 real :: pplev(ngrid,nlayer+1) ! intermediate pressure levels 83 real :: zzlev(ngrid,nlayer+1) ! altitude at layer boundaries 84 real :: pt(ngrid,nlayer) ! temperature 85 real :: pdt(ngrid,nlayer) ! temperature tendency 86 real :: pu(ngrid,nlayer) ! u component of the wind (m.s-1) 87 real :: pdu(ngrid,nlayer) ! u component tendency 88 real :: pv(ngrid,nlayer) ! v component of the wind (m.s-1) 89 real :: pdv(ngrid,nlayer) ! v component tendency 86 90 real :: dist_sol ! distance of the sun (AU) 87 real :: mu0(ngrid mx) ! cos of solar zenith angle (=1 when sun at zenith)88 real :: pq(ngrid mx,nlayermx,nq) ! tracers mass mixing ratio89 real :: pdq(ngrid mx,nlayermx,nq) ! previous tendencies91 real :: mu0(ngrid) ! cos of solar zenith angle (=1 when sun at zenith) 92 real :: pq(ngrid,nlayer,nq) ! tracers mass mixing ratio 93 real :: pdq(ngrid,nlayer,nq) ! previous tendencies 90 94 real :: zday ! date (time since Ls=0, in martian days) 91 real :: tauref(ngrid mx) ! optical depth at 7 hPa92 real :: co2ice(ngrid mx) ! co2 ice surface layer (kg.m-2)93 real :: surfdust(ngrid mx,nlayermx) ! dust surface area (m2/m3)94 real :: surfice(ngrid mx,nlayermx) ! ice surface area (m2/m3)95 real :: tauref(ngrid) ! optical depth at 7 hPa 96 real :: co2ice(ngrid) ! co2 ice surface layer (kg.m-2) 97 real :: surfdust(ngrid,nlayer) ! dust surface area (m2/m3) 98 real :: surfice(ngrid,nlayer) ! ice surface area (m2/m3) 95 99 96 100 ! output: 97 101 98 real :: dqchim(ngrid mx,nlayermx,nq) ! tendencies on pq due to chemistry99 real :: dqschim(ngrid mx,nq) ! tendencies on qsurf100 real :: dqcloud(ngrid mx,nlayermx,nq)! tendencies on pq due to condensation101 real :: dqscloud(ngrid mx,nq) ! tendencies on qsurf102 real :: dqchim(ngrid,nlayer,nq) ! tendencies on pq due to chemistry 103 real :: dqschim(ngrid,nq) ! tendencies on qsurf 104 real :: dqcloud(ngrid,nlayer,nq)! tendencies on pq due to condensation 105 real :: dqscloud(ngrid,nq) ! tendencies on qsurf 102 106 103 107 ! local variables: … … 143 147 144 148 real :: latvl1, lonvl1 145 real :: zq(ngrid mx,nlayermx,nq) ! pq+pdq*ptimestep before chemistry149 real :: zq(ngrid,nlayer,nq) ! pq+pdq*ptimestep before chemistry 146 150 ! new mole fraction after 147 real :: zt(ngrid mx,nlayermx) ! temperature148 real :: zu(ngrid mx,nlayermx) ! u component of the wind149 real :: zv(ngrid mx,nlayermx) ! v component of the wind151 real :: zt(ngrid,nlayer) ! temperature 152 real :: zu(ngrid,nlayer) ! u component of the wind 153 real :: zv(ngrid,nlayer) ! v component of the wind 150 154 real :: taucol ! optical depth at 7 hPa 151 155 … … 155 159 ! for each column of atmosphere: 156 160 157 real :: zpress(nlayer mx) ! Pressure (mbar)158 real :: zdens(nlayer mx) ! Density (cm-3)159 real :: ztemp(nlayer mx) ! Temperature (K)160 real :: zlocal(nlayer mx) ! Altitude (km)161 real :: zycol(nlayer mx,nq) ! Composition (mole fractions)161 real :: zpress(nlayer) ! Pressure (mbar) 162 real :: zdens(nlayer) ! Density (cm-3) 163 real :: ztemp(nlayer) ! Temperature (K) 164 real :: zlocal(nlayer) ! Altitude (km) 165 real :: zycol(nlayer,nq) ! Composition (mole fractions) 162 166 real :: szacol ! Solar zenith angle 163 real :: surfice1d(nlayer mx) ! Ice surface area (cm2/cm3)164 real :: surfdust1d(nlayer mx) ! Dust surface area (cm2/cm3)165 real :: jo3(nlayer mx) ! Photodissociation rate O3->O1D (s-1)167 real :: surfice1d(nlayer) ! Ice surface area (cm2/cm3) 168 real :: surfdust1d(nlayer) ! Dust surface area (cm2/cm3) 169 real :: jo3(nlayer) ! Photodissociation rate O3->O1D (s-1) 166 170 167 171 ! for output: … … 169 173 logical :: output ! to issue calls to writediagfi and stats 170 174 parameter (output = .true.) 171 real :: jo3_3d(ngrid mx,nlayermx) ! Photodissociation rate O3->O1D (s-1)175 real :: jo3_3d(ngrid,nlayer) ! Photodissociation rate O3->O1D (s-1) 172 176 173 177 !======================================================================= … … 592 596 !======================================================================= 593 597 594 do ig = 1,ngrid mx598 do ig = 1,ngrid 595 599 596 600 foundswitch = 0 597 do l = 1,nlayer mx601 do l = 1,nlayer 598 602 do i = 1,nbq 599 603 iq = niq(i) ! get tracer index … … 626 630 end if 627 631 if (.not. thermochem) then 628 lswitch = min(50,nlayer mx+1)632 lswitch = min(50,nlayer+1) 629 633 end if 630 634 631 end do ! of do l=1,nlayer mx635 end do ! of do l=1,nlayer 632 636 633 637 szacol = acos(mu0(ig))*180./pi … … 647 651 ! ozone photolysis, for output 648 652 649 do l = 1,nlayer mx653 do l = 1,nlayer 650 654 jo3_3d(ig,l) = jo3(l) 651 655 end do … … 653 657 ! condensation of h2o2 654 658 655 call perosat(ig,ptimestep,pplev,pplay, & 659 call perosat(ngrid, nlayer, nq, & 660 ig,ptimestep,pplev,pplay, & 656 661 ztemp,zycol,dqcloud,dqscloud) 657 662 end if … … 667 672 668 673 if (depos) then 669 call deposition(ig, ig_vl1, pplay, pplev, zzlay, zzlev,& 674 call deposition(ngrid, nlayer, nq, & 675 ig, ig_vl1, pplay, pplev, zzlay, zzlev, & 670 676 zu, zv, zt, zycol, ptimestep, co2ice) 671 677 end if … … 679 685 680 686 ! tendency for the most abundant species = - sum of others 681 do l = 1,nlayer mx687 do l = 1,nlayer 682 688 iloc=maxloc(zycol(l,:)) 683 689 iqmax=iloc(1) … … 691 697 end if 692 698 end do 693 end do ! of do l = 1,nlayer mx699 end do ! of do l = 1,nlayer 694 700 695 701 !======================================================================= … … 697 703 !======================================================================= 698 704 699 end do ! of do ig=1,ngrid mx705 end do ! of do ig=1,ngrid 700 706 701 707 !======================================================================= … … 707 713 708 714 if (photochem .and. output) then 709 if (ngrid mx> 1) then710 call writediagfi(ngrid mx,'jo3','j o3->o1d', &715 if (ngrid > 1) then 716 call writediagfi(ngrid,'jo3','j o3->o1d', & 711 717 's-1',3,jo3_3d(1,1)) 712 718 if (callstats) then 713 call wstats(ngrid mx,'jo3','j o3->o1d', &719 call wstats(ngrid,'jo3','j o3->o1d', & 714 720 's-1',3,jo3_3d(1,1)) 715 721 endif 716 end if ! of if (ngrid mx.gt.1)722 end if ! of if (ngrid.gt.1) 717 723 end if ! of if (output) 718 724
Note: See TracChangeset
for help on using the changeset viewer.