[Dart-dev] [3328] DART/branches/nancy_work: My test branch only; commit test code for calling

nancy at subversion.ucar.edu nancy at subversion.ucar.edu
Thu May 8 16:54:28 MDT 2008


An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/dart-dev/attachments/20080508/5a0df467/attachment.html
-------------- next part --------------
Modified: DART/branches/nancy_work/models/lorenz_96/work/path_names_create_fixed_network_seq
===================================================================
--- DART/branches/nancy_work/models/lorenz_96/work/path_names_create_fixed_network_seq	2008-05-06 15:34:44 UTC (rev 3327)
+++ DART/branches/nancy_work/models/lorenz_96/work/path_names_create_fixed_network_seq	2008-05-08 22:54:27 UTC (rev 3328)
@@ -10,4 +10,5 @@
 random_nr/random_nr_mod.f90
 time_manager/time_manager_mod.f90
 utilities/utilities_mod.f90
+mpi_utilities/null_mpi_utilities_mod.f90
 cov_cutoff/cov_cutoff_mod.f90

Modified: DART/branches/nancy_work/models/lorenz_96/work/path_names_filter
===================================================================
--- DART/branches/nancy_work/models/lorenz_96/work/path_names_filter	2008-05-06 15:34:44 UTC (rev 3327)
+++ DART/branches/nancy_work/models/lorenz_96/work/path_names_filter	2008-05-08 22:54:27 UTC (rev 3328)
@@ -18,4 +18,4 @@
 random_nr/random_nr_mod.f90
 time_manager/time_manager_mod.f90
 utilities/utilities_mod.f90
-mpi_utilities/null_mpi_utilities_mod.f90
+mpi_utilities/mpi_utilities_mod.f90

Modified: DART/branches/nancy_work/models/lorenz_96/work/path_names_merge_obs_seq
===================================================================
--- DART/branches/nancy_work/models/lorenz_96/work/path_names_merge_obs_seq	2008-05-06 15:34:44 UTC (rev 3327)
+++ DART/branches/nancy_work/models/lorenz_96/work/path_names_merge_obs_seq	2008-05-08 22:54:27 UTC (rev 3328)
@@ -11,3 +11,4 @@
 random_nr/random_nr_mod.f90
 time_manager/time_manager_mod.f90
 utilities/utilities_mod.f90
+mpi_utilities/null_mpi_utilities_mod.f90

Modified: DART/branches/nancy_work/models/lorenz_96/work/path_names_obs_diag
===================================================================
--- DART/branches/nancy_work/models/lorenz_96/work/path_names_obs_diag	2008-05-06 15:34:44 UTC (rev 3327)
+++ DART/branches/nancy_work/models/lorenz_96/work/path_names_obs_diag	2008-05-08 22:54:27 UTC (rev 3328)
@@ -11,3 +11,4 @@
 random_nr/random_nr_mod.f90
 assim_model/assim_model_mod.f90
 models/lorenz_96/model_mod.f90
+mpi_utilities/null_mpi_utilities_mod.f90

Modified: DART/branches/nancy_work/models/lorenz_96/work/path_names_preprocess
===================================================================
--- DART/branches/nancy_work/models/lorenz_96/work/path_names_preprocess	2008-05-06 15:34:44 UTC (rev 3327)
+++ DART/branches/nancy_work/models/lorenz_96/work/path_names_preprocess	2008-05-08 22:54:27 UTC (rev 3328)
@@ -1,3 +1,5 @@
 preprocess/preprocess.f90
 common/types_mod.f90
+time_manager/time_manager_mod.f90
 utilities/utilities_mod.f90
+mpi_utilities/null_mpi_utilities_mod.f90

Modified: DART/branches/nancy_work/models/wrf/work/path_names_convertdate
===================================================================
--- DART/branches/nancy_work/models/wrf/work/path_names_convertdate	2008-05-06 15:34:44 UTC (rev 3327)
+++ DART/branches/nancy_work/models/wrf/work/path_names_convertdate	2008-05-08 22:54:27 UTC (rev 3328)
@@ -1,4 +1,5 @@
+models/wrf/WRF_DART_utilities/convertdate.f90
 common/types_mod.f90
 time_manager/time_manager_mod.f90
 utilities/utilities_mod.f90
