Changeset 4074
- Timestamp:
- Feb 17, 2026, 2:45:53 PM (8 weeks ago)
- Location:
- trunk/LMDZ.COMMON/libf/evolution
- Files:
-
- 26 edited
- 1 moved
-
atmosphere.F90 (modified) (2 diffs)
-
changelog.txt (modified) (1 diff)
-
config.F90 (modified) (4 diffs)
-
deftank/README (modified) (4 diffs)
-
deftank/ini_pem_orbit.sh (modified) (2 diffs)
-
deftank/pcm_run.job (modified) (2 diffs)
-
deftank/pem_run.job (modified) (2 diffs)
-
deftank/pem_workflow.sh (modified) (2 diffs)
-
deftank/pem_workflow_lib.sh (modified) (4 diffs)
-
deftank/run_pem.def (moved) (moved from trunk/LMDZ.COMMON/libf/evolution/deftank/run_PEM.def) (3 diffs)
-
frost.F90 (modified) (1 diff)
-
glaciers.F90 (modified) (5 diffs)
-
ice_table.F90 (modified) (4 diffs)
-
orbit.F90 (modified) (1 diff)
-
pem.F90 (modified) (1 diff)
-
planet.F90 (modified) (1 diff)
-
slopes.F90 (modified) (1 diff)
-
soil.F90 (modified) (1 diff)
-
soil_temp.F90 (modified) (1 diff)
-
sorption.F90 (modified) (8 diffs)
-
stopping_crit.F90 (modified) (6 diffs)
-
subsurface_ice.F90 (modified) (3 diffs)
-
surf_ice.F90 (modified) (5 diffs)
-
surf_temp.F90 (modified) (1 diff)
-
surface.F90 (modified) (1 diff)
-
tendencies.F90 (modified) (1 diff)
-
tracers.F90 (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/atmosphere.F90
r4065 r4074 69 69 if (.not. allocated(u_PCM)) allocate(u_PCM(ngrid,nlayer)) 70 70 if (.not. allocated(v_PCM)) allocate(v_PCM(ngrid,nlayer)) 71 ap(:) = 0._dp 72 bp(:) = 0._dp 73 ps_PCM(:) = 0._dp 74 teta_PCM(:,:) = 0._dp 75 u_PCM(:,:) = 0._dp 76 v_PCM(:,:) = 0._dp 71 77 72 78 END SUBROUTINE ini_atmosphere … … 662 668 ! The pressure deviation is rescaled to avoid disproportionate oscillations in case of huge change of average pressure during the PEM run 663 669 ps4PCM(:) = ps_avg(:) + ps_dev(:)*ps_avg_glob/ps_avg_glob_ini 664 pa4PCM = ps_avg_glob_ini/30. ! For now the altitude grid is not changed 665 preff4PCM = ps_avg_glob_ini ! For now the altitude grid is not changed 666 670 pa4PCM = ps_avg_glob_ini/30. ! For now the altitude grid is not changed 671 preff4PCM = ps_avg_glob_ini ! For now the altitude grid is not changed 672 673 ! Correction on teta due to surface pressure changes 667 674 call print_msg('> Building potential temperature for the PCM') 668 675 do l = 1,nlayer 669 ! Correction on teta due to surface pressure changes670 676 teta4PCM(:,l) = teta_PCM(:,l)*ps4PCM(:)**rcp 671 677 end do 672 678 679 ! Compute atmospheric pressure 673 680 call print_msg('> Building air mass for the PCM') 674 ! Compute atmospheric pressure675 681 do l = 1,nlayer + 1 676 682 p(:,l) = ap(l) + bp(l)*ps4PCM(:) -
trunk/LMDZ.COMMON/libf/evolution/changelog.txt
r4072 r4074 875 875 == 16/02/2026 == JBC 876 876 Modify the PEM semantics to standardize file/functions/variable names and avoid ambiguity: workflow = repetion of cycles; cycle = PCM phase + PEM phase; PCM phase = 2+ PCM runs of 1 year each, PEM phase = 1 PEM run of 'x' years. 877 878 == 17/02/2026 == JBC 879 - Correct management of H2O ice tendency in 1D when there is not enough ice anymore. 880 - Clean initialization of allocatable module arrays (especially needed when no slope) 881 - One more renaming for consistency + few small updates thoughout the code. -
trunk/LMDZ.COMMON/libf/evolution/config.F90
r4072 r4074 24 24 25 25 character(7), parameter :: rundef_name = 'run.def' 26 character(11), parameter :: runPCMdef_name = 'run_ PCM.def'26 character(11), parameter :: runPCMdef_name = 'run_pcm.def' 27 27 character(12), parameter :: callphys_name = 'callphys.def' 28 28 … … 203 203 call set_layered_deposits_config(do_layering_l,impose_dust_ratio_l,d_dust_l,dust2ice_ratio_l) 204 204 205 ! Read "run_ PCM.def" parameters205 ! Read "run_pcm.def" parameters 206 206 hybrid = .true. ! Default 207 207 call get_hybrid(hybrid) … … 274 274 ! 275 275 ! NOTES 276 ! To work, it needs that "run_ PEM.def" hols a line with276 ! To work, it needs that "run_pem.def" hols a line with 277 277 ! "INCLUDEDEF=callphys.def". 278 278 !----------------------------------------------------------------------- … … 318 318 ! 319 319 ! DESCRIPTION 320 ! Get the key definition in "run_ PCM.def".320 ! Get the key definition in "run_pcm.def". 321 321 ! 322 322 ! AUTHORS & DATE -
trunk/LMDZ.COMMON/libf/evolution/deftank/README
r4072 r4074 44 44 > the xml files for XIOS which can be found in the PCM deftank folder: "iodef.xml", "context_lmdz_physics.xml", "file_def_physics_mars.xml" and "field_def_physics_mars.xml"; 45 45 > the def files you want to run the PCM: "run.def", "callphys.def", "traceur.def", etc. 46 /!\ Do not forget to rename the PCM "run.def" into "run_ PCM.def";46 /!\ Do not forget to rename the PCM "run.def" into "run_pcm.def"; 47 47 > the starting files you want to run the PCM: "startfi.nc", "start.nc"/"start1D.txt"/profiles; 48 > the necessary PEM files: "pem_workflow.sh", "pem_workflow_lib.sh", "pcm_run.job", "pem_run.job", "run_ PEM.def" and "obl_ecc_lsp.asc";48 > the necessary PEM files: "pem_workflow.sh", "pem_workflow_lib.sh", "pcm_run.job", "pem_run.job", "run_pem.def" and "obl_ecc_lsp.asc"; 49 49 > the optional PEM files: "diagevol.def" to define the PEM variables to be ouputted and "startpem.nc" to set the initial state of the PEM. 50 50 … … 55 55 > "pcm_run.job"; 56 56 > "pem_run.job"; 57 > def files, especially for "run_ PEM.def", "run_PCM.def", "callphys.def".58 In addition, the user has to provide a "startfi.nc" whose orbital parameters are consistent with the initial date set in "run_ PEM.def". The script "ini_pem_orbit.sh" can do it automatically with "obl_ecc_lsp.asc".57 > def files, especially for "run_pem.def", "run_pcm.def", "callphys.def". 58 In addition, the user has to provide a "startfi.nc" whose orbital parameters are consistent with the initial date set in "run_pem.def". The script "ini_pem_orbit.sh" can do it automatically with "obl_ecc_lsp.asc". 59 59 60 60 Outputs: … … 100 100 > The PEM executable can have an optional argument which should be specified according to the set-up ("--auto-exit" for SLURM and PBS/TORQUE | "" when the script is not run as a job). 101 101 102 # run_ PEM.def102 # run_pem.def 103 103 All the possible parameters to define a PEM run (read in "config.F90"). 104 It needs to include in "run_ PCM.def" with "INCLUDEDEF=run_PEM.def".104 It needs to include in "run_pcm.def" with "INCLUDEDEF=run_pem.def". 105 105 106 106 # obl_ecc_lsp.asc [default], obl_ecc_lsp_pos.asc [future years] … … 114 114 115 115 # ini_pem_orbit.sh: 116 Bash script file to set the orbital parameters of a file "startfi.nc" from Laskar's data contained in "obl_ecc_lsp.asc" according to the initial date 'pem_ini_earth_date' defined in "run_ PEM.def". See also "modify_startfi_orbit.sh".116 Bash script file to set the orbital parameters of a file "startfi.nc" from Laskar's data contained in "obl_ecc_lsp.asc" according to the initial date 'pem_ini_earth_date' defined in "run_pem.def". See also "modify_startfi_orbit.sh". 117 117 118 118 # concat_pem.py: -
trunk/LMDZ.COMMON/libf/evolution/deftank/ini_pem_orbit.sh
r4072 r4074 2 2 ###################################################################### 3 3 ### Script to modify the orbital parameters of a file "startfi.nc" ### 4 ### according to the date set in the file "run_ PEM.def" ###4 ### according to the date set in the file "run_pem.def" ### 5 5 ###################################################################### 6 6 set -e … … 17 17 18 18 # Name of the file containing the starting date (Earth years) 19 date_file="run_ PEM.def"19 date_file="run_pem.def" 20 20 ###################################################################### 21 21 -
trunk/LMDZ.COMMON/libf/evolution/deftank/pcm_run.job
r4072 r4074 24 24 25 25 # Name of executable for the PCM: 26 exePCM="gcm_64x48x32_phymars_para.e"26 pcm_exe="gcm_64x48x32_phymars_para.e" 27 27 28 28 # Execution command: 29 exe _cmd="srun --ntasks-per-node=${SLURM_NTASKS_PER_NODE} --cpu-bind=none --mem-bind=none --label -- ./adastra_cpu_binding.sh ./$exePCM"29 exec_cmd="srun --ntasks-per-node=${SLURM_NTASKS_PER_NODE} --cpu-bind=none --mem-bind=none --label -- ./adastra_cpu_binding.sh ./$pcm_exe" 30 30 ######################################################################## 31 31 … … 36 36 read n_yr_sim ntot_yr_sim r_plnt2earth_yr i_pcm_run i_pem_run n_pcm_runs n_pcm_runs_ini < pem_workflow.sts 37 37 echo "Run \"PCM $i_pcm_run\" is starting." 38 cp run_ PCM.def run.def39 eval "$exe _cmd > run.log 2>&1"38 cp run_pcm.def run.def 39 eval "$exec_cmd > run.log 2>&1" 40 40 if [ ! -f "restartfi.nc" ] || ! (tail -n 100 run.log | grep -iq "everything is cool!"); then # Check if it ended abnormally 41 41 echo "Error: the run \"PCM $i_pcm_run\" crashed!" -
trunk/LMDZ.COMMON/libf/evolution/deftank/pem_run.job
r4072 r4074 21 21 22 22 # Name of executable for the PEM: 23 exePEM="pem_64x48x32_phymars_seq.e"23 pem_exe="pem_64x48x32_phymars_seq.e" 24 24 25 25 # Argument for the PEM execution ("--auto-exit" for SLURM and PBS/TORQUE | "" when the script is not run as a job): 26 arg_pem="--auto-exit"26 pem_arg="--auto-exit" 27 27 ######################################################################## 28 28 … … 33 33 read n_yr_sim ntot_yr_sim r_plnt2earth_yr i_pcm_run i_pem_run n_pcm_runs n_pcm_runs_ini < pem_workflow.sts 34 34 echo "Run \"PEM $i_pem_run\" is starting." 35 cp run_ PEM.def run.def36 eval "./$ exePEM $arg_pem> run.log 2>&1"35 cp run_pem.def run.def 36 eval "./$pem_exe $pem_arg > run.log 2>&1" 37 37 if [ ! -f "restartfi.nc" ] || ! (tail -n 100 run.log | grep -iq "so far, so good!"); then # Check if it ended abnormally 38 38 echo "Error: the run \"PEM $i_pem_run\" crashed!" -
trunk/LMDZ.COMMON/libf/evolution/deftank/pem_workflow.sh
r4072 r4074 68 68 submit_cycle $exec_mode $n_pcm_runs 69 69 70 # Starting a resum e70 # Starting a resumption of the workflow 71 71 elif [ $1 = "re" ]; then 72 72 if [ ! -f "pem_workflow.sts" ]; then … … 132 132 fi 133 133 134 # Continuing the PEM run 135 elif [ $1 = "cont" ]; then 136 exec >> pem_workflow.log 2>&1 137 echo 138 echo "This is a continuation of the previous PEM run." 139 date 140 submit_pem_phase $exec_mode 134 # Continuing a PEM run 135 # CANNOT BE DONE FOR NOW BECAUSE THE PEM DOES NOT SAVE ITS STATE TO BE ABLE TO RECOVER 136 #elif [ $1 = "cont" ]; then 137 # exec >> pem_workflow.log 2>&1 138 # echo 139 # echo "This is a continuation of the previous PEM run." 140 # date 141 # submit_pem_phase $exec_mode 141 142 142 143 # Default case: error -
trunk/LMDZ.COMMON/libf/evolution/deftank/pem_workflow_lib.sh
r4072 r4074 48 48 ns=$(ncdump -h startfi.nc | sed -n 's/.*nslope = \([0-9]*\) ;.*/\1/p') 49 49 else 50 for f in run_ PCM.def callphys.def; do50 for f in run_pcm.def callphys.def; do 51 51 if [[ -f "$f" ]]; then 52 52 while IFS= read -r line; do … … 162 162 print val 163 163 exit 164 }' run_ PCM.def)164 }' run_pcm.def) 165 165 166 166 if [ -z "$sol_in_file" ]; then 167 echo "Error: no length of year found in \"run_ PCM.def\"!"167 echo "Error: no length of year found in \"run_pcm.def\"!" 168 168 abort_workflow 169 169 elif [ "$sol_in_file" -eq "$year_sol" ]; then … … 171 171 : 172 172 else 173 echo "Error: length of year mismatch between \"run_ PCM.def\" ($sol_in_file) and \"startfi.nc\" ($year_sol)!"173 echo "Error: length of year mismatch between \"run_pcm.def\" ($sol_in_file) and \"startfi.nc\" ($year_sol)!" 174 174 abort_workflow 175 175 fi … … 212 212 abort_workflow 213 213 fi 214 if [ ! -f "run_ PCM.def" ]; then215 echo "Error: file \"run_ PCM.def\" does not exist in $dir!"216 abort_workflow 217 fi 218 if [ ! -f "run_ PEM.def" ]; then219 echo "Error: file \"run_ PEM.def\" does not exist in $dir!"214 if [ ! -f "run_pcm.def" ]; then 215 echo "Error: file \"run_pcm.def\" does not exist in $dir!" 216 abort_workflow 217 fi 218 if [ ! -f "run_pem.def" ]; then 219 echo "Error: file \"run_pem.def\" does not exist in $dir!" 220 220 abort_workflow 221 221 fi -
trunk/LMDZ.COMMON/libf/evolution/deftank/run_pem.def
r4073 r4074 17 17 # pem_ini_earth_date=0 18 18 19 # Do you want the obliquity to ev eolve when following "obl_ecc_lsp.asc"? Default = .true.19 # Do you want the obliquity to evolve when following "obl_ecc_lsp.asc"? Default = .true. 20 20 # evol_obl=.true. 21 21 … … 56 56 57 57 # Do you want to run with adsorption/desorption in the PEM? Default = .false. 58 # sorption=.false.58 # do_sorption=.false. 59 59 60 60 # Do you want to modify the soil thermal properties with the pressure? Default = .false. … … 102 102 # dust2ice_ratio=0.1 103 103 104 # Some definitions for the physics in file "run_ PCM.def"105 INCLUDEDEF=run_ PCM.def104 # Some definitions for the physics in file "run_pcm.def" 105 INCLUDEDEF=run_pcm.def -
trunk/LMDZ.COMMON/libf/evolution/frost.F90
r4071 r4074 67 67 if (.not. allocated(h2o_frost4PCM)) allocate(h2o_frost4PCM(ngrid,nslope)) 68 68 if (.not. allocated(co2_frost4PCM)) allocate(co2_frost4PCM(ngrid,nslope)) 69 h2ofrost_PCM(:,:) = 0._dp 70 co2frost_PCM(:,:) = 0._dp 71 h2o_frost4PCM(:,:) = 0._dp 72 co2_frost4PCM(:,:) = 0._dp 69 73 70 74 END SUBROUTINE ini_frost -
trunk/LMDZ.COMMON/libf/evolution/glaciers.F90
r4071 r4074 124 124 call print_msg("> Flow of CO2 glaciers") 125 125 call computeTcondCO2(vmr_co2_PEM,ps_PCM,ps_avg_glob_ini,ps_avg_global,Tcond) 126 call compute_hmaxglaciers(Tcond," co2",hmax)126 call compute_hmaxglaciers(Tcond,"CO2",hmax) 127 127 call transfer_ice_duringflow(hmax,Tcond,co2ice,is_co2ice_flow) 128 128 … … 169 169 ! ---- 170 170 call print_msg("> Flow of H2O glaciers") 171 call compute_hmaxglaciers(Tice," h2o",hmax)171 call compute_hmaxglaciers(Tice,"H2O",hmax) 172 172 call transfer_ice_duringflow(hmax,Tice,h2oice,is_h2oice_flow) 173 173 … … 222 222 ! ---- 223 223 select case (trim(adjustl(name_ice))) 224 case(' h2o')224 case('H2O') 225 225 tau_d = 1.e5_dp 226 case(' co2')226 case('CO2') 227 227 tau_d = 5.e3_dp 228 228 case default … … 294 294 if (islope /= iflat) then ! ice can be infinite on flat ground 295 295 ! First: check that CO2 ice must flow (excess of ice on the slope), ice can accumulate infinitely on flat ground 296 if (qice(ig,islope) >= rho_ice(Tice(ig,islope),' h2o')*hmax(ig,islope)*cos(pi*def_slope_mean(islope)/180._dp)) then296 if (qice(ig,islope) >= rho_ice(Tice(ig,islope),'H2O')*hmax(ig,islope)*cos(pi*def_slope_mean(islope)/180._dp)) then 297 297 ! Second: determine the flatest slopes possible: 298 298 if (islope > iflat) then … … 308 308 end if 309 309 end do 310 qice(ig,iaval) = qice(ig,iaval) + (qice(ig,islope) - rho_ice(Tice(ig,islope),' h2o')*hmax(ig,islope)*cos(pi*def_slope_mean(islope)/180._dp)) &310 qice(ig,iaval) = qice(ig,iaval) + (qice(ig,islope) - rho_ice(Tice(ig,islope),'H2O')*hmax(ig,islope)*cos(pi*def_slope_mean(islope)/180._dp)) & 311 311 *subslope_dist(ig,islope)/subslope_dist(ig,iaval)*cos(pi*def_slope_mean(iaval)/180._dp)/cos(pi*def_slope_mean(islope)/180._dp) 312 312 313 qice(ig,islope) = rho_ice(Tice(ig,islope),' h2o')*hmax(ig,islope)*cos(pi*def_slope_mean(islope)/180._dp)313 qice(ig,islope) = rho_ice(Tice(ig,islope),'H2O')*hmax(ig,islope)*cos(pi*def_slope_mean(islope)/180._dp) 314 314 flag_flow(ig,islope) = .true. 315 315 end if ! co2ice > hmax -
trunk/LMDZ.COMMON/libf/evolution/ice_table.F90
r4065 r4074 67 67 allocate(icetable_thickness(ngrid,nslope)) 68 68 allocate(ice_porefilling(ngrid,nsoil,nslope)) 69 icetable_depth(:,:) = 0._dp 70 icetable_thickness(:,:) = 0._dp 71 ice_porefilling(:,:,:) = 0._dp 69 72 70 73 END SUBROUTINE ini_ice_table … … 303 306 do islope = 1,nslope 304 307 call compute_Tice(tsoil(ig,:,islope),tsurf(ig,islope),icetable_depth(ig,islope),Tice) 305 delta_icetable(ig) = delta_icetable(ig) + porosity*rho_ice(Tice,' h2o')*(icetable_thickness(ig,islope) - icetable_thickness_old(ig,islope)) & ! convention > 0. <=> it condenses308 delta_icetable(ig) = delta_icetable(ig) + porosity*rho_ice(Tice,'H2O')*(icetable_thickness(ig,islope) - icetable_thickness_old(ig,islope)) & ! convention > 0. <=> it condenses 306 309 *subslope_dist(ig,islope)/cos(def_slope_mean(islope)*pi/180._dp) 307 310 end do … … 313 316 do isoil = 1,nsoil 314 317 call compute_Tice(tsoil(ig,:,islope),tsurf(ig,islope),mlayer(isoil - 1),Tice) 315 delta_icetable(ig) = delta_icetable(ig) + rho_ice(Tice,' h2o')*(ice_porefilling(ig,isoil,islope) - ice_porefilling_old(ig,isoil,islope)) & ! convention > 0. <=> it condenses318 delta_icetable(ig) = delta_icetable(ig) + rho_ice(Tice,'H2O')*(ice_porefilling(ig,isoil,islope) - ice_porefilling_old(ig,isoil,islope)) & ! convention > 0. <=> it condenses 316 319 *subslope_dist(ig,islope)/cos(def_slope_mean(islope)*pi/180._dp) 317 320 end do … … 586 589 ! ---- 587 590 select case (trim(adjustl(ice))) 588 case(' h2o')591 case('H2O') 589 592 rho = -3.5353e-4_dp*T**2 + 0.0351_dp*T + 933.5030_dp ! Rottgers 2012 590 case(' co2')593 case('CO2') 591 594 rho = (1.72391_dp - 2.53e-4_dp*T - 2.87_dp*1.e-7_dp*T**2)*1.e3_dp ! Mangan et al. 2017 592 595 case default -
trunk/LMDZ.COMMON/libf/evolution/orbit.F90
r4071 r4074 283 283 if (.not. allocated(ecc_lask)) allocate(ecc_lask(n)) 284 284 if (.not. allocated(lsp_lask)) allocate(lsp_lask(n)) 285 year_lask(:) = 0._dp 286 obl_lask(:) = 0._dp 287 ecc_lask(:) = 0._dp 288 lsp_lask(:) = 0._dp 285 289 286 290 END SUBROUTINE ini_orbit -
trunk/LMDZ.COMMON/libf/evolution/pem.F90
r4072 r4074 246 246 if (h2o_ice(i,islope) > 0._dp) then 247 247 is_h2oice_ini(i,islope) = .true. 248 if (d_ co2ice(i,islope) < 0._dp) h2oice_sublim_coverage_ini = h2oice_sublim_coverage_ini + cell_area(i)*subslope_dist(i,islope)/cos(pi*def_slope_mean(islope)/180._dp)248 if (d_h2oice(i,islope) < 0._dp) h2oice_sublim_coverage_ini = h2oice_sublim_coverage_ini + cell_area(i)*subslope_dist(i,islope)/cos(pi*def_slope_mean(islope)/180._dp) 249 249 end if 250 250 end do -
trunk/LMDZ.COMMON/libf/evolution/planet.F90
r4065 r4074 28 28 real(dp), parameter :: m_co2 = 44.01e-3_dp ! CO2 molecular mass [kg/mol] 29 29 real(dp), parameter :: m_noco2 = 33.37e-3_dp ! Non condensible mol mass [kg/mol] 30 real(dp), parameter :: m_h2o = 18.01528e-3_dp ! Molecular weight of h2o[kg/mol]30 real(dp), parameter :: m_h2o = 18.01528e-3_dp ! Molecular weight of H2O [kg/mol] 31 31 real(dp), parameter :: A = (1._dp/m_co2 - 1._dp/m_noco2) ! Intermediate parameter for computation 32 32 real(dp), parameter :: B = 1._dp/m_noco2 ! Intermediate parameter for computation -
trunk/LMDZ.COMMON/libf/evolution/slopes.F90
r4065 r4074 59 59 if (.not. allocated(def_slope_mean)) allocate(def_slope_mean(nslope)) 60 60 if (.not. allocated(subslope_dist)) allocate(subslope_dist(ngrid,nslope)) 61 def_slope_mean(:) = 0._dp 62 subslope_dist(:,:) = 1._dp 61 63 62 64 END SUBROUTINE ini_slopes -
trunk/LMDZ.COMMON/libf/evolution/soil.F90
r4065 r4074 92 92 if (.not. allocated(inertiedat_PCM)) allocate(inertiedat_PCM(ngrid,nsoil_PCM)) 93 93 if (.not. allocated(TI_PCM)) allocate(TI_PCM(ngrid,nsoil_PCM,nslope)) 94 inertiedat_PCM(:,:) = 0._dp 95 TI_PCM(:,:,:) = 0._dp 94 96 95 97 END SUBROUTINE ini_soil -
trunk/LMDZ.COMMON/libf/evolution/soil_temp.F90
r4065 r4074 59 59 if (.not. allocated(tsoil_PCM)) allocate(tsoil_PCM(ngrid,nsoil_PCM,nslope)) 60 60 if (.not. allocated(flux_geo_PCM)) allocate(flux_geo_PCM(ngrid,nslope)) 61 tsoil_PCM(:,:,:) = 0._dp 62 flux_geo_PCM(:,:) = 0._dp 61 63 62 64 END SUBROUTINE ini_soil_temp -
trunk/LMDZ.COMMON/libf/evolution/sorption.F90
r4065 r4074 102 102 real(dp), dimension(:,:,:), intent(in) :: tsoil ! Soil temperature [K] 103 103 real(dp), dimension(:,:), intent(in) :: ps ! Average surface pressure [Pa] 104 real(dp), dimension(:,:), intent(in) :: q_co2_ts ! Mass mixing ratio of co2 in the first layer [kg/kg]105 real(dp), dimension(:,:), intent(in) :: q_h2o_ts ! Mass mixing ratio of H2 oin the first layer [kg/kg]106 real(dp), dimension(:), intent(out) :: delta_h2o_ads ! Difference density of h2oadsorbed [kg/m^3]107 real(dp), dimension(:), intent(out) :: delta_co2_ads ! Difference density of co2 adsorbed [kg/m^3]104 real(dp), dimension(:,:), intent(in) :: q_co2_ts ! Mass mixing ratio of CO2 in the first layer [kg/kg] 105 real(dp), dimension(:,:), intent(in) :: q_h2o_ts ! Mass mixing ratio of H2O in the first layer [kg/kg] 106 real(dp), dimension(:), intent(out) :: delta_h2o_ads ! Difference density of H2O adsorbed [kg/m^3] 107 real(dp), dimension(:), intent(out) :: delta_co2_ads ! Difference density of CO2 adsorbed [kg/m^3] 108 108 real(dp), dimension(:,:,:), intent(inout) :: h2o_ads_reg, co2_ads_reg 109 109 … … 156 156 real(dp), dimension(:,:), intent(in) :: co2ice ! CO2 ice at the surface [kg/m^2] 157 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 H2 oin the first layer [kg/kg]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 160 real(dp), dimension(:,:,:), intent(in) :: TI ! Soil Thermal inertia [J/K/^2/s^1/2] 161 161 real(dp), dimension(:,:,:), intent(in) :: tsoil ! Soil temperature [K] 162 real(dp), dimension(:,:,:), intent(inout) :: h2o_ads_reg ! Density of h2oadsorbed [kg/m^3]162 real(dp), dimension(:,:,:), intent(inout) :: h2o_ads_reg ! Density of H2O adsorbed [kg/m^3] 163 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 h2oadsorbed [kg/m^3]164 real(dp), dimension(:), intent(out) :: delta_h2o_ads ! Difference density of H2O adsorbed [kg/m^3] 165 165 166 166 ! LOCAL VARIABLES … … 170 170 real(dp) :: e = 2573.9_dp ! Jackosky et al. 1997 171 171 real(dp) :: mu = 0.48_dp ! Jackosky et al. 1997 172 real(dp) :: m_theta = 2.84e-7_dp ! Mass of h2oper m^2 absorbed Jackosky et al. 1997172 real(dp) :: m_theta = 2.84e-7_dp ! Mass of H2O per m^2 absorbed Jackosky et al. 1997 173 173 ! real(dp) :: as = 18.9e3_dp ! Specific area, Buhler & Piqueux 2021 174 174 real(dp) :: as = 9.48e4_dp ! Specific area, Zent … … 177 177 real(dp) :: K ! Used to compute theta 178 178 integer(di) :: ig, iloop, islope, it ! For loops 179 logical(k4), dimension(ngrid,nslope) :: ispermanent_co2glaciers ! Check if the co2 glacier is permanent180 logical(k4), dimension(ngrid,nslope) :: ispermanent_h2oglaciers ! Check if the h2oglacier is permanent181 real(dp), dimension(ngrid,nslope) :: deltam_reg_slope ! Difference density of h2oadsorbed per slope [kg/m^3]182 real(dp), dimension(ngrid,nsoil,nslope) :: dm_h2o_regolith_slope ! Elementary h2omass adsorded per mesh per slope179 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 183 183 real(dp) :: A, B ! Used to compute the mean mass above the surface 184 184 real(dp) :: p_sat ! Saturated vapor pressure of ice … … 299 299 real(dp), dimension(:,:,:), intent(in) :: TI ! Mean Thermal Inertia [USI] 300 300 real(dp), dimension(:,:), intent(in) :: d_h2oice, d_co2ice ! Tendencies on the glaciers () 301 real(dp), dimension(:,:), intent(in) :: q_co2_ts, q_h2o_ts ! Mass mixing ratio of co2 and h2oin the first layer [kg/kg]301 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 302 real(dp), dimension(:,:), intent(in) :: h2oice ! Water ice at the surface [kg/m^2] 303 303 real(dp), dimension(:,:), intent(in) :: co2ice ! CO2 ice at the surface [kg/m^2] 304 real(dp), dimension(:,:,:), intent(inout) :: co2_ads_reg ! Density of co2 adsorbed [kg/m^3]305 real(dp), dimension(:), intent(out) :: delta_co2_ads ! Difference density of co2 adsorbed [kg/m^3]304 real(dp), dimension(:,:,:), intent(inout) :: co2_ads_reg ! Density of CO2 adsorbed [kg/m^3] 305 real(dp), dimension(:), intent(out) :: delta_co2_ads ! Difference density of CO2 adsorbed [kg/m^3] 306 306 307 307 ! LOCAL VARIABLES … … 311 311 real(dp) :: beta = -1541.5_dp ! Zent & Quinn 1995 312 312 real(dp) :: inertie_thresold = 800._dp ! TI > 800 means cementation 313 real(dp) :: m_theta = 4.27e-7_dp ! Mass of co2 per m^2 absorbed313 real(dp) :: m_theta = 4.27e-7_dp ! Mass of CO2 per m^2 absorbed 314 314 ! real(dp) :: as = 18.9e3_dp ! Specific area, Buhler & Piqueux 2021 315 315 real(dp) :: as = 9.48e4_dp ! Same as previous but from zent … … 317 317 integer(di) :: ig, islope, iloop, it ! For loops 318 318 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 h2oglacier is permanent319 logical(k4), dimension(ngrid,nslope) :: ispermanent_co2glaciers ! Check if the CO2 glacier is permanent 320 logical(k4), dimension(ngrid,nslope) :: ispermanent_h2oglaciers ! Check if the H2O glacier is permanent 321 321 real(dp), dimension(ngrid,index_breccia,nslope) :: deltam_reg_complete ! Difference in the mass per slope and soil layer [kg/m^3] 322 322 real(dp), dimension(ngrid,nslope) :: deltam_reg_slope ! Difference in the mass per slope [kg/m^3] 323 323 real(dp), dimension(ngrid,nsoil,nslope) :: m_h2o_adsorbed ! Density of CO2 adsorbed [kg/m^3] 324 324 real(dp), dimension(ngrid,nsoil,nslope) :: theta_h2o_ads ! Fraction of the pores occupied by H2O molecules 325 real(dp), dimension(ngrid) :: delta_mh2o ! Difference density of h2oadsorbed [kg/m^3]325 real(dp), dimension(ngrid) :: delta_mh2o ! Difference density of H2O adsorbed [kg/m^3] 326 326 ! nday array are allocated because heavy... 327 327 real(dp), dimension(:,:), allocatable :: mass_mean ! Mean mass above the surface … … 368 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) 369 369 370 ! 2. we compute the mass of co2 adsorded in each layer of the meshes370 ! 2. we compute the mass of CO2 adsorded in each layer of the meshes 371 371 do ig = 1,ngrid 372 372 do islope = 1,nslope -
trunk/LMDZ.COMMON/libf/evolution/stopping_crit.F90
r4065 r4074 24 24 ! PARAMETERS 25 25 ! ---------- 26 real(dp), protected :: h2oice_crit ! Change of the surface of h2oice sublimating before stopping the PEM27 real(dp), protected :: co2ice_crit ! Change of the surface of co2 ice sublimating before stopping the PEM26 real(dp), protected :: h2oice_crit ! Change of the surface of H2O ice sublimating before stopping the PEM 27 real(dp), protected :: co2ice_crit ! Change of the surface of CO2 ice sublimating before stopping the PEM 28 28 real(dp), protected :: ps_crit ! Change of averaged surface pressure before stopping the PEM 29 29 … … 196 196 ! CODE 197 197 ! ---- 198 if (this%surface_h2oice_change) then; msg = "**** STOPPING because surface of h2oice has changed too much (see message above)."199 elseif (this%zero_dh2oice) then; msg = "**** STOPPING because tendencies on h2oice = 0 (see message above)."200 elseif (this%surface_co2ice_change) then; msg = "**** STOPPING because surface of co2 ice has changed too much (see message above)."198 if (this%surface_h2oice_change) then; msg = "**** STOPPING because surface of H2O ice has changed too much (see message above)." 199 elseif (this%zero_dh2oice) then; msg = "**** STOPPING because tendencies on H2O ice = 0 (see message above)." 200 elseif (this%surface_co2ice_change) then; msg = "**** STOPPING because surface of CO2 ice has changed too much (see message above)." 201 201 elseif (this%pressure_change) then; msg = "**** STOPPING because surface global pressure has changed too much (see message above)." 202 202 elseif (this%nmax_yr_run_reached) then; msg = "**** STOPPING because maximum number of years is reached." … … 253 253 ! CODE 254 254 ! ---- 255 ! Check to escape the subroutine ( not relevant in 1D orif the PEM should stop already)256 if ( ngrid == 1 .or.stopcrit%stop_code() > 0) return255 ! Check to escape the subroutine (if the PEM should stop already) 256 if (stopcrit%stop_code() > 0) return 257 257 258 258 ! Computation of the present surface of sublimating H2O ice … … 313 313 ! --------------- 314 314 integer(di) :: i, islope 315 real(dp) :: co2ice_now_surf ! Current surface of co2 ice315 real(dp) :: co2ice_now_surf ! Current surface of CO2 ice 316 316 317 317 ! CODE … … 320 320 if (ngrid == 1 .or. stopcrit%stop_code() > 0) return 321 321 322 ! Computation of the present surface of co2 ice still sublimating322 ! Computation of the present surface of CO2 ice still sublimating 323 323 co2ice_now_surf = 0. 324 324 do i = 1,ngrid … … 331 331 if (co2ice_now_surf < co2ice_sublim_coverage_ini*(1. - co2ice_crit) .or. co2ice_now_surf > co2ice_sublim_coverage_ini*(1._dp + co2ice_crit)) then 332 332 stopcrit%surface_co2ice_change = .true. 333 call print_msg("Initial surface of co2 ice sublimating (ini|now) [m2] = "//real2str(co2ice_sublim_coverage_ini)//' | '//real2str(co2ice_now_surf))333 call print_msg("Initial surface of CO2 ice sublimating (ini|now) [m2] = "//real2str(co2ice_sublim_coverage_ini)//' | '//real2str(co2ice_now_surf)) 334 334 call print_msg("Change (accepted|current) [%] = +/- "//real2str(co2ice_crit*100._dp)//' | '//real2str(100._dp*(co2ice_now_surf - co2ice_sublim_coverage_ini)/co2ice_sublim_coverage_ini)) 335 335 end if -
trunk/LMDZ.COMMON/libf/evolution/subsurface_ice.F90
r4065 r4074 379 379 fracIR = 0.04*p0(k)/600.; fracDust = 0.02*p0(k)/600. 380 380 B = Diff*bigstep*86400.*365.24/(porosity*927.) 381 !B = Diff*bigstep*86400.*365.24/(porosity*rho_ice(Tb(),' h2o'))381 !B = Diff*bigstep*86400.*365.24/(porosity*rho_ice(Tb(),'H2O')) 382 382 383 383 typeT = -9 … … 869 869 870 870 B = Diff*bigstep*86400.*365.24/(porosity*927.) 871 !B = Diff*bigstep*86400.*365.24/(porosity*rho_ice(T,' h2o'))871 !B = Diff*bigstep*86400.*365.24/(porosity*rho_ice(T,'H2O')) 872 872 873 873 ! advance ice table, avdrho>0 is retreat … … 889 889 beta = (1-icefrac)/(1-porosity)/icefrac 890 890 beta = Diff*bigstep*beta*86400*365.24/927. 891 !beta = Diff*bigstep*beta*86400*365.24/rho_ice(T,' h2o')891 !beta = Diff*bigstep*beta*86400*365.24/rho_ice(T,'H2O') 892 892 zdepthT = sqrt(2*beta*avdrho*18./8314. + zdepthT**2) 893 893 endif -
trunk/LMDZ.COMMON/libf/evolution/surf_ice.F90
r4071 r4074 62 62 if (.not. allocated(is_h2o_perice_PCM)) allocate(is_h2o_perice_PCM(ngrid)) 63 63 if (.not. allocated(co2_perice_PCM)) allocate(co2_perice_PCM(ngrid,nslope)) 64 is_h2o_perice_PCM(:) = .false. 65 co2_perice_PCM(:,:) = 0._dp 64 66 65 67 END SUBROUTINE ini_surf_ice … … 359 361 360 362 if (ngrid == 1) then ! In 1D 361 h2o_ice = h2o_ice + d_h2oice*dt 362 zshift_surf = d_h2oice*dt/rho_h2oice 363 where (d_h2oice(:,:) < 0._dp .and. abs(d_h2oice(:,:)*dt) > h2o_ice(:,:)) ! Not enough ice to sublimate everything 364 ! We sublimate what we can 365 d_h2oice_new(:,:) = h2o_ice(:,:)/dt 366 ! It means the tendency is zero next time 367 d_h2oice(:,:) = 0._dp 368 else where 369 d_h2oice_new(:,:) = d_h2oice(:,:) 370 end where 363 371 else ! In 3D 364 372 call stopping_crit_h2o(delta_h2o_ads,delta_icetable,h2o_ice,d_h2oice,S_atm_2_h2o,S_h2o_2_atm,S_atm_2_h2oice,S_h2oice_2_atm,stopcrit) 365 373 if (stopcrit%stop_code() > 0) return 366 367 374 call balance_h2oice_reservoirs(S_atm_2_h2o,S_h2o_2_atm,S_atm_2_h2oice,S_h2oice_2_atm,h2o_ice,d_h2oice,d_h2oice_new) 368 h2o_ice = h2o_ice + d_h2oice_new*dt369 zshift_surf = d_h2oice_new*dt/rho_h2oice370 375 end if 376 377 h2o_ice = h2o_ice + d_h2oice_new*dt 378 zshift_surf = d_h2oice_new*dt/rho_h2oice 371 379 372 380 END SUBROUTINE evolve_h2oice … … 408 416 ! --------------- 409 417 integer(di) :: i, islope 410 real(qp) :: S_target, S_target_subl_h2oice, S_target_cond_h2oice, S_ghostice, d_target ! Balance variables 418 real(qp) :: S_target, S_target_subl_h2oice, S_target_cond_h2oice, S_ghostice ! Balance variables 419 real(dp) :: d_target 411 420 412 421 ! CODE … … 421 430 do islope = 1,nslope 422 431 if (d_h2oice(i,islope) > 0._dp) then ! Condensing 423 d_h2oice_new(i,islope) = d_h2oice _new(i,islope)*real(S_target_cond_h2oice/S_atm_2_h2oice,dp)432 d_h2oice_new(i,islope) = d_h2oice(i,islope)*real(S_target_cond_h2oice/S_atm_2_h2oice,dp) 424 433 else if (d_h2oice(i,islope) < 0._dp) then ! Sublimating 425 434 d_target = d_h2oice(i,islope)*real(S_target_subl_h2oice/S_h2oice_2_atm,dp) 426 if (abs(d_target*dt) < h2o_ice(i,islope)) then ! Enough ice to sublimate everything427 d_h2oice_new(i,islope) = real(d_target,dp)435 if (abs(d_target*dt) <= h2o_ice(i,islope)) then ! Enough ice to sublimate everything 436 d_h2oice_new(i,islope) = d_target 428 437 else ! Not enough ice to sublimate everything 429 438 ! We sublimate what we can … … 438 447 end do 439 448 440 ! We need to remove this ice unable to sublimate from places where ice condensed sin order to keep balance449 ! We need to remove this ice unable to sublimate from places where ice condensed in order to keep balance 441 450 where (d_h2oice_new > 0._dp) d_h2oice_new = d_h2oice_new*real((S_target_cond_h2oice - S_ghostice)/S_target_cond_h2oice,dp) 442 451 -
trunk/LMDZ.COMMON/libf/evolution/surf_temp.F90
r4065 r4074 56 56 ! ---- 57 57 if (.not. allocated(tsurf_PCM)) allocate(tsurf_PCM(ngrid,nslope)) 58 tsurf_PCM(:,:) = 0._dp 58 59 59 60 END SUBROUTINE ini_surf_temp -
trunk/LMDZ.COMMON/libf/evolution/surface.F90
r4065 r4074 60 60 if (.not. allocated(albedodat_PCM)) allocate(albedodat_PCM(ngrid)) 61 61 if (.not. allocated(emissivity_PCM)) allocate(emissivity_PCM(ngrid,nslope)) 62 albedo_PCM(:,:) = 0._dp 63 albedodat_PCM(:) = 0._dp 64 emissivity_PCM(:,:) = 1._dp 62 65 63 66 END SUBROUTINE ini_surface -
trunk/LMDZ.COMMON/libf/evolution/tendencies.F90
r4071 r4074 178 178 real(dp) :: Rz_old, Rz_new, R_dec, hum_dec, psv_max_old, psv_max_new 179 179 integer(di) :: iday 180 real(dp), parameter :: coef_diff = 4.e-4 ! Diffusion coefficient181 real(dp), parameter :: zcdv = 0.0325 ! Drag coefficient180 real(dp), parameter :: coef_diff = 4.e-4_dp ! Diffusion coefficient 181 real(dp), parameter :: zcdv = 0.0325_dp ! Drag coefficient 182 182 183 183 ! CODE -
trunk/LMDZ.COMMON/libf/evolution/tracers.F90
r4065 r4074 80 80 if (.not. allocated(qnames)) allocate(qnames(nq)) 81 81 if (.not. allocated(q_PCM)) allocate(q_PCM(ngrid,nlayer,nq)) 82 mmol(:) = 0._dp 83 q_PCM(:,:,:) = 0._dp 82 84 83 85 ! Initialize the names of tracers
Note: See TracChangeset
for help on using the changeset viewer.
