Ignore:
Timestamp:
Nov 19, 2024, 5:54:18 PM (4 days ago)
Author:
jbclement
Message:

PEM:
Removing unused or redundant Norbert Schorghofer's subroutines (follow-up of r3493) + cleaning and some modifications of related subroutines.
JBC

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.COMMON/libf/evolution/NS_soilthprop_mars.F90

    r3493 r3526  
    7676 
    7777end 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 appropriate
    84 !            values of thermal inertia ti and rho*c in icy layer
    85 !                 
    86 !     INPUTS:
    87 !             nz = number of grid points
    88 !             z = grid spacing for dry regolith
    89 !                 (will be partially overwritten)
    90 !             zdepth = depth where ice table starts
    91 !                      negative values indicate no ice
    92 !             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 volume
    95 !             layertypes are explained below 
    96 !             icefrac = fraction of ice in icelayer
    97 !
    98 !     OUTPUTS: z = grid coordinates
    99 !              vectors ti and rhocv
    100 !***********************************************************************
    101   implicit none
    102   integer, intent(IN) :: nz, layertype
    103   real(8), intent(IN) :: zdepth, thIn, rhoc, porosity, icefrac
    104   real(8), intent(INOUT) :: z(nz)
    105   real(8), intent(OUT) :: ti(nz), rhocv(nz)
    106   integer j, b
    107   real(8) stretch, newrhoc, newti
    108   real(8), parameter :: NULL=0.
    109  
    110   if (zdepth>0 .and. zdepth<z(nz)) then
    111 
    112      select case (layertype)
    113      case (1)  ! interstitial ice
    114         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 default
    122         error stop 'invalid layer type'
    123      end select
    124 
    125      ! Thermal skin depth is proportional to sqrt(kappa)
    126      ! thermal diffusivity kappa = k/(rho*c) = I^2/(rho*c)**2
    127      stretch = (newti/thIn)*(rhoc/newrhoc) ! ratio of sqrt(thermal diffusivity)
    128      
    129      b = 1
    130      do j=1,nz
    131         if (z(j)<=zdepth) then
    132            b = j+1
    133            rhocv(j) = rhoc
    134            ti(j) = thIn
    135         else
    136            rhocv(j) = newrhoc
    137            ti(j) = newti
    138         endif
    139         ! print *,j,z(j),ti(j),rhocv(j)
    140      enddo
    141      do j=b+1,nz
    142         z(j) = z(b) + stretch*(z(j)-z(b))
    143      enddo
    144      
    145      ! print *,'zmax=',z(nz),' b=',b,' stretch=',stretch
    146      ! print *,'depth at b-1, b ',z(b-1),z(b)
    147      ! print *,'ti1=',thIn,' ti2=',newti
    148      ! print *,'rhoc1=',rhoc,' rhoc2=',newrhoc
    149   endif
    150  
    151 end subroutine smartgrid
    152 
Note: See TracChangeset for help on using the changeset viewer.