Changeset 1047 for trunk/LMDZ.MARS/libf
- Timestamp:
- Sep 23, 2013, 9:56:47 AM (12 years ago)
- Location:
- trunk/LMDZ.MARS/libf
- Files:
-
- 11 added
- 15 deleted
- 84 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 -
trunk/LMDZ.MARS/libf/aeronomars/chemthermos.F90
r1036 r1047 33 33 #include "comcstfi.h" 34 34 #include "callkeys.h" 35 #include "comdiurn.h"35 !#include "comdiurn.h" 36 36 #include "param.h" 37 37 #include "param_v4.h" -
trunk/LMDZ.MARS/libf/aeronomars/concentrations.F
r1036 r1047 1 SUBROUTINE concentrations(nq,pplay,pt,pdt,pq,pdq,ptimestep) 1 SUBROUTINE concentrations(ngrid,nlayer,nq, 2 & pplay,pt,pdt,pq,pdq,ptimestep) 2 3 3 4 use tracer_mod, only: igcm_co2, igcm_co, igcm_o, igcm_o1d, … … 9 10 & igcm_nplus, igcm_noplus, igcm_n2plus, 10 11 & igcm_hplus, igcm_hco2plus, mmol 12 use conc_mod, only: mmean, Akknew, rnew, cpnew 13 11 14 implicit none 12 15 … … 14 17 ! CALCULATION OF MEAN MOLECULAR MASS, Cp, Akk and R 15 18 ! 16 ! mmean(ngrid mx,nlayermx) amu17 ! cpnew(ngrid mx,nlayermx) J/kg/K18 ! rnew(ngrid mx,nlayermx) J/kg/K19 ! akknew(ngrid mx,nlayermx) coefficient of thermal concduction19 ! mmean(ngrid,nlayer) amu 20 ! cpnew(ngrid,nlayer) J/kg/K 21 ! rnew(ngrid,nlayer) J/kg/K 22 ! akknew(ngrid,nlayer) coefficient of thermal concduction 20 23 ! 21 24 ! version: April 2012 - Franck Lefevre … … 24 27 ! declarations 25 28 26 #include "dimensions.h"27 #include "dimphys.h"29 !#include "dimensions.h" 30 !#include "dimphys.h" 28 31 #include "comcstfi.h" 29 32 #include "callkeys.h" 30 #include "comdiurn.h"33 !#include "comdiurn.h" 31 34 #include "chimiedata.h" 32 35 !#include "tracer.h" 33 #include "conc.h"36 !#include "conc.h" 34 37 35 38 ! input/output 36 39 40 integer,intent(in) :: ngrid ! number of atmospheric columns 41 integer,intent(in) :: nlayer ! number of atmospheric layers 37 42 integer,intent(in) :: nq ! number of tracers 38 real,intent(in) :: pplay(ngrid mx,nlayermx)39 real,intent(in) :: pt(ngrid mx,nlayermx)40 real,intent(in) :: pdt(ngrid mx,nlayermx)41 real,intent(in) :: pq(ngrid mx,nlayermx,nq)42 real,intent(in) :: pdq(ngrid mx,nlayermx,nq)43 real,intent(in) :: pplay(ngrid,nlayer) 44 real,intent(in) :: pt(ngrid,nlayer) 45 real,intent(in) :: pdt(ngrid,nlayer) 46 real,intent(in) :: pq(ngrid,nlayer,nq) 47 real,intent(in) :: pdq(ngrid,nlayer,nq) 43 48 real,intent(in) :: ptimestep 44 49 … … 49 54 integer,allocatable,save :: niq(:) 50 55 real :: ni(nq), ntot 51 real :: zq(ngrid mx, nlayermx, nq)52 real :: zt(ngrid mx, nlayermx)56 real :: zq(ngrid, nlayer, nq) 57 real :: zt(ngrid, nlayer) 53 58 real,allocatable,save :: aki(:) 54 59 real,allocatable,save :: cpi(:) … … 243 248 ! update temperature 244 249 245 do l = 1,nlayer mx246 do ig = 1,ngrid mx250 do l = 1,nlayer 251 do ig = 1,ngrid 247 252 zt(ig,l) = pt(ig,l) + pdt(ig,l)*ptimestep 248 253 end do … … 251 256 ! update tracers 252 257 253 do l = 1,nlayer mx254 do ig = 1,ngrid mx258 do l = 1,nlayer 259 do ig = 1,ngrid 255 260 do i = 1,nbq 256 261 iq = niq(i) … … 266 271 mmean(:,:) = 0. 267 272 268 do l = 1,nlayer mx269 do ig = 1,ngrid mx273 do l = 1,nlayer 274 do ig = 1,ngrid 270 275 do i = 1,nbq 271 276 iq = niq(i) … … 283 288 akknew(:,:) = 0. 284 289 285 do l = 1,nlayer mx286 do ig = 1,ngrid mx290 do l = 1,nlayer 291 do ig = 1,ngrid 287 292 ntot = pplay(ig,l)/(1.381e-23*zt(ig,l))*1.e-6 ! in #/cm3 288 293 do i = 1,nbq -
trunk/LMDZ.MARS/libf/aeronomars/conduction.F
r38 r1047 1 SUBROUTINE conduction( ptimestep,pplay,pplev,pt,pdt,1 SUBROUTINE conduction(ngrid,nlayer,ptimestep,pplay,pplev,pt,pdt, 2 2 $ tsurf,zzlev,zzlay,zdtconduc) 3 3 4 use conc_mod, only: Akknew, rnew, cpnew 4 5 IMPLICIT NONE 5 6 … … 16 17 c----------------------------------------------------------------------- 17 18 18 #include "dimensions.h"19 #include "dimphys.h"20 #include "comcstfi.h"21 #include "surfdat.h"22 #include "chimiedata.h"23 #include "conc.h"19 !#include "dimensions.h" 20 !#include "dimphys.h" 21 !#include "comcstfi.h" 22 !#include "surfdat.h" 23 !#include "chimiedata.h" 24 !#include "conc.h" 24 25 25 26 c arguments: 26 27 c ---------- 27 28 28 REAL ptimestep 29 REAL pplay(ngridmx,nlayermx) 30 real pplev(ngridmx,nlayermx+1) 31 REAL zzlay(ngridmx,nlayermx) 32 real zzlev(ngridmx,nlayermx+1) 33 REAL pt(ngridmx,nlayermx) 34 real pdt(ngridmx,nlayermx) 35 real tsurf(ngridmx) 29 integer,intent(in) :: ngrid ! number of atmospheric columns 30 integer,intent(in) :: nlayer ! number of atmospheric layers 31 real,intent(in) :: ptimestep 32 REAL,intent(in) :: pplay(ngrid,nlayer) 33 real,intent(in) :: pplev(ngrid,nlayer+1) 34 REAL,intent(in) :: zzlay(ngrid,nlayer) 35 real,intent(in) :: zzlev(ngrid,nlayer+1) 36 REAL,intent(in) :: pt(ngrid,nlayer) 37 real,intent(in) :: pdt(ngrid,nlayer) 38 real,intent(in) :: tsurf(ngrid) 36 39 37 real zdtconduc(ngridmx,nlayermx)40 real,intent(out) :: zdtconduc(ngrid,nlayer) 38 41 39 42 c local: … … 41 44 42 45 INTEGER i,ig,l 43 INTEGER,SAVE :: ngrid, nz44 46 real Akk 45 47 real,save :: phitop 46 48 real m,tmean 47 REAL alpha(nlayer mx)48 real zt(nlayer mx)49 REAL lambda(nlayer mx)50 real muvol(nlayer mx)51 REAL C(nlayer mx)52 real D(nlayer mx)53 real den(nlayer mx)54 REAL pdtc(nlayer mx)55 real zlay(nlayer mx)56 real zlev(nlayer mx+1)49 REAL alpha(nlayer) 50 real zt(nlayer) 51 REAL lambda(nlayer) 52 real muvol(nlayer) 53 REAL C(nlayer) 54 real D(nlayer) 55 real den(nlayer) 56 REAL pdtc(nlayer) 57 real zlay(nlayer) 58 real zlev(nlayer+1) 57 59 58 60 c constants used locally … … 78 80 ! Initialize phitop 79 81 phitop=0.0 80 ! Initialize ngrid and nz81 ngrid=ngridmx82 nz=nlayermx83 82 84 83 firstcall = .false. … … 93 92 zlev(1)=zzlev(ig,1) 94 93 95 do i=2,n z94 do i=2,nlayer 96 95 97 96 zt(i)=pt(ig,i)+pdt(ig,i)*ptimestep … … 107 106 enddo 108 107 109 c zlev(n z+1)= zlev(nz)110 c & -log(max(pplev(ig,n z+1),1.e-30)/pplev(ig,nz))111 c & *Rnew(ig,n z)*tmean/g112 c if(pplev(ig,n z+1).eq.0.)113 c & zlev(n z+1)=zlev(nz)+(zlay(nz)-zlay(nz-1))108 c zlev(nlayer+1)= zlev(nlayer) 109 c & -log(max(pplev(ig,nlayer+1),1.e-30)/pplev(ig,nlayer)) 110 c & *Rnew(ig,nlayer)*tmean/g 111 c if(pplev(ig,nlayer+1).eq.0.) 112 c & zlev(nlayer+1)=zlev(nlayer)+(zlay(nlayer)-zlay(nlayer-1)) 114 113 115 zlev(n z+1)= zlev(nz)+10000.114 zlev(nlayer+1)= zlev(nlayer)+10000. 116 115 117 116 Akk=Akknew(ig,1) 118 117 lambda(1) = Akk*tsurf(ig)**skk/zlay(1) 119 118 120 DO i = 2 , n z119 DO i = 2 , nlayer 121 120 Akk=Akknew(ig,i) 122 121 lambda(i)=Akk*zt(i)**skk/(zlay(i)-zlay(i-1)) 123 122 ENDDO 124 DO i=1,n z-1123 DO i=1,nlayer-1 125 124 muvol(i)=pplay(ig,i)/(rnew(ig,i)*zt(i)) 126 125 alpha(i)=cpnew(ig,i)*(muvol(i)/ptimestep) … … 128 127 ENDDO 129 128 130 muvol(n z)=pplay(ig,nz)/(rnew(ig,nz)*zt(nz))131 alpha(n z)=cpnew(ig,i)*(muvol(nz)/ptimestep)132 $ *(zlev(n z+1)-zlev(nz))129 muvol(nlayer)=pplay(ig,nlayer)/(rnew(ig,nlayer)*zt(nlayer)) 130 alpha(nlayer)=cpnew(ig,i)*(muvol(nlayer)/ptimestep) 131 $ *(zlev(nlayer+1)-zlev(nlayer)) 133 132 134 133 c-------------------------------------------------------------------- … … 143 142 D(1)=lambda(2)/den(1) 144 143 145 DO i = 2,n z-1144 DO i = 2,nlayer-1 146 145 den(i)=alpha(i)+lambda(i+1) 147 146 den(i)=den(i)+lambda(i)*(1-D(i-1)) … … 154 153 ENDDO 155 154 156 den(n z)=alpha(nz) + lambda(nz) * (1-D(nz-1))157 C(n z)=C(nz-1)+zt(nz-1)-zt(nz)158 C(n z)=(C(nz)*lambda(nz)+phitop) / den(nz)155 den(nlayer)=alpha(nlayer) + lambda(nlayer) * (1-D(nlayer-1)) 156 C(nlayer)=C(nlayer-1)+zt(nlayer-1)-zt(nlayer) 157 C(nlayer)=(C(nlayer)*lambda(nlayer)+phitop) / den(nlayer) 159 158 160 159 c---------------------------------------------------------------------- … … 164 163 c---------------------------------------------------------------------- 165 164 166 DO i=1,n z165 DO i=1,nlayer 167 166 pdtc(i)=0. 168 167 ENDDO 169 pdtc(n z)=C(nz)170 DO i=n z-1,1,-1168 pdtc(nlayer)=C(nlayer) 169 DO i=nlayer-1,1,-1 171 170 pdtc(i)=C(i)+D(i)*pdtc(i+1) 172 171 ENDDO … … 177 176 c----------------------------------------------------------------------- 178 177 179 DO i=1,n z178 DO i=1,nlayer 180 179 zdtconduc(ig,i)=pdtc(i)/ptimestep 181 180 ENDDO -
trunk/LMDZ.MARS/libf/aeronomars/deposition.F
r1036 r1047 1 subroutine deposition(ig, ig_vl1, pplay, pplev, zzlay, zzlev, 1 subroutine deposition(ngrid, nlayer, nq, 2 & ig, ig_vl1, pplay, pplev, zzlay, zzlev, 2 3 $ zu, zv, zt, zycol, ptimestep, co2ice) 3 4 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc … … 7 8 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc 8 9 c 9 use tracer_mod, only: nqmx 10 use surfdat_h, only: z0 ! surface roughness 11 use conc_mod, only: rnew ! specific gas constant 10 12 implicit none 11 13 c 12 #include "dimensions.h"13 #include "dimphys.h"14 #include "planete.h"15 #include "chimiedata.h"16 #include "conc.h"17 #include "surfdat.h"14 !#include "dimensions.h" 15 !#include "dimphys.h" 16 !#include "planete.h" 17 !#include "chimiedata.h" 18 !#include "conc.h" 19 !#include "surfdat.h" 18 20 c 19 21 c input 20 22 c 21 integer ig ! grid point index 22 integer ig_vl1 ! viking 1 grid point 23 real pplay(ngridmx,nlayermx) ! pressure at the middle of the layers (pa) 24 real pplev(ngridmx,nlayermx+1) ! pressure at layer boundaries (pa) 25 real zzlay(ngridmx,nlayermx) ! altitude at the middle of the layers (m) 26 real zzlev(ngridmx,nlayermx+1) ! altitude at layer boundaries (m) 27 real zu(ngridmx,nlayermx) ! u component of the wind (m.s-1) 28 real zv(ngridmx,nlayermx) ! v component of the wind (m.s-1) 29 real zt(ngridmx,nlayermx) ! temperature (k) 30 real zycol(nlayermx,nqmx) ! composition (volume mixing ratio) 31 real ptimestep ! physical timestep (s) 32 real co2ice(ngridmx) ! co2 ice surface layer (kg.m-2) 23 integer,intent(in) :: ngrid ! number of atmospheric columns 24 integer,intent(in) :: nlayer ! number of atmospheric layers 25 integer,intent(in) :: nq ! number of tracers 26 integer ig ! grid point index 27 integer ig_vl1 ! viking 1 grid point 28 real pplay(ngrid,nlayer) ! pressure at the middle of the layers (pa) 29 real pplev(ngrid,nlayer+1) ! pressure at layer boundaries (pa) 30 real zzlay(ngrid,nlayer) ! altitude at the middle of the layers (m) 31 real zzlev(ngrid,nlayer+1) ! altitude at layer boundaries (m) 32 real zu(ngrid,nlayer) ! u component of the wind (m.s-1) 33 real zv(ngrid,nlayer) ! v component of the wind (m.s-1) 34 real zt(ngrid,nlayer) ! temperature (k) 35 real zycol(nlayer,nq) ! composition (volume mixing ratio) 36 real ptimestep ! physical timestep (s) 37 real co2ice(ngrid) ! co2 ice surface layer (kg.m-2) 33 38 c 34 39 c local -
trunk/LMDZ.MARS/libf/aeronomars/euvheat.F90
r1036 r1047 1 SUBROUTINE euvheat( pt,pdt,pplev,pplay,zzlay, &1 SUBROUTINE euvheat(ngrid,nlayer,nq,pt,pdt,pplev,pplay,zzlay, & 2 2 mu0,ptimestep,ptime,zday,pq,pdq,pdteuv) 3 3 4 use tracer_mod, only: nqmx, igcm_co2, igcm_co, igcm_o, igcm_o1d,&5 igcm_o2, igcm_h, igcm_h2, igcm_oh, igcm_ho2, &6 igcm_h2o2, igcm_h2o_vap, igcm_o3, igcm_n2, &4 use tracer_mod, only: igcm_co2, igcm_co, igcm_o, igcm_o1d, & 5 igcm_o2, igcm_h, igcm_h2, igcm_oh, igcm_ho2, & 6 igcm_h2o2, igcm_h2o_vap, igcm_o3, igcm_n2, & 7 7 igcm_n, igcm_no, igcm_no2, igcm_n2d, mmol 8 use conc_mod, only: rnew, cpnew 8 9 IMPLICIT NONE 9 10 !======================================================================= … … 17 18 ! input: 18 19 ! ----- 19 ! mu0(ngrid mx)20 ! mu0(ngrid) 20 21 ! pplay(ngrid,nlayer) pressure at middle of layers (Pa) 21 22 ! … … 30 31 ! ------------------ 31 32 ! 32 #include "dimensions.h"33 #include "dimphys.h"34 #include "comcstfi.h"33 !#include "dimensions.h" 34 !#include "dimphys.h" 35 !#include "comcstfi.h" 35 36 #include "callkeys.h" 36 #include "comdiurn.h"37 #include "param.h"38 #include "param_v4.h"39 #include "chimiedata.h"37 !#include "comdiurn.h" 38 !#include "param.h" 39 !#include "param_v4.h" 40 !#include "chimiedata.h" 40 41 !#include "tracer.h" 41 #include "conc.h"42 !#include "conc.h" 42 43 !----------------------------------------------------------------------- 43 44 ! Input/Output 44 45 ! ------------ 45 46 46 real :: pt(ngridmx,nlayermx) 47 real :: pdt(ngridmx,nlayermx) 48 real :: pplev(ngridmx,nlayermx+1) 49 real :: pplay(ngridmx,nlayermx) 50 real :: zzlay(ngridmx,nlayermx) 51 real :: mu0(ngridmx) 47 integer,intent(in) :: ngrid ! number of atmospheric columns 48 integer,intent(in) :: nlayer ! number of atmospheric layers 49 integer,intent(in) :: nq ! number of advected tracers 50 real :: pt(ngrid,nlayer) 51 real :: pdt(ngrid,nlayer) 52 real :: pplev(ngrid,nlayer+1) 53 real :: pplay(ngrid,nlayer) 54 real :: zzlay(ngrid,nlayer) 55 real :: mu0(ngrid) 52 56 real :: ptimestep,ptime 53 57 real :: zday 54 real :: pq(ngrid mx,nlayermx,nqmx)55 real :: pdq(ngrid mx,nlayermx,nqmx)56 57 real :: pdteuv(ngrid mx,nlayermx)58 real :: pq(ngrid,nlayer,nq) 59 real :: pdq(ngrid,nlayer,nq) 60 61 real :: pdteuv(ngrid,nlayer) 58 62 ! 59 63 ! Local variables : … … 63 67 INTEGER :: l,ig,n 64 68 integer,save :: euvmod 65 real, allocatable :: rm(:,:) ! number density (cm-3)66 real :: zq(ngrid mx,nlayermx,nqmx) ! local updated tracer quantity67 real :: zt(ngrid mx,nlayermx) ! local updated atmospheric temperature68 real :: zlocal(nlayer mx)69 real, allocatable, save :: rm(:,:) ! number density (cm-3) 70 real :: zq(ngrid,nlayer,nq) ! local updated tracer quantity 71 real :: zt(ngrid,nlayer) ! local updated atmospheric temperature 72 real :: zlocal(nlayer) 69 73 real :: zenit 70 real :: jtot(nlayer mx)74 real :: jtot(nlayer) 71 75 real :: dens ! amu/cm-3 72 real :: tx(nlayer mx)76 real :: tx(nlayer) 73 77 ! real euveff !UV heating efficiency 74 78 … … 326 330 end select 327 331 332 !Allocate density vector 333 allocate(rm(nlayer,nespeuv)) 334 328 335 firstcall= .false. 329 336 endif ! of if (firstcall) … … 331 338 !cccccccccccccccccccccccccccccccccccccccccccccccccccccccc 332 339 333 !Number of species if not firstcall 334 335 336 !Allocate density vector 337 allocate(rm(nlayermx,nespeuv)) 340 338 341 ! build local updated values of tracers and temperature 339 do l=1,nlayer mx340 do ig=1,ngrid mx342 do l=1,nlayer 343 do ig=1,ngrid 341 344 ! chemical species 342 345 zq(ig,l,g_co2)=pq(ig,l,g_co2)+pdq(ig,l,g_co2)*ptimestep … … 374 377 ! set 375 378 376 do ig=1,ngrid mx379 do ig=1,ngrid 377 380 zenit=acos(mu0(ig))*180./acos(-1.) 378 381 379 do l=1,nlayer mx382 do l=1,nlayer 380 383 !Conversion to number density 381 384 dens=pplay(ig,l)/(rnew(ig,l)*zt(ig,l)) / 1.66e-21 … … 406 409 tx(1)=zt(ig,1) 407 410 408 do l=2,nlayer mx411 do l=2,nlayer 409 412 tx(l)=zt(ig,l) 410 413 zlocal(l)=zzlay(ig,l)/1000. … … 419 422 !Gonzalez-Galindo et al. JGR 2009) for details 420 423 !Calculates the UV heating from the total photoabsorption coefficient 421 do l=1,nlayer mx424 do l=1,nlayer 422 425 pdteuv(ig,l)=euveff*jtot(l)/10. & 423 426 /(cpnew(ig,l)*pplay(ig,l)/(rnew(ig,l)*zt(ig,l))) … … 426 429 !the actual Mars-Sun distance 427 430 enddo 428 enddo ! of do ig=1,ngrid mx431 enddo ! of do ig=1,ngrid 429 432 !Deallocations 430 deallocate(rm)433 ! deallocate(rm) 431 434 432 435 return -
trunk/LMDZ.MARS/libf/aeronomars/inichim_newstart.F90
r1036 r1047 1 subroutine inichim_newstart(nq, pq, qsurf, ps, flagh2o, flagthermo) 1 subroutine inichim_newstart(ngrid, nq, pq, qsurf, ps, & 2 flagh2o, flagthermo) 2 3 3 4 use tracer_mod … … 25 26 ! 26 27 ! pq(iip1,jjp1,llm,nq) Advected fields, ie chemical species here 27 ! qsurf(ngrid mx,nq) Amount of tracer on the surface (kg/m2)28 ! qsurf(ngrid,nq) Amount of tracer on the surface (kg/m2) 28 29 ! ps(iip1,jjp1) Surface pressure (Pa) 29 30 ! flagh2o flag for initialisation of h2o (1: yes / 0: no) … … 33 34 34 35 #include "dimensions.h" 35 #include "dimphys.h"36 !#include "dimphys.h" 36 37 #include "paramet.h" 37 38 !#include "tracer.h" … … 42 43 ! inputs : 43 44 45 integer,intent(in) :: ngrid ! number of atmospheric columns in the physics 44 46 integer,intent(in) :: nq ! number of tracers 45 47 real,intent(in) :: ps(iip1,jjp1) ! surface pressure in the gcm (Pa) … … 50 52 51 53 real,intent(out) :: pq(iip1,jjp1,llm,nq) ! advected fields, ie chemical species 52 real,intent(out) :: qsurf(ngrid mx,nq) ! surface values (kg/m2) of tracers54 real,intent(out) :: qsurf(ngrid,nq) ! surface values (kg/m2) of tracers 53 55 54 56 ! local : … … 586 588 do n = 1,nspe 587 589 iq = niq(n) 588 qsurf(1:ngrid mx,iq) = 0.590 qsurf(1:ngrid,iq) = 0. 589 591 end do 590 592 end if … … 604 606 end do 605 607 ! set surface value to zero 606 qsurf(1:ngrid mx,igcm_ch4) = 0.608 qsurf(1:ngrid,igcm_ch4) = 0. 607 609 end if 608 610 … … 644 646 ! surface value to 0 645 647 646 qsurf(1:ngrid mx,igcm_co2plus) = 0.647 qsurf(1:ngrid mx,igcm_o2plus) = 0.648 qsurf(1:ngrid mx,igcm_oplus) = 0.649 qsurf(1:ngrid mx,igcm_coplus) = 0.650 qsurf(1:ngrid mx,igcm_cplus) = 0.651 qsurf(1:ngrid mx,igcm_nplus) = 0.652 qsurf(1:ngrid mx,igcm_noplus) = 0.653 qsurf(1:ngrid mx,igcm_n2plus) = 0.654 qsurf(1:ngrid mx,igcm_hplus) = 0.655 qsurf(1:ngrid mx,igcm_hco2plus) = 0.656 qsurf(1:ngrid mx,igcm_elec) = 0.648 qsurf(1:ngrid,igcm_co2plus) = 0. 649 qsurf(1:ngrid,igcm_o2plus) = 0. 650 qsurf(1:ngrid,igcm_oplus) = 0. 651 qsurf(1:ngrid,igcm_coplus) = 0. 652 qsurf(1:ngrid,igcm_cplus) = 0. 653 qsurf(1:ngrid,igcm_nplus) = 0. 654 qsurf(1:ngrid,igcm_noplus) = 0. 655 qsurf(1:ngrid,igcm_n2plus) = 0. 656 qsurf(1:ngrid,igcm_hplus) = 0. 657 qsurf(1:ngrid,igcm_hco2plus) = 0. 658 qsurf(1:ngrid,igcm_elec) = 0. 657 659 658 660 else -
trunk/LMDZ.MARS/libf/aeronomars/jthermcalc.F
r1036 r1047 1680 1680 !c*************************************************** 1681 1681 1682 use comsaison_h, only: dist_sol 1682 1683 implicit none 1683 1684 … … 1686 1687 include "dimensions.h" 1687 1688 include "dimphys.h" 1688 include "comsaison.h"1689 ! include "comsaison.h" 1689 1690 include 'param.h' 1690 1691 include 'param_v4.h' -
trunk/LMDZ.MARS/libf/aeronomars/moldiff.F
r1036 r1047 1 subroutine moldiff(pplay,pplev,pt,pdt,pq,pdq,ptimestep, 1 subroutine moldiff(ngrid,nlayer,nq, 2 & pplay,pplev,pt,pdt,pq,pdq,ptimestep, 2 3 & zzlay,pdteuv,pdtconduc,pdqdiff) 3 4 4 use tracer_mod, only: nqmx,igcm_co2, igcm_co, igcm_o, igcm_o1d,5 use tracer_mod, only: igcm_co2, igcm_co, igcm_o, igcm_o1d, 5 6 & igcm_o2, igcm_o3, igcm_h, igcm_h2, igcm_oh, 6 7 & igcm_ho2, igcm_h2o2, igcm_n2, igcm_ar, 7 8 & igcm_h2o_vap, mmol 9 use conc_mod, only: rnew, mmean 8 10 implicit none 9 11 10 #include "dimensions.h"11 #include "dimphys.h"12 !#include "dimensions.h" 13 !#include "dimphys.h" 12 14 #include "comcstfi.h" 13 #include "callkeys.h"14 #include "comdiurn.h"15 #include "chimiedata.h"15 !#include "callkeys.h" 16 !#include "comdiurn.h" 17 !#include "chimiedata.h" 16 18 !#include "tracer.h" 17 #include "conc.h"19 !#include "conc.h" 18 20 19 21 … … 21 23 c Input/Output 22 24 c 25 integer,intent(in) :: ngrid ! number of atmospheric columns 26 integer,intent(in) :: nlayer ! number of atmospheric layers 27 integer,intent(in) :: nq ! number of advected tracers 23 28 real ptimestep 24 real pplay(ngrid mx,nlayermx)25 real zzlay(ngrid mx,nlayermx)26 real pplev(ngrid mx,nlayermx+1)27 real pq(ngrid mx,nlayermx,nqmx)28 real pdq(ngrid mx,nlayermx,nqmx)29 real pt(ngrid mx,nlayermx)30 real pdt(ngrid mx,nlayermx)31 real pdteuv(ngrid mx,nlayermx)32 real pdtconduc(ngrid mx,nlayermx)33 real pdqdiff(ngrid mx,nlayermx,nqmx)29 real pplay(ngrid,nlayer) 30 real zzlay(ngrid,nlayer) 31 real pplev(ngrid,nlayer+1) 32 real pq(ngrid,nlayer,nq) 33 real pdq(ngrid,nlayer,nq) 34 real pt(ngrid,nlayer) 35 real pdt(ngrid,nlayer) 36 real pdteuv(ngrid,nlayer) 37 real pdtconduc(ngrid,nlayer) 38 real pdqdiff(ngrid,nlayer,nq) 34 39 c 35 40 c Local … … 42 47 real del1,del2, tmean ,dalfinvdz, d 43 48 real hh,dcoef,dcoef1,ptfac, ntot, dens, dens2, dens3 44 real hp(nlayer mx)45 real tt(nlayer mx)46 real qq(nlayer mx,ncompmoldiff)47 real dmmeandz(nlayer mx)48 real qnew(nlayer mx,ncompmoldiff)49 real zlocal(nlayer mx)49 real hp(nlayer) 50 real tt(nlayer) 51 real qq(nlayer,ncompmoldiff) 52 real dmmeandz(nlayer) 53 real qnew(nlayer,ncompmoldiff) 54 real zlocal(nlayer) 50 55 real alf(ncompmoldiff-1,ncompmoldiff-1) 51 real alfinv(nlayer mx,ncompmoldiff-1,ncompmoldiff-1)56 real alfinv(nlayer,ncompmoldiff-1,ncompmoldiff-1) 52 57 real indx(ncompmoldiff-1) 53 real b(nlayer mx,ncompmoldiff-1)58 real b(nlayer,ncompmoldiff-1) 54 59 real y(ncompmoldiff-1,ncompmoldiff-1) 55 real aa(nlayer mx,ncompmoldiff-1,ncompmoldiff-1)56 real bb(nlayer mx,ncompmoldiff-1,ncompmoldiff-1)57 real cc(nlayer mx,ncompmoldiff-1,ncompmoldiff-1)58 real atri(nlayer mx-2)59 real btri(nlayer mx-2)60 real ctri(nlayer mx-2)61 real rtri(nlayer mx-2)62 real qtri(nlayer mx-2)60 real aa(nlayer,ncompmoldiff-1,ncompmoldiff-1) 61 real bb(nlayer,ncompmoldiff-1,ncompmoldiff-1) 62 real cc(nlayer,ncompmoldiff-1,ncompmoldiff-1) 63 real atri(nlayer-2) 64 real btri(nlayer-2) 65 real ctri(nlayer-2) 66 real rtri(nlayer-2) 67 real qtri(nlayer-2) 63 68 real alfdiag(ncompmoldiff-1) 64 69 real wi(ncompmoldiff), flux(ncompmoldiff), pote … … 211 216 cccccccccccccccccccccccccccccccccccccccccccccccccccccccc 212 217 213 nz=nlayer mx214 215 do ig=1,ngrid mx218 nz=nlayer 219 220 do ig=1,ngrid 216 221 217 222 do l=2,nz-1 … … 291 296 write(*,*) 'ig, l=',ig, l 292 297 write(*,*) 'No molecular diffusion this time !' 293 call zerophys(ngridmx*nlayermx*nqmx,pdqdiff)298 pdqdiff(1:ngrid,1:nlayer,1:nq)=0 294 299 return 295 300 c stop -
trunk/LMDZ.MARS/libf/aeronomars/moldiff_red.F90
r1036 r1047 1 subroutine moldiff_red(pplay,pplev,pt,pdt,pq,pdq,ptimestep,zzlay,pdteuv,pdtconduc,pdqdiff) 2 3 use tracer_mod, only: nqmx, noms, mmol 1 subroutine moldiff_red(ngrid,nlayer,nq,pplay,pplev,pt,pdt,pq,pdq,& 2 ptimestep,zzlay,pdteuv,pdtconduc,pdqdiff) 3 4 use tracer_mod, only: noms, mmol 4 5 5 6 implicit none 6 7 7 #include "dimensions.h"8 #include "dimphys.h"8 !#include "dimensions.h" 9 !#include "dimphys.h" 9 10 #include "comcstfi.h" 10 #include "callkeys.h"11 #include "comdiurn.h"12 #include "chimiedata.h"11 !#include "callkeys.h" 12 !#include "comdiurn.h" 13 !#include "chimiedata.h" 13 14 !#include "tracer.h" 14 #include "conc.h"15 !#include "conc.h" 15 16 #include "diffusion.h" 16 17 … … 19 20 ! Input/Output 20 21 ! 22 integer,intent(in) :: ngrid ! number of atmospheric columns 23 integer,intent(in) :: nlayer ! number of atmospheric layers 24 integer,intent(in) :: nq ! number of advected tracers 21 25 real ptimestep 22 real pplay(ngrid mx,nlayermx)23 real zzlay(ngrid mx,nlayermx)24 real pplev(ngrid mx,nlayermx+1)25 real pq(ngrid mx,nlayermx,nqmx)26 real pdq(ngrid mx,nlayermx,nqmx)27 real pt(ngrid mx,nlayermx)28 real pdt(ngrid mx,nlayermx)29 real pdteuv(ngrid mx,nlayermx)30 real pdtconduc(ngrid mx,nlayermx)31 real pdqdiff(ngrid mx,nlayermx,nqmx)26 real pplay(ngrid,nlayer) 27 real zzlay(ngrid,nlayer) 28 real pplev(ngrid,nlayer+1) 29 real pq(ngrid,nlayer,nq) 30 real pdq(ngrid,nlayer,nq) 31 real pt(ngrid,nlayer) 32 real pdt(ngrid,nlayer) 33 real pdteuv(ngrid,nlayer) 34 real pdtconduc(ngrid,nlayer) 35 real pdqdiff(ngrid,nlayer,nq) 32 36 ! 33 37 ! Local … … 37 41 ! real hco2(ncompdiff),ho 38 42 39 integer,dimension(nq mx) :: indic_diff43 integer,dimension(nq) :: indic_diff 40 44 integer ig,iq,nz,l,k,n,nn,p,ij0 41 45 integer istep,il,gcn,ntime,nlraf … … 44 48 real*8 rho0,D0,T0,H0,time0,dZ,time,dZraf,tdiff,Zmin,Zmax 45 49 real*8 FacEsc,invsgmu 46 real*8 hp(nlayer mx)47 real*8 pp(nlayer mx)48 real*8 pint(nlayer mx)49 real*8 tt(nlayer mx),tnew(nlayermx),tint(nlayermx)50 real*8 zz(nlayer mx)50 real*8 hp(nlayer) 51 real*8 pp(nlayer) 52 real*8 pint(nlayer) 53 real*8 tt(nlayer),tnew(nlayer),tint(nlayer) 54 real*8 zz(nlayer) 51 55 real*8,dimension(:,:),allocatable,save :: qq,qnew,qint,FacMass 52 56 real*8,dimension(:,:),allocatable,save :: rhoK,rhokinit 53 real*8 rhoT(nlayer mx)54 real*8 dmmeandz(nlayer mx)55 real*8 massemoy(nlayer mx)57 real*8 rhoT(nlayer) 58 real*8 dmmeandz(nlayer) 59 real*8 massemoy(nlayer) 56 60 real*8,dimension(:),allocatable :: Praf,Traf,Rraf,Mraf,Nraf,Draf,Hraf,Wraf 57 61 real*8,dimension(:),allocatable :: Zraf,Tdiffraf … … 130 134 131 135 ncompdiff=0 132 indic_diff(1:nq mx)=0136 indic_diff(1:nq)=0 133 137 134 do nn=1,nq mx138 do nn=1,nq 135 139 do n=1,14 136 140 if (ListeDiff(n) .eq. noms(nn)) then … … 151 155 ! Store gcm indexes in gcmind 152 156 n=0 153 do nn=1,nq mx157 do nn=1,nq 154 158 if (indic_diff(nn) .eq. 1) then 155 159 n=n+1 … … 162 166 ! find vertical index above which diffusion is computed 163 167 164 do l=1,nlayer mx168 do l=1,nlayer 165 169 if (pplay(1,l) .gt. Pdiff) then 166 170 il0=l … … 176 180 177 181 ! allocatation des tableaux dependants du nombre d especes diffusees 178 allocate(qq(nlayer mx,ncompdiff))179 allocate(qnew(nlayer mx,ncompdiff))180 allocate(qint(nlayer mx,ncompdiff))181 allocate(FacMass(nlayer mx,ncompdiff))182 allocate(rhok(nlayer mx,ncompdiff))183 allocate(rhokinit(nlayer mx,ncompdiff))182 allocate(qq(nlayer,ncompdiff)) 183 allocate(qnew(nlayer,ncompdiff)) 184 allocate(qint(nlayer,ncompdiff)) 185 allocate(FacMass(nlayer,ncompdiff)) 186 allocate(rhok(nlayer,ncompdiff)) 187 allocate(rhokinit(nlayer,ncompdiff)) 184 188 185 189 allocate(wi(ncompdiff)) … … 212 216 213 217 ! print*,'moldiff',i_h2,i_h,ncompdiff 214 do ig=1,ngrid mx218 do ig=1,ngrid 215 219 pp=dble(pplay(ig,:)) 216 220 … … 218 222 219 223 ! CALL TMNEW(pt(ig,:),pdt(ig,:),pdtconduc(ig,:),pdteuv(ig,:) & 220 ! & ,tt,ptimestep,nlayer mx,ig)221 do l=1,nlayer mx224 ! & ,tt,ptimestep,nlayer,ig) 225 do l=1,nlayer 222 226 tt(l)=pt(ig,l)*1D0+(pdt(ig,l)*dble(ptimestep)+ & 223 227 pdtconduc(ig,l)*dble(ptimestep)+ & … … 228 232 pdt(ig,l),pdtconduc(ig,l),pdteuv(ig,l),dble(ptimestep) 229 233 endif 230 enddo ! of do l=1,nlayer mx234 enddo ! of do l=1,nlayer 231 235 232 236 ! Update the mass mixing ratios modified by other processes 233 237 234 ! CALL QMNEW(pq(ig,:,:),pdq(ig,:,:),qq,ptimestep,nlayer mx, &238 ! CALL QMNEW(pq(ig,:,:),pdq(ig,:,:),qq,ptimestep,nlayer, & 235 239 ! & ncompdiff,gcmind,ig) 236 240 do iq=1,ncompdiff 237 do l=1,nlayer mx241 do l=1,nlayer 238 242 qq(l,iq)=pq(ig,l,gcmind(iq))*1D0+( & 239 243 pdq(ig,l,gcmind(iq))*dble(ptimestep)) 240 244 qq(l,iq)=max(qq(l,iq),1d-30) 241 enddo ! of do l=1,nlayer mx245 enddo ! of do l=1,nlayer 242 246 enddo ! of do iq=1,ncompdiff 243 247 244 248 ! Compute the Pressure scale height 245 249 246 CALL HSCALE(pp,hp,nlayer mx)250 CALL HSCALE(pp,hp,nlayer) 247 251 248 252 ! Compute the atmospheric mass (in Dalton) 249 253 250 CALL MMOY(massemoy,mmol,qq,gcmind,nlayer mx,ncompdiff)254 CALL MMOY(massemoy,mmol,qq,gcmind,nlayer,ncompdiff) 251 255 252 256 ! Compute the vertical gradient of atmospheric mass 253 257 254 CALL DMMOY(massemoy,hp,dmmeandz,nlayer mx)258 CALL DMMOY(massemoy,hp,dmmeandz,nlayer) 255 259 256 260 ! Compute the altitude of each layer 257 261 258 CALL ZVERT(pp,tt,massemoy,zz,nlayer mx,ig)262 CALL ZVERT(pp,tt,massemoy,zz,nlayer,ig) 259 263 260 264 ! Compute the total mass density (kg/m3) 261 265 262 CALL RHOTOT(pp,tt,massemoy,qq,RHOT,RHOK,nlayer mx,ncompdiff)266 CALL RHOTOT(pp,tt,massemoy,qq,RHOT,RHOK,nlayer,ncompdiff) 263 267 RHOKINIT=RHOK 264 268 … … 271 275 Mtot1(1:ncompdiff)=0d0 272 276 273 do l=il0,nlayer mx277 do l=il0,nlayer 274 278 do nn=1,ncompdiff 275 279 Mtot1(nn)=Mtot1(nn)+1d0/g*qq(l,nn)* & … … 279 283 280 284 Zmin=zz(il0) 281 Zmax=zz(nlayer mx)285 Zmax=zz(nlayer) 282 286 283 287 … … 286 290 if (Zmax .gt. 4000000.) then 287 291 Print*,'Zmax too high',ig,zmax,zmin 288 do l=1,nlayer mx292 do l=1,nlayer 289 293 print*,'old',zz(l),pt(ig,l),pdteuv(ig,l),pdq(ig,l,:) 290 294 print*,'l',l,rhot(l),tt(l),pp(l),massemoy(l),qq(l,:) … … 321 325 CALL UPPER_RESOL(pp,tt,zz,massemoy,RHOT,RHOK, & 322 326 & qq,mmol,gcmind,Praf,Traf,Qraf,Mraf,Zraf, & 323 & Nraf,Nrafk,Rraf,Rrafk,il0,nlraf,ncompdiff,nlayer mx,ig)327 & Nraf,Nrafk,Rraf,Rrafk,il0,nlraf,ncompdiff,nlayer,ig) 324 328 325 329 Prafold=Praf … … 330 334 331 335 CALL GCMGRID_P(Zraf,Praf,Qraf,Traf,Nrafk,Rrafk,qq,qint,tt,tint & 332 & ,pp,mmol,gcmind,nlraf,ncompdiff,nlayer mx,ig)336 & ,pp,mmol,gcmind,nlraf,ncompdiff,nlayer,ig) 333 337 334 338 ! We compute the mass correction factor of each specie at each pressure level 335 339 336 CALL CORRMASS(qq,qint,FacMass,nlayer mx,ncompdiff)340 CALL CORRMASS(qq,qint,FacMass,nlayer,ncompdiff) 337 341 338 342 ! Altitude step … … 367 371 ! enddo 368 372 369 ! do l=1,nlayer mx373 ! do l=1,nlayer 370 374 ! print*,'l',l,zz(l),pp(l),tt(l),sum(qq(l,:)),massemoy(l) 371 375 ! enddo … … 374 378 ! No change below il0 375 379 376 do l=1,nlayer mx380 do l=1,nlayer 377 381 qnew(l,:)=qq(l,:) ! No effet below il0 378 382 enddo … … 527 531 print*,'Mraf',Mraf 528 532 stop 529 ! pdqdiff(1:ngrid mx,1:nlayermx,1:nqmx)=0.533 ! pdqdiff(1:ngrid,1:nlayer,1:nq)=0. 530 534 ! return 531 535 ! Rrafk(l,nn)=1D-30*Rraf(l) … … 572 576 573 577 CALL GCMGRID_P2(Zraf,Praf,Qraf,Traf,Nrafk,Rrafk,qq,qnew,tt,tnew,& 574 & pp,mmol,gcmind,nlraf,ncompdiff,nlayer mx,FacMass,ig)575 576 CALL RHOTOT(pp,tt,massemoy,qnew,RHOT,RHOK,nlayer mx,ncompdiff)578 & pp,mmol,gcmind,nlraf,ncompdiff,nlayer,FacMass,ig) 579 580 CALL RHOTOT(pp,tt,massemoy,qnew,RHOT,RHOK,nlayer,ncompdiff) 577 581 578 582 if (ig .eq. ij0) then 579 do l=il0,nlayer mx583 do l=il0,nlayer 580 584 write(*,'(i2,1x,19(e12.4,1x))') l,zz(l),tt(l),RHOK(l,1)/sum(RHOK(l,:)),RHOKINIT(l,1)/sum(RHOKINIT(l,:)),& 581 585 & RHOK(l,2)/sum(RHOK(l,:)),RHOKINIT(l,2)/sum(RHOKINIT(l,:)),& … … 590 594 Mtot2(1:ncompdiff)=0d0 591 595 592 do l=il0,nlayer mx596 do l=il0,nlayer 593 597 do nn=1,ncompdiff 594 598 Mtot2(nn)=Mtot2(nn)+1d0/g*qnew(l,nn)* & … … 600 604 601 605 ! do nn=1,ncompdiff 602 ! CALL CheckMass2(qq,qnew,pplev(ig,:),il0,nlayer mx,nn,ncompdiff)606 ! CALL CheckMass2(qq,qnew,pplev(ig,:),il0,nlayer,nn,ncompdiff) 603 607 ! enddo 604 608 605 609 ! Compute the diffusion trends du to diffusion 606 610 607 do l=1,nlayer mx611 do l=1,nlayer 608 612 do nn=1,ncompdiff 609 613 pdqdiff(ig,l,gcmind(nn))=(qnew(l,nn)-qq(l,nn))/ptimestep -
trunk/LMDZ.MARS/libf/aeronomars/moldiffcoeff.F
r1036 r1047 19 19 #include "dimphys.h" 20 20 #include "callkeys.h" 21 #include "comdiurn.h"21 !#include "comdiurn.h" 22 22 #include "chimiedata.h" 23 23 !#include "tracer.h" 24 #include "conc.h"24 !#include "conc.h" 25 25 26 26 c----------------------------------------------------------------------- -
trunk/LMDZ.MARS/libf/aeronomars/moldiffcoeff_red.F
r1036 r1047 15 15 #include "dimphys.h" 16 16 #include "callkeys.h" 17 #include "comdiurn.h"17 !#include "comdiurn.h" 18 18 #include "chimiedata.h" 19 19 !#include "tracer.h" 20 #include "conc.h"20 !#include "conc.h" 21 21 #include "diffusion.h" 22 22 -
trunk/LMDZ.MARS/libf/aeronomars/molvis.F
r690 r1047 1 SUBROUTINE molvis(ptimestep,pplay,pplev,pt,pdteuv,pdtconduc 1 SUBROUTINE molvis(ngrid,nlayer,ptimestep, 2 & pplay,pplev,pt,pdteuv,pdtconduc 2 3 $ ,pvel,tsurf,zzlev,zzlay,zdvelmolvis) 4 5 use conc_mod, only: cpnew, Akknew, rnew 3 6 IMPLICIT NONE 4 7 … … 17 20 c----------------------------------------------------------------------- 18 21 19 #include "dimensions.h"20 #include "dimphys.h"21 #include "comcstfi.h"22 #include "surfdat.h"23 #include "chimiedata.h"24 #include "conc.h"22 !#include "dimensions.h" 23 !#include "dimphys.h" 24 !#include "comcstfi.h" 25 !#include "surfdat.h" 26 !#include "chimiedata.h" 27 !#include "conc.h" 25 28 26 29 c arguments: 27 30 c ---------- 28 31 32 integer,intent(in) :: ngrid ! number of atmospheric columns 33 integer,intent(in) :: nlayer ! number of atmospheric layers 29 34 REAL ptimestep 30 REAL pplay(ngrid mx,nlayermx)31 REAL pplev(ngrid mx,nlayermx+1)32 REAL zzlay(ngrid mx,nlayermx)33 REAL zzlev(ngrid mx,nlayermx+1)34 real pt(ngrid mx,nlayermx)35 real tsurf(ngrid mx)36 REAL pvel(ngrid mx,nlayermx)37 REAL pdvel(ngrid mx,nlayermx)38 real pdteuv(ngrid mx,nlayermx)39 real pdtconduc(ngrid mx,nlayermx)35 REAL pplay(ngrid,nlayer) 36 REAL pplev(ngrid,nlayer+1) 37 REAL zzlay(ngrid,nlayer) 38 REAL zzlev(ngrid,nlayer+1) 39 real pt(ngrid,nlayer) 40 real tsurf(ngrid) 41 REAL pvel(ngrid,nlayer) 42 REAL pdvel(ngrid,nlayer) 43 real pdteuv(ngrid,nlayer) 44 real pdtconduc(ngrid,nlayer) 40 45 41 real zdvelmolvis(ngrid mx,nlayermx)46 real zdvelmolvis(ngrid,nlayer) 42 47 43 48 c local: 44 49 c ------ 45 50 46 INTEGER l,ig, n grid,nz47 real Akk, skk,phitop,velsurf,fac, m, tmean48 REAL zvel(nlayer mx)49 real zt(nlayer mx)50 REAL alpha(nlayer mx)51 REAL lambda(nlayer mx)52 real muvol(nlayer mx)53 REAL C(nlayer mx)54 real D(nlayer mx)55 real den(nlayer mx)56 REAL pdvelm(nlayer mx)57 REAL zlay(nlayer mx)58 real zlev(nlayer mx+1)51 INTEGER l,ig, nz 52 real Akk,phitop,fac, m, tmean 53 REAL zvel(nlayer) 54 real zt(nlayer) 55 REAL alpha(nlayer) 56 REAL lambda(nlayer) 57 real muvol(nlayer) 58 REAL C(nlayer) 59 real D(nlayer) 60 real den(nlayer) 61 REAL pdvelm(nlayer) 62 REAL zlay(nlayer) 63 real zlev(nlayer+1) 59 64 60 65 c constants used locally … … 67 72 68 73 69 PARAMETER (skk=0.69)74 REAL,PARAMETER :: skk=0.69 70 75 71 PARAMETER (velsurf =0.0)76 REAL,PARAMETER :: velsurf =0.0 72 77 73 logical firstcall 74 save firstcall 75 data firstcall /.true./ 78 logical,save :: firstcall=.true. 79 76 80 c----------------------------------------------------------------------- 77 81 c calcul des coefficients alpha et lambda … … 90 94 phitop=0.0 91 95 92 ngrid=ngridmx 93 nz=nlayermx 96 nz=nlayer 94 97 95 98 do ig=1,ngrid -
trunk/LMDZ.MARS/libf/aeronomars/perosat.F
r1036 r1047 1 SUBROUTINE perosat( ig, ptimestep,1 SUBROUTINE perosat(ngrid,nlayer,nq,ig, ptimestep, 2 2 $ pplev, pplay, zt, 3 3 & zy, pdqcloud, pdqscloud) 4 use tracer_mod, only: nqmx, igcm_h2o2, mmol 4 5 use tracer_mod, only: igcm_h2o2, mmol 6 use conc_mod, only: mmean 5 7 IMPLICIT NONE 6 8 … … 22 24 c ------------- 23 25 24 #include "dimensions.h"25 #include "dimphys.h"26 !#include "dimensions.h" 27 !#include "dimphys.h" 26 28 #include "comcstfi.h" 27 #include "chimiedata.h"29 !#include "chimiedata.h" 28 30 !#include "tracer.h" 29 #include "conc.h"31 !#include "conc.h" 30 32 c 31 33 c arguments: 32 34 c ---------- 33 35 36 integer,intent(in) :: ngrid ! number of atmospheric columns 37 integer,intent(in) :: nlayer ! number of atmospheric layers 38 integer,intent(in) :: nq ! number of tracers 34 39 INTEGER ig 35 40 REAL ptimestep ! pas de temps physique (s) 36 REAL pplev(ngrid mx,nlayermx+1)! pression aux inter-couches (Pa)37 REAL pplay(ngrid mx,nlayermx)! pression au milieu des couches (Pa)38 REAL zt(nlayer mx)! temperature au centre des couches (K)41 REAL pplev(ngrid,nlayer+1) ! pression aux inter-couches (Pa) 42 REAL pplay(ngrid,nlayer) ! pression au milieu des couches (Pa) 43 REAL zt(nlayer) ! temperature au centre des couches (K) 39 44 ! deja mise a jour dans calchim 40 45 41 46 c Traceurs : 42 real zy(nlayer mx,nqmx) ! traceur (fraction molaire sortie chimie)43 real pdqcloud(ngrid mx,nlayermx,nqmx) ! tendance condensation (kg/kg.s-1)44 real pdqscloud(ngrid mx,nqmx) ! flux en surface (kg.m-2.s-1)47 real zy(nlayer,nq) ! traceur (fraction molaire sortie chimie) 48 real pdqcloud(ngrid,nlayer,nq) ! tendance condensation (kg/kg.s-1) 49 real pdqscloud(ngrid,nq) ! flux en surface (kg.m-2.s-1) 45 50 46 51 c local: … … 49 54 INTEGER l,iq 50 55 51 REAL zysat(nlayer mx)52 REAL zynew(nlayer mx)! mole fraction after condensation56 REAL zysat(nlayer) 57 REAL zynew(nlayer) ! mole fraction after condensation 53 58 REAL psat_hg ! pression saturante (mm Hg) 54 59 REAL psat_hpa ! pression saturante (hPa) … … 57 62 c Pour diagnostique : 58 63 c ~~~~~~~~~~~~~~~~~ 59 REAL taucond(ngrid mx,nlayermx) ! taux de condensation (kg/kg/s-1)64 REAL taucond(ngrid,nlayer) ! taux de condensation (kg/kg/s-1) 60 65 61 66 c----------------------------------------------------------------------- … … 80 85 c domaine d'application: T < 220 K 81 86 c 82 do l = 1,nlayer mx87 do l = 1,nlayer 83 88 84 89 c print *,'ig=',ig,' l=',l,' igcm_h2o2=',igcm_h2o2 … … 103 108 c (Pour diagnostic seulement !) 104 109 c 105 do l=1, nlayer mx110 do l=1, nlayer 106 111 taucond(ig,l)=max((zy(l,igcm_h2o2)-zysat(l))*mmol(igcm_h2o2) 107 112 $ /(mmean(ig,l)*ptimestep),0.) … … 111 116 c ~~~~~~~~~~~~~~~~~~~~~~~~~~ 112 117 c 113 do l=nlayer mx,2, -1118 do l=nlayer,2, -1 114 119 if (zynew(l).gt.zysat(l)) then 115 120 zynew(l-1) = zynew(l-1) + (zynew(l) - zysat(l)) … … 135 140 c ~~~~~~~~~~~~~~~ 136 141 c 137 do l=1, nlayer mx142 do l=1, nlayer 138 143 pdqcloud(ig,l,igcm_h2o2)=(zynew(l) - zy(l,igcm_h2o2)) 139 144 & *mmol(igcm_h2o2)/(mmean(ig,l)*ptimestep) -
trunk/LMDZ.MARS/libf/aeronomars/surfacearea.F
r1036 r1047 7 7 use tracer_mod, only: nuice_sed, igcm_dust_number, 8 8 & igcm_ccn_number, varian, ccn_factor 9 use conc_mod, only: rnew 9 10 implicit none 10 11 … … 18 19 19 20 #include "dimensions.h" 20 #include "dimphys.h"21 !#include "dimphys.h" 21 22 #include "comcstfi.h" 22 23 #include "callkeys.h" 23 24 !#include "tracer.h" 24 #include "dimradmars.h" 25 !#include "dimradmars.h" 26 ! naerkind is set in scatterers.h (built when compiling with makegcm -s #) 27 #include"scatterers.h" 25 28 #include "chimiedata.h" 26 #include "conc.h"29 !#include "conc.h" 27 30 28 31 ! input -
trunk/LMDZ.MARS/libf/aeronomars/thermosphere.F
r1036 r1047 1 subroutine thermosphere(pplev,pplay,dist_sol, 1 subroutine thermosphere(ngrid,nlayer,nq, 2 & pplev,pplay,dist_sol, 2 3 $ mu0,ptimestep,ptime,zday,tsurf,zzlev,zzlay, 3 4 & pt,pq,pu,pv,pdt,pdq, 4 5 $ zdteuv,zdtconduc,zdumolvis,zdvmolvis,zdqmoldiff) 5 6 6 use tracer_mod, only: nqmx ! number of advecter tracers7 use conc_mod, only: rnew, cpnew 7 8 implicit none 8 9 9 #include "dimensions.h"10 #include "dimphys.h"10 !#include "dimensions.h" 11 !#include "dimphys.h" 11 12 #include "comcstfi.h" 12 13 #include "callkeys.h" 13 #include "comdiurn.h"14 #include "param.h"15 #include "param_v4.h"16 #include "chimiedata.h"17 #include "conc.h"14 !#include "comdiurn.h" 15 !#include "param.h" 16 !#include "param_v4.h" 17 !#include "chimiedata.h" 18 !#include "conc.h" 18 19 19 20 20 INTEGER l,ig 21 22 REAL pplay(ngridmx,nlayermx) 23 real pplev(ngridmx,nlayermx+1) 24 REAL zzlay(ngridmx,nlayermx) 25 real zzlev(ngridmx,nlayermx+1) 26 REAL pt(ngridmx,nlayermx) 21 integer,intent(in) :: ngrid ! number of atmospheric columns 22 integer,intent(in) :: nlayer ! number of atmospheric layers 23 integer,intent(in) :: nq ! number of advected tracers 24 REAL pplay(ngrid,nlayer) 25 real pplev(ngrid,nlayer+1) 26 REAL zzlay(ngrid,nlayer) 27 real zzlev(ngrid,nlayer+1) 28 REAL pt(ngrid,nlayer) 27 29 real zday 28 30 REAL dist_sol 29 real mu0(ngrid mx)30 real pq(ngrid mx,nlayermx,nqmx)31 real mu0(ngrid) 32 real pq(ngrid,nlayer,nq) 31 33 real ptimestep 32 34 real ptime 33 real tsurf(ngrid mx)34 REAL pu(ngrid mx,nlayermx),pv(ngridmx,nlayermx)35 REAL pdt(ngrid mx,nlayermx),pdq(ngridmx,nlayermx,nqmx)35 real tsurf(ngrid) 36 REAL pu(ngrid,nlayer),pv(ngrid,nlayer) 37 REAL pdt(ngrid,nlayer),pdq(ngrid,nlayer,nq) 36 38 37 REAL zdteuv(ngrid mx,nlayermx)38 REAL zdtconduc(ngrid mx,nlayermx)39 REAL zdumolvis(ngrid mx,nlayermx)40 REAL zdvmolvis(ngrid mx,nlayermx)41 real zdqmoldiff(ngrid mx,nlayermx,nqmx)39 REAL zdteuv(ngrid,nlayer) 40 REAL zdtconduc(ngrid,nlayer) 41 REAL zdumolvis(ngrid,nlayer) 42 REAL zdvmolvis(ngrid,nlayer) 43 real zdqmoldiff(ngrid,nlayer,nq) 42 44 43 logical firstcall 44 save firstcall 45 data firstcall /.true./ 45 INTEGER l,ig 46 logical,save :: firstcall=.true. 46 47 47 48 if (firstcall) then 48 49 if (.not. tracer) then 49 do l=1,nlayer mx50 do ig=1,ngrid mx50 do l=1,nlayer 51 do ig=1,ngrid 51 52 rnew(ig,l)=r 52 53 cpnew(ig,l)=cpp … … 58 59 59 60 if (calleuv) then 60 call zerophys(ngridmx*nlayermx,zdteuv)61 call euvheat( pt,pdt,pplev,pplay,zzlay,61 zdteuv(1:ngrid,1:nlayer)=0 62 call euvheat(ngrid,nlayer,nq,pt,pdt,pplev,pplay,zzlay, 62 63 $ mu0,ptimestep,ptime,zday,pq,pdq,zdteuv) 63 64 endif 64 65 65 66 if (callconduct) THEN 66 call zerophys(ngridmx*nlayermx,zdtconduc)67 call conduction( ptimestep,pplay,pplev,pt,zdteuv,67 zdtconduc(1:ngrid,1:nlayer)=0 68 call conduction(ngrid,nlayer,ptimestep,pplay,pplev,pt,zdteuv, 68 69 $ tsurf,zzlev,zzlay,zdtconduc) 69 70 endif 70 71 71 72 if (callmolvis) THEN 72 call zerophys(ngridmx*nlayermx,zdumolvis) 73 call molvis(ptimestep,pplay,pplev,pt,zdteuv,zdtconduc,pu, 73 zdumolvis(1:ngrid,1:nlayer)=0 74 call molvis(ngrid,nlayer,ptimestep,pplay,pplev,pt, 75 & zdteuv,zdtconduc,pu, 74 76 $ tsurf,zzlev,zzlay,zdumolvis) 75 call zerophys(ngridmx*nlayermx,zdvmolvis) 76 call molvis(ptimestep,pplay,pplev,pt,zdteuv,zdtconduc,pv, 77 zdvmolvis(1:ngrid,1:nlayer)=0 78 call molvis(ngrid,nlayer,ptimestep,pplay,pplev,pt, 79 & zdteuv,zdtconduc,pv, 77 80 $ tsurf,zzlev,zzlay,zdvmolvis) 78 81 endif 79 82 80 83 if (callmoldiff) THEN 81 call zerophys(ngridmx*nlayermx*nqmx,zdqmoldiff) 82 call moldiff_red(pplay,pplev,pt,pdt,pq,pdq,ptimestep, 84 zdqmoldiff(1:ngrid,1:nlayer,1:nq)=0 85 call moldiff_red(ngrid,nlayer,nq, 86 & pplay,pplev,pt,pdt,pq,pdq,ptimestep, 83 87 & zzlay,zdteuv,zdtconduc,zdqmoldiff) 84 88 endif -
trunk/LMDZ.MARS/libf/dyn3d/ini_archive.F
r38 r1047 34 34 c======================================================================= 35 35 36 use comsoil_h, only: nsoilmx, mlayer 36 37 implicit none 37 38 … … 48 49 #include "serre.h" 49 50 #include "control.h" 50 #include"comsoil.h"51 !#include"comsoil.h" 51 52 52 53 #include "netcdf.inc" -
trunk/LMDZ.MARS/libf/dyn3d/lect_start_archive.F
r1036 r1047 1 SUBROUTINE lect_start_archive(nqtot,date,tsurf,tsoil,emis,q2, 1 SUBROUTINE lect_start_archive(ngrid,nlayer,nqtot, 2 & date,tsurf,tsoil,emis,q2, 2 3 & t,ucov,vcov,ps,co2ice,h,phisold_newgrid, 3 4 & q,qsurf,surfith,nid) … … 17 18 c======================================================================= 18 19 use infotrac, only: tnom 20 use comsoil_h, only: nsoilmx, layer, mlayer, volcapa, inertiedat 19 21 implicit none 20 22 21 23 #include "dimensions.h" 22 #include "dimphys.h"23 #include "surfdat.h"24 #include "comsoil.h"25 #include "dimradmars.h"26 #include "yomaer.h"24 !#include "dimphys.h" 25 !#include "surfdat.h" 26 !#include "comsoil.h" 27 !#include "dimradmars.h" 28 !#include "yomaer.h" 27 29 #include "planete.h" 28 30 #include "paramet.h" … … 49 51 c et autres: 50 52 c---------- 53 integer,intent(in) :: ngrid ! number of atmospheric columns 54 ! on new physics grid 55 integer,intent(in) :: nlayer ! number of atmospheric layers 56 ! on new grid 51 57 integer,intent(in) :: nqtot ! number of advected tracers 52 58 … … 98 104 c variable physique 99 105 c------------------ 100 REAL tsurf(ngrid mx) ! surface temperature101 REAL tsoil(ngrid mx,nsoilmx) ! soil temperature102 REAL co2ice(ngrid mx) ! CO2 ice layer103 REAL emis(ngrid mx)104 REAL q2(ngrid mx,nlayermx+1),qsurf(ngridmx,nqtot)105 c REAL phisfi(ngrid mx)106 REAL tsurf(ngrid) ! surface temperature 107 REAL tsoil(ngrid,nsoilmx) ! soil temperature 108 REAL co2ice(ngrid) ! CO2 ice layer 109 REAL emis(ngrid) 110 REAL q2(ngrid,nlayer+1),qsurf(ngrid,nqtot) 111 c REAL phisfi(ngrid) 106 112 107 113 INTEGER i,j,l … … 176 182 177 183 real surfith(iip1,jjp1) ! surface thermal inertia 178 ! real surfithfi(ngrid mx)184 ! real surfithfi(ngrid) 179 185 ! surface thermal inertia at old horizontal grid resolution 180 186 real, dimension(:,:), allocatable :: surfithold … … 335 341 allocate(varp1 (imold+1,jmold+1,llm+1)) 336 342 337 write(*,*) 'q2',ngrid mx,nlayermx+1343 write(*,*) 'q2',ngrid,nlayer+1 338 344 write(*,*) 'q2S',iip1,jjp1,llm+1 339 345 write(*,*) 'q2old',imold+1,jmold+1,lmold+1 … … 1000 1006 call interp_horiz (tsurfold,tsurfs,imold,jmold,iim,jjm,1, 1001 1007 & rlonuold,rlatvold,rlonu,rlatv) 1002 call gr_dyn_fi (1,iim+1,jjm+1,ngrid mx,tsurfs,tsurf)1008 call gr_dyn_fi (1,iim+1,jjm+1,ngrid,tsurfs,tsurf) 1003 1009 c write(44,*) 'tsurf', tsurf 1004 1010 … … 1007 1013 ! & imold,jmold,iim,jjm,nsoilmx, 1008 1014 ! & rlonuold,rlatvold,rlonu,rlatv) 1009 ! call gr_dyn_fi (nsoilmx,iim+1,jjm+1,ngrid mx,tsoils,tsoil)1015 ! call gr_dyn_fi (nsoilmx,iim+1,jjm+1,ngrid,tsoils,tsoil) 1010 1016 c write(45,*) 'tsoil',tsoil 1011 1017 … … 1013 1019 call interp_horiz (emisold,emiss,imold,jmold,iim,jjm,1, 1014 1020 & rlonuold,rlatvold,rlonu,rlatv) 1015 call gr_dyn_fi (1,iim+1,jjm+1,ngrid mx,emiss,emis)1021 call gr_dyn_fi (1,iim+1,jjm+1,ngrid,emiss,emis) 1016 1022 c write(46,*) 'emis',emis 1017 1023 c----------------------------------------------------------------------- … … 1130 1136 1131 1137 ! Reshape inertiedatS to scalar grid as inertiedat 1132 call gr_dyn_fi (nsoilmx,iim+1,jjm+1,ngrid mx,1138 call gr_dyn_fi (nsoilmx,iim+1,jjm+1,ngrid, 1133 1139 & inertiedatS,inertiedat) 1134 1140 … … 1203 1209 1204 1210 ! Reshape tsoilS to scalar grid as tsoil 1205 call gr_dyn_fi (nsoilmx,iim+1,jjm+1,ngrid mx,tsoilS,tsoil)1211 call gr_dyn_fi (nsoilmx,iim+1,jjm+1,ngrid,tsoilS,tsoil) 1206 1212 1207 1213 … … 1229 1235 & rlonuold,rlatvold,rlonu,rlatv) 1230 1236 write (*,*) 'lect_start_archive: q2s ', q2s (1,2,1) ! INFO 1231 call gr_dyn_fi (llm+1,iim+1,jjm+1,ngrid mx,q2s,q2)1237 call gr_dyn_fi (llm+1,iim+1,jjm+1,ngrid,q2s,q2) 1232 1238 write (*,*) 'lect_start_archive: q2 ', q2 (1,2) ! INFO 1233 1239 c write(47,*) 'q2',q2 … … 1278 1284 enddo 1279 1285 1280 call gr_dyn_fi (nqtot,iim+1,jjm+1,ngrid mx,qsurfs,qsurf)1286 call gr_dyn_fi (nqtot,iim+1,jjm+1,ngrid,qsurfs,qsurf) 1281 1287 1282 1288 c traceurs 3D … … 1329 1335 enddo 1330 1336 1331 call gr_dyn_fi (1,iim+1,jjm+1,ngrid mx,co2ices,co2ice)1337 call gr_dyn_fi (1,iim+1,jjm+1,ngrid,co2ices,co2ice) 1332 1338 1333 1339 c----------------------------------------------------------------------- -
trunk/LMDZ.MARS/libf/dyn3d/newstart.F
r1036 r1047 19 19 use infotrac, only: iniadvtrac, nqtot, tnom 20 20 use tracer_mod, only: noms, igcm_h2o_vap, igcm_h2o_ice 21 use surfdat_h, only: phisfi, z0, zmea, zstd, zsig, zgam, zthe, 22 & albedodat, z0_default 23 use comsoil_h, only: inertiedat, layer, mlayer, nsoilmx 21 24 implicit none 22 25 23 26 #include "dimensions.h" 27 integer, parameter :: ngridmx = (2+(jjm-1)*iim - 1/jjm) 24 28 #include "dimphys.h" 25 #include "surfdat.h"26 #include "comsoil.h"27 #include "dimradmars.h"28 #include "yomaer.h"29 !#include "surfdat.h" 30 !#include "comsoil.h" 31 !#include "dimradmars.h" 32 !#include "yomaer.h" 29 33 #include "planete.h" 30 34 #include "paramet.h" … … 404 408 405 409 write(*,*) 'Reading file START_ARCHIVE' 406 CALL lect_start_archive(nqtot,date,tsurf,tsoil,emis,q2, 407 . t,ucov,vcov,ps,co2ice,teta,phisold_newgrid,q,qsurf, 410 CALL lect_start_archive(ngridmx,llm,nqtot, 411 & date,tsurf,tsoil,emis,q2, 412 & t,ucov,vcov,ps,co2ice,teta,phisold_newgrid,q,qsurf, 408 413 & surfith,nid) 409 414 write(*,*) "OK, read start_archive file" … … 425 430 write(*,*) 'Reading file STARTFI' 426 431 fichnom = 'startfi.nc' 427 CALL phyetat0 (fichnom,tab0,Lmodif,nsoilmx,n qtot,432 CALL phyetat0 (fichnom,tab0,Lmodif,nsoilmx,ngridmx,llm,nqtot, 428 433 . day_ini,time, 429 434 . tsurf,tsoil,emis,q2,qsurf,co2ice) … … 858 863 endif 859 864 860 call inichim_newstart(nq, q, qsurf, ps, flagh2o, flagthermo) 865 call inichim_newstart(ngridmx, nq, q, qsurf, ps, 866 & flagh2o, flagthermo) 861 867 862 868 ! We want to have the very same value at lon -180 and lon 180 … … 1472 1478 C 1473 1479 1474 call physdem0("restartfi.nc",lonfi,latfi,nsoilmx,n qtot,1475 . dtphys,real(day_ini),0.0,1480 call physdem0("restartfi.nc",lonfi,latfi,nsoilmx,ngridmx,llm, 1481 . nqtot,dtphys,real(day_ini),0.0, 1476 1482 . airefi,albfi,ithfi,zmea,zstd,zsig,zgam,zthe) 1477 call physdem1("restartfi.nc",nsoilmx,n qtot,1483 call physdem1("restartfi.nc",nsoilmx,ngridmx,llm,nqtot, 1478 1484 . dtphys,hour_ini, 1479 1485 . tsurf,tsoil,co2ice,emis,q2,qsurf) -
trunk/LMDZ.MARS/libf/dyn3d/start2archive.F
r1036 r1047 20 20 21 21 use infotrac, only: iniadvtrac, nqtot, tnom 22 use comsoil_h, only: nsoilmx, inertiedat 23 use surfdat_h, only: ini_surfdat_h 24 use comsoil_h, only: ini_comsoil_h 22 25 implicit none 23 26 24 27 #include "dimensions.h" 28 integer, parameter :: ngridmx = (2+(jjm-1)*iim - 1/jjm) 25 29 #include "paramet.h" 26 30 #include "comconst.h" … … 34 38 #include "description.h" 35 39 36 #include "dimphys.h"37 #include "comsoil.h"40 !#include "dimphys.h" 41 !#include "comsoil.h" 38 42 !#include"advtrac.h" 39 43 #include "netcdf.inc" … … 62 66 REAL tsoil(ngridmx,nsoilmx) ! Soil temperature 63 67 REAL co2ice(ngridmx) ! CO2 ice layer 64 REAL q2(ngridmx, nlayermx+1)68 REAL q2(ngridmx,llm+1) 65 69 REAL,ALLOCATABLE :: qsurf(:,:) 66 70 REAL emis(ngridmx) … … 126 130 allocate(qsurf(ngridmx,nqtot)) 127 131 allocate(qsurfS(ip1jmp1,nqtot)) 132 call ini_surfdat_h(ngridmx) 133 call ini_comsoil_h(ngridmx) 134 128 135 129 136 fichnom = 'start.nc' … … 135 142 Lmodif=0 136 143 137 CALL phyetat0 (fichnom,0,Lmodif,nsoilmx,n qtot,day_ini_fi,timefi,138 .tsurf,tsoil,emis,q2,qsurf,co2ice)144 CALL phyetat0 (fichnom,0,Lmodif,nsoilmx,ngridmx,llm,nqtot, 145 & day_ini_fi,timefi,tsurf,tsoil,emis,q2,qsurf,co2ice) 139 146 140 147 ierr = NF_OPEN (fichnom, NF_NOWRITE,nid1) -
trunk/LMDZ.MARS/libf/dyn3d/write_archive.F
r38 r1047 32 32 c======================================================================= 33 33 34 use comsoil_h, only: nsoilmx 34 35 implicit none 35 36 -
trunk/LMDZ.MARS/libf/phymars/aerkind.h
r38 r1047 4 4 !------------------------------------------------------------------ 5 5 6 ! Don't forget to set up the right number of scatterer 7 ! (naerkind) in dimradmars.h! 6 ! Don't forget that naerkind is set in scatterers.h 7 ! (built when compiling with makegcm -s #) 8 8 9 character*20 name_iaer(naerkind) ! name of the scatterers 9 10 ! Scatterer: DUST -
trunk/LMDZ.MARS/libf/phymars/aeropacity.F
r1036 r1047 7 7 use tracer_mod, only: noms, igcm_h2o_ice, igcm_dust_mass, 8 8 & igcm_dust_submicron, rho_dust, rho_ice 9 use comgeomfi_h, only: lati ! grid point latitudes (rad) 10 use yomaer_h, only: tauvis 9 11 IMPLICIT NONE 10 12 c======================================================================= … … 34 36 c pq Dust mixing ratio (used if tracer =T and active=T). 35 37 c reffrad(ngrid,nlayer,naerkind) Aerosol effective radius 36 c QREFvis3d(ngrid mx,nlayermx,naerkind) \ 3d extinction coefficients37 c QREFir3d(ngrid mx,nlayermx,naerkind) / at reference wavelengths;38 c omegaREFvis3d(ngrid mx,nlayermx,naerkind) \ 3d single scat. albedo39 c omegaREFir3d(ngrid mx,nlayermx,naerkind) / at reference wavelengths;38 c QREFvis3d(ngrid,nlayer,naerkind) \ 3d extinction coefficients 39 c QREFir3d(ngrid,nlayer,naerkind) / at reference wavelengths; 40 c omegaREFvis3d(ngrid,nlayer,naerkind) \ 3d single scat. albedo 41 c omegaREFir3d(ngrid,nlayer,naerkind) / at reference wavelengths; 40 42 c 41 43 c output: … … 48 50 c 49 51 c======================================================================= 50 #include "dimensions.h"51 #include "dimphys.h"52 !#include "dimensions.h" 53 !#include "dimphys.h" 52 54 #include "callkeys.h" 53 55 #include "comcstfi.h" 54 #include "comgeomfi.h"55 #include "dimradmars.h"56 #include "yomaer.h"56 !#include "comgeomfi.h" 57 !#include "dimradmars.h" 58 !#include "yomaer.h" 57 59 !#include "tracer.h" 60 ! naerkind is set in scatterers.h (built when compiling with makegcm -s #) 61 #include"scatterers.h" 58 62 #include "planete.h" 59 63 #include "aerkind.h" … … 73 77 REAL tauref(ngrid), tau(ngrid,naerkind) 74 78 REAL aerosol(ngrid,nlayer,naerkind) 75 REAL dsodust(ngrid mx,nlayermx)79 REAL dsodust(ngrid,nlayer) 76 80 REAL reffrad(ngrid,nlayer,naerkind) 77 81 REAL nueffrad(ngrid,nlayer,naerkind) 78 REAL QREFvis3d(ngrid mx,nlayermx,naerkind)79 REAL QREFir3d(ngrid mx,nlayermx,naerkind)80 REAL omegaREFvis3d(ngrid mx,nlayermx,naerkind)81 REAL omegaREFir3d(ngrid mx,nlayermx,naerkind)82 REAL QREFvis3d(ngrid,nlayer,naerkind) 83 REAL QREFir3d(ngrid,nlayer,naerkind) 84 REAL omegaREFvis3d(ngrid,nlayer,naerkind) 85 REAL omegaREFir3d(ngrid,nlayer,naerkind) 82 86 c 83 87 c Local variables : … … 85 89 INTEGER l,ig,iq,i,j 86 90 INTEGER iaer ! Aerosol index 87 real topdust(ngrid mx)91 real topdust(ngrid) 88 92 real zlsconst, zp 89 93 real taueq,tauS,tauN 90 94 c Mean Qext(vis)/Qext(ir) profile 91 real msolsir(nlayer mx,naerkind)95 real msolsir(nlayer,naerkind) 92 96 c Mean Qext(ir)/Qabs(ir) profile 93 real mqextsqabs(nlayer mx,naerkind)97 real mqextsqabs(nlayer,naerkind) 94 98 c Variables used when multiple particle sizes are used 95 99 c for dust or water ice particles in the radiative transfer 96 100 c (see callradite.F for more information). 97 REAL taudusttmp(ngrid mx)! Temporary dust opacity101 REAL taudusttmp(ngrid)! Temporary dust opacity 98 102 ! used before scaling 99 REAL tauscaling(ngrid mx) ! Scaling factor for qdust and Ndust100 REAL taudustvis(ngrid mx) ! Dust opacity after scaling101 REAL taudusttes(ngrid mx) ! Dust opacity at IR ref. wav. as103 REAL tauscaling(ngrid) ! Scaling factor for qdust and Ndust 104 REAL taudustvis(ngrid) ! Dust opacity after scaling 105 REAL taudusttes(ngrid) ! Dust opacity at IR ref. wav. as 102 106 ! "seen" by the GCM. 103 REAL taucloudvis(ngrid mx)! Cloud opacity at visible107 REAL taucloudvis(ngrid)! Cloud opacity at visible 104 108 ! reference wavelength 105 REAL taucloudtes(ngrid mx)! Cloud opacity at infrared109 REAL taucloudtes(ngrid)! Cloud opacity at infrared 106 110 ! reference wavelength using 107 111 ! Qabs instead of Qext … … 111 115 c --------------------- 112 116 113 REAL topdust0(ngridmx)114 SAVE topdust0 117 REAL,SAVE,ALLOCATABLE :: topdust0(:) 118 115 119 c Level under which the dust mixing ratio is held constant 116 120 c when computing the dust opacity in each layer … … 135 139 136 140 IF (firstcall) THEN 141 ! allocate local saved arrays 142 allocate(nqdust(nq)) 143 allocate(topdust0(ngrid)) 144 137 145 ! identify scatterers that are dust 138 146 naerdust=0 … … 145 153 ENDDO 146 154 ! identify tracers which are dust 147 allocate(nqdust(nq))148 155 i=0 149 156 DO iq=1,nq … … 174 181 WRITE(*,*) "Aerosol # ",iaer 175 182 DO l=1,nlayer 176 DO ig=1,ngrid mx183 DO ig=1,ngrid 177 184 msolsir(l,iaer)=msolsir(l,iaer)+ 178 185 & QREFvis3d(ig,l,iaer)/ … … 181 188 & (1.E0-omegaREFir3d(ig,l,iaer))**(-1) 182 189 ENDDO 183 msolsir(l,iaer)=msolsir(l,iaer)/REAL(ngrid mx)184 mqextsqabs(l,iaer)=mqextsqabs(l,iaer)/REAL(ngrid mx)190 msolsir(l,iaer)=msolsir(l,iaer)/REAL(ngrid) 191 mqextsqabs(l,iaer)=mqextsqabs(l,iaer)/REAL(ngrid) 185 192 ENDDO 186 193 WRITE(*,*) "solsir: ",msolsir(:,iaer) … … 199 206 c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 200 207 IF(iaervar.eq.1) THEN 201 do ig=1, ngrid mx208 do ig=1, ngrid 202 209 tauref(ig)=max(tauvis,1.e-9) ! tauvis=cste (set in callphys.def 203 210 ! or read in starfi … … 220 227 c taueq= 0.2 +(0.5-0.2) *(cos(0.5*(ls+pi-4.363)))**14 221 228 c endif 222 do ig=1,ngrid/2 ! Northern hemisphere 223 tauref(ig)= tauN + 224 & (taueq-tauN)*0.5*(1+tanh((45-lati(ig)*180./pi)*6/60)) 225 end do 226 do ig=ngrid/2+1, ngridmx ! Southern hemisphere 227 tauref(ig)= tauS + 228 & (taueq-tauS)*0.5*(1+tanh((45+lati(ig)*180./pi)*6/60)) 229 end do 229 do ig=1,ngrid 230 if (lati(ig).ge.0) then 231 ! Northern hemisphere 232 tauref(ig)= tauN + 233 & (taueq-tauN)*0.5*(1+tanh((45-lati(ig)*180./pi)*6/60)) 234 else 235 ! Southern hemisphere 236 tauref(ig)= tauS + 237 & (taueq-tauS)*0.5*(1+tanh((45+lati(ig)*180./pi)*6/60)) 238 endif 239 enddo ! of do ig=1,ngrid 230 240 ELSE IF (iaervar.eq.5) THEN ! << Escalier Scenario>> 231 241 c tauref(1) = 0.2 … … 397 407 c 3. Outputs -- Now done in physiq.F 398 408 ! IF (ngrid.NE.1) THEN 399 ! CALL WRITEDIAGFI(ngrid mx,'tauVIS','tauext VIS refwvl',409 ! CALL WRITEDIAGFI(ngrid,'tauVIS','tauext VIS refwvl', 400 410 ! & ' ',2,taucloudvis) 401 ! CALL WRITEDIAGFI(ngrid mx,'tauTES','tauabs IR refwvl',411 ! CALL WRITEDIAGFI(ngrid,'tauTES','tauabs IR refwvl', 402 412 ! & ' ',2,taucloudtes) 403 413 ! IF (callstats) THEN 404 ! CALL wstats(ngrid mx,'tauVIS','tauext VIS refwvl',414 ! CALL wstats(ngrid,'tauVIS','tauext VIS refwvl', 405 415 ! & ' ',2,taucloudvis) 406 ! CALL wstats(ngrid mx,'tauTES','tauabs IR refwvl',416 ! CALL wstats(ngrid,'tauTES','tauabs IR refwvl', 407 417 ! & ' ',2,taucloudtes) 408 418 ! ENDIF … … 452 462 c output for debug 453 463 c IF (ngrid.NE.1) THEN 454 c CALL WRITEDIAGFI(ngrid mx,'taudusttmp','virtual tau dust',464 c CALL WRITEDIAGFI(ngrid,'taudusttmp','virtual tau dust', 455 465 c & '#',2,taudusttmp) 456 c CALL WRITEDIAGFI(ngrid mx,'tausca','tauscaling',466 c CALL WRITEDIAGFI(ngrid,'tausca','tauscaling', 457 467 c & '#',2,tauscaling) 458 468 c ELSE 459 c CALL WRITEDIAGFI(ngrid mx,'taudusttmp','virtual tau dust',469 c CALL WRITEDIAGFI(ngrid,'taudusttmp','virtual tau dust', 460 470 c & '#',0,taudusttmp) 461 c CALL WRITEDIAGFI(ngrid mx,'tausca','tauscaling',471 c CALL WRITEDIAGFI(ngrid,'tausca','tauscaling', 462 472 c & '#',0,tauscaling) 463 473 c ENDIF … … 477 487 c dsodust(1:ngrid,1:nlayer) = 0. 478 488 c DO iaer=1,naerdust 479 c DO l=1,nlayer mx489 c DO l=1,nlayer 480 490 c DO ig=1,ngrid 481 491 c dsodust(ig,l) = dsodust(ig,l) + … … 486 496 c IF (ngrid.NE.1) THEN 487 497 c write(txt2,'(i1.1)') iaer 488 c call WRITEDIAGFI(ngrid mx,'taudust'//txt2,498 c call WRITEDIAGFI(ngrid,'taudust'//txt2, 489 499 c & 'Dust col opacity', 490 500 c & ' ',2,tau(1,iaerdust(iaer))) 491 501 c IF (callstats) THEN 492 c CALL wstats(ngrid mx,'taudust'//txt2,502 c CALL wstats(ngrid,'taudust'//txt2, 493 503 c & 'Dust col opacity', 494 504 c & ' ',2,tau(1,iaerdust(iaer))) … … 498 508 499 509 c IF (ngrid.NE.1) THEN 500 c CALL WRITEDIAGFI(ngrid mx,'dsodust','tau*g/dp',510 c CALL WRITEDIAGFI(ngrid,'dsodust','tau*g/dp', 501 511 c & 'm2.kg-1',3,dsodust) 502 512 c IF (callstats) THEN 503 c CALL wstats(ngrid mx,'dsodust',513 c CALL wstats(ngrid,'dsodust', 504 514 c & 'tau*g/dp', 505 515 c & 'm2.kg-1',3,dsodust) -
trunk/LMDZ.MARS/libf/phymars/aeroptproperties.F
r784 r1047 4 4 & QREFvis3d,QREFir3d, 5 5 & omegaREFvis3d,omegaREFir3d) 6 use dimradmars_mod, only: nir, nsun 7 use yomaer_h, only: radiustab, nsize, QVISsQREF, omegavis, gvis, 8 & QIRsQREF, omegaIR, gIR, QREFvis, QREFir, 9 & omegaREFvis, omegaREFir 6 10 IMPLICIT NONE 7 11 c ============================================================= … … 26 30 #include "dimphys.h" 27 31 #include "callkeys.h" 28 #include "dimradmars.h" 29 #include "yomaer.h" 32 !#include "dimradmars.h" 33 !#include "yomaer.h" 34 ! naerkind is set in scatterers.h (built when compiling with makegcm -s #) 35 #include"scatterers.h" 30 36 31 37 c Local variables … … 49 55 INTEGER :: grid_i,grid_j 50 56 c Intermediate variable 51 REAL :: var_tmp,var3d_tmp(ngrid mx,nlayermx)57 REAL :: var_tmp,var3d_tmp(ngrid,nlayer) 52 58 c Bilinear interpolation factors 53 59 REAL :: kx,ky,k1,k2,k3,k4 … … 87 93 88 94 c Radius axis of the interpolation grid 89 REAL,SAVE :: refftab(refftabsize,naerkind,2)95 REAL,SAVE,ALLOCATABLE :: refftab(:,:,:) 90 96 c Variance axis of the interpolation grid 91 REAL,SAVE :: nuefftab(nuefftabsize,naerkind,2)97 REAL,SAVE,ALLOCATABLE :: nuefftab(:,:,:) 92 98 c Volume ratio of the grid 93 99 REAL,SAVE :: logvratgrid(naerkind,2) … … 96 102 & = .false. 97 103 c Optical properties of the grid (VISIBLE) 98 REAL,SAVE :: qsqrefVISgrid(refftabsize,nuefftabsize,nsun,naerkind)99 REAL,SAVE :: qextVISgrid(refftabsize,nuefftabsize,nsun,naerkind)100 REAL,SAVE :: qscatVISgrid(refftabsize,nuefftabsize,nsun,naerkind)101 REAL,SAVE :: omegVISgrid(refftabsize,nuefftabsize,nsun,naerkind)102 REAL,SAVE :: gVISgrid(refftabsize,nuefftabsize,nsun,naerkind)104 REAL,SAVE,ALLOCATABLE :: qsqrefVISgrid(:,:,:,:) 105 REAL,SAVE,ALLOCATABLE :: qextVISgrid(:,:,:,:) 106 REAL,SAVE,ALLOCATABLE :: qscatVISgrid(:,:,:,:) 107 REAL,SAVE,ALLOCATABLE :: omegVISgrid(:,:,:,:) 108 REAL,SAVE,ALLOCATABLE :: gVISgrid(:,:,:,:) 103 109 c Optical properties of the grid (INFRARED) 104 REAL,SAVE :: qsqrefIRgrid(refftabsize,nuefftabsize,nir,naerkind)105 REAL,SAVE :: qextIRgrid(refftabsize,nuefftabsize,nir,naerkind)106 REAL,SAVE :: qscatIRgrid(refftabsize,nuefftabsize,nir,naerkind)107 REAL,SAVE :: omegIRgrid(refftabsize,nuefftabsize,nir,naerkind)108 REAL,SAVE :: gIRgrid(refftabsize,nuefftabsize,nir,naerkind)110 REAL,SAVE,ALLOCATABLE :: qsqrefIRgrid(:,:,:,:) 111 REAL,SAVE,ALLOCATABLE :: qextIRgrid(:,:,:,:) 112 REAL,SAVE,ALLOCATABLE :: qscatIRgrid(:,:,:,:) 113 REAL,SAVE,ALLOCATABLE :: omegIRgrid(:,:,:,:) 114 REAL,SAVE,ALLOCATABLE :: gIRgrid(:,:,:,:) 109 115 c Optical properties of the grid (REFERENCE WAVELENGTHS) 110 116 REAL,SAVE :: qrefVISgrid(refftabsize,nuefftabsize,naerkind) … … 124 130 REAL,SAVE :: radGAUSb(ngau,naerkind,2) 125 131 126 REAL,SAVE :: qsqrefVISa(nsun,ngau,naerkind)127 REAL,SAVE :: qrefVISa(ngau,naerkind)128 REAL,SAVE :: qsqrefVISb(nsun,ngau,naerkind)129 REAL,SAVE :: qrefVISb(ngau,naerkind)130 REAL,SAVE :: omegVISa(nsun,ngau,naerkind)131 REAL,SAVE :: omegrefVISa(ngau,naerkind)132 REAL,SAVE :: omegVISb(nsun,ngau,naerkind)133 REAL,SAVE :: omegrefVISb(ngau,naerkind)134 REAL,SAVE :: gVISa(nsun,ngau,naerkind)135 REAL,SAVE :: gVISb(nsun,ngau,naerkind)136 137 REAL,SAVE :: qsqrefIRa(nir,ngau,naerkind)138 REAL,SAVE :: qrefIRa(ngau,naerkind)139 REAL,SAVE :: qsqrefIRb(nir,ngau,naerkind)140 REAL,SAVE :: qrefIRb(ngau,naerkind)141 REAL,SAVE :: omegIRa(nir,ngau,naerkind)142 REAL,SAVE :: omegrefIRa(ngau,naerkind)143 REAL,SAVE :: omegIRb(nir,ngau,naerkind)144 REAL,SAVE :: omegrefIRb(ngau,naerkind)145 REAL,SAVE :: gIRa(nir,ngau,naerkind)146 REAL,SAVE :: gIRb(nir,ngau,naerkind)132 REAL,SAVE,ALLOCATABLE :: qsqrefVISa(:,:,:) 133 REAL,SAVE,ALLOCATABLE :: qrefVISa(:,:) 134 REAL,SAVE,ALLOCATABLE :: qsqrefVISb(:,:,:) 135 REAL,SAVE,ALLOCATABLE :: qrefVISb(:,:) 136 REAL,SAVE,ALLOCATABLE :: omegVISa(:,:,:) 137 REAL,SAVE,ALLOCATABLE :: omegrefVISa(:,:) 138 REAL,SAVE,ALLOCATABLE :: omegVISb(:,:,:) 139 REAL,SAVE,ALLOCATABLE :: omegrefVISb(:,:) 140 REAL,SAVE,ALLOCATABLE :: gVISa(:,:,:) 141 REAL,SAVE,ALLOCATABLE :: gVISb(:,:,:) 142 143 REAL,SAVE,ALLOCATABLE :: qsqrefIRa(:,:,:) 144 REAL,SAVE,ALLOCATABLE :: qrefIRa(:,:) 145 REAL,SAVE,ALLOCATABLE :: qsqrefIRb(:,:,:) 146 REAL,SAVE,ALLOCATABLE :: qrefIRb(:,:) 147 REAL,SAVE,ALLOCATABLE :: omegIRa(:,:,:) 148 REAL,SAVE,ALLOCATABLE :: omegrefIRa(:,:) 149 REAL,SAVE,ALLOCATABLE :: omegIRb(:,:,:) 150 REAL,SAVE,ALLOCATABLE :: omegrefIRb(:,:) 151 REAL,SAVE,ALLOCATABLE :: gIRa(:,:,:) 152 REAL,SAVE,ALLOCATABLE :: gIRb(:,:,:) 147 153 148 154 REAL :: radiusm … … 152 158 c ------ 153 159 154 INTEGER :: ngrid,nlayer160 INTEGER,INTENT(IN) :: ngrid,nlayer 155 161 c Aerosol effective radius used for radiative transfer (meter) 156 REAL :: reffrad(ngridmx,nlayermx,naerkind)162 REAL,INTENT(IN) :: reffrad(ngrid,nlayer,naerkind) 157 163 c Aerosol effective variance used for radiative transfer (n.u.) 158 REAL :: nueffrad(ngridmx,nlayermx,naerkind)164 REAL,INTENT(IN) :: nueffrad(ngrid,nlayer,naerkind) 159 165 160 166 c Outputs 161 167 c ------- 162 168 163 REAL :: QVISsQREF3d(ngridmx,nlayermx,nsun,naerkind)164 REAL :: omegaVIS3d(ngridmx,nlayermx,nsun,naerkind)165 REAL :: gVIS3d(ngridmx,nlayermx,nsun,naerkind)166 167 REAL :: QIRsQREF3d(ngridmx,nlayermx,nir,naerkind)168 REAL :: omegaIR3d(ngridmx,nlayermx,nir,naerkind)169 REAL :: gIR3d(ngridmx,nlayermx,nir,naerkind)170 171 REAL :: QREFvis3d(ngridmx,nlayermx,naerkind)172 REAL :: QREFir3d(ngridmx,nlayermx,naerkind)173 174 REAL :: omegaREFvis3d(ngridmx,nlayermx,naerkind)175 REAL :: omegaREFir3d(ngridmx,nlayermx,naerkind)169 REAL,INTENT(OUT) :: QVISsQREF3d(ngrid,nlayer,nsun,naerkind) 170 REAL,INTENT(OUT) :: omegaVIS3d(ngrid,nlayer,nsun,naerkind) 171 REAL,INTENT(OUT) :: gVIS3d(ngrid,nlayer,nsun,naerkind) 172 173 REAL,INTENT(OUT) :: QIRsQREF3d(ngrid,nlayer,nir,naerkind) 174 REAL,INTENT(OUT) :: omegaIR3d(ngrid,nlayer,nir,naerkind) 175 REAL,INTENT(OUT) :: gIR3d(ngrid,nlayer,nir,naerkind) 176 177 REAL,INTENT(OUT) :: QREFvis3d(ngrid,nlayer,naerkind) 178 REAL,INTENT(OUT) :: QREFir3d(ngrid,nlayer,naerkind) 179 180 REAL,INTENT(OUT) :: omegaREFvis3d(ngrid,nlayer,naerkind) 181 REAL,INTENT(OUT) :: omegaREFir3d(ngrid,nlayer,naerkind) 176 182 177 183 c Tests … … 181 187 INTEGER, PARAMETER :: out_iaer = 2 182 188 INTEGER :: out_ndim 183 REAL :: out_qext(ngrid mx,nlayermx)184 REAL :: out_omeg(ngrid mx,nlayermx)185 REAL :: out_g(ngrid mx,nlayermx)189 REAL :: out_qext(ngrid,nlayer) 190 REAL :: out_omeg(ngrid,nlayer) 191 REAL :: out_g(ngrid,nlayer) 186 192 INTEGER :: out_nchannel 187 193 CHARACTER*1 :: out_str … … 190 196 c ----------------------------------------------- 191 197 IF (firstcall) THEN 198 c 0.0 Allocate all local saved arrays: 199 allocate(refftab(refftabsize,naerkind,2)) 200 allocate(nuefftab(nuefftabsize,naerkind,2)) 201 ! Optical properties of the grid (VISIBLE) 202 allocate(qsqrefVISgrid(refftabsize,nuefftabsize,nsun,naerkind)) 203 allocate(qextVISgrid(refftabsize,nuefftabsize,nsun,naerkind)) 204 allocate(qscatVISgrid(refftabsize,nuefftabsize,nsun,naerkind)) 205 allocate(omegVISgrid(refftabsize,nuefftabsize,nsun,naerkind)) 206 allocate(gVISgrid(refftabsize,nuefftabsize,nsun,naerkind)) 207 ! Optical properties of the grid (INFRARED) 208 allocate(qsqrefIRgrid(refftabsize,nuefftabsize,nir,naerkind)) 209 allocate(qextIRgrid(refftabsize,nuefftabsize,nir,naerkind)) 210 allocate(qscatIRgrid(refftabsize,nuefftabsize,nir,naerkind)) 211 allocate(omegIRgrid(refftabsize,nuefftabsize,nir,naerkind)) 212 allocate(gIRgrid(refftabsize,nuefftabsize,nir,naerkind)) 213 214 allocate(qsqrefVISa(nsun,ngau,naerkind)) 215 allocate(qrefVISa(ngau,naerkind)) 216 allocate(qsqrefVISb(nsun,ngau,naerkind)) 217 allocate(qrefVISb(ngau,naerkind)) 218 allocate(omegVISa(nsun,ngau,naerkind)) 219 allocate(omegrefVISa(ngau,naerkind)) 220 allocate(omegVISb(nsun,ngau,naerkind)) 221 allocate(omegrefVISb(ngau,naerkind)) 222 allocate(gVISa(nsun,ngau,naerkind)) 223 allocate(gVISb(nsun,ngau,naerkind)) 224 225 allocate(qsqrefIRa(nir,ngau,naerkind)) 226 allocate(qrefIRa(ngau,naerkind)) 227 allocate(qsqrefIRb(nir,ngau,naerkind)) 228 allocate(qrefIRb(ngau,naerkind)) 229 allocate(omegIRa(nir,ngau,naerkind)) 230 allocate(omegrefIRa(ngau,naerkind)) 231 allocate(omegIRb(nir,ngau,naerkind)) 232 allocate(omegrefIRb(ngau,naerkind)) 233 allocate(gIRa(nir,ngau,naerkind)) 234 allocate(gIRb(nir,ngau,naerkind)) 235 192 236 c 0.1 Pi! 193 237 pi = 2. * asin(1.e0) … … 758 802 & k2*omegrefIRgrid(grid_i+1,1,iaer) 759 803 ENDIF ! -------------------------------- 760 ENDDO !nlayer mx761 ENDDO !ngrid mx804 ENDDO !nlayer 805 ENDDO !ngrid 762 806 c================================================================== 763 807 ELSE ! VARYING NUEFF … … 1171 1215 & k4*omegrefIRgrid(grid_i,grid_j+1,iaer) 1172 1216 ENDIF ! -------------------------------- 1173 ENDDO !nlayer mx1174 ENDDO !ngrid mx1217 ENDDO !nlayer 1218 ENDDO !ngrid 1175 1219 1176 1220 ENDIF ! varyingnueff -
trunk/LMDZ.MARS/libf/phymars/albedocaps.F90
r801 r1047 5 5 6 6 ! to use the 'getin' routine 7 use ioipsl_getincom 8 7 use ioipsl_getincom, only: getin 8 #ifdef MESOSCALE 9 use comgeomfi_h 10 #endif 11 use surfdat_h, only: TESicealbedo, TESice_Ncoef, TESice_Scoef, & 12 emisice, albedice, watercaptag, albedo_h2o_ice, & 13 emissiv, albedodat 9 14 implicit none 10 15 11 16 #include"dimensions.h" 12 17 #include"dimphys.h" 13 #include"surfdat.h"18 !#include"surfdat.h" 14 19 #include"callkeys.h" 15 #ifdef MESOSCALE16 #include"comgeomfi.h"17 #endif20 !#ifdef MESOSCALE 21 !#include"comgeomfi.h" 22 !#endif 18 23 19 24 ! arguments: … … 98 103 subroutine TES_icecap_albedo(zls,ig,alb,icap) 99 104 105 use comgeomfi_h, only: lati, long 106 use surfdat_h, only: albedice, TESice_Ncoef, TESice_Scoef 100 107 implicit none 101 108 #include"dimensions.h" 102 109 #include"dimphys.h" 103 #include"surfdat.h"104 #include"comgeomfi.h"110 !#include"surfdat.h" 111 !#include"comgeomfi.h" 105 112 #include"netcdf.inc" 106 113 #include"datafile.h" -
trunk/LMDZ.MARS/libf/phymars/blendrad.F
r38 r1047 10 10 c the scale over which this happens are set in the nlteparams.h file. 11 11 c Above layer NLAYLTE the tendency is purely the sum of NLTE contributions. 12 c (Note : nlaylte is calculated by "nlthermeq" and stored in common "yomlw.h")12 c (Note : nlaylte is calculated by "nlthermeq" and stored in module "yomlw_h") 13 13 c Stephen Lewis 6/2000 FF 14 14 c 15 use yomlw_h, only: nlaylte 15 16 implicit none 16 #include "dimensions.h"17 #include "dimphys.h"18 #include "dimradmars.h"17 !#include "dimensions.h" 18 !#include "dimphys.h" 19 !#include "dimradmars.h" 19 20 #include "nlteparams.h" 20 #include "yomlw.h"21 !#include "yomlw.h" 21 22 22 23 c Input: -
trunk/LMDZ.MARS/libf/phymars/calldrag_noro.F
r38 r1047 4 4 5 5 6 6 use surfdat_h, only: zstd, zsig, zgam, zthe 7 use dimradmars_mod, only: ndomainsz 7 8 IMPLICIT NONE 8 9 c======================================================================= … … 16 17 c ("sub-domain") to save memory and 17 18 c be able run on a workstation at high resolution 18 c The sub-grid size is defined in dimradmars .h.19 c The sub-grid size is defined in dimradmars_mod. 19 20 c 20 21 c author: … … 54 55 c ------------------ 55 56 c 56 #include "dimensions.h"57 #include "dimphys.h"58 #include "dimradmars.h"59 #include "surfdat.h"57 !#include "dimensions.h" 58 !#include "dimphys.h" 59 !#include "dimradmars.h" 60 !#include "surfdat.h" 60 61 61 62 c----------------------------------------------------------------------- … … 75 76 c ----------------- 76 77 77 REAL sigtest(nlayer mx+1)78 INTEGER igwd,igwdim,itest(ngrid mx)79 80 INTEGER ndomain81 parameter (ndomain = (ngridmx-1) / ndomainsz + 1)78 REAL sigtest(nlayer+1) 79 INTEGER igwd,igwdim,itest(ngrid) 80 81 INTEGER,SAVE :: ndomain 82 ! parameter (ndomain = (ngrid-1) / ndomainsz + 1) 82 83 83 84 INTEGER l,ig 84 85 INTEGER jd,ig0,nd 85 86 86 REAL zulow(ngrid mx),zvlow(ngridmx)87 REAL zustr(ngrid mx),zvstr(ngridmx)88 89 REAL zplev(ndomainsz,nlayer mx+1)90 REAL zplay(ndomainsz,nlayer mx)91 REAL zt(ndomainsz,nlayer mx)92 REAL zu(ndomainsz,nlayer mx)93 REAL zv(ndomainsz,nlayer mx)87 REAL zulow(ngrid),zvlow(ngrid) 88 REAL zustr(ngrid),zvstr(ngrid) 89 90 REAL zplev(ndomainsz,nlayer+1) 91 REAL zplay(ndomainsz,nlayer) 92 REAL zt(ndomainsz,nlayer) 93 REAL zu(ndomainsz,nlayer) 94 REAL zv(ndomainsz,nlayer) 94 95 INTEGER zidx(ndomainsz) 95 REAL zzdtgw(ndomainsz,nlayer mx)96 REAL zzdugw(ndomainsz,nlayer mx)97 REAL zzdvgw(ndomainsz,nlayer mx)96 REAL zzdtgw(ndomainsz,nlayer) 97 REAL zzdugw(ndomainsz,nlayer) 98 REAL zzdvgw(ndomainsz,nlayer) 98 99 99 100 logical ll … … 114 115 115 116 IF (firstcall) THEN 116 do l=1,nlayermx+1 117 ndomain = (ngrid-1) / ndomainsz + 1 118 119 do l=1,nlayer+1 117 120 sigtest(l)=pplev(1,l)/pplev(1,1) 118 121 enddo 119 call sugwd(nlayer mx,sigtest)120 121 if (ngrid mx.EQ. 1) then122 call sugwd(nlayer,sigtest) 123 124 if (ngrid .EQ. 1) then 122 125 if (ndomainsz .NE. 1) then 123 126 print* 124 127 print*,'ATTENTION !!!' 125 128 print*,'pour tourner en 1D, meme pour drag_noro ' 126 print*,'fixer ndomainsz=1 dans phymars/dimradmars .h'129 print*,'fixer ndomainsz=1 dans phymars/dimradmars_mod' 127 130 print* 128 131 call exit(1) … … 139 142 ig0=(jd-1)*ndomainsz 140 143 if (jd.eq.ndomain) then 141 nd=ngrid mx-ig0144 nd=ngrid-ig0 142 145 else 143 146 nd=ndomainsz -
trunk/LMDZ.MARS/libf/phymars/callradite.F
r1036 r1047 5 5 & nuice,co2ice) 6 6 7 IMPLICIT NONE 7 use dimradmars_mod, only: ndomainsz, nflev, nsun, nir 8 use yomlw_h, only: gcp, nlaylte 9 IMPLICIT NONE 8 10 c======================================================================= 9 11 c subject: … … 18 20 c The calculations are only performed for the first "nlaylte" 19 21 c parameters (nlaylte is calculated by subroutine "nlthermeq" 20 c and stored in common "yomlw.h").22 c and stored in module "yomlw_h"). 21 23 c 22 24 c The purpose of this subroutine is to: … … 25 27 c ("sub-domain") to save memory and 26 28 c be able run on a workstation at high resolution 27 c The sub-grid size is defined in dimradmars .h29 c The sub-grid size is defined in dimradmars_mod 28 30 c 3) Compute the 3D scattering parameters depending on the 29 31 c size distribution of the different tracers (added by JBM) … … 74 76 c 75 77 c This version has been modified to only calculate radiative tendencies 76 c over layers 1..NFLEV (set in dimradmars .h). Returns zero for higher78 c over layers 1..NFLEV (set in dimradmars_mod). Returns zero for higher 77 79 c layers, if any. 78 80 c In other routines, nlayermx -> nflev. … … 85 87 c ---------- 86 88 c Here, solar band#1 is spectral interval between "long1vis" and "long2vis" 87 c set in dimradmars .h89 c set in dimradmars_mod 88 90 c Here, solar band#2 is spectral interval between "long2vis" and "long3vis" 89 c set in dimradmars .h91 c set in dimradmars_mod 90 92 c 91 93 c input: … … 105 107 c (see below) 106 108 c emis Thermal IR surface emissivity (no unit) 107 c mu0(ngrid mx) cos of solar zenith angle109 c mu0(ngrid) cos of solar zenith angle 108 110 c (=1 when sun at zenith) 109 111 c pplay(ngrid,nlayer) pressure (Pa) in the middle of each layer … … 111 113 c pt(ngrid,nlayer) atmospheric temperature in each layer (K) 112 114 c tsurf(ngrid) surface temperature (K) 113 c fract(ngrid mx) day fraction of the time interval115 c fract(ngrid) day fraction of the time interval 114 116 c =1 during the full day ; =0 during the night 115 117 c declin latitude of subsolar point … … 136 138 c aerosol(ngrid,nlayer,naerkind) aerosol extinction optical depth 137 139 c at reference wavelength "longrefvis" set 138 c in dimradmars .h , in each layer, for one of140 c in dimradmars_h , in each layer, for one of 139 141 c the "naerkind" kind of aerosol optical 140 142 c properties. … … 145 147 c ------------- 146 148 c 147 #include "dimensions.h"148 #include "dimphys.h"149 #include "dimradmars.h"149 !#include "dimensions.h" 150 !#include "dimphys.h" 151 !#include "dimradmars.h" 150 152 #include "comcstfi.h" 151 153 #include "callkeys.h" 152 #include "yomlw.h" 154 !#include "yomlw.h" 155 ! naerkind is set in scatterers.h (built when compiling with makegcm -s #) 156 #include"scatterers.h" 153 157 #include "aerkind.h" 154 158 … … 156 160 c Input/Output 157 161 c ------------ 158 INTEGER icount159 INTEGER ngrid,nlayer,nq160 INTEGER igout161 162 REAL pq(ngrid,nlayer,nq)163 REAL tauscaling(ngridmx) ! Conversion factor for162 INTEGER,INTENT(IN) :: icount 163 INTEGER,INTENT(IN) :: ngrid,nlayer,nq 164 INTEGER,INTENT(IN) :: igout 165 166 REAL,INTENT(IN) :: pq(ngrid,nlayer,nq) 167 REAL,INTENT(IN) :: tauscaling(ngrid) ! Conversion factor for 164 168 ! qdust and Ndust 165 REAL albedo(ngrid,2),emis(ngrid)166 REAL ls,zday167 168 REAL pplev(ngrid,nlayer+1),pplay(ngrid,nlayer)169 REAL pt(ngrid,nlayer)170 REAL tsurf(ngrid)171 REAL dist_sol,mu0(ngrid),fract(ngrid)172 REAL dtlw(ngridmx,nlayermx),dtsw(ngridmx,nlayermx)173 REAL fluxsurf_lw(ngridmx), fluxtop_lw(ngridmx)174 REAL fluxsurf_sw(ngridmx,2), fluxtop_sw(ngridmx,2)175 176 REAL tauref(ngrid), tau(ngrid,naerkind)177 REAL taucloudtes(ngridmx)! Cloud opacity at infrared169 REAL,INTENT(IN) :: albedo(ngrid,2),emis(ngrid) 170 REAL,INTENT(IN) :: ls,zday 171 172 REAL,INTENT(IN) :: pplev(ngrid,nlayer+1),pplay(ngrid,nlayer) 173 REAL,INTENT(IN) :: pt(ngrid,nlayer) 174 REAL,INTENT(IN) :: tsurf(ngrid) 175 REAL,INTENT(IN) :: dist_sol,mu0(ngrid),fract(ngrid) 176 REAL,INTENT(OUT) :: dtlw(ngrid,nlayer),dtsw(ngrid,nlayer) 177 REAL,INTENT(OUT) :: fluxsurf_lw(ngrid), fluxtop_lw(ngrid) 178 REAL,INTENT(OUT) :: fluxsurf_sw(ngrid,2), fluxtop_sw(ngrid,2) 179 180 REAL,INTENT(OUT) :: tauref(ngrid), tau(ngrid,naerkind) 181 REAL,INTENT(OUT) :: taucloudtes(ngrid)! Cloud opacity at infrared 178 182 ! reference wavelength using 179 183 ! Qabs instead of Qext 180 184 ! (direct comparison with TES) 181 REAL aerosol(ngrid,nlayer,naerkind)182 REAL rdust(ngridmx,nlayermx) ! Dust geometric mean radius (m)183 REAL rice(ngridmx,nlayermx) ! Ice geometric mean radius (m)184 REAL nuice(ngridmx,nlayermx) ! Estimated effective variance185 REAL co2ice(ngridmx) ! co2 ice surface layer (kg.m-2)185 REAL,INTENT(OUT) :: aerosol(ngrid,nlayer,naerkind) 186 REAL,INTENT(OUT) :: rdust(ngrid,nlayer) ! Dust geometric mean radius (m) 187 REAL,INTENT(OUT) :: rice(ngrid,nlayer) ! Ice geometric mean radius (m) 188 REAL,INTENT(OUT) :: nuice(ngrid,nlayer) ! Estimated effective variance 189 REAL,INTENT(IN) :: co2ice(ngrid) ! co2 ice surface layer (kg.m-2) 186 190 187 191 c … … 194 198 195 199 real cste_mars ! solar constant on Mars (Wm-2) 196 REAL ptlev(ngridmx,nlayermx+1) 197 198 INTEGER ndomain 199 parameter (ndomain = (ngridmx-1) / ndomainsz + 1) 200 REAL ptlev(ngrid,nlayer+1) 201 202 INTEGER,SAVE :: ndomain 200 203 201 204 c Thermal IR net radiative budget (W m-2) … … 232 235 REAL :: nueffrad(ngrid,nlayer,naerkind) 233 236 c Aerosol optical properties 234 REAL :: QVISsQREF3d(ngrid mx,nlayermx,nsun,naerkind)235 REAL :: omegaVIS3d(ngrid mx,nlayermx,nsun,naerkind)236 REAL :: gVIS3d(ngrid mx,nlayermx,nsun,naerkind)237 238 REAL :: QIRsQREF3d(ngrid mx,nlayermx,nir,naerkind)239 REAL :: omegaIR3d(ngrid mx,nlayermx,nir,naerkind)240 REAL :: gIR3d(ngrid mx,nlayermx,nir,naerkind)241 242 REAL :: QREFvis3d(ngrid mx,nlayermx,naerkind)243 REAL :: QREFir3d(ngrid mx,nlayermx,naerkind)244 245 REAL :: omegaREFvis3d(ngrid mx,nlayermx,naerkind)246 REAL :: omegaREFir3d(ngrid mx,nlayermx,naerkind)237 REAL :: QVISsQREF3d(ngrid,nlayer,nsun,naerkind) 238 REAL :: omegaVIS3d(ngrid,nlayer,nsun,naerkind) 239 REAL :: gVIS3d(ngrid,nlayer,nsun,naerkind) 240 241 REAL :: QIRsQREF3d(ngrid,nlayer,nir,naerkind) 242 REAL :: omegaIR3d(ngrid,nlayer,nir,naerkind) 243 REAL :: gIR3d(ngrid,nlayer,nir,naerkind) 244 245 REAL :: QREFvis3d(ngrid,nlayer,naerkind) 246 REAL :: QREFir3d(ngrid,nlayer,naerkind) 247 248 REAL :: omegaREFvis3d(ngrid,nlayer,naerkind) 249 REAL :: omegaREFir3d(ngrid,nlayer,naerkind) 247 250 248 251 c local saved variables 249 252 c --------------------- 250 253 251 real pview(ngridmx) 252 save pview 254 real,save,allocatable :: pview(:) 253 255 254 256 real zco2 ! volume fraction of CO2 in Mars atmosphere … … 266 268 267 269 IF (firstcall) THEN 270 ! compute ndomain and allocate local saved arrays 271 ndomain= (ngrid-1) / ndomainsz + 1 272 allocate(pview(ngrid)) 268 273 269 274 c Please name the different scatterers here ---------------- 270 275 c PLEASE MAKE SURE that you set up the right number of 271 c scatterers in dimradmars.h (naerkind);276 c scatterers in scatterers.h (naerkind); 272 277 name_iaer(1) = "dust_conrath" !! default choice is good old Conrath profile 273 278 IF (doubleq.AND.active) name_iaer(1) = "dust_doubleq" !! two-moment scheme … … 328 333 write(*,*) " expected ",naerkind 329 334 write(*,*) "please make sure that the number of" 330 write(*,*) "scatterers in dimradmars.h, the names"335 write(*,*) "scatterers in scatterers.h, the names" 331 336 write(*,*) "in callradite.F, and the flags in" 332 337 write(*,*) "callphys.def are all consistent!" … … 353 358 WRITE(*,*) 'If activice is TRUE, water has to be set' 354 359 WRITE(*,*) 'to TRUE, and "naerkind" must be at least' 355 WRITE(*,*) 'equal to 2 in dimradmars.h.'360 WRITE(*,*) 'equal to 2 in scatterers.h.' 356 361 CALL ABORT 357 362 ELSE IF ( (.NOT.activice).AND.(naerkind.GT.1) ) THEN … … 364 369 c Loading the optical properties in external look-up tables: 365 370 CALL SUAER 366 CALL SULW 371 ! CALL SULW ! this step is now done in ini_yomlw_h 367 372 368 373 write(*,*) 'Splitting radiative calculations: ', 369 $ ' ngrid mx,ngrid,ndomainsz,ndomain',370 $ ngrid mx,ngrid,ndomainsz,ndomain371 if (ngrid mx.EQ. 1) then374 $ ' ngrid,ndomainsz,ndomain', 375 $ ngrid,ndomainsz,ndomain 376 if (ngrid .EQ. 1) then 372 377 if (ndomainsz .NE. 1) then 373 378 print* 374 379 print*,'ATTENTION !!!' 375 380 print*,'pour tourner en 1D, ' 376 print*,'fixer ndomainsz=1 dans phymars/dimradmars .h'381 print*,'fixer ndomainsz=1 dans phymars/dimradmars_h' 377 382 print* 378 383 call exit(1) … … 409 414 ig0=(jd-1)*ndomainsz 410 415 if (jd.eq.ndomain) then 411 nd=ngrid mx-ig0416 nd=ngrid-ig0 412 417 else 413 418 nd=ndomainsz -
trunk/LMDZ.MARS/libf/phymars/callsedim.F
r1036 r1047 29 29 c ------------- 30 30 31 #include "dimensions.h"32 #include "dimphys.h"31 !#include "dimensions.h" 32 !#include "dimphys.h" 33 33 #include "comcstfi.h" 34 34 !#include "tracer.h" … … 52 52 real,intent(out) :: rice(ngrid,nlay) ! H2O Ice geometric mean radius (m) 53 53 c Sedimentation radius of water ice 54 real,intent(in) :: rsedcloud(ngrid mx,nlayermx)54 real,intent(in) :: rsedcloud(ngrid,nlay) 55 55 c Cloud density (kg.m-3) 56 real,intent(inout) :: rhocloud(ngrid mx,nlayermx)56 real,intent(inout) :: rhocloud(ngrid,nlay) 57 57 c Traceurs : 58 58 real,intent(in) :: pq(ngrid,nlay,nq) ! tracers (kg/kg) … … 130 130 IF (firstcall) THEN 131 131 132 IF(ngrid.NE.ngridmx) THEN133 PRINT*,'STOP dans callsedim'134 PRINT*,'probleme de dimensions :'135 PRINT*,'ngrid =',ngrid136 PRINT*,'ngridmx =',ngridmx137 STOP138 ENDIF139 140 132 c Doubleq: initialization 141 133 IF (doubleq) THEN -
trunk/LMDZ.MARS/libf/phymars/co2snow.F
r890 r1047 2 2 & ,pplev,pcondicea,pcondices,pfallice,pemisurf) 3 3 4 IMPLICIT NONE 4 use surfdat_h, only: iceradius, dtemisice 5 IMPLICIT NONE 5 6 6 7 c======================================================================= … … 17 18 #include "dimphys.h" 18 19 #include "comcstfi.h" 19 #include "surfdat.h"20 !#include "surfdat.h" 20 21 #include "callkeys.h" 21 22 -
trunk/LMDZ.MARS/libf/phymars/convadj.F
r1036 r1047 31 31 ! ------------ 32 32 33 #include "dimensions.h"34 #include "dimphys.h"33 !#include "dimensions.h" 34 !#include "dimphys.h" 35 35 #include "comcstfi.h" 36 36 #include "callkeys.h" … … 63 63 64 64 INTEGER ig,i,l,l1,l2,jj 65 INTEGER jcnt, jadrs(ngrid mx)66 67 REAL sig(nlay ermx+1),sdsig(nlayermx),dsig(nlayermx)68 REAL zu(ngrid mx,nlayermx),zv(ngridmx,nlayermx)69 REAL zh(ngrid mx,nlayermx)70 REAL zu2(ngrid mx,nlayermx),zv2(ngridmx,nlayermx)71 REAL zh2(ngrid mx,nlayermx), zhc(ngridmx,nlayermx)65 INTEGER jcnt, jadrs(ngrid) 66 67 REAL sig(nlay+1),sdsig(nlay),dsig(nlay) 68 REAL zu(ngrid,nlay),zv(ngrid,nlay) 69 REAL zh(ngrid,nlay) 70 REAL zu2(ngrid,nlay),zv2(ngrid,nlay) 71 REAL zh2(ngrid,nlay), zhc(ngrid,nlay) 72 72 REAL zhm,zsm,zdsm,zum,zvm,zalpha,zhmc 73 73 … … 75 75 INTEGER iq,ico2 76 76 save ico2 77 REAL zq(ngrid mx,nlayermx,nq), zq2(ngridmx,nlayermx,nq)77 REAL zq(ngrid,nlay,nq), zq2(ngrid,nlay,nq) 78 78 REAL zqm(nq),zqco2m 79 79 real m_co2, m_noco2, A , B … … 82 82 real mtot1, mtot2 , mm1, mm2 83 83 integer l1ref, l2ref 84 LOGICAL vtest(ngrid mx),down,firstcall84 LOGICAL vtest(ngrid),down,firstcall 85 85 save firstcall 86 86 data firstcall/.true./ … … 94 94 95 95 IF (firstcall) THEN 96 IF(ngrid.NE.ngridmx) THEN 97 PRINT* 98 PRINT*,'STOP in convadj' 99 PRINT*,'ngrid =',ngrid 100 PRINT*,'ngridmx =',ngridmx 101 ENDIF 96 102 97 ico2=0 103 98 if (tracer) then -
trunk/LMDZ.MARS/libf/phymars/dimphys.h
r38 r1047 4 4 ! ngridmx : number of horizontal grid points 5 5 ! note: the -1/jjm term will be 0; unless jj=1 6 integer, parameter :: ngridmx = (2+(jjm-1)*iim - 1/jjm)6 ! integer, parameter :: ngridmx = (2+(jjm-1)*iim - 1/jjm) 7 7 ! nlayermx : number of atmospheric layers 8 8 integer, parameter :: nlayermx = llm 9 9 ! nsoilmx : number of subterranean layers 10 10 !EM: old soil routine: integer, parameter :: nsoilmx = 10 11 integer, parameter :: nsoilmx = 18 11 ! integer, parameter :: nsoilmx = 18 ! nsoilmx is now in comsoil_h 12 12 !----------------------------------------------------------------------- -
trunk/LMDZ.MARS/libf/phymars/drag_noro.F
r38 r1047 51 51 C 52 52 c 53 use dimradmars_mod, only: ndlo2 53 54 IMPLICIT none 54 55 c====================================================================== … … 69 70 c d_v-----output-R-increment de la vitesse v 70 71 c====================================================================== 71 #include "dimensions.h"72 #include "dimphys.h"73 #include "dimradmars.h"72 !#include "dimensions.h" 73 !#include "dimphys.h" 74 !#include "dimradmars.h" 74 75 #include "comcstfi.h" 75 76 c … … 88 89 c Variables locales: 89 90 c 90 REAL paprs(NDLO2, nlayermx+1)91 REAL paprsf(NDLO2, nlayermx)92 REAL zgeom(NDLO2, nlayermx)93 REAL pdtdt(NDLO2, nlayermx)94 REAL pdudt(NDLO2, nlayermx), pdvdt(NDLO2,nlayermx)95 REAL pt(NDLO2, nlayermx), pu(NDLO2,nlayermx)96 REAL pv(NDLO2, nlayermx)91 REAL paprs(NDLO2,klev+1) 92 REAL paprsf(NDLO2,klev) 93 REAL zgeom(NDLO2,klev) 94 REAL pdtdt(NDLO2,klev) 95 REAL pdudt(NDLO2,klev), pdvdt(NDLO2,klev) 96 REAL pt(NDLO2,klev), pu(NDLO2,klev) 97 REAL pv(NDLO2,klev) 97 98 c 98 99 c initialiser les variables de sortie (pour securite) -
trunk/LMDZ.MARS/libf/phymars/dustdevil.F
r1036 r1047 3 3 4 4 use tracer_mod, only: alpha_devil 5 use surfdat_h, only: z0_default 5 6 IMPLICIT NONE 6 7 … … 28 29 c ------------- 29 30 30 #include "dimensions.h"31 #include "dimphys.h"31 !#include "dimensions.h" 32 !#include "dimphys.h" 32 33 #include "comcstfi.h" 33 34 c#include "comconst.h" ! TEMPORAIRE AVEC ANLDEVIL !!!! 34 #include "surfdat.h"35 #include "comgeomfi.h"35 !#include "surfdat.h" 36 !#include "comgeomfi.h" 36 37 !#include "tracer.h" 37 38 c arguments: … … 62 63 63 64 64 REAL devila(ngrid mx)65 integer ltop(ngrid mx)65 REAL devila(ngrid) 66 integer ltop(ngrid) 66 67 real b,rho,Fs,wind 67 68 … … 77 78 78 79 c TEMPORAIRE AVEC ANLDEVIL : ************* 79 c real b_diag(ngrid mx)80 c real localtime(ngrid mx)80 c real b_diag(ngrid) 81 c real localtime(ngrid) 81 82 c common/temporaire/localtime 82 c real ztop(ngrid mx),magwind(ngridmx),t1(ngridmx)83 c real ztop(ngrid),magwind(ngrid),t1(ngrid) 83 84 c real rcp ,cpp 84 85 c rcp = kappa … … 95 96 write(*,*) 'In dustdevil :' 96 97 write(*,*) ' q2top= ',q2top,' seuil= ', seuil 97 c un petit test de coherence:98 IF(ngrid.NE.ngridmx) THEN99 PRINT*,'STOP dans coefdifv'100 PRINT*,'probleme de dimensions :'101 PRINT*,'ngrid =',ngrid102 PRINT*,'ngridmx =',ngridmx103 STOP104 ENDIF105 98 106 99 c A rough estimation of the horizontal drag coefficient Cd … … 218 211 c TEMPORAIRE AVEC ANLDEVIL: 219 212 c IF (ngrid.gt.1) THEN 220 c do ig=2,ngrid mx-1213 c do ig=2,ngrid-1 221 214 c write(77,88) lati(ig)*180./pi,localtime(ig), 222 215 c & -12.*log(pplev(ig,ltop(ig))/pplev(ig,1)), … … 226 219 c88 format (f7.3,1x,f7.3,1x,f6.3,1x,f6.4,1x,f7.4,1x, 227 220 c & f7.3,1x,f7.3,1x,f9.3) 228 c do ig=1,ngrid mx221 c do ig=1,ngrid 229 222 c ztop(ig) = -12.*log(pplev(ig,ltop(ig))/pplev(ig,1)) 230 223 c magwind(ig) = sqrt(pu(ig,1)**2+pv(ig,1)**2) … … 232 225 c end do 233 226 234 c call WRITEDIAGFI(ngrid mx,'dqs_dev','dqs devil',227 c call WRITEDIAGFI(ngrid,'dqs_dev','dqs devil', 235 228 c & 'kg.m-2.s-1',2,pdqs_dev) 236 c call WRITEDIAGFI(ngrid mx,'wind','wind',229 c call WRITEDIAGFI(ngrid,'wind','wind', 237 230 c & 'm.s-1',2,magwind) 238 c call WRITEDIAGFI(ngrid mx,'ztop','top pbl',231 c call WRITEDIAGFI(ngrid,'ztop','top pbl', 239 232 c & 'km',2,ztop) 240 c call WRITEDIAGFI(ngrid mx,'tsurf','tsurf',233 c call WRITEDIAGFI(ngrid,'tsurf','tsurf', 241 234 c & 'K',2,ptsurf) 242 c call WRITEDIAGFI(ngrid mx,'T1','T(1)',235 c call WRITEDIAGFI(ngrid,'T1','T(1)', 243 236 c & 'K',2,t1) 244 c call WRITEDIAGFI(ngrid mx,'b','b',237 c call WRITEDIAGFI(ngrid,'b','b', 245 238 c & ' ',2,b_diag) 246 239 c END If -
trunk/LMDZ.MARS/libf/phymars/dustlift.F
r1038 r1047 24 24 c ------------- 25 25 26 #include "dimensions.h"27 #include "dimphys.h"26 !#include "dimensions.h" 27 !#include "dimphys.h" 28 28 #include "comcstfi.h" 29 29 !#include "tracer.h" … … 47 47 c ------ 48 48 INTEGER ig,iq 49 REAL fhoriz(ngrid mx) ! Horizontal dust flux49 REAL fhoriz(ngrid) ! Horizontal dust flux 50 50 REAL ust,us 51 51 REAL stress_seuil -
trunk/LMDZ.MARS/libf/phymars/flusv.F
r38 r1047 1 1 SUBROUTINE flusv(KDLON,nsf,n,omega,g,tau,emis,bh,bsol,fah,fdh) 2 use dimradmars_mod, only: ndlo2, ndlon 2 3 IMPLICIT NONE 3 4 c....................................................................... … … 37 38 #include "dimensions.h" 38 39 #include "dimphys.h" 39 #include "dimradmars.h"40 !#include "dimradmars.h" 40 41 c....................................................................... 41 42 c declaration des arguments … … 271 272 272 273 SUBROUTINE sys3v(KDLON,n,a,b,d,e,y) 274 use dimradmars_mod, only: ndlon, ndlo2 273 275 IMPLICIT NONE 274 276 c....................................................................... … … 293 295 #include "dimensions.h" 294 296 #include "dimphys.h" 295 #include "dimradmars.h"297 !#include "dimradmars.h" 296 298 c....................................................................... 297 299 c declaration des arguments -
trunk/LMDZ.MARS/libf/phymars/getslopes.F90
r998 r1047 1 subroutine getslopes( geopot)1 subroutine getslopes(ngrid,geopot) 2 2 3 use comgeomfi_h, only: long, lati 4 use slope_mod, only: theta_sl, psi_sl 3 5 implicit none 4 6 5 7 #include "dimensions.h" 6 #include "dimphys.h"7 #include "slope.h"8 #include "comgeomfi.h"8 !#include "dimphys.h" 9 !#include "slope.h" 10 !#include "comgeomfi.h" 9 11 #include "comcstfi.h" 10 12 … … 16 18 ! TN 04/1013 17 19 18 19 real geopot(ngridmx) ! geopotential on phy grid20 integer,intent(in) :: ngrid ! nnumber of atmospheric columns 21 real,intent(in) :: geopot(ngrid) ! geopotential on phy grid 20 22 real topogrid(iim,jjm+1) ! topography on lat/lon grid with poles and only one -180/180 point 21 23 real latigrid(iim,jjm+1),longgrid(iim,jjm+1) ! meshgrid of latitude and longitude values (radians) … … 43 45 latigrid(:,1) = lati(1) 44 46 longgrid(:,1) = long(1) 45 topogrid(:,jjm+1) = geopot(ngrid mx)/g46 latigrid(:,jjm+1) = lati(ngrid mx)47 longgrid(:,jjm+1) = long(ngrid mx)47 topogrid(:,jjm+1) = geopot(ngrid)/g 48 latigrid(:,jjm+1) = lati(ngrid) 49 longgrid(:,jjm+1) = long(ngrid) 48 50 49 51 -
trunk/LMDZ.MARS/libf/phymars/gwprofil.F
r38 r1047 52 52 C PASSAGE OF THE NEW GWDRAG TO I.F.S. (F. LOTT, 22/11/93) 53 53 C----------------------------------------------------------------------- 54 use dimradmars_mod, only: ndlo2 54 55 implicit none 55 56 C … … 59 60 #include "dimensions.h" 60 61 #include "dimphys.h" 61 #include "dimradmars.h"62 !#include "dimradmars.h" 62 63 integer klon,klev,kidia,kfdia 63 64 #include "yoegwd.h" -
trunk/LMDZ.MARS/libf/phymars/gwstress.F
r38 r1047 45 45 C 46 46 C----------------------------------------------------------------------- 47 use dimradmars_mod, only: ndlo2 47 48 implicit none 48 49 #include "dimensions.h" 49 50 #include "dimphys.h" 50 #include "dimradmars.h"51 !#include "dimradmars.h" 51 52 integer klon,klev,kidia,kfdia 52 53 -
trunk/LMDZ.MARS/libf/phymars/improvedclouds.F
r1036 r1047 10 10 & igcm_dust_number, igcm_ccn_mass, 11 11 & igcm_ccn_number 12 use conc_mod, only: mmean 12 13 implicit none 13 14 … … 33 34 c A. Spiga, optimization (February 2012) 34 35 c------------------------------------------------------------------ 35 #include "dimensions.h"36 #include "dimphys.h"36 !#include "dimensions.h" 37 !#include "dimphys.h" 37 38 #include "comcstfi.h" 38 39 #include "callkeys.h" 39 40 !#include "tracer.h" 40 #include "comgeomfi.h"41 #include "dimradmars.h"41 !#include "comgeomfi.h" 42 !#include "dimradmars.h" 42 43 #include "microphys.h" 43 #include "conc.h"44 !#include "conc.h" 44 45 c------------------------------------------------------------------ 45 46 c Inputs: … … 57 58 REAL pdq(ngrid,nlay,nq) ! tendance avant condensation 58 59 ! (kg/kg.s-1) 59 REAL tauscaling(ngrid mx) ! Convertion factor for qdust and Ndust60 REAL tauscaling(ngrid) ! Convertion factor for qdust and Ndust 60 61 61 62 c Outputs: … … 77 78 INTEGER ig,l,i 78 79 79 REAL zq(ngrid mx,nlayermx,nq) ! local value of tracers80 REAL zq0(ngrid mx,nlayermx,nq) ! local initial value of tracers81 REAL zt(ngrid mx,nlayermx) ! local value of temperature82 REAL zqsat(ngrid mx,nlayermx) ! saturation80 REAL zq(ngrid,nlay,nq) ! local value of tracers 81 REAL zq0(ngrid,nlay,nq) ! local initial value of tracers 82 REAL zt(ngrid,nlay) ! local value of temperature 83 REAL zqsat(ngrid,nlay) ! saturation 83 84 REAL lw !Latent heat of sublimation (J.kg-1) 84 85 REAL cste … … 101 102 REAL rice(ngrid,nlay) ! Ice mass mean radius (m) 102 103 ! (r_c in montmessin_2004) 103 REAL rhocloud(ngrid mx,nlayermx) ! Cloud density (kg.m-3)104 REAL rdust(ngrid mx,nlayermx) ! Dust geometric mean radius (m)104 REAL rhocloud(ngrid,nlay) ! Cloud density (kg.m-3) 105 REAL rdust(ngrid,nlay) ! Dust geometric mean radius (m) 105 106 106 107 REAL res ! Resistance growth … … 259 260 dev2 = 1. / ( sqrt(2.) * sigma_ice ) 260 261 261 call watersat(ngrid mx*nlayermx,zt,pplay,zqsat)262 call watersat(ngrid*nlay,zt,pplay,zqsat) 262 263 263 264 countcells = 0 -
trunk/LMDZ.MARS/libf/phymars/inifis.F
r1036 r1047 48 48 USE ioipsl_getincom, only : getin 49 49 use tracer_mod, only : nqmx, nuice_sed, ccn_factor 50 50 use comsoil_h, only: ini_comsoil_h 51 #ifdef MESOSCALE 52 use comsoil_h, only: volcapa !!MESOSCALE -- needed to fill volcapa 53 #endif 54 use comgeomfi_h, only: long, lati, area, totarea 55 use comdiurn_h, only: sinlat, coslat, sinlon, coslon 56 use surfdat_h, only: ini_surfdat_h, albedo_h2o_ice, inert_h2o_ice, 57 & frost_albedo_threshold 58 use comsaison_h, only: ini_comsaison_h 59 use slope_mod, only: ini_slope_mod 60 use dimradmars_mod, only: ini_dimradmars_mod 61 use yomaer_h,only: ini_yomaer_h, tauvis 62 use yomlw_h, only: ini_yomlw_h 63 use conc_mod, only: ini_conc_mod 51 64 IMPLICIT NONE 52 65 #include "dimensions.h" … … 54 67 #include "planete.h" 55 68 #include "comcstfi.h" 56 #include "comsaison.h"57 #include "comdiurn.h"58 #include "comgeomfi.h"69 !#include "comsaison.h" 70 !#include "comdiurn.h" 71 !#include "comgeomfi.h" 59 72 #include "callkeys.h" 60 #include "surfdat.h"61 #include "dimradmars.h"62 #include "yomaer.h"73 !#include "surfdat.h" 74 !#include "dimradmars.h" 75 !#include "yomaer.h" 63 76 #include "datafile.h" 64 #include "slope.h"77 !#include "slope.h" 65 78 #include "microphys.h" 66 79 !#include "tracer.h" 80 ! naerkind is set in scatterers.h (built when compiling with makegcm -s #) 81 #include"scatterers.h" 67 82 #ifdef MESOSCALE 68 #include "comsoil.h" !!MESOSCALE -- needed to fill volcapa83 !#include "comsoil.h" !!MESOSCALE -- needed to fill volcapa 69 84 #include "meso_inc/meso_inc_inifisvar.F" 70 85 #endif … … 107 122 ! The usual Tests 108 123 ! -------------- 109 IF (nlayer.NE.nlayermx) THEN110 PRINT*,'STOP in inifis'111 PRINT*,'Probleme de dimensions :'112 PRINT*,'nlayer = ',nlayer113 PRINT*,'nlayermx = ',nlayermx114 STOP115 ENDIF116 117 IF (ngrid.NE.ngridmx) THEN118 PRINT*,'STOP in inifis'119 PRINT*,'Probleme de dimensions :'120 PRINT*,'ngrid = ',ngrid121 PRINT*,'ngridmx = ',ngridmx122 STOP123 ENDIF124 ! IF (nlayer.NE.nlayermx) THEN 125 ! PRINT*,'STOP in inifis' 126 ! PRINT*,'Probleme de dimensions :' 127 ! PRINT*,'nlayer = ',nlayer 128 ! PRINT*,'nlayermx = ',nlayermx 129 ! STOP 130 ! ENDIF 131 132 ! IF (ngrid.NE.ngridmx) THEN 133 ! PRINT*,'STOP in inifis' 134 ! PRINT*,'Probleme de dimensions :' 135 ! PRINT*,'ngrid = ',ngrid 136 ! PRINT*,'ngridmx = ',ngridmx 137 ! STOP 138 ! ENDIF 124 139 125 140 ! -------------------------------------------------------------- … … 765 780 ! ------------------------ 766 781 767 ! in 'comgeomfi.h' 782 ! allocate "slope_mod" arrays 783 call ini_slope_mod(ngrid) 784 785 ! allocate "comsaison_h" arrays 786 call ini_comsaison_h(ngrid) 787 788 ! allocate "surfdat_h" arrays 789 call ini_surfdat_h(ngrid) 790 791 ! allocate "comgeomfi_h" arrays 792 allocate(lati(ngrid)) 793 allocate(long(ngrid)) 794 allocate(area(ngrid)) 795 796 ! fill "comgeomfi_h" data 768 797 CALL SCOPY(ngrid,plon,1,long,1) 769 798 CALL SCOPY(ngrid,plat,1,lati,1) 770 799 CALL SCOPY(ngrid,parea,1,area,1) 771 totarea=SSUM(ngridmx,area,1) 772 773 ! in 'comdiurn.h' 800 totarea=SSUM(ngrid,area,1) 801 802 ! allocate "comdiurn_h" data 803 allocate(sinlat(ngrid)) 804 allocate(coslat(ngrid)) 805 allocate(sinlon(ngrid)) 806 allocate(coslon(ngrid)) 807 808 ! fill "comdiurn_h" data 774 809 DO ig=1,ngrid 775 810 sinlat(ig)=sin(plat(ig)) … … 781 816 pi=2.*asin(1.) ! NB: pi is a common in comcstfi.h 782 817 783 ! managing the tracers, and tests: 784 ! ------------------------------- 785 ! Ehouarn: removed; as these tests are now done in initracer.F 786 ! if(tracer) then 787 ! 788 !! when photochem is used, nqchem_min is the rank 789 !! of the first chemical species 790 ! 791 !! Ehouarn: nqchem_min is now meaningless and no longer used 792 !! nqchem_min = 1 793 ! if (photochem .or. callthermos) then 794 ! chem = .true. 795 ! end if 796 ! 797 ! if (water .or. thermoswater) h2o = .true. 798 ! 799 !! TESTS 800 ! 801 ! print*,'inifis: TRACERS:' 802 ! write(*,*) " chem=",chem," h2o=",h2o 803 !! write(*,*) " doubleq=",doubleq 804 !! write(*,*) " dustbin=",dustbin 805 ! 806 ! if ((doubleq).and.(h2o).and. 807 ! $ (chem)) then 808 ! print*,' 2 dust tracers (doubleq)' 809 ! print*,' 1 water vapour tracer' 810 ! print*,' 1 water ice tracer' 811 ! print*,nq-4,' chemistry tracers' 812 ! endif 813 ! 814 ! if ((doubleq).and.(h2o).and. 815 ! $ .not.(chem)) then 816 ! print*,' 2 dust tracers (doubleq)' 817 ! print*,' 1 water vapour tracer' 818 ! print*,' 1 water ice tracer' 819 ! if (nq.LT.4) then 820 ! print*,'nq should be at least equal to' 821 ! print*,'4 with these options.' 822 ! stop 823 ! endif 824 ! endif 825 ! 826 ! if (.not.(doubleq).and.(h2o).and. 827 ! $ (chem)) then 828 ! if (dustbin.gt.0) then 829 ! print*,dustbin,' dust bins' 830 ! endif 831 ! print*,nq-2-dustbin,' chemistry tracers' 832 ! print*,' 1 water vapour tracer' 833 ! print*,' 1 water ice tracer' 834 ! endif 835 ! 836 ! if (.not.(doubleq).and.(h2o).and. 837 ! $ .not.(chem)) then 838 ! if (dustbin.gt.0) then 839 ! print*,dustbin,' dust bins' 840 ! endif 841 ! print*,' 1 water vapour tracer' 842 ! print*,' 1 water ice tracer' 843 ! if (nq.gt.(dustbin+2)) then 844 ! print*,'nq should be ',(dustbin+2), 845 ! $ ' with these options...' 846 ! print*,'(or check callphys.def)' 847 ! endif 848 ! if (nq.lt.(dustbin+2)) then 849 ! write(*,*) "inifis: nq.lt.(dustbin+2)" 850 ! stop 851 ! endif 852 ! endif 853 ! 854 ! endif ! of if (tracer) 855 ! 856 ! RETURN 818 ! allocate "comsoil_h" arrays 819 call ini_comsoil_h(ngrid) 820 821 ! set some variables in "dimradmars_mod" 822 call ini_dimradmars_mod(ngrid,nlayer) 823 824 ! allocate arrays in "yomaer_h" 825 call ini_yomaer_h 826 827 ! allocate arrays in "yomlw_h" 828 call ini_yomlw_h(ngrid) 829 830 ! allocate arrays in "conc_mod" 831 call ini_conc_mod(ngrid,nlayer) 832 857 833 END -
trunk/LMDZ.MARS/libf/phymars/initracer.F
r1038 r1047 26 26 27 27 28 #include "dimensions.h"29 #include "dimphys.h"28 !#include "dimensions.h" 29 !#include "dimphys.h" 30 30 #include "comcstfi.h" 31 31 #include "callkeys.h" 32 32 !#include "tracer.h" 33 33 !#include "advtrac.h" 34 #include "comgeomfi.h"35 36 #include "surfdat.h"34 !#include "comgeomfi.h" 35 36 !#include "surfdat.h" 37 37 38 38 integer,intent(in) :: ngrid ! number of atmospheric columns … … 68 68 allocate(alpha_lift(nq)) 69 69 allocate(alpha_devil(nq)) 70 allocate(dryness(ngrid mx))70 allocate(dryness(ngrid)) 71 71 allocate(igcm_dustbin(nq)) 72 72 -
trunk/LMDZ.MARS/libf/phymars/iniwrite.F
r999 r1047 1 1 SUBROUTINE iniwrite(nid,idayref,phis) 2 3 use comsoil_h, only: mlayer, nsoilmx 2 4 IMPLICIT NONE 3 5 … … 30 32 #include "description.h" 31 33 #include "serre.h" 32 #include"dimphys.h"33 #include"comsoil.h"34 !#include"dimphys.h" 35 !#include"comsoil.h" 34 36 35 37 c Arguments: … … 253 255 254 256 !------------------------------- 255 ! (soil) depth variable mlayer() (known from comsoil .h)257 ! (soil) depth variable mlayer() (known from comsoil_h) 256 258 !------------------------------- 257 259 ierr=NF_REDEF (nid) ! Enter NetCDF (re-)define mode -
trunk/LMDZ.MARS/libf/phymars/iniwritesoil.F90
r38 r1047 1 subroutine iniwritesoil(nid )1 subroutine iniwritesoil(nid,ngrid) 2 2 3 3 ! initialization routine for 'writediagoil'. Here we create/define … … 5 5 ! (time-independent) parameters. 6 6 7 use comsoil_h, only: mlayer, inertiedat, nsoilmx 8 7 9 implicit none 8 10 9 11 #include"dimensions.h" 10 #include"dimphys.h"12 !#include"dimphys.h" 11 13 #include"paramet.h" 12 14 #include"comcstfi.h" 13 15 #include"comgeom.h" 14 #include"comsoil.h"16 !#include"comsoil.h" 15 17 #include"netcdf.inc" 16 18 17 19 ! Arguments: 20 integer,intent(in) :: ngrid 18 21 integer,intent(in) :: nid ! NetCDF output file ID 19 22 … … 154 157 ierr=NF_PUT_VAR_REAL(nid,varid,mlayer) 155 158 #endif 156 ! Note mlayer(0:nsoilmx-1) known from comsoil .h159 ! Note mlayer(0:nsoilmx-1) known from comsoil_h 157 160 if (ierr.ne.NF_NOERR) then 158 161 write(*,*)"iniwritesoil: Error, could not write depth variable" … … 240 243 241 244 ! Recast data along 'dynamics' grid 242 ! Note: inertiedat is known from comsoil .h245 ! Note: inertiedat is known from comsoil_h 243 246 244 247 do l=1,nsoilmx … … 246 249 do i=1,iip1 247 250 data3(i,1,l)=inertiedat(1,l) 248 data3(i,jjp1,l)=inertiedat(ngrid mx,l)251 data3(i,jjp1,l)=inertiedat(ngrid,l) 249 252 enddo 250 253 ! rest of the grid -
trunk/LMDZ.MARS/libf/phymars/lwb.F
r38 r1047 7 7 c---------------------------------------------------------------------- 8 8 9 use dimradmars_mod, only: ndlon, ndlo2, kflev , nir 10 use yomlw_h, only: nlaylte, xi , tstand, xp 9 11 implicit none 10 12 11 #include "dimensions.h"12 #include "dimphys.h"13 #include "dimradmars.h"14 #include "callkeys.h"13 !#include "dimensions.h" 14 !#include "dimphys.h" 15 !#include "dimradmars.h" 16 !#include "callkeys.h" 15 17 16 #include "yomlw.h"18 !#include "yomlw.h" 17 19 18 20 c---------------------------------------------------------------------- -
trunk/LMDZ.MARS/libf/phymars/lwdiff.F
r38 r1047 4 4 . ,pemis,pfluc) 5 5 6 use dimradmars_mod, only: nir, npademx, nabsmx, nflev, ndlon, 7 & ndlo2 8 use yomlw_h, only: nlaylte 6 9 IMPLICIT NONE 7 10 8 #include "dimensions.h"9 #include "dimphys.h"10 #include "dimradmars.h"11 !#include "dimensions.h" 12 !#include "dimphys.h" 13 !#include "dimradmars.h" 11 14 #include "callkeys.h" 12 15 #include "comcstfi.h" 13 16 14 #include "yomaer.h"15 #include "yomlw.h"17 !#include "yomaer.h" 18 !#include "yomlw.h" 16 19 C----------------------------------------------------------------------- 17 20 C -
trunk/LMDZ.MARS/libf/phymars/lwflux.F
r38 r1047 11 11 c---------------------------------------------------------------------- 12 12 13 use dimradmars_mod, only: ndlo2, nir, ndlon, nuco2, nflev 14 use yomlw_h, only: nlaylte, xi, xi_ground, gcp 13 15 implicit none 14 16 15 17 16 #include "dimensions.h"17 #include "dimphys.h"18 #include "dimradmars.h"18 !#include "dimensions.h" 19 !#include "dimphys.h" 20 !#include "dimradmars.h" 19 21 #include "callkeys.h" 20 22 #include "comg1d.h" 21 23 22 #include "yomlw.h"24 !#include "yomlw.h" 23 25 24 26 c---------------------------------------------------------------------- … … 65 67 66 68 integer ja,jl,j,i,ig1d,ig,l,ndim 67 parameter(ndim = ndlon*(nuco2+1)*(nflev+2)*(nflev+2))69 ! parameter(ndim = ndlon*(nuco2+1)*(nflev+2)*(nflev+2)) 68 70 real ksidb (ndlon,nuco2+1,0:nflev+1,0:nflev+1) ! net exchange rate (W/m2) 69 71 … … 77 79 c To compute IR flux in the atmosphere (For diagnostic only !!) 78 80 logical computeflux 79 real coefd(ngridmx,nuco2,nflev+1,nflev+1) 80 real coefu(ngridmx,nuco2,0:nflev,nflev+1) 81 real flw_up(ngridmx,nflev+1), flw_dn(ngridmx,nflev+1) ! fluxes (W/m2) 82 83 81 real coefd(kdlon,nuco2,nflev+1,nflev+1) 82 real coefu(kdlon,nuco2,0:nflev,nflev+1) 83 real flw_up(kdlon,nflev+1), flw_dn(kdlon,nflev+1) ! fluxes (W/m2) 84 85 86 ndim = ndlon*(nuco2+1)*(nflev+2)*(nflev+2) 84 87 call zerophys(ndim, ksidb) 85 88 … … 364 367 if (callg2d) then 365 368 366 ig1d = ngridmx/2 + 1367 c ig1d = ngridmx369 ig1d = kdlon/2 + 1 370 c ig1d = kdlon 368 371 369 372 if ((ig0+1).LE.ig1d .and. ig1d.LE.(ig0+kdlon) 370 . .OR. ngridmx.EQ.1 ) then373 . .OR. kdlon.EQ.1 ) then 371 374 372 375 ig = ig1d-ig0 -
trunk/LMDZ.MARS/libf/phymars/lwi.F
r38 r1047 4 4 5 5 6 use dimradmars_mod, only: ndlo2, ndlon, nflev, nir 7 use yomlw_h, only: gcp, nlaylte, xi 6 8 implicit none 7 9 8 10 9 #include "dimensions.h"10 #include "dimphys.h"11 #include "dimradmars.h"11 !#include "dimensions.h" 12 !#include "dimphys.h" 13 !#include "dimradmars.h" 12 14 #include "comg1d.h" 13 15 #include "callkeys.h" 14 16 #include "comcstfi.h" 15 #include "yomlw.h"17 !#include "yomlw.h" 16 18 17 19 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC -
trunk/LMDZ.MARS/libf/phymars/lwmain.F
r353 r1047 9 9 c---------------------------------------------------------------------- 10 10 c LWMAIN organizes the LTE longwave calculations 11 c for layer 1 to layer "nlaylte" (stored in "yomlw.h") 12 c---------------------------------------------------------------------- 13 11 c for layer 1 to layer "nlaylte" (stored in "yomlw_h") 12 c---------------------------------------------------------------------- 13 14 use dimradmars_mod, only: ndlo2, nflev, nir, ndlon, nuco2 15 use yomlw_h, only: nlaylte, xi 14 16 implicit none 15 17 16 #include "dimensions.h"17 #include "dimphys.h"18 #include "dimradmars.h"18 !#include "dimensions.h" 19 !#include "dimphys.h" 20 !#include "dimradmars.h" 19 21 #include "callkeys.h" 20 22 #include "comg1d.h" 21 22 #include "yomlw.h" 23 ! naerkind is set in scatterers.h (built when compiling with makegcm -s #) 24 #include"scatterers.h" 25 !#include "yomlw.h" 23 26 24 27 c---------------------------------------------------------------------- … … 40 43 real aerosol(ndlo2,kflev,naerkind) ! aerosol extinction optical 41 44 c depth at reference wavelength "longrefvis" set 42 c in dimradmars .h, in each layer, for one of45 c in dimradmars_mod , in each layer, for one of 43 46 c the "naerkind" kind of aerosol optical properties. 44 47 … … 95 98 firstcall = .false. 96 99 97 do jkk = 0 , nlaylte+1 98 do jk = 0 , nlaylte+1 99 do ja = 1 , nuco2 100 do jl = 1 , ngridmx 101 xi (jl,ja,jk,jkk)=0. 102 enddo 103 enddo 104 enddo 105 enddo 100 xi (:,:,:,:)=0. 106 101 107 102 endif … … 184 179 c do jk = 0 , nlaylte+1 185 180 c do ja = 1 , nuco2 186 c do jl = 1 , ngrid mx181 c do jl = 1 , ngrid 187 182 c if (xi (jl,ja,jk,jkk) .LT. 0 188 183 c . .OR. xi (jl,ja,jk,jkk) .GT. 1 ) then -
trunk/LMDZ.MARS/libf/phymars/lwtt.F
r38 r1047 7 7 c---------------------------------------------------------------------- 8 8 9 use dimradmars_mod, only : ndlon, ndlo2 10 use yomlw_h, only: ga, gb, cst_voigt 9 11 implicit none 10 12 11 #include "dimensions.h"12 #include "dimphys.h"13 #include "dimradmars.h"14 #include "yomlw.h"13 !#include "dimensions.h" 14 !#include "dimphys.h" 15 !#include "dimradmars.h" 16 !#include "yomlw.h" 15 17 16 18 c---------------------------------------------------------------------- -
trunk/LMDZ.MARS/libf/phymars/lwu.F
r626 r1047 31 31 c----------------------------------------------------------------------- 32 32 33 use dimradmars_mod, only: ndlo2, nir, nuco2, ndlon, nflev 34 use yomlw_h, only: nlaylte, tref, at, bt, cst_voigt 33 35 implicit none 34 36 35 #include "dimensions.h"36 #include "dimphys.h"37 #include "dimradmars.h"37 !#include "dimensions.h" 38 !#include "dimphys.h" 39 !#include "dimradmars.h" 38 40 #include "comcstfi.h" 39 41 40 #include "yomaer.h" 41 #include "yomlw.h" 42 !#include "yomaer.h" 43 !#include "yomlw.h" 44 ! naerkind is set in scatterers.h (built when compiling with makegcm -s #) 45 #include"scatterers.h" 42 46 43 47 #include "callkeys.h" … … 56 60 real aerosol (ndlo2,kflev,naerkind) ! aerosol extinction optical depth 57 61 c at reference wavelength "longrefvis" set 58 c in dimradmars .h, in each layer, for one of62 c in dimradmars_mod , in each layer, for one of 59 63 c the "naerkind" kind of aerosol optical properties. 60 64 REAL QIRsQREF3d(ndlo2,kflev,nir,naerkind) ! 3d ext. coef. -
trunk/LMDZ.MARS/libf/phymars/lwxb.F
r38 r1047 33 33 c---------------------------------------------------------------------- 34 34 35 use dimradmars_mod, only: ndlo2, nuco2, ndlon, nflev 36 use yomlw_h, only: xi, nlaylte 35 37 implicit none 36 38 37 #include "dimensions.h"38 #include "dimphys.h"39 #include "dimradmars.h"40 #include "callkeys.h"39 !#include "dimensions.h" 40 !#include "dimphys.h" 41 !#include "dimradmars.h" 42 !#include "callkeys.h" 41 43 42 #include "yomlw.h"44 !#include "yomlw.h" 43 45 44 46 c---------------------------------------------------------------------- -
trunk/LMDZ.MARS/libf/phymars/lwxd.F
r38 r1047 32 32 c---------------------------------------------------------------------- 33 33 34 use dimradmars_mod, only: ndlon, nuco2, nflev, ndlo2 35 use yomlw_h, only: nlaylte, xi, xi_emis 34 36 implicit none 35 37 36 #include "dimensions.h"37 #include "dimphys.h"38 #include "dimradmars.h"38 !#include "dimensions.h" 39 !#include "dimphys.h" 40 !#include "dimradmars.h" 39 41 40 #include "yomlw.h"42 !#include "yomlw.h" 41 43 #include "callkeys.h" 42 44 … … 60 62 61 63 integer ja,jl,jk,jkk,ndim 62 parameter(ndim = ndlon*nuco2*(nflev+2)*(nflev+2))64 ! parameter(ndim = ndlon*nuco2*(nflev+2)*(nflev+2)) 63 65 64 66 … … 74 76 75 77 c---------------------------------------------------------------------- 78 ndim = ndlon*nuco2*(nflev+2)*(nflev+2) 76 79 call zerophys(ndim,ksi_emis) 77 80 c---------------------------------------------------------------------- -
trunk/LMDZ.MARS/libf/phymars/lwxn.F
r38 r1047 70 70 c----------------------------------------------------------------------- 71 71 72 use dimradmars_mod, only: ndlo2, nuco2, ndlon, nflev 73 use yomlw_h, only: nlaylte, xi, xi_ground, xi_emis 72 74 implicit none 73 75 74 #include "dimensions.h"75 #include "dimphys.h"76 #include "dimradmars.h"76 !#include "dimensions.h" 77 !#include "dimphys.h" 78 !#include "dimradmars.h" 77 79 78 #include "yomlw.h"80 !#include "yomlw.h" 79 81 #include "callkeys.h" 80 82 -
trunk/LMDZ.MARS/libf/phymars/newcondens.F
r1036 r1047 7 7 8 8 use tracer_mod, only: noms 9 use surfdat_h, only: emissiv, phisfi 9 10 IMPLICIT NONE 10 11 c======================================================================= … … 30 31 c 31 32 c \ 32 c pdt(ngrid,nlayer mx)\ derivee temporelle physique avant condensation33 c pdt(ngrid,nlayer)\ derivee temporelle physique avant condensation 33 34 c / ou sublimation pour pt,ptsrf 34 35 c pdtsrf(ngrid) / … … 37 38 c ------- 38 39 c 39 c pdpsrf(ngrid) \ derivee temporelle physique (contribution de40 c pdtc(ngrid,nlayer mx) / la condensation ou sublimation) pour Ps,pt,ptsrf41 c pdtsrfc(ngrid) /40 c pdpsrf(ngrid) \ derivee temporelle physique (contribution de 41 c pdtc(ngrid,nlayer) / la condensation ou sublimation) pour Ps,pt,ptsrf 42 c pdtsrfc(ngrid) / 42 43 c 43 44 c Entree/sortie … … 55 56 c 56 57 #include "dimensions.h" 57 #include "dimphys.h"58 !#include "dimphys.h" 58 59 #include "comcstfi.h" 59 #include "surfdat.h"60 #include "comgeomfi.h"60 !#include "surfdat.h" 61 !#include "comgeomfi.h" 61 62 #include "comvert.h" 62 #include "paramet.h"63 !#include "paramet.h" 63 64 #include "callkeys.h" 64 65 !#include "tracer.h" … … 114 115 c -------------------------------------------- 115 116 INTEGER i,j 116 REAL Fluxmean(jjp1)117 c REAL Fluxmean(jjp1) 117 118 INTEGER l,ig,iq,icap,nmix 118 119 LOGICAL transparency, fluxdependent … … 166 167 real,parameter :: cpice=1000. ! (J.kg-1.K-1) specific heat of CO2 ice 167 168 REAL,SAVE :: acond,bcond,ccond 168 ! REAL,SAVE :: albediceF(ngrid mx)169 ! REAL,SAVE :: albediceF(ngrid) 169 170 real,save :: m_co2, m_noco2, A , B 170 171 … … 225 226 c zfallice(ngrid,l):amount of ice falling from layer l (kg/m2/s) 226 227 c 227 c pdtc(ngrid,nlayer mx) : dT/dt due to cond/sub228 c pdtc(ngrid,nlayer) : dT/dt due to cond/sub 228 229 c 229 230 c … … 675 676 end do 676 677 Sm(1) = masse(1) 677 do l =2,nlayer mx678 do l =2,nlayer 678 679 do iq=1,nq 679 680 zq(l,iq)=pq(ig,l,iq) … … 733 734 c END DO 734 735 c END DO 735 c call WRITEDIAGFI(ngrid mx,'tconda1',736 c call WRITEDIAGFI(ngrid,'tconda1', 736 737 c &'Taux de condensation CO2 atmospherique /Pa', 737 738 c & 'kg.m-2.Pa-1.s-1',3,tconda1) 738 c call WRITEDIAGFI(ngrid mx,'tconda2',739 c call WRITEDIAGFI(ngrid,'tconda2', 739 740 c &'Taux de condensation CO2 atmospherique /m', 740 741 c & 'kg.m-3.s-1',3,tconda2) 741 742 742 743 ! output falling co2 ice in 1st layer: 743 ! call WRITEDIAGFI(ngrid mx,'fallice',744 ! call WRITEDIAGFI(ngrid,'fallice', 744 745 ! &'Precipitation of co2 ice', 745 746 ! & 'kg.m-2.s-1',2,zfallice(1,1)) -
trunk/LMDZ.MARS/libf/phymars/newsedim.F
r530 r1047 14 14 c ------------- 15 15 16 #include "dimensions.h"17 #include "dimphys.h"16 !#include "dimensions.h" 17 !#include "dimphys.h" 18 18 #include "comcstfi.h" 19 19 c … … 33 33 c Traceurs : 34 34 real,intent(inout) :: pqi(ngrid,nlay) ! traceur (e.g. ?/kg) 35 real,intent(out) :: wq(ngrid mx,nlay+1) ! flux de traceur durant timestep (?/m-2)35 real,intent(out) :: wq(ngrid,nlay+1) ! flux de traceur durant timestep (?/m-2) 36 36 real,intent(in) :: beta ! correction for the shape of the particles 37 37 ! (see Murphy et al. JGR 1990 vol.95) … … 50 50 c Traceurs : 51 51 c ~~~~~~~~ 52 real traversee (ngrid mx,nlayermx)53 real vstokes(ngrid mx,nlayermx)54 real w(ngrid mx,nlayermx)52 real traversee (ngrid,nlay) 53 real vstokes(ngrid,nlay) 54 real w(ngrid,nlay) 55 55 real ptop, dztop, Ep, Stra 56 56 … … 71 71 72 72 IF (firstcall) THEN 73 IF(ngrid.NE.ngridmx) THEN 74 PRINT*,'STOP dans newsedim' 75 PRINT*,'probleme de dimensions :' 76 PRINT*,'ngrid =',ngrid 77 PRINT*,'ngridmx =',ngridmx 78 STOP 79 ENDIF 73 80 74 firstcall=.false. 81 75 … … 211 205 end do 212 206 213 call vlz_fi(ngrid, pqi,2.,masse,w,wq)207 call vlz_fi(ngrid,nlay,pqi,2.,masse,w,wq) 214 208 c write(*,*) ' newsed: wq(6), wq(7), q(6)', 215 209 c & wq(1,6),wq(1,7),pqi(1,6) -
trunk/LMDZ.MARS/libf/phymars/nirco2abs.F
r1036 r1047 3 3 4 4 use tracer_mod, only: igcm_co2, igcm_o 5 use comdiurn_h, only: sinlon, coslon, sinlat, coslat 5 6 IMPLICIT NONE 6 7 c======================================================================= … … 30 31 c nlayer Number of layer 31 32 c dist_sol sun-Mars distance (AU) 32 c mu0(ngrid mx)33 c fract(ngrid mx)day fraction of the time interval33 c mu0(ngrid) 34 c fract(ngrid) day fraction of the time interval 34 35 c declin latitude of subslar point 35 36 c … … 45 46 c ------------------ 46 47 c 47 #include "dimensions.h"48 #include "dimphys.h"48 !#include "dimensions.h" 49 !#include "dimphys.h" 49 50 #include "comcstfi.h" 50 51 #include "callkeys.h" 51 #include "comdiurn.h"52 !#include "comdiurn.h" 52 53 #include "nirdata.h" 53 54 !#include "tracer.h" … … 62 63 integer,intent(in) :: nq ! number of tracers 63 64 real,intent(in) :: pq(ngrid,nlayer,nq) ! tracers 64 real,intent(in) :: mu0(ngrid mx) ! solar angle65 real,intent(in) :: fract(ngrid mx) ! day fraction of the time interval65 real,intent(in) :: mu0(ngrid) ! solar angle 66 real,intent(in) :: fract(ngrid) ! day fraction of the time interval 66 67 real,intent(in) :: declin ! latitude of sub-solar point 67 68 … … 71 72 c ----------------- 72 73 INTEGER l,ig, n, nstep,i 73 REAL co2heat0, zmu(ngrid mx)74 REAL co2heat0, zmu(ngrid) 74 75 75 76 c special diurnal=F 76 real mu0_int(ngrid mx),fract_int(ngridmx),zday_int77 real mu0_int(ngrid),fract_int(ngrid),zday_int 77 78 real ztim1,ztim2,ztim3,step 78 79 -
trunk/LMDZ.MARS/libf/phymars/nlte_tcool.F
r759 r1047 22 22 c*********************************************************************** 23 23 24 use conc_mod, only: cpnew, mmean 24 25 implicit none 25 26 … … 29 30 include 'nlte_commons.h' 30 31 include "chimiedata.h" 31 include "conc.h"32 ! include "conc.h" 32 33 33 34 -
trunk/LMDZ.MARS/libf/phymars/nltecool.F
r1036 r1047 31 31 32 32 use tracer_mod, only: igcm_co2, igcm_co, igcm_o, igcm_n2, mmol 33 use conc_mod, only: mmean 33 34 implicit none 34 35 … … 37 38 #include "dimphys.h" 38 39 #include "chimiedata.h" 39 #include "conc.h" !Added to have "dynamic composition" in the scheme40 !#include "conc.h" !Added to have "dynamic composition" in the scheme 40 41 !#include "tracer.h" !" 41 42 #include "callkeys.h" -
trunk/LMDZ.MARS/libf/phymars/nlthermeq.F
r38 r1047 1 1 subroutine nlthermeq(ngrid, nlayer, pplev, pplay) 2 2 c 3 c Compute the number of layers nlaylte (stored in common yomlw.h)3 c Compute the number of layers nlaylte (stored in module yomlw_h) 4 4 c over which local thermodynamic equilibrium 5 5 c radiation scheme should be run to be sure of covering at least to a … … 8 8 c Stephen Lewis 6/2000 9 9 c Modified Y. Wanherdrick/ F. Forget 09/2000 10 10 use yomlw_h, only: nlaylte 11 11 implicit none 12 #include "dimensions.h"13 #include "dimphys.h"14 #include "dimradmars.h"12 !#include "dimensions.h" 13 !#include "dimphys.h" 14 !#include "dimradmars.h" 15 15 #include "nlteparams.h" 16 #include "yomlw.h"16 !#include "yomlw.h" 17 17 #include "callkeys.h" 18 18 -
trunk/LMDZ.MARS/libf/phymars/orodrag.F
r38 r1047 71 71 C F.LOTT + M. MILLER E.C.M.W.F. 22/11/94 72 72 C----------------------------------------------------------------------- 73 use dimradmars_mod, only: ndlo2 73 74 implicit none 74 75 C … … 76 77 #include "dimensions.h" 77 78 #include "dimphys.h" 78 #include "dimradmars.h" 79 integer klon,klev,kidia,kfdia 80 parameter(kidia=1,kfdia=NDLO2) 79 !#include "dimradmars.h" 80 integer klon,klev,kidia 81 parameter(kidia=1) 82 integer, save :: kfdia ! =NDLO2 81 83 82 84 #include "comcstfi.h" … … 153 155 110 CONTINUE 154 156 C 157 kfdia=NDLO2 158 155 159 c ZTMST=TWODT 156 160 c IF(NSTEP.EQ.NSTART) ZTMST=0.5*TWODT -
trunk/LMDZ.MARS/libf/phymars/orosetup.F
r38 r1047 46 46 C 47 47 C----------------------------------------------------------------------- 48 use dimradmars_mod, only: ndlo2 48 49 implicit none 49 50 C … … 51 52 #include "dimensions.h" 52 53 #include "dimphys.h" 53 #include "dimradmars.h"54 !#include "dimradmars.h" 54 55 integer klon,klev,kidia,kfdia 55 56 -
trunk/LMDZ.MARS/libf/phymars/phyetat0.F
r1036 r1047 1 SUBROUTINE phyetat0 (fichnom,tab0,Lmodif,nsoil,n q,1 SUBROUTINE phyetat0 (fichnom,tab0,Lmodif,nsoil,ngrid,nlay,nq, 2 2 . day_ini,time0, 3 3 . tsurf,tsoil,emis,q2,qsurf,co2ice) … … 5 5 use netcdf 6 6 use infotrac, only: nqtot, tnom 7 use surfdat_h, only: phisfi, albedodat, z0, z0_default, 8 & zmea, zstd, zsig, zgam, zthe 7 9 8 10 implicit none … … 17 19 c====================================================================== 18 20 !#include "netcdf.inc" 19 #include "dimensions.h"20 #include "dimphys.h"21 !#include "dimensions.h" 22 !#include "dimphys.h" 21 23 !#include "comgeomfi.h" 22 #include "surfdat.h"24 !#include "surfdat.h" 23 25 #include "planete.h" 24 #include "dimradmars.h"25 #include "yomaer.h"26 !#include "dimradmars.h" 27 !#include "yomaer.h" 26 28 #include "comcstfi.h" 27 29 !#include "tracer.h" … … 35 37 ! --------- 36 38 ! inputs: 37 character*(*) fichnom ! "startfi.nc" file 38 integer tab0 39 integer Lmodif 40 integer nsoil ! # of soil layers 41 integer nq 42 integer day_ini 43 real time0 39 character*(*),intent(in) :: fichnom ! "startfi.nc" file 40 integer,intent(in) :: tab0 41 integer,intent(in) :: Lmodif 42 integer,intent(in) :: nsoil ! # of soil layers 43 integer,intent(in) :: ngrid ! # of atmospheric columns 44 integer,intent(in) :: nlay ! # of atmospheric layers 45 integer,intent(in) :: nq 46 integer :: day_ini 47 real :: time0 44 48 45 49 ! outputs: 46 real tsurf(ngridmx) ! surface temperature47 real tsoil(ngridmx,nsoil) ! soil temperature48 real emis(ngridmx) ! surface emissivity49 real q2(ngridmx, llm+1) !50 real qsurf(ngridmx,nq) ! tracers on surface51 real co2ice(ngridmx) ! co2 ice cover50 real,intent(out) :: tsurf(ngrid) ! surface temperature 51 real,intent(out) :: tsoil(ngrid,nsoil) ! soil temperature 52 real,intent(out) :: emis(ngrid) ! surface emissivity 53 real,intent(out) :: q2(ngrid,nlay+1) ! 54 real,intent(out) :: qsurf(ngrid,nq) ! tracers on surface 55 real,intent(out) :: co2ice(ngrid) ! co2 ice cover 52 56 53 57 !====================================================================== 54 58 ! Local variables: 55 59 56 real surffield(ngrid mx) ! to temporarily store a surface field60 real surffield(ngrid) ! to temporarily store a surface field 57 61 real xmin,xmax ! to display min and max of a field 58 62 c … … 248 252 CALL abort 249 253 ENDIF 250 xmin = 1.0E+20 251 xmax = -1.0E+20 252 DO i = 1, ngridmx 253 xmin = MIN(zmea(i),xmin) 254 xmax = MAX(zmea(i),xmax) 255 ENDDO 254 xmin = MINVAL(zmea) 255 xmax = MAXVAL(zmea) 256 256 PRINT*,'<zmea>:', xmin, xmax 257 257 c … … 270 270 CALL abort 271 271 ENDIF 272 xmin = 1.0E+20 273 xmax = -1.0E+20 274 DO i = 1, ngridmx 275 xmin = MIN(zstd(i),xmin) 276 xmax = MAX(zstd(i),xmax) 277 ENDDO 272 xmin = MINVAL(zstd) 273 xmax = MAXVAL(zstd) 278 274 PRINT*,'<zstd>:', xmin, xmax 279 275 c … … 292 288 CALL abort 293 289 ENDIF 294 xmin = 1.0E+20 295 xmax = -1.0E+20 296 DO i = 1, ngridmx 297 xmin = MIN(zsig(i),xmin) 298 xmax = MAX(zsig(i),xmax) 299 ENDDO 290 xmin = MINVAL(zsig) 291 xmax = MAXVAL(zsig) 300 292 PRINT*,'<zsig>:', xmin, xmax 301 293 c … … 314 306 CALL abort 315 307 ENDIF 316 xmin = 1.0E+20 317 xmax = -1.0E+20 318 DO i = 1, ngridmx 319 xmin = MIN(zgam(i),xmin) 320 xmax = MAX(zgam(i),xmax) 321 ENDDO 308 xmin = MINVAL(zgam) 309 xmax = MAXVAL(zgam) 322 310 PRINT*,'<zgam>:', xmin, xmax 323 311 c … … 336 324 CALL abort 337 325 ENDIF 338 xmin = 1.0E+20 339 xmax = -1.0E+20 340 DO i = 1, ngridmx 341 xmin = MIN(zthe(i),xmin) 342 xmax = MAX(zthe(i),xmax) 343 ENDDO 326 xmin = MINVAL(zthe) 327 xmax = MAXVAL(zthe) 344 328 PRINT*,'<zthe>:', xmin, xmax 345 329 … … 417 401 corner(1)=1 418 402 corner(2)=indextime 419 edges(1)=ngrid mx403 edges(1)=ngrid 420 404 edges(2)=1 421 405 ierr=nf90_inq_varid(nid,"co2ice",nvarid) … … 486 470 ! IF (nbsrf >= 2) THEN 487 471 ! DO nsrf = 2, nbsrf 488 ! DO i = 1, ngrid mx472 ! DO i = 1, ngrid 489 473 ! tsurf(i,nsrf) = tsurf(i,1) 490 474 ! ENDDO … … 506 490 ! PRINT*, "phyetat0: Le champ <tsoil> est absent" 507 491 ! PRINT*, " Il prend donc la valeur de surface" 508 ! DO i=1, ngrid mx492 ! DO i=1, ngrid 509 493 ! tsoil(i,isoil,nsrf)=tsurf(i,nsrf) 510 494 ! ENDDO … … 549 533 550 534 ! 551 ! surface roughness length (NB: z0 is a common in surfdat .h)535 ! surface roughness length (NB: z0 is a common in surfdat_h) 552 536 ! 553 537 ierr=nf90_inq_varid(nid,"z0",nvarid) … … 577 561 corner(2)=1 578 562 corner(3)=indextime 579 edges(1)=ngrid mx580 edges(2)= llm+1563 edges(1)=ngrid 564 edges(2)=nlay+1 581 565 edges(3)=1 582 566 ierr=nf90_inq_varid(nid,"q2",nvarid) … … 602 586 corner(1)=1 603 587 corner(2)=indextime 604 edges(1)=ngrid mx588 edges(1)=ngrid 605 589 edges(2)=1 606 590 IF(nq.GE.1) THEN … … 628 612 & ' not found in file' 629 613 write(*,*) trim(txt), ' set to 0' 630 do ig=1,ngrid mx614 do ig=1,ngrid 631 615 qsurf(ig,iq)=0. 632 616 end do … … 635 619 !ierr=nf90_get_var(nid,nvarid,qsurf(1,iq)) 636 620 ierr=nf90_get_var(nid,nvarid,surffield,corner,edges) 637 qsurf(1:ngrid mx,iq)=surffield(1:ngridmx)621 qsurf(1:ngrid,iq)=surffield(1:ngrid) 638 622 IF (ierr.NE.nf90_noerr) THEN 639 623 PRINT*, 'phyetat0: Lecture echouee pour <',trim(txt),'>' … … 644 628 xmin = 1.0E+20 645 629 xmax = -1.0E+20 646 xmin = MINVAL(qsurf(1:ngrid mx,iq))647 xmax = MAXVAL(qsurf(1:ngrid mx,iq))630 xmin = MINVAL(qsurf(1:ngrid,iq)) 631 xmax = MAXVAL(qsurf(1:ngrid,iq)) 648 632 PRINT*,'tracer on surface <',trim(txt),'>:',xmin,xmax 649 633 ENDDO … … 660 644 ! if (yes.eq.'y') then 661 645 ! write(*,*) 'OK, let s reindex qsurf' 662 ! do ig=1,ngrid mx646 ! do ig=1,ngrid 663 647 ! do iq=nqtot,nqtot-nqold+1,-1 664 648 ! qsurf(ig,iq)=qsurf(ig,iq-nqtot+nqold) … … 675 659 ! as well as thermal inertia and volumetric heat capacity 676 660 677 call soil_settings(nid,ngrid mx,nsoil,tsurf,tsoil,indextime)661 call soil_settings(nid,ngrid,nsoil,tsurf,tsoil,indextime) 678 662 c 679 663 c Fermer le fichier: -
trunk/LMDZ.MARS/libf/phymars/physdem.F
r1036 r1047 1 subroutine physdem0(filename,lonfi,latfi,nsoil,n q,1 subroutine physdem0(filename,lonfi,latfi,nsoil,ngrid,nlay,nq, 2 2 . phystep,day_ini,time,airefi, 3 3 . alb,ith,pzmea,pzstd,pzsig,pzgam,pzthe) 4 4 5 5 use infotrac, only: nqtot, tnom 6 use comsoil_h, only: inertiedat, volcapa, mlayer 7 use comgeomfi_h, only: area 8 use surfdat_h, only: albedodat, zmea, zstd, zsig, zgam, zthe, 9 & z0_default, albedice, emisice, emissiv, 10 & iceradius, dtemisice, phisfi, z0 11 use yomaer_h, only: tauvis 6 12 implicit none 7 13 c … … 32 38 #include "ener.h" 33 39 #include "netcdf.inc" 34 #include "dimphys.h"40 !#include "dimphys.h" 35 41 !#include "advtrac.h" 36 42 #include "callkeys.h" … … 43 49 44 50 REAL day_ini 45 INTEGER nsoil,nq51 INTEGER,INTENT(IN) :: nsoil,ngrid,nlay,nq 46 52 integer ierr,idim1,idim2,idim3,idim4,idim5,idim6,nvarid 47 53 48 54 c 49 55 REAL phystep,time 50 REAL latfi(ngrid mx), lonfi(ngridmx)51 ! REAL champhys(ngrid mx)56 REAL latfi(ngrid), lonfi(ngrid) 57 ! REAL champhys(ngrid) 52 58 INTEGER length 53 59 PARAMETER (length=100) … … 62 68 #include "clesph0.h" 63 69 #include "fxyprim.h" 64 #include "comgeomfi.h"65 #include "surfdat.h"66 #include "comsoil.h"70 !#include "comgeomfi.h" 71 !#include "surfdat.h" 72 !#include "comsoil.h" 67 73 #include "planete.h" 68 #include "dimradmars.h"69 #include "yomaer.h"74 !#include "dimradmars.h" 75 !#include "yomaer.h" 70 76 #include "comcstfi.h" 71 77 72 real airefi(ngrid mx)73 real alb(ngrid mx),ith(ngridmx,nsoil)74 real pzmea(ngrid mx),pzstd(ngridmx)75 real pzsig(ngrid mx),pzgam(ngridmx),pzthe(ngridmx)78 real airefi(ngrid) 79 real alb(ngrid),ith(ngrid,nsoil) 80 real pzmea(ngrid),pzstd(ngrid) 81 real pzsig(ngrid),pzgam(ngrid),pzthe(ngrid) 76 82 integer ig 77 83 … … 86 92 87 93 ! copy airefi(:) to area(:) 88 CALL SCOPY(ngrid mx,airefi,1,area,1)89 ! note: area() is defined in comgeomfi .h90 91 92 DO ig=1,ngrid mx93 albedodat(ig)=alb(ig) ! note: albedodat() is defined in surfdat .h94 zmea(ig)=pzmea(ig) ! note: zmea() is defined in surfdat .h95 zstd(ig)=pzstd(ig) ! note: zstd() is defined in surfdat .h96 zsig(ig)=pzsig(ig) ! note: zsig() is defined in surfdat .h97 zgam(ig)=pzgam(ig) ! note: zgam() is defined in surfdat .h98 zthe(ig)=pzthe(ig) ! note: zthe() is defined in surfdat .h94 CALL SCOPY(ngrid,airefi,1,area,1) 95 ! note: area() is defined in comgeomfi_h 96 97 98 DO ig=1,ngrid 99 albedodat(ig)=alb(ig) ! note: albedodat() is defined in surfdat_h 100 zmea(ig)=pzmea(ig) ! note: zmea() is defined in surfdat_h 101 zstd(ig)=pzstd(ig) ! note: zstd() is defined in surfdat_h 102 zsig(ig)=pzsig(ig) ! note: zsig() is defined in surfdat_h 103 zgam(ig)=pzgam(ig) ! note: zgam() is defined in surfdat_h 104 zthe(ig)=pzthe(ig) ! note: zthe() is defined in surfdat_h 99 105 ENDDO 100 106 101 inertiedat(:,:)=ith(:,:) ! note inertiedat() is defined in comsoil .h107 inertiedat(:,:)=ith(:,:) ! note inertiedat() is defined in comsoil_h 102 108 c 103 109 c things to store in the physics start file: … … 121 127 endif 122 128 c 123 ierr = NF_DEF_DIM (nid,"physical_points",ngrid mx,idim2)129 ierr = NF_DEF_DIM (nid,"physical_points",ngrid,idim2) 124 130 if (ierr.ne.NF_NOERR) then 125 131 WRITE(6,*)'physdem0: Problem defining physical_points dimension' … … 164 170 ENDDO 165 171 166 write(*,*) "physdem0: ngrid mx: ",ngridmx172 write(*,*) "physdem0: ngrid: ",ngrid 167 173 168 174 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc … … 170 176 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc 171 177 c Informations on the physics grid 172 tab_cntrl(1) = float(ngrid mx) ! number of nodes on physics grid173 tab_cntrl(2) = float(nlay ermx) ! number of atmospheric layers178 tab_cntrl(1) = float(ngrid) ! number of nodes on physics grid 179 tab_cntrl(2) = float(nlay) ! number of atmospheric layers 174 180 tab_cntrl(3) = day_ini + int(time) ! initial day 175 181 tab_cntrl(4) = time -int(time) ! initial time of day … … 260 266 261 267 262 ! write mid-layer depths mlayer() !known from comsoil .h268 ! write mid-layer depths mlayer() !known from comsoil_h 263 269 264 270 ierr = NF_REDEF (nid) ! Enter NetCDF (re-)define mode … … 464 470 #endif 465 471 466 ! surface roughness length (z0 is a common in surfdat .h)472 ! surface roughness length (z0 is a common in surfdat_h) 467 473 468 474 ierr = NF_REDEF (nid) … … 691 697 692 698 693 subroutine physdem1(filename,nsoil,n q,699 subroutine physdem1(filename,nsoil,ngrid,nlay,nq, 694 700 . phystep,time, 695 701 . tsurf,tsoil,co2ice,emis,q2,qsurf) 696 702 use infotrac, only: nqtot, tnom 703 use surfdat_h, only: emis 697 704 implicit none 698 705 c … … 721 728 #include "ener.h" 722 729 #include "netcdf.inc" 723 #include "dimphys.h"730 !#include "dimphys.h" 724 731 !#include "advtrac.h" 725 732 #include "callkeys.h" … … 732 739 733 740 REAL day_ini 734 INTEGER nsoil,nq741 INTEGER,INTENT(IN) :: nsoil,ngrid,nlay,nq 735 742 integer ierr,nvarid 736 743 737 744 c 738 745 REAL phystep,time 739 ! REAL champhys(ngrid mx)740 REAL tsurf(ngrid mx)746 ! REAL champhys(ngrid) 747 REAL tsurf(ngrid) 741 748 742 749 INTEGER nb … … 753 760 #include "clesph0.h" 754 761 #include "fxyprim.h" 755 #include "comgeomfi.h"756 #include "surfdat.h"757 #include "comsoil.h"762 !#include "comgeomfi.h" 763 !#include "surfdat.h" 764 !#include "comsoil.h" 758 765 #include "planete.h" 759 #include "dimradmars.h"760 #include "yomaer.h"766 !#include "dimradmars.h" 767 !#include "yomaer.h" 761 768 #include "comcstfi.h" 762 769 763 real co2ice(ngrid mx),tsoil(ngridmx,nsoil),emis(ngridmx)764 real q2(ngrid mx, llm+1),qsurf(ngridmx,nq)770 real co2ice(ngrid),tsoil(ngrid,nsoil),emis(ngrid) 771 real q2(ngrid,nlay+1),qsurf(ngrid,nq) 765 772 integer ig 766 773 … … 815 822 corner(2)=1 816 823 corner(3)=nb 817 edges(1)=ngrid mx824 edges(1)=ngrid 818 825 edges(2)=nsoil 819 826 edges(3)=1 … … 838 845 corner(2)=1 839 846 corner(3)=nb 840 edges(1)=ngrid mx847 edges(1)=ngrid 841 848 edges(2)=llm+1 842 849 edges(3)=1 … … 861 868 corner(1)=1 862 869 corner(2)=nb 863 edges(1)=ngrid mx870 edges(1)=ngrid 864 871 edges(2)=1 865 872 … … 946 953 write(*,*)'physdem1: moving surface water ice to index ',nqtot 947 954 do iq=nqtot,nqtot 948 qsurf(1:ngrid mx,iq)=qsurf(1:ngridmx,iq-1)949 qsurf(1:ngrid mx,iq-1)=0955 qsurf(1:ngrid,iq)=qsurf(1:ngrid,iq-1) 956 qsurf(1:ngrid,iq-1)=0 950 957 enddo 951 958 ENDIF -
trunk/LMDZ.MARS/libf/phymars/physiq.F
r1038 r1047 17 17 & igcm_dust_mass, igcm_dust_number, igcm_h2o2, 18 18 & nuice_ref, rho_ice, rho_dust, ref_r0 19 19 use comsoil_h, only: inertiedat, ! soil thermal inertia 20 & nsoilmx ! number of subsurface layers 21 use eofdump_mod, only: eofdump 22 use comgeomfi_h, only: long, lati, area 23 use comdiurn_h, only: sinlon, coslon, sinlat, coslat 24 use surfdat_h, only: phisfi, albedodat, zmea, zstd, zsig, zgam, 25 & zthe, z0, albedo_h2o_ice, 26 & frost_albedo_threshold 27 use comsaison_h, only: dist_sol, declin, mu0, fract 28 use slope_mod, only: theta_sl, psi_sl 29 use conc_mod, only: rnew, cpnew, mmean 20 30 IMPLICIT NONE 21 31 c======================================================================= … … 105 115 c ------- 106 116 c 107 c pdu(ngrid,nlayer mx) |108 c pdv(ngrid,nlayer mx) | Temporal derivative of the corresponding109 c pdt(ngrid,nlayer mx) | variables due to physical processes.110 c pdq(ngrid,nlayer mx,nq) |111 c pdpsrf(ngrid) 117 c pdu(ngrid,nlayer) | 118 c pdv(ngrid,nlayer) | Temporal derivative of the corresponding 119 c pdt(ngrid,nlayer) | variables due to physical processes. 120 c pdq(ngrid,nlayer,nq) | 121 c pdpsrf(ngrid) | 112 122 c tracerdyn call tracer in dynamical part of GCM ? 113 123 … … 120 130 #include "dimensions.h" 121 131 #include "dimphys.h" 122 #include "comgeomfi.h"123 #include "surfdat.h"124 #include "comsoil.h"125 #include "comdiurn.h"132 !#include "comgeomfi.h" 133 !#include "surfdat.h" 134 !#include "comsoil.h" 135 !#include "comdiurn.h" 126 136 #include "callkeys.h" 127 137 #include "comcstfi.h" 128 138 #include "planete.h" 129 #include "comsaison.h"139 !#include "comsaison.h" 130 140 #include "control.h" 131 #include "dimradmars.h" 141 !#include "dimradmars.h" 142 ! naerkind is set in scatterers.h (built when compiling with makegcm -s #) 143 #include"scatterers.h" 132 144 #include "comg1d.h" 133 145 !#include "tracer.h" … … 138 150 #include "param.h" 139 151 #include "param_v4.h" 140 #include "conc.h"152 !#include "conc.h" 141 153 142 154 #include "netcdf.inc" 143 155 144 #include "slope.h"156 !#include "slope.h" 145 157 146 158 #ifdef MESOSCALE … … 158 170 INTEGER ngrid,nlayer,nq 159 171 REAL ptimestep 160 REAL pplev(ngrid mx,nlayer+1),pplay(ngridmx,nlayer)161 REAL pphi(ngrid mx,nlayer)162 REAL pu(ngrid mx,nlayer),pv(ngridmx,nlayer)163 REAL pt(ngrid mx,nlayer),pq(ngridmx,nlayer,nq)164 REAL pw(ngrid mx,nlayer) !Mars pvervel transmit par dyn3d165 REAL zh(ngrid mx,nlayermx) ! potential temperature (K)172 REAL pplev(ngrid,nlayer+1),pplay(ngrid,nlayer) 173 REAL pphi(ngrid,nlayer) 174 REAL pu(ngrid,nlayer),pv(ngrid,nlayer) 175 REAL pt(ngrid,nlayer),pq(ngrid,nlayer,nq) 176 REAL pw(ngrid,nlayer) !Mars pvervel transmit par dyn3d 177 REAL zh(ngrid,nlayer) ! potential temperature (K) 166 178 LOGICAL firstcall,lastcall 167 179 … … 173 185 c -------- 174 186 c physical tendencies 175 REAL pdu(ngrid mx,nlayer),pdv(ngridmx,nlayer)176 REAL pdt(ngrid mx,nlayer),pdq(ngridmx,nlayer,nq)177 REAL pdpsrf(ngrid mx) ! surface pressure tendency187 REAL pdu(ngrid,nlayer),pdv(ngrid,nlayer) 188 REAL pdt(ngrid,nlayer),pdq(ngrid,nlayer,nq) 189 REAL pdpsrf(ngrid) ! surface pressure tendency 178 190 179 191 … … 181 193 c ---------------------- 182 194 c aerosol (dust or ice) extinction optical depth at reference wavelength 183 c "longrefvis" set in dimradmars .h, for one of the "naerkind" kind of195 c "longrefvis" set in dimradmars_mod , for one of the "naerkind" kind of 184 196 c aerosol optical properties : 185 REAL aerosol(ngridmx,nlayermx,naerkind)186 187 INTEGER day_ini ! Initial date of the run (sol since Ls=0)188 INTEGER icount ! counter of calls to physiq during the run.189 REAL tsurf(ngridmx)! Surface temperature (K)190 REAL tsoil(ngridmx,nsoilmx)! sub-surface temperatures (K)191 REAL co2ice(ngridmx)! co2 ice surface layer (kg.m-2)192 REAL albedo(ngridmx,2)! Surface albedo in each solar band193 REAL emis(ngridmx)! Thermal IR surface emissivity194 REAL dtrad(ngridmx,nlayermx)! Net atm. radiative heating rate (K.s-1)195 REAL fluxrad_sky(ngridmx)! rad. flux from sky absorbed by surface (W.m-2)196 REAL fluxrad(ngridmx)! Net radiative surface flux (W.m-2)197 REAL capcal(ngridmx)! surface heat capacity (J m-2 K-1)198 REAL fluxgrd(ngridmx)! surface conduction flux (W.m-2)197 REAL,SAVE,ALLOCATABLE :: aerosol(:,:,:) 198 199 INTEGER,SAVE :: day_ini ! Initial date of the run (sol since Ls=0) 200 INTEGER,SAVE :: icount ! counter of calls to physiq during the run. 201 REAL,SAVE,ALLOCATABLE :: tsurf(:) ! Surface temperature (K) 202 REAL,SAVE,ALLOCATABLE :: tsoil(:,:) ! sub-surface temperatures (K) 203 REAL,SAVE,ALLOCATABLE :: co2ice(:) ! co2 ice surface layer (kg.m-2) 204 REAL,SAVE,ALLOCATABLE :: albedo(:,:) ! Surface albedo in each solar band 205 REAL,SAVE,ALLOCATABLE :: emis(:) ! Thermal IR surface emissivity 206 REAL,SAVE,ALLOCATABLE :: dtrad(:,:) ! Net atm. radiative heating rate (K.s-1) 207 REAL,SAVE,ALLOCATABLE :: fluxrad_sky(:) ! rad. flux from sky absorbed by surface (W.m-2) 208 REAL,SAVE,ALLOCATABLE :: fluxrad(:) ! Net radiative surface flux (W.m-2) 209 REAL,SAVE,ALLOCATABLE :: capcal(:) ! surface heat capacity (J m-2 K-1) 210 REAL,SAVE,ALLOCATABLE :: fluxgrd(:) ! surface conduction flux (W.m-2) 199 211 REAL,ALLOCATABLE,SAVE :: qsurf(:,:) ! tracer on surface (e.g. kg.m-2) 200 REAL q2(ngridmx,nlayermx+1) ! Turbulent Kinetic Energy212 REAL,SAVE,ALLOCATABLE :: q2(:,:) ! Turbulent Kinetic Energy 201 213 202 214 c Variables used by the water ice microphysical scheme: 203 REAL rice(ngrid mx,nlayermx) ! Water ice geometric mean radius (m)204 REAL nuice(ngrid mx,nlayermx) ! Estimated effective variance215 REAL rice(ngrid,nlayer) ! Water ice geometric mean radius (m) 216 REAL nuice(ngrid,nlayer) ! Estimated effective variance 205 217 ! of the size distribution 206 real rsedcloud(ngrid mx,nlayermx) ! Cloud sedimentation radius207 real rhocloud(ngrid mx,nlayermx) ! Cloud density (kg.m-3)208 REAL surfdust(ngrid mx,nlayermx) ! dust surface area (m2/m3, if photochemistry)209 REAL surfice(ngrid mx,nlayermx) ! ice surface area (m2/m3, if photochemistry)210 REAL inertiesoil(ngrid mx,nsoilmx)! Time varying subsurface211 212 218 real rsedcloud(ngrid,nlayer) ! Cloud sedimentation radius 219 real rhocloud(ngrid,nlayer) ! Cloud density (kg.m-3) 220 REAL surfdust(ngrid,nlayer) ! dust surface area (m2/m3, if photochemistry) 221 REAL surfice(ngrid,nlayer) ! ice surface area (m2/m3, if photochemistry) 222 REAL inertiesoil(ngrid,nsoilmx) ! Time varying subsurface 223 ! thermal inertia (J.s-1/2.m-2.K-1) 224 ! (used only when tifeedback=.true.) 213 225 214 226 c Variables used by the slope model … … 219 231 REAL sky 220 232 221 SAVE day_ini, icount, time_phys 222 SAVE aerosol, tsurf,tsoil 223 SAVE co2ice,albedo,emis, q2 224 SAVE capcal,fluxgrd,dtrad,fluxrad,fluxrad_sky 225 226 REAL stephan 227 DATA stephan/5.67e-08/ ! Stephan Boltzman constant 228 SAVE stephan 233 REAL,PARAMETER :: stephan = 5.67e-08 ! Stephan Boltzman constant 229 234 230 235 c Local variables : … … 237 242 INTEGER l,ig,ierr,igout,iq,tapphys 238 243 239 REAL fluxsurf_lw(ngrid mx) !incident LW (IR) surface flux (W.m-2)240 REAL fluxsurf_sw(ngrid mx,2) !incident SW (solar) surface flux (W.m-2)241 REAL fluxtop_lw(ngrid mx) !Outgoing LW (IR) flux to space (W.m-2)242 REAL fluxtop_sw(ngrid mx,2) !Outgoing SW (solar) flux to space (W.m-2)243 REAL tauref(ngrid mx) ! Reference column optical depth at odpref244 REAL fluxsurf_lw(ngrid) !incident LW (IR) surface flux (W.m-2) 245 REAL fluxsurf_sw(ngrid,2) !incident SW (solar) surface flux (W.m-2) 246 REAL fluxtop_lw(ngrid) !Outgoing LW (IR) flux to space (W.m-2) 247 REAL fluxtop_sw(ngrid,2) !Outgoing SW (solar) flux to space (W.m-2) 248 REAL tauref(ngrid) ! Reference column optical depth at odpref 244 249 real,parameter :: odpref=610. ! DOD reference pressure (Pa) 245 REAL tau(ngrid mx,naerkind) ! Column dust optical depth at each point250 REAL tau(ngrid,naerkind) ! Column dust optical depth at each point 246 251 REAL zls ! solar longitude (rad) 247 252 REAL zday ! date (time since Ls=0, in martian days) 248 REAL zzlay(ngrid mx,nlayermx)! altitude at the middle of the layers249 REAL zzlev(ngrid mx,nlayermx+1)! altitude at layer boundaries253 REAL zzlay(ngrid,nlayer) ! altitude at the middle of the layers 254 REAL zzlev(ngrid,nlayer+1) ! altitude at layer boundaries 250 255 ! REAL latvl1,lonvl1 ! Viking Lander 1 point (for diagnostic) 251 256 252 257 c Tendancies due to various processes: 253 REAL dqsurf(ngrid mx,nq)254 REAL zdtlw(ngrid mx,nlayermx) ! (K/s)255 REAL zdtsw(ngrid mx,nlayermx) ! (K/s)256 ! REAL cldtlw(ngrid mx,nlayermx) ! (K/s) LW heating rate for clear area257 ! REAL cldtsw(ngrid mx,nlayermx) ! (K/s) SW heating rate for clear area258 REAL zdtnirco2(ngrid mx,nlayermx) ! (K/s)259 REAL zdtnlte(ngrid mx,nlayermx) ! (K/s)260 REAL zdtsurf(ngrid mx) ! (K/s)261 REAL zdtcloud(ngrid mx,nlayermx)262 REAL zdvdif(ngrid mx,nlayermx),zdudif(ngridmx,nlayermx) ! (m.s-2)263 REAL zdhdif(ngrid mx,nlayermx), zdtsdif(ngridmx) ! (K/s)264 REAL zdvadj(ngrid mx,nlayermx),zduadj(ngridmx,nlayermx) ! (m.s-2)265 REAL zdhadj(ngrid mx,nlayermx) ! (K/s)266 REAL zdtgw(ngrid mx,nlayermx) ! (K/s)267 REAL zdugw(ngrid mx,nlayermx),zdvgw(ngridmx,nlayermx) ! (m.s-2)268 REAL zdtc(ngrid mx,nlayermx),zdtsurfc(ngridmx)269 REAL zdvc(ngrid mx,nlayermx),zduc(ngridmx,nlayermx)270 271 REAL zdqdif(ngrid mx,nlayermx,nq), zdqsdif(ngridmx,nq)272 REAL zdqsed(ngrid mx,nlayermx,nq), zdqssed(ngridmx,nq)273 REAL zdqdev(ngrid mx,nlayermx,nq), zdqsdev(ngridmx,nq)274 REAL zdqadj(ngrid mx,nlayermx,nq)275 REAL zdqc(ngrid mx,nlayermx,nq)276 REAL zdqcloud(ngrid mx,nlayermx,nq)277 REAL zdqscloud(ngrid mx,nq)278 REAL zdqchim(ngrid mx,nlayermx,nq)279 REAL zdqschim(ngrid mx,nq)280 281 REAL zdteuv(ngrid mx,nlayermx) ! (K/s)282 REAL zdtconduc(ngrid mx,nlayermx) ! (K/s)283 REAL zdumolvis(ngrid mx,nlayermx)284 REAL zdvmolvis(ngrid mx,nlayermx)285 real zdqmoldiff(ngrid mx,nlayermx,nq)258 REAL dqsurf(ngrid,nq) 259 REAL zdtlw(ngrid,nlayer) ! (K/s) 260 REAL zdtsw(ngrid,nlayer) ! (K/s) 261 ! REAL cldtlw(ngrid,nlayer) ! (K/s) LW heating rate for clear area 262 ! REAL cldtsw(ngrid,nlayer) ! (K/s) SW heating rate for clear area 263 REAL zdtnirco2(ngrid,nlayer) ! (K/s) 264 REAL zdtnlte(ngrid,nlayer) ! (K/s) 265 REAL zdtsurf(ngrid) ! (K/s) 266 REAL zdtcloud(ngrid,nlayer) 267 REAL zdvdif(ngrid,nlayer),zdudif(ngrid,nlayer) ! (m.s-2) 268 REAL zdhdif(ngrid,nlayer), zdtsdif(ngrid) ! (K/s) 269 REAL zdvadj(ngrid,nlayer),zduadj(ngrid,nlayer) ! (m.s-2) 270 REAL zdhadj(ngrid,nlayer) ! (K/s) 271 REAL zdtgw(ngrid,nlayer) ! (K/s) 272 REAL zdugw(ngrid,nlayer),zdvgw(ngrid,nlayer) ! (m.s-2) 273 REAL zdtc(ngrid,nlayer),zdtsurfc(ngrid) 274 REAL zdvc(ngrid,nlayer),zduc(ngrid,nlayer) 275 276 REAL zdqdif(ngrid,nlayer,nq), zdqsdif(ngrid,nq) 277 REAL zdqsed(ngrid,nlayer,nq), zdqssed(ngrid,nq) 278 REAL zdqdev(ngrid,nlayer,nq), zdqsdev(ngrid,nq) 279 REAL zdqadj(ngrid,nlayer,nq) 280 REAL zdqc(ngrid,nlayer,nq) 281 REAL zdqcloud(ngrid,nlayer,nq) 282 REAL zdqscloud(ngrid,nq) 283 REAL zdqchim(ngrid,nlayer,nq) 284 REAL zdqschim(ngrid,nq) 285 286 REAL zdteuv(ngrid,nlayer) ! (K/s) 287 REAL zdtconduc(ngrid,nlayer) ! (K/s) 288 REAL zdumolvis(ngrid,nlayer) 289 REAL zdvmolvis(ngrid,nlayer) 290 real zdqmoldiff(ngrid,nlayer,nq) 286 291 287 292 c Local variable for local intermediate calcul: 288 REAL zflubid(ngrid mx)289 REAL zplanck(ngrid mx),zpopsk(ngridmx,nlayermx)290 REAL zdum1(ngrid mx,nlayermx)291 REAL zdum2(ngrid mx,nlayermx)293 REAL zflubid(ngrid) 294 REAL zplanck(ngrid),zpopsk(ngrid,nlayer) 295 REAL zdum1(ngrid,nlayer) 296 REAL zdum2(ngrid,nlayer) 292 297 REAL ztim1,ztim2,ztim3, z1,z2 293 298 REAL ztime_fin 294 REAL zdh(ngrid mx,nlayermx)299 REAL zdh(ngrid,nlayer) 295 300 INTEGER length 296 301 PARAMETER (length=100) … … 298 303 c local variables only used for diagnostic (output in file "diagfi" or "stats") 299 304 c ----------------------------------------------------------------------------- 300 REAL ps(ngrid mx), zt(ngridmx,nlayermx)301 REAL zu(ngrid mx,nlayermx),zv(ngridmx,nlayermx)302 REAL zq(ngrid mx,nlayermx,nq)303 REAL fluxtop_sw_tot(ngrid mx), fluxsurf_sw_tot(ngridmx)305 REAL ps(ngrid), zt(ngrid,nlayer) 306 REAL zu(ngrid,nlayer),zv(ngrid,nlayer) 307 REAL zq(ngrid,nlayer,nq) 308 REAL fluxtop_sw_tot(ngrid), fluxsurf_sw_tot(ngrid) 304 309 character*2 str2 305 310 ! character*5 str5 306 real zdtdif(ngridmx,nlayermx), zdtadj(ngridmx,nlayermx) 307 REAL tauscaling(ngridmx) ! Convertion factor for qdust and Ndust 308 SAVE tauscaling ! in case iradia NE 1 309 real rdust(ngridmx,nlayermx) ! dust geometric mean radius (m) 311 real zdtdif(ngrid,nlayer), zdtadj(ngrid,nlayer) 312 REAL,SAVE,ALLOCATABLE :: tauscaling(:) ! Convertion factor for qdust and Ndust 313 real rdust(ngrid,nlayer) ! dust geometric mean radius (m) 310 314 integer igmin, lmin 311 315 logical tdiag 312 316 313 real co2col(ngrid mx) ! CO2 column317 real co2col(ngrid) ! CO2 column 314 318 ! pplev and pplay are dynamical inputs and must not be modified in the physics. 315 319 ! instead, use zplay and zplev : 316 REAL zplev(ngrid,nlayer mx+1),zplay(ngrid,nlayermx)320 REAL zplev(ngrid,nlayer+1),zplay(ngrid,nlayer) 317 321 ! REAL zstress(ngrid),cd 318 real tmean, zlocal(nlayer mx)319 real rho(ngrid mx,nlayermx) ! density320 real vmr(ngrid mx,nlayermx) ! volume mixing ratio321 real rhopart(ngrid mx,nlayermx) ! number density of a given species322 real colden(ngrid mx,nq) ! vertical column of tracers323 REAL mtot(ngrid mx) ! Total mass of water vapor (kg/m2)324 REAL icetot(ngrid mx) ! Total mass of water ice (kg/m2)325 REAL Nccntot(ngrid mx) ! Total number of ccn (nbr/m2)326 REAL Mccntot(ngrid mx) ! Total mass of ccn (kg/m2)327 REAL rave(ngrid mx) ! Mean water ice effective radius (m)328 REAL opTES(ngrid mx,nlayermx)! abs optical depth at 825 cm-1329 REAL tauTES(ngrid mx) ! column optical depth at 825 cm-1322 real tmean, zlocal(nlayer) 323 real rho(ngrid,nlayer) ! density 324 real vmr(ngrid,nlayer) ! volume mixing ratio 325 real rhopart(ngrid,nlayer) ! number density of a given species 326 real colden(ngrid,nq) ! vertical column of tracers 327 REAL mtot(ngrid) ! Total mass of water vapor (kg/m2) 328 REAL icetot(ngrid) ! Total mass of water ice (kg/m2) 329 REAL Nccntot(ngrid) ! Total number of ccn (nbr/m2) 330 REAL Mccntot(ngrid) ! Total mass of ccn (kg/m2) 331 REAL rave(ngrid) ! Mean water ice effective radius (m) 332 REAL opTES(ngrid,nlayer) ! abs optical depth at 825 cm-1 333 REAL tauTES(ngrid) ! column optical depth at 825 cm-1 330 334 REAL Qabsice ! Water ice absorption coefficient 331 REAL taucloudtes(ngrid mx)! Cloud opacity at infrared335 REAL taucloudtes(ngrid) ! Cloud opacity at infrared 332 336 ! reference wavelength using 333 337 ! Qabs instead of Qext 334 338 ! (direct comparison with TES) 335 339 336 REAL dqdustsurf(ngrid mx) ! surface q dust flux (kg/m2/s)337 REAL dndustsurf(ngrid mx) ! surface n dust flux (number/m2/s)338 REAL ndust(ngrid mx,nlayermx) ! true n dust (kg/kg)339 REAL qdust(ngrid mx,nlayermx) ! true q dust (kg/kg)340 REAL nccn(ngrid mx,nlayermx) ! true n ccn (kg/kg)341 REAL qccn(ngrid mx,nlayermx) ! true q ccn (kg/kg)340 REAL dqdustsurf(ngrid) ! surface q dust flux (kg/m2/s) 341 REAL dndustsurf(ngrid) ! surface n dust flux (number/m2/s) 342 REAL ndust(ngrid,nlayer) ! true n dust (kg/kg) 343 REAL qdust(ngrid,nlayer) ! true q dust (kg/kg) 344 REAL nccn(ngrid,nlayer) ! true n ccn (kg/kg) 345 REAL qccn(ngrid,nlayer) ! true q ccn (kg/kg) 342 346 343 347 c Test 1d/3d scavenging 344 real h2otot(ngrid mx)345 REAL satu(ngrid mx,nlayermx) ! satu ratio for output346 REAL zqsat(ngrid mx,nlayermx) ! saturation347 348 REAL time_phys348 real h2otot(ngrid) 349 REAL satu(ngrid,nlayer) ! satu ratio for output 350 REAL zqsat(ngrid,nlayer) ! saturation 351 352 REAL,SAVE :: time_phys 349 353 350 354 ! Added for new NLTE scheme 351 355 352 real co2vmr_gcm(ngrid mx,nlayermx)353 real n2vmr_gcm(ngrid mx,nlayermx)354 real ovmr_gcm(ngrid mx,nlayermx)355 real covmr_gcm(ngrid mx,nlayermx)356 real co2vmr_gcm(ngrid,nlayer) 357 real n2vmr_gcm(ngrid,nlayer) 358 real ovmr_gcm(ngrid,nlayer) 359 real covmr_gcm(ngrid,nlayer) 356 360 357 361 358 362 c Variables for PBL 359 REAL zz1(ngrid mx)360 REAL lmax_th_out(ngrid mx),zmax_th(ngridmx)361 REAL, SAVE :: wstar(ngridmx)362 REAL, SAVE :: hfmax_th(ngridmx)363 REAL pdu_th(ngrid mx,nlayermx),pdv_th(ngridmx,nlayermx)364 REAL pdt_th(ngrid mx,nlayermx),pdq_th(ngridmx,nlayermx,nq)365 INTEGER lmax_th(ngrid mx),dimout,n_out,n363 REAL zz1(ngrid) 364 REAL lmax_th_out(ngrid),zmax_th(ngrid) 365 REAL,SAVE,ALLOCATABLE :: wstar(:) 366 REAL,SAVE,ALLOCATABLE :: hfmax_th(:) 367 REAL pdu_th(ngrid,nlayer),pdv_th(ngrid,nlayer) 368 REAL pdt_th(ngrid,nlayer),pdq_th(ngrid,nlayer,nq) 369 INTEGER lmax_th(ngrid),dimout,n_out,n 366 370 CHARACTER(50) zstring 367 REAL dtke_th(ngrid mx,nlayermx+1)368 REAL zcdv(ngrid mx), zcdh(ngridmx)371 REAL dtke_th(ngrid,nlayer+1) 372 REAL zcdv(ngrid), zcdh(ngrid) 369 373 REAL, ALLOCATABLE, DIMENSION(:,:) :: T_out 370 374 REAL, ALLOCATABLE, DIMENSION(:,:) :: u_out ! Interpolated teta and u at z_out 371 REAL u_out1(ngrid mx)372 REAL T_out1(ngrid mx)375 REAL u_out1(ngrid) 376 REAL T_out1(ngrid) 373 377 REAL, ALLOCATABLE, DIMENSION(:) :: z_out ! height of interpolation between z0 and z1 [meters] 374 REAL ustar(ngrid mx),tstar(ngridmx) ! friction velocity and friction potential temp375 REAL L_mo(ngrid mx),vhf(ngridmx),vvv(ngridmx)376 ! REAL zu2(ngrid mx)377 REAL sensibFlux(ngrid mx)378 REAL ustar(ngrid),tstar(ngrid) ! friction velocity and friction potential temp 379 REAL L_mo(ngrid),vhf(ngrid),vvv(ngrid) 380 ! REAL zu2(ngrid) 381 REAL sensibFlux(ngrid) 378 382 379 383 c======================================================================= … … 388 392 ! allocate local (saved) arrays: 389 393 allocate(qsurf(ngrid,nq)) 394 allocate(tsoil(ngrid,nsoilmx)) 395 allocate(tsurf(ngrid)) 396 allocate(aerosol(ngrid,nlayer,naerkind)) 397 allocate(co2ice(ngrid)) 398 allocate(albedo(ngrid,2)) 399 allocate(emis(ngrid)) 400 allocate(dtrad(ngrid,nlayer)) 401 allocate(fluxrad_sky(ngrid)) 402 allocate(fluxrad(ngrid)) 403 allocate(capcal(ngrid)) 404 allocate(fluxgrd(ngrid)) 405 allocate(q2(ngrid,nlayer+1)) 406 allocate(tauscaling(ngrid)) 407 allocate(wstar(ngrid)) 408 allocate(hfmax_th(ngrid)) 390 409 391 410 c variables set to 0 … … 406 425 ! Read netcdf initial physical parameters. 407 426 CALL phyetat0 ("startfi.nc",0,0, 408 & nsoilmx,n q,427 & nsoilmx,ngrid,nlayer,nq, 409 428 & day_ini,time_phys, 410 429 & tsurf,tsoil,emis,q2,qsurf,co2ice) … … 469 488 470 489 if (.not.callthermos .and. .not.photochem) then 471 do l=1,nlayer mx472 do ig=1,ngrid mx490 do l=1,nlayer 491 do ig=1,ngrid 473 492 rnew(ig,l)=r 474 493 cpnew(ig,l)=cpp … … 482 501 if(thermochem) call chemthermos_readini 483 502 484 IF (tracer.AND.water.AND.(ngrid mx.NE.1)) THEN503 IF (tracer.AND.water.AND.(ngrid.NE.1)) THEN 485 504 write(*,*)"physiq: water_param Surface water ice albedo:", 486 505 . albedo_h2o_ice … … 488 507 489 508 #ifndef MESOSCALE 490 if (callslope) call getslopes( phisfi)509 if (callslope) call getslopes(ngrid,phisfi) 491 510 492 call physdem0("restartfi.nc",long,lati,nsoilmx,n q,511 call physdem0("restartfi.nc",long,lati,nsoilmx,ngrid,nlayer,nq, 493 512 . ptimestep,pday,time_phys,area, 494 513 . albedodat,inertiedat,zmea,zstd,zsig,zgam,zthe) … … 503 522 c --------------------------------------------------- 504 523 c 505 IF (ngrid.NE.ngridmx) THEN506 PRINT*,'STOP in PHYSIQ'507 PRINT*,'Probleme de dimensions :'508 PRINT*,'ngrid = ',ngrid509 PRINT*,'ngridmx = ',ngridmx510 STOP511 ENDIF512 524 513 525 c Initialize various variables … … 580 592 581 593 if(photochem.or.callthermos) then 582 call concentrations(nq,zplay,pt,pdt,pq,pdq,ptimestep) 594 call concentrations(ngrid,nlayer,nq, 595 & zplay,pt,pdt,pq,pdq,ptimestep) 583 596 endif 584 597 #endif … … 812 825 c Richardson based surface layer model. 813 826 IF ( .not.calltherm .and. callrichsl ) THEN 814 DO ig=1, ngrid mx827 DO ig=1, ngrid 815 828 IF (zh(ig,1) .lt. tsurf(ig)) THEN 816 829 wstar(ig)=1. … … 1226 1239 $ surfdust, surfice) 1227 1240 ! call photochemistry 1228 call calchim(n q,1241 call calchim(ngrid,nlayer,nq, 1229 1242 & ptimestep,zplay,zplev,pt,pdt,dist_sol,mu0, 1230 1243 $ zzlev,zzlay,zday,pq,pdq,zdqchim,zdqschim, … … 1293 1306 1294 1307 if (callthermos) then 1295 call thermosphere( zplev,zplay,dist_sol,1308 call thermosphere(ngrid,nlayer,nq,zplev,zplay,dist_sol, 1296 1309 $ mu0,ptimestep,ptime,zday,tsurf,zzlev,zzlay, 1297 1310 & pt,pq,pu,pv,pdt,pdq, … … 1331 1344 1332 1345 1333 IF (tracer.AND.water.AND.(ngrid mx.NE.1)) THEN1346 IF (tracer.AND.water.AND.(ngrid.NE.1)) THEN 1334 1347 #ifndef MESOSCALE 1335 1348 if (caps.and.(obliquit.lt.27.)) then … … 1356 1369 endif 1357 1370 enddo ! of do ig=1,ngrid 1358 ENDIF ! of IF (tracer.AND.water.AND.(ngrid mx.NE.1))1371 ENDIF ! of IF (tracer.AND.water.AND.(ngrid.NE.1)) 1359 1372 1360 1373 c … … 1415 1428 ! Potential Temperature 1416 1429 1417 DO ig=1,ngrid mx1418 DO l=1,nlayer mx1430 DO ig=1,ngrid 1431 DO l=1,nlayer 1419 1432 zh(ig,l) = zt(ig,l)*(zplev(ig,1)/zplay(ig,l))**rcp 1420 1433 ENDDO … … 1553 1566 1554 1567 1555 call physdem1("restartfi.nc",nsoilmx,n q,1568 call physdem1("restartfi.nc",nsoilmx,ngrid,nlayer,nq, 1556 1569 . ptimestep,ztime_fin, 1557 1570 . tsurf,tsoil,co2ice,emis,q2,qsurf) … … 1598 1611 tauTES(:)=0 1599 1612 do ig=1,ngrid 1600 do l=1,nlayer mx1613 do l=1,nlayer 1601 1614 mtot(ig) = mtot(ig) + 1602 1615 & zq(ig,l,igcm_h2o_vap) * … … 1619 1632 c if (icetot(ig)*1e3.lt.0.01) rave(ig)=0. 1620 1633 enddo 1621 call watersat(ngrid mx*nlayermx,zt,zplay,zqsat)1634 call watersat(ngrid*nlayer,zt,zplay,zqsat) 1622 1635 satu(:,:) = zq(:,:,igcm_h2o_vap)/zqsat(:,:) 1623 1636 … … 1627 1640 rave(:)=0 1628 1641 do ig=1,ngrid 1629 do l=1,nlayer mx1642 do l=1,nlayer 1630 1643 Nccntot(ig) = Nccntot(ig) + 1631 1644 & zq(ig,l,igcm_ccn_number)*tauscaling(ig) … … 1649 1662 rave(:)=0 1650 1663 do ig=1,ngrid 1651 do l=1,nlayer mx1664 do l=1,nlayer 1652 1665 rave(ig) = rave(ig) + 1653 1666 & zq(ig,l,igcm_h2o_ice) * … … 1722 1735 if (tracer) then 1723 1736 if (water) then 1724 vmr=zq(1:ngrid mx,1:nlayermx,igcm_h2o_vap)1725 & *mmean(1:ngrid mx,1:nlayermx)/mmol(igcm_h2o_vap)1737 vmr=zq(1:ngrid,1:nlayer,igcm_h2o_vap) 1738 & *mmean(1:ngrid,1:nlayer)/mmol(igcm_h2o_vap) 1726 1739 call wstats(ngrid,"vmr_h2ovap", 1727 1740 & "H2O vapor volume mixing ratio","mol/mol", 1728 1741 & 3,vmr) 1729 vmr=zq(1:ngrid mx,1:nlayermx,igcm_h2o_ice)1730 & *mmean(1:ngrid mx,1:nlayermx)/mmol(igcm_h2o_ice)1742 vmr=zq(1:ngrid,1:nlayer,igcm_h2o_ice) 1743 & *mmean(1:ngrid,1:nlayer)/mmol(igcm_h2o_ice) 1731 1744 call wstats(ngrid,"vmr_h2oice", 1732 1745 & "H2O ice volume mixing ratio","mol/mol", 1733 1746 & 3,vmr) 1734 vmr=zqsat(1:ngrid mx,1:nlayermx)1735 & *mmean(1:ngrid mx,1:nlayermx)/mmol(igcm_h2o_vap)1747 vmr=zqsat(1:ngrid,1:nlayer) 1748 & *mmean(1:ngrid,1:nlayer)/mmol(igcm_h2o_vap) 1736 1749 call wstats(ngrid,"vmr_h2osat", 1737 1750 & "saturation volume mixing ratio","mol/mol", … … 1766 1779 & 2,tauTES) 1767 1780 else 1768 call wstats(ngrid mx,'tauTES',1781 call wstats(ngrid,'tauTES', 1769 1782 & 'tau abs 825 cm-1', 1770 1783 & '',2,taucloudtes) … … 1776 1789 if (dustbin.ne.0) then 1777 1790 1778 call wstats(ngrid mx,'tau','taudust','SI',2,tau(1,1))1791 call wstats(ngrid,'tau','taudust','SI',2,tau(1,1)) 1779 1792 1780 1793 if (doubleq) then 1781 c call wstats(ngrid mx,'qsurf','qsurf',1794 c call wstats(ngrid,'qsurf','qsurf', 1782 1795 c & 'kg.m-2',2,qsurf(1,igcm_dust_mass)) 1783 c call wstats(ngrid mx,'Nsurf','N particles',1796 c call wstats(ngrid,'Nsurf','N particles', 1784 1797 c & 'N.m-2',2,qsurf(1,igcm_dust_number)) 1785 c call wstats(ngrid mx,'dqsdev','ddevil lift',1798 c call wstats(ngrid,'dqsdev','ddevil lift', 1786 1799 c & 'kg.m-2.s-1',2,zdqsdev(1,1)) 1787 c call wstats(ngrid mx,'dqssed','sedimentation',1800 c call wstats(ngrid,'dqssed','sedimentation', 1788 1801 c & 'kg.m-2.s-1',2,zdqssed(1,1)) 1789 c call wstats(ngrid mx,'dqsdif','diffusion',1802 c call wstats(ngrid,'dqsdif','diffusion', 1790 1803 c & 'kg.m-2.s-1',2,zdqsdif(1,1)) 1791 call wstats(ngrid mx,'dqsdust',1804 call wstats(ngrid,'dqsdust', 1792 1805 & 'deposited surface dust mass', 1793 1806 & 'kg.m-2.s-1',2,dqdustsurf) 1794 call wstats(ngrid mx,'dqndust',1807 call wstats(ngrid,'dqndust', 1795 1808 & 'deposited surface dust number', 1796 1809 & 'number.m-2.s-1',2,dndustsurf) 1797 call wstats(ngrid mx,'reffdust','reffdust',1810 call wstats(ngrid,'reffdust','reffdust', 1798 1811 & 'm',3,rdust*ref_r0) 1799 call wstats(ngrid mx,'dustq','Dust mass mr',1812 call wstats(ngrid,'dustq','Dust mass mr', 1800 1813 & 'kg/kg',3,qdust) 1801 call wstats(ngrid mx,'dustN','Dust number',1814 call wstats(ngrid,'dustN','Dust number', 1802 1815 & 'part/kg',3,ndust) 1803 1816 else 1804 1817 do iq=1,dustbin 1805 1818 write(str2(1:2),'(i2.2)') iq 1806 call wstats(ngrid mx,'q'//str2,'mix. ratio',1819 call wstats(ngrid,'q'//str2,'mix. ratio', 1807 1820 & 'kg/kg',3,zq(1,1,iq)) 1808 call wstats(ngrid mx,'qsurf'//str2,'qsurf',1821 call wstats(ngrid,'qsurf'//str2,'qsurf', 1809 1822 & 'kg.m-2',2,qsurf(1,iq)) 1810 1823 end do … … 1812 1825 1813 1826 if (scavenging) then 1814 call wstats(ngrid mx,'ccnq','CCN mass mr',1827 call wstats(ngrid,'ccnq','CCN mass mr', 1815 1828 & 'kg/kg',3,qccn) 1816 call wstats(ngrid mx,'ccnN','CCN number',1829 call wstats(ngrid,'ccnN','CCN number', 1817 1830 & 'part/kg',3,nccn) 1818 1831 endif ! (scavenging) … … 1895 1908 qsurfice(1:ngrid) = qsurf(1:ngrid,igcm_h2o_ice) 1896 1909 vmr=1.e6 * zq(1:ngrid,1:nlayer,igcm_h2o_ice) 1897 . *mmean(1:ngrid mx,1:nlayermx) / mmol(igcm_h2o_ice)1910 . *mmean(1:ngrid,1:nlayer) / mmol(igcm_h2o_ice) 1898 1911 ENDIF 1899 1912 !! Dust quantity integration along the vertical axe … … 1901 1914 IF (igcm_dust_mass .ne. 0) THEN 1902 1915 do ig=1,ngrid 1903 do l=1,nlayer mx1916 do l=1,nlayer 1904 1917 dustot(ig) = dustot(ig) + 1905 1918 & zq(ig,l,igcm_dust_mass) … … 1953 1966 c call WRITEDIAGFI(ngrid,"ssurf","Surface stress","N.m-2",2, 1954 1967 c & zstress) 1955 c call WRITEDIAGFI(ngrid mx,'sw_htrt','sw heat. rate',1968 c call WRITEDIAGFI(ngrid,'sw_htrt','sw heat. rate', 1956 1969 c & 'w.m-2',3,zdtsw) 1957 c call WRITEDIAGFI(ngrid mx,'lw_htrt','lw heat. rate',1970 c call WRITEDIAGFI(ngrid,'lw_htrt','lw heat. rate', 1958 1971 c & 'w.m-2',3,zdtlw) 1959 1972 if (.not.activice) then 1960 CALL WRITEDIAGFI(ngrid mx,'tauTESap',1973 CALL WRITEDIAGFI(ngrid,'tauTESap', 1961 1974 & 'tau abs 825 cm-1', 1962 1975 & '',2,tauTES) 1963 1976 else 1964 CALL WRITEDIAGFI(ngrid mx,'tauTES',1977 CALL WRITEDIAGFI(ngrid,'tauTES', 1965 1978 & 'tau abs 825 cm-1', 1966 1979 & '',2,taucloudtes) … … 1998 2011 ! Compute co2 column 1999 2012 co2col(:)=0 2000 do l=1,nlayer mx2013 do l=1,nlayer 2001 2014 do ig=1,ngrid 2002 2015 co2col(ig)=co2col(ig)+ … … 2016 2029 #ifdef MESOINI 2017 2030 !!!! waterice = q01, voir readmeteo.F90 2018 call WRITEDIAGFI(ngrid mx,'q01',noms(igcm_h2o_ice),2031 call WRITEDIAGFI(ngrid,'q01',noms(igcm_h2o_ice), 2019 2032 & 'kg/kg',3, 2020 & zq(1:ngrid mx,1:nlayermx,igcm_h2o_ice))2033 & zq(1:ngrid,1:nlayer,igcm_h2o_ice)) 2021 2034 !!!! watervapor = q02, voir readmeteo.F90 2022 call WRITEDIAGFI(ngrid mx,'q02',noms(igcm_h2o_vap),2035 call WRITEDIAGFI(ngrid,'q02',noms(igcm_h2o_vap), 2023 2036 & 'kg/kg',3, 2024 & zq(1:ngrid mx,1:nlayermx,igcm_h2o_vap))2037 & zq(1:ngrid,1:nlayer,igcm_h2o_vap)) 2025 2038 !!!! surface waterice qsurf02 (voir readmeteo) 2026 call WRITEDIAGFI(ngrid mx,'qsurf02','surface tracer',2039 call WRITEDIAGFI(ngrid,'qsurf02','surface tracer', 2027 2040 & 'kg.m-2',2, 2028 & qsurf(1:ngrid mx,igcm_h2o_ice))2041 & qsurf(1:ngrid,igcm_h2o_ice)) 2029 2042 #endif 2030 2043 2031 CALL WRITEDIAGFI(ngrid mx,'mtot',2044 CALL WRITEDIAGFI(ngrid,'mtot', 2032 2045 & 'total mass of water vapor', 2033 2046 & 'kg/m2',2,mtot) 2034 CALL WRITEDIAGFI(ngrid mx,'icetot',2047 CALL WRITEDIAGFI(ngrid,'icetot', 2035 2048 & 'total mass of water ice', 2036 2049 & 'kg/m2',2,icetot) 2037 vmr=zq(1:ngrid mx,1:nlayermx,igcm_h2o_ice)2038 & *mmean(1:ngrid mx,1:nlayermx)/mmol(igcm_h2o_ice)2039 call WRITEDIAGFI(ngrid mx,'vmr_h2oice','h2o ice vmr',2050 vmr=zq(1:ngrid,1:nlayer,igcm_h2o_ice) 2051 & *mmean(1:ngrid,1:nlayer)/mmol(igcm_h2o_ice) 2052 call WRITEDIAGFI(ngrid,'vmr_h2oice','h2o ice vmr', 2040 2053 & 'mol/mol',3,vmr) 2041 vmr=zq(1:ngrid mx,1:nlayermx,igcm_h2o_vap)2042 & *mmean(1:ngrid mx,1:nlayermx)/mmol(igcm_h2o_vap)2043 call WRITEDIAGFI(ngrid mx,'vmr_h2ovap','h2o vap vmr',2054 vmr=zq(1:ngrid,1:nlayer,igcm_h2o_vap) 2055 & *mmean(1:ngrid,1:nlayer)/mmol(igcm_h2o_vap) 2056 call WRITEDIAGFI(ngrid,'vmr_h2ovap','h2o vap vmr', 2044 2057 & 'mol/mol',3,vmr) 2045 CALL WRITEDIAGFI(ngrid mx,'reffice',2058 CALL WRITEDIAGFI(ngrid,'reffice', 2046 2059 & 'Mean reff', 2047 2060 & 'm',2,rave) … … 2052 2065 & "mass condensation nuclei","kg/m2", 2053 2066 & 2,Mccntot) 2054 call WRITEDIAGFI(ngrid mx,'rice','Ice particle size',2067 call WRITEDIAGFI(ngrid,'rice','Ice particle size', 2055 2068 & 'm',3,rice) 2056 call WRITEDIAGFI(ngrid mx,'h2o_ice_s',2069 call WRITEDIAGFI(ngrid,'h2o_ice_s', 2057 2070 & 'surface h2o_ice', 2058 2071 & 'kg.m-2',2,qsurf(1,igcm_h2o_ice)) 2059 CALL WRITEDIAGFI(ngrid mx,'albedo',2072 CALL WRITEDIAGFI(ngrid,'albedo', 2060 2073 & 'albedo', 2061 2074 & '',2,albedo(1,1)) 2062 2075 if (tifeedback) then 2063 call WRITEDIAGSOIL(ngrid mx,"soiltemp",2076 call WRITEDIAGSOIL(ngrid,"soiltemp", 2064 2077 & "Soil temperature","K", 2065 2078 & 3,tsoil) 2066 call WRITEDIAGSOIL(ngrid mx,'soilti',2079 call WRITEDIAGSOIL(ngrid,'soilti', 2067 2080 & 'Soil Thermal Inertia', 2068 2081 & 'J.s-1/2.m-2.K-1',3,inertiesoil) … … 2074 2087 iq=nq 2075 2088 c write(str2(1:2),'(i2.2)') iq 2076 c call WRITEDIAGFI(ngrid mx,'dqs'//str2,'dqscloud',2089 c call WRITEDIAGFI(ngrid,'dqs'//str2,'dqscloud', 2077 2090 c & 'kg.m-2',2,zdqscloud(1,iq)) 2078 c call WRITEDIAGFI(ngrid mx,'dqch'//str2,'var chim',2091 c call WRITEDIAGFI(ngrid,'dqch'//str2,'var chim', 2079 2092 c & 'kg/kg',3,zdqchim(1,1,iq)) 2080 c call WRITEDIAGFI(ngrid mx,'dqd'//str2,'var dif',2093 c call WRITEDIAGFI(ngrid,'dqd'//str2,'var dif', 2081 2094 c & 'kg/kg',3,zdqdif(1,1,iq)) 2082 c call WRITEDIAGFI(ngrid mx,'dqa'//str2,'var adj',2095 c call WRITEDIAGFI(ngrid,'dqa'//str2,'var adj', 2083 2096 c & 'kg/kg',3,zdqadj(1,1,iq)) 2084 c call WRITEDIAGFI(ngrid mx,'dqc'//str2,'var c',2097 c call WRITEDIAGFI(ngrid,'dqc'//str2,'var c', 2085 2098 c & 'kg/kg',3,zdqc(1,1,iq)) 2086 2099 endif !(water.and..not.photochem) … … 2091 2104 c ---------------------------------------------------------- 2092 2105 2093 call WRITEDIAGFI(ngrid mx,'tauref',2106 call WRITEDIAGFI(ngrid,'tauref', 2094 2107 & 'Dust ref opt depth','NU',2,tauref) 2095 2108 2096 2109 if (tracer.and.(dustbin.ne.0)) then 2097 call WRITEDIAGFI(ngrid mx,'tau','taudust','SI',2,tau(1,1))2110 call WRITEDIAGFI(ngrid,'tau','taudust','SI',2,tau(1,1)) 2098 2111 if (doubleq) then 2099 c call WRITEDIAGFI(ngrid mx,'qsurf','qsurf',2112 c call WRITEDIAGFI(ngrid,'qsurf','qsurf', 2100 2113 c & 'kg.m-2',2,qsurf(1,igcm_dust_mass)) 2101 c call WRITEDIAGFI(ngrid mx,'Nsurf','N particles',2114 c call WRITEDIAGFI(ngrid,'Nsurf','N particles', 2102 2115 c & 'N.m-2',2,qsurf(1,igcm_dust_number)) 2103 c call WRITEDIAGFI(ngrid mx,'dqsdev','ddevil lift',2116 c call WRITEDIAGFI(ngrid,'dqsdev','ddevil lift', 2104 2117 c & 'kg.m-2.s-1',2,zdqsdev(1,1)) 2105 c call WRITEDIAGFI(ngrid mx,'dqssed','sedimentation',2118 c call WRITEDIAGFI(ngrid,'dqssed','sedimentation', 2106 2119 c & 'kg.m-2.s-1',2,zdqssed(1,1)) 2107 c call WRITEDIAGFI(ngrid mx,'dqsdif','diffusion',2120 c call WRITEDIAGFI(ngrid,'dqsdif','diffusion', 2108 2121 c & 'kg.m-2.s-1',2,zdqsdif(1,1)) 2109 call WRITEDIAGFI(ngrid mx,'dqsdust',2122 call WRITEDIAGFI(ngrid,'dqsdust', 2110 2123 & 'deposited surface dust mass', 2111 2124 & 'kg.m-2.s-1',2,dqdustsurf) 2112 call WRITEDIAGFI(ngrid mx,'dqndust',2125 call WRITEDIAGFI(ngrid,'dqndust', 2113 2126 & 'deposited surface dust number', 2114 2127 & 'number.m-2.s-1',2,dndustsurf) 2115 call WRITEDIAGFI(ngrid mx,'reffdust','reffdust',2128 call WRITEDIAGFI(ngrid,'reffdust','reffdust', 2116 2129 & 'm',3,rdust*ref_r0) 2117 call WRITEDIAGFI(ngrid mx,'dustq','Dust mass mr',2130 call WRITEDIAGFI(ngrid,'dustq','Dust mass mr', 2118 2131 & 'kg/kg',3,qdust) 2119 call WRITEDIAGFI(ngrid mx,'dustN','Dust number',2132 call WRITEDIAGFI(ngrid,'dustN','Dust number', 2120 2133 & 'part/kg',3,ndust) 2121 2134 #ifdef MESOINI 2122 2135 ! !!! to initialize mesoscale we need scaled variables 2123 2136 ! !!! because this must correspond to starting point for tracers 2124 ! call WRITEDIAGFI(ngrid mx,'dustq','Dust mass mr',2125 ! & 'kg/kg',3,pq(1:ngrid mx,1:nlayermx,igcm_dust_mass))2126 ! call WRITEDIAGFI(ngrid mx,'dustN','Dust number',2127 ! & 'part/kg',3,pq(1:ngrid mx,1:nlayermx,igcm_dust_number))2128 ! call WRITEDIAGFI(ngrid mx,'ccn','Nuclei mass mr',2129 ! & 'kg/kg',3,pq(1:ngrid mx,1:nlayermx,igcm_ccn_mass))2130 ! call WRITEDIAGFI(ngrid mx,'ccnN','Nuclei number',2131 ! & 'part/kg',3,pq(1:ngrid mx,1:nlayermx,igcm_ccn_number))2132 call WRITEDIAGFI(ngrid mx,'dustq','Dust mass mr',2137 ! call WRITEDIAGFI(ngrid,'dustq','Dust mass mr', 2138 ! & 'kg/kg',3,pq(1:ngrid,1:nlayer,igcm_dust_mass)) 2139 ! call WRITEDIAGFI(ngrid,'dustN','Dust number', 2140 ! & 'part/kg',3,pq(1:ngrid,1:nlayer,igcm_dust_number)) 2141 ! call WRITEDIAGFI(ngrid,'ccn','Nuclei mass mr', 2142 ! & 'kg/kg',3,pq(1:ngrid,1:nlayer,igcm_ccn_mass)) 2143 ! call WRITEDIAGFI(ngrid,'ccnN','Nuclei number', 2144 ! & 'part/kg',3,pq(1:ngrid,1:nlayer,igcm_ccn_number)) 2145 call WRITEDIAGFI(ngrid,'dustq','Dust mass mr', 2133 2146 & 'kg/kg',3,pq(1,1,igcm_dust_mass)) 2134 call WRITEDIAGFI(ngrid mx,'dustN','Dust number',2147 call WRITEDIAGFI(ngrid,'dustN','Dust number', 2135 2148 & 'part/kg',3,pq(1,1,igcm_dust_number)) 2136 call WRITEDIAGFI(ngrid mx,'ccn','Nuclei mass mr',2149 call WRITEDIAGFI(ngrid,'ccn','Nuclei mass mr', 2137 2150 & 'kg/kg',3,pq(1,1,igcm_ccn_mass)) 2138 call WRITEDIAGFI(ngrid mx,'ccnN','Nuclei number',2151 call WRITEDIAGFI(ngrid,'ccnN','Nuclei number', 2139 2152 & 'part/kg',3,pq(1,1,igcm_ccn_number)) 2140 2153 #endif … … 2142 2155 do iq=1,dustbin 2143 2156 write(str2(1:2),'(i2.2)') iq 2144 call WRITEDIAGFI(ngrid mx,'q'//str2,'mix. ratio',2157 call WRITEDIAGFI(ngrid,'q'//str2,'mix. ratio', 2145 2158 & 'kg/kg',3,zq(1,1,iq)) 2146 call WRITEDIAGFI(ngrid mx,'qsurf'//str2,'qsurf',2159 call WRITEDIAGFI(ngrid,'qsurf'//str2,'qsurf', 2147 2160 & 'kg.m-2',2,qsurf(1,iq)) 2148 2161 end do … … 2150 2163 2151 2164 if (scavenging) then 2152 call WRITEDIAGFI(ngrid mx,'ccnq','CCN mass mr',2165 call WRITEDIAGFI(ngrid,'ccnq','CCN mass mr', 2153 2166 & 'kg/kg',3,qccn) 2154 call WRITEDIAGFI(ngrid mx,'ccnN','CCN number',2167 call WRITEDIAGFI(ngrid,'ccnN','CCN number', 2155 2168 & 'part/kg',3,nccn) 2156 2169 endif ! (scavenging) 2157 2170 2158 2171 c if (submicron) then 2159 c call WRITEDIAGFI(ngrid mx,'dustsubm','subm mass mr',2172 c call WRITEDIAGFI(ngrid,'dustsubm','subm mass mr', 2160 2173 c & 'kg/kg',3,pq(1,1,igcm_dust_submicron)) 2161 2174 c endif ! (submicron) … … 2169 2182 if(callthermos) then 2170 2183 2171 call WRITEDIAGFI(ngrid mx,"q15um","15 um cooling","K/s",2184 call WRITEDIAGFI(ngrid,"q15um","15 um cooling","K/s", 2172 2185 $ 3,zdtnlte) 2173 call WRITEDIAGFI(ngrid mx,"quv","UV heating","K/s",2186 call WRITEDIAGFI(ngrid,"quv","UV heating","K/s", 2174 2187 $ 3,zdteuv) 2175 call WRITEDIAGFI(ngrid mx,"cond","Thermal conduction","K/s",2188 call WRITEDIAGFI(ngrid,"cond","Thermal conduction","K/s", 2176 2189 $ 3,zdtconduc) 2177 call WRITEDIAGFI(ngrid mx,"qnir","NIR heating","K/s",2190 call WRITEDIAGFI(ngrid,"qnir","NIR heating","K/s", 2178 2191 $ 3,zdtnirco2) 2179 2192 … … 2208 2221 ! endif 2209 2222 2210 call WRITEDIAGFI(ngrid mx,'zmax_th',2223 call WRITEDIAGFI(ngrid,'zmax_th', 2211 2224 & 'hauteur du thermique','m', 2212 2225 & 2,zmax_th) 2213 call WRITEDIAGFI(ngrid mx,'hfmax_th',2226 call WRITEDIAGFI(ngrid,'hfmax_th', 2214 2227 & 'maximum TH heat flux','K.m/s', 2215 2228 & 2,hfmax_th) 2216 call WRITEDIAGFI(ngrid mx,'wstar',2229 call WRITEDIAGFI(ngrid,'wstar', 2217 2230 & 'maximum TH vertical velocity','m/s', 2218 2231 & 2,wstar) … … 2265 2278 if(calltherm) then 2266 2279 2267 call WRITEDIAGFI(ngrid mx,'lmax_th',2280 call WRITEDIAGFI(ngrid,'lmax_th', 2268 2281 & 'hauteur du thermique','point', 2269 2282 & 0,lmax_th_out) 2270 call WRITEDIAGFI(ngrid mx,'zmax_th',2283 call WRITEDIAGFI(ngrid,'zmax_th', 2271 2284 & 'hauteur du thermique','m', 2272 2285 & 0,zmax_th) 2273 call WRITEDIAGFI(ngrid mx,'hfmax_th',2286 call WRITEDIAGFI(ngrid,'hfmax_th', 2274 2287 & 'maximum TH heat flux','K.m/s', 2275 2288 & 0,hfmax_th) 2276 call WRITEDIAGFI(ngrid mx,'wstar',2289 call WRITEDIAGFI(ngrid,'wstar', 2277 2290 & 'maximum TH vertical velocity','m/s', 2278 2291 & 0,wstar) … … 2280 2293 co2col(:)=0. 2281 2294 if (tracer) then 2282 do l=1,nlayer mx2295 do l=1,nlayer 2283 2296 do ig=1,ngrid 2284 2297 co2col(ig)=co2col(ig)+ … … 2305 2318 ! call WRITEDIAGFI(ngrid,"dtrad","rad. heat. rate", & 2306 2319 ! & "K.s-1",1,dtrad/zpopsk) 2307 ! call WRITEDIAGFI(ngrid mx,'sw_htrt','sw heat. rate',2320 ! call WRITEDIAGFI(ngrid,'sw_htrt','sw heat. rate', 2308 2321 ! & 'w.m-2',1,zdtsw/zpopsk) 2309 ! call WRITEDIAGFI(ngrid mx,'lw_htrt','lw heat. rate',2322 ! call WRITEDIAGFI(ngrid,'lw_htrt','lw heat. rate', 2310 2323 ! & 'w.m-2',1,zdtlw/zpopsk) 2311 2324 call WRITEDIAGFI(ngrid,"co2ice","co2 ice thickness" … … 2313 2326 2314 2327 ! or output in diagfi.nc (for testphys1d) 2315 call WRITEDIAGFI(ngrid mx,'ps','Surface pressure','Pa',0,ps)2316 call WRITEDIAGFI(ngrid mx,'temp','Temperature',2328 call WRITEDIAGFI(ngrid,'ps','Surface pressure','Pa',0,ps) 2329 call WRITEDIAGFI(ngrid,'temp','Temperature', 2317 2330 & 'K',1,zt) 2318 2331 … … 2321 2334 do iq=1,nq 2322 2335 c CALL writeg1d(ngrid,nlayer,zq(1,1,iq),noms(iq),'kg/kg') 2323 call WRITEDIAGFI(ngrid mx,trim(noms(iq)),2336 call WRITEDIAGFI(ngrid,trim(noms(iq)), 2324 2337 & trim(noms(iq)),'kg/kg',1,zq(1,1,iq)) 2325 2338 end do 2326 2339 if (doubleq) then 2327 call WRITEDIAGFI(ngrid mx,'rdust','rdust',2340 call WRITEDIAGFI(ngrid,'rdust','rdust', 2328 2341 & 'm',1,rdust) 2329 2342 endif 2330 2343 if (water.AND.tifeedback) then 2331 call WRITEDIAGFI(ngrid mx,"soiltemp",2344 call WRITEDIAGFI(ngrid,"soiltemp", 2332 2345 & "Soil temperature","K", 2333 2346 & 1,tsoil) 2334 call WRITEDIAGFI(ngrid mx,'soilti',2347 call WRITEDIAGFI(ngrid,'soilti', 2335 2348 & 'Soil Thermal Inertia', 2336 2349 & 'J.s-1/2.m-2.K-1',1,inertiesoil) … … 2345 2358 2346 2359 tauTES=0 2347 do l=1,nlayer mx2360 do l=1,nlayer 2348 2361 Qabsice = min( 2349 2362 & max(0.4e6*rice(1,l)*(1.+nuice_ref)-0.05 ,0.),1.2 … … 2355 2368 tauTES=tauTES+ opTES(1,l) 2356 2369 enddo 2357 CALL WRITEDIAGFI(ngrid mx,'tauTESap',2370 CALL WRITEDIAGFI(ngrid,'tauTESap', 2358 2371 & 'tau abs 825 cm-1', 2359 2372 & '',0,tauTES) 2360 2373 else 2361 2374 2362 CALL WRITEDIAGFI(ngrid mx,'tauTES',2375 CALL WRITEDIAGFI(ngrid,'tauTES', 2363 2376 & 'tau abs 825 cm-1', 2364 2377 & '',0,taucloudtes) … … 2377 2390 h2otot = h2otot+mtot+icetot 2378 2391 2379 CALL WRITEDIAGFI(ngrid mx,'h2otot',2392 CALL WRITEDIAGFI(ngrid,'h2otot', 2380 2393 & 'h2otot', 2381 2394 & 'kg/m2',0,h2otot) 2382 CALL WRITEDIAGFI(ngrid mx,'mtot',2395 CALL WRITEDIAGFI(ngrid,'mtot', 2383 2396 & 'mtot', 2384 2397 & 'kg/m2',0,mtot) 2385 CALL WRITEDIAGFI(ngrid mx,'icetot',2398 CALL WRITEDIAGFI(ngrid,'icetot', 2386 2399 & 'icetot', 2387 2400 & 'kg/m2',0,icetot) … … 2401 2414 2402 2415 Nccntot= 0 2403 call watersat(ngrid mx*nlayermx,zt,zplay,zqsat)2404 do l=1,nlayer mx2416 call watersat(ngrid*nlayer,zt,zplay,zqsat) 2417 do l=1,nlayer 2405 2418 Nccntot = Nccntot + 2406 2419 & zq(1,l,igcm_ccn_number)*tauscaling(1) … … 2413 2426 call WRITEDIAGFI(ngrid,"satu","vap in satu","kg/kg",1, 2414 2427 & satu) 2415 CALL WRITEDIAGFI(ngrid mx,'Nccntot',2428 CALL WRITEDIAGFI(ngrid,'Nccntot', 2416 2429 & 'Nccntot', 2417 2430 & 'nbr/m2',0,Nccntot) 2418 2431 2419 call WRITEDIAGFI(ngrid mx,'zdqsed_dustq'2432 call WRITEDIAGFI(ngrid,'zdqsed_dustq' 2420 2433 & ,'sedimentation q','kg.m-2.s-1',1,zdqsed(1,:,igcm_dust_mass)) 2421 call WRITEDIAGFI(ngrid mx,'zdqsed_dustN'2434 call WRITEDIAGFI(ngrid,'zdqsed_dustN' 2422 2435 &,'sedimentation N','Nbr.m-2.s-1',1, 2423 2436 & zdqsed(1,:,igcm_dust_number)) … … 2436 2449 endif ! of if (scavenging) 2437 2450 2438 CALL WRITEDIAGFI(ngrid mx,'reffice',2451 CALL WRITEDIAGFI(ngrid,'reffice', 2439 2452 & 'reffice', 2440 2453 & 'm',0,rave) 2441 2454 2442 2455 do iq=1,nq 2443 call WRITEDIAGFI(ngrid mx,trim(noms(iq))//'_s',2456 call WRITEDIAGFI(ngrid,trim(noms(iq))//'_s', 2444 2457 & trim(noms(iq))//'_s','kg/kg',0,qsurf(1,iq)) 2445 2458 end do 2446 2459 2447 call WRITEDIAGFI(ngrid mx,'zdqcloud_ice','cloud ice',2460 call WRITEDIAGFI(ngrid,'zdqcloud_ice','cloud ice', 2448 2461 & 'kg.m-2.s-1',1,zdqcloud(1,:,igcm_h2o_ice)) 2449 call WRITEDIAGFI(ngrid mx,'zdqcloud_vap','cloud vap',2462 call WRITEDIAGFI(ngrid,'zdqcloud_vap','cloud vap', 2450 2463 & 'kg.m-2.s-1',1,zdqcloud(1,:,igcm_h2o_vap)) 2451 call WRITEDIAGFI(ngrid mx,'zdqcloud','cloud ice',2464 call WRITEDIAGFI(ngrid,'zdqcloud','cloud ice', 2452 2465 & 'kg.m-2.s-1',1,zdqcloud(1,:,igcm_h2o_ice) 2453 2466 & +zdqcloud(1,:,igcm_h2o_vap)) -
trunk/LMDZ.MARS/libf/phymars/read_dust_scenario.F90
r677 r1047 4 4 5 5 use netcdf 6 use comgeomfi_h, only: lati, long 6 7 implicit none 7 8 8 9 #include "dimensions.h" 9 10 #include "dimphys.h" 10 #include "comgeomfi.h"11 !#include "comgeomfi.h" 11 12 #include "datafile.h" 12 13 #include "callkeys.h" -
trunk/LMDZ.MARS/libf/phymars/simpleclouds.F
r1036 r1047 29 29 c of the typical CCN profile, Oct. 2011) 30 30 c------------------------------------------------------------------ 31 #include "dimensions.h"32 #include "dimphys.h"31 !#include "dimensions.h" 32 !#include "dimphys.h" 33 33 #include "comcstfi.h" 34 34 #include "callkeys.h" 35 35 !#include "tracer.h" 36 #include "comgeomfi.h" 37 #include "dimradmars.h" 36 !#include "comgeomfi.h" 37 !#include "dimradmars.h" 38 ! naerkind is set in scatterers.h (built when compiling with makegcm -s #) 39 #include"scatterers.h" 40 38 41 c------------------------------------------------------------------ 39 42 c Arguments: … … 52 55 real pdq(ngrid,nlay,nq) ! tendance avant condensation 53 56 ! (kg/kg.s-1) 54 REAL tau(ngrid mx,naerkind)! Column dust optical depth at each point57 REAL tau(ngrid,naerkind) ! Column dust optical depth at each point 55 58 56 59 c Output: … … 65 68 c Local variables: 66 69 67 LOGICAL firstcall 68 DATA firstcall/.true./ 69 SAVE firstcall 70 70 LOGICAL,SAVE :: firstcall = .true. 71 71 72 REAL rhocloud(ngrid mx,nlayermx) ! Cloud density (kg.m-3)72 REAL rhocloud(ngrid,nlay) ! Cloud density (kg.m-3) 73 73 74 74 INTEGER ig,l 75 75 76 REAL zq(ngrid mx,nlayermx,nq) ! local value of tracers77 REAL zq0(ngrid mx,nlayermx,nq) ! local initial value of tracers78 REAL zt(ngrid mx,nlayermx) ! local value of temperature79 REAL zqsat(ngrid mx,nlayermx) ! saturation76 REAL zq(ngrid,nlay,nq) ! local value of tracers 77 REAL zq0(ngrid,nlay,nq) ! local initial value of tracers 78 REAL zt(ngrid,nlay) ! local value of temperature 79 REAL zqsat(ngrid,nlay) ! saturation 80 80 REAL*8 dzq ! masse de glace echangee (kg/kg) 81 81 REAL lw !Latent heat of sublimation (J.kg-1) 82 82 REAL,PARAMETER :: To=273.15 ! reference temperature, T=273.15 K 83 real rdusttyp(ngrid mx,nlayermx) ! Typical dust geom. mean radius (m)84 REAL ccntyp(ngrid mx,nlayermx)83 real rdusttyp(ngrid,nlay) ! Typical dust geom. mean radius (m) 84 REAL ccntyp(ngrid,nlay) 85 85 ! Typical dust number density (#/kg) 86 86 c CCN reduction factor … … 120 120 c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 121 121 122 call watersat(ngrid mx*nlayermx,zt,pplay,zqsat)122 call watersat(ngrid*nlay,zt,pplay,zqsat) 123 123 124 124 c taux de condensation (kg/kg/s-1) dans les differentes couches … … 147 147 c ~~~~~~~~~~~~~~~ 148 148 do l=1, nlay 149 do ig=1,ngrid mx149 do ig=1,ngrid 150 150 pdqcloud(ig,l,igcm_h2o_vap)=(zq(ig,l,igcm_h2o_vap) 151 151 & -zq0(ig,l,igcm_h2o_vap))/ptimestep … … 159 159 c ice crystal radius 160 160 do l=1, nlay 161 do ig=1,ngrid mx161 do ig=1,ngrid 162 162 call updaterice_typ(zq(ig,l,igcm_h2o_ice), 163 163 & tau(ig,1),pzlay(ig,l),rice(ig,l)) -
trunk/LMDZ.MARS/libf/phymars/soil.F
r833 r1047 3 3 & timestep,tsurf,tsoil, 4 4 & capcal,fluxgrd) 5 use comsoil_h, only: layer, mlayer, volcapa 6 use surfdat_h, only: watercaptag, inert_h2o_ice 5 7 implicit none 6 8 … … 11 13 ! 12 14 ! Note: depths of layers and mid-layers, soil thermal inertia and 13 ! heat capacity are commons in comsoil .h15 ! heat capacity are commons in comsoil_h 14 16 !----------------------------------------------------------------------- 15 17 … … 17 19 #include "dimphys.h" 18 20 19 #include"comsoil.h"21 !#include"comsoil.h" 20 22 21 #include"surfdat.h"23 !#include"surfdat.h" 22 24 #include"callkeys.h" 23 25 … … 38 40 39 41 ! local saved variables: 40 ! real,save :: layer(ngridmx,nsoilmx) ! layer depth 41 real,save :: mthermdiff(ngridmx,0:nsoilmx-1) ! mid-layer thermal diffusivity 42 real,save :: thermdiff(ngridmx,nsoilmx-1) ! inter-layer thermal diffusivity 43 real,save :: coefq(0:nsoilmx-1) ! q_{k+1/2} coefficients 44 real,save :: coefd(ngridmx,nsoilmx-1) ! d_k coefficients 45 real,save :: alph(ngridmx,nsoilmx-1) ! alpha_k coefficients 46 real,save :: beta(ngridmx,nsoilmx-1) ! beta_k coefficients 42 real,save,allocatable :: mthermdiff(:,:) ! mid-layer thermal diffusivity 43 real,save,allocatable :: thermdiff(:,:) ! inter-layer thermal diffusivity 44 real,save,allocatable :: coefq(:) ! q_{k+1/2} coefficients 45 real,save,allocatable :: coefd(:,:) ! d_k coefficients 46 real,save,allocatable :: alph(:,:) ! alpha_k coefficients 47 real,save,allocatable :: beta(:,:) ! beta_k coefficients 47 48 real,save :: mu 48 49 … … 51 52 52 53 ! 0. Initialisations and preprocessing step 54 if (firstcall) then 55 ! allocate local saved arrays: 56 allocate(mthermdiff(ngrid,0:nsoil-1)) 57 allocate(thermdiff(ngrid,nsoil-1)) 58 allocate(coefq(0:nsoil-1)) 59 allocate(coefd(ngrid,nsoil-1)) 60 allocate(alph(ngrid,nsoil-1)) 61 allocate(beta(ngrid,nsoil-1)) 62 endif 63 53 64 if (firstcall.or.tifeedback) then 54 65 ! note: firstcall is set to .true. or .false. by the caller -
trunk/LMDZ.MARS/libf/phymars/soil_settings.F
r999 r1047 2 2 3 3 use netcdf 4 use comsoil_h, only: layer, mlayer, inertiedat, volcapa 4 5 implicit none 5 6 … … 31 32 !====================================================================== 32 33 33 #include "dimensions.h"34 #include "dimphys.h"35 36 #include "comsoil.h"37 !#include "netcdf.inc"38 34 !====================================================================== 39 35 ! arguments 40 36 ! --------- 41 37 ! inputs: 42 integer nid ! Input Netcdf file ID43 integer ngrid ! # of horizontal grid points44 integer nsoil ! # of soil layers45 real tsurf(ngrid)! surface temperature46 integer indextime ! position on time axis38 integer,intent(in) :: nid ! Input Netcdf file ID 39 integer,intent(in) :: ngrid ! # of horizontal grid points 40 integer,intent(in) :: nsoil ! # of soil layers 41 real,intent(in) :: tsurf(ngrid) ! surface temperature 42 integer,intent(in) :: indextime ! position on time axis 47 43 ! output: 48 real tsoil(ngridmx,nsoilmx) ! soil temperature44 real,intent(out) :: tsoil(ngrid,nsoil) ! soil temperature 49 45 50 46 !====================================================================== … … 184 180 enddo 185 181 186 ! 2. Volumetric heat capacity (note: it is declared in comsoil .h)182 ! 2. Volumetric heat capacity (note: it is declared in comsoil_h) 187 183 ! --------------------------- 188 184 ! "volcapa" is (so far) 0D and written in "controle" table of startfi file … … 217 213 ! endif 218 214 219 ! 3. Thermal inertia (note: it is declared in comsoil .h)215 ! 3. Thermal inertia (note: it is declared in comsoil_h) 220 216 ! ------------------ 221 217 … … 306 302 corner(2)=1 307 303 corner(3)=indextime 308 edges(1)=ngrid mx309 edges(2)=nsoil mx304 edges(1)=ngrid 305 edges(2)=nsoil 310 306 edges(3)=1 311 307 !ierr=nf90_get_var(nid,nvarid,tsoil,corner,edges) -
trunk/LMDZ.MARS/libf/phymars/soil_tifeedback.F
r1036 r1047 2 2 3 3 use tracer_mod, only: nqmx, igcm_h2o_ice, rho_ice 4 use comsoil_h, only: layer, inertiedat 5 use surfdat_h, only: watercaptag, inert_h2o_ice 4 6 IMPLICIT NONE 5 7 … … 12 14 c - One layer of surface water ice (the thickness is given 13 15 c by the variable icecover (in kg of ice per m2) and the thermal 14 c inertia is prescribed by inert_h2o_ice (see surfdat .h and inifis));16 c inertia is prescribed by inert_h2o_ice (see surfdat_h and inifis)); 15 17 c - A transitional layer of mixed thermal inertia; 16 18 c - A last layer of regolith below the ice cover whose thermal inertia … … 25 27 #include "dimensions.h" 26 28 #include "dimphys.h" 27 #include "comsoil.h"29 !#include "comsoil.h" 28 30 !#include "tracer.h" 29 #include "surfdat.h"31 !#include "surfdat.h" 30 32 31 33 c Local variables -
trunk/LMDZ.MARS/libf/phymars/suaer.F90
r411 r1047 1 1 SUBROUTINE suaer 2 use dimradmars_mod, only: longrefvis, longrefir, nsizemax, long1vis, & 3 long2vis, long3vis, long1ir, long2ir, long1co2, & 4 long2co2, nsun, nir 5 use yomaer_h, only: radiustab, gvis, omegavis, QVISsQREF, gIR, omegaIR, & 6 QIRsQREF, QREFvis, QREFir, omegaREFvis, omegaREFir, & 7 nsize 2 8 IMPLICIT NONE 3 9 !================================================================== … … 34 40 #include "callkeys.h" 35 41 #include "datafile.h" 36 #include "dimensions.h" 37 #include "dimphys.h" 38 #include "dimradmars.h" 39 #include "yomaer.h" 42 !#include "dimensions.h" 43 !#include "dimphys.h" 44 !#include "dimradmars.h" 45 !#include "yomaer.h" 46 ! naerkind is set in scatterers.h (built when compiling with makegcm -s #) 47 #include"scatterers.h" 40 48 #include "aerkind.h" 41 49 … … 350 358 write(*,*) " nsizemax=",nsizemax 351 359 write(*,*) " you must increase the value of nsizemax" 352 write(*,*) " in dimradmars .h!"360 write(*,*) " in dimradmars_mod !" 353 361 stop 354 362 endif … … 362 370 ! and not epref, which is a different parameter); 363 371 ! Reference wavelengths are defined for each aerosol in 364 ! dimradmars .h.372 ! dimradmars_mod. 365 373 366 374 CALL aerave ( nwvl,& … … 420 428 ! and not epref, which is a different parameter); 421 429 ! Reference wavelengths are defined for each aerosol in 422 ! dimradmar s.h.430 ! dimradmar_mod. 423 431 424 432 CALL aerave ( nwvl,& … … 448 456 ! Single scattering properties 449 457 ! in each of the "nir" bands 450 ! (cf. dimradmars .h)458 ! (cf. dimradmars_mod) 451 459 452 460 ! iir=1 : central 15um CO2 bands -
trunk/LMDZ.MARS/libf/phymars/surfini.F
r1041 r1047 4 4 use netcdf 5 5 use tracer_mod, only: nqmx, noms, dryness 6 use comgeomfi_h, only: long, lati 7 use surfdat_h, only: watercaptag, frost_albedo_threshold, 8 & albedo_h2o_ice, inert_h2o_ice, albedodat, 9 & albedice 6 10 IMPLICIT NONE 7 11 c======================================================================= … … 14 18 c ------------- 15 19 #include "dimensions.h" 16 #include "dimphys.h"17 #include "surfdat.h"20 !#include "dimphys.h" 21 !#include "surfdat.h" 18 22 #include "callkeys.h" 19 23 !#include "tracer.h" 20 #include "comgeomfi.h"24 !#include "comgeomfi.h" 21 25 #include "comcstfi.h" 22 26 … … 84 88 alternate = 0 85 89 86 if (ngrid mx.ne. 1) then90 if (ngrid .ne. 1) then 87 91 watercaptag(:) = .false. 88 92 longwatercaptag(:) = .false. … … 98 102 #ifdef MESOSCALE 99 103 100 do ig=1,ngrid mx104 do ig=1,ngrid 101 105 102 106 !write(*,*) "all qsurf to zero. dirty." … … 123 127 124 128 125 IF (ngrid mx.eq. 1) THEN ! special case for 1d --> do nothing126 127 print*, 'ngrid mx= 1, do no put ice caps in surfini.F'129 IF (ngrid .eq. 1) THEN ! special case for 1d --> do nothing 130 131 print*, 'ngrid = 1, do no put ice caps in surfini.F' 128 132 129 133 ELSE IF (icelocationmode .eq. 1) THEN … … 187 191 !print*,'jjm,iim',jjm,iim ! jjm = nb lati , iim = nb longi 188 192 189 ! loop over the GCM grid - except for poles (ig=1 and ngrid mx)190 do ig=2,ngrid mx-1193 ! loop over the GCM grid - except for poles (ig=1 and ngrid) 194 do ig=2,ngrid-1 191 195 192 196 ! loop over the surface file grid … … 212 216 & lonice(1+mod(ig-2,iim),:) + nb_ice(ig,:) ! lonice is USELESS ... 213 217 214 enddo ! of do ig=2,ngrid mx-1218 enddo ! of do ig=2,ngrid-1 215 219 216 220 … … 220 224 latice(1,:) = nb_ice(1,:) 221 225 lonice(1,:) = nb_ice(1,:) 222 latice(jjm,:) = nb_ice(ngrid mx,:)223 lonice(iim,:) = nb_ice(ngrid mx,:)226 latice(jjm,:) = nb_ice(ngrid,:) 227 lonice(iim,:) = nb_ice(ngrid,:) 224 228 225 229 … … 319 323 320 324 321 else if (ngrid mx.ne. 1) then325 else if (ngrid .ne. 1) then 322 326 323 327 print*,'No predefined ice location for this resolution :',iim,jjm … … 328 332 endif 329 333 330 do ig=1,ngrid mx334 do ig=1,ngrid 331 335 if (longwatercaptag(ig)) watercaptag(ig) = .true. 332 336 enddo … … 337 341 print*,'Surfini: ice caps defined by lat and lon values' 338 342 339 do ig=1,ngrid mx343 do ig=1,ngrid 340 344 341 345 c-------- Towards olympia planitia water caps ----------- … … 392 396 c-------------------------------------------------------- 393 397 c-------------------------------------------------------- 394 end do ! of (ngrid mx)398 end do ! of (ngrid) 395 399 396 400 … … 406 410 ! print caps locations - useful for plots too 407 411 print*,'latitude | longitude | ig' 408 do ig=1,ngrid mx412 do ig=1,ngrid 409 413 dryness (ig) = icedryness 410 414 -
trunk/LMDZ.MARS/libf/phymars/swmain.F
r38 r1047 5 5 & QVISsQREF3d,omegaVIS3d,gVIS3d) 6 6 7 use dimradmars_mod, only: ndlo2, ndlon, nflev, nsun 8 use yomlw_h, only: nlaylte, gcp 7 9 IMPLICIT NONE 8 10 9 #include "dimensions.h"10 #include "dimphys.h"11 #include "dimradmars.h"11 !#include "dimensions.h" 12 !#include "dimphys.h" 13 !#include "dimradmars.h" 12 14 13 #include "yomaer.h" 14 #include "yomlw.h" 15 !#include "yomaer.h" 16 !#include "yomlw.h" 17 ! naerkind is set in scatterers.h (built when compiling with makegcm -s #) 18 #include"scatterers.h" 15 19 #include "callkeys.h" 16 20 c … … 42 46 c aerosol aerosol extinction optical depth 43 47 c at reference wavelength "longrefvis" set 44 c in dimradmars .h, in each layer, for one of48 c in dimradmars_mod , in each layer, for one of 45 49 c the "naerkind" kind of aerosol optical properties. 46 50 c Pfract : day fraction of the time interval … … 134 138 C------------------------------------------------------------------ 135 139 c 2 spectral interval in solar spectrum : 136 c - INU=1: between wavelength "long1vis" and "long2vis" set in dimradmars .h137 c - INU=2: between wavelength "long2vis" and "long3vis" set in dimradmars .h140 c - INU=1: between wavelength "long1vis" and "long2vis" set in dimradmars_mod 141 c - INU=2: between wavelength "long2vis" and "long3vis" set in dimradmars_mod 138 142 139 143 DO INU = 1,2 -
trunk/LMDZ.MARS/libf/phymars/swr_fouquart.F
r38 r1047 4 4 S , PFD,PFU ) 5 5 6 use dimradmars_mod, only: sunfr, ndlo2, nsun, ndlon, nflev 7 use yomlw_h, only: nlaylte 6 8 IMPLICIT NONE 7 9 C 8 #include "dimensions.h"9 #include "dimphys.h"10 #include "dimradmars.h"10 !#include "dimensions.h" 11 !#include "dimphys.h" 12 !#include "dimradmars.h" 11 13 #include "callkeys.h" 12 13 #include "yomaer.h" 14 #include "yomlw.h" 14 ! naerkind is set in scatterers.h (built when compiling with makegcm -s #) 15 #include"scatterers.h" 16 !#include "yomaer.h" 17 !#include "yomlw.h" 15 18 16 19 C … … 37 40 c aerosol aerosol extinction optical depth 38 41 c at reference wavelength "longrefvis" set 39 c in dimradmars .h, in each layer, for one of42 c in dimradmars_mod , in each layer, for one of 40 43 c the "naerkind" kind of aerosol optical properties. 41 44 c albedo hemispheric surface albedo … … 378 381 SUBROUTINE DEDD (KDLON,PGG,PREF,PRMUZ,PTO1,PW 379 382 S , PRE1,PRE2,PTR1,PTR2 ) 383 use dimradmars_mod, only: ndlo2 380 384 implicit none 381 385 C 382 #include "dimensions.h"383 #include "dimphys.h"384 #include "dimradmars.h"386 !#include "dimensions.h" 387 !#include "dimphys.h" 388 !#include "dimradmars.h" 385 389 C 386 390 C**** *DEDD* - DELTA-EDDINGTON IN A CLOUDY LAYER -
trunk/LMDZ.MARS/libf/phymars/swr_toon.F
r38 r1047 4 4 S , PFD,PFU ) 5 5 6 use dimradmars_mod, only: sunfr, ndlo2, nsun, nflev, ndlon 7 use yomlw_h, only: nlaylte 8 6 9 IMPLICIT NONE 7 10 C 8 #include "dimensions.h"9 #include "dimphys.h"10 #include "dimradmars.h"11 !#include "dimensions.h" 12 !#include "dimphys.h" 13 !#include "dimradmars.h" 11 14 #include "callkeys.h" 12 13 #include "yomaer.h" 14 #include "yomlw.h" 15 ! naerkind is set in scatterers.h (built when compiling with makegcm -s #) 16 #include"scatterers.h" 17 !#include "yomaer.h" 18 !#include "yomlw.h" 15 19 16 20 C … … 36 40 c aerosol aerosol extinction optical depth 37 41 c at reference wavelength "longrefvis" set 38 c in dimradmars .h, in each layer, for one of42 c in dimradmars_mod , in each layer, for one of 39 43 c the "naerkind" kind of aerosol optical properties. 40 44 c albedo hemispheric surface albedo -
trunk/LMDZ.MARS/libf/phymars/tabfi.F
r672 r1047 43 43 c 44 44 c======================================================================= 45 45 46 use comsoil_h, only: volcapa ! soil volumetric heat capacity 47 use surfdat_h, only: z0_default, emissiv, emisice, albedice, 48 & iceradius, dtemisice, iceradius 49 use yomaer_h, only: tauvis 46 50 implicit none 47 51 48 #include "dimensions.h"49 #include "dimphys.h"52 !#include "dimensions.h" 53 !#include "dimphys.h" 50 54 #include "comcstfi.h" 51 #include "comgeomfi.h"55 !#include "comgeomfi.h" 52 56 #include "planete.h" 53 #include "surfdat.h"54 #include "comsoil.h"57 !#include "surfdat.h" 58 !#include "comsoil.h" 55 59 #include "netcdf.inc" 56 #include "dimradmars.h"57 #include "yomaer.h"60 !#include "dimradmars.h" 61 !#include "yomaer.h" 58 62 59 63 c----------------------------------------------------------------------- … … 165 169 c Initialization of some physical constants 166 170 c informations on physics grid 167 if(ngridmx.ne.tab_cntrl(tab0+1)) then168 print*,'tabfi: WARNING !!! tab_cntrl(tab0+1).ne.ngridmx'169 print*,tab_cntrl(tab0+1),ngridmx170 endif171 ! if(ngridmx.ne.tab_cntrl(tab0+1)) then 172 ! print*,'tabfi: WARNING !!! tab_cntrl(tab0+1).ne.ngridmx' 173 ! print*,tab_cntrl(tab0+1),ngridmx 174 ! endif 171 175 lmax = nint(tab_cntrl(tab0+2)) 172 176 day_ini = tab_cntrl(tab0+3) … … 225 229 write(*,*) 'Reading tab_cntrl when calling tabfi before changes' 226 230 write(*,*) '*****************************************************' 227 write(*,5) '(1) = ngridmx?',tab_cntrl(tab0+1) ,real(ngridmx)231 write(*,5) '(1) = ngridmx?',tab_cntrl(tab0+1)!,real(ngridmx) 228 232 write(*,5) '(2) lmax',tab_cntrl(tab0+2),real(lmax) 229 233 write(*,5) '(3) day_ini',tab_cntrl(tab0+3),real(day_ini) … … 491 495 write(*,*) 'Reading tab_cntrl when calling tabfi AFTER changes' 492 496 write(*,*) '*****************************************************' 493 write(*,5) '(1) = ngridmx?',tab_cntrl(tab0+1) ,real(ngridmx)497 write(*,5) '(1) = ngridmx?',tab_cntrl(tab0+1)!,real(ngridmx) 494 498 write(*,5) '(2) lmax',tab_cntrl(tab0+2),real(lmax) 495 499 write(*,5) '(3) day_ini',tab_cntrl(tab0+3),real(day_ini) -
trunk/LMDZ.MARS/libf/phymars/testphys1d.F
r1036 r1047 4 4 USE ioipsl_getincom, only: getin 5 5 use infotrac, only: nqtot, tnom 6 use comsoil_h, only: volcapa, layer, mlayer, inertiedat 7 use comgeomfi_h, only: lati, long, area 8 use comdiurn_h, only: sinlat 9 use surfdat_h, only: albedodat, z0_default, emissiv, emisice, 10 & albedice, iceradius, dtemisice, z0, 11 & zmea, zstd, zsig, zgam, zthe, phisfi, 12 & watercaptag 13 use slope_mod, only: theta_sl, psi_sl 14 use yomaer_h, only: tauvis 6 15 IMPLICIT NONE 7 16 … … 27 36 #include "dimensions.h" 28 37 #include "dimphys.h" 29 #include "dimradmars.h"30 #include "comgeomfi.h"31 #include "surfdat.h"32 #include "slope.h"33 #include "comsoil.h"34 #include "comdiurn.h"38 !#include "dimradmars.h" 39 !#include "comgeomfi.h" 40 !#include "surfdat.h" 41 !#include "slope.h" 42 !#include "comsoil.h" 43 !#include "comdiurn.h" 35 44 #include "callkeys.h" 36 45 #include "comcstfi.h" 37 46 #include "planete.h" 38 #include "comsaison.h"39 #include "yomaer.h"47 !#include "comsaison.h" 48 !#include "yomaer.h" 40 49 #include "control.h" 41 50 #include "comvert.h" … … 91 100 Logical tracerdyn 92 101 integer :: nq=1 ! number of tracers 102 real :: latitude, longitude 93 103 94 104 character*2 str2 … … 447 457 c latitude/longitude 448 458 c ------------------ 449 lati (1)=0 ! default value for lati(1)459 latitude=0 ! default value for latitude 450 460 PRINT *,'latitude (in degrees) ?' 451 call getin("latitude",lati(1)) 452 write(*,*) " latitude = ",lati(1) 453 lati(1)=lati(1)*pi/180.E+0 454 long(1)=0.E+0 455 long(1)=long(1)*pi/180.E+0 461 call getin("latitude",latitude) 462 write(*,*) " latitude = ",latitude 463 latitude=latitude*pi/180.E+0 464 longitude=0.E+0 465 longitude=longitude*pi/180.E+0 466 467 ! "inifis" does some initializations (some of which have already been 468 ! done above!) and loads parameters set in callphys.def 469 ! and allocates some arrays 470 !Mars possible matter with dtphys in input and include!!! 471 CALL inifis(1,llm,nq,day0,daysec,dtphys, 472 & latitude,longitude,1.0,rad,g,r,cpp) 473 456 474 457 475 c Initialize albedo / soil thermal inertia … … 502 520 c everything is controled by surface pressure 503 521 phisfi(1)=0.E+0 504 505 c "inifis" does some initializations (some of which have already been506 c done above!) and loads parameters set in callphys.def507 508 !Mars possible matter with dtphys in input and include!!!509 CALL inifis(1,llm,nq,day0,daysec,dtphys,510 . lati,long,area,rad,g,r,cpp)511 522 512 523 c Initialization to take into account prescribed winds … … 629 640 c Check if the surface is a water ice reservoir 630 641 c -------------------------------------------------- 631 watercaptag( ngridmx)=.false. ! Default: no water ice reservoir642 watercaptag(1)=.false. ! Default: no water ice reservoir 632 643 print *,'Water ice cap on ground ?' 633 644 call getin("watercaptag",watercaptag) … … 652 663 c It is needed to transfert physics variables to "physiq"... 653 664 654 call physdem0("startfi.nc",long,lati,nsoilmx,n q,665 call physdem0("startfi.nc",long,lati,nsoilmx,ngridmx,llm,nq, 655 666 . dtphys,float(day0),time,area, 656 667 . albedodat,inertiedat,zmea,zstd,zsig,zgam,zthe) 657 call physdem1("startfi.nc",nsoilmx,n q,668 call physdem1("startfi.nc",nsoilmx,ngridmx,llm,nq, 658 669 . dtphys,time, 659 670 . tsurf,tsoil,co2ice,emis,q2,qsurf) -
trunk/LMDZ.MARS/libf/phymars/updatereffrad.F
r1036 r1047 30 30 c ------------- 31 31 c 32 #include "dimensions.h"33 #include "dimphys.h"32 !#include "dimensions.h" 33 !#include "dimphys.h" 34 34 #include "comcstfi.h" 35 35 #include "callkeys.h" 36 #include "dimradmars.h"36 !#include "dimradmars.h" 37 37 !#include "tracer.h" 38 ! naerkind is set in scatterers.h (built when compiling with makegcm -s #) 39 #include"scatterers.h" 38 40 #include "aerkind.h" 39 #include "yomaer.h"41 !#include "yomaer.h" 40 42 41 43 c----------------------------------------------------------------------- … … 45 47 INTEGER ngrid,nlayer 46 48 c Ice geometric mean radius (m) 47 REAL :: rice(ngrid mx,nlayermx)49 REAL :: rice(ngrid,nlayer) 48 50 c Estimated effective variance of the size distribution (n.u.) 49 REAL :: nuice(ngrid mx,nlayermx)51 REAL :: nuice(ngrid,nlayer) 50 52 c Tracer mass mixing ratio (kg/kg) 51 53 REAL pq(ngrid,nlayer,nqmx) 52 REAL rdust(ngrid mx,nlayermx) ! Dust geometric mean radius (m)54 REAL rdust(ngrid,nlayer) ! Dust geometric mean radius (m) 53 55 54 56 REAL pplay(ngrid,nlayer) ! altitude at the middle of the layers … … 60 62 61 63 c Aerosol effective radius used for radiative transfer (meter) 62 REAL :: reffrad(ngrid mx,nlayermx,naerkind)64 REAL :: reffrad(ngrid,nlayer,naerkind) 63 65 c Aerosol effective variance used for radiative transfer (n.u.) 64 REAL :: nueffrad(ngrid mx,nlayermx,naerkind)66 REAL :: nueffrad(ngrid,nlayer,naerkind) 65 67 66 68 c Local variables: … … 79 81 c For microphysics only: 80 82 REAL Mo,No ! Mass and number of ccn 81 REAL rhocloud(ngridmx,nlayermx) ! Cloud density (kg.m-3) 82 REAL tauscaling(ngridmx) ! Convertion factor for qccn and Nccn 83 84 LOGICAL firstcall 85 DATA firstcall/.true./ 86 SAVE firstcall 83 REAL rhocloud(ngrid,nlayer) ! Cloud density (kg.m-3) 84 REAL tauscaling(ngrid) ! Convertion factor for qccn and Nccn 85 86 LOGICAL,SAVE :: firstcall=.true. , firstcall_alloc=.true. 87 87 88 88 REAL CBRT 89 89 EXTERNAL CBRT 90 90 91 REAL,SAVE :: nueffdust(ngridmx,nlayermx) ! Dust effective variance91 REAL,SAVE,ALLOCATABLE :: nueffdust(:,:) ! Dust effective variance 92 92 93 93 c Local saved variables: 94 94 c --------------------- 95 95 96 if (firstcall_alloc) then 97 !allocate local saved arrays: 98 allocate(nueffdust(ngrid,nlayer)) 99 firstcall_alloc=.false. 100 endif 96 101 97 102 c================================================================== -
trunk/LMDZ.MARS/libf/phymars/vdif_kc.F
r1036 r1047 1 SUBROUTINE vdif_kc(dt,g,zlev,zlay,u,v,teta,cd,q2,km,kn,zq) 2 3 use tracer_mod, only: nqmx, noms 1 SUBROUTINE vdif_kc(ngrid,nlay,nq,dt,g, 2 & zlev,zlay,u,v,teta,cd,q2,km,kn,zq) 3 4 use tracer_mod, only: noms 4 5 IMPLICIT NONE 5 6 c....................................................................... 6 #include "dimensions.h"7 #include "dimphys.h"7 !#include "dimensions.h" 8 !#include "dimphys.h" 8 9 !#include "tracer.h" 9 10 #include "callkeys.h" … … 32 33 c....................................................................... 33 34 REAL dt,g 34 REAL zlev(ngrid mx,nlayermx+1)35 REAL zlay(ngrid mx,nlayermx)36 REAL u(ngrid mx,nlayermx)37 REAL v(ngrid mx,nlayermx)38 REAL teta(ngrid mx,nlayermx)39 REAL cd(ngrid mx)40 REAL q2(ngrid mx,nlayermx+1)41 REAL km(ngrid mx,nlayermx+1)42 REAL kn(ngrid mx,nlayermx+1)43 REAL zq(ngrid mx,nlayermx,nqmx)35 REAL zlev(ngrid,nlay+1) 36 REAL zlay(ngrid,nlay) 37 REAL u(ngrid,nlay) 38 REAL v(ngrid,nlay) 39 REAL teta(ngrid,nlay) 40 REAL cd(ngrid) 41 REAL q2(ngrid,nlay+1) 42 REAL km(ngrid,nlay+1) 43 REAL kn(ngrid,nlay+1) 44 REAL zq(ngrid,nlay,nq) 44 45 c....................................................................... 45 46 c … … 54 55 c 55 56 c....................................................................... 56 INTEGER nlay,nlev,ngrid 57 REAL unsdz(ngridmx,nlayermx) 58 REAL unsdzdec(ngridmx,nlayermx+1) 59 REAL q(ngridmx,nlayermx+1) 57 INTEGER,INTENT(IN) :: nlay,ngrid,nq 58 INTEGER nlev 59 REAL unsdz(ngrid,nlay) 60 REAL unsdzdec(ngrid,nlay+1) 61 REAL q(ngrid,nlay+1) 60 62 c....................................................................... 61 63 c … … 67 69 c 68 70 c....................................................................... 69 REAL kmpre(ngrid mx,nlayermx+1)71 REAL kmpre(ngrid,nlay+1) 70 72 REAL qcstat 71 73 REAL q2cstat … … 75 77 c 76 78 c....................................................................... 77 REAL long(ngrid mx,nlayermx+1)79 REAL long(ngrid,nlay+1) 78 80 c....................................................................... 79 81 c … … 98 100 REAL mcstat 99 101 REAL m2cstat 100 REAL m(ngrid mx,nlayermx+1)101 REAL mpre(ngrid mx,nlayermx+1)102 REAL m2(ngrid mx,nlayermx+1)103 REAL n2(ngrid mx,nlayermx+1)102 REAL m(ngrid,nlay+1) 103 REAL mpre(ngrid,nlay+1) 104 REAL m2(ngrid,nlay+1) 105 REAL n2(ngrid,nlay+1) 104 106 c....................................................................... 105 107 c … … 123 125 LOGICAL gnsup 124 126 REAL gm 125 c REAL ri(ngrid mx,nlayermx+1)126 REAL sn(ngrid mx,nlayermx+1)127 REAL snq2(ngrid mx,nlayermx+1)128 REAL sm(ngrid mx,nlayermx+1)129 REAL smq2(ngrid mx,nlayermx+1)127 c REAL ri(ngrid,nlay+1) 128 REAL sn(ngrid,nlay+1) 129 REAL snq2(ngrid,nlay+1) 130 REAL sm(ngrid,nlay+1) 131 REAL smq2(ngrid,nlay+1) 130 132 c....................................................................... 131 133 c … … 186 188 PARAMETER (q2min=1.E-3) 187 189 PARAMETER (q2max=1.E+2) 188 PARAMETER (nlay=nlayermx)189 PARAMETER (nlev=nlayermx+1)190 PARAMETER (ngrid=ngridmx)191 190 c 192 191 PARAMETER ( … … 219 218 save firstcall 220 219 data firstcall/.true./ 221 REAL zhc(ngrid mx,nlayermx)220 REAL zhc(ngrid,nlay) 222 221 c....................................................................... 223 222 c Initialization … … 228 227 if (tracer) then 229 228 ! Prepare Special treatment if one of the tracers is CO2 gas 230 do iq=1,nq mx229 do iq=1,nq 231 230 if (noms(iq).eq."co2") then 232 231 ico2=iq … … 246 245 endif !of if firstcall 247 246 247 nlev=nlay+1 248 248 249 c....................................................................... 249 250 c Special treatment for co2 -
trunk/LMDZ.MARS/libf/phymars/vdifc.F
r1036 r1047 13 13 use tracer_mod, only: noms, igcm_dust_mass, igcm_dust_number, 14 14 & igcm_dust_submicron, igcm_h2o_vap, 15 & igcm_h2o_ice, dryness, alpha_lift, nqmx 15 & igcm_h2o_ice, dryness, alpha_lift 16 use surfdat_h, only: watercaptag, frost_albedo_threshold 16 17 IMPLICIT NONE 17 18 … … 36 37 c ------------- 37 38 38 #include "dimensions.h"39 #include "dimphys.h"39 !#include "dimensions.h" 40 !#include "dimphys.h" 40 41 #include "comcstfi.h" 41 42 #include "callkeys.h" 42 #include "surfdat.h"43 #include "comgeomfi.h"43 !#include "surfdat.h" 44 !#include "comgeomfi.h" 44 45 !#include "tracer.h" 45 46 #include "microphys.h" … … 85 86 c ------ 86 87 87 REAL ust(ngrid mx),tst(ngridmx)88 REAL ust(ngrid),tst(ngrid) 88 89 89 90 INTEGER ilev,ig,ilay,nlev 90 91 91 REAL z4st,zdplanck(ngrid mx)92 REAL zkv(ngrid mx,nlayermx+1),zkh(ngridmx,nlayermx+1)93 REAL zkq(ngrid mx,nlayermx+1)94 REAL zcdv(ngrid mx),zcdh(ngridmx)95 REAL zcdv_true(ngrid mx),zcdh_true(ngridmx) ! drag coeff are used by the LES to recompute u* and hfx96 REAL zu(ngrid mx,nlayermx),zv(ngridmx,nlayermx)97 REAL zh(ngrid mx,nlayermx)98 REAL ztsrf2(ngrid mx)99 REAL z1(ngrid mx),z2(ngridmx)100 REAL za(ngrid mx,nlayermx),zb(ngridmx,nlayermx)101 REAL zb0(ngrid mx,nlayermx)102 REAL zc(ngrid mx,nlayermx),zd(ngridmx,nlayermx)92 REAL z4st,zdplanck(ngrid) 93 REAL zkv(ngrid,nlay+1),zkh(ngrid,nlay+1) 94 REAL zkq(ngrid,nlay+1) 95 REAL zcdv(ngrid),zcdh(ngrid) 96 REAL zcdv_true(ngrid),zcdh_true(ngrid) ! drag coeff are used by the LES to recompute u* and hfx 97 REAL zu(ngrid,nlay),zv(ngrid,nlay) 98 REAL zh(ngrid,nlay) 99 REAL ztsrf2(ngrid) 100 REAL z1(ngrid),z2(ngrid) 101 REAL za(ngrid,nlay),zb(ngrid,nlay) 102 REAL zb0(ngrid,nlay) 103 REAL zc(ngrid,nlay),zd(ngrid,nlay) 103 104 REAL zcst1 104 REAL zu2(ngrid mx)105 REAL zu2(ngrid) 105 106 106 107 EXTERNAL SSUM,SCOPY … … 111 112 c variable added for CO2 condensation: 112 113 c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 113 REAL hh , zhcond(ngridmx,nlayermx) 114 REAL latcond,tcond1mb 115 REAL acond,bcond 116 SAVE acond,bcond 117 DATA latcond,tcond1mb/5.9e5,136.27/ 114 REAL hh , zhcond(ngrid,nlay) 115 REAL,PARAMETER :: latcond=5.9e5 116 REAL,PARAMETER :: tcond1mb=136.27 117 REAL,SAVE :: acond,bcond 118 118 119 119 c For latent heat release from ground ice sublimation 120 ! REAL tsrf_lw(ngrid mx)120 ! REAL tsrf_lw(ngrid) 121 121 ! REAL alpha 122 122 REAL T1,T2 … … 127 127 c ~~~~~~~ 128 128 INTEGER iq 129 REAL zq(ngrid mx,nlayermx,nqmx)130 REAL zq1temp(ngrid mx)131 REAL rho(ngrid mx) ! near surface air density132 REAL qsat(ngrid mx)129 REAL zq(ngrid,nlay,nq) 130 REAL zq1temp(ngrid) 131 REAL rho(ngrid) ! near surface air density 132 REAL qsat(ngrid) 133 133 134 134 REAL kmixmin … … 138 138 139 139 INTEGER j,l 140 REAL zcondicea(ngrid,nlayermx) 141 REAL zt(ngridmx,nlayermx),ztcond(ngridmx,nlayermx+1) 142 REAL betam(ngridmx,nlayermx),dmice(ngridmx,nlayermx) 143 REAL pdtc(ngrid,nlayermx) 144 REAL zhs(ngridmx,nlayermx) 145 REAL ccond 146 SAVE ccond 140 REAL zcondicea(ngrid,nlay) 141 REAL zt(ngrid,nlay),ztcond(ngrid,nlay+1) 142 REAL betam(ngrid,nlay),dmice(ngrid,nlay) 143 REAL pdtc(ngrid,nlay) 144 REAL zhs(ngrid,nlay) 145 REAL,SAVE :: ccond 147 146 148 147 c Theta_m formulation for mass-variation scheme : 149 148 c ~~~~~~~ 150 149 151 INTEGER ico2,llnt(ngridmx) 152 SAVE ico2 153 REAL m_co2, m_noco2, A , B 154 SAVE A, B, m_co2, m_noco2 155 REAL vmr_co2(ngridmx,nlayermx) 150 INTEGER,SAVE :: ico2 151 INTEGER llnt(ngrid) 152 REAL,SAVE :: m_co2, m_noco2, A , B 153 REAL vmr_co2(ngrid,nlay) 156 154 REAL qco2,mmean 157 155 158 REAL sensibFlux(ngridmx)156 REAL,INTENT(OUT) :: sensibFlux(ngrid) 159 157 160 158 #ifdef MESOSCALE … … 165 163 166 164 IF (firstcall) THEN 167 IF(ngrid.NE.ngridmx) THEN168 PRINT*,'STOP dans vdifc'169 PRINT*,'probleme de dimensions :'170 PRINT*,'ngrid =',ngrid171 PRINT*,'ngridmx =',ngridmx172 STOP173 ENDIF174 165 c To compute: Tcond= 1./(bcond-acond*log(.0095*p)) (p in pascal) 175 166 bcond=1./tcond1mb … … 372 363 ! Some usefull diagnostics for the new surface layer parametrization : 373 364 374 ! call WRITEDIAGFI(ngrid mx,'pcdv',365 ! call WRITEDIAGFI(ngrid,'pcdv', 375 366 ! & 'momentum drag','no units', 376 367 ! & 2,zcdv_true) 377 ! call WRITEDIAGFI(ngrid mx,'pcdh',368 ! call WRITEDIAGFI(ngrid,'pcdh', 378 369 ! & 'heat drag','no units', 379 370 ! & 2,zcdh_true) 380 ! call WRITEDIAGFI(ngrid mx,'ust',371 ! call WRITEDIAGFI(ngrid,'ust', 381 372 ! & 'friction velocity','m/s',2,ust) 382 ! call WRITEDIAGFI(ngrid mx,'tst',373 ! call WRITEDIAGFI(ngrid,'tst', 383 374 ! & 'friction temperature','K',2,tst) 384 ! call WRITEDIAGFI(ngrid mx,'rm-1',375 ! call WRITEDIAGFI(ngrid,'rm-1', 385 376 ! & 'aerodyn momentum conductance','m/s', 386 377 ! & 2,zcdv) 387 ! call WRITEDIAGFI(ngrid mx,'rh-1',378 ! call WRITEDIAGFI(ngrid,'rh-1', 388 379 ! & 'aerodyn heat conductance','m/s', 389 380 ! & 2,zcdh) … … 693 684 c Calcul du flux vertical au bas de la premiere couche (dust) : 694 685 c ----------------------------------------------------------- 695 do ig=1,ngrid mx686 do ig=1,ngrid 696 687 rho(ig) = zb0(ig,1) /ptimestep 697 688 c zb(ig,1) = 0. … … 740 731 c ---------------------------------------- 741 732 if (water) then 742 call watersat(ngrid mx,ptsrf,pplev(1,1),qsat)733 call watersat(ngrid,ptsrf,pplev(1,1),qsat) 743 734 end if 744 735 -
trunk/LMDZ.MARS/libf/phymars/vlz_fi.F
r38 r1047 1 SUBROUTINE vlz_fi(ngrid, q,pente_max,masse,w,wq)1 SUBROUTINE vlz_fi(ngrid,nlay,q,pente_max,masse,w,wq) 2 2 c 3 3 c Auteurs: P.Le Van, F.Hourdin, F.Forget … … 16 16 IMPLICIT NONE 17 17 c 18 #include "dimensions.h"19 #include "dimphys.h"18 !#include "dimensions.h" 19 !#include "dimphys.h" 20 20 21 21 c … … 23 23 c Arguments: 24 24 c ---------- 25 integer ngrid 26 real masse(ngrid,llm),pente_max 27 REAL q(ngrid,llm) 28 REAL w(ngrid,llm) 29 REAL wq(ngrid,llm+1) 25 integer,intent(in) :: ngrid ! number of atmospheric columns 26 integer,intent(in) :: nlay ! number of atmospheric layers 27 real masse(ngrid,nlay),pente_max 28 REAL q(ngrid,nlay) 29 REAL w(ngrid,nlay) 30 REAL wq(ngrid,nlay+1) 30 31 c 31 32 c Local … … 35 36 c 36 37 37 real dzq(ngrid mx,llm),dzqw(ngridmx,llm),adzqw(ngridmx,llm),dzqmax38 real dzq(ngrid,nlay),dzqw(ngrid,nlay),adzqw(ngrid,nlay),dzqmax 38 39 real newmasse 39 40 real sigw, Mtot, MQtot … … 47 48 c sens de W 48 49 49 do l=2, llm50 do l=2,nlay 50 51 do ij=1,ngrid 51 52 dzqw(ij,l)=q(ij,l-1)-q(ij,l) … … 54 55 enddo 55 56 56 do l=2, llm-157 do l=2,nlay-1 57 58 do ij=1,ngrid 58 59 #ifdef CRAY … … 73 74 do ij=1,ngrid 74 75 dzq(ij,1)=0. 75 dzq(ij, llm)=0.76 dzq(ij,nlay)=0. 76 77 enddo 77 78 c --------------------------------------------------------------- … … 83 84 c No flux at the model top: 84 85 do ij=1,ngrid 85 wq(ij, llm+1)=0.86 wq(ij,nlay+1)=0. 86 87 enddo 87 88 … … 89 90 c =============================== 90 91 91 do l = 1, llm! loop different than when w<092 do l = 1,nlay ! loop different than when w<0 92 93 do ij = 1,ngrid 93 94 … … 107 108 Mtot = masse(ij,m) 108 109 MQtot = masse(ij,m)*q(ij,m) 109 if(m.ge. llm)goto 88110 if(m.ge.nlay)goto 88 110 111 do while(w(ij,l).gt.(Mtot+masse(ij,m+1))) 111 112 m=m+1 112 113 Mtot = Mtot + masse(ij,m) 113 114 MQtot = MQtot + masse(ij,m)*q(ij,m) 114 if(m.ge. llm)goto 88115 if(m.ge.nlay)goto 88 115 116 end do 116 117 88 continue 117 if (m.lt. llm) then118 if (m.lt.nlay) then 118 119 sigw=(w(ij,l)-Mtot)/masse(ij,m+1) 119 120 wq(ij,l)=(MQtot + (w(ij,l)-Mtot)* … … 137 138 end do 138 139 139 do l = 1, llm-1 ! loop different than when w>0140 do l = 1,nlay-1 ! loop different than when w>0 140 141 do ij = 1,ngrid 141 142 if(w(ij,l+1).le.0)then … … 176 177 99 continue 177 178 178 do l=1, llm179 do l=1,nlay 179 180 do ij=1,ngrid 180 181 -
trunk/LMDZ.MARS/libf/phymars/watercloud.F
r1036 r1047 34 34 c ------------- 35 35 36 #include "dimensions.h"37 #include "dimphys.h"36 !#include "dimensions.h" 37 !#include "dimphys.h" 38 38 #include "comcstfi.h" 39 39 #include "callkeys.h" 40 40 !#include "tracer.h" 41 #include "comgeomfi.h" 42 #include "dimradmars.h" 41 !#include "comgeomfi.h" 42 !#include "dimradmars.h" 43 ! naerkind is set in scatterers.h (built when compiling with makegcm -s #) 44 #include"scatterers.h" 43 45 44 46 c Inputs: … … 58 60 real pdq(ngrid,nlay,nq) ! tendence avant condensation (kg/kg.s-1) 59 61 60 REAL tau(ngrid mx,naerkind) ! Column dust optical depth at each point61 REAL tauscaling(ngrid mx) ! Convertion factor for dust amount62 real rdust(ngrid mx,nlay) ! Dust geometric mean radius (m)62 REAL tau(ngrid,naerkind) ! Column dust optical depth at each point 63 REAL tauscaling(ngrid) ! Convertion factor for dust amount 64 real rdust(ngrid,nlay) ! Dust geometric mean radius (m) 63 65 64 66 c Outputs: … … 73 75 REAL nuice(ngrid,nlay) ! Estimated effective variance 74 76 ! of the size distribution 75 real rsedcloud(ngrid mx,nlay) ! Cloud sedimentation radius76 real rhocloud(ngrid mx,nlay) ! Cloud density (kg.m-3)77 real rsedcloud(ngrid,nlay) ! Cloud sedimentation radius 78 real rhocloud(ngrid,nlay) ! Cloud density (kg.m-3) 77 79 78 80 c local: … … 106 108 107 109 IF (firstcall) THEN 108 IF(ngrid.NE.ngridmx) THEN109 PRINT*,'STOP dans watercloud'110 PRINT*,'probleme de dimensions :'111 PRINT*,'ngrid =',ngrid112 PRINT*,'ngridmx =',ngridmx113 STOP114 ENDIF115 110 116 111 if (nq.gt.nqmx) then … … 445 440 c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 446 441 c Then that should not affect the ice particle radius 447 do ig=1,ngrid mx442 do ig=1,ngrid 448 443 if(pdpsrf(ig)*ptimestep.gt.0.9*(pplev(ig,1)-pplev(ig,2)))then 449 444 if(pdpsrf(ig)*ptimestep.gt.0.9*(pplev(ig,1)-pplev(ig,3))) -
trunk/LMDZ.MARS/libf/phymars/writediagfi.F
r1005 r1047 39 39 ! 40 40 !================================================================= 41 41 use surfdat_h, only: phisfi 42 42 implicit none 43 43 44 44 ! Commons 45 45 #include "dimensions.h" 46 #include "dimphys.h"46 !#include "dimphys.h" 47 47 #include "paramet.h" 48 48 #include "control.h" … … 52 52 #include "netcdf.inc" 53 53 #include "temps.h" 54 #include "surfdat.h"54 !#include "surfdat.h" 55 55 56 56 ! Arguments on input: … … 192 192 endif ! if (firstnom.eq.'1234567890') 193 193 194 if (ngrid mx.eq.1) then194 if (ngrid.eq.1) then 195 195 ! in testphys1d, for the 1d version of the GCM, iphysiq and irythme 196 196 ! are undefined; so set them to 1 -
trunk/LMDZ.MARS/libf/phymars/writediagsoil.F90
r410 r1047 12 12 ! Modifs: Aug.2010 Ehouarn: enforce outputs to be real*4 13 13 14 use comsoil_h, only: nsoilmx 15 14 16 implicit none 15 17 16 18 #include"dimensions.h" 17 #include"dimphys.h"19 !#include"dimphys.h" 18 20 #include"paramet.h" 19 21 #include"control.h" 20 #include"comsoil.h"22 !#include"comsoil.h" 21 23 #include"netcdf.inc" 22 24 … … 29 31 integer,intent(in) :: dimpx ! dimension of the variable (3,2 or 0) 30 32 real,dimension(ngrid,nsoilmx),intent(in) :: px ! variable 31 ! Note: nsoilmx is a common parameter set in 'dimphys.h'33 ! Note: nsoilmx is a parameter set in 'comsoil_h' 32 34 33 35 ! Local variables: 34 36 real*4,dimension(iip1,jjp1,nsoilmx) :: data3 ! to store 3D data 35 ! Note iip1,jjp1 known from paramet.h; nsoilmx known from dimphys.h37 ! Note iip1,jjp1 known from paramet.h; nsoilmx known from comsoil_h 36 38 real*4,dimension(iip1,jjp1) :: data2 ! to store 2D data 37 39 real*4 :: data0 ! to store 0D data … … 80 82 81 83 ! Define dimensions and axis attributes 82 call iniwritesoil(nid )84 call iniwritesoil(nid,ngrid) 83 85 84 86 ! set zitau to -1 to be compatible with zitau incrementation step below
Note: See TracChangeset
for help on using the changeset viewer.