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

Public Member Functions

subroutine mp_bcastf_0dp (ng, model, a, inpcomm)
 
subroutine mp_bcastf_1dp (ng, model, a, inpcomm)
 
subroutine mp_bcastf_2dp (ng, model, a, inpcomm)
 
subroutine mp_bcastf_3dp (ng, model, a, inpcomm)
 
subroutine mp_bcastf_0d (ng, model, a, inpcomm)
 
subroutine mp_bcastf_1d (ng, model, a, inpcomm)
 
subroutine mp_bcastf_2d (ng, model, a, inpcomm)
 
subroutine mp_bcastf_3d (ng, model, a, inpcomm)
 
subroutine mp_bcastf_4d (ng, model, a, inpcomm)
 

Detailed Description

Definition at line 75 of file distribute.F.

Member Function/Subroutine Documentation

◆ mp_bcastf_0d()

subroutine distribute_mod::mp_bcastf::mp_bcastf_0d ( integer, intent(in) ng,
integer, intent(in) model,
real(r8), intent(inout) a,
integer, intent(in), optional inpcomm )

Definition at line 560 of file distribute.F.

561!
562!***********************************************************************
563! !
564! This routine broadcasts a floating-point scalar variable to all !
565! processors in the communicator. It is called by all the members !
566! in the group. !
567! !
568! On Input: !
569! !
570! ng Nested grid number. !
571! model Calling model identifier. !
572! A Variable to broadcast (real). !
573! InpComm Communicator handle (integer, OPTIONAL). !
574! !
575! On Output: !
576! !
577! A Broadcasted variable. !
578! !
579!***********************************************************************
580!
581! Imported variable declarations.
582!
583 integer, intent(in) :: ng, model
584
585 integer, intent(in), optional :: InpComm
586!
587 real(r8), intent(inout) :: A
588!
589! Local variable declarations
590!
591 integer :: Lstr, MyCOMM, MyError, Npts, Serror
592!
593 character (len=MPI_MAX_ERROR_STRING) :: string
594
595 character (len=*), parameter :: MyFile = &
596 & __FILE__//", mp_bcastf_0d"
597
598# ifdef PROFILE
599!
600!-----------------------------------------------------------------------
601! Turn on time clocks.
602!-----------------------------------------------------------------------
603!
604 CALL wclock_on (ng, model, 64, __line__, myfile)
605# endif
606# ifdef MPI
607!
608!-----------------------------------------------------------------------
609! Set distributed-memory communicator handle (context ID).
610!-----------------------------------------------------------------------
611!
612 IF (PRESENT(inpcomm)) THEN
613 mycomm=inpcomm
614 ELSE
615 mycomm=ocn_comm_world
616 END IF
617# endif
618!
619!-----------------------------------------------------------------------
620! Broadcast requested variable.
621!-----------------------------------------------------------------------
622!
623 npts=1
624# ifdef MPI
625 CALL mpi_bcast (a, npts, mp_float, mymaster, mycomm, myerror)
626 IF (myerror.ne.mpi_success) THEN
627 CALL mpi_error_string (myerror, string, lstr, serror)
628 lstr=len_trim(string)
629 WRITE (stdout,10) 'MPI_BCAST', myrank, myerror, string(1:lstr)
630 10 FORMAT (/,' MP_BCASTF_0D - error during ',a,' call, Task = ', &
631 & i3.3,' Error = ',i3,/,13x,a)
632 exit_flag=2
633 RETURN
634 END IF
635# endif
636# ifdef PROFILE
637!
638!-----------------------------------------------------------------------
639! Turn off time clocks.
640!-----------------------------------------------------------------------
641!
642 CALL wclock_off (ng, model, 64, __line__, myfile)
643# endif
644!
645 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_scalars::exit_flag, mod_parallel::mp_float, 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_bcastf_0dp()

subroutine distribute_mod::mp_bcastf::mp_bcastf_0dp ( integer, intent(in) ng,
integer, intent(in) model,
real(dp), intent(inout) a,
integer, intent(in), optional inpcomm )

Definition at line 195 of file distribute.F.

