Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add VIIRS SCF processing capability and merge with current IMS_proc #7

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 20 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@


cmake_minimum_required( VERSION 3.12)
project( imsproc VERSION 2022.10 LANGUAGES Fortran )
project( scfproc VERSION 2022.10 LANGUAGES Fortran )

# ecbuild integration
find_package(ecbuild 3.3.2 REQUIRED)
include( ecbuild_system NO_POLICY_SCOPE )
ecbuild_declare_project()

list( APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include( imsproc_compiler_flags )
include( scfproc_compiler_flags )

################################################################################
# Dependencies
Expand All @@ -22,31 +22,33 @@ include( imsproc_compiler_flags )
find_package(OpenMP COMPONENTS C Fortran)
find_package(MPI REQUIRED COMPONENTS C Fortran)
find_package(NetCDF REQUIRED COMPONENTS Fortran )
find_package(HDF5 REQUIRED COMPONENTS Fortran)

################################################################################
# Sources
################################################################################

#add_definitions ( -DCPP=0 )

set( IMSPROC_LINKER_LANGUAGE Fortran )
set( SCFPROC_LINKER_LANGUAGE Fortran )

list ( APPEND sorc_files
./sorc/IMSaggregate_mod.f90
./sorc/aggregate_mod.f90
yuanxue2870 marked this conversation as resolved.
Show resolved Hide resolved
)

ecbuild_add_library( TARGET imsproc
ecbuild_add_library( TARGET scfproc
SOURCES ${sorc_files}
INSTALL_HEADERS LISTED
LINKER_LANGUAGE ${IMSPROC_LINKER_LANGUAGE}
LINKER_LANGUAGE ${SCFPROC_LINKER_LANGUAGE}
)


target_link_libraries(imsproc PUBLIC NetCDF::NetCDF_Fortran)
target_link_libraries(imsproc PUBLIC MPI::MPI_Fortran)
target_link_libraries(imsproc PUBLIC OpenMP::OpenMP_C OpenMP::OpenMP_Fortran)
target_link_libraries(scfproc PUBLIC NetCDF::NetCDF_Fortran)
target_link_libraries(scfproc PUBLIC HDF5::HDF5)
target_link_libraries(scfproc PUBLIC MPI::MPI_Fortran)
target_link_libraries(scfproc PUBLIC OpenMP::OpenMP_C OpenMP::OpenMP_Fortran)

#target_compile_options(imsproc PRIVATE -r8 -init=huge -cpp, -DCCPP=.false. )
#target_compile_options(scfproc PRIVATE -r8 -init=huge -cpp, -DCCPP=.false. )

# Fortran module output directory for build and install interfaces
set(MODULE_DIR module/${PROJECT_NAME}/${CMAKE_Fortran_COMPILER_ID}/${CMAKE_Fortran_COMPILER_VERSION})
Expand All @@ -56,23 +58,23 @@ target_include_directories(${PROJECT_NAME} INTERFACE
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/${MODULE_DIR}>
$<INSTALL_INTERFACE:${MODULE_DIR}>)

set( IMSPROC_INCLUDE_DIRS ${CMAKE_Fortran_MODULE_DIRECTORY} )
set( IMSPROC_LIBRARIES imsproc )
set( SCFPROC_INCLUDE_DIRS ${CMAKE_Fortran_MODULE_DIRECTORY} )
set( SCFPROC_LIBRARIES scfproc )

# calcfIMS.exe executable
# calcfSCF.exe executable
#-------------------------------------------------------------------------------
set ( exe_files ./sorc/driver_fIMS.f90 )
set ( exe_files ./sorc/driver_fSCF.f90 )

ecbuild_add_executable( TARGET calcfIMS.exe
ecbuild_add_executable( TARGET calcfSCF.exe
SOURCES ${exe_files}
LIBS imsproc
LINKER_LANGUAGE ${IMSPROC_LINKER_LANGUAGE}
LIBS scfproc
LINKER_LANGUAGE ${SCFPROC_LINKER_LANGUAGE}
)


################################################################################
# Finalise configuration
################################################################################

ecbuild_install_project( NAME imsproc )
ecbuild_install_project( NAME scfproc )
ecbuild_print_summary()
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
Code for processing IMS input ascii files on the UFS model grid.
Code for processing IMS or VIIRS (based on user selection) input files on the UFS model grid.

Inputs: IMS ascii file, IMS index file (generated offline).
IMS index file is model resolution specific.
VIIRS h5 file, VIIRS index file (generated offline).
VIIRS index file is model resolution specific.

Output: file with i) IMS-derived snow cover fraction over land on UFS model grid, and ii) snow depth derived form the IMS snow cover fraction, using an inversion of the noah model snow depletion curve.
Output: file with i) IMS(VIIRS)-derived snow cover fraction over land on UFS model grid, and ii) snow depth derived form the IMS(VIIRS) snow cover fraction, using an inversion of the noah model snow depletion curve.


To compile:
ln -s $your_GDAS_App_installation**
./build.sh
To compile:
1.ln -s $your_GDAS_App_installation*
2 ./build.sh
On hera, can use:
*/scratch2/NCEPDEV/land/data/DA/GDASApp

On hera, can use:

**/scratch2/NCEPDEV/land/data/DA/GDASApp

See ./test for test case (hera only).
See ./test for test case (hera only)

Clara Draper, Tseganeh Gichamo, with input from Youlong Xia. June, 2021.
Yuan Xue: add VIIRS processing capability and merge with original IMS'. July 2024.

yuanxue2870 marked this conversation as resolved.
Show resolved Hide resolved

2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if [ $# == 1 ]; then
env_file=$1
else
# assume installed a subdir of DA_update
env_file="../env_GDASApp"
env_file="env_GDASApp"
yuanxue2870 marked this conversation as resolved.
Show resolved Hide resolved
fi
source $env_file

Expand Down
File renamed without changes.
12 changes: 6 additions & 6 deletions sorc/Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
SHELL= /bin/ksh
FC =$(FCMP)
LIBS =$(LIBSM)
OBJS =driver_fIMS.o IMSaggregate_mod.o
OBJS =driver_fSCF.o aggregate_mod.o

CMD =calcfIMS
CMD =calcfSCF
$(CMD): $(OBJS)
${FC} $(FFLAGS) $(OBJS) $(LIBS) -o $(CMD)

IMSaggregate_mod.o: IMSaggregate_mod.f90
$(FC) $(FFLAGS) -c IMSaggregate_mod.f90
aggregate_mod.o: aggregate_mod.f90
$(FC) $(FFLAGS) -c aggregate_mod.f90

driver_fIMS.o: IMSaggregate_mod.o driver_fIMS.f90
$(FC) $(FFLAGS) -c driver_fIMS.f90
driver_fSCF.o: aggregate_mod.o driver_fSCF.f90
$(FC) $(FFLAGS) -c driver_fSCF.f90
yuanxue2870 marked this conversation as resolved.
Show resolved Hide resolved

install:
-cp -p $(CMD) ../exec/.
Expand Down
Loading