Skip to content

Commit

Permalink
Merge pull request #487 from FESOM/refactoring_razvan_multio
Browse files Browse the repository at this point in the history
Refactoring razvan multio
  • Loading branch information
suvarchal authored Aug 11, 2023
2 parents cdd9a2b + 8f402d8 commit 0582658
Show file tree
Hide file tree
Showing 8 changed files with 737 additions and 70 deletions.
5 changes: 3 additions & 2 deletions src/MOD_PARTIT.F90
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ module MOD_PARTIT
integer :: eDim_nod2D
integer, allocatable, dimension(:) :: myList_nod2D

integer :: myDim_elem2D
integer :: myDim_elem2D, myDim_elem2D_shrinked
integer :: eDim_elem2D
integer :: eXDim_elem2D
integer, allocatable, dimension(:) :: myList_elem2D
integer, allocatable, dimension(:) :: myList_elem2D, myInd_elem2D_shrinked

integer :: myDim_edge2D
integer :: eDim_edge2D
Expand All @@ -75,6 +75,7 @@ module MOD_PARTIT
integer, allocatable :: s_mpitype_nod3D(:,:,:), r_mpitype_nod3D(:,:,:)

integer :: MPIERR

!!! remPtr_* are constructed during the runtime and shall not be dumped!!!
integer, allocatable :: remPtr_nod2D(:), remList_nod2D(:)
integer, allocatable :: remPtr_elem2D(:), remList_elem2D(:)
Expand Down
7 changes: 7 additions & 0 deletions src/fesom_module.F90
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ module fesom_module

subroutine fesom_init(fesom_total_nsteps)
use fesom_main_storage_module
#if defined(__MULTIO)
use iom
#endif
integer, intent(out) :: fesom_total_nsteps
! EO parameters
logical mpi_is_initialized
Expand Down Expand Up @@ -243,6 +246,10 @@ subroutine fesom_init(fesom_total_nsteps)
write(*,*) '============================================'
endif

#if defined(__MULTIO)
call iom_send_fesom_domains(f%partit, f%mesh)
#endif

! f%dump_dir='DUMP/'
! INQUIRE(file=trim(f%dump_dir), EXIST=f%L_EXISTS)
! if (.not. f%L_EXISTS) call system('mkdir '//trim(f%dump_dir))
Expand Down
40 changes: 40 additions & 0 deletions src/ifs_interface/ifs_interface.F90
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,46 @@ MODULE nemogcmcoup_steps
INTEGER :: substeps !per IFS timestep
END MODULE nemogcmcoup_steps

#if defined(__MULTIO)
SUBROUTINE nemogcmcoup_init_ioserver( icomm, lnemoioserver, irequired, iprovided, lmpi1)

! Initialize the NEMO mppio server
USE mpp_io

IMPLICIT NONE
INTEGER :: icomm
LOGICAL :: lnemoioserver
INTEGER :: irequired, iprovided
LOGICAL :: lmpi1

CALL mpp_io_init(icomm, lnemoioserver, irequired, iprovided, lmpi1)
END SUBROUTINE nemogcmcoup_init_ioserver


SUBROUTINE nemogcmcoup_init_ioserver_2( icomm )
! Initialize the NEMO mppio server
USE mpp_io

IMPLICIT NONE
INTEGER :: icomm

CALL mpp_io_init_2( icomm )
IF (lioserver) THEN
! IO server finished, clean-up multio objects
CALL mpp_stop()
ENDIF
END SUBROUTINE nemogcmcoup_init_ioserver_2

SUBROUTINE nemogcmcoup_end_ioserver
! Function is only called for the IO client.
USE mpp_io

IMPLICIT NONE

CALL mpp_stop()
END SUBROUTINE nemogcmcoup_end_ioserver
#endif

SUBROUTINE nemogcmcoup_init( mype, icomm, inidate, initime, itini, itend, zstp, &
& lwaveonly, iatmunit, lwrite )

Expand Down
40 changes: 0 additions & 40 deletions src/ifs_interface/ifs_notused.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,6 @@
!
! -Original code by Kristian Mogensen, ECMWF.

SUBROUTINE nemogcmcoup_init_ioserver( icomm, lnemoioserver )

! Initialize the NEMO mppio server

IMPLICIT NONE
INTEGER :: icomm
LOGICAL :: lnemoioserver

WRITE(*,*)'No mpp_ioserver'
CALL abort

END SUBROUTINE nemogcmcoup_init_ioserver


SUBROUTINE nemogcmcoup_init_ioserver_2( icomm )

! Initialize the NEMO mppio server

IMPLICIT NONE
INTEGER :: icomm

WRITE(*,*)'No mpp_ioserver'
CALL abort

END SUBROUTINE nemogcmcoup_init_ioserver_2


SUBROUTINE nemogcmcoup_mlflds_get( mype, npes, icomm, &
& nlev, nopoints, pgt3d, pgs3d, pgu3d, pgv3d )

Expand Down Expand Up @@ -332,16 +305,3 @@ SUBROUTINE nemogcmcoup_wam_update_stress( mype, npes, icomm, npoints, &

END SUBROUTINE nemogcmcoup_wam_update_stress

SUBROUTINE nemogcmcoup_end_ioserver

! Close io servers

IMPLICIT NONE
INTEGER :: icomm
LOGICAL :: lnemoioserver

WRITE(*,*)'No mpp_ioserver'
CALL abort

END SUBROUTINE nemogcmcoup_end_ioserver

Loading

0 comments on commit 0582658

Please sign in to comment.