Changeset 3110 for trunk/LMDZ.MARS/libf/phymars
- Timestamp:
- Nov 2, 2023, 4:28:39 PM (14 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/libf/phymars/soil_settings.F
r3109 r3110 87 87 ! ------------------- 88 88 89 89 90 ! 1.1 Start by reading how many layers of soil there are 90 91 … … 146 147 do iloop=0,nsoil-1 147 148 mlayer(iloop)=lay1*(alpha**(iloop-0.5)) 148 149 enddo 149 150 endif 150 151 … … 157 158 layer(iloop)=lay1*(alpha**(iloop-1)) 158 159 enddo 160 161 159 162 160 163 ! 2. Volumetric heat capacity (note: it is declared in comsoil_h) … … 241 244 write(*,*)' => Building <inertiesoil> from surface values'// 242 245 & ' <inertiedat>' 243 do islope=1,nslope 244 inertiesoil(:,:,islope)=inertiedat(:,:) 245 enddo 246 ! Case 1: No interpolation needed, we just copy past inertiedat 247 if(.not.(interpol)) then 248 do islope=1,nslope 249 inertiesoil(:,:,islope)=inertiedat(:,:) 250 enddo 251 else 252 ! Case 2: Interpolation needed: we copy past old value from inertiedat 253 if (.not.allocated(oldinertiesoil)) then 254 allocate(oldinertiesoil(ngrid,dimlen,nslope),stat=ierr) 255 endif 256 do islope=1,nslope 257 oldinertiesoil(:,:,islope)=oldinertiedat(:,:) 258 enddo 259 endif 246 260 else ! <inertiesoil> found 247 261 if (interpol) then ! put values in oldinertiesoil … … 283 297 write(*,*)'soil_settings: Field <tsoil> not found!' 284 298 write(*,*)' => Building <tsoil> from surface values <tsurf>' 285 do iloop=1,nsoil 286 do islope=1,nslope 287 tsoil(:,iloop,islope)=tsurf(:,islope) 299 ! Case 1: No interpolation needed, we just copy past inertiedat 300 if(.not.(interpol)) then 301 do iloop=1,nsoil 302 do islope=1,nslope 303 tsoil(:,iloop,islope)=tsurf(:,islope) 304 enddo 288 305 enddo 289 enddo 306 else 307 ! Case 2: Interpolation needed: we copy past old value from inertiedat 308 if (.not.allocated(oldtsoil)) then 309 allocate(oldtsoil(ngrid,dimlen,nslope),stat=ierr) 310 endif 311 do iloop=1,dimlen 312 do islope=1,nslope 313 oldtsoil(:,iloop,islope)=tsurf(:,islope) 314 enddo 315 enddo 316 endif 290 317 else ! <tsoil> found 291 318 if (interpol) then ! put values in oldtsoil … … 372 399 enddo 373 400 enddo ! ig 374 375 401 376 402 ! soil temperature … … 391 417 392 418 !cleanup 393 deallocate(oldgrid)419 deallocate(oldgrid) 394 420 deallocate(oldval) 395 421 deallocate(newval)
Note: See TracChangeset
for help on using the changeset viewer.