Changeset 3666 for trunk/LMDZ.COMMON
- Timestamp:
- Feb 28, 2025, 5:51:32 PM (4 months ago)
- Location:
- trunk/LMDZ.COMMON/libf/evolution
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/changelog.txt
r3649 r3666 609 609 == 26/02/2025 == JBC 610 610 Correction and simplification of the numbering of jobs/runs in the launching script. 611 612 == 28/02/2025 == JBC 613 - Adjusments of few scripts to handle more situations. 614 - Bug correction related to deallocation in case of "soil_pem = .false." or "layering_algo = .true.". -
trunk/LMDZ.COMMON/libf/evolution/compute_soiltemp_mod.F90
r3610 r3666 246 246 real, dimension(ngrid,nsoil,nslope) :: tsoil_old 247 247 248 write(*,*) "Shifting soil temperature to surface"248 write(*,*) "> Shifting soil temperature profile to match surface evolution" 249 249 tsoil_old = tsoil 250 250 -
trunk/LMDZ.COMMON/libf/evolution/deftank/inipem_orbit.sh
r3579 r3666 15 15 # Name of the file containing the orbital data 16 16 orb_data="obl_ecc_lsp.asc" 17 18 # Name of the file containing the starting date (Earth years) 19 date_file="run_PEM.def" 17 20 ###################################################################### 18 21 … … 23 26 exit 1 24 27 fi 25 if [ ! -f " startfi.nc" ]; then28 if [ ! -f "$name_file" ]; then 26 29 echo "Error: file \"$name_file\" not found!" 27 30 exit 1 28 31 fi 29 if [ ! -f " run_PEM.def" ]; then30 echo "Error: file \" run_PEM.def\" not found!"32 if [ ! -f "$date_file" ]; then 33 echo "Error: file \"$date_file\" not found!" 31 34 exit 1 32 35 fi 33 36 34 # Get the number of Earth years before present to start the PEM run from "run_PEM.def" 35 eyears_bp_ini=$(grep 'year_earth_bp_ini=' run_PEM.def | cut -d '=' -f 2 | tr -d '[:space:]') 36 echo "The starting date is $eyears_bp_ini Earth years according to \"run_PEM.def\"." 37 # Get the number of Earth years before present to start the PEM run 38 eyears_bp_ini=$(grep 'year_earth_bp_ini=' $date_file | cut -d '=' -f 2 | tr -d '[:space:]') 39 echo "In \"$date_file\":" 40 echo "The starting date is $eyears_bp_ini Earth years." 37 41 38 42 # Get the new values for the orbital parameters … … 58 62 fi 59 63 new_Lsp=$(echo "($lsp2 - $lsp1)/($y2 - $y1)*($yearlask - $y1) + $lsp1" | bc -l) 60 echo " New obliquity = $new_obl"61 echo " New eccentricity = $new_ecc"62 echo " New Lsp = $new_Lsp"63 echo " Done!"64 echo "In \"$orb_data\":" 65 echo "Found obliquity = $new_obl" 66 echo "Found eccentricity = $new_ecc" 67 echo "Found Lsp = $new_Lsp" 64 68 break 65 69 fi … … 95 99 peri_day=$(echo "$year_day*(1. - ($zx0 - $new_ecc*s($zx0))/(2.*$pi))" | bc -l) 96 100 97 ztheta=$(echo "($new_iniLs - $new_Lsp)/$degrad" | bc -l)98 tan=$(echo "s(0.5*$ztheta)/c(0.5*$ztheta)" | bc -l)99 zx0=$(echo "2.*a($tan*sqrt((1. - $new_ecc)/(1. + $new_ecc)))" | bc -l)100 xref=$(echo "$zx0 - $new_ecc*s($zx0)" | bc -l)101 new_inisol=$(echo "$peri_day + $xref*$year_day/(2.*$pi)" | bc -l)102 if [ $(echo "$new_inisol < 0." | bc -l) -eq 1 ]; then103 new_inisol=$(echo "$new_inisol + $year_day" | bc -l)104 fi105 if [ $(echo "$new_inisol >= $year_day" | bc -l) -eq 1 ]; then106 new_inisol=$(echo "$new_inisol - $year_day" | bc -l)107 fi108 109 101 # Update the netCDF file 110 102 # controle(15) = periheli ! min. Sun-Mars distance (Mkm) ̃206.66 … … 117 109 -s "controle(15)=$aphelie" \ 118 110 -s "controle(16)=$peri_day" \ 119 -s "controle(2)=$new_inisol" \120 111 $name_file $name_file 121 112 … … 123 114 echo "New obliquit = $new_obl" 124 115 echo "New eccentricity = $new_ecc -> new periheli = $periheli" 125 echo " -> new aphelie = $aphelie"116 echo " -> new aphelie = $aphelie" 126 117 echo "New Lsp = $new_Lsp -> new peri_day = $peri_day" 127 echo "New initial Ls = $new_iniLs -> New initial sol = $new_inisol"128 118 echo "Done!" -
trunk/LMDZ.COMMON/libf/evolution/deftank/lib_launchPEM.sh
r3649 r3666 181 181 else # Mode: submitting jobs 182 182 cp PCMrun.job PCMrun${iPCM}.job 183 sed -i -E " s/($name_job[^0-9]*)[0-9]+([^0-9]*)$/\1${iPCM}\2/" PCMrun${iPCM}.job183 sed -i -E "/^$name_job/s/(.*[^0-9])([0-9]+)(_[^0-9]*)?$/\1${iPCM}\3/" PCMrun${iPCM}.job 184 184 sed -i "s/^k=[0-9]\+$/k=$(echo "$ii - $3 + 2" | bc)/" PCMrun${iPCM}.job 185 185 jobID=$(eval "$submit_job PCMrun${iPCM}.job") … … 208 208 else # Mode: submitting jobs 209 209 cp PCMrun.job PCMrun${iPCM}.job 210 sed -i -E " s/($name_job[^0-9]*)[0-9]+([^0-9]*)$/\1${iPCM}\2/" PCMrun${iPCM}.job210 sed -i -E "/^$name_job/s/(.*[^0-9])([0-9]+)(_[^0-9]*)?$/\1${iPCM}\3/" PCMrun${iPCM}.job 211 211 sed -i "s/^k=[0-9]\+$/k=$(echo "$i - $3 + 2" | bc)/" PCMrun${iPCM}.job 212 212 jobID=$(eval "$submit_dependjob=afterok:${jobID} PCMrun${iPCM}.job") … … 234 234 fi 235 235 else # Mode: submitting jobs 236 sed -i -E " s/($name_job[^0-9]*)[0-9]+([^0-9]*)$/\1${iPEM}\2/" PEMrun.job236 sed -i -E "/^$name_job/s/(.*[^0-9])([0-9]+)(_[^0-9]*)?$/\1${iPEM}\3/" PEMrun.job 237 237 jobID=$(eval "$submit_job PEMrun.job") 238 238 # Create a file to cancel the dependent jobs of the cycle … … 264 264 fi 265 265 else # Mode: submitting jobs 266 sed -i -E " s/($name_job[^0-9]*)[0-9]+([^0-9]*)$/\1${iPEM}\2/" PEMrun.job266 sed -i -E "/^$name_job/s/(.*[^0-9])([0-9]+)(_[^0-9]*)?$/\1${iPEM}\3/" PEMrun.job 267 267 jobID=$(eval "$submit_dependjob=afterok:${jobID} PEMrun.job") 268 268 echo $kill_job $jobID >> kill_launchPEM.sh -
trunk/LMDZ.COMMON/libf/evolution/deftank/visu_evol_layering.py
r3460 r3666 151 151 ### Processing 152 152 stratif_data, max_top_elevation, longitude, latitude = process_files(folder_path,base_name) 153 if dz > max_top_elevation: 154 print('The discretization step is higher than the maximum top elevation: please provide a correct value!') 155 exit() 153 156 ref_grid, gridded_stratif_data = interpolate_data(stratif_data,max_top_elevation,dz) 154 157 date_time = read_infofile(infofile) -
trunk/LMDZ.COMMON/libf/evolution/layering_mod.F90
r3638 r3666 125 125 126 126 ! Verification of volume fraction 127 if (abs(1. - (str%co2ice_volfrac + str%h2oice_volfrac + str%dust_volfrac + str%air_volfrac)) > tol) & 128 error stop 'add_stratum: properties for the new stratum are not possible (sum of volumetric fraction /= 1)!' 127 if (abs(1. - (str%co2ice_volfrac + str%h2oice_volfrac + str%dust_volfrac + str%air_volfrac)) > tol) then 128 call print_stratum(str) 129 error stop 'add_stratum: properties for the new stratum are not possible (sum of volumetric fraction /= 1)!' 130 endif 129 131 130 132 ! Increment the number of strata … … 178 180 179 181 ! Verification of volume fraction 180 if (abs(1. - (str%co2ice_volfrac + str%h2oice_volfrac + str%dust_volfrac + str%air_volfrac)) > tol) & 181 error stop 'insert_stratum: properties for the new stratum are not possible (sum of volumetric fraction /= 1)!' 182 if (abs(1. - (str%co2ice_volfrac + str%h2oice_volfrac + str%dust_volfrac + str%air_volfrac)) > tol) then 183 call print_stratum(str) 184 error stop 'add_stratum: properties for the new stratum are not possible (sum of volumetric fraction /= 1)!' 185 endif 182 186 183 187 ! Increment the number of strata -
trunk/LMDZ.COMMON/libf/evolution/pem.F90
r3649 r3666 893 893 if (soil_pem) then 894 894 ! II_d.2 Shifting soil temperature to surface 895 write(*,*) "> Shifting soil temperature profile to match surface evolution"896 895 call shift_tsoil2surf(ngrid,nsoilmx_PEM,nslope,zshift_surf,zlag,tsurf_avg,tsoil_PEM) 897 deallocate(zshift_surf,zlag)898 896 899 897 ! II_d.3 Update soil temperature … … 977 975 endif 978 976 endif !soil_pem 977 deallocate(zshift_surf,zlag) 979 978 980 979 !------------------------ … … 1022 1021 ! enddo 1023 1022 !enddo 1024 deallocate(vmr_co2_PEM_phys,icetable_depth_old,tsoil_PEM_timeseries_old) 1023 if (soil_pem) deallocate(icetable_depth_old,tsoil_PEM_timeseries_old) 1024 deallocate(vmr_co2_PEM_phys) 1025 1025 1026 1026 !------------------------ … … 1071 1071 deallocate(d_co2ice,d_co2ice_ini,d_h2oice) 1072 1072 deallocate(is_co2ice_ini,is_co2ice_sublim_ini,is_h2oice_sublim_ini) 1073 if (layering_algo) then 1074 do islope = 1,nslope 1075 do i = 1,ngrid 1076 call del_layering(stratif(i,islope)) 1077 enddo 1078 enddo 1079 deallocate(new_str,new_lag1,new_lag2,current1,current2) 1080 endif 1073 if (layering_algo) deallocate(new_str,new_lag1,new_lag2,current1,current2) 1081 1074 !------------------------------ END RUN -------------------------------- 1082 1075 -
trunk/LMDZ.COMMON/libf/evolution/pemetat0.F90
r3602 r3666 139 139 if (.not. found) then 140 140 write(*,*) 'Pemetat0: failed loading <nb_str_max>!' 141 write(*,*) '''nb_str_max'' is set to 3!'141 write(*,*) '''nb_str_max'' is set to 1!' 142 142 else 143 143 nb_str_max = int(inquire_dimension_length('nb_str_max'))
Note: See TracChangeset
for help on using the changeset viewer.