Skip to content

Commit

Permalink
GitHub Issue NOAA-EMC/GSI#368. WCOSS2 port.
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelLueken committed May 3, 2022
1 parent 5e056ea commit e7924dd
Show file tree
Hide file tree
Showing 27 changed files with 207 additions and 92 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.6)
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 )
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.6)
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 )
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.6)
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 )
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 3.16.1)

file(GLOB CONMON_GRADS_SFCTIME_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*90 )

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.6)
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 )
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.6)
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 )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export p_cyc=`echo ${cdate} | cut -c9-10`
#############################################
# TANKverf - WHERE OUTPUT DATA WILL RESIDE
#############################################
export COM_IN=${COM_IN:-${COMROOT}/${NET}/${envir}}
export COM_IN=${COM_IN:-$(compath.py ${envir}/${NET}/${gfs_ver})}

export M_TANKverf=${M_TANKverf:-${COM_IN}/${RUN}.${PDY}/${cyc}/${COMPONENT}/minmon}
export M_TANKverfM1=${M_TANKverfM1:-${COM_IN}/${RUN}.${P_PDY}/${p_cyc}/${COMPONENT}/minmon}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export p_cyc=`echo ${cdate} | cut -c9-10`
#############################################
# TANKverf - WHERE OUTPUT DATA WILL RESIDE
#############################################
export COM_IN=${COM_IN:-${COMROOT}/${NET}/${envir}}
export COM_IN=${COM_IN:-$(compath.py ${envir}/${NET}/${gfs_ver})}

M_TANKverf=${M_TANKverf:-${COM_IN}/${RUN}.${PDY}/${cyc}/${COMPONENT}/minmon}
export M_TANKverfM1=${M_TANKverfM1:-${COM_IN}/${RUN}.${P_PDY}/${p_cyc}/${COMPONENT}/minmon}
Expand Down
1 change: 1 addition & 0 deletions util/Ozone_Monitor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
endif()

cmake_policy(SET CMP0009 NEW)
cmake_policy(SET CMP0074 NEW)
find_package(OpenMP)
message("found openmp with flag ${OPENMP_Fortran_FLAGS}")

Expand Down
102 changes: 57 additions & 45 deletions util/Ozone_Monitor/OznMon_install.pl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
my $machine = `/usr/bin/perl get_hostname.pl`;
my $my_machine="export MY_MACHINE=$machine";

