Changeset 3533 for trunk/LMDZ.COMMON/libf/evolution
- Timestamp:
- Dec 4, 2024, 6:29:10 PM (3 weeks ago)
- Location:
- trunk/LMDZ.COMMON/libf/evolution
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/changelog.txt
r3532 r3533 504 504 == 04/12/2024 == JBC 505 505 Removing unecessary module/subroutine "interpol_TI_PEM2PCM.F90" + Few small corrections/cleanings. 506 507 == 04/12/2024 == JBC 508 Fixing the writing format for "info_PEM.txt". -
trunk/LMDZ.COMMON/libf/evolution/info_PEM_mod.F90
r3532 r3533 31 31 logical :: ok 32 32 integer :: cstat 33 character(50) :: info_frmt 34 character(20) :: ich1, ich2, ich3, ich4, fch1, fch2, fch3 33 character(20) :: fch1, fch2, fch3 35 34 36 35 !----- Code … … 40 39 write(fch2,'(f'//int2str(nb_digits(n_myear) + 5)//'.4)') n_myear 41 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" 42 write(ich1,'(i0)') iPCM 43 write(ich2,'(i0)') iPEM + 1 44 write(ich3,'(i0)') nPCM 45 write(ich4,'(i0)') nPCM_ini 46 call execute_command_line('sed -i "1s/.*/'//trim(fch1)//' '//trim(fch2)//' '//trim(fch3)//' '//trim(ich1)//' '//trim(ich2)//' '//trim(ich3)//' '//trim(ich4)//'/" 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)//'/" info_PEM.txt',cmdstat = cstat) 47 42 if (cstat > 0) then 48 43 error stop 'info_PEM: command execution failed!' … … 53 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 54 49 ! The conversion ratio from Planetary years to Earth years is given in the header of the file 55 info_frmt = '(f'//int2str(nb_digits(year_bp_ini + i_myear) + 5)//'.4,'//'f'//int2str(nb_digits(i_myear_leg) + 5)//'.4,'//'f'//int2str(nb_digits(i_myear) + 5)//'.4,'//'i0)' 56 write(1,trim(adjustl(info_frmt))) year_bp_ini + i_myear, i_myear_leg, i_myear, stopPEM 50 write(1,'(f20.4,f20.4,f20.4,i20)') year_bp_ini + i_myear, i_myear_leg, i_myear, stopPEM 57 51 close(1) 58 52 else … … 67 61 ! Function to convert an integer into a string 68 62 69 integer, intent(in) :: i 70 character(20) :: str 63 integer, intent(in) :: i 64 character(20) :: str_tmp 65 character(:), allocatable :: str 71 66 72 if (nb_digits(real(i)) > len(str )) error stop 'int2str [info_PEM_mod]: invalid integer for conversion!'73 write(str ,'(i0)') i74 str = trim(adjustl(str ))67 if (nb_digits(real(i)) > len(str_tmp)) error stop 'int2str [info_PEM_mod]: invalid integer for conversion!' 68 write(str_tmp,'(i0)') i 69 str = trim(adjustl(str_tmp)) 75 70 76 71 END FUNCTION int2str
Note: See TracChangeset
for help on using the changeset viewer.