-models/wrf/WRF_DART_utilities/convertdate.f90
+mpi_utilities/null_mpi_utilities_mod.f90

Modified: DART/branches/nancy_work/models/wrf/work/path_names_dart_tf_wrf
===================================================================
--- DART/branches/nancy_work/models/wrf/work/path_names_dart_tf_wrf	2008-05-06 15:34:44 UTC (rev 3327)
+++ DART/branches/nancy_work/models/wrf/work/path_names_dart_tf_wrf	2008-05-08 22:54:27 UTC (rev 3328)
@@ -9,4 +9,5 @@
 random_seq/random_seq_mod.f90
 random_nr/random_nr_mod.f90
 utilities/utilities_mod.f90
+mpi_utilities/null_mpi_utilities_mod.f90
 time_manager/time_manager_mod.f90

Modified: DART/branches/nancy_work/models/wrf/work/path_names_ensemble_init
===================================================================
--- DART/branches/nancy_work/models/wrf/work/path_names_ensemble_init	2008-05-06 15:34:44 UTC (rev 3327)
+++ DART/branches/nancy_work/models/wrf/work/path_names_ensemble_init	2008-05-08 22:54:27 UTC (rev 3328)
@@ -3,3 +3,4 @@
 common/types_mod.f90
 time_manager/time_manager_mod.f90
 utilities/utilities_mod.f90
+mpi_utilities/null_mpi_utilities_mod.f90

Modified: DART/branches/nancy_work/models/wrf/work/path_names_extract
===================================================================
--- DART/branches/nancy_work/models/wrf/work/path_names_extract	2008-05-06 15:34:44 UTC (rev 3327)
+++ DART/branches/nancy_work/models/wrf/work/path_names_extract	2008-05-08 22:54:27 UTC (rev 3328)
@@ -1,3 +1,5 @@
 models/wrf/WRF_DART_utilities/extract.f90
 common/types_mod.f90
 utilities/utilities_mod.f90
+mpi_utilities/null_mpi_utilities_mod.f90
+time_manager/time_manager_mod.f90

Modified: DART/branches/nancy_work/models/wrf/work/path_names_filter
===================================================================
--- DART/branches/nancy_work/models/wrf/work/path_names_filter	2008-05-06 15:34:44 UTC (rev 3327)
+++ DART/branches/nancy_work/models/wrf/work/path_names_filter	2008-05-08 22:54:27 UTC (rev 3328)
@@ -19,4 +19,4 @@
 time_manager/time_manager_mod.f90
 reg_factor/reg_factor_mod.f90
 ensemble_manager/ensemble_manager_mod.f90
-mpi_utilities/null_mpi_utilities_mod.f90
+mpi_utilities/mpi_utilities_mod.f90

Modified: DART/branches/nancy_work/models/wrf/work/path_names_merge_obs_seq
===================================================================
--- DART/branches/nancy_work/models/wrf/work/path_names_merge_obs_seq	2008-05-06 15:34:44 UTC (rev 3327)
+++ DART/branches/nancy_work/models/wrf/work/path_names_merge_obs_seq	2008-05-08 22:54:27 UTC (rev 3328)
@@ -12,3 +12,4 @@
 random_nr/random_nr_mod.f90
 time_manager/time_manager_mod.f90
 utilities/utilities_mod.f90
+mpi_utilities/null_mpi_utilities_mod.f90

Modified: DART/branches/nancy_work/models/wrf/work/path_names_obs_diag
===================================================================
--- DART/branches/nancy_work/models/wrf/work/path_names_obs_diag	2008-05-06 15:34:44 UTC (rev 3327)
+++ DART/branches/nancy_work/models/wrf/work/path_names_obs_diag	2008-05-08 22:54:27 UTC (rev 3328)
@@ -12,3 +12,4 @@
 common/types_mod.f90
 time_manager/time_manager_mod.f90
 utilities/utilities_mod.f90
+mpi_utilities/null_mpi_utilities_mod.f90

