49 logical :: EXECUTE_PREPROCESS = .true.
50 logical :: EXECUTE_MODEL = .false.
51 integer :: NUM_BULKJOB = 1
52 integer :: NUM_DOMAIN = 1
53 integer :: NUM_FAIL_TOLERANCE = 1
54 integer :: FREQ_FAIL_CHECK = 0
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!' 131 if ( execute_preprocess &
132 .OR. execute_model )
then 133 if( universal_master )
write(*,*)
"*** Execute preprocess? : ", execute_preprocess
134 if( universal_master )
write(*,*)
"*** Execute model? : ", execute_model
136 if( universal_master )
write(*,*)
'xxx No execution. please check PARAM_LAUNCHER. STOP' 142 if ( mod(universal_nprocs,num_bulkjob) /= 0 )
then 143 if( universal_master )
write(*,*)
'xxx Total Num of Processes must be divisible by NUM_BULKJOB. Check!' 144 if( universal_master )
write(*,*)
'xxx Total Num of Processes = ', universal_nprocs
145 if( universal_master )
write(*,*)
'xxx NUM_BULKJOB = ', num_bulkjob
149 global_nprocs = universal_nprocs / num_bulkjob
150 prc_bulkjob(1:num_bulkjob) = global_nprocs
151 if ( num_bulkjob > 1 )
then 152 if( universal_master )
write(*,
'(1x,A,I5)')
"*** TOTAL BULK JOB NUMBER = ", num_bulkjob
153 if( universal_master )
write(*,
'(1x,A,I5)')
"*** PROCESS NUM of EACH JOB = ", global_nprocs
155 if ( failure_prc_manage )
then 156 if( universal_master )
write(*,
'(1x,A)')
"*** Available: Failure Process Management" 158 if ( num_fail_tolerance <= 0 )
then 159 if( universal_master )
write(*,*)
'xxx Num of Failure Processes must be positive number. Check!' 160 if( universal_master )
write(*,*)
'xxx NUM_FAIL_TOLERANCE = ', num_fail_tolerance
164 if ( num_fail_tolerance > num_bulkjob )
then 165 write(*,*)
'xxx NUM_FAIL_TOLERANCE is bigger than NUM_BLUKJOB number' 166 write(*,*)
' set to be: NUM_FAIL_TOLERANCE <= NUM_BLUKJOB' 181 intercomm_parent_null, &
182 intercomm_child_null, &
190 if ( num_domain > 1 )
then 191 if( universal_master )
write(*,
'(1x,A,I5)')
"*** TOTAL DOMAIN NUMBER = ", num_domain
192 if( universal_master )
write(*,
'(1x,A,L5)')
"*** Flag of ABORT ALL JOBS = ", abort_all_jobs
209 call fpm_init( num_fail_tolerance, &
223 if ( num_bulkjob > 1 )
then 224 local_cnf_fname = trim(bulk_prefix)//
"/"//trim(local_cnf_fname)
227 if ( execute_preprocess )
then 229 intercomm_parent_null, &
230 intercomm_child_null, &
234 if ( execute_model )
then 244 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_init
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