196!
197!***********************************************************************
198! !
199! This routine broadcasts a double-precision scalar variable to all !
200! processors in the communicator. It is called by all the members in !
201! the group. !
202! !
203! On Input: !
204! !
205! ng Nested grid number. !
206! model Calling model identifier. !
207! A Variable to broadcast (real). !
208! InpComm Communicator handle (integer, OPTIONAL). !
209! !
210! On Output: !
211! !
212! A Broadcasted variable. !
213! !
214!***********************************************************************
215!
216! Imported variable declarations.
217!
218 integer, intent(in) :: ng, model
219
220 integer, intent(in), optional :: InpComm
221
222 real(dp), intent(inout) :: A
223!
224! Local variable declarations
225!
226 integer :: Lstr, MyCOMM, MyError, Npts, Serror
227!
228 character (len=MPI_MAX_ERROR_STRING) :: string
229
230 character (len=*), parameter :: MyFile = &
231 & __FILE__//", mp_bcastf_0dp"
232
233# ifdef PROFILE
234!
235!-----------------------------------------------------------------------
236! Turn on time clocks.
237!-----------------------------------------------------------------------
238!
239 CALL wclock_on (ng, model, 64, __line__, myfile)
240# endif
241# ifdef MPI
242!
243!-----------------------------------------------------------------------
244! Set distributed-memory communicator handle (context ID).
245!-----------------------------------------------------------------------
246!
247 IF (PRESENT(inpcomm)) THEN
248 mycomm=inpcomm
249 ELSE
250 mycomm=ocn_comm_world
251 END IF
252# endif
253!
254!-----------------------------------------------------------------------
255! Broadcast requested variable.
256!-----------------------------------------------------------------------
257!
258 npts=1
259# ifdef MPI
260 CALL mpi_bcast (a, npts, mp_double, mymaster, mycomm, myerror)
261 IF (myerror.ne.mpi_success) THEN
262 CALL mpi_error_string (myerror, string, lstr, serror)
263 lstr=len_trim(string)
264 WRITE (stdout,10) 'MPI_BCAST', myrank, myerror, string(1:lstr)
265 10 FORMAT (/,' MP_BCASTF_0DP - error during ',a,' call, Task = ', &
266 & i3.3,' Error = ',i3,/,13x,a)
267 exit_flag=2
268 RETURN
269 END IF
270# endif
271# ifdef PROFILE
272!
273!-----------------------------------------------------------------------
274! Turn off time clocks.
275!-----------------------------------------------------------------------
276!
277 CALL wclock_off (ng, model, 64, __line__, myfile)
278# endif
279!
280 RETURN

References mod_scalars::exit_flag, mod_parallel::mp_double, 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_bcastf_1d()

subroutine distribute_mod::mp_bcastf::mp_bcastf_1d ( integer, intent(in) ng,
integer, intent(in) model,
real(r8), dimension(:), intent(inout) a,
integer, intent(in), optional inpcomm )

Definition at line 648 of file distribute.F.

