120 private :: nest_comm_parentsize
121 private :: nest_comm_catalogue
122 private :: nest_comm_ping
123 private :: nest_comm_setup_nestdown
124 private :: nest_comm_importgrid_nestdown
125 private :: nest_comm_intercomm_nestdown
126 private :: nest_comm_issuer_of_receive
127 private :: nest_comm_issuer_of_wait
130 interface nest_comm_intercomm_nestdown
132 end interface nest_comm_intercomm_nestdown
134 interface nest_comm_issuer_of_receive
136 end interface nest_comm_issuer_of_receive
138 interface nest_comm_issuer_of_wait
140 end interface nest_comm_issuer_of_wait
146 real(RP),
private,
allocatable :: latlon_catalog(:,:,:)
147 real(RP),
private :: corner_loc(4,2)
149 integer,
private :: parent_prc_num_x(2)
150 integer,
private :: parent_prc_num_y(2)
151 integer,
private :: parent_prc_nprocs(2)
153 integer,
private :: daughter_prc_num_x(2)
154 integer,
private :: daughter_prc_num_y(2)
155 integer,
private :: daughter_prc_nprocs(2)
157 integer,
private :: nest_tile_all
158 integer,
private :: nest_tile_allmax_p
159 integer,
private :: nest_tile_allmax_d
160 integer,
private,
allocatable :: nest_tile_list_p(:,:)
161 integer,
private,
allocatable :: nest_tile_list_d(:,:)
162 integer,
private,
allocatable :: nest_tile_list_yp(:)
163 integer,
private :: num_yp
165 character(len=H_LONG) :: offline_parent_basename
166 integer,
private :: offline_parent_prc_num_x
167 integer,
private :: offline_parent_prc_num_y
168 integer,
private :: offline_parent_kmax
169 integer,
private :: offline_parent_imax
170 integer,
private :: offline_parent_jmax
171 integer,
private :: offline_parent_lkmax
172 integer(8),
private :: online_wait_limit
173 logical,
private :: online_daughter_use_velz
174 logical,
private :: online_daughter_no_rotate
175 logical,
private :: online_aggressive_comm
177 integer,
parameter :: i_lon = 1
178 integer,
parameter :: i_lat = 2
180 integer,
parameter :: i_nw = 1
181 integer,
parameter :: i_ne = 2
182 integer,
parameter :: i_sw = 3
183 integer,
parameter :: i_se = 4
184 integer,
parameter :: i_bndqa = 20
186 integer,
parameter :: i_sclr = 1
187 integer,
parameter :: i_zstg = 2
188 integer,
parameter :: i_xstg = 3
189 integer,
parameter :: i_ystg = 4
191 integer,
parameter :: itp_ng = 4
192 integer,
private :: itp_nh = 4
193 integer,
private :: itp_nv = 2
195 integer,
parameter :: tag_lon = 1
196 integer,
parameter :: tag_lat = 2
197 integer,
parameter :: tag_lonx = 3
198 integer,
parameter :: tag_latx = 4
199 integer,
parameter :: tag_lony = 5
200 integer,
parameter :: tag_laty = 6
201 integer,
parameter :: tag_cz = 7
202 integer,
parameter :: tag_fz = 8
204 integer,
parameter :: tag_dens = 1
205 integer,
parameter :: tag_momz = 2
206 integer,
parameter :: tag_momx = 3
207 integer,
parameter :: tag_momy = 4
208 integer,
parameter :: tag_rhot = 5
209 integer,
parameter :: tag_qx = 6
211 integer,
parameter :: order_tag_comm = 100000
212 integer,
parameter :: order_tag_var = 1000
219 integer,
private :: interp_search_divnum
221 integer,
private :: intercomm_id(2)
223 integer,
private,
parameter :: max_isu = 100
224 integer,
private,
parameter :: max_isuf = 20
225 integer,
private,
parameter :: max_bndqa = 12
226 integer,
private :: max_rq = 1000
227 integer,
private :: rq_ctl_p
228 integer,
private :: rq_ctl_d
229 integer,
private :: rq_tot_p
230 integer,
private :: rq_tot_d
231 integer,
private,
allocatable :: ireq_p(:)
232 integer,
private,
allocatable :: ireq_d(:)
233 integer,
private,
allocatable :: call_order(:)
235 real(RP),
private,
allocatable :: buffer_2d (:,:)
236 real(RP),
private,
allocatable :: buffer_3d (:,:,:)
237 real(RP),
private,
allocatable :: buffer_3df(:,:,:)
238 real(RP),
private,
allocatable :: recvbuf_3d (:,:,:,:)
239 real(RP),
private,
allocatable :: recvbuf_3df(:,:,:,:)
241 real(RP),
private,
allocatable :: buffer_ref_lon (:,:)
242 real(RP),
private,
allocatable :: buffer_ref_lonx(:,:)
243 real(RP),
private,
allocatable :: buffer_ref_lony(:,:)
244 real(RP),
private,
allocatable :: buffer_ref_lat (:,:)
245 real(RP),
private,
allocatable :: buffer_ref_latx(:,:)
246 real(RP),
private,
allocatable :: buffer_ref_laty(:,:)
247 real(RP),
private,
allocatable :: buffer_ref_cz (:,:,:)
248 real(RP),
private,
allocatable :: buffer_ref_fz (:,:,:)
251 real(RP),
private,
allocatable :: buffer_ref_3d (:,:,:)
252 real(RP),
private,
allocatable :: buffer_ref_3df(:,:,:)
253 real(RP),
private,
allocatable :: u_llp(:,:,:)
254 real(RP),
private,
allocatable :: v_llp(:,:,:)
256 real(RP),
private,
allocatable :: org_dens(:,:,:)
257 real(RP),
private,
allocatable :: org_momz(:,:,:)
258 real(RP),
private,
allocatable :: org_momx(:,:,:)
259 real(RP),
private,
allocatable :: org_momy(:,:,:)
260 real(RP),
private,
allocatable :: org_rhot(:,:,:)
261 real(RP),
private,
allocatable :: org_qtrc(:,:,:,:)
263 real(RP),
private,
allocatable :: hfact(:,:,:,:)
264 real(RP),
private,
allocatable :: vfact(:,:,:,:,:,:)
265 integer,
private,
allocatable :: kgrd (:,:,:,:,:,:)
266 integer,
private,
allocatable :: igrd (:,:,:,:)
267 integer,
private,
allocatable :: jgrd (:,:,:,:)
268 integer,
private,
allocatable :: ncopy(:,:,:,:)
270 integer(8),
private :: nwait_p, nwait_d, nrecv, nsend
315 integer,
intent(in),
optional :: inter_parent
316 integer,
intent(in),
optional :: inter_child
319 character(len=H_LONG) :: latlon_catalogue_fname =
'latlon_domain_catalogue.txt' 321 integer :: online_specified_maxrq = 0
325 integer,
allocatable :: errcodes(:)
327 character(len=2) :: dom_num
329 logical :: flag_parent = .false.
330 logical :: flag_child = .false.
335 namelist / param_nest / &
336 latlon_catalogue_fname, &
337 offline_parent_basename, &
338 offline_parent_prc_num_x, &
339 offline_parent_prc_num_y, &
347 online_aggressive_comm, &
349 online_specified_maxrq, &
356 if(
io_l )
write(
io_fid_log,*)
'++++++ Module[GRID_NEST] / Categ[ATMOS-RM GRID] / Origin[SCALElib]' 358 if( inter_parent /= mpi_comm_null ) flag_child = .true.
359 if( inter_child /= mpi_comm_null ) flag_parent = .true.
361 offline_parent_basename =
"" 370 online_wait_limit = 999999999
371 online_aggressive_comm = .true.
372 interp_search_divnum = 10
378 if(
io_l )
write(
io_fid_log,*)
'*** Not found namelist. Default used.' 379 elseif( ierr > 0 )
then 380 write(*,*)
'xxx Not appropriate names in namelist PARAM_NEST. Check!' 387 if ( offline_parent_basename /=
"" )
then 393 call filegetshape( dims, offline_parent_basename,
"CX", 0 )
394 offline_parent_imax = dims(1)-4
395 call filegetshape( dims, offline_parent_basename,
"CY", 0 )
396 offline_parent_jmax = dims(1)-4
397 call filegetshape( dims, offline_parent_basename,
"z", 0, error=error )
399 offline_parent_kmax = 0
401 offline_parent_kmax = dims(1)
403 call filegetshape( dims, offline_parent_basename,
"lz", 0, error=error )
405 offline_parent_lkmax = 0
407 offline_parent_lkmax = dims(1)
410 call comm_bcast( offline_parent_imax )
411 call comm_bcast( offline_parent_jmax )
412 call comm_bcast( offline_parent_kmax )
413 call comm_bcast( offline_parent_lkmax )
419 write(*,*)
'xxx OFFLINE and ONLINE cannot be use at the same time' 439 if( online_specified_maxrq > max_rq ) max_rq = online_specified_maxrq
440 allocate( ireq_p(max_rq) )
441 allocate( ireq_d(max_rq) )
442 allocate( call_order(max_rq) )
449 corner_loc(i_sw,i_lon) =
real_lonxy( 0, 0) / d2r
453 corner_loc(i_sw,i_lat) =
real_latxy( 0, 0) / d2r
456 allocate( ncopy(
ia,
ja,itp_nh,itp_ng) )
461 parent_prc_num_x(
handling_num) = offline_parent_prc_num_x
462 parent_prc_num_y(
handling_num) = offline_parent_prc_num_y
469 allocate( latlon_catalog(parent_prc_nprocs(
handling_num),4,2) )
474 file = trim(latlon_catalogue_fname), &
475 form =
'formatted', &
479 if ( ierr /= 0 )
then 480 write(*,*)
'xxx [grd_nest/NEST_setup] cannot open latlon-catalogue file!' 485 read(fid,
'(i8,8f32.24)',iostat=ierr) parent_id, &
486 latlon_catalog(i,i_nw,i_lon), latlon_catalog(i,i_ne,i_lon), &
487 latlon_catalog(i,i_sw,i_lon), latlon_catalog(i,i_se,i_lon), &
488 latlon_catalog(i,i_nw,i_lat), latlon_catalog(i,i_ne,i_lat), &
489 latlon_catalog(i,i_sw,i_lat), latlon_catalog(i,i_se,i_lat)
490 if ( i /= parent_id )
then 491 write(*,*)
'xxx [grd_nest/NEST_setup] internal error: parent mpi id' 494 if ( ierr /= 0 )
exit 513 else if (
i_qv > 0 )
then 519 if(
io_l )
write(
io_fid_log,*)
"flag_parent", flag_parent,
"flag_child", flag_child
522 if( flag_parent )
then 525 write(*,*)
'xxx [grd_nest/NEST_setup] Parent Flag from launcher is not consistent with namelist!' 535 if(
io_l )
write(
io_fid_log,
'(1x,A,I2,A)')
'*** Online Nesting - PARENT [INTERCOMM_ID:', &
559 u_llp(:,:,:) = 0.0_rp
560 v_llp(:,:,:) = 0.0_rp
563 if(
io_l )
write(
io_fid_log,
'(1x,A)' )
'*** Informations of Parent Domain [me]' 572 if(
io_l )
write(
io_fid_log,
'(1x,A)' )
'*** Informations of Daughter Domain' 581 if(
io_l )
write(
io_fid_log,
'(1x,A,I6) ')
'*** Limit Num. NCOMM req. :', max_rq
596 if( flag_child )
then 599 write(*,*)
'xxx [grd_nest/NEST_setup] Child Flag from launcher is not consistent with namelist!' 609 if(
io_l )
write(
io_fid_log,
'(1x,A,I2,A)')
'*** Online Nesting - DAUGHTER [INTERCOMM_ID:', &
617 allocate( latlon_catalog(parent_prc_nprocs(
handling_num),4,2) )
633 if(
io_l )
write(
io_fid_log,
'(1x,A)' )
'*** Informations of Parent Domain' 642 if(
io_l )
write(
io_fid_log,
'(1x,A)' )
'*** Informations of Daughter Domain [me]' 651 if(
io_l )
write(
io_fid_log,
'(1x,A)' )
'*** Informations of Target Tiles' 655 if(
io_l )
write(
io_fid_log,
'(1x,A,I6) ')
'*** Limit Num. NCOMM req. :', max_rq
688 vfact(:,:,:,:,:,i_sclr), &
689 kgrd(:,:,:,:,:,i_sclr), &
690 igrd(:,:,:,i_sclr), &
691 jgrd(:,:,:,i_sclr), &
692 ncopy(:,:,:,i_sclr), &
700 buffer_ref_cz(:,:,:), &
701 buffer_ref_lat(:,:), &
702 buffer_ref_lon(:,:), &
710 vfact(:,:,:,:,:,i_zstg), &
711 kgrd(:,:,:,:,:,i_zstg), &
712 igrd(:,:,:,i_zstg), &
713 jgrd(:,:,:,i_zstg), &
714 ncopy(:,:,:,i_zstg), &
722 buffer_ref_fz(:,:,:), &
723 buffer_ref_lat(:,:), &
724 buffer_ref_lon(:,:), &
732 vfact(:,:,:,:,:,i_xstg), &
733 kgrd(:,:,:,:,:,i_xstg), &
734 igrd(:,:,:,i_xstg), &
735 jgrd(:,:,:,i_xstg), &
736 ncopy(:,:,:,i_xstg), &
744 buffer_ref_cz(:,:,:), &
745 buffer_ref_latx(:,:), &
746 buffer_ref_lonx(:,:), &
753 vfact(:,:,:,:,:,i_ystg), &
754 kgrd(:,:,:,:,:,i_ystg), &
755 igrd(:,:,:,i_ystg), &
756 jgrd(:,:,:,i_ystg), &
757 ncopy(:,:,:,i_ystg), &
765 buffer_ref_cz(:,:,:), &
766 buffer_ref_laty(:,:), &
767 buffer_ref_lony(:,:), &
772 deallocate( buffer_2d )
773 deallocate( buffer_3d )
774 deallocate( buffer_3df )
803 integer,
intent(in) :: handle
805 logical :: hit = .false.
806 integer,
allocatable :: pd_tile_num(:,:)
808 real(RP) :: wid_lon, wid_lat
809 integer :: pd_sw_tile
810 integer :: pd_ne_tile
818 allocate( pd_tile_num(0:parent_prc_nprocs(handle)-1,2) )
821 do j = 1, parent_prc_num_y(handle)
822 do i = 1, parent_prc_num_x(handle)
831 do i = 1, parent_prc_nprocs(handle)
832 wid_lon = abs((latlon_catalog(i,i_sw,i_lon) - latlon_catalog(i,i_se,i_lon)) &
834 wid_lat = abs((latlon_catalog(i,i_sw,i_lat) - latlon_catalog(i,i_nw,i_lat)) &
837 if ( corner_loc(i_sw,i_lon) >= min(latlon_catalog(i,i_sw,i_lon),latlon_catalog(i,i_nw,i_lon))-wid_lon .AND. &
838 corner_loc(i_sw,i_lat) >= min(latlon_catalog(i,i_sw,i_lat),latlon_catalog(i,i_se,i_lat))-wid_lat .AND. &
839 corner_loc(i_sw,i_lon) <= max(latlon_catalog(i,i_ne,i_lon),latlon_catalog(i,i_se,i_lon))+wid_lon .AND. &
840 corner_loc(i_sw,i_lat) <= max(latlon_catalog(i,i_ne,i_lat),latlon_catalog(i,i_nw,i_lat))+wid_lat )
then 847 if ( .NOT. hit )
then 848 write(*,*)
'xxx [grd_nest/NEST_domain_relate] region of daughter domain is larger than that of parent: SW search' 850 if(
io_l )
write(
io_fid_log,
'(1x,A)')
'xxx region of daughter domain is larger than that of parent: SW search' 851 if(
io_l )
write(
io_fid_log,*)
' grid width: half width in lat:', wid_lat,
' half width in lon:', wid_lon
852 if(
io_l )
write(
io_fid_log,
'(1x,A,F12.6)')
' daughter local (me): LON=',corner_loc(i_sw,i_lon)
853 do i = 1, parent_prc_nprocs(handle)
854 if(
io_l )
write(
io_fid_log,
'(1x,A,F12.6,1x,F12.6)')
' parent local SW-NE: LON=', &
855 latlon_catalog(i,i_sw,i_lon) ,latlon_catalog(i,i_ne,i_lon)
857 if(
io_l )
write(
io_fid_log,
'(1x,A,F12.6)')
' daughter local (me): LAT=',corner_loc(i_sw,i_lat)
858 do i = 1, parent_prc_nprocs(handle)
859 if(
io_l )
write(
io_fid_log,
'(1x,A,F12.6,1x,F12.6)')
' parent local SW-NE: LAT=', &
860 latlon_catalog(i,i_sw,i_lat) ,latlon_catalog(i,i_ne,i_lat)
867 do i = parent_prc_nprocs(handle), 1, -1
868 wid_lon = abs((latlon_catalog(i,i_nw,i_lon) - latlon_catalog(i,i_ne,i_lon)) &
870 wid_lat = abs((latlon_catalog(i,i_se,i_lat) - latlon_catalog(i,i_ne,i_lat)) &
873 if ( corner_loc(i_ne,i_lon) >= min(latlon_catalog(i,i_sw,i_lon),latlon_catalog(i,i_nw,i_lon))-wid_lon .AND. &
874 corner_loc(i_ne,i_lat) >= min(latlon_catalog(i,i_sw,i_lat),latlon_catalog(i,i_se,i_lat))-wid_lat .AND. &
875 corner_loc(i_ne,i_lon) <= max(latlon_catalog(i,i_ne,i_lon),latlon_catalog(i,i_se,i_lon))+wid_lon .AND. &
876 corner_loc(i_ne,i_lat) <= max(latlon_catalog(i,i_ne,i_lat),latlon_catalog(i,i_nw,i_lat))+wid_lat )
then 883 if ( .NOT. hit )
then 884 write(*,*)
'xxx [grd_nest/NEST_domain_relate] region of daughter domain is larger than that of parent: NE search' 886 if(
io_l )
write(
io_fid_log,
'(1x,A)')
'xxx region of daughter domain is larger than that of parent: NE search' 887 if(
io_l )
write(
io_fid_log,*)
' grid width: half width in lat:', wid_lat,
' half width in lon:', wid_lon
888 if(
io_l )
write(
io_fid_log,
'(1x,A,F12.6)')
' daughter local (me): LON=',corner_loc(i_ne,i_lon)
889 do i = 1, parent_prc_nprocs(handle)
890 if(
io_l )
write(
io_fid_log,
'(1x,A,F12.6,1x,F12.6)')
' parent local SW-NE: LON=', &
891 latlon_catalog(i,i_sw,i_lon) ,latlon_catalog(i,i_ne,i_lon)
893 if(
io_l )
write(
io_fid_log,
'(1x,A,F12.6)')
' daughter local (me): LAT=',corner_loc(i_ne,i_lat)
894 do i = 1, parent_prc_nprocs(handle)
895 if(
io_l )
write(
io_fid_log,
'(1x,A,F12.6,1x,F12.6)')
' parent local SW-NE: LAT=', &
896 latlon_catalog(i,i_sw,i_lat) ,latlon_catalog(i,i_ne,i_lat)
901 nest_tile_num_x = pd_tile_num(pd_ne_tile,1) - pd_tile_num(pd_sw_tile,1) + 1
902 nest_tile_num_y = pd_tile_num(pd_ne_tile,2) - pd_tile_num(pd_sw_tile,2) + 1
906 if(
io_l )
write(
io_fid_log,
'(1x,A)')
'*** NEST: target process tile in parent domain' 910 nest_tile_id(k) = pd_sw_tile + (i-1) + parent_prc_num_x(handle)*(j-1)
932 integer,
intent(out) :: tilei, tilej
933 integer,
intent(out) :: cxs, cxe, cys, cye
934 integer,
intent(out) :: pxs, pxe, pys, pye
935 integer,
intent(in) :: iloc
939 integer :: xloc, yloc
940 integer :: xlocg, ylocg
949 yloc = int(
real(iloc-1) /
real(NEST_TILE_NUM_X) ) + 1
950 xlocg = mod( rank, offline_parent_prc_num_x ) + 1
951 ylocg = int(
real(rank) /
real(OFFLINE_PARENT_PRC_NUM_X) ) + 1
955 cxs = tilei * (xloc-1) + 1
957 cys = tilej * (yloc-1) + 1
964 if ( xlocg == 1 )
then 969 if ( xlocg == offline_parent_prc_num_x )
then 972 if ( ylocg == 1 )
then 977 if ( ylocg == offline_parent_prc_num_y )
then 986 subroutine nest_comm_parentsize( &
1003 integer,
intent(in) :: handle
1006 integer :: datapack(14)
1007 integer :: qa_otherside
1008 integer :: ireq1, ireq2, ierr1, ierr2, ileng
1009 integer :: istatus(mpi_status_size)
1017 tag = intercomm_id(handle) * 100
1041 call mpi_wait(ireq1, istatus, ierr1)
1042 call mpi_wait(ireq2, istatus, ierr2)
1045 parent_prc_nprocs(handle) = datapack( 1)
1046 parent_prc_num_x(handle) = datapack( 2)
1047 parent_prc_num_y(handle) = datapack( 3)
1051 prnt_ks(handle) = datapack( 7)
1052 prnt_ke(handle) = datapack( 8)
1053 prnt_is(handle) = datapack( 9)
1054 prnt_ie(handle) = datapack(10)
1055 prnt_js(handle) = datapack(11)
1056 prnt_je(handle) = datapack(12)
1064 call mpi_wait(ireq1, istatus, ierr1)
1065 call mpi_wait(ireq2, istatus, ierr2)
1067 call comm_bcast(datapack, ileng)
1068 call comm_bcast(buffer)
1070 daughter_prc_nprocs(handle) = datapack( 1)
1071 daughter_prc_num_x(handle) = datapack( 2)
1072 daughter_prc_num_y(handle) = datapack( 3)
1076 datr_ks(handle) = datapack( 7)
1077 datr_ke(handle) = datapack( 8)
1078 datr_is(handle) = datapack( 9)
1079 datr_ie(handle) = datapack(10)
1080 datr_js(handle) = datapack(11)
1081 datr_je(handle) = datapack(12)
1083 qa_otherside = datapack(14)
1092 call mpi_wait(ireq1, istatus, ierr1)
1093 call mpi_wait(ireq2, istatus, ierr2)
1095 call comm_bcast(datapack, ileng)
1096 call comm_bcast(buffer)
1098 parent_prc_nprocs(handle) = datapack( 1)
1099 parent_prc_num_x(handle) = datapack( 2)
1100 parent_prc_num_y(handle) = datapack( 3)
1104 prnt_ks(handle) = datapack( 7)
1105 prnt_ke(handle) = datapack( 8)
1106 prnt_is(handle) = datapack( 9)
1107 prnt_ie(handle) = datapack(10)
1108 prnt_js(handle) = datapack(11)
1109 prnt_je(handle) = datapack(12)
1111 qa_otherside = datapack(14)
1134 call mpi_wait(ireq1, istatus, ierr1)
1135 call mpi_wait(ireq2, istatus, ierr2)
1138 daughter_prc_nprocs(handle) = datapack( 1)
1139 daughter_prc_num_x(handle) = datapack( 2)
1140 daughter_prc_num_y(handle) = datapack( 3)
1144 datr_ks(handle) = datapack( 7)
1145 datr_ke(handle) = datapack( 8)
1146 datr_is(handle) = datapack( 9)
1147 datr_ie(handle) = datapack(10)
1148 datr_js(handle) = datapack(11)
1149 datr_je(handle) = datapack(12)
1153 write(*,*)
'xxx [grd_nest/NEST_COMM_parentsize] internal error' 1158 if(
io_l )
write(
io_fid_log,*)
'*** Number concentration of hydrometeor will be diagnosed' 1163 write(*,*)
'xxx [grd_nest/NEST_COMM_parentsize] NUMBER of QA are not matched!' 1164 write(*,*)
'xxx check a flag of ONLINE_BOUNDARY_USE_QHYD.' 1165 write(*,*)
'xxx Number of QA (remote,local) = ', qa_otherside,
nest_bnd_qa 1171 end subroutine nest_comm_parentsize
1175 subroutine nest_comm_catalogue( &
1189 integer,
intent(in) :: handle
1191 integer :: ireq, ierr, ileng
1192 integer :: istatus(mpi_status_size)
1200 tag = intercomm_id(handle) * 100
1206 call mpi_wait(ireq, istatus, ierr)
1210 ileng = parent_prc_nprocs(handle) * 4 * 2
1213 call mpi_wait(ireq, istatus, ierr)
1215 call comm_bcast( latlon_catalog, parent_prc_nprocs(handle), 4, 2 )
1217 write(*,*)
'xxx [grd_nest/NEST_COMM_catalogue] internal error' 1222 end subroutine nest_comm_catalogue
1226 subroutine nest_comm_ping( &
1236 integer,
intent(in) :: handle
1238 integer :: ping, pong
1239 integer :: ireq1, ireq2, ierr1, ierr2
1240 integer :: istatus(mpi_status_size)
1242 logical :: ping_error
1249 tag = intercomm_id(handle) * 100
1250 ping_error = .false.
1259 call mpi_wait(ireq1, istatus, ierr1)
1260 call mpi_wait(ireq2, istatus, ierr2)
1263 call comm_bcast(pong)
1265 if ( pong /= intercomm_id(handle)+1 ) ping_error = .true.
1274 call mpi_wait(ireq1, istatus, ierr1)
1275 call mpi_wait(ireq2, istatus, ierr2)
1278 call comm_bcast(pong)
1280 if ( pong /= intercomm_id(handle) ) ping_error = .true.
1283 write(*,*)
'xxx [grd_nest/NEST_COMM_ping] internal error' 1287 if ( ping_error )
then 1288 write(*,*)
'xxx [grd_nest/NEST_COMM_ping] ping destination error' 1293 end subroutine nest_comm_ping
1297 subroutine nest_comm_setup_nestdown( &
1308 integer,
intent(in) :: handle
1310 integer,
allocatable :: buffer_list(:)
1311 integer,
allocatable :: buffer_alllist(:)
1313 integer :: ireq, ierr, ileng
1314 integer :: istatus(mpi_status_size)
1315 integer :: tag, target_rank
1324 tag = intercomm_id(handle) * 100
1331 call mpi_wait(ireq, istatus, ierr)
1333 call comm_bcast(nest_tile_allmax_p)
1335 allocate( nest_tile_list_p(nest_tile_allmax_p,daughter_prc_nprocs(handle)) )
1336 allocate( nest_tile_list_yp(nest_tile_allmax_p*daughter_prc_nprocs(handle)) )
1338 ileng = nest_tile_allmax_p*daughter_prc_nprocs(handle)
1341 call mpi_wait(ireq, istatus, ierr)
1343 call comm_bcast(nest_tile_list_p, nest_tile_allmax_p, daughter_prc_nprocs(handle))
1345 nest_tile_list_yp(:) = -1
1348 do j = 1, daughter_prc_nprocs(handle)
1349 do i = 1, nest_tile_allmax_p
1350 if ( nest_tile_list_p(i,j) ==
prc_myrank )
then 1352 nest_tile_list_yp(k) = j - 1
1358 if(
io_l )
write(
io_fid_log,
'(A,I5,A,I5)')
"[P] Num YP =",num_yp,
" Num TILE(MAX) =",nest_tile_allmax_p
1362 call mpi_wait(ireq, istatus, ierr)
1364 call comm_bcast(online_daughter_use_velz)
1366 if(
io_l )
write(
io_fid_log,
'(1x,A,L2)')
'*** NEST: ONLINE_DAUGHTER_USE_VELZ =', online_daughter_use_velz
1370 call mpi_wait(ireq, istatus, ierr)
1372 call comm_bcast(online_daughter_no_rotate)
1375 write(*,*)
'xxx [grd_nest/NEST_COMM_setup_nestdown] Flag of NO_ROTATE is not consistent with the child domain' 1377 if(
io_l )
write(
io_fid_log,*)
'xxx ONLINE_DAUGHTER_NO_ROTATE =', online_daughter_no_rotate
1380 if(
io_l )
write(
io_fid_log,
'(1x,A,L2)')
'*** NEST: ONLINE_DAUGHTER_NO_ROTATE =', online_daughter_no_rotate
1382 call nest_comm_importgrid_nestdown( handle )
1385 target_rank = nest_tile_list_yp(i)
1386 call mpi_isend(i, 1, mpi_integer, target_rank, tag+5,
intercomm_daughter, ireq, ierr)
1387 call mpi_wait(ireq, istatus, ierr)
1396 call mpi_allreduce( nest_tile_all, &
1397 nest_tile_allmax_d, &
1403 if(
io_l )
write(
io_fid_log,
'(A,I5,A,I5)')
"[D] Num YP =",nest_tile_all,
" Num TILE(MAX) =",nest_tile_allmax_d
1407 call mpi_wait(ireq, istatus, ierr)
1410 allocate( buffer_list(nest_tile_allmax_d) )
1411 allocate( buffer_alllist(nest_tile_allmax_d*daughter_prc_nprocs(handle)) )
1412 allocate( nest_tile_list_d(nest_tile_allmax_d,daughter_prc_nprocs(handle)) )
1414 do i = 1, nest_tile_allmax_d
1415 if ( i <= nest_tile_all )
then 1422 ileng = nest_tile_allmax_d
1423 call mpi_allgather( buffer_list(:), &
1426 buffer_alllist(:), &
1432 do j = 1, daughter_prc_nprocs(handle)
1433 do i = 1, nest_tile_allmax_d
1434 nest_tile_list_d(i,j) = buffer_alllist(k)
1439 deallocate( buffer_list )
1440 deallocate( buffer_alllist )
1442 ileng = nest_tile_allmax_d*daughter_prc_nprocs(handle)
1445 call mpi_wait(ireq, istatus, ierr)
1450 call mpi_wait(ireq, istatus, ierr)
1455 call mpi_wait(ireq, istatus, ierr)
1457 call comm_bcast(online_daughter_no_rotate)
1459 call nest_comm_importgrid_nestdown( handle )
1461 do i = 1, nest_tile_all
1462 target_rank = nest_tile_list_d(i,
prc_myrank+1)
1463 call mpi_irecv( call_order(i), 1, mpi_integer, target_rank, tag+5,
intercomm_parent, ireq, ierr )
1464 call mpi_wait(ireq, istatus, ierr)
1470 write(*,*)
'xxx [grd_nest/NEST_COMM_setup_nestdown] internal error' 1474 if( num_yp * 16 > max_rq .OR. nest_tile_all * 16 > max_rq )
then 1475 write(*,*)
'xxx [grd_nest/NEST_COMM_setup_nestdown] internal error (overflow number of ireq)' 1476 write(*,*)
' NUM_YP x 16 = ', num_yp * 16
1477 write(*,*)
' NEST_TILE_ALL x 16 = ', nest_tile_all * 16
1478 write(*,*)
' max_rq = ', max_rq
1483 end subroutine nest_comm_setup_nestdown
1487 subroutine nest_comm_importgrid_nestdown( &
1505 integer,
intent(in) :: handle
1507 integer :: ierr, ileng
1508 integer :: istatus(mpi_status_size)
1509 integer :: tag, tagbase, target_rank
1511 integer :: xloc, yloc
1515 real(RP) :: max_ref, max_loc
1524 tagbase = intercomm_id(handle) * 100
1531 target_rank = nest_tile_list_yp(i)
1535 tag = tagbase + tag_lon
1537 call mpi_wait(ireq_p(rq), istatus, ierr)
1541 tag = tagbase + tag_lat
1543 call mpi_wait(ireq_p(rq), istatus, ierr)
1547 tag = tagbase + tag_lonx
1549 call mpi_wait(ireq_p(rq), istatus, ierr)
1553 tag = tagbase + tag_latx
1555 call mpi_wait(ireq_p(rq), istatus, ierr)
1559 tag = tagbase + tag_lony
1561 call mpi_wait(ireq_p(rq), istatus, ierr)
1565 tag = tagbase + tag_laty
1567 call mpi_wait(ireq_p(rq), istatus, ierr)
1571 tag = tagbase + tag_cz
1573 call mpi_wait(ireq_p(rq), istatus, ierr)
1577 tag = tagbase + tag_fz
1579 call mpi_wait(ireq_p(rq), istatus, ierr)
1585 do i = 1, nest_tile_all
1587 target_rank = nest_tile_list_d(i,
prc_myrank+1)
1590 yloc = int(
real(i-1) /
real(NEST_TILE_NUM_X) ) + 1
1599 tag = tagbase + tag_lon
1601 call mpi_wait(ireq_d(rq), istatus, ierr)
1606 tag = tagbase + tag_lat
1608 call mpi_wait(ireq_d(rq), istatus, ierr)
1613 tag = tagbase + tag_lonx
1615 call mpi_wait(ireq_d(rq), istatus, ierr)
1620 tag = tagbase + tag_latx
1622 call mpi_wait(ireq_d(rq), istatus, ierr)
1627 tag = tagbase + tag_lony
1629 call mpi_wait(ireq_d(rq), istatus, ierr)
1634 tag = tagbase + tag_laty
1636 call mpi_wait(ireq_d(rq), istatus, ierr)
1641 tag = tagbase + tag_cz
1643 call mpi_wait(ireq_d(rq), istatus, ierr)
1650 tag = tagbase + tag_fz
1652 call mpi_wait(ireq_d(rq), istatus, ierr)
1659 max_ref = maxval( buffer_ref_fz(:,:,:) )
1661 if ( max_ref < max_loc )
then 1662 write(*,*)
'xxx [grd_nest/NEST_COMM_importgrid_nestdown] REQUESTED DOMAIN IS TOO MUCH BROAD' 1663 write(*,*)
'xxx -- VERTICAL direction over the limit' 1664 write(*,*)
'xxx -- reference max: ', max_ref
1665 write(*,*)
'xxx -- local max: ', max_loc
1671 write(*,*)
'xxx [grd_nest/NEST_COMM_importgrid_nestdown] internal error' 1676 end subroutine nest_comm_importgrid_nestdown
1689 interped_ref_DENS, & ! [inout]
1690 interped_ref_VELZ, & ! [inout]
1691 interped_ref_VELX, & ! [inout]
1692 interped_ref_VELY, & ! [inout]
1693 interped_ref_POTT, & ! [inout]
1704 integer,
intent(in) :: handle
1705 integer,
intent(in) :: bnd_qa
1721 real(RP) :: dummy(1,1,1)
1731 real(RP) :: u_on_map, v_on_map
1733 integer :: tagbase, tagcomm
1734 integer :: isu_tag, isu_tagf
1735 integer :: i, j, k, iq
1737 integer,
parameter :: cosin = 1
1738 integer,
parameter :: sine = 2
1745 if ( bnd_qa > i_bndqa )
then 1746 write(*,*)
'xxx [grd_nest/NEST_COMM_nestdown] internal error: BND_QA is larger than I_BNDQA' 1749 if ( bnd_qa > max_bndqa )
then 1750 write(*,*)
'xxx [grd_nest/NEST_COMM_nestdown] internal error: BND_QA is larger than max_bndqa' 1754 tagcomm = intercomm_id(handle) * order_tag_comm
1761 if(
io_l )
write(
io_fid_log,
'(1X,A,I5,A)')
"*** NestIDC [P]: que send ( ", nsend,
" )" 1766 org_dens(:,:,:) = ipt_dens(:,:,:)
1767 org_momz(:,:,:) = ipt_momz(:,:,:)
1768 org_momx(:,:,:) = ipt_momx(:,:,:)
1769 org_momy(:,:,:) = ipt_momy(:,:,:)
1770 org_rhot(:,:,:) = ipt_rhot(:,:,:)
1772 org_qtrc(:,:,:,iq) = ipt_qtrc(:,:,:,iq)
1780 if ( .NOT. online_daughter_no_rotate )
then 1785 work1p(k,i,j) = ( org_momx(k,i-1,j) + org_momx(k,i,j) ) * 0.5_rp
1791 work1p(k,1,j) = org_momx(k,1,j)
1794 call comm_vars8( work1p(:,:,:), 1 )
1798 work2p(k,i,j) = ( org_momy(k,i,j-1) + org_momy(k,i,j) ) * 0.5_rp
1804 work2p(k,i,1) = org_momy(k,i,1)
1807 call comm_vars8( work2p(:,:,:), 2 )
1808 call comm_wait ( work1p(:,:,:), 1, .false. )
1809 call comm_wait ( work2p(:,:,:), 2, .false. )
1815 u_on_map = work1p(k,i,j) / org_dens(k,i,j)
1816 v_on_map = work2p(k,i,j) / org_dens(k,i,j)
1818 u_llp(k,i,j) = u_on_map * rotc(i,j,cosin) - v_on_map * rotc(i,j,sine )
1819 v_llp(k,i,j) = u_on_map * rotc(i,j,sine ) + v_on_map * rotc(i,j,cosin)
1825 tagbase = tagcomm + tag_dens*order_tag_var
1826 call nest_comm_intercomm_nestdown( org_dens, dummy, tagbase, i_sclr, handle, isu_tag, isu_tagf, .true. )
1828 tagbase = tagcomm + tag_momz*order_tag_var
1829 if ( online_daughter_use_velz )
then 1830 call nest_comm_intercomm_nestdown( org_momz, dummy, tagbase, i_zstg, handle, isu_tag, isu_tagf )
1833 tagbase = tagcomm + tag_momx*order_tag_var
1834 if ( online_daughter_no_rotate )
then 1835 call nest_comm_intercomm_nestdown( org_momx, dummy, tagbase, i_xstg, handle, isu_tag, isu_tagf )
1837 call nest_comm_intercomm_nestdown( u_llp, dummy, tagbase, i_sclr, handle, isu_tag, isu_tagf )
1840 tagbase = tagcomm + tag_momy*order_tag_var
1841 if ( online_daughter_no_rotate )
then 1842 call nest_comm_intercomm_nestdown( org_momy, dummy, tagbase, i_ystg, handle, isu_tag, isu_tagf )
1844 call nest_comm_intercomm_nestdown( v_llp, dummy, tagbase, i_sclr, handle, isu_tag, isu_tagf )
1847 tagbase = tagcomm + tag_rhot*order_tag_var
1848 call nest_comm_intercomm_nestdown( org_rhot, dummy, tagbase, i_sclr, handle, isu_tag, isu_tagf )
1851 tagbase = tagcomm + (tag_qx*10+iq)*order_tag_var
1852 call nest_comm_intercomm_nestdown( org_qtrc(:,:,:,iq), dummy, tagbase, i_sclr, handle, isu_tag, isu_tagf )
1865 nwait_d = nwait_d + 1
1877 if ( online_aggressive_comm )
then 1886 tagbase = tagcomm + tag_dens*order_tag_var
1887 call nest_comm_intercomm_nestdown( dummy, dens, tagbase, i_sclr, handle, isu_tag, isu_tagf, .true. )
1892 interped_ref_dens(k,i,j) = dens(k,i,j)
1897 call comm_vars8( interped_ref_dens, 1 )
1899 tagbase = tagcomm + tag_momz*order_tag_var
1901 call nest_comm_intercomm_nestdown( dummy, work1d, tagbase, i_zstg, handle, isu_tag, isu_tagf )
1906 interped_ref_velz(k,i,j) = work1d(k,i,j) / ( dens(k,i,j) + dens(k+1,i,j) ) * 2.0_rp
1912 tagbase = tagcomm + tag_momx*order_tag_var
1915 call nest_comm_intercomm_nestdown( dummy, u_lld, tagbase, i_xstg, handle, isu_tag, isu_tagf )
1918 call nest_comm_intercomm_nestdown( dummy, u_lld, tagbase, i_sclr, handle, isu_tag, isu_tagf )
1921 tagbase = tagcomm + tag_momy*order_tag_var
1924 call nest_comm_intercomm_nestdown( dummy, v_lld, tagbase, i_ystg, handle, isu_tag, isu_tagf )
1927 call nest_comm_intercomm_nestdown( dummy, v_lld, tagbase, i_sclr, handle, isu_tag, isu_tagf )
1930 call comm_wait ( interped_ref_dens, 1, .false. )
1936 interped_ref_velx(k,i,j) = u_lld(k,i,j) &
1937 / ( interped_ref_dens(k,i+1,j) + interped_ref_dens(k,i,j) ) * 2.0_rp
1947 call comm_vars8( interped_ref_velx, 2 )
1951 interped_ref_vely(k,i,j) = v_lld(k,i,j) &
1952 / ( interped_ref_dens(k,i,j+1) + interped_ref_dens(k,i,j) ) * 2.0_rp
1962 call comm_vars8( interped_ref_vely, 3 )
1963 call comm_wait ( interped_ref_velx, 2, .false. )
1964 call comm_wait ( interped_ref_vely, 3, .false. )
1970 work1d(k,i,j) = u_lld(k,i,j) * rotc(i,j,cosin) + v_lld(k,i,j) * rotc(i,j,sine )
1971 work2d(k,i,j) = - u_lld(k,i,j) * rotc(i,j,sine ) + v_lld(k,i,j) * rotc(i,j,cosin)
1980 interped_ref_velx(k,i,j) = ( work1d(k,i+1,j) + work1d(k,i,j) ) * 0.5_rp
1989 call comm_vars8( interped_ref_velx, 2 )
1993 interped_ref_vely(k,i,j) = ( work2d(k,i,j+1) + work2d(k,i,j) ) * 0.5_rp
2002 call comm_vars8( interped_ref_vely, 3 )
2003 call comm_wait ( interped_ref_velx, 2, .false. )
2004 call comm_wait ( interped_ref_vely, 3, .false. )
2007 tagbase = tagcomm + tag_rhot*order_tag_var
2008 call nest_comm_intercomm_nestdown( dummy, work1d, tagbase, i_sclr, handle, isu_tag, isu_tagf )
2012 interped_ref_pott(k,i,j) = work1d(k,i,j) / interped_ref_dens(k,i,j)
2018 tagbase = tagcomm + (tag_qx*10+iq)*order_tag_var
2019 call nest_comm_intercomm_nestdown( dummy, work1d, tagbase, i_sclr, handle, isu_tag, isu_tagf )
2023 interped_ref_qtrc(k,i,j,iq) = work1d(k,i,j)
2033 write(*,*)
'xxx [grd_nest/NEST_COMM_nestdown] internal error' 2049 integer,
intent(in) :: handle
2050 integer,
intent(in) :: bnd_qa
2052 integer :: isu_tag, isu_tagf
2053 integer :: tagbase, tagcomm
2062 if ( bnd_qa > i_bndqa )
then 2063 write(*,*)
'xxx [grd_nest/NEST_COMM_recvwait_issue] internal error: about BND_QA' 2067 tagcomm = intercomm_id(handle) * order_tag_comm
2072 nwait_p = nwait_p + 1
2076 call nest_comm_issuer_of_wait( handle )
2078 if ( online_aggressive_comm )
then 2091 if(
io_l )
write(
io_fid_log,
'(1X,A,I5,A)')
"*** NestIDC [C]: que recv ( ", nrecv,
" )" 2100 tagbase = tagcomm + tag_dens*order_tag_var
2101 call nest_comm_issuer_of_receive( tagbase, i_sclr, handle, isu_tag, isu_tagf, .true. )
2103 tagbase = tagcomm + tag_momz*order_tag_var
2105 call nest_comm_issuer_of_receive( tagbase, i_zstg, handle, isu_tag, isu_tagf )
2108 tagbase = tagcomm + tag_momx*order_tag_var
2110 call nest_comm_issuer_of_receive( tagbase, i_xstg, handle, isu_tag, isu_tagf )
2112 call nest_comm_issuer_of_receive( tagbase, i_sclr, handle, isu_tag, isu_tagf )
2115 tagbase = tagcomm + tag_momy*order_tag_var
2117 call nest_comm_issuer_of_receive( tagbase, i_ystg, handle, isu_tag, isu_tagf )
2119 call nest_comm_issuer_of_receive( tagbase, i_sclr, handle, isu_tag, isu_tagf )
2122 tagbase = tagcomm + tag_rhot*order_tag_var
2123 call nest_comm_issuer_of_receive( tagbase, i_sclr, handle, isu_tag, isu_tagf )
2126 tagbase = tagcomm + (tag_qx*10+iq)*order_tag_var
2127 call nest_comm_issuer_of_receive( tagbase, i_sclr, handle, isu_tag, isu_tagf )
2134 write(*,*)
'xxx [grd_nest/NEST_COMM_recvwait_issue] internal error' 2149 integer,
intent(in) :: handle
2168 if(
io_l )
write(
io_fid_log,
'(1X,A,I5,A)')
"*** NestIDC [C]: CANCEL recv ( ", nrecv,
" )" 2170 if ( ireq_d(rq) /= mpi_request_null )
then 2171 call mpi_cancel(ireq_d(rq), ierr)
2180 write(*,*)
'xxx [grd_nest/NEST_COMM_recv_cancel] internal error' 2195 isu_tag, & ! [inout]
2196 isu_tagf, & ! [inout]
2206 real(RP),
intent(in) :: pvar(:,:,:)
2207 real(RP),
intent(out) :: dvar(:,:,:)
2208 integer ,
intent(in) :: tagbase
2209 integer ,
intent(in) :: id_stag
2210 integer ,
intent(in) :: HANDLE
2211 integer ,
intent(inout) :: isu_tag
2212 integer ,
intent(inout) :: isu_tagf
2214 logical ,
intent(in),
optional :: flag_dens
2216 integer :: ierr, ileng
2217 integer :: tag, target_rank
2219 integer :: xloc, yloc
2224 integer :: ig, rq, yp
2225 logical :: no_zstag = .true.
2226 logical :: logarithmic = .false.
2233 logarithmic = .false.
2234 if (
present(flag_dens) )
then 2235 if ( flag_dens )
then 2236 logarithmic = .true.
2240 if ( id_stag == i_sclr )
then 2243 elseif ( id_stag == i_zstg )
then 2246 elseif ( id_stag == i_xstg )
then 2249 elseif ( id_stag == i_ystg )
then 2254 if ( no_zstag )
then 2269 target_rank = nest_tile_list_yp(yp)
2273 dvar(:,:,:) = -1.0_rp
2283 do yp = 1, nest_tile_all
2287 yloc = int(
real(yp-1) /
real(NEST_TILE_NUM_X) ) + 1
2294 if ( no_zstag )
then 2295 isu_tag = isu_tag + 1
2297 if ( .NOT. logarithmic )
then 2301 buffer_ref_3d(k,xs:xe,ys:ye) &
2308 buffer_ref_3d(k,xs:xe,ys:ye) &
2313 isu_tagf = isu_tagf + 1
2316 buffer_ref_3df(k,xs:xe,ys:ye) &
2321 if ( isu_tag > max_isu .OR. isu_tagf > max_isuf )
then 2322 write(*,*)
'xxx [grd_nest/NEST_COMM_intercomm_nestdown_3D] Exceeded maximum issue' 2323 write(*,*)
'xxx isu_tag = ', isu_tag
2324 write(*,*)
'xxx isu_tagf = ', isu_tagf
2332 dvar(:,:,:) = 0.0_rp
2334 if ( no_zstag )
then 2338 vfact(:,:,:,:,:,ig), &
2339 kgrd(:,:,:,:,:,ig), &
2352 vfact(:,:,:,:,:,ig), &
2353 kgrd(:,:,:,:,:,ig), &
2364 write(*,*)
'xxx [grd_nest/NEST_COMM_intercomm_nestdown_3D] internal error' 2377 isu_tag, & ! [inout]
2378 isu_tagf, & ! [inout]
2387 integer ,
intent(in) :: tagbase
2388 integer ,
intent(in) :: id_stag
2389 integer ,
intent(in) :: HANDLE
2390 integer ,
intent(inout) :: isu_tag
2391 integer ,
intent(inout) :: isu_tagf
2392 logical ,
intent(in),
optional :: flag_dens
2394 integer :: ierr, ileng
2395 integer :: tag, target_rank
2397 integer :: ig, rq, yp
2398 logical :: no_zstag = .true.
2399 logical :: logarithmic = .false.
2406 logarithmic = .false.
2407 if (
present(flag_dens) )
then 2408 if ( flag_dens )
then 2409 logarithmic = .true.
2413 if ( id_stag == i_sclr )
then 2416 elseif ( id_stag == i_zstg )
then 2419 elseif ( id_stag == i_xstg )
then 2422 elseif ( id_stag == i_ystg )
then 2427 if ( no_zstag )
then 2443 do yp = 1, nest_tile_all
2446 target_rank = nest_tile_list_d(yp,
prc_myrank+1)
2448 tag = tagbase + call_order(yp)
2449 if ( no_zstag )
then 2450 isu_tag = isu_tag + 1
2451 recvbuf_3d(:,:,:,isu_tag) = 0.0_rp
2452 call mpi_irecv( recvbuf_3d(:,:,:,isu_tag), &
2461 isu_tagf = isu_tagf + 1
2462 recvbuf_3df(:,:,:,isu_tagf) = 0.0_rp
2463 call mpi_irecv( recvbuf_3df(:,:,:,isu_tagf), &
2475 if ( isu_tag > max_isu .OR. isu_tagf > max_isuf )
then 2476 write(*,*)
'xxx [grd_nest/NEST_COMM_issuer_of_receive_3D] Exceeded maximum issue' 2477 write(*,*)
'xxx isu_tag = ', isu_tag
2478 write(*,*)
'xxx isu_tagf = ', isu_tagf
2486 write(*,*)
'xxx [grd_nest/NEST_COMM_issuer_of_receive_3D] internal error' 2501 integer,
intent(in) :: HANDLE
2518 write(*,*)
'xxx [grd_nest/NEST_COMM_issuer_of_wait_3D] internal error' 2534 integer,
intent(in) :: req_count
2535 integer,
intent(inout) :: ireq(max_rq)
2539 integer :: istatus(MPI_STATUS_SIZE,req_count)
2540 integer :: req_count2
2541 integer :: ireq2(max_rq)
2555 if (ireq(i) /= mpi_request_null)
then 2556 req_count2 = req_count2 + 1
2557 ireq2(req_count2) = ireq(i)
2560 if ( req_count2 /= 0 )
call mpi_waitall( req_count2, ireq2, istatus, ierr )
2584 integer,
intent(in) :: handle
2586 integer :: istatus(mpi_status_size)
2598 if ( rq_ctl_p > 0 )
call mpi_test(ireq_p(1), flag, istatus, ierr)
2604 if ( rq_ctl_d > 0 )
call mpi_test(ireq_d(1), flag, istatus, ierr)
2608 write(*,*)
'xxx [grd_nest/NEST_COMM_test] error' 2629 if(
io_l )
write(
io_fid_log,
'(1x,A)')
'*** Waiting finish of whole processes' 2636 if(
io_l )
write(
io_fid_log,
'(1x,A)')
'*** Disconnected communication with child' 2643 if(
io_l )
write(
io_fid_log,
'(1x,A)')
'*** Disconnected communication with parent' integer, public imax
of computational cells: x, local
subroutine, public nest_setup(inter_parent, inter_child)
Setup.
integer, public prc_num_x
x length of 2D processor topology
integer, public is
start point of inner domain: x, local
integer, dimension(2), public parent_ka
parent max number in z-direction (with halo)
integer, dimension(2), public daughter_ka
daughter max number in z-direction (with halo)
integer, dimension(2), public prnt_ie
end index in x-direction in parent
integer, public comm_datatype
datatype of variable
real(dp), dimension(2), public parent_dtsec
parent DT [sec]
integer, public je
end point of inner domain: y, local
logical, public prc_ismaster
master process in local communicator?
logical, public prc_has_n
integer, dimension(2), public daughter_jmax
daughter max number in y-direction
subroutine, public prc_mpistop
Abort MPI.
subroutine nest_comm_issuer_of_wait_3d(HANDLE)
[substance of issuer] Inter-communication from parent to daughter: nestdown
integer, dimension(2), public parent_jmax
parent max number in y-direction
module GRID (nesting system)
subroutine nest_comm_waitall(req_count, ireq)
[substance of comm_wait] Inter-communication
integer, public time_nstep
total steps [number]
logical, public io_l
output log or not? (this process)
integer, public handling_num
handing number of nesting relation
logical, public online_iam_daughter
a flag to say "I am a daughter"
integer, public intercomm_parent
module ATMOSPHERE / Physics Cloud Microphysics
integer, dimension(2), public prnt_js
start index in y-direction in parent
integer, dimension(2), public prnt_ke
end index in z-direction in parent
integer, public nest_interp_weight_order
horizontal interpolation weight order
logical, public online_boundary_use_qhyd
real(rp), public const_radius
radius of the planet [m]
logical, public prc_has_e
logical, public online_no_rotate
integer, dimension(2), public parent_nstep
parent step [number]
integer, public ke
end point of inner domain: z, local
integer, dimension(2), public daughter_lkmax
daughter max number in lz-direction
real(rp), dimension(:,:,:), allocatable, public real_fz
geopotential height [m] (cell face )
real(rp), dimension(:,:,:), allocatable, public real_cz
geopotential height [m] (cell center)
integer, dimension(2), public prnt_je
end index in y-direction in parent
integer, dimension(2), public datr_ke
end index in z-direction in daughter
real(rp), public const_d2r
degree to radian
integer, public nest_bnd_qa
number of tracer treated in nesting system
procedure(intrpnest_intfc_interp_2d), pointer, public intrpnest_interp_2d
integer, dimension(:), allocatable, public nest_tile_id
parent tile real id
integer, public nest_interp_level
horizontal interpolation level
subroutine, public nest_comm_nestdown(HANDLE, BND_QA, ipt_DENS, ipt_MOMZ, ipt_MOMX, ipt_MOMY, ipt_RHOT, ipt_QTRC, interped_ref_DENS, interped_ref_VELZ, interped_ref_VELX, interped_ref_VELY, interped_ref_POTT, interped_ref_QTRC)
Boundary data transfer from parent to daughter: nestdown.
integer, dimension(2), public prnt_is
start index in x-direction in parent
logical, public prc_has_s
subroutine, public intrpnest_interp_fact_llz(hfact, vfact, kgrd, igrd, jgrd, ncopy, myhgt, mylat, mylon, myKS, myKE, myIA, myJA, inhgt, inlat, inlon, inKA, inIA, inJA, landgrid)
integer, dimension(2), public datr_je
end index in y-direction in daughter
integer, public prc_num_y
y length of 2D processor topology
integer, dimension(2), public daughter_imax
daughter max number in x-direction
logical, public io_nml
output log or not? (for namelist, this process)
subroutine, public nest_domain_shape(tilei, tilej, cxs, cxe, cys, cye, pxs, pxe, pys, pye, iloc)
Return shape of ParentDomain at the specified rank (for offline)
integer, public ia
of whole cells: x, local, with HALO
integer, dimension(2), public daughter_ia
daughter max number in x-direction (with halo)
real(rp), dimension(:,:), allocatable, public real_latx
latitude at staggered point (uy) [rad,-pi,pi]
integer function, public io_get_available_fid()
search & get available file ID
integer, dimension(2), public datr_ie
end index in x-direction in daughter
real(dp), public time_dtsec
time interval of model [sec]
integer, public comm_world
communication world ID
integer, dimension(2), public daughter_kmax
daughter max number in z-direction
integer, public kmax
of computational cells: z, local
subroutine nest_comm_intercomm_nestdown_3d(pvar, dvar, tagbase, id_stag, HANDLE, isu_tag, isu_tagf, flag_dens)
Inter-communication from parent to daughter: nestdown.
real(rp), dimension(:,:), allocatable, public real_lonxy
longitude at staggered point (uv) [rad,0-2pi]
integer, public jhalo
of halo cells: y
logical, public online_boundary_diagqnum
integer, public js
start point of inner domain: y, local
integer, public prc_global_comm_world
global communicator
integer, dimension(2), public datr_js
start index in y-direction in daughter
integer, dimension(2), public parent_ja
parent max number in y-direction (with halo)
real(dp), dimension(2), public daughter_dtsec
daughter DT [sec]
real(rp), dimension(:,:,:), allocatable, public gtrans_rotc
rotation coefficient
integer, dimension(2), public daughter_ja
daughter max number in y-direction (with halo)
integer, dimension(2), public parent_lkmax
parent max number in lz-direction
subroutine, public nest_comm_recv_cancel(HANDLE)
Sub-command for data transfer from parent to daughter: nestdown.
integer, dimension(10), public nest_filiation
index of parent-daughter relation (p>0, d<0)
procedure(intrpnest_intfc_interp_3d), pointer, public intrpnest_interp_3d
integer, public nest_tile_num_y
parent tile number in y-direction
integer, dimension(2), public parent_ia
parent max number in x-direction (with halo)
integer, public ks
start point of inner domain: z, local
logical, public use_nesting
integer, public prc_myrank
process num in local communicator
integer, parameter, public khalo
of halo cells: z
integer, dimension(2), public parent_kmax
parent max number in z-direction
subroutine, public nest_comm_recvwait_issue(HANDLE, BND_QA)
Sub-command for data transfer from parent to daughter: nestdown.
subroutine, public nest_domain_relate(HANDLE)
Solve relationship between ParentDomain & Daughter Domain.
real(rp), dimension(:,:,:), allocatable, public real_domain_catalogue
domain latlon catalogue [rad]
module INTERPOLATION (nesting system)
subroutine, public prof_rapstart(rapname_base, level)
Start raptime.
integer, dimension(2), public tileal_ka
cells of all tiles in z-direction
integer, dimension(2), public datr_ks
start index in z-direction in daughter
integer, public ie
end point of inner domain: x, local
integer, dimension(2), public parent_imax
parent max number in x-direction
subroutine nest_comm_issuer_of_receive_3d(tagbase, id_stag, HANDLE, isu_tag, isu_tagf, flag_dens)
[substance of issuer] Inter-communication from parent to daughter: nestdown
integer, public intercomm_daughter
real(rp), dimension(:,:), allocatable, public real_lon
longitude [rad,0-2pi]
integer, dimension(2), public datr_is
start index in x-direction in daughter
logical, public online_iam_parent
a flag to say "I am a parent"
integer, public nest_tile_num_x
parent tile number in x-direction
logical, public online_use_velz
integer, dimension(2), public prnt_ks
start index in z-direction in parent
integer, dimension(2), public tileal_ia
cells of all tiles in x-direction
integer, public io_fid_conf
Config file ID.
integer, public prc_global_domainid
my domain ID in global communicator
real(rp), dimension(:,:), allocatable, public real_lat
latitude [rad,-pi,pi]
real(rp), dimension(:,:), allocatable, public real_lony
longitude at staggered point (xv) [rad,0-2pi]
integer, public debug_domain_num
integer, public io_fid_log
Log file ID.
integer, dimension(2), public daughter_nstep
daughter steps [number]
subroutine, public prof_rapend(rapname_base, level)
Save raptime.
logical, public prc_has_w
integer, parameter, public rp
integer, public prc_nprocs
myrank in local communicator
real(rp), dimension(:,:), allocatable, public real_latxy
latitude at staggered point (uv) [rad,-pi,pi]
real(rp), dimension(:,:), allocatable, public real_lonx
longitude at staggered point (uy) [rad,0-2pi]
integer, dimension(2), public tileal_ja
cells of all tiles in y-direction
integer, public jmax
of computational cells: y, local
integer, public io_fid_nml
Log file ID (only for output namelist)
subroutine, public nest_comm_disconnect()
[finalize: disconnect] Inter-communication
integer, public ihalo
of halo cells: x
integer, public online_domain_num
subroutine, public nest_comm_test(HANDLE)
[check communication status] Inter-communication
real(rp), dimension(:,:), allocatable, public real_laty
latitude at staggered point (xv) [rad,-pi,pi]
integer, public ja
of whole cells: y, local, with HALO
subroutine, public intrpnest_setup(interp_search_divnum, NEST_INTERP_LEVEL, NEST_INTERP_WEIGHT_ORDER, OFFLINE)
Setup.