118 private :: nest_comm_parentsize
119 private :: nest_comm_catalogue
120 private :: nest_comm_ping
121 private :: nest_comm_setup_nestdown
122 private :: nest_comm_importgrid_nestdown
123 private :: nest_comm_intercomm_nestdown
124 private :: nest_comm_issuer_of_receive
125 private :: nest_comm_issuer_of_wait
128 interface nest_comm_intercomm_nestdown
130 end interface nest_comm_intercomm_nestdown
132 interface nest_comm_issuer_of_receive
134 end interface nest_comm_issuer_of_receive
136 interface nest_comm_issuer_of_wait
138 end interface nest_comm_issuer_of_wait
144 real(RP),
private,
allocatable :: latlon_catalog(:,:,:)
145 real(RP),
private :: corner_loc(4,2)
147 integer,
private :: parent_prc_num_x(2)
148 integer,
private :: parent_prc_num_y(2)
149 integer,
private :: parent_prc_nprocs(2)
151 integer,
private :: daughter_prc_num_x(2)
152 integer,
private :: daughter_prc_num_y(2)
153 integer,
private :: daughter_prc_nprocs(2)
155 integer,
private :: nest_tile_all
156 integer,
private :: nest_tile_allmax_p
157 integer,
private :: nest_tile_allmax_d
158 integer,
private,
allocatable :: nest_tile_list_p(:,:)
159 integer,
private,
allocatable :: nest_tile_list_d(:,:)
160 integer,
private,
allocatable :: nest_tile_list_yp(:)
161 integer,
private :: num_yp
163 integer,
private :: offline_parent_prc_num_x
164 integer,
private :: offline_parent_prc_num_y
165 integer,
private :: offline_parent_kmax
166 integer,
private :: offline_parent_imax
167 integer,
private :: offline_parent_jmax
168 integer,
private :: offline_parent_lkmax
169 integer(8),
private :: online_wait_limit
170 logical,
private :: online_daughter_use_velz
171 logical,
private :: online_daughter_no_rotate
172 logical,
private :: online_aggressive_comm
174 integer,
parameter :: i_lon = 1
175 integer,
parameter :: i_lat = 2
177 integer,
parameter :: i_nw = 1
178 integer,
parameter :: i_ne = 2
179 integer,
parameter :: i_sw = 3
180 integer,
parameter :: i_se = 4
181 integer,
parameter :: i_bndqa = 20
183 integer,
parameter :: i_sclr = 1
184 integer,
parameter :: i_zstg = 2
185 integer,
parameter :: i_xstg = 3
186 integer,
parameter :: i_ystg = 4
188 integer,
parameter :: itp_ng = 4
189 integer,
private :: itp_nh = 4
190 integer,
private :: itp_nv = 2
192 integer,
parameter :: tag_lon = 1
193 integer,
parameter :: tag_lat = 2
194 integer,
parameter :: tag_lonx = 3
195 integer,
parameter :: tag_latx = 4
196 integer,
parameter :: tag_lony = 5
197 integer,
parameter :: tag_laty = 6
198 integer,
parameter :: tag_cz = 7
199 integer,
parameter :: tag_fz = 8
201 integer,
parameter :: tag_dens = 1
202 integer,
parameter :: tag_momz = 2
203 integer,
parameter :: tag_momx = 3
204 integer,
parameter :: tag_momy = 4
205 integer,
parameter :: tag_rhot = 5
206 integer,
parameter :: tag_qx = 6
208 integer,
parameter :: order_tag_comm = 100000
209 integer,
parameter :: order_tag_var = 1000
216 integer,
private :: interp_search_divnum
218 integer,
private :: intercomm_id(2)
220 integer,
private,
parameter :: max_isu = 100
221 integer,
private,
parameter :: max_isuf = 20
222 integer,
private,
parameter :: max_bndqa = 12
223 integer,
private :: max_rq = 1000
224 integer,
private :: rq_ctl_p
225 integer,
private :: rq_ctl_d
226 integer,
private :: rq_tot_p
227 integer,
private :: rq_tot_d
228 integer,
private,
allocatable :: ireq_p(:)
229 integer,
private,
allocatable :: ireq_d(:)
230 integer,
private,
allocatable :: call_order(:)
232 real(RP),
private,
allocatable :: buffer_2d (:,:)
233 real(RP),
private,
allocatable :: buffer_3d (:,:,:)
234 real(RP),
private,
allocatable :: buffer_3df(:,:,:)
235 real(RP),
private,
allocatable :: recvbuf_3d (:,:,:,:)
236 real(RP),
private,
allocatable :: recvbuf_3df(:,:,:,:)
238 real(RP),
private,
allocatable :: buffer_ref_lon (:,:)
239 real(RP),
private,
allocatable :: buffer_ref_lonx(:,:)
240 real(RP),
private,
allocatable :: buffer_ref_lony(:,:)
241 real(RP),
private,
allocatable :: buffer_ref_lat (:,:)
242 real(RP),
private,
allocatable :: buffer_ref_latx(:,:)
243 real(RP),
private,
allocatable :: buffer_ref_laty(:,:)
244 real(RP),
private,
allocatable :: buffer_ref_cz (:,:,:)
245 real(RP),
private,
allocatable :: buffer_ref_fz (:,:,:)
248 real(RP),
private,
allocatable :: buffer_ref_3d (:,:,:)
249 real(RP),
private,
allocatable :: buffer_ref_3df(:,:,:)
250 real(RP),
private,
allocatable :: u_llp(:,:,:)
251 real(RP),
private,
allocatable :: v_llp(:,:,:)
253 real(RP),
private,
allocatable :: org_dens(:,:,:)
254 real(RP),
private,
allocatable :: org_momz(:,:,:)
255 real(RP),
private,
allocatable :: org_momx(:,:,:)
256 real(RP),
private,
allocatable :: org_momy(:,:,:)
257 real(RP),
private,
allocatable :: org_rhot(:,:,:)
258 real(RP),
private,
allocatable :: org_qtrc(:,:,:,:)
260 real(RP),
private,
allocatable :: hfact(:,:,:,:)
261 real(RP),
private,
allocatable :: vfact(:,:,:,:,:,:)
262 integer,
private,
allocatable :: kgrd (:,:,:,:,:,:)
263 integer,
private,
allocatable :: igrd (:,:,:,:)
264 integer,
private,
allocatable :: jgrd (:,:,:,:)
265 integer,
private,
allocatable :: ncopy(:,:,:,:)
267 integer(8),
private :: nwait_p, nwait_d, nrecv, nsend
308 integer,
intent(in),
optional :: inter_parent
309 integer,
intent(in),
optional :: inter_child
312 character(len=H_LONG) :: LATLON_CATALOGUE_FNAME =
'latlon_domain_catalogue.txt' 314 integer :: ONLINE_SPECIFIED_MAXRQ = 0
318 integer,
allocatable :: errcodes(:)
323 character(2) :: dom_num
325 logical :: flag_parent = .false.
326 logical :: flag_child = .false.
328 namelist / param_nest / &
330 latlon_catalogue_fname, &
331 offline_parent_prc_num_x, &
332 offline_parent_prc_num_y, &
333 offline_parent_kmax, &
334 offline_parent_imax, &
335 offline_parent_jmax, &
336 offline_parent_lkmax, &
344 online_aggressive_comm, &
346 online_specified_maxrq, &
354 if( inter_parent /= mpi_comm_null ) flag_child = .true.
355 if( inter_child /= mpi_comm_null ) flag_parent = .true.
364 online_wait_limit = 999999999
365 online_aggressive_comm = .true.
366 interp_search_divnum = 10
372 if(
io_l )
write(
io_fid_log,*)
'*** Not found namelist. Default used.' 373 elseif( ierr > 0 )
then 374 write(*,*)
'xxx Not appropriate names in namelist PARAM_NEST. Check!' 386 if( online_specified_maxrq > max_rq ) max_rq = online_specified_maxrq
387 allocate( ireq_p(max_rq) )
388 allocate( ireq_d(max_rq) )
389 allocate( call_order(max_rq) )
402 corner_loc(i_nw,i_lon) =
real_lonxy(ims,jme) / d2r
403 corner_loc(i_ne,i_lon) =
real_lonxy(ime,jme) / d2r
404 corner_loc(i_sw,i_lon) =
real_lonxy(ims,jms) / d2r
405 corner_loc(i_se,i_lon) =
real_lonxy(ime,jms) / d2r
406 corner_loc(i_nw,i_lat) =
real_latxy(ims,jme) / d2r
407 corner_loc(i_ne,i_lat) =
real_latxy(ime,jme) / d2r
408 corner_loc(i_sw,i_lat) =
real_latxy(ims,jms) / d2r
409 corner_loc(i_se,i_lat) =
real_latxy(ime,jms) / d2r
411 allocate( ncopy(
ia,
ja,itp_nh,itp_ng) )
416 parent_prc_num_x(
handling_num) = offline_parent_prc_num_x
417 parent_prc_num_y(
handling_num) = offline_parent_prc_num_y
424 allocate( latlon_catalog(parent_prc_nprocs(
handling_num),4,2) )
429 file = trim(latlon_catalogue_fname), &
430 form =
'formatted', &
434 if ( ierr /= 0 )
then 435 write(*,*)
'xxx cannot open latlon-catalogue file!' 440 read(fid,
'(i8,8f32.24)',iostat=ierr) parent_id, &
441 latlon_catalog(i,i_nw,i_lon), latlon_catalog(i,i_ne,i_lon), &
442 latlon_catalog(i,i_sw,i_lon), latlon_catalog(i,i_se,i_lon), &
443 latlon_catalog(i,i_nw,i_lat), latlon_catalog(i,i_ne,i_lat), &
444 latlon_catalog(i,i_sw,i_lat), latlon_catalog(i,i_se,i_lat)
445 if ( i /= parent_id )
then 446 if(
io_l )
write(*,*)
'xxx internal error: parent mpi id' 449 if ( ierr /= 0 )
exit 472 if(
io_l )
write(
io_fid_log,*)
"flag_parent", flag_parent,
"flag_child", flag_child
475 if( flag_parent )
then 478 write(*,*)
'xxx Parent Flag from launcher is not consistent with namelist! [NEST/GRID]' 488 if(
io_l )
write(
io_fid_log,
'(1x,A,I2,A)')
'*** Online Nesting - PARENT [INTERCOMM_ID:', &
512 u_llp(:,:,:) = 0.0_rp
513 v_llp(:,:,:) = 0.0_rp
516 if(
io_l )
write(
io_fid_log,
'(1x,A)' )
'*** Informations of Parent Domain [me]' 525 if(
io_l )
write(
io_fid_log,
'(1x,A)' )
'*** Informations of Daughter Domain' 534 if(
io_l )
write(
io_fid_log,
'(1x,A,I6) ')
'*** Limit Num. NCOMM req. :', max_rq
549 if( flag_child )
then 552 write(*,*)
'xxx Child Flag from launcher is not consistent with namelist! [NEST/GRID]' 562 if(
io_l )
write(
io_fid_log,
'(1x,A,I2,A)')
'*** Online Nesting - DAUGHTER [INTERCOMM_ID:', &
570 allocate( latlon_catalog(parent_prc_nprocs(
handling_num),4,2) )
586 if(
io_l )
write(
io_fid_log,
'(1x,A)' )
'*** Informations of Parent Domain' 595 if(
io_l )
write(
io_fid_log,
'(1x,A)' )
'*** Informations of Daughter Domain [me]' 604 if(
io_l )
write(
io_fid_log,
'(1x,A)' )
'*** Informations of Target Tiles' 608 if(
io_l )
write(
io_fid_log,
'(1x,A,I6) ')
'*** Limit Num. NCOMM req. :', max_rq
641 vfact(:,:,:,:,:,i_sclr), &
642 kgrd(:,:,:,:,:,i_sclr), &
643 igrd(:,:,:,i_sclr), &
644 jgrd(:,:,:,i_sclr), &
645 ncopy(:,:,:,i_sclr), &
653 buffer_ref_cz(:,:,:), &
654 buffer_ref_lat(:,:), &
655 buffer_ref_lon(:,:), &
663 vfact(:,:,:,:,:,i_zstg), &
664 kgrd(:,:,:,:,:,i_zstg), &
665 igrd(:,:,:,i_zstg), &
666 jgrd(:,:,:,i_zstg), &
667 ncopy(:,:,:,i_zstg), &
675 buffer_ref_fz(:,:,:), &
676 buffer_ref_lat(:,:), &
677 buffer_ref_lon(:,:), &
685 vfact(:,:,:,:,:,i_xstg), &
686 kgrd(:,:,:,:,:,i_xstg), &
687 igrd(:,:,:,i_xstg), &
688 jgrd(:,:,:,i_xstg), &
689 ncopy(:,:,:,i_xstg), &
697 buffer_ref_cz(:,:,:), &
698 buffer_ref_latx(:,:), &
699 buffer_ref_lonx(:,:), &
706 vfact(:,:,:,:,:,i_ystg), &
707 kgrd(:,:,:,:,:,i_ystg), &
708 igrd(:,:,:,i_ystg), &
709 jgrd(:,:,:,i_ystg), &
710 ncopy(:,:,:,i_ystg), &
718 buffer_ref_cz(:,:,:), &
719 buffer_ref_laty(:,:), &
720 buffer_ref_lony(:,:), &
725 deallocate( buffer_2d )
726 deallocate( buffer_3d )
727 deallocate( buffer_3df )
758 integer,
intent(in) :: HANDLE
760 logical :: hit = .false.
761 integer,
allocatable :: pd_tile_num(:,:)
763 real(RP) :: wid_lon, wid_lat
764 integer :: pd_sw_tile
765 integer :: pd_ne_tile
773 allocate( pd_tile_num(0:parent_prc_nprocs(handle)-1,2) )
776 do j = 1, parent_prc_num_y(handle)
777 do i = 1, parent_prc_num_x(handle)
786 do i = 1, parent_prc_nprocs(handle)
787 wid_lon = abs((latlon_catalog(i,i_sw,i_lon) - latlon_catalog(i,i_se,i_lon)) &
789 wid_lat = abs((latlon_catalog(i,i_sw,i_lat) - latlon_catalog(i,i_nw,i_lat)) &
792 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. &
793 corner_loc(i_sw,i_lat) >= min(latlon_catalog(i,i_sw,i_lat),latlon_catalog(i,i_se,i_lat))-wid_lat .AND. &
794 corner_loc(i_sw,i_lon) <= max(latlon_catalog(i,i_ne,i_lon),latlon_catalog(i,i_se,i_lon))+wid_lon .AND. &
795 corner_loc(i_sw,i_lat) <= max(latlon_catalog(i,i_ne,i_lat),latlon_catalog(i,i_nw,i_lat))+wid_lat )
then 802 if ( .NOT. hit )
then 803 write(*,*)
'xxx region of daughter domain is larger than that of parent: SW search' 805 if(
io_l )
write(
io_fid_log,
'(1x,A)')
'xxx region of daughter domain is larger than that of parent: SW search' 806 if(
io_l )
write(
io_fid_log,*)
' grid width: half width in lat:', wid_lat,
' half width in lon:', wid_lon
807 if(
io_l )
write(
io_fid_log,
'(1x,A,F12.6)')
' daughter local (me): LON=',corner_loc(i_sw,i_lon)
808 do i = 1, parent_prc_nprocs(handle)
809 if(
io_l )
write(
io_fid_log,
'(1x,A,F12.6,1x,F12.6)')
' parent local SW-NE: LON=', &
810 latlon_catalog(i,i_sw,i_lon) ,latlon_catalog(i,i_ne,i_lon)
812 if(
io_l )
write(
io_fid_log,
'(1x,A,F12.6)')
' daughter local (me): LAT=',corner_loc(i_sw,i_lat)
813 do i = 1, parent_prc_nprocs(handle)
814 if(
io_l )
write(
io_fid_log,
'(1x,A,F12.6,1x,F12.6)')
' parent local SW-NE: LAT=', &
815 latlon_catalog(i,i_sw,i_lat) ,latlon_catalog(i,i_ne,i_lat)
822 do i = parent_prc_nprocs(handle), 1, -1
823 wid_lon = abs((latlon_catalog(i,i_nw,i_lon) - latlon_catalog(i,i_ne,i_lon)) &
825 wid_lat = abs((latlon_catalog(i,i_se,i_lat) - latlon_catalog(i,i_ne,i_lat)) &
828 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. &
829 corner_loc(i_ne,i_lat) >= min(latlon_catalog(i,i_sw,i_lat),latlon_catalog(i,i_se,i_lat))-wid_lat .AND. &
830 corner_loc(i_ne,i_lon) <= max(latlon_catalog(i,i_ne,i_lon),latlon_catalog(i,i_se,i_lon))+wid_lon .AND. &
831 corner_loc(i_ne,i_lat) <= max(latlon_catalog(i,i_ne,i_lat),latlon_catalog(i,i_nw,i_lat))+wid_lat )
then 838 if ( .NOT. hit )
then 839 write(*,*)
'xxx region of daughter domain is larger than that of parent: NE search' 841 if(
io_l )
write(
io_fid_log,
'(1x,A)')
'xxx region of daughter domain is larger than that of parent: NE search' 842 if(
io_l )
write(
io_fid_log,*)
' grid width: half width in lat:', wid_lat,
' half width in lon:', wid_lon
843 if(
io_l )
write(
io_fid_log,
'(1x,A,F12.6)')
' daughter local (me): LON=',corner_loc(i_ne,i_lon)
844 do i = 1, parent_prc_nprocs(handle)
845 if(
io_l )
write(
io_fid_log,
'(1x,A,F12.6,1x,F12.6)')
' parent local SW-NE: LON=', &
846 latlon_catalog(i,i_sw,i_lon) ,latlon_catalog(i,i_ne,i_lon)
848 if(
io_l )
write(
io_fid_log,
'(1x,A,F12.6)')
' daughter local (me): LAT=',corner_loc(i_ne,i_lat)
849 do i = 1, parent_prc_nprocs(handle)
850 if(
io_l )
write(
io_fid_log,
'(1x,A,F12.6,1x,F12.6)')
' parent local SW-NE: LAT=', &
851 latlon_catalog(i,i_sw,i_lat) ,latlon_catalog(i,i_ne,i_lat)
856 nest_tile_num_x = pd_tile_num(pd_ne_tile,1) - pd_tile_num(pd_sw_tile,1) + 1
857 nest_tile_num_y = pd_tile_num(pd_ne_tile,2) - pd_tile_num(pd_sw_tile,2) + 1
861 if(
io_l )
write(
io_fid_log,
'(1x,A)')
'*** NEST: target process tile in parent domain' 865 nest_tile_id(k) = pd_sw_tile + (i-1) + parent_prc_num_x(handle)*(j-1)
887 integer,
intent(out) :: tilei, tilej
888 integer,
intent(out) :: cxs, cxe, cys, cye
889 integer,
intent(out) :: pxs, pxe, pys, pye
890 integer,
intent(in) :: iloc
894 integer :: xloc, yloc
895 integer :: xlocg, ylocg
904 yloc = int(
real(iloc-1) /
real(NEST_TILE_NUM_X) ) + 1
905 xlocg = mod( rank, offline_parent_prc_num_x ) + 1
906 ylocg = int(
real(rank) /
real(OFFLINE_PARENT_PRC_NUM_X) ) + 1
910 cxs = tilei * (xloc-1) + 1
912 cys = tilej * (yloc-1) + 1
919 if ( xlocg == 1 )
then 924 if ( xlocg == offline_parent_prc_num_x )
then 927 if ( ylocg == 1 )
then 932 if ( ylocg == offline_parent_prc_num_y )
then 941 subroutine nest_comm_parentsize( &
958 integer,
intent(in) :: HANDLE
961 integer :: datapack(14)
962 integer :: QA_OTHERSIDE
963 integer :: ireq1, ireq2, ierr1, ierr2, ileng
964 integer :: istatus(mpi_status_size)
972 tag = intercomm_id(handle) * 100
996 call mpi_wait(ireq1, istatus, ierr1)
997 call mpi_wait(ireq2, istatus, ierr2)
1000 parent_prc_nprocs(handle) = datapack( 1)
1001 parent_prc_num_x(handle) = datapack( 2)
1002 parent_prc_num_y(handle) = datapack( 3)
1006 prnt_ks(handle) = datapack( 7)
1007 prnt_ke(handle) = datapack( 8)
1008 prnt_is(handle) = datapack( 9)
1009 prnt_ie(handle) = datapack(10)
1010 prnt_js(handle) = datapack(11)
1011 prnt_je(handle) = datapack(12)
1019 call mpi_wait(ireq1, istatus, ierr1)
1020 call mpi_wait(ireq2, istatus, ierr2)
1022 call comm_bcast(datapack, ileng)
1023 call comm_bcast(buffer)
1025 daughter_prc_nprocs(handle) = datapack( 1)
1026 daughter_prc_num_x(handle) = datapack( 2)
1027 daughter_prc_num_y(handle) = datapack( 3)
1031 datr_ks(handle) = datapack( 7)
1032 datr_ke(handle) = datapack( 8)
1033 datr_is(handle) = datapack( 9)
1034 datr_ie(handle) = datapack(10)
1035 datr_js(handle) = datapack(11)
1036 datr_je(handle) = datapack(12)
1038 qa_otherside = datapack(14)
1047 call mpi_wait(ireq1, istatus, ierr1)
1048 call mpi_wait(ireq2, istatus, ierr2)
1050 call comm_bcast(datapack, ileng)
1051 call comm_bcast(buffer)
1053 parent_prc_nprocs(handle) = datapack( 1)
1054 parent_prc_num_x(handle) = datapack( 2)
1055 parent_prc_num_y(handle) = datapack( 3)
1059 prnt_ks(handle) = datapack( 7)
1060 prnt_ke(handle) = datapack( 8)
1061 prnt_is(handle) = datapack( 9)
1062 prnt_ie(handle) = datapack(10)
1063 prnt_js(handle) = datapack(11)
1064 prnt_je(handle) = datapack(12)
1066 qa_otherside = datapack(14)
1089 call mpi_wait(ireq1, istatus, ierr1)
1090 call mpi_wait(ireq2, istatus, ierr2)
1093 daughter_prc_nprocs(handle) = datapack( 1)
1094 daughter_prc_num_x(handle) = datapack( 2)
1095 daughter_prc_num_y(handle) = datapack( 3)
1099 datr_ks(handle) = datapack( 7)
1100 datr_ke(handle) = datapack( 8)
1101 datr_is(handle) = datapack( 9)
1102 datr_ie(handle) = datapack(10)
1103 datr_js(handle) = datapack(11)
1104 datr_je(handle) = datapack(12)
1108 write(*,*)
'xxx internal error [parentsize: nest/grid]' 1113 write(*,*)
'xxx ERROR: NUMBER of QA are not matched! [parentsize: nest/grid]' 1114 write(*,*)
'xxx check a flag of ONLINE_BOUNDARY_USE_QHYD.', qa_otherside,
nest_bnd_qa 1119 end subroutine nest_comm_parentsize
1123 subroutine nest_comm_catalogue( &
1137 integer,
intent(in) :: HANDLE
1139 integer :: ireq, ierr, ileng
1140 integer :: istatus(mpi_status_size)
1148 tag = intercomm_id(handle) * 100
1154 call mpi_wait(ireq, istatus, ierr)
1158 ileng = parent_prc_nprocs(handle) * 4 * 2
1161 call mpi_wait(ireq, istatus, ierr)
1163 call comm_bcast( latlon_catalog, parent_prc_nprocs(handle), 4, 2 )
1165 if(
io_l )
write(*,*)
'xxx internal error [nest/grid]' 1170 end subroutine nest_comm_catalogue
1174 subroutine nest_comm_ping( &
1184 integer,
intent(in) :: HANDLE
1186 integer :: ping, pong
1187 integer :: ireq1, ireq2, ierr1, ierr2
1188 integer :: istatus(mpi_status_size)
1190 logical :: ping_error
1197 tag = intercomm_id(handle) * 100
1198 ping_error = .false.
1207 call mpi_wait(ireq1, istatus, ierr1)
1208 call mpi_wait(ireq2, istatus, ierr2)
1211 call comm_bcast(pong)
1213 if ( pong /= intercomm_id(handle)+1 ) ping_error = .true.
1222 call mpi_wait(ireq1, istatus, ierr1)
1223 call mpi_wait(ireq2, istatus, ierr2)
1226 call comm_bcast(pong)
1228 if ( pong /= intercomm_id(handle) ) ping_error = .true.
1231 if(
io_l )
write(*,*)
'xxx internal error [nest/grid]' 1235 if ( ping_error )
then 1236 if(
io_l )
write(*,*)
'xxx ping destination error [nest/grid]' 1241 end subroutine nest_comm_ping
1245 subroutine nest_comm_setup_nestdown( &
1258 integer,
intent(in) :: HANDLE
1260 integer,
allocatable :: buffer_LIST(:)
1261 integer,
allocatable :: buffer_ALLLIST(:)
1263 integer :: ireq, ierr, ileng
1264 integer :: istatus(mpi_status_size)
1265 integer :: tag, target_rank
1274 tag = intercomm_id(handle) * 100
1281 call mpi_wait(ireq, istatus, ierr)
1283 call comm_bcast(nest_tile_allmax_p)
1285 allocate( nest_tile_list_p(nest_tile_allmax_p,daughter_prc_nprocs(handle)) )
1286 allocate( nest_tile_list_yp(nest_tile_allmax_p*daughter_prc_nprocs(handle)) )
1288 ileng = nest_tile_allmax_p*daughter_prc_nprocs(handle)
1291 call mpi_wait(ireq, istatus, ierr)
1293 call comm_bcast(nest_tile_list_p, nest_tile_allmax_p, daughter_prc_nprocs(handle))
1295 nest_tile_list_yp(:) = -1
1298 do j = 1, daughter_prc_nprocs(handle)
1299 do i = 1, nest_tile_allmax_p
1300 if ( nest_tile_list_p(i,j) ==
prc_myrank )
then 1302 nest_tile_list_yp(k) = j - 1
1308 if(
io_l )
write(
io_fid_log,
'(A,I5,A,I5)')
"[P] Num YP =",num_yp,
" Num TILE(MAX) =",nest_tile_allmax_p
1312 call mpi_wait(ireq, istatus, ierr)
1314 call comm_bcast(online_daughter_use_velz)
1316 if(
io_l )
write(
io_fid_log,
'(1x,A,L2)')
'*** NEST: ONLINE_DAUGHTER_USE_VELZ =', online_daughter_use_velz
1320 call mpi_wait(ireq, istatus, ierr)
1322 call comm_bcast(online_daughter_no_rotate)
1325 write(*,*)
'xxx Flag of NO_ROTATE is not consistent with the child domain' 1327 if(
io_l )
write(
io_fid_log,*)
'xxx ONLINE_DAUGHTER_NO_ROTATE =', online_daughter_no_rotate
1330 if(
io_l )
write(
io_fid_log,
'(1x,A,L2)')
'*** NEST: ONLINE_DAUGHTER_NO_ROTATE =', online_daughter_no_rotate
1332 call nest_comm_importgrid_nestdown( handle )
1335 target_rank = nest_tile_list_yp(i)
1336 call mpi_isend(i, 1, mpi_integer, target_rank, tag+5,
intercomm_daughter, ireq, ierr)
1337 call mpi_wait(ireq, istatus, ierr)
1346 call mpi_allreduce( nest_tile_all, &
1347 nest_tile_allmax_d, &
1353 if(
io_l )
write(
io_fid_log,
'(A,I5,A,I5)')
"[D] Num YP =",nest_tile_all,
" Num TILE(MAX) =",nest_tile_allmax_d
1357 call mpi_wait(ireq, istatus, ierr)
1360 allocate( buffer_list(nest_tile_allmax_d) )
1361 allocate( buffer_alllist(nest_tile_allmax_d*daughter_prc_nprocs(handle)) )
1362 allocate( nest_tile_list_d(nest_tile_allmax_d,daughter_prc_nprocs(handle)) )
1364 do i = 1, nest_tile_allmax_d
1365 if ( i <= nest_tile_all )
then 1372 ileng = nest_tile_allmax_d
1373 call mpi_allgather( buffer_list(:), &
1376 buffer_alllist(:), &
1382 do j = 1, daughter_prc_nprocs(handle)
1383 do i = 1, nest_tile_allmax_d
1384 nest_tile_list_d(i,j) = buffer_alllist(k)
1389 deallocate( buffer_list )
1390 deallocate( buffer_alllist )
1392 ileng = nest_tile_allmax_d*daughter_prc_nprocs(handle)
1395 call mpi_wait(ireq, istatus, ierr)
1400 call mpi_wait(ireq, istatus, ierr)
1405 call mpi_wait(ireq, istatus, ierr)
1407 call comm_bcast(online_daughter_no_rotate)
1409 call nest_comm_importgrid_nestdown( handle )
1411 do i = 1, nest_tile_all
1412 target_rank = nest_tile_list_d(i,
prc_myrank+1)
1413 call mpi_irecv( call_order(i), 1, mpi_integer, target_rank, tag+5,
intercomm_parent, ireq, ierr )
1414 call mpi_wait(ireq, istatus, ierr)
1420 if(
io_l )
write(*,*)
'xxx internal error [nest/grid]' 1424 if( num_yp * 16 > max_rq .OR. nest_tile_all * 16 > max_rq )
then 1425 write(*,*)
'xxx internal error (overflow number of ireq) [nest/grid]' 1426 write(*,*)
' NUM_YP x 16 = ', num_yp * 16
1427 write(*,*)
' NEST_TILE_ALL x 16 = ', nest_tile_all * 16
1428 write(*,*)
' max_rq = ', max_rq
1433 end subroutine nest_comm_setup_nestdown
1437 subroutine nest_comm_importgrid_nestdown( &
1456 integer,
intent(in) :: HANDLE
1458 integer :: ierr, ileng
1459 integer :: istatus(mpi_status_size)
1460 integer :: tag, tagbase, target_rank
1462 integer :: xloc, yloc
1466 real(RP) :: max_ref, max_loc
1475 tagbase = intercomm_id(handle) * 100
1482 target_rank = nest_tile_list_yp(i)
1486 tag = tagbase + tag_lon
1488 call mpi_wait(ireq_p(rq), istatus, ierr)
1492 tag = tagbase + tag_lat
1494 call mpi_wait(ireq_p(rq), istatus, ierr)
1498 tag = tagbase + tag_lonx
1500 call mpi_wait(ireq_p(rq), istatus, ierr)
1504 tag = tagbase + tag_latx
1506 call mpi_wait(ireq_p(rq), istatus, ierr)
1510 tag = tagbase + tag_lony
1512 call mpi_wait(ireq_p(rq), istatus, ierr)
1516 tag = tagbase + tag_laty
1518 call mpi_wait(ireq_p(rq), istatus, ierr)
1522 tag = tagbase + tag_cz
1524 call mpi_wait(ireq_p(rq), istatus, ierr)
1528 tag = tagbase + tag_fz
1530 call mpi_wait(ireq_p(rq), istatus, ierr)
1536 do i = 1, nest_tile_all
1538 target_rank = nest_tile_list_d(i,
prc_myrank+1)
1541 yloc = int(
real(i-1) /
real(NEST_TILE_NUM_X) ) + 1
1550 tag = tagbase + tag_lon
1552 call mpi_wait(ireq_d(rq), istatus, ierr)
1557 tag = tagbase + tag_lat
1559 call mpi_wait(ireq_d(rq), istatus, ierr)
1564 tag = tagbase + tag_lonx
1566 call mpi_wait(ireq_d(rq), istatus, ierr)
1571 tag = tagbase + tag_latx
1573 call mpi_wait(ireq_d(rq), istatus, ierr)
1578 tag = tagbase + tag_lony
1580 call mpi_wait(ireq_d(rq), istatus, ierr)
1585 tag = tagbase + tag_laty
1587 call mpi_wait(ireq_d(rq), istatus, ierr)
1592 tag = tagbase + tag_cz
1594 call mpi_wait(ireq_d(rq), istatus, ierr)
1601 tag = tagbase + tag_fz
1603 call mpi_wait(ireq_d(rq), istatus, ierr)
1610 max_ref = maxval( buffer_ref_fz(:,:,:) )
1612 if ( max_ref < max_loc )
then 1613 write(*,*)
'xxx ERROR: REQUESTED DOMAIN IS TOO MUCH BROAD' 1614 write(*,*)
'xxx -- VERTICAL direction over the limit' 1615 write(*,*)
'xxx -- reference max: ', max_ref
1616 write(*,*)
'xxx -- local max: ', max_loc
1622 write(*,*)
'xxx internal error [nest/grid]' 1627 end subroutine nest_comm_importgrid_nestdown
1640 interped_ref_DENS, & ! [inout]
1641 interped_ref_VELZ, & ! [inout]
1642 interped_ref_VELX, & ! [inout]
1643 interped_ref_VELY, & ! [inout]
1644 interped_ref_POTT, & ! [inout]
1659 integer,
intent(in) :: HANDLE
1660 integer,
intent(in) :: BND_QA
1676 real(RP) :: dummy(1,1,1)
1686 real(RP) :: u_on_map, v_on_map
1688 integer :: tagbase, tagcomm
1689 integer :: isu_tag, isu_tagf
1690 integer :: i, j, k, iq
1692 integer,
parameter :: cosin = 1
1693 integer,
parameter :: sine = 2
1700 if ( bnd_qa > i_bndqa )
then 1701 if(
io_l )
write(*,*)
'xxx internal error: BND_QA is larger than I_BNDQA [nest/grid]' 1704 if ( bnd_qa > max_bndqa )
then 1705 if(
io_l )
write(*,*)
'xxx internal error: BND_QA is larger than max_bndqa [nest/grid]' 1709 tagcomm = intercomm_id(handle) * order_tag_comm
1716 if(
io_l )
write(
io_fid_log,
'(1X,A,I5,A)')
"*** NestIDC [P]: que send ( ", nsend,
" )" 1721 org_dens(:,:,:) = ipt_dens(:,:,:)
1722 org_momz(:,:,:) = ipt_momz(:,:,:)
1723 org_momx(:,:,:) = ipt_momx(:,:,:)
1724 org_momy(:,:,:) = ipt_momy(:,:,:)
1725 org_rhot(:,:,:) = ipt_rhot(:,:,:)
1727 org_qtrc(:,:,:,iq) = ipt_qtrc(:,:,:,iq)
1735 if ( .NOT. online_daughter_no_rotate )
then 1740 work1p(k,i,j) = ( org_momx(k,i-1,j) + org_momx(k,i,j) ) * 0.5_rp
1746 work1p(k,1,j) = org_momx(k,1,j)
1749 call comm_vars8( work1p(:,:,:), 1 )
1753 work2p(k,i,j) = ( org_momy(k,i,j-1) + org_momy(k,i,j) ) * 0.5_rp
1759 work2p(k,i,1) = org_momy(k,i,1)
1762 call comm_vars8( work2p(:,:,:), 2 )
1763 call comm_wait ( work1p(:,:,:), 1, .false. )
1764 call comm_wait ( work2p(:,:,:), 2, .false. )
1770 u_on_map = work1p(k,i,j) / org_dens(k,i,j)
1771 v_on_map = work2p(k,i,j) / org_dens(k,i,j)
1773 u_llp(k,i,j) = u_on_map * rotc(i,j,cosin) - v_on_map * rotc(i,j,sine )
1774 v_llp(k,i,j) = u_on_map * rotc(i,j,sine ) + v_on_map * rotc(i,j,cosin)
1780 tagbase = tagcomm + tag_dens*order_tag_var
1781 call nest_comm_intercomm_nestdown( org_dens, dummy, tagbase, i_sclr, handle, isu_tag, isu_tagf, .true. )
1783 tagbase = tagcomm + tag_momz*order_tag_var
1784 if ( online_daughter_use_velz )
then 1785 call nest_comm_intercomm_nestdown( org_momz, dummy, tagbase, i_zstg, handle, isu_tag, isu_tagf )
1788 tagbase = tagcomm + tag_momx*order_tag_var
1789 if ( online_daughter_no_rotate )
then 1790 call nest_comm_intercomm_nestdown( org_momx, dummy, tagbase, i_xstg, handle, isu_tag, isu_tagf )
1792 call nest_comm_intercomm_nestdown( u_llp, dummy, tagbase, i_sclr, handle, isu_tag, isu_tagf )
1795 tagbase = tagcomm + tag_momy*order_tag_var
1796 if ( online_daughter_no_rotate )
then 1797 call nest_comm_intercomm_nestdown( org_momy, dummy, tagbase, i_ystg, handle, isu_tag, isu_tagf )
1799 call nest_comm_intercomm_nestdown( v_llp, dummy, tagbase, i_sclr, handle, isu_tag, isu_tagf )
1802 tagbase = tagcomm + tag_rhot*order_tag_var
1803 call nest_comm_intercomm_nestdown( org_rhot, dummy, tagbase, i_sclr, handle, isu_tag, isu_tagf )
1806 tagbase = tagcomm + (tag_qx*10+iq)*order_tag_var
1807 call nest_comm_intercomm_nestdown( org_qtrc(:,:,:,iq), dummy, tagbase, i_sclr, handle, isu_tag, isu_tagf )
1820 nwait_d = nwait_d + 1
1832 if ( online_aggressive_comm )
then 1841 tagbase = tagcomm + tag_dens*order_tag_var
1842 call nest_comm_intercomm_nestdown( dummy, dens, tagbase, i_sclr, handle, isu_tag, isu_tagf, .true. )
1847 interped_ref_dens(k,i,j) = dens(k,i,j)
1852 call comm_vars8( interped_ref_dens, 1 )
1854 tagbase = tagcomm + tag_momz*order_tag_var
1856 call nest_comm_intercomm_nestdown( dummy, work1d, tagbase, i_zstg, handle, isu_tag, isu_tagf )
1861 interped_ref_velz(k,i,j) = work1d(k,i,j) / ( dens(k,i,j) + dens(k+1,i,j) ) * 2.0_rp
1867 tagbase = tagcomm + tag_momx*order_tag_var
1870 call nest_comm_intercomm_nestdown( dummy, u_lld, tagbase, i_xstg, handle, isu_tag, isu_tagf )
1873 call nest_comm_intercomm_nestdown( dummy, u_lld, tagbase, i_sclr, handle, isu_tag, isu_tagf )
1876 tagbase = tagcomm + tag_momy*order_tag_var
1879 call nest_comm_intercomm_nestdown( dummy, v_lld, tagbase, i_ystg, handle, isu_tag, isu_tagf )
1882 call nest_comm_intercomm_nestdown( dummy, v_lld, tagbase, i_sclr, handle, isu_tag, isu_tagf )
1885 call comm_wait ( interped_ref_dens, 1, .false. )
1891 interped_ref_velx(k,i,j) = u_lld(k,i,j) &
1892 / ( interped_ref_dens(k,i+1,j) + interped_ref_dens(k,i,j) ) * 2.0_rp
1902 call comm_vars8( interped_ref_velx, 2 )
1906 interped_ref_vely(k,i,j) = v_lld(k,i,j) &
1907 / ( interped_ref_dens(k,i,j+1) + interped_ref_dens(k,i,j) ) * 2.0_rp
1917 call comm_vars8( interped_ref_vely, 3 )
1918 call comm_wait ( interped_ref_velx, 2, .false. )
1919 call comm_wait ( interped_ref_vely, 3, .false. )
1925 work1d(k,i,j) = u_lld(k,i,j) * rotc(i,j,cosin) + v_lld(k,i,j) * rotc(i,j,sine )
1926 work2d(k,i,j) = - u_lld(k,i,j) * rotc(i,j,sine ) + v_lld(k,i,j) * rotc(i,j,cosin)
1935 interped_ref_velx(k,i,j) = ( work1d(k,i+1,j) + work1d(k,i,j) ) * 0.5_rp
1944 call comm_vars8( interped_ref_velx, 2 )
1948 interped_ref_vely(k,i,j) = ( work2d(k,i,j+1) + work2d(k,i,j) ) * 0.5_rp
1957 call comm_vars8( interped_ref_vely, 3 )
1958 call comm_wait ( interped_ref_velx, 2, .false. )
1959 call comm_wait ( interped_ref_vely, 3, .false. )
1962 tagbase = tagcomm + tag_rhot*order_tag_var
1963 call nest_comm_intercomm_nestdown( dummy, work1d, tagbase, i_sclr, handle, isu_tag, isu_tagf )
1967 interped_ref_pott(k,i,j) = work1d(k,i,j) / interped_ref_dens(k,i,j)
1973 tagbase = tagcomm + (tag_qx*10+iq)*order_tag_var
1974 call nest_comm_intercomm_nestdown( dummy, work1d, tagbase, i_sclr, handle, isu_tag, isu_tagf )
1978 interped_ref_qtrc(k,i,j,iq) = work1d(k,i,j)
1988 write(*,*)
'xxx internal error [nestdown: nest/grid]' 2004 integer,
intent(in) :: HANDLE
2005 integer,
intent(in) :: BND_QA
2007 integer :: isu_tag, isu_tagf
2008 integer :: tagbase, tagcomm
2017 if ( bnd_qa > i_bndqa )
then 2018 write(*,*)
'xxx internal error: about BND_QA [nest/grid]' 2022 tagcomm = intercomm_id(handle) * order_tag_comm
2027 nwait_p = nwait_p + 1
2031 call nest_comm_issuer_of_wait( handle )
2033 if ( online_aggressive_comm )
then 2046 if(
io_l )
write(
io_fid_log,
'(1X,A,I5,A)')
"*** NestIDC [C]: que recv ( ", nrecv,
" )" 2055 tagbase = tagcomm + tag_dens*order_tag_var
2056 call nest_comm_issuer_of_receive( tagbase, i_sclr, handle, isu_tag, isu_tagf, .true. )
2058 tagbase = tagcomm + tag_momz*order_tag_var
2060 call nest_comm_issuer_of_receive( tagbase, i_zstg, handle, isu_tag, isu_tagf )
2063 tagbase = tagcomm + tag_momx*order_tag_var
2065 call nest_comm_issuer_of_receive( tagbase, i_xstg, handle, isu_tag, isu_tagf )
2067 call nest_comm_issuer_of_receive( tagbase, i_sclr, handle, isu_tag, isu_tagf )
2070 tagbase = tagcomm + tag_momy*order_tag_var
2072 call nest_comm_issuer_of_receive( tagbase, i_ystg, handle, isu_tag, isu_tagf )
2074 call nest_comm_issuer_of_receive( tagbase, i_sclr, handle, isu_tag, isu_tagf )
2077 tagbase = tagcomm + tag_rhot*order_tag_var
2078 call nest_comm_issuer_of_receive( tagbase, i_sclr, handle, isu_tag, isu_tagf )
2081 tagbase = tagcomm + (tag_qx*10+iq)*order_tag_var
2082 call nest_comm_issuer_of_receive( tagbase, i_sclr, handle, isu_tag, isu_tagf )
2089 write(*,*)
'xxx internal error [issue: nest/grid]' 2106 integer,
intent(in) :: HANDLE
2125 if(
io_l )
write(
io_fid_log,
'(1X,A,I5,A)')
"*** NestIDC [C]: CANCEL recv ( ", nrecv,
" )" 2127 if ( ireq_d(rq) /= mpi_request_null )
then 2128 call mpi_cancel(ireq_d(rq), ierr)
2137 write(*,*)
'xxx internal error [cancel: nest/grid]' 2152 isu_tag, & ! [inout]
2153 isu_tagf, & ! [inout]
2165 real(RP),
intent(in) :: pvar(:,:,:)
2166 real(RP),
intent(out) :: dvar(:,:,:)
2167 integer ,
intent(in) :: tagbase
2168 integer ,
intent(in) :: id_stag
2169 integer ,
intent(in) :: HANDLE
2170 integer ,
intent(inout) :: isu_tag
2171 integer ,
intent(inout) :: isu_tagf
2173 logical ,
intent(in),
optional :: flag_dens
2175 integer :: ierr, ileng
2176 integer :: tag, target_rank
2178 integer :: xloc, yloc
2183 integer :: ig, rq, yp
2184 logical :: no_zstag = .true.
2185 logical :: logarithmic = .false.
2192 logarithmic = .false.
2193 if (
present(flag_dens) )
then 2194 if ( flag_dens )
then 2195 logarithmic = .true.
2199 if ( id_stag == i_sclr )
then 2202 elseif ( id_stag == i_zstg )
then 2205 elseif ( id_stag == i_xstg )
then 2208 elseif ( id_stag == i_ystg )
then 2213 if ( no_zstag )
then 2228 target_rank = nest_tile_list_yp(yp)
2232 dvar(:,:,:) = -1.0_rp
2242 do yp = 1, nest_tile_all
2246 yloc = int(
real(yp-1) /
real(NEST_TILE_NUM_X) ) + 1
2253 if ( no_zstag )
then 2254 isu_tag = isu_tag + 1
2256 if ( .NOT. logarithmic )
then 2260 buffer_ref_3d(k,xs:xe,ys:ye) &
2267 buffer_ref_3d(k,xs:xe,ys:ye) &
2272 isu_tagf = isu_tagf + 1
2275 buffer_ref_3df(k,xs:xe,ys:ye) &
2280 if ( isu_tag > max_isu .OR. isu_tagf > max_isuf )
then 2281 write(*,*)
'xxx Exceeded maximum issue [intercomm: nest/grid]' 2282 write(*,*)
'xxx isu_tag = ', isu_tag
2283 write(*,*)
'xxx isu_tagf = ', isu_tagf
2291 dvar(:,:,:) = 0.0_rp
2293 if ( no_zstag )
then 2297 vfact(:,:,:,:,:,ig), &
2298 kgrd(:,:,:,:,:,ig), &
2311 vfact(:,:,:,:,:,ig), &
2312 kgrd(:,:,:,:,:,ig), &
2323 write(*,*)
'xxx internal error [nest/grid]' 2336 isu_tag, & ! [inout]
2337 isu_tagf, & ! [inout]
2347 integer ,
intent(in) :: tagbase
2348 integer ,
intent(in) :: id_stag
2349 integer ,
intent(in) :: HANDLE
2350 integer ,
intent(inout) :: isu_tag
2351 integer ,
intent(inout) :: isu_tagf
2352 logical ,
intent(in),
optional :: flag_dens
2354 integer :: ierr, ileng
2355 integer :: tag, target_rank
2357 integer :: ig, rq, yp
2358 logical :: no_zstag = .true.
2359 logical :: logarithmic = .false.
2366 logarithmic = .false.
2367 if (
present(flag_dens) )
then 2368 if ( flag_dens )
then 2369 logarithmic = .true.
2373 if ( id_stag == i_sclr )
then 2376 elseif ( id_stag == i_zstg )
then 2379 elseif ( id_stag == i_xstg )
then 2382 elseif ( id_stag == i_ystg )
then 2387 if ( no_zstag )
then 2403 do yp = 1, nest_tile_all
2406 target_rank = nest_tile_list_d(yp,
prc_myrank+1)
2408 tag = tagbase + call_order(yp)
2409 if ( no_zstag )
then 2410 isu_tag = isu_tag + 1
2411 recvbuf_3d(:,:,:,isu_tag) = 0.0_rp
2412 call mpi_irecv( recvbuf_3d(:,:,:,isu_tag), &
2421 isu_tagf = isu_tagf + 1
2422 recvbuf_3df(:,:,:,isu_tagf) = 0.0_rp
2423 call mpi_irecv( recvbuf_3df(:,:,:,isu_tagf), &
2435 if ( isu_tag > max_isu .OR. isu_tagf > max_isuf )
then 2436 write(*,*)
'xxx Exceeded maximum issue [receive: nest/grid]' 2437 write(*,*)
'xxx isu_tag = ', isu_tag
2438 write(*,*)
'xxx isu_tagf = ', isu_tagf
2446 write(*,*)
'xxx internal error [receive: nest/grid]' 2461 integer,
intent(in) :: HANDLE
2478 write(*,*)
'xxx internal error [wait: nest/grid]' 2494 integer,
intent(in) :: req_count
2495 integer,
intent(inout) :: ireq(max_rq)
2499 integer :: istatus(mpi_status_size,req_count)
2500 integer :: req_count2
2501 integer :: ireq2(max_rq)
2515 if (ireq(i) /= mpi_request_null)
then 2516 req_count2 = req_count2 + 1
2517 ireq2(req_count2) = ireq(i)
2520 if ( req_count2 /= 0 )
call mpi_waitall( req_count2, ireq2, istatus, ierr )
2544 integer,
intent(in) :: HANDLE
2546 integer :: istatus(mpi_status_size)
2558 if ( rq_ctl_p > 0 )
call mpi_test(ireq_p(1), flag, istatus, ierr)
2564 if ( rq_ctl_d > 0 )
call mpi_test(ireq_d(1), flag, istatus, ierr)
2568 write(*,*)
'xxx internal error [test: nest/grid]' 2589 if(
io_l )
write(
io_fid_log,
'(1x,A)')
'*** Waiting finish of whole processes' 2596 if(
io_l )
write(
io_fid_log,
'(1x,A)')
'*** Disconnected communication with child' 2603 if(
io_l )
write(
io_fid_log,
'(1x,A)')
'*** Disconnected communication with parent' integer, public imax
of computational cells: x
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
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
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
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 x whole cells (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
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
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)
subroutine, public log(type, message)
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
real(rp), public const_eps
small number
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
logical, public io_lnml
output log or not? (for namelist, this process)
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
subroutine, public nest_comm_disconnect()
[finalize: disconnect] Inter-communication
subroutine, public intrpnest_setup(interp_search_divnum, NEST_INTERP_LEVEL, OFFLINE)
Setup.
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 y whole cells (local, with HALO)