Skip to content

Commit

Permalink
feature/cmake: This commit references #91.
Browse files Browse the repository at this point in the history
Add back 'find_package' calls to "CMakeLists.txt".

Change fortran instrinsic 'ALOG' to 'LOG' in "surface.F90".

Point to official version of esmf v8 on Dell.
  • Loading branch information
GeorgeGayno-NOAA committed Mar 17, 2020
1 parent cb887b6 commit 725dd1c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 20 deletions.
26 changes: 10 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,13 @@ if(NOT NETCDF)
list(APPEND CMAKE_PREFIX_PATH $ENV{NETCDF})
set(NETCDF $ENV{NETCDF})
endif()
endif()

find_package(MPI REQUIRED COMPONENTS Fortran)

if(NOT ESMFMKFILE)
if(NOT DEFINED ENV{ESMFMKFILE})
message(FATAL_ERROR "fatal error esfm not set")
else()
list(APPEND CMAKE_PREFIX_PATH $ENV{ESMFMKFILE})
set(ESMFMKFILE $ENV{ESMFMKFILE})
if(DEFINED_ENV{NETCDF_FORTRAN})
list(APPEND CMAKE_PREFIX_PATH $ENV{NETCDF_FORTRAN})
endif()
endif()

find_package(MPI REQUIRED COMPONENTS Fortran)
find_package(ESMF MODULE REQUIRED)
find_package(WGRIB2 REQUIRED)

if(OPENMP)
Expand All @@ -60,27 +54,27 @@ endif()
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG true)

if(NOT TARGET sfcio_4)
set(SFCIO_LIB4 $ENV{SFCIO_LIB4})
find_package(sfcio REQUIRED)
endif()

if(NOT TARGET w3nco_d)
set(W3NCO_LIBd $ENV{W3NCO_LIBd})
find_package(w3nco REQUIRED)
endif()

if(NOT TARGET bacio_4)
set(BACIO_LIB4 $ENV{BACIO_LIB4})
find_package(bacio REQUIRED)
endif()

if(NOT TARGET nemsio)
set(NEMSIO_LIB $ENV{NEMSIO_LIB})
find_package(nemsio REQUIRED)
endif()

if(NOT TARGET sigio_4)
set(SIGIO_LIB4 $ENV{SIGIO_LIB4})
find_package(sigio REQUIRED)
endif()

if(NOT TARGET sp_d)
set(SP_LIBd $ENV{SP_LIBd})
find_package(sp REQUIRED)
endif()

add_subdirectory(sorc)
Expand Down
5 changes: 3 additions & 2 deletions modulefiles/chgres_cube.wcoss_dell_p3
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@
module load ips/18.0.1.163
module load impi/18.0.1
module load NetCDF/4.5.0
# module load ESMF/7_1_0r
export ESMFMKFILE=/gpfs/dell2/emc/modeling/noscrub/George.Gayno/esmf_lib/8_0_0bs20/lib/libO/Linux.intel.64.intelmpi.default/esmf.mk
module load w3nco/2.0.6
module load sp/2.0.2
module load nemsio/2.2.3
module load bacio/2.0.2
module load sfcio/1.0.0
module load sigio/2.1.0

module use /gpfs/dell2/emc/modeling/noscrub/emc.nemspara/soft/modulefiles
module load esmf/8.0.0

export WGRIB2_ROOT=/u/Wesley.Ebisuzaki/home/grib2.v2.0.8.intel/lib
#export WGRIB2API_INC=/u/Wesley.Ebisuzaki/home/grib2.v2.0.8.intel/lib
#export WGRIB2_LIB=/u/Wesley.Ebisuzaki/home/grib2.v2.0.8.intel/lib/libwgrib2.a
Expand Down
4 changes: 2 additions & 2 deletions sorc/chgres_cube.fd/surface.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2345,8 +2345,8 @@ FUNCTION FRH2O (TKELV,SMC,SH2O,SMCMAX,BEXP,PSIS)
DO WHILE ( (NLOG .LT. 10) .AND. (KCOUNT .EQ. 0) )

NLOG = NLOG+1
DF = ALOG(( PSIS*GRAV/HLICE ) * ( ( 1.+CK*SWL )**2. ) * &
( SMCMAX/(SMC-SWL) )**BX) - ALOG(-(TKELV-frz_h2o)/TKELV)
DF = LOG(( PSIS*GRAV/HLICE ) * ( ( 1.+CK*SWL )**2. ) * &
( SMCMAX/(SMC-SWL) )**BX) - LOG(-(TKELV-frz_h2o)/TKELV)
DENOM = 2. * CK / ( 1.+CK*SWL ) + BX / ( SMC - SWL )
SWLK = SWL - DF/DENOM

Expand Down

0 comments on commit 725dd1c

Please sign in to comment.