Changeset 4134 for trunk/LMDZ.COMMON/libf/evolution/pem.F90
- Timestamp:
- Mar 16, 2026, 3:24:12 PM (13 days ago)
- File:
-
- 1 edited
-
trunk/LMDZ.COMMON/libf/evolution/pem.F90 (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/pem.F90
r4117 r4134 23 23 ! PEM modules 24 24 use allocation, only: ini_allocation, end_allocation 25 use atmosphere, only: ps_PCM, evolve_pressure, CO2cond_ps_PCM, build4PCM_atmosphere 25 use atmosphere, only: ps_PCM, evolve_pressure, CO2cond_ps_PCM 26 use backup, only: save_clim_state, backup_rate 26 27 use clim_state_init, only: read_start, read_startfi, read_startpem 27 use clim_state_rec, only: write_restart, write_restartfi, write_restartpem28 28 use config, only: read_rundef, read_display_config 29 29 use display, only: print_ini, print_end, print_msg, LVL_NFO, LVL_WRN … … 39 39 use physics, only: g 40 40 use slopes, only: subslope_dist, def_slope_mean 41 use soil, only: do_soil, set_soil, TI , build4PCM_soil41 use soil, only: do_soil, set_soil, TI 42 42 use soil_temp, only: tsoil_PCM, shift_tsoil2surf, evolve_soil_temp 43 43 use soil_therm_inertia, only: update_soil_TI 44 44 use sorption, only: do_sorption, compute_totmass_adsorbed, evolve_regolith_adsorption 45 45 use stopping_crit, only: stopFlags, stopping_crit_pressure, stopping_crit_h2o, stopping_crit_h2oice, stopping_crit_co2ice 46 use surface, only: emissivity_PCM , build4PCM_surf_rad_prop47 use surf_ice, only: evolve_co2ice, evolve_h2oice, balance_h2oice_reservoirs , build4PCM_perice48 use surf_temp, only: tsurf_PCM, adapt_tsurf2disappearedice , build4PCM_tsurf46 use surface, only: emissivity_PCM 47 use surf_ice, only: evolve_co2ice, evolve_h2oice, balance_h2oice_reservoirs 48 use surf_temp, only: tsurf_PCM, adapt_tsurf2disappearedice 49 49 use tendencies, only: compute_tendice, evolve_tend_co2ice, evolve_tend_h2oice 50 use tracers, only: adapt_tracers2pressure , build4PCM_tracers, nq50 use tracers, only: adapt_tracers2pressure 51 51 use utility, only: real2str 52 52 use workflow_status, only: i_pem_run, read_workflow_status, update_workflow_status … … 71 71 real(dp) :: ps_avg_glob_old ! Global average pressure of previous time step [Pa] 72 72 real(dp) :: ps_avg_glob ! Global average pressure of current time step [Pa] 73 real(dp), dimension(:), allocatable :: ps4PCM ! Surface pressure reconstruction to feed back into PCM [Pa]74 real(dp), dimension(:,:), allocatable :: teta4PCM ! Potential temperature reconstruction to feed back into PCM [K]75 real(dp), dimension(:,:), allocatable :: air_mass4PCM ! Air mass reconstruction to feed back into PCM [kg]76 real(dp) :: pa4PCM ! Transition pressure (for hybrid coord.) [Pa]77 real(dp) :: preff4PCM ! Reference pressure [Pa]78 73 ! Ice-related: 79 74 real(dp), dimension(:,:), allocatable :: h2o_ice ! H2O ice [kg.m-2] … … 89 84 real(dp), dimension(:,:,:), allocatable :: minPCM_h2ofrost ! Minimum of H2O frost over the last PCM year [kg.m-2] 90 85 real(dp), dimension(:,:,:), allocatable :: minPCM_co2frost ! Minimum of CO2 frost over the last PCM year [kg.m-2] 91 real(dp), dimension(:,:), allocatable :: h2o_ice4PCM ! H2O ice reconstruction to feed back into PCM [kg.m-2]92 real(dp), dimension(:,:), allocatable :: co2_ice4PCM ! CO2 ice reconstruction to feed back into PCM [kg.m-2]93 logical(k4), dimension(:), allocatable :: is_h2o_perice ! Location of H2O infinite reservoir, called 'watercaptag' in PCM94 86 logical(k4), dimension(:,:), allocatable :: is_co2ice_disappeared ! Flag to check if CO2 ice disappeared at the previous timestep 95 87 ! Surface-related: … … 100 92 real(dp), dimension(:,:), allocatable :: zshift_surf ! Elevation shift for the surface [m] 101 93 real(dp), dimension(:,:), allocatable :: zlag ! Newly built lag thickness [m] 102 real(dp), dimension(:,:), allocatable :: albedo4PCM ! Albedo reconstruction to feed back into PCM103 real(dp), dimension(:,:), allocatable :: emissivity4PCM ! Emissivity reconstruction to feed back into PCM104 real(dp), dimension(:,:), allocatable :: tsurf4PCM ! Surface temperature reconstruction to feed back into PCM [K]105 94 ! Soil-related: 106 95 real(dp), dimension(:,:,:), allocatable :: tsoil_avg ! Average soil temperature [K] … … 112 101 real(dp), dimension(:), allocatable :: delta_h2o_ads ! Quantity of H2O exchanged due to adsorption/desorption [kg/m^2] 113 102 real(qp) :: totmass_adsh2o ! Total mass of H2O exchanged because of adsorption/desorption [kg] 114 real(dp), dimension(:,:,:), allocatable :: inertiesoil4PCM ! Soil thermal inertia reconstruction to feed back into PCM [SI]115 real(dp), dimension(:,:,:), allocatable :: tsoil4PCM ! Average soil temperature reconstruction to feed back into PCM [K]116 real(dp), dimension(:,:), allocatable :: flux_geo4PCM ! Geothermal flux reconstruction to feed back into PCM [W/m2]117 103 real(dp), dimension(:,:,:), allocatable :: h2o_ads_reg ! H2O adsorbed in the regolith [kg/m^2] 118 104 real(dp), dimension(:,:,:), allocatable :: co2_ads_reg ! CO2 adsorbed in the regolith [kg/m^2] … … 123 109 real(dp), dimension(:,:), allocatable :: q_co2_ts_ini ! Initial CO2 mass mixing ratio in the first layer [kg/kg] 124 110 real(dp), dimension(:,:), allocatable :: q_h2o_ts ! H2O mass mixing ratio in the first layer [kg/kg] 125 real(dp), dimension(:,:,:), allocatable :: q4PCM ! Tracers reconstruction to feed back into PCM [kg/kg]126 111 ! Tendency-related: 127 112 real(dp), dimension(:,:), allocatable :: d_co2ice ! Tendency of perennial CO2 ice [kg/m2/y] … … 440 425 idt = idt + 1 441 426 427 ! Save periodic backups of restart files 428 if (backup_rate > 0 .and. mod(idt,backup_rate) == 0) then 429 call save_clim_state(h2o_ice,co2_ice,tsurf_avg,tsurf_dev,tsoil_avg,tsoil_dev,ps_avg,ps_dev,ps_avg_glob,ps_avg_glob_ini, & 430 icetable_depth,icetable_thickness,ice_porefilling,h2o_ads_reg,co2_ads_reg,layerings_map,idt) 431 end if 432 442 433 ! Check the stopping criteria 443 434 call print_msg("> Checking the stopping criteria",LVL_NFO) … … 469 460 if (evo_orbit) call update_orbit(n_yr_sim,n_yr_run) 470 461 471 ! Build ice for the PCM 472 allocate(h2o_ice4PCM(ngrid,nslope),co2_ice4PCM(ngrid,nslope),is_h2o_perice(ngrid)) 473 call build4PCM_perice(h2o_ice,co2_ice,is_h2o_perice,h2o_ice4PCM,co2_ice4PCM) 474 475 ! Build surface temperature for the PCM 476 allocate(tsurf4PCM(ngrid,nslope)) 477 call build4PCM_tsurf(tsurf_avg,tsurf_dev,tsurf4PCM) 478 479 ! Build soil for the PCM 480 if (do_soil) then 481 allocate(tsoil4PCM(ngrid,nsoil_PCM,nslope),inertiesoil4PCM(ngrid,nsoil_PCM,nslope),flux_geo4PCM(ngrid,nslope)) 482 call build4PCM_soil(tsoil_avg,tsoil_dev,inertiesoil4PCM,tsoil4PCM,flux_geo4PCM) 483 end if 484 485 ! Build atmosphere for the PCM 486 allocate(ps4PCM(ngrid),teta4PCM(ngrid,nlayer),air_mass4PCM(ngrid,nlayer)) 487 call build4PCM_atmosphere(ps_avg,ps_dev,ps_avg_glob,ps_avg_glob_ini,ps4PCM,pa4PCM,preff4PCM,teta4PCM,air_mass4PCM) 488 489 ! Build tracers for the PCM 490 allocate(q4PCM(ngrid,nlayer,nq)) 491 call build4PCM_tracers(ps4PCM,q4PCM) 492 493 ! Build surface radiative properties state for the PCM 494 allocate(albedo4PCM(ngrid,nslope),emissivity4PCM(ngrid,nslope)) 495 call build4PCM_surf_rad_prop(h2o_ice,co2_ice,albedo4PCM,emissivity4PCM) 496 497 ! Write the "startevo.nc" 498 call write_restartpem(h2o_ice,co2_ice,tsoil_avg,TI,icetable_depth,icetable_thickness,ice_porefilling,h2o_ads_reg,co2_ads_reg,layerings_map) 499 500 ! Write the "startfi.nc" 501 call write_restartfi(is_h2o_perice,h2o_ice4PCM,co2_ice4PCM,tsurf4PCM,tsoil4PCM,inertiesoil4PCM,albedo4PCM,emissivity4PCM,flux_geo4PCM) 502 503 ! Write the "start.nc" 504 call write_restart(ps4PCM,pa4PCM,preff4PCM,q4PCM,teta4PCM,air_mass4PCM) 462 call save_clim_state(h2o_ice,co2_ice,tsurf_avg,tsurf_dev,tsoil_avg,tsoil_dev,ps_avg,ps_dev,ps_avg_glob,ps_avg_glob_ini, & 463 icetable_depth,icetable_thickness,ice_porefilling,h2o_ads_reg,co2_ads_reg,layerings_map) 505 464 506 465 ! Update the duration information of the workflow … … 508 467 509 468 ! Deallocation 510 deallocate(emissivity4PCM,albedo4PCM)511 deallocate(q4PCM)512 deallocate(ps4PCM,teta4PCM,air_mass4PCM)513 if (do_soil) deallocate(tsoil4PCM,inertiesoil4PCM,flux_geo4PCM)514 deallocate(tsurf4PCM)515 deallocate(co2_ice4PCM,h2o_ice4PCM,is_h2o_perice)516 469 deallocate(num) 517 470 if (do_layering) then
Note: See TracChangeset
for help on using the changeset viewer.
