Changes between Initial Version and Version 1 of PDAF3_init_parallel


Ignore:
Timestamp:
Mar 27, 2026, 7:03:40 PM (4 days ago)
Author:
lnerger
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PDAF3_init_parallel

    v1 v1  
     1= PDAF3_init_parallel =
     2
     3This page documents the routine `PDAF3_init_parallel` of PDAF. The routine was introduced with PDAF V3.1.
     4
     5The routine `PDAF3_set_parallel` is called in `init_parallel_pdaf` to initialize the parallelization configuration inside PDAF and return the information to the user code.
     6
     7Note: In PDAF V3.0, the actual initialization of the parallelization was done directly in `init_parallel_pdaf` and then provided to PDAF by calling [wiki:PDAF3_set_parallel]. In PDAF V3.1 and later one does no longer need this functionality in the user code.
     8
     9For calling the routine one sets the ensemble size (`dim_ens`) and number of parallel model tasks (`n_modeltasks`). In addition, one provides the MPI communicator that was initialized by the model (`COMM_model`) or the main program in case of offline coupled DA. The routine updates the model communicator for the ensemble setup. Further, it provides the rank and size information for the model commuicator. Further the communicator of processes that execute the analysis step (`COMM_assim`) and the related process rank and size information is provided. The latter can be used in call-back routines that are executed during the analysis step.
     10
     11
     12The interface is the following:
     13{{{
     14  SUBROUTINE PDAF3_init_parallel(screen, type_parallel, online_coupling, n_modeltasks, dim_ens, &
     15       COMM_model, mype_model, npes_model, COMM_assim, mype_assim, npes_assim, &
     16       task_id)
     17
     18    INTEGER, INTENT(in)    :: screen          ! >0 for display information about the parallelization setup
     19
     20    ! Input variables
     21    INTEGER, INTENT(in) :: type_parallel      ! Type of parallelization (currently not uesed)
     22    INTEGER, INTENT(in) :: online_cpl         ! 1: online DA coupling, 0: offline DA coupling
     23    INTEGER, INTENT(in) :: dim_ens            ! Ensemble size
     24
     25    ! Input variable that might be updated in the routine
     26    INTEGER, INTENT(inout) :: n_modeltasks    ! Number of model tasks
     27    INTEGER, INTENT(out) :: COMM_model        ! Input: Model MPI communicator
     28                                              ! Output: Model communicator split for model tasks
     29
     30    ! Output variables
     31    INTEGER, INTENT(out) :: npes_model        ! Number of Processs in COMM_model
     32    INTEGER, INTENT(out) :: mype_model        ! Process rank in COMM_model
     33    INTEGER, INTENT(out) :: COMM_assim        ! MPI communicator for assimilation processes
     34    INTEGER, INTENT(out) :: npes_assim        ! Number of processes in COMM_assim
     35    INTEGER, INTENT(out) :: mype_assim        ! Process rank in COMM_assim
     36    INTEGER, INTENT(out) :: task_id           ! Index of my model task (1,...,n_modeltasks)
     37}}}
     38
     39Notes:
     40* The configuration of the parallelization is what we found to be 'typically working'. If one has a particular case, one can instead do the communicator configuration in the user code and then call [wiki:PDAF3_set_parallel] to provide PDAF with the configuration.
     41* In cases that the ensemble parallelization is readily prepared by the model, one can directly use [wiki:PDAF3_set_parallel] to provide PDAF with the configuration of the parallelization.
     42* The template and tutorial codes show the use of `PDAF3_init_parallel` in the file `init_parallel_pdaf.F90`.
     43* For the offline DA coupling, the routine always sets `n_modeltasks=1` independent of the input value.