Modified: DART/branches/nancy_work/models/wrf/work/path_names_pert_wrf_bc
===================================================================
--- DART/branches/nancy_work/models/wrf/work/path_names_pert_wrf_bc	2008-05-06 15:34:44 UTC (rev 3327)
+++ DART/branches/nancy_work/models/wrf/work/path_names_pert_wrf_bc	2008-05-08 22:54:27 UTC (rev 3328)
@@ -5,3 +5,4 @@
 common/types_mod.f90
 time_manager/time_manager_mod.f90
 utilities/utilities_mod.f90
+mpi_utilities/null_mpi_utilities_mod.f90

Modified: DART/branches/nancy_work/models/wrf/work/path_names_preprocess
===================================================================
--- DART/branches/nancy_work/models/wrf/work/path_names_preprocess	2008-05-06 15:34:44 UTC (rev 3327)
+++ DART/branches/nancy_work/models/wrf/work/path_names_preprocess	2008-05-08 22:54:27 UTC (rev 3328)
@@ -1,3 +1,5 @@
 preprocess/preprocess.f90
 common/types_mod.f90
 utilities/utilities_mod.f90
+mpi_utilities/null_mpi_utilities_mod.f90
+time_manager/time_manager_mod.f90

Modified: DART/branches/nancy_work/models/wrf/work/path_names_select
===================================================================
--- DART/branches/nancy_work/models/wrf/work/path_names_select	2008-05-06 15:34:44 UTC (rev 3327)
+++ DART/branches/nancy_work/models/wrf/work/path_names_select	2008-05-08 22:54:27 UTC (rev 3328)
@@ -11,3 +11,4 @@
 models/wrf/module_map_utils.f90
 common/types_mod.f90
 utilities/utilities_mod.f90
+mpi_utilities/null_mpi_utilities_mod.f90

Modified: DART/branches/nancy_work/models/wrf/work/path_names_update_wrf_bc
===================================================================
--- DART/branches/nancy_work/models/wrf/work/path_names_update_wrf_bc	2008-05-06 15:34:44 UTC (rev 3327)
+++ DART/branches/nancy_work/models/wrf/work/path_names_update_wrf_bc	2008-05-08 22:54:27 UTC (rev 3328)
@@ -5,3 +5,4 @@
 common/types_mod.f90
 time_manager/time_manager_mod.f90
 utilities/utilities_mod.f90
+mpi_utilities/null_mpi_utilities_mod.f90

Modified: DART/branches/nancy_work/models/wrf/work/path_names_wakeup_filter
===================================================================
--- DART/branches/nancy_work/models/wrf/work/path_names_wakeup_filter	2008-05-06 15:34:44 UTC (rev 3327)
+++ DART/branches/nancy_work/models/wrf/work/path_names_wakeup_filter	2008-05-08 22:54:27 UTC (rev 3328)
@@ -2,4 +2,4 @@
 common/types_mod.f90
 time_manager/time_manager_mod.f90
 utilities/utilities_mod.f90
-mpi_utilities/null_mpi_utilities_mod.f90
+mpi_utilities/mpi_utilities_mod.f90

Modified: DART/branches/nancy_work/mpi_utilities/mpi_utilities_mod.f90
===================================================================
--- DART/branches/nancy_work/mpi_utilities/mpi_utilities_mod.f90	2008-05-06 15:34:44 UTC (rev 3327)
+++ DART/branches/nancy_work/mpi_utilities/mpi_utilities_mod.f90	2008-05-08 22:54:27 UTC (rev 3328)
@@ -191,7 +191,7 @@
 
 
 public :: initialize_mpi_utilities, finalize_mpi_utilities,                  &
-          task_count, my_task_id, block_task, restart_task, exit_all,        &
+          task_count, my_task_id, block_task, restart_task,                  &
           task_sync, array_broadcast, send_to, receive_from, iam_task0,      &
           broadcast_send, broadcast_recv, shell_execute, sleep_seconds,      &
           sum_across_tasks
@@ -224,14 +224,14 @@
 ! at link time about an undefined symbol (something like '_system_') then
 ! comment this interface block in and try again.
  
