diff --git a/src/enkf_chgres_recenter_nc.fd/CMakeLists.txt b/src/enkf_chgres_recenter_nc.fd/CMakeLists.txt index 69d8fc1b..82c5abc1 100644 --- a/src/enkf_chgres_recenter_nc.fd/CMakeLists.txt +++ b/src/enkf_chgres_recenter_nc.fd/CMakeLists.txt @@ -10,9 +10,6 @@ utils.f90 if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fp-model precise") endif() -if(ip_VERSION VERSION_GREATER_EQUAL 4.0.0) - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -DIP_V4") -endif() set(exe_name enkf_chgres_recenter_nc.x) add_executable(${exe_name} ${fortran_src}) @@ -26,4 +23,8 @@ if(OpenMP_Fortran_FOUND) target_link_libraries(${exe_name} PRIVATE OpenMP::OpenMP_Fortran) endif() +if(ip_VERSION VERSION_GREATER_EQUAL 4.0.0) + target_compile_definitions(${exe_name} PRIVATE "IP_V4") +endif() + install(TARGETS ${exe_name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/src/fbwndgfs.fd/CMakeLists.txt b/src/fbwndgfs.fd/CMakeLists.txt index d62d43dd..57a71a0e 100644 --- a/src/fbwndgfs.fd/CMakeLists.txt +++ b/src/fbwndgfs.fd/CMakeLists.txt @@ -8,10 +8,6 @@ elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdefault-real-8 -fdefault-integer-8 -fconvert=big-endian") endif() -if(w3emc_VERSION VERSION_GREATER_EQUAL 2.10) - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -DW3EMC_210") -endif() - set(exe_name fbwndgfs.x) add_executable(${exe_name} ${fortran_src}) target_link_libraries(${exe_name} PRIVATE bacio::bacio_8 @@ -19,4 +15,8 @@ target_link_libraries(${exe_name} PRIVATE bacio::bacio_8 sp::sp_8 w3emc::w3emc_8) +if(w3emc_VERSION VERSION_GREATER_EQUAL 2.10) + target_compile_definitions(${exe_name} PRIVATE "W3EMC_V2_10") +endif() + install(TARGETS ${exe_name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/src/fbwndgfs.fd/fbwndgfs.F b/src/fbwndgfs.fd/fbwndgfs.F index 2c0ae230..c97db5c7 100644 --- a/src/fbwndgfs.fd/fbwndgfs.F +++ b/src/fbwndgfs.fd/fbwndgfs.F @@ -399,7 +399,7 @@ DO 110 J = 1,NRSTNS C CALL GDSWIZ(KGDS,-1,1,FILL,XPTS(J),YPTS(J), C & ALON(J),ALAT(J),IRET,0,DUM,DUM) -#ifdef W3EMC_210 +#ifdef W3EMC_V2_10 CALL GDSWZD_GRIB1(KGDS,-1,1,FILL,XPTS(J),YPTS(J), & ALON(J),ALAT(J),IRET) #else diff --git a/src/mkgfsawps.fd/CMakeLists.txt b/src/mkgfsawps.fd/CMakeLists.txt index ab7978b1..088596bf 100644 --- a/src/mkgfsawps.fd/CMakeLists.txt +++ b/src/mkgfsawps.fd/CMakeLists.txt @@ -10,10 +10,6 @@ elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set_source_files_properties(${fortran_src_free} PROPERTIES COMPILE_FLAGS "-ffree-form") endif() -if(ip_VERSION VERSION_GREATER_EQUAL 4.0.0) - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -DIP_V4") -endif() - set(exe_name mkgfsawps.x) add_executable(${exe_name} ${fortran_src}) target_link_libraries(${exe_name} PRIVATE bacio::bacio_4 @@ -24,4 +20,8 @@ if(OpenMP_Fortran_FOUND) target_link_libraries(${exe_name} PRIVATE OpenMP::OpenMP_Fortran) endif() +if(ip_VERSION VERSION_GREATER_EQUAL 4.0.0) + target_compile_definitions(${exe_name} PRIVATE "IP_V4") +endif() + install(TARGETS ${exe_name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})