Skip to content

Commit

Permalink
Harmonise preproc flags related to NEMO prec
Browse files Browse the repository at this point in the history
  • Loading branch information
awnawab committed Feb 27, 2024
1 parent 9b8ea07 commit 07cc270
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
8 changes: 1 addition & 7 deletions src/ecwam/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -356,17 +356,11 @@ list( APPEND ecwam_srcs
z0wave.F90
)

# check for nemo single-precision
set(WAM_NEMO_SINGLE 0)
if( ${PNAME}_OCEANMODEL_HAVE_SINGLE_PRECISION )
set(WAM_NEMO_SINGLE 1)
endif()

if( HAVE_GEN_DERIV_TYPES )
list( APPEND ecwam_srcs ${CMAKE_CURRENT_BINARY_DIR}/yowfield_mod.F90)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/yowfield_mod.F90
COMMAND ${FYPP} -m io -m yaml -m os -DWAM_NEMO_SINGLE=${WAM_NEMO_SINGLE} ${CMAKE_CURRENT_SOURCE_DIR}/yowfield_mod.fypp > yowfield_mod.F90
COMMAND ${FYPP} -m io -m yaml -m os ${CMAKE_CURRENT_SOURCE_DIR}/yowfield_mod.fypp > yowfield_mod.F90
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/yowfield_mod.fypp
VERBATIM)
else()
Expand Down
6 changes: 3 additions & 3 deletions src/ecwam/yowfield_mod.fypp
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ MODULE YOWFIELD_MOD
#:for var, type, dim in objdef[obj]
#{if type == 'real'}#REAL(KIND=JWRB)#{elif type == 'ocean'}#REAL(KIND=JWRO)#{else}#INTEGER(KIND=JWIM)#{endif}#, DIMENSION(${','.join(':' for _ in range(dim-1))}$), POINTER :: ${var.upper()}$=>NULL()
#:endfor
#:if WAM_NEMO_SINGLE == 1
#ifdef PARKIND1_SINGLE_NEMO
#:for var, type, dim in objdef[obj]
CLASS(FIELD_${dim}$#{if type == 'int'}#IM#{elif type == 'ocean'}#RM#{else}#RB#{endif}#), POINTER :: F_${var.upper()}$=>NULL()
#:endfor
#:else
#else
#:for var, type, dim in objdef[obj]
CLASS(FIELD_${dim}$#{if type == 'int'}#IM#{elif type == 'ocean'}#RD#{else}#RB#{endif}#), POINTER :: F_${var.upper()}$=>NULL()
#:endfor
#:endif
#endif
CONTAINS
PROCEDURE :: INIT => ${obj.upper()}$_FIELD_INIT
PROCEDURE :: UPDATE_VIEW => ${obj.upper()}$_UPDATE_VIEW
Expand Down

0 comments on commit 07cc270

Please sign in to comment.