Changeset 4117 for trunk/LMDZ.COMMON
- Timestamp:
- Mar 10, 2026, 4:52:43 PM (8 days ago)
- Location:
- trunk/LMDZ.COMMON/libf/evolution
- Files:
-
- 13 edited
-
atmosphere.F90 (modified) (1 diff)
-
changelog.txt (modified) (1 diff)
-
clim_state_init.F90 (modified) (7 diffs)
-
clim_state_rec.F90 (modified) (2 diffs)
-
config.F90 (modified) (1 diff)
-
deftank/pem_workflow_lib.sh (modified) (1 diff)
-
display.F90 (modified) (1 diff)
-
orbit.F90 (modified) (1 diff)
-
pem.F90 (modified) (2 diffs)
-
soil_therm_inertia.F90 (modified) (4 diffs)
-
sorption.F90 (modified) (15 diffs)
-
utility.F90 (modified) (1 diff)
-
workflow_status.F90 (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/atmosphere.F90
r4110 r4117 181 181 ! ---- 182 182 CO2cond_ps_PCM = CO2cond_ps_PCM_in 183 call print_msg(' set_CO2cond_ps_PCM = '//real2str(CO2cond_ps_PCM),LVL_NFO)183 call print_msg('CO2cond_ps_PCM = '//real2str(CO2cond_ps_PCM),LVL_NFO) 184 184 if (CO2cond_ps_PCM < 0._dp .or. CO2cond_ps_PCM > 1._dp) call stop_clean(__FILE__,__LINE__,'Value for ''CO2cond_ps'' is not between 0 and 1!',1) 185 185 -
trunk/LMDZ.COMMON/libf/evolution/changelog.txt
r4110 r4117 899 899 - Addition of workflow safety checks for required executables, dependencies (e.g. 'ncdump'), input files and callphys keys. 900 900 - Renaming of PEM starting and diagnostic files ("startevol.nc" into "startevo.nc", "diagevol.nc" into "diagevo.nc"). 901 902 == 10/03/2026 == JBC 903 - Remove 'd_h2oice' and 'd_co2ice' arguments from adsorption and soil thermal inertia routines (not needed and possible bugs). 904 - Move 'read_callphys' call from 'read_start1D' to 'read_rundef' so that 'CO2cond_ps' is initialized no matter what. 905 - Explicit initialization of 'delta_h2o_ads'/'delta_co2_ads' before 'read_startpem'. 906 - Add time index argument to 'put_var_nc' calls to write "restart.nc". 907 - Increase temporary string buffer size for 'real2str_qp'. 908 - Fixed some typos. -
trunk/LMDZ.COMMON/libf/evolution/clim_state_init.F90
r4110 r4117 125 125 use tracers, only: nq, set_q_PCM 126 126 use stoppage, only: stop_clean 127 use config, only: read_callphys128 127 use display, only: print_msg, LVL_NFO 129 128 … … 174 173 call set_ap(ap_tmp) 175 174 call set_bp(bp_tmp) 176 177 ! Read the "callphys.def"178 call read_callphys() ! To get 'CO2cond_ps'179 175 180 176 END SUBROUTINE read_start1D … … 300 296 301 297 !======================================================================= 302 SUBROUTINE read_startpem(tsurf_avg_yr1,tsurf_avg_yr2,ps_avg_glob,ps_ts,q_co2_ts,q_h2o_ts,h2o_surfdensity_avg, d_h2oice,d_co2ice,h2o_ice,co2_ice, &303 tsoil_avg,h2o_soildensity_avg,icetable_depth,icetable_thickness,ice_porefilling,layerings_map, &298 SUBROUTINE read_startpem(tsurf_avg_yr1,tsurf_avg_yr2,ps_avg_glob,ps_ts,q_co2_ts,q_h2o_ts,h2o_surfdensity_avg,h2o_ice,co2_ice, & 299 tsoil_avg,h2o_soildensity_avg,icetable_depth,icetable_thickness,ice_porefilling,layerings_map, & 304 300 h2o_ads_reg,co2_ads_reg,delta_h2o_ads,delta_co2_ads) 305 301 !----------------------------------------------------------------------- … … 351 347 real(dp), dimension(:,:), intent(in) :: q_co2_ts, q_h2o_ts ! MMR of CO2 and H2O 352 348 real(dp), dimension(:,:), intent(in) :: h2o_surfdensity_avg ! Average of surface water density 353 real(dp), dimension(:,:), intent(in) :: d_h2oice, d_co2ice ! Tendencies on ice354 349 real(dp), dimension(:,:), intent(inout) :: h2o_ice, co2_ice ! Surface ice 355 350 real(dp), dimension(:,:,:), intent(inout) :: tsoil_avg ! Soil temperature … … 471 466 if (icetable_equilibrium) then 472 467 call computeice_table_equilibrium(is_h2o_perice_PCM,h2o_surfdensity_avg,h2o_soildensity_avg,TI(:,1,:),icetable_depth,icetable_thickness) 473 call update_soil_TI( d_h2oice,h2o_ice,ps_avg_glob,icetable_depth,icetable_thickness,ice_porefilling,icetable_equilibrium,icetable_dynamic,TI)468 call update_soil_TI(h2o_ice,ps_avg_glob,icetable_depth,icetable_thickness,ice_porefilling,icetable_equilibrium,icetable_dynamic,TI) 474 469 do islope = 1,nslope 475 470 call ini_tsoil_pem(ngrid,nsoil,TI(:,:,islope),tsurf_avg_yr2(:,islope),tsoil_avg(:,:,islope)) 476 471 end do 477 472 else if (icetable_dynamic) then 478 call update_soil_TI( d_h2oice,h2o_ice,ps_avg_glob,icetable_depth,icetable_thickness,ice_porefilling,icetable_equilibrium,icetable_dynamic,TI)473 call update_soil_TI(h2o_ice,ps_avg_glob,icetable_depth,icetable_thickness,ice_porefilling,icetable_equilibrium,icetable_dynamic,TI) 479 474 do islope = 1,nslope 480 475 call ini_tsoil_pem(ngrid,nsoil,TI(:,:,islope),tsurf_avg_yr2(:,islope),tsoil_avg(:,:,islope)) … … 486 481 h2o_ads_reg = 0._dp 487 482 co2_ads_reg = 0._dp 488 call evolve_regolith_adsorption(d_h2oice,d_co2ice,h2o_ice,co2_ice,tsoil_avg,TI,ps_ts,q_h2o_ts,q_co2_ts,h2o_ads_reg,co2_ads_reg,delta_h2o_ads,delta_co2_ads) 489 delta_co2_ads = 0._dp 490 delta_h2o_ads = 0._dp 483 call evolve_regolith_adsorption(h2o_ice,co2_ice,tsoil_avg,TI,ps_ts,q_h2o_ts,q_co2_ts,h2o_ads_reg,co2_ads_reg,delta_h2o_ads,delta_co2_ads) 491 484 end if ! do_sorption 492 485 end if ! do_soil … … 565 558 call get_var_nc('co2_ads_reg',co2_ads_reg(:,:,:)) 566 559 call get_var_nc('h2o_ads_reg',h2o_ads_reg(:,:,:)) 567 call evolve_regolith_adsorption( d_h2oice,d_co2ice,h2o_ice,co2_ice,tsoil_avg,TI,ps_ts,q_h2o_ts,q_co2_ts,h2o_ads_reg,co2_ads_reg,delta_h2o_ads,delta_co2_ads)560 call evolve_regolith_adsorption(h2o_ice,co2_ice,tsoil_avg,TI,ps_ts,q_h2o_ts,q_co2_ts,h2o_ads_reg,co2_ads_reg,delta_h2o_ads,delta_co2_ads) 568 561 end if ! do_sorption 569 562 end if ! do_soil -
trunk/LMDZ.COMMON/libf/evolution/clim_state_rec.F90
r4110 r4117 95 95 ! Surface pressure 96 96 call vect2dyngrd(nlon + 1,nlat,ngrid,ps4PCM,ps_dyn) 97 call put_var_nc('ps',ps_dyn )97 call put_var_nc('ps',ps_dyn,1) 98 98 99 99 ! Potential temperature 100 100 call vect2dyngrd(nlon + 1,nlat,ngrid,teta4PCM,var_dyn) 101 call put_var_nc('teta',var_dyn )101 call put_var_nc('teta',var_dyn,1) 102 102 103 103 ! Air mass 104 104 call vect2dyngrd(nlon + 1,nlat,ngrid,air_mass4PCM,var_dyn) 105 call put_var_nc('masse',var_dyn )105 call put_var_nc('masse',var_dyn,1) 106 106 107 107 ! Tracers … … 110 110 call vect2dyngrd(nlon + 1,nlat,ngrid,q4PCM(:,l,i),var_dyn(:,:,l)) 111 111 end do 112 call put_var_nc(qnames(i),var_dyn )112 call put_var_nc(qnames(i),var_dyn,1) 113 113 end do 114 114 -
trunk/LMDZ.COMMON/libf/evolution/config.F90
r4110 r4117 208 208 call set_atmosphere_config(hybrid) 209 209 210 ! Read the "callphys.def" 211 call read_callphys() ! To get 'CO2cond_ps' 212 210 213 ! Check incompatibilities 211 214 call check_config_incompatibility() -
trunk/LMDZ.COMMON/libf/evolution/deftank/pem_workflow_lib.sh
r4110 r4117 28 28 if ! command -v "$1" >/dev/null 2>&1; then 29 29 echo "Error: required command '$1' not found." 30 echo "Please install or load the corres onding library."30 echo "Please install or load the corresponding library." 31 31 abort_workflow 32 32 fi -
trunk/LMDZ.COMMON/libf/evolution/display.F90
r4110 r4117 195 195 call print_msg('',LVL_NFO) 196 196 call print_msg('****** PEM final information *******',LVL_NFO) 197 write(msg,'(a,i0,a,f16.4,a)') ' + The run PEM #',i_pem_run,' achieved ', n_yr_run, ' Planetary years, completed in '//format_duration(dur_secs)//'.'197 write(msg,'(a,i0,a,f16.4,a)') '+ The run PEM #',i_pem_run,' achieved ', n_yr_run, ' Planetary years, completed in '//format_duration(dur_secs)//'.' 198 198 call print_msg(msg,LVL_NFO) 199 write(msg,'(a,f16.4,a,f16.4,a)') ' + The workflow has achieved ', n_yr_sim, ' Planetary years =', n_yr_sim*r_plnt2earth_yr, ' Earth years.'199 write(msg,'(a,f16.4,a,f16.4,a)') '+ The workflow has achieved ', n_yr_sim, ' Planetary years =', n_yr_sim*r_plnt2earth_yr, ' Earth years.' 200 200 call print_msg(msg,LVL_NFO) 201 write(msg,'(a,f16.4,a)') ' + The reached date is now ', (pem_ini_date + n_yr_sim)*r_plnt2earth_yr, ' Earth years.'201 write(msg,'(a,f16.4,a)') '+ The reached date is now ', (pem_ini_date + n_yr_sim)*r_plnt2earth_yr, ' Earth years.' 202 202 call print_msg(msg,LVL_NFO) 203 203 call print_msg('+ PEM: so far, so good!',LVL_NFO) -
trunk/LMDZ.COMMON/libf/evolution/orbit.F90
r4110 r4117 92 92 max_change_ecc = max_change_ecc_in 93 93 max_change_lsp = max_change_lsp_in 94 call print_msg('evo_orbit = '//bool2str(evo_orbit),LVL_NFO)95 call print_msg('evo_obl = '//bool2str(evo_obl),LVL_NFO)96 call print_msg('evo_ecc = '//bool2str(evo_ecc),LVL_NFO)97 call print_msg('evo_lsp = '//bool2str(evo_lsp),LVL_NFO)94 call print_msg('evo_orbit = '//bool2str(evo_orbit),LVL_NFO) 95 call print_msg('evo_obl = '//bool2str(evo_obl),LVL_NFO) 96 call print_msg('evo_ecc = '//bool2str(evo_ecc),LVL_NFO) 97 call print_msg('evo_lsp = '//bool2str(evo_lsp),LVL_NFO) 98 98 call print_msg('max_change_obl = '//real2str(max_change_obl),LVL_NFO) 99 99 call print_msg('max_change_ecc = '//real2str(max_change_ecc),LVL_NFO) -
trunk/LMDZ.COMMON/libf/evolution/pem.F90
r4110 r4117 208 208 allocate(h2o_ads_reg(ngrid,nsoil,nslope),co2_ads_reg(ngrid,nsoil,nslope),delta_h2o_ads(ngrid),delta_co2_ads(ngrid)) 209 209 allocate(layerings_map(ngrid,nslope)) 210 call read_startpem(tsurf_avg_yr1,tsurf_avg,ps_avg_glob_ini,ps_ts,q_co2_ts,q_h2o_ts,h2o_surfdensity_avg,d_h2oice,d_co2ice,h2o_ice,co2_ice, & 211 tsoil_avg,h2o_soildensity_avg,icetable_depth,icetable_thickness,ice_porefilling,layerings_map, & 210 delta_h2o_ads(:) = 0._dp 211 delta_co2_ads(:) = 0._dp 212 call read_startpem(tsurf_avg_yr1,tsurf_avg,ps_avg_glob_ini,ps_ts,q_co2_ts,q_h2o_ts,h2o_surfdensity_avg,h2o_ice,co2_ice, & 213 tsoil_avg,h2o_soildensity_avg,icetable_depth,icetable_thickness,ice_porefilling,layerings_map, & 212 214 h2o_ads_reg,co2_ads_reg,delta_h2o_ads,delta_co2_ads) 213 215 deallocate(tsurf_avg_yr1) … … 342 344 343 345 ! Update soil thermal properties according to ice table and soil temperature 344 call update_soil_TI( d_h2oice,h2o_ice,ps_avg_glob,icetable_depth,icetable_thickness,ice_porefilling,icetable_equilibrium,icetable_dynamic,TI)346 call update_soil_TI(h2o_ice,ps_avg_glob,icetable_depth,icetable_thickness,ice_porefilling,icetable_equilibrium,icetable_dynamic,TI) 345 347 346 348 ! Evolve adsorbed species 347 349 if (do_sorption) then 348 call evolve_regolith_adsorption( d_h2oice,d_co2ice,h2o_ice,co2_ice,tsoil_avg,TI,ps_ts,q_h2o_ts,q_co2_ts,h2o_ads_reg,co2_ads_reg,delta_h2o_ads,delta_co2_ads)350 call evolve_regolith_adsorption(h2o_ice,co2_ice,tsoil_avg,TI,ps_ts,q_h2o_ts,q_co2_ts,h2o_ads_reg,co2_ads_reg,delta_h2o_ads,delta_co2_ads) 349 351 call compute_totmass_adsorbed(h2o_ads_reg,co2_ads_reg,totmass_adsco2,totmass_adsh2o) 350 352 else -
trunk/LMDZ.COMMON/libf/evolution/soil_therm_inertia.F90
r4110 r4117 85 85 86 86 !======================================================================= 87 SUBROUTINE update_soil_TI( tendencies_waterice,waterice,p_avg_new,icetable_depth,icetable_thickness,ice_porefilling,icetable_equilibrium,icetable_dynamic,TI)87 SUBROUTINE update_soil_TI(h2o_ice,p_avg_new,icetable_depth,icetable_thickness,ice_porefilling,icetable_equilibrium,icetable_dynamic,TI) 88 88 !----------------------------------------------------------------------- 89 89 ! NAME … … 115 115 ! ARGUMENTS 116 116 ! --------- 117 real(dp), intent(in) :: p_avg_new ! Global average surface pressure [Pa] 118 real(dp), dimension(:,:), intent(in) :: tendencies_waterice ! Tendencies on the water ice [kg/m^2/year] 119 real(dp), dimension(:,:), intent(in) :: waterice ! Surface Water ice [kg/m^2] 120 real(dp), dimension(:,:), intent(in) :: icetable_depth ! Ice table depth [m] 121 real(dp), dimension(:,:), intent(in) :: icetable_thickness ! Ice table thickness [m] 122 real(dp), dimension(:,:,:), intent(in) :: ice_porefilling ! Ice porefilling [m^3/m^3] 117 real(dp), intent(in) :: p_avg_new ! Global average surface pressure [Pa] 118 real(dp), dimension(:,:), intent(in) :: h2o_ice ! Surface Water ice [kg/m^2] 119 real(dp), dimension(:,:), intent(in) :: icetable_depth ! Ice table depth [m] 120 real(dp), dimension(:,:), intent(in) :: icetable_thickness ! Ice table thickness [m] 121 real(dp), dimension(:,:,:), intent(in) :: ice_porefilling ! Ice porefilling [m^3/m^3] 123 122 logical(k4), intent(in) :: icetable_equilibrium, icetable_dynamic ! Computing method for ice table 124 real(dp), dimension(:,:,:), intent(inout) :: TI ! Soil Thermal Inertia [J/m^2/K/s^1/2]123 real(dp), dimension(:,:,:), intent(inout) :: TI ! Soil Thermal Inertia [J/m^2/K/s^1/2] 125 124 126 125 ! LOCAL VARIABLES … … 141 140 regolith_inertia(:,islope) = inertiedat(:,1) 142 141 do ig = 1,ngrid 143 if ( tendencies_waterice(ig,islope) < -1.e-5_dp .and. abs(waterice(ig,islope)) < minieps) regolith_inertia(ig,islope) = TI_regolith_avg142 if (abs(h2o_ice(ig,islope)) < minieps) regolith_inertia(ig,islope) = TI_regolith_avg 144 143 if (reg_thprop_dependp) then 145 144 if (TI(ig,1,islope) < reg_inertie_thresold) then … … 153 152 end do 154 153 155 ! 2. Build new Thermal Inertia154 ! 2. Build new thermal inertia 156 155 do islope = 1,nslope 157 156 do ig = 1,ngrid -
trunk/LMDZ.COMMON/libf/evolution/sorption.F90
r4110 r4117 69 69 70 70 !======================================================================= 71 SUBROUTINE evolve_regolith_adsorption( d_h2oice,d_co2ice,h2oice,co2ice,tsoil,TI,ps,q_h2o_ts,q_co2_ts,h2o_ads_reg,co2_ads_reg,delta_h2o_ads,delta_co2_ads)71 SUBROUTINE evolve_regolith_adsorption(h2o_ice,co2_ice,tsoil,TI,ps,q_h2o_ts,q_co2_ts,h2o_ads_reg,co2_ads_reg,delta_h2o_ads,delta_co2_ads) 72 72 !----------------------------------------------------------------------- 73 73 ! NAME … … 96 96 ! ARGUMENTS 97 97 ! --------- 98 real(dp), dimension(:,:), intent(in) :: d_h2oice, d_co2ice ! tendencies on the glaciers [1] 99 real(dp), dimension(:,:), intent(in) :: h2oice ! H2O ice at the surface [kg/m^2] 100 real(dp), dimension(:,:), intent(in) :: co2ice ! CO2 ice at the surface [kg/m^2] 98 real(dp), dimension(:,:), intent(in) :: h2o_ice ! H2O ice at the surface [kg/m^2] 99 real(dp), dimension(:,:), intent(in) :: co2_ice ! CO2 ice at the surface [kg/m^2] 101 100 real(dp), dimension(:,:,:), intent(in) :: TI ! Soil Thermal inertia [J/K/^2/s^1/2] 102 101 real(dp), dimension(:,:,:), intent(in) :: tsoil ! Soil temperature [K] … … 114 113 ! CODE 115 114 ! ---- 116 call evolve_h2o_ads( d_h2oice,d_co2ice,h2oice,co2ice,ps,q_h2o_ts,q_co2_ts,tsoil,TI,theta_h2o_ads,h2o_ads_reg,delta_h2o_ads)117 call evolve_co2_ads( d_h2oice,d_co2ice,h2oice,co2ice,ps,q_h2o_ts,q_co2_ts,tsoil,TI,co2_ads_reg,delta_co2_ads)115 call evolve_h2o_ads(h2o_ice,co2_ice,ps,q_h2o_ts,q_co2_ts,tsoil,TI,theta_h2o_ads,h2o_ads_reg,delta_h2o_ads) 116 call evolve_co2_ads(h2o_ice,co2_ice,ps,q_h2o_ts,q_co2_ts,tsoil,TI,co2_ads_reg,delta_co2_ads) 118 117 119 118 END SUBROUTINE evolve_regolith_adsorption … … 121 120 122 121 !======================================================================= 123 SUBROUTINE evolve_h2o_ads( d_h2oice,d_co2ice,h2oice,co2ice,ps,q_h2o_ts,q_co2_ts,tsoil,TI,theta_h2o_ads,h2o_ads_reg,delta_h2o_ads)122 SUBROUTINE evolve_h2o_ads(h2o_ice,co2_ice,ps,q_h2o_ts,q_co2_ts,tsoil,TI,theta_h2o_ads,h2o_ads_reg,delta_h2o_ads) 124 123 !----------------------------------------------------------------------- 125 124 ! NAME … … 152 151 ! ARGUMENTS 153 152 ! --------- 154 real(dp), dimension(:,:), intent(in) :: d_h2oice, d_co2ice ! Tendencies on the glaciers () 155 real(dp), dimension(:,:), intent(in) :: h2oice ! H2O ice at the surface [kg/m^2] 156 real(dp), dimension(:,:), intent(in) :: co2ice ! CO2 ice at the surface [kg/m^2] 157 real(dp), dimension(:,:), intent(in) :: ps ! Surface pressure [Pa] 158 real(dp), dimension(:,:), intent(in) :: q_co2_ts ! Mass mixing ratio of CO2 in the first layer [kg/kg] 159 real(dp), dimension(:,:), intent(in) :: q_h2o_ts ! Mass mixing ratio of H2O in the first layer [kg/kg] 160 real(dp), dimension(:,:,:), intent(in) :: TI ! Soil Thermal inertia [J/K/^2/s^1/2] 161 real(dp), dimension(:,:,:), intent(in) :: tsoil ! Soil temperature [K] 162 real(dp), dimension(:,:,:), intent(inout) :: h2o_ads_reg ! Density of H2O adsorbed [kg/m^3] 163 real(dp), dimension(:,:,:), intent(out) :: theta_h2o_ads ! Fraction of the pores occupied by H2O molecules 164 real(dp), dimension(:), intent(out) :: delta_h2o_ads ! Difference density of H2O adsorbed [kg/m^3] 153 real(dp), dimension(:,:), intent(in) :: h2o_ice ! H2O ice at the surface [kg/m^2] 154 real(dp), dimension(:,:), intent(in) :: co2_ice ! CO2 ice at the surface [kg/m^2] 155 real(dp), dimension(:,:), intent(in) :: ps ! Surface pressure [Pa] 156 real(dp), dimension(:,:), intent(in) :: q_co2_ts ! Mass mixing ratio of CO2 in the first layer [kg/kg] 157 real(dp), dimension(:,:), intent(in) :: q_h2o_ts ! Mass mixing ratio of H2O in the first layer [kg/kg] 158 real(dp), dimension(:,:,:), intent(in) :: TI ! Soil Thermal inertia [J/K/^2/s^1/2] 159 real(dp), dimension(:,:,:), intent(in) :: tsoil ! Soil temperature [K] 160 real(dp), dimension(:,:,:), intent(inout) :: h2o_ads_reg ! Density of H2O adsorbed [kg/m^3] 161 real(dp), dimension(:,:,:), intent(out) :: theta_h2o_ads ! Fraction of the pores occupied by H2O molecules 162 real(dp), dimension(:), intent(out) :: delta_h2o_ads ! Difference density of H2O adsorbed [kg/m^3] 165 163 166 164 ! LOCAL VARIABLES … … 177 175 real(dp) :: K ! Used to compute theta 178 176 integer(di) :: ig, iloop, islope, it ! For loops 179 logical(k4), dimension(ngrid,nslope) :: ispermanent_co2glaciers ! Check if the CO2 glacier is permanent 180 logical(k4), dimension(ngrid,nslope) :: ispermanent_h2oglaciers ! Check if the H2O glacier is permanent 181 real(dp), dimension(ngrid,nslope) :: deltam_reg_slope ! Difference density of H2O adsorbed per slope [kg/m^3] 182 real(dp), dimension(ngrid,nsoil,nslope) :: dm_h2o_regolith_slope ! Elementary H2O mass adsorded per mesh per slope 177 real(dp), dimension(ngrid,nslope) :: deltam_reg_slope ! Difference density of H2O adsorbed per slope [kg/m^3] 178 real(dp), dimension(ngrid,nsoil,nslope) :: dm_h2o_regolith_slope ! Elementary H2O mass adsorded per mesh per slope 183 179 real(dp) :: A, B ! Used to compute the mean mass above the surface 184 180 real(dp) :: p_sat ! Saturated vapor pressure of ice 185 real(dp), dimension(:,:), allocatable:: mass_mean ! Mean mass above the surface186 real(dp), dimension(:,:), allocatable:: zplev_mean ! Pressure above the surface187 real(dp), dimension(:,:), allocatable:: pvapor ! Partial pressure above the surface188 real(dp), dimension(:) , allocatable:: pvapor_avg ! Yearly averaged181 real(dp), dimension(:,:), allocatable :: mass_mean ! Mean mass above the surface 182 real(dp), dimension(:,:), allocatable :: zplev_mean ! Pressure above the surface 183 real(dp), dimension(:,:), allocatable :: pvapor ! Partial pressure above the surface 184 real(dp), dimension(:) , allocatable :: pvapor_avg ! Yearly averaged 189 185 190 186 ! CODE … … 196 192 theta_h2o_ads = 0._dp 197 193 dm_h2o_regolith_slope = 0._dp 198 ispermanent_h2oglaciers = .false. 199 ispermanent_co2glaciers = .false. 200 201 ! 0.1 Look at perennial ice 202 where (abs(d_h2oice(:,:)) > 1.e-5 .and. h2oice(:,:) > 0._dp) ispermanent_h2oglaciers(:,:) = .true. 203 where (abs(d_co2ice(:,:)) > 1.e-5 .and. co2ice(:,:) > 0._dp) ispermanent_co2glaciers(:,:) = .true. 204 205 ! 0.2 Compute the partial pressure of vapor 194 195 ! 0. Compute the partial pressure of vapor 206 196 ! a. the molecular mass into the column 207 197 do ig = 1,ngrid … … 243 233 deltam_reg_slope(ig,islope) = 0._dp 244 234 do iloop = 1,index_breccia 245 if (TI(ig,iloop,islope) < inertie_thresold .and. .not. ispermanent_h2oglaciers(ig,islope) .and. .not. ispermanent_co2glaciers(ig,islope)) then235 if (TI(ig,iloop,islope) < inertie_thresold .and. abs(h2o_ice(ig,islope)) < minieps .and. abs(co2_ice(ig,islope)) < minieps) then 246 236 if (iloop == 1) then 247 237 deltam_reg_complete(ig,iloop,islope) = (dm_h2o_regolith_slope(ig,iloop,islope) - h2o_ads_reg(ig,iloop,islope))*(layer(iloop)) … … 263 253 264 254 !======================================================================= 265 SUBROUTINE evolve_co2_ads( d_h2oice,d_co2ice,h2oice,co2ice,ps,q_h2o_ts,q_co2_ts,tsoil,TI,co2_ads_reg,delta_co2_ads)255 SUBROUTINE evolve_co2_ads(h2o_ice,co2_ice,ps,q_h2o_ts,q_co2_ts,tsoil,TI,co2_ads_reg,delta_co2_ads) 266 256 267 257 !----------------------------------------------------------------------- … … 298 288 real(dp), dimension(:,:,:), intent(in) :: tsoil ! Mean Soil Temperature [K] 299 289 real(dp), dimension(:,:,:), intent(in) :: TI ! Mean Thermal Inertia [USI] 300 real(dp), dimension(:,:), intent(in) :: d_h2oice, d_co2ice ! Tendencies on the glaciers ()301 290 real(dp), dimension(:,:), intent(in) :: q_co2_ts, q_h2o_ts ! Mass mixing ratio of CO2 and H2O in the first layer [kg/kg] 302 real(dp), dimension(:,:), intent(in) :: h2o ice! Water ice at the surface [kg/m^2]303 real(dp), dimension(:,:), intent(in) :: co2 ice! CO2 ice at the surface [kg/m^2]291 real(dp), dimension(:,:), intent(in) :: h2o_ice ! Water ice at the surface [kg/m^2] 292 real(dp), dimension(:,:), intent(in) :: co2_ice ! CO2 ice at the surface [kg/m^2] 304 293 real(dp), dimension(:,:,:), intent(inout) :: co2_ads_reg ! Density of CO2 adsorbed [kg/m^3] 305 294 real(dp), dimension(:), intent(out) :: delta_co2_ads ! Difference density of CO2 adsorbed [kg/m^3] … … 317 306 integer(di) :: ig, islope, iloop, it ! For loops 318 307 real(dp), dimension(ngrid,nsoil,nslope) :: dm_co2_regolith_slope ! Elementary mass adsorded per mesh per slope 319 logical(k4), dimension(ngrid,nslope) :: ispermanent_co2glaciers ! Check if the CO2 glacier is permanent320 logical(k4), dimension(ngrid,nslope) :: ispermanent_h2oglaciers ! Check if the H2O glacier is permanent321 308 real(dp), dimension(ngrid,index_breccia,nslope) :: deltam_reg_complete ! Difference in the mass per slope and soil layer [kg/m^3] 322 309 real(dp), dimension(ngrid,nslope) :: deltam_reg_slope ! Difference in the mass per slope [kg/m^3] … … 339 326 dm_co2_regolith_slope = 0._dp 340 327 delta_co2_ads = 0._dp 341 ispermanent_h2oglaciers = .false. 342 ispermanent_co2glaciers = .false. 343 344 ! 0.1 Look at perennial ice 345 where (abs(d_h2oice(:,:)) > 1.e-5 .and. h2oice(:,:) > 0._dp) ispermanent_h2oglaciers(:,:) = .true. 346 where (abs(d_co2ice(:,:)) > 1.e-5 .and. co2ice(:,:) > 0._dp) ispermanent_co2glaciers(:,:) = .true. 347 348 ! 0.2 Compute the partial pressure of CO2 328 329 ! 0. Compute the partial pressure of CO2 349 330 ! a. the molecular mass into the column 350 331 do ig = 1,ngrid … … 366 347 367 348 ! 1. Compute the fraction of the pores occupied by H2O 368 call evolve_h2o_ads( d_h2oice,d_co2ice,h2oice,co2ice,ps,q_co2_ts,q_h2o_ts,tsoil,TI,theta_h2o_ads,m_h2o_adsorbed,delta_mh2o)349 call evolve_h2o_ads(h2o_ice,co2_ice,ps,q_co2_ts,q_h2o_ts,tsoil,TI,theta_h2o_ads,m_h2o_adsorbed,delta_mh2o) 369 350 370 351 ! 2. we compute the mass of CO2 adsorded in each layer of the meshes … … 372 353 do islope = 1,nslope 373 354 do iloop = 1,index_breccia 374 if (TI(ig,iloop,islope) < inertie_thresold .and. .not. ispermanent_h2oglaciers(ig,islope) .and. .not. ispermanent_co2glaciers(ig,islope)) then355 if (TI(ig,iloop,islope) < inertie_thresold .and. abs(h2o_ice(ig,islope)) < minieps .and. abs(co2_ice(ig,islope)) < minieps) then 375 356 dm_co2_regolith_slope(ig,iloop,islope) = as*rho_regolith*m_theta*(1._dp - theta_h2o_ads(ig,iloop,islope))*alpha*pco2_avg(ig)/ & 376 357 (alpha*pco2_avg(ig) + sqrt(tsoil(ig,iloop,islope))*exp(beta/tsoil(ig,iloop,islope))) … … 393 374 deltam_reg_slope(ig,islope) = 0._dp 394 375 do iloop = 1,index_breccia 395 if (TI(ig,iloop,islope) < inertie_thresold .and. .not. ispermanent_h2oglaciers(ig,islope) .and. .not. ispermanent_co2glaciers(ig,islope)) then376 if (TI(ig,iloop,islope) < inertie_thresold .and. abs(h2o_ice(ig,islope)) < minieps .and. abs(co2_ice(ig,islope)) < minieps) then 396 377 if (iloop == 1) then 397 378 deltam_reg_complete(ig,iloop,islope) = (dm_co2_regolith_slope(ig,iloop,islope) - co2_ads_reg(ig,iloop,islope))*(layer(iloop)) -
trunk/LMDZ.COMMON/libf/evolution/utility.F90
r4110 r4117 209 209 ! --------------- 210 210 !~ integer(di) :: len_trimmed 211 character( 32):: str_tmp211 character(128) :: str_tmp 212 212 character(:), allocatable :: str 213 213 -
trunk/LMDZ.COMMON/libf/evolution/workflow_status.F90
r4110 r4117 76 76 close(funit) 77 77 78 call print_msg('Current PEM run: '//int2str(i_pem_run),LVL_NFO)79 call print_msg('Input PCM runs : '//int2str(i_pcm_run - 1)//' and'//int2str(i_pcm_run),LVL_NFO)78 call print_msg('Current PEM run: #'//int2str(i_pem_run),LVL_NFO) 79 call print_msg('Input PCM runs : #'//int2str(i_pcm_run - 1)//' and #'//int2str(i_pcm_run),LVL_NFO) 80 80 81 81 END SUBROUTINE read_workflow_status
Note: See TracChangeset
for help on using the changeset viewer.