649!
650!***********************************************************************
651! !
652! This routine broadcasts a 1D floating-point, non-tiled, array !
653! to all processors in the communicator. It is called by all the !
654! members in the group. !
655! !
656! On Input: !
657! !
658! ng Nested grid number. !
659! model Calling model identifier. !
660! A 1D array to broadcast (real). !
661! InpComm Communicator handle (integer, OPTIONAL). !
662! !
663! On Output: !
664! !
665! A Broadcasted 1D array. !
666! !
667!***********************************************************************
668!
669! Imported variable declarations.
670!
671 integer, intent(in) :: ng, model
672
673 integer, intent(in), optional :: InpComm
674!
675 real(r8), intent(inout) :: A(:)
676!
677! Local variable declarations
678!
679 integer :: Lstr, MyCOMM, MyError, Npts, Serror
680!
681 character (len=MPI_MAX_ERROR_STRING) :: string
682
683 character (len=*), parameter :: MyFile = &
684 & __FILE__//", mp_bcastf_1d"
685
686# ifdef PROFILE
687!
688!-----------------------------------------------------------------------
689! Turn on time clocks.
690!-----------------------------------------------------------------------
691!
692 CALL wclock_on (ng, model, 64, __line__, myfile)
693# endif
694# ifdef MPI
695!
696!-----------------------------------------------------------------------
697! Set distributed-memory communicator handle (context ID).
698!-----------------------------------------------------------------------
699!
700 IF (PRESENT(inpcomm)) THEN
701 mycomm=inpcomm
702 ELSE
703 mycomm=ocn_comm_world
704 END IF
705# endif
706!
707!-----------------------------------------------------------------------
708! Broadcast requested variable.
709!-----------------------------------------------------------------------
710!
711 npts=ubound(a, dim=1)
712
713# ifdef MPI
714 CALL mpi_bcast (a, npts, mp_float, mymaster, mycomm, myerror)
715 IF (myerror.ne.mpi_success) THEN
716 CALL mpi_error_string (myerror, string, lstr, serror)
717 lstr=len_trim(string)
718 WRITE (stdout,10) 'MPI_BCAST', myrank, myerror, string(1:lstr)
719 10 FORMAT (/,' MP_BCASTF_1D - error during ',a,' call, Task = ', &
720 & i3.3,' Error = ',i3,/,13x,a)
721 exit_flag=2
722 RETURN
723 END IF
724# endif
725# ifdef PROFILE
726!
727!-----------------------------------------------------------------------
728! Turn off time clocks.
729!-----------------------------------------------------------------------
730!
731 CALL wclock_off (ng, model, 64, __line__, myfile)
732# endif
733!
734 RETURN

References mod_scalars::exit_flag, mod_parallel::mp_float, 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_bcastf_1dp()

subroutine distribute_mod::mp_bcastf::mp_bcastf_1dp ( integer, intent(in) ng,
integer, intent(in) model,
real(dp), dimension(:), intent(inout) a,
integer, intent(in), optional inpcomm )

Definition at line 283 of file distribute.F.

284!
285!***********************************************************************
286! !
287! This routine broadcasts a 1D double-precission, non-tiled, array !
288! to all processors in the communicator. It is called by all the !
289! members in the group. !
290! !
291! On Input: !
292! !
293! ng Nested grid number. !
294! model Calling model identifier. !
295! A 1D array to broadcast (real). !
296! InpComm Communicator handle (integer, OPTIONAL). !
297! !
298! On Output: !
299! !
300! A Broadcasted 1D array. !
301! !
302!***********************************************************************
303!
304! Imported variable declarations.
305!
306 integer, intent(in) :: ng, model
307
308 integer, intent(in), optional :: InpComm
309!
310 real(dp), intent(inout) :: A(:)
311!
312! Local variable declarations
313!
314 integer :: Lstr, MyCOMM, MyError, Npts, Serror
315!
316 character (len=MPI_MAX_ERROR_STRING) :: string
317
318 character (len=*), parameter :: MyFile = &
319 & __FILE__//", mp_bcastf_1dp"
320
321# ifdef PROFILE
322!
323!-----------------------------------------------------------------------
324! Turn on time clocks.
325!-----------------------------------------------------------------------
326!
327 CALL wclock_on (ng, model, 64, __line__, myfile)
328# endif
329# ifdef MPI
330!
331!-----------------------------------------------------------------------
332! Set distributed-memory communicator handle (context ID).
333!-----------------------------------------------------------------------
334!
335 IF (PRESENT(inpcomm)) THEN
336 mycomm=inpcomm
337 ELSE
338 mycomm=ocn_comm_world
339 END IF
340# endif
341!
342!-----------------------------------------------------------------------
343! Broadcast requested variable.
344!-----------------------------------------------------------------------
345!
346 npts=ubound(a, dim=1)
347
348# ifdef MPI
349 CALL mpi_bcast (a, npts, mp_double, mymaster, mycomm, myerror)
350 IF (myerror.ne.mpi_success) THEN
351 CALL mpi_error_string (myerror, string, lstr, serror)
352 lstr=len_trim(string)
353 WRITE (stdout,10) 'MPI_BCAST', myrank, myerror, string(1:lstr)
354 10 FORMAT (/,' MP_BCASTF_1DP - error during ',a,' call, Task = ', &
355 & i3.3,' Error = ',i3,/,13x,a)
356 exit_flag=2
357 RETURN
358 END IF
359# endif
360# ifdef PROFILE
361!
362!-----------------------------------------------------------------------
363! Turn off time clocks.
364!-----------------------------------------------------------------------
365!
366 CALL wclock_off (ng, model, 64, __line__, myfile)
367# endif
368!
369 RETURN

