Ignore:
Timestamp:
Nov 20, 2024, 3:53:19 PM (26 hours ago)
Author:
jbclement
Message:

PEM:

  • Removing redundant Norbert Schorghofer's subroutines/parameters (follow-up of r3526);
  • Making all Norbert Schorghofer's subroutines with modern explicit interface via modules;
  • Cleaning of "glaciers_mod.F90";
  • Optimization for the computation of ice density according to temperature by using a function.

JBC

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.COMMON/libf/evolution/ice_table_mod.F90

    r3525 r3527  
    184184        do islope = 1,nslope
    185185            call compute_Tice_pem(nsoil,tsoil(ig,:,islope),tsurf(ig,islope),icetable_depth(ig,islope),Tice)
    186             rho = -3.5353e-4*Tice**2 + 0.0351*Tice + 933.5030 ! Rottgers, 2012
    187             delta_m_h2o(ig) = delta_m_h2o(ig) + porosity*rho*(icetable_thickness(ig,islope) - icetable_thickness_old(ig,islope)) & ! convention > 0. <=> it condenses
     186            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
    188187                              *subslope_dist(ig,islope)/cos(def_slope_mean(islope)*pi/180.)
    189188        enddo
     
    195194            do isoil = 1,nsoil
    196195                call compute_Tice_pem(nsoil,tsoil(ig,:,islope),tsurf(ig,islope),mlayer_PEM(isoil - 1),Tice)
    197                 rho = -3.5353e-4*Tice**2 + 0.0351*Tice + 933.5030 ! Rottgers, 2012
    198                 delta_m_h2o(ig) = delta_m_h2o(ig) + rho*(ice_porefilling(ig,isoil,islope) - ice_porefilling_old(ig,isoil,islope)) & ! convention > 0. <=> it condenses
     196                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
    199197                                  *subslope_dist(ig,islope)/cos(def_slope_mean(islope)*pi/180.)
    200198            enddo
     
    258256    index_tmp = nsoilmx_PEM
    259257    do ilay = 1,nsoilmx_PEM
    260         call constriction(porefill(ilay),eta(ilay))
     258        eta(ilay) = constriction(porefill(ilay))
    261259    enddo
    262260else
    263261    index_tmp = index_IS
    264262    do ilay = 1,index_IS - 1
    265         call constriction(porefill(ilay),eta(ilay))
     263        eta(ilay) = constriction(porefill(ilay))
    266264    enddo
    267265    do ilay = index_IS,nsoilmx_PEM
     
    350348
    351349!-----------------------------------------------------------------------
    352 SUBROUTINE constriction(porefill,eta)
     350FUNCTION constriction(porefill) RESULT(eta)
    353351
    354352!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     
    363361
    364362real, intent(in) :: porefill ! pore filling fraction
    365 real, intent(out) :: eta ! constriction
     363real :: eta ! constriction
    366364
    367365if (porefill <= 0.) then
     
    373371endif
    374372
    375 END SUBROUTINE constriction
     373END FUNCTION constriction
    376374
    377375!-----------------------------------------------------------------------
     
    386384
    387385use comsoil_h_PEM, only: layer_PEM, mlayer_PEM
     386use abort_pem_mod, only: abort_pem
    388387
    389388implicit none
     
    422421    endif
    423422    if (indexice < 0) then
    424         call abort_physic("compute_Tice_pem","subsurface ice is below the last soil layer",1)
     423        call abort_pem("compute_Tice_pem","Subsurface ice is below the last soil layer!",1)
    425424    else
    426425        if(indexice >= 1) then ! Linear inteprolation between soil temperature
     
    434433END SUBROUTINE compute_Tice_pem
    435434
     435!-----------------------------------------------------------------------
     436FUNCTION rho_ice(T,ice) RESULT(rho)
     437!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     438!!!
     439!!! Purpose: Compute subsurface ice density
     440!!!
     441!!! Author: JBC
     442!!!
     443!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     444
     445use abort_pem_mod, only: abort_pem
     446
     447implicit none
     448
     449real,         intent(in) :: T
     450character(3), intent(in) :: ice
     451real :: rho
     452
     453select case (trim(adjustl(ice)))
     454    case('h2o')
     455        rho = -3.5353e-4*T**2 + 0.0351*T + 933.5030 ! Rottgers 2012
     456    case('co2')
     457        rho = (1.72391 - 2.53e-4*T-2.87*1e-7*T**2)*1.e3 ! Mangan et al. 2017
     458    case default
     459        call abort_pem("rho_ice","Type of ice not known!",1)
     460end select
     461
     462END FUNCTION rho_ice
     463
    436464END MODULE ice_table_mod
Note: See TracChangeset for help on using the changeset viewer.