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

Porting UFS-WM Noah-MP GSWP3 baseline to land DA workflow #32

Merged
merged 69 commits into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
5a22db7
update gitmodules
rhaesung Sep 15, 2023
cbab24f
update vector2tile
rhaesung Sep 15, 2023
3a1bd75
add template.tile2tile
rhaesung Sep 21, 2023
65d42a1
remove vector2tile submodule
rhaesung Sep 21, 2023
97309ba
delete template for vector2tile
rhaesung Sep 21, 2023
693e514
update .gitmodules
rhaesung Sep 21, 2023
602eba8
update CMakeLists.txt
rhaesung Sep 21, 2023
92f89d9
add tile2tile submodule
rhaesung Sep 21, 2023
7e3dc45
update submit_cycle.sh
rhaesung Sep 21, 2023
6fcd4d1
update DA_update
rhaesung Sep 21, 2023
2678691
update submit_cycle.sh
rhaesung Sep 21, 2023
55e2b89
Update Jenkinsfile adding sonarqube
zach1221 Oct 18, 2023
fd3c5cb
add jedi2ufs conversion feature
rhaesung Oct 24, 2023
1ba1ff5
add ufs2jedi and jedi2ufs tile conversion
rhaesung Oct 24, 2023
8a56f97
remove unnecessary templates
rhaesung Oct 24, 2023
6f79b50
add new tile2tile templates
rhaesung Oct 24, 2023
a33cea7
Merge branch 'feature/porting' of https://github.com/ufs-community/la…
rhaesung Oct 24, 2023
04b7afa
turn on the ufs-weather-model
rhaesung Oct 25, 2023
77e9c4b
add the UFS Noah MP run feature
rhaesung Nov 2, 2023
518c8f6
increse cpus per task from 1 to 2
rhaesung Nov 2, 2023
4436a2d
update the location of restart files in 'fv3_run'
rhaesung Nov 6, 2023
78f498a
increase cpus per tasks from 2 to 5
rhaesung Nov 6, 2023
6d4528a
add vector2tile submodule again
rhaesung Nov 9, 2023
2dc77eb
update CMakeLists.txt
rhaesung Nov 9, 2023
92afb17
add vec2tile again
rhaesung Nov 9, 2023
aef338c
adding the offline noah-mp feature with era5 forcing
rhaesung Nov 13, 2023
3f3a3b2
add vec2tile/tile2vec templates
rhaesung Nov 13, 2023
1786c93
add settings_DA_cycle_gswp3
rhaesung Nov 13, 2023
714728c
add back the offline noah-mp option with era5 forcing
rhaesung Nov 13, 2023
478d635
add the fake_observations
rhaesung Nov 14, 2023
1b51eea
update the gitmodules
rhaesung Nov 14, 2023
d094dd8
update do_subnit_cycle.sh
rhaesung Nov 14, 2023
b1c72bd
update settings for era5
rhaesung Nov 14, 2023
b225210
update settings for gswp3
rhaesung Nov 14, 2023
8787552
Read in customized UFS datm_cdeps_lnd_gswp3_rst RT script and add wri…
rhaesung Nov 14, 2023
b6eb14f
update file names from nems to ufs
rhaesung Nov 15, 2023
1980229
revert to the default offline-noahmp/era5 setting
rhaesung Nov 15, 2023
07fb73a
Update Jenkinsfile jenkins workspace
zach1221 Nov 15, 2023
bd4298a
remove tile2tile submodule
rhaesung Nov 15, 2023
822b8ab
Merge branch 'feature/porting' of https://github.com/ufs-community/la…
rhaesung Nov 15, 2023
605b71a
update the RT path on Orion
rhaesung Nov 17, 2023
a2a1023
update the GHCN path
rhaesung Nov 18, 2023
a24962a
Update landda_orion.intel.lua
jkbk2004 Nov 20, 2023
599258f
change the RT path of Orion.
rhaesung Nov 21, 2023
cc75570
Create orion_ctest.sh
zach1221 Nov 21, 2023
bc598fd
Update Jenkinsfile to add orion
zach1221 Nov 21, 2023
4f659c8
Rename run_ctest.sh to run_hera_ctest.sh
zach1221 Nov 21, 2023
4546ff3
Create run_orion_ctest.sh
zach1221 Nov 21, 2023
3faea14
Delete test/testinput/run_orion_ctest.sh
zach1221 Nov 21, 2023
7a146e9
Create run_orion_ctest.sh
zach1221 Nov 21, 2023
5d177e4
Update Jenkinsfile add orion scripts
zach1221 Nov 21, 2023
9045da9
Update Jenkinsfile
zach1221 Nov 21, 2023
59d0c04
Update Jenkinsfile
zach1221 Nov 21, 2023
5d70a7f
add mchine_id option in setting
rhaesung Nov 21, 2023
fe3d9b8
clean up the machine_ID
rhaesung Nov 21, 2023
672b1da
clean up
rhaesung Nov 21, 2023
1f23540
Merge branch 'feature/porting' of https://github.com/ufs-community/la…
rhaesung Nov 21, 2023
e4b8537
Update run_orion_ctest.sh fix orion account
zach1221 Nov 21, 2023
b3908b6
add datm_cdeps_lnd_gswp3_rst file in the cycle directory
rhaesung Nov 21, 2023
d1ac907
clean up
rhaesung Nov 21, 2023
dce0a04
Merge branch 'feature/porting' of https://github.com/ufs-community/la…
rhaesung Nov 21, 2023
ff665b4
adding back the machine_ID for ctest
rhaesung Nov 21, 2023
3723353
Update Jenkinsfile
zach1221 Nov 21, 2023
3c74eec
orion_ctest.sh permissions
zach1221 Nov 21, 2023
f16ac05
run_orion_ctest.sh permissions
zach1221 Nov 21, 2023
0bd3c33
Update run_orion_ctest.sh
zach1221 Nov 21, 2023
6411436
Update run_orion_ctest.sh
zach1221 Nov 22, 2023
59f3064
Update Jenkinsfile
zach1221 Nov 22, 2023
ea623d9
remove README for tile2tile
rhaesung Nov 22, 2023
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
8 changes: 4 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
path = DA_update
url = https://github.com/ufs-community/land-DA.git
branch = develop
[submodule "vector2tile"]
path = vector2tile
url = https://github.com/NOAA-PSL/land-vector2tile.git
branch = develop
[submodule "tile2tile"]
path = tile2tile
url = https://github.com/rhaesung/land-tile2tile.git
branch = feature/porting
22 changes: 11 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@ include_directories( ${NETCDF_INCLUDE_DIRS} )
################################################################################
set( LANDDA_LINKER_LANGUAGE CXX)

