49 logical :: EXECUTE_PREPROCESS = .false.
50 logical :: EXECUTE_MODEL = .true.
51 integer :: NUM_BULKJOB = 1
52 integer :: NUM_DOMAIN = 1
53 integer :: NUM_FAIL_TOLERANCE = 1
54 integer :: FREQ_FAIL_CHECK = 5
57 logical :: ABORT_ALL_JOBS = .false.
58 logical :: LOG_SPLIT = .false.
59 logical :: COLOR_REORDER = .true.
60 logical :: FAILURE_PRC_MANAGE = .false.
62 namelist / param_launcher / &
76 integer :: universal_comm
77 integer :: universal_nprocs
78 logical :: universal_master
79 character(len=H_LONG) :: universal_cnf_fname
81 integer :: global_comm
82 integer :: global_nprocs
85 integer :: intercomm_parent_null
86 integer :: intercomm_child_null
87 character(len=H_LONG) :: bulk_prefix
89 logical :: use_fpm = .false.
92 integer :: intercomm_parent
93 integer :: intercomm_child
94 character(len=H_LONG) :: local_cnf_fname
106 if( universal_master )
write(*,*)
'*** Start Launch System for SCALE-RM' 116 conf_files(1) = universal_cnf_fname
120 read(fid,nml=param_launcher,iostat=ierr)
123 elseif( ierr > 0 )
then 124 if( universal_master )
write(*,*)
'xxx Not appropriate names in namelist PARAM_LAUNCHER. Check!' 130 if ( execute_preprocess &
131 .OR. execute_model )
then 132 if( universal_master )
write(*,*)
"*** Execute preprocess? : ", execute_preprocess
133 if( universal_master )
write(*,*)
"*** Execute model? : ", execute_model
135 if( universal_master )
write(*,*)
'xxx No execution. please check PARAM_LAUNCHER. STOP' 141 if ( mod(universal_nprocs,num_bulkjob) /= 0 )
then 142 if( universal_master )
write(*,*)
'xxx Total Num of Processes must be divisible by NUM_BULKJOB. Check!' 143 if( universal_master )
write(*,*)
'xxx Total Num of Processes = ', universal_nprocs
144 if( universal_master )
write(*,*)
'xxx NUM_BULKJOB = ', num_bulkjob
148 global_nprocs = universal_nprocs / num_bulkjob
149 prc_bulkjob(1:num_bulkjob) = global_nprocs
150 if ( num_bulkjob > 1 )
then 151 if( universal_master )
write(*,
'(1x,A,I5)')
"*** TOTAL BULK JOB NUMBER = ", num_bulkjob
152 if( universal_master )
write(*,
'(1x,A,I5)')
"*** PROCESS NUM of EACH JOB = ", global_nprocs
154 if ( failure_prc_manage )
then 155 if( universal_master )
write(*,
'(1x,A)')
"*** Available: Failure Process Management" 157 if ( num_fail_tolerance <= 0 )
then 158 if( universal_master )
write(*,*)
'xxx Num of Failure Processes must be positive number. Check!' 159 if( universal_master )
write(*,*)
'xxx NUM_FAIL_TOLERANCE = ', num_fail_tolerance
163 if ( num_fail_tolerance > num_bulkjob )
then 164 write(*,*)
'xxx NUM_FAIL_TOLERANCE is bigger than NUM_BLUKJOB number' 165 write(*,*)
' set to be: NUM_FAIL_TOLERANCE <= NUM_BLUKJOB' 169 if ( num_domain > 1 )
then 170 if ( freq_fail_check >= 1 .or. num_fail_tolerance /= num_bulkjob )
then 171 write(*,*)
'xxx Full function of FPM is not available with online nesting.' 172 write(*,*)
' You can use this only to avoid job stop until all members finish.' 173 write(*,*)
' for this purpose, set: FREQ_FAIL_CHECK = 0' 174 write(*,*)
' NUM_FAIL_TOLERANCE == NUM_BULKJOB' 190 intercomm_parent_null, &
191 intercomm_child_null, &
199 if ( num_domain > 1 )
then 200 if( universal_master )
write(*,
'(1x,A,I5)')
"*** TOTAL DOMAIN NUMBER = ", num_domain
201 if( universal_master )
write(*,
'(1x,A,L5)')
"*** Flag of ABORT ALL JOBS = ", abort_all_jobs
218 call fpm_init( num_fail_tolerance, &
231 if ( num_bulkjob > 1 )
then 232 local_cnf_fname = trim(bulk_prefix)//
"/"//trim(local_cnf_fname)
235 if ( execute_preprocess )
then 237 intercomm_parent_null, &
238 intercomm_child_null, &
242 if ( execute_model )
then 252 if( universal_master )
write(*,*)
'*** End Launch System for SCALE-RM' integer, parameter, public prc_domain_nlim
max depth of domains
subroutine, public rm_prep(comm_world, intercomm_parent, intercomm_child, cnf_fname)
Setup.
subroutine, public prc_mpistart(comm)
Start MPI.
subroutine, public prc_mpisplit(ORG_COMM, NUM_DOMAIN, PRC_DOMAINS, CONF_FILES, LOG_SPLIT, bulk_split, color_reorder, INTRA_COMM, inter_parent, inter_child, fname_local)
MPI Communicator Split.
integer function, public io_cnf_open(fname, is_master)
open config file
subroutine, public prc_global_setup(abortall, comm)
setup MPI in global communicator
module SCALE-RM (a main routine of regional model)
subroutine, public prc_universal_setup(comm, nprocs, ismaster)
setup MPI in universal communicator
subroutine, public rm_driver(comm_world, intercomm_parent, intercomm_child, cnf_fname)
Setup.
program scalerm
Program SCALE-RM (a launcher of main routine)
subroutine, public prc_abort
Abort Process.
character(len=h_long) function, public io_arg_getfname(is_master, allow_noconf)
get config filename from argument
subroutine, public prc_errhandler_setup(use_fpm, master)
Setup MPI error handler.
subroutine, public prc_mpifinish
Stop MPI peacefully.
subroutine, public fpm_init(max_failure, polling_freq, universal_comm, global_comm, local_comm, num_member, global_root, use_fpm)
Initialize FPM.
integer, dimension(prc_domain_nlim+1), public prc_global_root
root processes in global members