Ignore:
Timestamp:
Feb 17, 2026, 4:52:40 PM (12 days ago)
Author:
jbclement
Message:

PEM:
Addition of runs ID for the current cycle in "pem_workflow.sts".
JBC

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.COMMON/libf/evolution/workflow_status.F90

    r4072 r4075  
    121121! LOCAL VARIABLES
    122122! ---------------
    123 logical(k4)   :: here
    124 integer(di)   :: cstat, ierr, funit
    125 character(20) :: fch1, fch2, fch3
     123logical(k4)               :: here
     124integer(di)               :: i, cstat, ierr, funit, id_PCM_1, n_id_PCM
     125character(20)             :: header1, header2, header3
     126character(:), allocatable :: headline
    126127
    127128! CODE
     
    132133
    133134! Modify the header (first line)
    134 write(fch1,'(f'//int2str(nb_digits(n_yr_sim) + 5)//'.4)') n_yr_sim
    135 write(fch2,'(f'//int2str(nb_digits(ntot_yr_sim) + 5)//'.4)') ntot_yr_sim
    136 write(fch3,'(f6.4)') r_plnt2earth_yr ! 4 digits to the right of the decimal point to respect the precision of year in "pem_workflow_lib.sh"
    137 call execute_command_line('sed -i "1s/.*/'//trim(fch1)//' '//trim(fch2)//' '//trim(fch3)//' '//int2str(i_pcm_run)//' '//int2str(i_pem_run + 1)//' '//int2str(n_pcm_runs)//' '//int2str(n_pcm_runs_ini)//'/" pem_workflow.sts',cmdstat = cstat)
     135write(header1,'(f'//int2str(nb_digits(n_yr_sim) + 5)//'.4)') n_yr_sim
     136write(header2,'(f'//int2str(nb_digits(ntot_yr_sim) + 5)//'.4)') ntot_yr_sim
     137write(header3,'(f6.4)') r_plnt2earth_yr ! 4 digits to the right of the decimal point to respect the precision of year in "pem_workflow_lib.sh"
     138call execute_command_line('sed -i "1s/.*/'//trim(header1)//' '//trim(header2)//' '//trim(header3)//' '//int2str(i_pcm_run)//' '//int2str(i_pem_run + 1)//' '//int2str(n_pcm_runs)//' '//int2str(n_pcm_runs_ini)//'/" pem_workflow.sts',cmdstat = cstat)
    138139if (cstat > 0) then
    139140    call stop_clean(__FILE__,__LINE__,'command execution failed!',1)
     
    143144
    144145! Add the information of current PEM run at the end of file
     146! Headline (cycle infomation), Date, Number of years done by the chained simulation, Number of years done by the PEM run, Code of the stopping criterion
     147if (i_pcm_run - 1 <= n_pcm_runs_ini) then
     148    id_PCM_1 = i_pcm_run - n_pcm_runs_ini
     149    n_id_PCM = n_pcm_runs_ini
     150else
     151    id_PCM_1 = i_pcm_run - n_pcm_runs
     152    n_id_PCM = n_pcm_runs
     153end if
     154headline = 'cycle=PCM('//int2str(id_PCM_1)
     155do i = 1,n_id_PCM - 1
     156    headline = headline//'+'//int2str(id_PCM_1 + i)
     157end do
     158headline = headline//')+PEM('//int2str(i_pem_run)//')'
    145159open(newunit = funit,file = statusfile_name,status = "old",position = "append",action = "write",iostat = ierr)
    146160if (ierr /= 0) call stop_clean(__FILE__,__LINE__,'error opening file "'//statusfile_name//'"!',ierr)
    147 ! Date, Number of years done by the PEM run, Number of years done by the chained simulation, Code of the stopping criterion
    148 write(funit,'(f20.4,f20.4,f20.4,i20)') pem_ini_date + n_yr_sim, n_yr_run, n_yr_sim, stopPEM
     161write(funit,'(a,f20.4,f20.4,f20.4,i4)') headline, pem_ini_date + n_yr_sim, n_yr_sim, n_yr_run, stopPEM
    149162close(funit)
    150163
Note: See TracChangeset for help on using the changeset viewer.