Changeset 3980
- Timestamp:
- Nov 28, 2025, 5:38:44 PM (2 days ago)
- Location:
- trunk/LMDZ.COMMON/libf/evolution
- Files:
-
- 13 edited
-
changelog.txt (modified) (1 diff)
-
conf_pem.F90 (modified) (1 diff)
-
deftank/PCMrun.job (modified) (2 diffs)
-
deftank/PEMrun.job (modified) (2 diffs)
-
deftank/README (modified) (1 diff)
-
deftank/clean.sh (modified) (1 diff)
-
deftank/launchPEM.sh (modified) (3 diffs)
-
deftank/lib_launchPEM.sh (modified) (4 diffs)
-
deftank/visu_evol_layering.py (modified) (4 diffs)
-
grid_conversion.F90 (modified) (2 diffs)
-
info_PEM_mod.F90 (modified) (4 diffs)
-
recomp_orb_param_mod.F90 (modified) (1 diff)
-
stopping_crit_mod.F90 (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/changelog.txt
r3979 r3980 805 805 == 28/11/2025 == JBC 806 806 Addition of the periodicity to search along the longitudes to find the nearest bare soil from the place where ice disappeared + Searching with slope priority according to equator-ward orientation to try gaining efficiency + Warning if the search is unsuccessful. 807 808 == 28/11/2025 == JBC 809 Renaming the file "info_PEM.txt" into "launchPEM.info". -
trunk/LMDZ.COMMON/libf/evolution/conf_pem.F90
r3860 r3980 43 43 44 44 ! #---------- Martian years parameters from launching script 45 open(100,file = ' info_PEM.txt',status = 'old',form = 'formatted',action = 'read',iostat = ierr)45 open(100,file = 'launchPEM.info',status = 'old',form = 'formatted',action = 'read',iostat = ierr) 46 46 if (ierr /= 0) then 47 write(*,*) 'Cannot find required file " info_PEM.txt"!'47 write(*,*) 'Cannot find required file "launchPEM.info"!' 48 48 write(*,*) 'It should be created by the launching script...' 49 49 stop -
trunk/LMDZ.COMMON/libf/evolution/deftank/PCMrun.job
r3977 r3980 34 34 35 35 # Running the PCM 36 read i_myear n_myear convert_years iPCM iPEM nPCM nPCM_ini < info_PEM.txt36 read i_myear n_myear convert_years iPCM iPEM nPCM nPCM_ini < launchPEM.info 37 37 echo "Run \"PCM $iPCM\" is starting." 38 38 cp run_PCM.def run.def … … 77 77 i_myear=$(echo "$i_myear + 1." | bc -l) 78 78 fi 79 sed -i "1s/.*/$i_myear $n_myear $convert_years $iPCM $iPEM $nPCM $nPCM_ini/" info_PEM.txt79 sed -i "1s/.*/$i_myear $n_myear $convert_years $iPCM $iPEM $nPCM $nPCM_ini/" launchPEM.info -
trunk/LMDZ.COMMON/libf/evolution/deftank/PEMrun.job
r3977 r3980 31 31 32 32 # Running the PEM 33 read i_myear n_myear convert_years iPCM iPEM nPCM nPCM_ini < info_PEM.txt33 read i_myear n_myear convert_years iPCM iPEM nPCM nPCM_ini < launchPEM.info 34 34 echo "Run \"PEM $iPEM\" is starting." 35 35 cp run_PEM.def run.def … … 61 61 62 62 # Launch the next cycle 63 #if [ "$(awk 'END{print $NF}' info_PEM.txt)" -eq 7 ]; then64 # read i_myear n_myear convert_years iPCM iPEM nPCM nPCM_ini < info_PEM.txt63 #if [ "$(awk 'END{print $NF}' launchPEM.info)" -eq 7 ]; then 64 # read i_myear n_myear convert_years iPCM iPEM nPCM nPCM_ini < launchPEM.info 65 65 # ./launchPEM.sh cont # Continue the PEM run if it stopped because of job time limit 66 66 #else -
trunk/LMDZ.COMMON/libf/evolution/deftank/README
r3977 r3980 63 63 > the usual outputs of the PCM: "restartfi.nc", "restart.nc", "diagfi.nc", etc; 64 64 > the XIOS outputs of the PCM: "Xoutdaily4pem*.nc"/"Xoutyearly4pem*.nc"; 65 > the outputs of the chained simulation: "launchPEM.log", " info_PEM.txt" and possibly "kill_launchPEM.sh";65 > the outputs of the chained simulation: "launchPEM.log", "launchPEM.info" and possibly "kill_launchPEM.sh"; 66 66 > the usual outputs of the PEM: "restartfi.nc", "restart.nc"/"restart1D.txt" and "diagpem.nc". 67 67 During the simulation, the PCM/PEM run files are renamed conveniently and stored in the sub-directories "logs" (log files), "starts" (starting files) and "diags" (diagnostic files). -
trunk/LMDZ.COMMON/libf/evolution/deftank/clean.sh
r3977 r3980 11 11 # Cleaning of files in the current folder 12 12 rm -f Bands*.dat 13 rm -f info_PEM.txt13 rm -f launchPEM.info 14 14 find . -type f -name "PCMrun*.job" ! -name "PCMrun.job" -delete 15 15 rm -f *.out -
trunk/LMDZ.COMMON/libf/evolution/deftank/launchPEM.sh
r3958 r3980 68 68 fi 69 69 fi 70 read i_myear n_myear convert_years iPCM iPEM nPCM nPCM_ini < info_PEM.txt70 read i_myear n_myear convert_years iPCM iPEM nPCM nPCM_ini < launchPEM.info 71 71 cyclelaunch $mode $counting $nPCM 72 72 73 73 # Starting a relaunch 74 74 elif [ $1 = "re" ]; then 75 if [ ! -f " info_PEM.txt" ]; then76 echo "Error: file \" info_PEM.txt\" does not exist in $dir!"75 if [ ! -f "launchPEM.info" ]; then 76 echo "Error: file \"launchPEM.info\" does not exist in $dir!" 77 77 echo "It is necessary to relaunch a PEM simulation." 78 78 errlaunch … … 88 88 fi 89 89 done 90 read i_myear n_myear_old convert_years iPCM iPEM nPCM_old nPCM_ini_old < info_PEM.txt90 read i_myear n_myear_old convert_years iPCM iPEM nPCM_old nPCM_ini_old < launchPEM.info 91 91 while true; do 92 92 if [ $relaunch = "PCM" ]; then … … 125 125 echo "The number of initial PCM years has been modified from $n_myear_old to $n_myear." 126 126 fi 127 sed -i "1s/.*/$i_myear $n_myear $convert_years $iPCM $iPEM $nPCM $nPCM_ini/" info_PEM.txt127 sed -i "1s/.*/$i_myear $n_myear $convert_years $iPCM $iPEM $nPCM $nPCM_ini/" launchPEM.info 128 128 if [ -f "kill_launchPEM.sh" ]; then 129 129 ./kill_launchPEM.sh -
trunk/LMDZ.COMMON/libf/evolution/deftank/lib_launchPEM.sh
r3977 r3980 290 290 291 291 # Create a file to manage years of the chained simulation and store some info from the PEM runs 292 echo $i_myear $n_myear $convert_years $iPCM $iPEM $nPCM $nPCM_ini > info_PEM.txt292 echo $i_myear $n_myear $convert_years $iPCM $iPEM $nPCM $nPCM_ini > launchPEM.info 293 293 } 294 294 … … 474 474 i_myear=0 475 475 fi 476 sed -i "1s/.*/$i_myear $n_myear $convert_years $iPCM $iPEM $nPCM $nPCM_ini/" info_PEM.txt476 sed -i "1s/.*/$i_myear $n_myear $convert_years $iPCM $iPEM $nPCM $nPCM_ini/" launchPEM.info 477 477 cleanfiles diags/diagpem .nc $(($iPEM - 1)) 478 478 cleanfiles diags/diagsoilpem .nc $(($iPEM - 1)) … … 504 504 il=$(echo "($irelaunch - $nPCM_ini + 1)%$nPCM + 1" | bc) 505 505 if [ $2 -ne 0 ]; then # Counting: PCM years taken into account 506 i_myear=$(echo "$(awk "NR==$iPEM {printf \"%s\n\", \$3}" " info_PEM.txt") + $il" | bc -l)506 i_myear=$(echo "$(awk "NR==$iPEM {printf \"%s\n\", \$3}" "launchPEM.info") + $il" | bc -l) 507 507 else # Counting: only PEM years count 508 i_myear=$(awk "NR==$iPEM {printf \"%s\n\", \$3}" " info_PEM.txt")509 fi 510 sed -i "1s/.*/$i_myear $n_myear $convert_years $iPCM $iPEM $nPCM $nPCM_ini/" info_PEM.txt508 i_myear=$(awk "NR==$iPEM {printf \"%s\n\", \$3}" "launchPEM.info") 509 fi 510 sed -i "1s/.*/$i_myear $n_myear $convert_years $iPCM $iPEM $nPCM $nPCM_ini/" launchPEM.info 511 511 cleanfiles diags/diagpem .nc $(($iPEM - 1)) 512 512 cleanfiles diags/diagsoilpem .nc $(($iPEM - 1)) … … 539 539 iPEM=$(echo "$irelaunch + 1" | bc) 540 540 iPCM=$(echo "$nPCM_ini + $nPCM*($irelaunch - 1) + 1" | bc) 541 i_myear=$(awk "NR==$iPEM {printf \"%s\n\", \$3}" " info_PEM.txt")542 sed -i "1s/.*/$i_myear $n_myear $convert_years $iPCM $iPEM $nPCM $nPCM_ini/" info_PEM.txt541 i_myear=$(awk "NR==$iPEM {printf \"%s\n\", \$3}" "launchPEM.info") 542 sed -i "1s/.*/$i_myear $n_myear $convert_years $iPCM $iPEM $nPCM $nPCM_ini/" launchPEM.info 543 543 cleanfiles diags/diagfi .nc $(($iPCM - 1)) 544 544 cleanfiles diags/diagsoil .nc $(($iPCM - 1)) -
trunk/LMDZ.COMMON/libf/evolution/deftank/visu_evol_layering.py
r3926 r3980 22 22 - folder_path: directory containing NetCDF files (default: "starts") 23 23 - base_name: base filename (default: "restartpem") 24 - infofile: name of the PEM info file (default: " info_PEM.txt")24 - infofile: name of the PEM info file (default: "launchPEM.info") 25 25 Validates existence of folder and infofile before returning. 26 26 """ … … 42 42 infofile = input( 43 43 "Enter the name of the PEM info file " 44 "(press Enter for default [ info_PEM.txt]): "45 ).strip() or " info_PEM.txt"44 "(press Enter for default [launchPEM.info]): " 45 ).strip() or "launchPEM.info" 46 46 while not os.path.isfile(infofile): 47 47 print(f" » \"{infofile}\" does not exist or is not a file.") 48 48 infofile = input( 49 "Enter a valid PEM info filename (press Enter for default [ info_PEM.txt]): "50 ).strip() or " info_PEM.txt"49 "Enter a valid PEM info filename (press Enter for default [launchPEM.info]): " 50 ).strip() or "launchPEM.info" 51 51 52 52 orbfile = input( … … 58 58 orbfile = input( 59 59 "Enter a valid orbital parameters ASCII filename (press Enter for default [obl_ecc_lsp.asc]): " 60 ).strip() or " info_PEM.txt"60 ).strip() or "launchPEM.info" 61 61 62 62 return folder_path, base_name, infofile, orbfile … … 240 240 def read_infofile(file_name): 241 241 """ 242 Reads " info_PEM.txt". Expects:242 Reads "launchPEM.info". Expects: 243 243 - First line: parameters where the 3rd value is martian_to_earth conversion factor. 244 244 - Each subsequent line: floats where first value is simulation timestamp (in Mars years). -
trunk/LMDZ.COMMON/libf/evolution/grid_conversion.F90
r3977 r3980 7 7 !======================================================================= 8 8 SUBROUTINE lonlat2vect(nlon,nlat,ngrid,v_ll,v_vect) 9 10 9 ! To convert data from lon x lat grid (where values at the poles are duplicated) into a vector 10 ! /!\ The longitudes -180 and +180 are not duplicated like in the PCM dynamics 11 11 12 12 implicit none … … 51 51 !======================================================================= 52 52 SUBROUTINE vect2lonlat(nlon,nlat,ngrid,v_vect,v_ll) 53 ! To convert data from a vector into lon x lat grid (where values at the poles are duplicated) 54 ! /!\ The longitudes -180 and +180 are not duplicated like in the PCM dynamics 53 55 54 56 implicit none -
trunk/LMDZ.COMMON/libf/evolution/info_PEM_mod.F90
r3533 r3980 13 13 !======================================================================= 14 14 ! 15 ! Purpose: Update the first line of " info_PEM.txt" to count the number of simulated Martian years16 ! Write in " info_PEM.txt" the reason why the PEM stopped and the number of simulated years15 ! Purpose: Update the first line of "launchPEM.info" to count the number of simulated Martian years 16 ! Write in "launchPEM.info" the reason why the PEM stopped and the number of simulated years 17 17 ! 18 18 ! Author: RV, JBC … … 34 34 35 35 !----- Code 36 inquire(file = ' info_PEM.txt',exist = ok)36 inquire(file = 'launchPEM.info',exist = ok) 37 37 if (ok) then 38 38 write(fch1,'(f'//int2str(nb_digits(i_myear) + 5)//'.4)') i_myear 39 39 write(fch2,'(f'//int2str(nb_digits(n_myear) + 5)//'.4)') n_myear 40 40 write(fch3,'(f6.4)') convert_years ! 4 digits to the right of the decimal point to respect the precision of Martian year in "launch_pem.sh" 41 call execute_command_line('sed -i "1s/.*/'//trim(fch1)//' '//trim(fch2)//' '//trim(fch3)//' '//int2str(iPCM)//' '//int2str(iPEM + 1)//' '//int2str(nPCM)//' '//int2str(nPCM_ini)//'/" info_PEM.txt',cmdstat = cstat)41 call execute_command_line('sed -i "1s/.*/'//trim(fch1)//' '//trim(fch2)//' '//trim(fch3)//' '//int2str(iPCM)//' '//int2str(iPEM + 1)//' '//int2str(nPCM)//' '//int2str(nPCM_ini)//'/" launchPEM.info',cmdstat = cstat) 42 42 if (cstat > 0) then 43 43 error stop 'info_PEM: command execution failed!' … … 45 45 error stop 'info_PEM: command execution not supported!' 46 46 endif 47 open(1,file = ' info_PEM.txt',status = "old",position = "append",action = "write")47 open(1,file = 'launchPEM.info',status = "old",position = "append",action = "write") 48 48 ! Martian date, Number of Martians years done by the PEM run, Number of Martians years done by the chainded simulation, Code of the stopping criterion 49 49 ! The conversion ratio from Planetary years to Earth years is given in the header of the file … … 51 51 close(1) 52 52 else 53 error stop 'The file '' info_PEM.txt'' does not exist and cannot be updated!'53 error stop 'The file ''launchPEM.info'' does not exist and cannot be updated!' 54 54 endif 55 55 -
trunk/LMDZ.COMMON/libf/evolution/recomp_orb_param_mod.F90
r3961 r3980 120 120 121 121 END MODULE recomp_orb_param_mod 122 -
trunk/LMDZ.COMMON/libf/evolution/stopping_crit_mod.F90
r3977 r3980 247 247 integer :: i, islope ! Loop 248 248 !======================================================================= 249 ! Checks to escape the subroutine 249 ! Checks to escape the subroutine (adjusment not relevant in 1D or if the PEM should stop already) 250 250 if (ngrid == 1 .or. stopCrit%stop_code() > 0) then 251 251 S_atm_2_h2o = 1.
Note: See TracChangeset
for help on using the changeset viewer.
