Changeset 4136 for trunk/LMDZ.COMMON/libf
- Timestamp:
- Mar 17, 2026, 11:12:37 AM (2 weeks ago)
- Location:
- trunk/LMDZ.COMMON/libf/evolution
- Files:
-
- 4 edited
-
changelog.txt (modified) (1 diff)
-
geometry.F90 (modified) (16 diffs)
-
soil.F90 (modified) (4 diffs)
-
xios_data.F90 (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/changelog.txt
r4135 r4136 914 914 == 16/03/2026 == JBC 915 915 Relocate Mars-specific parameters out of "planet" module and into the modules that own their physics domain. 916 917 == 17/03/2026 == JBC 918 - Temporary memory load reduced in "xios_data". 919 - Rename local variables in procedures to avoid masking variables in parent scope. -
trunk/LMDZ.COMMON/libf/evolution/geometry.F90
r4134 r4136 153 153 154 154 !======================================================================= 155 SUBROUTINE lonlat2vect(nlon ,nlat,ngrid,v_ll,v_vect)155 SUBROUTINE lonlat2vect(nlon_in,nlat_in,ngrid_in,v_ll,v_vect) 156 156 !----------------------------------------------------------------------- 157 157 ! NAME … … 180 180 ! ARGUMENTS 181 181 !---------- 182 integer(di), intent(in) :: nlon, nlat, ngrid183 real(dp), dimension(nlon ,nlat), intent(in) :: v_ll184 real(dp), dimension(ngrid ),intent(out) :: v_vect182 integer(di), intent(in) :: nlon_in, nlat_in, ngrid_in 183 real(dp), dimension(nlon_in,nlat_in), intent(in) :: v_ll 184 real(dp), dimension(ngrid_in), intent(out) :: v_vect 185 185 186 186 ! LOCAL VARIABLES … … 190 190 ! CODE 191 191 !----- 192 if (ngrid == 1) then ! 1D case192 if (ngrid_in == 1) then ! 1D case 193 193 v_vect(1) = v_ll(1,1) 194 194 return 195 195 else ! 3D 196 196 ! Check 197 if (ngrid /= nlon*(nlat- 2) + 2) call stop_clean(__FILE__,__LINE__,'problem of dimensions!',1)197 if (ngrid_in /= nlon_in*(nlat_in - 2) + 2) call stop_clean(__FILE__,__LINE__,'problem of dimensions!',1) 198 198 199 199 ! Initialization … … 202 202 ! Treatment of the poles 203 203 v_vect(1) = v_ll(1,1) 204 v_vect(ngrid ) = v_ll(1,nlat)204 v_vect(ngrid_in) = v_ll(1,nlat_in) 205 205 206 206 ! Treatment of regular points 207 do j = 2,nlat - 1208 do i = 1,nlon 209 v_vect(1 + i + (j - 2)*nlon ) = v_ll(i,j)207 do j = 2,nlat_in - 1 208 do i = 1,nlon_in 209 v_vect(1 + i + (j - 2)*nlon_in) = v_ll(i,j) 210 210 end do 211 211 end do … … 216 216 217 217 !======================================================================= 218 SUBROUTINE vect2lonlat(nlon ,nlat,ngrid,v_vect,v_ll)218 SUBROUTINE vect2lonlat(nlon_in,nlat_in,ngrid_in,v_vect,v_ll) 219 219 !----------------------------------------------------------------------- 220 220 ! NAME … … 243 243 ! ARGUMENTS 244 244 !---------- 245 integer(di), intent(in) :: nlon, nlat, ngrid246 real(dp), dimension(ngrid ),intent(in) :: v_vect247 real(dp), dimension(nlon ,nlat), intent(out) :: v_ll245 integer(di), intent(in) :: nlon_in, nlat_in, ngrid_in 246 real(dp), dimension(ngrid_in), intent(in) :: v_vect 247 real(dp), dimension(nlon_in,nlat_in), intent(out) :: v_ll 248 248 249 249 ! LOCAL VARIABLES … … 253 253 ! CODE 254 254 !----- 255 if (ngrid == 1) then ! 1D case255 if (ngrid_in == 1) then ! 1D case 256 256 v_ll(1,1) = v_vect(1) 257 257 return 258 258 else ! 3D 259 259 ! Check 260 if (ngrid /= nlon*(nlat- 2) + 2) call stop_clean(__FILE__,__LINE__,'problem of dimensions!',1)260 if (ngrid_in /= nlon_in*(nlat_in - 2) + 2) call stop_clean(__FILE__,__LINE__,'problem of dimensions!',1) 261 261 262 262 ! Initialization … … 265 265 ! Treatment of the poles 266 266 v_ll(:,1) = v_vect(1) 267 v_ll(:,nlat ) = v_vect(ngrid)267 v_ll(:,nlat_in) = v_vect(ngrid_in) 268 268 269 269 ! Treatment of regular points 270 do j = 2,nlat - 1271 do i = 1,nlon 272 v_ll(i,j) = v_vect(1 + i + (j - 2)*nlon )270 do j = 2,nlat_in - 1 271 do i = 1,nlon_in 272 v_ll(i,j) = v_vect(1 + i + (j - 2)*nlon_in) 273 273 end do 274 274 end do … … 279 279 280 280 !======================================================================= 281 SUBROUTINE dyngrd2vect(ni,nj,ngrid ,v_dyn,v_vect)281 SUBROUTINE dyngrd2vect(ni,nj,ngrid_in,v_dyn,v_vect) 282 282 !----------------------------------------------------------------------- 283 283 ! NAME … … 306 306 ! ARGUMENTS 307 307 !---------- 308 integer(di), intent(in) :: ni, nj, ngrid309 real(dp), dimension(ni,nj), intent(in) :: v_dyn310 real(dp), dimension(ngrid ), intent(out) :: v_vect308 integer(di), intent(in) :: ni, nj, ngrid_in 309 real(dp), dimension(ni,nj), intent(in) :: v_dyn 310 real(dp), dimension(ngrid_in), intent(out) :: v_vect 311 311 312 312 ! LOCAL VARIABLES … … 316 316 ! CODE 317 317 !----- 318 if (ngrid == 1) then ! 1D case318 if (ngrid_in == 1) then ! 1D case 319 319 v_vect(1) = v_dyn(1,1) 320 320 return 321 321 else ! 3D 322 322 ! Check 323 if (ngrid /= (ni - 1)*(nj - 2) + 2) call stop_clean(__FILE__,__LINE__,'problem of dimensions!',1)323 if (ngrid_in /= (ni - 1)*(nj - 2) + 2) call stop_clean(__FILE__,__LINE__,'problem of dimensions!',1) 324 324 325 325 ! Initialization … … 328 328 ! Treatment of the poles 329 329 v_vect(1) = v_dyn(1,1) 330 v_vect(ngrid ) = v_dyn(1,nj)330 v_vect(ngrid_in) = v_dyn(1,nj) 331 331 332 332 ! Treatment of regular points … … 342 342 343 343 !======================================================================= 344 SUBROUTINE vect2dyngrd(ni,nj,ngrid ,v_vect,v_dyn)344 SUBROUTINE vect2dyngrd(ni,nj,ngrid_in,v_vect,v_dyn) 345 345 !----------------------------------------------------------------------- 346 346 ! NAME … … 369 369 ! ARGUMENTS 370 370 !---------- 371 integer(di), intent(in) :: ni, nj, ngrid372 real(dp), dimension(ngrid ), intent(in) :: v_vect373 real(dp), dimension(ni,nj), intent(out) :: v_dyn371 integer(di), intent(in) :: ni, nj, ngrid_in 372 real(dp), dimension(ngrid_in), intent(in) :: v_vect 373 real(dp), dimension(ni,nj), intent(out) :: v_dyn 374 374 375 375 ! LOCAL VARIABLES … … 379 379 ! CODE 380 380 !----- 381 if (ngrid == 1) then ! 1D case381 if (ngrid_in == 1) then ! 1D case 382 382 v_dyn(1,1) = v_vect(1) 383 383 return 384 384 else ! 3D 385 385 ! Check 386 if (ngrid /= (ni - 1)*(nj - 2) + 2) call stop_clean(__FILE__,__LINE__,'problem of dimensions!',1)386 if (ngrid_in /= (ni - 1)*(nj - 2) + 2) call stop_clean(__FILE__,__LINE__,'problem of dimensions!',1) 387 387 388 388 ! Initialization … … 391 391 ! Treatment of the poles 392 392 v_dyn(:,1) = v_vect(1) 393 v_dyn(:,nj) = v_vect(ngrid )393 v_dyn(:,nj) = v_vect(ngrid_in) 394 394 395 395 ! Treatment of regular points -
trunk/LMDZ.COMMON/libf/evolution/soil.F90
r4135 r4136 25 25 ! PARAMETERS 26 26 ! ---------- 27 ! Density and porosity of regolith and breccia 28 real(dp), parameter :: rho_regolith = 2000._dp ! [kg/m^3], Zent et al. 1995; Buhler and Piqueux 2021 27 real(dp), parameter :: rho_regolith = 2000._dp ! Density of the martian regolith [kg/m^3], Zent et al. 1995; Buhler and Piqueux 2021 29 28 real(dp), parameter :: regolith_porosity = 0.4_dp ! Porosity of the martian regolith for a random loose packing of monodisperse sphere, Scott 1960 30 29 real(dp), parameter :: breccia_porosity = 0.1_dp ! Porosity of breccia … … 255 254 256 255 !======================================================================= 257 SUBROUTINE set_soil( TI)256 SUBROUTINE set_soil(therm_initia) 258 257 !----------------------------------------------------------------------- 259 258 ! NAME … … 291 290 ! ARGUMENTS 292 291 ! --------- 293 real(dp), dimension(:,:,:), intent(inout) :: TI! Thermal inertia in the PEM [SI]292 real(dp), dimension(:,:,:), intent(inout) :: therm_initia ! Thermal inertia in the PEM [SI] 294 293 295 294 ! LOCAL VARIABLES … … 334 333 do islope = 1,nslope 335 334 do iloop = 1,nsoil_PCM 336 TI(ig,iloop,islope) = TI_PCM(ig,iloop,islope)335 therm_initia(ig,iloop,islope) = TI_PCM(ig,iloop,islope) 337 336 end do 338 337 if (nsoil > nsoil_PCM) then 339 338 do iloop = nsoil_PCM + 1,nsoil 340 TI(ig,iloop,islope) = TI_PCM(ig,nsoil_PCM,islope)339 therm_initia(ig,iloop,islope) = TI_PCM(ig,nsoil_PCM,islope) 341 340 end do 342 341 end if -
trunk/LMDZ.COMMON/libf/evolution/xios_data.F90
r4110 r4136 68 68 logical(k4) :: here 69 69 integer(di) :: islope, isoil, iday 70 real(dp), dimension(:), allocatable :: var_read_1d 70 71 real(dp), dimension(:,:), allocatable :: var_read_2d 71 72 real(dp), dimension(:,:,:), allocatable :: var_read_3d 72 73 real(dp), dimension(:,:,:,:), allocatable :: var_read_4d 73 74 character(:), allocatable :: num ! To read slope variables 74 real(dp), dimension(ngrid,nsoil,nslope,nday) :: h2o_soildensity_ts75 75 76 76 ! CODE … … 157 157 ! Allocate and read the variables 158 158 deallocate(var_read_2d,var_read_3d) 159 allocate(var_read_ 3d(nlon,nlat,nday),var_read_4d(nlon,nlat,nsoil_PCM,nday))159 allocate(var_read_1d(ngrid),var_read_3d(nlon,nlat,nday),var_read_4d(nlon,nlat,nsoil_PCM,nday)) 160 160 call get_var_nc('ps',var_read_3d) 161 161 do iday = 1,nday … … 171 171 end do 172 172 if (do_soil) then 173 h2o_soildensity_avg(:,:,:) = 0._dp 173 174 do islope = 1,nslope 174 175 if (nslope /= 1) then … … 189 190 do iday = 1,nday 190 191 do isoil = 1,nsoil_PCM 191 call lonlat2vect(nlon,nlat,ngrid,var_read_4d(:,:,isoil,iday),h2o_soildensity_ts(:,isoil,islope,iday)) 192 call lonlat2vect(nlon,nlat,ngrid,var_read_4d(:,:,isoil,iday),var_read_1d) 193 h2o_soildensity_avg(:,isoil,islope) = h2o_soildensity_avg(:,isoil,islope) + var_read_1d 192 194 end do 193 do isoil = nsoil_PCM + 1,nsoil 194 h2o_soildensity_ts(:,isoil,islope,iday) = h2o_soildensity_ts(:,nsoil_PCM,islope,iday) ! Explicit initialization because dimension with size nsoil > nsoil_PCM 195 end do 196 end do 195 end do 196 ! Keep deep layers consistent with PCM bottom layer when nsoil > nsoil_PCM. 197 h2o_soildensity_avg(:,nsoil_PCM + 1:nsoil,islope) = h2o_soildensity_avg(:,nsoil_PCM,islope) 197 198 end do 198 h2o_soildensity_avg(:,:,:) = sum(h2o_soildensity_ts,4)/nday199 h2o_soildensity_avg(:,:,:) = h2o_soildensity_avg(:,:,:)/real(nday,dp) 199 200 end if 200 deallocate(var_read_ 3d,var_read_4d,num)201 deallocate(var_read_1d,var_read_3d,var_read_4d,num) 201 202 202 203 ! Close the NetCDF file of XIOS outputs
Note: See TracChangeset
for help on using the changeset viewer.