References mod_scalars::exit_flag, mod_parallel::mp_double, 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_bcastf_2d()

subroutine distribute_mod::mp_bcastf::mp_bcastf_2d ( integer, intent(in) ng,
integer, intent(in) model,
real(r8), dimension(:,:), intent(inout) a,
integer, intent(in), optional inpcomm )

Definition at line 737 of file distribute.F.

738!
739!***********************************************************************
740! !
741! This routine broadcasts a 2D floating-point, non-tiled, array !
742! to all processors in the communicator. It is called by all the !
743! members in the group. !
744! !
745! On Input: !
746! !
747! ng Nested grid number. !
748! model Calling model identifier. !
749! A 2D array to broadcast (real). !
750! InpComm Communicator handle (integer, OPTIONAL). !
751! !
752! On Output: !
753! !
754! A Broadcasted 2D array. !
755! !
756!***********************************************************************
757!
758! Imported variable declarations.
759!
760 integer, intent(in) :: ng, model
761
762 integer, intent(in), optional :: InpComm
763!
764 real(r8), intent(inout) :: A(:,:)
765!
766! Local variable declarations
767!
768 integer :: Lstr, MyCOMM, MyError, Npts, Serror
769
770 integer :: Asize(2)
771!
772 character (len=MPI_MAX_ERROR_STRING) :: string
773
774 character (len=*), parameter :: MyFile = &
775 & __FILE__//", mp_bcastf_2d"
776
777# ifdef PROFILE
778!
779!-----------------------------------------------------------------------
780! Turn on time clocks.
781!-----------------------------------------------------------------------
782!
783 CALL wclock_on (ng, model, 64, __line__, myfile)
784# endif
785# ifdef MPI
786!
787!-----------------------------------------------------------------------
788! Set distributed-memory communicator handle (context ID).
789!-----------------------------------------------------------------------
790!
791 IF (PRESENT(inpcomm)) THEN
792 mycomm=inpcomm
793 ELSE
794 mycomm=ocn_comm_world
795 END IF
796# endif
797!
798!-----------------------------------------------------------------------
799! Broadcast requested variable.
800!-----------------------------------------------------------------------
801!
802 asize(1)=ubound(a, dim=1)
803 asize(2)=ubound(a, dim=2)
804 npts=asize(1)*asize(2)
805
806# ifdef MPI
807 CALL mpi_bcast (a, npts, mp_float, mymaster, mycomm, myerror)
808 IF (myerror.ne.mpi_success) THEN
809 CALL mpi_error_string (myerror, string, lstr, serror)
810 lstr=len_trim(string)
811 WRITE (stdout,10) 'MPI_BCAST', myrank, myerror, string(1:lstr)
812 10 FORMAT (/,' MP_BCASTF_2D - error during ',a,' call, Task = ', &
813 & i3.3,' Error = ',i3,/,13x,a)
814 exit_flag=2
815 RETURN
816 END IF
817# endif
818# ifdef PROFILE
819!
820!-----------------------------------------------------------------------
821! Turn off time clocks.
822!-----------------------------------------------------------------------
823!
824 CALL wclock_off (ng, model, 64, __line__, myfile)
825# endif
826!
827 RETURN

References mod_scalars::exit_flag, mod_parallel::mp_float, 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_bcastf_2dp()

subroutine distribute_mod::mp_bcastf::mp_bcastf_2dp ( integer, intent(in) ng,
integer, intent(in) model,
real(dp), dimension(:,:), intent(inout) a,
integer, intent(in), optional inpcomm )

Definition at line 372 of file distribute.F.

