ROMS
Loading...
Searching...
No Matches
distribute_mod::mp_bcasti Interface Reference

Public Member Functions

subroutine mp_bcasti_0d (ng, model, a, inpcomm)
 
subroutine mp_bcasti_1d (ng, model, a, inpcomm)
 
subroutine mp_bcasti_2d (ng, model, a, inpcomm)
 

Detailed Description

Definition at line 95 of file distribute.F.

Member Function/Subroutine Documentation

◆ mp_bcasti_0d()

subroutine distribute_mod::mp_bcasti::mp_bcasti_0d ( integer, intent(in) ng,
integer, intent(in) model,
integer, intent(inout) a,
integer, intent(in), optional inpcomm )

Definition at line 1018 of file distribute.F.

1019!
1020!***********************************************************************
1021! !
1022! This routine broadcasts an integer scalar variable to all !
1023! processors in the communicator. It is called by all the !
1024! members in the group. !
1025! !
1026! On Input: !
1027! !
1028! ng Nested grid number. !
1029! model Calling model identifier. !
1030! A Variable to broadcast (integer). !
1031! InpComm Communicator handle (integer, OPTIONAL). !
1032! !
1033! On Output: !
1034! !
1035! A Broadcasted variable. !
1036! !
1037!***********************************************************************
1038!
1039! Imported variable declarations.
1040!
1041 integer, intent(in) :: ng, model
1042
1043 integer, intent(in), optional :: InpComm
1044
1045 integer, intent(inout) :: A
1046!
1047! Local variable declarations
1048!
1049 integer :: Lstr, MyCOMM, MyError, Npts, Serror
1050!
1051 character (len=MPI_MAX_ERROR_STRING) :: string
1052
1053 character (len=*), parameter :: MyFile = &
1054 & __FILE__//", mp_bcasti_0d"
1055
1056# ifdef PROFILE
1057!
1058!-----------------------------------------------------------------------
1059! Turn on time clocks.
1060!-----------------------------------------------------------------------
1061!
1062 IF (lwclock) THEN
1063 CALL wclock_on (ng, model, 64, __line__, myfile)
1064 END IF
1065# endif
1066# ifdef MPI
1067!
1068!-----------------------------------------------------------------------
1069! Set distributed-memory communicator handle (context ID).
1070!-----------------------------------------------------------------------
1071!
1072 IF (PRESENT(inpcomm)) THEN
1073 mycomm=inpcomm
1074 ELSE
1075 mycomm=ocn_comm_world
1076 END IF
1077# endif
1078!
1079!-----------------------------------------------------------------------
1080! Broadcast requested variable.
1081!-----------------------------------------------------------------------
1082!
1083 npts=1
1084# ifdef MPI
1085 CALL mpi_bcast (a, npts, mpi_integer, mymaster, ocn_comm_world, &
1086 & myerror)
1087 IF (myerror.ne.mpi_success) THEN
1088 CALL mpi_error_string (myerror, string, lstr, serror)
1089 lstr=len_trim(string)
1090 WRITE (stdout,10) 'MPI_BCAST', myrank, myerror, string(1:lstr)
1091 10 FORMAT (/,' MP_BCASTI_0D - error during ',a,' call, Task = ', &
1092 & i3.3,' Error = ',i3,/,13x,a)
1093 RETURN
1094 END IF
1095# endif
1096# ifdef PROFILE
1097!
1098!-----------------------------------------------------------------------
1099! Turn off time clocks.
1100!-----------------------------------------------------------------------
1101!
1102 IF (lwclock) THEN
1103 CALL wclock_off (ng, model, 64, __line__, myfile)
1104 END IF
1105# endif
1106!
1107 RETURN
recursive subroutine wclock_off(ng, model, region, line, routine)
Definition timers.F:148
recursive subroutine wclock_on(ng, model, region, line, routine)
Definition timers.F:3

References mod_parallel::lwclock, mod_parallel::mymaster, mod_parallel::myrank, mod_parallel::ocn_comm_world, mod_iounits::stdout, wclock_off(), and wclock_on().

Here is the call graph for this function:

◆ mp_bcasti_1d()

subroutine distribute_mod::mp_bcasti::mp_bcasti_1d ( integer, intent(in) ng,
integer, intent(in) model,
integer, dimension(:), intent(inout) a,
integer, intent(in), optional inpcomm )

Definition at line 1110 of file distribute.F.

