Changeset 3810 for LMDZ6/branches


Ignore:
Timestamp:
Jan 28, 2021, 2:08:14 PM (4 years ago)
Author:
lguez
Message:

Bug fix: do not finalize XIOS context

Replace call to finalize_parallel by calls to mpi_finalize and
xios_finalize. The difference is that finalize_parallel also calls
xios_context_finalize. This crashed ce0l because the context is not
initialized in ce0l. The bug was introduced in revision [3501].

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/branches/Ocean_skin/libf/dynphy_lonlat/phylmd/ce0l.F90

    r3501 r3810  
    2929  USE iniphysiq_mod,  ONLY: iniphysiq
    3030  USE mod_const_mpi,  ONLY: comm_lmdz
     31
    3132#ifdef CPP_PARA
    3233  USE mod_const_mpi,  ONLY: init_const_mpi
    33   USE parallel_lmdz,  ONLY: init_parallel, mpi_rank, omp_rank, finalize_parallel
     34  USE parallel_lmdz,  ONLY: init_parallel, mpi_rank, omp_rank, using_mpi
    3435  USE bands,          ONLY: read_distrib, distrib_phys
    3536  USE mod_hallo,      ONLY: init_mod_hallo
    3637  USE mod_interface_dyn_phys, ONLY: init_interface_dyn_phys
    37 #endif
     38#ifdef CPP_XIOS
     39  USE xios, only: xios_finalize
     40#endif
     41#endif
     42
    3843  USE comconst_mod, ONLY: cpp, daysec, dtphys, dtvr, g, kappa, omeg, r, rad, &
    3944                          pi, jmp1
     
    5055  include "comgeom2.h"
    5156  include "iniprint.h"
     57#ifdef CPP_MPI
     58  include 'mpif.h'
     59#endif
     60 
    5261  REAL               :: masque(iip1,jjp1)             !--- CONTINENTAL MASK
    5362  REAL               :: phis  (iip1,jjp1)             !--- GROUND GEOPOTENTIAL
     
    6776  REAL, ALLOCATABLE  :: masktmp(:)
    6877
    69 #ifndef CPP_PARA
     78#ifdef CPP_PARA
     79  integer ierr
     80#else
    7081! for iniphysiq in serial mode
    7182  INTEGER,PARAMETER :: mpi_rank=0
     
    168179    ocemask = ocetmp
    169180    IF(dlat_omask(1)<dlat_omask(jml_omask)) THEN
    170       DO j=1,jjp1; ocemask(:,j) = ocetmp(:,jjp1-j+1); END DO
     181       DO j=1,jjp1
     182          ocemask(:,j) = ocetmp(:,jjp1-j+1)
     183       END DO
    171184    END IF
    172185    DEALLOCATE(ocetmp,lon_omask,lat_omask,dlon_omask,dlat_omask)
     
    239252#ifdef CPP_PARA
    240253  END IF
    241   call finalize_parallel
     254#ifdef CPP_XIOS
     255  CALL xios_finalize
     256#endif
     257#ifdef CPP_MPI
     258  IF (using_mpi) call MPI_FINALIZE(ierr)
     259#endif
    242260#endif
    243261
Note: See TracChangeset for help on using the changeset viewer.