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 = .false.
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
769 allocate( pd_tile_num(0:parent_prc_nprocs(handle)-1,2) )
772 do j = 1, parent_prc_num_y(handle)
773 do i = 1, parent_prc_num_x(handle)
782 do i = 1, parent_prc_nprocs(handle)
783 wid_lon = abs((latlon_catalog(i,i_sw,i_lon) - latlon_catalog(i,i_se,i_lon)) &
785 wid_lat = abs((latlon_catalog(i,i_sw,i_lat) - latlon_catalog(i,i_nw,i_lat)) &
788 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. &
789 corner_loc(i_sw,i_lat) >= min(latlon_catalog(i,i_sw,i_lat),latlon_catalog(i,i_se,i_lat))-wid_lat .AND. &
790 corner_loc(i_sw,i_lon) <= max(latlon_catalog(i,i_ne,i_lon),latlon_catalog(i,i_se,i_lon))+wid_lon .AND. &
791 corner_loc(i_sw,i_lat) <= max(latlon_catalog(i,i_ne,i_lat),latlon_catalog(i,i_nw,i_lat))+wid_lat )
then 798 if ( .NOT. hit )
then 799 write(*,*)
'xxx region of daughter domain is larger than that of parent: SW search' 801 if(
io_l )
write(
io_fid_log,
'(1x,A)')
'xxx region of daughter domain is larger than that of parent: SW search' 802 if(
io_l )
write(
io_fid_log,*)
' grid width: half width in lat:', wid_lat,
' half width in lon:', wid_lon
803 if(
io_l )
write(
io_fid_log,
'(1x,A,F12.6)')
' daughter local (me): LON=',corner_loc(i_sw,i_lon)
804 do i = 1, parent_prc_nprocs(handle)
805 if(
io_l )
write(
io_fid_log,
'(1x,A,F12.6,1x,F12.6)')
' parent local SW-NE: LON=', &
806 latlon_catalog(i,i_sw,i_lon) ,latlon_catalog(i,i_ne,i_lon)
808 if(
io_l )
write(
io_fid_log,
'(1x,A,F12.6)')
' daughter local (me): LAT=',corner_loc(i_sw,i_lat)
809 do i = 1, parent_prc_nprocs(handle)
810 if(
io_l )
write(
io_fid_log,
'(1x,A,F12.6,1x,F12.6)')
' parent local SW-NE: LAT=', &
811 latlon_catalog(i,i_sw,i_lat) ,latlon_catalog(i,i_ne,i_lat)
818 do i = parent_prc_nprocs(handle), 1, -1
819 wid_lon = abs((latlon_catalog(i,i_nw,i_lon) - latlon_catalog(i,i_ne,i_lon)) &
821 wid_lat = abs((latlon_catalog(i,i_se,i_lat) - latlon_catalog(i,i_ne,i_lat)) &
824 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. &
825 corner_loc(i_ne,i_lat) >= min(latlon_catalog(i,i_sw,i_lat),latlon_catalog(i,i_se,i_lat))-wid_lat .AND. &
826 corner_loc(i_ne,i_lon) <= max(latlon_catalog(i,i_ne,i_lon),latlon_catalog(i,i_se,i_lon))+wid_lon .AND. &
827 corner_loc(i_ne,i_lat) <= max(latlon_catalog(i,i_ne,i_lat),latlon_catalog(i,i_nw,i_lat))+wid_lat )
then 834 if ( .NOT. hit )
then 835 write(*,*)
'xxx region of daughter domain is larger than that of parent: NE search' 837 if(
io_l )
write(
io_fid_log,
'(1x,A)')
'xxx region of daughter domain is larger than that of parent: NE search' 838 if(
io_l )
write(
io_fid_log,*)
' grid width: half width in lat:', wid_lat,
' half width in lon:', wid_lon
839 if(
io_l )
write(
io_fid_log,
'(1x,A,F12.6)')
' daughter local (me): LON=',corner_loc(i_ne,i_lon)
840 do i = 1, parent_prc_nprocs(handle)
841 if(
io_l )
write(
io_fid_log,
'(1x,A,F12.6,1x,F12.6)')
' parent local SW-NE: LON=', &
842 latlon_catalog(i,i_sw,i_lon) ,latlon_catalog(i,i_ne,i_lon)
844 if(
io_l )
write(
io_fid_log,
'(1x,A,F12.6)')
' daughter local (me): LAT=',corner_loc(i_ne,i_lat)
845 do i = 1, parent_prc_nprocs(handle)
846 if(
io_l )
write(
io_fid_log,
'(1x,A,F12.6,1x,F12.6)')
' parent local SW-NE: LAT=', &
847 latlon_catalog(i,i_sw,i_lat) ,latlon_catalog(i,i_ne,i_lat)
852 nest_tile_num_x = pd_tile_num(pd_ne_tile,1) - pd_tile_num(pd_sw_tile,1) + 1
853 nest_tile_num_y = pd_tile_num(pd_ne_tile,2) - pd_tile_num(pd_sw_tile,2) + 1
857 if(
io_l )
write(
io_fid_log,
'(1x,A)')
'*** NEST: target process tile in parent domain' 861 nest_tile_id(k) = pd_sw_tile + (i-1) + parent_prc_num_x(handle)*(j-1)
883 integer,
intent(out) :: tilei, tilej
884 integer,
intent(out) :: cxs, cxe, cys, cye
885 integer,
intent(out) :: pxs, pxe, pys, pye
886 integer,
intent(in) :: iloc
890 integer :: xloc, yloc
891 integer :: xlocg, ylocg
896 yloc = int(
real(iloc-1) /
real(NEST_TILE_NUM_X) ) + 1
897 xlocg = mod( rank, offline_parent_prc_num_x ) + 1
898 ylocg = int(
real(rank) /
real(OFFLINE_PARENT_PRC_NUM_X) ) + 1
902 cxs = tilei * (xloc-1) + 1
904 cys = tilej * (yloc-1) + 1
911 if ( xlocg == 1 )
then 916 if ( xlocg == offline_parent_prc_num_x )
then 919 if ( ylocg == 1 )
then 924 if ( ylocg == offline_parent_prc_num_y )
then 933 subroutine nest_comm_parentsize( &
950 integer,
intent(in) :: HANDLE
953 integer :: datapack(14)
954 integer :: QA_OTHERSIDE
955 integer :: ireq1, ireq2, ierr1, ierr2, ileng
956 integer :: istatus(mpi_status_size)
960 tag = intercomm_id(handle) * 100
984 call mpi_wait(ireq1, istatus, ierr1)
985 call mpi_wait(ireq2, istatus, ierr2)
988 parent_prc_nprocs(handle) = datapack( 1)
989 parent_prc_num_x(handle) = datapack( 2)
990 parent_prc_num_y(handle) = datapack( 3)
1007 call mpi_wait(ireq1, istatus, ierr1)
1008 call mpi_wait(ireq2, istatus, ierr2)
1010 call comm_bcast(datapack, ileng)
1011 call comm_bcast(buffer)
1013 daughter_prc_nprocs(handle) = datapack( 1)
1014 daughter_prc_num_x(handle) = datapack( 2)
1015 daughter_prc_num_y(handle) = datapack( 3)
1019 datr_ks(handle) = datapack( 7)
1020 datr_ke(handle) = datapack( 8)
1021 datr_is(handle) = datapack( 9)
1022 datr_ie(handle) = datapack(10)
1023 datr_js(handle) = datapack(11)
1024 datr_je(handle) = datapack(12)
1026 qa_otherside = datapack(14)
1035 call mpi_wait(ireq1, istatus, ierr1)
1036 call mpi_wait(ireq2, istatus, ierr2)
1038 call comm_bcast(datapack, ileng)
1039 call comm_bcast(buffer)
1041 parent_prc_nprocs(handle) = datapack( 1)
1042 parent_prc_num_x(handle) = datapack( 2)
1043 parent_prc_num_y(handle) = datapack( 3)
1047 prnt_ks(handle) = datapack( 7)
1048 prnt_ke(handle) = datapack( 8)
1049 prnt_is(handle) = datapack( 9)
1050 prnt_ie(handle) = datapack(10)
1051 prnt_js(handle) = datapack(11)
1052 prnt_je(handle) = datapack(12)
1054 qa_otherside = datapack(14)
1077 call mpi_wait(ireq1, istatus, ierr1)
1078 call mpi_wait(ireq2, istatus, ierr2)
1081 daughter_prc_nprocs(handle) = datapack( 1)
1082 daughter_prc_num_x(handle) = datapack( 2)
1083 daughter_prc_num_y(handle) = datapack( 3)
1087 datr_ks(handle) = datapack( 7)
1088 datr_ke(handle) = datapack( 8)
1089 datr_is(handle) = datapack( 9)
1090 datr_ie(handle) = datapack(10)
1091 datr_js(handle) = datapack(11)
1092 datr_je(handle) = datapack(12)
1096 write(*,*)
'xxx internal error [parentsize: nest/grid]' 1101 write(*,*)
'xxx ERROR: NUMBER of QA are not matched! [parentsize: nest/grid]' 1102 write(*,*)
'xxx check a flag of ONLINE_BOUNDARY_USE_QHYD.', qa_otherside,
nest_bnd_qa 1107 end subroutine nest_comm_parentsize
1111 subroutine nest_comm_catalogue( &
1125 integer,
intent(in) :: HANDLE
1127 integer :: ireq, ierr, ileng
1128 integer :: istatus(mpi_status_size)
1132 tag = intercomm_id(handle) * 100
1138 call mpi_wait(ireq, istatus, ierr)
1142 ileng = parent_prc_nprocs(handle) * 4 * 2
1145 call mpi_wait(ireq, istatus, ierr)
1147 call comm_bcast( latlon_catalog, parent_prc_nprocs(handle), 4, 2 )
1149 if(
io_l )
write(*,*)
'xxx internal error [nest/grid]' 1154 end subroutine nest_comm_catalogue
1158 subroutine nest_comm_ping( &
1168 integer,
intent(in) :: HANDLE
1170 integer :: ping, pong
1171 integer :: ireq1, ireq2, ierr1, ierr2
1172 integer :: istatus(mpi_status_size)
1174 logical :: ping_error
1177 tag = intercomm_id(handle) * 100
1178 ping_error = .false.
1187 call mpi_wait(ireq1, istatus, ierr1)
1188 call mpi_wait(ireq2, istatus, ierr2)
1191 call comm_bcast(pong)
1193 if ( pong /= intercomm_id(handle)+1 ) ping_error = .true.
1202 call mpi_wait(ireq1, istatus, ierr1)
1203 call mpi_wait(ireq2, istatus, ierr2)
1206 call comm_bcast(pong)
1208 if ( pong /= intercomm_id(handle) ) ping_error = .true.
1211 if(
io_l )
write(*,*)
'xxx internal error [nest/grid]' 1215 if ( ping_error )
then 1216 if(
io_l )
write(*,*)
'xxx ping destination error [nest/grid]' 1221 end subroutine nest_comm_ping
1225 subroutine nest_comm_setup_nestdown( &
1238 integer,
intent(in) :: HANDLE
1240 integer,
allocatable :: buffer_LIST(:)
1241 integer,
allocatable :: buffer_ALLLIST(:)
1243 integer :: ireq, ierr, ileng
1244 integer :: istatus(mpi_status_size)
1245 integer :: tag, target_rank
1250 tag = intercomm_id(handle) * 100
1257 call mpi_wait(ireq, istatus, ierr)
1259 call comm_bcast(nest_tile_allmax_p)
1261 allocate( nest_tile_list_p(nest_tile_allmax_p,daughter_prc_nprocs(handle)) )
1262 allocate( nest_tile_list_yp(nest_tile_allmax_p*daughter_prc_nprocs(handle)) )
1264 ileng = nest_tile_allmax_p*daughter_prc_nprocs(handle)
1267 call mpi_wait(ireq, istatus, ierr)
1269 call comm_bcast(nest_tile_list_p, nest_tile_allmax_p, daughter_prc_nprocs(handle))
1271 nest_tile_list_yp(:) = -1
1274 do j = 1, daughter_prc_nprocs(handle)
1275 do i = 1, nest_tile_allmax_p
1276 if ( nest_tile_list_p(i,j) ==
prc_myrank )
then 1278 nest_tile_list_yp(k) = j - 1
1284 if(
io_l )
write(
io_fid_log,
'(A,I5,A,I5)')
"[P] Num YP =",num_yp,
" Num TILE(MAX) =",nest_tile_allmax_p
1288 call mpi_wait(ireq, istatus, ierr)
1290 call comm_bcast(online_daughter_use_velz)
1292 if(
io_l )
write(
io_fid_log,
'(1x,A,L2)')
'*** NEST: ONLINE_DAUGHTER_USE_VELZ =', online_daughter_use_velz
1296 call mpi_wait(ireq, istatus, ierr)
1298 call comm_bcast(online_daughter_no_rotate)
1301 write(*,*)
'xxx Flag of NO_ROTATE is not consistent with the child domain' 1303 if(
io_l )
write(
io_fid_log,*)
'xxx ONLINE_DAUGHTER_NO_ROTATE =', online_daughter_no_rotate
1306 if(
io_l )
write(
io_fid_log,
'(1x,A,L2)')
'*** NEST: ONLINE_DAUGHTER_NO_ROTATE =', online_daughter_no_rotate
1308 call nest_comm_importgrid_nestdown( handle )
1311 target_rank = nest_tile_list_yp(i)
1312 call mpi_isend(i, 1, mpi_integer, target_rank, tag+5,
intercomm_daughter, ireq, ierr)
1313 call mpi_wait(ireq, istatus, ierr)
1322 call mpi_allreduce( nest_tile_all, &
1323 nest_tile_allmax_d, &
1329 if(
io_l )
write(
io_fid_log,
'(A,I5,A,I5)')
"[D] Num YP =",nest_tile_all,
" Num TILE(MAX) =",nest_tile_allmax_d
1333 call mpi_wait(ireq, istatus, ierr)
1336 allocate( buffer_list(nest_tile_allmax_d) )
1337 allocate( buffer_alllist(nest_tile_allmax_d*daughter_prc_nprocs(handle)) )
1338 allocate( nest_tile_list_d(nest_tile_allmax_d,daughter_prc_nprocs(handle)) )
1340 do i = 1, nest_tile_allmax_d
1341 if ( i <= nest_tile_all )
then 1348 ileng = nest_tile_allmax_d
1349 call mpi_allgather( buffer_list(:), &
1352 buffer_alllist(:), &
1358 do j = 1, daughter_prc_nprocs(handle)
1359 do i = 1, nest_tile_allmax_d
1360 nest_tile_list_d(i,j) = buffer_alllist(k)
1365 deallocate( buffer_list )
1366 deallocate( buffer_alllist )
1368 ileng = nest_tile_allmax_d*daughter_prc_nprocs(handle)
1371 call mpi_wait(ireq, istatus, ierr)
1376 call mpi_wait(ireq, istatus, ierr)
1381 call mpi_wait(ireq, istatus, ierr)
1383 call comm_bcast(online_daughter_no_rotate)
1385 call nest_comm_importgrid_nestdown( handle )
1387 do i = 1, nest_tile_all
1388 target_rank = nest_tile_list_d(i,
prc_myrank+1)
1389 call mpi_irecv( call_order(i), 1, mpi_integer, target_rank, tag+5,
intercomm_parent, ireq, ierr )
1390 call mpi_wait(ireq, istatus, ierr)
1396 if(
io_l )
write(*,*)
'xxx internal error [nest/grid]' 1400 if( num_yp * 16 > max_rq .OR. nest_tile_all * 16 > max_rq )
then 1401 write(*,*)
'xxx internal error (overflow number of ireq) [nest/grid]' 1402 write(*,*)
' NUM_YP x 16 = ', num_yp * 16
1403 write(*,*)
' NEST_TILE_ALL x 16 = ', nest_tile_all * 16
1404 write(*,*)
' max_rq = ', max_rq
1409 end subroutine nest_comm_setup_nestdown
1413 subroutine nest_comm_importgrid_nestdown( &
1432 integer,
intent(in) :: HANDLE
1434 integer :: ierr, ileng
1435 integer :: istatus(mpi_status_size)
1436 integer :: tag, tagbase, target_rank
1438 integer :: xloc, yloc
1442 real(RP) :: max_ref, max_loc
1447 tagbase = intercomm_id(handle) * 100
1454 target_rank = nest_tile_list_yp(i)
1458 tag = tagbase + tag_lon
1460 call mpi_wait(ireq_p(rq), istatus, ierr)
1464 tag = tagbase + tag_lat
1466 call mpi_wait(ireq_p(rq), istatus, ierr)
1470 tag = tagbase + tag_lonx
1472 call mpi_wait(ireq_p(rq), istatus, ierr)
1476 tag = tagbase + tag_latx
1478 call mpi_wait(ireq_p(rq), istatus, ierr)
1482 tag = tagbase + tag_lony
1484 call mpi_wait(ireq_p(rq), istatus, ierr)
1488 tag = tagbase + tag_laty
1490 call mpi_wait(ireq_p(rq), istatus, ierr)
1494 tag = tagbase + tag_cz
1496 call mpi_wait(ireq_p(rq), istatus, ierr)
1500 tag = tagbase + tag_fz
1502 call mpi_wait(ireq_p(rq), istatus, ierr)
1508 do i = 1, nest_tile_all
1510 target_rank = nest_tile_list_d(i,
prc_myrank+1)
1513 yloc = int(
real(i-1) /
real(NEST_TILE_NUM_X) ) + 1
1522 tag = tagbase + tag_lon
1524 call mpi_wait(ireq_d(rq), istatus, ierr)
1529 tag = tagbase + tag_lat
1531 call mpi_wait(ireq_d(rq), istatus, ierr)
1536 tag = tagbase + tag_lonx
1538 call mpi_wait(ireq_d(rq), istatus, ierr)
1543 tag = tagbase + tag_latx
1545 call mpi_wait(ireq_d(rq), istatus, ierr)
1550 tag = tagbase + tag_lony
1552 call mpi_wait(ireq_d(rq), istatus, ierr)
1557 tag = tagbase + tag_laty
1559 call mpi_wait(ireq_d(rq), istatus, ierr)
1564 tag = tagbase + tag_cz
1566 call mpi_wait(ireq_d(rq), istatus, ierr)
1573 tag = tagbase + tag_fz
1575 call mpi_wait(ireq_d(rq), istatus, ierr)
1582 max_ref = maxval( buffer_ref_fz(:,:,:) )
1584 if ( max_ref < max_loc )
then 1585 write(*,*)
'xxx ERROR: REQUESTED DOMAIN IS TOO MUCH BROAD' 1586 write(*,*)
'xxx -- VERTICAL direction over the limit' 1587 write(*,*)
'xxx -- reference max: ', max_ref
1588 write(*,*)
'xxx -- local max: ', max_loc
1594 write(*,*)
'xxx internal error [nest/grid]' 1599 end subroutine nest_comm_importgrid_nestdown
1612 interped_ref_DENS, & ! [inout]
1613 interped_ref_VELZ, & ! [inout]
1614 interped_ref_VELX, & ! [inout]
1615 interped_ref_VELY, & ! [inout]
1616 interped_ref_POTT, & ! [inout]
1631 integer,
intent(in) :: HANDLE
1632 integer,
intent(in) :: BND_QA
1648 real(RP) :: dummy(1,1,1)
1658 real(RP) :: u_on_map, v_on_map
1660 integer :: tagbase, tagcomm
1661 integer :: isu_tag, isu_tagf
1662 integer :: i, j, k, iq
1664 integer,
parameter :: cosin = 1
1665 integer,
parameter :: sine = 2
1668 if ( bnd_qa > i_bndqa )
then 1669 if(
io_l )
write(*,*)
'xxx internal error: BND_QA is larger than I_BNDQA [nest/grid]' 1672 if ( bnd_qa > max_bndqa )
then 1673 if(
io_l )
write(*,*)
'xxx internal error: BND_QA is larger than max_bndqa [nest/grid]' 1677 tagcomm = intercomm_id(handle) * order_tag_comm
1684 if(
io_l )
write(
io_fid_log,
'(1X,A,I5,A)')
"*** NestIDC [P]: que send ( ", nsend,
" )" 1689 org_dens(:,:,:) = ipt_dens(:,:,:)
1690 org_momz(:,:,:) = ipt_momz(:,:,:)
1691 org_momx(:,:,:) = ipt_momx(:,:,:)
1692 org_momy(:,:,:) = ipt_momy(:,:,:)
1693 org_rhot(:,:,:) = ipt_rhot(:,:,:)
1695 org_qtrc(:,:,:,iq) = ipt_qtrc(:,:,:,iq)
1703 if ( .NOT. online_daughter_no_rotate )
then 1708 work1p(k,i,j) = ( org_momx(k,i-1,j) + org_momx(k,i,j) ) * 0.5_rp
1714 work1p(k,1,j) = org_momx(k,1,j)
1717 call comm_vars8( work1p(:,:,:), 1 )
1721 work2p(k,i,j) = ( org_momy(k,i,j-1) + org_momy(k,i,j) ) * 0.5_rp
1727 work2p(k,i,1) = org_momy(k,i,1)
1730 call comm_vars8( work2p(:,:,:), 2 )
1731 call comm_wait ( work1p(:,:,:), 1, .false. )
1732 call comm_wait ( work2p(:,:,:), 2, .false. )
1738 u_on_map = work1p(k,i,j) / org_dens(k,i,j)
1739 v_on_map = work2p(k,i,j) / org_dens(k,i,j)
1741 u_llp(k,i,j) = u_on_map * rotc(i,j,cosin) - v_on_map * rotc(i,j,sine )
1742 v_llp(k,i,j) = u_on_map * rotc(i,j,sine ) + v_on_map * rotc(i,j,cosin)
1748 tagbase = tagcomm + tag_dens*order_tag_var
1749 call nest_comm_intercomm_nestdown( org_dens, dummy, tagbase, i_sclr, handle, isu_tag, isu_tagf, .true. )
1751 tagbase = tagcomm + tag_momz*order_tag_var
1752 if ( online_daughter_use_velz )
then 1753 call nest_comm_intercomm_nestdown( org_momz, dummy, tagbase, i_zstg, handle, isu_tag, isu_tagf )
1756 tagbase = tagcomm + tag_momx*order_tag_var
1757 if ( online_daughter_no_rotate )
then 1758 call nest_comm_intercomm_nestdown( org_momx, dummy, tagbase, i_xstg, handle, isu_tag, isu_tagf )
1760 call nest_comm_intercomm_nestdown( u_llp, dummy, tagbase, i_sclr, handle, isu_tag, isu_tagf )
1763 tagbase = tagcomm + tag_momy*order_tag_var
1764 if ( online_daughter_no_rotate )
then 1765 call nest_comm_intercomm_nestdown( org_momy, dummy, tagbase, i_ystg, handle, isu_tag, isu_tagf )
1767 call nest_comm_intercomm_nestdown( v_llp, dummy, tagbase, i_sclr, handle, isu_tag, isu_tagf )
1770 tagbase = tagcomm + tag_rhot*order_tag_var
1771 call nest_comm_intercomm_nestdown( org_rhot, dummy, tagbase, i_sclr, handle, isu_tag, isu_tagf )
1774 tagbase = tagcomm + (tag_qx*10+iq)*order_tag_var
1775 call nest_comm_intercomm_nestdown( org_qtrc(:,:,:,iq), dummy, tagbase, i_sclr, handle, isu_tag, isu_tagf )
1788 nwait_d = nwait_d + 1
1800 if ( online_aggressive_comm )
then 1809 tagbase = tagcomm + tag_dens*order_tag_var
1810 call nest_comm_intercomm_nestdown( dummy, dens, tagbase, i_sclr, handle, isu_tag, isu_tagf, .true. )
1815 interped_ref_dens(k,i,j) = dens(k,i,j)
1820 call comm_vars8( interped_ref_dens, 1 )
1822 tagbase = tagcomm + tag_momz*order_tag_var
1824 call nest_comm_intercomm_nestdown( dummy, work1d, tagbase, i_zstg, handle, isu_tag, isu_tagf )
1829 interped_ref_velz(k,i,j) = work1d(k,i,j) / ( dens(k,i,j) + dens(k+1,i,j) ) * 2.0_rp
1835 tagbase = tagcomm + tag_momx*order_tag_var
1838 call nest_comm_intercomm_nestdown( dummy, u_lld, tagbase, i_xstg, handle, isu_tag, isu_tagf )
1841 call nest_comm_intercomm_nestdown( dummy, u_lld, tagbase, i_sclr, handle, isu_tag, isu_tagf )
1844 tagbase = tagcomm + tag_momy*order_tag_var
1847 call nest_comm_intercomm_nestdown( dummy, v_lld, tagbase, i_ystg, handle, isu_tag, isu_tagf )
1850 call nest_comm_intercomm_nestdown( dummy, v_lld, tagbase, i_sclr, handle, isu_tag, isu_tagf )
1853 call comm_wait ( interped_ref_dens, 1, .false. )
1859 interped_ref_velx(k,i,j) = u_lld(k,i,j) &
1860 / ( interped_ref_dens(k,i+1,j) + interped_ref_dens(k,i,j) ) * 2.0_rp
1870 call comm_vars8( interped_ref_velx, 2 )
1874 interped_ref_vely(k,i,j) = v_lld(k,i,j) &
1875 / ( interped_ref_dens(k,i,j+1) + interped_ref_dens(k,i,j) ) * 2.0_rp
1885 call comm_vars8( interped_ref_vely, 3 )
1886 call comm_wait ( interped_ref_velx, 2, .false. )
1887 call comm_wait ( interped_ref_vely, 3, .false. )
1893 work1d(k,i,j) = u_lld(k,i,j) * rotc(i,j,cosin) + v_lld(k,i,j) * rotc(i,j,sine )
1894 work2d(k,i,j) = - u_lld(k,i,j) * rotc(i,j,sine ) + v_lld(k,i,j) * rotc(i,j,cosin)
1903 interped_ref_velx(k,i,j) = ( work1d(k,i+1,j) + work1d(k,i,j) ) * 0.5_rp
1912 call comm_vars8( interped_ref_velx, 2 )
1916 interped_ref_vely(k,i,j) = ( work2d(k,i,j+1) + work2d(k,i,j) ) * 0.5_rp
1925 call comm_vars8( interped_ref_vely, 3 )
1926 call comm_wait ( interped_ref_velx, 2, .false. )
1927 call comm_wait ( interped_ref_vely, 3, .false. )
1930 tagbase = tagcomm + tag_rhot*order_tag_var
1931 call nest_comm_intercomm_nestdown( dummy, work1d, tagbase, i_sclr, handle, isu_tag, isu_tagf )
1935 interped_ref_pott(k,i,j) = work1d(k,i,j) / interped_ref_dens(k,i,j)
1941 tagbase = tagcomm + (tag_qx*10+iq)*order_tag_var
1942 call nest_comm_intercomm_nestdown( dummy, work1d, tagbase, i_sclr, handle, isu_tag, isu_tagf )
1946 interped_ref_qtrc(k,i,j,iq) = work1d(k,i,j)
1956 write(*,*)
'xxx internal error [nestdown: nest/grid]' 1972 integer,
intent(in) :: HANDLE
1973 integer,
intent(in) :: BND_QA
1975 integer :: isu_tag, isu_tagf
1976 integer :: tagbase, tagcomm
1981 if ( bnd_qa > i_bndqa )
then 1982 write(*,*)
'xxx internal error: about BND_QA [nest/grid]' 1986 tagcomm = intercomm_id(handle) * order_tag_comm
1991 nwait_p = nwait_p + 1
1995 call nest_comm_issuer_of_wait( handle )
1997 if ( online_aggressive_comm )
then 2010 if(
io_l )
write(
io_fid_log,
'(1X,A,I5,A)')
"*** NestIDC [C]: que recv ( ", nrecv,
" )" 2019 tagbase = tagcomm + tag_dens*order_tag_var
2020 call nest_comm_issuer_of_receive( tagbase, i_sclr, handle, isu_tag, isu_tagf, .true. )
2022 tagbase = tagcomm + tag_momz*order_tag_var
2024 call nest_comm_issuer_of_receive( tagbase, i_zstg, handle, isu_tag, isu_tagf )
2027 tagbase = tagcomm + tag_momx*order_tag_var
2029 call nest_comm_issuer_of_receive( tagbase, i_xstg, handle, isu_tag, isu_tagf )
2031 call nest_comm_issuer_of_receive( tagbase, i_sclr, handle, isu_tag, isu_tagf )
2034 tagbase = tagcomm + tag_momy*order_tag_var
2036 call nest_comm_issuer_of_receive( tagbase, i_ystg, handle, isu_tag, isu_tagf )
2038 call nest_comm_issuer_of_receive( tagbase, i_sclr, handle, isu_tag, isu_tagf )
2041 tagbase = tagcomm + tag_rhot*order_tag_var
2042 call nest_comm_issuer_of_receive( tagbase, i_sclr, handle, isu_tag, isu_tagf )
2045 tagbase = tagcomm + (tag_qx*10+iq)*order_tag_var
2046 call nest_comm_issuer_of_receive( tagbase, i_sclr, handle, isu_tag, isu_tagf )
2053 write(*,*)
'xxx internal error [issue: nest/grid]' 2070 integer,
intent(in) :: HANDLE
2085 if(
io_l )
write(
io_fid_log,
'(1X,A,I5,A)')
"*** NestIDC [C]: CANCEL recv ( ", nrecv,
" )" 2087 if ( ireq_d(rq) /= mpi_request_null )
then 2088 call mpi_cancel(ireq_d(rq), ierr)
2097 write(*,*)
'xxx internal error [cancel: nest/grid]' 2112 isu_tag, & ! [inout]
2113 isu_tagf, & ! [inout]
2125 real(RP),
intent(in) :: pvar(:,:,:)
2126 real(RP),
intent(out) :: dvar(:,:,:)
2127 integer ,
intent(in) :: tagbase
2128 integer ,
intent(in) :: id_stag
2129 integer ,
intent(in) :: HANDLE
2130 integer ,
intent(inout) :: isu_tag
2131 integer ,
intent(inout) :: isu_tagf
2133 logical ,
intent(in),
optional :: flag_dens
2135 integer :: ierr, ileng
2136 integer :: tag, target_rank
2138 integer :: xloc, yloc
2143 integer :: ig, rq, yp
2144 logical :: no_zstag = .true.
2145 logical :: logarithmic = .false.
2147 logarithmic = .false.
2148 if (
present(flag_dens) )
then 2149 if ( flag_dens )
then 2150 logarithmic = .true.
2154 if ( id_stag == i_sclr )
then 2157 elseif ( id_stag == i_zstg )
then 2160 elseif ( id_stag == i_xstg )
then 2163 elseif ( id_stag == i_ystg )
then 2168 if ( no_zstag )
then 2183 target_rank = nest_tile_list_yp(yp)
2187 dvar(:,:,:) = -1.0_rp
2197 do yp = 1, nest_tile_all
2201 yloc = int(
real(yp-1) /
real(NEST_TILE_NUM_X) ) + 1
2208 if ( no_zstag )
then 2209 isu_tag = isu_tag + 1
2211 if ( .NOT. logarithmic )
then 2215 buffer_ref_3d(k,xs:xe,ys:ye) &
2222 buffer_ref_3d(k,xs:xe,ys:ye) &
2227 isu_tagf = isu_tagf + 1
2230 buffer_ref_3df(k,xs:xe,ys:ye) &
2235 if ( isu_tag > max_isu .OR. isu_tagf > max_isuf )
then 2236 write(*,*)
'xxx Exceeded maximum issue [intercomm: nest/grid]' 2237 write(*,*)
'xxx isu_tag = ', isu_tag
2238 write(*,*)
'xxx isu_tagf = ', isu_tagf
2246 dvar(:,:,:) = 0.0_rp
2248 if ( no_zstag )
then 2252 vfact(:,:,:,:,:,ig), &
2253 kgrd(:,:,:,:,:,ig), &
2266 vfact(:,:,:,:,:,ig), &
2267 kgrd(:,:,:,:,:,ig), &
2278 write(*,*)
'xxx internal error [nest/grid]' 2291 isu_tag, & ! [inout]
2292 isu_tagf, & ! [inout]
2302 integer ,
intent(in) :: tagbase
2303 integer ,
intent(in) :: id_stag
2304 integer ,
intent(in) :: HANDLE
2305 integer ,
intent(inout) :: isu_tag
2306 integer ,
intent(inout) :: isu_tagf
2307 logical ,
intent(in),
optional :: flag_dens
2309 integer :: ierr, ileng
2310 integer :: tag, target_rank
2312 integer :: ig, rq, yp
2313 logical :: no_zstag = .true.
2314 logical :: logarithmic = .false.
2317 logarithmic = .false.
2318 if (
present(flag_dens) )
then 2319 if ( flag_dens )
then 2320 logarithmic = .true.
2324 if ( id_stag == i_sclr )
then 2327 elseif ( id_stag == i_zstg )
then 2330 elseif ( id_stag == i_xstg )
then 2333 elseif ( id_stag == i_ystg )
then 2338 if ( no_zstag )
then 2354 do yp = 1, nest_tile_all
2357 target_rank = nest_tile_list_d(yp,
prc_myrank+1)
2359 tag = tagbase + call_order(yp)
2360 if ( no_zstag )
then 2361 isu_tag = isu_tag + 1
2362 recvbuf_3d(:,:,:,isu_tag) = 0.0_rp
2363 call mpi_irecv( recvbuf_3d(:,:,:,isu_tag), &
2372 isu_tagf = isu_tagf + 1
2373 recvbuf_3df(:,:,:,isu_tagf) = 0.0_rp
2374 call mpi_irecv( recvbuf_3df(:,:,:,isu_tagf), &
2386 if ( isu_tag > max_isu .OR. isu_tagf > max_isuf )
then 2387 write(*,*)
'xxx Exceeded maximum issue [receive: nest/grid]' 2388 write(*,*)
'xxx isu_tag = ', isu_tag
2389 write(*,*)
'xxx isu_tagf = ', isu_tagf
2397 write(*,*)
'xxx internal error [receive: nest/grid]' 2412 integer,
intent(in) :: HANDLE
2425 write(*,*)
'xxx internal error [wait: nest/grid]' 2441 integer,
intent(in) :: req_count
2442 integer,
intent(inout) :: ireq(max_rq)
2446 integer :: istatus(mpi_status_size,req_count)
2447 integer :: req_count2
2448 integer :: ireq2(max_rq)
2458 if (ireq(i) /= mpi_request_null)
then 2459 req_count2 = req_count2 + 1
2460 ireq2(req_count2) = ireq(i)
2463 if ( req_count2 /= 0 )
call mpi_waitall( req_count2, ireq2, istatus, ierr )
2487 integer,
intent(in) :: HANDLE
2489 integer :: istatus(mpi_status_size)
2497 if ( rq_ctl_p > 0 )
call mpi_test(ireq_p(1), flag, istatus, ierr)
2503 if ( rq_ctl_d > 0 )
call mpi_test(ireq_d(1), flag, istatus, ierr)
2507 write(*,*)
'xxx internal error [test: nest/grid]' 2524 if(
io_l )
write(
io_fid_log,
'(1x,A)')
'*** Waiting finish of whole processes' 2531 if(
io_l )
write(
io_fid_log,
'(1x,A)')
'*** Disconnected communication with child' 2538 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)