1111!
1112!***********************************************************************
1113! !
1114! This routine broadcasts a 1D non-tiled, integer array to all !
1115! processors in the communicator. It is called by all the !
1116! members in the group. !
1117! !
1118! On Input: !
1119! !
1120! ng Nested grid number. !
1121! model Calling model identifier. !
1122! A 1D array to broadcast (integer). !
1123! InpComm Communicator handle (integer, OPTIONAL). !
1124! !
1125! On Output: !
1126! !
1127! A Broadcasted 1D array. !
1128! !
1129!***********************************************************************
1130!
1131! Imported variable declarations.
1132!
1133 integer, intent(in) :: ng, model
1134
1135 integer, intent(in), optional :: InpComm
1136
1137 integer, intent(inout) :: A(:)
1138!
1139! Local variable declarations
1140!
1141 integer :: Lstr, MyCOMM, MyError, Npts, Serror
1142!
1143 character (len=MPI_MAX_ERROR_STRING) :: string
1144
1145 character (len=*), parameter :: MyFile = &
1146 & __FILE__//", mp_bcasti_1d"
1147
1148# ifdef PROFILE
1149!
1150!-----------------------------------------------------------------------
1151! Turn on time clocks.
1152!-----------------------------------------------------------------------
1153!
1154 CALL wclock_on (ng, model, 64, __line__, myfile)
1155# endif
1156# ifdef MPI
1157!
1158!-----------------------------------------------------------------------
1159! Set distributed-memory communicator handle (context ID).
1160!-----------------------------------------------------------------------
1161!
1162 IF (PRESENT(inpcomm)) THEN
1163 mycomm=inpcomm
1164 ELSE
1165 mycomm=ocn_comm_world
1166 END IF
1167# endif
1168!
1169!-----------------------------------------------------------------------
1170! Broadcast requested variable.
1171!-----------------------------------------------------------------------
1172!
1173 npts=ubound(a, dim=1)
1174
1175# ifdef MPI
1176 CALL mpi_bcast (a, npts, mpi_integer, mymaster, mycomm, myerror)
1177 IF (myerror.ne.mpi_success) THEN
1178 CALL mpi_error_string (myerror, string, lstr, serror)
1179 lstr=len_trim(string)
1180 WRITE (stdout,10) 'MPI_BCAST', myrank, myerror, string(1:lstr)
1181 10 FORMAT (/,' MP_BCASTI_1D - error during ',a,' call, Task = ', &
1182 & i3.3,' Error = ',i3,/,13x,a)
1183 exit_flag=2
1184 RETURN
1185 END IF
1186# endif
1187# ifdef PROFILE
1188!
1189!-----------------------------------------------------------------------
1190! Turn off time clocks.
1191!-----------------------------------------------------------------------
1192!
1193 CALL wclock_off (ng, model, 64, __line__, myfile)
1194# endif
1195!
1196 RETURN

References mod_scalars::exit_flag, mod_parallel::mymaster, mod_parallel::myrank, mod_parallel::ocn_comm_world, mod_iounits::stdout, wclock_off(), and wclock_on().

Here is the call graph for this function:

◆ mp_bcasti_2d()

subroutine distribute_mod::mp_bcasti::mp_bcasti_2d ( integer, intent(in) ng,
integer, intent(in) model,
integer, dimension(:,:), intent(inout) a,
integer, intent(in), optional inpcomm )

Definition at line 1199 of file distribute.F.

1200!
1201!***********************************************************************
1202! !
1203! This routine broadcasts a 2D non-tiled, integer array to all !
1204! processors in the communicator. It is called by all the !
1205! members in the group. !
1206! !
1207! On Input: !
1208! !
1209! ng Nested grid number. !
1210! model Calling model identifier. !
1211! A 2D array to broadcast (integer). !
1212! InpComm Communicator handle (integer, OPTIONAL). !
1213! !
1214! On Output: !
1215! !
1216! A Broadcasted 2D array. !
1217! !
1218!***********************************************************************
1219!
1220! Imported variable declarations.
1221!
1222 integer, intent(in) :: ng, model
1223
1224 integer, intent(in), optional :: InpComm
1225
1226 integer, intent(inout) :: A(:,:)
1227!
1228! Local variable declarations
1229!
1230 integer :: Lstr, MyCOMM, MyError, Npts, Serror
1231 integer :: Asize(2)
1232!
1233 character (len=MPI_MAX_ERROR_STRING) :: string
1234
1235 character (len=*), parameter :: MyFile = &
1236 & __FILE__//", mp_bcasti_2d"
1237
1238# ifdef PROFILE
1239!
1240!-----------------------------------------------------------------------
1241! Turn on time clocks.
1242!-----------------------------------------------------------------------
1243!
1244 CALL wclock_on (ng, model, 64, __line__, myfile)
1245# endif
1246# ifdef MPI
1247!
1248!-----------------------------------------------------------------------
1249! Set distributed-memory communicator handle (context ID).
1250!-----------------------------------------------------------------------
1251!
1252 IF (PRESENT(inpcomm)) THEN
1253 mycomm=inpcomm
1254 ELSE
1255 mycomm=ocn_comm_world
1256 END IF
1257# endif
1258!
1259!-----------------------------------------------------------------------
1260! Broadcast requested variable.
1261!-----------------------------------------------------------------------
1262!
1263 asize(1)=ubound(a, dim=1)
1264 asize(2)=ubound(a, dim=2)
1265 npts=asize(1)*asize(2)
1266
1267# ifdef MPI
1268 CALL mpi_bcast (a, npts, mpi_integer, mymaster, mycomm, myerror)
1269 IF (myerror.ne.mpi_success) THEN
1270 CALL mpi_error_string (myerror, string, lstr, serror)
1271 lstr=len_trim(string)
1272 WRITE (stdout,10) 'MPI_BCAST', myrank, myerror, string(1:lstr)
1273 10 FORMAT (/,' MP_BCASTI_2D - error during ',a,' call, Task = ', &
1274 & i3.3,' Error = ',i3,/,13x,a)
1275 exit_flag=2
1276 RETURN
1277 END IF
1278# endif
1279# ifdef PROFILE
1280!
1281!-----------------------------------------------------------------------
1282! Turn off time clocks.
1283!-----------------------------------------------------------------------
1284!
1285 CALL wclock_off (ng, model, 64, __line__, myfile)
1286# endif
1287!
1288 RETURN

References mod_scalars::exit_flag, mod_parallel::mymaster, mod_parallel::myrank, mod_parallel::ocn_comm_world, mod_iounits::stdout, wclock_off(), and wclock_on().

Here is the call graph for this function:

The documentation for this interface was generated from the following file: