Skip to content

Commit

Permalink
Towards parkind independent interfaces in legacy benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrows committed Nov 9, 2023
1 parent 6a9ee3e commit 50e883c
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 44 deletions.
2 changes: 1 addition & 1 deletion src/programs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ foreach( prec sp dp )
wrappers/inv_trans.F90
wrappers/setup_trans0.F90
wrappers/setup_trans.F90
wrappers/specnorm.F90
# wrappers/specnorm.F90
wrappers/trans_inq.F90
PUBLIC_INCLUDES $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/trans/include>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/trans/include/ectrans>
Expand Down
2 changes: 1 addition & 1 deletion src/programs/ectrans-benchmark.F90
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ program transform_test
#include "inv_trans.h"
#include "dir_trans.h"
#include "trans_inq.h"
#include "specnorm.h"
#include "./wrappers/specnorm.inc"
#include "abor1.intfb.h"
#include "gstats_setup.intfb.h"
#include "ec_meminfo.intfb.h"
Expand Down
34 changes: 0 additions & 34 deletions src/programs/wrappers/specnorm.F90

This file was deleted.

31 changes: 31 additions & 0 deletions src/programs/wrappers/specnorm.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
! (C) Copyright 2000- ECMWF.
! (C) Copyright 2000- Meteo-France.
!
! This software is licensed under the terms of the Apache Licence Version 2.0
! which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
! In applying this licence, ECMWF does not waive the privileges and immunities
! granted to it by virtue of its status as an intergovernmental organisation
! nor does it submit to any jurisdiction.
!
INTERFACE SPECNORM
SUBROUTINE SPECNORM_SP(PNORM,PSPEC,KVSET,KMASTER,KRESOL,PMET)
USE EC_PARKIND, ONLY: JPRM, JPIM
REAL(KIND=JPRM) , INTENT(OUT) :: PNORM(:)
REAL(KIND=JPRM) ,OPTIONAL, INTENT(IN) :: PSPEC(:,:)
INTEGER(KIND=JPIM) ,OPTIONAL, INTENT(IN) :: KVSET(:)
INTEGER(KIND=JPIM) ,OPTIONAL, INTENT(IN) :: KMASTER
REAL(KIND=JPRM) ,OPTIONAL, INTENT(IN) :: PMET(:)
INTEGER(KIND=JPIM) ,OPTIONAL, INTENT(IN) :: KRESOL
END SUBROUTINE SPECNORM_SP
SUBROUTINE SPECNORM_DP(PNORM,PSPEC,KVSET,KMASTER,KRESOL,PMET)
USE EC_PARKIND, ONLY: JPRD, JPIM
REAL(KIND=JPRD) , INTENT(OUT) :: PNORM(:)
REAL(KIND=JPRD) ,OPTIONAL, INTENT(IN) :: PSPEC(:,:)
INTEGER(KIND=JPIM) ,OPTIONAL, INTENT(IN) :: KVSET(:)
INTEGER(KIND=JPIM) ,OPTIONAL, INTENT(IN) :: KMASTER
REAL(KIND=JPRD) ,OPTIONAL, INTENT(IN) :: PMET(:)
INTEGER(KIND=JPIM) ,OPTIONAL, INTENT(IN) :: KRESOL
END SUBROUTINE SPECNORM_DP
END INTERFACE SPECNORM


2 changes: 1 addition & 1 deletion src/trans/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ ecbuild_list_add_pattern( LIST trans_src
sharedmem/*
algor/*
internal/*
#external/*
external/specnorm.F90
module/*
${CMAKE_CURRENT_BINARY_DIR}/internal/ectrans_version_mod.F90
QUIET
Expand Down
7 changes: 2 additions & 5 deletions src/trans/external/specnorm.F90
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
!

#ifndef INMODULE
SUBROUTINE SPECNORM(PSPEC,KVSET,KMASTER,KRESOL,PMET,PNORM)
SUBROUTINE SPECNORM(PNORM,PSPEC,KVSET,KMASTER,KRESOL,PMET)
#else
MODULE PROCEDURE SPECNORM
#endif
Expand Down Expand Up @@ -70,11 +70,11 @@ SUBROUTINE SPECNORM(PSPEC,KVSET,KMASTER,KRESOL,PMET,PNORM)


#ifndef INMODULE
REAL(KIND=JPRB) , INTENT(OUT) :: PNORM(:)
REAL(KIND=JPRB) ,OPTIONAL, INTENT(IN) :: PSPEC(:,:)
INTEGER(KIND=JPIM) ,OPTIONAL, INTENT(IN) :: KVSET(:)
INTEGER(KIND=JPIM) ,OPTIONAL, INTENT(IN) :: KMASTER
REAL(KIND=JPRB) ,OPTIONAL, INTENT(IN) :: PMET(:)
REAL(KIND=JPRB) ,OPTIONAL, INTENT(OUT) :: PNORM(:)
INTEGER(KIND=JPIM) ,OPTIONAL, INTENT(IN) :: KRESOL
#endif
!ifndef INTERFACE
Expand Down Expand Up @@ -121,9 +121,6 @@ SUBROUTINE SPECNORM(PSPEC,KVSET,KMASTER,KRESOL,PMET,PNORM)
ENDIF
ENDIF
IF(MYPROC == IMASTER) THEN
IF(.NOT. PRESENT(PNORM)) THEN
CALL ABORT_TRANS('SPECNORM: PNORM NOT PRESENT')
ENDIF
IF(UBOUND(PNORM,1) < IFLD_G) THEN
CALL ABORT_TRANS('SPECNORM: PNORM TOO SMALL')
ENDIF
Expand Down
2 changes: 2 additions & 0 deletions src/trans/include/ectrans/renames.inc
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@
#define ectrans_mod SUFFIXIZE(ectrans_mod)
#define transform_driver_data_mod SUFFIXIZE(transform_driver_data_mod)
#define transform_driver_mod SUFFIXIZE(transform_driver_mod)
#define SPECNORM SUFFIXIZE(SPECNORM)
#define specnorm SUFFIXIZE(specnorm)
!Pure replacements below
#define parkind1 ec_parkind
#define PARKIND1 EC_PARKIND
Expand Down
4 changes: 2 additions & 2 deletions src/trans/include/ectrans/specnorm.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ INTERFACE
#ifdef INMODULE
MODULE &
#endif
SUBROUTINE SPECNORM(PSPEC,KVSET,KMASTER,KRESOL,PMET,PNORM)
SUBROUTINE SPECNORM(PNORM,PSPEC,KVSET,KMASTER,KRESOL,PMET)

!**** *SPECNORM* - Compute global spectral norms

Expand Down Expand Up @@ -58,11 +58,11 @@ IMPLICIT NONE
! Declaration of arguments


REAL(KIND=JPRB) , INTENT(OUT) :: PNORM(:)
REAL(KIND=JPRB) ,OPTIONAL, INTENT(IN) :: PSPEC(:,:)
INTEGER(KIND=JPIM) ,OPTIONAL, INTENT(IN) :: KVSET(:)
INTEGER(KIND=JPIM) ,OPTIONAL, INTENT(IN) :: KMASTER
REAL(KIND=JPRB) ,OPTIONAL, INTENT(IN) :: PMET(:)
REAL(KIND=JPRB) ,OPTIONAL, INTENT(OUT) :: PNORM(:)
INTEGER(KIND=JPIM) ,OPTIONAL, INTENT(IN) :: KRESOL

! ------------------------------------------------------------------
Expand Down

0 comments on commit 50e883c

Please sign in to comment.