New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 15276 for NEMO/branches/UKMO/NEMO_4.0.1_NGMS_couple_stage3_spmd/src/OCE/LBC/lib_mpp.F90 – NEMO

Ignore:
Timestamp:
2021-09-21T17:32:52+02:00 (17 months ago)
Author:
vsmart
Message:

Merge in changes from couple_stage2_spmd branch to allow for running from the Fortran cap

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/UKMO/NEMO_4.0.1_NGMS_couple_stage3_spmd/src/OCE/LBC/lib_mpp.F90

    r13311 r15276  
    5858   ! 
    5959   PUBLIC   ctl_stop, ctl_warn, ctl_opn, ctl_nam 
     60   PUBLIC   set_mpi_pre_initialised 
    6061   PUBLIC   mpp_start, mppstop, mppsync, mpp_comm_free 
    6162   PUBLIC   mpp_ini_north 
     
    100101!$AGRIF_END_DO_NOT_TREAT 
    101102   LOGICAL, PUBLIC, PARAMETER ::   lk_mpp = .TRUE.    !: mpp flag 
     103   LOGICAL, PUBLIC            ::   mpi_pre_initialised = .FALSE. 
    102104#else    
    103105   INTEGER, PUBLIC, PARAMETER ::   MPI_STATUS_SIZE = 1 
     
    176178   !!---------------------------------------------------------------------- 
    177179CONTAINS 
     180 
     181   SUBROUTINE set_mpi_pre_initialised() 
     182      !!---------------------------------------------------------------------- 
     183      !!                  ***  routine set_mpi_pre_initialised  *** 
     184      !! 
     185      !! ** Purpose :   set global variable mpi_pre_initialised 
     186      !!---------------------------------------------------------------------- 
     187      INTEGER ::   ierr 
     188      !!---------------------------------------------------------------------- 
     189#if defined key_mpp_mpi 
     190      call mpi_initialized(mpi_pre_initialised, ierr) 
     191#endif 
     192      ! 
     193   END SUBROUTINE set_mpi_pre_initialised 
    178194 
    179195   SUBROUTINE mpp_start( localComm ) 
     
    692708      ELSE 
    693709         CALL mppsync 
    694          CALL mpi_finalize( info ) 
     710         IF (.NOT. mpi_pre_initialised) THEN 
     711             CALL mpi_finalize( info ) 
     712         ENDIF 
    695713      ENDIF 
    696714      IF( ll_abort ) STOP 123 
Note: See TracChangeset for help on using the changeset viewer.