47 logical :: execute_preprocess = .true.
48 logical :: execute_model = .false.
49 integer :: num_bulkjob = 1
50 integer :: num_domain = 1
53 logical :: abort_all_jobs = .false.
54 logical :: log_split = .false.
55 logical :: color_reorder = .true.
57 namelist / param_launcher / &
68 integer :: universal_comm
69 integer :: universal_nprocs
70 logical :: universal_master
71 character(len=H_LONG) :: universal_cnf_fname
73 integer :: global_comm
74 integer :: global_nprocs
77 integer :: intercomm_parent_null
78 integer :: intercomm_child_null
79 character(len=H_LONG) :: bulk_prefix
82 integer :: intercomm_parent
83 integer :: intercomm_child
84 character(len=H_LONG) :: local_cnf_fname
96 if( universal_master )
write(*,*)
'*** Start Launch System for SCALE-RM' 106 conf_files(1) = universal_cnf_fname
110 read(fid,nml=param_launcher,iostat=ierr)
113 elseif( ierr > 0 )
then 114 if( universal_master )
write(*,*)
'xxx Not appropriate names in namelist PARAM_LAUNCHER. Check!' 120 if ( execute_preprocess &
121 .OR. execute_model )
then 122 if( universal_master )
write(*,*)
"*** Execute preprocess? : ", execute_preprocess
123 if( universal_master )
write(*,*)
"*** Execute model? : ", execute_model
125 if( universal_master )
write(*,*)
'xxx No execution. please check PARAM_LAUNCHER. STOP' 131 if ( mod(universal_nprocs,num_bulkjob) /= 0 )
then 132 if( universal_master )
write(*,*)
'xxx Total Num of Processes must be divisible by NUM_BULKJOB. Check!' 133 if( universal_master )
write(*,*)
'xxx Total Num of Processes = ', universal_nprocs
134 if( universal_master )
write(*,*)
'xxx NUM_BULKJOB = ', num_bulkjob
138 global_nprocs = universal_nprocs / num_bulkjob
139 prc_bulkjob(1:num_bulkjob) = global_nprocs
140 if ( num_bulkjob > 1 )
then 141 if( universal_master )
write(*,
'(1x,A,I5)')
"*** TOTAL BULK JOB NUMBER = ", num_bulkjob
142 if( universal_master )
write(*,
'(1x,A,I5)')
"*** PROCESS NUM of EACH JOB = ", global_nprocs
154 intercomm_parent_null, &
155 intercomm_child_null, &
163 if ( num_domain > 1 )
then 164 if( universal_master )
write(*,
'(1x,A,I5)')
"*** TOTAL DOMAIN NUMBER = ", num_domain
165 if( universal_master )
write(*,
'(1x,A,L5)')
"*** Flag of ABORT ALL JOBS = ", abort_all_jobs
183 if ( num_bulkjob > 1 )
then 184 local_cnf_fname = trim(bulk_prefix)//
"/"//trim(local_cnf_fname)
187 if ( execute_preprocess )
then 189 intercomm_parent_null, &
190 intercomm_child_null, &
194 if ( execute_model )
then 204 if( universal_master )
write(*,*)
'*** End Launch System for SCALE-RM'
subroutine, public prc_mpistop
Abort MPI.
subroutine, public scalerm(comm_world, intercomm_parent, intercomm_child, cnf_fname)
Setup.
subroutine, public prc_universal_setup(comm, nprocs, ismaster)
setup MPI in universal communicator
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.
character(len=h_long) function, public io_arg_getfname(is_master)
get config filename from argument
module SCALE-RM (a main routine of regional model)
program scalerm_launcher
Program SCALE-RM (a launcher of main routine)
subroutine, public prc_global_setup(abortall, comm)
setup MPI in global communicator
subroutine, public scalerm_prep(comm_world, intercomm_parent, intercomm_child, cnf_fname)
Setup.
subroutine, public prc_mpistart(comm)
Start MPI.
integer, parameter, public prc_domain_nlim
max depth of domains
subroutine, public prc_mpifinish
Stop MPI peacefully.
integer function, public io_cnf_open(fname, is_master)
open config file