Changeset 1308
- Timestamp:
- Jul 10, 2014, 3:19:01 PM (11 years ago)
- Location:
- trunk/LMDZ.GENERIC
- Files:
-
- 1 deleted
- 51 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.GENERIC/README
r1283 r1308 1032 1032 And some cosmetic cleanup in rain.F90, vdif_kc.F and turbdiff.F90 1033 1033 1034 == 10/07/2014 == EM 1035 Some cleanup to simplify dynamics/physics interactions by getting rid 1036 of dimphys.h (i.e. the nlayermx parameter) and minimizing use of 1037 dimension.h in the physics. 1038 -
trunk/LMDZ.GENERIC/libf/phystd/aeropacity.F90
r1132 r1308 30 30 ! pq Aerosol mixing ratio 31 31 ! reffrad(ngrid,nlayer,naerkind) Aerosol effective radius 32 ! QREFvis3d(ngrid,nlayer mx,naerkind) \ 3d extinction coefficients33 ! QREFir3d(ngrid,nlayer mx,naerkind) / at reference wavelengths32 ! QREFvis3d(ngrid,nlayer,naerkind) \ 3d extinction coefficients 33 ! QREFir3d(ngrid,nlayer,naerkind) / at reference wavelengths 34 34 ! 35 35 ! Output … … 40 40 !======================================================================= 41 41 42 #include "dimensions.h"43 #include "dimphys.h"42 !#include "dimensions.h" 43 !#include "dimphys.h" 44 44 #include "callkeys.h" 45 45 #include "comcstfi.h" 46 #include "comvert.h"46 !#include "comvert.h" 47 47 48 48 INTEGER,INTENT(IN) :: ngrid ! number of atmospheric columns … … 54 54 REAL,INTENT(OUT) :: aerosol(ngrid,nlayer,naerkind) ! aerosol optical depth 55 55 REAL,INTENT(IN) :: reffrad(ngrid,nlayer,naerkind) ! aerosol effective radius 56 REAL,INTENT(IN) :: QREFvis3d(ngrid,nlayer mx,naerkind) ! extinction coefficient in the visible57 REAL,INTENT(IN) :: QREFir3d(ngrid,nlayer mx,naerkind)56 REAL,INTENT(IN) :: QREFvis3d(ngrid,nlayer,naerkind) ! extinction coefficient in the visible 57 REAL,INTENT(IN) :: QREFir3d(ngrid,nlayer,naerkind) 58 58 REAL,INTENT(OUT):: tau_col(ngrid) !column integrated visible optical depth 59 59 ! BENJAMIN MODIFS 60 real,intent(in) :: cloudfrac(ngrid,nlayer mx) ! cloud fraction60 real,intent(in) :: cloudfrac(ngrid,nlayer) ! cloud fraction 61 61 real,intent(out) :: totcloudfrac(ngrid) ! total cloud fraction 62 62 logical,intent(in) :: clearsky … … 135 135 iaer=iaero_co2 136 136 ! 1. Initialization 137 aerosol(1:ngrid,1:nlayer mx,iaer)=0.0137 aerosol(1:ngrid,1:nlayer,iaer)=0.0 138 138 ! 2. Opacity calculation 139 139 if (noaero) then ! aerosol set to zero 140 aerosol(1:ngrid,1:nlayer mx,iaer)=0.0140 aerosol(1:ngrid,1:nlayer,iaer)=0.0 141 141 elseif (aerofixco2.or.(i_co2ice.eq.0)) then ! CO2 ice cloud prescribed 142 aerosol(1:ngrid,1:nlayer mx,iaer)=1.e-9142 aerosol(1:ngrid,1:nlayer,iaer)=1.e-9 143 143 !aerosol(1:ngrid,12,iaer)=4.0 ! single cloud layer option 144 144 else … … 172 172 iaer=iaero_h2o 173 173 ! 1. Initialization 174 aerosol(1:ngrid,1:nlayer mx,iaer)=0.0174 aerosol(1:ngrid,1:nlayer,iaer)=0.0 175 175 ! 2. Opacity calculation 176 176 if (aerofixh2o.or.(i_h2oice.eq.0).or.clearsky) then 177 aerosol(1:ngrid,1:nlayer mx,iaer) =1.e-9177 aerosol(1:ngrid,1:nlayer,iaer) =1.e-9 178 178 179 179 ! put cloud at cloudlvl … … 226 226 227 227 if(CLFvarying)then 228 call totalcloudfrac(ngrid,n q,cloudfrac,totcloudfrac,pplev,pq,aerosol(1:ngrid,1:nlayermx,iaer))228 call totalcloudfrac(ngrid,nlayer,nq,cloudfrac,totcloudfrac,pplev,pq,aerosol(1,1,iaer)) 229 229 do ig=1, ngrid 230 230 do l=1,nlayer-1 ! to stop the rad tran bug … … 253 253 iaer=iaero_dust 254 254 ! 1. Initialization 255 aerosol(1:ngrid,1:nlayer mx,iaer)=0.0255 aerosol(1:ngrid,1:nlayer,iaer)=0.0 256 256 257 257 topdust=30.0 ! km (used to be 10.0 km) LK … … 264 264 ! Typical mixing ratio profile 265 265 266 zp=(p reff/pplay(ig,l))**(70./topdust)266 zp=(pplev(ig,1)/pplay(ig,l))**(70./topdust) 267 267 expfactor=max(exp(0.007*(1.-max(zp,1.))),1.e-3) 268 268 … … 277 277 ! Rescaling each layer to reproduce the choosen (or assimilated) 278 278 ! dust extinction opacity at visible reference wavelength, which 279 ! is scaled to the "preff" reference surface pressure available in comvert.h 280 ! and stored in startfi.nc 279 ! is scaled to the surface pressure pplev(ig,1) 281 280 282 281 taudusttmp(1:ngrid)=0. … … 291 290 aerosol(ig,l,iaer) = max(1E-20, & 292 291 dusttau & 293 * pplev(ig,1) / p reff&292 * pplev(ig,1) / pplev(ig,1) & 294 293 * aerosol(ig,l,iaer) & 295 294 / taudusttmp(ig)) … … 307 306 308 307 ! 1. Initialization 309 aerosol(1:ngrid,1:nlayer mx,iaer)=0.0308 aerosol(1:ngrid,1:nlayer,iaer)=0.0 310 309 311 310 … … 317 316 ! Typical mixing ratio profile 318 317 319 zp=(p reff/pplay(ig,l))**(70./30) !emulating topdust318 zp=(pplev(ig,1)/pplay(ig,l))**(70./30) !emulating topdust 320 319 expfactor=max(exp(0.007*(1.-max(zp,1.))),1.e-3) 321 320 … … 335 334 aerosol(ig,l,iaer) = max(1E-20, & 336 335 1 & 337 * pplev(ig,1) / p reff&336 * pplev(ig,1) / pplev(ig,1) & 338 337 * aerosol(ig,l,iaer) & 339 338 / tauh2so4tmp(ig)) … … 367 366 iaer=iaero_back2lay 368 367 ! 1. Initialization 369 aerosol(1:ngrid,1:nlayer mx,iaer)=0.0368 aerosol(1:ngrid,1:nlayer,iaer)=0.0 370 369 ! 2. Opacity calculation 371 370 DO ig=1,ngrid -
trunk/LMDZ.GENERIC/libf/phystd/aeroptproperties.F90
r787 r1308 32 32 ! ============================================================== 33 33 34 #include "dimensions.h"35 #include "dimphys.h"34 !#include "dimensions.h" 35 !#include "dimphys.h" 36 36 #include "callkeys.h" 37 37 … … 60 60 INTEGER :: grid_i,grid_j 61 61 ! Intermediate variable 62 REAL :: var_tmp,var3d_tmp(ngrid,nlayer mx)62 REAL :: var_tmp,var3d_tmp(ngrid,nlayer) 63 63 ! Bilinear interpolation factors 64 64 REAL :: kx,ky,k1,k2,k3,k4 … … 161 161 INTEGER :: ngrid,nlayer 162 162 ! Aerosol effective radius used for radiative transfer (meter) 163 REAL :: reffrad(ngrid,nlayermx,naerkind)163 REAL,INTENT(IN) :: reffrad(ngrid,nlayer,naerkind) 164 164 ! Aerosol effective variance used for radiative transfer (n.u.) 165 REAL :: nueffrad(ngrid,nlayermx,naerkind)165 REAL,INTENT(IN) :: nueffrad(ngrid,nlayer,naerkind) 166 166 167 167 ! Outputs 168 168 ! ------- 169 169 170 REAL :: QVISsQREF3d(ngrid,nlayermx,L_NSPECTV,naerkind)171 REAL :: omegaVIS3d(ngrid,nlayermx,L_NSPECTV,naerkind)172 REAL :: gVIS3d(ngrid,nlayermx,L_NSPECTV,naerkind)173 174 REAL :: QIRsQREF3d(ngrid,nlayermx,L_NSPECTI,naerkind)175 REAL :: omegaIR3d(ngrid,nlayermx,L_NSPECTI,naerkind)176 REAL :: gIR3d(ngrid,nlayermx,L_NSPECTI,naerkind)177 178 REAL :: QREFvis3d(ngrid,nlayermx,naerkind)179 REAL :: QREFir3d(ngrid,nlayermx,naerkind)180 181 REAL :: omegaREFvis3d(ngrid,nlayer mx,naerkind)182 REAL :: omegaREFir3d(ngrid,nlayer mx,naerkind)170 REAL,INTENT(OUT) :: QVISsQREF3d(ngrid,nlayer,L_NSPECTV,naerkind) 171 REAL,INTENT(OUT) :: omegaVIS3d(ngrid,nlayer,L_NSPECTV,naerkind) 172 REAL,INTENT(OUT) :: gVIS3d(ngrid,nlayer,L_NSPECTV,naerkind) 173 174 REAL,INTENT(OUT) :: QIRsQREF3d(ngrid,nlayer,L_NSPECTI,naerkind) 175 REAL,INTENT(OUT) :: omegaIR3d(ngrid,nlayer,L_NSPECTI,naerkind) 176 REAL,INTENT(OUT) :: gIR3d(ngrid,nlayer,L_NSPECTI,naerkind) 177 178 REAL,INTENT(OUT) :: QREFvis3d(ngrid,nlayer,naerkind) 179 REAL,INTENT(OUT) :: QREFir3d(ngrid,nlayer,naerkind) 180 181 REAL :: omegaREFvis3d(ngrid,nlayer,naerkind) 182 REAL :: omegaREFir3d(ngrid,nlayer,naerkind) 183 183 184 184 DO iaer = 1, naerkind ! Loop on aerosol kind … … 724 724 k2*omegrefIRgrid(grid_i+1,1,iaer) 725 725 ENDIF ! -------------------------------- 726 ENDDO !nlayer mx726 ENDDO !nlayer 727 727 ENDDO !ngrid 728 728 -
trunk/LMDZ.GENERIC/libf/phystd/calc_cpp_mugaz.F90
r869 r1308 20 20 implicit none 21 21 22 #include "dimensions.h"23 #include "dimphys.h"22 !#include "dimensions.h" 23 !#include "dimphys.h" 24 24 #include "comcstfi.h" 25 25 #include "callkeys.h" -
trunk/LMDZ.GENERIC/libf/phystd/calcenergy_kcm.F90
r787 r1308 1 subroutine calcenergy_kcm( Tsurf,T,Play,Plev,Qsurf,Q,muvar,Eatmtot)1 subroutine calcenergy_kcm(nlayer,Tsurf,T,Play,Plev,Qsurf,Q,muvar,Eatmtot) 2 2 3 3 … … 11 11 ! ---------------------------------------------------------------- 12 12 13 #include "dimensions.h"14 #include "dimphys.h"13 !#include "dimensions.h" 14 !#include "dimphys.h" 15 15 #include "comcstfi.h" 16 16 !#include "callkeys.h" … … 19 19 20 20 ! inputs 21 real Tsurf,T(1:nlayermx) 22 real Play(1:nlayermx),Plev(1:nlayermx+1) 23 real Qsurf,Q(1:nlayermx) 24 real muvar(1,nlayermx+1) 21 integer,intent(in) :: nlayer 22 real Tsurf,T(1:nlayer) 23 real Play(1:nlayer),Plev(1:nlayer+1) 24 real Qsurf,Q(1:nlayer) 25 real muvar(1,nlayer+1) 25 26 26 27 ! internal … … 29 30 real s_c,rho_v,L 30 31 double precision p_v, s_v, nul 31 real VMR(1:nlayer mx)32 real VMR(1:nlayer) 32 33 33 34 ! output … … 41 42 42 43 43 do il=1,nlayer mx44 do il=1,nlayer 44 45 VMR(il)=Q(il)*(muvar(1,il+1)/mH2O) 45 46 end do … … 47 48 48 49 Eatmtot = 0.0 49 do il=1,nlayer mx50 do il=1,nlayer 50 51 51 52 -
trunk/LMDZ.GENERIC/libf/phystd/callcorrk.F90
r1194 r1308 35 35 !================================================================== 36 36 37 #include "dimphys.h"37 !#include "dimphys.h" 38 38 #include "comcstfi.h" 39 39 #include "callkeys.h" … … 42 42 ! Declaration of the arguments (INPUT - OUTPUT) on the LMD GCM grid 43 43 ! Layer #1 is the layer near the ground. 44 ! Layer #nlayer mxis the layer at the top.44 ! Layer #nlayer is the layer at the top. 45 45 46 46 INTEGER,INTENT(IN) :: ngrid ! number of atmospheric columns … … 52 52 REAL,INTENT(IN) :: emis(ngrid) ! LW emissivity 53 53 real,intent(in) :: mu0(ngrid) ! cosine of sun incident angle 54 REAL,INTENT(IN) :: pplev(ngrid,nlayer mx+1) ! inter-layer pressure (Pa)55 REAL,INTENT(IN) :: pplay(ngrid,nlayer mx) ! mid-layer pressure (Pa)56 REAL,INTENT(IN) :: pt(ngrid,nlayer mx) ! air temperature (K)54 REAL,INTENT(IN) :: pplev(ngrid,nlayer+1) ! inter-layer pressure (Pa) 55 REAL,INTENT(IN) :: pplay(ngrid,nlayer) ! mid-layer pressure (Pa) 56 REAL,INTENT(IN) :: pt(ngrid,nlayer) ! air temperature (K) 57 57 REAL,INTENT(IN) :: tsurf(ngrid) ! surface temperature (K) 58 58 REAL,INTENT(IN) :: fract(ngrid) ! fraction of day 59 59 REAL,INTENT(IN) :: dist_star ! distance star-planet (AU) 60 REAL,INTENT(OUT) :: aerosol(ngrid,nlayer mx,naerkind) ! aerosol tau (kg/kg)61 real,intent(in) :: muvar(ngrid,nlayer mx+1)62 REAL,INTENT(OUT) :: dtlw(ngrid,nlayer mx) ! heating rate (K/s) due to LW63 REAL,INTENT(OUT) :: dtsw(ngrid,nlayer mx) ! heating rate (K/s) due to SW60 REAL,INTENT(OUT) :: aerosol(ngrid,nlayer,naerkind) ! aerosol tau (kg/kg) 61 real,intent(in) :: muvar(ngrid,nlayer+1) 62 REAL,INTENT(OUT) :: dtlw(ngrid,nlayer) ! heating rate (K/s) due to LW 63 REAL,INTENT(OUT) :: dtsw(ngrid,nlayer) ! heating rate (K/s) due to SW 64 64 REAL,INTENT(OUT) :: fluxsurf_lw(ngrid) ! incident LW flux to surf (W/m2) 65 65 REAL,INTENT(OUT) :: fluxsurf_sw(ngrid) ! incident SW flux to surf (W/m2) … … 71 71 REAL,INTENT(OUT) :: tau_col(ngrid) ! diagnostic from aeropacity 72 72 ! for H2O cloud fraction in aeropacity 73 real,intent(in) :: cloudfrac(ngrid,nlayer mx)73 real,intent(in) :: cloudfrac(ngrid,nlayer) 74 74 real,intent(out) :: totcloudfrac(ngrid) 75 75 logical,intent(in) :: clearsky … … 79 79 ! Globally varying aerosol optical properties on GCM grid 80 80 ! Not needed everywhere so not in radcommon_h 81 REAL :: QVISsQREF3d(ngrid,nlayer mx,L_NSPECTV,naerkind)82 REAL :: omegaVIS3d(ngrid,nlayer mx,L_NSPECTV,naerkind)83 REAL :: gVIS3d(ngrid,nlayer mx,L_NSPECTV,naerkind)84 85 REAL :: QIRsQREF3d(ngrid,nlayer mx,L_NSPECTI,naerkind)86 REAL :: omegaIR3d(ngrid,nlayer mx,L_NSPECTI,naerkind)87 REAL :: gIR3d(ngrid,nlayer mx,L_NSPECTI,naerkind)88 89 ! REAL :: omegaREFvis3d(ngrid,nlayer mx,naerkind)90 ! REAL :: omegaREFir3d(ngrid,nlayer mx,naerkind) ! not sure of the point of these...81 REAL :: QVISsQREF3d(ngrid,nlayer,L_NSPECTV,naerkind) 82 REAL :: omegaVIS3d(ngrid,nlayer,L_NSPECTV,naerkind) 83 REAL :: gVIS3d(ngrid,nlayer,L_NSPECTV,naerkind) 84 85 REAL :: QIRsQREF3d(ngrid,nlayer,L_NSPECTI,naerkind) 86 REAL :: omegaIR3d(ngrid,nlayer,L_NSPECTI,naerkind) 87 REAL :: gIR3d(ngrid,nlayer,L_NSPECTI,naerkind) 88 89 ! REAL :: omegaREFvis3d(ngrid,nlayer,naerkind) 90 ! REAL :: omegaREFir3d(ngrid,nlayer,naerkind) ! not sure of the point of these... 91 91 92 92 REAL,ALLOCATABLE,SAVE :: reffrad(:,:,:) ! aerosol effective radius (m) … … 141 141 real*8,save :: GIAER(L_LEVELS+1,L_NSPECTI,naerkind) 142 142 143 !REAL :: QREFvis3d(ngrid,nlayer mx,naerkind)144 !REAL :: QREFir3d(ngrid,nlayer mx,naerkind)143 !REAL :: QREFvis3d(ngrid,nlayer,naerkind) 144 !REAL :: QREFir3d(ngrid,nlayer,naerkind) 145 145 !save QREFvis3d, QREFir3d 146 146 real, dimension(:,:,:), save, allocatable :: QREFvis3d … … 177 177 178 178 ! included by RW for runaway greenhouse 1D study 179 real vtmp(nlayer mx)179 real vtmp(nlayer) 180 180 REAL*8 muvarrad(L_LEVELS) 181 181 … … 195 195 !!! ALLOCATED instances are necessary because of CLFvarying 196 196 !!! strategy to call callcorrk twice in physiq... 197 IF(.not.ALLOCATED(QREFvis3d)) ALLOCATE(QREFvis3d(ngrid,nlayer mx,naerkind))198 IF(.not.ALLOCATED(QREFir3d)) ALLOCATE(QREFir3d(ngrid,nlayer mx,naerkind))197 IF(.not.ALLOCATED(QREFvis3d)) ALLOCATE(QREFvis3d(ngrid,nlayer,naerkind)) 198 IF(.not.ALLOCATED(QREFir3d)) ALLOCATE(QREFir3d(ngrid,nlayer,naerkind)) 199 199 ! Effective radius and variance of the aerosols 200 200 IF(.not.ALLOCATED(reffrad)) allocate(reffrad(ngrid,nlayer,naerkind)) … … 207 207 call abort 208 208 endif 209 call su_aer_radii(ngrid, reffrad,nueffrad)209 call su_aer_radii(ngrid,nlayer,reffrad,nueffrad) 210 210 211 211 … … 266 266 267 267 if ((iaer.eq.iaero_co2).and.tracer.and.(igcm_co2_ice.gt.0)) then ! treat condensed co2 particles. 268 call co2_reffrad(ngrid,n q,pq,reffrad(1,1,iaero_co2))269 print*,'Max. CO2 ice particle size = ',maxval(reffrad(1:ngrid,1:nlayer mx,iaer))/1.e-6,' um'270 print*,'Min. CO2 ice particle size = ',minval(reffrad(1:ngrid,1:nlayer mx,iaer))/1.e-6,' um'268 call co2_reffrad(ngrid,nlayer,nq,pq,reffrad(1,1,iaero_co2)) 269 print*,'Max. CO2 ice particle size = ',maxval(reffrad(1:ngrid,1:nlayer,iaer))/1.e-6,' um' 270 print*,'Min. CO2 ice particle size = ',minval(reffrad(1:ngrid,1:nlayer,iaer))/1.e-6,' um' 271 271 end if 272 272 if ((iaer.eq.iaero_h2o).and.water) then ! treat condensed water particles. to be generalized for other aerosols 273 call h2o_reffrad(ngrid, pq(1,1,igcm_h2o_ice),pt, &273 call h2o_reffrad(ngrid,nlayer,pq(1,1,igcm_h2o_ice),pt, & 274 274 reffrad(1,1,iaero_h2o),nueffrad(1,1,iaero_h2o)) 275 print*,'Max. H2O cloud particle size = ',maxval(reffrad(1:ngrid,1:nlayer mx,iaer))/1.e-6,' um'276 print*,'Min. H2O cloud particle size = ',minval(reffrad(1:ngrid,1:nlayer mx,iaer))/1.e-6,' um'275 print*,'Max. H2O cloud particle size = ',maxval(reffrad(1:ngrid,1:nlayer,iaer))/1.e-6,' um' 276 print*,'Min. H2O cloud particle size = ',minval(reffrad(1:ngrid,1:nlayer,iaer))/1.e-6,' um' 277 277 endif 278 278 if(iaer.eq.iaero_dust)then 279 call dust_reffrad(ngrid, reffrad(1,1,iaero_dust))279 call dust_reffrad(ngrid,nlayer,reffrad(1,1,iaero_dust)) 280 280 print*,'Dust particle size = ',reffrad(1,1,iaer)/1.e-6,' um' 281 281 endif 282 282 if(iaer.eq.iaero_h2so4)then 283 call h2so4_reffrad(ngrid, reffrad(1,1,iaero_h2so4))283 call h2so4_reffrad(ngrid,nlayer,reffrad(1,1,iaero_h2so4)) 284 284 print*,'H2SO4 particle size =',reffrad(1,1,iaer)/1.e-6,' um' 285 285 endif … … 318 318 do iaer=1,naerkind 319 319 DO nw=1,L_NSPECTV 320 do l=1,nlayer mx321 322 temp1=QVISsQREF3d(ig,nlayer mx+1-l,nw,iaer) &323 *QREFvis3d(ig,nlayer mx+1-l,iaer)324 325 temp2=QVISsQREF3d(ig,max(nlayer mx-l,1),nw,iaer) &326 *QREFvis3d(ig,max(nlayer mx-l,1),iaer)320 do l=1,nlayer 321 322 temp1=QVISsQREF3d(ig,nlayer+1-l,nw,iaer) & 323 *QREFvis3d(ig,nlayer+1-l,iaer) 324 325 temp2=QVISsQREF3d(ig,max(nlayer-l,1),nw,iaer) & 326 *QREFvis3d(ig,max(nlayer-l,1),iaer) 327 327 328 328 qxvaer(2*l,nw,iaer) = temp1 329 329 qxvaer(2*l+1,nw,iaer)=(temp1+temp2)/2 330 330 331 temp1=temp1*omegavis3d(ig,nlayer mx+1-l,nw,iaer)332 temp2=temp2*omegavis3d(ig,max(nlayer mx-l,1),nw,iaer)331 temp1=temp1*omegavis3d(ig,nlayer+1-l,nw,iaer) 332 temp2=temp2*omegavis3d(ig,max(nlayer-l,1),nw,iaer) 333 333 334 334 qsvaer(2*l,nw,iaer) = temp1 335 335 qsvaer(2*l+1,nw,iaer)=(temp1+temp2)/2 336 336 337 temp1=gvis3d(ig,nlayer mx+1-l,nw,iaer)338 temp2=gvis3d(ig,max(nlayer mx-l,1),nw,iaer)337 temp1=gvis3d(ig,nlayer+1-l,nw,iaer) 338 temp2=gvis3d(ig,max(nlayer-l,1),nw,iaer) 339 339 340 340 gvaer(2*l,nw,iaer) = temp1 … … 344 344 345 345 qxvaer(1,nw,iaer)=qxvaer(2,nw,iaer) 346 qxvaer(2*nlayer mx+1,nw,iaer)=0.346 qxvaer(2*nlayer+1,nw,iaer)=0. 347 347 348 348 qsvaer(1,nw,iaer)=qsvaer(2,nw,iaer) 349 qsvaer(2*nlayer mx+1,nw,iaer)=0.349 qsvaer(2*nlayer+1,nw,iaer)=0. 350 350 351 351 gvaer(1,nw,iaer)=gvaer(2,nw,iaer) 352 gvaer(2*nlayer mx+1,nw,iaer)=0.352 gvaer(2*nlayer+1,nw,iaer)=0. 353 353 354 354 end do … … 356 356 ! longwave 357 357 DO nw=1,L_NSPECTI 358 do l=1,nlayer mx359 360 temp1=QIRsQREF3d(ig,nlayer mx+1-l,nw,iaer) &361 *QREFir3d(ig,nlayer mx+1-l,iaer)362 363 temp2=QIRsQREF3d(ig,max(nlayer mx-l,1),nw,iaer) &364 *QREFir3d(ig,max(nlayer mx-l,1),iaer)358 do l=1,nlayer 359 360 temp1=QIRsQREF3d(ig,nlayer+1-l,nw,iaer) & 361 *QREFir3d(ig,nlayer+1-l,iaer) 362 363 temp2=QIRsQREF3d(ig,max(nlayer-l,1),nw,iaer) & 364 *QREFir3d(ig,max(nlayer-l,1),iaer) 365 365 366 366 qxiaer(2*l,nw,iaer) = temp1 367 367 qxiaer(2*l+1,nw,iaer)=(temp1+temp2)/2 368 368 369 temp1=temp1*omegair3d(ig,nlayer mx+1-l,nw,iaer)370 temp2=temp2*omegair3d(ig,max(nlayer mx-l,1),nw,iaer)369 temp1=temp1*omegair3d(ig,nlayer+1-l,nw,iaer) 370 temp2=temp2*omegair3d(ig,max(nlayer-l,1),nw,iaer) 371 371 372 372 qsiaer(2*l,nw,iaer) = temp1 373 373 qsiaer(2*l+1,nw,iaer)=(temp1+temp2)/2 374 374 375 temp1=gir3d(ig,nlayer mx+1-l,nw,iaer)376 temp2=gir3d(ig,max(nlayer mx-l,1),nw,iaer)375 temp1=gir3d(ig,nlayer+1-l,nw,iaer) 376 temp2=gir3d(ig,max(nlayer-l,1),nw,iaer) 377 377 378 378 giaer(2*l,nw,iaer) = temp1 … … 382 382 383 383 qxiaer(1,nw,iaer)=qxiaer(2,nw,iaer) 384 qxiaer(2*nlayer mx+1,nw,iaer)=0.384 qxiaer(2*nlayer+1,nw,iaer)=0. 385 385 386 386 qsiaer(1,nw,iaer)=qsiaer(2,nw,iaer) 387 qsiaer(2*nlayer mx+1,nw,iaer)=0.387 qsiaer(2*nlayer+1,nw,iaer)=0. 388 388 389 389 giaer(1,nw,iaer)=giaer(2,nw,iaer) 390 giaer(2*nlayer mx+1,nw,iaer)=0.390 giaer(2*nlayer+1,nw,iaer)=0. 391 391 392 392 end do … … 481 481 elseif(varfixed)then 482 482 483 do l=1,nlayer mx! here we will assign fixed water vapour profiles globally483 do l=1,nlayer ! here we will assign fixed water vapour profiles globally 484 484 RH = satval * ((pplay(ig,l)/pplev(ig,1) - 0.02) / 0.98) 485 485 if(RH.lt.0.0) RH=0.0 … … 507 507 ! call watersat(Ttemp,ptemp,qsat) 508 508 509 qvar(2*nlayer mx+1)= RH * qsat ! ~realistic profile (e.g. 80% saturation at ground)509 qvar(2*nlayer+1)= RH * qsat ! ~realistic profile (e.g. 80% saturation at ground) 510 510 511 511 else … … 541 541 542 542 muvarrad(1) = muvarrad(2) 543 muvarrad(2*nlayer mx+1)=muvar(ig,1)543 muvarrad(2*nlayer+1)=muvar(ig,1) 544 544 545 545 print*,'Recalculating qvar with VARIABLE epsi for kastprof' … … 579 579 580 580 muvarrad(1) = muvarrad(2) 581 muvarrad(2*nlayer mx+1)=muvar(ig,1)581 muvarrad(2*nlayer+1)=muvar(ig,1) 582 582 endif 583 583 … … 607 607 608 608 tlevrad(1) = tlevrad(2) 609 tlevrad(2*nlayer mx+1)=tsurf(ig)609 tlevrad(2*nlayer+1)=tsurf(ig) 610 610 611 611 tmid(1) = tlevrad(2) -
trunk/LMDZ.GENERIC/libf/phystd/callsedim.F
r1006 r1308 28 28 c ------------- 29 29 30 #include "dimensions.h"31 #include "dimphys.h"30 !#include "dimensions.h" 31 !#include "dimphys.h" 32 32 #include "comcstfi.h" 33 33 #include "callkeys.h" … … 65 65 real epaisseur (ngrid,nlay) ! Layer thickness (m) 66 66 real wq(ngrid,nlay+1) ! displaced tracer mass (kg.m-2) 67 c real dens(ngrid,nlay ermx) ! Mean density of the ice part. accounting for dust core67 c real dens(ngrid,nlay) ! Mean density of the ice part. accounting for dust core 68 68 69 69 … … 125 125 if (water.and.(iq.eq.igcm_h2o_ice)) then 126 126 ! compute radii for h2o_ice 127 call h2o_reffrad(ngrid, zqi(1,1,igcm_h2o_ice),zt,127 call h2o_reffrad(ngrid,nlay,zqi(1,1,igcm_h2o_ice),zt, 128 128 & reffrad(1,1,iaero_h2o),nueffrad(1,1,iaero_h2o)) 129 129 ! call sedimentation for h2o_ice -
trunk/LMDZ.GENERIC/libf/phystd/condense_cloud.F90
r1216 r1308 32 32 ! ptsrf(ngrid) Surface temperature 33 33 ! 34 ! pdt(ngrid,nlayer mx) Time derivative before condensation/sublimation of pt34 ! pdt(ngrid,nlayer) Time derivative before condensation/sublimation of pt 35 35 ! pdtsrf(ngrid) Time derivative before condensation/sublimation of ptsrf 36 36 ! pqsurf(ngrid,nq) Sedimentation flux at the surface (kg.m-2.s-1) … … 38 38 ! Outputs 39 39 ! ------- 40 ! pdpsrf(ngrid) 41 ! pdtc(ngrid,nlayer mx) / to the time derivatives of Ps, pt, and ptsrf42 ! pdtsrfc(ngrid) 40 ! pdpsrf(ngrid) \ Contribution of condensation/sublimation 41 ! pdtc(ngrid,nlayer) / to the time derivatives of Ps, pt, and ptsrf 42 ! pdtsrfc(ngrid) / 43 43 ! 44 44 ! Both … … 56 56 !================================================================== 57 57 58 #include "dimensions.h"59 #include "dimphys.h"58 !#include "dimensions.h" 59 !#include "dimphys.h" 60 60 #include "comcstfi.h" 61 #include "comvert.h"61 !#include "comvert.h" 62 62 #include "callkeys.h" 63 63 … … 99 99 100 100 REAL reffrad(ngrid,nlayer) ! radius (m) of the co2 ice particles 101 REAL*8 zt(ngrid,nlayer mx)102 REAL zq(ngrid,nlayer mx,nq)101 REAL*8 zt(ngrid,nlayer) 102 REAL zq(ngrid,nlayer,nq) 103 103 REAL zcpi 104 REAL ztcond (ngrid,nlayer mx)105 REAL ztnuc (ngrid,nlayer mx)104 REAL ztcond (ngrid,nlayer) 105 REAL ztnuc (ngrid,nlayer) 106 106 REAL ztcondsol(ngrid) 107 107 REAL zdiceco2(ngrid) 108 REAL zcondicea(ngrid,nlayer mx), zcondices(ngrid)108 REAL zcondicea(ngrid,nlayer), zcondices(ngrid) 109 109 REAL zfallice(ngrid), Mfallice(ngrid) 110 REAL zmflux(nlayer mx+1)111 REAL zu(nlayer mx),zv(nlayermx)110 REAL zmflux(nlayer+1) 111 REAL zu(nlayer),zv(nlayer) 112 112 REAL ztsrf(ngrid) 113 REAL ztc(nlayer mx), ztm(nlayermx+1)114 REAL zum(nlayer mx+1) , zvm(nlayermx+1)113 REAL ztc(nlayer), ztm(nlayer+1) 114 REAL zum(nlayer+1) , zvm(nlayer+1) 115 115 LOGICAL condsub(ngrid) 116 116 REAL subptimestep 117 117 Integer Ntime 118 real masse (ngrid,nlayer mx), w(ngrid,nlayermx,nq)119 real wq(ngrid,nlayer mx+1)118 real masse (ngrid,nlayer), w(ngrid,nlayer,nq) 119 real wq(ngrid,nlayer+1) 120 120 real vstokes,reff 121 121 122 122 ! Special diagnostic variables 123 real tconda1(ngrid,nlayer mx)124 real tconda2(ngrid,nlayer mx)125 real zdtsig (ngrid,nlayer mx)126 real zdt (ngrid,nlayer mx)123 real tconda1(ngrid,nlayer) 124 real tconda2(ngrid,nlayer) 125 real zdtsig (ngrid,nlayer) 126 real zdt (ngrid,nlayer) 127 127 128 128 !----------------------------------------------------------------------- … … 205 205 ! zcondices(ngrid) condensation rate on the ground (kg/m2/s) 206 206 ! zfallice(ngrid) flux of ice falling on surface (kg/m2/s) 207 ! pdtc(ngrid,nlayer mx) dT/dt due to phase changes (K/s)207 ! pdtc(ngrid,nlayer) dT/dt due to phase changes (K/s) 208 208 209 209 … … 301 301 302 302 ! sedimentation computed from radius computed from q in module radii_mod 303 call co2_reffrad(ngrid,n q,zq,reffrad)303 call co2_reffrad(ngrid,nlayer,nq,zq,reffrad) 304 304 305 305 do ilay=1,nlayer … … 321 321 ! Computing q after sedimentation 322 322 323 call vlz_fi(ngrid, zq(1,1,i_co2ice),2.,masse,w(1,1,i_co2ice),wq)323 call vlz_fi(ngrid,nlayer,zq(1,1,i_co2ice),2.,masse,w(1,1,i_co2ice),wq) 324 324 325 325 -
trunk/LMDZ.GENERIC/libf/phystd/convadj.F
r787 r1308 29 29 ! ------------ 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 "callkeys.h" … … 57 57 INTEGER jcnt, jadrs(ngrid) 58 58 59 REAL sig(nlay ermx+1),sdsig(nlayermx),dsig(nlayermx)60 REAL zu(ngrid,nlay ermx),zv(ngrid,nlayermx)61 REAL zh(ngrid,nlay ermx)62 REAL zu2(ngrid,nlay ermx),zv2(ngrid,nlayermx)63 REAL zh2(ngrid,nlay ermx), zhc(ngrid,nlayermx)59 REAL sig(nlay+1),sdsig(nlay),dsig(nlay) 60 REAL zu(ngrid,nlay),zv(ngrid,nlay) 61 REAL zh(ngrid,nlay) 62 REAL zu2(ngrid,nlay),zv2(ngrid,nlay) 63 REAL zh2(ngrid,nlay), zhc(ngrid,nlay) 64 64 REAL zhm,zsm,zdsm,zum,zvm,zalpha,zhmc 65 65 … … 67 67 INTEGER iq,ico2 68 68 save ico2 69 REAL zq(ngrid,nlay ermx,nq), zq2(ngrid,nlayermx,nq)69 REAL zq(ngrid,nlay,nq), zq2(ngrid,nlay,nq) 70 70 REAL zqm(nq),zqco2m 71 71 real m_co2, m_noco2, A , B -
trunk/LMDZ.GENERIC/libf/phystd/evap.F
r787 r1308 1 subroutine evap(ngrid,n q,dtime,pt, pq, pdq, pdt,1 subroutine evap(ngrid,nlayer,nq,dtime,pt, pq, pdq, pdt, 2 2 $ dqevap,dtevap, qevap, tevap) 3 3 … … 7 7 implicit none 8 8 9 #include "dimensions.h"10 #include "dimphys.h"9 !#include "dimensions.h" 10 !#include "dimphys.h" 11 11 #include "comcstfi.h" 12 12 … … 24 24 !================================================================== 25 25 26 INTEGER ngrid,n q26 INTEGER ngrid,nlayer,nq 27 27 28 28 ! Arguments: 29 REAL pt(ngrid,nlayer mx)30 REAL pq(ngrid,nlayer mx,nq)31 REAL pdt(ngrid,nlayer mx)32 REAL pdq(ngrid,nlayer mx,nq)33 REAL dqevap(ngrid,nlayer mx)34 REAL dtevap(ngrid,nlayer mx)35 REAL qevap(ngrid,nlayer mx,nq)29 REAL pt(ngrid,nlayer) 30 REAL pq(ngrid,nlayer,nq) 31 REAL pdt(ngrid,nlayer) 32 REAL pdq(ngrid,nlayer,nq) 33 REAL dqevap(ngrid,nlayer) 34 REAL dtevap(ngrid,nlayer) 35 REAL qevap(ngrid,nlayer,nq) 36 36 REAL dtime 37 37 38 38 ! Local: 39 REAL tevap(ngrid,nlayer mx)39 REAL tevap(ngrid,nlayer) 40 40 REAL zlvdcp 41 41 REAL zlsdcp … … 47 47 ! 48 48 49 DO l=1,nlayer mx49 DO l=1,nlayer 50 50 DO ig=1,ngrid 51 51 qevap(ig,l,igcm_h2o_vap)=pq(ig,l,igcm_h2o_vap) … … 57 57 ENDDO 58 58 59 DO l = 1, nlayer mx59 DO l = 1, nlayer 60 60 DO ig = 1, ngrid 61 61 zlvdcp=RLVTT/RCPD!/(1.0+RVTMP2*qevap(ig,l,igcm_h2o_vap)) … … 77 77 ENDDO 78 78 79 RETURN80 79 END -
trunk/LMDZ.GENERIC/libf/phystd/forceWCfn.F
r787 r1308 1 subroutine forceWCfn(ngrid,n q,pplev,pt,dq,dqs)1 subroutine forceWCfn(ngrid,nlayer,nq,pplev,pt,dq,dqs) 2 2 3 3 USE tracer_h … … 18 18 !================================================================== 19 19 20 #include "dimensions.h"21 #include "dimphys.h"20 !#include "dimensions.h" 21 !#include "dimphys.h" 22 22 #include "comcstfi.h" 23 23 24 INTEGER ngrid,n q24 INTEGER ngrid,nlayer,nq 25 25 26 26 real masse, Wtot, Wdiff 27 27 28 real pplev(ngrid,nlayer mx+1)28 real pplev(ngrid,nlayer+1) 29 29 real pt(ngrid) 30 30 31 31 real dqs(ngrid,nq) 32 real dq(ngrid,nlayer mx,nq)32 real dq(ngrid,nlayer,nq) 33 33 34 34 integer iq, ig, ilay … … 37 37 do ig=1,ngrid 38 38 Wtot = 0.0 39 do ilay=1,nlayer mx39 do ilay=1,nlayer 40 40 masse = (pplev(ig,ilay) - pplev(ig,ilay+1))/g 41 41 Wtot = Wtot + masse*dq(ig,ilay,iq) -
trunk/LMDZ.GENERIC/libf/phystd/hydrol.F90
r1297 r1308 39 39 !================================================================== 40 40 41 #include "dimensions.h"42 #include "dimphys.h"41 !#include "dimensions.h" 42 !#include "dimphys.h" 43 43 #include "comcstfi.h" 44 44 #include "callkeys.h" -
trunk/LMDZ.GENERIC/libf/phystd/ini_archive.F
r1216 r1308 40 40 41 41 #include "dimensions.h" 42 #include "dimphys.h"42 !#include "dimphys.h" 43 43 #include "paramet.h" 44 44 #include "comconst.h" -
trunk/LMDZ.GENERIC/libf/phystd/inifis.F
r1297 r1308 10 10 use comsoil_h, only: ini_comsoil_h 11 11 use control_mod, only: ecritphy 12 use planete_mod, only: nres 12 13 use planetwide_mod, only: planetwide_sumval 13 14 … … 51 52 USE ioipsl_getincom 52 53 IMPLICIT NONE 53 #include "dimensions.h"54 #include "dimphys.h"55 #include "planete.h"54 !#include "dimensions.h" 55 !#include "dimphys.h" 56 !#include "planete.h" 56 57 #include "comcstfi.h" 57 58 #include "callkeys.h" … … 88 89 avocado = 6.02214179e23 ! added by RW 89 90 90 ! --------------------------------------------------------91 ! The usual Tests92 ! --------------93 IF (nlayer.NE.nlayermx) THEN94 PRINT*,'STOP in inifis'95 PRINT*,'Probleme de dimensions :'96 PRINT*,'nlayer = ',nlayer97 PRINT*,'nlayermx = ',nlayermx98 STOP99 ENDIF100 91 101 92 ! read in 'ecritphy' (frequency of calls to physics, in dynamical steps) -
trunk/LMDZ.GENERIC/libf/phystd/iniorbit.F
r590 r1308 1 1 SUBROUTINE iniorbit 2 2 $ (papoastr,pperiastr,pyear_day,pperi_day,pobliq) 3 4 USE planete_mod, only: apoastr, periastr, year_day, obliquit, 5 & peri_day, e_elips, p_elips, timeperi 3 6 IMPLICIT NONE 4 7 … … 19 22 c ---------- 20 23 c - Doit etre appele avant d'utiliser orbite. 21 c - initialise une partie du common planete .h24 c - initialise une partie du common planete_mod 22 25 c 23 26 c Arguments: … … 35 38 c ------------- 36 39 37 #include "planete.h"40 !#include "planete.h" 38 41 #include "comcstfi.h" 39 42 -
trunk/LMDZ.GENERIC/libf/phystd/iniphysiq.F90
r1216 r1308 16 16 rlatd ! latitudes 17 17 use infotrac, only : nqtot ! number of advected tracers 18 use planete_mod, only: ini_planete_mod 18 19 19 20 implicit none 21 include "dimensions.h" 22 include "comvert.h" 20 23 21 24 real,intent(in) :: prad ! radius of the planet (m) … … 67 70 rlatd(1:klon_omp)=plat(offset+klon_omp_begin:offset+klon_omp_end) 68 71 72 ! copy over preff , ap() and bp() 73 call ini_planete_mod(nlayer,preff,ap,bp) 74 69 75 ! copy some fundamental parameters to physics 70 76 ! and do some initializations -
trunk/LMDZ.GENERIC/libf/phystd/initracer.F
r1297 r1308 24 24 25 25 #include "dimensions.h" 26 #include "dimphys.h"26 !#include "dimphys.h" 27 27 #include "comcstfi.h" 28 28 #include "callkeys.h" -
trunk/LMDZ.GENERIC/libf/phystd/iniwrite_specIR.F
r993 r1308 34 34 #include "netcdf.inc" 35 35 #include "serre.h" 36 #include"dimphys.h"36 !#include"dimphys.h" 37 37 38 38 c Arguments: -
trunk/LMDZ.GENERIC/libf/phystd/iniwrite_specVI.F
r993 r1308 34 34 #include "netcdf.inc" 35 35 #include "serre.h" 36 #include"dimphys.h"36 !#include"dimphys.h" 37 37 38 38 c Arguments: -
trunk/LMDZ.GENERIC/libf/phystd/kcm1d.F90
r1216 r1308 7 7 use ioipsl_getincom, only: getin 8 8 use comsaison_h, only: mu0, fract, dist_star 9 use planete_mod 9 10 ! use control_mod 10 11 … … 30 31 31 32 #include "dimensions.h" 32 #include "dimphys.h"33 !#include "dimphys.h" 33 34 #include "callkeys.h" 34 35 #include "comcstfi.h" 35 #include "planete.h"36 !#include "planete.h" 36 37 !#include "control.h" 37 38 … … 42 43 integer nlayer,nlevel,nq 43 44 integer ilay,ilev,iq,iw,iter 44 real play( nlayermx) ! Pressure at the middle of the layers [Pa]45 real zlay( nlayermx) ! Altitude at middle of the layers [km]46 real plev( nlayermx+1) ! Intermediate pressure levels [Pa]47 real temp( nlayermx) ! temperature at the middle of the layers [K]45 real play(llm) ! Pressure at the middle of the layers [Pa] 46 real zlay(llm) ! Altitude at middle of the layers [km] 47 real plev(llm+1) ! Intermediate pressure levels [Pa] 48 real temp(llm) ! temperature at the middle of the layers [K] 48 49 real,allocatable :: q(:,:) ! tracer mixing ratio [kg/kg] 49 50 real,allocatable :: vmr(:,:) ! tracer mixing ratio [mol/mol] … … 53 54 real emis, albedo 54 55 55 real muvar( nlayermx+1)56 57 real dtsw( nlayermx) ! heating rate (K/s) due to SW58 real dtlw( nlayermx) ! heating rate (K/s) due to LW56 real muvar(llm+1) 57 58 real dtsw(llm) ! heating rate (K/s) due to SW 59 real dtlw(llm) ! heating rate (K/s) due to LW 59 60 real fluxsurf_lw ! incident LW flux to surf (W/m2) 60 61 real fluxtop_lw ! outgoing LW flux to space (W/m2) … … 64 65 65 66 ! not used 66 real reffrad( nlayermx,naerkind)67 real nueffrad( nlayermx,naerkind)68 real cloudfrac( nlayermx)67 real reffrad(llm,naerkind) 68 real nueffrad(llm,naerkind) 69 real cloudfrac(llm) 69 70 real totcloudfrac 70 71 real tau_col 71 72 72 73 real dTstrat 73 real aerosol( nlayermx,naerkind) ! aerosol tau (kg/kg)74 real aerosol(llm,naerkind) ! aerosol tau (kg/kg) 74 75 real OLR_nu(1,L_NSPECTI) 75 76 real OSR_nu(1,L_NSPECTV) … … 93 94 94 95 95 nlayer= nlayermx96 nlayer=llm 96 97 nlevel=nlayer+1 97 98 … … 225 226 ! allocate arrays which depend on number of tracers 226 227 allocate(nametrac(nq)) 227 allocate(q(nlayer mx,nq))228 allocate(vmr(nlayer mx,nq))228 allocate(q(nlayer,nq)) 229 allocate(vmr(nlayer,nq)) 229 230 allocate(qsurf(nq)) 230 231 … … 268 269 269 270 ! Create vertical profiles 270 call kcmprof_fn( psurf,qsurf(1),tsurf, &271 call kcmprof_fn(nlayer,psurf,qsurf(1),tsurf, & 271 272 tstrat,play,plev,zlay,temp,q(:,1),muvar(1)) 272 273 … … 316 317 ! Calculate total atmospheric energy 317 318 Eatmtot=0.0 318 ! call calcenergy_kcm( tsurf,temp,play,plev,qsurf,&319 ! call calcenergy_kcm(nlayer,tsurf,temp,play,plev,qsurf,& 319 320 ! q(:,1),muvar,Eatmtot) 320 321 -
trunk/LMDZ.GENERIC/libf/phystd/kcmprof_fn.F90
r869 r1308 1 subroutine kcmprof_fn( psurf_rcm,qsurf_rcm,Tsurf_rcm,Tstra_rcm,P_rcm,Pl_rcm,z_rcm,T_rcm,q_rcm,m_rcm)1 subroutine kcmprof_fn(nlayer,psurf_rcm,qsurf_rcm,Tsurf_rcm,Tstra_rcm,P_rcm,Pl_rcm,z_rcm,T_rcm,q_rcm,m_rcm) 2 2 3 3 use params_h … … 12 12 ! ---------------------------------------------------------------- 13 13 14 #include "dimensions.h"15 #include "dimphys.h"14 !#include "dimensions.h" 15 !#include "dimphys.h" 16 16 #include "comcstfi.h" 17 17 #include "callkeys.h" … … 21 21 22 22 ! rcm inputs 23 integer nlayer 23 24 real Tsurf_rcm,Tstra_rcm 24 25 25 26 ! rcm outputs 26 27 real psurf_rcm,qsurf_rcm 27 real P_rcm(1:nlayer mx)28 real Pl_rcm(1:nlayer mx+1)29 real z_rcm(1:nlayer mx)30 real T_rcm(1:nlayer mx),q_rcm(1:nlayermx)31 real m_rcm(1:nlayer mx+1)28 real P_rcm(1:nlayer) 29 real Pl_rcm(1:nlayer+1) 30 real z_rcm(1:nlayer) 31 real T_rcm(1:nlayer),q_rcm(1:nlayer) 32 real m_rcm(1:nlayer+1) 32 33 33 34 ! rcm for interpolation (should really use log coords?) … … 161 162 162 163 ! define fine pressure grid 163 dlogp_rcm = -(log(psurf_rcm)-log(ptop))/nlayer mx164 dlogp_rcm = -(log(psurf_rcm)-log(ptop))/nlayer 164 165 165 166 P_rcm(1) = psurf_rcm*exp(dlogp_rcm) 166 do ilay_rcm=1,nlayer mx-1167 do ilay_rcm=1,nlayer-1 167 168 P_rcm(ilay_rcm+1) = P_rcm(ilay_rcm)*exp(dlogp_rcm) 168 169 enddo 169 170 170 171 Pl_rcm(1) = psurf_rcm 171 do ilev_rcm=2,nlayer mx172 do ilev_rcm=2,nlayer 172 173 ! log-linear interpolation 173 174 Pl_rcm(ilev_rcm) = exp( log( P_rcm(ilev_rcm)*P_rcm(ilev_rcm-1) )/2 ) … … 318 319 do ilay=2,nlay 319 320 320 if(ilay_rcm.le.nlayer mx)then321 if(ilay_rcm.le.nlayer)then 321 322 ! interpolate rcm variables 322 323 … … 349 350 350 351 ifinal_rcm=ilay_rcm-1 351 if(ifinal_rcm.lt.nlayer mx)then352 if(ifinal_rcm.lt.nlayer)then 352 353 if(verbose)then 353 354 print*,'Interpolation in kcmprof stopped at layer',ilay_rcm,'!' 354 355 endif 355 356 356 do ilay_rcm=ifinal_rcm+1,nlayer mx357 do ilay_rcm=ifinal_rcm+1,nlayer 357 358 358 359 z_rcm(ilay_rcm) = z_rcm(ilay_rcm-1) … … 364 365 endif 365 366 366 do ilay=2,nlayer mx367 do ilay=2,nlayer 367 368 if(T_rcm(ilay).lt.Ttop)then 368 369 T_rcm(ilay)=Ttop … … 373 374 if(co2cond)then 374 375 print*,'CO2 condensation haircut - assumes CO2-dominated atmosphere!' 375 do ilay=2,nlayer mx376 do ilay=2,nlayer 376 377 if(P_rcm(ilay).lt.518000.)then 377 378 TCO2cond = (-3167.8)/(log(.01*P_rcm(ilay))-23.23) ! Fanale's formula -
trunk/LMDZ.GENERIC/libf/phystd/largescale.F90
r1016 r1308 1 subroutine largescale(ngrid,n q,ptimestep, pplev, pplay, pt, pq,&2 1 subroutine largescale(ngrid,nlayer,nq,ptimestep, pplev, pplay, & 2 pt, pq, pdt, pdq, pdtlsc, pdqvaplsc, pdqliqlsc, rneb) 3 3 4 4 … … 23 23 !================================================================== 24 24 25 #include "dimensions.h"26 #include "dimphys.h"25 !#include "dimensions.h" 26 !#include "dimphys.h" 27 27 #include "comcstfi.h" 28 28 29 29 #include "callkeys.h" 30 30 31 INTEGER ngrid,n q31 INTEGER ngrid,nlayer,nq 32 32 33 33 ! Arguments 34 34 REAL ptimestep ! intervalle du temps (s) 35 REAL pplev(ngrid,nlayer mx+1) ! pression a inter-couche36 REAL pplay(ngrid,nlayer mx) ! pression au milieu de couche37 REAL pt(ngrid,nlayer mx) ! temperature (K)38 REAL pq(ngrid,nlayer mx,nq) ! tracer mixing ratio (kg/kg)39 REAL pdt(ngrid,nlayer mx) ! physical temperature tenedency (K/s)40 REAL pdq(ngrid,nlayer mx,nq)! physical tracer tenedency (K/s)41 REAL pdtlsc(ngrid,nlayer mx) ! incrementation de la temperature (K)42 REAL pdqvaplsc(ngrid,nlayer mx) ! incrementation de la vapeur d'eau43 REAL pdqliqlsc(ngrid,nlayer mx) ! incrementation de l'eau liquide44 REAL rneb(ngrid,nlayer mx) ! fraction nuageuse35 REAL pplev(ngrid,nlayer+1) ! pression a inter-couche 36 REAL pplay(ngrid,nlayer) ! pression au milieu de couche 37 REAL pt(ngrid,nlayer) ! temperature (K) 38 REAL pq(ngrid,nlayer,nq) ! tracer mixing ratio (kg/kg) 39 REAL pdt(ngrid,nlayer) ! physical temperature tenedency (K/s) 40 REAL pdq(ngrid,nlayer,nq)! physical tracer tenedency (K/s) 41 REAL pdtlsc(ngrid,nlayer) ! incrementation de la temperature (K) 42 REAL pdqvaplsc(ngrid,nlayer) ! incrementation de la vapeur d'eau 43 REAL pdqliqlsc(ngrid,nlayer) ! incrementation de l'eau liquide 44 REAL rneb(ngrid,nlayer) ! fraction nuageuse 45 45 46 46 … … 63 63 64 64 ! evaporation calculations 65 REAL dqevap(ngrid,nlayer mx),dtevap(ngrid,nlayermx)66 REAL qevap(ngrid,nlayer mx,nq)67 REAL tevap(ngrid,nlayer mx)65 REAL dqevap(ngrid,nlayer),dtevap(ngrid,nlayer) 66 REAL qevap(ngrid,nlayer,nq) 67 REAL tevap(ngrid,nlayer) 68 68 69 69 DOUBLE PRECISION zx_q(ngrid) … … 83 83 ! GCM -----> subroutine variables, initialisation of outputs 84 84 85 pdtlsc(1:ngrid,1:nlayer mx) = 0.086 pdqvaplsc(1:ngrid,1:nlayer mx) = 0.087 pdqliqlsc(1:ngrid,1:nlayer mx) = 0.088 rneb(1:ngrid,1:nlayer mx) = 0.085 pdtlsc(1:ngrid,1:nlayer) = 0.0 86 pdqvaplsc(1:ngrid,1:nlayer) = 0.0 87 pdqliqlsc(1:ngrid,1:nlayer) = 0.0 88 rneb(1:ngrid,1:nlayer) = 0.0 89 89 Lcp=RLVTT/RCPD 90 90 91 91 92 92 ! Evaporate cloud water/ice 93 call evap(ngrid,n q,ptimestep,pt,pq,pdq,pdt,dqevap,dtevap,qevap,tevap)93 call evap(ngrid,nlayer,nq,ptimestep,pt,pq,pdq,pdt,dqevap,dtevap,qevap,tevap) 94 94 ! note: we use qevap but not tevap in largescale/moistadj 95 95 ! otherwise is a big mess … … 97 97 98 98 ! Boucle verticale (du haut vers le bas) 99 DO k = nlayer mx, 1, -199 DO k = nlayer, 1, -1 100 100 101 101 zt(1:ngrid)=pt(1:ngrid,k)+(pdt(1:ngrid,k)+dtevap(1:ngrid,k))*ptimestep … … 171 171 pdtlsc(1:ngrid,k) = pdqliqlsc(1:ngrid,k)*real(Lcp) 172 172 173 Enddo ! k= nlayer mx, 1, -1173 Enddo ! k= nlayer, 1, -1 174 174 175 175 176 return177 176 end -
trunk/LMDZ.GENERIC/libf/phystd/lect_start_archive.F
r1297 r1308 1 SUBROUTINE lect_start_archive(date,tsurf,tsoil,emis,q2, 1 SUBROUTINE lect_start_archive(ngrid,nlayer, 2 & date,tsurf,tsoil,emis,q2, 2 3 & t,ucov,vcov,ps,h,phisold_newgrid, 3 4 & q,qsurf,surfith,nid, … … 30 31 31 32 #include "dimensions.h" 32 #include "dimphys.h"33 !#include "dimphys.h" 33 34 !#include "planete.h" 34 35 #include "paramet.h" … … 47 48 c======================================================================= 48 49 50 INTEGER,INTENT(IN) :: ngrid, nlayer 51 49 52 c Old variables dimensions (from file) 50 53 c------------------------------------ … … 99 102 c variable physique 100 103 c------------------ 101 REAL tsurf(ngrid mx) ! surface temperature102 REAL tsoil(ngrid mx,nsoilmx) ! soil temperature103 REAL co2ice(ngrid mx) ! CO2 ice layer104 REAL emis(ngrid mx)105 REAL q2(ngrid mx,nlayermx+1),qsurf(ngridmx,nqtot)106 REAL tslab(ngrid mx,noceanmx)107 REAL rnat(ngrid mx),pctsrf_sic(ngridmx)108 REAL tsea_ice(ngrid mx),sea_ice(ngridmx)109 c REAL phisfi(ngrid mx)104 REAL tsurf(ngrid) ! surface temperature 105 REAL tsoil(ngrid,nsoilmx) ! soil temperature 106 REAL co2ice(ngrid) ! CO2 ice layer 107 REAL emis(ngrid) 108 REAL q2(ngrid,llm+1),qsurf(ngrid,nqtot) 109 REAL tslab(ngrid,noceanmx) 110 REAL rnat(ngrid),pctsrf_sic(ngrid) 111 REAL tsea_ice(ngrid),sea_ice(ngrid) 112 c REAL phisfi(ngrid) 110 113 111 114 INTEGER i,j,l … … 322 325 allocate(varp1 (imold+1,jmold+1,llm+1)) 323 326 324 write(*,*) 'q2',ngrid mx,nlayermx+1327 write(*,*) 'q2',ngrid,llm+1 325 328 write(*,*) 'q2S',iip1,jjp1,llm+1 326 329 write(*,*) 'q2old',imold+1,jmold+1,lmold+1 … … 1052 1055 call interp_horiz (tsurfold,tsurfs,imold,jmold,iim,jjm,1, 1053 1056 & rlonuold,rlatvold,rlonu,rlatv) 1054 call gr_dyn_fi (1,iim+1,jjm+1,ngrid mx,tsurfs,tsurf)1057 call gr_dyn_fi (1,iim+1,jjm+1,ngrid,tsurfs,tsurf) 1055 1058 c write(44,*) 'tsurf', tsurf 1056 1059 … … 1059 1062 ! & imold,jmold,iim,jjm,nsoilmx, 1060 1063 ! & rlonuold,rlatvold,rlonu,rlatv) 1061 ! call gr_dyn_fi (nsoilmx,iim+1,jjm+1,ngrid mx,tsoils,tsoil)1064 ! call gr_dyn_fi (nsoilmx,iim+1,jjm+1,ngrid,tsoils,tsoil) 1062 1065 c write(45,*) 'tsoil',tsoil 1063 1066 … … 1065 1068 call interp_horiz (emisold,emiss,imold,jmold,iim,jjm,1, 1066 1069 & rlonuold,rlatvold,rlonu,rlatv) 1067 call gr_dyn_fi (1,iim+1,jjm+1,ngrid mx,emiss,emis)1070 call gr_dyn_fi (1,iim+1,jjm+1,ngrid,emiss,emis) 1068 1071 c write(46,*) 'emis',emis 1069 1072 … … 1201 1204 1202 1205 ! Reshape inertiedatS to scalar grid as inertiedat 1203 call gr_dyn_fi (nsoilmx,iim+1,jjm+1,ngrid mx,1206 call gr_dyn_fi (nsoilmx,iim+1,jjm+1,ngrid, 1204 1207 & inertiedatS,inertiedat) 1205 1208 … … 1287 1290 1288 1291 ! Reshape tsoilS to scalar grid as tsoil 1289 call gr_dyn_fi (nsoilmx,iim+1,jjm+1,ngrid mx,tsoilS,tsoil)1292 call gr_dyn_fi (nsoilmx,iim+1,jjm+1,ngrid,tsoilS,tsoil) 1290 1293 1291 1294 c----------------------------------------------------------------------- … … 1294 1297 call interp_horiz (tslabold,tslabs,imold,jmold,iim,jjm,noceanmx, 1295 1298 & rlonuold,rlatvold,rlonu,rlatv) 1296 call gr_dyn_fi (1,iim+1,jjm+1,ngrid mx,tslabs,tslab)1299 call gr_dyn_fi (1,iim+1,jjm+1,ngrid,tslabs,tslab) 1297 1300 1298 1301 call interp_horiz (rnatold,rnats,imold,jmold,iim,jjm,1, 1299 1302 & rlonuold,rlatvold,rlonu,rlatv) 1300 call gr_dyn_fi (1,iim+1,jjm+1,ngrid mx,rnats,rnat)1303 call gr_dyn_fi (1,iim+1,jjm+1,ngrid,rnats,rnat) 1301 1304 1302 1305 call interp_horiz (pctsrf_sicold,pctsrf_sics,imold,jmold,iim, 1303 1306 & jjm,1,rlonuold,rlatvold,rlonu,rlatv) 1304 call gr_dyn_fi (1,iim+1,jjm+1,ngrid mx,pctsrf_sics,pctsrf_sic)1307 call gr_dyn_fi (1,iim+1,jjm+1,ngrid,pctsrf_sics,pctsrf_sic) 1305 1308 1306 1309 call interp_horiz (tsea_iceold,tsea_ices,imold,jmold,iim,jjm,1, 1307 1310 & rlonuold,rlatvold,rlonu,rlatv) 1308 call gr_dyn_fi (1,iim+1,jjm+1,ngrid mx,tsea_ices,tsea_ice)1311 call gr_dyn_fi (1,iim+1,jjm+1,ngrid,tsea_ices,tsea_ice) 1309 1312 1310 1313 call interp_horiz (sea_iceold,sea_ices,imold,jmold,iim,jjm,1, 1311 1314 & rlonuold,rlatvold,rlonu,rlatv) 1312 call gr_dyn_fi (1,iim+1,jjm+1,ngrid mx,sea_ices,sea_ice)1315 call gr_dyn_fi (1,iim+1,jjm+1,ngrid,sea_ices,sea_ice) 1313 1316 1314 1317 c----------------------------------------------------------------------- … … 1334 1337 & rlonuold,rlatvold,rlonu,rlatv) 1335 1338 write (*,*) 'lect_start_archive: q2s ', q2s (1,2,1) ! INFO 1336 call gr_dyn_fi (llm+1,iim+1,jjm+1,ngrid mx,q2s,q2)1339 call gr_dyn_fi (llm+1,iim+1,jjm+1,ngrid,q2s,q2) 1337 1340 write (*,*) 'lect_start_archive: q2 ', q2 (1,2) ! INFO 1338 1341 c write(47,*) 'q2',q2 … … 1384 1387 enddo 1385 1388 1386 call gr_dyn_fi (nqtot,iim+1,jjm+1,ngrid mx,qsurfs,qsurf)1389 call gr_dyn_fi (nqtot,iim+1,jjm+1,ngrid,qsurfs,qsurf) 1387 1390 1388 1391 c traceurs 3D … … 1435 1438 enddo 1436 1439 1437 ! call gr_dyn_fi (1,iim+1,jjm+1,ngrid mx,co2ices,co2ice)1440 ! call gr_dyn_fi (1,iim+1,jjm+1,ngrid,co2ices,co2ice) 1438 1441 ! no need to transfer "co2ice" any more; it is in qsurf(igcm_co2_ice) 1439 1442 -
trunk/LMDZ.GENERIC/libf/phystd/mass_redistribution.F90
r1194 r1308 9 9 USE comgeomfi_h 10 10 USE tracer_h 11 USE planete_mod, only: bp 11 12 12 13 IMPLICIT NONE … … 50 51 ! ------------------ 51 52 ! 52 #include "dimensions.h"53 #include "dimphys.h"53 !#include "dimensions.h" 54 !#include "dimphys.h" 54 55 #include "comcstfi.h" 55 #include "comvert.h"56 #include "paramet.h"56 !#include "comvert.h" 57 !#include "paramet.h" 57 58 #include "callkeys.h" 58 59 … … 84 85 85 86 ! vertical reorganization of sigma levels 86 REAL zzu(nlayer mx),zzv(nlayermx)87 REAL zzq(nlayer mx,nq),zzt(nlayermx)87 REAL zzu(nlayer),zzv(nlayer) 88 REAL zzq(nlayer,nq),zzt(nlayer) 88 89 ! Dummy variables 89 90 INTEGER n,l,ig,iq 90 REAL zdtsig(ngrid,nlayer mx)91 REAL zmass(ngrid,nlayer mx),zzmass(nlayermx),w(nlayermx+1)92 REAL zdmass_sum(ngrid,nlayer mx+1)93 REAL zmflux(nlayer mx+1)94 REAL zq1(nlayer mx)91 REAL zdtsig(ngrid,nlayer) 92 REAL zmass(ngrid,nlayer),zzmass(nlayer),w(nlayer+1) 93 REAL zdmass_sum(ngrid,nlayer+1) 94 REAL zmflux(nlayer+1) 95 REAL zq1(nlayer) 95 96 REAL ztsrf(ngrid) 96 REAL ztm(nlayermx+1) 97 REAL zum(nlayermx+1) , zvm(nlayermx+1) 98 REAL zqm(nlayermx+1,nq),zqm1(nlayermx+1) 97 REAL ztm(nlayer+1) 98 REAL zum(nlayer+1) , zvm(nlayer+1) 99 REAL zqm(nlayer+1,nq),zqm1(nlayer+1) 100 REAL sigma(nlayer+1) 99 101 100 102 ! local saved variables … … 127 129 128 130 DO ig=1,ngrid 129 zdmass_sum(ig,nlayer mx+1)=0.130 DO l = nlayer mx, 1, -1131 zdmass_sum(ig,nlayer+1)=0. 132 DO l = nlayer, 1, -1 131 133 zmass(ig,l) = (pplev(ig,l)-pplev(ig,l+1))/glat(ig) 132 134 zdmass_sum(ig,l)= zdmass_sum(ig,l+1)+pdmassmr(ig,l) … … 181 183 ! Correction to account for redistribution between sigma or hybrid 182 184 ! layers when changing surface pressure 183 ! zzx quantities have dimension (nlayer mx) to speed up calculation185 ! zzx quantities have dimension (nlayer) to speed up calculation 184 186 ! ************************************************************* 185 187 186 188 DO ig=1,ngrid 187 zzt(1:nlayer mx) = pt(ig,1:nlayermx) + pdt(ig,1:nlayermx) * ptimestep188 zzu(1:nlayer mx) = pu(ig,1:nlayermx) + pdu(ig,1:nlayermx) * ptimestep189 zzv(1:nlayer mx) = pv(ig,1:nlayermx) + pdv(ig,1:nlayermx) * ptimestep190 zzq(1:nlayer mx,1:nq)=pq(ig,1:nlayermx,1:nq)+pdq(ig,1:nlayermx,1:nq)*ptimestep ! must add the water that has fallen???189 zzt(1:nlayer) = pt(ig,1:nlayer) + pdt(ig,1:nlayer) * ptimestep 190 zzu(1:nlayer) = pu(ig,1:nlayer) + pdu(ig,1:nlayer) * ptimestep 191 zzv(1:nlayer) = pv(ig,1:nlayer) + pdv(ig,1:nlayer) * ptimestep 192 zzq(1:nlayer,1:nq)=pq(ig,1:nlayer,1:nq)+pdq(ig,1:nlayer,1:nq)*ptimestep ! must add the water that has fallen??? 191 193 192 194 ! Mass fluxes of air through the sigma levels (kg.m-2.s-1) (>0 when up) 193 195 ! """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 194 195 196 zmflux(1) = zmassboil(ig) 197 sigma(1)=1 196 198 DO l=1,nlayer 199 ! Ehouarn: shouldn't we rather compute sigma levels than use bp()? 200 ! sigma(l+1)=pplev(ig,l+1)/pplev(ig,1) 201 ! zmflux(l+1) = zmflux(l) + pdmassmr(ig,l) - & 202 ! (sigma(l)-sigma(l+1))*(zdmass_sum(ig,1)+zmflux(1)) 203 ! if (abs(zmflux(l+1)).lt.1E-13.OR.sigma(l+1).eq.0.) zmflux(l+1)=0. 204 ! Ehouarn: but for now leave things as before 197 205 zmflux(l+1) = zmflux(l) + pdmassmr(ig,l) - (bp(l)-bp(l+1))*(zdmass_sum(ig,1)+zmflux(1)) 198 206 ! zmflux set to 0 if very low to avoid: top layer is disappearing in v1ld 199 if (abs(zmflux(l+1)).lt.1E-13.OR. bp(l+1).eq.0.) zmflux(l+1)=0.207 if (abs(zmflux(l+1)).lt.1E-13.OR.sigma(l+1).eq.0.) zmflux(l+1)=0. 200 208 END DO 201 209 202 210 ! Mass of each layer 203 211 ! ------------------ 204 zzmass(1:nlayer mx)=zmass(ig,1:nlayermx)*(1.+pdpsrfmr(ig)*ptimestep/pplev(ig,1))212 zzmass(1:nlayer)=zmass(ig,1:nlayer)*(1.+pdpsrfmr(ig)*ptimestep/pplev(ig,1)) 205 213 206 214 … … 219 227 220 228 ! Van Leer scheme: 221 w(1:nlayer mx+1)=-zmflux(1:nlayermx+1)*ptimestep229 w(1:nlayer+1)=-zmflux(1:nlayer+1)*ptimestep 222 230 call vl1d(zzt,2.,zzmass,w,ztm) 223 231 call vl1d(zzu ,2.,zzmass,w,zum) 224 232 call vl1d(zzv ,2.,zzmass,w,zvm) 225 233 do iq=1,nq 226 zq1(1:nlayer mx)=zzq(1:nlayermx,iq)234 zq1(1:nlayer)=zzq(1:nlayer,iq) 227 235 zqm1(1)=zqm(1,iq) 228 236 ! print*,iq -
trunk/LMDZ.GENERIC/libf/phystd/moistadj.F90
r1016 r1308 1 subroutine moistadj(ngrid, n q, pt, pq, pdq, pplev, pplay, pdtmana, pdqmana, ptimestep, rneb)1 subroutine moistadj(ngrid, nlayer, nq, pt, pq, pdq, pplev, pplay, pdtmana, pdqmana, ptimestep, rneb) 2 2 3 3 use watercommon_h, only: T_h2O_ice_liq, RLVTT, RCPD, RCPV, Psat_water, Lcpdqsat_water 4 USE tracer_h 4 USE tracer_h, only: igcm_h2o_vap, igcm_h2o_ice 5 5 6 6 implicit none … … 20 20 !===================================================================== 21 21 22 #include "dimensions.h"23 #include "dimphys.h"22 !#include "dimensions.h" 23 !#include "dimphys.h" 24 24 #include "comcstfi.h" 25 25 26 INTEGER ngrid, nq 27 28 REAL pt(ngrid,nlayermx) ! temperature (K) 29 REAL pq(ngrid,nlayermx,nq) ! tracer (kg/kg) 30 REAL pdq(ngrid,nlayermx,nq) 31 32 REAL pdqmana(ngrid,nlayermx,nq) ! tendency of tracers (kg/kg.s-1) 33 REAL pdtmana(ngrid,nlayermx) ! temperature increment 26 INTEGER,INTENT(IN) :: ngrid, nlayer, nq 27 28 REAL,INTENT(IN) :: pt(ngrid,nlayer) ! temperature (K) 29 REAL,INTENT(IN) :: pq(ngrid,nlayer,nq) ! tracer (kg/kg) 30 REAL,INTENT(IN) :: pdq(ngrid,nlayer,nq) 31 REAL,INTENT(IN) :: pplev(ngrid,nlayer+1) ! inter-layer pressure (Pa) 32 REAL,INTENT(IN) :: pplay(ngrid,nlayer) ! mid-layer pressure (Pa) 33 REAL,INTENT(IN) :: ptimestep ! physics timestep (s) 34 REAL,INTENT(OUT) :: pdqmana(ngrid,nlayer,nq) ! tracer tendencies (kg/kg.s-1) 35 REAL,INTENT(OUT) :: pdtmana(ngrid,nlayer) ! temperature increment(K/s) 36 REAL,INTENT(OUT) :: rneb(ngrid,nlayer) ! cloud fraction 34 37 35 38 ! local variables 36 REAL zt(ngrid,nlayermx) ! temperature (K) 37 REAL zq(ngrid,nlayermx) ! humidite specifique (kg/kg) 38 REAL pplev(ngrid,nlayermx+1) ! pression a inter-couche (Pa) 39 REAL pplay(ngrid,nlayermx) ! pression au milieu de couche (Pa) 40 41 REAL d_t(ngrid,nlayermx) ! temperature increment 42 REAL d_q(ngrid,nlayermx) ! incrementation pour vapeur d'eau 43 REAL d_ql(ngrid,nlayermx) ! incrementation pour l'eau liquide 44 REAL rneb(ngrid,nlayermx) ! cloud fraction 45 REAL ptimestep 39 REAL zt(ngrid,nlayer) ! temperature (K) 40 REAL zq(ngrid,nlayer) ! humidite specifique (kg/kg) 41 42 REAL d_t(ngrid,nlayer) ! temperature increment 43 REAL d_q(ngrid,nlayer) ! incrementation pour vapeur d'eau 44 REAL d_ql(ngrid,nlayer) ! incrementation pour l'eau liquide 46 45 47 46 ! REAL t_coup … … 55 54 INTEGER k1, k1p, k2, k2p 56 55 LOGICAL itest(ngrid) 57 REAL delta_q(ngrid, nlayer mx)58 DOUBLE PRECISION :: cp_new_t(nlayer mx), v_cptt(ngrid,nlayermx)59 REAL cp_delta_t(nlayer mx)60 DOUBLE PRECISION :: v_cptj(nlayer mx), v_cptjk1, v_ssig56 REAL delta_q(ngrid, nlayer) 57 DOUBLE PRECISION :: cp_new_t(nlayer), v_cptt(ngrid,nlayer) 58 REAL cp_delta_t(nlayer) 59 DOUBLE PRECISION :: v_cptj(nlayer), v_cptjk1, v_ssig 61 60 REAL v_p, v_t, v_zqs,v_cptt2,v_pratio,v_dlnpsat 62 REAL zqs(ngrid,nlayer mx), zdqs(ngrid,nlayermx),zpsat(ngrid,nlayermx),zdlnpsat(ngrid,nlayermx)61 REAL zqs(ngrid,nlayer), zdqs(ngrid,nlayer),zpsat(ngrid,nlayer),zdlnpsat(ngrid,nlayer) 63 62 REAL zq1(ngrid), zq2(ngrid) 64 DOUBLE PRECISION :: gamcpdz(ngrid,2:nlayer mx)63 DOUBLE PRECISION :: gamcpdz(ngrid,2:nlayer) 65 64 DOUBLE PRECISION :: zdp, zdpm 66 65 … … 68 67 REAL zflo ! flotabilite 69 68 70 DOUBLE PRECISION :: local_q(ngrid,nlayer mx),local_t(ngrid,nlayermx)69 DOUBLE PRECISION :: local_q(ngrid,nlayer),local_t(ngrid,nlayer) 71 70 72 71 REAL zdelta, zcor, zcvm5 … … 79 78 INTEGER,SAVE :: i_ice=0 ! water ice 80 79 81 LOGICAL firstcall 82 SAVE firstcall 83 84 DATA firstcall /.TRUE./ 80 LOGICAL,SAVE :: firstcall=.TRUE. 85 81 86 82 IF (firstcall) THEN … … 96 92 97 93 ! GCM -----> subroutine variables 98 zq(1:ngrid,1:nlayer mx) = pq(1:ngrid,1:nlayermx,i_h2o)+ pdq(1:ngrid,1:nlayermx,i_h2o)*ptimestep99 zt(1:ngrid,1:nlayer mx) = pt(1:ngrid,1:nlayermx)100 pdqmana(1:ngrid,1:nlayer mx,1:nq)=0.0101 102 DO k = 1, nlayer mx94 zq(1:ngrid,1:nlayer) = pq(1:ngrid,1:nlayer,i_h2o)+ pdq(1:ngrid,1:nlayer,i_h2o)*ptimestep 95 zt(1:ngrid,1:nlayer) = pt(1:ngrid,1:nlayer) 96 pdqmana(1:ngrid,1:nlayer,1:nq)=0.0 97 98 DO k = 1, nlayer 103 99 DO i = 1, ngrid 104 100 if(zq(i,k).lt.0.)then … … 108 104 ENDDO 109 105 110 local_q(1:ngrid,1:nlayer mx) = zq(1:ngrid,1:nlayermx)111 local_t(1:ngrid,1:nlayer mx) = zt(1:ngrid,1:nlayermx)112 rneb(1:ngrid,1:nlayer mx) = 0.0113 d_ql(1:ngrid,1:nlayer mx) = 0.0114 d_t(1:ngrid,1:nlayer mx) = 0.0115 d_q(1:ngrid,1:nlayer mx) = 0.0106 local_q(1:ngrid,1:nlayer) = zq(1:ngrid,1:nlayer) 107 local_t(1:ngrid,1:nlayer) = zt(1:ngrid,1:nlayer) 108 rneb(1:ngrid,1:nlayer) = 0.0 109 d_ql(1:ngrid,1:nlayer) = 0.0 110 d_t(1:ngrid,1:nlayer) = 0.0 111 d_q(1:ngrid,1:nlayer) = 0.0 116 112 117 113 ! Calculate v_cptt 118 DO k = 1, nlayer mx114 DO k = 1, nlayer 119 115 DO i = 1, ngrid 120 116 v_cptt(i,k) = RCPD * local_t(i,k) … … 128 124 129 125 ! Calculate Gamma * Cp * dz: (gamma is the critical gradient) 130 DO k = 2, nlayer mx126 DO k = 2, nlayer 131 127 DO i = 1, ngrid 132 128 zdp = pplev(i,k)-pplev(i,k+1) … … 159 155 810 CONTINUE ! look for k1, the base of the column 160 156 k2 = k2 + 1 161 IF (k2 .GT. nlayer mx) GOTO 9999157 IF (k2 .GT. nlayer) GOTO 9999 162 158 zflo = v_cptt(i,k2-1) - v_cptt(i,k2) - gamcpdz(i,k2) 163 159 zsat=(local_q(i,k2-1)-zqs(i,k2-1))*(pplev(i,k2-1)-pplev(i,k2)) & … … 169 165 170 166 820 CONTINUE !! look for k2, the top of the column 171 IF (k2 .EQ. nlayer mx) GOTO 821167 IF (k2 .EQ. nlayer) GOTO 821 172 168 k2p = k2 + 1 173 169 zsat=zsat+(pplev(i,k2p)-pplev(i,k2p+1))*(local_q(i,k2p)-zqs(i,k2p)) … … 227 223 ! ENDDO 228 224 229 DO k = 2, nlayer mx225 DO k = 2, nlayer 230 226 zdpm = pplev(i,k-1) - pplev(i,k) 231 227 zdp = pplev(i,k) - pplev(i,k+1) … … 272 268 ! a l'endroit ou la vapeur d'eau est diminuee par l'ajustement): 273 269 274 DO k = 1, nlayer mx270 DO k = 1, nlayer 275 271 DO i = 1, ngrid 276 272 IF (itest(i)) THEN … … 291 287 ENDIF 292 288 ENDDO 293 DO k = 1, nlayer mx289 DO k = 1, nlayer 294 290 DO i = 1, ngrid 295 291 IF (itest(i)) THEN … … 300 296 ENDDO 301 297 ENDDO 302 DO k = 1, nlayer mx298 DO k = 1, nlayer 303 299 DO i = 1, ngrid 304 300 IF (itest(i)) THEN … … 308 304 ENDDO 309 305 310 DO k = 1, nlayer mx306 DO k = 1, nlayer 311 307 DO i = 1, ngrid 312 308 local_q(i, k) = MAX(local_q(i, k), seuil_vap) … … 314 310 ENDDO 315 311 316 DO k = 1, nlayer mx312 DO k = 1, nlayer 317 313 DO i = 1, ngrid 318 314 d_t(i,k) = local_t(i,k) - zt(i,k) … … 322 318 323 319 ! now subroutine -----> GCM variables 324 DO k = 1, nlayer mx320 DO k = 1, nlayer 325 321 DO i = 1, ngrid 326 322 … … 333 329 334 330 335 RETURN336 331 END -
trunk/LMDZ.GENERIC/libf/phystd/newsedim.F
r858 r1308 16 16 ! ------------ 17 17 18 #include "dimensions.h"19 #include "dimphys.h"18 !#include "dimensions.h" 19 !#include "dimphys.h" 20 20 #include "comcstfi.h" 21 21 … … 47 47 c Traceurs : 48 48 c ~~~~~~~~ 49 real traversee (ngrid,nlay ermx)50 real vstokes(ngrid,nlay ermx)51 real w(ngrid,nlay ermx)49 real traversee (ngrid,nlay) 50 real vstokes(ngrid,nlay) 51 real w(ngrid,nlay) 52 52 real ptop, dztop, Ep, Stra 53 53 … … 191 191 end do 192 192 193 call vlz_fi(ngrid, pqi,2.,masse,w,wq)193 call vlz_fi(ngrid,nlay,pqi,2.,masse,w,wq) 194 194 c write(*,*) ' newsed: wq(6), wq(7), q(6)', 195 195 c & wq(1,6),wq(1,7),pqi(1,6) 196 196 197 RETURN198 197 END -
trunk/LMDZ.GENERIC/libf/phystd/newstart.F
r1297 r1308 32 32 33 33 #include "dimensions.h" 34 #include "dimphys.h" 35 #include "planete.h" 34 !#include "dimphys.h" 35 integer, parameter :: ngridmx = (2+(jjm-1)*iim - 1/jjm) 36 !#include "planete.h" 36 37 #include "paramet.h" 37 38 #include "comconst.h" … … 98 99 real emisread ! added by RW 99 100 REAL,ALLOCATABLE :: qsurf(:,:) 100 REAL q2(ngridmx, nlayermx+1)101 REAL q2(ngridmx,llm+1) 101 102 ! REAL rnaturfi(ngridmx) 102 103 real alb(iip1,jjp1),albfi(ngridmx) ! albedos … … 171 172 172 173 ! added by BC for cloud fraction setup 173 REAL hice(ngridmx),cloudfrac(ngridmx, nlayermx)174 REAL hice(ngridmx),cloudfrac(ngridmx,llm) 174 175 REAL totalfrac(ngridmx) 175 176 … … 341 342 write(*,*) 'Reading file STARTFI' 342 343 fichnom = 'startfi.nc' 343 CALL phyetat0 (ngridmx, fichnom,tab0,Lmodif,nsoilmx,nqtot,344 . day_ini,time,344 CALL phyetat0 (ngridmx,llm,fichnom,tab0,Lmodif,nsoilmx, 345 . nqtot,day_ini,time, 345 346 . tsurf,tsoil,emis,q2,qsurf, !) ! temporary modif by RDW 346 347 . cloudfrac,totalfrac,hice,rnat,pctsrf_sic,tslab,tsea_ice, … … 534 535 535 536 write(*,*) 'Reading file START_ARCHIVE' 536 CALL lect_start_archive(date,tsurf,tsoil,emis,q2, 537 CALL lect_start_archive(ngridmx,llm, 538 & date,tsurf,tsoil,emis,q2, 537 539 & t,ucov,vcov,ps,teta,phisold_newgrid,q,qsurf, 538 540 & surfith,nid, … … 956 958 ucov(1:iip1,1:jjp1,1:llm)=0. 957 959 vcov(1:iip1,1:jjm,1:llm)=0. 958 q2(1:ngridmx,1: nlayermx+1)=0.960 q2(1:ngridmx,1:llm+1)=0. 959 961 else 960 962 write(*,*)'problem reading file ',trim(txt),' !' … … 1296 1298 ucov(1:iip1,1:jjp1,1:llm)=0 1297 1299 vcov(1:iip1,1:jjm,1:llm)=0 1298 q2(1:ngridmx,1: nlayermx+1)=01300 q2(1:ngridmx,1:llm+1)=0 1299 1301 1300 1302 c radequi : Radiative equilibrium profile of temperatures and no winds … … 1326 1328 ucov(1:iip1,1:jjp1,1:llm)=0 1327 1329 vcov(1:iip1,1:jjm,1:llm)=0 1328 q2(1:ngridmx,1: nlayermx+1)=01330 q2(1:ngridmx,1:llm+1)=0 1329 1331 1330 1332 c coldstart : T set 1K above CO2 frost point and no winds … … 1362 1364 ucov(1:iip1,1:jjp1,1:llm)=0 1363 1365 vcov(1:iip1,1:jjm,1:llm)=0 1364 q2(1:ngridmx,1: nlayermx+1)=01366 q2(1:ngridmx,1:llm+1)=0 1365 1367 1366 1368 -
trunk/LMDZ.GENERIC/libf/phystd/newtrelax.F90
r787 r1308 1 subroutine newtrelax(ngrid, mu0,sinlat,popsk,temp,pplay,pplev,dtrad,firstcall)1 subroutine newtrelax(ngrid,nlayer,mu0,sinlat,popsk,temp,pplay,pplev,dtrad,firstcall) 2 2 3 3 implicit none 4 4 5 #include "dimensions.h"6 #include "dimphys.h"5 !#include "dimensions.h" 6 !#include "dimphys.h" 7 7 #include "comcstfi.h" 8 8 #include "callkeys.h" … … 21 21 !================================================================== 22 22 23 integer ngrid24 23 25 24 ! Input 26 real mu0(ngrid) ! cosine of sun incident angle 27 real sinlat(ngrid) ! sine of latitude 28 real temp(ngrid,nlayermx) ! temperature at each layer (K) 29 real pplay(ngrid,nlayermx) ! pressure at each layer (Pa) 30 real pplev(ngrid,nlayermx+1) ! pressure at each level (Pa) 31 real popsk(ngrid,nlayermx) ! pot. T to T converter 25 integer,intent(in) :: ngrid, nlayer 26 logical,intent(in) :: firstcall 27 real,intent(in) :: mu0(ngrid) ! cosine of sun incident angle 28 real,intent(in) :: sinlat(ngrid) ! sine of latitude 29 real,intent(in) :: temp(ngrid,nlayer) ! temperature at each layer (K) 30 real,intent(in) :: pplay(ngrid,nlayer) ! pressure at each layer (Pa) 31 real,intent(in) :: pplev(ngrid,nlayer+1) ! pressure at each level (Pa) 32 real,intent(in) :: popsk(ngrid,nlayer) ! pot. T to T converter 32 33 33 34 ! Output 34 real dtrad(ngrid,nlayermx)35 real,intent(out) :: dtrad(ngrid,nlayer) 35 36 36 37 ! Internal … … 44 45 real sig, f_sig, sig_trop 45 46 integer l,ig 46 logical firstcall47 47 48 48 … … 53 53 if(firstcall) then 54 54 55 ALLOCATE(Trelax(ngrid,nlayer mx))55 ALLOCATE(Trelax(ngrid,nlayer)) 56 56 57 57 print*,'-----------------------------------------------------' … … 66 66 T_surf = 126. + 239.*mu0(ig) 67 67 T_trop = 140. + 52.*mu0(ig) 68 do l=1,nlayer mx68 do l=1,nlayer 69 69 70 70 if(mu0(ig).le.0.0)then ! night side … … 86 86 sig_trop=(T_trop/T_surf)**(1./rcp) 87 87 88 do l=1,nlayer mx88 do l=1,nlayer 89 89 do ig=1,ngrid 90 90 … … 109 109 endif 110 110 111 firstcall=.false.112 113 111 endif 114 112 115 113 ! Calculate radiative forcing 116 do l=1,nlayer mx114 do l=1,nlayer 117 115 do ig=1,ngrid 118 116 dtrad(ig,l) = -(temp(ig,l) - Trelax(ig,l)) / tau_relax … … 129 127 !call writediagfi(ngrid,'ThetaZ','stellar zenith angle','deg',2,mu0) 130 128 131 return132 129 end subroutine newtrelax -
trunk/LMDZ.GENERIC/libf/phystd/ocean_slab_mod.F90
r1298 r1308 15 15 16 16 17 #include "dimensions.h"18 #include "dimphys.h"17 !#include "dimensions.h" 18 !#include "dimphys.h" 19 19 #include "comcstfi.h" 20 20 #include "callkeys.h" … … 67 67 68 68 69 #include "dimensions.h"70 #include "dimphys.h"69 !#include "dimensions.h" 70 !#include "dimphys.h" 71 71 #include "comcstfi.h" 72 72 #include "callkeys.h" … … 210 210 use slab_ice_h 211 211 212 #include "dimensions.h"213 #include "dimphys.h"212 !#include "dimensions.h" 213 !#include "dimphys.h" 214 214 #include "comcstfi.h" 215 215 #include "callkeys.h" … … 451 451 use slab_ice_h 452 452 453 #include "dimensions.h"454 #include "comcstfi.h"453 !#include "dimensions.h" 454 !#include "comcstfi.h" 455 455 ! INCLUDE "iniprint.h" 456 456 #include "callkeys.h" … … 534 534 ! Transport diffusif 535 535 ! IF (ok_soil_hdiff) THEN 536 CALL divgrad_phy(n oceanmx,tmp_tslab_loc,dtdiff_loc)536 CALL divgrad_phy(ngrid,noceanmx,tmp_tslab_loc,dtdiff_loc) 537 537 dtdiff_loc=dtdiff_loc*soil_hdiff*50./SUM(slabh)!*100. 538 538 ! dtdiff_loc(:,1)=dtdiff_loc(:,1)*soil_hdiff*50./SUM(slabh)*0.8 … … 544 544 ! Calcul de transport par Ekman 545 545 546 CALL slab_ekman2( taux_slab,tauy_slab,tslab,dtekman_loc)546 CALL slab_ekman2(ngrid,taux_slab,tauy_slab,tslab,dtekman_loc) 547 547 548 548 -
trunk/LMDZ.GENERIC/libf/phystd/orbite.F
r253 r1308 1 1 subroutine orbite(pls,pdist_star,pdecli) 2 3 use planete_mod, only: p_elips, e_elips, timeperi, obliquit 2 4 implicit none 3 5 … … 23 25 c ------------- 24 26 25 #include "planete.h"27 !#include "planete.h" 26 28 #include "comcstfi.h" 27 29 -
trunk/LMDZ.GENERIC/libf/phystd/phyetat0.F90
r1297 r1308 1 subroutine phyetat0 (ngrid, fichnom,tab0,Lmodif,nsoil,nq, &1 subroutine phyetat0 (ngrid,nlayer,fichnom,tab0,Lmodif,nsoil,nq, & 2 2 day_ini,time,tsurf,tsoil, & 3 3 emis,q2,qsurf,cloudfrac,totcloudfrac,hice, & … … 20 20 !====================================================================== 21 21 #include "netcdf.inc" 22 #include "dimensions.h"23 #include "dimphys.h"24 #include "planete.h"22 !#include "dimensions.h" 23 !#include "dimphys.h" 24 !#include "planete.h" 25 25 #include "comcstfi.h" 26 26 … … 33 33 ! inputs: 34 34 integer,intent(in) :: ngrid 35 integer,intent(in) :: nlayer 35 36 character*(*),intent(in) :: fichnom ! "startfi.nc" file 36 37 integer,intent(in) :: tab0 … … 45 46 real,intent(out) :: tsoil(ngrid,nsoil) ! soil temperature 46 47 real,intent(out) :: emis(ngrid) ! surface emissivity 47 real,intent(out) :: q2(ngrid, llm+1) !48 real,intent(out) :: q2(ngrid,nlayer+1) ! 48 49 real,intent(out) :: qsurf(ngrid,nq) ! tracers on surface 49 50 ! real co2ice(ngrid) ! co2 ice cover 50 real,intent(out) :: cloudfrac(ngrid,nlayer mx)51 real,intent(out) :: cloudfrac(ngrid,nlayer) 51 52 real,intent(out) :: hice(ngrid), totcloudfrac(ngrid) 52 53 real,intent(out) :: pctsrf_sic(ngrid),tslab(ngrid,noceanmx) -
trunk/LMDZ.GENERIC/libf/phystd/phyredem.F90
r1297 r1308 17 17 put_var, put_field, length 18 18 use mod_grid_phy_lmdz, only : klon_glo 19 use planete_mod, only: year_day, periastr, apoastr, peri_day, & 20 obliquit, z0, lmixmin, emin_turb 19 21 20 22 implicit none 21 #include "planete.h"23 !#include "planete.h" 22 24 #include "comcstfi.h" 23 25 character(len=*), intent(in) :: filename … … 147 149 !#include "temps.h" 148 150 #include "comcstfi.h" 149 #include "planete.h"151 !#include "planete.h" 150 152 #include "callkeys.h" 151 153 !====================================================================== -
trunk/LMDZ.GENERIC/libf/phystd/physiq.F90
r1297 r1308 12 12 use gases_h, only: gnom, gfrac 13 13 use radcommon_h, only: sigma, eclipse, glat, grav 14 use radii_mod, only: h2o_reffrad, co2_reffrad , h2o_cloudrad14 use radii_mod, only: h2o_reffrad, co2_reffrad 15 15 use aerosol_mod, only: iaero_co2, iaero_h2o 16 16 use surfdat_h, only: phisfi, albedodat, zmea, zstd, zsig, zgam, zthe, & … … 32 32 use planetwide_mod, only: planetwide_minval,planetwide_maxval,planetwide_sumval 33 33 use mod_phys_lmdz_para, only : is_master 34 34 use planete_mod, only: apoastr, periastr, year_day, peri_day, & 35 obliquit, nres, z0 35 36 36 37 implicit none … … 102 103 ! ------ 103 104 ! 104 ! pdu(ngrid,nlayer mx) \105 ! pdv(ngrid,nlayer mx) \ Temporal derivative of the corresponding106 ! pdt(ngrid,nlayer mx) / variables due to physical processes.107 ! pdq(ngrid,nlayer mx) /105 ! pdu(ngrid,nlayer) \ 106 ! pdv(ngrid,nlayer) \ Temporal derivative of the corresponding 107 ! pdt(ngrid,nlayer) / variables due to physical processes. 108 ! pdq(ngrid,nlayer) / 108 109 ! pdpsrf(ngrid) / 109 110 ! tracerdyn call tracer in dynamical part of GCM ? … … 131 132 ! ------------------ 132 133 133 #include "dimensions.h"134 #include "dimphys.h"134 !#include "dimensions.h" 135 !#include "dimphys.h" 135 136 #include "callkeys.h" 136 137 #include "comcstfi.h" 137 #include "planete.h"138 !#include "planete.h" 138 139 !#include "control.h" 139 140 #include "netcdf.inc" … … 179 180 ! "longrefvis" set in dimradmars.h , for one of the "naerkind" kind of 180 181 ! aerosol optical properties: 181 ! real aerosol(ngrid,nlayer mx,naerkind)182 ! real aerosol(ngrid,nlayer,naerkind) 182 183 ! this is now internal to callcorrk and hence no longer needed here 183 184 … … 207 208 ! aerosol (dust or ice) extinction optical depth at reference wavelength 208 209 ! for the "naerkind" optically active aerosols: 209 real aerosol(ngrid,nlayer mx,naerkind)210 real zh(ngrid,nlayer mx) ! potential temperature (K)210 real aerosol(ngrid,nlayer,naerkind) 211 real zh(ngrid,nlayer) ! potential temperature (K) 211 212 212 213 character*80 fichier … … 228 229 real zls ! solar longitude (rad) 229 230 real zday ! date (time since Ls=0, in martian days) 230 real zzlay(ngrid,nlayer mx) ! altitude at the middle of the layers231 real zzlev(ngrid,nlayer mx+1) ! altitude at layer boundaries231 real zzlay(ngrid,nlayer) ! altitude at the middle of the layers 232 real zzlev(ngrid,nlayer+1) ! altitude at layer boundaries 232 233 real latvl1,lonvl1 ! Viking Lander 1 point (for diagnostic) 233 234 234 235 ! Tendencies due to various processes: 235 236 real dqsurf(ngrid,nq) 236 real cldtlw(ngrid,nlayer mx) ! (K/s) LW heating rate for clear areas237 real cldtsw(ngrid,nlayer mx) ! (K/s) SW heating rate for clear areas237 real cldtlw(ngrid,nlayer) ! (K/s) LW heating rate for clear areas 238 real cldtsw(ngrid,nlayer) ! (K/s) SW heating rate for clear areas 238 239 real zdtsurf(ngrid) ! (K/s) 239 real dtlscale(ngrid,nlayer mx)240 real zdvdif(ngrid,nlayer mx),zdudif(ngrid,nlayermx) ! (m.s-2)241 real zdhdif(ngrid,nlayer mx), zdtsdif(ngrid) ! (K/s)242 real zdtdif(ngrid,nlayer mx) ! (K/s)243 real zdvadj(ngrid,nlayer mx),zduadj(ngrid,nlayermx) ! (m.s-2)244 real zdhadj(ngrid,nlayer mx) ! (K/s)245 real zdtgw(ngrid,nlayer mx) ! (K/s)246 real zdtmr(ngrid,nlayer mx)247 real zdugw(ngrid,nlayer mx),zdvgw(ngrid,nlayermx) ! (m.s-2)248 real zdtc(ngrid,nlayer mx),zdtsurfc(ngrid)249 real zdvc(ngrid,nlayer mx),zduc(ngrid,nlayermx)250 real zdumr(ngrid,nlayer mx),zdvmr(ngrid,nlayermx)240 real dtlscale(ngrid,nlayer) 241 real zdvdif(ngrid,nlayer),zdudif(ngrid,nlayer) ! (m.s-2) 242 real zdhdif(ngrid,nlayer), zdtsdif(ngrid) ! (K/s) 243 real zdtdif(ngrid,nlayer) ! (K/s) 244 real zdvadj(ngrid,nlayer),zduadj(ngrid,nlayer) ! (m.s-2) 245 real zdhadj(ngrid,nlayer) ! (K/s) 246 real zdtgw(ngrid,nlayer) ! (K/s) 247 real zdtmr(ngrid,nlayer) 248 real zdugw(ngrid,nlayer),zdvgw(ngrid,nlayer) ! (m.s-2) 249 real zdtc(ngrid,nlayer),zdtsurfc(ngrid) 250 real zdvc(ngrid,nlayer),zduc(ngrid,nlayer) 251 real zdumr(ngrid,nlayer),zdvmr(ngrid,nlayer) 251 252 real zdtsurfmr(ngrid) 252 253 253 real zdmassmr(ngrid,nlayer mx),zdpsrfmr(ngrid)254 real zdmassmr(ngrid,nlayer),zdpsrfmr(ngrid) 254 255 real zdmassmr_col(ngrid) 255 256 256 real zdqdif(ngrid,nlayer mx,nq), zdqsdif(ngrid,nq)257 real zdqevap(ngrid,nlayer mx)258 real zdqsed(ngrid,nlayer mx,nq), zdqssed(ngrid,nq)259 real zdqdev(ngrid,nlayer mx,nq), zdqsdev(ngrid,nq)260 real zdqadj(ngrid,nlayer mx,nq)261 real zdqc(ngrid,nlayer mx,nq)262 real zdqmr(ngrid,nlayer mx,nq),zdqsurfmr(ngrid,nq)263 real zdqlscale(ngrid,nlayer mx,nq)257 real zdqdif(ngrid,nlayer,nq), zdqsdif(ngrid,nq) 258 real zdqevap(ngrid,nlayer) 259 real zdqsed(ngrid,nlayer,nq), zdqssed(ngrid,nq) 260 real zdqdev(ngrid,nlayer,nq), zdqsdev(ngrid,nq) 261 real zdqadj(ngrid,nlayer,nq) 262 real zdqc(ngrid,nlayer,nq) 263 real zdqmr(ngrid,nlayer,nq),zdqsurfmr(ngrid,nq) 264 real zdqlscale(ngrid,nlayer,nq) 264 265 real zdqslscale(ngrid,nq) 265 real zdqchim(ngrid,nlayer mx,nq)266 real zdqchim(ngrid,nlayer,nq) 266 267 real zdqschim(ngrid,nq) 267 268 268 real zdteuv(ngrid,nlayer mx) ! (K/s)269 real zdtconduc(ngrid,nlayer mx) ! (K/s)270 real zdumolvis(ngrid,nlayer mx)271 real zdvmolvis(ngrid,nlayer mx)272 real zdqmoldiff(ngrid,nlayer mx,nq)269 real zdteuv(ngrid,nlayer) ! (K/s) 270 real zdtconduc(ngrid,nlayer) ! (K/s) 271 real zdumolvis(ngrid,nlayer) 272 real zdvmolvis(ngrid,nlayer) 273 real zdqmoldiff(ngrid,nlayer,nq) 273 274 274 275 ! Local variables for local calculations: 275 276 real zflubid(ngrid) 276 real zplanck(ngrid),zpopsk(ngrid,nlayer mx)277 real zdum1(ngrid,nlayer mx)278 real zdum2(ngrid,nlayer mx)277 real zplanck(ngrid),zpopsk(ngrid,nlayer) 278 real zdum1(ngrid,nlayer) 279 real zdum2(ngrid,nlayer) 279 280 real ztim1,ztim2,ztim3, z1,z2 280 281 real ztime_fin 281 real zdh(ngrid,nlayer mx)282 real zdh(ngrid,nlayer) 282 283 real gmplanet 283 284 real taux(ngrid),tauy(ngrid) … … 288 289 ! local variables only used for diagnostics (output in file "diagfi" or "stats") 289 290 ! ------------------------------------------------------------------------------ 290 real ps(ngrid), zt(ngrid,nlayer mx)291 real zu(ngrid,nlayer mx),zv(ngrid,nlayermx)292 real zq(ngrid,nlayer mx,nq)291 real ps(ngrid), zt(ngrid,nlayer) 292 real zu(ngrid,nlayer),zv(ngrid,nlayer) 293 real zq(ngrid,nlayer,nq) 293 294 character*2 str2 294 295 character*5 str5 295 real zdtadj(ngrid,nlayer mx)296 real zdtdyn(ngrid,nlayer mx)296 real zdtadj(ngrid,nlayer) 297 real zdtdyn(ngrid,nlayer) 297 298 real,allocatable,dimension(:,:),save :: ztprevious 298 real reff(ngrid,nlayer mx) ! effective dust radius (used if doubleq=T)299 real reff(ngrid,nlayer) ! effective dust radius (used if doubleq=T) 299 300 real qtot1,qtot2 ! total aerosol mass 300 301 integer igmin, lmin 301 302 logical tdiag 302 303 303 real zplev(ngrid,nlayer mx+1),zplay(ngrid,nlayermx)304 real zplev(ngrid,nlayer+1),zplay(ngrid,nlayer) 304 305 real zstress(ngrid), cd 305 real hco2(nq), tmean, zlocal(nlayer mx)306 real vmr(ngrid,nlayer mx) ! volume mixing ratio306 real hco2(nq), tmean, zlocal(nlayer) 307 real vmr(ngrid,nlayer) ! volume mixing ratio 307 308 308 309 real time_phys … … 318 319 319 320 ! included by RW for H2O precipitation 320 real zdtrain(ngrid,nlayer mx)321 real zdqrain(ngrid,nlayer mx,nq)321 real zdtrain(ngrid,nlayer) 322 real zdqrain(ngrid,nlayer,nq) 322 323 real zdqsrain(ngrid) 323 324 real zdqssnow(ngrid) … … 325 326 326 327 ! included by RW for H2O Manabe scheme 327 real dtmoist(ngrid,nlayer mx)328 real dqmoist(ngrid,nlayer mx,nq)329 330 real qvap(ngrid,nlayer mx)331 real dqvaplscale(ngrid,nlayer mx)332 real dqcldlscale(ngrid,nlayer mx)333 real rneb_man(ngrid,nlayer mx)334 real rneb_lsc(ngrid,nlayer mx)328 real dtmoist(ngrid,nlayer) 329 real dqmoist(ngrid,nlayer,nq) 330 331 real qvap(ngrid,nlayer) 332 real dqvaplscale(ngrid,nlayer) 333 real dqcldlscale(ngrid,nlayer) 334 real rneb_man(ngrid,nlayer) 335 real rneb_lsc(ngrid,nlayer) 335 336 336 337 ! included by RW to account for surface cooling by evaporation … … 339 340 340 341 ! to test energy conservation (RW+JL) 341 real mass(ngrid,nlayer mx),massarea(ngrid,nlayermx)342 real mass(ngrid,nlayer),massarea(ngrid,nlayer) 342 343 real dEtot, dEtots, AtmToSurf_TurbFlux 343 344 real,save :: dEtotSW, dEtotsSW, dEtotLW, dEtotsLW 344 real dEzRadsw(ngrid,nlayer mx),dEzRadlw(ngrid,nlayermx),dEzdiff(ngrid,nlayermx)345 real dEzRadsw(ngrid,nlayer),dEzRadlw(ngrid,nlayer),dEzdiff(ngrid,nlayer) 345 346 real dEdiffs(ngrid),dEdiff(ngrid) 346 real madjdE(ngrid), lscaledE(ngrid),madjdEz(ngrid,nlayer mx), lscaledEz(ngrid,nlayermx)347 real madjdE(ngrid), lscaledE(ngrid),madjdEz(ngrid,nlayer), lscaledEz(ngrid,nlayer) 347 348 !JL12 conservation test for mean flow kinetic energy has been disabled temporarily 348 349 real dtmoist_max,dtmoist_min … … 351 352 352 353 ! included by BC for evaporation 353 real qevap(ngrid,nlayer mx,nq)354 real tevap(ngrid,nlayer mx)355 real dqevap1(ngrid,nlayer mx)356 real dtevap1(ngrid,nlayer mx)354 real qevap(ngrid,nlayer,nq) 355 real tevap(ngrid,nlayer) 356 real dqevap1(ngrid,nlayer) 357 real dtevap1(ngrid,nlayer) 357 358 358 359 ! included by BC for hydrology … … 367 368 368 369 ! included by RW for RH diagnostic 369 real qsat(ngrid,nlayer mx), RH(ngrid,nlayermx), H2Omaxcol(ngrid),psat_tmp370 real qsat(ngrid,nlayer), RH(ngrid,nlayer), H2Omaxcol(ngrid),psat_tmp 370 371 371 372 ! included by RW for hydrology … … 378 379 ! included by BC for double radiative transfer call 379 380 logical clearsky 380 real zdtsw1(ngrid,nlayer mx)381 real zdtlw1(ngrid,nlayer mx)381 real zdtsw1(ngrid,nlayer) 382 real zdtlw1(ngrid,nlayer) 382 383 real fluxsurf_lw1(ngrid) 383 384 real fluxsurf_sw1(ngrid) … … 402 403 403 404 ! included by RW for temp convadj conservation test 404 real playtest(nlayer mx)405 real plevtest(nlayer mx)406 real ttest(nlayer mx)407 real qtest(nlayer mx)405 real playtest(nlayer) 406 real plevtest(nlayer) 407 real ttest(nlayer) 408 real qtest(nlayer) 408 409 integer igtest 409 410 410 411 ! included by RW for runway greenhouse 1D study 411 real muvar(ngrid,nlayer mx+1)412 real muvar(ngrid,nlayer+1) 412 413 413 414 ! included by RW for variable H2O particle sizes 414 415 real,allocatable,dimension(:,:,:),save :: reffrad ! aerosol effective radius (m) 415 416 real,allocatable,dimension(:,:,:),save :: nueffrad ! aerosol effective radius variance 416 ! real :: nueffrad_dummy(ngrid,nlayer mx,naerkind) !! AS. This is temporary. Check below why.417 real :: reffh2oliq(ngrid,nlayer mx) ! liquid water particles effective radius (m)418 real :: reffh2oice(ngrid,nlayer mx) ! water ice particles effective radius (m)419 ! real reffH2O(ngrid,nlayer mx)417 ! real :: nueffrad_dummy(ngrid,nlayer,naerkind) !! AS. This is temporary. Check below why. 418 real :: reffh2oliq(ngrid,nlayer) ! liquid water particles effective radius (m) 419 real :: reffh2oice(ngrid,nlayer) ! water ice particles effective radius (m) 420 ! real reffH2O(ngrid,nlayer) 420 421 real reffcol(ngrid,naerkind) 421 422 … … 469 470 ALLOCATE(rnat(ngrid)) 470 471 ALLOCATE(emis(ngrid)) 471 ALLOCATE(dtrad(ngrid,nlayer mx))472 ALLOCATE(dtrad(ngrid,nlayer)) 472 473 ALLOCATE(fluxrad_sky(ngrid)) 473 474 ALLOCATE(fluxrad(ngrid)) … … 475 476 ALLOCATE(fluxgrd(ngrid)) 476 477 ALLOCATE(qsurf(ngrid,nq)) 477 ALLOCATE(q2(ngrid,nlayer mx+1))478 ALLOCATE(ztprevious(ngrid,nlayer mx))479 ALLOCATE(cloudfrac(ngrid,nlayer mx))478 ALLOCATE(q2(ngrid,nlayer+1)) 479 ALLOCATE(ztprevious(ngrid,nlayer)) 480 ALLOCATE(cloudfrac(ngrid,nlayer)) 480 481 ALLOCATE(totcloudfrac(ngrid)) 481 482 ALLOCATE(hice(ngrid)) 482 483 ALLOCATE(qsurf_hist(ngrid,nq)) 483 ALLOCATE(reffrad(ngrid,nlayer mx,naerkind))484 ALLOCATE(nueffrad(ngrid,nlayer mx,naerkind))484 ALLOCATE(reffrad(ngrid,nlayer,naerkind)) 485 ALLOCATE(nueffrad(ngrid,nlayer,naerkind)) 485 486 ALLOCATE(ice_initial(ngrid)) 486 487 ALLOCATE(ice_min(ngrid)) … … 494 495 ALLOCATE(OSR_nu(ngrid,L_NSPECTV)) 495 496 ALLOCATE(sensibFlux(ngrid)) 496 ALLOCATE(zdtlw(ngrid,nlayer mx))497 ALLOCATE(zdtsw(ngrid,nlayer mx))497 ALLOCATE(zdtlw(ngrid,nlayer)) 498 ALLOCATE(zdtsw(ngrid,nlayer)) 498 499 ALLOCATE(tau_col(ngrid)) 499 500 ALLOCATE(pctsrf_sic(ngrid)) … … 541 542 ! read startfi (initial parameters) 542 543 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 543 call phyetat0(ngrid, "startfi.nc",0,0,nsoilmx,nq, &544 call phyetat0(ngrid,nlayer,"startfi.nc",0,0,nsoilmx,nq, & 544 545 day_ini,time_phys,tsurf,tsoil,emis,q2,qsurf, & 545 546 cloudfrac,totcloudfrac,hice, & … … 587 588 588 589 589 CALL init_masquv( zmasq)590 CALL init_masquv(ngrid,zmasq) 590 591 591 592 … … 721 722 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 722 723 723 pdu(1:ngrid,1:nlayer mx) = 0.0724 pdv(1:ngrid,1:nlayer mx) = 0.0724 pdu(1:ngrid,1:nlayer) = 0.0 725 pdv(1:ngrid,1:nlayer) = 0.0 725 726 if ( .not.nearco2cond ) then 726 pdt(1:ngrid,1:nlayer mx) = 0.0727 pdt(1:ngrid,1:nlayer) = 0.0 727 728 endif 728 pdq(1:ngrid,1:nlayer mx,1:nq) = 0.0729 pdq(1:ngrid,1:nlayer,1:nq) = 0.0 729 730 pdpsrf(1:ngrid) = 0.0 730 731 zflubid(1:ngrid) = 0.0 … … 773 774 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 774 775 775 zzlay(1:ngrid,1:nlayer mx)=pphi(1:ngrid,1:nlayermx)776 do l=1,nlayer mx776 zzlay(1:ngrid,1:nlayer)=pphi(1:ngrid,1:nlayer) 777 do l=1,nlayer 777 778 zzlay(1:ngrid,l)= zzlay(1:ngrid,l)/glat(1:ngrid) 778 779 enddo … … 892 893 endif 893 894 if(water) then 894 muvar(1:ngrid,1:nlayer mx)=mugaz/(1.e0+(1.e0/epsi-1.e0)*pq(1:ngrid,1:nlayermx,igcm_h2o_vap))895 muvar(1:ngrid,nlayer mx+1)=mugaz/(1.e0+(1.e0/epsi-1.e0)*pq(1:ngrid,nlayermx,igcm_h2o_vap))895 muvar(1:ngrid,1:nlayer)=mugaz/(1.e0+(1.e0/epsi-1.e0)*pq(1:ngrid,1:nlayer,igcm_h2o_vap)) 896 muvar(1:ngrid,nlayer+1)=mugaz/(1.e0+(1.e0/epsi-1.e0)*pq(1:ngrid,nlayer,igcm_h2o_vap)) 896 897 ! take into account water effect on mean molecular weight 897 898 else 898 muvar(1:ngrid,1:nlayer mx+1)=mugaz899 muvar(1:ngrid,1:nlayer+1)=mugaz 899 900 endif 900 901 … … 950 951 tau_col(ig) = ntf*tau_col1(ig) + tf*tau_col(ig) 951 952 952 zdtlw(ig,1:nlayer mx) = ntf*zdtlw1(ig,1:nlayermx) + tf*zdtlw(ig,1:nlayermx)953 zdtsw(ig,1:nlayer mx) = ntf*zdtsw1(ig,1:nlayermx) + tf*zdtsw(ig,1:nlayermx)953 zdtlw(ig,1:nlayer) = ntf*zdtlw1(ig,1:nlayer) + tf*zdtlw(ig,1:nlayer) 954 zdtsw(ig,1:nlayer) = ntf*zdtsw1(ig,1:nlayer) + tf*zdtsw(ig,1:nlayer) 954 955 955 956 OSR_nu(ig,1:L_NSPECTV) = ntf*OSR_nu1(ig,1:L_NSPECTV) + tf*OSR_nu(ig,1:L_NSPECTV) … … 976 977 977 978 ! Net atmospheric radiative heating rate (K.s-1) 978 dtrad(1:ngrid,1:nlayer mx)=zdtsw(1:ngrid,1:nlayermx)+zdtlw(1:ngrid,1:nlayermx)979 dtrad(1:ngrid,1:nlayer)=zdtsw(1:ngrid,1:nlayer)+zdtlw(1:ngrid,1:nlayer) 979 980 980 981 elseif(newtonian)then … … 982 983 ! b) Call Newtonian cooling scheme 983 984 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 984 call newtrelax(ngrid, mu0,sinlat,zpopsk,pt,pplay,pplev,dtrad,firstcall)985 call newtrelax(ngrid,nlayer,mu0,sinlat,zpopsk,pt,pplay,pplev,dtrad,firstcall) 985 986 986 987 zdtsurf(1:ngrid) = +(pt(1:ngrid,1)-tsurf(1:ngrid))/ptimestep … … 1001 1002 1002 1003 1003 dtrad(1:ngrid,1:nlayer mx)=0.01004 dtrad(1:ngrid,1:nlayer)=0.0 1004 1005 ! hence no atmospheric radiative heating 1005 1006 … … 1015 1016 zplanck(1:ngrid)=emis(1:ngrid)*sigma*zplanck(1:ngrid)*zplanck(1:ngrid) 1016 1017 fluxrad(1:ngrid)=fluxrad_sky(1:ngrid)-zplanck(1:ngrid) 1017 pdt(1:ngrid,1:nlayer mx)=pdt(1:ngrid,1:nlayermx)+dtrad(1:ngrid,1:nlayermx)1018 pdt(1:ngrid,1:nlayer)=pdt(1:ngrid,1:nlayer)+dtrad(1:ngrid,1:nlayer) 1018 1019 1019 1020 !------------------------- … … 1048 1049 zflubid(1:ngrid)=fluxrad(1:ngrid)+fluxgrd(1:ngrid) 1049 1050 1050 zdum1(1:ngrid,1:nlayer mx)=0.01051 zdum2(1:ngrid,1:nlayer mx)=0.01051 zdum1(1:ngrid,1:nlayer)=0.0 1052 zdum2(1:ngrid,1:nlayer)=0.0 1052 1053 1053 1054 … … 1066 1067 else 1067 1068 1068 zdh(1:ngrid,1:nlayer mx)=pdt(1:ngrid,1:nlayermx)/zpopsk(1:ngrid,1:nlayermx)1069 zdh(1:ngrid,1:nlayer)=pdt(1:ngrid,1:nlayer)/zpopsk(1:ngrid,1:nlayer) 1069 1070 1070 1071 call vdifc(ngrid,nlayer,nq,rnat,zpopsk, & … … 1077 1078 taux,tauy,lastcall) 1078 1079 1079 zdtdif(1:ngrid,1:nlayer mx)=zdhdif(1:ngrid,1:nlayermx)*zpopsk(1:ngrid,1:nlayermx) ! for diagnostic only1080 zdqevap(1:ngrid,1:nlayer mx)=0.1080 zdtdif(1:ngrid,1:nlayer)=zdhdif(1:ngrid,1:nlayer)*zpopsk(1:ngrid,1:nlayer) ! for diagnostic only 1081 zdqevap(1:ngrid,1:nlayer)=0. 1081 1082 1082 1083 end if !turbdiff 1083 1084 1084 pdv(1:ngrid,1:nlayer mx)=pdv(1:ngrid,1:nlayermx)+zdvdif(1:ngrid,1:nlayermx)1085 pdu(1:ngrid,1:nlayer mx)=pdu(1:ngrid,1:nlayermx)+zdudif(1:ngrid,1:nlayermx)1086 pdt(1:ngrid,1:nlayer mx)=pdt(1:ngrid,1:nlayermx)+zdtdif(1:ngrid,1:nlayermx)1085 pdv(1:ngrid,1:nlayer)=pdv(1:ngrid,1:nlayer)+zdvdif(1:ngrid,1:nlayer) 1086 pdu(1:ngrid,1:nlayer)=pdu(1:ngrid,1:nlayer)+zdudif(1:ngrid,1:nlayer) 1087 pdt(1:ngrid,1:nlayer)=pdt(1:ngrid,1:nlayer)+zdtdif(1:ngrid,1:nlayer) 1087 1088 zdtsurf(1:ngrid)=zdtsurf(1:ngrid)+zdtsdif(1:ngrid) 1088 1089 … … 1094 1095 1095 1096 if (tracer) then 1096 pdq(1:ngrid,1:nlayer mx,1:nq)=pdq(1:ngrid,1:nlayermx,1:nq)+ zdqdif(1:ngrid,1:nlayermx,1:nq)1097 pdq(1:ngrid,1:nlayer,1:nq)=pdq(1:ngrid,1:nlayer,1:nq)+ zdqdif(1:ngrid,1:nlayer,1:nq) 1097 1098 dqsurf(1:ngrid,1:nq)=dqsurf(1:ngrid,1:nq) + zdqsdif(1:ngrid,1:nq) 1098 1099 end if ! of if (tracer) … … 1171 1172 if(calladj) then 1172 1173 1173 zdh(1:ngrid,1:nlayer mx) = pdt(1:ngrid,1:nlayermx)/zpopsk(1:ngrid,1:nlayermx)1174 zduadj(1:ngrid,1:nlayer mx)=0.01175 zdvadj(1:ngrid,1:nlayer mx)=0.01176 zdhadj(1:ngrid,1:nlayer mx)=0.01174 zdh(1:ngrid,1:nlayer) = pdt(1:ngrid,1:nlayer)/zpopsk(1:ngrid,1:nlayer) 1175 zduadj(1:ngrid,1:nlayer)=0.0 1176 zdvadj(1:ngrid,1:nlayer)=0.0 1177 zdhadj(1:ngrid,1:nlayer)=0.0 1177 1178 1178 1179 … … 1184 1185 zdqadj) 1185 1186 1186 pdu(1:ngrid,1:nlayer mx) = pdu(1:ngrid,1:nlayermx) + zduadj(1:ngrid,1:nlayermx)1187 pdv(1:ngrid,1:nlayer mx) = pdv(1:ngrid,1:nlayermx) + zdvadj(1:ngrid,1:nlayermx)1188 pdt(1:ngrid,1:nlayer mx) = pdt(1:ngrid,1:nlayermx) + zdhadj(1:ngrid,1:nlayermx)*zpopsk(1:ngrid,1:nlayermx)1189 zdtadj(1:ngrid,1:nlayer mx) = zdhadj(1:ngrid,1:nlayermx)*zpopsk(1:ngrid,1:nlayermx) ! for diagnostic only1187 pdu(1:ngrid,1:nlayer) = pdu(1:ngrid,1:nlayer) + zduadj(1:ngrid,1:nlayer) 1188 pdv(1:ngrid,1:nlayer) = pdv(1:ngrid,1:nlayer) + zdvadj(1:ngrid,1:nlayer) 1189 pdt(1:ngrid,1:nlayer) = pdt(1:ngrid,1:nlayer) + zdhadj(1:ngrid,1:nlayer)*zpopsk(1:ngrid,1:nlayer) 1190 zdtadj(1:ngrid,1:nlayer) = zdhadj(1:ngrid,1:nlayer)*zpopsk(1:ngrid,1:nlayer) ! for diagnostic only 1190 1191 1191 1192 if(tracer) then 1192 pdq(1:ngrid,1:nlayer mx,1:nq) = pdq(1:ngrid,1:nlayermx,1:nq) + zdqadj(1:ngrid,1:nlayermx,1:nq)1193 pdq(1:ngrid,1:nlayer,1:nq) = pdq(1:ngrid,1:nlayer,1:nq) + zdqadj(1:ngrid,1:nlayer,1:nq) 1193 1194 end if 1194 1195 … … 1240 1241 zdqc) 1241 1242 1242 pdt(1:ngrid,1:nlayer mx)=pdt(1:ngrid,1:nlayermx)+zdtc(1:ngrid,1:nlayermx)1243 pdv(1:ngrid,1:nlayer mx)=pdv(1:ngrid,1:nlayermx)+zdvc(1:ngrid,1:nlayermx)1244 pdu(1:ngrid,1:nlayer mx)=pdu(1:ngrid,1:nlayermx)+zduc(1:ngrid,1:nlayermx)1243 pdt(1:ngrid,1:nlayer)=pdt(1:ngrid,1:nlayer)+zdtc(1:ngrid,1:nlayer) 1244 pdv(1:ngrid,1:nlayer)=pdv(1:ngrid,1:nlayer)+zdvc(1:ngrid,1:nlayer) 1245 pdu(1:ngrid,1:nlayer)=pdu(1:ngrid,1:nlayer)+zduc(1:ngrid,1:nlayer) 1245 1246 zdtsurf(1:ngrid) = zdtsurf(1:ngrid) + zdtsurfc(1:ngrid) 1246 1247 1247 pdq(1:ngrid,1:nlayer mx,1:nq)=pdq(1:ngrid,1:nlayermx,1:nq)+ zdqc(1:ngrid,1:nlayermx,1:nq)1248 pdq(1:ngrid,1:nlayer,1:nq)=pdq(1:ngrid,1:nlayer,1:nq)+ zdqc(1:ngrid,1:nlayer,1:nq) 1248 1249 ! Note: we do not add surface co2ice tendency 1249 1250 ! because qsurf(:,igcm_co2_ice) is updated in condens_co2cloud … … 1283 1284 ! ---------------- 1284 1285 1285 dqmoist(1:ngrid,1:nlayer mx,1:nq)=0.1286 dtmoist(1:ngrid,1:nlayer mx)=0.1287 1288 call moistadj(ngrid,n q,pt,pq,pdq,pplev,pplay,dtmoist,dqmoist,ptimestep,rneb_man)1289 1290 pdq(1:ngrid,1:nlayer mx,igcm_h2o_vap) = pdq(1:ngrid,1:nlayermx,igcm_h2o_vap) &1291 +dqmoist(1:ngrid,1:nlayer mx,igcm_h2o_vap)1292 pdq(1:ngrid,1:nlayer mx,igcm_h2o_ice) =pdq(1:ngrid,1:nlayermx,igcm_h2o_ice) &1293 +dqmoist(1:ngrid,1:nlayer mx,igcm_h2o_ice)1294 pdt(1:ngrid,1:nlayer mx) = pdt(1:ngrid,1:nlayermx)+dtmoist(1:ngrid,1:nlayermx)1286 dqmoist(1:ngrid,1:nlayer,1:nq)=0. 1287 dtmoist(1:ngrid,1:nlayer)=0. 1288 1289 call moistadj(ngrid,nlayer,nq,pt,pq,pdq,pplev,pplay,dtmoist,dqmoist,ptimestep,rneb_man) 1290 1291 pdq(1:ngrid,1:nlayer,igcm_h2o_vap) = pdq(1:ngrid,1:nlayer,igcm_h2o_vap) & 1292 +dqmoist(1:ngrid,1:nlayer,igcm_h2o_vap) 1293 pdq(1:ngrid,1:nlayer,igcm_h2o_ice) =pdq(1:ngrid,1:nlayer,igcm_h2o_ice) & 1294 +dqmoist(1:ngrid,1:nlayer,igcm_h2o_ice) 1295 pdt(1:ngrid,1:nlayer) = pdt(1:ngrid,1:nlayer)+dtmoist(1:ngrid,1:nlayer) 1295 1296 1296 1297 !------------------------- … … 1321 1322 ! Large scale condensation/evaporation 1322 1323 ! -------------------------------- 1323 call largescale(ngrid,n q,ptimestep,pplev,pplay,pt,pq,pdt,pdq,dtlscale,dqvaplscale,dqcldlscale,rneb_lsc)1324 1325 pdt(1:ngrid,1:nlayer mx) = pdt(1:ngrid,1:nlayermx)+dtlscale(1:ngrid,1:nlayermx)1326 pdq(1:ngrid,1:nlayer mx,igcm_h2o_vap) = pdq(1:ngrid,1:nlayermx,igcm_h2o_vap)+dqvaplscale(1:ngrid,1:nlayermx)1327 pdq(1:ngrid,1:nlayer mx,igcm_h2o_ice) = pdq(1:ngrid,1:nlayermx,igcm_h2o_ice)+dqcldlscale(1:ngrid,1:nlayermx)1324 call largescale(ngrid,nlayer,nq,ptimestep,pplev,pplay,pt,pq,pdt,pdq,dtlscale,dqvaplscale,dqcldlscale,rneb_lsc) 1325 1326 pdt(1:ngrid,1:nlayer) = pdt(1:ngrid,1:nlayer)+dtlscale(1:ngrid,1:nlayer) 1327 pdq(1:ngrid,1:nlayer,igcm_h2o_vap) = pdq(1:ngrid,1:nlayer,igcm_h2o_vap)+dqvaplscale(1:ngrid,1:nlayer) 1328 pdq(1:ngrid,1:nlayer,igcm_h2o_ice) = pdq(1:ngrid,1:nlayer,igcm_h2o_ice)+dqcldlscale(1:ngrid,1:nlayer) 1328 1329 1329 1330 !------------------------- … … 1363 1364 if(waterrain)then 1364 1365 1365 zdqrain(1:ngrid,1:nlayer mx,1:nq) = 0.01366 zdqrain(1:ngrid,1:nlayer,1:nq) = 0.0 1366 1367 zdqsrain(1:ngrid) = 0.0 1367 1368 zdqssnow(1:ngrid) = 0.0 … … 1370 1371 zdtrain,zdqrain,zdqsrain,zdqssnow,cloudfrac) 1371 1372 1372 pdq(1:ngrid,1:nlayer mx,igcm_h2o_vap) = pdq(1:ngrid,1:nlayermx,igcm_h2o_vap) &1373 +zdqrain(1:ngrid,1:nlayer mx,igcm_h2o_vap)1374 pdq(1:ngrid,1:nlayer mx,igcm_h2o_ice) = pdq(1:ngrid,1:nlayermx,igcm_h2o_ice) &1375 +zdqrain(1:ngrid,1:nlayer mx,igcm_h2o_ice)1376 pdt(1:ngrid,1:nlayer mx) = pdt(1:ngrid,1:nlayermx)+zdtrain(1:ngrid,1:nlayermx)1373 pdq(1:ngrid,1:nlayer,igcm_h2o_vap) = pdq(1:ngrid,1:nlayer,igcm_h2o_vap) & 1374 +zdqrain(1:ngrid,1:nlayer,igcm_h2o_vap) 1375 pdq(1:ngrid,1:nlayer,igcm_h2o_ice) = pdq(1:ngrid,1:nlayer,igcm_h2o_ice) & 1376 +zdqrain(1:ngrid,1:nlayer,igcm_h2o_ice) 1377 pdt(1:ngrid,1:nlayer) = pdt(1:ngrid,1:nlayer)+zdtrain(1:ngrid,1:nlayer) 1377 1378 dqsurf(1:ngrid,igcm_h2o_vap) = dqsurf(1:ngrid,igcm_h2o_vap)+zdqsrain(1:ngrid) ! a bug was here 1378 1379 dqsurf(1:ngrid,igcm_h2o_ice) = dqsurf(1:ngrid,igcm_h2o_ice)+zdqssnow(1:ngrid) … … 1419 1420 ! ------------- 1420 1421 if (sedimentation) then 1421 zdqsed(1:ngrid,1:nlayer mx,1:nq) = 0.01422 zdqsed(1:ngrid,1:nlayer,1:nq) = 0.0 1422 1423 zdqssed(1:ngrid,1:nq) = 0.0 1423 1424 … … 1455 1456 ! and as in rain.F90, whether it falls as rain or snow depends 1456 1457 ! only on the surface temperature 1457 pdq(1:ngrid,1:nlayer mx,1:nq) = pdq(1:ngrid,1:nlayermx,1:nq) + zdqsed(1:ngrid,1:nlayermx,1:nq)1458 pdq(1:ngrid,1:nlayer,1:nq) = pdq(1:ngrid,1:nlayer,1:nq) + zdqsed(1:ngrid,1:nlayer,1:nq) 1458 1459 dqsurf(1:ngrid,1:nq) = dqsurf(1:ngrid,1:nq) + zdqssed(1:ngrid,1:nq) 1459 1460 … … 1483 1484 if(mass_redistrib) then 1484 1485 1485 zdmassmr(1:ngrid,1:nlayer mx) = mass(1:ngrid,1:nlayermx) * &1486 ( zdqevap(1:ngrid,1:nlayer mx) &1487 + zdqrain(1:ngrid,1:nlayer mx,igcm_h2o_vap) &1488 + dqmoist(1:ngrid,1:nlayer mx,igcm_h2o_vap) &1489 + dqvaplscale(1:ngrid,1:nlayer mx) )1486 zdmassmr(1:ngrid,1:nlayer) = mass(1:ngrid,1:nlayer) * & 1487 ( zdqevap(1:ngrid,1:nlayer) & 1488 + zdqrain(1:ngrid,1:nlayer,igcm_h2o_vap) & 1489 + dqmoist(1:ngrid,1:nlayer,igcm_h2o_vap) & 1490 + dqvaplscale(1:ngrid,1:nlayer) ) 1490 1491 1491 1492 do ig = 1, ngrid 1492 zdmassmr_col(ig)=SUM(zdmassmr(ig,1:nlayer mx))1493 zdmassmr_col(ig)=SUM(zdmassmr(ig,1:nlayer)) 1493 1494 enddo 1494 1495 … … 1503 1504 1504 1505 1505 pdq(1:ngrid,1:nlayer mx,1:nq) = pdq(1:ngrid,1:nlayermx,1:nq) + zdqmr(1:ngrid,1:nlayermx,1:nq)1506 pdq(1:ngrid,1:nlayer,1:nq) = pdq(1:ngrid,1:nlayer,1:nq) + zdqmr(1:ngrid,1:nlayer,1:nq) 1506 1507 dqsurf(1:ngrid,1:nq) = dqsurf(1:ngrid,1:nq) + zdqsurfmr(1:ngrid,1:nq) 1507 pdt(1:ngrid,1:nlayer mx) = pdt(1:ngrid,1:nlayermx) + zdtmr(1:ngrid,1:nlayermx)1508 pdu(1:ngrid,1:nlayer mx) = pdu(1:ngrid,1:nlayermx) + zdumr(1:ngrid,1:nlayermx)1509 pdv(1:ngrid,1:nlayer mx) = pdv(1:ngrid,1:nlayermx) + zdvmr(1:ngrid,1:nlayermx)1508 pdt(1:ngrid,1:nlayer) = pdt(1:ngrid,1:nlayer) + zdtmr(1:ngrid,1:nlayer) 1509 pdu(1:ngrid,1:nlayer) = pdu(1:ngrid,1:nlayer) + zdumr(1:ngrid,1:nlayer) 1510 pdv(1:ngrid,1:nlayer) = pdv(1:ngrid,1:nlayer) + zdvmr(1:ngrid,1:nlayer) 1510 1511 pdpsrf(1:ngrid) = pdpsrf(1:ngrid) + zdpsrfmr(1:ngrid) 1511 1512 zdtsurf(1:ngrid) = zdtsurf(1:ngrid) + zdtsurfmr(1:ngrid) 1512 1513 1513 ! print*,'after mass redistrib, q=',pq(211,1:nlayer mx,igcm_h2o_vap)+ptimestep*pdq(211,1:nlayermx,igcm_h2o_vap)1514 ! print*,'after mass redistrib, q=',pq(211,1:nlayer,igcm_h2o_vap)+ptimestep*pdq(211,1:nlayer,igcm_h2o_vap) 1514 1515 endif 1515 1516 … … 1672 1673 1673 1674 ! temperature, zonal and meridional wind 1674 zt(1:ngrid,1:nlayer mx) = pt(1:ngrid,1:nlayermx) + pdt(1:ngrid,1:nlayermx)*ptimestep1675 zu(1:ngrid,1:nlayer mx) = pu(1:ngrid,1:nlayermx) + pdu(1:ngrid,1:nlayermx)*ptimestep1676 zv(1:ngrid,1:nlayer mx) = pv(1:ngrid,1:nlayermx) + pdv(1:ngrid,1:nlayermx)*ptimestep1675 zt(1:ngrid,1:nlayer) = pt(1:ngrid,1:nlayer) + pdt(1:ngrid,1:nlayer)*ptimestep 1676 zu(1:ngrid,1:nlayer) = pu(1:ngrid,1:nlayer) + pdu(1:ngrid,1:nlayer)*ptimestep 1677 zv(1:ngrid,1:nlayer) = pv(1:ngrid,1:nlayer) + pdv(1:ngrid,1:nlayer)*ptimestep 1677 1678 1678 1679 ! diagnostic 1679 zdtdyn(1:ngrid,1:nlayer mx) = pt(1:ngrid,1:nlayermx)-ztprevious(1:ngrid,1:nlayermx)1680 ztprevious(1:ngrid,1:nlayer mx) = zt(1:ngrid,1:nlayermx)1680 zdtdyn(1:ngrid,1:nlayer) = pt(1:ngrid,1:nlayer)-ztprevious(1:ngrid,1:nlayer) 1681 ztprevious(1:ngrid,1:nlayer) = zt(1:ngrid,1:nlayer) 1681 1682 1682 1683 if(firstcall)then 1683 zdtdyn(1:ngrid,1:nlayer mx)=0.01684 zdtdyn(1:ngrid,1:nlayer)=0.0 1684 1685 endif 1685 1686 … … 1690 1691 1691 1692 ! tracers 1692 zq(1:ngrid,1:nlayer mx,1:nq) = pq(1:ngrid,1:nlayermx,1:nq) + pdq(1:ngrid,1:nlayermx,1:nq)*ptimestep1693 zq(1:ngrid,1:nlayer,1:nq) = pq(1:ngrid,1:nlayer,1:nq) + pdq(1:ngrid,1:nlayer,1:nq)*ptimestep 1693 1694 1694 1695 ! surface pressure … … 1798 1799 do iq=1,nq 1799 1800 do ig=1,ngrid 1800 qcol(ig,iq) = SUM( zq(ig,1:nlayer mx,iq) * mass(ig,1:nlayermx))1801 qcol(ig,iq) = SUM( zq(ig,1:nlayer,iq) * mass(ig,1:nlayer)) 1801 1802 enddo 1802 1803 enddo … … 1805 1806 reffcol(1:ngrid,1:naerkind)=0.0 1806 1807 if(co2cond.and.(iaero_co2.ne.0))then 1807 call co2_reffrad(ngrid,n q,zq,reffrad(1,1,iaero_co2))1808 call co2_reffrad(ngrid,nlayer,nq,zq,reffrad(1,1,iaero_co2)) 1808 1809 do ig=1,ngrid 1809 reffcol(ig,iaero_co2) = SUM(zq(ig,1:nlayer mx,igcm_co2_ice)*reffrad(ig,1:nlayermx,iaero_co2)*mass(ig,1:nlayermx))1810 reffcol(ig,iaero_co2) = SUM(zq(ig,1:nlayer,igcm_co2_ice)*reffrad(ig,1:nlayer,iaero_co2)*mass(ig,1:nlayer)) 1810 1811 enddo 1811 1812 endif 1812 1813 if(water.and.(iaero_h2o.ne.0))then 1813 call h2o_reffrad(ngrid, zq(1,1,igcm_h2o_ice),zt, &1814 call h2o_reffrad(ngrid,nlayer,zq(1,1,igcm_h2o_ice),zt, & 1814 1815 reffrad(1,1,iaero_h2o),nueffrad(1,1,iaero_h2o)) 1815 1816 do ig=1,ngrid 1816 reffcol(ig,iaero_h2o) = SUM(zq(ig,1:nlayer mx,igcm_h2o_ice)*reffrad(ig,1:nlayermx,iaero_h2o)*mass(ig,1:nlayermx))1817 reffcol(ig,iaero_h2o) = SUM(zq(ig,1:nlayer,igcm_h2o_ice)*reffrad(ig,1:nlayer,iaero_h2o)*mass(ig,1:nlayer)) 1817 1818 enddo 1818 1819 endif … … 1989 1990 end do 1990 1991 if (water) then 1991 vmr=zq(1:ngrid,1:nlayer mx,igcm_h2o_vap)*mugaz/mmol(igcm_h2o_vap)1992 vmr=zq(1:ngrid,1:nlayer,igcm_h2o_vap)*mugaz/mmol(igcm_h2o_vap) 1992 1993 call wstats(ngrid,"vmr_h2ovapor", & 1993 1994 "H2O vapour volume mixing ratio","mol/mol", & -
trunk/LMDZ.GENERIC/libf/phystd/planete_mod.F90
r1304 r1308 1 !----------------------------------------------------------------------- 2 ! INCLUDE planet.h 3 4 COMMON/planet/apoastr,periastr,year_day,peri_day, & 5 & obliquit,nres, & 6 & z0,lmixmin,emin_turb,coefvis,coefir, & 7 & timeperi,e_elips,p_elips 8 9 real apoastr,periastr,year_day,peri_day, & 10 & obliquit,nres, & 11 & z0,lmixmin,emin_turb,coefvis,coefir, & 12 & timeperi,e_elips,p_elips 13 14 15 !----------------------------------------------------------------------- 1 MODULE planete_mod 2 IMPLICIT NONE 3 4 REAL :: apoastr ! maximum star-planet distance (AU) 5 REAL :: periastr ! minimum star-planet distance (AU) 6 REAL :: year_day ! length of year (sols) 7 REAL :: peri_day ! date of periastron (sols since N. spring) 8 REAL :: obliquit ! Obliquity of the planet (deg) 9 REAL :: nres ! tidal resonance ratio 10 REAL :: z0 ! surface roughness (m) 11 REAL :: lmixmin ! mixing length 12 REAL :: emin_turb ! minimal energy 13 REAL :: coefvis 14 REAL :: coefir 15 REAL :: timeperi 16 REAL :: e_elips 17 REAL :: p_elips 18 19 REAL :: preff ! reference surface pressure (Pa) 20 REAL,ALLOCATABLE :: ap(:) ! hybrid coordinate at layer interface 21 REAL,ALLOCATABLE :: bp(:) ! hybrid coordinate at layer interface 22 23 CONTAINS 24 25 subroutine ini_planete_mod(nlayer,preff_dyn,ap_dyn,bp_dyn) 26 27 implicit none 28 integer,intent(in) :: nlayer ! number of atmospheric layers 29 real,intent(in) :: preff_dyn ! reference surface pressure (Pa) 30 real,intent(in) :: ap_dyn(nlayer+1) ! hybrid coordinate at interfaces 31 real,intent(in) :: bp_dyn(nlayer+1) ! hybrid coordinate at interfaces 32 33 allocate(ap(nlayer+1)) 34 allocate(bp(nlayer+1)) 35 36 preff=preff_dyn 37 ap(:)=ap_dyn(:) 38 bp(:)=bp_dyn(:) 39 40 end subroutine ini_planete_mod 41 42 END MODULE planete_mod -
trunk/LMDZ.GENERIC/libf/phystd/radii_mod.F90
r1283 r1308 20 20 21 21 !================================================================== 22 subroutine su_aer_radii(ngrid, reffrad,nueffrad)22 subroutine su_aer_radii(ngrid,nlayer,reffrad,nueffrad) 23 23 !================================================================== 24 24 ! Purpose … … 39 39 40 40 include "callkeys.h" 41 include "dimensions.h" 42 include "dimphys.h" 43 44 integer,intent(in) :: ngrid 45 46 real, intent(out) :: reffrad(ngrid,nlayermx,naerkind) !aerosols radii (K) 47 real, intent(out) :: nueffrad(ngrid,nlayermx,naerkind) !variance 41 ! include "dimensions.h" 42 ! include "dimphys.h" 43 44 integer,intent(in) :: ngrid 45 integer,intent(in) :: nlayer 46 47 real, intent(out) :: reffrad(ngrid,nlayer,naerkind) !aerosols radii (K) 48 real, intent(out) :: nueffrad(ngrid,nlayer,naerkind) !variance 48 49 49 50 logical, save :: firstcall=.true. … … 58 59 59 60 if(iaer.eq.iaero_co2)then ! CO2 ice 60 reffrad(1:ngrid,1:nlayer mx,iaer) = 1.e-461 nueffrad(1:ngrid,1:nlayer mx,iaer) = 0.161 reffrad(1:ngrid,1:nlayer,iaer) = 1.e-4 62 nueffrad(1:ngrid,1:nlayer,iaer) = 0.1 62 63 endif 63 64 64 65 if(iaer.eq.iaero_h2o)then ! H2O ice 65 reffrad(1:ngrid,1:nlayer mx,iaer) = 1.e-566 nueffrad(1:ngrid,1:nlayer mx,iaer) = 0.166 reffrad(1:ngrid,1:nlayer,iaer) = 1.e-5 67 nueffrad(1:ngrid,1:nlayer,iaer) = 0.1 67 68 endif 68 69 69 70 if(iaer.eq.iaero_dust)then ! dust 70 reffrad(1:ngrid,1:nlayer mx,iaer) = 1.e-571 nueffrad(1:ngrid,1:nlayer mx,iaer) = 0.171 reffrad(1:ngrid,1:nlayer,iaer) = 1.e-5 72 nueffrad(1:ngrid,1:nlayer,iaer) = 0.1 72 73 endif 73 74 74 75 if(iaer.eq.iaero_h2so4)then ! H2O ice 75 reffrad(1:ngrid,1:nlayer mx,iaer) = 1.e-676 nueffrad(1:ngrid,1:nlayer mx,iaer) = 0.176 reffrad(1:ngrid,1:nlayer,iaer) = 1.e-6 77 nueffrad(1:ngrid,1:nlayer,iaer) = 0.1 77 78 endif 78 79 79 80 if(iaer.eq.iaero_back2lay)then ! Two-layer aerosols 80 reffrad(1:ngrid,1:nlayer mx,iaer) = 2.e-681 nueffrad(1:ngrid,1:nlayer mx,iaer) = 0.181 reffrad(1:ngrid,1:nlayer,iaer) = 2.e-6 82 nueffrad(1:ngrid,1:nlayer,iaer) = 0.1 82 83 endif 83 84 … … 126 127 127 128 !================================================================== 128 subroutine h2o_reffrad(ngrid, pq,pt,reffrad,nueffrad)129 subroutine h2o_reffrad(ngrid,nlayer,pq,pt,reffrad,nueffrad) 129 130 !================================================================== 130 131 ! Purpose … … 141 142 142 143 include "callkeys.h" 143 include "dimensions.h"144 include "dimphys.h"144 ! include "dimensions.h" 145 ! include "dimphys.h" 145 146 include "comcstfi.h" 146 147 147 148 integer,intent(in) :: ngrid 148 149 real, intent(in) :: pq(ngrid,nlayermx) !water ice mixing ratios (kg/kg) 150 real, intent(in) :: pt(ngrid,nlayermx) !temperature (K) 151 real, intent(out) :: reffrad(ngrid,nlayermx) !aerosol radii 152 real, intent(out) :: nueffrad(ngrid,nlayermx) ! dispersion 149 integer,intent(in) :: nlayer 150 151 real, intent(in) :: pq(ngrid,nlayer) !water ice mixing ratios (kg/kg) 152 real, intent(in) :: pt(ngrid,nlayer) !temperature (K) 153 real, intent(out) :: reffrad(ngrid,nlayer) !aerosol radii 154 real, intent(out) :: nueffrad(ngrid,nlayer) ! dispersion 153 155 154 156 integer :: ig,l … … 158 160 159 161 if (radfixed) then 160 do l=1,nlayer mx162 do l=1,nlayer 161 163 do ig=1,ngrid 162 164 zfice = 1.0 - (pt(ig,l)-T_h2O_ice_clouds) / (T_h2O_ice_liq-T_h2O_ice_clouds) … … 167 169 enddo 168 170 else 169 do l=1,nlayer mx171 do l=1,nlayer 170 172 do ig=1,ngrid 171 173 zfice = 1.0 - (pt(ig,l)-T_h2O_ice_clouds) / (T_h2O_ice_liq-T_h2O_ice_clouds) … … 186 188 187 189 !================================================================== 188 subroutine h2o_cloudrad(ngrid, pql,reffliq,reffice)190 subroutine h2o_cloudrad(ngrid,nlayer,pql,reffliq,reffice) 189 191 !================================================================== 190 192 ! Purpose … … 201 203 202 204 include "callkeys.h" 203 include "dimensions.h"204 include "dimphys.h"205 ! include "dimensions.h" 206 ! include "dimphys.h" 205 207 include "comcstfi.h" 206 208 207 209 integer,intent(in) :: ngrid 208 209 real, intent(in) :: pql(ngrid,nlayermx) !condensed water mixing ratios (kg/kg) 210 real, intent(out) :: reffliq(ngrid,nlayermx),reffice(ngrid,nlayermx) !liquid and ice water particle radii (m) 210 integer,intent(in) :: nlayer 211 212 real, intent(in) :: pql(ngrid,nlayer) !condensed water mixing ratios (kg/kg) 213 real, intent(out) :: reffliq(ngrid,nlayer),reffice(ngrid,nlayer) !liquid and ice water particle radii (m) 211 214 212 215 real,external :: CBRT … … 214 217 215 218 if (radfixed) then 216 reffliq(1:ngrid,1:nlayer mx)= rad_h2o217 reffice(1:ngrid,1:nlayer mx)= rad_h2o_ice219 reffliq(1:ngrid,1:nlayer)= rad_h2o 220 reffice(1:ngrid,1:nlayer)= rad_h2o_ice 218 221 else 219 do k=1,nlayer mx222 do k=1,nlayer 220 223 do i=1,ngrid 221 224 reffliq(i,k) = CBRT(3*pql(i,k)/(4*Nmix_h2o*pi*rhowater)) … … 234 237 235 238 !================================================================== 236 subroutine co2_reffrad(ngrid,n q,pq,reffrad)239 subroutine co2_reffrad(ngrid,nlayer,nq,pq,reffrad) 237 240 !================================================================== 238 241 ! Purpose … … 249 252 250 253 include "callkeys.h" 251 include "dimensions.h"252 include "dimphys.h"254 ! include "dimensions.h" 255 ! include "dimphys.h" 253 256 include "comcstfi.h" 254 257 255 integer,intent(in) :: ngrid,n q256 257 real, intent(in) :: pq(ngrid,nlayer mx,nq) !tracer mixing ratios (kg/kg)258 real, intent(out) :: reffrad(ngrid,nlayer mx) !co2 ice particles radii (K)258 integer,intent(in) :: ngrid,nlayer,nq 259 260 real, intent(in) :: pq(ngrid,nlayer,nq) !tracer mixing ratios (kg/kg) 261 real, intent(out) :: reffrad(ngrid,nlayer) !co2 ice particles radii (m) 259 262 260 263 integer :: ig,l … … 265 268 266 269 if (radfixed) then 267 reffrad(1:ngrid,1:nlayer mx) = 5.e-5 ! CO2 ice270 reffrad(1:ngrid,1:nlayer) = 5.e-5 ! CO2 ice 268 271 else 269 do l=1,nlayer mx272 do l=1,nlayer 270 273 do ig=1,ngrid 271 274 zrad = CBRT( 3*pq(ig,l,igcm_co2_ice)/(4*Nmix_co2*pi*rho_co2) ) … … 281 284 282 285 !================================================================== 283 subroutine dust_reffrad(ngrid, reffrad)286 subroutine dust_reffrad(ngrid,nlayer,reffrad) 284 287 !================================================================== 285 288 ! Purpose … … 294 297 Implicit none 295 298 296 include "callkeys.h" 297 include "dimensions.h" 298 include "dimphys.h" 299 300 integer,intent(in) :: ngrid 301 302 real, intent(out) :: reffrad(ngrid,nlayermx) !dust particles radii (K) 299 ! include "callkeys.h" 300 ! include "dimensions.h" 301 ! include "dimphys.h" 302 303 integer,intent(in) :: ngrid 304 integer,intent(in) :: nlayer 305 306 real, intent(out) :: reffrad(ngrid,nlayer) !dust particles radii (m) 303 307 304 reffrad(1:ngrid,1:nlayer mx) = 2.e-6 ! dust308 reffrad(1:ngrid,1:nlayer) = 2.e-6 ! dust 305 309 306 310 end subroutine dust_reffrad … … 309 313 310 314 !================================================================== 311 subroutine h2so4_reffrad(ngrid, reffrad)315 subroutine h2so4_reffrad(ngrid,nlayer,reffrad) 312 316 !================================================================== 313 317 ! Purpose … … 322 326 Implicit none 323 327 324 include "callkeys.h" 325 include "dimensions.h" 326 include "dimphys.h" 327 328 integer,intent(in) :: ngrid 329 330 real, intent(out) :: reffrad(ngrid,nlayermx) !h2so4 particle radii (K) 328 ! include "callkeys.h" 329 ! include "dimensions.h" 330 ! include "dimphys.h" 331 332 integer,intent(in) :: ngrid 333 integer,intent(in) :: nlayer 334 335 real, intent(out) :: reffrad(ngrid,nlayer) !h2so4 particle radii (m) 331 336 332 reffrad(1:ngrid,1:nlayer mx) = 1.e-6 ! h2so4337 reffrad(1:ngrid,1:nlayer) = 1.e-6 ! h2so4 333 338 334 339 end subroutine h2so4_reffrad … … 352 357 353 358 include "callkeys.h" 354 include "dimensions.h"355 include "dimphys.h"356 357 integer,intent(in) :: ngrid 358 359 real, intent(out) :: reffrad(ngrid,nlayer mx) ! particle radii359 ! include "dimensions.h" 360 ! include "dimphys.h" 361 362 integer,intent(in) :: ngrid 363 364 real, intent(out) :: reffrad(ngrid,nlayer) ! particle radii (m) 360 365 REAL,INTENT(IN) :: pplev(ngrid,nlayer+1) ! inter-layer pressure (Pa) 361 366 INTEGER,INTENT(IN) :: nlayer ! number of atmospheric layers -
trunk/LMDZ.GENERIC/libf/phystd/rain.F90
r1304 r1308 1 subroutine rain(ngrid,n q,ptimestep,pplev,pplay,t,pdt,pq,pdq,d_t,dqrain,dqsrain,dqssnow,rneb)1 subroutine rain(ngrid,nlayer,nq,ptimestep,pplev,pplay,t,pdt,pq,pdq,d_t,dqrain,dqsrain,dqssnow,rneb) 2 2 3 3 … … 22 22 !================================================================== 23 23 24 include "dimensions.h"25 include "dimphys.h"24 ! include "dimensions.h" 25 ! include "dimphys.h" 26 26 include "comcstfi.h" 27 27 include "callkeys.h" 28 28 29 29 ! Arguments 30 integer,intent(in) :: ngrid ! number of atmospherci columns 30 integer,intent(in) :: ngrid ! number of atmospheric columns 31 integer,intent(in) :: nlayer ! number of atmospheric layers 31 32 integer,intent(in) :: nq ! number of tracers 32 33 real,intent(in) :: ptimestep ! time interval 33 real,intent(in) :: pplev(ngrid,nlayer mx+1) ! inter-layer pressure (Pa)34 real,intent(in) :: pplay(ngrid,nlayer mx) ! mid-layer pressure (Pa)35 real,intent(in) :: t(ngrid,nlayer mx) ! input temperature (K)36 real,intent(in) :: pdt(ngrid,nlayer mx) ! input tendency on temperature (K/s)37 real,intent(in) :: pq(ngrid,nlayer mx,nq) ! tracers (kg/kg)38 real,intent(in) :: pdq(ngrid,nlayer mx,nq) ! input tendency on tracers39 real,intent(out) :: d_t(ngrid,nlayer mx) ! temperature tendency (K/s)40 real,intent(out) :: dqrain(ngrid,nlayer mx,nq) ! tendency of H2O precipitation (kg/kg.s-1)34 real,intent(in) :: pplev(ngrid,nlayer+1) ! inter-layer pressure (Pa) 35 real,intent(in) :: pplay(ngrid,nlayer) ! mid-layer pressure (Pa) 36 real,intent(in) :: t(ngrid,nlayer) ! input temperature (K) 37 real,intent(in) :: pdt(ngrid,nlayer) ! input tendency on temperature (K/s) 38 real,intent(in) :: pq(ngrid,nlayer,nq) ! tracers (kg/kg) 39 real,intent(in) :: pdq(ngrid,nlayer,nq) ! input tendency on tracers 40 real,intent(out) :: d_t(ngrid,nlayer) ! temperature tendency (K/s) 41 real,intent(out) :: dqrain(ngrid,nlayer,nq) ! tendency of H2O precipitation (kg/kg.s-1) 41 42 real,intent(out) :: dqsrain(ngrid) ! rain flux at the surface (kg.m-2.s-1) 42 43 real,intent(out) :: dqssnow(ngrid) ! snow flux at the surface (kg.m-2.s-1) 43 real,intent(in) :: rneb(ngrid,nlayer mx) ! cloud fraction44 45 REAL zt(ngrid,nlayer mx) ! working temperature (K)46 REAL ql(ngrid,nlayer mx) ! liquid water (Kg/Kg)47 REAL q(ngrid,nlayer mx) ! specific humidity (Kg/Kg)48 REAL d_q(ngrid,nlayer mx) ! water vapor increment49 REAL d_ql(ngrid,nlayer mx) ! liquid water / ice increment44 real,intent(in) :: rneb(ngrid,nlayer) ! cloud fraction 45 46 REAL zt(ngrid,nlayer) ! working temperature (K) 47 REAL ql(ngrid,nlayer) ! liquid water (Kg/Kg) 48 REAL q(ngrid,nlayer) ! specific humidity (Kg/Kg) 49 REAL d_q(ngrid,nlayer) ! water vapor increment 50 REAL d_ql(ngrid,nlayer) ! liquid water / ice increment 50 51 51 52 ! Subroutine options … … 73 74 ! Local variables 74 75 INTEGER i, k, n 75 REAL zqs(ngrid,nlayer mx),Tsat(ngrid,nlayermx), zdelta, zcor76 REAL zqs(ngrid,nlayer),Tsat(ngrid,nlayer), zdelta, zcor 76 77 REAL zrfl(ngrid), zrfln(ngrid), zqev, zqevt 77 78 … … 80 81 REAL zchau(ngrid),zfroi(ngrid),zfrac(ngrid),zneb(ngrid) 81 82 82 real reffh2oliq(ngrid,nlayer mx),reffh2oice(ngrid,nlayermx)83 real reffh2oliq(ngrid,nlayer),reffh2oice(ngrid,nlayer) 83 84 84 85 real ttemp, ptemp, psat_tmp 85 real tnext(ngrid,nlayer mx)86 87 real l2c(ngrid,nlayer mx)86 real tnext(ngrid,nlayer) 87 88 real l2c(ngrid,nlayer) 88 89 real dWtot 89 90 … … 151 152 152 153 ! GCM -----> subroutine variables 153 DO k = 1, nlayer mx154 DO k = 1, nlayer 154 155 DO i = 1, ngrid 155 156 … … 172 173 173 174 ! Initialise the outputs 174 d_t(1:ngrid,1:nlayer mx) = 0.0175 d_q(1:ngrid,1:nlayer mx) = 0.0176 d_ql(1:ngrid,1:nlayer mx) = 0.0175 d_t(1:ngrid,1:nlayer) = 0.0 176 d_q(1:ngrid,1:nlayer) = 0.0 177 d_ql(1:ngrid,1:nlayer) = 0.0 177 178 zrfl(1:ngrid) = 0.0 178 179 zrfln(1:ngrid) = 0.0 179 180 180 181 ! calculate saturation mixing ratio 181 DO k = 1, nlayer mx182 DO k = 1, nlayer 182 183 DO i = 1, ngrid 183 184 ttemp = zt(i,k) … … 190 191 191 192 ! get column / layer conversion factor 192 DO k = 1, nlayer mx193 DO k = 1, nlayer 193 194 DO i = 1, ngrid 194 195 l2c(i,k)=(pplev(i,k)-pplev(i,k+1))/g … … 199 200 ! We carry the rain with us and calculate that added by warm/cold precipitation 200 201 ! processes and that subtracted by evaporation at each level. 201 DO k = nlayer mx, 1, -1202 DO k = nlayer, 1, -1 202 203 203 204 IF (evap_prec) THEN ! note no rneb dependence! … … 273 274 274 275 !recalculate liquid water particle radii 275 call h2o_cloudrad(ngrid, ql,reffh2oliq,reffh2oice)276 call h2o_cloudrad(ngrid,nlayer,ql,reffh2oliq,reffh2oice) 276 277 277 278 SELECT CASE(precip_scheme) … … 357 358 endif ! if precip_scheme=1 358 359 359 ENDDO ! of DO k = nlayer mx, 1, -1360 ENDDO ! of DO k = nlayer, 1, -1 360 361 361 362 ! Rain or snow on the ground … … 376 377 ! now subroutine -----> GCM variables 377 378 if (evap_prec) then 378 dqrain(1:ngrid,1:nlayer mx,i_vap)=d_q(1:ngrid,1:nlayermx)/ptimestep379 d_t(1:ngrid,1:nlayer mx)=d_t(1:ngrid,1:nlayermx)/ptimestep379 dqrain(1:ngrid,1:nlayer,i_vap)=d_q(1:ngrid,1:nlayer)/ptimestep 380 d_t(1:ngrid,1:nlayer)=d_t(1:ngrid,1:nlayer)/ptimestep 380 381 else 381 dqrain(1:ngrid,1:nlayer mx,i_vap)=0.0382 d_t(1:ngrid,1:nlayer mx)=0.0382 dqrain(1:ngrid,1:nlayer,i_vap)=0.0 383 d_t(1:ngrid,1:nlayer)=0.0 383 384 endif 384 dqrain(1:ngrid,1:nlayer mx,i_ice) = d_ql(1:ngrid,1:nlayermx)/ptimestep385 dqrain(1:ngrid,1:nlayer,i_ice) = d_ql(1:ngrid,1:nlayer)/ptimestep 385 386 386 387 end subroutine rain -
trunk/LMDZ.GENERIC/libf/phystd/rcm1d.F
r1303 r1308 16 16 use comgeomphy, only: initcomgeomphy 17 17 use slab_ice_h, only: noceanmx 18 use planete_mod 18 19 19 20 implicit none … … 45 46 #include "dimensions.h" 46 47 #include "paramet.h" 47 #include "dimphys.h"48 !include "dimphys.h" 48 49 #include "callkeys.h" 49 50 #include "comcstfi.h" 50 #include "planete.h"51 !#include "planete.h" 51 52 !#include "control.h" 52 53 #include "comvert.h" … … 67 68 REAL day ! date durant le run 68 69 REAL time ! time (0<time<1 ; time=0.5 a midi) 69 REAL play( nlayermx) ! Pressure at the middle of the layers (Pa)70 REAL plev( nlayermx+1) ! intermediate pressure levels (pa)70 REAL play(llm) ! Pressure at the middle of the layers (Pa) 71 REAL plev(llm+1) ! intermediate pressure levels (pa) 71 72 REAL psurf,tsurf(1) 72 REAL u( nlayermx),v(nlayermx) ! zonal, meridional wind73 REAL u(llm),v(llm) ! zonal, meridional wind 73 74 REAL gru,grv ! prescribed "geostrophic" background wind 74 REAL temp( nlayermx) ! temperature at the middle of the layers75 REAL temp(llm) ! temperature at the middle of the layers 75 76 REAL,ALLOCATABLE :: q(:,:) ! tracer mixing ratio (e.g. kg/kg) 76 77 REAL,ALLOCATABLE :: qsurf(:) ! tracer surface budget (e.g. kg.m-2) … … 81 82 integer :: i_h2o_vap=0 ! tracer index of h2o vapor 82 83 REAL emis(1) ! surface layer 83 REAL q2( nlayermx+1) ! Turbulent Kinetic Energy84 REAL zlay( nlayermx) ! altitude estimee dans les couches (km)84 REAL q2(llm+1) ! Turbulent Kinetic Energy 85 REAL zlay(llm) ! altitude estimee dans les couches (km) 85 86 86 87 c Physical and dynamical tandencies (e.g. m.s-2, K/s, Pa/s) 87 REAL du( nlayermx),dv(nlayermx),dtemp(nlayermx)88 REAL dudyn( nlayermx),dvdyn(nlayermx),dtempdyn(nlayermx)88 REAL du(llm),dv(llm),dtemp(llm) 89 REAL dudyn(llm),dvdyn(llm),dtempdyn(llm) 89 90 REAL dpsurf 90 91 REAL,ALLOCATABLE :: dq(:,:) … … 94 95 ! INTEGER thermo 95 96 REAL zls 96 REAL phi( nlayermx),h(nlayermx),s(nlayermx)97 REAL pks, ptif, w( nlayermx)97 REAL phi(llm),h(llm),s(llm) 98 REAL pks, ptif, w(llm) 98 99 INTEGER ierr, aslun 99 REAL tmp1(0: nlayermx),tmp2(0:nlayermx)100 REAL tmp1(0:llm),tmp2(0:llm) 100 101 Logical tracerdyn 101 102 integer :: nq !=1 ! number of tracers … … 111 112 ! added by RW for autozlevs computation 112 113 real nu, xx, pMIN, zlev, Htop 113 real logplevs( nlayermx)114 real logplevs(llm) 114 115 115 116 ! added by BC 116 REAL cloudfrac(1, nlayermx)117 REAL cloudfrac(1,llm) 117 118 REAL hice(1),totcloudfrac(1) 118 119 REAL qzero1D !initial water amount on the ground … … 253 254 if (nq>0) then 254 255 allocate(tname(nq)) 255 allocate(q( nlayermx,nq))256 allocate(q(llm,nq)) 256 257 allocate(qsurf(nq)) 257 allocate(dq( nlayermx,nq))258 allocate(dqdyn( nlayermx,nq))258 allocate(dq(llm,nq)) 259 allocate(dqdyn(llm,nq)) 259 260 else 260 261 write(*,*) "rcm1d: Error. You set tracer=.true." … … 298 299 allocate(tname(1)) 299 300 allocate(qsurf(1)) 300 allocate(q( nlayermx,1))301 allocate(dq( nlayermx,1))301 allocate(q(llm,1)) 302 allocate(dq(llm,1)) 302 303 303 304 ! Check that tracer boolean is compliant with number of tracers … … 484 485 c -------------- 485 486 c 486 nlayer= nlayermx487 nlayer=llm 487 488 nlevel=nlayer+1 488 489 nsoil=nsoilmx … … 890 891 OPEN(12,file='profile.out',form='formatted') 891 892 write(12,*) tsurf 892 DO ilayer=1, nlayermx893 DO ilayer=1,llm 893 894 write(12,*) temp(ilayer) !, play(ilayer) !AS12 only temp so that iprofile=8 can be used 894 895 ENDDO -
trunk/LMDZ.GENERIC/libf/phystd/soil.F
r1216 r1308 17 17 !----------------------------------------------------------------------- 18 18 19 include "dimensions.h"20 include "dimphys.h"19 ! include "dimensions.h" 20 ! include "dimphys.h" 21 21 22 22 -
trunk/LMDZ.GENERIC/libf/phystd/start2archive.F
r1297 r1308 27 27 ! to use 'getin' 28 28 USE ioipsl_getincom 29 USE planete_mod 29 30 30 31 implicit none 31 32 32 33 #include "dimensions.h" 34 integer, parameter :: ngridmx = (2+(jjm-1)*iim - 1/jjm) 33 35 #include "paramet.h" 34 36 #include "comconst.h" … … 41 43 #include "ener.h" 42 44 43 #include "dimphys.h"44 #include "planete.h"45 !#include "dimphys.h" 46 !#include "planete.h" 45 47 !#include"advtrac.h" 46 48 #include "netcdf.inc" … … 69 71 REAL tsoil(ngridmx,nsoilmx) ! Soil temperature 70 72 REAL co2ice(ngridmx) ! CO2 ice layer 71 REAL q2(ngridmx, nlayermx+1)73 REAL q2(ngridmx,llm+1) 72 74 REAL,ALLOCATABLE :: qsurf(:,:) 73 75 REAL emis(ngridmx) … … 80 82 ! added by FF for cloud fraction setup 81 83 REAL hice(ngridmx) 82 REAL cloudfrac(ngridmx, nlayermx),totalcloudfrac(ngridmx)84 REAL cloudfrac(ngridmx,llm),totalcloudfrac(ngridmx) 83 85 84 86 ! added by BC for slab ocean … … 199 201 200 202 201 CALL phyetat0 (ngridmx, fichnom,0,Lmodif,nsoilmx,nqtot,day_ini_fi,202 . timefi,203 CALL phyetat0 (ngridmx,llm,fichnom,0,Lmodif,nsoilmx,nqtot, 204 . day_ini_fi,timefi, 203 205 . tsurf,tsoil,emis,q2,qsurf, 204 206 ! change FF 05/2011 -
trunk/LMDZ.GENERIC/libf/phystd/stellarlong.F
r590 r1308 1 1 SUBROUTINE stellarlong(pday,pstellong) 2 3 USE planete_mod, ONLY: year_day, peri_day, e_elips, timeperi 2 4 IMPLICIT NONE 3 5 … … 40 42 c ------------- 41 43 42 #include "planete.h"44 !#include "planete.h" 43 45 #include "comcstfi.h" 44 46 -
trunk/LMDZ.GENERIC/libf/phystd/surf_heat_transp_mod.F90
r1298 r1308 7 7 CONTAINS 8 8 9 SUBROUTINE divgrad_phy(n levs,temp,delta)9 SUBROUTINE divgrad_phy(ngrid,nlevs,temp,delta) 10 10 11 11 … … 14 14 15 15 #include "dimensions.h" 16 #include "dimphys.h"16 !#include "dimphys.h" 17 17 #include "paramet.h" 18 18 #include "comcstfi.h" … … 20 20 #include "comhdiff.h" 21 21 22 INTEGER nlevs, ll 23 REAL temp(ngridmx,nlevs) 22 INTEGER,INTENT(IN) :: ngrid, nlevs 23 REAL,INTENT(IN) :: temp(ngrid,nlevs) 24 REAL,INTENT(OUT) :: delta(ngrid,nlevs) 24 25 REAL delta_2d(ip1jmp1,nlevs) 25 REAL delta(ngridmx,nlevs)26 INTEGER :: ll 26 27 REAL ghx(ip1jmp1,nlevs), ghy(ip1jm,nlevs) 27 28 28 29 29 CALL gr_fi_dyn(nlevs,ngrid mx,iip1,jjp1,temp,delta_2d)30 CALL gr_fi_dyn(nlevs,ngrid,iip1,jjp1,temp,delta_2d) 30 31 CALL grad(nlevs,delta_2d,ghx,ghy) 31 32 DO ll=1,nlevs … … 36 37 END DO 37 38 CALL diverg(nlevs,ghx,ghy,delta_2d) 38 CALL gr_dyn_fi(nlevs,iip1,jjp1,ngrid mx,delta_2d,delta)39 CALL gr_dyn_fi(nlevs,iip1,jjp1,ngrid,delta_2d,delta) 39 40 40 41 … … 43 44 44 45 45 SUBROUTINE init_masquv( zmasq)46 SUBROUTINE init_masquv(ngrid,zmasq) 46 47 47 48 IMPLICIT NONE 48 49 49 50 #include "dimensions.h" 50 #include "dimphys.h"51 !#include "dimphys.h" 51 52 #include "paramet.h" 52 53 #include "comcstfi.h" … … 55 56 56 57 57 REAL zmasq(ngridmx) 58 INTEGER,INTENT(IN) :: ngrid 59 REAL zmasq(ngrid) 58 60 REAL zmasq_2d(ip1jmp1) 59 61 REAL ff(ip1jm) … … 66 68 zmasqv=1. 67 69 68 CALL gr_fi_dyn(1,ngrid mx,iip1,jjp1,zmasq,zmasq_2d)70 CALL gr_fi_dyn(1,ngrid,iip1,jjp1,zmasq,zmasq_2d) 69 71 70 72 DO i=1,ip1jmp1-1 … … 104 106 105 107 106 SUBROUTINE slab_ekman2( tx_phy,ty_phy,ts_phy,dt_phy)108 SUBROUTINE slab_ekman2(ngrid,tx_phy,ty_phy,ts_phy,dt_phy) 107 109 108 110 use slab_ice_h … … 111 113 112 114 #include "dimensions.h" 113 #include "dimphys.h"115 !#include "dimphys.h" 114 116 #include "paramet.h" 115 117 #include "comcstfi.h" … … 118 120 #include "comhdiff.h" 119 121 122 INTEGER,INTENT(IN) :: ngrid 120 123 INTEGER ij 121 124 REAL txv(ip1jm),fluxm(ip1jm),tyv(ip1jm) … … 123 126 REAL tyu(ip1jmp1),txu(ip1jmp1),fluxz(ip1jmp1),fluxv(ip1jmp1) 124 127 REAL dt(ip1jmp1,noceanmx),ts(ip1jmp1,noceanmx) 125 REAL tx_phy(ngrid mx),ty_phy(ngridmx)126 REAL dt_phy(ngrid mx,noceanmx),ts_phy(ngridmx,noceanmx)128 REAL tx_phy(ngrid),ty_phy(ngrid) 129 REAL dt_phy(ngrid,noceanmx),ts_phy(ngrid,noceanmx) 127 130 128 131 … … 130 133 131 134 ! Passage taux,y sur grilles 2d 132 CALL gr_fi_dyn(1,ngrid mx,iip1,jjp1,tx_phy,txu)133 CALL gr_fi_dyn(1,ngrid mx,iip1,jjp1,ty_phy,tyu)135 CALL gr_fi_dyn(1,ngrid,iip1,jjp1,tx_phy,txu) 136 CALL gr_fi_dyn(1,ngrid,iip1,jjp1,ty_phy,tyu) 134 137 ! Passage grille u,v 135 138 ! Multiplication par f ou eps. … … 144 147 145 148 ! Calcul de T, Tdeep 146 CALL gr_fi_dyn(2,ngrid mx,iip1,jjp1,ts_phy,ts)149 CALL gr_fi_dyn(2,ngrid,iip1,jjp1,ts_phy,ts) 147 150 148 151 ! Flux de masse … … 222 225 223 226 ! Retour grille physique 224 CALL gr_dyn_fi(2,iip1,jjp1,ngrid mx,dt,dt_phy)227 CALL gr_dyn_fi(2,iip1,jjp1,ngrid,dt,dt_phy) 225 228 226 229 -
trunk/LMDZ.GENERIC/libf/phystd/surface_nature.F
r787 r1308 33 33 !================================================================== 34 34 35 #include "dimensions.h"36 #include "dimphys.h"35 !#include "dimensions.h" 36 !#include "dimphys.h" 37 37 #include "comcstfi.h" 38 38 #include "callkeys.h" -
trunk/LMDZ.GENERIC/libf/phystd/surfini.F
r1216 r1308 15 15 c Declarations: 16 16 c ------------- 17 #include "dimensions.h"18 #include "dimphys.h"17 !#include "dimensions.h" 18 !#include "dimphys.h" 19 19 #include "callkeys.h" 20 20 c -
trunk/LMDZ.GENERIC/libf/phystd/tabfi.F
r1216 r1308 34 34 c comparer avec le day_ini dynamique) 35 35 c 36 c - lmax: tab_cntrl(tab0+2) (pour test avec nlayer mx)36 c - lmax: tab_cntrl(tab0+2) (pour test avec nlayer) 37 37 c 38 38 c - p_rad … … 51 51 use iostart, only: get_var 52 52 use mod_phys_lmdz_para, only: is_parallel 53 use planete_mod, only: year_day, periastr, apoastr, peri_day, 54 & obliquit, z0, lmixmin, emin_turb 53 55 54 56 implicit none 55 57 56 58 #include "comcstfi.h" 57 #include "planete.h"59 !#include "planete.h" 58 60 #include "netcdf.inc" 59 61 #include "callkeys.h" -
trunk/LMDZ.GENERIC/libf/phystd/totalcloudfrac.F90
r858 r1308 1 subroutine totalcloudfrac(ngrid,n q,rneb,totalrneb,pplev,pq,tau)1 subroutine totalcloudfrac(ngrid,nlayer,nq,rneb,totalrneb,pplev,pq,tau) 2 2 3 3 use watercommon_h … … 19 19 !================================================================== 20 20 21 #include "dimensions.h"22 #include "dimphys.h"21 !#include "dimensions.h" 22 !#include "dimphys.h" 23 23 #include "comcstfi.h" 24 24 #include "callkeys.h" 25 25 26 26 integer,intent(in) :: ngrid ! number of atmospheric columns 27 integer,intent(in) :: nlayer ! number of atmospheric layers 27 28 integer,intent(in) :: nq ! number of tracers 28 real,intent(in) :: rneb(ngrid,nlayer mx) ! cloud fraction29 real,intent(in) :: rneb(ngrid,nlayer) ! cloud fraction 29 30 real,intent(out) :: totalrneb(ngrid) ! total cloud fraction 30 real,intent(in) :: pplev(ngrid,nlayer mx+1) ! inter-layer pressure (Pa)31 real,intent(in) :: pq(ngrid,nlayer mx,nq) ! tracers (.../kg_of_air)32 real,intent(in) :: tau(ngrid,nlayer mx)31 real,intent(in) :: pplev(ngrid,nlayer+1) ! inter-layer pressure (Pa) 32 real,intent(in) :: pq(ngrid,nlayer,nq) ! tracers (.../kg_of_air) 33 real,intent(in) :: tau(ngrid,nlayer) 33 34 34 real, dimension(nlayer mx+1) :: masse35 real, dimension(nlayer+1) :: masse 35 36 integer, parameter :: recovery=7 36 37 integer ltau_max … … 47 48 real clear,tau_min 48 49 real, parameter :: tau_c=0.1 !threshold of optical depth for the calculation of total cloud fraction 49 real rneb2(nlayer mx)50 real rneb2(nlayer) 50 51 51 52 … … 55 56 if (recovery.eq.1) then 56 57 clear = (1.-rneb(ig,1)) 57 do l=2,nlayer mx58 do l=2,nlayer 58 59 clear = clear*(1.-rneb(ig,l)) 59 60 enddo … … 62 63 elseif (recovery.eq.2) then 63 64 totalrneb(ig) = rneb(ig,1) 64 do l=2,14 !nlayer mx65 do l=2,14 !nlayer 65 66 totalrneb(ig) = max(rneb(ig,l),totalrneb(ig)) 66 67 enddo … … 68 69 elseif (recovery.eq.3) then 69 70 totalrneb(ig) = rneb(ig,1) 70 do l=2,nlayer mx71 do l=2,nlayer 71 72 totalrneb(ig) = min(rneb(ig,l),totalrneb(ig)) 72 73 enddo … … 77 78 elseif (recovery.eq.5) then 78 79 totalrneb(ig) = rneb(ig,1) 79 do l=1,nlayer mx80 do l=1,nlayer 80 81 masse(l)=pq(ig,l,igcm_h2o_ice)*(pplev(ig,l)-pplev(ig,l+1)) 81 82 enddo … … 85 86 elseif (recovery.eq.6) then 86 87 totalrneb(ig) = 0. 87 do l=1,nlayer mx88 do l=1,nlayer 88 89 masse(l)=pq(ig,l,igcm_h2o_ice)*(pplev(ig,l)-pplev(ig,l+1)) 89 90 masse(l)=max(masse(l),0.) 90 91 enddo 91 92 massetot=sum(masse,dim=1) 92 do l=1,nlayer mx93 do l=1,nlayer 93 94 totalrneb(ig) = totalrneb(ig)+rneb(ig,l)*masse(l)/massetot 94 95 enddo … … 96 97 elseif (recovery.eq.7) then 97 98 98 rneb2(:)=rneb(ig,1:nlayer mx)99 tau_min=MIN(tau_c,MAXVAL(tau(ig,1:nlayer mx))/2.)100 do l=1,nlayer mx99 rneb2(:)=rneb(ig,1:nlayer) 100 tau_min=MIN(tau_c,MAXVAL(tau(ig,1:nlayer))/2.) 101 do l=1,nlayer 101 102 if(tau(ig,l)<tau_min) rneb2(l)=0. 102 103 enddo 103 totalrneb(ig)=maxval(rneb2(1:nlayer mx))104 totalrneb(ig)=maxval(rneb2(1:nlayer)) 104 105 105 106 endif ! (recovery=) -
trunk/LMDZ.GENERIC/libf/phystd/turbdiff.F90
r1297 r1308 41 41 ! ------------ 42 42 43 include "dimensions.h"44 include "dimphys.h"43 ! include "dimensions.h" 44 ! include "dimphys.h" 45 45 include "comcstfi.h" 46 46 include "callkeys.h" … … 48 48 ! arguments 49 49 ! --------- 50 INTEGER,INTENT(IN) :: ngrid,nlay 50 INTEGER,INTENT(IN) :: ngrid 51 INTEGER,INTENT(IN) :: nlay 51 52 REAL,INTENT(IN) :: ptimestep 52 53 REAL,INTENT(IN) :: pplay(ngrid,nlay),pplev(ngrid,nlay+1) … … 86 87 87 88 REAL z4st,zdplanck(ngrid) 88 REAL zkv(ngrid,nlay ermx+1),zkh(ngrid,nlayermx+1)89 REAL zkv(ngrid,nlay+1),zkh(ngrid,nlay+1) 89 90 REAL zcdv(ngrid),zcdh(ngrid) 90 91 REAL zcdv_true(ngrid),zcdh_true(ngrid) 91 REAL zu(ngrid,nlay ermx),zv(ngrid,nlayermx)92 REAL zh(ngrid,nlay ermx),zt(ngrid,nlayermx)92 REAL zu(ngrid,nlay),zv(ngrid,nlay) 93 REAL zh(ngrid,nlay),zt(ngrid,nlay) 93 94 REAL ztsrf(ngrid) 94 95 REAL z1(ngrid),z2(ngrid) 95 REAL zmass(ngrid,nlay ermx)96 REAL zfluxv(ngrid,nlay ermx),zfluxt(ngrid,nlayermx),zfluxq(ngrid,nlayermx)97 REAL zb0(ngrid,nlay ermx)98 REAL zExner(ngrid,nlay ermx),zovExner(ngrid,nlayermx)99 REAL zcv(ngrid,nlay ermx),zdv(ngrid,nlayermx) !inversion coefficient for winds100 REAL zct(ngrid,nlay ermx),zdt(ngrid,nlayermx) !inversion coefficient for temperature101 REAL zcq(ngrid,nlay ermx),zdq(ngrid,nlayermx) !inversion coefficient for tracers96 REAL zmass(ngrid,nlay) 97 REAL zfluxv(ngrid,nlay),zfluxt(ngrid,nlay),zfluxq(ngrid,nlay) 98 REAL zb0(ngrid,nlay) 99 REAL zExner(ngrid,nlay),zovExner(ngrid,nlay) 100 REAL zcv(ngrid,nlay),zdv(ngrid,nlay) !inversion coefficient for winds 101 REAL zct(ngrid,nlay),zdt(ngrid,nlay) !inversion coefficient for temperature 102 REAL zcq(ngrid,nlay),zdq(ngrid,nlay) !inversion coefficient for tracers 102 103 REAL zcst1 103 104 REAL zu2!, a … … 110 111 ! ------- 111 112 INTEGER iq 112 REAL zq(ngrid,nlay ermx,nq)113 REAL zqnoevap(ngrid,nlay ermx) !special for water case to compute where evaporated water goes.114 REAL pdqevap(ngrid,nlay ermx) !special for water case to compute where evaporated water goes.113 REAL zq(ngrid,nlay,nq) 114 REAL zqnoevap(ngrid,nlay) !special for water case to compute where evaporated water goes. 115 REAL pdqevap(ngrid,nlay) !special for water case to compute where evaporated water goes. 115 116 REAL zdmassevap(ngrid) 116 117 REAL rho(ngrid) ! near-surface air density … … 241 242 ! ------------------------------------------------------ 242 243 243 call vdif_kc(ngrid, ptimestep,g,pzlev,pzlay,pu,pv,zh,zcdv_true,pq2,zkv,zkh) !JL12 why not call vdif_kc with updated winds and temperature244 call vdif_kc(ngrid,nlay,ptimestep,g,pzlev,pzlay,pu,pv,zh,zcdv_true,pq2,zkv,zkh) !JL12 why not call vdif_kc with updated winds and temperature 244 245 245 246 ! Adding eddy mixing to mimic 3D general circulation in 1D … … 262 263 263 264 !JL12 calculate the flux coefficients (tables multiplied elements by elements) 264 zfluxv(1:ngrid,1:nlay ermx)=zkv(1:ngrid,1:nlayermx)*zb0(1:ngrid,1:nlayermx)265 zfluxv(1:ngrid,1:nlay)=zkv(1:ngrid,1:nlay)*zb0(1:ngrid,1:nlay) 265 266 266 267 !----------------------------------------------------------------------- … … 364 365 ! JL12 calculate the flux coefficients (tables multiplied elements by elements) 365 366 ! --------------------------------------------------------------- 366 zfluxq(1:ngrid,1:nlay ermx)=zkh(1:ngrid,1:nlayermx)*zb0(1:ngrid,1:nlayermx) !JL12 we save zfluxq which doesn't need the Exner factor367 zfluxt(1:ngrid,1:nlay ermx)=zfluxq(1:ngrid,1:nlayermx)*zExner(1:ngrid,1:nlayermx)367 zfluxq(1:ngrid,1:nlay)=zkh(1:ngrid,1:nlay)*zb0(1:ngrid,1:nlay) !JL12 we save zfluxq which doesn't need the Exner factor 368 zfluxt(1:ngrid,1:nlay)=zfluxq(1:ngrid,1:nlay)*zExner(1:ngrid,1:nlay) 368 369 369 370 DO ig=1,ngrid -
trunk/LMDZ.GENERIC/libf/phystd/vdif_kc.F
r1283 r1308 1 SUBROUTINE vdif_kc(ngrid, dt,g,zlev,zlay,u,v,teta,cd,q2,km,kn)1 SUBROUTINE vdif_kc(ngrid,nlay,dt,g,zlev,zlay,u,v,teta,cd,q2,km,kn) 2 2 IMPLICIT NONE 3 3 c....................................................................... 4 #include "dimensions.h"5 #include "dimphys.h"4 !#include "dimensions.h" 5 !#include "dimphys.h" 6 6 c....................................................................... 7 7 c … … 28 28 c....................................................................... 29 29 INTEGER,INTENT(IN) :: ngrid 30 INTEGER,INTENT(IN) :: nlay 30 31 REAL,INTENT(IN) :: dt,g 31 REAL,INTENT(IN) :: zlev(ngrid,nlay ermx+1)32 REAL,INTENT(IN) :: zlay(ngrid,nlay ermx)33 REAL,INTENT(IN) :: u(ngrid,nlay ermx)34 REAL,INTENT(IN) :: v(ngrid,nlay ermx)35 REAL,INTENT(IN) :: teta(ngrid,nlay ermx)32 REAL,INTENT(IN) :: zlev(ngrid,nlay+1) 33 REAL,INTENT(IN) :: zlay(ngrid,nlay) 34 REAL,INTENT(IN) :: u(ngrid,nlay) 35 REAL,INTENT(IN) :: v(ngrid,nlay) 36 REAL,INTENT(IN) :: teta(ngrid,nlay) 36 37 REAL,INTENT(IN) :: cd(ngrid) 37 REAL,INTENT(INOUT) :: q2(ngrid,nlay ermx+1)38 REAL,INTENT(OUT) :: km(ngrid,nlay ermx+1)39 REAL,INTENT(OUT) :: kn(ngrid,nlay ermx+1)38 REAL,INTENT(INOUT) :: q2(ngrid,nlay+1) 39 REAL,INTENT(OUT) :: km(ngrid,nlay+1) 40 REAL,INTENT(OUT) :: kn(ngrid,nlay+1) 40 41 c....................................................................... 41 42 c … … 50 51 c 51 52 c....................................................................... 52 INTEGER,PARAMETER :: nlay=nlayermx 53 INTEGER,PARAMETER :: nlev=nlayermx+1 54 REAL unsdz(ngrid,nlayermx) 55 REAL unsdzdec(ngrid,nlayermx+1) 56 REAL q(ngrid,nlayermx+1) 53 INTEGER :: nlev 54 REAL unsdz(ngrid,nlay) 55 REAL unsdzdec(ngrid,nlay+1) 56 REAL q(ngrid,nlay+1) 57 57 c....................................................................... 58 58 c … … 64 64 c 65 65 c....................................................................... 66 REAL kmpre(ngrid,nlay ermx+1)66 REAL kmpre(ngrid,nlay+1) 67 67 REAL qcstat 68 68 REAL q2cstat … … 72 72 c 73 73 c....................................................................... 74 REAL long(ngrid,nlay ermx+1)74 REAL long(ngrid,nlay+1) 75 75 c....................................................................... 76 76 c … … 95 95 REAL mcstat 96 96 REAL m2cstat 97 REAL m(ngrid,nlay ermx+1)98 REAL mpre(ngrid,nlay ermx+1)99 REAL m2(ngrid,nlay ermx+1)100 REAL n2(ngrid,nlay ermx+1)97 REAL m(ngrid,nlay+1) 98 REAL mpre(ngrid,nlay+1) 99 REAL m2(ngrid,nlay+1) 100 REAL n2(ngrid,nlay+1) 101 101 c....................................................................... 102 102 c … … 120 120 LOGICAL gnsup 121 121 REAL gm 122 c REAL ri(ngrid,nlaye rmx+1)123 REAL sn(ngrid,nlay ermx+1)124 REAL snq2(ngrid,nlay ermx+1)125 REAL sm(ngrid,nlay ermx+1)126 REAL smq2(ngrid,nlay ermx+1)122 c REAL ri(ngrid,nlaye+1) 123 REAL sn(ngrid,nlay+1) 124 REAL snq2(ngrid,nlay+1) 125 REAL sm(ngrid,nlay+1) 126 REAL smq2(ngrid,nlay+1) 127 127 c....................................................................... 128 128 c … … 179 179 180 180 ! initialization of local variables: 181 nlev=nlay+1 181 182 long(:,:)=0. 182 183 n2(:,:)=0. -
trunk/LMDZ.GENERIC/libf/phystd/vdifc.F
r1297 r1308 38 38 ! ------------ 39 39 40 #include "dimensions.h"41 #include "dimphys.h"40 !#include "dimensions.h" 41 !#include "dimphys.h" 42 42 #include "comcstfi.h" 43 43 #include "callkeys.h" … … 77 77 78 78 REAL z4st,zdplanck(ngrid) 79 REAL zkv(ngrid,nlay ermx+1),zkh(ngrid,nlayermx+1)79 REAL zkv(ngrid,nlay+1),zkh(ngrid,nlay+1) 80 80 REAL zcdv(ngrid),zcdh(ngrid) 81 81 REAL zcdv_true(ngrid),zcdh_true(ngrid) 82 REAL zu(ngrid,nlay ermx),zv(ngrid,nlayermx)83 REAL zh(ngrid,nlay ermx)82 REAL zu(ngrid,nlay),zv(ngrid,nlay) 83 REAL zh(ngrid,nlay) 84 84 REAL ztsrf2(ngrid) 85 85 REAL z1(ngrid),z2(ngrid) 86 REAL za(ngrid,nlay ermx),zb(ngrid,nlayermx)87 REAL zb0(ngrid,nlay ermx)88 REAL zc(ngrid,nlay ermx),zd(ngrid,nlayermx)86 REAL za(ngrid,nlay),zb(ngrid,nlay) 87 REAL zb0(ngrid,nlay) 88 REAL zc(ngrid,nlay),zd(ngrid,nlay) 89 89 REAL zcst1 90 90 REAL zu2!, a 91 REAL zcq(ngrid,nlay ermx),zdq(ngrid,nlayermx)91 REAL zcq(ngrid,nlay),zdq(ngrid,nlay) 92 92 REAL evap(ngrid) 93 93 REAL zcq0(ngrid),zdq0(ngrid) … … 101 101 ! variables added for CO2 condensation 102 102 ! ------------------------------------ 103 REAL hh !, zhcond(ngrid,nlay ermx)103 REAL hh !, zhcond(ngrid,nlay) 104 104 ! REAL latcond,tcond1mb 105 105 ! REAL acond,bcond … … 110 110 ! ------- 111 111 INTEGER iq 112 REAL zq(ngrid,nlay ermx,nq)112 REAL zq(ngrid,nlay,nq) 113 113 REAL zq1temp(ngrid) 114 114 REAL rho(ngrid) ! near-surface air density … … 123 123 real z1_T(ngrid), z2_T(ngrid) 124 124 real zb_T(ngrid) 125 real zc_T(ngrid,nlay ermx)126 real zd_T(ngrid,nlay ermx)125 real zc_T(ngrid,nlay) 126 real zd_T(ngrid,nlay) 127 127 real lat1(ngrid), lat2(ngrid) 128 128 real surfh2otot … … 249 249 ! ------------------------------------------------------ 250 250 251 call vdif_kc(ngrid, ptimestep,g,pzlev,pzlay251 call vdif_kc(ngrid,nlay,ptimestep,g,pzlev,pzlay 252 252 & ,pu,pv,ph,zcdv_true 253 253 & ,pq2,zkv,zkh) -
trunk/LMDZ.GENERIC/libf/phystd/vlz_fi.F
r787 r1308 1 SUBROUTINE vlz_fi(ngrid, q,pente_max,masse,w,wq)1 SUBROUTINE vlz_fi(ngrid,nlayer,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 ngrid26 real masse(ngrid,llm),pente_max27 REAL q(ngrid,llm)28 REAL w(ngrid,llm)29 REAL wq(ngrid,llm+1)25 integer,intent(in) :: ngrid, nlayer 26 real,intent(in) :: masse(ngrid,nlayer),pente_max 27 REAL,INTENT(INOUT) :: q(ngrid,nlayer) 28 REAL,INTENT(INOUT) :: w(ngrid,nlayer) 29 REAL,INTENT(OUT) :: wq(ngrid,nlayer+1) 30 30 c 31 31 c Local … … 35 35 c 36 36 37 real dzq(ngrid,llm),dzqw(ngrid,llm),adzqw(ngrid,llm),dzqmax 37 real dzq(ngrid,nlayer),dzqw(ngrid,nlayer),adzqw(ngrid,nlayer) 38 real 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,nlayer 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,nlayer-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,nlayer)=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,nlayer+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,nlayer ! 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.nlayer)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.nlayer)goto 88 115 116 end do 116 117 88 continue 117 if (m.lt. llm) then118 if (m.lt.nlayer) 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,nlayer-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,nlayer 179 180 do ij=1,ngrid 180 181 … … 191 192 192 193 193 194 return195 194 end -
trunk/LMDZ.GENERIC/libf/phystd/writediagspecIR.F
r1216 r1308 54 54 ! Commons 55 55 #include "dimensions.h" 56 #include "dimphys.h"56 !#include "dimphys.h" 57 57 #include "paramet.h" 58 58 !#include "control.h" -
trunk/LMDZ.GENERIC/libf/phystd/writediagspecVI.F
r1216 r1308 54 54 ! Commons 55 55 #include "dimensions.h" 56 #include "dimphys.h"56 !#include "dimphys.h" 57 57 #include "paramet.h" 58 58 !#include "control.h" -
trunk/LMDZ.GENERIC/libf/phystd/wstats.F90
r1216 r1308 7 7 8 8 #include "dimensions.h" 9 #include "dimphys.h"9 !#include "dimphys.h" 10 10 #include "comconst.h" 11 11 #include "statto.h" … … 293 293 294 294 include "dimensions.h" 295 include "dimphys.h"295 !include "dimphys.h" 296 296 include "netcdf.inc" 297 297
Note: See TracChangeset
for help on using the changeset viewer.