source: trunk/LMDZ.COMMON/libf/evolution/NS_dyn_ss_ice_m.F90 @ 3980

Last change on this file since 3980 was 3961, checked in by jbclement, 2 weeks ago

PEM:
Clearing all the tags and code related to the Generic PCM.
JBC

File size: 9.7 KB
Line 
1MODULE dyn_ss_ice_m_mod
2
3implicit none
4
5CONTAINS
6
7!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
8!!!
9!!! Purpose:  Retreat and growth of subsurface ice on Mars
10!!!           orbital elements remain constant
11!!!
12!!!
13!!! Author: EV, updated NS MSIM dynamical program for the PEM
14!!!
15!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
16
17SUBROUTINE dyn_ss_ice_m(ssi_depth_in,T1,Tb,nz,thIn,p0,pfrost,porefill_in,porefill,ssi_depth)
18
19!***********************************************************************
20! Retreat and growth of subsurface ice on Mars
21! orbital elements remain constant
22!***********************************************************************
23  use constants_marspem_mod, only: sec_per_sol
24  use fast_subs_mars,        only: psv, icelayer_mars, NMAX
25  use comcstfi_h,            only: pi
26  implicit none
27  integer, parameter :: NP=1   ! # of sites
28  integer nz, i, k, iloop
29  real(8)  zmax, delta, z(NMAX), icetime, porosity, icefrac
30  real(8), dimension(NP) ::  albedo, thIn, rhoc
31  real(8), dimension(NP) :: pfrost, p0
32  real(8) newti, stretch, newrhoc, ecc, omega, eps, timestep
33  real(8)  ssi_depth_in, ssi_depth, T1
34  real(8), dimension(NP) :: zdepthF, zdepthE, zdepthT, zdepthG
35  real(8), dimension(nz,NP) :: porefill, porefill_in
36  real(8), dimension(nz) :: Tb
37  real(8), dimension(NP) :: Tmean1, Tmean3, avrho1
38  real(8) tmax, tlast, avrho1prescribed(NP), l1
39  real(8), external :: smartzfac
40
41  !if (iargc() /= 1) then
42  !   stop 'USAGE: icages ext'
43  !endif
44  !call getarg( 1, ext )
45
46  if (NP>100) stop 'subroutine icelayer_mars cannot handle this many sites'
47
48  ! parameters that never ever change
49  porosity = 0.4d0  ! porosity of till
50  !rhoc(:) = 1500.*800.  ! will be overwritten
51  icefrac = 0.98
52  tmax = 1
53  tlast = 0.
54  avrho1prescribed(:) = pfrost/T1  ! <0 means absent
55  albedo=0.23
56  !avrho1prescribed(:) = 0.16/200.  ! units are Pa/K
57
58  !open(unit=21,file='lats.'//ext,action='read',status='old',iostat=ierr)
59  !if (ierr /= 0) then
60  !   print *,'File lats.'//ext,'not found'
61  !   stop
62  !endif
63  do k=1,NP
64     !read(21,*) latitude(k),albedo(k),thIn(k),htopo(k)
65     ! empirical relation from Mellon & Jakosky
66     rhoc(k) = 800.*(150.+100.*sqrt(34.2+0.714*thIn(k)))
67  enddo
68  !close(21)
69
70  ! set eternal grid
71  zmax = 25.
72  !zfac = smartzfac(nz,zmax,6,0.032d0)
73  !call setgrid(nz,z,zmax,zfac)
74  l1=2.e-4
75  do iloop=0,nz - 1
76    z(iloop + 1) = l1*(1+iloop**2.9*(1-exp(-real(iloop)/20.)))
77  enddo
78
79
80  !open(unit=30,file='z.'//ext,action='write',status='unknown')
81  !write(30,'(999(f8.5,1x))') z(1:nz)
82  !close(30)
83
84  !ecc = ecc_in;  eps = obl_in*d2r;  omega = Lp_in*d2r   ! today
85  ! total atmospheric pressure
86  !p0(:) = 600.
87  ! presently 520 Pa at zero elevation (Smith & Zuber, 1998)
88 ! do k=1,NP
89 !    p0(k)=520*exp(-htopo(k)/10800.)
90 ! enddo
91  timestep = 1 ! must be integer fraction of 1 ka
92  icetime = -tmax-timestep  ! earth years
93
94  ! initializations
95  !Tb = -9999.
96  zdepthF(:) = -9999.
97
98  !zdepthT(1:NP) = -9999.   ! reset again below
99 ! zdepthT(1:NP) = 0.
100
101 ! print *,'RUNNING MARS_FAST'
102 ! print *,'Global model parameters:'
103 ! print *,'nz=',nz,' zfac=',zfac,'zmax=',zmax
104 ! print *,'porosity=',porosity
105 ! print *,'starting at time',icetime,'years'
106 ! print *,'time step=',timestep,'years'
107 ! print *,'eps=',eps/d2r,'ecc=',ecc,'omega=',omega/d2r
108 ! print *,'number of sites=',NP
109 ! print *,'Site specific parameters:'
110  do k=1,NP
111     if (NP>1) print *,'  Site ',k
112 !    print *,'  latitude (deg)',latitude(k),' rho*c (J/m^3/K)',rhoc(k),' thIn=',thIn(k)
113 !    print *,'  total pressure=',p0(k),'partial pressure=',pfrost(k)
114     delta = thIn(k)/rhoc(k)*sqrt(sec_per_sol/pi)
115 !    print *,'  skin depths (m)',delta,delta*sqrt(solsperyear)
116     call soilthprop(porosity,1.d0,rhoc(k),thIn(k),1,newrhoc,newti,icefrac)
117     stretch = (newti/thIn(k))*(rhoc(k)/newrhoc)
118     do i=1,nz
119        if (z(i)<delta) cycle
120 !       print *,'  ',i-1,' grid points within diurnal skin depth'
121        exit
122     enddo
123 !    print *,'  ',zmax/(sqrt(solsperyear)*delta),'times seasonal dry skin depth'
124 !    print *,'  ',zmax/(sqrt(solsperyear)*delta*stretch),'times seasonal filled skin depth'
125 !    print *,'  Initial ice depth=',zdepthT(k)
126 !    print *
127  enddo
128 ! call outputmoduleparameters
129 ! print *
130
131  ! open and name all output files
132!  open(unit=34,file='subout.'//ext,action='write',status='unknown')
133!  open(unit=36,file='depthF.'//ext,action='write',status='unknown')
134!  open(unit=37,file='depths.'//ext,action='write',status='unknown')
135
136 ! print *,'Equilibrating initial temperature'
137 ! do i=1,4
138 !    call icelayer_mars(0d0,nz,NP,thIn,rhoc,z,porosity,pfrost,Tb,zdepthF, &
139 !      &  zdepthE,porefill(1:nz,:),Tmean1,Tmean3,zdepthG, &
140 !      &  latitude,albedo,p0,ecc,omega,eps,icefrac,zdepthT,avrho1, &
141 !      &  avrho1prescribed)
142 ! enddo
143
144  !print *,'History begins here'
145 porefill(1:nz,1:NP) =  porefill_in(1:nz,1:NP)
146  zdepthT(1:NP) = ssi_depth_in
147  do
148  !print *,'Zt0=  ',ZdepthT
149     call icelayer_mars(timestep,nz,NP,thIn,rhoc,z,porosity,pfrost,Tb,zdepthF, &
150          & zdepthE,porefill,Tmean1,Tmean3,zdepthG, &
151          & albedo,p0,icefrac,zdepthT,avrho1, &
152          & avrho1prescribed)
153     icetime = icetime+timestep
154   !  print *,'T_after=  ',Tb(:)
155 !    print *,'z=  ',z(:)
156 !    print *,'Zt=  ',ZdepthT
157     ssi_depth=ZdepthT(1)
158    ! if (abs(mod(icetime/100.,1.d0))<1.e-3) then ! output every 1000 years
159    !    do k=1,NP
160         !write(36,*) icetime,latitude(k),zdepthF(k),porefill(1:nz,k)
161           ! compact output format
162 !          write(36,'(f10.0,2x,f7.3,1x,f11.5,1x)',advance='no') &
163 !               & icetime,latitude(k),zdepthF(k)
164 !          call compactoutput(36,porefill(:,k),nz)
165 !          write(37,501) icetime,latitude(k),zdepthT(k), &
166 !               & Tmean1(k),Tmean3(k),zdepthG(k),avrho1(k)
167  !      enddo
168  !   endif
169!     print *,icetime
170     if (icetime>=tlast) exit
171  enddo
172
173 ! close(34)
174 ! close(36); close(37)
175
176!501 format (f10.0,2x,f7.3,2x,f10.4,2(2x,f6.2),2x,f9.3,2x,g11.4)
177
178end subroutine dyn_ss_ice_m
179
180!=======================================================================
181
182subroutine soilthprop(porosity,fill,rhocobs,tiobs,layertype, &
183     &     newrhoc,newti,icefrac)
184!***********************************************************************
185! soilthprop: assign thermal properties of icy soil or dirty ice
186!
187!     porositiy = void space / total volume
188!     rhof = density of free ice in space not occupied by regolith [kg/m^3]
189!     fill = rhof/icedensity <=1 (only relevant for layertype 1)
190!     rhocobs = heat capacity per volume of dry regolith [J/m^3]
191!     tiobs = thermal inertia of dry regolith [SI-units]
192!     layertype: 1=interstitial ice, 2=pure ice or ice with dirt
193!                3=pure ice, 4=ice-cemented soil, 5=custom values
194!     icefrac: fraction of ice in icelayer (only relevant for layertype 2)
195!     output are newti and newrhoc
196!***********************************************************************
197  implicit none
198  integer, intent(IN) :: layertype
199  real(8), intent(IN) :: porosity, fill, rhocobs, tiobs
200  real(8), intent(OUT) :: newti, newrhoc
201  real(8), intent(IN) :: icefrac
202  real(8) kobs, cice, icedensity, kice
203  !parameter (cice=2000.d0, icedensity=926.d0, kice=2.4d0) ! unaffected by scaling
204  parameter (cice=1540.d0, icedensity=927.d0, kice=3.2d0) ! at 198 Kelvin
205  real(8) fA, ki0, ki, k
206  real(8), parameter :: kw=3. ! Mellon et al., JGR 102, 19357 (1997)
207
208  kobs = tiobs**2/rhocobs
209  ! k, rhoc, and ti are defined in between grid points
210  ! rhof and T are defined on grid points
211
212  newrhoc = -9999.
213  newti  = -9999.
214
215  select case (layertype)
216  case (1) ! interstitial ice
217     newrhoc = rhocobs + porosity*fill*icedensity*cice
218     if (fill>0.) then
219        !--linear addition (option A)
220        k = porosity*fill*kice + kobs
221        !--Mellon et al. 1997 (option B)
222        ki0 = porosity/(1/kobs-(1-porosity)/kw)
223        fA = sqrt(fill)
224        ki = (1-fA)*ki0 + fA*kice
225        !k = kw*ki/((1-porosity)*ki+porosity*kw)
226     else
227        k = kobs
228     endif
229     newti = sqrt(newrhoc*k)
230
231  case (2)  ! massive ice (pure or dirty ice)
232     newrhoc = rhocobs*(1.-icefrac)/(1.-porosity) + icefrac*icedensity*cice
233     k = icefrac*kice + (1.-icefrac)*kw
234     newti = sqrt(newrhoc*k)
235
236  case (3)  ! all ice, special case of layertype 2, which doesn't use porosity
237     newrhoc = icedensity*cice
238     k = kice
239     newti = sqrt(newrhoc*k)
240
241  case (4)  ! pores completely filled with ice, special case of layertype 1
242     newrhoc = rhocobs + porosity*icedensity*cice
243     k = porosity*kice + kobs ! option A, end-member case of type 1, option A
244     !k = kw*kice/((1-porosity)*kice+porosity*kw) ! option B, harmonic average
245     newti = sqrt(newrhoc*k)
246
247  case (5)  ! custom values
248     ! values from Mellon et al. (2004) for ice-cemented soil
249     newrhoc = 2018.*1040.
250     k = 2.5
251     newti = sqrt(newrhoc*k)
252
253  case default
254     error stop 'invalid layer type'
255
256  end select
257
258end subroutine soilthprop
259
260
261!=======================================================================
262
263      real*8 function frostpoint(p)
264!     inverse of psv
265!     input is partial pressure [Pascal]
266!     output is temperature [Kelvin]
267      implicit none
268      real*8 p
269
270!-----inverse of parametrization 1
271!      real*8 DHmelt,DHvap,DHsub,R,pt,Tt
272!      parameter (DHmelt=6008.,DHvap=45050.)
273!      parameter (DHsub=DHmelt+DHvap)
274!      parameter (R=8.314,pt=6.11e2,Tt=273.16)
275!      frostpoint = 1./(1./Tt-R/DHsub*log(p/pt))
276
277!-----inverse of parametrization 2
278!     inverse of eq. (2) in Murphy & Koop (2005)
279      real*8 A,B
280      parameter (A=-6143.7, B=28.9074)
281      frostpoint = A / (log(p) - B)
282
283!-----approximate inverse of parametrization 3
284!     eq. (8) in Murphy & Koop (2005)
285!      frostpoint = (1.814625*log(p) + 6190.134)/(29.120 - log(p))
286
287      end function frostpoint
288
289END MODULE dyn_ss_ice_m_mod
Note: See TracBrowser for help on using the repository browser.