373!
374!***********************************************************************
375! !
376! This routine broadcasts a 2D double-preision, non-tiled, array !
377! to all processors in the communicator. It is called by all the !
378! members in the group. !
379! !
380! On Input: !
381! !
382! ng Nested grid number. !
383! model Calling model identifier. !
384! A 2D array to broadcast (real). !
385! InpComm Communicator handle (integer, OPTIONAL). !
386! !
387! On Output: !
388! !
389! A Broadcasted 2D array. !
390! !
391!***********************************************************************
392!
393! Imported variable declarations.
394!
395 integer, intent(in) :: ng, model
396
397 integer, intent(in), optional :: InpComm
398!
399 real(dp), intent(inout) :: A(:,:)
400!
401! Local variable declarations
402!
403 integer :: Lstr, MyCOMM, MyError, Npts, Serror
404
405 integer :: Asize(2)
406!
407 character (len=MPI_MAX_ERROR_STRING) :: string
408
409 character (len=*), parameter :: MyFile = &
410 & __FILE__//", mp_bcastf_2dp"
411
412# ifdef PROFILE
413!
414!-----------------------------------------------------------------------
415! Turn on time clocks.
416!-----------------------------------------------------------------------
417!
418 CALL wclock_on (ng, model, 64, __line__, myfile)
419# endif
420# ifdef MPI
421!
422!-----------------------------------------------------------------------
423! Set distributed-memory communicator handle (context ID).
424!-----------------------------------------------------------------------
425!
426 IF (PRESENT(inpcomm)) THEN
427 mycomm=inpcomm
428 ELSE
429 mycomm=ocn_comm_world
430 END IF
431# endif
432!
433!-----------------------------------------------------------------------
434! Broadcast requested variable.
435!-----------------------------------------------------------------------
436!
437 asize(1)=ubound(a, dim=1)
438 asize(2)=ubound(a, dim=2)
439 npts=asize(1)*asize(2)
440
441# ifdef MPI
442 CALL mpi_bcast (a, npts, mp_float, mymaster, mycomm, myerror)
443 IF (myerror.ne.mpi_success) THEN
444 CALL mpi_error_string (myerror, string, lstr, serror)
445 lstr=len_trim(string)
446 WRITE (stdout,10) 'MPI_BCAST', myrank, myerror, string(1:lstr)
447 10 FORMAT (/,' MP_BCASTF_2DP - error during ',a,' call, Task = ', &
448 & i3.3,' Error = ',i3,/,13x,a)
449 exit_flag=2
450 RETURN
451 END IF
452# endif
453# ifdef PROFILE
454!
455!-----------------------------------------------------------------------
456! Turn off time clocks.
457!-----------------------------------------------------------------------
458!
459 CALL wclock_off (ng, model, 64, __line__, myfile)
460# endif
461!
462 RETURN

References mod_scalars::exit_flag, mod_parallel::mp_float, 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_bcastf_3d()

subroutine distribute_mod::mp_bcastf::mp_bcastf_3d ( integer, intent(in) ng,
integer, intent(in) model,
real(r8), dimension(:,:,:), intent(inout) a,
integer, intent(in), optional inpcomm )

Definition at line 830 of file distribute.F.

