Changeset 3616
- Timestamp:
- Feb 10, 2025, 2:28:11 PM (5 months ago)
- Location:
- trunk/LMDZ.COMMON/libf/evolution
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/changelog.txt
r3612 r3616 584 584 - missing initialization for slope number (r3609); 585 585 - taking into account that there may be no "startfi.nc" at the beginning of the PEM simulation. 586 587 == 10/02/2025 == JBC 588 - Improvement of the loops to update surface temperature in case of CO2 ice is disappearing. 589 - Improvement of messages printed on the terminal. -
trunk/LMDZ.COMMON/libf/evolution/pem.F90
r3611 r3616 231 231 232 232 ! Some variables for the PEM run 233 real, parameter :: year_step = 1 ! Timestep for the pem 234 real :: i_myear_leg ! Number of iteration 235 real :: n_myear_leg ! Maximum number of iterations before stopping 236 real :: i_myear ! Global number of Martian years of the chained simulations 237 real :: n_myear ! Maximum number of Martian years of the chained simulations 238 real :: timestep ! Timestep [s] 239 character(100) :: arg ! To read command-line arguments program was invoked 240 logical :: timewall ! Flag to use the time limit stopping criterion in case of a PEM job 241 integer(kind = 8) :: cr ! Number of clock ticks per second (count rate) 242 integer(kind = 8) :: c1, c2 ! Counts of processor clock 243 character(100) :: chtimelimit ! Time limit for the PEM job outputted by the SLURM command 244 real :: timelimit ! Time limit for the PEM job in seconds 245 real, parameter :: antetime = 1200 ! Anticipation time to prevent reaching the time limit: 1200 s = 20 min by default 246 integer :: cstat, days, hours, minutes, seconds 247 character(1) :: sep 233 real, parameter :: year_step = 1 ! Timestep for the pem 234 real :: i_myear_leg ! Number of iteration 235 real :: n_myear_leg ! Maximum number of iterations before stopping 236 real :: i_myear ! Global number of Martian years of the chained simulations 237 real :: n_myear ! Maximum number of Martian years of the chained simulations 238 real :: timestep ! Timestep [s] 239 character(100) :: arg ! To read command-line arguments program was invoked 240 logical :: timewall ! Flag to use the time limit stopping criterion in case of a PEM job 241 integer(kind = 8) :: cr ! Number of clock ticks per second (count rate) 242 integer(kind = 8) :: c1, c2 ! Counts of processor clock 243 character(100) :: chtimelimit ! Time limit for the PEM job outputted by the SLURM command 244 real :: timelimit ! Time limit for the PEM job in seconds 245 real, parameter :: antetime = 1200 ! Anticipation time to prevent reaching the time limit: 1200 s = 20 min by default 246 integer :: cstat, days, hours, minutes, seconds 247 character(1) :: sep 248 character(8) :: date 249 character(10) :: time 250 character(5) :: zone 251 integer, dimension(8) :: values 252 character(128) :: dir = ' ' 253 character(32) :: logname = ' ' 254 character(32) :: hostname = ' ' 248 255 249 256 #ifdef CPP_STD … … 358 365 endif 359 366 367 ! Some user info 368 call date_and_time(date,time,zone,values) 369 call getcwd(dir) ! Current directory 370 call getlog(logname) ! User name 371 call hostnm(hostname) ! Machine/station name 372 write(*,*) 373 write(*,*) '######### PEM information #########' 374 write(*,*) '+ User : '//trim(logname) 375 write(*,*) '+ Machine : '//trim(hostname) 376 write(*,*) '+ Directory: '//trim(dir) 377 write(*,'(a,i2,a,i2,a,i4)') ' + Date : ',values(3),'/',values(2),'/',values(1) 378 write(*,'(a,i2,a,i2,a,i2,a)') ' + Time : ',values(5),':',values(6),':',values(7) 379 360 380 ! Parallel variables 361 381 #ifndef CPP_STD … … 382 402 ! I_a Read the "run.def" 383 403 !------------------------ 404 write(*,*) 405 write(*,*) '######### PEM initialization #########' 384 406 write(*,*) '> Reading "run.def" (PEM)' 385 407 #ifndef CPP_1D … … 706 728 ! II_a Update pressure, ice and tracers 707 729 !------------------------ 730 write(*,*) 731 write(*,*) '######### PEM cycle #########' 708 732 i_myear_leg = 0 709 733 stopPEM = 0 … … 723 747 do while (i_myear_leg < n_myear_leg .and. i_myear < n_myear) 724 748 ! II.a.1. Compute updated global pressure 749 write(*,'(a,f10.2)') ' #### Iteration of the PEM leg (Martian years): ', i_myear_leg + 1 725 750 write(*,*) "> Updating the surface pressure" 726 751 ps_avg_global_old = ps_avg_global_new … … 826 851 if (is_co2ice_ini(ig,islope) .and. co2_ice(ig,islope) < 1.e-10 .and. .not. co2ice_disappeared(ig,islope)) then 827 852 co2ice_disappeared(ig,islope) = .true. 828 if (latitude_deg(ig) > 0.) then 829 outer1: do ig_loop = ig,ngrid 830 do islope_loop = islope,iflat,-1 853 if (latitude_deg(ig) > 0.) then ! North hemisphere 854 outer1: do ig_loop = ig,ngrid ! Go towards equator 855 do islope_loop = islope - 1,1,-1 ! Go over the slopes (backward numbering - should be equator-ward) 856 if (.not. is_co2ice_ini(ig_loop,islope_loop) .and. co2_ice(ig_loop,islope_loop) < 1.e-10) then 857 tsurf_avg(ig,islope) = tsurf_avg(ig_loop,islope_loop) 858 exit outer1 859 endif 860 enddo 861 do islope_loop = islope + 1,nslope ! Go over the slopes (forward numbering - should be pole-ward) 831 862 if (.not. is_co2ice_ini(ig_loop,islope_loop) .and. co2_ice(ig_loop,islope_loop) < 1.e-10) then 832 863 tsurf_avg(ig,islope) = tsurf_avg(ig_loop,islope_loop) … … 835 866 enddo 836 867 enddo outer1 837 else 838 outer2: do ig_loop = ig,1,-1 839 do islope_loop = islope,iflat 868 else ! South hemisphere 869 outer2: do ig_loop = ig,1,-1 ! Go towards equator 870 do islope_loop = islope + 1,nslope ! Go over the slopes (forward numbering - should be equator-ward) 871 if (.not. is_co2ice_ini(ig_loop,islope_loop) .and. co2_ice(ig_loop,islope_loop) < 1.e-10) then 872 tsurf_avg(ig,islope) = tsurf_avg(ig_loop,islope_loop) 873 exit outer2 874 endif 875 enddo 876 do islope_loop = islope - 1,1,-1 ! Go over the slopes (backward numbering - should be pole-ward) 840 877 if (.not. is_co2ice_ini(ig_loop,islope_loop) .and. co2_ice(ig_loop,islope_loop) < 1.e-10) then 841 878 tsurf_avg(ig,islope) = tsurf_avg(ig_loop,islope_loop) … … 845 882 enddo outer2 846 883 endif 847 else if (co2_ice(ig,islope) > 1.e-10 .and. d_co2ice(ig,islope) > 1.e-10) then ! Put tsurf as tcond CO2884 else if (co2_ice(ig,islope) > 1.e-10 .and. d_co2ice(ig,islope) > 1.e-10) then ! Put tsurf as Tcond CO2 848 885 call computeTcondCO2(timelen,ngrid,nslope,vmr_co2_PEM_phys,ps_timeseries,ps_avg_global_ini,ps_avg_global_new,tsurf_avg) 849 886 endif … … 976 1013 !------------------------ 977 1014 call recomp_tend_co2(ngrid,nslope,timelen,d_co2ice,d_co2ice_ini,co2_ice,emis,vmr_co2_PCM,vmr_co2_PEM_phys,ps_timeseries,ps_avg_global_old,ps_avg_global_new) 1015 978 1016 do ig = 1,ngrid 979 1017 do islope = 1,nslope … … 999 1037 select case (stopPEM) 1000 1038 case(1) 1001 write(*, *) "STOPPING because surface of h2o ice sublimating is too low:", stopPEM, "See message above."1039 write(*,'(a,i0,a)') " #### STOPPING because surface of h2o ice sublimating is too low:", stopPEM, "See message above." 1002 1040 case(2) 1003 write(*, *) "STOPPING because tendencies on h2o ice = 0:", stopPEM, "See message above."1041 write(*,'(a,i0,a)') " #### STOPPING because tendencies on h2o ice = 0:", stopPEM, "See message above." 1004 1042 case(3) 1005 write(*, *) "STOPPING because surface of co2 ice sublimating is too low:", stopPEM, "See message above."1043 write(*,'(a,i0,a)') " #### STOPPING because surface of co2 ice sublimating is too low:", stopPEM, "See message above." 1006 1044 case(4) 1007 write(*, *) "STOPPING because surface global pressure changed too much:", stopPEM, "See message above."1045 write(*,'(a,i0,a)') " #### STOPPING because surface global pressure changed too much:", stopPEM, "See message above." 1008 1046 case(5) 1009 write(*, *) "STOPPING because maximum number of iterations is reached (possibly due to orbital parameters):", stopPEM1047 write(*,'(a,i0)') " #### STOPPING because maximum number of iterations is reached (possibly due to orbital parameters):", stopPEM 1010 1048 case(6) 1011 write(*, *) "STOPPING because maximum number of Martian years to be simulated is reached:", stopPEM1049 write(*,'(a,i0)') " #### STOPPING because maximum number of Martian years to be simulated is reached:", stopPEM 1012 1050 case(7) 1013 write(*, *) "STOPPING because the time limit for the PEM job will be reached soon:", stopPEM1051 write(*,'(a,i0)') " #### STOPPING because the time limit for the PEM job will be reached soon:", stopPEM 1014 1052 case(8) 1015 write(*, *) "STOPPING because the layering algorithm met an hasty end:", stopPEM1053 write(*,'(a,i0)') " #### STOPPING because the layering algorithm met an hasty end:", stopPEM 1016 1054 case default 1017 write(*, *) "STOPPING with unknown stopping criterion code:", stopPEM1055 write(*,'(a,i0)') " #### STOPPING with unknown stopping criterion code:", stopPEM 1018 1056 end select 1019 1057 exit 1020 1058 else 1021 write(*, *) "The PEM can continue!"1022 write(*,*) "Number of iterations of the PEM : i_myear_leg =", i_myear_leg1023 write(*,*) "Number of simulated Martian years: i_myear =", i_myear1059 write(*,'(a,f10.2,a)') ' #### The chained simulation has run for ',i_myear,' Martian years.' 1060 write(*,*) '#### The PEM can continue!' 1061 write(*,*) '####' 1024 1062 endif 1025 1063 enddo ! big time iteration loop of the pem … … 1046 1084 !------------------------ 1047 1085 ! III_a.1 Ice update for start file 1086 write(*,*) 1087 write(*,*) '######### PEM finalization #########' 1048 1088 write(*,*) '> Reconstructing perennial ice and frost for the PCM' 1049 1089 watercap = 0. … … 1251 1291 call info_PEM(i_myear_leg,stopPEM,i_myear,n_myear) 1252 1292 1253 write(*,*) '************************************************************************' 1254 write(*,*) "> The PEM has run for", i_myear_leg, "Martian years." 1255 write(*,*) "> The chained simulation has run for", i_myear, "Martian years =", i_myear*convert_years, "Earth years." 1256 write(*,*) "> The reached date is now", (year_bp_ini + i_myear)*convert_years, "Earth years." 1257 write(*,*) "> PEM: so far, so good!" 1258 write(*,*) '************************************************************************' 1293 write(*,*) 1294 write(*,*) '######### PEM finalization #########' 1295 write(*,'(a,f10.2,a)') " + The PEM leg has run for ", i_myear_leg, " Martian years." 1296 write(*,'(a,f10.2,a,f10.2,a)') " + The chained simulation has run for ", i_myear, " Martian years =", i_myear*convert_years, "Earth years." 1297 write(*,'(a,f10.2,a)') " + The reached date is now ", (year_bp_ini + i_myear)*convert_years, " Earth years." 1298 write(*,*) "+ PEM: so far, so good!" 1299 write(*,*) '####################################' 1259 1300 1260 1301 if (layering_algo) then -
trunk/LMDZ.COMMON/libf/evolution/read_data_PCM_mod.F90
r3611 r3616 304 304 ! Close the NetCDF file 305 305 call error_msg(nf90_close(fID),"close",filename2) 306 write(*,*) ' ">'//filename2//'" processed!'306 write(*,*) '> "'//filename2//'" processed!' 307 307 308 308 END SUBROUTINE read_data_PCM
Note: See TracChangeset
for help on using the changeset viewer.