| [3989] | 1 | MODULE glaciers |
|---|
| [3991] | 2 | !----------------------------------------------------------------------- |
|---|
| 3 | ! NAME |
|---|
| 4 | ! glaciers |
|---|
| 5 | ! |
|---|
| 6 | ! DESCRIPTION |
|---|
| 7 | ! Compute flow and transfer of CO2 and H2O ice glaciers on slopes |
|---|
| 8 | ! based on maximum ice thickness and basal drag conditions. |
|---|
| 9 | ! |
|---|
| 10 | ! AUTHORS & DATE |
|---|
| 11 | ! L. Lange |
|---|
| 12 | ! JB Clement, 2023-2025 |
|---|
| 13 | ! |
|---|
| 14 | ! NOTES |
|---|
| 15 | ! |
|---|
| 16 | !----------------------------------------------------------------------- |
|---|
| [2995] | 17 | |
|---|
| [4065] | 18 | ! DEPENDENCIES |
|---|
| 19 | ! ------------ |
|---|
| [4071] | 20 | use numerics, only: dp, di, k4, minieps |
|---|
| [4065] | 21 | |
|---|
| [3991] | 22 | ! DECLARATION |
|---|
| 23 | ! ----------- |
|---|
| [3149] | 24 | implicit none |
|---|
| 25 | |
|---|
| [3991] | 26 | ! PARAMETERS |
|---|
| 27 | ! ---------- |
|---|
| [4065] | 28 | logical(k4), protected :: h2oice_flow ! Flag to compute H2O ice flow |
|---|
| 29 | logical(k4), protected :: co2ice_flow ! Flag to compute CO2 ice flow |
|---|
| [3161] | 30 | |
|---|
| [2995] | 31 | contains |
|---|
| [4065] | 32 | !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
|---|
| [3991] | 33 | |
|---|
| [3149] | 34 | !======================================================================= |
|---|
| [4065] | 35 | SUBROUTINE set_glaciers_config(h2oice_flow_in,co2ice_flow_in) |
|---|
| [3991] | 36 | !----------------------------------------------------------------------- |
|---|
| 37 | ! NAME |
|---|
| [4065] | 38 | ! set_glaciers_config |
|---|
| 39 | ! |
|---|
| 40 | ! DESCRIPTION |
|---|
| 41 | ! Setter for 'glaciers' configuration parameters. |
|---|
| 42 | ! |
|---|
| 43 | ! AUTHORS & DATE |
|---|
| 44 | ! JB Clement, 02/2026 |
|---|
| 45 | ! |
|---|
| 46 | ! NOTES |
|---|
| 47 | ! |
|---|
| 48 | !----------------------------------------------------------------------- |
|---|
| 49 | |
|---|
| 50 | ! DEPENDENCIES |
|---|
| 51 | ! ------------ |
|---|
| 52 | use utility, only: bool2str |
|---|
| 53 | use geometry, only: nslope |
|---|
| 54 | use display, only: print_msg |
|---|
| 55 | |
|---|
| 56 | ! DECLARATION |
|---|
| 57 | ! ----------- |
|---|
| 58 | implicit none |
|---|
| 59 | |
|---|
| 60 | ! ARGUMENTS |
|---|
| 61 | ! --------- |
|---|
| 62 | logical(k4), intent(in) :: h2oice_flow_in, co2ice_flow_in |
|---|
| 63 | |
|---|
| 64 | ! CODE |
|---|
| 65 | ! ---- |
|---|
| 66 | h2oice_flow = h2oice_flow_in |
|---|
| 67 | co2ice_flow = co2ice_flow_in |
|---|
| 68 | if (h2oice_flow .and. nslope == 1) then |
|---|
| 69 | call print_msg('Warning: h2oice_flow = .true. but nslope = 1. So there will be no flow!') |
|---|
| 70 | h2oice_flow = .false. |
|---|
| 71 | end if |
|---|
| 72 | if (co2ice_flow .and. nslope == 1) then |
|---|
| 73 | call print_msg('Warning: co2ice_flow = .true. but nslope = 1. So there will be no flow!') |
|---|
| 74 | co2ice_flow = .false. |
|---|
| 75 | end if |
|---|
| 76 | call print_msg('h2oice_flow = '//bool2str(h2oice_flow)) |
|---|
| 77 | call print_msg('co2ice_flow = '//bool2str(co2ice_flow)) |
|---|
| 78 | |
|---|
| 79 | END SUBROUTINE set_glaciers_config |
|---|
| 80 | !======================================================================= |
|---|
| 81 | |
|---|
| 82 | !======================================================================= |
|---|
| 83 | SUBROUTINE flow_co2glaciers(vmr_co2_PEM,ps_PCM,ps_avg_glob_ini,ps_avg_global,co2ice,is_co2ice_flow) |
|---|
| 84 | !----------------------------------------------------------------------- |
|---|
| 85 | ! NAME |
|---|
| [3991] | 86 | ! flow_co2glaciers |
|---|
| 87 | ! |
|---|
| 88 | ! DESCRIPTION |
|---|
| 89 | ! Compute maximum thickness and transfer CO2 ice between subslopes. |
|---|
| 90 | ! |
|---|
| 91 | ! AUTHORS & DATE |
|---|
| 92 | ! L. Lange |
|---|
| 93 | ! JB Clement, 2023-2025 |
|---|
| 94 | ! |
|---|
| 95 | ! NOTES |
|---|
| 96 | ! |
|---|
| 97 | !----------------------------------------------------------------------- |
|---|
| [2995] | 98 | |
|---|
| [4065] | 99 | ! DEPENDENCIES |
|---|
| 100 | ! ------------ |
|---|
| 101 | use geometry, only: ngrid, nslope |
|---|
| 102 | use display, only: print_msg |
|---|
| 103 | |
|---|
| [3991] | 104 | ! DECLARATION |
|---|
| 105 | ! ----------- |
|---|
| [3149] | 106 | implicit none |
|---|
| [2995] | 107 | |
|---|
| [3991] | 108 | ! ARGUMENTS |
|---|
| 109 | ! --------- |
|---|
| [4071] | 110 | real(dp), dimension(:,:), intent(in) :: vmr_co2_PEM ! Grid points x Time field : VMR of CO2 in the first layer [mol/mol] |
|---|
| 111 | real(dp), dimension(:,:), intent(in) :: ps_PCM ! Grid points x Time field: surface pressure given by the PCM [Pa] |
|---|
| 112 | real(dp), intent(in) :: ps_avg_glob_ini ! Global averaged surface pressure at the beginning [Pa] |
|---|
| 113 | real(dp), intent(in) :: ps_avg_global ! Global averaged surface pressure during the PEM iteration [Pa] |
|---|
| 114 | real(dp), dimension(:,:), intent(inout) :: co2ice ! Grid points x Slope field: CO2 ice on the subgrid slopes [kg/m^2] |
|---|
| 115 | logical(k4), dimension(:,:), intent(out) :: is_co2ice_flow ! Flag to see if there is flow on the subgrid slopes |
|---|
| [2995] | 116 | |
|---|
| [3991] | 117 | ! LOCAL VARIABLES |
|---|
| 118 | ! --------------- |
|---|
| [4065] | 119 | real(dp), dimension(ngrid,nslope) :: Tcond ! CO2 condensation temperature [K] |
|---|
| 120 | real(dp), dimension(ngrid,nslope) :: hmax ! Maximum thickness before flow |
|---|
| [3991] | 121 | |
|---|
| 122 | ! CODE |
|---|
| 123 | ! ---- |
|---|
| [4065] | 124 | call print_msg("> Flow of CO2 glaciers") |
|---|
| 125 | call computeTcondCO2(vmr_co2_PEM,ps_PCM,ps_avg_glob_ini,ps_avg_global,Tcond) |
|---|
| [4074] | 126 | call compute_hmaxglaciers(Tcond,"CO2",hmax) |
|---|
| [4065] | 127 | call transfer_ice_duringflow(hmax,Tcond,co2ice,is_co2ice_flow) |
|---|
| [2995] | 128 | |
|---|
| [3149] | 129 | END SUBROUTINE flow_co2glaciers |
|---|
| [3991] | 130 | !======================================================================= |
|---|
| [2995] | 131 | |
|---|
| [3149] | 132 | !======================================================================= |
|---|
| [4065] | 133 | SUBROUTINE flow_h2oglaciers(Tice,h2oice,is_h2oice_flow) |
|---|
| [3991] | 134 | !----------------------------------------------------------------------- |
|---|
| 135 | ! NAME |
|---|
| 136 | ! flow_h2oglaciers |
|---|
| 137 | ! |
|---|
| 138 | ! DESCRIPTION |
|---|
| 139 | ! Compute maximum thickness and transfer H2O ice between subslopes. |
|---|
| 140 | ! |
|---|
| 141 | ! AUTHORS & DATE |
|---|
| 142 | ! L. Lange |
|---|
| 143 | ! JB Clement, 2023-2025 |
|---|
| 144 | ! |
|---|
| 145 | ! NOTES |
|---|
| 146 | ! |
|---|
| 147 | !----------------------------------------------------------------------- |
|---|
| [2995] | 148 | |
|---|
| [4065] | 149 | ! DEPENDENCIES |
|---|
| 150 | ! ------------ |
|---|
| 151 | use geometry, only: ngrid, nslope |
|---|
| 152 | use display, only: print_msg |
|---|
| 153 | |
|---|
| [3991] | 154 | ! DECLARATION |
|---|
| 155 | ! ----------- |
|---|
| [3149] | 156 | implicit none |
|---|
| [2995] | 157 | |
|---|
| [3991] | 158 | ! ARGUMENTS |
|---|
| [2995] | 159 | ! --------- |
|---|
| [4065] | 160 | real(dp), dimension(:,:), intent(in) :: Tice ! Ice Temperature [K] |
|---|
| 161 | real(dp), dimension(:,:), intent(inout) :: h2oice ! H2O ice on the subgrid slopes [kg/m^2] |
|---|
| 162 | logical(k4), dimension(:,:), intent(out) :: is_h2oice_flow ! Flow flag on subgrid slopes |
|---|
| [2995] | 163 | |
|---|
| [3991] | 164 | ! LOCAL VARIABLES |
|---|
| 165 | ! --------------- |
|---|
| [4065] | 166 | real(dp), dimension(ngrid,nslope) :: hmax ! Maximum thickness before flow |
|---|
| [2995] | 167 | |
|---|
| [3991] | 168 | ! CODE |
|---|
| 169 | ! ---- |
|---|
| [4065] | 170 | call print_msg("> Flow of H2O glaciers") |
|---|
| [4074] | 171 | call compute_hmaxglaciers(Tice,"H2O",hmax) |
|---|
| [4065] | 172 | call transfer_ice_duringflow(hmax,Tice,h2oice,is_h2oice_flow) |
|---|
| [2995] | 173 | |
|---|
| [3149] | 174 | END SUBROUTINE flow_h2oglaciers |
|---|
| [3991] | 175 | !======================================================================= |
|---|
| [2995] | 176 | |
|---|
| [3149] | 177 | !======================================================================= |
|---|
| [4065] | 178 | SUBROUTINE compute_hmaxglaciers(Tice,name_ice,hmax) |
|---|
| [3991] | 179 | !----------------------------------------------------------------------- |
|---|
| 180 | ! NAME |
|---|
| 181 | ! compute_hmaxglaciers |
|---|
| 182 | ! |
|---|
| 183 | ! DESCRIPTION |
|---|
| 184 | ! Compute the maximum thickness of CO2 and H2O glaciers given a |
|---|
| 185 | ! slope angle before initiating flow. |
|---|
| 186 | ! |
|---|
| 187 | ! AUTHORS & DATE |
|---|
| 188 | ! L. Lange |
|---|
| 189 | ! JB Clement, 2023-2025 |
|---|
| 190 | ! |
|---|
| 191 | ! NOTES |
|---|
| 192 | ! Based on work by A.Grau Galofre (LPG) and Isaac Smith (JGR Planets 2022) |
|---|
| 193 | ! |
|---|
| 194 | !----------------------------------------------------------------------- |
|---|
| [2995] | 195 | |
|---|
| [3991] | 196 | ! DEPENDENCIES |
|---|
| 197 | ! ------------ |
|---|
| [4065] | 198 | use geometry, only: ngrid, nslope |
|---|
| 199 | use slopes, only: iflat, def_slope_mean |
|---|
| 200 | use ice_table, only: rho_ice |
|---|
| 201 | use stoppage, only: stop_clean |
|---|
| 202 | use maths, only: pi |
|---|
| 203 | use physics, only: g |
|---|
| [2995] | 204 | |
|---|
| [3991] | 205 | ! DECLARATION |
|---|
| 206 | ! ----------- |
|---|
| [3149] | 207 | implicit none |
|---|
| [2995] | 208 | |
|---|
| [3991] | 209 | ! ARGUMENTS |
|---|
| 210 | ! --------- |
|---|
| [4065] | 211 | real(dp), dimension(:,:), intent(in) :: Tice ! Ice temperature [K] |
|---|
| 212 | character(3), intent(in) :: name_ice ! Nature of ice |
|---|
| 213 | real(dp), dimension(:,:), intent(out) :: hmax ! Maximum thickness before flow [m] |
|---|
| [3991] | 214 | |
|---|
| 215 | ! LOCAL VARIABLES |
|---|
| 216 | ! --------------- |
|---|
| [4065] | 217 | real(dp) :: tau_d ! characteristic basal drag, understood as the stress that an ice mass flowing under its weight balanced by viscosity. Value obtained from I.Smith |
|---|
| 218 | integer(di) :: ig, islope |
|---|
| 219 | real(dp) :: slo_angle |
|---|
| [2995] | 220 | |
|---|
| [3991] | 221 | ! CODE |
|---|
| 222 | ! ---- |
|---|
| [3527] | 223 | select case (trim(adjustl(name_ice))) |
|---|
| [4074] | 224 | case('H2O') |
|---|
| [4065] | 225 | tau_d = 1.e5_dp |
|---|
| [4074] | 226 | case('CO2') |
|---|
| [4065] | 227 | tau_d = 5.e3_dp |
|---|
| [3527] | 228 | case default |
|---|
| [4065] | 229 | call stop_clean(__FILE__,__LINE__,"type of ice unknown!",1) |
|---|
| [3527] | 230 | end select |
|---|
| [2995] | 231 | |
|---|
| [3527] | 232 | do ig = 1,ngrid |
|---|
| 233 | do islope = 1,nslope |
|---|
| 234 | if (islope == iflat) then |
|---|
| [4065] | 235 | hmax(ig,islope) = 1.e8_dp |
|---|
| [3527] | 236 | else |
|---|
| [4065] | 237 | slo_angle = abs(def_slope_mean(islope)*pi/180._dp) |
|---|
| [3527] | 238 | hmax(ig,islope) = tau_d/(rho_ice(Tice(ig,islope),name_ice)*g*slo_angle) |
|---|
| [4065] | 239 | end if |
|---|
| 240 | end do |
|---|
| 241 | end do |
|---|
| [3527] | 242 | |
|---|
| [3149] | 243 | END SUBROUTINE compute_hmaxglaciers |
|---|
| [3991] | 244 | !======================================================================= |
|---|
| [2995] | 245 | |
|---|
| [3149] | 246 | !======================================================================= |
|---|
| [4065] | 247 | SUBROUTINE transfer_ice_duringflow(hmax,Tice,qice,flag_flow) |
|---|
| [3991] | 248 | !----------------------------------------------------------------------- |
|---|
| 249 | ! NAME |
|---|
| 250 | ! transfer_ice_duringflow |
|---|
| 251 | ! |
|---|
| 252 | ! DESCRIPTION |
|---|
| 253 | ! Transfer the excess of ice from one subslope to another. |
|---|
| 254 | ! No transfer between mesh at the time. |
|---|
| 255 | ! |
|---|
| 256 | ! AUTHORS & DATE |
|---|
| 257 | ! L. Lange |
|---|
| 258 | ! JB Clement, 2023-2025 |
|---|
| 259 | ! |
|---|
| 260 | ! NOTES |
|---|
| 261 | ! |
|---|
| 262 | !----------------------------------------------------------------------- |
|---|
| [2995] | 263 | |
|---|
| [3991] | 264 | ! DEPENDENCIES |
|---|
| 265 | ! ------------ |
|---|
| [4065] | 266 | use geometry, only: ngrid, nslope |
|---|
| 267 | use slopes, only: iflat, subslope_dist, def_slope_mean |
|---|
| 268 | use ice_table, only: rho_ice |
|---|
| 269 | use stoppage, only: stop_clean |
|---|
| 270 | use maths, only: pi |
|---|
| [2995] | 271 | |
|---|
| [3991] | 272 | ! DECLARATION |
|---|
| 273 | ! ----------- |
|---|
| [2995] | 274 | implicit none |
|---|
| 275 | |
|---|
| [3991] | 276 | ! ARGUMENTS |
|---|
| 277 | ! --------- |
|---|
| [4065] | 278 | real(dp), dimension(:,:), intent(in) :: hmax ! Maximum height before initiating flow [m] |
|---|
| 279 | real(dp), dimension(:,:), intent(in) :: Tice ! Ice temperature [K] |
|---|
| 280 | real(dp), dimension(:,:), intent(inout) :: qice ! Ice in the subslope [kg/m^2] |
|---|
| 281 | logical(k4), dimension(:,:), intent(out) :: flag_flow ! Flow flag on subgrid slopes |
|---|
| [2995] | 282 | |
|---|
| [3991] | 283 | ! LOCAL VARIABLES |
|---|
| 284 | ! --------------- |
|---|
| [4065] | 285 | integer(di) :: ig, islope |
|---|
| 286 | integer(di) :: iaval ! Index where ice is transferred |
|---|
| [3991] | 287 | |
|---|
| 288 | ! CODE |
|---|
| 289 | ! ---- |
|---|
| [4065] | 290 | flag_flow = .false. |
|---|
| [3591] | 291 | |
|---|
| [3527] | 292 | do ig = 1,ngrid |
|---|
| 293 | do islope = 1,nslope |
|---|
| 294 | if (islope /= iflat) then ! ice can be infinite on flat ground |
|---|
| [2995] | 295 | ! First: check that CO2 ice must flow (excess of ice on the slope), ice can accumulate infinitely on flat ground |
|---|
| [4074] | 296 | if (qice(ig,islope) >= rho_ice(Tice(ig,islope),'H2O')*hmax(ig,islope)*cos(pi*def_slope_mean(islope)/180._dp)) then |
|---|
| [2995] | 297 | ! Second: determine the flatest slopes possible: |
|---|
| [3527] | 298 | if (islope > iflat) then |
|---|
| [3991] | 299 | iaval = islope - 1 |
|---|
| [3527] | 300 | else |
|---|
| 301 | iaval = islope + 1 |
|---|
| [4065] | 302 | end if |
|---|
| [4071] | 303 | do while (iaval /= iflat .and. abs(subslope_dist(ig,iaval)) < minieps) |
|---|
| [3527] | 304 | if (iaval > iflat) then |
|---|
| 305 | iaval = iaval - 1 |
|---|
| 306 | else |
|---|
| 307 | iaval = iaval + 1 |
|---|
| [4065] | 308 | end if |
|---|
| 309 | end do |
|---|
| [4074] | 310 | qice(ig,iaval) = qice(ig,iaval) + (qice(ig,islope) - rho_ice(Tice(ig,islope),'H2O')*hmax(ig,islope)*cos(pi*def_slope_mean(islope)/180._dp)) & |
|---|
| [4065] | 311 | *subslope_dist(ig,islope)/subslope_dist(ig,iaval)*cos(pi*def_slope_mean(iaval)/180._dp)/cos(pi*def_slope_mean(islope)/180._dp) |
|---|
| [2995] | 312 | |
|---|
| [4074] | 313 | qice(ig,islope) = rho_ice(Tice(ig,islope),'H2O')*hmax(ig,islope)*cos(pi*def_slope_mean(islope)/180._dp) |
|---|
| [4065] | 314 | flag_flow(ig,islope) = .true. |
|---|
| 315 | end if ! co2ice > hmax |
|---|
| 316 | end if ! iflat |
|---|
| 317 | end do !islope |
|---|
| 318 | end do !ig |
|---|
| [2995] | 319 | |
|---|
| [3149] | 320 | END SUBROUTINE |
|---|
| [2995] | 321 | |
|---|
| [3149] | 322 | !======================================================================= |
|---|
| [4065] | 323 | SUBROUTINE computeTcondCO2(vmr_co2_PEM,ps_PCM,ps_avg_glob_ini,ps_avg_global,Tcond) |
|---|
| [3991] | 324 | !----------------------------------------------------------------------- |
|---|
| 325 | ! NAME |
|---|
| 326 | ! computeTcondCO2 |
|---|
| 327 | ! |
|---|
| 328 | ! DESCRIPTION |
|---|
| 329 | ! Compute CO2 condensation temperature. |
|---|
| 330 | ! |
|---|
| 331 | ! AUTHORS & DATE |
|---|
| 332 | ! L. Lange |
|---|
| 333 | ! JB Clement, 2023-2025 |
|---|
| 334 | ! |
|---|
| 335 | ! NOTES |
|---|
| 336 | ! |
|---|
| 337 | !----------------------------------------------------------------------- |
|---|
| [3532] | 338 | |
|---|
| [3991] | 339 | ! DEPENDENCIES |
|---|
| 340 | ! ------------ |
|---|
| [4065] | 341 | use geometry, only: ngrid, nday |
|---|
| 342 | use planet, only: alpha_clap_co2, beta_clap_co2 |
|---|
| [2995] | 343 | |
|---|
| [3991] | 344 | ! DECLARATION |
|---|
| 345 | ! ----------- |
|---|
| [3532] | 346 | implicit none |
|---|
| [2995] | 347 | |
|---|
| [3991] | 348 | ! ARGUMENTS |
|---|
| 349 | ! --------- |
|---|
| [4065] | 350 | real(dp), dimension(:,:), intent(in) :: vmr_co2_PEM ! VMR of CO2 in the first layer [mol/mol] |
|---|
| 351 | real(dp), dimension(:,:), intent(in) :: ps_PCM ! Surface pressure in the PCM [Pa] |
|---|
| 352 | real(dp), intent(in) :: ps_avg_glob_ini ! Global averaged surfacepressure in the PCM [Pa] |
|---|
| 353 | real(dp), intent(in) :: ps_avg_global ! Global averaged surface pressure computed during the PEM iteration |
|---|
| 354 | real(dp), dimension(:,:), intent(out) :: Tcond ! Condensation temperature of CO2, yearly averaged |
|---|
| [2995] | 355 | |
|---|
| [3991] | 356 | ! LOCAL VARIABLES |
|---|
| 357 | ! --------------- |
|---|
| [4065] | 358 | integer(di) :: ig, it |
|---|
| [3149] | 359 | |
|---|
| [3991] | 360 | ! CODE |
|---|
| 361 | ! ---- |
|---|
| [3149] | 362 | do ig = 1,ngrid |
|---|
| [4065] | 363 | Tcond(ig,:) = 0._dp |
|---|
| 364 | do it = 1,nday |
|---|
| 365 | Tcond(ig,:) = Tcond(ig,:) + beta_clap_co2/(alpha_clap_co2 - log(vmr_co2_PEM(ig,it)*ps_PCM(ig,it)*ps_avg_glob_ini/ps_avg_global/100._dp)) |
|---|
| 366 | end do |
|---|
| 367 | Tcond(ig,:) = Tcond(ig,:)/nday |
|---|
| 368 | end do |
|---|
| [2995] | 369 | |
|---|
| [3149] | 370 | END SUBROUTINE computeTcondCO2 |
|---|
| [3991] | 371 | !======================================================================= |
|---|
| [2995] | 372 | |
|---|
| [3989] | 373 | END MODULE glaciers |
|---|