Ignore:
Timestamp:
May 16, 2024, 6:40:20 PM (7 months ago)
Author:
jbclement
Message:

PEM:
Update of the layering algorithm + corrections of wrong lines commited in r3330.
JBC

Location:
trunk/LMDZ.COMMON/libf/evolution
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.COMMON/libf/evolution/changelog.txt

    r3330 r3331  
    315315== 16/05/2024 == JBC
    316316Improvement of a flag-like variable (more robust as a logical) to know where co2 ice was at the beginning.
     317
     318== 16/05/2024 == JBC
     319Update of the layering algorithm + corrections of wrong lines commited in r3330.
  • trunk/LMDZ.COMMON/libf/evolution/layering_mod.F90

    r3321 r3331  
    474474htend_dust = tend_dust/rho_dust
    475475
    476 if (htend_dust < 0.) then ! Dust lifting
     476if (htend_dust < 0.) then ! Dust lifting only
    477477    if (abs(htend_co2ice) > eps .or. abs(htend_h2oice) > eps) error stop 'Situation not managed: dust lifting + CO2/H2O ice condensation/sublimation!'
    478478    write(*,'(a)') ' Stratification -> Dust lifting'
     
    506506else
    507507
    508 !------ Dust sedimentation
     508!------ Dust sedimentation only
    509509    if (abs(htend_co2ice) < eps .and. abs(htend_h2oice) < eps) then
    510510        write(*,'(a)') ' Stratification -> Dust sedimentation'
    511511        ! New stratum at the layering top by sedimentation of dust
    512512        thickness = htend_dust/(1. - dry_regolith_porosity)
    513         if (thickness > 0.) then ! Only if the stratum is builiding up
     513        if (thickness > 0.) then ! Only if the stratum is building up
    514514             if (new_str) then
    515515                 call add_stratum(this,thickness,this%top%top_elevation + thickness,0.,0.,htend_dust/thickness,dry_regolith_porosity)
     
    526526        ! New stratum at the layering top by condensation of CO2 and H2O ice
    527527        thickness = htend_co2ice/(1. - co2ice_porosity) + htend_h2oice/(1. - h2oice_porosity) + htend_dust
    528         if (thickness > 0.) then ! Only if the stratum is builiding up
     528        if (thickness > 0.) then ! Only if the stratum is building up
    529529             if (new_str) then
    530530                 call add_stratum(this,thickness,this%top%top_elevation + thickness,htend_co2ice/thickness,htend_h2oice/thickness,htend_dust/thickness,1. - (htend_co2ice/thickness + htend_h2oice/thickness + htend_dust/thickness))
     
    550550                h2subl_tot = 0.
    551551                call subl_co2ice_layering(this,current1,h2subl,h_co2ice_old,h_h2oice_old,h_dust_old,new_lag1)
    552             else if (h_co2ice_old < eps) then ! There is nothing to sublimate so we move to the underlying stratum
    553                 current1 => current1%down
    554                 new_lag1 = .true.
     552            else if (h_co2ice_old < eps) then ! There is nothing to sublimate so we stop here
     553                !current1 => current1%down ! Move to the underlying stratum
     554                !new_lag1 = .true.
     555                exit
    555556            else ! Only a fraction can sublimate and so we move to the underlying stratum
    556557                h2subl = h_co2ice_old
     
    567568        ! New stratum at the layering top by condensation of H2O ice
    568569        thickness = htend_h2oice/(1. - h2oice_porosity) + htend_dust
    569         if (thickness > 0.) then ! Only if the stratum is builiding up
     570        if (thickness > 0.) then ! Only if the stratum is building up
    570571             if (new_str) then
    571572                 call add_stratum(this,thickness,this%top%top_elevation + thickness,0.,htend_h2oice/thickness,htend_dust/thickness,1. - (htend_h2oice/thickness + htend_dust/thickness))
     
    591592                h2subl_tot = 0.
    592593                call subl_co2ice_layering(this,current1,h2subl,h_co2ice_old,h_h2oice_old,h_dust_old,new_lag1)
    593             else if (h_co2ice_old < eps) then ! There is nothing to sublimate so we move to the underlying stratum
    594                 current1 => current1%down
    595                 new_lag1 = .true.
     594            else if (h_co2ice_old < eps) then ! There is nothing to sublimate so we stop here
     595                !current1 => current1%down ! Move to the underlying stratum
     596                !new_lag1 = .true.
     597                exit
    596598            else ! Only a fraction can sublimate and so we move to the underlying stratum
    597599                h2subl = h_co2ice_old
     
    617619                h2subl_tot = 0.
    618620                call subl_h2oice_layering(this,current2,h2subl,h_co2ice_old,h_h2oice_old,h_dust_old,new_lag2)
    619             else if (h_h2oice_old < eps) then ! There is nothing to sublimate so we move to the underlying stratum
    620                 current2 => current2%down
    621                 new_lag2 = .true.
     621            else if (h_h2oice_old < eps) then ! There is nothing to sublimate so we stop here
     622                !current2 => current1%down ! Move to the underlying stratum
     623                !new_lag2 = .true.
     624                exit
    622625            else ! Only a fraction can sublimate and so we move to the underlying stratum
    623626                h2subl = h_h2oice_old
     
    682685endif
    683686
    684 
    685687! New stratum = dust lag
    686688h_lag = hsubl_dust/(1. - dry_lag_porosity)
  • trunk/LMDZ.COMMON/libf/evolution/pem.F90

    r3330 r3331  
    792792        do islope = 1,nslope
    793793            if (is_co2ice_ini(ig,islope) .and. co2_ice(ig,islope) < 1.e-10 .and. .not. co2ice_disappeared(ig,islope)) then ! co2 ice disappeared, look for closest point without co2ice
    794                 co2ice_disappeared = .true.
     794                co2ice_disappeared(ig,islope) = .true.
    795795                if (latitude_deg(ig) > 0) then
    796796                    do ig_loop = ig,ngrid
     
    816816                    enddo
    817817                endif
    818                 is_co2ice_ini(ig,islope) = .false.
    819818                if ((co2_ice(ig,islope) < 1.e-10) .and. (h2o_ice(ig,islope) > frost_albedo_threshold)) then
    820819                    albedo(ig,1,islope) = albedo_h2o_frost
Note: See TracChangeset for help on using the changeset viewer.