Changeset 3526 for trunk/LMDZ.COMMON/libf/evolution/NS_soilthprop_mars.F90
- Timestamp:
- Nov 19, 2024, 5:54:18 PM (4 days ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/NS_soilthprop_mars.F90
r3493 r3526 76 76 77 77 end subroutine soilthprop 78 79 80 81 subroutine smartgrid(nz,z,zdepth,thIn,rhoc,porosity,ti,rhocv,layertype,icefrac)82 !***********************************************************************83 ! smartgrid: returns intelligently spaced grid and appropriate84 ! values of thermal inertia ti and rho*c in icy layer85 !86 ! INPUTS:87 ! nz = number of grid points88 ! z = grid spacing for dry regolith89 ! (will be partially overwritten)90 ! zdepth = depth where ice table starts91 ! negative values indicate no ice92 ! rhoc = heat capacity per volume of dry regolith [J/m^3]93 ! thIn = thermal inertia of dry regolith [SI-units]94 ! porosity = void space / total volume95 ! layertypes are explained below96 ! icefrac = fraction of ice in icelayer97 !98 ! OUTPUTS: z = grid coordinates99 ! vectors ti and rhocv100 !***********************************************************************101 implicit none102 integer, intent(IN) :: nz, layertype103 real(8), intent(IN) :: zdepth, thIn, rhoc, porosity, icefrac104 real(8), intent(INOUT) :: z(nz)105 real(8), intent(OUT) :: ti(nz), rhocv(nz)106 integer j, b107 real(8) stretch, newrhoc, newti108 real(8), parameter :: NULL=0.109 110 if (zdepth>0 .and. zdepth<z(nz)) then111 112 select case (layertype)113 case (1) ! interstitial ice114 call soilthprop(porosity,1.d0,rhoc,thIn,1,newrhoc,newti,NULL)115 case (2) ! mostly ice (massive ice)116 call soilthprop(porosity,NULL,rhoc,thIn,2,newrhoc,newti,icefrac)117 case (3) ! all ice (pure ice)118 call soilthprop(NULL,NULL,NULL,NULL,3,newrhoc,newti,NULL)119 case (4) ! ice + rock + nothing else (ice-cemented soil)120 call soilthprop(porosity,NULL,rhoc,NULL,4,newrhoc,newti,NULL)121 case default122 error stop 'invalid layer type'123 end select124 125 ! Thermal skin depth is proportional to sqrt(kappa)126 ! thermal diffusivity kappa = k/(rho*c) = I^2/(rho*c)**2127 stretch = (newti/thIn)*(rhoc/newrhoc) ! ratio of sqrt(thermal diffusivity)128 129 b = 1130 do j=1,nz131 if (z(j)<=zdepth) then132 b = j+1133 rhocv(j) = rhoc134 ti(j) = thIn135 else136 rhocv(j) = newrhoc137 ti(j) = newti138 endif139 ! print *,j,z(j),ti(j),rhocv(j)140 enddo141 do j=b+1,nz142 z(j) = z(b) + stretch*(z(j)-z(b))143 enddo144 145 ! print *,'zmax=',z(nz),' b=',b,' stretch=',stretch146 ! print *,'depth at b-1, b ',z(b-1),z(b)147 ! print *,'ti1=',thIn,' ti2=',newti148 ! print *,'rhoc1=',rhoc,' rhoc2=',newrhoc149 endif150 151 end subroutine smartgrid152
Note: See TracChangeset
for help on using the changeset viewer.