if( $machine ne "wcoss_c" && $machine ne "hera" && $machine ne "wcoss_d" ) {
if( $machine ne "wcoss_c" && $machine ne "hera" && $machine ne "wcoss_d" &&
$machine ne "wcoss2" ) {
die( "ERROR --- Unrecognized machine hostname, $machine. Exiting now...\n" );
}
else {
Expand Down Expand Up @@ -62,6 +63,9 @@
elsif( $machine eq "wcoss_c" ){
$tankdir = "/gpfs/hps/emc/da/noscrub/$user_name/nbns";
}
elsif( $machine eq "wcoss2" ){
$tankdir = "/lfs/h2/emc/da/noscrub/$user_name/nbns";
}
else {
$tankdir = "/global/save/$user_name/nbns";
}
Expand Down Expand Up @@ -209,6 +213,10 @@
$my_ptmp="export OZN_PTMP=\${OZN_PTMP:-/gpfs/hps2/ptmp}";
$my_stmp="export OZN_STMP=\${OZN_STMP:-/gpfs/hps2/stmp}";
}
elsif( $machine eq "wcoss2" ){
$my_ptmp="export MY_PTMP=\${MY_PTMP:-/lfs/h2/emc/ptmp}";
$my_stmp="export MY_STMP=\${MY_STMP:-/lfs/h2/emc/stmp}";
}
elsif( $machine eq "hera" ){
$ptmp = "/scratch2/NCEPDEV/stmp3";

Expand Down Expand Up @@ -325,61 +333,65 @@
print "\n";
print "Updating parm/OznMon_user_settings\n";

my $account = "export ACCOUNT=\${ACCOUNT:-fv3-cpu}";
if( $machine ne "theia" && $machine ne "hera" ) {
$account = "export ACCOUNT=\${ACCOUNT:-}";
my $account = "export ACCOUNT=\${ACCOUNT:-}";
if( $machine eq "hera" ) {
$account = "export ACCOUNT=\${ACCOUNT:-fv3-cpu}";
} elsif( $machine eq "wcoss2" ){
$account = "export ACCOUNT=\${ACCOUNT:-GFS-DEV}";
}

my $project = "export PROJECT=\${PROJECT:-GFS-DEV}";
if( $machine ne "wcoss_c" && $machine ne "wcoss_d" ) {
my $project = "export PROJECT=\${PROJECT:-GDAS-T2O}";
if( $machine eq "wcoss2" ){
$project = "export PROJECT=\${PROJECT:-GDAS-DEV}";
} elsif( $machine ne "wcoss_c" && $machine ne "wcoss_d" ) {
$project="export PROJECT=";
}
}

my $job_queue="export JOB_QUEUE=";
if( $machine eq "wcoss_c" ) {
if( $machine eq "wcoss_c" || $machine eq "wcoss2" ) {
$job_queue="export JOB_QUEUE=\${JOB_QUEUE:-dev}";
} elsif( $machine eq "wcoss" || $machine eq "wcoss_d" ){
$job_queue = "export JOB_QUEUE=\${JOB_QUEUE:-dev_shared}";
}


my $uname = $ENV{ 'USER' };
my $hpss_dir = "export HPSS_DIR=\${HPSS_DIR:-/NCEPDEV/hpssuser/g01/$uname/nbns/stats}";

my $outfile = "tmp.file";
open (OUT, ">", $outfile) || die "Cannot open file ".$outfile." for write";

my $infile = "./parm/OznMon_user_settings";
open (IN, "<", $infile) || die "Cannot open file ".$infile." for read";

foreach $line (<IN>) {
chomp( $line );
if ($line =~ m/export ACCOUNT/) {
$line = $account;
}
elsif( $line =~ m/export PROJECT/ ){
$line = $project;
}
elsif( $line =~ m/export JOB_QUEUE/ ){
$line = $job_queue;
}
elsif( $line =~ m/export HPSS_DIR/ ){
$line = $hpss_dir;
}
elsif( $line =~ m/export DO_DATA_RPT/ ){
$line = $my_rpt;
}
print OUT "$line\n";
}
close OUT;
close IN;

move $outfile, $infile;

print "\n";
print "Making all executables\n";

`./build_OznMon_cmake.sh`;
my $uname = $ENV{ 'USER' };
my $hpss_dir = "export HPSS_DIR=\${HPSS_DIR:-/NCEPDEV/hpssuser/g01/$uname/nbns/stats}";

my $outfile = "tmp.file";
open (OUT, ">", $outfile) || die "Cannot open file ".$outfile." for write";

my $infile = "./parm/OznMon_user_settings";
open (IN, "<", $infile) || die "Cannot open file ".$infile." for read";

foreach $line (<IN>) {
chomp( $line );
if ($line =~ m/export ACCOUNT/) {
$line = $account;
}
elsif( $line =~ m/export PROJECT/ ){
$line = $project;
}
elsif( $line =~ m/export JOB_QUEUE/ ){
$line = $job_queue;
}
elsif( $line =~ m/export HPSS_DIR/ ){
$line = $hpss_dir;
}
elsif( $line =~ m/export DO_DATA_RPT/ ){
$line = $my_rpt;
}
print OUT "$line\n";
}
close OUT;
close IN;

move $outfile, $infile;

print "\n";
print "Making all executables\n";

`./build_OznMon_cmake.sh`;


exit 0;
Expand Down
12 changes: 8 additions & 4 deletions util/Ozone_Monitor/build_OznMon_cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ elif [[ -d /data/prod ]]; then
elif [[ -d /jetmon ]]; then
. /apps/lmod/lmod/init/sh
target=jet
elif [[ -d /lfs && -d /dfs ]]; then
. $MODULESHOME/init/bash
target=wcoss2
else
echo "unknown target = $target"
exit 9
Expand All @@ -69,17 +72,18 @@ fi
# Verify this is a supported machine
#---------------------------------------------------

if [[ ${target} = "hera" || ${target} = "wcoss_c" \
|| ${target} = "wcoss_d" || ${target} = "orion" \
|| ${target} = "jet" || ${target} = "s4" ]]; then
if [[ ${target} = "hera" || ${target} = "wcoss_c" \
|| ${target} = "wcoss_d" || ${target} = "orion" \
|| ${target} = "jet" || ${target} = "s4" \
|| ${target} = "wcoss2" ]]; then
echo Building nwprod executables on ${target}
echo


#-------------------------------------
# load modules
#-------------------------------------
if [ $target = wcoss_d ]; then
if [ $target = wcoss_d -o $target = wcoss2 ]; then
module purge
module use -a $dir_modules
module load modulefile.ProdGSI.$target
Expand Down
3 changes: 3 additions & 0 deletions util/Ozone_Monitor/get_hostname.pl
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
if( $host =~ /hfe/ ) {
$machine = "hera";
}
elsif( $host =~ /clogin0/ || $host =~ /dlogin0/ ){
$machine = "wcoss2"
}
elsif( $host =~ /login/ ) {
$machine = "wcoss_c";
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
#!/bin/ksh
#PBS -o gdas_voznmon.out
#PBS -e gdas_voznmon.err
#PBS -N gdas_voznmon
#PBS -q dev
#PBS -l select=1:mem=5000M
#PBS -l walltime=5:00
#PBS -A GFS-DEV

set -ax

##------------------------------------------------------------
## This is the test driver script for the wcoss2 systems
## to run the JGDAS_ATMOS_VERFOZN job.
##------------------------------------------------------------

export OZNMON_NEW_HDR=${OZN_NEW_HDR:-0}

#-------------------------------------------------------------
# PDATE settings for this test driver script correspond to
# available data in the $DATAROOT space (defined below).
# References to netcdf and binary indicate available files in
# the test_data space.
#
export PDATE=${PDATE:-2021082400}
export NET=${NET:-gfs}
export RUN=${RUN:-gdas}

export PDY=`echo $PDATE | cut -c1-8`
export cyc=`echo $PDATE | cut -c9-10`
export job=gdas_verfozn.${cyc}
export pid=${pid:-$$}
export jobid=${job}.${pid}
export envir=${envir:-test}
export DATAROOT=/lfs/h1/ops/canned/com/gfs/v16.2
export COMROOT=/lfs/h2/emc/ptmp/${LOGNAME}
export OZN_WORK_DIR=${OZN_WORK_DIR:-/lfs/h2/emc/stmp/${LOGNAME}/oznmon.${pid}}
export DATA=/lfs/h2/emc/stmp/${LOGNAME}/${RADMON_SUFFIX}

if [[ ! -d ${COMROOT}/logs/jlogfiles ]]; then
mkdir -p ${COMROOT}/logs/jlogfiles
fi

#------------------------------------------------------------
# Specify versions
#
export gdas_oznmon_ver=v2.0.0
export oznmon_shared_ver=v2.0.0


#------------------------------------------------------------
# Load modules
#
module purge
module load prod_util/2.0.10
module load util_shared/1.4.0

module list

#------------------------------------------------------------
# Set user specific variables
#
export OZNMON_SUFFIX=${OZNMON_SUFFIX:-testozn}
export NWTEST=${NWTEST:-/lfs/h2/emc/da/noscrub/Edward.Safford/git/gsi/gfsda.v16.1.5_wcoss2_port/util/Ozone_Monitor/nwprod}
export HOMEgfs=${HOMEgfs:-${NWTEST}/gdas_oznmon.${gdas_oznmon_ver}}
export HOMEgdas_ozn=${HOMEgdas_ozn:-${HOMEgfs}}
export PARMgdas_ozn=${HOMEgdas_ozn}/parm
export FIXgdas_ozn=${FIXgdas_ozn:-${HOMEgdas_ozn}/fix}


export HOMEgfs_ozn=${HOMEgfs_ozn:-${HOMEgdas_ozn}}
export PARMgfs_ozn=${PARMgfs_ozn:-${PARMgdas_ozn}}
export FIXgfs_ozn=${FIXgfs_ozn:-${FIXgdas_ozn}}

export JOBGLOBAL=${JOBGLOBAL:-${HOMEgdas_ozn}/jobs}
export HOMEoznmon=${HOMEoznmon:-${NWTEST}/oznmon_shared.${shared_oznmon_ver}}

export HOMEoznmon=${NWTEST}/oznmon_shared.${oznmon_shared_ver}
export COM_IN=${COM_IN:-$DATAROOT}
export OZN_TANKDIR=${OZN_TANKDIR:-${COMROOT}/${OZNMON_SUFFIX}}


#------------------------------------------------------------
# Execute job
#
${JOBGLOBAL}/JGDAS_ATMOS_VERFOZN

exit

Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ export p_cyc=`echo ${cdate} | cut -c9-10`
#---------------------------------------------
# OZN_TANKDIR - WHERE OUTPUT DATA WILL RESIDE
#
export OZN_TANKDIR=${OZN_TANKDIR:-${COMROOTp3}/$NET/$envir}
export OZN_TANKDIR=${OZN_TANKDIR:-$(compath.py ${envir}/${NET}/${gfs_ver})}
export TANKverf_ozn=${TANKverf_ozn:-${OZN_TANKDIR}/${RUN}.${PDY}/${cyc}/${COMPONENT}/oznmon}
export TANKverf_oznM1=${TANKverf_oznM1:-${OZN_TANKDIR}/${RUN}.${P_PDY}/${p_cyc}/${COMPONENT}/oznmon}
export COM_IN=${COM_IN:-${COMROOTp3}/${NET}/${envir}}
export COM_IN=${COM_IN:-$(compath.py ${envir}/${NET}/${gfs_ver})}
export COMIN=${COMIN:-${COM_IN}/${RUN}.${PDY}/${cyc}/${COMPONENT}}

if [[ ! -d ${TANKverf_ozn} ]]; then
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
cmake_minimum_required(VERSION 2.6)
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 ")
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})
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()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
cmake_minimum_required(VERSION 2.6)
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 ")
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})
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()
Expand Down
Loading

0 comments on commit e7924dd

Please sign in to comment.