source: trunk/LMDZ.COMMON/libf/evolution/ice_table_mod.F90 @ 3961

Last change on this file since 3961 was 3961, checked in by jbclement, 7 days ago

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

File size: 20.8 KB
Line 
1MODULE ice_table_mod
2
3implicit none
4
5!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
6!!!
7!!! Purpose: Ice table (pore-filling) variables and methods to compute it (dynamic and static)
8!!! Author:  LL, 02/2023
9!!!
10!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
11
12logical                             :: icetable_equilibrium ! Boolean to say if the PEM needs to recompute the icetable depth when at equilibrium
13logical                             :: icetable_dynamic     ! Boolean to say if the PEM needs to recompute the icetable depth with the dynamic method
14real, allocatable, dimension(:,:)   :: icetable_depth       ! ngrid x nslope: Depth of the ice table [m]
15real, allocatable, dimension(:,:)   :: icetable_thickness   ! ngrid x nslope: Thickness of the ice table [m]
16real, allocatable, dimension(:,:,:) :: ice_porefilling      ! the amout of porefilling in each layer in each grid [m^3/m^3]
17
18!-----------------------------------------------------------------------
19contains
20
21!-----------------------------------------------------------------------
22SUBROUTINE ini_ice_table(ngrid,nslope,nsoil)
23
24implicit none
25
26integer, intent(in) :: ngrid  ! number of atmospheric columns
27integer, intent(in) :: nslope ! number of slope within a mesh
28integer, intent(in) :: nsoil  ! number of soil layers
29
30allocate(icetable_depth(ngrid,nslope))
31allocate(icetable_thickness(ngrid,nslope))
32allocate(ice_porefilling(ngrid,nsoil,nslope))
33
34END SUBROUTINE ini_ice_table
35
36!-----------------------------------------------------------------------
37SUBROUTINE end_ice_table
38
39implicit none
40
41if (allocated(icetable_depth)) deallocate(icetable_depth)
42if (allocated(icetable_thickness)) deallocate(icetable_thickness)
43if (allocated(ice_porefilling)) deallocate(ice_porefilling)
44
45END SUBROUTINE end_ice_table
46
47!------------------------------------------------------------------------------------------------------
48SUBROUTINE computeice_table_equilibrium(ngrid,nslope,nsoil,watercaptag,rhowatersurf_ave,rhowatersoil_ave,regolith_inertia,ice_table_depth,ice_table_thickness)
49!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
50!!!
51!!! Purpose: Compute the ice table depth (pore-filling) knowing the yearly average water
52!!! density at the surface and at depth.
53!!! Computations are made following the methods in Schorgofer et al., 2005
54!!! This subroutine only gives the ice table at equilibrium and does not consider exchange with the atmosphere
55!!!
56!!! Author: LL
57!!!
58!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
59use math_mod,                   only: findroot
60use comsoil_h_PEM,              only: mlayer_PEM, layer_PEM ! Depth of the vertical grid
61use soil_thermalproperties_mod, only: ice_thermal_properties
62
63implicit none
64
65! Inputs
66! ------
67integer,                             intent(in) :: ngrid, nslope, nsoil ! Size of the physical grid, number of subslope, number of soil layer in the PEM
68logical, dimension(ngrid),           intent(in) :: watercaptag          ! Boolean to check the presence of a perennial glacier
69real, dimension(ngrid,nslope),       intent(in) :: rhowatersurf_ave     ! Water density at the surface, yearly averaged [kg/m^3]
70real, dimension(ngrid,nsoil,nslope), intent(in) :: rhowatersoil_ave     ! Water density at depth, computed from clapeyron law's (Murchy and Koop 2005), yearly averaged [kg/m^3]
71real, dimension(ngrid,nslope),       intent(in) :: regolith_inertia     ! Thermal inertia of the regolith layer [SI]
72! Ouputs
73! ------
74real, dimension(ngrid,nslope), intent(out) :: ice_table_depth     ! ice table depth [m]
75real, dimension(ngrid,nslope), intent(out) :: ice_table_thickness ! ice table thickness [m]
76! Locals
77! ------
78integer                       :: ig, islope, isoil, isoilend ! loop variables
79real, dimension(nsoil)        :: diff_rho                    ! difference of water vapor density between the surface and at depth [kg/m^3]
80real                          :: ice_table_end               ! depth of the end of the ice table  [m]
81real, dimension(ngrid,nslope) :: previous_icetable_depth     ! Ice table computed at previous ice depth [m]
82real                          :: stretch                     ! stretch factor to improve the convergence of the ice table
83real                          :: wice_inertia                ! Water Ice thermal Inertia [USI]
84! Code
85! ----
86previous_icetable_depth = ice_table_depth
87do ig = 1,ngrid
88    if (watercaptag(ig)) then
89        ice_table_depth(ig,:) = 0.
90        ice_table_thickness(ig,:) = layer_PEM(nsoil) ! Let's assume an infinite ice table (true when geothermal flux is set to 0.)
91    else
92        do islope = 1,nslope
93            ice_table_depth(ig,islope) = -1.
94            ice_table_thickness(ig,islope) = 0.
95            do isoil = 1,nsoil
96                diff_rho(isoil) = rhowatersurf_ave(ig,islope) - rhowatersoil_ave(ig,isoil,islope)
97            enddo
98            if (diff_rho(1) > 0.) then ! ice is at the surface
99                ice_table_depth(ig,islope) = 0.
100                do isoilend = 2,nsoil - 1
101                    if (diff_rho(isoilend) > 0 .and. diff_rho(isoilend + 1) < 0.) then
102                        call findroot(diff_rho(isoilend),diff_rho(isoilend + 1),mlayer_PEM(isoilend - 1),mlayer_PEM(isoilend),ice_table_end)
103                        ice_table_thickness(ig,islope) = ice_table_end - ice_table_depth(ig,islope)
104                        exit
105                    endif
106                enddo
107            else
108                do isoil = 1,nsoil - 1 ! general case, we find the ice table depth by doing a linear approximation between the two depth, and then solve the first degree equation to find the root
109                    if (diff_rho(isoil) < 0. .and. diff_rho(isoil + 1) > 0.) then
110                        call findroot(diff_rho(isoil),diff_rho(isoil + 1),mlayer_PEM(isoil),mlayer_PEM(isoil + 1),ice_table_depth(ig,islope))
111                        ! Now let's find the end of the ice table
112                        ice_table_thickness(ig,islope) = layer_PEM(nsoil) ! Let's assume an infinite ice table (true when geothermal flux is set to 0.)
113                        do isoilend = isoil + 1,nsoil - 1
114                            if (diff_rho(isoilend) > 0. .and. diff_rho(isoilend + 1) < 0.) then
115                                call findroot(diff_rho(isoilend),diff_rho(isoilend + 1),mlayer_PEM(isoilend - 1),mlayer_PEM(isoilend),ice_table_end)
116                                ice_table_thickness(ig,islope) = ice_table_end - ice_table_depth(ig,islope)
117                                exit
118                            endif
119                        enddo
120                    endif ! diff_rho(z) <0 & diff_rho(z+1) > 0
121                enddo
122            endif ! diff_rho(1) > 0
123        enddo
124    endif ! watercaptag
125enddo
126
127! Small trick to speed up the convergence, Oded's idea.
128do islope = 1,nslope
129    do ig = 1,ngrid
130        if (ice_table_depth(ig,islope) > previous_icetable_depth(ig,islope) .and. previous_icetable_depth(ig,islope) >= 0) then
131            call ice_thermal_properties(.false.,1.,regolith_inertia(ig,islope),wice_inertia)
132            stretch = (regolith_inertia(ig,islope)/wice_inertia)**2
133            ice_table_thickness(ig,islope) = ice_table_thickness(ig,islope) + (ice_table_depth(ig,islope) - &
134                                             previous_icetable_depth(ig,islope) + (ice_table_depth(ig,islope) - previous_icetable_depth(ig,islope))/stretch)
135            ice_table_depth(ig,islope) = previous_icetable_depth(ig,islope) + (ice_table_depth(ig,islope) - previous_icetable_depth(ig,islope))/stretch
136        endif
137    enddo
138enddo
139
140END SUBROUTINE computeice_table_equilibrium
141
142!-----------------------------------------------------------------------
143SUBROUTINE compute_massh2o_exchange_ssi(ngrid,nslope,nsoil,icetable_thickness_old,ice_porefilling_old,tsurf,tsoil,delta_m_h2o)
144!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
145!!!
146!!! Purpose: Compute the mass of H2O that has sublimated from the ice table / condensed
147!!!
148!!! Author: LL
149!!!
150!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
151use comsoil_h_PEM,         only: mlayer_PEM
152use comslope_mod,          only: subslope_dist, def_slope_mean
153use constants_marspem_mod, only: porosity
154use comcstfi_h,            only: pi
155
156implicit none
157
158! Inputs
159! ------
160integer,                             intent(in) :: ngrid, nslope, nsoil   ! Size of the physical grid, number of subslope, number of soil layer in the PEM
161real, dimension(ngrid,nslope),       intent(in) :: icetable_thickness_old ! Ice table thickness at the previous iteration [m]
162real, dimension(ngrid,nsoil,nslope), intent(in) :: ice_porefilling_old    ! Ice pore filling at the previous iteration [m]
163real, dimension(ngrid,nslope),       intent(in) :: tsurf                  ! Surface temperature [K]
164real, dimension(ngrid,nsoil,nslope), intent(in) :: tsoil                  ! Soil temperature [K]
165! Outputs
166! -------
167real, dimension(ngrid), intent(out) :: delta_m_h2o ! Mass of H2O ice that has been condensed on the ice table / sublimates from the ice table [kg/m^2]
168! Locals
169!-------
170integer :: ig, islope, isoil ! loop index
171real    :: rho               ! density of water ice [kg/m^3]
172real    :: Tice              ! ice temperature [k]
173! Code
174! ----
175
176! Let's compute the amount of ice that has sublimated in each subslope
177if (icetable_equilibrium) then
178    delta_m_h2o = 0.
179    do ig = 1,ngrid
180        do islope = 1,nslope
181            call compute_Tice_pem(nsoil,tsoil(ig,:,islope),tsurf(ig,islope),icetable_depth(ig,islope),Tice)
182            delta_m_h2o(ig) = delta_m_h2o(ig) + porosity*rho_ice(Tice,'h2o')*(icetable_thickness(ig,islope) - icetable_thickness_old(ig,islope)) & ! convention > 0. <=> it condenses
183                              *subslope_dist(ig,islope)/cos(def_slope_mean(islope)*pi/180.)
184        enddo
185    enddo
186else if (icetable_dynamic) then
187    delta_m_h2o = 0.
188    do ig = 1,ngrid
189        do islope = 1,nslope
190            do isoil = 1,nsoil
191                call compute_Tice_pem(nsoil,tsoil(ig,:,islope),tsurf(ig,islope),mlayer_PEM(isoil - 1),Tice)
192                delta_m_h2o(ig) = delta_m_h2o(ig) + rho_ice(Tice,'h2o')*(ice_porefilling(ig,isoil,islope) - ice_porefilling_old(ig,isoil,islope)) & ! convention > 0. <=> it condenses
193                                  *subslope_dist(ig,islope)/cos(def_slope_mean(islope)*pi/180.)
194            enddo
195        enddo
196    enddo
197endif
198
199END SUBROUTINE compute_massh2o_exchange_ssi
200
201!-----------------------------------------------------------------------
202SUBROUTINE find_layering_icetable(porefill,psat_soil,psat_surf,pwat_surf,psat_bottom,B,index_IS,depth_filling,index_filling,index_geothermal,depth_geothermal,dz_etadz_rho)
203!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
204!!!
205!!! Purpose: Compute layering between dry soil, pore filling ice, and ice sheet based on Schorgofer, Icarus (2010). Adapted from NS MSIM
206!!!
207!!! Author: LL
208!!!
209!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
210use comsoil_h_PEM, only: nsoilmx_PEM, mlayer_PEM
211use math_mod,      only: deriv1, deriv1_onesided, colint, findroot, deriv2_simple
212
213implicit none
214
215! Inputs
216! ------
217real, dimension(nsoilmx_PEM), intent(in) :: porefill    ! Fraction of pore space filled with ice [Unitless] 0 <= f <= 1 for pore ice
218real, dimension(nsoilmx_PEM), intent(in) :: psat_soil   ! Soil water pressure at saturation, yearly averaged [Pa]
219real,                         intent(in) :: psat_surf   ! surface water pressure at saturation, yearly averaged [Pa]
220real,                         intent(in) :: pwat_surf   ! Water vapor pressure  at the surface, not necesseraly at saturation, yearly averaged [Pa]
221real,                         intent(in) :: psat_bottom ! Boundary conditions for soil vapor pressure [Pa]
222real,                         intent(in) :: B           ! constant (Eq. 8 from  Schorgofer, Icarus (2010).)
223integer,                      intent(in) :: index_IS    ! index of the soil layer where the ice sheet begins [1]
224real, intent(inout) :: depth_filling ! depth where pore filling begins [m]
225! Outputs
226! -------
227integer,                      intent(out) :: index_filling    ! index where the pore filling begins [1]
228integer,                      intent(out) :: index_geothermal ! index where the ice table stops [1]
229real,                         intent(out) :: depth_geothermal ! depth where the ice table stops [m]
230real, dimension(nsoilmx_PEM), intent(out) :: dz_etadz_rho     ! \partial z(eta \partial z rho), eta is the constriction, used later for pore filling increase
231! Locals
232!-------
233real, dimension(nsoilmx_PEM) :: eta                          ! constriction
234real, dimension(nsoilmx_PEM) :: dz_psat                      ! first derivative of the vapor pressure at saturation
235real, dimension(nsoilmx_PEM) :: dz_eta                       ! \partial z \eta
236real, dimension(nsoilmx_PEM) :: dzz_psat                     ! \partial \partial psat
237integer                      :: ilay, index_tmp              ! index for loop
238real                         :: old_depth_filling            ! depth_filling saved
239real                         :: Jdry                         ! flux trought the dry layer
240real                         :: Jsat                         ! flux trought the ice layer
241real                         :: Jdry_prevlay, Jsat_prevlay   ! same but for the previous ice layer
242integer                      :: index_firstice               ! first index where ice appears (i.e., f > 0)
243real                         :: massfillabove, massfillafter ! h2O mass above and after index_geothermal
244! Constant
245!---------
246real, parameter :: pvap2rho = 18.e-3/8.314
247! Code
248!-----
249! 0. Compute constriction over the layer
250! Within the ice sheet, constriction is set to 0. Elsewhere, constriction =  (1-porefilling)**2
251if (index_IS < 0) then
252    index_tmp = nsoilmx_PEM
253    do ilay = 1,nsoilmx_PEM
254        eta(ilay) = constriction(porefill(ilay))
255    enddo
256else
257    index_tmp = index_IS
258    do ilay = 1,index_IS - 1
259        eta(ilay) = constriction(porefill(ilay))
260    enddo
261    do ilay = index_IS,nsoilmx_PEM
262        eta(ilay) = 0.
263    enddo
264endif
265
266! 1. Depth at which pore filling occurs. We solve Eq. 9 from  Schorgofer, Icarus  (2010)
267old_depth_filling = depth_filling
268
269call deriv1(mlayer_PEM,nsoilmx_PEM,psat_soil,psat_surf,psat_bottom,dz_psat)
270
271do ilay = 1,index_tmp
272    Jdry = (psat_soil(ilay) - pwat_surf)/mlayer_PEM(ilay) ! left member of Eq. 9 from Schorgofer, Icarus  (2010)
273    Jsat =  eta(ilay)*dz_psat(ilay) !right member of Eq. 9 from Schorgofer, Icarus (2010)
274    if (Jdry - Jsat <= 0) then
275        index_filling = ilay
276        exit
277    endif
278enddo
279
280if (index_filling == 1) then
281    depth_filling = mlayer_PEM(1)
282else if (index_filling > 1) then
283    Jdry_prevlay = (psat_soil(index_filling - 1) - pwat_surf)/mlayer_PEM(index_filling - 1)
284    Jsat_prevlay = eta(index_filling - 1)*dz_psat(index_filling - 1)
285    call findroot(Jdry - Jsat,Jdry_prevlay - Jsat_prevlay,mlayer_PEM(index_filling),mlayer_PEM(index_filling - 1),depth_filling)
286endif
287
288! 2. Compute d_z (eta* d_z(rho)) (last term in Eq. 13 of Schorgofer, Icarus (2010))
289! 2.0 preliminary: depth to shallowest ice (discontinuity at interface)
290index_firstice = -1
291do ilay = 1,nsoilmx_PEM
292    if (porefill(ilay) <= 0.) then
293        index_firstice = ilay  ! first point with ice
294        exit
295    endif
296enddo
297
298! 2.1: now we can compute
299call deriv1(mlayer_PEM,nsoilmx_PEM,eta,1.,eta(nsoilmx_PEM - 1),dz_eta)
300
301if (index_firstice > 0 .and. index_firstice < nsoilmx_PEM - 2) call deriv1_onesided(index_firstice,mlayer_PEM,nsoilmx_PEM,eta,dz_eta(index_firstice))
302
303call deriv2_simple(mlayer_PEM,nsoilmx_PEM,psat_soil,psat_surf,psat_bottom,dzz_psat)
304dz_etadz_rho = pvap2rho*(dz_eta*dz_psat + eta*dzz_psat)
305
306! 3. Ice table boundary due to geothermal heating
307if (index_IS > 0) index_geothermal = -1
308if (index_geothermal < 0) depth_geothermal = -1.
309if ((index_geothermal > 0).and.(index_IS < 0)) then ! Eq. 21 from Schorfoger, Icarus (2010)
310    index_geothermal = -1
311    do ilay = 2,nsoilmx_PEM
312        if (dz_psat(ilay) > 0.) then  ! first point with reversed flux
313            index_geothermal = ilay
314            call findroot(dz_psat(ilay - 1),dz_psat(ilay),mlayer_PEM(ilay - 1),mlayer_PEM(ilay),depth_geothermal)
315            exit
316        endif
317    enddo
318else
319    index_geothermal = -1
320endif
321if (index_geothermal > 0 .and. index_IS < 0) then ! Eq. 24 from Schorgofer, Icarus (2010)
322    call  colint(porefill/eta,mlayer_PEM,nsoilmx_PEM,index_geothermal - 1,nsoilmx_PEM,massfillabove)
323    index_tmp = -1
324    do ilay = index_geothermal,nsoilmx_PEM
325        if (minval(eta(ilay:nsoilmx_PEM)).le.0.) cycle ! eta=0 means completely full
326        call colint(porefill/eta,mlayer_PEM,nsoilmx_PEM,ilay,nsoilmx_PEM,massfillafter)
327        if (massfillafter < dz_psat(ilay)*pvap2rho*B) then ! usually executes on i=typeG
328            if (ilay > index_geothermal) then
329!                write(34,*) '# adjustment to geotherm depth by',ilay-index_geothermal
330                call findroot(dz_psat(ilay - 1)*pvap2rho*B - massfillabove, &
331                              dz_psat(ilay)*pvap2rho*B - massfillafter,mlayer_PEM(ilay - 1),mlayer_PEM(ilay),depth_geothermal)
332!                if (depth_geothermal > mlayer_PEM(ilay) .or. depth_geothermal < mlayer_PEM(ilay - 1)) write(*,*) '# WARNING: zdepthG interpolation failed',ilay,mlayer_PEM(ilay - 1),depth_geothermal,mlayer_PEM(ilay)
333              index_tmp = ilay
334           endif
335           ! otherwise leave depth_geothermal unchanged
336           exit
337        endif
338        massfillabove = massfillafter
339    enddo
340    if (index_tmp > 0) index_geothermal = index_tmp
341end if
342
343END SUBROUTINE find_layering_icetable
344
345!-----------------------------------------------------------------------
346FUNCTION constriction(porefill) RESULT(eta)
347
348!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
349!!!
350!!! Purpose: Compute the constriction of vapor flux by pore ice
351!!!
352!!! Author: LL
353!!!
354!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
355
356implicit none
357
358real, intent(in) :: porefill ! pore filling fraction
359real :: eta ! constriction
360
361if (porefill <= 0.) then
362    eta = 1.
363else if (0 < porefill .and. porefill < 1.) then
364    eta = (1-porefill)**2 ! Hudson et al., JGR, 2009
365else
366    eta = 0.
367endif
368
369END FUNCTION constriction
370
371!-----------------------------------------------------------------------
372SUBROUTINE compute_Tice_pem(nsoil,ptsoil,ptsurf,ice_depth,Tice)
373!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
374!!!
375!!! Purpose: Compute subsurface ice temperature by interpolating the temperatures between the two adjacent cells.
376!!!
377!!! Author: LL
378!!!
379!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
380
381use comsoil_h_PEM, only: mlayer_PEM
382use abort_pem_mod, only: abort_pem
383
384implicit none
385
386! Inputs
387! ------
388integer,                intent(in) :: nsoil     ! Number of soil layers
389real, dimension(nsoil), intent(in) :: ptsoil    ! Soil temperature (K)
390real,                   intent(in) :: ptsurf    ! Surface temperature (K)
391real,                   intent(in) :: ice_depth ! Ice depth (m)
392
393! Outputs
394! -------
395real, intent(out) :: Tice ! Ice temperatures (K)
396
397! Locals
398! ------
399integer :: ik       ! Loop variables
400integer :: indexice ! Index of the ice
401
402! Code
403!-----
404indexice = -1
405if (ice_depth >= mlayer_PEM(nsoil - 1)) then
406    Tice = ptsoil(nsoil)
407else
408    if(ice_depth < mlayer_PEM(0)) then
409        indexice = 0.
410    else
411        do ik = 0,nsoil - 2 ! go through all the layers to find the ice locations
412            if (mlayer_PEM(ik) <= ice_depth .and. mlayer_PEM(ik + 1) > ice_depth) then
413                indexice = ik + 1
414                exit
415            endif
416        enddo
417    endif
418    if (indexice < 0) then
419        call abort_pem("compute_Tice_pem","Subsurface ice is below the last soil layer!",1)
420    else
421        if(indexice >= 1) then ! Linear inteprolation between soil temperature
422            Tice = (ptsoil(indexice) - ptsoil(indexice + 1))/(mlayer_PEM(indexice - 1) - mlayer_PEM(indexice))*(ice_depth - mlayer_PEM(indexice)) + ptsoil(indexice + 1)
423        else ! Linear inteprolation between the 1st soil temperature and the surface temperature
424            Tice = (ptsoil(1) - ptsurf)/mlayer_PEM(0)*(ice_depth - mlayer_PEM(0)) + ptsoil(1)
425        endif ! index ice >= 1
426    endif !indexice < 0
427endif ! icedepth > mlayer_PEM(nsoil - 1)
428
429END SUBROUTINE compute_Tice_pem
430
431!-----------------------------------------------------------------------
432FUNCTION rho_ice(T,ice) RESULT(rho)
433!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
434!!!
435!!! Purpose: Compute subsurface ice density
436!!!
437!!! Author: JBC
438!!!
439!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
440
441use abort_pem_mod, only: abort_pem
442
443implicit none
444
445real,         intent(in) :: T
446character(3), intent(in) :: ice
447real :: rho
448
449select case (trim(adjustl(ice)))
450    case('h2o')
451        rho = -3.5353e-4*T**2 + 0.0351*T + 933.5030 ! Rottgers 2012
452    case('co2')
453        rho = (1.72391 - 2.53e-4*T-2.87*1e-7*T**2)*1.e3 ! Mangan et al. 2017
454    case default
455        call abort_pem("rho_ice","Type of ice not known!",1)
456end select
457
458END FUNCTION rho_ice
459
460END MODULE ice_table_mod
Note: See TracBrowser for help on using the repository browser.