@@ -420,7 +420,6 @@ subroutine prep_ocn_init(infodata, atm_c2_ocn, atm_c2_ice, ice_c2_ocn, rof_c2_oc
420
420
' seq_maps.rc' ,' atm2ocn_fmapname:' ,' atm2ocn_fmaptype:' ,samegrid_ao, &
421
421
' mapper_Fa2o initialization' , esmf_map_flag, no_match)
422
422
call shr_sys_flush(logunit)
423
- #ifdef HAVE_MOAB
424
423
! Call moab intx only if atm and ocn are init in moab
425
424
if ((mbaxid .ge. 0 ) .and. (mboxid .ge. 0 )) then
426
425
if (iamroot_CPLID) then
@@ -605,8 +604,7 @@ subroutine prep_ocn_init(infodata, atm_c2_ocn, atm_c2_ice, ice_c2_ocn, rof_c2_oc
605
604
endif ! if (.not. samegrid_ao)
606
605
607
606
endif ! if ((mbaxid .ge. 0) .and. (mboxid .ge. 0))
608
- ! endif HAVE_MOAB
609
- #endif
607
+
610
608
end if ! if (atm_present)
611
609
612
610
! atm_c2_ice flag is here because ICE and OCN are constrained to be on the same
@@ -694,7 +692,6 @@ subroutine prep_ocn_init(infodata, atm_c2_ocn, atm_c2_ice, ice_c2_ocn, rof_c2_oc
694
692
write (logunit,F00) ' Initializing mapper_SFi2o'
695
693
end if
696
694
call seq_map_init_rearrolap(mapper_SFi2o, ice(1 ), ocn(1 ), ' mapper_SFi2o' )
697
- #ifdef HAVE_MOAB
698
695
if ( (mbixid .ge. 0 ) .and. (mboxid .ge. 0 )) then
699
696
if (iamroot_CPLID) then
700
697
write (logunit,* ) ' '
@@ -737,7 +734,6 @@ subroutine prep_ocn_init(infodata, atm_c2_ocn, atm_c2_ice, ice_c2_ocn, rof_c2_oc
737
734
mapper_SFi2o% intx_context = ocn(1 )% cplcompid
738
735
mapper_SFi2o% mbname = ' mapper_SFi2o'
739
736
endif
740
- #endif
741
737
endif ! if (ice_present)
742
738
call shr_sys_flush(logunit)
743
739
@@ -754,7 +750,6 @@ subroutine prep_ocn_init(infodata, atm_c2_ocn, atm_c2_ice, ice_c2_ocn, rof_c2_oc
754
750
call seq_comm_getData(CPLID, mpicom= mpicom_CPLID, iamroot= iamroot_CPLID)
755
751
call seq_comm_getData(CPLID, mpigrp= mpigrp_CPLID) ! second group, the coupler group CPLID is global variable
756
752
757
- #ifdef HAVE_MOAB
758
753
appname = " ROF_OCN_COU" // CHAR (0 )
759
754
! rmapid is a unique external number of MOAB app that takes care of map between rof and ocn mesh
760
755
rmapid = 100 * rof(1 )% cplcompid + ocn(1 )% cplcompid ! something different, to differentiate it
@@ -835,7 +830,6 @@ subroutine prep_ocn_init(infodata, atm_c2_ocn, atm_c2_ice, ice_c2_ocn, rof_c2_oc
835
830
mapper_Rr2o_liq% weight_identifier = wgtIdFr2ol
836
831
mapper_Rr2o_liq% mbname = ' mapper_Rr2o_liq'
837
832
838
- #endif
839
833
840
834
if (iamroot_CPLID) then
841
835
write (logunit,* ) ' '
@@ -846,7 +840,6 @@ subroutine prep_ocn_init(infodata, atm_c2_ocn, atm_c2_ice, ice_c2_ocn, rof_c2_oc
846
840
' seq_maps.rc' , ' rof2ocn_ice_rmapname:' , ' rof2ocn_ice_rmaptype:' ,samegrid_ro, &
847
841
' mapper_Rr2o_ice initialization' , esmf_map_flag, no_match )
848
842
! us the same one for mapper_Rr2o_ice and mapper_Fr2o
849
- #ifdef HAVE_MOAB
850
843
! now take care of the mapper for MOAB mapper_Rr2o_ice
851
844
if (iamroot_CPLID) then
852
845
write (logunit,* ) ' '
@@ -868,7 +861,6 @@ subroutine prep_ocn_init(infodata, atm_c2_ocn, atm_c2_ice, ice_c2_ocn, rof_c2_oc
868
861
mapper_Rr2o_ice% intx_context = rmapid ! read map is the same context as intersection now
869
862
mapper_Rr2o_ice% weight_identifier = wgtIdFr2oi
870
863
mapper_Rr2o_ice% mbname = ' mapper_Rr2o_ice'
871
- #endif
872
864
if (flood_present) then
873
865
if (iamroot_CPLID) then
874
866
write (logunit,* ) ' '
@@ -878,8 +870,6 @@ subroutine prep_ocn_init(infodata, atm_c2_ocn, atm_c2_ice, ice_c2_ocn, rof_c2_oc
878
870
call seq_map_init_rcfile( mapper_Fr2o, rof(1 ), ocn(1 ), &
879
871
' seq_maps.rc' , ' rof2ocn_fmapname:' , ' rof2ocn_fmaptype:' ,samegrid_ro, &
880
872
string= ' mapper_Fr2o initialization' , esmf_map= esmf_map_flag, no_match= no_match )
881
-
882
- #ifdef HAVE_MOAB
883
873
! now take care of the mapper for MOAB mapper_Fr2o
884
874
if (iamroot_CPLID) then
885
875
write (logunit,* ) ' '
@@ -892,30 +882,29 @@ subroutine prep_ocn_init(infodata, atm_c2_ocn, atm_c2_ice, ice_c2_ocn, rof_c2_oc
892
882
call moab_map_init_rcfile( mbrxid, mboxid, mbintxro, type_grid, &
893
883
' seq_maps.rc' , ' rof2ocn_fmapname:' , ' rof2ocn_fmaptype:' , samegrid_ro, &
894
884
arearead, wgtIdFr2o, ' mapper_Fr2o MOAB initialization' , esmf_map_flag, wgtIdFr2ol )
895
-
896
885
end if
897
-
898
886
mapper_Fr2o% src_mbid = mbrxid
899
887
mapper_Fr2o% tgt_mbid = mboxid ! special
900
888
mapper_Fr2o% intx_mbid = mbintxro
901
889
mapper_Fr2o% src_context = rof(1 )% cplcompid
902
890
mapper_Fr2o% intx_context = rmapid ! read map is the same context as intersection now
903
891
mapper_Fr2o% weight_identifier = wgtIdFr2o
904
892
mapper_Fr2o% mbname = ' mapper_Fr2o'
905
- #endif
906
893
endif
907
894
908
- context_id = rmapid ! ocn(1)%cplcompid
895
+ context_id = rmapid ! ocn(1)%cplcompid*100+rof(1)%cplcompid
896
+ type_grid = 3 ! this is type of grid
897
+ if (.not. compute_maps_online_r2o) then
898
+ ierr = iMOAB_MigrateMapMesh ( mbrxid, mbintxro, mpicom_CPLID, mpigrp_CPLID, &
899
+ mpigrp_CPLID, type_grid, rof(1 )% cplcompid, context_id )
900
+ if (ierr .ne. 0 ) then
901
+ write (logunit,* ) subname,' error in migrating rof mesh for map rof c2 ocn '
902
+ call shr_sys_abort(subname// ' ERROR in migrating rof mesh for map rof c2 ocn ' )
903
+ endif
904
+ endif
909
905
! this creates a parallel communication graph between mbrxid and mbintxro,
910
906
! with ids rof(1)%cplcompid, rmapid (rmapid is 100*src+tgt)
911
907
! this will be used in send/receive mappers
912
- type_grid = 3 ! this is type of grid
913
- ierr = iMOAB_MigrateMapMesh ( mbrxid, mbintxro, mpicom_CPLID, mpigrp_CPLID, &
914
- mpigrp_CPLID, type_grid, rof(1 )% cplcompid, context_id )
915
- if (ierr .ne. 0 ) then
916
- write (logunit,* ) subname,' error in migrating rof mesh for map rof c2 ocn '
917
- call shr_sys_abort(subname// ' ERROR in migrating rof mesh for map rof c2 ocn ' )
918
- endif
919
908
ierr = iMOAB_ComputeCommGraph( mbrxid, mbintxro, mpicom_CPLID, mpigrp_CPLID, mpigrp_CPLID, &
920
909
type_grid, type_grid, rof(1 )% cplcompid, rmapid )
921
910
if (ierr .ne. 0 ) then
0 commit comments