From d5f91df49bc25fb7e794cc4dfcaace71d40361d1 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Wed, 18 May 2022 11:57:08 -0400 Subject: [PATCH] GitHub Issue NOAA-EMC/GSI#112. A refactor of CMake build framework. (#327) --- util/Conventional_Monitor/CMakeLists.txt | 107 +----------------- .../image_gen/CMakeLists.txt | 1 + .../image_gen/exec/.gitignore | 2 - .../image_gen/sorc/CMakeLists.txt | 5 + .../sorc/conmon_read_ps_IG.fd/CMakeLists.txt | 36 ++++-- .../sorc/conmon_read_ps_IG.fd/convinfo.f90 | 2 +- .../sorc/conmon_read_pw_IG.fd/CMakeLists.txt | 39 +++++-- .../sorc/conmon_read_pw_IG.fd/convinfo.f90 | 2 +- .../sorc/conmon_read_q_IG.fd/CMakeLists.txt | 39 +++++-- .../sorc/conmon_read_q_IG.fd/convinfo.f90 | 2 +- .../sorc/conmon_read_t_IG.fd/CMakeLists.txt | 39 +++++-- .../sorc/conmon_read_t_IG.fd/convinfo.f90 | 2 +- .../sorc/conmon_read_uv_IG.fd/CMakeLists.txt | 40 +++++-- .../sorc/conmon_read_uv_IG.fd/convinfo.f90 | 2 +- .../nwprod/CMakeLists.txt | 1 + .../nwprod/conmon_shared/CMakeLists.txt | 1 + .../nwprod/conmon_shared/exec/.gitignore | 2 - .../conmon_shared/modulefiles/cray/CMonBuild | 21 ---- .../conmon_shared/modulefiles/theia/CMonBuild | 17 --- .../conmon_shared/modulefiles/wcoss/CMonBuild | 18 --- .../nwprod/conmon_shared/sorc/CMakeLists.txt | 6 + .../sorc/conmon_grads_lev.fd/CMakeLists.txt | 39 ++++--- .../conmon_grads_lev.fd/conmon_read_diag.F90 | 42 +++---- .../sorc/conmon_grads_lev.fd/grads_lev.f90 | 2 +- .../conmon_grads_mandlev.fd/CMakeLists.txt | 41 ++++--- .../conmon_read_diag.F90 | 42 +++---- .../conmon_grads_mandlev.fd/grads_mandlev.f90 | 5 +- .../sorc/conmon_grads_sfc.fd/CMakeLists.txt | 41 ++++--- .../conmon_grads_sfc.fd/conmon_read_diag.F90 | 42 +++---- .../sorc/conmon_grads_sfc.fd/grads_sfc.f90 | 2 +- .../conmon_grads_sfctime.fd/CMakeLists.txt | 52 +++++---- .../conmon_read_diag.F90 | 42 +++---- .../conmon_grads_sfctime.fd/grads_sfctime.f90 | 2 +- .../sorc/conmon_grads_sig.fd/CMakeLists.txt | 43 ++++--- .../conmon_grads_sig.fd/conmon_read_diag.F90 | 42 +++---- .../sorc/conmon_grads_sig.fd/grads_sig.f90 | 2 +- .../sorc/conmon_time.fd/CMakeLists.txt | 44 ++++--- .../sorc/conmon_time.fd/conmon_read_diag.F90 | 42 +++---- .../sorc/conmon_time.fd/process_time_data.f90 | 10 +- util/Ozone_Monitor/CMakeLists.txt | 98 +--------------- util/Ozone_Monitor/data_xtrct/CMakeLists.txt | 1 + util/Ozone_Monitor/data_xtrct/exec/.gitignore | 2 - .../data_xtrct/sorc/CMakeLists.txt | 1 + .../sorc/make_base.fd/CMakeLists.txt | 28 ++--- .../data_xtrct/sorc/make_base.fd/makefile | 44 ------- util/Ozone_Monitor/nwprod/CMakeLists.txt | 1 + .../nwprod/oznmon_shared/CMakeLists.txt | 1 + .../nwprod/oznmon_shared/exec/.gitignore | 2 - .../modulefiles/cray/OznMonBuild | 18 --- .../modulefiles/dell/OznMonBuild | 18 --- .../modulefiles/theia/OznMonBuild | 20 ---- .../modulefiles/wcoss/OznMonBuild | 18 --- .../nwprod/oznmon_shared/sorc/CMakeLists.txt | 2 + .../sorc/oznmon_horiz.fd/CMakeLists.txt | 39 ++++--- .../sorc/oznmon_horiz.fd/oznmon_read_diag.f90 | 4 +- .../sorc/oznmon_time.fd/CMakeLists.txt | 41 ++++--- .../sorc/oznmon_time.fd/oznmon_read_diag.f90 | 4 +- .../sorc/oznmon_time.fd/time.f90 | 6 +- util/Radiance_Monitor/CMakeLists.txt | 107 +----------------- .../data_extract/CMakeLists.txt | 1 + .../data_extract/exec/.gitignore | 2 - .../data_extract/sorc/CMakeLists.txt | 2 + .../sorc/radmon_mk_base.fd/CMakeLists.txt | 28 ++--- .../sorc/radmon_mk_base.fd/makefile | 44 ------- .../sorc/radmon_validate_tm.fd/CMakeLists.txt | 34 +++--- .../sorc/radmon_validate_tm.fd/makefile | 62 ---------- .../Radiance_Monitor/image_gen/CMakeLists.txt | 1 + .../image_gen/exec/.gitignore | 2 - .../image_gen/src/CMakeLists.txt | 5 + .../src/radmon_ig_angle.fd/CMakeLists.txt | 31 ++--- .../src/radmon_ig_angle.fd/angle.f90 | 2 +- .../src/radmon_ig_bcoef.fd/CMakeLists.txt | 31 ++--- .../src/radmon_ig_bcoef.fd/bcoef.f90 | 6 +- .../src/radmon_ig_horiz.fd/CMakeLists.txt | 41 ++++--- .../src/radmon_ig_summary.fd/CMakeLists.txt | 31 ++--- .../src/radmon_ig_summary.fd/summary.f90 | 6 +- .../src/radmon_ig_time.fd/CMakeLists.txt | 31 ++--- .../image_gen/src/radmon_ig_time.fd/time.f90 | 6 +- util/Radiance_Monitor/nwprod/CMakeLists.txt | 1 + .../nwprod/radmon_shared/CMakeLists.txt | 1 + .../nwprod/radmon_shared/sorc/CMakeLists.txt | 4 + .../sorc/verf_radang.fd/CMakeLists.txt | 40 ++++--- .../sorc/verf_radbcoef.fd/CMakeLists.txt | 40 ++++--- .../sorc/verf_radbcor.fd/CMakeLists.txt | 41 ++++--- .../sorc/verf_radtime.fd/CMakeLists.txt | 44 ++++--- 85 files changed, 825 insertions(+), 1086 deletions(-) create mode 100644 util/Conventional_Monitor/image_gen/CMakeLists.txt delete mode 100644 util/Conventional_Monitor/image_gen/exec/.gitignore create mode 100644 util/Conventional_Monitor/image_gen/sorc/CMakeLists.txt create mode 100644 util/Conventional_Monitor/nwprod/CMakeLists.txt create mode 100644 util/Conventional_Monitor/nwprod/conmon_shared/CMakeLists.txt delete mode 100644 util/Conventional_Monitor/nwprod/conmon_shared/exec/.gitignore delete mode 100644 util/Conventional_Monitor/nwprod/conmon_shared/modulefiles/cray/CMonBuild delete mode 100644 util/Conventional_Monitor/nwprod/conmon_shared/modulefiles/theia/CMonBuild delete mode 100644 util/Conventional_Monitor/nwprod/conmon_shared/modulefiles/wcoss/CMonBuild create mode 100644 util/Conventional_Monitor/nwprod/conmon_shared/sorc/CMakeLists.txt create mode 100644 util/Ozone_Monitor/data_xtrct/CMakeLists.txt delete mode 100644 util/Ozone_Monitor/data_xtrct/exec/.gitignore create mode 100644 util/Ozone_Monitor/data_xtrct/sorc/CMakeLists.txt delete mode 100755 util/Ozone_Monitor/data_xtrct/sorc/make_base.fd/makefile create mode 100644 util/Ozone_Monitor/nwprod/CMakeLists.txt create mode 100644 util/Ozone_Monitor/nwprod/oznmon_shared/CMakeLists.txt delete mode 100644 util/Ozone_Monitor/nwprod/oznmon_shared/exec/.gitignore delete mode 100644 util/Ozone_Monitor/nwprod/oznmon_shared/modulefiles/cray/OznMonBuild delete mode 100644 util/Ozone_Monitor/nwprod/oznmon_shared/modulefiles/dell/OznMonBuild delete mode 100644 util/Ozone_Monitor/nwprod/oznmon_shared/modulefiles/theia/OznMonBuild delete mode 100644 util/Ozone_Monitor/nwprod/oznmon_shared/modulefiles/wcoss/OznMonBuild create mode 100644 util/Ozone_Monitor/nwprod/oznmon_shared/sorc/CMakeLists.txt create mode 100644 util/Radiance_Monitor/data_extract/CMakeLists.txt delete mode 100644 util/Radiance_Monitor/data_extract/exec/.gitignore create mode 100644 util/Radiance_Monitor/data_extract/sorc/CMakeLists.txt delete mode 100755 util/Radiance_Monitor/data_extract/sorc/radmon_mk_base.fd/makefile delete mode 100755 util/Radiance_Monitor/data_extract/sorc/radmon_validate_tm.fd/makefile create mode 100644 util/Radiance_Monitor/image_gen/CMakeLists.txt delete mode 100644 util/Radiance_Monitor/image_gen/exec/.gitignore create mode 100644 util/Radiance_Monitor/image_gen/src/CMakeLists.txt create mode 100644 util/Radiance_Monitor/nwprod/CMakeLists.txt create mode 100644 util/Radiance_Monitor/nwprod/radmon_shared/CMakeLists.txt create mode 100644 util/Radiance_Monitor/nwprod/radmon_shared/sorc/CMakeLists.txt diff --git a/util/Conventional_Monitor/CMakeLists.txt b/util/Conventional_Monitor/CMakeLists.txt index 9b66fa9a..efeab15b 100644 --- a/util/Conventional_Monitor/CMakeLists.txt +++ b/util/Conventional_Monitor/CMakeLists.txt @@ -1,105 +1,2 @@ -cmake_minimum_required(VERSION 2.8) -if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) - # I am top-level project. - if( NOT DEFINED ENV{CC} ) - find_path( crayComp "ftn" ) - find_path( wcossIntel "mpfort" ) - find_path( intelComp "ifort" ) - find_path( pgiComp "pgf90" ) - if( crayComp ) - message("Setting CrayLinuxEnvironment") - set(CMAKE_SYSTEM_NAME "CrayLinuxEnvironment") - set(CMAKE_C_COMPILER "${crayComp}/cc") - set(CMAKE_CXX_COMPILER "${crayComp}/CC") - set(CMAKE_Fortran_COMPILER "${crayComp}/ftn") - endif() - if( intelComp ) - set(ENV{CC} "icc") - set(ENV{CXX} "icpc") - set(ENV{FC} "ifort") - endif() - if( wcossIntel ) - message("Setting env for wcoss intel") - set(ENV{CC} "mpcc") - set(ENV{CXX} "mpCC") - set(ENV{FC} "mpfort") - endif() - if( pgiComp ) - set(ENV{CC} "pgcc") - set(ENV{CXX} "pgCC") - set(ENV{FC} "pgf90") - endif() - endif() - project(COV_Calc) - enable_language (Fortran) - set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/../../cmake/Modules/") - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib") - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/setPlatformVariables.cmake) - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/setIntelFlags.cmake) - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/setGNUFlags.cmake) - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/setPGIFlags.cmake) - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/setHOST.cmake) - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/platforms/Cheyenne.cmake) - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/platforms/Discover.cmake) - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/platforms/Generic.cmake) - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/platforms/Gaea.cmake) - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/platforms/Jet.cmake) - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/platforms/S4.cmake) - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/platforms/Hera.cmake) - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/platforms/WCOSS-C.cmake) - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/platforms/WCOSS-D.cmake) - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/platforms/WCOSS.cmake) - if (NOT CMAKE_BUILD_TYPE) - set (CMAKE_BUILD_TYPE RELEASE CACHE STRING - "Choose the type of build, options are: PRODUCTION Debug Release." - FORCE) - endif (NOT CMAKE_BUILD_TYPE) - if (CMAKE_CXX_COMPILER_ID MATCHES "GNU*") - message("Setting GNU flags") - setGNU() - elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel") - message("Setting Intel flags") - setIntel() - elseif(CMAKE_C_COMPILER MATCHES "pgc*") - message("Setting PGI flags") - setPGI() - endif() - - cmake_policy(SET CMP0009 NEW) - cmake_policy(SET CMP0054 NEW) - find_package(OpenMP) - message("found openmp with flag ${OPENMP_Fortran_FLAGS}") - -# Set Host specific flags and options - setHOST() - - find_package( NetCDF COMPONENTS C Fortran REQUIRED) - find_package(MPI REQUIRED) - message("MPI version is ${MPI_Fortran_VERSION}") - message("MPI f90 version is ${MPI_Fortran_HAVE_F90_MODULE}") - message("MPI f08 version is ${MPI_Fortran_HAVE_F08_MODULE}") - - add_definitions(${MPI_Fortran_COMPILE_FLAGS}) - include_directories(${MPI_Fortran_INCLUDE_DIRS} ${MPI_INCLUDE_PATH} "./" ${CMAKE_INCLUDE_OUTPUT_DIRECTORY}) - link_directories(${MPI_Fortran_LIBRARIES} ${ARCHIVE_OUTPUT_PATH} ) - find_package( W3NCO ) - - set (CMAKE_Fortran_INC_FLAGS "-I ./ -I ${CORE_INCS} -I ${NETCDF_INCLUDE_DIRS} ") - set(BUILD_NCDIAG ON) - set(NCDIAG_INCS "${PROJECT_BINARY_DIR}/src/ncdiag/include") - add_subdirectory(src/ncdiag) - set(NCDIAG_LIBRARIES ncdiag ) - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) -endif() - -add_subdirectory(nwprod/conmon_shared/sorc/conmon_grads_lev.fd) -add_subdirectory(nwprod/conmon_shared/sorc/conmon_grads_mandlev.fd) -add_subdirectory(nwprod/conmon_shared/sorc/conmon_grads_sfc.fd) -add_subdirectory(nwprod/conmon_shared/sorc/conmon_grads_sfctime.fd) -add_subdirectory(nwprod/conmon_shared/sorc/conmon_grads_sig.fd) -add_subdirectory(nwprod/conmon_shared/sorc/conmon_time.fd) -add_subdirectory(image_gen/sorc/conmon_read_ps_IG.fd) -add_subdirectory(image_gen/sorc/conmon_read_pw_IG.fd) -add_subdirectory(image_gen/sorc/conmon_read_q_IG.fd) -add_subdirectory(image_gen/sorc/conmon_read_t_IG.fd) -add_subdirectory(image_gen/sorc/conmon_read_uv_IG.fd) +add_subdirectory(image_gen) +add_subdirectory(nwprod) diff --git a/util/Conventional_Monitor/image_gen/CMakeLists.txt b/util/Conventional_Monitor/image_gen/CMakeLists.txt new file mode 100644 index 00000000..ddf939af --- /dev/null +++ b/util/Conventional_Monitor/image_gen/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(sorc) diff --git a/util/Conventional_Monitor/image_gen/exec/.gitignore b/util/Conventional_Monitor/image_gen/exec/.gitignore deleted file mode 100644 index d6b7ef32..00000000 --- a/util/Conventional_Monitor/image_gen/exec/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/util/Conventional_Monitor/image_gen/sorc/CMakeLists.txt b/util/Conventional_Monitor/image_gen/sorc/CMakeLists.txt new file mode 100644 index 00000000..3029d34e --- /dev/null +++ b/util/Conventional_Monitor/image_gen/sorc/CMakeLists.txt @@ -0,0 +1,5 @@ +add_subdirectory(conmon_read_ps_IG.fd) +add_subdirectory(conmon_read_pw_IG.fd) +add_subdirectory(conmon_read_q_IG.fd) +add_subdirectory(conmon_read_t_IG.fd) +add_subdirectory(conmon_read_uv_IG.fd) diff --git a/util/Conventional_Monitor/image_gen/sorc/conmon_read_ps_IG.fd/CMakeLists.txt b/util/Conventional_Monitor/image_gen/sorc/conmon_read_ps_IG.fd/CMakeLists.txt index fd28c786..72332232 100644 --- a/util/Conventional_Monitor/image_gen/sorc/conmon_read_ps_IG.fd/CMakeLists.txt +++ b/util/Conventional_Monitor/image_gen/sorc/conmon_read_ps_IG.fd/CMakeLists.txt @@ -1,15 +1,29 @@ -cmake_minimum_required(VERSION 2.6) - file(GLOB CONMON_READ_PS_IG_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*90 ) - set(CONMON_READ_PS_IG_Fortran_FLAGS "-fp-model strict -assume byterecl -convert big_endian -O3 -traceback -D_REAL8_ ") - set_source_files_properties( ${CONMON_READ_PS_IG_SRC} PROPERTIES COMPILE_FLAGS ${CONMON_READ_PS_IG_Fortran_FLAGS} ) - add_executable(conmon_read_ps_IG.x ${CONMON_READ_PS_IG_SRC} ) +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fp-model strict -assume byterecl -convert big_endian") +elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fconvert=big-endian -ffree-line-length-0 -ffast-math -fno-second-underscore -frecord-marker=4") +endif() - set_target_properties( conmon_read_ps_IG.x PROPERTIES COMPILE_FLAGS ${CONMON_READ_PS_IG_Fortran_FLAGS} ) - include_directories( ${CORE_INCS} ${NCDIAG_INCS} ) +list(APPEND SRCS + convinfo.f90 + histgram.f90 + mainread_ps.f90 + read_ps.f90 + read_ps_mor.f90 + rm_dups.f90 +) - target_link_libraries( conmon_read_ps_IG.x ${W3NCO_4_LIBRARY} ${NCDIAG_LIBRARIES} ${NETCDF_Fortran_LIBRARIES} ) - if(BUILD_W3NCO) - add_dependencies( conmon_read_ps_IG.x ${W3NCO_4_LIBRARY} ) - endif() +add_executable(conmon_read_ps_IG.x ${SRCS}) +if(TARGET ncdiag) + add_dependencies(conmon_read_ps_IG.x ncdiag) +endif() +target_compile_definitions(conmon_read_ps_IG.x PRIVATE "_REAL8_") +target_link_libraries(conmon_read_ps_IG.x PRIVATE NetCDF::NetCDF_Fortran) +target_link_libraries(conmon_read_ps_IG.x PRIVATE MPI::MPI_Fortran) +target_link_libraries(conmon_read_ps_IG.x PRIVATE ncdiag::ncdiag) +target_link_libraries(conmon_read_ps_IG.x PRIVATE w3emc::w3emc_4) + +# Install executable targets +install(TARGETS conmon_read_ps_IG.x RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/util/Conventional_Monitor/image_gen/sorc/conmon_read_ps_IG.fd/convinfo.f90 b/util/Conventional_Monitor/image_gen/sorc/conmon_read_ps_IG.fd/convinfo.f90 index 63a749f7..a16a81a8 100644 --- a/util/Conventional_Monitor/image_gen/sorc/conmon_read_ps_IG.fd/convinfo.f90 +++ b/util/Conventional_Monitor/image_gen/sorc/conmon_read_ps_IG.fd/convinfo.f90 @@ -12,8 +12,8 @@ subroutine convinfo_read( dtype, idtype, insubtype, ituse, ntumgrp, ntgroup, ntm !-------------- ! interface ! - character(idtype), intent(in) :: dtype integer, intent(in) :: idtype, insubtype + character(idtype), intent(in) :: dtype integer(4), intent(out) :: ituse, ntumgrp, ntgroup, ntmiter, isubtype real(4), intent(out) :: ttwind2, gtross2, etrmax2, etrmin2, vtar_b2, vtar_pg2 diff --git a/util/Conventional_Monitor/image_gen/sorc/conmon_read_pw_IG.fd/CMakeLists.txt b/util/Conventional_Monitor/image_gen/sorc/conmon_read_pw_IG.fd/CMakeLists.txt index b3e1a7be..0c7ccc22 100644 --- a/util/Conventional_Monitor/image_gen/sorc/conmon_read_pw_IG.fd/CMakeLists.txt +++ b/util/Conventional_Monitor/image_gen/sorc/conmon_read_pw_IG.fd/CMakeLists.txt @@ -1,12 +1,29 @@ -cmake_minimum_required(VERSION 2.6) - file(GLOB CONMON_READ_PW_IG_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*90 ) - set(CONMON_READ_PW_IG_Fortran_FLAGS "-fp-model strict -assume byterecl -convert big_endian -O3 -traceback -D_REAL8_ ") - set_source_files_properties( ${CONMON_READ_PW_IG_SRC} PROPERTIES COMPILE_FLAGS ${CONMON_READ_PW_IG_Fortran_FLAGS} ) - add_executable(conmon_read_pw_IG.x ${CONMON_READ_PW_IG_SRC} ) - set_target_properties( conmon_read_pw_IG.x PROPERTIES COMPILE_FLAGS ${CONMON_READ_PW_IG_Fortran_FLAGS} ) - include_directories( ${CORE_INCS} ${NCDIAG_INCS} ) - target_link_libraries( conmon_read_pw_IG.x ${W3NCO_4_LIBRARY} ${NCDIAG_LIBRARIES} ${NETCDF_Fortran_LIBRARIES} ) - if(BUILD_W3NCO) - add_dependencies( conmon_read_pw_IG.x ${W3NCO_4_LIBRARY} ) - endif() +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fp-model strict -assume byterecl -convert big_endian") +elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fconvert=big-endian -ffree-line-length-0 -ffast-math -fno-second-underscore -frecord-marker=4") +endif() + +list(APPEND SRCS + convinfo.f90 + histgram.f90 + mainread_pw.f90 + read_pw.f90 + read_pw_mor.f90 + rm_dups.f90 +) + +add_executable(conmon_read_pw_IG.x ${SRCS}) +if(TARGET ncdiag) + add_dependencies(conmon_read_pw_IG.x ncdiag) +endif() + +target_compile_definitions(conmon_read_pw_IG.x PRIVATE "_REAL8_") +target_link_libraries(conmon_read_pw_IG.x PRIVATE NetCDF::NetCDF_Fortran) +target_link_libraries(conmon_read_pw_IG.x PRIVATE MPI::MPI_Fortran) +target_link_libraries(conmon_read_pw_IG.x PRIVATE ncdiag::ncdiag) +target_link_libraries(conmon_read_pw_IG.x PRIVATE w3emc::w3emc_4) + +# Install executable targets +install(TARGETS conmon_read_pw_IG.x RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/util/Conventional_Monitor/image_gen/sorc/conmon_read_pw_IG.fd/convinfo.f90 b/util/Conventional_Monitor/image_gen/sorc/conmon_read_pw_IG.fd/convinfo.f90 index 63a749f7..a16a81a8 100644 --- a/util/Conventional_Monitor/image_gen/sorc/conmon_read_pw_IG.fd/convinfo.f90 +++ b/util/Conventional_Monitor/image_gen/sorc/conmon_read_pw_IG.fd/convinfo.f90 @@ -12,8 +12,8 @@ subroutine convinfo_read( dtype, idtype, insubtype, ituse, ntumgrp, ntgroup, ntm !-------------- ! interface ! - character(idtype), intent(in) :: dtype integer, intent(in) :: idtype, insubtype + character(idtype), intent(in) :: dtype integer(4), intent(out) :: ituse, ntumgrp, ntgroup, ntmiter, isubtype real(4), intent(out) :: ttwind2, gtross2, etrmax2, etrmin2, vtar_b2, vtar_pg2 diff --git a/util/Conventional_Monitor/image_gen/sorc/conmon_read_q_IG.fd/CMakeLists.txt b/util/Conventional_Monitor/image_gen/sorc/conmon_read_q_IG.fd/CMakeLists.txt index c5c45259..4d5496df 100644 --- a/util/Conventional_Monitor/image_gen/sorc/conmon_read_q_IG.fd/CMakeLists.txt +++ b/util/Conventional_Monitor/image_gen/sorc/conmon_read_q_IG.fd/CMakeLists.txt @@ -1,12 +1,29 @@ -cmake_minimum_required(VERSION 2.6) - file(GLOB CONMON_READ_Q_IG_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*90 ) - set(CONMON_READ_Q_IG_Fortran_FLAGS "-fp-model strict -assume byterecl -convert big_endian -O3 -traceback -D_REAL8_ ") - set_source_files_properties( ${CONMON_READ_Q_IG_SRC} PROPERTIES COMPILE_FLAGS ${CONMON_READ_Q_IG_Fortran_FLAGS} ) - add_executable(conmon_read_q_IG.x ${CONMON_READ_Q_IG_SRC} ) - set_target_properties( conmon_read_q_IG.x PROPERTIES COMPILE_FLAGS ${CONMON_READ_Q_IG_Fortran_FLAGS} ) - include_directories( ${CORE_INCS} ${NCDIAG_INCS} ) - target_link_libraries( conmon_read_q_IG.x ${W3NCO_4_LIBRARY} ${NCDIAG_LIBRARIES} ${NETCDF_Fortran_LIBRARIES} ) - if(BUILD_W3NCO) - add_dependencies( conmon_read_q_IG.x ${W3NCO_4_LIBRARY} ) - endif() +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fp-model strict -assume byterecl -convert big_endian") +elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fconvert=big-endian -ffree-line-length-0 -ffast-math -fno-second-underscore -frecord-marker=4") +endif() + +list(APPEND SRCS + convinfo.f90 + histgram.f90 + mainread_q.f90 + read_q.f90 + read_q_mor.f90 + rm_dups.f90 +) + +add_executable(conmon_read_q_IG.x ${SRCS}) +if(TARGET ncdiag) + add_dependencies(conmon_read_q_IG.x ncdiag) +endif() + +target_compile_definitions(conmon_read_q_IG.x PRIVATE "_REAL8_") +target_link_libraries(conmon_read_q_IG.x PRIVATE NetCDF::NetCDF_Fortran) +target_link_libraries(conmon_read_q_IG.x PRIVATE MPI::MPI_Fortran) +target_link_libraries(conmon_read_q_IG.x PRIVATE ncdiag::ncdiag) +target_link_libraries(conmon_read_q_IG.x PRIVATE w3emc::w3emc_4) + +# Install executable targets +install(TARGETS conmon_read_q_IG.x RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/util/Conventional_Monitor/image_gen/sorc/conmon_read_q_IG.fd/convinfo.f90 b/util/Conventional_Monitor/image_gen/sorc/conmon_read_q_IG.fd/convinfo.f90 index 63a749f7..a16a81a8 100644 --- a/util/Conventional_Monitor/image_gen/sorc/conmon_read_q_IG.fd/convinfo.f90 +++ b/util/Conventional_Monitor/image_gen/sorc/conmon_read_q_IG.fd/convinfo.f90 @@ -12,8 +12,8 @@ subroutine convinfo_read( dtype, idtype, insubtype, ituse, ntumgrp, ntgroup, ntm !-------------- ! interface ! - character(idtype), intent(in) :: dtype integer, intent(in) :: idtype, insubtype + character(idtype), intent(in) :: dtype integer(4), intent(out) :: ituse, ntumgrp, ntgroup, ntmiter, isubtype real(4), intent(out) :: ttwind2, gtross2, etrmax2, etrmin2, vtar_b2, vtar_pg2 diff --git a/util/Conventional_Monitor/image_gen/sorc/conmon_read_t_IG.fd/CMakeLists.txt b/util/Conventional_Monitor/image_gen/sorc/conmon_read_t_IG.fd/CMakeLists.txt index 9ae4052a..0e57ee9f 100644 --- a/util/Conventional_Monitor/image_gen/sorc/conmon_read_t_IG.fd/CMakeLists.txt +++ b/util/Conventional_Monitor/image_gen/sorc/conmon_read_t_IG.fd/CMakeLists.txt @@ -1,12 +1,29 @@ -cmake_minimum_required(VERSION 2.6) - file(GLOB CONMON_READ_T_IG_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*90 ) - set(CONMON_READ_T_IG_Fortran_FLAGS "-fp-model strict -assume byterecl -convert big_endian -O3 -traceback -D_REAL8_ ") - set_source_files_properties( ${CONMON_READ_T_IG_SRC} PROPERTIES COMPILE_FLAGS ${CONMON_READ_T_IG_Fortran_FLAGS} ) - add_executable(conmon_read_t_IG.x ${CONMON_READ_T_IG_SRC} ) - set_target_properties( conmon_read_t_IG.x PROPERTIES COMPILE_FLAGS ${CONMON_READ_T_IG_Fortran_FLAGS} ) - include_directories( ${CORE_INCS} ${NCDIAG_INCS} ) - target_link_libraries( conmon_read_t_IG.x ${W3NCO_4_LIBRARY} ${NCDIAG_LIBRARIES} ${NETCDF_Fortran_LIBRARIES} ) - if(BUILD_W3NCO) - add_dependencies( conmon_read_t_IG.x ${W3NCO_4_LIBRARY} ) - endif() +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fp-model strict -assume byterecl -convert big_endian") +elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fconvert=big-endian -ffree-line-length-0 -ffast-math -fno-second-underscore -frecord-marker=4") +endif() + +list(APPEND SRCS + convinfo.f90 + histgram.f90 + mainread_t.f90 + read_t.f90 + read_t_mor.f90 + rm_dups.f90 +) + +add_executable(conmon_read_t_IG.x ${SRCS}) +if(TARGET ncdiag) + add_dependencies(conmon_read_t_IG.x ncdiag) +endif() + +target_compile_definitions(conmon_read_t_IG.x PRIVATE "_REAL8_") +target_link_libraries(conmon_read_t_IG.x PRIVATE NetCDF::NetCDF_Fortran) +target_link_libraries(conmon_read_t_IG.x PRIVATE MPI::MPI_Fortran) +target_link_libraries(conmon_read_t_IG.x PRIVATE ncdiag::ncdiag) +target_link_libraries(conmon_read_t_IG.x PRIVATE w3emc::w3emc_4) + +# Install executable targets +install(TARGETS conmon_read_t_IG.x RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/util/Conventional_Monitor/image_gen/sorc/conmon_read_t_IG.fd/convinfo.f90 b/util/Conventional_Monitor/image_gen/sorc/conmon_read_t_IG.fd/convinfo.f90 index 63a749f7..a16a81a8 100644 --- a/util/Conventional_Monitor/image_gen/sorc/conmon_read_t_IG.fd/convinfo.f90 +++ b/util/Conventional_Monitor/image_gen/sorc/conmon_read_t_IG.fd/convinfo.f90 @@ -12,8 +12,8 @@ subroutine convinfo_read( dtype, idtype, insubtype, ituse, ntumgrp, ntgroup, ntm !-------------- ! interface ! - character(idtype), intent(in) :: dtype integer, intent(in) :: idtype, insubtype + character(idtype), intent(in) :: dtype integer(4), intent(out) :: ituse, ntumgrp, ntgroup, ntmiter, isubtype real(4), intent(out) :: ttwind2, gtross2, etrmax2, etrmin2, vtar_b2, vtar_pg2 diff --git a/util/Conventional_Monitor/image_gen/sorc/conmon_read_uv_IG.fd/CMakeLists.txt b/util/Conventional_Monitor/image_gen/sorc/conmon_read_uv_IG.fd/CMakeLists.txt index e7413895..5120d849 100644 --- a/util/Conventional_Monitor/image_gen/sorc/conmon_read_uv_IG.fd/CMakeLists.txt +++ b/util/Conventional_Monitor/image_gen/sorc/conmon_read_uv_IG.fd/CMakeLists.txt @@ -1,12 +1,30 @@ -cmake_minimum_required(VERSION 2.6) - file(GLOB CONMON_READ_UV_IG_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*90 ) - set(CONMON_READ_UV_IG_Fortran_FLAGS "-fp-model strict -assume byterecl -convert big_endian -O3 -traceback -D_REAL8_ ") - set_source_files_properties( ${CONMON_READ_UV_IG_SRC} PROPERTIES COMPILE_FLAGS ${CONMON_READ_UV_IG_Fortran_FLAGS} ) - add_executable(conmon_read_uv_IG.x ${CONMON_READ_UV_IG_SRC} ) - set_target_properties( conmon_read_uv_IG.x PROPERTIES COMPILE_FLAGS ${CONMON_READ_UV_IG_Fortran_FLAGS} ) - include_directories( ${CORE_INCS} ${NCDIAG_INCS} ) - target_link_libraries( conmon_read_uv_IG.x ${W3NCO_4_LIBRARY} ${NCDIAG_LIBRARIES} ${NETCDF_Fortran_LIBRARIES} ) - if(BUILD_W3NCO) - add_dependencies( conmon_read_uv_IG.x ${W3NCO_4_LIBRARY} ) - endif() +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fp-model strict -assume byterecl -convert big_endian") +elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fconvert=big-endian -ffree-line-length-0 -ffast-math -fno-second-underscore -frecord-marker=4") +endif() + +list(APPEND SRCS + convinfo.f90 + histgram.f90 + histgramuv.f90 + mainread_uv.f90 + read_uv.f90 + read_uv_mor.f90 + rm_dups.f90 +) + +add_executable(conmon_read_uv_IG.x ${SRCS}) +if(TARGET ncdiag) + add_dependencies(conmon_read_uv_IG.x ncdiag) +endif() + +target_compile_definitions(conmon_read_uv_IG.x PRIVATE "_REAL8_") +target_link_libraries(conmon_read_uv_IG.x PRIVATE NetCDF::NetCDF_Fortran) +target_link_libraries(conmon_read_uv_IG.x PRIVATE MPI::MPI_Fortran) +target_link_libraries(conmon_read_uv_IG.x PRIVATE ncdiag::ncdiag) +target_link_libraries(conmon_read_uv_IG.x PRIVATE w3emc::w3emc_4) + +# Install executable targets +install(TARGETS conmon_read_uv_IG.x RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/util/Conventional_Monitor/image_gen/sorc/conmon_read_uv_IG.fd/convinfo.f90 b/util/Conventional_Monitor/image_gen/sorc/conmon_read_uv_IG.fd/convinfo.f90 index 63a749f7..a16a81a8 100644 --- a/util/Conventional_Monitor/image_gen/sorc/conmon_read_uv_IG.fd/convinfo.f90 +++ b/util/Conventional_Monitor/image_gen/sorc/conmon_read_uv_IG.fd/convinfo.f90 @@ -12,8 +12,8 @@ subroutine convinfo_read( dtype, idtype, insubtype, ituse, ntumgrp, ntgroup, ntm !-------------- ! interface ! - character(idtype), intent(in) :: dtype integer, intent(in) :: idtype, insubtype + character(idtype), intent(in) :: dtype integer(4), intent(out) :: ituse, ntumgrp, ntgroup, ntmiter, isubtype real(4), intent(out) :: ttwind2, gtross2, etrmax2, etrmin2, vtar_b2, vtar_pg2 diff --git a/util/Conventional_Monitor/nwprod/CMakeLists.txt b/util/Conventional_Monitor/nwprod/CMakeLists.txt new file mode 100644 index 00000000..11bdb4b8 --- /dev/null +++ b/util/Conventional_Monitor/nwprod/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(conmon_shared) diff --git a/util/Conventional_Monitor/nwprod/conmon_shared/CMakeLists.txt b/util/Conventional_Monitor/nwprod/conmon_shared/CMakeLists.txt new file mode 100644 index 00000000..ddf939af --- /dev/null +++ b/util/Conventional_Monitor/nwprod/conmon_shared/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(sorc) diff --git a/util/Conventional_Monitor/nwprod/conmon_shared/exec/.gitignore b/util/Conventional_Monitor/nwprod/conmon_shared/exec/.gitignore deleted file mode 100644 index d6b7ef32..00000000 --- a/util/Conventional_Monitor/nwprod/conmon_shared/exec/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/util/Conventional_Monitor/nwprod/conmon_shared/modulefiles/cray/CMonBuild b/util/Conventional_Monitor/nwprod/conmon_shared/modulefiles/cray/CMonBuild deleted file mode 100644 index 0dfad2c3..00000000 --- a/util/Conventional_Monitor/nwprod/conmon_shared/modulefiles/cray/CMonBuild +++ /dev/null @@ -1,21 +0,0 @@ -#%Module################################################################# -proc ModulesHelp { } { - puts stderr "Set environment variables for WCOSS cmon build" -} - -module-whatis "Set environment variables for WCOSS cmon build" - - -module load intel -module load w3nco-intel - -set ver 2.0.4 -set FCOMP ifort - -setenv CF $FCOMP -setenv FC $FCOMP -setenv FFLAGS "-O3 -fp-model strict -D_REAL8_ -traceback -convert big_endian -assume byterecl" -setenv D_FFLAGS "-O3 -fp-model strict -D_REAL8_ -traceback -convert big_endian -assume byterecl -debug" -setenv CHECK_LIBS "/gpfs/hps/nco/ops/nwprod/spa_util/check_libs.bash" - - diff --git a/util/Conventional_Monitor/nwprod/conmon_shared/modulefiles/theia/CMonBuild b/util/Conventional_Monitor/nwprod/conmon_shared/modulefiles/theia/CMonBuild deleted file mode 100644 index 29b99fa3..00000000 --- a/util/Conventional_Monitor/nwprod/conmon_shared/modulefiles/theia/CMonBuild +++ /dev/null @@ -1,17 +0,0 @@ -#%Module################################################################# -proc ModulesHelp { } { - puts stderr "Set environment variables for THEIA cmon build" -} - -module-whatis "Set environment variables for THEIA cmon build" - -module load intel - -set FCOMP ifort - -setenv CF $FCOMP -setenv FC $FCOMP -setenv FFLAGS "-O3 -fp-model strict -D_REAL8_ -traceback -convert big_endian -assume byterecl" -setenv D_FFLAGS "-O3 -fp-model strict -D_REAL8_ -traceback -convert big_endian -assume byterecl -debug" - -setenv W3NCO_LIB4 "-L/scratch3/NCEPDEV/nwprod/lib -lw3nco_4" diff --git a/util/Conventional_Monitor/nwprod/conmon_shared/modulefiles/wcoss/CMonBuild b/util/Conventional_Monitor/nwprod/conmon_shared/modulefiles/wcoss/CMonBuild deleted file mode 100644 index ff2d51fb..00000000 --- a/util/Conventional_Monitor/nwprod/conmon_shared/modulefiles/wcoss/CMonBuild +++ /dev/null @@ -1,18 +0,0 @@ -#%Module################################################################# -proc ModulesHelp { } { - puts stderr "Set environment variables for WCOSS cmon build" -} - -module-whatis "Set environment variables for WCOSS cmon build" - -set ver 2.0.4 -set FCOMP ifort - -setenv CF $FCOMP -setenv FC $FCOMP -setenv FFLAGS "-O3 -fp-model strict -D_REAL8_ -traceback -convert big_endian -assume byterecl" -setenv D_FFLAGS "-O3 -fp-model strict -D_REAL8_ -traceback -convert big_endian -assume byterecl -debug" -setenv CHECK_LIBS "/nwprod/spa_util/check_libs.bash" -module load ics -module load w3nco - diff --git a/util/Conventional_Monitor/nwprod/conmon_shared/sorc/CMakeLists.txt b/util/Conventional_Monitor/nwprod/conmon_shared/sorc/CMakeLists.txt new file mode 100644 index 00000000..33eafda0 --- /dev/null +++ b/util/Conventional_Monitor/nwprod/conmon_shared/sorc/CMakeLists.txt @@ -0,0 +1,6 @@ +add_subdirectory(conmon_grads_lev.fd) +add_subdirectory(conmon_grads_mandlev.fd) +add_subdirectory(conmon_grads_sfc.fd) +add_subdirectory(conmon_grads_sfctime.fd) +add_subdirectory(conmon_grads_sig.fd) +add_subdirectory(conmon_time.fd) diff --git a/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_lev.fd/CMakeLists.txt b/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_lev.fd/CMakeLists.txt index 34741860..d53b99c4 100644 --- a/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_lev.fd/CMakeLists.txt +++ b/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_lev.fd/CMakeLists.txt @@ -1,19 +1,30 @@ -cmake_minimum_required(VERSION 3.16.1) - file(GLOB CONMON_GRADS_LEV_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*90 ) - set(CONMON_GRADS_LEV_Fortran_FLAGS "-fp-model strict -assume byterecl -convert big_endian -O3 -traceback -D_REAL8_ ") - set(Util_MODULE_DIR ${PROJECT_BINARY_DIR}/include/conmon_grads_lev ) +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fp-model strict -assume byterecl -convert big_endian") +elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fconvert=big-endian -ffree-line-length-0 -ffast-math -fno-second-underscore -frecord-marker=4") +endif() - set_source_files_properties( ${CONMON_GRADS_LEV_SRC} PROPERTIES COMPILE_FLAGS ${CONMON_GRADS_LEV_Fortran_FLAGS} ) - add_executable(conmon_grads_lev.x ${CONMON_GRADS_LEV_SRC} ) - set_target_properties( conmon_grads_lev.x PROPERTIES COMPILE_FLAGS ${CONMON_GRADS_LEV_Fortran_FLAGS} ) - set_target_properties( conmon_grads_lev.x PROPERTIES Fortran_MODULE_DIRECTORY ${Util_MODULE_DIR} ) +list(APPEND SRCS + conmon_read_diag.F90 + data_mod.f90 + generic_list.f90 + grads_lev.f90 + kinds.F90 + maingrads_lev.f90 + rm_dups.f90 +) - include_directories( ${CORE_INCS} ${NCDIAG_INCS} ) +add_executable(conmon_grads_lev.x ${SRCS}) +if(TARGET ncdiag) + add_dependencies(conmon_grads_lev.x ncdiag) +endif() - target_link_libraries( conmon_grads_lev.x ${W3NCO_4_LIBRARY} ${NCDIAG_LIBRARIES} ${NETCDF_Fortran_LIBRARIES} - ${NETCDF_C_LIBRARIES} ${MPI_Fortran_LIBRARIES} ) +target_compile_definitions(conmon_grads_lev.x PRIVATE "_REAL8_") +target_link_libraries(conmon_grads_lev.x PRIVATE NetCDF::NetCDF_Fortran) +target_link_libraries(conmon_grads_lev.x PRIVATE MPI::MPI_Fortran) +target_link_libraries(conmon_grads_lev.x PRIVATE ncdiag::ncdiag) +target_link_libraries(conmon_grads_lev.x PRIVATE w3emc::w3emc_4) - if(BUILD_W3NCO) - add_dependencies( conmon_grads_lev.x ${W3NCO_4_LIBRARY} ) - endif() +# Install executable targets +install(TARGETS conmon_grads_lev.x RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_lev.fd/conmon_read_diag.F90 b/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_lev.fd/conmon_read_diag.F90 index 0b7afcf0..add99d17 100644 --- a/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_lev.fd/conmon_read_diag.F90 +++ b/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_lev.fd/conmon_read_diag.F90 @@ -424,12 +424,12 @@ subroutine read_diag_file_ps_nc( input_file, return_all, ftin, ctype, intype,exp ! if( adjustl( trim( Observation_Class(ii) )) == adjustl( trim( ctype ))) then - if( return_all == .true. ) then + if( return_all .eqv. .true. ) then add_obs = .true. else if( Observation_Type(ii) == intype ) then - if( have_subtype == .false. ) then + if( have_subtype .eqv. .false. ) then add_obs = .true. else if( Observation_Subtype(ii) == in_subtype ) then add_obs = .true. @@ -438,7 +438,7 @@ subroutine read_diag_file_ps_nc( input_file, return_all, ftin, ctype, intype,exp end if end if - if( add_obs == .true. ) then + if( add_obs .eqv. .true. ) then nobs=nobs+1 @@ -628,12 +628,12 @@ subroutine read_diag_file_q_nc( input_file, return_all, ftin, ctype, intype,expe ! if( adjustl( trim( Observation_Class(ii) )) == adjustl( trim( ctype ))) then - if( return_all == .true. ) then + if( return_all .eqv. .true. ) then add_obs = .true. else if( Observation_Type(ii) == intype ) then - if( have_subtype == .false. ) then + if( have_subtype .eqv. .false. ) then add_obs = .true. else if( Observation_Subtype(ii) == in_subtype ) then add_obs = .true. @@ -643,7 +643,7 @@ subroutine read_diag_file_q_nc( input_file, return_all, ftin, ctype, intype,expe end if - if( add_obs == .true. ) then + if( add_obs .eqv. .true. ) then nobs=nobs+1 @@ -850,12 +850,12 @@ subroutine read_diag_file_sst_nc( input_file, return_all, ftin, ctype, intype,ex ! if( adjustl( trim( Observation_Class(ii) )) == adjustl( trim( ctype ))) then - if( return_all == .true. ) then + if( return_all .eqv. .true. ) then add_obs = .true. else if( Observation_Type(ii) == intype ) then - if( have_subtype == .false. ) then + if( have_subtype .eqv. .false. ) then add_obs = .true. else if( Observation_Subtype(ii) == in_subtype ) then add_obs = .true. @@ -865,7 +865,7 @@ subroutine read_diag_file_sst_nc( input_file, return_all, ftin, ctype, intype,ex end if - if( add_obs == .true. ) then + if( add_obs .eqv. .true. ) then nobs=nobs+1 @@ -1100,12 +1100,12 @@ subroutine read_diag_file_t_nc( input_file, return_all, ftin, ctype, intype, exp if( adjustl( trim( Observation_Class(ii) )) == adjustl( trim( ctype ))) then - if( return_all == .true. ) then + if( return_all .eqv. .true. ) then add_obs = .true. else if( Observation_Type(ii) == intype ) then - if( have_subtype == .false. ) then + if( have_subtype .eqv. .false. ) then add_obs = .true. else if( Observation_Subtype(ii) == in_subtype ) then add_obs = .true. @@ -1114,7 +1114,7 @@ subroutine read_diag_file_t_nc( input_file, return_all, ftin, ctype, intype, exp end if end if - if( add_obs == .true. ) then + if( add_obs .eqv. .true. ) then nobs=nobs+1 @@ -1319,12 +1319,12 @@ subroutine read_diag_file_uv_nc( input_file, return_all, ftin, ctype, intype, ex if( adjustl( trim( Observation_Class(ii) )) == adjustl( trim( ctype ))) then - if( return_all == .true. ) then + if( return_all .eqv. .true. ) then add_obs = .true. else if( Observation_Type(ii) == intype ) then - if( have_subtype == .false. ) then + if( have_subtype .eqv. .false. ) then add_obs = .true. else if( Observation_Subtype(ii) == in_subtype ) then add_obs = .true. @@ -1333,7 +1333,7 @@ subroutine read_diag_file_uv_nc( input_file, return_all, ftin, ctype, intype, ex end if end if - if( add_obs == .true. ) then + if( add_obs .eqv. .true. ) then nobs=nobs+1 @@ -1554,12 +1554,12 @@ subroutine read_diag_file_gps_nc( input_file, return_all, ftin, ctype, intype,ex if( adjustl( trim( Observation_Class(ii) )) == adjustl( trim( ctype ))) then - if( return_all == .true. ) then + if( return_all .eqv. .true. ) then add_obs = .true. else if( Observation_Type(ii) == intype ) then - if( have_subtype == .false. ) then + if( have_subtype .eqv. .false. ) then add_obs = .true. else if( Observation_Subtype(ii) == in_subtype ) then add_obs = .true. @@ -1568,7 +1568,7 @@ subroutine read_diag_file_gps_nc( input_file, return_all, ftin, ctype, intype,ex end if end if - if( add_obs == .true. ) then + if( add_obs .eqv. .true. ) then nobs=nobs+1 @@ -1733,7 +1733,7 @@ subroutine read_diag_file_bin( input_file, return_all, ctype, intype,expected_nr ! exit loop if the number of reals (nreal) from file ! doesn't match the target number ! - if(( return_all == .true. ) .OR. ( trim(dtype) == trim(ctype) .and. file_nreal /= expected_nreal )) then + if(( return_all .eqv. .true. ) .OR. ( trim(dtype) == trim(ctype) .and. file_nreal /= expected_nreal )) then print *, 'matched observation type:',dtype,' file_nreal=', file_nreal exit endif @@ -1741,7 +1741,7 @@ subroutine read_diag_file_bin( input_file, return_all, ctype, intype,expected_nr !--------------------------------------------- ! skip to next iteration if types don't match ! - if(( return_all == .false. ) .AND. ( trim( dtype ) /= trim( ctype ))) then + if(( return_all .eqv. .false. ) .AND. ( trim( dtype ) /= trim( ctype ))) then cycle endif @@ -1764,7 +1764,7 @@ subroutine read_diag_file_bin( input_file, return_all, ctype, intype,expected_nr ! if both types and subtypes match ! then add a new data element ! - if(( return_all == .true. ) .OR. ( file_itype == intype .AND. file_subtype == in_subtype )) then + if(( return_all .eqv. .true. ) .OR. ( file_itype == intype .AND. file_subtype == in_subtype )) then nobs=nobs+1 diff --git a/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_lev.fd/grads_lev.f90 b/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_lev.fd/grads_lev.f90 index c537af29..04ae4668 100644 --- a/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_lev.fd/grads_lev.f90 +++ b/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_lev.fd/grads_lev.f90 @@ -73,7 +73,7 @@ subroutine grads_lev(fileo,ifileo,nobs,nreal,nlev,plev,iscater,igrads,& obs_ctr = 0 next => list - do while ( associated( next ) == .TRUE. ) + do while ( associated( next ) .eqv. .TRUE. ) ptr = transfer(list_get( next ), ptr) next => list_next( next ) diff --git a/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_mandlev.fd/CMakeLists.txt b/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_mandlev.fd/CMakeLists.txt index 86d8bbe0..916b99ce 100644 --- a/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_mandlev.fd/CMakeLists.txt +++ b/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_mandlev.fd/CMakeLists.txt @@ -1,19 +1,30 @@ -cmake_minimum_required(VERSION 3.16.1) - file(GLOB CONMON_GRADS_MANDLEV_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*90 ) - set(CONMON_GRADS_MANDLEV_Fortran_FLAGS "-fp-model strict -assume byterecl -convert big_endian -O3 -traceback -D_REAL8_ ") - set(Util_MODULE_DIR ${PROJECT_BINARY_DIR}/include/conmon_grads_mandlev ) +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fp-model strict -assume byterecl -convert big_endian") +elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fconvert=big-endian -ffree-line-length-0 -ffast-math -fno-second-underscore -frecord-marker=4") +endif() - set_source_files_properties( ${CONMON_GRADS_MANDLEV_SRC} PROPERTIES COMPILE_FLAGS ${CONMON_GRADS_MANDLEV_Fortran_FLAGS} ) - add_executable(conmon_grads_mandlev.x ${CONMON_GRADS_MANDLEV_SRC} ) - set_target_properties( conmon_grads_mandlev.x PROPERTIES COMPILE_FLAGS ${CONMON_GRADS_MANDLEV_Fortran_FLAGS} ) - set_target_properties( conmon_grads_mandlev.x PROPERTIES Fortran_MODULE_DIRECTORY ${Util_MODULE_DIR} ) +list(APPEND SRCS + conmon_read_diag.F90 + data_mod.f90 + generic_list.f90 + grads_mandlev.f90 + kinds.F90 + maingrads_mandlev.f90 + rm_dups.f90 +) - include_directories( ${CORE_INCS} ${NCDIAG_INCS} ) - - target_link_libraries( conmon_grads_mandlev.x ${W3NCO_4_LIBRARY} ${NCDIAG_LIBRARIES} ${NETCDF_Fortran_LIBRARIES} - ${NETCDF_C_LIBRARIES} ${MPI_Fortran_LIBRARIES} ) +add_executable(conmon_grads_mandlev.x ${SRCS}) +if(TARGET ncdiag) + add_dependencies(conmon_grads_mandlev.x ncdiag) +endif() - if(BUILD_W3NCO) - add_dependencies( conmon_grads_mandlev.x ${W3NCO_4_LIBRARY} ) - endif() +target_compile_definitions(conmon_grads_mandlev.x PRIVATE "_REAL8_") +target_link_libraries(conmon_grads_mandlev.x PRIVATE NetCDF::NetCDF_Fortran) +target_link_libraries(conmon_grads_mandlev.x PRIVATE MPI::MPI_Fortran) +target_link_libraries(conmon_grads_mandlev.x PRIVATE ncdiag::ncdiag) +target_link_libraries(conmon_grads_mandlev.x PRIVATE w3emc::w3emc_4) + +# Install executable targets +install(TARGETS conmon_grads_mandlev.x RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_mandlev.fd/conmon_read_diag.F90 b/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_mandlev.fd/conmon_read_diag.F90 index 0b7afcf0..add99d17 100644 --- a/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_mandlev.fd/conmon_read_diag.F90 +++ b/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_mandlev.fd/conmon_read_diag.F90 @@ -424,12 +424,12 @@ subroutine read_diag_file_ps_nc( input_file, return_all, ftin, ctype, intype,exp ! if( adjustl( trim( Observation_Class(ii) )) == adjustl( trim( ctype ))) then - if( return_all == .true. ) then + if( return_all .eqv. .true. ) then add_obs = .true. else if( Observation_Type(ii) == intype ) then - if( have_subtype == .false. ) then + if( have_subtype .eqv. .false. ) then add_obs = .true. else if( Observation_Subtype(ii) == in_subtype ) then add_obs = .true. @@ -438,7 +438,7 @@ subroutine read_diag_file_ps_nc( input_file, return_all, ftin, ctype, intype,exp end if end if - if( add_obs == .true. ) then + if( add_obs .eqv. .true. ) then nobs=nobs+1 @@ -628,12 +628,12 @@ subroutine read_diag_file_q_nc( input_file, return_all, ftin, ctype, intype,expe ! if( adjustl( trim( Observation_Class(ii) )) == adjustl( trim( ctype ))) then - if( return_all == .true. ) then + if( return_all .eqv. .true. ) then add_obs = .true. else if( Observation_Type(ii) == intype ) then - if( have_subtype == .false. ) then + if( have_subtype .eqv. .false. ) then add_obs = .true. else if( Observation_Subtype(ii) == in_subtype ) then add_obs = .true. @@ -643,7 +643,7 @@ subroutine read_diag_file_q_nc( input_file, return_all, ftin, ctype, intype,expe end if - if( add_obs == .true. ) then + if( add_obs .eqv. .true. ) then nobs=nobs+1 @@ -850,12 +850,12 @@ subroutine read_diag_file_sst_nc( input_file, return_all, ftin, ctype, intype,ex ! if( adjustl( trim( Observation_Class(ii) )) == adjustl( trim( ctype ))) then - if( return_all == .true. ) then + if( return_all .eqv. .true. ) then add_obs = .true. else if( Observation_Type(ii) == intype ) then - if( have_subtype == .false. ) then + if( have_subtype .eqv. .false. ) then add_obs = .true. else if( Observation_Subtype(ii) == in_subtype ) then add_obs = .true. @@ -865,7 +865,7 @@ subroutine read_diag_file_sst_nc( input_file, return_all, ftin, ctype, intype,ex end if - if( add_obs == .true. ) then + if( add_obs .eqv. .true. ) then nobs=nobs+1 @@ -1100,12 +1100,12 @@ subroutine read_diag_file_t_nc( input_file, return_all, ftin, ctype, intype, exp if( adjustl( trim( Observation_Class(ii) )) == adjustl( trim( ctype ))) then - if( return_all == .true. ) then + if( return_all .eqv. .true. ) then add_obs = .true. else if( Observation_Type(ii) == intype ) then - if( have_subtype == .false. ) then + if( have_subtype .eqv. .false. ) then add_obs = .true. else if( Observation_Subtype(ii) == in_subtype ) then add_obs = .true. @@ -1114,7 +1114,7 @@ subroutine read_diag_file_t_nc( input_file, return_all, ftin, ctype, intype, exp end if end if - if( add_obs == .true. ) then + if( add_obs .eqv. .true. ) then nobs=nobs+1 @@ -1319,12 +1319,12 @@ subroutine read_diag_file_uv_nc( input_file, return_all, ftin, ctype, intype, ex if( adjustl( trim( Observation_Class(ii) )) == adjustl( trim( ctype ))) then - if( return_all == .true. ) then + if( return_all .eqv. .true. ) then add_obs = .true. else if( Observation_Type(ii) == intype ) then - if( have_subtype == .false. ) then + if( have_subtype .eqv. .false. ) then add_obs = .true. else if( Observation_Subtype(ii) == in_subtype ) then add_obs = .true. @@ -1333,7 +1333,7 @@ subroutine read_diag_file_uv_nc( input_file, return_all, ftin, ctype, intype, ex end if end if - if( add_obs == .true. ) then + if( add_obs .eqv. .true. ) then nobs=nobs+1 @@ -1554,12 +1554,12 @@ subroutine read_diag_file_gps_nc( input_file, return_all, ftin, ctype, intype,ex if( adjustl( trim( Observation_Class(ii) )) == adjustl( trim( ctype ))) then - if( return_all == .true. ) then + if( return_all .eqv. .true. ) then add_obs = .true. else if( Observation_Type(ii) == intype ) then - if( have_subtype == .false. ) then + if( have_subtype .eqv. .false. ) then add_obs = .true. else if( Observation_Subtype(ii) == in_subtype ) then add_obs = .true. @@ -1568,7 +1568,7 @@ subroutine read_diag_file_gps_nc( input_file, return_all, ftin, ctype, intype,ex end if end if - if( add_obs == .true. ) then + if( add_obs .eqv. .true. ) then nobs=nobs+1 @@ -1733,7 +1733,7 @@ subroutine read_diag_file_bin( input_file, return_all, ctype, intype,expected_nr ! exit loop if the number of reals (nreal) from file ! doesn't match the target number ! - if(( return_all == .true. ) .OR. ( trim(dtype) == trim(ctype) .and. file_nreal /= expected_nreal )) then + if(( return_all .eqv. .true. ) .OR. ( trim(dtype) == trim(ctype) .and. file_nreal /= expected_nreal )) then print *, 'matched observation type:',dtype,' file_nreal=', file_nreal exit endif @@ -1741,7 +1741,7 @@ subroutine read_diag_file_bin( input_file, return_all, ctype, intype,expected_nr !--------------------------------------------- ! skip to next iteration if types don't match ! - if(( return_all == .false. ) .AND. ( trim( dtype ) /= trim( ctype ))) then + if(( return_all .eqv. .false. ) .AND. ( trim( dtype ) /= trim( ctype ))) then cycle endif @@ -1764,7 +1764,7 @@ subroutine read_diag_file_bin( input_file, return_all, ctype, intype,expected_nr ! if both types and subtypes match ! then add a new data element ! - if(( return_all == .true. ) .OR. ( file_itype == intype .AND. file_subtype == in_subtype )) then + if(( return_all .eqv. .true. ) .OR. ( file_itype == intype .AND. file_subtype == in_subtype )) then nobs=nobs+1 diff --git a/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_mandlev.fd/grads_mandlev.f90 b/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_mandlev.fd/grads_mandlev.f90 index 00542bd8..68a63ea3 100644 --- a/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_mandlev.fd/grads_mandlev.f90 +++ b/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_mandlev.fd/grads_mandlev.f90 @@ -28,6 +28,7 @@ subroutine grads_mandlev(fileo,ifileo,nobs,nreal,nlev,plev,iscater,igrads,& real(4) rlat,rlon,rp character(3) subtype,run character(8) stid + integer ifileo character(ifileo) :: fileo character(30) :: files,filegrads character(8) :: stidend @@ -35,7 +36,7 @@ subroutine grads_mandlev(fileo,ifileo,nobs,nreal,nlev,plev,iscater,igrads,& real*4 :: rtim,xlat0,xlon0 character(30) :: filein, file_nobs - integer :: ifileo,i,j,ii,k,nreal_m2,ctr,obs_ctr + integer :: i,j,ii,k,nreal_m2,ctr,obs_ctr integer :: ilat,ilon,ipres,itime,iweight,ndup integer(4) :: isubtype @@ -66,7 +67,7 @@ subroutine grads_mandlev(fileo,ifileo,nobs,nreal,nlev,plev,iscater,igrads,& obs_ctr = 0 next => list - do while ( associated( next ) == .TRUE. ) + do while ( associated( next ) .eqv. .TRUE. ) ptr = transfer(list_get( next ), ptr) next => list_next( next ) diff --git a/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_sfc.fd/CMakeLists.txt b/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_sfc.fd/CMakeLists.txt index e1e38afa..1535bd68 100644 --- a/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_sfc.fd/CMakeLists.txt +++ b/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_sfc.fd/CMakeLists.txt @@ -1,17 +1,30 @@ -cmake_minimum_required(VERSION 3.16.1) - file(GLOB CONMON_GRADS_SFC_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*90 ) - set(CONMON_GRADS_SFC_Fortran_FLAGS "-fp-model strict -assume byterecl -convert big_endian -O3 -traceback -D_REAL8_ ") - set(Util_MODULE_DIR ${PROJECT_BINARY_DIR}/include/conmon_grads_sfc ) +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fp-model strict -assume byterecl -convert big_endian") +elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fconvert=big-endian -ffree-line-length-0 -ffast-math -fno-second-underscore -frecord-marker=4") +endif() - set_source_files_properties( ${CONMON_GRADS_SFC_SRC} PROPERTIES COMPILE_FLAGS ${CONMON_GRADS_SFC_Fortran_FLAGS} ) - add_executable(conmon_grads_sfc.x ${CONMON_GRADS_SFC_SRC} ) - set_target_properties( conmon_grads_sfc.x PROPERTIES COMPILE_FLAGS ${CONMON_GRADS_SFC_Fortran_FLAGS} ) - set_target_properties( conmon_grads_sfc.x PROPERTIES Fortran_MODULE_DIRECTORY ${Util_MODULE_DIR} ) +list(APPEND SRCS + conmon_read_diag.F90 + data_mod.f90 + generic_list.f90 + grads_sfc.f90 + kinds.F90 + maingrads_sfc.f90 + rm_dups.f90 +) - include_directories( ${CORE_INCS} ${NCDIAG_INCS} ) - target_link_libraries( conmon_grads_sfc.x ${W3NCO_4_LIBRARY} ${NCDIAG_LIBRARIES} ${NETCDF_Fortran_LIBRARIES} - ${NETCDF_C_LIBRARIES} ${MPI_Fortran_LIBRARIES} ) - if(BUILD_W3NCO) - add_dependencies( conmon_grads_sfc.x ${W3NCO_4_LIBRARY} ) - endif() +add_executable(conmon_grads_sfc.x ${SRCS}) +if(TARGET ncdiag) + add_dependencies(conmon_grads_sfc.x ncdiag) +endif() + +target_compile_definitions(conmon_grads_sfc.x PRIVATE "_REAL8_") +target_link_libraries(conmon_grads_sfc.x PRIVATE NetCDF::NetCDF_Fortran) +target_link_libraries(conmon_grads_sfc.x PRIVATE MPI::MPI_Fortran) +target_link_libraries(conmon_grads_sfc.x PRIVATE ncdiag::ncdiag) +target_link_libraries(conmon_grads_sfc.x PRIVATE w3emc::w3emc_4) + +# Install executable targets +install(TARGETS conmon_grads_sfc.x RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_sfc.fd/conmon_read_diag.F90 b/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_sfc.fd/conmon_read_diag.F90 index 0b7afcf0..add99d17 100644 --- a/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_sfc.fd/conmon_read_diag.F90 +++ b/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_sfc.fd/conmon_read_diag.F90 @@ -424,12 +424,12 @@ subroutine read_diag_file_ps_nc( input_file, return_all, ftin, ctype, intype,exp ! if( adjustl( trim( Observation_Class(ii) )) == adjustl( trim( ctype ))) then - if( return_all == .true. ) then + if( return_all .eqv. .true. ) then add_obs = .true. else if( Observation_Type(ii) == intype ) then - if( have_subtype == .false. ) then + if( have_subtype .eqv. .false. ) then add_obs = .true. else if( Observation_Subtype(ii) == in_subtype ) then add_obs = .true. @@ -438,7 +438,7 @@ subroutine read_diag_file_ps_nc( input_file, return_all, ftin, ctype, intype,exp end if end if - if( add_obs == .true. ) then + if( add_obs .eqv. .true. ) then nobs=nobs+1 @@ -628,12 +628,12 @@ subroutine read_diag_file_q_nc( input_file, return_all, ftin, ctype, intype,expe ! if( adjustl( trim( Observation_Class(ii) )) == adjustl( trim( ctype ))) then - if( return_all == .true. ) then + if( return_all .eqv. .true. ) then add_obs = .true. else if( Observation_Type(ii) == intype ) then - if( have_subtype == .false. ) then + if( have_subtype .eqv. .false. ) then add_obs = .true. else if( Observation_Subtype(ii) == in_subtype ) then add_obs = .true. @@ -643,7 +643,7 @@ subroutine read_diag_file_q_nc( input_file, return_all, ftin, ctype, intype,expe end if - if( add_obs == .true. ) then + if( add_obs .eqv. .true. ) then nobs=nobs+1 @@ -850,12 +850,12 @@ subroutine read_diag_file_sst_nc( input_file, return_all, ftin, ctype, intype,ex ! if( adjustl( trim( Observation_Class(ii) )) == adjustl( trim( ctype ))) then - if( return_all == .true. ) then + if( return_all .eqv. .true. ) then add_obs = .true. else if( Observation_Type(ii) == intype ) then - if( have_subtype == .false. ) then + if( have_subtype .eqv. .false. ) then add_obs = .true. else if( Observation_Subtype(ii) == in_subtype ) then add_obs = .true. @@ -865,7 +865,7 @@ subroutine read_diag_file_sst_nc( input_file, return_all, ftin, ctype, intype,ex end if - if( add_obs == .true. ) then + if( add_obs .eqv. .true. ) then nobs=nobs+1 @@ -1100,12 +1100,12 @@ subroutine read_diag_file_t_nc( input_file, return_all, ftin, ctype, intype, exp if( adjustl( trim( Observation_Class(ii) )) == adjustl( trim( ctype ))) then - if( return_all == .true. ) then + if( return_all .eqv. .true. ) then add_obs = .true. else if( Observation_Type(ii) == intype ) then - if( have_subtype == .false. ) then + if( have_subtype .eqv. .false. ) then add_obs = .true. else if( Observation_Subtype(ii) == in_subtype ) then add_obs = .true. @@ -1114,7 +1114,7 @@ subroutine read_diag_file_t_nc( input_file, return_all, ftin, ctype, intype, exp end if end if - if( add_obs == .true. ) then + if( add_obs .eqv. .true. ) then nobs=nobs+1 @@ -1319,12 +1319,12 @@ subroutine read_diag_file_uv_nc( input_file, return_all, ftin, ctype, intype, ex if( adjustl( trim( Observation_Class(ii) )) == adjustl( trim( ctype ))) then - if( return_all == .true. ) then + if( return_all .eqv. .true. ) then add_obs = .true. else if( Observation_Type(ii) == intype ) then - if( have_subtype == .false. ) then + if( have_subtype .eqv. .false. ) then add_obs = .true. else if( Observation_Subtype(ii) == in_subtype ) then add_obs = .true. @@ -1333,7 +1333,7 @@ subroutine read_diag_file_uv_nc( input_file, return_all, ftin, ctype, intype, ex end if end if - if( add_obs == .true. ) then + if( add_obs .eqv. .true. ) then nobs=nobs+1 @@ -1554,12 +1554,12 @@ subroutine read_diag_file_gps_nc( input_file, return_all, ftin, ctype, intype,ex if( adjustl( trim( Observation_Class(ii) )) == adjustl( trim( ctype ))) then - if( return_all == .true. ) then + if( return_all .eqv. .true. ) then add_obs = .true. else if( Observation_Type(ii) == intype ) then - if( have_subtype == .false. ) then + if( have_subtype .eqv. .false. ) then add_obs = .true. else if( Observation_Subtype(ii) == in_subtype ) then add_obs = .true. @@ -1568,7 +1568,7 @@ subroutine read_diag_file_gps_nc( input_file, return_all, ftin, ctype, intype,ex end if end if - if( add_obs == .true. ) then + if( add_obs .eqv. .true. ) then nobs=nobs+1 @@ -1733,7 +1733,7 @@ subroutine read_diag_file_bin( input_file, return_all, ctype, intype,expected_nr ! exit loop if the number of reals (nreal) from file ! doesn't match the target number ! - if(( return_all == .true. ) .OR. ( trim(dtype) == trim(ctype) .and. file_nreal /= expected_nreal )) then + if(( return_all .eqv. .true. ) .OR. ( trim(dtype) == trim(ctype) .and. file_nreal /= expected_nreal )) then print *, 'matched observation type:',dtype,' file_nreal=', file_nreal exit endif @@ -1741,7 +1741,7 @@ subroutine read_diag_file_bin( input_file, return_all, ctype, intype,expected_nr !--------------------------------------------- ! skip to next iteration if types don't match ! - if(( return_all == .false. ) .AND. ( trim( dtype ) /= trim( ctype ))) then + if(( return_all .eqv. .false. ) .AND. ( trim( dtype ) /= trim( ctype ))) then cycle endif @@ -1764,7 +1764,7 @@ subroutine read_diag_file_bin( input_file, return_all, ctype, intype,expected_nr ! if both types and subtypes match ! then add a new data element ! - if(( return_all == .true. ) .OR. ( file_itype == intype .AND. file_subtype == in_subtype )) then + if(( return_all .eqv. .true. ) .OR. ( file_itype == intype .AND. file_subtype == in_subtype )) then nobs=nobs+1 diff --git a/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_sfc.fd/grads_sfc.f90 b/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_sfc.fd/grads_sfc.f90 index a6a005cf..acec4a60 100644 --- a/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_sfc.fd/grads_sfc.f90 +++ b/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_sfc.fd/grads_sfc.f90 @@ -56,7 +56,7 @@ subroutine grads_sfc(fileo,ifileo,nobs,nreal,iscater,igrads,isubtype,subtype,lis obs_ctr = 0 next => list - do while ( associated( next ) == .TRUE. ) + do while ( associated( next ) .eqv. .TRUE. ) ptr = transfer(list_get( next ), ptr) next => list_next( next ) diff --git a/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_sfctime.fd/CMakeLists.txt b/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_sfctime.fd/CMakeLists.txt index 74b10dc3..c01c38b0 100644 --- a/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_sfctime.fd/CMakeLists.txt +++ b/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_sfctime.fd/CMakeLists.txt @@ -1,24 +1,30 @@ -cmake_minimum_required(VERSION 3.16.1) - - file(GLOB CONMON_GRADS_SFCTIME_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*90 ) - - set(CONMON_GRADS_SFCTIME_Fortran_FLAGS "-fp-model strict -assume byterecl -convert big_endian -O3 -traceback -D_REAL8_ ") - - set(Util_MODULE_DIR ${PROJECT_BINARY_DIR}/include/conmon_grads_sfctime ) - - set_source_files_properties( ${CONMON_GRADS_SFCTIME_SRC} PROPERTIES COMPILE_FLAGS ${CONMON_GRADS_SFCTIME_Fortran_FLAGS} ) - - add_executable(conmon_grads_sfctime.x ${CONMON_GRADS_SFCTIME_SRC} ) - - set_target_properties( conmon_grads_sfctime.x PROPERTIES COMPILE_FLAGS ${CONMON_GRADS_SFCTIME_Fortran_FLAGS} ) - set_target_properties( conmon_grads_sfctime.x PROPERTIES Fortran_MODULE_DIRECTORY ${Util_MODULE_DIR} ) - - include_directories( ${CORE_INCS} ${NCDIAG_INCS} ) - - target_link_libraries( conmon_grads_sfctime.x ${W3NCO_4_LIBRARY} ${NCDIAG_LIBRARIES} ${NETCDF_Fortran_LIBRARIES} - ${NETCDF_C_LIBRARIES} ${MPI_Fortran_LIBRARIES} ) - - if(BUILD_W3NCO) - add_dependencies( conmon_grads_sfctime.x ${W3NCO_4_LIBRARY} ) - endif() +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fp-model strict -assume byterecl -convert big_endian") +elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fconvert=big-endian -ffree-line-length-0 -ffast-math -fno-second-underscore -frecord-marker=4") +endif() + +list(APPEND SRCS + conmon_read_diag.F90 + data_mod.f90 + generic_list.f90 + grads_sfctime.f90 + kinds.F90 + maingrads_sfctime.f90 + rm_dups.f90 +) + +add_executable(conmon_grads_sfctime.x ${SRCS}) +if(TARGET ncdiag) + add_dependencies(conmon_grads_sfctime.x ncdiag) +endif() + +target_compile_definitions(conmon_grads_sfctime.x PRIVATE "_REAL8_") +target_link_libraries(conmon_grads_sfctime.x PRIVATE NetCDF::NetCDF_Fortran) +target_link_libraries(conmon_grads_sfctime.x PRIVATE MPI::MPI_Fortran) +target_link_libraries(conmon_grads_sfctime.x PRIVATE ncdiag::ncdiag) +target_link_libraries(conmon_grads_sfctime.x PRIVATE w3emc::w3emc_4) + +# Install executable targets +install(TARGETS conmon_grads_sfctime.x RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_sfctime.fd/conmon_read_diag.F90 b/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_sfctime.fd/conmon_read_diag.F90 index 0b7afcf0..add99d17 100644 --- a/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_sfctime.fd/conmon_read_diag.F90 +++ b/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_sfctime.fd/conmon_read_diag.F90 @@ -424,12 +424,12 @@ subroutine read_diag_file_ps_nc( input_file, return_all, ftin, ctype, intype,exp ! if( adjustl( trim( Observation_Class(ii) )) == adjustl( trim( ctype ))) then - if( return_all == .true. ) then + if( return_all .eqv. .true. ) then add_obs = .true. else if( Observation_Type(ii) == intype ) then - if( have_subtype == .false. ) then + if( have_subtype .eqv. .false. ) then add_obs = .true. else if( Observation_Subtype(ii) == in_subtype ) then add_obs = .true. @@ -438,7 +438,7 @@ subroutine read_diag_file_ps_nc( input_file, return_all, ftin, ctype, intype,exp end if end if - if( add_obs == .true. ) then + if( add_obs .eqv. .true. ) then nobs=nobs+1 @@ -628,12 +628,12 @@ subroutine read_diag_file_q_nc( input_file, return_all, ftin, ctype, intype,expe ! if( adjustl( trim( Observation_Class(ii) )) == adjustl( trim( ctype ))) then - if( return_all == .true. ) then + if( return_all .eqv. .true. ) then add_obs = .true. else if( Observation_Type(ii) == intype ) then - if( have_subtype == .false. ) then + if( have_subtype .eqv. .false. ) then add_obs = .true. else if( Observation_Subtype(ii) == in_subtype ) then add_obs = .true. @@ -643,7 +643,7 @@ subroutine read_diag_file_q_nc( input_file, return_all, ftin, ctype, intype,expe end if - if( add_obs == .true. ) then + if( add_obs .eqv. .true. ) then nobs=nobs+1 @@ -850,12 +850,12 @@ subroutine read_diag_file_sst_nc( input_file, return_all, ftin, ctype, intype,ex ! if( adjustl( trim( Observation_Class(ii) )) == adjustl( trim( ctype ))) then - if( return_all == .true. ) then + if( return_all .eqv. .true. ) then add_obs = .true. else if( Observation_Type(ii) == intype ) then - if( have_subtype == .false. ) then + if( have_subtype .eqv. .false. ) then add_obs = .true. else if( Observation_Subtype(ii) == in_subtype ) then add_obs = .true. @@ -865,7 +865,7 @@ subroutine read_diag_file_sst_nc( input_file, return_all, ftin, ctype, intype,ex end if - if( add_obs == .true. ) then + if( add_obs .eqv. .true. ) then nobs=nobs+1 @@ -1100,12 +1100,12 @@ subroutine read_diag_file_t_nc( input_file, return_all, ftin, ctype, intype, exp if( adjustl( trim( Observation_Class(ii) )) == adjustl( trim( ctype ))) then - if( return_all == .true. ) then + if( return_all .eqv. .true. ) then add_obs = .true. else if( Observation_Type(ii) == intype ) then - if( have_subtype == .false. ) then + if( have_subtype .eqv. .false. ) then add_obs = .true. else if( Observation_Subtype(ii) == in_subtype ) then add_obs = .true. @@ -1114,7 +1114,7 @@ subroutine read_diag_file_t_nc( input_file, return_all, ftin, ctype, intype, exp end if end if - if( add_obs == .true. ) then + if( add_obs .eqv. .true. ) then nobs=nobs+1 @@ -1319,12 +1319,12 @@ subroutine read_diag_file_uv_nc( input_file, return_all, ftin, ctype, intype, ex if( adjustl( trim( Observation_Class(ii) )) == adjustl( trim( ctype ))) then - if( return_all == .true. ) then + if( return_all .eqv. .true. ) then add_obs = .true. else if( Observation_Type(ii) == intype ) then - if( have_subtype == .false. ) then + if( have_subtype .eqv. .false. ) then add_obs = .true. else if( Observation_Subtype(ii) == in_subtype ) then add_obs = .true. @@ -1333,7 +1333,7 @@ subroutine read_diag_file_uv_nc( input_file, return_all, ftin, ctype, intype, ex end if end if - if( add_obs == .true. ) then + if( add_obs .eqv. .true. ) then nobs=nobs+1 @@ -1554,12 +1554,12 @@ subroutine read_diag_file_gps_nc( input_file, return_all, ftin, ctype, intype,ex if( adjustl( trim( Observation_Class(ii) )) == adjustl( trim( ctype ))) then - if( return_all == .true. ) then + if( return_all .eqv. .true. ) then add_obs = .true. else if( Observation_Type(ii) == intype ) then - if( have_subtype == .false. ) then + if( have_subtype .eqv. .false. ) then add_obs = .true. else if( Observation_Subtype(ii) == in_subtype ) then add_obs = .true. @@ -1568,7 +1568,7 @@ subroutine read_diag_file_gps_nc( input_file, return_all, ftin, ctype, intype,ex end if end if - if( add_obs == .true. ) then + if( add_obs .eqv. .true. ) then nobs=nobs+1 @@ -1733,7 +1733,7 @@ subroutine read_diag_file_bin( input_file, return_all, ctype, intype,expected_nr ! exit loop if the number of reals (nreal) from file ! doesn't match the target number ! - if(( return_all == .true. ) .OR. ( trim(dtype) == trim(ctype) .and. file_nreal /= expected_nreal )) then + if(( return_all .eqv. .true. ) .OR. ( trim(dtype) == trim(ctype) .and. file_nreal /= expected_nreal )) then print *, 'matched observation type:',dtype,' file_nreal=', file_nreal exit endif @@ -1741,7 +1741,7 @@ subroutine read_diag_file_bin( input_file, return_all, ctype, intype,expected_nr !--------------------------------------------- ! skip to next iteration if types don't match ! - if(( return_all == .false. ) .AND. ( trim( dtype ) /= trim( ctype ))) then + if(( return_all .eqv. .false. ) .AND. ( trim( dtype ) /= trim( ctype ))) then cycle endif @@ -1764,7 +1764,7 @@ subroutine read_diag_file_bin( input_file, return_all, ctype, intype,expected_nr ! if both types and subtypes match ! then add a new data element ! - if(( return_all == .true. ) .OR. ( file_itype == intype .AND. file_subtype == in_subtype )) then + if(( return_all .eqv. .true. ) .OR. ( file_itype == intype .AND. file_subtype == in_subtype )) then nobs=nobs+1 diff --git a/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_sfctime.fd/grads_sfctime.f90 b/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_sfctime.fd/grads_sfctime.f90 index 4f52806b..bbcde658 100644 --- a/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_sfctime.fd/grads_sfctime.f90 +++ b/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_sfctime.fd/grads_sfctime.f90 @@ -91,7 +91,7 @@ subroutine grads_sfctime(fileo,ifileo,nobs,nreal,nlev,plev,iscater,& obs_ctr = 0 next => list - do while ( associated( next ) == .TRUE. ) + do while ( associated( next ) .eqv. .TRUE. ) ptr = transfer(list_get( next ), ptr) next => list_next( next ) diff --git a/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_sig.fd/CMakeLists.txt b/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_sig.fd/CMakeLists.txt index b13e9f35..42f1367e 100644 --- a/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_sig.fd/CMakeLists.txt +++ b/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_sig.fd/CMakeLists.txt @@ -1,19 +1,32 @@ -cmake_minimum_required(VERSION 3.16.1) - file(GLOB CONMON_GRADS_SIG_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*90 ) - set(CONMON_GRADS_SIG_Fortran_FLAGS "-fp-model strict -assume byterecl -convert big_endian -O3 -traceback -D_REAL8_ ") - set(Util_MODULE_DIR ${PROJECT_BINARY_DIR}/include/conmon_grads_sig ) +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fp-model strict -assume byterecl -convert big_endian") +elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fconvert=big-endian -ffree-line-length-0 -ffast-math -fno-second-underscore -frecord-marker=4") +endif() - set_source_files_properties( ${CONMON_GRADS_SIG_SRC} PROPERTIES COMPILE_FLAGS ${CONMON_GRADS_SIG_Fortran_FLAGS} ) - add_executable(conmon_grads_sig.x ${CONMON_GRADS_SIG_SRC} ) - set_target_properties( conmon_grads_sig.x PROPERTIES COMPILE_FLAGS ${CONMON_GRADS_SIG_Fortran_FLAGS} ) - set_target_properties( conmon_grads_sig.x PROPERTIES Fortran_MODULE_DIRECTORY ${Util_MODULE_DIR} ) +list(APPEND SRCS + conmon_read_diag.F90 + data_mod.f90 + generic_list.f90 + grads_sig.f90 + kinds.F90 + maingrads_sig.f90 + read_conv2grads.f90 + rm_dups.f90 +) - include_directories( ${CORE_INCS} ${NCDIAG_INCS} ) - - target_link_libraries( conmon_grads_sig.x ${W3NCO_4_LIBRARY} ${NCDIAG_LIBRARIES} ${NETCDF_Fortran_LIBRARIES} - ${NETCDF_C_LIBRARIES} ${MPI_Fortran_LIBRARIES} ) +add_executable(conmon_grads_sig.x ${SRCS}) +if(TARGET ncdiag) + add_dependencies(conmon_grads_sig.x ncdiag) +endif() + +target_compile_definitions(conmon_grads_sig.x PRIVATE "_REAL8_") +target_link_libraries(conmon_grads_sig.x PRIVATE NetCDF::NetCDF_Fortran) +target_link_libraries(conmon_grads_sig.x PRIVATE MPI::MPI_Fortran) +target_link_libraries(conmon_grads_sig.x PRIVATE ncdiag::ncdiag) +target_link_libraries(conmon_grads_sig.x PRIVATE w3emc::w3emc_4) + +# Install executable targets +install(TARGETS conmon_grads_sig.x RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - if(BUILD_W3NCO) - add_dependencies( conmon_grads_sig.x ${W3NCO_4_LIBRARY} ) - endif() diff --git a/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_sig.fd/conmon_read_diag.F90 b/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_sig.fd/conmon_read_diag.F90 index 0b7afcf0..add99d17 100644 --- a/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_sig.fd/conmon_read_diag.F90 +++ b/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_sig.fd/conmon_read_diag.F90 @@ -424,12 +424,12 @@ subroutine read_diag_file_ps_nc( input_file, return_all, ftin, ctype, intype,exp ! if( adjustl( trim( Observation_Class(ii) )) == adjustl( trim( ctype ))) then - if( return_all == .true. ) then + if( return_all .eqv. .true. ) then add_obs = .true. else if( Observation_Type(ii) == intype ) then - if( have_subtype == .false. ) then + if( have_subtype .eqv. .false. ) then add_obs = .true. else if( Observation_Subtype(ii) == in_subtype ) then add_obs = .true. @@ -438,7 +438,7 @@ subroutine read_diag_file_ps_nc( input_file, return_all, ftin, ctype, intype,exp end if end if - if( add_obs == .true. ) then + if( add_obs .eqv. .true. ) then nobs=nobs+1 @@ -628,12 +628,12 @@ subroutine read_diag_file_q_nc( input_file, return_all, ftin, ctype, intype,expe ! if( adjustl( trim( Observation_Class(ii) )) == adjustl( trim( ctype ))) then - if( return_all == .true. ) then + if( return_all .eqv. .true. ) then add_obs = .true. else if( Observation_Type(ii) == intype ) then - if( have_subtype == .false. ) then + if( have_subtype .eqv. .false. ) then add_obs = .true. else if( Observation_Subtype(ii) == in_subtype ) then add_obs = .true. @@ -643,7 +643,7 @@ subroutine read_diag_file_q_nc( input_file, return_all, ftin, ctype, intype,expe end if - if( add_obs == .true. ) then + if( add_obs .eqv. .true. ) then nobs=nobs+1 @@ -850,12 +850,12 @@ subroutine read_diag_file_sst_nc( input_file, return_all, ftin, ctype, intype,ex ! if( adjustl( trim( Observation_Class(ii) )) == adjustl( trim( ctype ))) then - if( return_all == .true. ) then + if( return_all .eqv. .true. ) then add_obs = .true. else if( Observation_Type(ii) == intype ) then - if( have_subtype == .false. ) then + if( have_subtype .eqv. .false. ) then add_obs = .true. else if( Observation_Subtype(ii) == in_subtype ) then add_obs = .true. @@ -865,7 +865,7 @@ subroutine read_diag_file_sst_nc( input_file, return_all, ftin, ctype, intype,ex end if - if( add_obs == .true. ) then + if( add_obs .eqv. .true. ) then nobs=nobs+1 @@ -1100,12 +1100,12 @@ subroutine read_diag_file_t_nc( input_file, return_all, ftin, ctype, intype, exp if( adjustl( trim( Observation_Class(ii) )) == adjustl( trim( ctype ))) then - if( return_all == .true. ) then + if( return_all .eqv. .true. ) then add_obs = .true. else if( Observation_Type(ii) == intype ) then - if( have_subtype == .false. ) then + if( have_subtype .eqv. .false. ) then add_obs = .true. else if( Observation_Subtype(ii) == in_subtype ) then add_obs = .true. @@ -1114,7 +1114,7 @@ subroutine read_diag_file_t_nc( input_file, return_all, ftin, ctype, intype, exp end if end if - if( add_obs == .true. ) then + if( add_obs .eqv. .true. ) then nobs=nobs+1 @@ -1319,12 +1319,12 @@ subroutine read_diag_file_uv_nc( input_file, return_all, ftin, ctype, intype, ex if( adjustl( trim( Observation_Class(ii) )) == adjustl( trim( ctype ))) then - if( return_all == .true. ) then + if( return_all .eqv. .true. ) then add_obs = .true. else if( Observation_Type(ii) == intype ) then - if( have_subtype == .false. ) then + if( have_subtype .eqv. .false. ) then add_obs = .true. else if( Observation_Subtype(ii) == in_subtype ) then add_obs = .true. @@ -1333,7 +1333,7 @@ subroutine read_diag_file_uv_nc( input_file, return_all, ftin, ctype, intype, ex end if end if - if( add_obs == .true. ) then + if( add_obs .eqv. .true. ) then nobs=nobs+1 @@ -1554,12 +1554,12 @@ subroutine read_diag_file_gps_nc( input_file, return_all, ftin, ctype, intype,ex if( adjustl( trim( Observation_Class(ii) )) == adjustl( trim( ctype ))) then - if( return_all == .true. ) then + if( return_all .eqv. .true. ) then add_obs = .true. else if( Observation_Type(ii) == intype ) then - if( have_subtype == .false. ) then + if( have_subtype .eqv. .false. ) then add_obs = .true. else if( Observation_Subtype(ii) == in_subtype ) then add_obs = .true. @@ -1568,7 +1568,7 @@ subroutine read_diag_file_gps_nc( input_file, return_all, ftin, ctype, intype,ex end if end if - if( add_obs == .true. ) then + if( add_obs .eqv. .true. ) then nobs=nobs+1 @@ -1733,7 +1733,7 @@ subroutine read_diag_file_bin( input_file, return_all, ctype, intype,expected_nr ! exit loop if the number of reals (nreal) from file ! doesn't match the target number ! - if(( return_all == .true. ) .OR. ( trim(dtype) == trim(ctype) .and. file_nreal /= expected_nreal )) then + if(( return_all .eqv. .true. ) .OR. ( trim(dtype) == trim(ctype) .and. file_nreal /= expected_nreal )) then print *, 'matched observation type:',dtype,' file_nreal=', file_nreal exit endif @@ -1741,7 +1741,7 @@ subroutine read_diag_file_bin( input_file, return_all, ctype, intype,expected_nr !--------------------------------------------- ! skip to next iteration if types don't match ! - if(( return_all == .false. ) .AND. ( trim( dtype ) /= trim( ctype ))) then + if(( return_all .eqv. .false. ) .AND. ( trim( dtype ) /= trim( ctype ))) then cycle endif @@ -1764,7 +1764,7 @@ subroutine read_diag_file_bin( input_file, return_all, ctype, intype,expected_nr ! if both types and subtypes match ! then add a new data element ! - if(( return_all == .true. ) .OR. ( file_itype == intype .AND. file_subtype == in_subtype )) then + if(( return_all .eqv. .true. ) .OR. ( file_itype == intype .AND. file_subtype == in_subtype )) then nobs=nobs+1 diff --git a/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_sig.fd/grads_sig.f90 b/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_sig.fd/grads_sig.f90 index b07dc632..66ee7da3 100644 --- a/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_sig.fd/grads_sig.f90 +++ b/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_sig.fd/grads_sig.f90 @@ -70,7 +70,7 @@ subroutine grads_sig(fileo,ifileo,nobs,nreal,nlev,plev,iscater,igrads,isubtype,s obs_ctr = 0 next => list - do while ( associated( next ) == .TRUE. ) + do while ( associated( next ) .eqv. .TRUE. ) ptr = transfer(list_get( next ), ptr) next => list_next( next ) diff --git a/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_time.fd/CMakeLists.txt b/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_time.fd/CMakeLists.txt index 767fdad0..41d0d749 100644 --- a/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_time.fd/CMakeLists.txt +++ b/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_time.fd/CMakeLists.txt @@ -1,19 +1,33 @@ -cmake_minimum_required(VERSION 3.16.1) - file(GLOB CONMON_TIME_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*90 ) - set(CONMON_TIME_Fortran_FLAGS "-fp-model strict -assume byterecl -convert big_endian -O3 -traceback -D_REAL8_ ") - set(Util_MODULE_DIR ${PROJECT_BINARY_DIR}/include/conmon_time ) +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fp-model strict -assume byterecl -convert big_endian") +elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fconvert=big-endian -ffree-line-length-0 -ffast-math -fno-second-underscore -frecord-marker=4") +endif() - set_source_files_properties( ${CONMON_TIME_SRC} PROPERTIES COMPILE_FLAGS ${CONMON_TIME_Fortran_FLAGS} ) - add_executable(conmon_time.x ${CONMON_TIME_SRC} ) - set_target_properties( conmon_time.x PROPERTIES COMPILE_FLAGS ${CONMON_TIME_Fortran_FLAGS} ) - set_target_properties( conmon_time.x PROPERTIES Fortran_MODULE_DIRECTORY ${Util_MODULE_DIR} ) +list(APPEND SRCS + conmon_read_diag.F90 + convinfo2.f90 + data_mod.f90 + generic_list.f90 + kinds.F90 + mainconv_time.f90 + process_time_data.f90 + stas2ctl.f90 + stas_time.f90 + stas_time_gps.f90 +) - include_directories( ${CORE_INCS} ${NCDIAG_INCS} ) - - target_link_libraries( conmon_time.x ${W3NCO_4_LIBRARY} ${NCDIAG_LIBRARIES} ${NETCDF_Fortran_LIBRARIES} - ${NETCDF_C_LIBRARIES} ${MPI_Fortran_LIBRARIES} ) +add_executable(conmon_time.x ${SRCS}) +if(TARGET ncdiag) + add_dependencies(conmon_time.x ncdiag) +endif() - if(BUILD_W3NCO) - add_dependencies( conmon_time.x ${W3NCO_4_LIBRARY} ) - endif() +target_compile_definitions(conmon_time.x PRIVATE "_REAL8_") +target_link_libraries(conmon_time.x PRIVATE NetCDF::NetCDF_Fortran) +target_link_libraries(conmon_time.x PRIVATE MPI::MPI_Fortran) +target_link_libraries(conmon_time.x PRIVATE ncdiag::ncdiag) +target_link_libraries(conmon_time.x PRIVATE w3emc::w3emc_4) + +# Install executable targets +install(TARGETS conmon_time.x RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_time.fd/conmon_read_diag.F90 b/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_time.fd/conmon_read_diag.F90 index 0b7afcf0..add99d17 100644 --- a/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_time.fd/conmon_read_diag.F90 +++ b/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_time.fd/conmon_read_diag.F90 @@ -424,12 +424,12 @@ subroutine read_diag_file_ps_nc( input_file, return_all, ftin, ctype, intype,exp ! if( adjustl( trim( Observation_Class(ii) )) == adjustl( trim( ctype ))) then - if( return_all == .true. ) then + if( return_all .eqv. .true. ) then add_obs = .true. else if( Observation_Type(ii) == intype ) then - if( have_subtype == .false. ) then + if( have_subtype .eqv. .false. ) then add_obs = .true. else if( Observation_Subtype(ii) == in_subtype ) then add_obs = .true. @@ -438,7 +438,7 @@ subroutine read_diag_file_ps_nc( input_file, return_all, ftin, ctype, intype,exp end if end if - if( add_obs == .true. ) then + if( add_obs .eqv. .true. ) then nobs=nobs+1 @@ -628,12 +628,12 @@ subroutine read_diag_file_q_nc( input_file, return_all, ftin, ctype, intype,expe ! if( adjustl( trim( Observation_Class(ii) )) == adjustl( trim( ctype ))) then - if( return_all == .true. ) then + if( return_all .eqv. .true. ) then add_obs = .true. else if( Observation_Type(ii) == intype ) then - if( have_subtype == .false. ) then + if( have_subtype .eqv. .false. ) then add_obs = .true. else if( Observation_Subtype(ii) == in_subtype ) then add_obs = .true. @@ -643,7 +643,7 @@ subroutine read_diag_file_q_nc( input_file, return_all, ftin, ctype, intype,expe end if - if( add_obs == .true. ) then + if( add_obs .eqv. .true. ) then nobs=nobs+1 @@ -850,12 +850,12 @@ subroutine read_diag_file_sst_nc( input_file, return_all, ftin, ctype, intype,ex ! if( adjustl( trim( Observation_Class(ii) )) == adjustl( trim( ctype ))) then - if( return_all == .true. ) then + if( return_all .eqv. .true. ) then add_obs = .true. else if( Observation_Type(ii) == intype ) then - if( have_subtype == .false. ) then + if( have_subtype .eqv. .false. ) then add_obs = .true. else if( Observation_Subtype(ii) == in_subtype ) then add_obs = .true. @@ -865,7 +865,7 @@ subroutine read_diag_file_sst_nc( input_file, return_all, ftin, ctype, intype,ex end if - if( add_obs == .true. ) then + if( add_obs .eqv. .true. ) then nobs=nobs+1 @@ -1100,12 +1100,12 @@ subroutine read_diag_file_t_nc( input_file, return_all, ftin, ctype, intype, exp if( adjustl( trim( Observation_Class(ii) )) == adjustl( trim( ctype ))) then - if( return_all == .true. ) then + if( return_all .eqv. .true. ) then add_obs = .true. else if( Observation_Type(ii) == intype ) then - if( have_subtype == .false. ) then + if( have_subtype .eqv. .false. ) then add_obs = .true. else if( Observation_Subtype(ii) == in_subtype ) then add_obs = .true. @@ -1114,7 +1114,7 @@ subroutine read_diag_file_t_nc( input_file, return_all, ftin, ctype, intype, exp end if end if - if( add_obs == .true. ) then + if( add_obs .eqv. .true. ) then nobs=nobs+1 @@ -1319,12 +1319,12 @@ subroutine read_diag_file_uv_nc( input_file, return_all, ftin, ctype, intype, ex if( adjustl( trim( Observation_Class(ii) )) == adjustl( trim( ctype ))) then - if( return_all == .true. ) then + if( return_all .eqv. .true. ) then add_obs = .true. else if( Observation_Type(ii) == intype ) then - if( have_subtype == .false. ) then + if( have_subtype .eqv. .false. ) then add_obs = .true. else if( Observation_Subtype(ii) == in_subtype ) then add_obs = .true. @@ -1333,7 +1333,7 @@ subroutine read_diag_file_uv_nc( input_file, return_all, ftin, ctype, intype, ex end if end if - if( add_obs == .true. ) then + if( add_obs .eqv. .true. ) then nobs=nobs+1 @@ -1554,12 +1554,12 @@ subroutine read_diag_file_gps_nc( input_file, return_all, ftin, ctype, intype,ex if( adjustl( trim( Observation_Class(ii) )) == adjustl( trim( ctype ))) then - if( return_all == .true. ) then + if( return_all .eqv. .true. ) then add_obs = .true. else if( Observation_Type(ii) == intype ) then - if( have_subtype == .false. ) then + if( have_subtype .eqv. .false. ) then add_obs = .true. else if( Observation_Subtype(ii) == in_subtype ) then add_obs = .true. @@ -1568,7 +1568,7 @@ subroutine read_diag_file_gps_nc( input_file, return_all, ftin, ctype, intype,ex end if end if - if( add_obs == .true. ) then + if( add_obs .eqv. .true. ) then nobs=nobs+1 @@ -1733,7 +1733,7 @@ subroutine read_diag_file_bin( input_file, return_all, ctype, intype,expected_nr ! exit loop if the number of reals (nreal) from file ! doesn't match the target number ! - if(( return_all == .true. ) .OR. ( trim(dtype) == trim(ctype) .and. file_nreal /= expected_nreal )) then + if(( return_all .eqv. .true. ) .OR. ( trim(dtype) == trim(ctype) .and. file_nreal /= expected_nreal )) then print *, 'matched observation type:',dtype,' file_nreal=', file_nreal exit endif @@ -1741,7 +1741,7 @@ subroutine read_diag_file_bin( input_file, return_all, ctype, intype,expected_nr !--------------------------------------------- ! skip to next iteration if types don't match ! - if(( return_all == .false. ) .AND. ( trim( dtype ) /= trim( ctype ))) then + if(( return_all .eqv. .false. ) .AND. ( trim( dtype ) /= trim( ctype ))) then cycle endif @@ -1764,7 +1764,7 @@ subroutine read_diag_file_bin( input_file, return_all, ctype, intype,expected_nr ! if both types and subtypes match ! then add a new data element ! - if(( return_all == .true. ) .OR. ( file_itype == intype .AND. file_subtype == in_subtype )) then + if(( return_all .eqv. .true. ) .OR. ( file_itype == intype .AND. file_subtype == in_subtype )) then nobs=nobs+1 diff --git a/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_time.fd/process_time_data.f90 b/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_time.fd/process_time_data.f90 index bc7c6ae5..68a4701b 100644 --- a/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_time.fd/process_time_data.f90 +++ b/util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_time.fd/process_time_data.f90 @@ -315,7 +315,7 @@ subroutine process_conv_nc( input_file, ctype, mregion, nregion, np, & print *, ' select, case ps' obs_ctr = 0 - do while ( associated( next ) == .TRUE. ) + do while ( associated( next ) .eqv. .TRUE. ) obs_ctr = obs_ctr + 1 ptr = transfer(list_get( next ), ptr) next => list_next( next ) @@ -340,7 +340,7 @@ subroutine process_conv_nc( input_file, ctype, mregion, nregion, np, & print *, ' select, case q' obs_ctr = 0 - do while ( associated( next ) == .TRUE. ) + do while ( associated( next ) .eqv. .TRUE. ) obs_ctr = obs_ctr + 1 ptr = transfer(list_get( next ), ptr) next => list_next( next ) @@ -365,7 +365,7 @@ subroutine process_conv_nc( input_file, ctype, mregion, nregion, np, & print *, ' select, case t' obs_ctr = 0 - do while ( associated( next ) == .TRUE. ) + do while ( associated( next ) .eqv. .TRUE. ) obs_ctr = obs_ctr + 1 ptr = transfer(list_get( next ), ptr) next => list_next( next ) @@ -389,7 +389,7 @@ subroutine process_conv_nc( input_file, ctype, mregion, nregion, np, & print *, ' select, case uv' obs_ctr = 0 - do while ( associated( next ) == .TRUE. ) + do while ( associated( next ) .eqv. .TRUE. ) obs_ctr = obs_ctr + 1 ptr = transfer(list_get( next ), ptr) next => list_next( next ) @@ -412,7 +412,7 @@ subroutine process_conv_nc( input_file, ctype, mregion, nregion, np, & case ( 'gps' ) print *, ' select, case gps' obs_ctr = 0 - do while ( associated( next ) == .TRUE. ) + do while ( associated( next ) .eqv. .TRUE. ) obs_ctr = obs_ctr + 1 ptr = transfer(list_get( next ), ptr) next => list_next( next ) diff --git a/util/Ozone_Monitor/CMakeLists.txt b/util/Ozone_Monitor/CMakeLists.txt index 97e24d7e..9e3df48c 100644 --- a/util/Ozone_Monitor/CMakeLists.txt +++ b/util/Ozone_Monitor/CMakeLists.txt @@ -1,96 +1,2 @@ -cmake_minimum_required(VERSION 2.8) -if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) - # I am top-level project. - if( NOT DEFINED ENV{CC} ) - find_path( crayComp "ftn" ) - find_path( wcossIntel "mpfort" ) - find_path( intelComp "ifort" ) - find_path( pgiComp "pgf90" ) - if( crayComp ) - message("Setting CrayLinuxEnvironment") - set(CMAKE_SYSTEM_NAME "CrayLinuxEnvironment") - set(CMAKE_C_COMPILER "${crayComp}/cc") - set(CMAKE_CXX_COMPILER "${crayComp}/CC") - set(CMAKE_Fortran_COMPILER "${crayComp}/ftn") - endif() - if( intelComp ) - set(ENV{CC} "icc") - set(ENV{CXX} "icpc") - set(ENV{FC} "ifort") - endif() - if( wcossIntel ) - message("Setting env for wcoss intel") - set(ENV{CC} "mpcc") - set(ENV{CXX} "mpCC") - set(ENV{FC} "mpfort") - endif() - if( pgiComp ) - set(ENV{CC} "pgcc") - set(ENV{CXX} "pgCC") - set(ENV{FC} "pgf90") - endif() - endif() - project(COV_Calc) - enable_language (Fortran) - set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/../../cmake/Modules/") - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib") - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/setPlatformVariables.cmake) - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/setIntelFlags.cmake) - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/setGNUFlags.cmake) - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/setPGIFlags.cmake) - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/setHOST.cmake) - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/platforms/Cheyenne.cmake) - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/platforms/Discover.cmake) - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/platforms/Generic.cmake) - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/platforms/Gaea.cmake) - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/platforms/Jet.cmake) - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/platforms/S4.cmake) - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/platforms/Hera.cmake) - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/platforms/WCOSS-C.cmake) - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/platforms/WCOSS-D.cmake) - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/platforms/WCOSS.cmake) - if (NOT CMAKE_BUILD_TYPE) - set (CMAKE_BUILD_TYPE RELEASE CACHE STRING - "Choose the type of build, options are: PRODUCTION Debug Release." - FORCE) - endif (NOT CMAKE_BUILD_TYPE) - if (CMAKE_CXX_COMPILER_ID MATCHES "GNU*") - message("Setting GNU flags") - setGNU() - elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel") - message("Setting Intel flags") - setIntel() - elseif(CMAKE_C_COMPILER MATCHES "pgc*") - message("Setting PGI flags") - setPGI() - endif() - - cmake_policy(SET CMP0009 NEW) - cmake_policy(SET CMP0074 NEW) - find_package(OpenMP) - message("found openmp with flag ${OPENMP_Fortran_FLAGS}") - -# Set Host specific flags and options - setHOST() - - find_package(MPI REQUIRED) - message("MPI version is ${MPI_Fortran_VERSION}") - message("MPI f90 version is ${MPI_Fortran_HAVE_F90_MODULE}") - message("MPI f08 version is ${MPI_Fortran_HAVE_F08_MODULE}") - - add_definitions(${MPI_Fortran_COMPILE_FLAGS}) - include_directories(${MPI_Fortran_INCLUDE_DIRS} ${MPI_INCLUDE_PATH} "./" ${CMAKE_INCLUDE_OUTPUT_DIRECTORY}) - link_directories(${MPI_Fortran_LIBRARIES} ${ARCHIVE_OUTPUT_PATH} ) - find_package( NetCDF COMPONENTS C Fortran REQUIRED) - find_package( W3NCO ) - - set(BUILD_NCDIAG ON) - set(NCDIAG_INCS "${PROJECT_BINARY_DIR}/src/ncdiag/include") - add_subdirectory(src/ncdiag) - set(NCDIAG_LIBRARIES ncdiag ) - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) -endif() - -add_subdirectory(nwprod/oznmon_shared/sorc/oznmon_horiz.fd) -add_subdirectory(nwprod/oznmon_shared/sorc/oznmon_time.fd) -add_subdirectory(data_xtrct/sorc/make_base.fd) +add_subdirectory(data_xtrct) +add_subdirectory(nwprod) diff --git a/util/Ozone_Monitor/data_xtrct/CMakeLists.txt b/util/Ozone_Monitor/data_xtrct/CMakeLists.txt new file mode 100644 index 00000000..ddf939af --- /dev/null +++ b/util/Ozone_Monitor/data_xtrct/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(sorc) diff --git a/util/Ozone_Monitor/data_xtrct/exec/.gitignore b/util/Ozone_Monitor/data_xtrct/exec/.gitignore deleted file mode 100644 index d6b7ef32..00000000 --- a/util/Ozone_Monitor/data_xtrct/exec/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/util/Ozone_Monitor/data_xtrct/sorc/CMakeLists.txt b/util/Ozone_Monitor/data_xtrct/sorc/CMakeLists.txt new file mode 100644 index 00000000..efe47a7d --- /dev/null +++ b/util/Ozone_Monitor/data_xtrct/sorc/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(make_base.fd) diff --git a/util/Ozone_Monitor/data_xtrct/sorc/make_base.fd/CMakeLists.txt b/util/Ozone_Monitor/data_xtrct/sorc/make_base.fd/CMakeLists.txt index 68e1da7c..ec8490a9 100644 --- a/util/Ozone_Monitor/data_xtrct/sorc/make_base.fd/CMakeLists.txt +++ b/util/Ozone_Monitor/data_xtrct/sorc/make_base.fd/CMakeLists.txt @@ -1,14 +1,16 @@ -cmake_minimum_required(VERSION 2.6) - file(GLOB OZNMON_MAKE_BASE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*90 ) - set(OZNMON_MAKE_BASE_Fortran_FLAGS "-fp-model strict -assume byterecl -convert big_endian -O3 ") - set_source_files_properties( ${OZNMON_MAKE_BASE_SRC} PROPERTIES COMPILE_FLAGS ${OZNMON_MAKE_BASE_Fortran_FLAGS} ) - set(Util_MODULE_DIR ${PROJECT_BINARY_DIR}/include/oznmon_make_base ) - add_executable(oznmon_make_base.x ${OZNMON_MAKE_BASE_SRC} ) - set_target_properties( oznmon_make_base.x PROPERTIES COMPILE_FLAGS ${OZNMON_MAKE_BASE_Fortran_FLAGS} ) - set_target_properties( oznmon_make_base.x PROPERTIES Fortran_MODULE_DIRECTORY ${Util_MODULE_DIR} ) - include_directories( ${CORE_INCS} ) - target_link_libraries( oznmon_make_base.x ${W3NCO_4_LIBRARY} ) - if(BUILD_W3NCO) - add_dependencies( oznmon_make_base.x ${W3NCO_4_LIBRARY} ) - endif() +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fp-model strict -assume byterecl -convert big_endian") +elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fconvert=big-endian -ffree-line-length-0 -ffast-math -fno-second-underscore -frecord-marker=4") +endif() + +list(APPEND SRCS + make_base.f90 +) + +add_executable(oznmon_make_base.x ${SRCS}) +target_link_libraries(oznmon_make_base.x PRIVATE w3emc::w3emc_4) + +# Install executable targets +install(TARGETS oznmon_make_base.x RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/util/Ozone_Monitor/data_xtrct/sorc/make_base.fd/makefile b/util/Ozone_Monitor/data_xtrct/sorc/make_base.fd/makefile deleted file mode 100755 index 292875a0..00000000 --- a/util/Ozone_Monitor/data_xtrct/sorc/make_base.fd/makefile +++ /dev/null @@ -1,44 +0,0 @@ -# ***************************************************************** -# makefile -# -# Make the make_base executable. The executable will construct -# base history files for each entry in the SATYPE list from the -# time data files (*.ieee_d) for the specified source (suffix). -# -# This is not normally necessary for RadMon users unless you want -# to use the automated validation mechanism. -# ***************************************************************** - -BINDIR = $(dir_root)/exec - -LIBS = $(W3NCO_LIB4) - -OBJS = make_base.o - -# -# ***************************************************************** -# - -CMD = oznmon_make_base.x - -all: $(CMD) - -clean: - rm -f *.o - rm -f *.mod - rm -f oznmon_make_base.x - -check_prereqs: - /nwprod/spa_util/check_libs.bash $(LIBS) - -install: - cp -f $(CMD) $(BINDIR)/. - -debug: FFLAGS = $(D_FFLAGS) -debug: $(CMD) - -$(CMD): $(OBJS) - $(CF) $(FFLAGS) $(LDFLAGS) -o $(@) $(OBJS) $(LIBS) - -make_base.o : make_base.f90 - $(CF) $(FFLAGS) -c $(*).f90 diff --git a/util/Ozone_Monitor/nwprod/CMakeLists.txt b/util/Ozone_Monitor/nwprod/CMakeLists.txt new file mode 100644 index 00000000..0fd3ef9e --- /dev/null +++ b/util/Ozone_Monitor/nwprod/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(oznmon_shared) diff --git a/util/Ozone_Monitor/nwprod/oznmon_shared/CMakeLists.txt b/util/Ozone_Monitor/nwprod/oznmon_shared/CMakeLists.txt new file mode 100644 index 00000000..ddf939af --- /dev/null +++ b/util/Ozone_Monitor/nwprod/oznmon_shared/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(sorc) diff --git a/util/Ozone_Monitor/nwprod/oznmon_shared/exec/.gitignore b/util/Ozone_Monitor/nwprod/oznmon_shared/exec/.gitignore deleted file mode 100644 index d6b7ef32..00000000 --- a/util/Ozone_Monitor/nwprod/oznmon_shared/exec/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/util/Ozone_Monitor/nwprod/oznmon_shared/modulefiles/cray/OznMonBuild b/util/Ozone_Monitor/nwprod/oznmon_shared/modulefiles/cray/OznMonBuild deleted file mode 100644 index 94ac5cfd..00000000 --- a/util/Ozone_Monitor/nwprod/oznmon_shared/modulefiles/cray/OznMonBuild +++ /dev/null @@ -1,18 +0,0 @@ -#%Module################################################################# -proc ModulesHelp { } { - puts stderr "Set environment variables for WCOSS(cray) ozmon build" -} - -module-whatis "Set environment variables for WCOSS(cray) ozmon build" - -set ver 2.0.2 -set FCOMP ifort - -setenv CF $FCOMP -setenv FC $FCOMP -setenv FFLAGS "-O3 -fp-model strict -convert big_endian -assume byterecl" - -setenv D_FFLAGS "-O3 -fp-model strict -convert big_endian -assume byterecl -debug" -module load intel -module load w3nco-intel/2.0.6 - diff --git a/util/Ozone_Monitor/nwprod/oznmon_shared/modulefiles/dell/OznMonBuild b/util/Ozone_Monitor/nwprod/oznmon_shared/modulefiles/dell/OznMonBuild deleted file mode 100644 index ea48fbad..00000000 --- a/util/Ozone_Monitor/nwprod/oznmon_shared/modulefiles/dell/OznMonBuild +++ /dev/null @@ -1,18 +0,0 @@ -#%Module################################################################# -proc ModulesHelp { } { - puts stderr "Set environment variables for WCOSS(dell) ozmon build" -} - -module-whatis "Set environment variables for WCOSS(dell) ozmon build" - -set ver 2.0.2 -set FCOMP ifort - -setenv CF $FCOMP -setenv FC $FCOMP -setenv FFLAGS "-O3 -fp-model strict -convert big_endian -assume byterecl" - -setenv D_FFLAGS "-O3 -fp-model strict -convert big_endian -assume byterecl -debug" -module load ips/18.0.1.163 -module load w3nco/2.0.6 - diff --git a/util/Ozone_Monitor/nwprod/oznmon_shared/modulefiles/theia/OznMonBuild b/util/Ozone_Monitor/nwprod/oznmon_shared/modulefiles/theia/OznMonBuild deleted file mode 100644 index 2b619e9a..00000000 --- a/util/Ozone_Monitor/nwprod/oznmon_shared/modulefiles/theia/OznMonBuild +++ /dev/null @@ -1,20 +0,0 @@ -#%Module################################################################# -proc ModulesHelp { } { - puts stderr "Set environment variables for THEIA OzoMon build" -} - -module-whatis "Set environment variables for THEIA OzoMon build" - -set ver 2.0.2 - -module load intel - -set FCOMP ifort - -setenv CF $FCOMP -setenv FC $FCOMP -setenv FFLAGS "-O3 -fp-model strict -D_REAL8_ -traceback -convert big_endian -assume byterecl" -setenv D_FFLAGS "-O3 -fp-model strict -D_REAL8_ -traceback -convert big_endian -assume byterecl -debug" - -setenv W3NCO_LIB4 "-L/scratch3/NCEPDEV/nwprod/lib -lw3nco_4" - diff --git a/util/Ozone_Monitor/nwprod/oznmon_shared/modulefiles/wcoss/OznMonBuild b/util/Ozone_Monitor/nwprod/oznmon_shared/modulefiles/wcoss/OznMonBuild deleted file mode 100644 index 2c251a0c..00000000 --- a/util/Ozone_Monitor/nwprod/oznmon_shared/modulefiles/wcoss/OznMonBuild +++ /dev/null @@ -1,18 +0,0 @@ -#%Module################################################################# -proc ModulesHelp { } { - puts stderr "Set environment variables for WCOSS(ibm) ozmon build" -} - -module-whatis "Set environment variables for WCOSS(ibm) ozmon build" - -set ver 2.0.0 -set FCOMP ifort - -setenv CF $FCOMP -setenv FC $FCOMP -setenv FFLAGS "-O3 -fp-model strict -convert big_endian -assume byterecl" - -setenv D_FFLAGS "-O3 -fp-model strict -convert big_endian -assume byterecl -debug" -module load ics -module load w3nco - diff --git a/util/Ozone_Monitor/nwprod/oznmon_shared/sorc/CMakeLists.txt b/util/Ozone_Monitor/nwprod/oznmon_shared/sorc/CMakeLists.txt new file mode 100644 index 00000000..c341723f --- /dev/null +++ b/util/Ozone_Monitor/nwprod/oznmon_shared/sorc/CMakeLists.txt @@ -0,0 +1,2 @@ +add_subdirectory(oznmon_horiz.fd) +add_subdirectory(oznmon_time.fd) diff --git a/util/Ozone_Monitor/nwprod/oznmon_shared/sorc/oznmon_horiz.fd/CMakeLists.txt b/util/Ozone_Monitor/nwprod/oznmon_shared/sorc/oznmon_horiz.fd/CMakeLists.txt index e53b9fe0..3d7e5fb7 100644 --- a/util/Ozone_Monitor/nwprod/oznmon_shared/sorc/oznmon_horiz.fd/CMakeLists.txt +++ b/util/Ozone_Monitor/nwprod/oznmon_shared/sorc/oznmon_horiz.fd/CMakeLists.txt @@ -1,14 +1,27 @@ -cmake_minimum_required(VERSION 3.16.1) - file(GLOB OZNMON_HORIZ_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*90 ) - set(OZNMON_HORIZ_Fortran_FLAGS "-fp-model strict -assume byterecl -convert big_endian -O3 -g -traceback ") - set_source_files_properties( ${OZNMON_HORIZ_SRC} PROPERTIES COMPILE_FLAGS ${OZNMON_HORIZ_Fortran_FLAGS} ) - set(Util_MODULE_DIR ${PROJECT_BINARY_DIR}/include/oznmon_horiz ) - add_executable(oznmon_horiz.x ${OZNMON_HORIZ_SRC} ) - set_target_properties( oznmon_horiz.x PROPERTIES COMPILE_FLAGS ${OZNMON_HORIZ_Fortran_FLAGS} ) - set_target_properties( oznmon_horiz.x PROPERTIES Fortran_MODULE_DIRECTORY ${Util_MODULE_DIR} ) - include_directories( ${CORE_INCS} ${NCDIAG_INCS} ) - target_link_libraries( oznmon_horiz.x ${W3NCO_4_LIBRARY} ${NCDIAG_LIBRARIES} ${NETCDF_Fortran_LIBRARIES} ${NETCDF_C_LIBRARIES} ${MPI_Fortran_LIBRARIES} ) - if(BUILD_W3NCO) - add_dependencies( oznmon_horiz.x ${W3NCO_4_LIBRARY} ) - endif() +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fp-model strict -assume byterecl -convert big_endian") +elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fconvert=big-endian -ffree-line-length-0 -ffast-math -fno-second-underscore -frecord-marker=4") +endif() + +list(APPEND SRCS + create_ctl_horiz.f90 + horiz.f90 + kinds.f90 + oznmon_read_diag.f90 +) + +add_executable(oznmon_horiz.x ${SRCS}) +if(TARGET ncdiag) + add_dependencies(oznmon_horiz.x ncdiag) +endif() + +target_compile_definitions(oznmon_horiz.x PRIVATE "_REAL8_") +target_link_libraries(oznmon_horiz.x PRIVATE NetCDF::NetCDF_Fortran) +target_link_libraries(oznmon_horiz.x PRIVATE MPI::MPI_Fortran) +target_link_libraries(oznmon_horiz.x PRIVATE ncdiag::ncdiag) +target_link_libraries(oznmon_horiz.x PRIVATE w3emc::w3emc_4) + +# Install executable targets +install(TARGETS oznmon_horiz.x RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/util/Ozone_Monitor/nwprod/oznmon_shared/sorc/oznmon_horiz.fd/oznmon_read_diag.f90 b/util/Ozone_Monitor/nwprod/oznmon_shared/sorc/oznmon_horiz.fd/oznmon_read_diag.f90 index 8feb261c..7dadde2e 100644 --- a/util/Ozone_Monitor/nwprod/oznmon_shared/sorc/oznmon_horiz.fd/oznmon_read_diag.f90 +++ b/util/Ozone_Monitor/nwprod/oznmon_shared/sorc/oznmon_horiz.fd/oznmon_read_diag.f90 @@ -642,7 +642,7 @@ subroutine read_ozndiag_data_nc( ftin, header_fix, data_fix, data_nlev, data_ext nlevs = header_fix%nlevs - if( ncdiag_open_status(cur_idx)%nc_read == .true. ) then + if( ncdiag_open_status(cur_idx)%nc_read .eqv. .true. ) then iflag = -1 else iflag = 0 @@ -965,7 +965,7 @@ logical function verify_var_name_nc( test_name ) end if end do - if( verify_var_name_nc == .false. ) then + if( verify_var_name_nc .eqv. .false. ) then do k=1,num_vars if( test_name == var_names(k) ) then verify_var_name_nc = .true. diff --git a/util/Ozone_Monitor/nwprod/oznmon_shared/sorc/oznmon_time.fd/CMakeLists.txt b/util/Ozone_Monitor/nwprod/oznmon_shared/sorc/oznmon_time.fd/CMakeLists.txt index ea8b907a..dd5d973b 100644 --- a/util/Ozone_Monitor/nwprod/oznmon_shared/sorc/oznmon_time.fd/CMakeLists.txt +++ b/util/Ozone_Monitor/nwprod/oznmon_shared/sorc/oznmon_time.fd/CMakeLists.txt @@ -1,14 +1,29 @@ -cmake_minimum_required(VERSION 3.16.1) - file(GLOB OZNMON_TIME_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*90 ) - set(OZNMON_TIME_Fortran_FLAGS "-fp-model strict -assume byterecl -convert big_endian -O3 -g -traceback ") - set(Util_MODULE_DIR ${PROJECT_BINARY_DIR}/include/oznmon_time ) - set_source_files_properties( ${OZNMON_TIME_SRC} PROPERTIES COMPILE_FLAGS ${OZNMON_TIME_Fortran_FLAGS} ) - add_executable(oznmon_time.x ${OZNMON_TIME_SRC} ) - set_target_properties( oznmon_time.x PROPERTIES COMPILE_FLAGS ${OZNMON_TIME_Fortran_FLAGS} ) - set_target_properties( oznmon_time.x PROPERTIES Fortran_MODULE_DIRECTORY ${Util_MODULE_DIR} ) - include_directories( ${CORE_INCS} ${NCDIAG_INCS} ) - target_link_libraries( oznmon_time.x ${W3NCO_4_LIBRARY} ${NCDIAG_LIBRARIES} ${NETCDF_Fortran_LIBRARIES} ${NETCDF_C_LIBRARIES} ${MPI_Fortran_LIBRARIES} ) - if(BUILD_W3NCO) - add_dependencies( oznmon_time.x ${W3NCO_4_LIBRARY} ) - endif() +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fp-model strict -assume byterecl -convert big_endian") +elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fconvert=big-endian -ffree-line-length-0 -ffast-math -fno-second-underscore -frecord-marker=4") +endif() + +list(APPEND SRCS + avgsdv.f90 + create_ctl_time.f90 + kinds.f90 + oznmon_read_diag.f90 + time.f90 + valid.f90 +) + +add_executable(oznmon_time.x ${SRCS}) +if(TARGET ncdiag) + add_dependencies(oznmon_time.x ncdiag) +endif() + +target_compile_definitions(oznmon_time.x PRIVATE "_REAL8_") +target_link_libraries(oznmon_time.x PRIVATE NetCDF::NetCDF_Fortran) +target_link_libraries(oznmon_time.x PRIVATE MPI::MPI_Fortran) +target_link_libraries(oznmon_time.x PRIVATE ncdiag::ncdiag) +target_link_libraries(oznmon_time.x PRIVATE w3emc::w3emc_4) + +# Install executable targets +install(TARGETS oznmon_time.x RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/util/Ozone_Monitor/nwprod/oznmon_shared/sorc/oznmon_time.fd/oznmon_read_diag.f90 b/util/Ozone_Monitor/nwprod/oznmon_shared/sorc/oznmon_time.fd/oznmon_read_diag.f90 index 8feb261c..7dadde2e 100644 --- a/util/Ozone_Monitor/nwprod/oznmon_shared/sorc/oznmon_time.fd/oznmon_read_diag.f90 +++ b/util/Ozone_Monitor/nwprod/oznmon_shared/sorc/oznmon_time.fd/oznmon_read_diag.f90 @@ -642,7 +642,7 @@ subroutine read_ozndiag_data_nc( ftin, header_fix, data_fix, data_nlev, data_ext nlevs = header_fix%nlevs - if( ncdiag_open_status(cur_idx)%nc_read == .true. ) then + if( ncdiag_open_status(cur_idx)%nc_read .eqv. .true. ) then iflag = -1 else iflag = 0 @@ -965,7 +965,7 @@ logical function verify_var_name_nc( test_name ) end if end do - if( verify_var_name_nc == .false. ) then + if( verify_var_name_nc .eqv. .false. ) then do k=1,num_vars if( test_name == var_names(k) ) then verify_var_name_nc = .true. diff --git a/util/Ozone_Monitor/nwprod/oznmon_shared/sorc/oznmon_time.fd/time.f90 b/util/Ozone_Monitor/nwprod/oznmon_shared/sorc/oznmon_time.fd/time.f90 index 15d70cba..66d08dba 100755 --- a/util/Ozone_Monitor/nwprod/oznmon_shared/sorc/oznmon_time.fd/time.f90 +++ b/util/Ozone_Monitor/nwprod/oznmon_shared/sorc/oznmon_time.fd/time.f90 @@ -329,7 +329,7 @@ program main end do ! Do validation - if( validate == .TRUE. ) then + if( validate .eqv. .TRUE. ) then call load_base( satname, ier ) write(6,*) 'ier from load_base = ', ier @@ -344,7 +344,7 @@ program main do j=1,n_levs if ( use(j,k) > 0.0 ) then - if( validate == .TRUE. .AND. ier >= 0 ) then + if( validate .eqv. .TRUE. .AND. ier >= 0 ) then pbound = 0.00 call validate_penalty( j, k, penalty(j,k), valid_penalty, pbound, iret ) @@ -369,7 +369,7 @@ program main endif end do - if( validate == .TRUE. ) then + if( validate .eqv. .TRUE. ) then close( lupen ) close( lucnt ) endif diff --git a/util/Radiance_Monitor/CMakeLists.txt b/util/Radiance_Monitor/CMakeLists.txt index e11f186d..9c012404 100644 --- a/util/Radiance_Monitor/CMakeLists.txt +++ b/util/Radiance_Monitor/CMakeLists.txt @@ -1,104 +1,3 @@ -cmake_minimum_required(VERSION 2.8.12) -if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) - # I am top-level project. - if( NOT DEFINED ENV{CC} ) - find_path( crayComp "ftn" ) - find_path( wcossIntel "mpfort" ) - find_path( intelComp "ifort" ) - find_path( pgiComp "pgf90" ) - if( crayComp ) - message("Setting CrayLinuxEnvironment") - set(CMAKE_SYSTEM_NAME "CrayLinuxEnvironment") - set(CMAKE_C_COMPILER "${crayComp}/cc") - set(CMAKE_CXX_COMPILER "${crayComp}/CC") - set(CMAKE_Fortran_COMPILER "${crayComp}/ftn") - endif() - if( intelComp ) - set(ENV{CC} "icc") - set(ENV{CXX} "icpc") - set(ENV{FC} "ifort") - endif() - if( wcossIntel ) - message("Setting env for wcoss intel") - set(ENV{CC} "mpcc") - set(ENV{CXX} "mpCC") - set(ENV{FC} "mpfort") - endif() - if( pgiComp ) - set(ENV{CC} "pgcc") - set(ENV{CXX} "pgCC") - set(ENV{FC} "pgf90") - endif() - endif() - project(COV_Calc) - enable_language (Fortran) - set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/../../cmake/Modules/") - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib") - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/setPlatformVariables.cmake) - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/setIntelFlags.cmake) - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/setGNUFlags.cmake) - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/setPGIFlags.cmake) - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/setHOST.cmake) - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/platforms/Cheyenne.cmake) - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/platforms/Discover.cmake) - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/platforms/Generic.cmake) - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/platforms/Gaea.cmake) - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/platforms/Jet.cmake) - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/platforms/S4.cmake) - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/platforms/Hera.cmake) - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/platforms/WCOSS-C.cmake) - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/platforms/WCOSS-D.cmake) - include(${CMAKE_SOURCE_DIR}/../../cmake/Modules/platforms/WCOSS.cmake) - if (NOT CMAKE_BUILD_TYPE) - set (CMAKE_BUILD_TYPE RELEASE CACHE STRING - "Choose the type of build, options are: PRODUCTION Debug Release." - FORCE) - endif (NOT CMAKE_BUILD_TYPE) - if (CMAKE_CXX_COMPILER_ID MATCHES "GNU*") - message("Setting GNU flags") - setGNU() - elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel") - message("Setting Intel flags") - setIntel() - elseif(CMAKE_C_COMPILER MATCHES "pgc*") - message("Setting PGI flags") - setPGI() - endif() - - cmake_policy(SET CMP0009 NEW) - cmake_policy(SET CMP0074 NEW) - find_package(OpenMP) - message("found openmp with flag ${OPENMP_Fortran_FLAGS}") - -# Set Host specific flags and options - setHOST() - - find_package(MPI REQUIRED) - message("MPI version is ${MPI_Fortran_VERSION}") - message("MPI f90 version is ${MPI_Fortran_HAVE_F90_MODULE}") - message("MPI f08 version is ${MPI_Fortran_HAVE_F08_MODULE}") - - add_definitions(${MPI_Fortran_COMPILE_FLAGS}) - include_directories(${MPI_Fortran_INCLUDE_DIRS} ${MPI_INCLUDE_PATH} "./" ${CMAKE_INCLUDE_OUTPUT_DIRECTORY}) - link_directories(${MPI_Fortran_LIBRARIES} ${ARCHIVE_OUTPUT_PATH} ) - find_package( NetCDF COMPONENTS C Fortran REQUIRED) - find_package( W3NCO ) - - set(BUILD_NCDIAG ON) - set(NCDIAG_INCS "${PROJECT_BINARY_DIR}/src/ncdiag") - add_subdirectory(${PROJECT_SOURCE_DIR}/../../src/ncdiag ${PROJECT_BINARY_DIR}/src/ncdiag) - set(NCDIAG_LIBRARIES ncdiag ) - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) -endif() - -add_subdirectory(nwprod/radmon_shared/sorc/verf_radang.fd) -add_subdirectory(nwprod/radmon_shared/sorc/verf_radbcoef.fd) -add_subdirectory(nwprod/radmon_shared/sorc/verf_radbcor.fd) -add_subdirectory(nwprod/radmon_shared/sorc/verf_radtime.fd) -add_subdirectory(data_extract/sorc/radmon_mk_base.fd) -add_subdirectory(data_extract/sorc/radmon_validate_tm.fd) -add_subdirectory(image_gen/src/radmon_ig_angle.fd) -add_subdirectory(image_gen/src/radmon_ig_bcoef.fd) -add_subdirectory(image_gen/src/radmon_ig_horiz.fd) -add_subdirectory(image_gen/src/radmon_ig_summary.fd) -add_subdirectory(image_gen/src/radmon_ig_time.fd) +add_subdirectory(data_extract) +add_subdirectory(image_gen) +add_subdirectory(nwprod) diff --git a/util/Radiance_Monitor/data_extract/CMakeLists.txt b/util/Radiance_Monitor/data_extract/CMakeLists.txt new file mode 100644 index 00000000..ddf939af --- /dev/null +++ b/util/Radiance_Monitor/data_extract/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(sorc) diff --git a/util/Radiance_Monitor/data_extract/exec/.gitignore b/util/Radiance_Monitor/data_extract/exec/.gitignore deleted file mode 100644 index d6b7ef32..00000000 --- a/util/Radiance_Monitor/data_extract/exec/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/util/Radiance_Monitor/data_extract/sorc/CMakeLists.txt b/util/Radiance_Monitor/data_extract/sorc/CMakeLists.txt new file mode 100644 index 00000000..f1f7ac2f --- /dev/null +++ b/util/Radiance_Monitor/data_extract/sorc/CMakeLists.txt @@ -0,0 +1,2 @@ +add_subdirectory(radmon_mk_base.fd) +add_subdirectory(radmon_validate_tm.fd) diff --git a/util/Radiance_Monitor/data_extract/sorc/radmon_mk_base.fd/CMakeLists.txt b/util/Radiance_Monitor/data_extract/sorc/radmon_mk_base.fd/CMakeLists.txt index 603d4acf..d60ba7d5 100644 --- a/util/Radiance_Monitor/data_extract/sorc/radmon_mk_base.fd/CMakeLists.txt +++ b/util/Radiance_Monitor/data_extract/sorc/radmon_mk_base.fd/CMakeLists.txt @@ -1,14 +1,16 @@ -cmake_minimum_required(VERSION 2.8.12) - file(GLOB RADMON_MK_BASE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*90 ) - set(RADMON_MK_BASE_Fortran_FLAGS "-fp-model strict -assume byterecl -convert big_endian -O3 -traceback -D_REAL8_ ") - set(Util_MODULE_DIR ${PROJECT_BINARY_DIR}/include/radmon_mk_base ) - set_source_files_properties( ${RADMON_MK_BASE_SRC} PROPERTIES COMPILE_FLAGS ${RADMON_MK_BASE_Fortran_FLAGS} ) - add_executable(radmon_mk_base.x ${RADMON_MK_BASE_SRC} ) - set_target_properties( radmon_mk_base.x PROPERTIES COMPILE_FLAGS ${RADMON_MK_BASE_Fortran_FLAGS} ) - set_target_properties( radmon_mk_base.x PROPERTIES Fortran_MODULE_DIRECTORY ${Util_MODULE_DIR} ) - include_directories( ${CORE_INCS} ) - target_link_libraries( radmon_mk_base.x ${W3NCO_4_LIBRARY} ) - if(BUILD_W3NCO) - add_dependencies( radmon_mk_base.x ${W3NCO_4_LIBRARY} ) - endif() +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fp-model strict -assume byterecl -convert big_endian") +elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fconvert=big-endian -ffree-line-length-0 -ffast-math -fno-second-underscore -frecord-marker=4") +endif() + +list(APPEND SRCS + make_base.f90 +) + +add_executable(radmon_make_base.x ${SRCS}) +target_link_libraries(radmon_make_base.x PRIVATE w3emc::w3emc_4) + +# Install executable targets +install(TARGETS radmon_make_base.x RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/util/Radiance_Monitor/data_extract/sorc/radmon_mk_base.fd/makefile b/util/Radiance_Monitor/data_extract/sorc/radmon_mk_base.fd/makefile deleted file mode 100755 index 05519c04..00000000 --- a/util/Radiance_Monitor/data_extract/sorc/radmon_mk_base.fd/makefile +++ /dev/null @@ -1,44 +0,0 @@ -# ***************************************************************** -# makefile -# -# Make the make_base executable. The executable will construct -# base history files for each entry in the SATYPE list from the -# time data files (*.ieee_d) for the specified source (suffix). -# -# This is not normally necessary for RadMon users unless you want -# to use the automated validation mechanism. -# ***************************************************************** - -BINDIR = ../../exec - -LIBS = $(W3NCO_LIB4) - -OBJS = make_base.o - -# -# ***************************************************************** -# - -CMD = make_base - -all: $(CMD) - -clean: - rm -f *.o - rm -f *.mod - rm -f make_base - -check_prereqs: - /nwprod/spa_util/check_libs.bash $(LIBS) - -install: - cp -f $(CMD) $(BINDIR)/. - -debug: FFLAGS = $(D_FFLAGS) -debug: $(CMD) - -$(CMD): $(OBJS) - $(CF) $(FFLAGS) $(LDFLAGS) -o $(@) $(OBJS) $(LIBS) - -make_base.o : make_base.f90 - $(CF) $(FFLAGS) -c $(*).f90 diff --git a/util/Radiance_Monitor/data_extract/sorc/radmon_validate_tm.fd/CMakeLists.txt b/util/Radiance_Monitor/data_extract/sorc/radmon_validate_tm.fd/CMakeLists.txt index 071e872e..d1f9128c 100644 --- a/util/Radiance_Monitor/data_extract/sorc/radmon_validate_tm.fd/CMakeLists.txt +++ b/util/Radiance_Monitor/data_extract/sorc/radmon_validate_tm.fd/CMakeLists.txt @@ -1,14 +1,22 @@ -cmake_minimum_required(VERSION 2.8.12) - file(GLOB RADMON_VALIDATE_TM_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*90 ) - set(RADMON_VALIDATE_TM_Fortran_FLAGS "-fp-model strict -assume byterecl -convert big_endian -O3 -traceback -D_REAL8_ ") - set(Util_MODULE_DIR ${PROJECT_BINARY_DIR}/include/radmon_validate_tm.x ) - set_source_files_properties( ${RADMON_VALIDATE_TM_SRC} PROPERTIES COMPILE_FLAGS ${RADMON_VALIDATE_TM_Fortran_FLAGS} ) - add_executable(radmon_validate_tm.x ${RADMON_VALIDATE_TM_SRC} ) - set_target_properties( radmon_validate_tm.x PROPERTIES COMPILE_FLAGS ${RADMON_VALIDATE_TM_Fortran_FLAGS} ) - set_target_properties( radmon_validate_tm.x PROPERTIES Fortran_MODULE_DIRECTORY ${Util_MODULE_DIR} ) - include_directories( ${CORE_INCS} ) - target_link_libraries( radmon_validate_tm.x ${W3NCO_4_LIBRARY} ) - if(BUILD_W3NCO) - add_dependencies( radmon_validate_tm.x ${W3NCO_4_LIBRARY} ) - endif() +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fp-model strict -assume byterecl -convert big_endian") +elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fconvert=big-endian -ffree-line-length-0 -ffast-math -fno-second-underscore -frecord-marker=4") +endif() + +list(APPEND SRCS + bad_chan.f90 + bad_penalty.f90 + kinds.F90 + low_count.f90 + valid.f90 + validate_time.f90 +) + +add_executable(radmon_validate_tm.x ${SRCS}) +target_compile_definitions(radmon_validate_tm.x PRIVATE "_REAL8_") +target_link_libraries(radmon_validate_tm.x PRIVATE w3emc::w3emc_4) + +# Install executable targets +install(TARGETS radmon_validate_tm.x RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/util/Radiance_Monitor/data_extract/sorc/radmon_validate_tm.fd/makefile b/util/Radiance_Monitor/data_extract/sorc/radmon_validate_tm.fd/makefile deleted file mode 100755 index afd5e059..00000000 --- a/util/Radiance_Monitor/data_extract/sorc/radmon_validate_tm.fd/makefile +++ /dev/null @@ -1,62 +0,0 @@ -# ***************************************************************** -# makefile -# -# Make the validate_time.x executable. This is not normally needed -# for normal use. It re-validates data in an extracted *.ieee_d -# file, applying a different set of historic base files in the -# validation. -# -# If needed, run make on this directory and move the executable -# over to the data_extract/exec directory. -# -# ***************************************************************** - -BINDIR = ../../exec - -LIBS = $(W3NCO_LIB4) - -OBJS = kinds.o bad_obs.o bad_penalty.o bad_chan.o valid.o \ - validate_time.o - -# -# ***************************************************************** -# - -CMD = validate_time.x - -all: $(CMD) - -clean: - rm -f *.o - rm -f *.mod - rm -f validate_time.x - -check_prereqs: - /nwprod/spa_util/check_libs.bash $(LIBS) - -install: - cp -f $(CMD) $(BINDIR)/ - -debug: FFLAGS = $(D_FFLAGS) -debug: $(CMD) - -$(CMD): $(OBJS) - $(CF) $(FFLAGS) $(LDFLAGS) -o $(@) $(OBJS) $(LIBS) - -bad_obs.o : bad_obs.f90 - $(CF) $(FFLAGS) -c $(*).f90 - -bad_penalty.o : bad_penalty.f90 - $(CF) $(FFLAGS) -c $(*).f90 - -bad_chan.o : bad_chan.f90 - $(CF) $(FFLAGS) -c $(*).f90 - -valid.o : valid.f90 - $(CF) $(FFLAGS) -c $(*).f90 - -validate_time.o : validate_time.f90 - $(CF) $(FFLAGS) -c $(*).f90 - -kinds.o : kinds.F90 - $(CF) $(FFLAGS) -c $(*).F90 diff --git a/util/Radiance_Monitor/image_gen/CMakeLists.txt b/util/Radiance_Monitor/image_gen/CMakeLists.txt new file mode 100644 index 00000000..febd4f0a --- /dev/null +++ b/util/Radiance_Monitor/image_gen/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(src) diff --git a/util/Radiance_Monitor/image_gen/exec/.gitignore b/util/Radiance_Monitor/image_gen/exec/.gitignore deleted file mode 100644 index d6b7ef32..00000000 --- a/util/Radiance_Monitor/image_gen/exec/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/util/Radiance_Monitor/image_gen/src/CMakeLists.txt b/util/Radiance_Monitor/image_gen/src/CMakeLists.txt new file mode 100644 index 00000000..a54d0f78 --- /dev/null +++ b/util/Radiance_Monitor/image_gen/src/CMakeLists.txt @@ -0,0 +1,5 @@ +add_subdirectory(radmon_ig_angle.fd) +add_subdirectory(radmon_ig_bcoef.fd) +add_subdirectory(radmon_ig_horiz.fd) +add_subdirectory(radmon_ig_summary.fd) +add_subdirectory(radmon_ig_time.fd) diff --git a/util/Radiance_Monitor/image_gen/src/radmon_ig_angle.fd/CMakeLists.txt b/util/Radiance_Monitor/image_gen/src/radmon_ig_angle.fd/CMakeLists.txt index e585be7a..ede288d2 100644 --- a/util/Radiance_Monitor/image_gen/src/radmon_ig_angle.fd/CMakeLists.txt +++ b/util/Radiance_Monitor/image_gen/src/radmon_ig_angle.fd/CMakeLists.txt @@ -1,14 +1,19 @@ -cmake_minimum_required(VERSION 2.8.12) - file(GLOB RADMON_IG_ANGLE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*90 ) - set(RADMON_IG_ANGLE_Fortran_FLAGS "-fp-model strict -assume byterecl -convert big_endian -O3 -traceback -D_REAL8_ ") - set(Util_MODULE_DIR ${PROJECT_BINARY_DIR}/include/radmon_ig_angle ) - set_source_files_properties( ${RADMON_IG_ANGLE_SRC} PROPERTIES COMPILE_FLAGS ${RADMON_IG_ANGLE_Fortran_FLAGS} ) - add_executable(radmon_ig_angle.x ${RADMON_IG_ANGLE_SRC} ) - set_target_properties( radmon_ig_angle.x PROPERTIES COMPILE_FLAGS ${RADMON_IG_ANGLE_Fortran_FLAGS} ) - set_target_properties( radmon_ig_angle.x PROPERTIES Fortran_MODULE_DIRECTORY ${Util_MODULE_DIR} ) - include_directories( ${CORE_INCS} ) - target_link_libraries( radmon_ig_angle.x ${W3NCO_4_LIBRARY} ) - if(BUILD_W3NCO) - add_dependencies( radmon_ig_angle.x ${W3NCO_4_LIBRARY} ) - endif() +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fp-model strict -assume byterecl -convert big_endian") +elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fconvert=big-endian -ffree-line-length-0 -ffast-math -fno-second-underscore -frecord-marker=4") +endif() + +list(APPEND SRCS + angle.f90 + avgsdv.f90 +) + +add_executable(radmon_ig_angle.x ${SRCS}) + +target_compile_definitions(radmon_ig_angle.x PRIVATE "_REAL8_") +target_link_libraries(radmon_ig_angle.x PRIVATE w3emc::w3emc_4) + +# Install executable targets +install(TARGETS radmon_ig_angle.x RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/util/Radiance_Monitor/image_gen/src/radmon_ig_angle.fd/angle.f90 b/util/Radiance_Monitor/image_gen/src/radmon_ig_angle.fd/angle.f90 index 78ea2f26..e7f35f51 100755 --- a/util/Radiance_Monitor/image_gen/src/radmon_ig_angle.fd/angle.f90 +++ b/util/Radiance_Monitor/image_gen/src/radmon_ig_angle.fd/angle.f90 @@ -338,7 +338,7 @@ program angle inquire(file=data_file, exist=exist) write( 6,* ) 'data_file : ', data_file, 'exist = ', exist - if ( exist == .TRUE. ) then + if ( exist .eqv. .TRUE. ) then open(ldname,file=data_file,form='unformatted') diff --git a/util/Radiance_Monitor/image_gen/src/radmon_ig_bcoef.fd/CMakeLists.txt b/util/Radiance_Monitor/image_gen/src/radmon_ig_bcoef.fd/CMakeLists.txt index 06e447e3..f16f518a 100644 --- a/util/Radiance_Monitor/image_gen/src/radmon_ig_bcoef.fd/CMakeLists.txt +++ b/util/Radiance_Monitor/image_gen/src/radmon_ig_bcoef.fd/CMakeLists.txt @@ -1,14 +1,19 @@ -cmake_minimum_required(VERSION 2.8.12) - file(GLOB RADMON_IG_BCOEF_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*90 ) - set(RADMON_IG_BCOEF_Fortran_FLAGS "-fp-model strict -assume byterecl -convert big_endian -O3 -traceback -D_REAL8_ ") - set(Util_MODULE_DIR ${PROJECT_BINARY_DIR}/include/radmon_ig_bcoef ) - set_source_files_properties( ${RADMON_IG_BCOEF_SRC} PROPERTIES COMPILE_FLAGS ${RADMON_IG_BCOEF_Fortran_FLAGS} ) - add_executable(radmon_ig_bcoef.x ${RADMON_IG_BCOEF_SRC} ) - set_target_properties( radmon_ig_bcoef.x PROPERTIES COMPILE_FLAGS ${RADMON_IG_BCOEF_Fortran_FLAGS} ) - set_target_properties( radmon_ig_bcoef.x PROPERTIES Fortran_MODULE_DIRECTORY ${Util_MODULE_DIR} ) - include_directories( ${CORE_INCS} ) - target_link_libraries( radmon_ig_bcoef.x ${W3NCO_4_LIBRARY} ) - if(BUILD_W3NCO) - add_dependencies( radmon_ig_bcoef.x ${W3NCO_4_LIBRARY} ) - endif() +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fp-model strict -assume byterecl -convert big_endian") +elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fconvert=big-endian -ffree-line-length-0 -ffast-math -fno-second-underscore -frecord-marker=4") +endif() + +list(APPEND SRCS + avgsdv.f90 + bcoef.f90 +) + +add_executable(radmon_ig_bcoef.x ${SRCS}) + +target_compile_definitions(radmon_ig_bcoef.x PRIVATE "_REAL8_") +target_link_libraries(radmon_ig_bcoef.x PRIVATE w3emc::w3emc_4) + +# Install executable targets +install(TARGETS radmon_ig_bcoef.x RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/util/Radiance_Monitor/image_gen/src/radmon_ig_bcoef.fd/bcoef.f90 b/util/Radiance_Monitor/image_gen/src/radmon_ig_bcoef.fd/bcoef.f90 index c70fac7c..24fb4b60 100755 --- a/util/Radiance_Monitor/image_gen/src/radmon_ig_bcoef.fd/bcoef.f90 +++ b/util/Radiance_Monitor/image_gen/src/radmon_ig_bcoef.fd/bcoef.f90 @@ -18,7 +18,9 @@ program bcoef ! but not bcoef. !************************************************************************ - use IFPORT +! use IFPORT +! Intel® Fortran includes functions and subroutines that ease porting of code to or from a PC, or allow you to write code on a PC that is compatible with other platforms. The portability library is called LIBIFPORT.LIB (Windows*) or libifport.a (Linux* and macOS*). Frequently used functions are included in a portability module called IFPORT. +! What functionality from IFPORT library is being used here and why? implicit none @@ -174,7 +176,7 @@ program bcoef inquire(file=data_file, exist=exist) ! write(6,*) 'data_file,exist = ', data_file, ' ', exist - if ( exist == .TRUE. ) then + if ( exist .eqv. .TRUE. ) then open(ldname,file=data_file,form='unformatted') read(ldname) (penalty(jj),jj=1,nchanl) ! write(6,*) 'penalty(1) = ', penalty(1) diff --git a/util/Radiance_Monitor/image_gen/src/radmon_ig_horiz.fd/CMakeLists.txt b/util/Radiance_Monitor/image_gen/src/radmon_ig_horiz.fd/CMakeLists.txt index 07e20110..b50bf7fe 100644 --- a/util/Radiance_Monitor/image_gen/src/radmon_ig_horiz.fd/CMakeLists.txt +++ b/util/Radiance_Monitor/image_gen/src/radmon_ig_horiz.fd/CMakeLists.txt @@ -1,14 +1,29 @@ -cmake_minimum_required(VERSION 2.8.12) - file(GLOB RADMON_HORIZ_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*90 ) - set(RADMON_HORIZ_Fortran_FLAGS "-fp-model strict -assume byterecl -convert big_endian -O3 -traceback -D_REAL8_ ") - set(Util_MODULE_DIR ${PROJECT_BINARY_DIR}/include/radmon_horiz ) - set_source_files_properties( ${RADMON_HORIZ_SRC} PROPERTIES COMPILE_FLAGS ${RADMON_HORIZ_Fortran_FLAGS} ) - add_executable(radmon_ig_horiz.x ${RADMON_HORIZ_SRC} ) - set_target_properties( radmon_ig_horiz.x PROPERTIES COMPILE_FLAGS ${RADMON_HORIZ_Fortran_FLAGS} ) - set_target_properties( radmon_ig_horiz.x PROPERTIES Fortran_MODULE_DIRECTORY ${Util_MODULE_DIR} ) - include_directories( ${CORE_INCS} ${NCDIAG_INCS} ) - target_link_libraries( radmon_ig_horiz.x ${W3NCO_4_LIBRARY} ${NCDIAG_LIBRARIES} ${NETCDF_Fortran_LIBRARIES} ${NETCDF_C_LIBRARIES} ${MPI_Fortran_LIBRARIES}) - if(BUILD_W3NCO) - add_dependencies( radmon_ig_horiz.x ${W3NCO_4_LIBRARY} ) - endif() +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fp-model strict -assume byterecl -convert big_endian") +elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fconvert=big-endian -ffree-line-length-0 -ffast-math -fno-second-underscore -frecord-marker=4") +endif() + +list(APPEND SRCS + create_ctl_horiz.f90 + horiz.f90 + kinds.F90 + read_diag.f90 + sparsearr.f90 + update_ctl_horiz.f90 +) + +add_executable(radmon_ig_horiz.x ${SRCS}) +if(TARGET ncdiag) + add_dependencies(radmon_ig_horiz.x ncdiag) +endif() + +target_compile_definitions(radmon_ig_horiz.x PRIVATE "_REAL8_") +target_link_libraries(radmon_ig_horiz.x PRIVATE NetCDF::NetCDF_Fortran) +target_link_libraries(radmon_ig_horiz.x PRIVATE MPI::MPI_Fortran) +target_link_libraries(radmon_ig_horiz.x PRIVATE ncdiag::ncdiag) +target_link_libraries(radmon_ig_horiz.x PRIVATE w3emc::w3emc_4) + +# Install executable targets +install(TARGETS radmon_ig_horiz.x RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/util/Radiance_Monitor/image_gen/src/radmon_ig_summary.fd/CMakeLists.txt b/util/Radiance_Monitor/image_gen/src/radmon_ig_summary.fd/CMakeLists.txt index 98dd52d7..aa69a48b 100644 --- a/util/Radiance_Monitor/image_gen/src/radmon_ig_summary.fd/CMakeLists.txt +++ b/util/Radiance_Monitor/image_gen/src/radmon_ig_summary.fd/CMakeLists.txt @@ -1,14 +1,19 @@ -cmake_minimum_required(VERSION 2.8.12) - file(GLOB RADMON_IG_SUMMARY_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*90 ) - set(RADMON_IG_SUMMARY_Fortran_FLAGS "-fp-model strict -assume byterecl -convert big_endian -O3 -traceback -D_REAL8_ ") - set(Util_MODULE_DIR ${PROJECT_BINARY_DIR}/include/radmon_ig_summary ) - set_source_files_properties( ${RADMON_IG_SUMMARY_SRC} PROPERTIES COMPILE_FLAGS ${RADMON_IG_SUMMARY_Fortran_FLAGS} ) - add_executable(radmon_ig_summary.x ${RADMON_IG_SUMMARY_SRC} ) - set_target_properties( radmon_ig_summary.x PROPERTIES COMPILE_FLAGS ${RADMON_IG_SUMMARY_Fortran_FLAGS} ) - set_target_properties( radmon_ig_summary.x PROPERTIES Fortran_MODULE_DIRECTORY ${Util_MODULE_DIR} ) - include_directories( ${CORE_INCS} ) - target_link_libraries( radmon_ig_summary.x ${W3NCO_4_LIBRARY} ) - if(BUILD_W3NCO) - add_dependencies( radmon_ig_summary.x ${W3NCO_4_LIBRARY} ) - endif() +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fp-model strict -assume byterecl -convert big_endian") +elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fconvert=big-endian -ffree-line-length-0 -ffast-math -fno-second-underscore -frecord-marker=4") +endif() + +list(APPEND SRCS + avgsdv.f90 + summary.f90 +) + +add_executable(radmon_ig_summary.x ${SRCS}) + +target_compile_definitions(radmon_ig_summary.x PRIVATE "_REAL8_") +target_link_libraries(radmon_ig_summary.x PRIVATE w3emc::w3emc_4) + +# Install executable targets +install(TARGETS radmon_ig_summary.x RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/util/Radiance_Monitor/image_gen/src/radmon_ig_summary.fd/summary.f90 b/util/Radiance_Monitor/image_gen/src/radmon_ig_summary.fd/summary.f90 index f857c4d1..531f4bd4 100755 --- a/util/Radiance_Monitor/image_gen/src/radmon_ig_summary.fd/summary.f90 +++ b/util/Radiance_Monitor/image_gen/src/radmon_ig_summary.fd/summary.f90 @@ -15,7 +15,9 @@ program summary ! !************************************************************************ - use IFPORT +! use IFPORT +! Intel® Fortran includes functions and subroutines that ease porting of code to or from a PC, or allow you to write code on a PC that is compatible with other platforms. The portability library is called LIBIFPORT.LIB (Windows*) or libifport.a (Linux* and macOS*). Frequently used functions are included in a portability module called IFPORT. +! What functionality from IFPORT library is being used here and why? implicit none @@ -142,7 +144,7 @@ program summary inquire(file=data_file, exist=exist) - if ( exist == .TRUE. ) then + if ( exist .eqv. .TRUE. ) then open(ldname,file=data_file,form='unformatted') read(ldname) ((cnt(ftyp,cyc,j,k),j=1,nchanl),k=1,nregion) read(ldname) ((pen(ftyp,cyc,j,k),j=1,nchanl),k=1,nregion) diff --git a/util/Radiance_Monitor/image_gen/src/radmon_ig_time.fd/CMakeLists.txt b/util/Radiance_Monitor/image_gen/src/radmon_ig_time.fd/CMakeLists.txt index 3f4bfa4c..390308fd 100644 --- a/util/Radiance_Monitor/image_gen/src/radmon_ig_time.fd/CMakeLists.txt +++ b/util/Radiance_Monitor/image_gen/src/radmon_ig_time.fd/CMakeLists.txt @@ -1,14 +1,19 @@ -cmake_minimum_required(VERSION 2.8.12) - file(GLOB RADMON_IG_TIME_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*90 ) - set(RADMON_IG_TIME_Fortran_FLAGS "-fp-model strict -assume byterecl -convert big_endian -O3 -traceback -D_REAL8_ ") - set(Util_MODULE_DIR ${PROJECT_BINARY_DIR}/include/radmon_ig_time ) - set_source_files_properties( ${RADMON_IG_TIME_SRC} PROPERTIES COMPILE_FLAGS ${RADMON_IG_TIME_Fortran_FLAGS} ) - add_executable(radmon_ig_time.x ${RADMON_IG_TIME_SRC} ) - set_target_properties( radmon_ig_time.x PROPERTIES COMPILE_FLAGS ${RADMON_IG_TIME_Fortran_FLAGS} ) - set_target_properties( radmon_ig_time.x PROPERTIES Fortran_MODULE_DIRECTORY ${Util_MODULE_DIR} ) - include_directories( ${CORE_INCS} ) - target_link_libraries( radmon_ig_time.x ${W3NCO_4_LIBRARY} ) - if(BUILD_W3NCO) - add_dependencies( radmon_ig_time.x ${W3NCO_4_LIBRARY} ) - endif() +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fp-model strict -assume byterecl -convert big_endian") +elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fconvert=big-endian -ffree-line-length-0 -ffast-math -fno-second-underscore -frecord-marker=4") +endif() + +list(APPEND SRCS + avgsdv.f90 + time.f90 +) + +add_executable(radmon_ig_time.x ${SRCS}) + +target_compile_definitions(radmon_ig_time.x PRIVATE "_REAL8_") +target_link_libraries(radmon_ig_time.x PRIVATE w3emc::w3emc_4) + +# Install executable targets +install(TARGETS radmon_ig_time.x RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/util/Radiance_Monitor/image_gen/src/radmon_ig_time.fd/time.f90 b/util/Radiance_Monitor/image_gen/src/radmon_ig_time.fd/time.f90 index 9b964de0..4e7df16e 100755 --- a/util/Radiance_Monitor/image_gen/src/radmon_ig_time.fd/time.f90 +++ b/util/Radiance_Monitor/image_gen/src/radmon_ig_time.fd/time.f90 @@ -15,7 +15,9 @@ program gatime ! one entry for a given channel per line. !************************************************************************ - use IFPORT +! use IFPORT +! Intel® Fortran includes functions and subroutines that ease porting of code to or from a PC, or allow you to write code on a PC that is compatible with other platforms. The portability library is called LIBIFPORT.LIB (Windows*) or libifport.a (Linux* and macOS*). Frequently used functions are included in a portability module called IFPORT. +! What functionality from IFPORT library is being used here and why? implicit none @@ -147,7 +149,7 @@ program gatime inquire(file=data_file, exist=exist) - if ( exist == .TRUE. ) then + if ( exist .eqv. .TRUE. ) then open(ldname,file=data_file,form='unformatted') read(ldname) ((cnt(ftyp,cyc,j,k),j=1,nchanl),k=1,nregion) read(ldname) ((pen(ftyp,cyc,j,k),j=1,nchanl),k=1,nregion) diff --git a/util/Radiance_Monitor/nwprod/CMakeLists.txt b/util/Radiance_Monitor/nwprod/CMakeLists.txt new file mode 100644 index 00000000..067d9346 --- /dev/null +++ b/util/Radiance_Monitor/nwprod/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(radmon_shared) diff --git a/util/Radiance_Monitor/nwprod/radmon_shared/CMakeLists.txt b/util/Radiance_Monitor/nwprod/radmon_shared/CMakeLists.txt new file mode 100644 index 00000000..ddf939af --- /dev/null +++ b/util/Radiance_Monitor/nwprod/radmon_shared/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(sorc) diff --git a/util/Radiance_Monitor/nwprod/radmon_shared/sorc/CMakeLists.txt b/util/Radiance_Monitor/nwprod/radmon_shared/sorc/CMakeLists.txt new file mode 100644 index 00000000..b08f886e --- /dev/null +++ b/util/Radiance_Monitor/nwprod/radmon_shared/sorc/CMakeLists.txt @@ -0,0 +1,4 @@ +add_subdirectory(verf_radang.fd) +add_subdirectory(verf_radbcoef.fd) +add_subdirectory(verf_radbcor.fd) +add_subdirectory(verf_radtime.fd) diff --git a/util/Radiance_Monitor/nwprod/radmon_shared/sorc/verf_radang.fd/CMakeLists.txt b/util/Radiance_Monitor/nwprod/radmon_shared/sorc/verf_radang.fd/CMakeLists.txt index aba90e6d..7cf902a8 100644 --- a/util/Radiance_Monitor/nwprod/radmon_shared/sorc/verf_radang.fd/CMakeLists.txt +++ b/util/Radiance_Monitor/nwprod/radmon_shared/sorc/verf_radang.fd/CMakeLists.txt @@ -1,14 +1,28 @@ -cmake_minimum_required(VERSION 3.16.1) - file(GLOB RADMON_ANGLE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*90 ) - set(RADMON_ANGLE_Fortran_FLAGS "-fp-model strict -assume byterecl -convert big_endian -O3 -g -traceback -D_REAL8_ ") - set(Util_MODULE_DIR ${PROJECT_BINARY_DIR}/include/radmon_angle ) - set_source_files_properties( ${RADMON_ANGLE_SRC} PROPERTIES COMPILE_FLAGS ${RADMON_ANGLE_Fortran_FLAGS} ) - add_executable(radmon_angle.x ${RADMON_ANGLE_SRC} ) - set_target_properties( radmon_angle.x PROPERTIES COMPILE_FLAGS ${RADMON_ANGLE_Fortran_FLAGS} ) - set_target_properties( radmon_angle.x PROPERTIES Fortran_MODULE_DIRECTORY ${Util_MODULE_DIR} ) - include_directories( ${CORE_INCS} ${NCDIAG_INCS} ) - target_link_libraries( radmon_angle.x ${W3NCO_4_LIBRARY} ${NCDIAG_LIBRARIES} ${NETCDF_Fortran_LIBRARIES} ${NETCDF_C_LIBRARIES} ${MPI_Fortran_LIBRARIES} ) - if(BUILD_W3NCO) - add_dependencies( radmon_angle.x ${W3NCO_4_LIBRARY} ) - endif() +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fp-model strict -assume byterecl -convert big_endian") +elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fconvert=big-endian -ffree-line-length-0 -ffast-math -fno-second-underscore -frecord-marker=4") +endif() + +list(APPEND SRCS + angle_bias.f90 + create_ctl_angle.f90 + kinds.F90 + read_diag.f90 + sparsearr.f90 +) + +add_executable(radmon_angle.x ${SRCS}) +if(TARGET ncdiag) + add_dependencies(radmon_angle.x ncdiag) +endif() + +target_compile_definitions(radmon_angle.x PRIVATE "_REAL8_") +target_link_libraries(radmon_angle.x PRIVATE NetCDF::NetCDF_Fortran) +target_link_libraries(radmon_angle.x PRIVATE MPI::MPI_Fortran) +target_link_libraries(radmon_angle.x PRIVATE ncdiag::ncdiag) +target_link_libraries(radmon_angle.x PRIVATE w3emc::w3emc_4) + +# Install executable targets +install(TARGETS radmon_angle.x RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/util/Radiance_Monitor/nwprod/radmon_shared/sorc/verf_radbcoef.fd/CMakeLists.txt b/util/Radiance_Monitor/nwprod/radmon_shared/sorc/verf_radbcoef.fd/CMakeLists.txt index f6c13cde..6fc89645 100644 --- a/util/Radiance_Monitor/nwprod/radmon_shared/sorc/verf_radbcoef.fd/CMakeLists.txt +++ b/util/Radiance_Monitor/nwprod/radmon_shared/sorc/verf_radbcoef.fd/CMakeLists.txt @@ -1,14 +1,28 @@ -cmake_minimum_required(VERSION 3.16.1) - file(GLOB RADMON_BCOEF_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*90 ) - set(RADMON_BCOEF_Fortran_FLAGS "-fp-model strict -assume byterecl -convert big_endian -O3 -g -traceback -D_REAL8_ ") - set(Util_MODULE_DIR ${PROJECT_BINARY_DIR}/include/radmon_bcoef ) - set_source_files_properties( ${RADMON_BCOEF_SRC} PROPERTIES COMPILE_FLAGS ${RADMON_BCOEF_Fortran_FLAGS} ) - add_executable(radmon_bcoef.x ${RADMON_BCOEF_SRC} ) - set_target_properties( radmon_bcoef.x PROPERTIES COMPILE_FLAGS ${RADMON_BCOEF_Fortran_FLAGS} ) - set_target_properties( radmon_bcoef.x PROPERTIES Fortran_MODULE_DIRECTORY ${Util_MODULE_DIR} ) - include_directories( ${CORE_INCS} ${NCDIAG_INCS} ) - target_link_libraries( radmon_bcoef.x ${W3NCO_4_LIBRARY} ${NCDIAG_LIBRARIES} ${NETCDF_Fortran_LIBRARIES} ${NETCDF_C_LIBRARIES} ${MPI_Fortran_LIBRARIES} ) - if(BUILD_W3NCO) - add_dependencies( radmon_bcoef.x ${W3NCO_4_LIBRARY} ) - endif() +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fp-model strict -assume byterecl -convert big_endian") +elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fconvert=big-endian -ffree-line-length-0 -ffast-math -fno-second-underscore -frecord-marker=4") +endif() + +list(APPEND SRCS + bcoef.f90 + create_ctl_bcoef.f90 + kinds.F90 + read_diag.f90 + sparsearr.f90 +) + +add_executable(radmon_bcoef.x ${SRCS}) +if(TARGET ncdiag) + add_dependencies(radmon_bcoef.x ncdiag) +endif() + +target_compile_definitions(radmon_bcoef.x PRIVATE "_REAL8_") +target_link_libraries(radmon_bcoef.x PRIVATE NetCDF::NetCDF_Fortran) +target_link_libraries(radmon_bcoef.x PRIVATE MPI::MPI_Fortran) +target_link_libraries(radmon_bcoef.x PRIVATE ncdiag::ncdiag) +target_link_libraries(radmon_bcoef.x PRIVATE w3emc::w3emc_4) + +# Install executable targets +install(TARGETS radmon_bcoef.x RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/util/Radiance_Monitor/nwprod/radmon_shared/sorc/verf_radbcor.fd/CMakeLists.txt b/util/Radiance_Monitor/nwprod/radmon_shared/sorc/verf_radbcor.fd/CMakeLists.txt index 96f5a583..4872ecbd 100644 --- a/util/Radiance_Monitor/nwprod/radmon_shared/sorc/verf_radbcor.fd/CMakeLists.txt +++ b/util/Radiance_Monitor/nwprod/radmon_shared/sorc/verf_radbcor.fd/CMakeLists.txt @@ -1,14 +1,29 @@ -cmake_minimum_required(VERSION 3.16.1) - file(GLOB RADMON_BCOR_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*90 ) - set(RADMON_BCOR_Fortran_FLAGS "-fp-model strict -assume byterecl -convert big_endian -O3 -g -traceback -D_REAL8_ ") - set(Util_MODULE_DIR ${PROJECT_BINARY_DIR}/include/radmon_bcor ) - set_source_files_properties( ${RADMON_BCOR_SRC} PROPERTIES COMPILE_FLAGS ${RADMON_BCOR_Fortran_FLAGS} ) - add_executable(radmon_bcor.x ${RADMON_BCOR_SRC} ) - set_target_properties( radmon_bcor.x PROPERTIES COMPILE_FLAGS ${RADMON_BCOR_Fortran_FLAGS} ) - set_target_properties( radmon_bcor.x PROPERTIES Fortran_MODULE_DIRECTORY ${Util_MODULE_DIR} ) - include_directories( ${CORE_INCS} ${NCDIAG_INCS} ) - target_link_libraries( radmon_bcor.x ${W3NCO_4_LIBRARY} ${NCDIAG_LIBRARIES} ${NETCDF_Fortran_LIBRARIES} ${NETCDF_C_LIBRARIES} ${MPI_Fortran_LIBRARIES} ) - if(BUILD_W3NCO) - add_dependencies( radmon_bcor.x ${W3NCO_4_LIBRARY} ) - endif() +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fp-model strict -assume byterecl -convert big_endian") +elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fconvert=big-endian -ffree-line-length-0 -ffast-math -fno-second-underscore -frecord-marker=4") +endif() + +list(APPEND SRCS + avgsdv.f90 + bcor.f90 + create_ctl_bcor.f90 + kinds.F90 + read_diag.f90 + sparsearr.f90 +) + +add_executable(radmon_bcor.x ${SRCS}) +if(TARGET ncdiag) + add_dependencies(radmon_bcor.x ncdiag) +endif() + +target_compile_definitions(radmon_bcor.x PRIVATE "_REAL8_") +target_link_libraries(radmon_bcor.x PRIVATE NetCDF::NetCDF_Fortran) +target_link_libraries(radmon_bcor.x PRIVATE MPI::MPI_Fortran) +target_link_libraries(radmon_bcor.x PRIVATE ncdiag::ncdiag) +target_link_libraries(radmon_bcor.x PRIVATE w3emc::w3emc_4) + +# Install executable targets +install(TARGETS radmon_bcor.x RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/util/Radiance_Monitor/nwprod/radmon_shared/sorc/verf_radtime.fd/CMakeLists.txt b/util/Radiance_Monitor/nwprod/radmon_shared/sorc/verf_radtime.fd/CMakeLists.txt index 9b24fd46..93c95185 100644 --- a/util/Radiance_Monitor/nwprod/radmon_shared/sorc/verf_radtime.fd/CMakeLists.txt +++ b/util/Radiance_Monitor/nwprod/radmon_shared/sorc/verf_radtime.fd/CMakeLists.txt @@ -1,14 +1,32 @@ -cmake_minimum_required(VERSION 3.16.1) - file(GLOB RADMON_TIME_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*90 ) - set(RADMON_TIME_Fortran_FLAGS "-fp-model strict -assume byterecl -convert big_endian -O3 -g -traceback -D_REAL8_ ") - set(Util_MODULE_DIR ${PROJECT_BINARY_DIR}/include/radmon_time ) - set_source_files_properties( ${RADMON_TIME_SRC} PROPERTIES COMPILE_FLAGS ${RADMON_TIME_Fortran_FLAGS} ) - add_executable(radmon_time.x ${RADMON_TIME_SRC} ) - set_target_properties( radmon_time.x PROPERTIES COMPILE_FLAGS ${RADMON_TIME_Fortran_FLAGS} ) - set_target_properties( radmon_time.x PROPERTIES Fortran_MODULE_DIRECTORY ${Util_MODULE_DIR} ) - include_directories( ${CORE_INCS} ${NCDIAG_INCS} ) - target_link_libraries( radmon_time.x ${W3NCO_4_LIBRARY} ${NCDIAG_LIBRARIES} ${NETCDF_Fortran_LIBRARIES} ${NETCDF_C_LIBRARIES} ${MPI_Fortran_LIBRARIES} ) - if(BUILD_W3NCO) - add_dependencies( radmon_time.x ${W3NCO_4_LIBRARY} ) - endif() +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fp-model strict -assume byterecl -convert big_endian") +elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fconvert=big-endian -ffree-line-length-0 -ffast-math -fno-second-underscore -frecord-marker=4") +endif() + +list(APPEND SRCS + bad_chan.f90 + bad_penalty.f90 + create_ctl_time.f90 + kinds.F90 + low_count.f90 + read_diag.f90 + sparsearr.f90 + time.f90 + valid.f90 +) + +add_executable(radmon_time.x ${SRCS}) +if(TARGET ncdiag) + add_dependencies(radmon_time.x ncdiag) +endif() + +target_compile_definitions(radmon_time.x PRIVATE "_REAL8_") +target_link_libraries(radmon_time.x PRIVATE NetCDF::NetCDF_Fortran) +target_link_libraries(radmon_time.x PRIVATE MPI::MPI_Fortran) +target_link_libraries(radmon_time.x PRIVATE ncdiag::ncdiag) +target_link_libraries(radmon_time.x PRIVATE w3emc::w3emc_4) + +# Install executable targets +install(TARGETS radmon_time.x RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})