ExternalProject_Add(ufs-weather-model
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/ufs-weather-model
GIT_REPOSITORY https://github.com/ufs-community/ufs-weather-model
GIT_SUBMODULES_RECURSE TRUE
GIT_TAG develop
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ufs-weather-model
CMAKE_ARGS ${SOURCE_DIR} -DAPP=LND -DMPI=ON -DCMAKE_BUILD_TYPE=Release
INSTALL_COMMAND cmake
)

add_subdirectory( vector2tile )
#ExternalProject_Add(ufs-weather-model
jkbk2004 marked this conversation as resolved.
Show resolved Hide resolved
# PREFIX ${CMAKE_CURRENT_BINARY_DIR}/ufs-weather-model
# GIT_REPOSITORY https://github.com/ufs-community/ufs-weather-model
# GIT_SUBMODULES_RECURSE TRUE
# GIT_TAG develop
# SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ufs-weather-model
# CMAKE_ARGS ${SOURCE_DIR} -DAPP=LND -DMPI=ON -DCMAKE_BUILD_TYPE=Release
# INSTALL_COMMAND cmake
# )

add_subdirectory( tile2tile )
add_subdirectory( ufs-land-driver-emc-dev )
add_subdirectory( DA_update/add_jedi_incr )

Expand Down
2 changes: 1 addition & 1 deletion DA_update
Submodule DA_update updated 1 files
+3 −0 do_landDA.sh
17 changes: 10 additions & 7 deletions do_submit_cycle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ fi
############################
# set executables