831!
832!***********************************************************************
833! !
834! This routine broadcasts a 3D floating-point, non-tiled, array !
835! to all processors in the communicator. It is called by all the !
836! members in the group. !
837! !
838! On Input: !
839! !
840! ng Nested grid number. !
841! model Calling model identifier. !
842! A 3D array to broadcast (real). !
843! InpComm Communicator handle (integer, OPTIONAL). !
844! !
845! On Output: !
846! !
847! A Broadcasted 3D array. !
848! !
849!***********************************************************************
850!
851! Imported variable declarations.
852!
853 integer, intent(in) :: ng, model
854
855 integer, intent(in), optional :: InpComm
856!
857 real(r8), intent(inout) :: A(:,:,:)
858!
859! Local variable declarations
860!
861 integer :: Lstr, MyCOMM, MyError, Npts, Serror
862
863 integer :: Asize(3)
864!
865 character (len=MPI_MAX_ERROR_STRING) :: string
866
867 character (len=*), parameter :: MyFile = &
868 & __FILE__//", mp_bcastf_3d"
869
870# ifdef PROFILE
871!
872!-----------------------------------------------------------------------
873! Turn on time clocks.
874!-----------------------------------------------------------------------
875!
876 CALL wclock_on (ng, model, 64, __line__, myfile)
877# endif
878# ifdef MPI
879!
880!-----------------------------------------------------------------------
881! Set distributed-memory communicator handle (context ID).
882!-----------------------------------------------------------------------
883!
884 IF (PRESENT(inpcomm)) THEN
885 mycomm=inpcomm
886 ELSE
887 mycomm=ocn_comm_world
888 END IF
889# endif
890!
891!-----------------------------------------------------------------------
892! Broadcast requested variable.
893!-----------------------------------------------------------------------
894!
895 asize(1)=ubound(a, dim=1)
896 asize(2)=ubound(a, dim=2)
897 asize(3)=ubound(a, dim=3)
898 npts=asize(1)*asize(2)*asize(3)
899
900# ifdef MPI
901 CALL mpi_bcast (a, npts, mp_float, mymaster, mycomm, myerror)
902 IF (myerror.ne.mpi_success) THEN
903 CALL mpi_error_string (myerror, string, lstr, serror)
904 lstr=len_trim(string)
905 WRITE (stdout,10) 'MPI_BCAST', myrank, myerror, string(1:lstr)
906 10 FORMAT (/,' MP_BCASTF_3D - error during ',a,' call, Task = ', &
907 & i3.3,' Error = ',i3,/,13x,a)
908 exit_flag=2
909 RETURN
910 END IF
911# endif
912# ifdef PROFILE
913!
914!-----------------------------------------------------------------------
915! Turn off time clocks.
916!-----------------------------------------------------------------------
917!
918 CALL wclock_off (ng, model, 64, __line__, myfile)
919# endif
920!
921 RETURN

References mod_scalars::exit_flag, mod_parallel::mp_float, 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_bcastf_3dp()

subroutine distribute_mod::mp_bcastf::mp_bcastf_3dp ( integer, intent(in) ng,
integer, intent(in) model,
real(dp), dimension(:,:,:), intent(inout) a,
integer, intent(in), optional inpcomm )

Definition at line 465 of file distribute.F.

466!
467!***********************************************************************
468! !
469! This routine broadcasts a 3D double-precision, non-tiled, array !
470! to all processors in the communicator. It is called by all the !
471! members in the group. !
472! !
473! On Input: !
474! !
475! ng Nested grid number. !
476! model Calling model identifier. !
477! A 3D array to broadcast (real). !
478! InpComm Communicator handle (integer, OPTIONAL). !
479! !
480! On Output: !
481! !
482! A Broadcasted 3D array. !
483! !
484!***********************************************************************
485!
486! Imported variable declarations.
487!
488 integer, intent(in) :: ng, model
489
490 integer, intent(in), optional :: InpComm
491!
492 real(dp), intent(inout) :: A(:,:,:)
493!
494! Local variable declarations
495!
496 integer :: Lstr, MyCOMM, MyError, Npts, Serror
497
498 integer :: Asize(3)
499!
500 character (len=MPI_MAX_ERROR_STRING) :: string
501
502 character (len=*), parameter :: MyFile = &
503 & __FILE__//", mp_bcastf_3d"
504
505# ifdef PROFILE
506!
507!-----------------------------------------------------------------------
508! Turn on time clocks.
509!-----------------------------------------------------------------------
510!
511 CALL wclock_on (ng, model, 64, __line__, myfile)
512# endif
513# ifdef MPI
514!
515!-----------------------------------------------------------------------
516! Set distributed-memory communicator handle (context ID).
517!-----------------------------------------------------------------------
518!
519 IF (PRESENT(inpcomm)) THEN
520 mycomm=inpcomm
521 ELSE
522 mycomm=ocn_comm_world
523 END IF
524# endif
525!
526!-----------------------------------------------------------------------
527! Broadcast requested variable.
528!-----------------------------------------------------------------------
529!
530 asize(1)=ubound(a, dim=1)
531 asize(2)=ubound(a, dim=2)
532 asize(3)=ubound(a, dim=3)
533 npts=asize(1)*asize(2)*asize(3)
534
535# ifdef MPI
536 CALL mpi_bcast (a, npts, mp_float, mymaster, mycomm, myerror)
537 IF (myerror.ne.mpi_success) THEN
538 CALL mpi_error_string (myerror, string, lstr, serror)
539 lstr=len_trim(string)
540 WRITE (stdout,10) 'MPI_BCAST', myrank, myerror, string(1:lstr)
541 10 FORMAT (/,' MP_BCASTF_3DP - error during ',a,' call, Task = ', &
542 & i3.3,' Error = ',i3,/,13x,a)
543 exit_flag=2
544 RETURN
545 END IF
546# endif
547# ifdef PROFILE
548!
549!-----------------------------------------------------------------------
550! Turn off time clocks.
551!-----------------------------------------------------------------------
552!
553 CALL wclock_off (ng, model, 64, __line__, myfile)
554# endif
555!
556 RETURN

