24 use mom_coms, only : broadcast, sum_across_pes, min_across_pes, max_across_pes
30 use mpp_domains_mod
, only : mpp_define_layout, mpp_get_boundary
31 use mpp_domains_mod
, only : mom_define_io_domain => mpp_define_io_domain
32 use mpp_domains_mod
, only : mom_define_domain => mpp_define_domains
33 use mpp_domains_mod
, only : domain2d, domain1d, mpp_get_data_domain
34 use mpp_domains_mod
, only : mpp_get_compute_domain, mpp_get_global_domain
35 use mpp_domains_mod
, only : global_field_sum => mpp_global_sum
36 use mpp_domains_mod
, only : mpp_update_domains, cyclic_global_domain, fold_north_edge
37 use mpp_domains_mod
, only : mpp_start_update_domains, mpp_complete_update_domains
38 use mpp_domains_mod
, only : mpp_create_group_update, mpp_do_group_update
39 use mpp_domains_mod
, only : group_pass_type => mpp_group_update_type
40 use mpp_domains_mod
, only : mpp_reset_group_update_field
41 use mpp_domains_mod
, only : mpp_group_update_initialized
42 use mpp_domains_mod
, only : mpp_start_group_update, mpp_complete_group_update
43 use mpp_domains_mod
, only : compute_block_extent => mpp_compute_block_extent
44 use mpp_parameter_mod
, only : agrid, bgrid_ne, cgrid_ne, scalar_pair, bitwise_exact_sum, corner
45 use mpp_parameter_mod
, only : to_east => wupdate, to_west => eupdate, omit_corners => edgeupdate
46 use mpp_parameter_mod
, only : to_north => supdate, to_south => nupdate
47 use fms_io_mod
, only : file_exist, parse_mask_table
49 implicit none ;
private 58 public :: global_field_sum, sum_across_pes, min_across_pes, max_across_pes
59 public :: agrid, bgrid_ne, cgrid_ne, scalar_pair, bitwise_exact_sum, corner
60 public :: to_east, to_west, to_north, to_south,
to_all, omit_corners
63 public :: compute_block_extent
107 type(domain2d),
pointer :: mpp_domain => null()
115 logical :: nonblocking_updates
117 logical :: thin_halo_updates
124 integer :: io_layout(2)
129 logical :: use_io_layout
130 logical,
pointer :: maskmap(:,:) => null()
138 integer,
parameter ::
to_all = to_east + to_west + to_north + to_south
143 subroutine pass_var_3d(array, MOM_dom, sideflag, complete, position, halo)
144 real,
dimension(:,:,:),
intent(inout) :: array
149 integer,
optional,
intent(in) :: sideflag
153 logical,
optional,
intent(in) :: complete
157 integer,
optional,
intent(in) :: position
160 integer,
optional,
intent(in) :: halo
178 logical :: block_til_complete
181 if (
present(sideflag))
then ;
if (sideflag > 0) dirflag = sideflag ;
endif 182 block_til_complete = .true.
183 if (
present(complete)) block_til_complete = complete
185 if (
present(halo) .and. mom_dom%thin_halo_updates)
then 186 call mpp_update_domains(array, mom_dom%mpp_domain, flags=dirflag, &
187 complete=block_til_complete, position=position, &
188 whalo=halo, ehalo=halo, shalo=halo, nhalo=halo)
190 call mpp_update_domains(array, mom_dom%mpp_domain, flags=dirflag, &
191 complete=block_til_complete, position=position)
197 subroutine pass_var_2d(array, MOM_dom, sideflag, complete, position, halo)
198 real,
dimension(:,:),
intent(inout) :: array
202 integer,
optional,
intent(in) :: sideflag
206 logical,
optional,
intent(in) :: complete
210 integer,
optional,
intent(in) :: position
213 integer,
optional,
intent(in) :: halo
232 logical :: block_til_complete
235 if (
present(sideflag))
then ;
if (sideflag > 0) dirflag = sideflag ;
endif 236 block_til_complete = .true.
237 if (
present(complete)) block_til_complete = complete
239 if (
present(halo) .and. mom_dom%thin_halo_updates)
then 240 call mpp_update_domains(array, mom_dom%mpp_domain, flags=dirflag, &
241 complete=block_til_complete, position=position, &
242 whalo=halo, ehalo=halo, shalo=halo, nhalo=halo)
244 call mpp_update_domains(array, mom_dom%mpp_domain, flags=dirflag, &
245 complete=block_til_complete, position=position)
251 real,
dimension(:,:),
intent(inout) :: array
256 integer,
optional,
intent(in) :: sideflag
260 integer,
optional,
intent(in) :: position
263 logical,
optional,
intent(in) :: complete
267 integer,
optional,
intent(in) :: halo
269 integer :: pass_var_start_2d
290 if (
present(sideflag))
then ;
if (sideflag > 0) dirflag = sideflag ;
endif 292 if (
present(halo) .and. mom_dom%thin_halo_updates)
then 293 pass_var_start_2d = mpp_start_update_domains(array, mom_dom%mpp_domain, &
294 flags=dirflag, position=position, &
295 whalo=halo, ehalo=halo, shalo=halo, nhalo=halo)
297 pass_var_start_2d = mpp_start_update_domains(array, mom_dom%mpp_domain, &
298 flags=dirflag, position=position)
303 real,
dimension(:,:,:),
intent(inout) :: array
308 integer,
optional,
intent(in) :: sideflag
312 integer,
optional,
intent(in) :: position
315 logical,
optional,
intent(in) :: complete
319 integer,
optional,
intent(in) :: halo
321 integer :: pass_var_start_3d
342 if (
present(sideflag))
then ;
if (sideflag > 0) dirflag = sideflag ;
endif 344 if (
present(halo) .and. mom_dom%thin_halo_updates)
then 345 pass_var_start_3d = mpp_start_update_domains(array, mom_dom%mpp_domain, &
346 flags=dirflag, position=position, &
347 whalo=halo, ehalo=halo, shalo=halo, nhalo=halo)
349 pass_var_start_3d = mpp_start_update_domains(array, mom_dom%mpp_domain, &
350 flags=dirflag, position=position)
356 integer,
intent(in) :: id_update
359 real,
dimension(:,:),
intent(inout) :: array
364 integer,
optional,
intent(in) :: sideflag
368 integer,
optional,
intent(in) :: position
371 integer,
optional,
intent(in) :: halo
390 if (
present(sideflag))
then ;
if (sideflag > 0) dirflag = sideflag ;
endif 392 if (
present(halo) .and. mom_dom%thin_halo_updates)
then 393 call mpp_complete_update_domains(id_update, array, mom_dom%mpp_domain, &
394 flags=dirflag, position=position, &
395 whalo=halo, ehalo=halo, shalo=halo, nhalo=halo)
397 call mpp_complete_update_domains(id_update, array, mom_dom%mpp_domain, &
398 flags=dirflag, position=position)
405 integer,
intent(in) :: id_update
408 real,
dimension(:,:,:),
intent(inout) :: array
413 integer,
optional,
intent(in) :: sideflag
417 integer,
optional,
intent(in) :: position
420 integer,
optional,
intent(in) :: halo
439 if (
present(sideflag))
then ;
if (sideflag > 0) dirflag = sideflag ;
endif 441 if (
present(halo) .and. mom_dom%thin_halo_updates)
then 442 call mpp_complete_update_domains(id_update, array, mom_dom%mpp_domain, &
443 flags=dirflag, position=position, &
444 whalo=halo, ehalo=halo, shalo=halo, nhalo=halo)
446 call mpp_complete_update_domains(id_update, array, mom_dom%mpp_domain, &
447 flags=dirflag, position=position)
453 subroutine pass_vector_2d(u_cmpt, v_cmpt, MOM_dom, direction, stagger, complete, halo)
454 real,
dimension(:,:),
intent(inout) :: u_cmpt
457 real,
dimension(:,:),
intent(inout) :: v_cmpt
463 integer,
optional,
intent(in) :: direction
469 integer,
optional,
intent(in) :: stagger
472 logical,
optional,
intent(in) :: complete
475 integer,
optional,
intent(in) :: halo
500 integer :: stagger_local
502 logical :: block_til_complete
504 stagger_local = cgrid_ne
505 if (
present(stagger)) stagger_local = stagger
508 if (
present(direction))
then ;
if (direction > 0) dirflag = direction ;
endif 509 block_til_complete = .true.
510 if (
present(complete)) block_til_complete = complete
512 if (
present(halo) .and. mom_dom%thin_halo_updates)
then 513 call mpp_update_domains(u_cmpt, v_cmpt, mom_dom%mpp_domain, flags=dirflag, &
514 gridtype=stagger_local, complete = block_til_complete, &
515 whalo=halo, ehalo=halo, shalo=halo, nhalo=halo)
517 call mpp_update_domains(u_cmpt, v_cmpt, mom_dom%mpp_domain, flags=dirflag, &
518 gridtype=stagger_local, complete = block_til_complete)
525 real,
dimension(:,:),
intent(inout) :: u_cmpt
528 real,
dimension(:,:),
intent(inout) :: v_cmpt
534 integer,
optional,
intent(in) :: stagger
537 logical,
optional,
intent(in) :: scalar
550 integer :: stagger_local
552 integer :: i, j, isc, iec, jsc, jec, isd, ied, jsd, jed, IscB, IecB, JscB, JecB
553 real,
allocatable,
dimension(:) :: sbuff_x, sbuff_y, wbuff_x, wbuff_y
554 logical :: block_til_complete
556 if (.not. mom_dom%symmetric)
return 558 stagger_local = cgrid_ne
559 if (
present(stagger)) stagger_local = stagger
561 if (.not.(stagger_local == cgrid_ne .or. stagger_local == bgrid_ne))
return 563 call mpp_get_compute_domain(mom_dom%mpp_domain, isc, iec, jsc, jec)
564 call mpp_get_data_domain(mom_dom%mpp_domain, isd, ied, jsd, jed)
568 isc = isc - (isd-1) ; iec = iec - (isd-1)
569 jsc = jsc - (jsd-1) ; jec = jec - (jsd-1)
570 iscb = isc ; iecb = iec+1 ; jscb = jsc ; jecb = jec+1
573 if (
present(scalar))
then ;
if (scalar) dirflag =
to_all+scalar_pair ;
endif 575 if (stagger_local == cgrid_ne)
then 576 allocate(wbuff_x(jsc:jec)) ;
allocate(sbuff_y(isc:iec))
577 wbuff_x(:) = 0.0 ; sbuff_y(:) = 0.0
578 call mpp_get_boundary(u_cmpt, v_cmpt, mom_dom%mpp_domain, flags=dirflag, &
579 wbufferx=wbuff_x, sbuffery=sbuff_y, &
582 v_cmpt(i,jscb) = sbuff_y(i)
585 u_cmpt(iscb,j) = wbuff_x(j)
587 deallocate(wbuff_x) ;
deallocate(sbuff_y)
588 elseif (stagger_local == bgrid_ne)
then 589 allocate(wbuff_x(jscb:jecb)) ;
allocate(sbuff_x(iscb:iecb))
590 allocate(wbuff_y(jscb:jecb)) ;
allocate(sbuff_y(iscb:iecb))
591 wbuff_x(:) = 0.0 ; wbuff_y(:) = 0.0 ; sbuff_x(:) = 0.0 ; sbuff_y(:) = 0.0
592 call mpp_get_boundary(u_cmpt, v_cmpt, mom_dom%mpp_domain, flags=dirflag, &
593 wbufferx=wbuff_x, sbufferx=sbuff_x, &
594 wbuffery=wbuff_y, sbuffery=sbuff_y, &
597 u_cmpt(i,jscb) = sbuff_x(i) ; v_cmpt(i,jscb) = sbuff_y(i)
600 u_cmpt(iscb,j) = wbuff_x(j) ; v_cmpt(iscb,j) = wbuff_y(j)
602 deallocate(wbuff_x) ;
deallocate(sbuff_x)
603 deallocate(wbuff_y) ;
deallocate(sbuff_y)
609 subroutine pass_vector_3d(u_cmpt, v_cmpt, MOM_dom, direction, stagger, complete, halo)
610 real,
dimension(:,:,:),
intent(inout) :: u_cmpt
613 real,
dimension(:,:,:),
intent(inout) :: v_cmpt
619 integer,
optional,
intent(in) :: direction
625 integer,
optional,
intent(in) :: stagger
628 logical,
optional,
intent(in) :: complete
631 integer,
optional,
intent(in) :: halo
656 integer :: stagger_local
658 logical :: block_til_complete
660 stagger_local = cgrid_ne
661 if (
present(stagger)) stagger_local = stagger
664 if (
present(direction))
then ;
if (direction > 0) dirflag = direction ;
endif 665 block_til_complete = .true.
666 if (
present(complete)) block_til_complete = complete
668 if (
present(halo) .and. mom_dom%thin_halo_updates)
then 669 call mpp_update_domains(u_cmpt, v_cmpt, mom_dom%mpp_domain, flags=dirflag, &
670 gridtype=stagger_local, complete = block_til_complete, &
671 whalo=halo, ehalo=halo, shalo=halo, nhalo=halo)
673 call mpp_update_domains(u_cmpt, v_cmpt, mom_dom%mpp_domain, flags=dirflag, &
674 gridtype=stagger_local, complete = block_til_complete)
680 real,
dimension(:,:),
intent(inout) :: u_cmpt
683 real,
dimension(:,:),
intent(inout) :: v_cmpt
689 integer,
optional,
intent(in) :: direction
695 integer,
optional,
intent(in) :: stagger
698 logical,
optional,
intent(in) :: complete
701 integer,
optional,
intent(in) :: halo
703 integer :: pass_vector_start_2d
729 integer :: stagger_local
732 stagger_local = cgrid_ne
733 if (
present(stagger)) stagger_local = stagger
736 if (
present(direction))
then ;
if (direction > 0) dirflag = direction ;
endif 738 if (
present(halo) .and. mom_dom%thin_halo_updates)
then 739 pass_vector_start_2d = mpp_start_update_domains(u_cmpt, v_cmpt, &
740 mom_dom%mpp_domain, flags=dirflag, gridtype=stagger_local, &
741 whalo=halo, ehalo=halo, shalo=halo, nhalo=halo)
743 pass_vector_start_2d = mpp_start_update_domains(u_cmpt, v_cmpt, &
744 mom_dom%mpp_domain, flags=dirflag, gridtype=stagger_local)
750 real,
dimension(:,:,:),
intent(inout) :: u_cmpt
753 real,
dimension(:,:,:),
intent(inout) :: v_cmpt
759 integer,
optional,
intent(in) :: direction
765 integer,
optional,
intent(in) :: stagger
768 logical,
optional,
intent(in) :: complete
771 integer,
optional,
intent(in) :: halo
773 integer :: pass_vector_start_3d
799 integer :: stagger_local
802 stagger_local = cgrid_ne
803 if (
present(stagger)) stagger_local = stagger
806 if (
present(direction))
then ;
if (direction > 0) dirflag = direction ;
endif 808 if (
present(halo) .and. mom_dom%thin_halo_updates)
then 809 pass_vector_start_3d = mpp_start_update_domains(u_cmpt, v_cmpt, &
810 mom_dom%mpp_domain, flags=dirflag, gridtype=stagger_local, &
811 whalo=halo, ehalo=halo, shalo=halo, nhalo=halo)
813 pass_vector_start_3d = mpp_start_update_domains(u_cmpt, v_cmpt, &
814 mom_dom%mpp_domain, flags=dirflag, gridtype=stagger_local)
821 integer,
intent(in) :: id_update
824 real,
dimension(:,:),
intent(inout) :: u_cmpt
827 real,
dimension(:,:),
intent(inout) :: v_cmpt
833 integer,
optional,
intent(in) :: direction
839 integer,
optional,
intent(in) :: stagger
842 integer,
optional,
intent(in) :: halo
866 integer :: stagger_local
869 stagger_local = cgrid_ne
870 if (
present(stagger)) stagger_local = stagger
873 if (
present(direction))
then ;
if (direction > 0) dirflag = direction ;
endif 875 if (
present(halo) .and. mom_dom%thin_halo_updates)
then 876 call mpp_complete_update_domains(id_update, u_cmpt, v_cmpt, &
877 mom_dom%mpp_domain, flags=dirflag, gridtype=stagger_local, &
878 whalo=halo, ehalo=halo, shalo=halo, nhalo=halo)
880 call mpp_complete_update_domains(id_update, u_cmpt, v_cmpt, &
881 mom_dom%mpp_domain, flags=dirflag, gridtype=stagger_local)
888 integer,
intent(in) :: id_update
891 real,
dimension(:,:,:),
intent(inout) :: u_cmpt
894 real,
dimension(:,:,:),
intent(inout) :: v_cmpt
900 integer,
optional,
intent(in) :: direction
906 integer,
optional,
intent(in) :: stagger
909 integer,
optional,
intent(in) :: halo
933 integer :: stagger_local
936 stagger_local = cgrid_ne
937 if (
present(stagger)) stagger_local = stagger
940 if (
present(direction))
then ;
if (direction > 0) dirflag = direction ;
endif 942 if (
present(halo) .and. mom_dom%thin_halo_updates)
then 943 call mpp_complete_update_domains(id_update, u_cmpt, v_cmpt, &
944 mom_dom%mpp_domain, flags=dirflag, gridtype=stagger_local, &
945 whalo=halo, ehalo=halo, shalo=halo, nhalo=halo)
947 call mpp_complete_update_domains(id_update, u_cmpt, v_cmpt, &
948 mom_dom%mpp_domain, flags=dirflag, gridtype=stagger_local)
956 type(group_pass_type),
intent(inout) :: group
959 real,
dimension(:,:),
intent(inout) :: array
964 integer,
optional,
intent(in) :: sideflag
968 integer,
optional,
intent(in) :: position
971 integer,
optional,
intent(in) :: halo
991 if (
present(sideflag))
then ;
if (sideflag > 0) dirflag = sideflag ;
endif 993 if (mpp_group_update_initialized(group))
then 994 call mpp_reset_group_update_field(group,array)
995 elseif (
present(halo) .and. mom_dom%thin_halo_updates)
then 996 call mpp_create_group_update(group, array, mom_dom%mpp_domain, flags=dirflag, &
997 position=position, whalo=halo, ehalo=halo, &
998 shalo=halo, nhalo=halo)
1000 call mpp_create_group_update(group, array, mom_dom%mpp_domain, flags=dirflag, &
1008 type(group_pass_type),
intent(inout) :: group
1011 real,
dimension(:,:,:),
intent(inout) :: array
1016 integer,
optional,
intent(in) :: sideflag
1020 integer,
optional,
intent(in) :: position
1023 integer,
optional,
intent(in) :: halo
1043 if (
present(sideflag))
then ;
if (sideflag > 0) dirflag = sideflag ;
endif 1045 if (mpp_group_update_initialized(group))
then 1046 call mpp_reset_group_update_field(group,array)
1047 elseif (
present(halo) .and. mom_dom%thin_halo_updates)
then 1048 call mpp_create_group_update(group, array, mom_dom%mpp_domain, flags=dirflag, &
1049 position=position, whalo=halo, ehalo=halo, &
1050 shalo=halo, nhalo=halo)
1052 call mpp_create_group_update(group, array, mom_dom%mpp_domain, flags=dirflag, &
1060 type(group_pass_type),
intent(inout) :: group
1063 real,
dimension(:,:),
intent(inout) :: u_cmpt
1066 real,
dimension(:,:),
intent(inout) :: v_cmpt
1073 integer,
optional,
intent(in) :: direction
1079 integer,
optional,
intent(in) :: stagger
1082 integer,
optional,
intent(in) :: halo
1106 integer :: stagger_local
1109 stagger_local = cgrid_ne
1110 if (
present(stagger)) stagger_local = stagger
1113 if (
present(direction))
then ;
if (direction > 0) dirflag = direction ;
endif 1115 if (mpp_group_update_initialized(group))
then 1116 call mpp_reset_group_update_field(group,u_cmpt, v_cmpt)
1117 elseif (
present(halo) .and. mom_dom%thin_halo_updates)
then 1118 call mpp_create_group_update(group, u_cmpt, v_cmpt, mom_dom%mpp_domain, &
1119 flags=dirflag, gridtype=stagger_local, whalo=halo, ehalo=halo, &
1120 shalo=halo, nhalo=halo)
1122 call mpp_create_group_update(group, u_cmpt, v_cmpt, mom_dom%mpp_domain, &
1123 flags=dirflag, gridtype=stagger_local)
1130 type(group_pass_type),
intent(inout) :: group
1133 real,
dimension(:,:,:),
intent(inout) :: u_cmpt
1136 real,
dimension(:,:,:),
intent(inout) :: v_cmpt
1143 integer,
optional,
intent(in) :: direction
1149 integer,
optional,
intent(in) :: stagger
1152 integer,
optional,
intent(in) :: halo
1177 integer :: stagger_local
1180 stagger_local = cgrid_ne
1181 if (
present(stagger)) stagger_local = stagger
1184 if (
present(direction))
then ;
if (direction > 0) dirflag = direction ;
endif 1186 if (mpp_group_update_initialized(group))
then 1187 call mpp_reset_group_update_field(group,u_cmpt, v_cmpt)
1188 elseif (
present(halo) .and. mom_dom%thin_halo_updates)
then 1189 call mpp_create_group_update(group, u_cmpt, v_cmpt, mom_dom%mpp_domain, &
1190 flags=dirflag, gridtype=stagger_local, whalo=halo, ehalo=halo, &
1191 shalo=halo, nhalo=halo)
1193 call mpp_create_group_update(group, u_cmpt, v_cmpt, mom_dom%mpp_domain, &
1194 flags=dirflag, gridtype=stagger_local)
1201 type(group_pass_type),
intent(inout) :: group
1214 call mpp_do_group_update(group, mom_dom%mpp_domain, d_type)
1220 type(group_pass_type),
intent(inout) :: group
1233 call mpp_start_group_update(group, mom_dom%mpp_domain, d_type)
1239 type(group_pass_type),
intent(inout) :: group
1252 call mpp_complete_group_update(group, mom_dom%mpp_domain, d_type)
1257 subroutine mom_domains_init(MOM_dom, param_file, symmetric, static_memory, &
1258 NIHALO, NJHALO, NIGLOBAL, NJGLOBAL, NIPROC, NJPROC, &
1259 min_halo, domain_name, include_name, param_suffix)
1264 logical,
optional,
intent(in) :: symmetric
1267 logical,
optional,
intent(in) :: static_memory
1270 integer,
optional,
intent(in) :: NIHALO
1272 integer,
optional,
intent(in) :: NJHALO
1274 integer,
optional,
intent(in) :: NIGLOBAL
1276 integer,
optional,
intent(in) :: NJGLOBAL
1278 integer,
optional,
intent(in) :: NIPROC
1280 integer,
optional,
intent(in) :: NJPROC
1282 integer,
dimension(2),
optional,
intent(inout) :: min_halo
1285 character(len=*),
optional,
intent(in) :: domain_name
1287 character(len=*),
optional,
intent(in) :: include_name
1289 character(len=*),
optional,
intent(in) :: param_suffix
1312 integer,
dimension(2) :: layout = (/ 1, 1 /)
1313 integer,
dimension(2) :: io_layout = (/ 0, 0 /)
1314 integer,
dimension(4) :: global_indices
1319 integer :: nihalo_dflt, njhalo_dflt
1320 integer :: pe, proc_used
1321 integer :: X_FLAGS, Y_FLAGS
1322 logical :: reentrant_x, reentrant_y, tripolar_N, is_static
1323 logical :: mask_table_exists
1324 character(len=128) :: mask_table, inputdir
1325 character(len=64) :: dom_name, inc_nm
1326 character(len=200) :: mesg
1328 integer :: xsiz, ysiz, nip_parsed, njp_parsed
1329 integer :: isc,iec,jsc,jec
1330 character(len=8) :: char_xsiz, char_ysiz, char_niglobal, char_njglobal
1331 character(len=40) :: nihalo_nm, njhalo_nm, layout_nm, io_layout_nm, masktable_nm
1332 character(len=40) :: niproc_nm, njproc_nm
1335 #include "version_variable.h" 1336 character(len=40) :: mdl
1338 if (.not.
associated(mom_dom))
then 1340 allocate(mom_dom%mpp_domain)
1344 proc_used = num_pes()
1348 mom_dom%symmetric = .true.
1349 if (
present(symmetric))
then ; mom_dom%symmetric = symmetric ;
endif 1350 if (
present(min_halo)) mdl = trim(mdl)//
" min_halo" 1352 dom_name =
"MOM" ; inc_nm =
"MOM_memory.h" 1353 if (
present(domain_name)) dom_name = trim(domain_name)
1354 if (
present(include_name)) inc_nm = trim(include_name)
1356 nihalo_nm =
"NIHALO" ; njhalo_nm =
"NJHALO" 1357 layout_nm =
"LAYOUT" ; io_layout_nm =
"IO_LAYOUT" ; masktable_nm =
"MASKTABLE" 1358 niproc_nm =
"NIPROC" ; njproc_nm =
"NJPROC" 1359 if (
present(param_suffix))
then ;
if (len(trim(adjustl(param_suffix))) > 0)
then 1360 nihalo_nm =
"NIHALO"//(trim(adjustl(param_suffix)))
1361 njhalo_nm =
"NJHALO"//(trim(adjustl(param_suffix)))
1362 layout_nm =
"LAYOUT"//(trim(adjustl(param_suffix)))
1363 io_layout_nm =
"IO_LAYOUT"//(trim(adjustl(param_suffix)))
1364 masktable_nm =
"MASKTABLE"//(trim(adjustl(param_suffix)))
1365 niproc_nm =
"NIPROC"//(trim(adjustl(param_suffix)))
1366 njproc_nm =
"NJPROC"//(trim(adjustl(param_suffix)))
1369 is_static = .false. ;
if (
present(static_memory)) is_static = static_memory
1371 if (.not.
present(nihalo))
call mom_error(fatal,
"NIHALO must be "// &
1372 "present in the call to MOM_domains_init with static memory.")
1373 if (.not.
present(njhalo))
call mom_error(fatal,
"NJHALO must be "// &
1374 "present in the call to MOM_domains_init with static memory.")
1375 if (.not.
present(niglobal))
call mom_error(fatal,
"NIGLOBAL must be "// &
1376 "present in the call to MOM_domains_init with static memory.")
1377 if (.not.
present(njglobal))
call mom_error(fatal,
"NJGLOBAL must be "// &
1378 "present in the call to MOM_domains_init with static memory.")
1379 if (.not.
present(niproc))
call mom_error(fatal,
"NIPROC must be "// &
1380 "present in the call to MOM_domains_init with static memory.")
1381 if (.not.
present(njproc))
call mom_error(fatal,
"NJPROC must be "// &
1382 "present in the call to MOM_domains_init with static memory.")
1387 call get_param(param_file, mdl,
"REENTRANT_X", reentrant_x, &
1388 "If true, the domain is zonally reentrant.", default=.true.)
1389 call get_param(param_file, mdl,
"REENTRANT_Y", reentrant_y, &
1390 "If true, the domain is meridionally reentrant.", &
1392 call get_param(param_file, mdl,
"TRIPOLAR_N", tripolar_n, &
1393 "Use tripolar connectivity at the northern edge of the \n"//&
1394 "domain. With TRIPOLAR_N, NIGLOBAL must be even.", &
1397 #ifndef NOT_SET_AFFINITY 1426 call log_param(param_file, mdl,
"!SYMMETRIC_MEMORY_", mom_dom%symmetric, &
1427 "If defined, the velocity point data domain includes \n"//&
1428 "every face of the thickness points. In other words, \n"//&
1429 "some arrays are larger than others, depending on where \n"//&
1430 "they are on the staggered grid. Also, the starting \n"//&
1431 "index of the velocity-point arrays is usually 0, not 1. \n"//&
1432 "This can only be set at compile time.",&
1434 call get_param(param_file, mdl,
"NONBLOCKING_UPDATES", mom_dom%nonblocking_updates, &
1435 "If true, non-blocking halo updates may be used.", &
1436 default=.false., layoutparam=.true.)
1437 call get_param(param_file, mdl,
"THIN_HALO_UPDATES", mom_dom%thin_halo_updates, &
1438 "If true, optional arguments may be used to specify the \n"//&
1439 "The width of the halos that are updated with each call.", &
1440 default=.true., layoutparam=.true.)
1442 nihalo_dflt = 4 ; njhalo_dflt = 4
1443 if (
present(nihalo)) nihalo_dflt = nihalo
1444 if (
present(njhalo)) njhalo_dflt = njhalo
1446 call log_param(param_file, mdl,
"!STATIC_MEMORY_", is_static, &
1447 "If STATIC_MEMORY_ is defined, the principle variables \n"//&
1448 "will have sizes that are statically determined at \n"//&
1449 "compile time. Otherwise the sizes are not determined \n"//&
1450 "until run time. The STATIC option is substantially \n"//&
1451 "faster, but does not allow the PE count to be changed \n"//&
1452 "at run time. This can only be set at compile time.",&
1455 call get_param(param_file, mdl, trim(nihalo_nm), mom_dom%nihalo, &
1456 "The number of halo points on each side in the \n"//&
1457 "x-direction. With STATIC_MEMORY_ this is set as NIHALO_ \n"//&
1458 "in "//trim(inc_nm)//
" at compile time; without STATIC_MEMORY_ \n"//&
1459 "the default is NIHALO_ in "//trim(inc_nm)//
" (if defined) or 2.", &
1460 default=4, static_value=nihalo_dflt, layoutparam=.true.)
1461 call get_param(param_file, mdl, trim(njhalo_nm), mom_dom%njhalo, &
1462 "The number of halo points on each side in the \n"//&
1463 "y-direction. With STATIC_MEMORY_ this is set as NJHALO_ \n"//&
1464 "in "//trim(inc_nm)//
" at compile time; without STATIC_MEMORY_ \n"//&
1465 "the default is NJHALO_ in "//trim(inc_nm)//
" (if defined) or 2.", &
1466 default=4, static_value=njhalo_dflt, layoutparam=.true.)
1467 if (
present(min_halo))
then 1468 mom_dom%nihalo = max(mom_dom%nihalo, min_halo(1))
1469 min_halo(1) = mom_dom%nihalo
1470 mom_dom%njhalo = max(mom_dom%njhalo, min_halo(2))
1471 min_halo(2) = mom_dom%njhalo
1472 call log_param(param_file, mdl,
"!NIHALO min_halo", mom_dom%nihalo, layoutparam=.true.)
1473 call log_param(param_file, mdl,
"!NJHALO min_halo", mom_dom%nihalo, layoutparam=.true.)
1476 call get_param(param_file, mdl,
"NIGLOBAL", mom_dom%niglobal, &
1477 "The total number of thickness grid points in the \n"//&
1478 "x-direction in the physical domain. With STATIC_MEMORY_ \n"//&
1479 "this is set in "//trim(inc_nm)//
" at compile time.", &
1480 static_value=niglobal)
1481 call get_param(param_file, mdl,
"NJGLOBAL", mom_dom%njglobal, &
1482 "The total number of thickness grid points in the \n"//&
1483 "y-direction in the physical domain. With STATIC_MEMORY_ \n"//&
1484 "this is set in "//trim(inc_nm)//
" at compile time.", &
1485 static_value=njglobal)
1486 if (mom_dom%niglobal /= niglobal)
call mom_error(fatal,
"MOM_domains_init: " // &
1487 "static mismatch for NIGLOBAL_ domain size. Header file does not match input namelist")
1488 if (mom_dom%njglobal /= njglobal)
call mom_error(fatal,
"MOM_domains_init: " // &
1489 "static mismatch for NJGLOBAL_ domain size. Header file does not match input namelist")
1491 if (.not.
present(min_halo))
then 1492 if (mom_dom%nihalo /= nihalo)
call mom_error(fatal,
"MOM_domains_init: " // &
1493 "static mismatch for "//trim(nihalo_nm)//
" domain size")
1494 if (mom_dom%njhalo /= njhalo)
call mom_error(fatal,
"MOM_domains_init: " // &
1495 "static mismatch for "//trim(njhalo_nm)//
" domain size")
1498 call get_param(param_file, mdl,
"NIGLOBAL", mom_dom%niglobal, &
1499 "The total number of thickness grid points in the \n"//&
1500 "x-direction in the physical domain. With STATIC_MEMORY_ \n"//&
1501 "this is set in "//trim(inc_nm)//
" at compile time.", &
1502 fail_if_missing=.true.)
1503 call get_param(param_file, mdl,
"NJGLOBAL", mom_dom%njglobal, &
1504 "The total number of thickness grid points in the \n"//&
1505 "y-direction in the physical domain. With STATIC_MEMORY_ \n"//&
1506 "this is set in "//trim(inc_nm)//
" at compile time.", &
1507 fail_if_missing=.true.)
1510 global_indices(1) = 1 ; global_indices(2) = mom_dom%niglobal
1511 global_indices(3) = 1 ; global_indices(4) = mom_dom%njglobal
1513 call get_param(param_file, mdl,
"INPUTDIR", inputdir, do_not_log=.true., default=
".")
1516 call get_param(param_file, mdl, trim(masktable_nm), mask_table, &
1517 "A text file to specify n_mask, layout and mask_list. \n"//&
1518 "This feature masks out processors that contain only land points. \n"//&
1519 "The first line of mask_table is the number of regions to be masked out.\n"//&
1520 "The second line is the layout of the model and must be \n"//&
1521 "consistent with the actual model layout.\n"//&
1522 "The following (n_mask) lines give the logical positions \n"//&
1523 "of the processors that are masked out. The mask_table \n"//&
1524 "can be created by tools like check_mask. The \n"//&
1525 "following example of mask_table masks out 2 processors, \n"//&
1526 "(1,2) and (3,6), out of the 24 in a 4x6 layout: \n"//&
1527 " 2\n 4,6\n 1,2\n 3,6\n", default=
"MOM_mask_table", &
1529 mask_table = trim(inputdir)//trim(mask_table)
1530 mask_table_exists = file_exist(mask_table)
1533 layout(1) = niproc ; layout(2) = njproc
1535 call get_param(param_file, mdl, trim(layout_nm), layout, &
1536 "The processor layout to be used, or 0, 0 to automatically \n"//&
1537 "set the layout based on the number of processors.", default=0, &
1539 call get_param(param_file, mdl, trim(niproc_nm), nip_parsed, &
1540 "The number of processors in the x-direction.", default=-1, &
1542 call get_param(param_file, mdl, trim(njproc_nm), njp_parsed, &
1543 "The number of processors in the y-direction.", default=-1, &
1545 if (nip_parsed > -1)
then 1546 if ((layout(1) > 0) .and. (layout(1) /= nip_parsed)) &
1547 call mom_error(fatal, trim(layout_nm)//
" and "//trim(niproc_nm)//
" set inconsistently. "//&
1548 "Only LAYOUT should be used.")
1549 layout(1) = nip_parsed
1550 call mom_mesg(trim(niproc_nm)//
" used to set "//trim(layout_nm)//
" in dynamic mode. "//&
1551 "Shift to using "//trim(layout_nm)//
" instead.")
1553 if (njp_parsed > -1)
then 1554 if ((layout(2) > 0) .and. (layout(2) /= njp_parsed)) &
1555 call mom_error(fatal, trim(layout_nm)//
" and "//trim(njproc_nm)//
" set inconsistently. "//&
1556 "Only "//trim(layout_nm)//
" should be used.")
1557 layout(2) = njp_parsed
1558 call mom_mesg(trim(njproc_nm)//
" used to set "//trim(layout_nm)//
" in dynamic mode. "//&
1559 "Shift to using "//trim(layout_nm)//
" instead.")
1562 if ( layout(1)==0 .and. layout(2)==0 ) &
1563 call mpp_define_layout(global_indices, proc_used, layout)
1564 if ( layout(1)/=0 .and. layout(2)==0 ) layout(2) = proc_used/layout(1)
1565 if ( layout(1)==0 .and. layout(2)/=0 ) layout(1) = proc_used/layout(2)
1567 if (layout(1)*layout(2) /= proc_used .and. (.not. mask_table_exists) )
then 1568 write(mesg,
'("MOM_domains_init: The product of the two components of layout, ", & 1569 & 2i4,", is not the number of PEs used, ",i5,".")') &
1570 layout(1),layout(2),proc_used
1574 call log_param(param_file, mdl, trim(niproc_nm), layout(1), &
1575 "The number of processors in the x-direction. With \n"//&
1576 "STATIC_MEMORY_ this is set in "//trim(inc_nm)//
" at compile time.",&
1578 call log_param(param_file, mdl, trim(njproc_nm), layout(2), &
1579 "The number of processors in the x-direction. With \n"//&
1580 "STATIC_MEMORY_ this is set in "//trim(inc_nm)//
" at compile time.",&
1582 call log_param(param_file, mdl, trim(layout_nm), layout, &
1583 "The processor layout that was acutally used.",&
1587 if (layout(1)*layout(2)>mom_dom%niglobal*mom_dom%njglobal)
then 1588 write(mesg,
'(a,2(i5,x,a))')
'You requested to use',layout(1)*layout(2), &
1589 'PEs but there are only',mom_dom%niglobal*mom_dom%njglobal,
'columns in the model' 1593 if (mask_table_exists)
then 1594 call mom_error(note,
'MOM_domains_init: reading maskmap information from '//&
1596 allocate(mom_dom%maskmap(layout(1), layout(2)))
1597 call parse_mask_table(mask_table, mom_dom%maskmap, dom_name)
1602 io_layout(:) = (/ 1, 1 /)
1603 call get_param(param_file, mdl, trim(io_layout_nm), io_layout, &
1604 "The processor layout to be used, or 0,0 to automatically \n"//&
1605 "set the io_layout to be the same as the layout.", default=1, &
1608 if (io_layout(1) < 0)
then 1609 write(mesg,
'("MOM_domains_init: IO_LAYOUT(1) = ",i4,". Negative values "//& 1610 &"are not allowed in ")') io_layout(1)
1611 call mom_error(fatal, mesg//trim(io_layout_nm))
1612 elseif (io_layout(1) > 0)
then ;
if (modulo(layout(1), io_layout(1)) /= 0)
then 1613 write(mesg,
'("MOM_domains_init: The x-direction I/O-layout, IO_LAYOUT(1)=",i4, & 1614 &", does not evenly divide the x-direction layout, NIPROC=,",i4,".")') &
1615 io_layout(1),layout(1)
1619 if (io_layout(2) < 0)
then 1620 write(mesg,
'("MOM_domains_init: IO_LAYOUT(2) = ",i4,". Negative values "//& 1621 &"are not allowed in ")') io_layout(2)
1622 call mom_error(fatal, mesg//trim(io_layout_nm))
1623 elseif (io_layout(2) /= 0)
then ;
if (modulo(layout(2), io_layout(2)) /= 0)
then 1624 write(mesg,
'("MOM_domains_init: The y-direction I/O-layout, IO_LAYOUT(2)=",i4, & 1625 &", does not evenly divide the y-direction layout, NJPROC=,",i4,".")') &
1626 io_layout(2),layout(2)
1630 if (io_layout(2) == 0) io_layout(2) = layout(2)
1631 if (io_layout(1) == 0) io_layout(1) = layout(1)
1633 x_flags = 0 ; y_flags = 0
1634 if (reentrant_x) x_flags = cyclic_global_domain
1635 if (reentrant_y) y_flags = cyclic_global_domain
1636 if (tripolar_n)
then 1637 y_flags = fold_north_edge
1638 if (reentrant_y)
call mom_error(fatal,
"MOM_domains: "// &
1639 "TRIPOLAR_N and REENTRANT_Y may not be defined together.")
1642 global_indices(1) = 1 ; global_indices(2) = mom_dom%niglobal
1643 global_indices(3) = 1 ; global_indices(4) = mom_dom%njglobal
1645 if (mask_table_exists)
then 1646 call mom_define_domain( global_indices, layout, mom_dom%mpp_domain, &
1647 xflags=x_flags, yflags=y_flags, &
1648 xhalo=mom_dom%nihalo, yhalo=mom_dom%njhalo, &
1649 symmetry = mom_dom%symmetric, name=dom_name, &
1650 maskmap=mom_dom%maskmap )
1652 call mom_define_domain( global_indices, layout, mom_dom%mpp_domain, &
1653 xflags=x_flags, yflags=y_flags, &
1654 xhalo=mom_dom%nihalo, yhalo=mom_dom%njhalo, &
1655 symmetry = mom_dom%symmetric, name=dom_name)
1658 if ((io_layout(1) > 0) .and. (io_layout(2) > 0) .and. &
1659 (layout(1)*layout(2) > 1))
then 1660 call mom_define_io_domain(mom_dom%mpp_domain, io_layout)
1664 mom_dom%X_FLAGS = x_flags
1665 mom_dom%Y_FLAGS = y_flags
1666 mom_dom%layout = layout
1667 mom_dom%io_layout = io_layout
1668 mom_dom%use_io_layout = (io_layout(1) + io_layout(2) > 0)
1673 call mpp_get_compute_domain(mom_dom%mpp_domain,isc,iec,jsc,jec)
1674 xsiz = iec - isc + 1
1675 ysiz = jec - jsc + 1
1676 if (xsiz*niproc /= mom_dom%niglobal .OR. ysiz*njproc /= mom_dom%njglobal)
then 1677 write( char_xsiz,
'(i4)' ) niproc
1678 write( char_ysiz,
'(i4)' ) njproc
1679 write( char_niglobal,
'(i4)' ) mom_dom%niglobal
1680 write( char_njglobal,
'(i4)' ) mom_dom%njglobal
1681 call mom_error(warning,
'MOM_domains: Processor decomposition (NIPROC_,NJPROC_) = (' &
1682 //trim(char_xsiz)//
','//trim(char_ysiz)// &
1683 ') does not evenly divide size set by preprocessor macro ('&
1684 //trim(char_niglobal)//
','//trim(char_njglobal)//
'). ')
1685 call mom_error(fatal,
'MOM_domains: #undef STATIC_MEMORY_ in "//trim(inc_nm)//" to use & 1686 &dynamic allocation, or change processor decomposition to evenly divide the domain.')
1693 subroutine clone_md_to_md(MD_in, MOM_dom, min_halo, halo_size, symmetric, &
1697 integer,
dimension(2),
optional,
intent(inout) :: min_halo
1698 integer,
optional,
intent(in) :: halo_size
1699 logical,
optional,
intent(in) :: symmetric
1700 character(len=*),
optional,
intent(in) :: domain_name
1702 integer :: global_indices(4)
1703 logical :: mask_table_exists
1704 character(len=64) :: dom_name
1706 if (.not.
associated(mom_dom))
then 1708 allocate(mom_dom%mpp_domain)
1712 mom_dom%niglobal = md_in%niglobal ; mom_dom%njglobal = md_in%njglobal
1713 mom_dom%nihalo = md_in%nihalo ; mom_dom%njhalo = md_in%njhalo
1715 mom_dom%symmetric = md_in%symmetric
1716 mom_dom%nonblocking_updates = md_in%nonblocking_updates
1718 mom_dom%X_FLAGS = md_in%X_FLAGS ; mom_dom%Y_FLAGS = md_in%Y_FLAGS
1719 mom_dom%layout(:) = md_in%layout(:) ; mom_dom%io_layout(:) = md_in%io_layout(:)
1720 mom_dom%use_io_layout = (mom_dom%io_layout(1) + mom_dom%io_layout(2) > 0)
1722 if (
associated(md_in%maskmap))
then 1723 mask_table_exists = .true.
1724 allocate(mom_dom%maskmap(mom_dom%layout(1), mom_dom%layout(2)))
1725 mom_dom%maskmap(:,:) = md_in%maskmap(:,:)
1727 mask_table_exists = .false.
1730 if (
present(halo_size) .and.
present(min_halo))
call mom_error(fatal, &
1731 "clone_MOM_domain can not have both halo_size and min_halo present.")
1733 if (
present(min_halo))
then 1734 mom_dom%nihalo = max(mom_dom%nihalo, min_halo(1))
1735 min_halo(1) = mom_dom%nihalo
1736 mom_dom%njhalo = max(mom_dom%njhalo, min_halo(2))
1737 min_halo(2) = mom_dom%njhalo
1740 if (
present(halo_size))
then 1741 mom_dom%nihalo = halo_size ; mom_dom%njhalo = halo_size
1744 if (
present(symmetric))
then ; mom_dom%symmetric = symmetric ;
endif 1747 if (
present(domain_name)) dom_name = trim(domain_name)
1749 global_indices(1) = 1 ; global_indices(2) = mom_dom%niglobal
1750 global_indices(3) = 1 ; global_indices(4) = mom_dom%njglobal
1751 if (mask_table_exists)
then 1752 call mom_define_domain( global_indices, mom_dom%layout, mom_dom%mpp_domain, &
1753 xflags=mom_dom%X_FLAGS, yflags=mom_dom%Y_FLAGS, &
1754 xhalo=mom_dom%nihalo, yhalo=mom_dom%njhalo, &
1755 symmetry = mom_dom%symmetric, name=dom_name, &
1756 maskmap=mom_dom%maskmap )
1758 call mom_define_domain( global_indices, mom_dom%layout, mom_dom%mpp_domain, &
1759 xflags=mom_dom%X_FLAGS, yflags=mom_dom%Y_FLAGS, &
1760 xhalo=mom_dom%nihalo, yhalo=mom_dom%njhalo, &
1761 symmetry = mom_dom%symmetric, name=dom_name)
1764 if ((mom_dom%io_layout(1) + mom_dom%io_layout(2) > 0) .and. &
1765 (mom_dom%layout(1)*mom_dom%layout(2) > 1))
then 1766 call mom_define_io_domain(mom_dom%mpp_domain, mom_dom%io_layout)
1772 subroutine clone_md_to_d2d(MD_in, mpp_domain, min_halo, halo_size, symmetric, &
1775 type(domain2d),
intent(inout) :: mpp_domain
1776 integer,
dimension(2),
optional,
intent(inout) :: min_halo
1777 integer,
optional,
intent(in) :: halo_size
1778 logical,
optional,
intent(in) :: symmetric
1779 character(len=*),
optional,
intent(in) :: domain_name
1781 integer :: global_indices(4), layout(2), io_layout(2)
1782 integer :: X_FLAGS, Y_FLAGS, niglobal, njglobal, nihalo, njhalo
1783 logical :: symmetric_dom
1784 character(len=64) :: dom_name
1787 niglobal = md_in%niglobal ; njglobal = md_in%njglobal
1788 nihalo = md_in%nihalo ; njhalo = md_in%njhalo
1790 symmetric_dom = md_in%symmetric
1792 x_flags = md_in%X_FLAGS ; y_flags = md_in%Y_FLAGS
1793 layout(:) = md_in%layout(:) ; io_layout(:) = md_in%io_layout(:)
1795 if (
present(halo_size) .and.
present(min_halo))
call mom_error(fatal, &
1796 "clone_MOM_domain can not have both halo_size and min_halo present.")
1798 if (
present(min_halo))
then 1799 nihalo = max(nihalo, min_halo(1))
1800 njhalo = max(njhalo, min_halo(2))
1801 min_halo(1) = nihalo ; min_halo(2) = njhalo
1804 if (
present(halo_size))
then 1805 nihalo = halo_size ; njhalo = halo_size
1808 if (
present(symmetric))
then ; symmetric_dom = symmetric ;
endif 1811 if (
present(domain_name)) dom_name = trim(domain_name)
1813 global_indices(1) = 1 ; global_indices(2) = niglobal
1814 global_indices(3) = 1 ; global_indices(4) = njglobal
1815 if (
associated(md_in%maskmap))
then 1816 call mom_define_domain( global_indices, layout, mpp_domain, &
1817 xflags=x_flags, yflags=y_flags, &
1818 xhalo=nihalo, yhalo=njhalo, &
1819 symmetry = symmetric, name=dom_name, &
1820 maskmap=md_in%maskmap )
1822 call mom_define_domain( global_indices, layout, mpp_domain, &
1823 xflags=x_flags, yflags=y_flags, &
1824 xhalo=nihalo, yhalo=njhalo, &
1825 symmetry = symmetric, name=dom_name)
1828 if ((io_layout(1) + io_layout(2) > 0) .and. &
1829 (layout(1)*layout(2) > 1))
then 1830 call mom_define_io_domain(mpp_domain, io_layout)
1837 isg, ieg, jsg, jeg, idg_offset, jdg_offset, &
1838 symmetric, local_indexing, index_offset)
1840 intent(in) :: Domain
1841 integer,
intent(out) :: isc, iec, jsc, jec
1843 integer,
intent(out) :: isd, ied, jsd, jed
1844 integer,
intent(out) :: isg, ieg, jsg, jeg
1845 integer,
intent(out) :: idg_offset, jdg_offset
1847 logical,
intent(out) :: symmetric
1848 logical,
optional, &
1849 intent(in) :: local_indexing
1851 integer,
optional, &
1852 intent(in) :: index_offset
1872 local = .true. ;
if (
present(local_indexing)) local = local_indexing
1873 ind_off = 0 ;
if (
present(index_offset)) ind_off = index_offset
1875 call mpp_get_compute_domain(domain%mpp_domain, isc, iec, jsc, jec)
1876 call mpp_get_data_domain(domain%mpp_domain, isd, ied, jsd, jed)
1877 call mpp_get_global_domain(domain%mpp_domain, isg, ieg, jsg, jeg)
1881 idg_offset = isd-1 ; jdg_offset = jsd-1
1882 isc = isc-isd+1 ; iec = iec-isd+1 ; jsc = jsc-jsd+1 ; jec = jec-jsd+1
1883 ied = ied-isd+1 ; jed = jed-jsd+1
1886 idg_offset = 0 ; jdg_offset = 0
1888 if (ind_off /= 0)
then 1889 idg_offset = idg_offset + ind_off ; jdg_offset = jdg_offset + ind_off
1890 isc = isc + ind_off ; iec = iec + ind_off
1891 jsc = jsc + ind_off ; jec = jec + ind_off
1892 isd = isd + ind_off ; ied = ied + ind_off
1893 jsd = jsd + ind_off ; jed = jed + ind_off
1895 symmetric = domain%symmetric
subroutine fill_vector_symmetric_edges_2d(u_cmpt, v_cmpt, MOM_dom, stagger, scalar)
integer function pass_vector_start_2d(u_cmpt, v_cmpt, MOM_dom, direction, stagger, complete, halo)
subroutine pass_vector_complete_2d(id_update, u_cmpt, v_cmpt, MOM_dom, direction, stagger, halo)
integer, parameter, public to_all
subroutine pass_vector_complete_3d(id_update, u_cmpt, v_cmpt, MOM_dom, direction, stagger, halo)
subroutine, public do_group_pass(group, MOM_dom)
integer function pass_var_start_3d(array, MOM_dom, sideflag, position, complete, halo)
subroutine pass_var_2d(array, MOM_dom, sideflag, complete, position, halo)
subroutine pass_vector_3d(u_cmpt, v_cmpt, MOM_dom, direction, stagger, complete, halo)
subroutine create_vector_group_pass_3d(group, u_cmpt, v_cmpt, MOM_dom, direction, stagger, halo)
character(len=len(dir)+2) function, public slasher(dir)
Returns a directory name that is terminated with a "/" or "./" if the argument is an empty string...
subroutine, public start_group_pass(group, MOM_dom)
subroutine create_var_group_pass_3d(group, array, MOM_dom, sideflag, position, halo)
subroutine, public mom_domains_init(MOM_dom, param_file, symmetric, static_memory, NIHALO, NJHALO, NIGLOBAL, NJGLOBAL, NIPROC, NJPROC, min_halo, domain_name, include_name, param_suffix)
logical function, public is_root_pe()
subroutine, public complete_group_pass(group, MOM_dom)
subroutine pass_var_3d(array, MOM_dom, sideflag, complete, position, halo)
subroutine, public mom_mesg(message, verb, all_print)
subroutine clone_md_to_md(MD_in, MOM_dom, min_halo, halo_size, symmetric, domain_name)
subroutine create_var_group_pass_2d(group, array, MOM_dom, sideflag, position, halo)
The MOM_domain_type contains information about the domain decompositoin.
integer function pass_vector_start_3d(u_cmpt, v_cmpt, MOM_dom, direction, stagger, complete, halo)
subroutine pass_var_complete_3d(id_update, array, MOM_dom, sideflag, position, halo)
subroutine, public get_domain_extent(Domain, isc, iec, jsc, jec, isd, ied, jsd, jed, isg, ieg, jsg, jeg, idg_offset, jdg_offset, symmetric, local_indexing, index_offset)
subroutine, public mom_infra_end
subroutine, public mom_error(level, message, all_print)
integer function pass_var_start_2d(array, MOM_dom, sideflag, position, complete, halo)
subroutine clone_md_to_d2d(MD_in, mpp_domain, min_halo, halo_size, symmetric, domain_name)
subroutine pass_var_complete_2d(id_update, array, MOM_dom, sideflag, position, halo)
subroutine create_vector_group_pass_2d(group, u_cmpt, v_cmpt, MOM_dom, direction, stagger, halo)
subroutine pass_vector_2d(u_cmpt, v_cmpt, MOM_dom, direction, stagger, complete, halo)