if [[ -e ${BUILDDIR}/bin/vector2tile_converter.exe ]]; then #prefer cmake-built executables
export vec2tileexec=${BUILDDIR}/bin/vector2tile_converter.exe
if [[ -e ${BUILDDIR}/bin/tile2tile_converter.exe ]]; then #prefer cmake-built executables
export tile2tileexec=${BUILDDIR}/bin/tile2tile_converter.exe
else
export vec2tileexec=${CYCLEDIR}/vector2tile/vector2tile_converter.exe
export tile2tileexec=${CYCLEDIR}/tile2tile/tile2tile_converter.exe
fi
if [[ -e ${BUILDDIR}/bin/ufsLand.exe ]]; then
export LSMexec=${BUILDDIR}/bin/ufsLand.exe
Expand Down Expand Up @@ -154,10 +154,12 @@ fi
ln -sf ${MEM_MODL_OUTDIR}/noahmp ${MEM_WORKDIR}/noahmp_output

# copy ICS into restarts, if needed
rst_out=${MEM_MODL_OUTDIR}/restarts/vector/ufs_land_restart_back.${sYYYY}-${sMM}-${sDD}_${sHH}-00-00.nc
rst_in=${LANDDA_INPUTS}/restarts/${atmos_forc}/ufs_land_restart.${sYYYY}-${sMM}-${sDD}_${sHH}-00-00.nc
for tile in 1 2 3 4 5 6
do
rst_out=${MEM_MODL_OUTDIR}/restarts/tile/ufs_land_restart_back.${sYYYY}-${sMM}-${sDD}_${sHH}-00-00.tile${tile}.nc
rst_in=${LANDDA_INPUTS}/restarts/${atmos_forc}/ufs_land_restart.${sYYYY}-${sMM}-${sDD}_${sHH}-00-00.tile${tile}.nc
# if restart not in experiment out directory, copy the restarts from the ICSDIR
if [[ ! -e ${rst_out} ]]; then
if [[ ! -e ${rst_out} ]]; then
echo "Looking for ICS: ${rst_in}"
if [[ -e ${rst_in} ]]; then
echo "ICS found, copying"
Expand All @@ -166,7 +168,8 @@ if [[ ! -e ${rst_out} ]]; then
echo "ICS not found. Exiting"
exit 10
fi
fi
fi
done

# create dates file
touch analdates.sh
Expand Down
66 changes: 34 additions & 32 deletions submit_cycle.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
#SBATCH --job-name=offline_noahmp
#SBATCH --account=da-cpu
#SBATCH --account=epic
#SBATCH --qos=debug
#SBATCH --nodes=1
#SBATCH --tasks-per-node=6
Expand Down Expand Up @@ -58,7 +58,7 @@ while [ $date_count -lt $cycles_per_job ]; do
nHH=`echo $NEXTDATE | cut -c9-10`

############################
# copy restarts to workdir, convert to vector for DA (all members)
# copy restarts to workdir, convert to UFS tile for DA (all members)

mem_ens="mem000"

Expand All @@ -67,46 +67,47 @@ while [ $date_count -lt $cycles_per_job ]; do

cd $MEM_WORKDIR
# copy restarts into work directory
rst_in=${MEM_MODL_OUTDIR}/restarts/vector/ufs_land_restart_back.${YYYY}-${MM}-${DD}_${HH}-00-00.nc
if [[ ! -e ${rst_in} ]]; then
rst_in=${LANDDA_INPUTS}/restarts/${atmos_forc}/ufs_land_restart.${YYYY}-${MM}-${DD}_${HH}-00-00.nc

for tile in 1 2 3 4 5 6
do
rst_in=${MEM_MODL_OUTDIR}/restarts/tile/ufs_land_restart_back.${YYYY}-${MM}-${DD}_${HH}-00-00.tile${tile}.nc
if [[ ! -e ${rst_in} ]]; then
rst_in=${LANDDA_INPUTS}/restarts/${atmos_forc}/ufs_land_restart.${YYYY}-${MM}-${DD}_${HH}-00-00.tile${tile}.nc
fi
rst_out=${MEM_WORKDIR}/ufs_land_restart.${YYYY}-${MM}-${DD}_${HH}-00-00.nc
rst_out=${MEM_WORKDIR}/ufs_land_restart.${YYYY}-${MM}-${DD}_${HH}-00-00.tile${tile}.nc
cp ${rst_in} ${rst_out}
done

if [[ $do_jedi == "YES" ]]; then
echo '************************************************'
echo 'calling tile2vector'