-! ! interface block for getting return code back from system() routine
-! interface
-!  function system(string)
-!   character(len=*) :: string
-!   integer :: system
-!  end function system
-! end interface
-! ! end block
+ ! interface block for getting return code back from system() routine
+ interface
+  function system(string)
+   character(len=*) :: string
+   integer :: system
+  end function system
+ end interface
+ ! end block
 
 contains
 
@@ -645,25 +645,7 @@
 end subroutine receive_from
 
 
-!-----------------------------------------------------------------------------
 
-subroutine exit_all(exit_code)
- integer, intent(in) :: exit_code
-
-! In case of error, call this instead of the fortran intrinsic exit().
-! It will signal the other MPI tasks that something bad happened and they
-! should also exit.
-
-integer :: ierror
-
-! do not bother testing here if the init code was called; we are trying 
-! to exit in case of error and we want to take the other tasks down with us.
-
-   call MPI_Abort(my_local_comm, exit_code, ierror)
-
-end subroutine exit_all
-
-
 !-----------------------------------------------------------------------------
 ! TODO: do i need to overload this for both integer and real?
 !       do i need to handle 1D, 2D, 3D inputs?
@@ -1445,3 +1427,26 @@
 
 end module mpi_utilities_mod
 
+!-----------------------------------------------------------------------------
+!-----------------------------------------------------------------------------
+! NOTE -- non-module code, so this subroutine can be called from the
+!  utilities module, which this module uses (and cannot have circular refs)
+!-----------------------------------------------------------------------------
+!-----------------------------------------------------------------------------
+
+subroutine exit_all(exit_code)
+ integer, intent(in) :: exit_code
+
+! In case of error, call this instead of the fortran intrinsic exit().
+! It will signal the other MPI tasks that something bad happened and they
+! should also exit.
+
+integer :: ierror
+
+! do not bother testing here if the init code was called; we are trying 
+! to exit in case of error and we want to take the other tasks down with us.
+
+   call MPI_Abort(my_local_comm, exit_code, ierror)
+
+end subroutine exit_all
+

Modified: DART/branches/nancy_work/mpi_utilities/null_mpi_utilities_mod.f90
===================================================================
--- DART/branches/nancy_work/mpi_utilities/null_mpi_utilities_mod.f90	2008-05-06 15:34:44 UTC (rev 3327)
+++ DART/branches/nancy_work/mpi_utilities/null_mpi_utilities_mod.f90	2008-05-08 22:54:27 UTC (rev 3328)
@@ -151,7 +151,7 @@
 use utilities_mod, only    : register_module, error_handler,             &
                              initialize_utilities, get_unit, close_file, & 
                              E_ERR, E_WARN, E_MSG, E_DBG
-use time_manager_mod, only : time_type, get_time, set_time
+use time_manager_mod, only : time_type, set_time
 
 
 implicit none
@@ -166,7 +166,7 @@
 integer :: comm_size       ! if ens count < tasks, only the first N participate
 
 public :: initialize_mpi_utilities, finalize_mpi_utilities,                  &
-          task_count, my_task_id, block_task, restart_task, exit_all,        &
+          task_count, my_task_id, block_task, restart_task,                  &
           task_sync, array_broadcast, send_to, receive_from, iam_task0,      &
           broadcast_send, broadcast_recv, shell_execute, sleep_seconds,      &
           sum_across_tasks
@@ -199,14 +199,14 @@
 ! at link time about an undefined symbol (something like '_system_') then
 ! comment this interface block in and try again.
 
-! ! interface block for getting return code back from system() routine
-! interface
-!  function system(string)
-!   character(len=*) :: string
-!   integer :: system
-!  end function system
-! end interface
-! ! end block
+ ! interface block for getting return code back from system() routine
+ interface
+  function system(string)
+   character(len=*) :: string
+   integer :: system
+  end function system
+ end interface
+ ! end block
 
 
 contains
@@ -388,18 +388,7 @@
 end subroutine receive_from
 
 
-!-----------------------------------------------------------------------------
 
-subroutine exit_all(exit_code)
- integer, intent(in) :: exit_code
-
-! Call exit with the specified code.
-
-   call exit(exit_code)
-
-end subroutine exit_all
-
-
 !-----------------------------------------------------------------------------
 ! TODO: do i need to overload this for both integer and real?
 !       do i need to handle 1D, 2D, 3D inputs?
