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

Last change on this file since 3526 was 3526, checked in by jbclement, 2 days ago

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

File size: 5.8 KB
Line 
1!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2!!!
3!!! Purpose:  Retreat and growth of subsurface ice on Mars
4!!!           orbital elements remain constant
5!!!
6!!!
7!!! Author: EV, updated NS MSIM dynamical program for the PEM
8!!!
9!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10
11SUBROUTINE dyn_ss_ice_m(ssi_depth_in,T1,Tb,nz,thIn,p0,pfrost,porefill_in,porefill,ssi_depth)
12
13!***********************************************************************
14! Retreat and growth of subsurface ice on Mars
15! orbital elements remain constant
16!***********************************************************************
17  use miscparameters, only : pi, d2r, NMAX, marsDay, solsperyear
18  !use allinterfaces
19  implicit none
20  integer, parameter :: NP=1   ! # of sites
21  integer nz, i, k, iloop
22  real(8)  zmax, delta, z(NMAX), icetime, porosity, icefrac
23  real(8), dimension(NP) ::  albedo, thIn, rhoc
24  real(8), dimension(NP) :: pfrost, p0
25  real(8) newti, stretch, newrhoc, ecc, omega, eps, timestep
26  real(8)  ssi_depth_in, ssi_depth, T1
27  real(8), dimension(NP) :: zdepthF, zdepthE, zdepthT, zdepthG
28  real(8), dimension(NMAX,NP) :: porefill, porefill_in
29  real(8), dimension(nz) :: Tb
30  real(8), dimension(NP) :: Tmean1, Tmean3, avrho1
31  real(8) tmax, tlast, avrho1prescribed(NP), l1
32  real(8), external :: smartzfac
33
34  !if (iargc() /= 1) then
35  !   stop 'USAGE: icages ext'
36  !endif
37  !call getarg( 1, ext )
38
39  if (NP>100) stop 'subroutine icelayer_mars cannot handle this many sites'
40
41  ! parameters that never ever change
42  porosity = 0.4d0  ! porosity of till
43  !rhoc(:) = 1500.*800.  ! will be overwritten
44  icefrac = 0.98
45  tmax = 1
46  tlast = 0.
47  avrho1prescribed(:) = pfrost/T1  ! <0 means absent
48  albedo=0.23
49  !avrho1prescribed(:) = 0.16/200.  ! units are Pa/K
50
51  !open(unit=21,file='lats.'//ext,action='read',status='old',iostat=ierr)
52  !if (ierr /= 0) then
53  !   print *,'File lats.'//ext,'not found'
54  !   stop
55  !endif
56  do k=1,NP
57     !read(21,*) latitude(k),albedo(k),thIn(k),htopo(k)
58     ! empirical relation from Mellon & Jakosky
59     rhoc(k) = 800.*(150.+100.*sqrt(34.2+0.714*thIn(k)))
60  enddo
61  !close(21)
62
63  ! set eternal grid
64  zmax = 25.
65  !zfac = smartzfac(nz,zmax,6,0.032d0)
66  !call setgrid(nz,z,zmax,zfac)
67  l1=2.e-4
68  do iloop=0,nz - 1
69    z(iloop + 1) = l1*(1+iloop**2.9*(1-exp(-real(iloop)/20.)))
70  enddo
71 
72
73  !open(unit=30,file='z.'//ext,action='write',status='unknown')
74  !write(30,'(999(f8.5,1x))') z(1:nz)
75  !close(30)
76
77  !ecc = ecc_in;  eps = obl_in*d2r;  omega = Lp_in*d2r   ! today
78  ! total atmospheric pressure
79  !p0(:) = 600.
80  ! presently 520 Pa at zero elevation (Smith & Zuber, 1998)
81 ! do k=1,NP
82 !    p0(k)=520*exp(-htopo(k)/10800.)
83 ! enddo
84  timestep = 1 ! must be integer fraction of 1 ka
85  icetime = -tmax-timestep  ! earth years
86 
87  ! initializations
88  !Tb = -9999.
89  zdepthF(:) = -9999.
90
91  !zdepthT(1:NP) = -9999.   ! reset again below
92 ! zdepthT(1:NP) = 0.
93
94 ! print *,'RUNNING MARS_FAST'
95 ! print *,'Global model parameters:'
96 ! print *,'nz=',nz,' zfac=',zfac,'zmax=',zmax
97 ! print *,'porosity=',porosity
98 ! print *,'starting at time',icetime,'years'
99 ! print *,'time step=',timestep,'years'
100 ! print *,'eps=',eps/d2r,'ecc=',ecc,'omega=',omega/d2r
101 ! print *,'number of sites=',NP
102 ! print *,'Site specific parameters:'
103  do k=1,NP
104     if (NP>1) print *,'  Site ',k
105 !    print *,'  latitude (deg)',latitude(k),' rho*c (J/m^3/K)',rhoc(k),' thIn=',thIn(k)
106 !    print *,'  total pressure=',p0(k),'partial pressure=',pfrost(k)
107     delta = thIn(k)/rhoc(k)*sqrt(marsDay/pi)
108 !    print *,'  skin depths (m)',delta,delta*sqrt(solsperyear)
109     call soilthprop(porosity,1.d0,rhoc(k),thIn(k),1,newrhoc,newti,icefrac)
110     stretch = (newti/thIn(k))*(rhoc(k)/newrhoc)
111     do i=1,nz
112        if (z(i)<delta) cycle
113 !       print *,'  ',i-1,' grid points within diurnal skin depth'
114        exit
115     enddo
116 !    print *,'  ',zmax/(sqrt(solsperyear)*delta),'times seasonal dry skin depth'
117 !    print *,'  ',zmax/(sqrt(solsperyear)*delta*stretch),'times seasonal filled skin depth'
118 !    print *,'  Initial ice depth=',zdepthT(k)
119 !    print *
120  enddo
121 ! call outputmoduleparameters
122 ! print *
123
124  ! open and name all output files
125!  open(unit=34,file='subout.'//ext,action='write',status='unknown')
126!  open(unit=36,file='depthF.'//ext,action='write',status='unknown')
127!  open(unit=37,file='depths.'//ext,action='write',status='unknown')
128
129 ! print *,'Equilibrating initial temperature'
130 ! do i=1,4
131 !    call icelayer_mars(0d0,nz,NP,thIn,rhoc,z,porosity,pfrost,Tb,zdepthF, &
132 !      &  zdepthE,porefill(1:nz,:),Tmean1,Tmean3,zdepthG, &
133 !      &  latitude,albedo,p0,ecc,omega,eps,icefrac,zdepthT,avrho1, &
134 !      &  avrho1prescribed)
135 ! enddo
136
137  !print *,'History begins here'
138 porefill(1:nz,1:NP) =  porefill_in(1:nz,1:NP)
139  zdepthT(1:NP) = ssi_depth_in
140  do
141  !print *,'Zt0=  ',ZdepthT
142     call icelayer_mars(timestep,nz,NP,thIn,rhoc,z,porosity,pfrost,Tb,zdepthF, &
143          & zdepthE,porefill(1:nz,:),Tmean1,Tmean3,zdepthG, &
144          & albedo,p0,icefrac,zdepthT,avrho1, &
145          & avrho1prescribed)
146     icetime = icetime+timestep
147   !  print *,'T_after=  ',Tb(:)
148 !    print *,'z=  ',z(:)
149 !    print *,'Zt=  ',ZdepthT
150     ssi_depth=ZdepthT(1)
151    ! if (abs(mod(icetime/100.,1.d0))<1.e-3) then ! output every 1000 years
152    !    do k=1,NP
153         !write(36,*) icetime,latitude(k),zdepthF(k),porefill(1:nz,k)
154           ! compact output format
155 !          write(36,'(f10.0,2x,f7.3,1x,f11.5,1x)',advance='no') &
156 !               & icetime,latitude(k),zdepthF(k)
157 !          call compactoutput(36,porefill(:,k),nz)
158 !          write(37,501) icetime,latitude(k),zdepthT(k), &
159 !               & Tmean1(k),Tmean3(k),zdepthG(k),avrho1(k)
160  !      enddo
161  !   endif
162!     print *,icetime
163     if (icetime>=tlast) exit
164  enddo
165
166 ! close(34)
167 ! close(36); close(37)
168
169!501 format (f10.0,2x,f7.3,2x,f10.4,2(2x,f6.2),2x,f9.3,2x,g11.4)
170 
171end subroutine dyn_ss_ice_m
Note: See TracBrowser for help on using the repository browser.