export MEM_WORKDIR

# update vec2tile and tile2vec namelists
cp ${CYCLEDIR}/template.vector2tile vector2tile.namelist

sed -i "s|LANDDA_INPUTS|${LANDDA_INPUTS}|g" vector2tile.namelist
sed -i -e "s/XXYYYY/${YYYY}/g" vector2tile.namelist
sed -i -e "s/XXMM/${MM}/g" vector2tile.namelist
sed -i -e "s/XXDD/${DD}/g" vector2tile.namelist
sed -i -e "s/XXHH/${HH}/g" vector2tile.namelist
sed -i -e "s/XXHH/${HH}/g" vector2tile.namelist
sed -i -e "s/MODEL_FORCING/${atmos_forc}/g" vector2tile.namelist
sed -i -e "s/XXRES/${RES}/g" vector2tile.namelist
sed -i -e "s/XXTSTUB/${TSTUB}/g" vector2tile.namelist
sed -i -e "s#XXTPATH#${TPATH}#g" vector2tile.namelist

# submit vec2tile
# update tile2tile namelist
cp ${CYCLEDIR}/template.tile2tile tile2tile.namelist

sed -i "s|LANDDA_INPUTS|${LANDDA_INPUTS}|g" tile2tile.namelist
sed -i -e "s/XXYYYY/${YYYY}/g" tile2tile.namelist
sed -i -e "s/XXMM/${MM}/g" tile2tile.namelist
sed -i -e "s/XXDD/${DD}/g" tile2tile.namelist
sed -i -e "s/XXHH/${HH}/g" tile2tile.namelist
sed -i -e "s/XXHH/${HH}/g" tile2tile.namelist
sed -i -e "s/MODEL_FORCING/${atmos_forc}/g" tile2tile.namelist
sed -i -e "s/XXRES/${RES}/g" tile2tile.namelist
sed -i -e "s/XXTSTUB/${TSTUB}/g" tile2tile.namelist
sed -i -e "s#XXTPATH#${TPATH}#g" tile2tile.namelist

# submit tile2tile
echo '************************************************'
echo 'calling vector2tile'
echo 'calling tile2tile'

if [[ $BASELINE =~ 'hera.internal' ]]; then
source ${CYCLEDIR}/land_mods
fi
$vec2tileexec vector2tile.namelist
$tile2tileexec tile2tile.namelist
if [[ $? != 0 ]]; then
echo "vec2tile failed"
echo "tile2tile failed"
exit
fi
fi # vector2tile for DA
fi # tile2tile for DA

############################
# do DA update
Expand All @@ -126,9 +127,10 @@ while [ $date_count -lt $cycles_per_job ]; do
exit
fi
fi


exit
############################
# convert back to vector, run model (all members) convert back to vector, run model (all members)
# convert back to UFS tile, run model (all members)

mem_ens="mem000"

Expand All @@ -139,7 +141,7 @@ while [ $date_count -lt $cycles_per_job ]; do

if [[ $do_jedi == "YES" ]]; then
echo '************************************************'
echo 'calling tile2vector'
echo 'calling tile2tile'

if [[ $BASELINE =~ 'hera.internal' ]]; then
source ${CYCLEDIR}/land_mods
Expand Down
6 changes: 3 additions & 3 deletions template.vector2tile → template.tile2tile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
! Direction of conversion: either "vector2tile" or "tile2vector" for restart file
! "lndp2tile" or "lndp2vector" for perturbation

direction = "vector2tile"
direction = "ufs2jedi"

! FV3 resolution and path to oro files for restart/perturbation conversion

Expand All @@ -26,8 +26,8 @@

! Location of tile restart files (tile2vector direction)

tile_restart_path = "junk"

! tile_restart_path = "junk"
tile_restart_path = "./"
! Path for converted files; if same as tile/vector path, files may be overwritten

output_path = "./"
Expand Down
4 changes: 4 additions & 0 deletions tile2tile/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
vector2tile_converter.exe
vector2tile_converter.o
*.mod
*.o
75 changes: 75 additions & 0 deletions tile2tile/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# (C) Copyright 2022 .
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.


