Changeset 1538 for trunk/LMDZ.GENERIC
- Timestamp:
- Apr 8, 2016, 4:57:00 PM (9 years ago)
- Location:
- trunk/LMDZ.GENERIC
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.GENERIC/README
r1537 r1538 1177 1177 - Initialize runoff in hydrol.F90. 1178 1178 1179 1180 1179 == 08/04/2016 == EM 1180 - Made nsoilmx be no longer a "parameter" and thus added the possibility to define the 1181 number of subsurface layers nsoilmx, along with first layer thickness "lay1_soil" and 1182 companion coefficient "alpha_soil", in callphys.def at run time. 1183 As before (when these were hard-coded), these are such that the depth of 1184 soil mid-layers are: 1185 mlayer(k)=lay1_soil*alpha_soil**(k-1/2), for k=0,nsoil-1 1186 1187 1188 -
trunk/LMDZ.GENERIC/libf/dynlonlat_phylonlat/phystd/newstart.F
r1524 r1538 36 36 USE ener_mod, ONLY: etot0,ptot0,ztot0,stot0,ang0 37 37 use inifis_mod, only: inifis 38 use control_mod, only: nday 38 39 implicit none 39 40 … … 95 96 c------------------ 96 97 REAL tsurf(ngridmx) ! surface temperature 97 REAL tsoil(ngridmx,nsoilmx) ! soil temperature98 REAL,ALLOCATABLE :: tsoil(:,:) ! soil temperature 98 99 ! REAL co2ice(ngridmx) ! CO2 ice layer 99 100 REAL emis(ngridmx) ! surface emissivity … … 103 104 ! REAL rnaturfi(ngridmx) 104 105 real alb(iip1,jjp1),albfi(ngridmx) ! albedos 105 real ith(iip1,jjp1,nsoilmx),ithfi(ngridmx,nsoilmx) ! thermal inertia (3D)106 real,allocatable :: ith(:,:,:),ithfi(:,:) ! thermal inertia (3D) 106 107 real surfith(iip1,jjp1),surfithfi(ngridmx) ! surface thermal inertia (2D) 107 108 REAL latfi(ngridmx),lonfi(ngridmx),airefi(ngridmx) … … 113 114 114 115 REAL rnat(ngridmx) 115 REAL tslab(ngridmx,nsoilmx) ! slab ocean temperature116 REAL,ALLOCATABLE :: tslab(:,:) ! slab ocean temperature 116 117 REAL pctsrf_sic(ngridmx) ! sea ice cover 117 118 REAL tsea_ice(ngridmx) ! temperature sea_ice … … 274 275 ! ... this has to be done before phyetat0 275 276 call initracer(ngridmx,nqtot,tname) 277 278 ! default nsoilmx is set in comsoil_h 279 call getin_p("nsoilmx",nsoilmx) 280 281 ! allocate some local arrays now that we know all dimensions 282 allocate(tsoil(ngridmx,nsoilmx)) 283 allocate(ith(iip1,jjp1,nsoilmx)) 284 allocate(ithfi(ngridmx,nsoilmx)) 285 allocate(tslab(ngridmx,nsoilmx)) 276 286 277 287 ! Take care of arrays in common modules … … 475 485 ! (for instance initracer needs to know about some flags, and/or 476 486 ! 'datafile' path may be changed by user) 477 call inifis(ngridmx,llm,nqtot,day_ini,daysec, dtphys,487 call inifis(ngridmx,llm,nqtot,day_ini,daysec,nday,dtphys, 478 488 & latfi,lonfi,airefi,rad,g,r,cpp) 479 489 -
trunk/LMDZ.GENERIC/libf/dynlonlat_phylonlat/phystd/start2archive.F
r1478 r1538 19 19 c======================================================================= 20 20 21 use ioipsl_getin_p_mod, only: getin_p 21 22 use infotrac, only: infotrac_init, nqtot, tname 22 23 USE comsoil_h … … 69 70 c ------------------------------------ 70 71 REAL tsurf(ngridmx) ! Surface temperature 71 REAL tsoil(ngridmx,nsoilmx) ! Soil temperature72 REAL,ALLOCATABLE :: tsoil(:,:) ! Soil temperature 72 73 REAL co2ice(ngridmx) ! CO2 ice layer 73 74 REAL q2(ngridmx,llm+1) … … 93 94 REAL T(ip1jmp1,llm),us(ip1jmp1,llm),vs(ip1jmp1,llm) 94 95 REAL tsurfS(ip1jmp1) 95 REAL tsoilS(ip1jmp1,nsoilmx)96 REAL ithS(ip1jmp1,nsoilmx) ! Soil Thermal Inertia96 REAL,ALLOCATABLE :: tsoilS(:,:) 97 REAL,ALLOCATABLE :: ithS(:,:) ! Soil Thermal Inertia 97 98 REAL co2iceS(ip1jmp1) 98 99 REAL q2S(ip1jmp1,llm+1) … … 147 148 CALL init_phys_lmdz(iim,jjp1,llm,1,(/(jjm-1)*iim+2/)) 148 149 call initcomgeomphy 150 151 ! get value of nsoilmx (default is set in comsoil_h) 152 call getin_p("nsoilmx",nsoilmx) 153 154 ! allocate some local arrays now that we know all dimensions 155 allocate(tsoil(ngridmx,nsoilmx)) 156 allocate(tsoilS(ip1jmp1,nsoilmx)) 157 allocate(ithS(ip1jmp1,nsoilmx)) 149 158 150 159 ! ALLOCATE ARRAYS IN comgeomfi_h (usually done in inifis) -
trunk/LMDZ.GENERIC/libf/phystd/comsoil_h.F90
r1516 r1538 5 5 !integer, parameter :: nsoilmx = 18 ! for z1=0.0002 m, depth = 18 m => mars case 6 6 !integer, parameter :: nsoilmx = 13 ! for z1=0.03 m, depth = 104.8 m => earth case 7 integer, parameter :: nsoilmx = 18 8 ! Full soil layer depths are set as: layer(k)=lay1*alpha**(k-1) , k=1,nsoil 9 ! Mid soil layer depths are set as: mlayer(k)=lay1*alpha**(k-1/2) , k=0,nsoil-1 10 real,parameter :: lay1=2.e-4 ! depth of first full soil layer 11 real,parameter :: alpha=2 7 integer,save :: nsoilmx = 18 ! default, but may be set in callphys.def 8 ! Full soil layer depths are set as: layer(k)=lay1_soil*alpha_soil**(k-1) , k=1,nsoil 9 ! Mid soil layer depths are set as: mlayer(k)=lay1_soil*alpha_soil**(k-1/2) , k=0,nsoil-1 10 real,save :: lay1_soil=2.e-4 ! depth (m) of first full soil layer (may be set in callphys.def) 11 real,save :: alpha_soil=2 ! coefficient for soil layer thickness (may be set in callphys.def) 12 !$OMP THREADPRIVATE(nsoilmx,lay1_soil,alpha_soil) 12 13 13 14 real,save,allocatable,dimension(:) :: layer ! soil layer depths -
trunk/LMDZ.GENERIC/libf/phystd/inifis_mod.F90
r1529 r1538 14 14 use comdiurn_h, only: sinlat, coslat, sinlon, coslon 15 15 use comgeomfi_h, only: long, lati, area, totarea, totarea_planet 16 use comsoil_h, only: ini_comsoil_h 16 use comsoil_h, only: ini_comsoil_h, nsoilmx, lay1_soil, alpha_soil 17 17 use time_phylmdz_mod, only: ecritphy,day_step,iphysiq, & 18 18 init_time, daysec, dtphys … … 322 322 call getin_p("graybody",graybody) 323 323 write(*,*)" graybody = ",graybody 324 325 ! Soil model 326 write(*,*)"Number of sub-surface layers for soil scheme?" 327 ! default value of nsoilmx set in comsoil_h 328 call getin_p("nsoilmx",nsoilmx) 329 write(*,*)" nsoilmx=",nsoilmx 330 331 write(*,*)"Thickness of topmost soil layer (m)?" 332 ! default value of lay1_soil set in comsoil_h 333 call getin_p("lay1_soil",lay1_soil) 334 write(*,*)" lay1_soil = ",lay1_soil 335 336 write(*,*)"Coefficient for soil layer thickness distribution?" 337 ! default value of alpha_soil set in comsoil_h 338 call getin_p("alpha_soil",alpha_soil) 339 write(*,*)" alpha_soil = ",alpha_soil 324 340 325 341 ! Slab Ocean -
trunk/LMDZ.GENERIC/libf/phystd/soil_settings.F
r1516 r1538 3 3 ! use netcdf 4 4 use comsoil_h, only: layer, mlayer, inertiedat, volcapa, 5 & lay1 , alpha5 & lay1_soil, alpha_soil 6 6 use iostart, only: inquire_field_ndims, get_var, get_field, 7 7 & inquire_field, inquire_dimension_length … … 71 71 real,dimension(:),allocatable :: newval 72 72 73 real malpha,mlay1 ! coefficients for building layers73 real malpha,mlay1_soil ! coefficients for building layers 74 74 real xmin,xmax ! to display min and max of a field 75 75 … … 84 84 85 85 if (dimlen.ne.nsoil) then 86 write(*,*)'soil_settings: Interpolation of soil temperature ',87 & 'and thermal inertia will be required!'88 86 ! if dimlen doesn't match nsoil, then interpolation of 89 87 ! soil temperatures and thermal inertia will be requiered 90 88 interpol=.true. 91 ! allocate olmlayer92 allocate(oldmlayer(dimlen),stat=ierr)93 if (ierr.ne.0) then94 write(*,*) 'soil_settings: failed allocation of oldmlayer!'95 stop96 endif97 89 endif 90 91 ! allocate oldmlayer 92 allocate(oldmlayer(dimlen),stat=ierr) 93 if (ierr.ne.0) then 94 write(*,*) 'soil_settings: failed allocation of oldmlayer!' 95 stop 96 endif 97 98 ! check if olmlayer distribution matches current one 99 call get_var("soildepth",oldmlayer,found) 100 if (found) then 101 malpha=oldmlayer(2)/oldmlayer(1) 102 if ((abs(malpha-alpha_soil)/alpha_soil).gt.1.e-6) then 103 ! alpha values are too different, intepolation needed 104 interpol=.true. 105 endif 106 ! check if loaded mid-layer depth value differs from current one 107 if (abs((oldmlayer(1)-lay1_soil*alpha_soil**(-1./2.))/ 108 & (lay1_soil*alpha_soil**(-1./2.))).gt.1.e-6) then 109 interpol=.true. 110 endif 111 endif 112 113 if (interpol) then 114 write(*,*)'soil_settings: Interpolation of soil temperature ', 115 & 'and thermal inertia will be required!' 116 endif 117 98 118 ! 1.2 Find out the # of dimensions <inertiedat> was defined as using 99 119 ndims=inquire_field_ndims("inertiedat") … … 133 153 if (interpol) then 134 154 ! default mlayer distribution, following a power law: 135 ! mlayer(k)=lay1 *alpha**(k-1/2)155 ! mlayer(k)=lay1_soil*alpha_soil**(k-1/2) 136 156 do iloop=0,nsoil-1 137 mlayer(iloop)=lay1 *(alpha**(iloop-0.5))157 mlayer(iloop)=lay1_soil*(alpha_soil**(iloop-0.5)) 138 158 enddo 139 159 endif 140 160 ! 1.5 Build layer(); following the same law as mlayer() 141 161 ! Assuming layer distribution follows mid-layer law: 142 ! layer(k)=lay1 *alpha**(k-1)143 mlay1 =sqrt(mlayer(0)*mlayer(1))162 ! layer(k)=lay1_soil*alpha_soil**(k-1) 163 mlay1_soil=sqrt(mlayer(0)*mlayer(1)) 144 164 malpha=mlayer(1)/mlayer(0) 145 165 ! Check that these values are the same as those prescibed for mlayers 146 if ((abs(mlay1 -lay1)/lay1).gt.1.e-6) then147 write(*,*) "soil_settings error: mlay1 =",mlay1148 write(*,*) " does not match comsoil_h lay1 =",lay1166 if ((abs(mlay1_soil-lay1_soil)/lay1_soil).gt.1.e-6) then 167 write(*,*) "soil_settings error: mlay1_soil=",mlay1_soil 168 write(*,*) " does not match comsoil_h lay1_soil=",lay1_soil 149 169 stop 150 170 endif 151 if ((abs(malpha-alpha )/alpha).gt.1.e-6) then171 if ((abs(malpha-alpha_soil)/alpha_soil).gt.1.e-6) then 152 172 write(*,*) "soil_settings error: malpha=",malpha 153 write(*,*) " does not match comsoil_h alpha =",alpha173 write(*,*) " does not match comsoil_h alpha_soil=",alpha_soil 154 174 stop 155 175 endif 156 176 do iloop=1,nsoil 157 layer(iloop)=mlay1 *(malpha**(iloop-1))177 layer(iloop)=mlay1_soil*(malpha**(iloop-1)) 158 178 enddo 159 179
Note: See TracChangeset
for help on using the changeset viewer.