Skip to content

Commit

Permalink
Re-enabling compilation of tests
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrows committed Feb 3, 2024
1 parent 82b5132 commit dd98142
Show file tree
Hide file tree
Showing 16 changed files with 121 additions and 45 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ jobs:
if [[ "${{ matrix.os }}" =~ macos ]]; then
brew install ninja
brew install gnu-sed
alias sed=gsed
else
sudo apt-get update
sudo apt-get install ninja-build
Expand Down Expand Up @@ -158,7 +157,8 @@ jobs:
- name: Set Build & Test Environment
run: |
alias sed=gsed
export GITHUB_PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$GITHUB_PATH"
# Add mpirun to path for testing
[ -z ${MPI_HOME+x} ] || echo "${MPI_HOME}/bin" >> $GITHUB_PATH
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ ectrans_find_lapack()
### Add sources and tests
include( ectrans_compile_options )
add_subdirectory( src )
#add_subdirectory( tests )
add_subdirectory( tests )

### Export
if( BUILD_SHARED_LIBS )
Expand Down
4 changes: 4 additions & 0 deletions src/programs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ ecbuild_add_library(
wrappers/setup_trans0.F90
wrappers/setup_trans.F90
wrappers/trans_inq.F90
wrappers/dir_transad.F90
wrappers/inv_transad.F90
wrappers/gath_spec.F90
wrappers/dist_spec.F90
PUBLIC_INCLUDES $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/trans/include>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/trans/include/ectrans>
$<INSTALL_INTERFACE:include/ectrans>
Expand Down
6 changes: 5 additions & 1 deletion src/trans/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ ecbuild_list_add_pattern( LIST trans_src
algor/*
internal/source/*
external/spec_norm.F90
external/dist_grid.F90
QUIET
)
ecbuild_list_add_pattern( LIST trans_src_common
Expand All @@ -49,12 +50,15 @@ ecbuild_list_add_pattern( LIST trans_src_common
)
ecbuild_list_add_pattern( LIST trans_src_ext
GLOB
# external/spec_norm.F90
external/dir__trans.F90
external/inv__trans.F90
external/dir_transad.F90
external/inv_transad.F90
external/trans__inq.F90
external/setup__trans.F90
external/setup__trans0.F90
external/dist_spec.F90
external/gath_spec.F90
module/*
QUIET
)
Expand Down
17 changes: 11 additions & 6 deletions src/trans/external/dir_transad.F90
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
! nor does it submit to any jurisdiction.
!


#ifndef INMODULE
SUBROUTINE DIR_TRANSAD(PSPVOR,PSPDIV,PSPSCALAR,PSPSC3A,PSPSC3B,PSPSC2,&
& KPROMA,KVSETUV,KVSETSC,KRESOL,KVSETSC3A,KVSETSC3B,KVSETSC2,&
& PGP,PGPUV,PGP3A,PGP3B,PGP2)

#else
MODULE PROCEDURE DIR_TRANSAD
#endif

!**** *DIR_TRANSAD* - Direct spectral transform - adjoint.

Expand Down Expand Up @@ -126,7 +128,7 @@ SUBROUTINE DIR_TRANSAD(PSPVOR,PSPDIV,PSPSCALAR,PSPSC3A,PSPSC3B,PSPSC2,&
IMPLICIT NONE

! Declaration of arguments

#ifndef INMODULE
REAL(KIND=JPRB) ,OPTIONAL, INTENT(INOUT) :: PSPVOR(:,:)
REAL(KIND=JPRB) ,OPTIONAL, INTENT(INOUT) :: PSPDIV(:,:)
REAL(KIND=JPRB) ,OPTIONAL, INTENT(INOUT) :: PSPSCALAR(:,:)
Expand All @@ -146,7 +148,7 @@ SUBROUTINE DIR_TRANSAD(PSPVOR,PSPDIV,PSPSCALAR,PSPSC3A,PSPSC3B,PSPSC2,&
REAL(KIND=JPRB),OPTIONAL ,INTENT(OUT) :: PGP3A(:,:,:,:)
REAL(KIND=JPRB),OPTIONAL ,INTENT(OUT) :: PGP3B(:,:,:,:)
REAL(KIND=JPRB),OPTIONAL ,INTENT(OUT) :: PGP2(:,:,:)

#endif
!ifndef INTERFACE

! Local variables
Expand Down Expand Up @@ -502,6 +504,9 @@ SUBROUTINE DIR_TRANSAD(PSPVOR,PSPDIV,PSPSCALAR,PSPSC3A,PSPSC3B,PSPSC2,&
! ------------------------------------------------------------------
!endif INTERFACE

END SUBROUTINE DIR_TRANSAD


#ifndef INMODULE
END SUBROUTINE DIR_TRANSAD
#else
END PROCEDURE DIR_TRANSAD
#endif
13 changes: 10 additions & 3 deletions src/trans/external/dist_spec.F90
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@
!


#ifndef INMODULE
SUBROUTINE DIST_SPEC(PSPECG,KFDISTG,KFROM,KVSET,KRESOL,PSPEC,&
& LDIM1_IS_FLD,KSMAX,KSORT)
#else
MODULE PROCEDURE DIST_SPEC
#endif

!**** *DIST_SPEC* - Distribute global spectral array among processors

Expand Down Expand Up @@ -69,7 +73,7 @@ SUBROUTINE DIST_SPEC(PSPECG,KFDISTG,KFROM,KVSET,KRESOL,PSPEC,&
IMPLICIT NONE

! Declaration of arguments

#ifndef INMODULE
REAL(KIND=JPRB) ,OPTIONAL, INTENT(IN) :: PSPECG(:,:)
INTEGER(KIND=JPIM) , INTENT(IN) :: KFDISTG
INTEGER(KIND=JPIM) , INTENT(IN) :: KFROM(:)
Expand All @@ -79,7 +83,7 @@ SUBROUTINE DIST_SPEC(PSPECG,KFDISTG,KFROM,KVSET,KRESOL,PSPEC,&
LOGICAL ,OPTIONAL, INTENT(IN) :: LDIM1_IS_FLD
INTEGER(KIND=JPIM) ,OPTIONAL, INTENT(IN) :: KSMAX
INTEGER(KIND=JPIM) ,OPTIONAL, INTENT(IN) :: KSORT (:)

#endif
!ifndef INTERFACE

INTEGER(KIND=JPIM) :: IVSET(KFDISTG)
Expand Down Expand Up @@ -211,5 +215,8 @@ SUBROUTINE DIST_SPEC(PSPECG,KFDISTG,KFROM,KVSET,KRESOL,PSPEC,&

! ------------------------------------------------------------------

#ifndef INMODULE
END SUBROUTINE DIST_SPEC

#else
END PROCEDURE DIST_SPEC
#endif
14 changes: 10 additions & 4 deletions src/trans/external/gath_spec.F90
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@
! nor does it submit to any jurisdiction.
!


#ifndef INMODULE
SUBROUTINE GATH_SPEC(PSPECG,KFGATHG,KTO,KVSET,KRESOL,PSPEC,LDIM1_IS_FLD,KSMAX,LDZA0IP)
#else
MODULE PROCEDURE GATH_SPEC
#endif

!**** *GATH_SPEC* - Gather global spectral array from processors

Expand Down Expand Up @@ -68,7 +71,7 @@ SUBROUTINE GATH_SPEC(PSPECG,KFGATHG,KTO,KVSET,KRESOL,PSPEC,LDIM1_IS_FLD,KSMAX,LD
IMPLICIT NONE

! Declaration of arguments

#ifndef INMODULE
REAL(KIND=JPRB) ,OPTIONAL, INTENT(OUT) :: PSPECG(:,:)
INTEGER(KIND=JPIM) , INTENT(IN) :: KFGATHG
INTEGER(KIND=JPIM) , INTENT(IN) :: KTO(:)
Expand All @@ -78,7 +81,7 @@ SUBROUTINE GATH_SPEC(PSPECG,KFGATHG,KTO,KVSET,KRESOL,PSPEC,LDIM1_IS_FLD,KSMAX,LD
LOGICAL ,OPTIONAL, INTENT(IN) :: LDIM1_IS_FLD
INTEGER(KIND=JPIM) ,OPTIONAL, INTENT(IN) :: KSMAX
LOGICAL ,OPTIONAL, INTENT(IN) :: LDZA0IP

#endif
!ifndef INTERFACE

INTEGER(KIND=JPIM) :: IVSET(KFGATHG)
Expand Down Expand Up @@ -191,5 +194,8 @@ SUBROUTINE GATH_SPEC(PSPECG,KFGATHG,KTO,KVSET,KRESOL,PSPEC,LDIM1_IS_FLD,KSMAX,LD

! ------------------------------------------------------------------

#ifndef INMODULE
END SUBROUTINE GATH_SPEC

#else
END PROCEDURE GATH_SPEC
#endif
14 changes: 10 additions & 4 deletions src/trans/external/inv_transad.F90
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@
! nor does it submit to any jurisdiction.
!


#ifndef INMODULE
SUBROUTINE INV_TRANSAD(PSPVOR,PSPDIV,PSPSCALAR,PSPSC3A,PSPSC3B,PSPSC2,&
& FSPGL_PROC,&
& LDSCDERS,LDVORGP,LDDIVGP,LDUVDER,KPROMA,KVSETUV,KVSETSC,KRESOL,&
& KVSETSC3A,KVSETSC3B,KVSETSC2,&
& PGP,PGPUV,PGP3A,PGP3B,PGP2)
#else
MODULE PROCEDURE INV_TRANSAD
#endif

!**** *INV_TRANSAD* - Inverse spectral transform - adjoint.

Expand Down Expand Up @@ -142,7 +145,7 @@ SUBROUTINE INV_TRANSAD(PSPVOR,PSPDIV,PSPSCALAR,PSPSC3A,PSPSC3B,PSPSC2,&
IMPLICIT NONE

! Declaration of arguments

#ifndef INMODULE
REAL(KIND=JPRB) ,OPTIONAL, INTENT(OUT) :: PSPVOR(:,:)
REAL(KIND=JPRB) ,OPTIONAL, INTENT(OUT) :: PSPDIV(:,:)
REAL(KIND=JPRB) ,OPTIONAL, INTENT(OUT) :: PSPSCALAR(:,:)
Expand All @@ -167,7 +170,7 @@ SUBROUTINE INV_TRANSAD(PSPVOR,PSPDIV,PSPSCALAR,PSPSC3A,PSPSC3B,PSPSC2,&
REAL(KIND=JPRB),OPTIONAL ,INTENT(IN) :: PGP3A(:,:,:,:)
REAL(KIND=JPRB),OPTIONAL ,INTENT(IN) :: PGP3B(:,:,:,:)
REAL(KIND=JPRB),OPTIONAL ,INTENT(IN) :: PGP2(:,:,:)

#endif
!ifndef INTERFACE

! Local varaibles
Expand Down Expand Up @@ -611,6 +614,9 @@ SUBROUTINE INV_TRANSAD(PSPVOR,PSPDIV,PSPSCALAR,PSPSC3A,PSPSC3B,PSPSC2,&
! ------------------------------------------------------------------

!endif INTERFACE

#ifndef INMODULE
END SUBROUTINE INV_TRANSAD
#else
END PROCEDURE INV_TRANSAD
#endif

3 changes: 3 additions & 0 deletions src/trans/include/ectrans/dir_transad.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
!

INTERFACE
#ifdef INMODULE
MODULE &
#endif
SUBROUTINE DIR_TRANSAD(PSPVOR,PSPDIV,PSPSCALAR,PSPSC3A,PSPSC3B,PSPSC2,&
& KPROMA,KVSETUV,KVSETSC,KRESOL,KVSETSC3A,KVSETSC3B,KVSETSC2,&
& PGP,PGPUV,PGP3A,PGP3B,PGP2)
Expand Down
3 changes: 3 additions & 0 deletions src/trans/include/ectrans/dist_spec.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
!

INTERFACE
#ifdef INMODULE
MODULE &
#endif
SUBROUTINE DIST_SPEC(PSPECG,KFDISTG,KFROM,KVSET,KRESOL,PSPEC,&
& LDIM1_IS_FLD,KSMAX,KSORT)

Expand Down
3 changes: 3 additions & 0 deletions src/trans/include/ectrans/gath_spec.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
!

INTERFACE
#ifdef INMODULE
MODULE &
#endif
SUBROUTINE GATH_SPEC(PSPECG,KFGATHG,KTO,KVSET,KRESOL,PSPEC,LDIM1_IS_FLD,KSMAX,LDZA0IP)

!**** *GATH_SPEC* - Gather global spectral array from processors
Expand Down
3 changes: 3 additions & 0 deletions src/trans/include/ectrans/inv_transad.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
!

INTERFACE
#ifdef INMODULE
MODULE &
#endif
SUBROUTINE INV_TRANSAD(PSPVOR,PSPDIV,PSPSCALAR,PSPSC3A,PSPSC3B,PSPSC2,&
& FSPGL_PROC,&
& LDSCDERS,LDVORGP,LDDIVGP,LDUVDER,KPROMA,KVSETUV,KVSETSC,KRESOL,&
Expand Down
5 changes: 5 additions & 0 deletions src/trans/include/ectrans/sedrenames.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ s/DIR_TRANS_CTLAD_MOD/DIR_TRANS_CTLAD_MOD_VARIANTDESIGNATOR/g
s/DIR_TRANS_CTL_MOD/DIR_TRANS_CTL_MOD_VARIANTDESIGNATOR/g
s/DIST_GRID_32_CTL_MOD/DIST_GRID_32_CTL_MOD_VARIANTDESIGNATOR/g
s/DIST_GRID_CTL_MOD/DIST_GRID_CTL_MOD_VARIANTDESIGNATOR/g
s/DIST_GRID/DIST_GRID_VARIANTDESIGNATOR/g
s/DIST_SPEC_CONTROL_MOD/DIST_SPEC_CONTROL_MOD_VARIANTDESIGNATOR/g
s/eq_regions_mod/eq_regions_mod_VARIANTDESIGNATOR/g
s/EQ_REGIONS_MOD/EQ_REGIONS_MOD_VARIANTDESIGNATOR/g
Expand Down Expand Up @@ -135,6 +136,10 @@ s/BLUESTEIN_FFT/BLUESTEIN_FFT_VARIANTDESIGNATOR/g
#s/DIR_TRANS/DIR_TRANS_VARIANTDESIGNATOR/g
#s/inv_trans/inv_trans_VARIANTDESIGNATOR/g
#s/INV_TRANS/INV_TRANS_VARIANTDESIGNATOR/g
#s/dir_transad/dir_transad_VARIANTDESIGNATOR/g
#s/DIR_TRANSAD/DIR_TRANSAD_VARIANTDESIGNATOR/g
#s/inv_transad/inv_transad_VARIANTDESIGNATOR/g
#s/INV_TRANSAD/INV_TRANSAD_VARIANTDESIGNATOR/g
#s/trans_inq/trans_inq_VARIANTDESIGNATOR/g
#s/TRANS_INQ/TRANS_INQ_VARIANTDESIGNATOR/g
#s/setup_trans0/setup_trans0_VARIANTDESIGNATOR/g
Expand Down
4 changes: 4 additions & 0 deletions src/trans/module/ectrans_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ module ectrans_mod
#include "setup__trans.h"
#include "inv__trans.h"
#include "dir__trans.h"
#include "inv_transad.h"
#include "dir_transad.h"
#include "trans__inq.h"
#include "gath_spec.h"
#include "dist_spec.h"
!#include "spec_norm.h"
contains
end module ectrans_mod
3 changes: 2 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ endif()

ecbuild_add_test(TARGET ectrans_test_adjoint
SOURCES trans/test_adjoint.F90
LIBS ${trans}
INCLUDES $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/programs/wrappers>
LIBS ${trans} ectrans_interfaces
LINKER_LANGUAGE Fortran
)
if( TEST ectrans_test_adjoint AND HAVE_OMP )
Expand Down
Loading

0 comments on commit dd98142

Please sign in to comment.