76 | | If the numerical model is not parallelized (i.e. serial), we need to add the parallelization for the ensemble. We follow here the approach used in the tutorial code `tutorial/online_2D_serialmodel`. The files `mod_parallel_pdaf.F90`, `init_parallel_pdaf.F90`, `finalize_pdaf.F90` (and `parser_mpi.F90`) can be directly used. Note, the `init_parallel_pdaf` uses command-line parsing (from `parser_mpi.F90`) to read the number of model tasks (`n_modeltasks`) from the command line (specifying `-ens N_MODELTASKS`, where N_MODELTASKS should be the ensmeble size). One can replace this, e.g., by reading from a configuration file. |
| 76 | === The adaptions in short === |
| 77 | |
| 78 | If you are experienced with MPI, the steps are the following using the files `mod_parallel_pdaf.F90`, `init_parallel_pdaf.F90`, `finalize_pdaf.F90` and `parser_mpi.F90` from `tutorial/online_2D_serialmodel`. |
| 79 | 1. Insert `CALL init_parallel_pdaf(0, 1)` at the beginning of the main program. This routine will also call `MPI_Init`. |
| 80 | 1. Insert `CALL finalize_pdaf()` at the end of the main program. This routine will also finalize MPI. |
| 81 | 1. The number of model tasks in variable `n_modeltasks` is determined in `init_parallel_pdaf` by command line parsing (it is parsing for `dim_ens`, thus setting `-dim_ens N_MODELTASKS`, where N_MODELTASKS should be the ensemble size). One could also read the value from a configuration file. |
| 82 | |
| 83 | |
| 84 | === Details on adapting a serial model === |
| 85 | |
| 86 | If the numerical model is not parallelized (i.e. serial), we need to add the parallelization for the ensemble. We follow here the approach used in the tutorial code `tutorial/online_2D_serialmodel`. The files `mod_parallel_pdaf.F90`, `init_parallel_pdaf.F90`, `finalize_pdaf.F90` (and `parser_mpi.F90`) can be directly used. Note, the `init_parallel_pdaf` uses command-line parsing (from `parser_mpi.F90`) to read the number of model tasks (`n_modeltasks`) from the command line (specifying `-dim_ens N_MODELTASKS`, where N_MODELTASKS should be the ensemble size). One can replace this, e.g., by reading from a configuration file. |