Ignore:
Timestamp:
Dec 8, 2025, 11:27:43 AM (7 days ago)
Author:
jbclement
Message:

PEM:

  • Removing completely the ice metamorphism computed by a threshold at the end of the PCM (which was commented).
  • Addition of a module "metamorphism" to compute the PCM frost at the PEM beginning and give it back to the PCM at the PEM end. The frost is considered as the ice given by the PCM "startfi.nc" which is above the yearly minimum. Thereby, metamorphism is performed through this operation.
  • Ice reservoirs representation in the PEM is modernized.

JBC

File:
1 edited

Legend:

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

    r3979 r3983  
    3838use conf_pem_mod,               only: conf_pem
    3939use pemredem,                   only: pemdem0, pemdem1
    40 use glaciers_mod,               only: flow_co2glaciers, flow_h2oglaciers, co2ice_flow, h2oice_flow, inf_h2oice_threshold, &
    41                                       metam_h2oice_threshold, metam_co2ice_threshold, metam_h2oice, metam_co2ice, computeTcondCO2
     40use glaciers_mod,               only: flow_co2glaciers, flow_h2oglaciers, co2ice_flow, h2oice_flow, inf_h2oice_threshold, computeTcondCO2, set_perice4PCM
    4241use stopping_crit_mod,          only: stopping_crit_h2o_ice, stopping_crit_co2, stopping_crit_h2o, stopFlags
    4342use constants_marspem_mod,      only: alpha_clap_co2, beta_clap_co2, alpha_clap_h2o, beta_clap_h2o, m_co2, m_noco2
     
    8382use dimradmars_mod,             only: totcloudfrac, albedo
    8483use dust_param_mod,             only: tauscaling
    85 use tracer_mod,                 only: noms, igcm_h2o_ice, igcm_co2, mmol, igcm_h2o_vap ! Tracer names and molar masses
     84use tracer_mod,                 only: noms, mmol, igcm_h2o_vap ! Tracer names and molar masses
    8685use mod_phys_lmdz_para,         only: is_parallel, is_sequential, is_mpi_root, is_omp_root, is_master
    8786use planete_h,                  only: year_day
    8887use surfini_mod,                only: surfini
    8988use comcstfi_h,                 only: mugaz
     89use metamorphism,               only: ini_frost_id, set_frost4PCM, iPCM_h2ofrost, iPCM_co2frost
    9090
    9191#ifndef CPP_1D
     
    161161real                                  :: ps_avg_global_old    ! constant: Global average pressure of previous time step
    162162real                                  :: ps_avg_global_new    ! constant: Global average pressure of current time step
    163 real,   dimension(:,:),   allocatable :: zplev_new            ! Grid points x Atmospheric field: mass of the atmospheric layers in the pem at current time step [kg/m^2]
    164 real,   dimension(:,:),   allocatable :: zplev_start0         ! Grid points x Atmospheric field: mass of the atmospheric layers in the start [kg/m^2]
    165 real,   dimension(:,:,:), allocatable :: zplev_timeseries_new ! Grid points x Atmospheric x Time: same as zplev_new, but in times series [kg/m ^2]
    166 real,   dimension(:,:,:), allocatable :: zplev_timeseries_old ! same but with the time series, for previous time step
     163real, dimension(:,:),     allocatable :: zplev_new            ! Grid points x Atmospheric field: mass of the atmospheric layers in the pem at current time step [kg/m^2]
     164real, dimension(:,:),     allocatable :: zplev_start0         ! Grid points x Atmospheric field: mass of the atmospheric layers in the start [kg/m^2]
     165real, dimension(:,:,:),  allocatable :: zplev_timeseries_new ! Grid points x Atmospheric x Time: same as zplev_new, but in times series [kg/m ^2]
     166real, dimension(:,:,:),  allocatable :: zplev_timeseries_old ! same but with the time series, for previous time step
    167167type(stopFlags)                       :: stopCrit             ! Stopping criteria
    168168real                                  :: A, B, mmean          ! Molar mass: intermediate A, B for computations of the  mean molar mass of the layer [mol/kg]
    169 real,   dimension(:,:),   allocatable :: q_h2o_PEM_phys       ! Grid points x Times: h2o mass mixing ratio computed in the PEM, first value comes from PCM [kg/kg]
     169real, dimension(:,:),     allocatable :: q_h2o_PEM_phys       ! Grid points x Times: h2o mass mixing ratio computed in the PEM, first value comes from PCM [kg/kg]
    170170integer                               :: timelen              ! # time samples
    171171real                                  :: extra_mass           ! Intermediate variables Extra mass of a tracer if it is greater than 1
    172 real, dimension(:,:),    allocatable  :: d_h2oice_new         ! Adjusted tendencies to keep balance between donor and recipient
     172real, dimension(:,:),     allocatable :: d_h2oice_new         ! Adjusted tendencies to keep balance between donor and recipient
     173real, dimension(:,:),     allocatable :: min_h2oice           ! Yearly minimum of H2O ice for the last year of the PCM
    173174real                                  :: S_atm_2_h2o, S_h2o_2_atm, S_atm_2_h2oice, S_h2oice_2_atm ! Variables to balance H2O
    174175
     
    183184real,    dimension(:,:), allocatable :: vmr_co2_PEM_phys       ! Grid points x Times co2 volume mixing ratio used in the PEM
    184185real,    dimension(:,:), allocatable :: q_co2_PEM_phys         ! Grid points x Times co2 mass mixing ratio in the first layer computed in the PEM, first value comes from PCM [kg/kg]
     186real,    dimension(:,:), allocatable :: min_co2ice             ! Yearly minimum of CO2 ice for the last year of the PCM
    185187real(kind = 16)                      :: totmass_co2ice, totmass_atmco2         ! Current total CO2 masses
    186188real(kind = 16)                      :: totmass_co2ice_ini, totmass_atmco2_ini ! Initial total CO2 masses
     
    413415
    414416call surfini(ngrid,nslope,qsurf)
    415 
    416 do nnq = 1,nqtot  ! Why not using ini_tracer?
    417     if (noms(nnq) == "h2o_ice") igcm_h2o_ice = nnq
     417call ini_frost_id(nqtot,noms)
     418do nnq = 1,nqtot
    418419    if (noms(nnq) == "h2o_vap") then
    419420        igcm_h2o_vap = nnq
    420421        mmol(igcm_h2o_vap) = 18.
    421422    endif
    422     if (noms(nnq) == "co2") igcm_co2 = nnq
    423423enddo
    424424
     
    448448allocate(watersurf_density_avg(ngrid,nslope),watersoil_density_timeseries(ngrid,nsoilmx,nslope,timelen))
    449449allocate(d_co2ice(ngrid,nslope),d_h2oice(ngrid,nslope),d_co2ice_ini(ngrid,nslope))
    450 
    451 call read_PCM_data(ngrid,nslope,nsoilmx,timelen,ps_avg,tsurf_avg,tsurf_avg_yr1,tsoil_avg,tsoil_timeseries,watersurf_density_avg,d_h2oice,d_co2ice,ps_timeseries,q_h2o_PEM_phys,q_co2_PEM_phys,watersoil_density_timeseries)
     450allocate(min_co2ice(ngrid,nslope),min_h2oice(ngrid,nslope))
     451
     452call read_PCM_data(ngrid,nslope,nsoilmx,timelen,qsurf(:,iPCM_h2ofrost,:),qsurf(:,iPCM_co2frost,:),ps_avg,tsurf_avg,tsurf_avg_yr1,tsoil_avg,tsoil_timeseries,watersurf_density_avg, &
     453                   d_h2oice,d_co2ice,ps_timeseries,q_h2o_PEM_phys,q_co2_PEM_phys,watersoil_density_timeseries,min_h2oice,min_co2ice)
     454
    452455vmr_co2_PCM = q_co2_PEM_phys/(A*q_co2_PEM_phys + B)/m_co2
    453456d_co2ice_ini = d_co2ice
     
    947950write(*,*) '********* PEM finalization *********'
    948951! III_a.1 Ice update for start file
    949 write(*,*) '> Reconstructing perennial ice and frost for the PCM'
    950 watercap = 0.
    951 perennial_co2ice = co2_ice
    952 do ig = 1,ngrid
    953     ! H2O ice metamorphism
    954     !if (metam_h2oice .and. sum(qsurf(ig,igcm_h2o_ice,:)*subslope_dist(ig,:)/cos(pi*def_slope_mean(:)/180.)) > metam_h2oice_threshold) then
    955     !    h2o_ice(ig,:) = h2o_ice(ig,:) + qsurf(ig,igcm_h2o_ice,:) - metam_h2oice_threshold
    956     !    qsurf(ig,igcm_h2o_ice,:) = metam_h2oice_threshold
    957     !endif
    958 
    959     ! Is H2O ice still considered as an infinite reservoir for the PCM?
    960     if (sum(h2o_ice(ig,:)*subslope_dist(ig,:)/cos(pi*def_slope_mean(:)/180.)) > inf_h2oice_threshold) then
    961         ! There is enough ice to be considered as an infinite reservoir
    962         watercaptag(ig) = .true.
    963     else
    964         ! Too little ice to be considered as an infinite reservoir so ice is transferred to the frost
    965         watercaptag(ig) = .false.
    966         qsurf(ig,igcm_h2o_ice,:) = qsurf(ig,igcm_h2o_ice,:) + h2o_ice(ig,:)
    967         h2o_ice(ig,:) = 0.
    968     endif
    969 
    970     ! CO2 ice metamorphism
    971     !if (metam_co2ice .and. sum(qsurf(ig,igcm_co2,:)*subslope_dist(ig,:)/cos(pi*def_slope_mean(:)/180.)) > metam_co2ice_threshold) then
    972     !    perennial_co2ice(ig,:) = perennial_co2ice(ig,:) + qsurf(ig,igcm_co2,:) - metam_co2ice_threshold
    973     !    qsurf(ig,igcm_co2,:) = metam_co2ice_threshold
    974     !endif
    975 enddo
     952call set_frost4PCM(qsurf)
     953call set_perice4PCM(ngrid,nslope,qsurf,watercaptag,watercap,perennial_co2ice)
    976954
    977955! III.a.3. Tsurf update for start file
     
    10691047        endif
    10701048        ! H2O frost
    1071         if (qsurf(ig,igcm_h2o_ice,islope) > 0.) then
     1049        if (qsurf(ig,iPCM_h2ofrost,islope) > 0.) then
    10721050            albedo(ig,:,islope) = albedo_h2o_frost
    10731051            emis(ig,islope) = 1.
    10741052        endif
    10751053        ! CO2 frost
    1076         if (qsurf(ig,igcm_co2,islope) > 0.) then
     1054        if (qsurf(ig,iPCM_co2frost,islope) > 0.) then
    10771055            albedo(ig,:,islope) = albedice(icap)
    10781056            emis(ig,islope) = emisice(icap)
     
    11341112call pemdem0("restartpem.nc",longitude,latitude,cell_area,ngrid,nslope,def_slope,subslope_dist)
    11351113call pemdem1("restartpem.nc",i_myear,nsoilmx_PEM,ngrid,nslope,tsoil_PEM,TI_PEM,icetable_depth,icetable_thickness,ice_porefilling, &
    1136              co2_adsorbed_phys,h2o_adsorbed_phys,h2o_ice,layerings_map)
     1114             co2_adsorbed_phys,h2o_adsorbed_phys,h2o_ice,co2_ice,layerings_map)
    11371115
    11381116call info_PEM(i_myear_leg,stopCrit%stop_code(),i_myear,n_myear)
Note: See TracChangeset for help on using the changeset viewer.