cmake_minimum_required( VERSION 3.12)
project( tile2tile 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( tile2tile_compiler_flags )

################################################################################
# Dependencies
################################################################################

find_package(OpenMP COMPONENTS C Fortran)
find_package(MPI REQUIRED COMPONENTS C Fortran)
find_package(NetCDF REQUIRED COMPONENTS Fortran )

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

set( TILE2TILE_LINKER_LANGUAGE Fortran )

list ( APPEND src_files
./namelist_mod.f90
./tile2tile_restart_mod.f90
)

ecbuild_add_library( TARGET tile2tile
SOURCES ${src_files}
INSTALL_HEADERS LISTED
LINKER_LANGUAGE ${TILE2TILE_LINKER_LANGUAGE}
)


target_link_libraries(tile2tile PUBLIC NetCDF::NetCDF_Fortran)
target_link_libraries(tile2tile PUBLIC MPI::MPI_Fortran)
target_link_libraries(tile2tile PUBLIC OpenMP::OpenMP_C OpenMP::OpenMP_Fortran)

# Fortran module output directory for build and install interfaces
set(MODULE_DIR module/${PROJECT_NAME}/${CMAKE_Fortran_COMPILER_ID}/${CMAKE_Fortran_COMPILER_VERSION})
set_target_properties(${PROJECT_NAME} PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/${MODULE_DIR})
install(DIRECTORY ${CMAKE_BINARY_DIR}/${MODULE_DIR}/ DESTINATION ${MODULE_DIR})
target_include_directories(${PROJECT_NAME} INTERFACE
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/${MODULE_DIR}>
$<INSTALL_INTERFACE:${MODULE_DIR}>)

set( TILE2TILE_INCLUDE_DIRS ${CMAKE_Fortran_MODULE_DIRECTORY} )
set( TILE2TILE_LIBRARIES tile2tile )

# tile2tile_converter.exe executable
#-------------------------------------------------------------------------------
set ( exe_files tile2tile_driver.f90 )

ecbuild_add_executable( TARGET tile2tile_converter.exe
SOURCES ${exe_files}
LIBS tile2tile
LINKER_LANGUAGE ${TILE2TILE_LINKER_LANGUAGE}
)


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

ecbuild_install_project( NAME tile2tile )
ecbuild_print_summary()
24 changes: 24 additions & 0 deletions tile2tile/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Makefile
#
.SUFFIXES:
.SUFFIXES: .o .f90

include ./user_build_config

OBJS = namelist_mod.o vector2tile_restart_mod.o vector2tile_perturbation_mod.o vector2tile_driver.o

all: vector2tile_converter.exe

.f90.o:
$(COMPILERF90) -c $(F90FLAGS) $(FREESOURCE) $(NETCDFMOD) $(*).f90

vector2tile_converter.exe: $(OBJS)
$(COMPILERF90) -o $(@) $(F90FLAGS) $(FREESOURCE) $(NETCDFMOD) $(OBJS) $(NETCDFLIB)

clean:
rm -f *.o *.mod *.exe


#
# Dependencies:
#
30 changes: 30 additions & 0 deletions tile2tile/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Code to map between vector format used by the Noah-MP offline driver, and the tile format used by the UFS atmospheric model. Currently used to prepare input tile files for JEDI. These files include only those fields required by JEDI, rather than the full restart. Can also be used to map stochastic_physics output to the tile or vector. Stochastic physics output files depend on the layout, with 1x1 layout giving one file per tile.
jkbk2004 marked this conversation as resolved.
Show resolved Hide resolved

Mike Barlage, Clara Draper. Dec 2021.

To compile on hera:

>configure

choose hera

load the modules indicated

>make

To run:

>vector2tile_converter.exe namelist.vector2tile

the namelist defines the conversion direction and the paths of the files

Details:

the vector2tile pathway assumes that the vector file exists in the vector_restart_path directory and overwrites/creates tile files in the output_path

the tile2vector pathway is a little tricky, it assumes the tile files exist in tile_restart_path and overwrites only the snow variables in the vector file in the output_path. If the vector file does not exist in output_path the process will fail.

the overall assumption here is that we will have a full model vector restart file, then convert the vector to tiles for only snow variables, then convert the updated snow variables back to the full vector restart file

For the lndp2vector or lndp2tile option, a new file will be created with the pertbations and lat lon only.

Loading