References mod_scalars::exit_flag, mod_parallel::mp_float, 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_bcastf_4d()

subroutine distribute_mod::mp_bcastf::mp_bcastf_4d ( integer, intent(in) ng,
integer, intent(in) model,
real(r8), dimension(:,:,:,:), intent(inout) a,
integer, intent(in), optional inpcomm )

Definition at line 924 of file distribute.F.

925!
926!***********************************************************************
927! !
928! This routine broadcasts a 4D floating-point, non-tiled, array !
929! to all processors in the communicator. It is called by all the !
930! members in the group. !
931! !
932! On Input: !
933! !
934! ng Nested grid number. !
935! model Calling model identifier. !
936! A 4D array to broadcast (real). !
937! !
938! On Output: !
939! !
940! A Broadcasted 4D array. !
941! !
942!***********************************************************************
943!
944! Imported variable declarations.
945!
946 integer, intent(in) :: ng, model
947
948 integer, intent(in), optional :: InpComm
949!
950 real(r8), intent(inout) :: A(:,:,:,:)
951!
952! Local variable declarations
953!
954 integer :: Lstr, MyCOMM, MyError, Npts, Serror
955
956 integer :: Asize(4)
957!
958 character (len=MPI_MAX_ERROR_STRING) :: string
959
960 character (len=*), parameter :: MyFile = &
961 & __FILE__//", mp_bcastf_4d"
962
963# ifdef PROFILE
964!
965!-----------------------------------------------------------------------
966! Turn on time clocks.
967!-----------------------------------------------------------------------
968!
969 CALL wclock_on (ng, model, 64, __line__, myfile)
970# endif
971# ifdef MPI
972!
973!-----------------------------------------------------------------------
974! Set distributed-memory communicator handle (context ID).
975!-----------------------------------------------------------------------
976!
977 IF (PRESENT(inpcomm)) THEN
978 mycomm=inpcomm
979 ELSE
980 mycomm=ocn_comm_world
981 END IF
982# endif
983!
984!-----------------------------------------------------------------------
985! Broadcast requested variable.
986!-----------------------------------------------------------------------
987!
988 asize(1)=ubound(a, dim=1)
989 asize(2)=ubound(a, dim=2)
990 asize(3)=ubound(a, dim=3)
991 asize(4)=ubound(a, dim=4)
992 npts=asize(1)*asize(2)*asize(3)*asize(4)
993
994# ifdef MPI
995 CALL mpi_bcast (a, npts, mp_float, mymaster, mycomm, myerror)
996 IF (myerror.ne.mpi_success) THEN
997 CALL mpi_error_string (myerror, string, lstr, serror)
998 lstr=len_trim(string)
999 WRITE (stdout,10) 'MPI_BCAST', myrank, myerror, string(1:lstr)
1000 10 FORMAT (/,' MP_BCASTF_4D - error during ',a,' call, Task = ', &
1001 & i3.3,' Error = ',i3,/,13x,a)
1002 exit_flag=2
1003 RETURN
1004 END IF
1005# endif
1006# ifdef PROFILE
1007!
1008!-----------------------------------------------------------------------
1009! Turn off time clocks.
1010!-----------------------------------------------------------------------
1011!
1012 CALL wclock_off (ng, model, 64, __line__, myfile)
1013# endif
1014!
1015 RETURN

References mod_scalars::exit_flag, mod_parallel::mp_float, 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: