Changeset 3778 for trunk/LMDZ.COMMON/libf/evolution/layering_mod.F90
- Timestamp:
- May 26, 2025, 10:34:57 AM (4 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/LMDZ.COMMON/libf/evolution/layering_mod.F90 ¶
r3770 r3778 2 2 3 3 !======================================================================= 4 ! Purpose: Manage layered depositsin the PEM with a linked list data structure4 ! Purpose: Manage layered layerings_map in the PEM with a linked list data structure 5 5 ! 6 6 ! Author: JBC … … 19 19 20 20 ! Physical parameters 21 real, parameter :: d_dust = 5.78e-2 ! Tendency of dust [kg.m-2.y-1] 22 real, parameter :: dry_lag_porosity = 0.4 ! Porosity of dust lag 23 real, parameter :: dry_regolith_porosity = 0.4 ! Porosity of regolith 24 real, parameter :: breccia_porosity = 0.1 ! Porosity of breccia 25 real, parameter :: co2ice_porosity = 0. ! Porosity of CO2 ice 26 real, parameter :: h2oice_porosity = 0. ! Porosity of H2O ice 27 real, parameter :: rho_dust = 2500. ! Density of dust [kg.m-3] 28 real, parameter :: rho_rock = 3200. ! Density of rock [kg.m-3] 21 real, parameter :: d_dust = 5.78e-2 ! Tendency of dust [kg.m-2.y-1] 22 real, parameter :: dry_lag_porosity = 0.4 ! Porosity of dust lag 23 real, parameter :: dry_regolith_porosity = 0.4 ! Porosity of regolith 24 real, parameter :: breccia_porosity = 0.1 ! Porosity of breccia 25 real, parameter :: co2ice_porosity = 0. ! Porosity of CO2 ice 26 real, parameter :: h2oice_porosity = 0. ! Porosity of H2O ice 27 real, parameter :: rho_dust = 2500. ! Density of dust [kg.m-3] 28 real, parameter :: rho_rock = 3200. ! Density of rock [kg.m-3] 29 real, parameter :: h_patchy_dust = 0.05 ! Height under which a dust statum is considered patchy [m] 29 30 30 31 ! Lag layer parameters -> see Levrard et al. 2007 31 real, parameter :: hmin_lag = 0.5! Minimal height of the lag deposit to reduce the sublimation rate32 real, parameter :: hmin_lag = 0.5 ! Minimal height of the lag deposit to reduce the sublimation rate 32 33 real, parameter :: fred_subl = 0.1 ! Reduction factor of sublimation rate 33 34 … … 49 50 type(stratum), pointer :: bottom => null() ! First stratum (head of the list) 50 51 type(stratum), pointer :: top => null() ! Last stratum (tail of the list) 52 !real :: h_toplag ! Height of dust layer at the top [m] 53 !type(stratum), pointer :: subice => null() ! Shallower stratum containing ice 54 !type(stratum), pointer :: surf => null() ! Surface stratum 51 55 end type layering 52 56 … … 70 74 ! > stratif2array 71 75 ! > array2stratif 72 ! > print_ deposits76 ! > print_layerings_map 73 77 ! Procedures to get information about a stratum: 74 78 ! > thickness 79 ! > thickness_toplag 75 80 ! > is_co2ice_str 76 81 ! > is_h2oice_str 77 82 ! > is_dust_str 78 83 ! > is_dust_lag 79 ! > compute_h_toplag84 ! > subsurface_ice_layering 80 85 ! Procedures for the algorithm to evolve the layering: 81 86 ! > make_layering … … 118 123 allocate(str) 119 124 nullify(str%up,str%down) 120 str%top_elevation = 1.121 str%h_co2ice = 0.122 str%h_h2oice = 0.123 str%h_dust = 1.124 str%h_pore = 0.125 str%top_elevation = 1. 126 str%h_co2ice = 0. 127 str%h_h2oice = 0. 128 str%h_dust = 1. 129 str%h_pore = 0. 125 130 str%poreice_volfrac = 0. 126 if (present(top_elevation)) str%top_elevation = top_elevation127 if (present(co2ice)) str%h_co2ice= co2ice128 if (present(h2oice)) str%h_h2oice= h2oice129 if (present(dust)) str%h_dust= dust130 if (present(pore)) str%h_pore= pore131 if (present(poreice)) str%poreice_volfrac = poreice131 if (present(top_elevation)) str%top_elevation = top_elevation 132 if (present(co2ice)) str%h_co2ice = co2ice 133 if (present(h2oice)) str%h_h2oice = h2oice 134 if (present(dust)) str%h_dust = dust 135 if (present(pore)) str%h_pore = pore 136 if (present(poreice)) str%poreice_volfrac = poreice 132 137 133 138 ! Increment the number of strata … … 167 172 allocate(str) 168 173 nullify(str%up,str%down) 169 str%top_elevation = 1.170 str%h_co2ice = 0.171 str%h_h2oice = 0.172 str%h_dust = 1.173 str%h_pore = 0.174 str%top_elevation = 1. 175 str%h_co2ice = 0. 176 str%h_h2oice = 0. 177 str%h_dust = 1. 178 str%h_pore = 0. 174 179 str%poreice_volfrac = 0. 175 if (present(top_elevation)) str%top_elevation = top_elevation176 if (present(co2ice)) str%h_co2ice= co2ice177 if (present(h2oice)) str%h_h2oice= h2oice178 if (present(dust)) str%h_dust= dust179 if (present(pore)) str%h_pore= pore180 if (present(poreice)) str%poreice_volfrac = poreice180 if (present(top_elevation)) str%top_elevation = top_elevation 181 if (present(co2ice)) str%h_co2ice = co2ice 182 if (present(h2oice)) str%h_h2oice = h2oice 183 if (present(dust)) str%h_dust = dust 184 if (present(pore)) str%h_pore = pore 185 if (present(poreice)) str%poreice_volfrac = poreice 181 186 182 187 ! Increment the number of strata … … 353 358 !======================================================================= 354 359 ! To get the maximum number of "stratum" in the stratification (layerings) 355 FUNCTION get_nb_str_max( stratif,ngrid,nslope) RESULT(nb_str_max)356 357 implicit none 358 359 !---- Arguments 360 type(layering), dimension(ngrid,nslope), intent(in) :: stratif360 FUNCTION get_nb_str_max(layerings_map,ngrid,nslope) RESULT(nb_str_max) 361 362 implicit none 363 364 !---- Arguments 365 type(layering), dimension(ngrid,nslope), intent(in) :: layerings_map 361 366 integer, intent(in) :: ngrid, nslope 362 367 integer :: nb_str_max … … 369 374 do islope = 1,nslope 370 375 do ig = 1,ngrid 371 nb_str_max = max( stratif(ig,islope)%nb_str,nb_str_max)376 nb_str_max = max(layerings_map(ig,islope)%nb_str,nb_str_max) 372 377 enddo 373 378 enddo … … 376 381 377 382 !======================================================================= 378 ! To convert the stratification data structure (layerings)into an array able to be outputted379 SUBROUTINE stratif2array( stratif,ngrid,nslope,stratif_array)383 ! To convert the layerings map into an array able to be outputted 384 SUBROUTINE stratif2array(layerings_map,ngrid,nslope,stratif_array) 380 385 381 386 implicit none … … 383 388 !---- Arguments 384 389 integer, intent(in) :: ngrid, nslope 385 type(layering), dimension(ngrid,nslope), intent(in) :: stratif390 type(layering), dimension(ngrid,nslope), intent(in) :: layerings_map 386 391 real, dimension(:,:,:,:), allocatable, intent(inout) :: stratif_array 387 392 … … 394 399 do islope = 1,nslope 395 400 do ig = 1,ngrid 396 current => stratif(ig,islope)%bottom401 current => layerings_map(ig,islope)%bottom 397 402 k = 1 398 403 do while (associated(current)) … … 412 417 413 418 !======================================================================= 414 ! To convert the stratification array into the stratification data structure (layerings)415 SUBROUTINE array2stratif(stratif_array,ngrid,nslope, stratif)419 ! To convert the stratification array into the layerings map 420 SUBROUTINE array2stratif(stratif_array,ngrid,nslope,layerings_map) 416 421 417 422 implicit none … … 420 425 integer, intent(in) :: ngrid, nslope 421 426 real, dimension(:,:,:,:), allocatable, intent(in) :: stratif_array 422 type(layering), dimension(ngrid,nslope), intent(inout) :: stratif427 type(layering), dimension(ngrid,nslope), intent(inout) :: layerings_map 423 428 424 429 !---- Local variables … … 429 434 do ig = 1,ngrid 430 435 do k = 1,size(stratif_array,3) 431 call add_stratum( stratif(ig,islope),stratif_array(ig,islope,k,1),stratif_array(ig,islope,k,2),stratif_array(ig,islope,k,3),stratif_array(ig,islope,k,4),stratif_array(ig,islope,k,5),stratif_array(ig,islope,k,6))436 call add_stratum(layerings_map(ig,islope),stratif_array(ig,islope,k,1),stratif_array(ig,islope,k,2),stratif_array(ig,islope,k,3),stratif_array(ig,islope,k,4),stratif_array(ig,islope,k,5),stratif_array(ig,islope,k,6)) 432 437 enddo 433 438 enddo … … 437 442 438 443 !======================================================================= 439 ! To display deposits440 SUBROUTINE print_ deposits(this,ngrid,nslope)444 ! To display the map of layerings 445 SUBROUTINE print_layerings_map(this,ngrid,nslope) 441 446 442 447 implicit none … … 460 465 enddo 461 466 462 END SUBROUTINE print_ deposits467 END SUBROUTINE print_layerings_map 463 468 464 469 !======================================================================= … … 477 482 478 483 END FUNCTION thickness 479 480 !=======================================================================481 ! To know whether the stratum can be considered as a CO2 ice layer482 FUNCTION is_co2ice_str(str) RESULT(co2ice_str)483 484 implicit none485 486 !---- Arguments487 type(stratum), intent(in) :: str488 logical :: co2ice_str489 490 !---- Code491 co2ice_str = .false.492 if (str%h_co2ice > str%h_h2oice .and. str%h_co2ice > str%h_dust) co2ice_str = .true.493 494 END FUNCTION is_co2ice_str495 496 !=======================================================================497 ! To know whether the stratum can be considered as a H2O ice layer498 FUNCTION is_h2oice_str(str) RESULT(h2oice_str)499 500 implicit none501 502 !---- Arguments503 type(stratum), intent(in) :: str504 logical :: h2oice_str505 506 !---- Code507 h2oice_str = .false.508 if (str%h_h2oice > str%h_co2ice .and. str%h_h2oice > str%h_dust) h2oice_str = .true.509 510 END FUNCTION is_h2oice_str511 512 !=======================================================================513 ! To know whether the stratum can be considered as a dust layer514 FUNCTION is_dust_str(str) RESULT(dust_str)515 516 implicit none517 518 !---- Arguments519 type(stratum), intent(in) :: str520 logical :: dust_str521 522 !---- Code523 dust_str = .false.524 if (str%h_dust > str%h_co2ice .and. str%h_dust > str%h_h2oice) dust_str = .true.525 526 END FUNCTION is_dust_str527 528 !=======================================================================529 ! To know whether the stratum can be considered as a dust lag530 FUNCTION is_dust_lag(str) RESULT(dust_lag)531 532 implicit none533 534 !---- Arguments535 type(stratum), intent(in) :: str536 logical :: dust_lag537 538 !---- Code539 dust_lag = .false.540 if (str%h_co2ice < tol .and. str%h_h2oice < tol .and. str%poreice_volfrac < tol) dust_lag = .true.541 542 END FUNCTION is_dust_lag543 484 544 485 !======================================================================= … … 559 500 current => this%top 560 501 ! Is the considered stratum a dust lag? 561 do while ( current%h_co2ice < tol .and. current%h_h2oice < tol .and. current%poreice_volfrac < tol.and. associated(current))502 do while (is_dust_lag(current) .and. associated(current)) 562 503 h_toplag = h_toplag + thickness(current) 563 504 current => current%down … … 565 506 566 507 END FUNCTION thickness_toplag 508 509 !======================================================================= 510 ! To know whether the stratum can be considered as a CO2 ice layer 511 FUNCTION is_co2ice_str(str) RESULT(co2ice_str) 512 513 implicit none 514 515 !---- Arguments 516 type(stratum), intent(in) :: str 517 logical :: co2ice_str 518 519 !---- Code 520 co2ice_str = .false. 521 if (str%h_co2ice > str%h_h2oice .and. str%h_co2ice > str%h_dust) co2ice_str = .true. 522 523 END FUNCTION is_co2ice_str 524 525 !======================================================================= 526 ! To know whether the stratum can be considered as a H2O ice layer 527 FUNCTION is_h2oice_str(str) RESULT(h2oice_str) 528 529 implicit none 530 531 !---- Arguments 532 type(stratum), intent(in) :: str 533 logical :: h2oice_str 534 535 !---- Code 536 h2oice_str = .false. 537 if (str%h_h2oice > str%h_co2ice .and. str%h_h2oice > str%h_dust) h2oice_str = .true. 538 539 END FUNCTION is_h2oice_str 540 541 !======================================================================= 542 ! To know whether the stratum can be considered as a dust layer 543 FUNCTION is_dust_str(str) RESULT(dust_str) 544 545 implicit none 546 547 !---- Arguments 548 type(stratum), intent(in) :: str 549 logical :: dust_str 550 551 !---- Code 552 dust_str = .false. 553 if (str%h_dust > str%h_co2ice .and. str%h_dust > str%h_h2oice) dust_str = .true. 554 555 END FUNCTION is_dust_str 556 557 !======================================================================= 558 ! To know whether the stratum can be considered as a dust lag 559 FUNCTION is_dust_lag(str) RESULT(dust_lag) 560 561 implicit none 562 563 !---- Arguments 564 type(stratum), intent(in) :: str 565 logical :: dust_lag 566 567 !---- Code 568 dust_lag = .false. 569 if (str%h_co2ice < tol .and. str%h_h2oice < tol .and. str%poreice_volfrac < tol) dust_lag = .true. 570 571 END FUNCTION is_dust_lag 572 573 !======================================================================= 574 ! To get data about possible subsurface ice in a layering 575 SUBROUTINE subsurface_ice_layering(this,is_subsurface_ice,h_toplag,h2o_ice) 576 577 implicit none 578 579 !---- Arguments 580 type(layering), intent(in) :: this 581 logical, intent(out) :: is_subsurface_ice 582 real, intent(out) :: h2o_ice, h_toplag 583 584 !---- Local variables 585 type(stratum), pointer :: current 586 587 !---- Code 588 h_toplag = 0. 589 h2o_ice = 0. 590 is_subsurface_ice = .false. 591 current => this%top 592 ! Is the considered stratum a dust lag? 593 if (is_dust_lag(current)) return 594 do while (is_dust_lag(current) .and. associated(current)) 595 h_toplag = h_toplag + thickness(current) 596 current => current%down 597 enddo 598 ! Is the stratum below the dust lag made of ice? 599 if (is_h2oice_str(current)) then 600 if (h_toplag >= h_patchy_dust) then 601 is_subsurface_ice = .true. 602 else 603 h_toplag = 0. 604 h2o_ice = current%h_h2oice 605 endif 606 endif 607 608 END SUBROUTINE subsurface_ice_layering 567 609 568 610 !======================================================================= … … 597 639 zlag = 0. 598 640 641 ! NOTHING HAPPENS 642 if (abs(dh_co2ice) < tol .and. abs(dh_h2oice) < tol .and. abs(dh_dust) < tol) then 643 ! So we do nothing 644 !----------------------------------------------------------------------- 599 645 ! DUST SEDIMENTATION with possibly ice condensation 600 if (dh_dust > dh_co2ice .and. dh_dust > dh_h2oice .and. dh_co2ice >= 0. .and. dh_h2oice >= 0.) then646 else if (dh_dust > dh_co2ice .and. dh_dust > dh_h2oice .and. dh_co2ice >= 0. .and. dh_h2oice >= 0.) then 601 647 write(*,*) '> Layering: dust sedimentation' 602 648 h_pore = dh_dust*dry_regolith_porosity/(1. - dry_regolith_porosity) … … 608 654 else 609 655 this%top%top_elevation = this%top%top_elevation + h_tot 610 this%top%h_co2ice = this%top%h_co2ice+ dh_co2ice611 this%top%h_h2oice = this%top%h_h2oice+ dh_h2oice612 this%top%h_dust = this%top%h_dust+ dh_dust613 this%top%h_pore = this%top%h_pore+ h_pore656 this%top%h_co2ice = this%top%h_co2ice + dh_co2ice 657 this%top%h_h2oice = this%top%h_h2oice + dh_h2oice 658 this%top%h_dust = this%top%h_dust + dh_dust 659 this%top%h_pore = this%top%h_pore + h_pore 614 660 endif 615 661 !----------------------------------------------------------------------- 616 ! DUST LIFTING 617 !(with possibly ice sublimation???) 662 ! DUST LIFTING with possibly ice sublimation 618 663 !else if (dh_dust < dh_co2ice .and. dh_dust < dh_h2oice .and. dh_co2ice <= 0. .and. dh_h2oice <= 0.) then 619 664 else if (dh_dust < 0. .and. abs(dh_co2ice) < eps .and. abs(dh_h2oice) < eps) then … … 651 696 else 652 697 this%top%top_elevation = this%top%top_elevation + h_tot 653 this%top%h_co2ice = this%top%h_co2ice+ dh_co2ice654 this%top%h_h2oice = this%top%h_h2oice+ dh_h2oice655 this%top%h_dust = this%top%h_dust+ dh_dust656 this%top%h_pore = this%top%h_pore+ h_pore698 this%top%h_co2ice = this%top%h_co2ice + dh_co2ice 699 this%top%h_h2oice = this%top%h_h2oice + dh_h2oice 700 this%top%h_dust = this%top%h_dust + dh_dust 701 this%top%h_pore = this%top%h_pore + h_pore 657 702 endif 658 703 !----------------------------------------------------------------------- … … 710 755 711 756 !----------------------------------------------------------------------- 712 ! NOTHING HAPPENS713 else if (abs(dh_co2ice) < tol .and. abs(dh_h2oice) < tol .and. abs(dh_dust) < tol) then714 ! We do nothing715 !-----------------------------------------------------------------------716 757 ! UNUSUAL (WEIRD) SITUATION 717 758 else … … 741 782 ! Update of properties in the eroding dust lag 742 783 str%top_elevation = str%top_elevation - h2lift*(1. + str%h_pore/str%h_dust) 743 str%h_pore = str%h_pore- h2lift*str%h_pore/str%h_dust744 str%h_dust = str%h_dust- h2lift784 str%h_pore = str%h_pore - h2lift*str%h_pore/str%h_dust 785 str%h_dust = str%h_dust - h2lift 745 786 746 787 ! Remove the eroding dust lag if there is no dust anymore … … 775 816 ! Update of properties in the sublimating stratum 776 817 str%top_elevation = str%top_elevation - h2subl*(1. + h_pore/h_ice) - hsubl_dust 777 str%h_co2ice = str%h_co2ice- h2subl_co2ice778 str%h_h2oice = str%h_h2oice- h2subl_h2oice779 str%h_dust = str%h_dust- hsubl_dust780 str%h_pore = str%h_pore- h2subl*h_pore/h_ice818 str%h_co2ice = str%h_co2ice - h2subl_co2ice 819 str%h_h2oice = str%h_h2oice - h2subl_h2oice 820 str%h_dust = str%h_dust - hsubl_dust 821 str%h_pore = str%h_pore - h2subl*h_pore/h_ice 781 822 782 823 ! Correct the value of top_elevation for the upper strata
Note: See TracChangeset
for help on using the changeset viewer.