Changeset 3983 for trunk/LMDZ.COMMON/libf/evolution/pem.F90
- Timestamp:
- Dec 8, 2025, 11:27:43 AM (7 days ago)
- File:
-
- 1 edited
-
trunk/LMDZ.COMMON/libf/evolution/pem.F90 (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/pem.F90
r3979 r3983 38 38 use conf_pem_mod, only: conf_pem 39 39 use 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 40 use glaciers_mod, only: flow_co2glaciers, flow_h2oglaciers, co2ice_flow, h2oice_flow, inf_h2oice_threshold, computeTcondCO2, set_perice4PCM 42 41 use stopping_crit_mod, only: stopping_crit_h2o_ice, stopping_crit_co2, stopping_crit_h2o, stopFlags 43 42 use constants_marspem_mod, only: alpha_clap_co2, beta_clap_co2, alpha_clap_h2o, beta_clap_h2o, m_co2, m_noco2 … … 83 82 use dimradmars_mod, only: totcloudfrac, albedo 84 83 use dust_param_mod, only: tauscaling 85 use tracer_mod, only: noms, igcm_h2o_ice, igcm_co2,mmol, igcm_h2o_vap ! Tracer names and molar masses84 use tracer_mod, only: noms, mmol, igcm_h2o_vap ! Tracer names and molar masses 86 85 use mod_phys_lmdz_para, only: is_parallel, is_sequential, is_mpi_root, is_omp_root, is_master 87 86 use planete_h, only: year_day 88 87 use surfini_mod, only: surfini 89 88 use comcstfi_h, only: mugaz 89 use metamorphism, only: ini_frost_id, set_frost4PCM, iPCM_h2ofrost, iPCM_co2frost 90 90 91 91 #ifndef CPP_1D … … 161 161 real :: ps_avg_global_old ! constant: Global average pressure of previous time step 162 162 real :: 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 step163 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 167 167 type(stopFlags) :: stopCrit ! Stopping criteria 168 168 real :: 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]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] 170 170 integer :: timelen ! # time samples 171 171 real :: 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 172 real, dimension(:,:), allocatable :: d_h2oice_new ! Adjusted tendencies to keep balance between donor and recipient 173 real, dimension(:,:), allocatable :: min_h2oice ! Yearly minimum of H2O ice for the last year of the PCM 173 174 real :: S_atm_2_h2o, S_h2o_2_atm, S_atm_2_h2oice, S_h2oice_2_atm ! Variables to balance H2O 174 175 … … 183 184 real, dimension(:,:), allocatable :: vmr_co2_PEM_phys ! Grid points x Times co2 volume mixing ratio used in the PEM 184 185 real, 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] 186 real, dimension(:,:), allocatable :: min_co2ice ! Yearly minimum of CO2 ice for the last year of the PCM 185 187 real(kind = 16) :: totmass_co2ice, totmass_atmco2 ! Current total CO2 masses 186 188 real(kind = 16) :: totmass_co2ice_ini, totmass_atmco2_ini ! Initial total CO2 masses … … 413 415 414 416 call 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 417 call ini_frost_id(nqtot,noms) 418 do nnq = 1,nqtot 418 419 if (noms(nnq) == "h2o_vap") then 419 420 igcm_h2o_vap = nnq 420 421 mmol(igcm_h2o_vap) = 18. 421 422 endif 422 if (noms(nnq) == "co2") igcm_co2 = nnq423 423 enddo 424 424 … … 448 448 allocate(watersurf_density_avg(ngrid,nslope),watersoil_density_timeseries(ngrid,nsoilmx,nslope,timelen)) 449 449 allocate(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) 450 allocate(min_co2ice(ngrid,nslope),min_h2oice(ngrid,nslope)) 451 452 call 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 452 455 vmr_co2_PCM = q_co2_PEM_phys/(A*q_co2_PEM_phys + B)/m_co2 453 456 d_co2ice_ini = d_co2ice … … 947 950 write(*,*) '********* PEM finalization *********' 948 951 ! 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 952 call set_frost4PCM(qsurf) 953 call set_perice4PCM(ngrid,nslope,qsurf,watercaptag,watercap,perennial_co2ice) 976 954 977 955 ! III.a.3. Tsurf update for start file … … 1069 1047 endif 1070 1048 ! H2O frost 1071 if (qsurf(ig,i gcm_h2o_ice,islope) > 0.) then1049 if (qsurf(ig,iPCM_h2ofrost,islope) > 0.) then 1072 1050 albedo(ig,:,islope) = albedo_h2o_frost 1073 1051 emis(ig,islope) = 1. 1074 1052 endif 1075 1053 ! CO2 frost 1076 if (qsurf(ig,i gcm_co2,islope) > 0.) then1054 if (qsurf(ig,iPCM_co2frost,islope) > 0.) then 1077 1055 albedo(ig,:,islope) = albedice(icap) 1078 1056 emis(ig,islope) = emisice(icap) … … 1134 1112 call pemdem0("restartpem.nc",longitude,latitude,cell_area,ngrid,nslope,def_slope,subslope_dist) 1135 1113 call 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) 1137 1115 1138 1116 call info_PEM(i_myear_leg,stopCrit%stop_code(),i_myear,n_myear)
Note: See TracChangeset
for help on using the changeset viewer.