@@ -787,3 +776,20 @@
 
 end module mpi_utilities_mod
 
+!-----------------------------------------------------------------------------
+!-----------------------------------------------------------------------------
+! NOTE -- non-module code, so this subroutine can be called from the
+!  utilities module, which this module uses (and cannot have circular refs)
+!-----------------------------------------------------------------------------
+!-----------------------------------------------------------------------------
+
+!-----------------------------------------------------------------------------
+
+subroutine exit_all(exit_code)
+ integer, intent(in) :: exit_code
+
+! Call exit with the specified code.
+
+   call exit(exit_code)
+
+end subroutine exit_all

Modified: DART/branches/nancy_work/utilities/utilities_mod.f90
===================================================================
--- DART/branches/nancy_work/utilities/utilities_mod.f90	2008-05-06 15:34:44 UTC (rev 3327)
+++ DART/branches/nancy_work/utilities/utilities_mod.f90	2008-05-08 22:54:27 UTC (rev 3328)
@@ -98,6 +98,18 @@
        E_DBG, E_MSG, E_WARN, E_ERR, & 
        DEBUG, MESSAGE, WARNING, FATAL
 
+! this routine is either in the null_mpi_utilities_mod.f90, or in
+! the mpi_utilities_mod.f90 file, but it is not a module subroutine.
+! the mpi files use this one, and you cannot have circular module
+! references.  the point of this call is that in the mpi multi-task
+! case, you want to call MPI_Abort() to kill the other tasks associated
+! with this job when you exit.
+interface
+ subroutine exit_all(exitval)
+  integer :: exitval
+ end subroutine exit_all
+end interface
+
 ! version controlled file description for error handling, do not edit
 character(len=128), parameter :: &
    source   = "$URL$", &
@@ -165,7 +177,7 @@
          if ( logfileunit < 0 ) then
             write(*,*)'   unable to get a unit to use for the logfile.'
             write(*,*)'   stopping.'
-            stop 99
+            call exit_all(77)
          endif
 
          if (present(alternatename)) then
@@ -187,7 +199,7 @@
             write(*,*)'   unable to open the logfile.'
             write(*,*)'   the intended file name was <',trim(lname),'>'
             write(*,*)'   stopping.'
-            stop 99
+            call exit_all(77)
          endif
 
          ! Log the run-time 
@@ -547,7 +559,7 @@
              case default
                 print *, ' ERROR in ',routine(1:len_trim(routine))
                 print *, ' ',message(1:len_trim(message))
-                stop 99
+                call exit_all(99)
           end select
 
 !         --------------------------------------------
@@ -645,7 +657,7 @@
 end select
 
 ! TERMLEVEL gets set in the namelist
-if( level >= TERMLEVEL ) call exit( 99 ) 
+if( level >= TERMLEVEL ) call exit_all( 99 ) 
 
 end subroutine error_handler
 
@@ -958,7 +970,7 @@
             write(*,*)'  ',trim(source)
             write(*,*)'  ',trim(revision)
             write(*,*)'  ',trim(revdate)
-            stop 
+            call exit_all(88) 
          endif
       else
          if(trim(adjustl(nml_string)) == trim(adjustl(test_string))) then
@@ -980,7 +992,7 @@
       write(*,*)'  ',trim(source)
       write(*,*)'  ',trim(revision)
       write(*,*)'  ',trim(revdate)
-      stop 
+      call exit_all(88) 
    endif
 endif
 
@@ -1032,7 +1044,7 @@
          write(*,*)'  ',trim(source)
          write(*,*)'  ',trim(revision)
          write(*,*)'  ',trim(revdate)
-         stop 
+         call exit_all(66) 
       endif
    else
       ! Didn't fall off end so bad entry in the middle of namelist
@@ -1056,7 +1068,7 @@
          write(*,*)'  ',trim(source)
          write(*,*)'  ',trim(revision)
          write(*,*)'  ',trim(revdate)
-         stop 
+         call exit_all(66) 
       endif
    endif
 endif


More information about the Dart-dev mailing list