Changeset 4110 for trunk/LMDZ.COMMON/libf/evolution/pem.F90
- Timestamp:
- Mar 9, 2026, 10:29:53 AM (5 days ago)
- File:
-
- 1 edited
-
trunk/LMDZ.COMMON/libf/evolution/pem.F90 (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/pem.F90
r4090 r4110 26 26 use clim_state_init, only: read_start, read_startfi, read_startpem 27 27 use clim_state_rec, only: write_restart, write_restartfi, write_restartpem 28 use config, only: read_rundef 29 use display, only: print_ini, print_end, print_msg 28 use config, only: read_rundef, read_display_config 29 use display, only: print_ini, print_end, print_msg, LVL_NFO, LVL_WRN 30 30 use evolution, only: n_yr_run, n_yr_sim, ntot_yr_sim, nmax_yr_run, dt, idt, r_plnt2earth_yr, pem_ini_date 31 31 use geometry, only: ngrid, nslope, nday, nsoil_PCM, nsoil, cell_area, total_surface, nlayer 32 32 use glaciers, only: h2oice_flow, co2ice_flow, flow_co2glaciers, flow_h2oglaciers 33 33 use ice_table, only: icetable_equilibrium, icetable_dynamic, icetable_depth, icetable_thickness, ice_porefilling, evolve_ice_table 34 use layered_deposits, only: layering, do_layering, del_layering, evolve_layering, ptrarray, layering2surfice, surfice2layering 34 use layered_deposits, only: layering, do_layering, del_layering, evolve_layering, ptrarray, layering2surfice, surfice2layering, print_layering 35 35 use maths, only: pi 36 36 use numerics, only: dp, qp, di, li, k4, minieps, minieps_qp 37 use orbit, only: evo l_orbit, read_orbitpm, compute_maxyr_orbit, update_orbit38 use output, only: write_diagevo l, dim_ngrid, dim_nsoil37 use orbit, only: evo_orbit, read_orbitpm, compute_maxyr_orbit, update_orbit 38 use output, only: write_diagevo, dim_ngrid, dim_nsoil 39 39 use physics, only: g 40 40 use slopes, only: subslope_dist, def_slope_mean … … 158 158 ! ~~~~~~~~~~~~~~ 159 159 ! Header 160 call read_display_config() 160 161 call print_ini() 161 162 … … 203 204 call compute_maxyr_orbit(n_yr_sim,nmax_yr_runorb) 204 205 205 ! Read the "startevo l.nc"206 ! Read the "startevo.nc" 206 207 allocate(h2o_ice(ngrid,nslope),co2_ice(ngrid,nslope)) 207 208 allocate(h2o_ads_reg(ngrid,nsoil,nslope),co2_ads_reg(ngrid,nsoil,nslope),delta_h2o_ads(ngrid),delta_co2_ads(ngrid)) … … 214 215 ! Compute ice tendencies from yearly minima 215 216 allocate(d_h2oice(ngrid,nslope),d_co2ice(ngrid,nslope)) 216 call print_msg('> Computing surface ice tendencies' )217 call print_msg('> Computing surface ice tendencies',LVL_NFO) 217 218 call compute_tendice(minPCM_h2operice + minPCM_h2ofrost,h2o_ice(:,:) > 0._dp,d_h2oice) 218 call print_msg('H2O ice tendencies [kg/m2/yr] (min|max): '//real2str(minval(d_h2oice))//' | '//real2str(maxval(d_h2oice)) )219 call print_msg('H2O ice tendencies [kg/m2/yr] (min|max): '//real2str(minval(d_h2oice))//' | '//real2str(maxval(d_h2oice)),LVL_NFO) 219 220 call compute_tendice(minPCM_co2perice + minPCM_co2frost,co2_ice(:,:) > 0._dp,d_co2ice) 220 call print_msg('CO2 ice tendencies [kg/m2/yr] (min|max): '//real2str(minval(d_co2ice))//' | '//real2str(maxval(d_co2ice)) )221 call print_msg('CO2 ice tendencies [kg/m2/yr] (min|max): '//real2str(minval(d_co2ice))//' | '//real2str(maxval(d_co2ice)),LVL_NFO) 221 222 deallocate(minPCM_h2operice,minPCM_co2perice,minPCM_h2ofrost,minPCM_co2frost) 222 223 223 224 ! Save initial set-up useful for the next computations 224 call print_msg('> Saving some initial climate state variables' )225 call print_msg('> Saving some initial climate state variables',LVL_NFO) 225 226 allocate(d_co2ice_ini(ngrid,nslope),q_co2_ts_ini(ngrid,nday)) 226 227 allocate(is_h2oice_ini(ngrid,nslope),is_co2ice_ini(ngrid,nslope)) … … 250 251 end do 251 252 end do 252 call print_msg("Initial global average pressure [Pa] = "//real2str(ps_avg_glob_ini) )253 call print_msg("Initial surface area of sublimating CO2 ice [m2] = "//real2str(co2ice_sublim_coverage_ini) )254 call print_msg("Initial surface area of sublimating H2O ice [m2] = "//real2str(h2oice_sublim_coverage_ini) )253 call print_msg("Initial global average pressure [Pa] = "//real2str(ps_avg_glob_ini),LVL_NFO) 254 call print_msg("Initial surface area of sublimating CO2 ice [m2] = "//real2str(co2ice_sublim_coverage_ini),LVL_NFO) 255 call print_msg("Initial surface area of sublimating H2O ice [m2] = "//real2str(h2oice_sublim_coverage_ini),LVL_NFO) 255 256 if (do_sorption) call compute_totmass_adsorbed(h2o_ads_reg,co2_ads_reg,totmass_adsco2_ini,totmass_adsh2o) 256 257 257 258 ! Main evolution loop 258 259 ! ~~~~~~~~~~~~~~~~~~~ 259 call print_msg('' )260 call print_msg('********* Evolution *********' )260 call print_msg('',LVL_NFO) 261 call print_msg('********* Evolution *********',LVL_NFO) 261 262 if (do_layering) then 262 263 allocate(h2oice_depth(ngrid,nslope),h2oice_depth_old(ngrid,nslope),new_str(ngrid,nslope),new_lag(ngrid,nslope),current(ngrid,nslope)) … … 284 285 idt = 0 285 286 do while (n_yr_run < min(nmax_yr_runorb,nmax_yr_run) .and. n_yr_sim < ntot_yr_sim) 286 call print_msg('**** Iteration of the PEM run [Planetary years]: '//real2str(n_yr_run + dt) )287 call print_msg('**** Iteration of the PEM run [Planetary years]: '//real2str(n_yr_run + dt),LVL_NFO) 287 288 ! Evolve global surface pressure 288 289 call evolve_pressure(d_co2ice,delta_co2_ads,do_sorption,ps_avg_glob_old,ps_avg_glob,ps_avg) … … 298 299 do i = 1,ngrid 299 300 call evolve_layering(layerings_map(i,islope),d_co2ice(i,islope),d_h2oice_new(i,islope),new_str(i,islope),zshift_surf(i,islope),new_lag(i,islope),zlag(i,islope),current(i,islope)%p) 300 !call print_layering(layerings_map(i,islope))301 call print_layering(layerings_map(i,islope)) 301 302 end do 302 303 end do … … 355 356 356 357 ! Output the results 357 call print_msg('> Standard outputs' )358 call write_diagevo l('ps_avg_glob','Global average pressure','Pa',ps_avg_glob)358 call print_msg('> Standard outputs',LVL_NFO) 359 call write_diagevo('ps_avg_glob','Global average pressure','Pa',ps_avg_glob) 359 360 do islope = 1,nslope 360 361 if (nslope /= 1) then … … 363 364 num = '_slope'//num 364 365 end if 365 call write_diagevo l('h2oice'//num,'H2O ice','kg.m-2',h2o_ice(:,islope),(/dim_ngrid/))366 call write_diagevo l('co2ice'//num,'CO2 ice','kg.m-2',co2_ice(:,islope),(/dim_ngrid/))367 call write_diagevo l('d_h2oice'//num,'H2O ice tendency','kg.m-2.yr-1',d_h2oice(:,islope),(/dim_ngrid/))368 call write_diagevo l('d_co2ice'//num,'CO2 ice tendency','kg.m-2.yr-1',d_co2ice(:,islope),(/dim_ngrid/))366 call write_diagevo('h2oice'//num,'H2O ice','kg.m-2',h2o_ice(:,islope),(/dim_ngrid/)) 367 call write_diagevo('co2ice'//num,'CO2 ice','kg.m-2',co2_ice(:,islope),(/dim_ngrid/)) 368 call write_diagevo('d_h2oice'//num,'H2O ice tendency','kg.m-2.yr-1',d_h2oice(:,islope),(/dim_ngrid/)) 369 call write_diagevo('d_co2ice'//num,'CO2 ice tendency','kg.m-2.yr-1',d_co2ice(:,islope),(/dim_ngrid/)) 369 370 if (co2ice_flow) then 370 call write_diagevo l('Flow_co2ice'//num,'CO2 ice flow location','T/F',merge(1._dp,0._dp,is_co2ice_flow(:,islope)),(/dim_ngrid/))371 call write_diagevo('Flow_co2ice'//num,'CO2 ice flow location','T/F',merge(1._dp,0._dp,is_co2ice_flow(:,islope)),(/dim_ngrid/)) 371 372 deallocate(is_co2ice_flow) 372 373 end if 373 374 if (h2oice_flow) then 374 call write_diagevo l('Flow_h2oice'//num,'H2O ice flow location','T/F',merge(1._dp,0._dp,is_h2oice_flow(:,islope)),(/dim_ngrid/))375 call write_diagevo('Flow_h2oice'//num,'H2O ice flow location','T/F',merge(1._dp,0._dp,is_h2oice_flow(:,islope)),(/dim_ngrid/)) 375 376 deallocate(is_h2oice_flow) 376 377 end if 377 call write_diagevo l('tsurf'//num,'Surface temperature','K',tsurf_avg(:,islope),(/dim_ngrid/))378 call write_diagevo('tsurf'//num,'Surface temperature','K',tsurf_avg(:,islope),(/dim_ngrid/)) 378 379 if (do_soil) then 379 380 if (icetable_equilibrium) then 380 call write_diagevo l('icetable_depth'//num,'Ice table depth','m',icetable_depth(:,islope),(/dim_ngrid/))381 call write_diagevo l('icetable_thick'//num,'Ice table thickness','m',icetable_thickness(:,islope),(/dim_ngrid/))381 call write_diagevo('icetable_depth'//num,'Ice table depth','m',icetable_depth(:,islope),(/dim_ngrid/)) 382 call write_diagevo('icetable_thick'//num,'Ice table thickness','m',icetable_thickness(:,islope),(/dim_ngrid/)) 382 383 else if (icetable_dynamic) then 383 call write_diagevo l('icetable_depth'//num,'Ice table depth','m',icetable_depth(:,islope),(/dim_ngrid/))384 call write_diagevo l('ice_porefilling'//num,'Ice pore filling','-',ice_porefilling(:,:,islope),(/dim_ngrid,dim_nsoil/))384 call write_diagevo('icetable_depth'//num,'Ice table depth','m',icetable_depth(:,islope),(/dim_ngrid/)) 385 call write_diagevo('ice_porefilling'//num,'Ice pore filling','-',ice_porefilling(:,:,islope),(/dim_ngrid,dim_nsoil/)) 385 386 end if 386 call write_diagevo l('tsoil_avg'//num,'Soil temperature','K',tsoil_avg(:,:,islope),(/dim_ngrid,dim_nsoil/))387 call write_diagevo l('inertiesoil'//num,'Thermal inertia','SI',TI(:,:,islope),(/dim_ngrid,dim_nsoil/))387 call write_diagevo('tsoil_avg'//num,'Soil temperature','K',tsoil_avg(:,:,islope),(/dim_ngrid,dim_nsoil/)) 388 call write_diagevo('inertiesoil'//num,'Thermal inertia','SI',TI(:,:,islope),(/dim_ngrid,dim_nsoil/)) 388 389 if (do_sorption) then 389 call write_diagevo l('co2_ads_reg'//num,'CO2 adsorbed in regolith','kg.m-2',co2_ads_reg(:,:,islope),(/dim_ngrid,dim_nsoil/))390 call write_diagevo l('h2o_ads_reg'//num,'H2O adsorbed in regolith','kg.m-2',h2o_ads_reg(:,:,islope),(/dim_ngrid,dim_nsoil/))390 call write_diagevo('co2_ads_reg'//num,'CO2 adsorbed in regolith','kg.m-2',co2_ads_reg(:,:,islope),(/dim_ngrid,dim_nsoil/)) 391 call write_diagevo('h2o_ads_reg'//num,'H2O adsorbed in regolith','kg.m-2',h2o_ads_reg(:,:,islope),(/dim_ngrid,dim_nsoil/)) 391 392 end if 392 393 end if … … 404 405 end do 405 406 totmass_ini = max(totmass_atmco2_ini + totmass_co2ice_ini + totmass_adsco2_ini,minieps_qp) ! To avoid division by 0 406 call print_msg(" > Relative total CO2 mass balance = "//real2str(100._qp*(totmass_atmco2 + totmass_co2ice + totmass_adsco2 - totmass_atmco2_ini - totmass_co2ice_ini - totmass_adsco2_ini)/totmass_ini)//' %' )407 call print_msg(" > Relative total CO2 mass balance = "//real2str(100._qp*(totmass_atmco2 + totmass_co2ice + totmass_adsco2 - totmass_atmco2_ini - totmass_co2ice_ini - totmass_adsco2_ini)/totmass_ini)//' %',LVL_NFO) 407 408 if (abs((totmass_atmco2 + totmass_co2ice + totmass_adsco2 - totmass_atmco2_ini - totmass_co2ice_ini - totmass_adsco2_ini)/totmass_ini) > 0.01_qp) then 408 call print_msg(' /!\ Warning: mass balance is not conserved!')409 call print_msg('Mass balance is not conserved!',LVL_WRN) 409 410 totmass_ini = max(totmass_atmco2_ini,minieps_qp) ! To avoid division by 0 410 call print_msg(' Atmospheric CO2 mass balance = '//real2str(100._qp*(totmass_atmco2 - totmass_atmco2_ini)/totmass_ini)//' %')411 call print_msg(' Atmospheric CO2 mass balance = '//real2str(100._qp*(totmass_atmco2 - totmass_atmco2_ini)/totmass_ini)//' %',LVL_WRN) 411 412 totmass_ini = max(totmass_co2ice_ini,minieps_qp) ! To avoid division by 0 412 call print_msg(' CO2 ice mass balance = '//real2str(100._qp*(totmass_co2ice - totmass_co2ice_ini)/totmass_ini)//' %')413 call print_msg(' CO2 ice mass balance = '//real2str(100._qp*(totmass_co2ice - totmass_co2ice_ini)/totmass_ini)//' %',LVL_WRN) 413 414 totmass_ini = max(totmass_adsco2_ini,minieps_qp) ! To avoid division by 0 414 call print_msg(' Adsorbed CO2 mass balance = '//real2str(100._qp*(totmass_adsco2 - totmass_adsco2_ini)/totmass_ini)//' %')415 call print_msg(' Adsorbed CO2 mass balance = '//real2str(100._qp*(totmass_adsco2 - totmass_adsco2_ini)/totmass_ini)//' %',LVL_WRN) 415 416 end if 416 417 end if … … 438 439 439 440 ! Check the stopping criteria 440 call print_msg("> Checking the stopping criteria" )441 call print_msg("> Checking the stopping criteria",LVL_NFO) 441 442 call stopping_crit_pressure(ps_avg_glob_ini,ps_avg_glob,stopcrit) 442 443 call stopping_crit_h2oice(h2oice_sublim_coverage_ini,h2o_ice,d_h2oice,stopcrit) … … 448 449 if (stopcrit%stop_code() == 0 .and. timewall .and. real(c2 - c1,dp)/real(cr,dp) >= timelimit - antetime) stopcrit%time_limit_reached = .true. 449 450 if (stopcrit%is_any_set()) then 450 call print_msg(stopcrit%stop_message() )451 call print_msg(stopcrit%stop_message(),LVL_NFO) 451 452 exit 452 453 else 453 call print_msg('**** This run has achieved '//real2str(n_yr_run)//' Planetary years.' )454 call print_msg('**** The workflow has achieved '//real2str(n_yr_sim)//' Planetary years.' )455 call print_msg('**** This run is continuing!' )456 call print_msg('****' )454 call print_msg('**** This run has achieved '//real2str(n_yr_run)//' Planetary years.',LVL_NFO) 455 call print_msg('**** The workflow has achieved '//real2str(n_yr_sim)//' Planetary years.',LVL_NFO) 456 call print_msg('**** This run is continuing!',LVL_NFO) 457 call print_msg('****',LVL_NFO) 457 458 end if 458 459 end do ! End of the evolution loop … … 461 462 ! Finalization 462 463 ! ~~~~~~~~~~~~ 463 call print_msg('' )464 call print_msg('********* Finalization *********' )464 call print_msg('',LVL_NFO) 465 call print_msg('********* Finalization *********',LVL_NFO) 465 466 ! Update orbital parameters 466 if (evo l_orbit) call update_orbit(n_yr_sim,n_yr_run)467 if (evo_orbit) call update_orbit(n_yr_sim,n_yr_run) 467 468 468 469 ! Build ice for the PCM … … 492 493 call build4PCM_surf_rad_prop(h2o_ice,co2_ice,albedo4PCM,emissivity4PCM) 493 494 494 ! Write the "startevo l.nc"495 ! Write the "startevo.nc" 495 496 call write_restartpem(h2o_ice,co2_ice,tsoil_avg,TI,icetable_depth,icetable_thickness,ice_porefilling,h2o_ads_reg,co2_ads_reg,layerings_map) 496 497
Note: See TracChangeset
for help on using the changeset viewer.
