Changeset 1036
- Timestamp:
- Sep 11, 2013, 2:34:44 PM (11 years ago)
- Location:
- trunk/LMDZ.MARS
- Files:
-
- 2 added
- 73 deleted
- 58 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/README
r1035 r1036 1893 1893 - Checked: exact same results than before modifications 1894 1894 1895 == 09/11/2013 == EM1895 == 11/09/2013 == EM 1896 1896 - Bug fix in vdifc.F: in some cases, some elements of pdqsdif() were not given 1897 1897 any value. In all cases, it is safer to start with clean initialization of … … 1899 1899 - Bug fix in concentration.F: error in cpi() and aki() indexes led to 1900 1900 wrong computation of atmospheric conductivity and specific heat. 1901 1902 == 11/09/2013 == EM 1903 - IMPORTANT CHANGE: Implemented dynamic tracers. It is no longer necessary to 1904 compile the model with the '-t #' option, number of tracers is simply read 1905 from tracer.def file (as before). 1906 Adapted makegcm_* scripts (and co.) accordingly. 1907 Technical aspects of the switch to dynamic tracers are: 1908 - advtrac.h (in dyn3d) removed and replaced by module infotrac.F 1909 - tracer.h (in phymars) removed and replaced by module tracer_mod.F90 (which 1910 contains nqmx, the number of tracers, etc. and can be used anywhere in the 1911 physics). 1912 - Included some side cleanups: removed unused files (in dyn3d) anldoppler2.F, 1913 anl_mcdstats.F and anl_stats-diag.F, and all the unecessary dimensions.* 1914 files in grid/dimension. 1915 - Checked that changes are clean and that GCM yields identical results (in 1916 debug mode) to previous svn version. -
trunk/LMDZ.MARS/libf/aeronomars/calchim.F90
r658 r1036 1 subroutine calchim(ptimestep,pplay,pplev,pt,pdt,dist_sol,mu0, & 1 subroutine calchim(nq, & 2 ptimestep,pplay,pplev,pt,pdt,dist_sol,mu0, & 2 3 zzlev,zzlay,zday,pq,pdq,dqchim,dqschim,dqcloud, & 3 4 dqscloud,tauref,co2ice, & 4 5 pu,pdu,pv,pdv,surfdust,surfice) 5 6 7 use tracer_mod, only: igcm_co2, igcm_co, igcm_o, igcm_o1d, igcm_o2, & 8 igcm_o3, igcm_h, igcm_h2, igcm_oh, igcm_ho2, & 9 igcm_h2o2, igcm_ch4, igcm_n2, igcm_h2o_vap, & 10 igcm_no, igcm_n, igcm_no2, igcm_n2d, & 11 igcm_o2plus, igcm_co2plus, igcm_oplus, & 12 igcm_coplus, igcm_cplus, igcm_nplus, & 13 igcm_noplus, igcm_n2plus, igcm_hplus, & 14 igcm_hco2plus, igcm_elec, mmol 6 15 implicit none 7 16 … … 56 65 #include "dimphys.h" 57 66 #include "chimiedata.h" 58 #include "tracer.h"67 !#include "tracer.h" 59 68 #include "comcstfi.h" 60 69 #include "callkeys.h" … … 63 72 ! input: 64 73 74 integer,intent(in) :: nq ! number of tracers 65 75 real :: ptimestep 66 76 real :: pplay(ngridmx,nlayermx) ! pressure at the middle of the layers … … 76 86 real :: dist_sol ! distance of the sun (AU) 77 87 real :: mu0(ngridmx) ! cos of solar zenith angle (=1 when sun at zenith) 78 real :: pq(ngridmx,nlayermx,nq mx) ! tracers mass mixing ratio79 real :: pdq(ngridmx,nlayermx,nq mx) ! previous tendencies88 real :: pq(ngridmx,nlayermx,nq) ! tracers mass mixing ratio 89 real :: pdq(ngridmx,nlayermx,nq) ! previous tendencies 80 90 real :: zday ! date (time since Ls=0, in martian days) 81 91 real :: tauref(ngridmx) ! optical depth at 7 hPa … … 86 96 ! output: 87 97 88 real :: dqchim(ngridmx,nlayermx,nq mx) ! tendencies on pq due to chemistry89 real :: dqschim(ngridmx,nq mx) ! tendencies on qsurf90 real :: dqcloud(ngridmx,nlayermx,nq mx)! tendencies on pq due to condensation91 real :: dqscloud(ngridmx,nq mx) ! tendencies on qsurf98 real :: dqchim(ngridmx,nlayermx,nq) ! tendencies on pq due to chemistry 99 real :: dqschim(ngridmx,nq) ! tendencies on qsurf 100 real :: dqcloud(ngridmx,nlayermx,nq)! tendencies on pq due to condensation 101 real :: dqscloud(ngridmx,nq) ! tendencies on qsurf 92 102 93 103 ! local variables: 94 104 95 105 integer,save :: nbq ! number of tracers used in the chemistry 96 integer, save :: niq(nqmx)! array storing the indexes of the tracers106 integer,allocatable,save :: niq(:) ! array storing the indexes of the tracers 97 107 integer :: iloc(1) ! index of major species 98 108 integer :: ig,l,i,iq,iqmax … … 133 143 134 144 real :: latvl1, lonvl1 135 real :: zq(ngridmx,nlayermx,nq mx) ! pq+pdq*ptimestep before chemistry145 real :: zq(ngridmx,nlayermx,nq) ! pq+pdq*ptimestep before chemistry 136 146 ! new mole fraction after 137 147 real :: zt(ngridmx,nlayermx) ! temperature … … 149 159 real :: ztemp(nlayermx) ! Temperature (K) 150 160 real :: zlocal(nlayermx) ! Altitude (km) 151 real :: zycol(nlayermx,nq mx) ! Composition (mole fractions)161 real :: zycol(nlayermx,nq) ! Composition (mole fractions) 152 162 real :: szacol ! Solar zenith angle 153 163 real :: surfice1d(nlayermx) ! Ice surface area (cm2/cm3) … … 172 182 end if 173 183 ! find index of chemical tracers to use 184 allocate(niq(nq)) 174 185 ! Listed here are all tracers that can go into photochemistry 175 186 nbq = 0 ! to count number of tracers -
trunk/LMDZ.MARS/libf/aeronomars/chemthermos.F90
r705 r1036 2 2 zpress,zlocal,zenit,ptimestep,zday) 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, & 7 igcm_n, igcm_no, igcm_no2, igcm_n2d, & 8 igcm_co2plus, igcm_o2plus, igcm_coplus, & 9 igcm_cplus, igcm_nplus, igcm_noplus, & 10 igcm_n2plus, igcm_hplus, igcm_hco2plus, & 11 igcm_elec, igcm_oplus 4 12 IMPLICIT NONE 5 13 !======================================================================= … … 28 36 #include "param.h" 29 37 #include "param_v4.h" 30 #include"tracer.h"38 !#include"tracer.h" 31 39 !----------------------------------------------------------------------- 32 40 ! Input/Output -
trunk/LMDZ.MARS/libf/aeronomars/concentrations.F
r1035 r1036 1 SUBROUTINE concentrations( pplay,pt,pdt,pq,pdq,ptimestep)1 SUBROUTINE concentrations(nq,pplay,pt,pdt,pq,pdq,ptimestep) 2 2 3 use tracer_mod, only: igcm_co2, igcm_co, igcm_o, igcm_o1d, 4 & igcm_o2, igcm_o3, igcm_h, igcm_h2, 5 & igcm_oh, igcm_ho2, igcm_n2, igcm_ar, 6 & igcm_h2o_vap, igcm_n, igcm_no, igcm_no2, 7 & igcm_n2d, igcm_co2plus, igcm_oplus, 8 & igcm_o2plus, igcm_coplus, igcm_cplus, 9 & igcm_nplus, igcm_noplus, igcm_n2plus, 10 & igcm_hplus, igcm_hco2plus, mmol 3 11 implicit none 4 12 … … 22 30 #include "comdiurn.h" 23 31 #include "chimiedata.h" 24 #include "tracer.h"32 !#include "tracer.h" 25 33 #include "conc.h" 26 34 27 35 ! input/output 28 36 29 real pplay(ngridmx,nlayermx) 30 real pt(ngridmx,nlayermx) 31 real pdt(ngridmx,nlayermx) 32 real pq(ngridmx,nlayermx,nqmx) 33 real pdq(ngridmx,nlayermx,nqmx) 34 real ptimestep 37 integer,intent(in) :: nq ! number of tracers 38 real,intent(in) :: pplay(ngridmx,nlayermx) 39 real,intent(in) :: pt(ngridmx,nlayermx) 40 real,intent(in) :: pdt(ngridmx,nlayermx) 41 real,intent(in) :: pq(ngridmx,nlayermx,nq) 42 real,intent(in) :: pdq(ngridmx,nlayermx,nq) 43 real,intent(in) :: ptimestep 35 44 36 45 ! local variables 37 46 38 47 integer :: i, l, ig, iq 39 integer, save :: nbq, niq(nqmx) 40 real :: ni(nqmx), ntot 41 real :: zq(ngridmx, nlayermx, nqmx) 48 integer, save :: nbq 49 integer,allocatable,save :: niq(:) 50 real :: ni(nq), ntot 51 real :: zq(ngridmx, nlayermx, nq) 42 52 real :: zt(ngridmx, nlayermx) 43 real, save :: aki(nqmx)44 real, save :: cpi(nqmx)53 real,allocatable,save :: aki(:) 54 real,allocatable,save :: cpi(:) 45 55 46 56 logical, save :: firstcall = .true. … … 48 58 if (firstcall) then 49 59 60 ! allocate local saved arrays: 61 allocate(aki(nq)) 62 allocate(cpi(nq)) 63 allocate(niq(nq)) 50 64 ! find index of chemical tracers to use 51 65 ! initialize thermal conductivity and specific heat coefficients … … 217 231 endif 218 232 219 233 ! tell the world about it: 234 write(*,*) "concentrations: firstcall, nbq=",nbq 235 write(*,*) " niq(1:nbq)=",niq(1:nbq) 236 write(*,*) " aki(1:nbq)=",aki(1:nbq) 237 write(*,*) " cpi(1:nbq)=",cpi(1:nbq) 220 238 221 239 firstcall = .false. -
trunk/LMDZ.MARS/libf/aeronomars/deposition.F
r421 r1036 7 7 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc 8 8 c 9 use tracer_mod, only: nqmx 9 10 implicit none 10 11 c -
trunk/LMDZ.MARS/libf/aeronomars/euvheat.F90
r705 r1036 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, & 7 igcm_n, igcm_no, igcm_no2, igcm_n2d, mmol 4 8 IMPLICIT NONE 5 9 !======================================================================= … … 34 38 #include "param_v4.h" 35 39 #include "chimiedata.h" 36 #include "tracer.h"40 !#include "tracer.h" 37 41 #include "conc.h" 38 42 !----------------------------------------------------------------------- -
trunk/LMDZ.MARS/libf/aeronomars/inichim_newstart.F90
r655 r1036 1 subroutine inichim_newstart(pq, qsurf, ps, flagh2o, flagthermo) 2 1 subroutine inichim_newstart(nq, pq, qsurf, ps, flagh2o, flagthermo) 2 3 use tracer_mod 3 4 implicit none 4 5 … … 23 24 ! ---------- 24 25 ! 25 ! pq(iip1,jjp1,llm,nq mx) Advected fields, ie chemical species here26 ! qsurf(ngridmx,nq mx) Amount of tracer on the surface (kg/m2)26 ! pq(iip1,jjp1,llm,nq) Advected fields, ie chemical species here 27 ! qsurf(ngridmx,nq) Amount of tracer on the surface (kg/m2) 27 28 ! ps(iip1,jjp1) Surface pressure (Pa) 28 29 ! flagh2o flag for initialisation of h2o (1: yes / 0: no) … … 34 35 #include "dimphys.h" 35 36 #include "paramet.h" 36 #include "tracer.h"37 !#include "tracer.h" 37 38 #include "comvert.h" 38 39 #include "callkeys.h" … … 41 42 ! inputs : 42 43 44 integer,intent(in) :: nq ! number of tracers 43 45 real,intent(in) :: ps(iip1,jjp1) ! surface pressure in the gcm (Pa) 44 46 integer,intent(in) :: flagh2o ! flag for h2o initialisation … … 47 49 ! outputs : 48 50 49 real,intent(out) :: pq(iip1,jjp1,llm,nq mx) ! advected fields, ie chemical species50 real,intent(out) :: qsurf(ngridmx,nq mx) ! surface values (kg/m2) of tracers51 real,intent(out) :: pq(iip1,jjp1,llm,nq) ! advected fields, ie chemical species 52 real,intent(out) :: qsurf(ngridmx,nq) ! surface values (kg/m2) of tracers 51 53 52 54 ! local : … … 73 75 74 76 ! 1.1 initialize tracer indexes to zero: 75 77 nqmx=nq ! initialize value of nqmx 78 76 79 do iq = 1,nqmx 77 80 igcm_dustbin(iq) = 0 -
trunk/LMDZ.MARS/libf/aeronomars/jthermcalc.F
r658 r1036 1026 1026 c********************************************************************** 1027 1027 1028 use tracer_mod, only: igcm_o, igcm_co2, igcm_o2, igcm_h2, 1029 & igcm_h2o_vap, igcm_h2o2, igcm_co, igcm_h, 1030 & igcm_o3, igcm_n2, igcm_n, igcm_no, igcm_no2, 1031 & mmol 1028 1032 implicit none 1029 1033 … … 1032 1036 include "dimensions.h" 1033 1037 include "dimphys.h" 1034 include "tracer.h"1038 ! include "tracer.h" 1035 1039 include 'param.h' 1036 1040 include 'param_v4.h' -
trunk/LMDZ.MARS/libf/aeronomars/moldiff.F
r690 r1036 2 2 & zzlay,pdteuv,pdtconduc,pdqdiff) 3 3 4 4 use tracer_mod, only: nqmx, igcm_co2, igcm_co, igcm_o, igcm_o1d, 5 & igcm_o2, igcm_o3, igcm_h, igcm_h2, igcm_oh, 6 & igcm_ho2, igcm_h2o2, igcm_n2, igcm_ar, 7 & igcm_h2o_vap, mmol 5 8 implicit none 6 9 … … 11 14 #include "comdiurn.h" 12 15 #include "chimiedata.h" 13 #include "tracer.h"16 !#include "tracer.h" 14 17 #include "conc.h" 15 18 -
trunk/LMDZ.MARS/libf/aeronomars/moldiff_red.F90
r1020 r1036 1 1 subroutine moldiff_red(pplay,pplev,pt,pdt,pq,pdq,ptimestep,zzlay,pdteuv,pdtconduc,pdqdiff) 2 3 use tracer_mod, only: nqmx, noms, mmol 2 4 3 5 implicit none … … 9 11 #include "comdiurn.h" 10 12 #include "chimiedata.h" 11 #include "tracer.h"13 !#include "tracer.h" 12 14 #include "conc.h" 13 15 #include "diffusion.h" … … 904 906 905 907 SUBROUTINE QMNEW(Q1,DQ,Q2,dtime,nl,nq,gc,ig) 908 use tracer_mod, only: nqmx 906 909 IMPLICIT NONE 907 #include "dimensions.h"910 !#include "dimensions.h" 908 911 909 912 INTEGER,INTENT(IN) :: nl,nq … … 939 942 940 943 SUBROUTINE MMOY(massemoy,mmol,qq,gc,nl,nq) 941 IMPLICIT NONE 942 #include "dimensions.h" 944 use tracer_mod, only: nqmx 945 IMPLICIT NONE 946 !#include "dimensions.h" 943 947 944 948 INTEGER :: nl,nq,l … … 1023 1027 & qq,mmol,gc,Praf,Traf,Qraf,Mraf,Zraf, & 1024 1028 & Nraf,Nrafk,Rraf,Rrafk,il,nl,nq,nlx,ig) 1029 use tracer_mod, only: nqmx 1025 1030 IMPLICIT NONE 1026 #include "dimensions.h"1031 !#include "dimensions.h" 1027 1032 1028 1033 INTEGER :: nl,nq,il,l,i,iq,nlx,iz,ig … … 1364 1369 SUBROUTINE GCMGRID_P(Z,P,Q,T,Nk,Rk,qq,qnew,tt,tnew, & 1365 1370 & pp,M,gc,nl,nq,nlx,ig) 1366 IMPLICIT NONE 1367 #include "dimensions.h" 1371 use tracer_mod, only: nqmx 1372 IMPLICIT NONE 1373 !#include "dimensions.h" 1368 1374 INTEGER :: nl,nq,nlx,il,nn,iP,ig,compteur 1369 1375 INTEGER,DIMENSION(1) :: indP … … 1465 1471 SUBROUTINE GCMGRID_P2(Z,P,Q,T,Nk,Rk,qq,qnew,tt,tnew & 1466 1472 & ,pp,M,gc,nl,nq,nlx,facM,ig) 1473 use tracer_mod, only: nqmx 1467 1474 IMPLICIT NONE 1468 #include "dimensions.h"1475 !#include "dimensions.h" 1469 1476 INTEGER :: nl,nq,nlx,il,nn,iP,ig,compteur 1470 1477 INTEGER,DIMENSION(1) :: indP -
trunk/LMDZ.MARS/libf/aeronomars/moldiffcoeff.F
r414 r1036 1 1 subroutine moldiffcoeff(dij) 2 3 use tracer_mod, only: igcm_co2, igcm_co, igcm_o, igcm_o1d, 4 & igcm_o2, igcm_o3, igcm_h, igcm_h2, igcm_oh, 5 & igcm_ho2, igcm_h2o2, igcm_n2, igcm_ar, 6 & igcm_h2o_vap, mmol 2 7 3 8 IMPLICIT NONE … … 16 21 #include "comdiurn.h" 17 22 #include "chimiedata.h" 18 #include "tracer.h"23 !#include "tracer.h" 19 24 #include "conc.h" 20 25 -
trunk/LMDZ.MARS/libf/aeronomars/moldiffcoeff_red.F
r710 r1036 1 1 subroutine moldiffcoeff_red(dij,indic,gcmind,ncompdiff2) 2 2 3 use tracer_mod, only: nqmx, noms, mmol 3 4 IMPLICIT NONE 4 5 c======================================================================= … … 16 17 #include "comdiurn.h" 17 18 #include "chimiedata.h" 18 #include "tracer.h"19 !#include "tracer.h" 19 20 #include "conc.h" 20 21 #include "diffusion.h" -
trunk/LMDZ.MARS/libf/aeronomars/perosat.F
r658 r1036 2 2 $ pplev, pplay, zt, 3 3 & zy, pdqcloud, pdqscloud) 4 use tracer_mod, only: nqmx, igcm_h2o2, mmol 4 5 IMPLICIT NONE 5 6 … … 14 15 c 15 16 c WARNING : H2O2 mixing ratio is assumed to be q(igcm_h2o2) 16 c index igcm_h2o2 is known from tracer .h17 c index igcm_h2o2 is known from tracer_mod 17 18 c======================================================================= 18 19 … … 25 26 #include "comcstfi.h" 26 27 #include "chimiedata.h" 27 #include "tracer.h"28 !#include "tracer.h" 28 29 #include "conc.h" 29 30 c -
trunk/LMDZ.MARS/libf/aeronomars/photochemistry.F
r690 r1036 14 14 $ surfice1d, jo3, tau) 15 15 c 16 use tracer_mod, only: nqmx 16 17 implicit none 17 18 c … … 20 21 #include "chimiedata.h" 21 22 #include "callkeys.h" 22 #include "tracer.h"23 !#include "tracer.h" 23 24 c 24 25 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc … … 1152 1153 c***************************************************************** 1153 1154 c 1155 use tracer_mod, only: nqmx, igcm_co2, igcm_co, igcm_o, igcm_o1d, 1156 & igcm_o2, igcm_o3, igcm_h, igcm_h2, igcm_oh, 1157 & igcm_ho2, igcm_h2o2, igcm_n2, igcm_h2o_vap, 1158 & igcm_ch4 1154 1159 implicit none 1155 1160 c … … 1157 1162 #include "dimphys.h" 1158 1163 #include "callkeys.h" 1159 #include "tracer.h"1164 !#include "tracer.h" 1160 1165 c 1161 1166 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc … … 1250 1255 c***************************************************************** 1251 1256 c 1257 use tracer_mod, only: nqmx, igcm_co2, igcm_co, igcm_o, igcm_o1d, 1258 & igcm_o2, igcm_o3, igcm_h, igcm_h2, igcm_oh, 1259 & igcm_ho2, igcm_h2o2, igcm_n2, igcm_h2o_vap, 1260 & igcm_ch4 1252 1261 implicit none 1253 1262 c … … 1255 1264 #include "dimphys.h" 1256 1265 #include "callkeys.h" 1257 #include "tracer.h"1266 !#include "tracer.h" 1258 1267 c 1259 1268 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc -
trunk/LMDZ.MARS/libf/aeronomars/surfacearea.F
r635 r1036 5 5 $ surfdust, surfice) 6 6 7 use tracer_mod, only: nuice_sed, igcm_dust_number, 8 & igcm_ccn_number, varian, ccn_factor 7 9 implicit none 8 10 … … 19 21 #include "comcstfi.h" 20 22 #include "callkeys.h" 21 #include "tracer.h"23 !#include "tracer.h" 22 24 #include "dimradmars.h" 23 25 #include "chimiedata.h" -
trunk/LMDZ.MARS/libf/aeronomars/thermosphere.F
r658 r1036 4 4 $ zdteuv,zdtconduc,zdumolvis,zdvmolvis,zdqmoldiff) 5 5 6 use tracer_mod, only: nqmx ! number of advecter tracers 6 7 implicit none 7 8 -
trunk/LMDZ.MARS/libf/dyn3d/calfis.F
r697 r1036 82 82 REAL pteta(iip1,jjp1,llm) 83 83 REAL pmasse(iip1,jjp1,llm) 84 REAL pq(iip1,jjp1,llm,nq mx)84 REAL pq(iip1,jjp1,llm,nq) 85 85 REAL pphis(iip1,jjp1) 86 86 REAL pphi(iip1,jjp1,llm) … … 89 89 REAL pducov(iip1,jjp1,llm) 90 90 REAL pdteta(iip1,jjp1,llm) 91 REAL pdq(iip1,jjp1,llm,nq mx)91 REAL pdq(iip1,jjp1,llm,nq) 92 92 c 93 93 REAL pw(iip1,jjp1,llm) … … 100 100 REAL pdufi(iip1,jjp1,llm) 101 101 REAL pdhfi(iip1,jjp1,llm) 102 REAL pdqfi(iip1,jjp1,llm,nq mx)102 REAL pdqfi(iip1,jjp1,llm,nq) 103 103 REAL pdpsfi(iip1,jjp1) 104 104 logical tracer … … 113 113 c 114 114 REAL zufi(ngridmx,llm), zvfi(ngridmx,llm) 115 REAL ztfi(ngridmx,llm),zqfi(ngridmx,llm,nq mx)115 REAL ztfi(ngridmx,llm),zqfi(ngridmx,llm,nq) 116 116 c 117 117 REAL zvervel(ngridmx,llm) 118 118 c 119 119 REAL zdufi(ngridmx,llm),zdvfi(ngridmx,llm) 120 REAL zdtfi(ngridmx,llm),zdqfi(ngridmx,llm,nq mx)120 REAL zdtfi(ngridmx,llm),zdqfi(ngridmx,llm,nq) 121 121 REAL zdpsrf(ngridmx) 122 122 c … … 185 185 airefi(ngridmx)=airefi(ngridmx)*iim 186 186 187 CALL inifis(ngridmx,llm, day_ini,daysec,dtphys,187 CALL inifis(ngridmx,llm,nq,day_ini,daysec,dtphys, 188 188 . latfi,lonfi,airefi,rad,g,r,cpp) 189 189 ENDIF … … 275 275 c 43.bis Taceurs (en kg/kg) 276 276 c -------------------------- 277 DO iq=1,nq mx277 DO iq=1,nq 278 278 DO l=1,llm 279 279 zqfi(1,l,iq) = pq(1,1,l,iq) … … 466 466 c --------------------- 467 467 468 DO iq=1,nq mx468 DO iq=1,nq 469 469 DO l=1,llm 470 470 DO i=1,iip1 -
trunk/LMDZ.MARS/libf/dyn3d/dynetat0.F
r999 r1036 3 3 4 4 use netcdf 5 use infotrac, only: tnom 5 6 6 7 IMPLICIT NONE … … 37 38 #include "serre.h" 38 39 #include "logic.h" 39 #include "advtrac.h"40 !#include "advtrac.h" 40 41 #include "control.h" 41 42 … … 380 381 ! WRITE(str3(2:3),'(i2.2)') iq 381 382 ! ierr = NF_INQ_VARID (nid, str3, nvarid) 382 ! NB: tracers are now read in using their name ('tnom' from advtrac.h)383 ! NB: tracers are now read in using their name ('tnom' from infotrac) 383 384 ! write(*,*) " loading tracer:",trim(tnom(iq)) 384 385 ierr=nf90_inq_varid(nid,tnom(iq),nvarid) … … 404 405 c case when new tracer are added in addition to old ones 405 406 write(*,*)'tracers 1 to ', nqold,'were already present' 406 write(*,*)'tracers ', nqold+1,' to ', nq mx,'are new'407 write(*,*)'tracers ', nqold+1,' to ', nq,'are new' 407 408 ! yes=' ' 408 409 ! do while ((yes.ne.'y').and.(yes.ne.'n')) 409 410 ! write(*,*) 'Would you like to reindex tracer # 1 ->',nqold 410 ! write(*,*) 'to #',nq mx-nqold+1,'->', nqmx,' (y or n) ?'411 ! write(*,*) 'to #',nq-nqold+1,'->', nq,' (y or n) ?' 411 412 ! read(*,fmt='(a)') yes 412 413 ! end do … … 416 417 ! do j=1,jjp1 417 418 ! do i=1,iip1 418 ! do iq=nq mx,nqmx-nqold+1,-1419 ! q(i,j,l,iq)=q(i,j,l,iq-nq mx+nqold)419 ! do iq=nq,nq-nqold+1,-1 420 ! q(i,j,l,iq)=q(i,j,l,iq-nq+nqold) 420 421 ! end do 421 ! do iq=nq mx-nqold,1,-1422 ! do iq=nq-nqold,1,-1 422 423 ! q(i,j,l,iq)= 0. 423 424 ! end do -
trunk/LMDZ.MARS/libf/dyn3d/dynredem.F
r999 r1036 1 1 SUBROUTINE dynredem0(fichnom,idayref,anneeref,phis,nq) 2 use infotrac, only: tnom 2 3 IMPLICIT NONE 3 4 c======================================================================= … … 17 18 #include "description.h" 18 19 #include "serre.h" 19 #include "advtrac.h"20 !#include "advtrac.h" 20 21 c Arguments: 21 22 c ---------- … … 963 964 SUBROUTINE dynredem1(fichnom,time, 964 965 . vcov,ucov,teta,q,nq,masse,ps) 966 use infotrac, only: nqtot, tnom 965 967 IMPLICIT NONE 966 968 c================================================================= … … 973 975 #include "comvert.h" 974 976 #include "comgeom.h" 975 #include"advtrac.h"977 !#include"advtrac.h" 976 978 977 979 INTEGER nq, l … … 979 981 REAL teta(ip1jmp1,llm) 980 982 REAL ps(ip1jmp1),masse(ip1jmp1,llm) 981 REAL q(iip1,jjp1,llm,nq mx)983 REAL q(iip1,jjp1,llm,nqtot) 982 984 REAL q3d(iip1,jjp1,llm) !temporary variable 983 985 CHARACTER*(*) fichnom -
trunk/LMDZ.MARS/libf/dyn3d/gcm.F
r999 r1036 1 1 PROGRAM gcm 2 2 3 use infotrac, only: iniadvtrac, nqtot, iadv 3 4 IMPLICIT NONE 4 5 … … 48 49 #include "tracstoke.h" 49 50 #include "sponge.h" 50 #include"advtrac.h"51 !#include"advtrac.h" 51 52 52 53 INTEGER*4 iday ! jour julien … … 57 58 REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm) ! vents covariants 58 59 real, dimension(ip1jmp1,llm) :: teta ! temperature potentielle 59 REAL q(ip1jmp1,llm,nqmx)! champs advectes60 REAL,allocatable :: q(:,:,:) ! champs advectes 60 61 REAL ps(ip1jmp1) ! pression au sol 61 62 REAL pext(ip1jmp1) ! pression extensive … … 80 81 c tendances dynamiques 81 82 REAL dv(ip1jm,llm),du(ip1jmp1,llm) 82 REAL dteta(ip1jmp1,llm),dq(ip1jmp1,llm,nqmx),dp(ip1jmp1) 83 REAL dteta(ip1jmp1,llm),dp(ip1jmp1) 84 REAL,ALLOCATABLE :: dq(:,:,:) 83 85 84 86 c tendances de la dissipation … … 88 90 c tendances physiques 89 91 REAL dvfi(ip1jm,llm),dufi(ip1jmp1,llm) 90 REAL dhfi(ip1jmp1,llm),dqfi(ip1jmp1,llm,nqmx),dpfi(ip1jmp1) 92 REAL dhfi(ip1jmp1,llm),dpfi(ip1jmp1) 93 REAL,ALLOCATABLE :: dqfi(:,:,:) 91 94 92 95 c variables pour le fichier histoire … … 95 98 REAL tppn(iim),tpps(iim),tpn,tps 96 99 c 97 ! INTEGER iadv(nqmx) ! indice schema de transport pour le traceur iq98 100 99 101 INTEGER itau,itaufinp1,iav … … 124 126 LOGICAL tracer 125 127 data tracer/.true./ 126 INTEGER nq128 ! INTEGER nq 127 129 128 130 C Calendrier … … 142 144 143 145 c----------------------------------------------------------------------- 144 c Initialize tracers using iniadvtrac (Ehouarn, oct 2008)145 146 CALL defrun_new( 99, .TRUE. ) 146 147 147 CALL iniadvtrac(nq,numvanle) 148 149 CALL dynetat0("start.nc",nqmx,vcov,ucov, 148 ! Initialize tracers 149 call iniadvtrac(nqtot,numvanle) 150 ! Allocation de la tableau q : champs advectes 151 allocate(q(ip1jmp1,llm,nqtot)) 152 allocate(dq(ip1jmp1,llm,nqtot)) 153 allocate(dqfi(ip1jmp1,llm,nqtot)) 154 155 CALL dynetat0("start.nc",nqtot,vcov,ucov, 150 156 . teta,q,masse,ps,phis,time_0) 151 157 … … 245 251 . 'c''est a dire du jour',i7,3x,'au jour',i7//) 246 252 247 CALL dynredem0("restart.nc",day_ini,anne_ini,phis,nq mx)253 CALL dynredem0("restart.nc",day_ini,anne_ini,phis,nqtot) 248 254 249 255 ecripar = .TRUE. … … 253 259 254 260 c Quelques initialisations pour les traceurs 255 call initial0(ijp1llm*nqmx,dq)261 dq(:,:,:)=0 256 262 c istdyn=day_step/4 ! stockage toutes les 6h=1jour/4 257 263 c istphy=istdyn/iphysiq … … 348 354 IF( forward. OR . leapf ) THEN 349 355 350 DO iq = 1, nq mx356 DO iq = 1, nqtot 351 357 c 352 358 IF ( iadv(iq).EQ.1.OR.iadv(iq).EQ.2 ) THEN 353 359 CALL traceur( iq,iadv,q,teta,pk,w, pbaru, pbarv, dq ) 354 360 355 ELSE IF( iq.EQ. nq mx) THEN361 ELSE IF( iq.EQ. nqtot ) THEN 356 362 c 357 363 iapp_tracvl = 5 … … 361 367 c 362 368 363 CALL vanleer(numvanle,iapp_tracvl,nq mx,q,pbaru,pbarv,369 CALL vanleer(numvanle,iapp_tracvl,nqtot,q,pbaru,pbarv, 364 370 * p, masse, dq, iadv(1), teta, pk ) 365 371 … … 422 428 ENDIF 423 429 c 424 CALL calfis( nq mx, lafin ,rdayvrai,rday_ecri,time ,430 CALL calfis( nqtot, lafin ,rdayvrai,rday_ecri,time , 425 431 $ ucov,vcov,teta,q,masse,ps,p,pk,phis,phi , 426 432 $ du,dv,dteta,dq,w, dufi,dvfi,dhfi,dqfi,dpfi,tracer) … … 429 435 c ajout des tendances physiques: 430 436 c ------------------------------ 431 CALL addfi( nq mx, dtphys, leapf, forward ,437 CALL addfi( nqtot, dtphys, leapf, forward , 432 438 $ ucov, vcov, teta , q ,ps , masse, 433 439 $ dufi, dvfi, dhfi , dqfi ,dpfi ) … … 540 546 c iav=0 541 547 c ENDIF 542 c CALL writedynav(histaveid, nq mx, itau,vcov ,548 c CALL writedynav(histaveid, nqtot, itau,vcov , 543 549 c , ucov,teta,pk,phi,q,masse,ps,phis) 544 550 c ENDIF … … 556 562 . ' date=',REAL(itau)/REAL(day_step) 557 563 CALL dynredem1("restart.nc",REAL(itau)/REAL(day_step), 558 . vcov,ucov,teta,q,nq mx,masse,ps)564 . vcov,ucov,teta,q,nqtot,masse,ps) 559 565 560 566 CLOSE(99) … … 625 631 iav=0 626 632 ENDIF 627 c CALL writedynav(histaveid, nq mx, itau,vcov ,633 c CALL writedynav(histaveid, nqtot, itau,vcov , 628 634 c , ucov,teta,pk,phi,q,masse,ps,phis) 629 635 … … 636 642 CALL dynredem1("restart.nc", 637 643 . REAL(itau)/REAL(day_step), 638 . vcov,ucov,teta,q,nq mx,masse,ps)644 . vcov,ucov,teta,q,nqtot,masse,ps) 639 645 640 646 forward = .TRUE. -
trunk/LMDZ.MARS/libf/dyn3d/lect_start_archive.F
r999 r1036 1 SUBROUTINE lect_start_archive( date,tsurf,tsoil,emis,q2,1 SUBROUTINE lect_start_archive(nqtot,date,tsurf,tsoil,emis,q2, 2 2 & t,ucov,vcov,ps,co2ice,h,phisold_newgrid, 3 3 & q,qsurf,surfith,nid) … … 16 16 c 17 17 c======================================================================= 18 18 use infotrac, only: tnom 19 19 implicit none 20 20 … … 38 38 #include "netcdf.inc" 39 39 !#include "tracer.h" 40 #include"advtrac.h"40 !#include"advtrac.h" 41 41 c======================================================================= 42 42 c Declarations … … 49 49 c et autres: 50 50 c---------- 51 INTEGER lnblnk 52 EXTERNAL lnblnk 51 integer,intent(in) :: nqtot ! number of advected tracers 53 52 54 53 c Variables pour les lectures des fichiers "ini" … … 85 84 REAL vcov(iip1,jjm,llm),ucov(iip1,jjp1,llm) ! vents covariants 86 85 REAL h(iip1,jjp1,llm),ps(iip1,jjp1) 87 REAL q(iip1,jjp1,llm,nq mx),qtot(iip1,jjp1,llm)86 REAL q(iip1,jjp1,llm,nqtot),qtot(iip1,jjp1,llm) 88 87 89 88 c autre variables dynamique nouvelle grille … … 103 102 REAL co2ice(ngridmx) ! CO2 ice layer 104 103 REAL emis(ngridmx) 105 REAL q2(ngridmx,nlayermx+1),qsurf(ngridmx,nq mx)104 REAL q2(ngridmx,nlayermx+1),qsurf(ngridmx,nqtot) 106 105 c REAL phisfi(ngridmx) 107 106 … … 130 129 real inertiedatS(iip1,jjp1,nsoilmx) 131 130 real co2iceS(iip1,jjp1),emisS(iip1,jjp1) 132 REAL q2S(iip1,jjp1,llm+1),qsurfS(iip1,jjp1,nq mx)131 REAL q2S(iip1,jjp1,llm+1),qsurfS(iip1,jjp1,nqtot) 133 132 134 133 real ptotal, co2icetotal … … 193 192 ! check if tracers follow old naming convention (q01, q02, q03, ...) 194 193 counter=0 195 do iq=1,nq mx194 do iq=1,nqtot 196 195 txt= " " 197 196 write(txt,'(a1,i2.2)')'q',iq … … 205 204 endif 206 205 enddo 207 if (counter.eq.nq mx) then206 if (counter.eq.nqtot) then 208 207 write(*,*) "lect_start_archive: tracers seem to follow old ", 209 208 & "naming convention (q01, q02,...)" … … 318 317 allocate(psold(imold+1,jmold+1)) 319 318 allocate(phisold(imold+1,jmold+1)) 320 allocate(qold(imold+1,jmold+1,lmold,nq mx))319 allocate(qold(imold+1,jmold+1,lmold,nqtot)) 321 320 allocate(co2iceold(imold+1,jmold+1)) 322 321 allocate(tsurfold(imold+1,jmold+1)) … … 331 330 allocate(surfithold(imold+1,jmold+1)) 332 331 allocate(mlayerold(nsoilold)) 333 allocate(qsurfold(imold+1,jmold+1,nq mx))332 allocate(qsurfold(imold+1,jmold+1,nqtot)) 334 333 335 334 allocate(var (imold+1,jmold+1,llm)) … … 748 747 c ------------------------------------------- 749 748 ! Surface tracers: 750 qsurfold(1:imold+1,1:jmold+1,1:nq mx)=0751 752 DO iq=1,nq mx749 qsurfold(1:imold+1,1:jmold+1,1:nqtot)=0 750 751 DO iq=1,nqtot 753 752 IF (oldtracernames) THEN 754 753 txt=" " … … 787 786 ENDIF 788 787 789 ENDDO ! of DO iq=1,nq mx788 ENDDO ! of DO iq=1,nqtot 790 789 791 790 !----------------------------------------------------------------------- … … 936 935 c ------------------------------------------- 937 936 ! Tracers: 938 qold(1:imold+1,1:jmold+1,1:lmold,1:nq mx)=0939 940 DO iq=1,nq mx937 qold(1:imold+1,1:jmold+1,1:lmold,1:nqtot)=0 938 939 DO iq=1,nqtot 941 940 IF (oldtracernames) THEN 942 941 txt=" " … … 966 965 ENDIF 967 966 968 ENDDO ! of DO iq=1,nq mx967 ENDDO ! of DO iq=1,nqtot 969 968 970 969 … … 1273 1272 1274 1273 c traceurs surface 1275 do iq = 1, nq mx1274 do iq = 1, nqtot 1276 1275 call interp_horiz(qsurfold(1,1,iq) ,qsurfs(1,1,iq), 1277 1276 & imold,jmold,iim,jjm,1, … … 1279 1278 enddo 1280 1279 1281 call gr_dyn_fi (nq mx,iim+1,jjm+1,ngridmx,qsurfs,qsurf)1280 call gr_dyn_fi (nqtot,iim+1,jjm+1,ngridmx,qsurfs,qsurf) 1282 1281 1283 1282 c traceurs 3D 1284 do iq = 1, nq mx1283 do iq = 1, nqtot 1285 1284 call interp_vert(qold(1,1,1,iq),var,lmold,llm, 1286 1285 & apsold,bpsold,aps,bps,psold,(imold+1)*(jmold+1)) … … 1322 1321 1323 1322 c Periodicite : 1324 do iq = 1, nq mx1323 do iq = 1, nqtot 1325 1324 do l=1, llm 1326 1325 do j = 1, jjp1 -
trunk/LMDZ.MARS/libf/dyn3d/newstart.F
r999 r1036 16 16 17 17 ! to use 'getin' 18 USE ioipsl_getincom 19 18 use ioipsl_getincom, only: getin 19 use infotrac, only: iniadvtrac, nqtot, tnom 20 use tracer_mod, only: noms, igcm_h2o_vap, igcm_h2o_ice 20 21 implicit none 21 22 … … 41 42 #include "serre.h" 42 43 #include "netcdf.inc" 43 #include"advtrac.h"44 #include"tracer.h"44 !#include"advtrac.h" 45 !#include"tracer.h" 45 46 #include "datafile.h" 46 47 c======================================================================= … … 72 73 REAL vcov(iip1,jjm,llm),ucov(iip1,jjp1,llm) ! vents covariants 73 74 REAL phis(iip1,jjp1) 74 REAL q(iip1,jjp1,llm,nqmx) ! champs advectes75 REAL,ALLOCATABLE :: q(:,:,:,:) ! champs advectes 75 76 76 77 c autre variables dynamique nouvelle grille … … 98 99 REAL co2ice(ngridmx) ! CO2 ice layer 99 100 REAL emis(ngridmx) ! surface emissivity 100 REAL qsurf(ngridmx,nqmx)101 REAL,ALLOCATABLE :: qsurf(:,:) 101 102 REAL q2(ngridmx,nlayermx+1) 102 103 ! REAL rnaturfi(ngridmx) … … 179 180 pa= 20 ! for Mars, instead of 500 (Earth) 180 181 182 ! Load tracer number and names: 183 call iniadvtrac(nqtot,numvanle) 184 ! allocate arrays 185 allocate(q(iip1,jjp1,llm,nqtot)) 186 allocate(qsurf(ngridmx,nqtot)) 187 181 188 c======================================================================= 182 189 c Choice of the start file(s) to use … … 323 330 c INITIALISATIONS DIVERSES 324 331 c======================================================================= 325 ! Load tracer names:326 call iniadvtrac(nq,numvanle)327 332 328 333 day_step=180 !?! Note: day_step is a common in "control.h" … … 357 362 ! (for instance initracer needs to know about some flags, and/or 358 363 ! 'datafile' path may be changed by user) 359 call inifis(ngridmx,llm, day_ini,daysec,dtphys,364 call inifis(ngridmx,llm,nqtot,day_ini,daysec,dtphys, 360 365 & latfi,lonfi,airefi,rad,g,r,cpp) 361 366 … … 399 404 400 405 write(*,*) 'Reading file START_ARCHIVE' 401 CALL lect_start_archive( date,tsurf,tsoil,emis,q2,406 CALL lect_start_archive(nqtot,date,tsurf,tsoil,emis,q2, 402 407 . t,ucov,vcov,ps,co2ice,teta,phisold_newgrid,q,qsurf, 403 408 & surfith,nid) … … 415 420 write(*,*) 'Reading file START' 416 421 fichnom = 'start.nc' 417 CALL dynetat0(fichnom,nq mx,vcov,ucov,teta,q,masse,422 CALL dynetat0(fichnom,nqtot,vcov,ucov,teta,q,masse, 418 423 . ps,phis,time) 419 424 420 425 write(*,*) 'Reading file STARTFI' 421 426 fichnom = 'startfi.nc' 422 CALL phyetat0 (fichnom,tab0,Lmodif,nsoilmx,nq mx,427 CALL phyetat0 (fichnom,tab0,Lmodif,nsoilmx,nqtot, 423 428 . day_ini,time, 424 429 . tsurf,tsoil,emis,q2,qsurf,co2ice) … … 448 453 ! rename them 449 454 count=0 450 do iq=1,nq mx455 do iq=1,nqtot 451 456 txt=" " 452 457 write(txt,'(a1,i2.2)') 'q',iq … … 454 459 count=count+1 455 460 endif 456 enddo ! of do iq=1,nq mx461 enddo ! of do iq=1,nqtot 457 462 458 463 ! initialize tracer names noms(:) and indexes (igcm_co2, igcm_h2o_vap, ...) 459 call initracer( qsurf,co2ice)464 call initracer(ngridmx,nqtot,qsurf,co2ice) 460 465 461 if (count.eq.nq mx) then466 if (count.eq.nqtot) then 462 467 write(*,*) 'Newstart: updating tracer names' 463 468 ! copy noms(:) to tnom(:) to have matching tracer names in physics 464 469 ! and dynamics 465 tnom(1:nq mx)=noms(1:nqmx)470 tnom(1:nqtot)=noms(1:nqtot) 466 471 endif 467 472 … … 693 698 if (yes.eq.'y') then 694 699 write(*,*) 'OK : conservation of tracer total mass' 695 DO iq =1, nq mx700 DO iq =1, nqtot 696 701 DO l=1,llm 697 702 DO j=1,jjp1 … … 712 717 do while (yes.eq.'y') 713 718 write(*,*) 'Which tracer name do you want to change ?' 714 do iq=1,nq mx719 do iq=1,nqtot 715 720 write(*,'(i3,a3,a20)')iq,' : ',trim(tnom(iq)) 716 721 enddo 717 722 write(*,'(a35,i3)') 718 & '(enter tracer number; between 1 and ',nq mx723 & '(enter tracer number; between 1 and ',nqtot 719 724 write(*,*)' or any other value to quit this option)' 720 725 read(*,*) iq 721 if ((iq.ge.1).and.(iq.le.nq mx)) then726 if ((iq.ge.1).and.(iq.le.nqtot)) then 722 727 write(*,*)'Change tracer name ',trim(tnom(iq)),' to ?' 723 728 read(*,*) txt … … 728 733 ! inapropiate value of iq; quit this option 729 734 yes='n' 730 endif ! of if ((iq.ge.1).and.(iq.le.nq mx))735 endif ! of if ((iq.ge.1).and.(iq.le.nqtot)) 731 736 enddo ! of do while (yes.ne.'y') 732 737 … … 736 741 c mise a 0 des q (traceurs) 737 742 write(*,*) 'Tracers set to 0 (1.E-30 in fact)' 738 DO iq =1, nq mx743 DO iq =1, nqtot 739 744 DO l=1,llm 740 745 DO j=1,jjp1 … … 747 752 748 753 c set surface tracers to zero 749 DO iq =1, nq mx754 DO iq =1, nqtot 750 755 DO ig=1,ngridmx 751 756 qsurf(ig,iq)=0. … … 757 762 else if (trim(modif) .eq. 'q=x') then 758 763 write(*,*) 'Which tracer do you want to modify ?' 759 do iq=1,nq mx764 do iq=1,nqtot 760 765 write(*,*)iq,' : ',trim(tnom(iq)) 761 766 enddo 762 write(*,*) '(choose between 1 and ',nq mx,')'767 write(*,*) '(choose between 1 and ',nqtot,')' 763 768 read(*,*) iq 764 if ((iq.lt.1).or.(iq.gt.nq mx)) then769 if ((iq.lt.1).or.(iq.gt.nqtot)) then 765 770 ! wrong value for iq, go back to menu 766 771 write(*,*) "wrong input value:",iq … … 793 798 write(*,*) "followed by 2nd, etc. up to top of atmosphere)" 794 799 write(*,*) 'Which tracer do you want to set?' 795 do iq=1,nq mx800 do iq=1,nqtot 796 801 write(*,*)iq,' : ',trim(tnom(iq)) 797 802 enddo 798 write(*,*) '(choose between 1 and ',nq mx,')'803 write(*,*) '(choose between 1 and ',nqtot,')' 799 804 read(*,*) iq 800 if ((iq.lt.1).or.(iq.gt.nq mx)) then805 if ((iq.lt.1).or.(iq.gt.nqtot)) then 801 806 ! wrong value for iq, go back to menu 802 807 write(*,*) "wrong input value:",iq … … 853 858 endif 854 859 855 call inichim_newstart( q, qsurf, ps, flagh2o, flagthermo)860 call inichim_newstart(nq, q, qsurf, ps, flagh2o, flagthermo) 856 861 857 862 ! We want to have the very same value at lon -180 and lon 180 858 863 do l = 1,llm 859 864 do j = 1,jjp1 860 do iq = 1,nq mx865 do iq = 1,nqtot 861 866 q(iip1,j,l,iq) = q(1,j,l,iq) 862 867 end do … … 892 897 do l = 1,llm 893 898 do j = 1,jjp1 894 do iq = 1,nq mx899 do iq = 1,nqtot 895 900 q(iip1,j,l,iq) = q(1,j,l,iq) 896 901 end do … … 1460 1465 c $ phi,conser,du,dv,dteta,dp,w, pbaru,pbarv, day_ini ) 1461 1466 1462 CALL dynredem0("restart.nc",day_ini,anneeref,phis,nq mx)1467 CALL dynredem0("restart.nc",day_ini,anneeref,phis,nqtot) 1463 1468 CALL dynredem1("restart.nc",hour_ini,vcov,ucov,teta,q, 1464 . nq mx,masse,ps)1469 . nqtot,masse,ps) 1465 1470 C 1466 1471 C Ecriture etat initial physique 1467 1472 C 1468 1473 1469 call physdem0("restartfi.nc",lonfi,latfi,nsoilmx,nq mx,1474 call physdem0("restartfi.nc",lonfi,latfi,nsoilmx,nqtot, 1470 1475 . dtphys,real(day_ini),0.0, 1471 1476 . airefi,albfi,ithfi,zmea,zstd,zsig,zgam,zthe) 1472 call physdem1("restartfi.nc",nsoilmx,nq mx,1477 call physdem1("restartfi.nc",nsoilmx,nqtot, 1473 1478 . dtphys,hour_ini, 1474 1479 . tsurf,tsoil,co2ice,emis,q2,qsurf) -
trunk/LMDZ.MARS/libf/dyn3d/paramet.h
r38 r1036 3 3 4 4 INTEGER iip1,iip2,iip3,jjp1,llmp1,llmp2,llmm1 5 INTEGER kftd,ip1jm,ip1jmp1,ip1jmi1,ijp1llm5 INTEGER ip1jm,ip1jmp1,ip1jmi1,ijp1llm 6 6 INTEGER ijmllm,mvar 7 7 INTEGER jcfil,jcfllm … … 10 10 PARAMETER( jjp1=jjm+1-1/jjm) 11 11 PARAMETER( llmp1 = llm+1, llmp2 = llm+2, llmm1 = llm-1 ) 12 PARAMETER( kftd = iim/2 -ndm )13 12 PARAMETER( ip1jm = iip1*jjm, ip1jmp1= iip1*jjp1 ) 14 13 PARAMETER( ip1jmi1= ip1jm - iip1 ) -
trunk/LMDZ.MARS/libf/dyn3d/start2archive.F
r999 r1036 19 19 c======================================================================= 20 20 21 use infotrac, only: iniadvtrac, nqtot, tnom 21 22 implicit none 22 23 … … 35 36 #include "dimphys.h" 36 37 #include "comsoil.h" 37 #include"advtrac.h"38 !#include"advtrac.h" 38 39 #include "netcdf.inc" 39 40 … … 46 47 REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm) ! vents covariants 47 48 REAL teta(ip1jmp1,llm) ! temperature potentielle 48 REAL q(ip1jmp1,llm,nqmx)! champs advectes49 REAL,ALLOCATABLE :: q(:,:,:) ! champs advectes 49 50 REAL pks(ip1jmp1) ! exner (f pour filtre) 50 51 REAL pk(ip1jmp1,llm) … … 61 62 REAL tsoil(ngridmx,nsoilmx) ! Soil temperature 62 63 REAL co2ice(ngridmx) ! CO2 ice layer 63 REAL q2(ngridmx,nlayermx+1),qsurf(ngridmx,nqmx) 64 REAL q2(ngridmx,nlayermx+1) 65 REAL,ALLOCATABLE :: qsurf(:,:) 64 66 REAL emis(ngridmx) 65 67 INTEGER start,length … … 75 77 REAL ithS(ip1jmp1,nsoilmx) ! Soil Thermal Inertia 76 78 REAL co2iceS(ip1jmp1) 77 REAL q2S(ip1jmp1,llm+1),qsurfS(ip1jmp1,nqmx) 79 REAL q2S(ip1jmp1,llm+1) 80 REAL,ALLOCATABLE :: qsurfS(:,:) 78 81 REAL emisS(ip1jmp1) 79 82 … … 116 119 c Lecture des donnees 117 120 c======================================================================= 118 ! Load tracer names: 119 call iniadvtrac(nq,numvanle) 121 ! Load tracer number and names: 122 call iniadvtrac(nqtot,numvanle) 123 124 ! allocate arrays: 125 allocate(q(ip1jmp1,llm,nqtot)) 126 allocate(qsurf(ngridmx,nqtot)) 127 allocate(qsurfS(ip1jmp1,nqtot)) 120 128 121 129 fichnom = 'start.nc' 122 CALL dynetat0(fichnom,nq mx,vcov,ucov,teta,q,masse,130 CALL dynetat0(fichnom,nqtot,vcov,ucov,teta,q,masse, 123 131 . ps,phis,timedyn) 124 132 … … 127 135 Lmodif=0 128 136 129 CALL phyetat0 (fichnom,0,Lmodif,nsoilmx,nq mx,day_ini_fi,timefi,137 CALL phyetat0 (fichnom,0,Lmodif,nsoilmx,nqtot,day_ini_fi,timefi, 130 138 . tsurf,tsoil,emis,q2,qsurf,co2ice) 131 139 … … 233 241 call gr_fi_dyn(1,ngridmx,iip1,jjp1,emis,emisS) 234 242 call gr_fi_dyn(llm+1,ngridmx,iip1,jjp1,q2,q2S) 235 call gr_fi_dyn(nq mx,ngridmx,iip1,jjp1,qsurf,qsurfS)243 call gr_fi_dyn(nqtot,ngridmx,iip1,jjp1,qsurf,qsurfS) 236 244 237 245 c======================================================================= … … 334 342 335 343 c----------------------------------------------------------------------- 336 c Ecriture du champs q ( q[1,nq mx] )337 c----------------------------------------------------------------------- 338 do iq=1,nq mx344 c Ecriture du champs q ( q[1,nqtot] ) 345 c----------------------------------------------------------------------- 346 do iq=1,nqtot 339 347 c write(str2,'(i2.2)') iq 340 348 c call write_archive(nid,ntime,'q'//str2,'tracer','kg/kg', … … 344 352 end do 345 353 c----------------------------------------------------------------------- 346 c Ecriture du champs qsurf ( qsurf[1,nq mx] )347 c----------------------------------------------------------------------- 348 do iq=1,nq mx354 c Ecriture du champs qsurf ( qsurf[1,nqtot] ) 355 c----------------------------------------------------------------------- 356 do iq=1,nqtot 349 357 c write(str2,'(i2.2)') iq 350 358 c call write_archive(nid,ntime,'qsurf'//str2,'Tracer on surface', -
trunk/LMDZ.MARS/libf/dyn3d/test_period.F
r1005 r1036 6 6 c teta, q , p et phis .......... 7 7 c 8 c IMPLICIT NONE 8 use infotrac,only: nqtot 9 IMPLICIT NONE 9 10 c 10 11 #include "dimensions.h" … … 14 15 c 15 16 REAL ucov(ip1jmp1,llm), vcov(ip1jm,llm), teta(ip1jmp1,llm) , 16 , q(ip1jmp1,llm,nq mx), p(ip1jmp1,llmp1), phis(ip1jmp1)17 , q(ip1jmp1,llm,nqtot), p(ip1jmp1,llmp1), phis(ip1jmp1) 17 18 c 18 19 c ..... Variables locales ..... … … 56 57 57 58 c 58 DO nq =1, nq mx59 DO nq =1, nqtot 59 60 DO l =1, llm 60 61 DO ij = 1, ip1jmp1, iip1 -
trunk/LMDZ.MARS/libf/grid/dimension/makdim
r38 r1036 1 nqmx=$1 2 shift 1 3 2 for i in $* ; do 4 3 list=$list.$i 5 4 done 6 fichdim=dimensions${list} .t${nqmx}5 fichdim=dimensions${list} 7 6 8 7 … … 15 14 lm=$3 16 15 n2=$1 17 ndm=116 # ndm=1 18 17 19 18 # while [ "$n2" -gt 2 ]; do … … 30 29 jm=$1 31 30 lm=$2 32 ndm=131 # ndm=1 33 32 else if [ $# -ge 1 ] ; then 34 33 im=1 35 34 jm=1 36 35 lm=$1 37 ndm=136 # ndm=1 38 37 else 39 38 echo il faut au moins une dimension … … 49 48 ! dimensions.h contient les dimensions du modele 50 49 ! ndm est tel que iim=2**ndm 51 ! nqmx est la dimension de la variable traceur q52 50 !----------------------------------------------------------------------- 53 51 54 INTEGER, parameter :: iim= 52 INTEGER, parameter :: iim=$im 55 53 INTEGER, parameter :: jjm=$jm 56 54 INTEGER, parameter :: llm=$lm 57 INTEGER, parameter :: ndm=$ndm58 59 integer, parameter :: nqmx=$nqmx60 55 61 56 !----------------------------------------------------------------------- -
trunk/LMDZ.MARS/libf/phymars/aeropacity.F
r677 r1036 4 4 5 5 ! to use 'getin' 6 USE ioipsl_getincom 6 USE ioipsl_getincom, only: getin 7 use tracer_mod, only: noms, igcm_h2o_ice, igcm_dust_mass, 8 & igcm_dust_submicron, rho_dust, rho_ice 7 9 IMPLICIT NONE 8 10 c======================================================================= … … 53 55 #include "dimradmars.h" 54 56 #include "yomaer.h" 55 #include "tracer.h"57 !#include "tracer.h" 56 58 #include "planete.h" 57 59 #include "aerkind.h" … … 119 121 120 122 ! indexes of water ice and dust tracers: 121 INTEGER, SAVE :: nqdust(nqmx) ! to store the indexes of dust tracers123 INTEGER,ALLOCATABLE,SAVE :: nqdust(:) ! to store the indexes of dust tracers 122 124 INTEGER,SAVE :: i_ice=0 ! water ice 123 125 real,parameter :: odpref=610. ! DOD reference pressure (Pa) … … 143 145 ENDDO 144 146 ! identify tracers which are dust 147 allocate(nqdust(nq)) 145 148 i=0 146 149 DO iq=1,nq -
trunk/LMDZ.MARS/libf/phymars/callradite.F
r740 r1036 272 272 name_iaer(1) = "dust_conrath" !! default choice is good old Conrath profile 273 273 IF (doubleq.AND.active) name_iaer(1) = "dust_doubleq" !! two-moment scheme 274 if (nq mx.gt.1) then274 if (nq.gt.1) then 275 275 ! trick to avoid problems compiling with 1 tracer 276 276 ! and picky compilers who know name_iaer(2) is out of bounds … … 278 278 IF (water.AND.activice) name_iaer(j) = "h2o_ice" !! radiatively-active clouds 279 279 IF (submicron.AND.active) name_iaer(j) = "dust_submicron" !! JBM experimental stuff 280 endif ! of if (nq mx.gt.1)280 endif ! of if (nq.gt.1) 281 281 c ---------------------------------------------------------- 282 282 -
trunk/LMDZ.MARS/libf/phymars/callsedim.F
r1005 r1036 5 5 & tau,tauscaling) 6 6 ! to use 'getin' 7 USE ioipsl_getincom 8 USE updaterad,only: updaterdust,updaterice_micro,updaterice_typ 7 USE ioipsl_getincom, only: getin 8 USE updaterad, only: updaterdust,updaterice_micro,updaterice_typ 9 USE tracer_mod, only: noms, igcm_dust_mass, igcm_dust_number, 10 & rho_dust, rho_q, radius, varian, 11 & igcm_ccn_mass, igcm_ccn_number, 12 & igcm_h2o_ice, nuice_sed, nuice_ref 9 13 IMPLICIT NONE 10 14 … … 28 32 #include "dimphys.h" 29 33 #include "comcstfi.h" 30 #include "tracer.h"34 !#include "tracer.h" 31 35 #include "callkeys.h" 32 36 -
trunk/LMDZ.MARS/libf/phymars/calltherm_interface.F90
r1033 r1036 45 45 46 46 use comtherm_h 47 use tracer_mod, only: nqmx,noms 47 48 implicit none 48 49 -
trunk/LMDZ.MARS/libf/phymars/convadj.F
r161 r1036 6 6 & pdqadj) 7 7 8 use tracer_mod, only: noms, ! tracer names 9 & igcm_h2o_vap ! index of water vapor tracer 8 10 implicit none 9 11 … … 33 35 #include "comcstfi.h" 34 36 #include "callkeys.h" 35 #include "tracer.h"37 !#include "tracer.h" 36 38 37 39 … … 73 75 INTEGER iq,ico2 74 76 save ico2 75 REAL zq(ngridmx,nlayermx,nq mx), zq2(ngridmx,nlayermx,nqmx)76 REAL zqm(nq mx),zqco2m77 REAL zq(ngridmx,nlayermx,nq), zq2(ngridmx,nlayermx,nq) 78 REAL zqm(nq),zqco2m 77 79 real m_co2, m_noco2, A , B 78 80 save A, B … … 101 103 if (tracer) then 102 104 ! Prepare Special treatment if one of the tracers is CO2 gas 103 do iq=1,nq mx105 do iq=1,nq 104 106 if (noms(iq).eq."co2") then 105 107 ico2=iq -
trunk/LMDZ.MARS/libf/phymars/dustdevil.F
r224 r1036 1 1 SUBROUTINE dustdevil(ngrid,nlay,nq, pplev,pu,pv,pt, ptsurf,pq2, 2 2 & pdqdev,pdqs_dev) 3 4 use tracer_mod, only: alpha_devil 3 5 IMPLICIT NONE 4 6 … … 32 34 #include "surfdat.h" 33 35 #include "comgeomfi.h" 34 #include "tracer.h"36 !#include "tracer.h" 35 37 c arguments: 36 38 c ---------- -
trunk/LMDZ.MARS/libf/phymars/dustlift.F
r310 r1036 2 2 $ pcdh_true,pcdh,co2ice, 3 3 $ dqslift) 4 5 use tracer_mod, only: alpha_lift, radius 4 6 IMPLICIT NONE 5 7 … … 19 21 #include "dimphys.h" 20 22 #include "comcstfi.h" 21 #include "tracer.h"23 !#include "tracer.h" 22 24 23 25 c -
trunk/LMDZ.MARS/libf/phymars/growthrate.F
r633 r1036 1 1 subroutine growthrate(temp,pmid,psat,rcrystal,res) 2 2 3 use tracer_mod, only: rho_ice 3 4 IMPLICIT NONE 4 5 … … 21 22 #include "dimphys.h" 22 23 #include "comcstfi.h" 23 #include "tracer.h"24 !#include "tracer.h" 24 25 #include "microphys.h" 25 26 -
trunk/LMDZ.MARS/libf/phymars/improvedclouds.F
r1020 r1036 6 6 USE ioipsl_getincom 7 7 USE updaterad 8 use tracer_mod, only: rho_ice, nuice_sed, igcm_h2o_vap, 9 & igcm_h2o_ice, igcm_dust_mass, 10 & igcm_dust_number, igcm_ccn_mass, 11 & igcm_ccn_number 8 12 implicit none 9 13 … … 33 37 #include "comcstfi.h" 34 38 #include "callkeys.h" 35 #include "tracer.h"39 !#include "tracer.h" 36 40 #include "comgeomfi.h" 37 41 #include "dimradmars.h" … … 73 77 INTEGER ig,l,i 74 78 75 REAL zq(ngridmx,nlayermx,nq mx) ! local value of tracers76 REAL zq0(ngridmx,nlayermx,nq mx) ! local initial value of tracers79 REAL zq(ngridmx,nlayermx,nq) ! local value of tracers 80 REAL zq0(ngridmx,nlayermx,nq) ! local initial value of tracers 77 81 REAL zt(ngridmx,nlayermx) ! local value of temperature 78 82 REAL zqsat(ngridmx,nlayermx) ! saturation -
trunk/LMDZ.MARS/libf/phymars/inifis.F
r1028 r1036 1 1 SUBROUTINE inifis( 2 $ ngrid,nlayer 2 $ ngrid,nlayer,nq 3 3 $ ,day_ini,pdaysec,ptimestep 4 4 $ ,plat,plon,parea … … 46 46 ! ------------- 47 47 ! to use 'getin' 48 USE ioipsl_getincom 48 USE ioipsl_getincom, only : getin 49 use tracer_mod, only : nqmx, nuice_sed, ccn_factor 50 49 51 IMPLICIT NONE 50 52 #include "dimensions.h" … … 62 64 #include "slope.h" 63 65 #include "microphys.h" 64 #include "tracer.h"66 !#include "tracer.h" 65 67 #ifdef MESOSCALE 66 68 #include "comsoil.h" !!MESOSCALE -- needed to fill volcapa 67 69 #include "meso_inc/meso_inc_inifisvar.F" 68 70 #endif 69 REAL prad,pg,pr,pcpp,pdaysec70 71 REAL ptimestep72 INTEGER day_ini73 74 INTEGER ngrid,nlayer75 REAL plat(ngrid),plon(ngrid),parea(ngridmx)71 REAL,INTENT(IN) :: prad,pg,pr,pcpp,pdaysec 72 73 REAL,INTENT(IN) :: ptimestep 74 INTEGER,INTENT(IN) :: day_ini 75 76 INTEGER,INTENT(IN) :: ngrid,nlayer,nq 77 REAL,INTENT(IN) :: plat(ngrid),plon(ngrid),parea(ngrid) 76 78 INTEGER ig,ierr 77 79 … … 95 97 daysec=pdaysec 96 98 dtphys=ptimestep 99 100 nqmx=nq 101 97 102 #ifdef MESOSCALE 98 103 #include "meso_inc/meso_inc_inifisini.F" … … 375 380 stop 376 381 endif 377 if (doubleq.and.submicron.and.(nq mx.LT.3)) then382 if (doubleq.and.submicron.and.(nq.LT.3)) then 378 383 print*,'If doubleq is used with a submicron tracer,' 379 384 print*,' then the number of tracers has to be' … … 804 809 ! print*,' 1 water vapour tracer' 805 810 ! print*,' 1 water ice tracer' 806 ! print*,nq mx-4,' chemistry tracers'811 ! print*,nq-4,' chemistry tracers' 807 812 ! endif 808 813 ! … … 812 817 ! print*,' 1 water vapour tracer' 813 818 ! print*,' 1 water ice tracer' 814 ! if (nq mx.LT.4) then815 ! print*,'nq mxshould be at least equal to'819 ! if (nq.LT.4) then 820 ! print*,'nq should be at least equal to' 816 821 ! print*,'4 with these options.' 817 822 ! stop … … 824 829 ! print*,dustbin,' dust bins' 825 830 ! endif 826 ! print*,nq mx-2-dustbin,' chemistry tracers'831 ! print*,nq-2-dustbin,' chemistry tracers' 827 832 ! print*,' 1 water vapour tracer' 828 833 ! print*,' 1 water ice tracer' … … 836 841 ! print*,' 1 water vapour tracer' 837 842 ! print*,' 1 water ice tracer' 838 ! if (nq mx.gt.(dustbin+2)) then839 ! print*,'nq mxshould be ',(dustbin+2),843 ! if (nq.gt.(dustbin+2)) then 844 ! print*,'nq should be ',(dustbin+2), 840 845 ! $ ' with these options...' 841 846 ! print*,'(or check callphys.def)' 842 847 ! endif 843 ! if (nq mx.lt.(dustbin+2)) then844 ! write(*,*) "inifis: nq mx.lt.(dustbin+2)"848 ! if (nq.lt.(dustbin+2)) then 849 ! write(*,*) "inifis: nq.lt.(dustbin+2)" 845 850 ! stop 846 851 ! endif -
trunk/LMDZ.MARS/libf/phymars/initracer.F
r1005 r1036 1 SUBROUTINE initracer(qsurf,co2ice) 2 1 SUBROUTINE initracer(ngrid,nq,qsurf,co2ice) 2 3 use infotrac, only: tnom 4 use tracer_mod 3 5 IMPLICIT NONE 4 6 c======================================================================= … … 11 13 c 12 14 c Test of dimension : 13 c Initialize COMMON tracer in tracer.h, using tracer names provided14 c by the dynamics in " advtrac.h"15 c Initialize tracer related data in tracer_mod, using tracer names provided 16 c by the dynamics in "infotrac" 15 17 c 16 18 c … … 26 28 #include "comcstfi.h" 27 29 #include "callkeys.h" 28 #include "tracer.h"29 #include "advtrac.h"30 !#include "tracer.h" 31 !#include "advtrac.h" 30 32 #include "comgeomfi.h" 31 33 32 34 #include "surfdat.h" 33 35 34 real qsurf(ngridmx,nqmx) ! tracer on surface (e.g. kg.m-2) 35 real co2ice(ngridmx) ! co2 ice mass on surface (e.g. kg.m-2) 36 integer,intent(in) :: ngrid ! number of atmospheric columns 37 integer,intent(in) :: nq ! number of tracers 38 real,intent(out) :: qsurf(ngrid,nq) ! tracer on surface (e.g. kg.m-2) 39 real,intent(out) :: co2ice(ngrid) ! co2 ice mass on surface (e.g. kg.m-2) 40 36 41 integer iq,ig,count 37 42 real r0_lift , reff_lift, nueff_lift … … 43 48 44 49 c----------------------------------------------------------------------- 45 c radius(nq mx) ! aerosol particle radius (m)46 c rho_q(nq mx) ! tracer densities (kg.m-3)47 c alpha_lift(nq mx) ! saltation vertical flux/horiz flux ratio (m-1)48 c alpha_devil(nq mx) ! lifting coeeficient by dust devil50 c radius(nq) ! aerosol particle radius (m) 51 c rho_q(nq) ! tracer densities (kg.m-3) 52 c alpha_lift(nq) ! saltation vertical flux/horiz flux ratio (m-1) 53 c alpha_devil(nq) ! lifting coeeficient by dust devil 49 54 c rho_dust ! Mars dust density 50 55 c rho_ice ! Water ice density … … 55 60 c----------------------------------------------------------------------- 56 61 62 ! Initialization: allocate arrays in tracer_mod 63 allocate(noms(nq)) 64 allocate(mmol(nq)) 65 allocate(radius(nq)) 66 allocate(rho_q(nq)) 67 allocate(alpha_lift(nq)) 68 allocate(alpha_devil(nq)) 69 allocate(dryness(ngridmx)) 70 allocate(igcm_dustbin(nq)) 71 57 72 ! Initialization: get tracer names from the dynamics and check if we are 58 73 ! using 'old' tracer convention ('q01',q02',...) … … 60 75 ! check if tracers have 'old' names 61 76 count=0 62 do iq=1,nq mx77 do iq=1,nq 63 78 txt=" " 64 79 write(txt,'(a1,i2.2)') 'q',iq … … 66 81 count=count+1 67 82 endif 68 enddo ! of do iq=1,nq mx83 enddo ! of do iq=1,nq 69 84 70 if (count.eq.nq mx) then85 if (count.eq.nq) then 71 86 write(*,*) "initracer: tracers seem to follow old naming ", 72 87 & "convention (q01,q02,...)" … … 76 91 77 92 ! copy tracer names from dynamics 78 do iq=1,nq mx93 do iq=1,nq 79 94 noms(iq)=tnom(iq) 80 95 enddo … … 86 101 ! Identify tracers by their names: (and set corresponding values of mmol) 87 102 ! 0. initialize tracer indexes to zero: 88 do iq=1,nqmx 89 igcm_dustbin(iq)=0 90 enddo 103 igcm_dustbin(1:nq)=0 104 91 105 igcm_dust_mass=0 92 106 igcm_dust_number=0 … … 130 144 count=0 131 145 if (dustbin.gt.0) then 132 do iq=1,nq mx146 do iq=1,nq 133 147 txt=" " 134 148 write(txt,'(a4,i2.2)')'dust',count+1 … … 138 152 mmol(iq)=100. 139 153 endif 140 enddo !do iq=1,nq mx154 enddo !do iq=1,nq 141 155 endif ! of if (dustbin.gt.0) 142 156 if (doubleq) then 143 do iq=1,nq mx157 do iq=1,nq 144 158 if (noms(iq).eq."dust_mass") then 145 159 igcm_dust_mass=iq … … 153 167 endif ! of if (doubleq) 154 168 if (microphys) then 155 do iq=1,nq mx169 do iq=1,nq 156 170 if (noms(iq).eq."ccn_mass") then 157 171 igcm_ccn_mass=iq … … 165 179 endif ! of if (microphys) 166 180 if (submicron) then 167 do iq=1,nq mx181 do iq=1,nq 168 182 if (noms(iq).eq."dust_submicron") then 169 183 igcm_dust_submicron=iq … … 174 188 endif ! of if (submicron) 175 189 ! 2. find chemistry and water tracers 176 do iq=1,nq mx190 do iq=1,nq 177 191 if (noms(iq).eq."co2") then 178 192 igcm_co2=iq … … 337 351 endif 338 352 339 enddo ! of do iq=1,nq mx353 enddo ! of do iq=1,nq 340 354 341 355 ! check that we identified all tracers: 342 if (count.ne.nq mx) then356 if (count.ne.nq) then 343 357 write(*,*) "initracer: found only ",count," tracers" 344 write(*,*) " expected ",nq mx358 write(*,*) " expected ",nq 345 359 do iq=1,count 346 360 write(*,*)' ',iq,' ',trim(noms(iq)) … … 349 363 else 350 364 write(*,*) "initracer: found all expected tracers, namely:" 351 do iq=1,nq mx365 do iq=1,nq 352 366 write(*,*)' ',iq,' ',trim(noms(iq)) 353 367 enddo … … 365 379 ! as qsurf(i_h2o_vap) & as qsurf(i_h2o_ice), so to be clean: 366 380 if (igcm_h2o_vap.ne.0) then 367 qsurf(1:ngrid mx,igcm_h2o_vap)=0381 qsurf(1:ngrid,igcm_h2o_vap)=0 368 382 endif 369 383 endif 370 384 371 385 c------------------------------------------------------------ 372 c Initialize tracers .... (in tracer .h)386 c Initialize tracers .... (in tracer_mod) 373 387 c------------------------------------------------------------ 374 388 ! start by setting everything to (default) zero 375 rho_q(1:nq mx)=0 ! tracer density (kg.m-3)376 radius(1:nq mx)=0. ! tracer particle radius (m)377 alpha_lift(1:nq mx) =0. ! tracer saltation vertical flux/horiz flux ratio (m-1)378 alpha_devil(1:nq mx)=0. ! tracer lifting coefficient by dust devils389 rho_q(1:nq)=0 ! tracer density (kg.m-3) 390 radius(1:nq)=0. ! tracer particle radius (m) 391 alpha_lift(1:nq) =0. ! tracer saltation vertical flux/horiz flux ratio (m-1) 392 alpha_devil(1:nq)=0. ! tracer lifting coefficient by dust devils 379 393 380 394 … … 393 407 c iq=1: Q mass mixing ratio, iq=2: N number mixing ratio 394 408 395 if( (nq mx.lt.2).or.(water.and.(nqmx.lt.4)) ) then396 write(*,*)'initracer: nq mx is too low : nqmx=', nqmx409 if( (nq.lt.2).or.(water.and.(nq.lt.4)) ) then 410 write(*,*)'initracer: nq is too low : nq=', nq 397 411 write(*,*)'water= ',water,' doubleq= ',doubleq 398 412 end if … … 499 513 alpha_lift(igcm_h2o_vap) =0. 500 514 alpha_devil(igcm_h2o_vap)=0. 501 if(water.and.(nq mx.ge.2)) then515 if(water.and.(nq.ge.2)) then 502 516 radius(igcm_h2o_ice)=3.e-6 503 517 rho_q(igcm_h2o_ice)=rho_ice 504 518 alpha_lift(igcm_h2o_ice) =0. 505 519 alpha_devil(igcm_h2o_ice)=0. 506 elseif(water.and.(nq mx.lt.2)) then507 write(*,*) 'nq mx is too low : nqmx=', nqmx520 elseif(water.and.(nq.lt.2)) then 521 write(*,*) 'nq is too low : nq=', nq 508 522 write(*,*) 'water= ',water 509 523 endif -
trunk/LMDZ.MARS/libf/phymars/newcondens.F
r890 r1036 6 6 $ fluxsurf_sw,zls) 7 7 8 use tracer_mod, only: noms 8 9 IMPLICIT NONE 9 10 c======================================================================= … … 61 62 #include "paramet.h" 62 63 #include "callkeys.h" 63 #include "tracer.h"64 !#include "tracer.h" 64 65 65 66 c----------------------------------------------------------------------- … … 195 196 if (tracer) then 196 197 c Prepare Special treatment if one of the tracer is CO2 gas 197 do iq=1,nq mx198 do iq=1,nq 198 199 if (noms(iq).eq."co2") then 199 200 ico2=iq … … 238 239 END DO 239 240 240 DO iq=1,nq mx241 DO iq=1,nq 241 242 DO l=1,nlayer 242 243 DO ig=1,ngrid … … 531 532 zu(l) =pu(ig,l) +pdu( ig,l) *ptimestep 532 533 zv(l) =pv(ig,l) +pdv( ig,l) *ptimestep 533 do iq=1,nq mx534 do iq=1,nq 534 535 zq(l,iq)=pq(ig,l,iq)+pdq(ig,l,iq)*ptimestep 535 536 enddo … … 564 565 zum(1) = 0 565 566 zvm(1) = 0 566 do iq=1,nq mx567 do iq=1,nq 567 568 zqm(1,iq)=0. ! most tracer do not condense ! 568 569 enddo … … 577 578 call vl1d(zu ,2.,masse,w,zum) 578 579 call vl1d(zv ,2.,masse,w,zvm) 579 do iq=1,nq mx580 do iq=1,nq 580 581 do l=1,nlayer 581 582 zq1(l)=zq(l,iq) … … 602 603 zum(nlayer+1)= zu(nlayer) ! should not be used, but... 603 604 zvm(nlayer+1)= zv(nlayer) ! should not be used, but... 604 do iq=1,nq mx605 do iq=1,nq 605 606 zqm(nlayer+1,iq)= zq(nlayer,iq) 606 607 enddo … … 637 638 638 639 c Tendencies on Q 639 do iq=1,nq mx640 do iq=1,nq 640 641 ! if (noms(iq).eq.'co2') then 641 642 if (iq.eq.ico2) then … … 668 669 if(pq(ig,1,ico2)+(pdq(ig,1,ico2)+pdqc(ig,1,ico2))*ptimestep 669 670 & .lt.qco2min) then 670 do iq=1,nq mx671 do iq=1,nq 671 672 zq(1,iq)=pq(ig,1,iq) 672 673 & +(pdq(ig,1,iq)+pdqc(ig,1,iq))*ptimestep … … 675 676 Sm(1) = masse(1) 676 677 do l =2,nlayermx 677 do iq=1,nq mx678 do iq=1,nq 678 679 zq(l,iq)=pq(ig,l,iq) 679 680 & +(pdq(ig,l,iq)+pdqc(ig,l,iq))*ptimestep … … 693 694 end do 694 695 99 continue 695 do iq=1,nq mx696 do iq=1,nq 696 697 qmix=zq(nmix,iq) 697 698 & +(Smq(nmix-1,iq)-zq(nmix,iq)*Sm(nmix-1))/mixmas -
trunk/LMDZ.MARS/libf/phymars/nirco2abs.F
r690 r1036 2 2 $ mu0,fract,declin,pdtnirco2) 3 3 4 use tracer_mod, only: igcm_co2, igcm_o 4 5 IMPLICIT NONE 5 6 c======================================================================= … … 50 51 #include "comdiurn.h" 51 52 #include "nirdata.h" 52 #include "tracer.h"53 !#include "tracer.h" 53 54 54 55 c----------------------------------------------------------------------- -
trunk/LMDZ.MARS/libf/phymars/nltecool.F
r472 r1036 30 30 c*************************************************************************** 31 31 32 use tracer_mod, only: igcm_co2, igcm_co, igcm_o, igcm_n2, mmol 32 33 implicit none 33 34 … … 37 38 #include "chimiedata.h" 38 39 #include "conc.h" !Added to have "dynamic composition" in the scheme 39 #include "tracer.h" !"40 !#include "tracer.h" !" 40 41 #include "callkeys.h" 41 42 -
trunk/LMDZ.MARS/libf/phymars/nuclea.F
r706 r1036 17 17 #include "dimphys.h" 18 18 #include "comcstfi.h" 19 #include "tracer.h"19 !#include "tracer.h" 20 20 #include "microphys.h" 21 21 -
trunk/LMDZ.MARS/libf/phymars/phyetat0.F
r999 r1036 4 4 5 5 use netcdf 6 use infotrac, only: nqtot, tnom 6 7 7 8 implicit none … … 25 26 #include "comcstfi.h" 26 27 !#include "tracer.h" 27 #include "advtrac.h"28 !#include "advtrac.h" 28 29 #include "control.h" 29 30 c====================================================================== … … 96 97 ! qsurf02, ...) 97 98 count=0 98 do iq=1,nq mx99 do iq=1,nqtot 99 100 txt= " " 100 101 write(txt,'(a5,i2.2)')'qsurf',iq … … 108 109 endif 109 110 enddo 110 if (count.eq.nq mx) then111 if (count.eq.nqtot) then 111 112 write(*,*) "phyetat0:tracers seem to follow old naming ", 112 113 & "convention (qsurf01,qsurf02,...)" … … 650 651 c case when new tracer are added in addition to old ones 651 652 write(*,*)'qsurf 1 to ', nqold,'were already present' 652 write(*,*)'qsurf ', nqold+1,' to ', nq mx,'are new'653 write(*,*)'qsurf ', nqold+1,' to ', nqtot,'are new' 653 654 ! yes=' ' 654 655 ! do while ((yes.ne.'y').and.(yes.ne.'n')) 655 656 ! write(*,*) 'Would you like to reindex qsurf # 1 ->',nqold 656 ! write(*,*) 'to #',nq mx-nqold+1,'->', nqmx,' (y or n) ?'657 ! write(*,*) 'to #',nqtot-nqold+1,'->', nqtot,' (y or n) ?' 657 658 ! read(*,fmt='(a)') yes 658 659 ! end do … … 660 661 ! write(*,*) 'OK, let s reindex qsurf' 661 662 ! do ig=1,ngridmx 662 ! do iq=nq mx,nqmx-nqold+1,-1663 ! qsurf(ig,iq)=qsurf(ig,iq-nq mx+nqold)663 ! do iq=nqtot,nqtot-nqold+1,-1 664 ! qsurf(ig,iq)=qsurf(ig,iq-nqtot+nqold) 664 665 ! end do 665 ! do iq=nq mx-nqold,1,-1666 ! do iq=nqtot-nqold,1,-1 666 667 ! qsurf(ig,iq)= 0. 667 668 ! end do -
trunk/LMDZ.MARS/libf/phymars/physdem.F
r999 r1036 3 3 . alb,ith,pzmea,pzstd,pzsig,pzgam,pzthe) 4 4 5 use infotrac, only: nqtot, tnom 5 6 implicit none 6 7 c … … 32 33 #include "netcdf.inc" 33 34 #include "dimphys.h" 34 #include "advtrac.h"35 !#include "advtrac.h" 35 36 #include "callkeys.h" 36 37 c … … 585 586 ! qsurf02, ...) 586 587 count=0 587 do iq=1,nq mx588 do iq=1,nqtot 588 589 txt= " " 589 590 write(txt,'(a1,i2.2)')'q',iq … … 596 597 endif 597 598 enddo 598 if (count.eq.nq mx) then599 if (count.eq.nqtot) then 599 600 write(*,*) "physdem0:tracers seem to follow old naming ", 600 601 & "convention (qsurf01,qsurf02,...)" … … 602 603 write(*,*) " but you should run newstart to rename them" 603 604 oldtracernames=.true. 604 endif ! of if (count.eq.nq mx)605 endif ! of if (count.eq.nqtot) 605 606 606 607 IF(nq.GE.1) THEN … … 693 694 . phystep,time, 694 695 . tsurf,tsoil,co2ice,emis,q2,qsurf) 696 use infotrac, only: nqtot, tnom 695 697 implicit none 696 698 c … … 720 722 #include "netcdf.inc" 721 723 #include "dimphys.h" 722 #include "advtrac.h"724 !#include "advtrac.h" 723 725 #include "callkeys.h" 724 726 c … … 918 920 IF (firstcall) THEN 919 921 count=0 920 do iq=1,nq mx922 do iq=1,nqtot 921 923 txt= " " 922 924 write(txt,'(a1,i2.2)')'q',iq … … 929 931 endif 930 932 enddo 931 if (count.eq.nq mx) then933 if (count.eq.nqtot) then 932 934 write(*,*) "physdem1:tracers seem to follow old naming ", 933 935 & "convention (qsurf01,qsurf02,...)" … … 935 937 write(*,*) " but you should run newstart to rename them" 936 938 oldtracernames=.true. 937 endif ! of if (count.eq.nq mx)939 endif ! of if (count.eq.nqtot) 938 940 ENDIF ! of if(firstcall) 939 941 940 942 ! If computing water cycle with ice, move surface ice 941 ! back to qsurf(nq mx)943 ! back to qsurf(nqtot) 942 944 IF (oldtracernames .and. water) THEN 943 945 !"loop" to avoid potential out-of-bounds on arrays 944 write(*,*)'physdem1: moving surface water ice to index ',nq mx945 do iq=nq mx,nqmx946 write(*,*)'physdem1: moving surface water ice to index ',nqtot 947 do iq=nqtot,nqtot 946 948 qsurf(1:ngridmx,iq)=qsurf(1:ngridmx,iq-1) 947 949 qsurf(1:ngridmx,iq-1)=0 -
trunk/LMDZ.MARS/libf/phymars/physiq.F
r1032 r1036 12 12 $ ) 13 13 14 14 use tracer_mod, only: noms, mmol, igcm_co2, igcm_n2, 15 & igcm_co, igcm_o, igcm_h2o_vap, igcm_h2o_ice, 16 & igcm_ccn_mass, igcm_ccn_number, 17 & igcm_dust_mass, igcm_dust_number, igcm_h2o2, 18 & nuice_ref, rho_ice, rho_dust, ref_r0 19 20 #ifdef MESOSCALE 21 use infotrac !!! this is necessary for tracers 22 #endif 15 23 IMPLICIT NONE 16 24 c======================================================================= … … 103 111 c pdv(ngrid,nlayermx) | Temporal derivative of the corresponding 104 112 c pdt(ngrid,nlayermx) | variables due to physical processes. 105 c pdq(ngrid,nlayermx,nq mx)|113 c pdq(ngrid,nlayermx,nq) | 106 114 c pdpsrf(ngrid) | 107 115 c tracerdyn call tracer in dynamical part of GCM ? … … 126 134 #include "dimradmars.h" 127 135 #include "comg1d.h" 128 #include "tracer.h"136 !#include "tracer.h" 129 137 #include "nlteparams.h" 130 138 #include "comvert.h" … … 142 150 #include "wrf_output_2d.h" 143 151 #include "wrf_output_3d.h" 144 #include "advtrac.h" !!! this is necessary for tracers (in dyn3d)152 !#include "advtrac.h" !!! this is necessary for tracers (in dyn3d) 145 153 #include "meso_inc/meso_inc_var.F" 146 154 #endif … … 192 200 REAL capcal(ngridmx) ! surface heat capacity (J m-2 K-1) 193 201 REAL fluxgrd(ngridmx) ! surface conduction flux (W.m-2) 194 REAL qsurf(ngridmx,nqmx)! tracer on surface (e.g. kg.m-2)202 REAL,ALLOCATABLE,SAVE :: qsurf(:,:) ! tracer on surface (e.g. kg.m-2) 195 203 REAL q2(ngridmx,nlayermx+1) ! Turbulent Kinetic Energy 196 204 … … 217 225 SAVE aerosol, tsurf,tsoil 218 226 SAVE co2ice,albedo,emis, q2 219 SAVE capcal,fluxgrd,dtrad,fluxrad,fluxrad_sky ,qsurf227 SAVE capcal,fluxgrd,dtrad,fluxrad,fluxrad_sky 220 228 221 229 REAL stephan … … 229 237 EXTERNAL CBRT 230 238 231 CHARACTER*80 fichier232 INTEGER l,ig,ierr,igout,iq, i,tapphys239 ! CHARACTER*80 fichier 240 INTEGER l,ig,ierr,igout,iq,tapphys 233 241 234 242 REAL fluxsurf_lw(ngridmx) !incident LW (IR) surface flux (W.m-2) … … 243 251 REAL zzlay(ngridmx,nlayermx) ! altitude at the middle of the layers 244 252 REAL zzlev(ngridmx,nlayermx+1) ! altitude at layer boundaries 245 REAL latvl1,lonvl1 ! Viking Lander 1 point (for diagnostic)253 ! REAL latvl1,lonvl1 ! Viking Lander 1 point (for diagnostic) 246 254 247 255 c Tendancies due to various processes: 248 REAL dqsurf(ngridmx,nq mx)256 REAL dqsurf(ngridmx,nq) 249 257 REAL zdtlw(ngridmx,nlayermx) ! (K/s) 250 258 REAL zdtsw(ngridmx,nlayermx) ! (K/s) 251 REAL cldtlw(ngridmx,nlayermx) ! (K/s) LW heating rate for clear area252 REAL cldtsw(ngridmx,nlayermx) ! (K/s) SW heating rate for clear area259 ! REAL cldtlw(ngridmx,nlayermx) ! (K/s) LW heating rate for clear area 260 ! REAL cldtsw(ngridmx,nlayermx) ! (K/s) SW heating rate for clear area 253 261 REAL zdtnirco2(ngridmx,nlayermx) ! (K/s) 254 262 REAL zdtnlte(ngridmx,nlayermx) ! (K/s) … … 264 272 REAL zdvc(ngridmx,nlayermx),zduc(ngridmx,nlayermx) 265 273 266 REAL zdqdif(ngridmx,nlayermx,nq mx), zdqsdif(ngridmx,nqmx)267 REAL zdqsed(ngridmx,nlayermx,nq mx), zdqssed(ngridmx,nqmx)268 REAL zdqdev(ngridmx,nlayermx,nq mx), zdqsdev(ngridmx,nqmx)269 REAL zdqadj(ngridmx,nlayermx,nq mx)270 REAL zdqc(ngridmx,nlayermx,nq mx)271 REAL zdqcloud(ngridmx,nlayermx,nq mx)272 REAL zdqscloud(ngridmx,nq mx)273 REAL zdqchim(ngridmx,nlayermx,nq mx)274 REAL zdqschim(ngridmx,nq mx)274 REAL zdqdif(ngridmx,nlayermx,nq), zdqsdif(ngridmx,nq) 275 REAL zdqsed(ngridmx,nlayermx,nq), zdqssed(ngridmx,nq) 276 REAL zdqdev(ngridmx,nlayermx,nq), zdqsdev(ngridmx,nq) 277 REAL zdqadj(ngridmx,nlayermx,nq) 278 REAL zdqc(ngridmx,nlayermx,nq) 279 REAL zdqcloud(ngridmx,nlayermx,nq) 280 REAL zdqscloud(ngridmx,nq) 281 REAL zdqchim(ngridmx,nlayermx,nq) 282 REAL zdqschim(ngridmx,nq) 275 283 276 284 REAL zdteuv(ngridmx,nlayermx) ! (K/s) … … 278 286 REAL zdumolvis(ngridmx,nlayermx) 279 287 REAL zdvmolvis(ngridmx,nlayermx) 280 real zdqmoldiff(ngridmx,nlayermx,nq mx)288 real zdqmoldiff(ngridmx,nlayermx,nq) 281 289 282 290 c Local variable for local intermediate calcul: … … 295 303 REAL ps(ngridmx), zt(ngridmx,nlayermx) 296 304 REAL zu(ngridmx,nlayermx),zv(ngridmx,nlayermx) 297 REAL zq(ngridmx,nlayermx,nq mx)305 REAL zq(ngridmx,nlayermx,nq) 298 306 REAL fluxtop_sw_tot(ngridmx), fluxsurf_sw_tot(ngridmx) 299 307 character*2 str2 300 character*5 str5308 ! character*5 str5 301 309 real zdtdif(ngridmx,nlayermx), zdtadj(ngridmx,nlayermx) 302 310 REAL tauscaling(ngridmx) ! Convertion factor for qdust and Ndust … … 310 318 ! instead, use zplay and zplev : 311 319 REAL zplev(ngrid,nlayermx+1),zplay(ngrid,nlayermx) 312 REAL zstress(ngrid),cd313 real hco2(nqmx),tmean, zlocal(nlayermx)320 ! REAL zstress(ngrid),cd 321 real tmean, zlocal(nlayermx) 314 322 real rho(ngridmx,nlayermx) ! density 315 323 real vmr(ngridmx,nlayermx) ! volume mixing ratio 316 324 real rhopart(ngridmx,nlayermx) ! number density of a given species 317 real colden(ngridmx,nq mx)! vertical column of tracers325 real colden(ngridmx,nq) ! vertical column of tracers 318 326 REAL mtot(ngridmx) ! Total mass of water vapor (kg/m2) 319 327 REAL icetot(ngridmx) ! Total mass of water ice (kg/m2) … … 357 365 REAL, SAVE :: hfmax_th(ngridmx) 358 366 REAL pdu_th(ngridmx,nlayermx),pdv_th(ngridmx,nlayermx) 359 REAL pdt_th(ngridmx,nlayermx),pdq_th(ngridmx,nlayermx,nq mx)367 REAL pdt_th(ngridmx,nlayermx),pdq_th(ngridmx,nlayermx,nq) 360 368 INTEGER lmax_th(ngridmx),dimout,n_out,n 361 369 CHARACTER(50) zstring … … 364 372 REAL, ALLOCATABLE, DIMENSION(:,:) :: T_out 365 373 REAL, ALLOCATABLE, DIMENSION(:,:) :: u_out ! Interpolated teta and u at z_out 366 REAL u_out1(ngridmx), T_out1(ngridmx) 374 ! REAL u_out1(ngridmx) 375 REAL T_out1(ngridmx) 367 376 REAL, ALLOCATABLE, DIMENSION(:) :: z_out ! height of interpolation between z0 and z1 [meters] 368 377 REAL ustar(ngridmx),tstar(ngridmx) ! friction velocity and friction potential temp 369 378 REAL L_mo(ngridmx),vhf(ngridmx),vvv(ngridmx) 370 REAL zu2(ngridmx),sensibFlux(ngridmx) 379 ! REAL zu2(ngridmx) 380 REAL sensibFlux(ngridmx) 371 381 372 382 c======================================================================= … … 379 389 IF (firstcall) THEN 380 390 391 ! allocate local (saved) arrays: 392 allocate(qsurf(ngrid,nq)) 393 381 394 c variables set to 0 382 395 c ~~~~~~~~~~~~~~~~~~ … … 417 430 tracerdyn=tracer 418 431 IF (tracer) THEN 419 CALL initracer( qsurf,co2ice)432 CALL initracer(ngrid,nq,qsurf,co2ice) 420 433 ENDIF ! end tracer 421 434 … … 570 583 571 584 if(photochem.or.callthermos) then 572 call concentrations( zplay,pt,pdt,pq,pdq,ptimestep)585 call concentrations(nq,zplay,pt,pdt,pq,pdq,ptimestep) 573 586 endif 574 587 #endif … … 1214 1227 $ surfdust, surfice) 1215 1228 ! call photochemistry 1216 call calchim(ptimestep,zplay,zplev,pt,pdt,dist_sol,mu0, 1229 call calchim(nq, 1230 & ptimestep,zplay,zplev,pt,pdt,dist_sol,mu0, 1217 1231 $ zzlev,zzlay,zday,pq,pdq,zdqchim,zdqschim, 1218 1232 $ zdqcloud,zdqscloud,tauref,co2ice, -
trunk/LMDZ.MARS/libf/phymars/simpleclouds.F
r740 r1036 4 4 & nq,tau,rice) 5 5 USE updaterad 6 use tracer_mod, only: igcm_h2o_vap, igcm_h2o_ice 6 7 implicit none 7 8 c------------------------------------------------------------------ … … 32 33 #include "comcstfi.h" 33 34 #include "callkeys.h" 34 #include "tracer.h"35 !#include "tracer.h" 35 36 #include "comgeomfi.h" 36 37 #include "dimradmars.h" … … 73 74 INTEGER ig,l 74 75 75 REAL zq(ngridmx,nlayermx,nq mx)! local value of tracers76 REAL zq0(ngridmx,nlayermx,nq mx)! local initial value of tracers76 REAL zq(ngridmx,nlayermx,nq) ! local value of tracers 77 REAL zq0(ngridmx,nlayermx,nq) ! local initial value of tracers 77 78 REAL zt(ngridmx,nlayermx) ! local value of temperature 78 79 REAL zqsat(ngridmx,nlayermx) ! saturation … … 91 92 c ----------------- 92 93 93 c On "update" la valeur de q(nq mx) (water vapor) et temperature.94 c On "update" la valeur de q(nq) (water vapor) et temperature. 94 95 c On effectue qqes calculs preliminaires sur les couches : 95 96 -
trunk/LMDZ.MARS/libf/phymars/soil_tifeedback.F
r857 r1036 1 1 SUBROUTINE soil_tifeedback(ngrid,nsoil,icecover,newtherm_i) 2 3 use tracer_mod, only: nqmx, igcm_h2o_ice, rho_ice 2 4 IMPLICIT NONE 3 5 … … 24 26 #include "dimphys.h" 25 27 #include "comsoil.h" 26 #include "tracer.h"28 !#include "tracer.h" 27 29 #include "surfdat.h" 28 30 … … 41 43 42 44 REAL icecover(ngrid,nqmx) ! tracer on the surface (kg.m-2) 43 ! last one (iq=nqmx) is surface45 ! (iq=igcm_h2o_ice) is surface 44 46 ! water ice 45 47 c Outputs -
trunk/LMDZ.MARS/libf/phymars/surfini.F
r740 r1036 3 3 USE ioipsl_getincom 4 4 use netcdf 5 use tracer_mod, only: nqmx, noms, dryness 5 6 IMPLICIT NONE 6 7 c======================================================================= … … 16 17 #include "surfdat.h" 17 18 #include "callkeys.h" 18 #include "tracer.h"19 !#include "tracer.h" 19 20 #include "comgeomfi.h" 20 21 #include "comcstfi.h" -
trunk/LMDZ.MARS/libf/phymars/testphys1d.F
r999 r1036 2 2 PROGRAM testphys1d 3 3 ! to use 'getin' 4 USE ioipsl_getincom 4 USE ioipsl_getincom, only: getin 5 use infotrac, only: nqtot, tnom 5 6 IMPLICIT NONE 6 7 … … 42 43 #include "comg1d.h" 43 44 #include "logic.h" 44 #include "advtrac.h"45 !#include "advtrac.h" 45 46 46 47 c -------------------------------------------------------------- … … 64 65 REAL gru,grv ! prescribed "geostrophic" background wind 65 66 REAL temp(nlayermx) ! temperature at the middle of the layers 66 REAL q(nlayermx,nqmx) ! tracer mixing ratio (e.g. kg/kg)67 REAL qsurf(nqmx)! tracer surface budget (e.g. kg.m-2)67 REAL,ALLOCATABLE :: q(:,:) ! tracer mixing ratio (e.g. kg/kg) 68 REAL,ALLOCATABLE :: qsurf(:) ! tracer surface budget (e.g. kg.m-2) 68 69 REAL tsoil(nsoilmx) ! subsurface soik temperature (K) 69 70 REAL co2ice ! co2ice layer (kg.m-2) … … 76 77 REAL dudyn(nlayermx),dvdyn(nlayermx),dtempdyn(nlayermx) 77 78 REAL dpsurf 78 REAL dq(nlayermx,nqmx)79 REAL dqdyn(nlayermx,nqmx)79 REAL,ALLOCATABLE :: dq(:,:) 80 REAL,ALLOCATABLE :: dqdyn(:,:) 80 81 81 82 c Various intermediate variables … … 84 85 REAL phi(nlayermx),h(nlayermx),s(nlayermx) 85 86 REAL pks, ptif, w(nlayermx) 86 REAL qtotinit, mqtot(nqmx),qtot 87 REAL qtotinit,qtot 88 real,allocatable :: mqtot(:) 87 89 INTEGER ierr, aslun 88 90 REAL tmp1(0:nlayermx),tmp2(0:nlayermx) … … 169 171 170 172 ! while we're at it, check if there is a 'traceur.def' file 171 ! and pr eocess it, if necessary. Otherwise initialize tracer names173 ! and process it. 172 174 if (tracer) then 173 175 ! load tracer names from file 'traceur.def' … … 183 185 ! read number of tracers: 184 186 read(90,*,iostat=ierr) nq 187 nqtot=nq ! set value of nqtot (in infotrac module) as nq 185 188 if (ierr.ne.0) then 186 189 write(*,*) "testphys1d: error reading number of tracers" 187 190 write(*,*) " (first line of traceur.def) " 188 191 stop 189 else190 ! check that the number of tracers is indeed nqmx191 if (nq.ne.nqmx) then192 write(*,*) "testphys1d: error, wrong number of tracers:"193 write(*,*) "nq=",nq," whereas nqmx=",nqmx194 stop195 endif196 192 endif 197 193 endif 194 ! allocate arrays: 195 allocate(tnom(nq)) 196 allocate(q(nlayermx,nq)) 197 allocate(qsurf(nq)) 198 allocate(dq(nlayermx,nq)) 199 allocate(dqdyn(nlayermx,nq)) 200 allocate(mqtot(nq)) 201 198 202 ! read tracer names from file traceur.def 199 do iq=1,nq mx203 do iq=1,nq 200 204 read(90,*,iostat=ierr) tnom(iq) 201 205 if (ierr.ne.0) then … … 212 216 ! "smarter" initialization of some tracers 213 217 ! (get values from "profile_*" files, if these are available) 214 do iq=1,nq mx218 do iq=1,nq 215 219 txt="" 216 220 write(txt,"(a)") tnom(iq) … … 346 350 close(91) 347 351 endif ! of if (txt.eq."ccn_number") 348 enddo ! of do iq=1,nq mx352 enddo ! of do iq=1,nq 349 353 350 354 else 351 ! we still need to set (dummy) tracer names for physdem1 352 nq=nqmx 355 ! we still need to set (dummy) tracer number and names for physdem1 356 nq=1 357 ! allocate arrays: 358 allocate(tnom(nq)) 359 allocate(q(nlayermx,nq)) 360 allocate(qsurf(nq)) 361 allocate(dq(nlayermx,nq)) 362 allocate(dqdyn(nlayermx,nq)) 363 allocate(mqtot(nq)) 353 364 do iq=1,nq 354 365 write(str7,'(a1,i2.2)')'q',iq … … 496 507 497 508 !Mars possible matter with dtphys in input and include!!! 498 CALL inifis(1,llm, day0,daysec,dtphys,509 CALL inifis(1,llm,nq,day0,daysec,dtphys, 499 510 . lati,long,area,rad,g,r,cpp) 500 511 … … 612 623 ! thermo=0: initialize over all atmospheric layers 613 624 thermo=0 614 call inichim_newstart(q,psurf,sig,nq mx,lati,long,area,625 call inichim_newstart(q,psurf,sig,nq,lati,long,area, 615 626 $ thermo,qsurf) 616 627 endif … … 641 652 c It is needed to transfert physics variables to "physiq"... 642 653 643 call physdem0("startfi.nc",long,lati,nsoilmx,nq mx,654 call physdem0("startfi.nc",long,lati,nsoilmx,nq, 644 655 . dtphys,float(day0),time,area, 645 656 . albedodat,inertiedat,zmea,zstd,zsig,zgam,zthe) 646 call physdem1("startfi.nc",nsoilmx,nq mx,657 call physdem1("startfi.nc",nsoilmx,nq, 647 658 . dtphys,time, 648 659 . tsurf,tsoil,co2ice,emis,q2,qsurf) … … 688 699 c -------------------- 689 700 ! write(*,*) "testphys1d avant q", q(1,:) 690 CALL physiq (1,llm,nq mx,701 CALL physiq (1,llm,nq, 691 702 , firstcall,lastcall, 692 703 , day,time,dtphys, … … 749 760 750 761 ! increment tracers 751 DO iq = 1, nq mx762 DO iq = 1, nq 752 763 DO ilayer=1,nlayer 753 764 q(ilayer,iq)=q(ilayer,iq)+dtphys*dq(ilayer,iq) -
trunk/LMDZ.MARS/libf/phymars/updaterad.F90
r882 r1036 62 62 ! Update ice radius if microphys == true 63 63 subroutine updaterice_micro(qice,qccn,nccn,coeff,rice,rhocloud) 64 implicit none 65 66 #include "dimensions.h" 67 #include "dimphys.h" 68 #include "comcstfi.h" 69 #include "tracer.h" 64 use tracer_mod, only: rho_dust, rho_ice 65 implicit none 66 67 #include "dimensions.h" 68 #include "dimphys.h" 69 #include "comcstfi.h" 70 !#include "tracer.h" 70 71 71 72 real, intent(in) :: qice,qccn,nccn … … 118 119 ! Update ice radius from a typical profile if microphys == false 119 120 subroutine updaterice_typ(qice,tau,pzlay,rice) 120 implicit none 121 122 #include "dimensions.h" 123 #include "dimphys.h" 124 #include "comcstfi.h" 125 #include "tracer.h" 121 use tracer_mod, only: rho_ice 122 implicit none 123 124 #include "dimensions.h" 125 #include "dimphys.h" 126 #include "comcstfi.h" 127 !#include "tracer.h" 126 128 127 129 real, intent(in) :: qice … … 175 177 ! To be used with doubleq == true. otherwise, rdust is constant !!! 176 178 subroutine updaterdust(qdust,ndust,rdust,tauscaling) 177 implicit none 178 179 #include "dimensions.h" 180 #include "dimphys.h" 181 #include "comcstfi.h" 182 #include "tracer.h" 179 use tracer_mod, only: r3n_q 180 implicit none 181 182 #include "dimensions.h" 183 #include "dimphys.h" 184 #include "comcstfi.h" 185 !#include "tracer.h" 183 186 184 187 real, intent(in) :: qdust,ndust ! needed if doubleq … … 230 233 ! geometric mean radius = mass mean radius x exp(-1.5 sigma0^2) 231 234 subroutine updaterccn(qccn,nccn,rccn,tauscaling) 232 implicit none 233 234 #include "dimensions.h" 235 #include "dimphys.h" 236 #include "comcstfi.h" 237 #include "tracer.h" 235 use tracer_mod, only: rho_dust 236 implicit none 237 238 #include "dimensions.h" 239 #include "dimphys.h" 240 #include "comcstfi.h" 241 !#include "tracer.h" 238 242 239 243 real, intent(in) :: qccn,nccn ! needed if doubleq -
trunk/LMDZ.MARS/libf/phymars/updatereffrad.F
r744 r1036 4 4 & pq,tauscaling,tau,pplay) 5 5 USE updaterad 6 use tracer_mod, only: nqmx, igcm_dust_mass, igcm_dust_number, 7 & igcm_h2o_ice, igcm_ccn_mass, radius, 8 & igcm_ccn_number, nuice_ref, varian, 9 & ref_r0, igcm_dust_submicron 6 10 IMPLICIT NONE 7 11 c======================================================================= … … 31 35 #include "callkeys.h" 32 36 #include "dimradmars.h" 33 #include "tracer.h"37 !#include "tracer.h" 34 38 #include "aerkind.h" 35 39 #include "yomaer.h" -
trunk/LMDZ.MARS/libf/phymars/vdif_kc.F
r325 r1036 1 1 SUBROUTINE vdif_kc(dt,g,zlev,zlay,u,v,teta,cd,q2,km,kn,zq) 2 3 use tracer_mod, only: nqmx, noms 2 4 IMPLICIT NONE 3 5 c....................................................................... 4 6 #include "dimensions.h" 5 7 #include "dimphys.h" 6 #include "tracer.h"8 !#include "tracer.h" 7 9 #include "callkeys.h" 8 10 c....................................................................... -
trunk/LMDZ.MARS/libf/phymars/vdifc.F
r1035 r1036 11 11 #endif 12 12 & ) 13 use tracer_mod, only: noms, igcm_dust_mass, igcm_dust_number, 14 & igcm_dust_submicron, igcm_h2o_vap, 15 & igcm_h2o_ice, dryness, alpha_lift, nqmx 13 16 IMPLICIT NONE 14 17 … … 39 42 #include "surfdat.h" 40 43 #include "comgeomfi.h" 41 #include "tracer.h"44 !#include "tracer.h" 42 45 #include "microphys.h" 43 46 … … 46 49 c ---------- 47 50 48 INTEGER ngrid,nlay 49 REAL ptimestep 50 REAL pplay(ngrid,nlay),pplev(ngrid,nlay+1) 51 REAL pzlay(ngrid,nlay),pzlev(ngrid,nlay+1) 52 REAL pu(ngrid,nlay),pv(ngrid,nlay),ph(ngrid,nlay),pt(ngrid,nlay) 53 REAL ptsrf(ngrid),pemis(ngrid) 54 REAL pdufi(ngrid,nlay),pdvfi(ngrid,nlay),pdhfi(ngrid,nlay) 55 REAL pfluxsrf(ngrid) 56 REAL pdudif(ngrid,nlay),pdvdif(ngrid,nlay),pdhdif(ngrid,nlay) 57 REAL pdtsrf(ngrid),pcapcal(ngrid) 51 INTEGER,INTENT(IN) :: ngrid,nlay 52 REAL,INTENT(IN) :: ptimestep 53 REAL,INTENT(IN) :: pplay(ngrid,nlay),pplev(ngrid,nlay+1) 54 REAL,INTENT(IN) :: pzlay(ngrid,nlay),pzlev(ngrid,nlay+1) 55 REAL,INTENT(IN) :: pu(ngrid,nlay),pv(ngrid,nlay) 56 REAL,INTENT(IN) :: ph(ngrid,nlay) 57 REAL :: pt(ngrid,nlay) 58 REAL,INTENT(IN) :: ptsrf(ngrid),pemis(ngrid) 59 REAL,INTENT(IN) :: pdufi(ngrid,nlay),pdvfi(ngrid,nlay) 60 REAL,INTENT(IN) :: pdhfi(ngrid,nlay) 61 REAL,INTENT(IN) :: pfluxsrf(ngrid) 62 REAL,INTENT(OUT) :: pdudif(ngrid,nlay),pdvdif(ngrid,nlay) 63 REAL,INTENT(OUT) :: pdtsrf(ngrid),pdhdif(ngrid,nlay) 64 REAL,INTENT(IN) ::pcapcal(ngrid) 58 65 REAL pq2(ngrid,nlay+1) 59 66 60 67 c Argument added for condensation: 61 REAL co2ice (ngrid), ppopsk(ngrid,nlay)62 logical lecrit63 64 REAL pz0(ngridmx) ! surface roughness length (m)68 REAL,INTENT(IN) :: co2ice (ngrid), ppopsk(ngrid,nlay) 69 logical,INTENT(IN) :: lecrit 70 71 REAL,INTENT(IN) :: pz0(ngrid) ! surface roughness length (m) 65 72 66 73 c Argument added to account for subgrid gustiness : 67 74 68 REAL wstar(ngrid mx), hfmax(ngridmx), zi(ngridmx)75 REAL wstar(ngrid), hfmax(ngrid)!, zi(ngrid) 69 76 70 77 c Traceurs : 71 integer nq72 REAL pqsurf(ngrid,nq)73 real pq(ngrid,nlay,nq), pdqfi(ngrid,nlay,nq)74 real pdqdif(ngrid,nlay,nq)75 real pdqsdif(ngrid,nq)78 integer,intent(in) :: nq 79 REAL,INTENT(IN) :: pqsurf(ngrid,nq) 80 real,intent(in) :: pq(ngrid,nlay,nq), pdqfi(ngrid,nlay,nq) 81 real,intent(out) :: pdqdif(ngrid,nlay,nq) 82 real,intent(out) :: pdqsdif(ngrid,nq) 76 83 77 84 c local: … … 99 106 EXTERNAL SSUM,SCOPY 100 107 REAL SSUM 101 LOGICAL firstcall 102 SAVE firstcall 108 LOGICAL,SAVE :: firstcall=.true. 103 109 104 110 … … 112 118 113 119 c For latent heat release from ground ice sublimation 114 REAL tsrf_lw(ngridmx)115 REAL alpha120 ! REAL tsrf_lw(ngridmx) 121 ! REAL alpha 116 122 REAL T1,T2 117 123 SAVE T1,T2 … … 125 131 REAL rho(ngridmx) ! near surface air density 126 132 REAL qsat(ngridmx) 127 DATA firstcall/.true./128 133 129 134 REAL kmixmin … … 179 184 if (tracer) then 180 185 c Prepare Special treatment if one of the tracer is CO2 gas 181 do iq=1,nq mx186 do iq=1,nq 182 187 if (noms(iq).eq."co2") then 183 188 ico2=iq … … 196 201 firstcall=.false. 197 202 ENDIF 198 199 200 201 203 202 204 … … 398 400 399 401 pt(:,:)=ph(:,:)*ppopsk(:,:) 400 CALL yamada4(ngrid,nlay, ptimestep,g,r,pplev,pt402 CALL yamada4(ngrid,nlay,nq,ptimestep,g,r,pplev,pt 401 403 s ,pzlev,pzlay,pu,pv,ph,pq,zcdv_true,pq2,zkv,zkh,zkq,ust 402 404 s ,9) 403 404 405 ENDIF 405 406 … … 900 901 901 902 RETURN 902 END 903 END SUBROUTINE vdifc -
trunk/LMDZ.MARS/libf/phymars/watercloud.F
r951 r1036 7 7 USE ioipsl_getincom 8 8 USE updaterad 9 use tracer_mod, only: nqmx, igcm_h2o_vap, igcm_h2o_ice, 10 & igcm_dust_mass, igcm_dust_number, 11 & igcm_ccn_mass, igcm_ccn_number, 12 & rho_dust, nuice_sed, nuice_ref 9 13 IMPLICIT NONE 10 14 … … 34 38 #include "comcstfi.h" 35 39 #include "callkeys.h" 36 #include "tracer.h"40 !#include "tracer.h" 37 41 #include "comgeomfi.h" 38 42 #include "dimradmars.h" -
trunk/LMDZ.MARS/libf/phymars/yamada4.F
r690 r1036 8 8 !************************************************************ 9 9 !************************************************************ 10 SUBROUTINE yamada4(ngrid,nlay, dt,g,rconst,plev,temp10 SUBROUTINE yamada4(ngrid,nlay,nq,dt,g,rconst,plev,temp 11 11 s ,zlev,zlay,u,v,phc,pq,cd,q2,km,kn,kq,ustar 12 12 s ,iflag_pbl) 13 use tracer_mod, only: noms 13 14 IMPLICIT NONE 14 15 !....................................................................... … … 16 17 #include "dimensions.h" 17 18 #include "dimphys.h" 18 #include "tracer.h"19 !#include "tracer.h" 19 20 #include "callkeys.h" 20 21 !....................................................................... … … 61 62 INTEGER, INTENT(IN) :: iflag_pbl,ngrid 62 63 INTEGER, INTENT(IN) :: nlay 64 INTEGER, INTENT(IN) :: nq 63 65 REAL, INTENT(INOUT) :: q2(ngrid,nlay+1) 64 66 REAL, INTENT(OUT) :: km(ngrid,nlay+1) … … 119 121 SAVE A, B 120 122 REAL teta(ngrid,nlay) 121 REAL pq(ngrid,nlay,nq mx)123 REAL pq(ngrid,nlay,nq) 122 124 REAL kminfact 123 125 INTEGER i … … 135 137 if (tracer) then 136 138 ! Prepare Special treatment if one of the tracers is CO2 gas 137 do iq=1,nq mx139 do iq=1,nq 138 140 if (noms(iq).eq."co2") then 139 141 ico2=iq … … 603 605 #include "dimensions.h" 604 606 #include "dimphys.h" 605 #include "tracer.h"607 !#include "tracer.h" 606 608 #include "callkeys.h" 607 609 !....................................................................... … … 684 686 #include "dimensions.h" 685 687 #include "dimphys.h" 686 #include "tracer.h"688 !#include "tracer.h" 687 689 #include "callkeys.h" 688 690 !....................................................................... -
trunk/LMDZ.MARS/makegcm_g95
r882 r1036 530 530 # Build the appropriate 'dimensions.h' file 531 531 cd dimension 532 ./makdim $ ntrac $dim532 ./makdim $dim 533 533 # echo contents of dimensions.h to standard output 534 534 cat $libf/grid/dimensions.h … … 556 556 echo dimension $dimension dim $dim 557 557 if ( $dimension == 1 ) then 558 echo pas de dynamique 559 set dyn="L_DYN= DYN= L_FILTRE= DIRMAIN=phy$physique " 558 echo "No dynamics" 559 ## set dyn="L_DYN= DYN= L_FILTRE= DIRMAIN=phy$physique " 560 ## NB: we still need to have L_DYN=libdyn3d to reach routines and module 561 ## objects which are located in dyn3d 562 set dyn="L_DYN=-ldyn3d DYN= L_FILTRE= DIRMAIN=phy$physique " 560 563 endif 561 564 endif -
trunk/LMDZ.MARS/makegcm_gfortran
r882 r1036 528 528 # Build the appropriate 'dimensions.h' file 529 529 cd dimension 530 ./makdim $ ntrac $dim530 ./makdim $dim 531 531 # echo contents of dimensions.h to standard output 532 532 cat $libf/grid/dimensions.h … … 554 554 echo dimension $dimension dim $dim 555 555 if ( $dimension == 1 ) then 556 echo pas de dynamique 557 set dyn="L_DYN= DYN= L_FILTRE= DIRMAIN=phy$physique " 556 echo "No dynamics" 557 ## set dyn="L_DYN= DYN= L_FILTRE= DIRMAIN=phy$physique " 558 ## NB: we still need to have L_DYN=libdyn3d to reach routines and module 559 ## objects which are located in dyn3d 560 set dyn="L_DYN=-ldyn3d DYN= L_FILTRE= DIRMAIN=phy$physique " 558 561 endif 559 562 endif -
trunk/LMDZ.MARS/makegcm_ifort
r1035 r1036 184 184 # Ehouarn 'ifort' compiler 185 185 #NB: on gnome -O3 ==> NaNs ... 186 set optim=" -O2 -fp-model precise -ip -mkl=sequential -align all "187 set optim90=" -O2 -fp-model precise -ip -mkl=sequential -align all "188 set optimtru90=" -O2 -fp-model precise -ip -mkl=sequential -align all "186 set optim="-auto -O2 -fp-model precise -ip -mkl=sequential -align all " 187 set optim90="-auto -O2 -fp-model precise -ip -mkl=sequential -align all " 188 set optimtru90="-auto -O2 -fp-model precise -ip -mkl=sequential -align all " 189 189 # set opt_link=" -Mfree -lpgf90 -lpgftnrtl -lpghpf -lpghpf2 -L$NCDFLIB -lnetcdf -Bstatic " 190 190 # set mod_loc_dir=$LIBOGCM … … 531 531 # Build the appropriate 'dimensions.h' file 532 532 cd dimension 533 ./makdim $ ntrac $dim533 ./makdim $dim 534 534 # echo contents of dimensions.h to standard output 535 535 cat $libf/grid/dimensions.h … … 557 557 echo dimension $dimension dim $dim 558 558 if ( $dimension == 1 ) then 559 echo pas de dynamique 560 set dyn="L_DYN= DYN= L_FILTRE= DIRMAIN=phy$physique " 559 echo "No dynamics" 560 ## set dyn="L_DYN= DYN= L_FILTRE= DIRMAIN=phy$physique " 561 ## NB: we still need to have L_DYN=libdyn3d to reach routines and module 562 ## objects which are located in dyn3d 563 set dyn="L_DYN=-ldyn3d DYN= L_FILTRE= DIRMAIN=phy$physique " 561 564 endif 562 565 endif -
trunk/LMDZ.MARS/makegcm_pgf
r882 r1036 532 532 # Build the appropriate 'dimensions.h' file 533 533 cd dimension 534 ./makdim $ ntrac $dim534 ./makdim $dim 535 535 # echo contents of dimensions.h to standard output 536 536 cat $libf/grid/dimensions.h … … 558 558 echo dimension $dimension dim $dim 559 559 if ( $dimension == 1 ) then 560 echo pas de dynamique 561 set dyn="L_DYN= DYN= L_FILTRE= DIRMAIN=phy$physique " 560 echo "No dynamics" 561 ## set dyn="L_DYN= DYN= L_FILTRE= DIRMAIN=phy$physique " 562 ## NB: we still need to have L_DYN=libdyn3d to reach routines and module 563 ## objects which are located in dyn3d 564 set dyn="L_DYN=-ldyn3d DYN= L_FILTRE= DIRMAIN=phy$physique " 562 565 endif 563 566 endif
Note: See TracChangeset
for help on using the changeset viewer.