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

Added Depstat scripts and related files #44

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
8,461 changes: 8,461 additions & 0 deletions dat/iasi_peak_pressures.dat

Large diffs are not rendered by default.

75 changes: 75 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Define directories containing source
SHELL = /bin/sh

#FC = pgf90
FC = gfortran

# pgf90 flags:
#CFLAGS = -g -Mbounds

# gfortran flags:
CFLAGS = -Jexec

# xlf90 flags:
#CFLAGS = -g -C -qsuffix=f=F90

# Allowed SUFFIXES:
.SUFFIXES :
.SUFFIXES : .F90 .o .mod

SDIR=./src
XDIR=./exec

SOURCE = ${SDIR}/depstat_main.F90

OBJS = ${XDIR}/parameters.o \
${XDIR}/array_definitions.o \
${XDIR}/depstat_main.o \
${XDIR}/prepare.o \
${XDIR}/vcoordinate.o \
${XDIR}/fetchOneTime.o \
${XDIR}/getSensorNumber.o \
${XDIR}/average.o \
${XDIR}/report.o

MODULES = ${XDIR}/parameters.o ${XDIR}/array_definitions.o


# Object dependencies:

${XDIR}/depstat_main : $(OBJS) $(MODULES)
$(FC) -o ${XDIR}/depstat_main $(OBJS)

${XDIR}/parameters.o : ${SDIR}/parameters.F90
$(FC) -c $(CFLAGS) $(INCFLAG) ${SDIR}/parameters.F90 -o ${XDIR}/parameters.o

${XDIR}/depstat_main.o : ${SDIR}/depstat_main.F90
$(FC) -c $(CFLAGS) $(INCFLAG) ${SDIR}/depstat_main.F90 -o ${XDIR}/depstat_main.o

${XDIR}/prepare.o : ${SDIR}/prepare.F90
$(FC) -c $(CFLAGS) $(INCFLAG) ${SDIR}/prepare.F90 -o ${XDIR}/prepare.o

${XDIR}/vcoordinate.o : ${SDIR}/vcoordinate.F90
$(FC) -c $(CFLAGS) $(INCFLAG) ${SDIR}/vcoordinate.F90 -o ${XDIR}/vcoordinate.o

${XDIR}/fetchOneTime.o : ${SDIR}/fetchOneTime.F90
$(FC) -c $(CFLAGS) $(INCFLAG) ${SDIR}/fetchOneTime.F90 -o ${XDIR}/fetchOneTime.o

${XDIR}/getSensorNumber.o : ${SDIR}/getSensorNumber.F90
$(FC) -c $(CFLAGS) $(INCFLAG) ${SDIR}/getSensorNumber.F90 -o ${XDIR}/getSensorNumber.o

${XDIR}/average.o : ${SDIR}/average.F90
$(FC) -c $(CFLAGS) $(INCFLAG) ${SDIR}/average.F90 -o ${XDIR}/average.o

${XDIR}/report.o : ${SDIR}/report.F90
$(FC) -c $(CFLAGS) $(INCFLAG) ${SDIR}/report.F90 -o ${XDIR}/report.o

${XDIR}/array_definitions.o : ${SDIR}/array_definitions.F90
$(FC) -c $(CFLAGS) $(INCFLAG) ${SDIR}/array_definitions.F90 -o ${XDIR}/array_definitions.o

#

clean :
rm -f ${OBJS} ${XDIR}/*.mod ${SDIR}/*~
clobber :
rm -f ${OBJS} ${XDIR}/*.mod ${SDIR}/*~ ${XDIR}/depstat_main
14 changes: 14 additions & 0 deletions nam/satellite_instruments.nml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
&satellite_instruments
satinst%noaa18_amsua=.true.
satinst%noaa19_amsua=.true.
satinst%metopb_amsua=.true.
satinst%metopc_amsua=.true.
satinst%noaa19_mhs=.true.
satinst%metopb_mhs=.true.
satinst%metopc_mhs=.true.
satinst%fy3d_mwhs2=.true.
satinst%snpp_atms=.true.
satinst%noaa20_atms=.true.
satinst%metopb_iasi=.true.
satinst%metopc_iasi=.true.
/
147 changes: 147 additions & 0 deletions scripts/depstat.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
#!/usr/bin/env bash

# This program produces the statistics for plotting

bold=$(tput bold)
normal=$(tput sgr0)
unline=$(tput smul)

PROGNAME=`basename $0`

# Define a usage function
usage() {

cat << USAGE

${bold}NAME${normal}
${PROGNAME} - generates departure statistics for plotting

${bold}USAGE${normal}
${PROGNAME} -c <control-name>
-t <test-name>
-f <first-dtg>
-l <last-dtg>
[ -h ]
${bold}DESCRIPTION${normal}
This program produces the ASCII files
containing departure statistics suitable
for plotting.

${bold}OPTIONS${normal}

-c ${unline}control-name${normal}
The short 4-digit name for control run
(e.g. cont)

-t ${unline}test-name${normal}
The short 4-digit name for test run
(e.g. test)

-f ${unline}first-dtg${normal}
The first DTG <YYYYMMDDHH>

-l ${unline}last-dtg${normal}
The last DTG <YYYYMMDDHH>

-h Help! Print usage information.

USAGE
}

CNAME=DUMMY
TNAME=DUMMY
FDTG=DUMMY
LDTG=DUMMY

this_script_loc="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
appdir=$(dirname ${this_script_loc})
exedir=${appdir}/libexec
bindir=${appdir}/bin
libdir=${appdir}/lib

wdir=$( pwd )

if [ ${#} -eq 0 ]; then
echo "No command line arguments provided"
echo "Try '${PROGNAME} -h' for more information"
exit 1
fi

while getopts c:t:f:l:h option
do
case $option in
c)
CNAME=$OPTARG
;;
t)
TNAME=$OPTARG
;;
f)
FDTG=$OPTARG
;;
l)
LDTG=$OPTARG
;;
h)
usage
exit 0
;;
*)
echo
echo "Try '${PROGNAME} -h' for more information"
;;
esac
done

whoami > uid.txt

g="large" # hyperspectral long-wave channels displayed also in channel index space
p="0" # Treat AIRS and CrIS separately from each other

if [ "${g}" = "large" ]; then
o=1
lwwn=1
else
o=0
lwwn=0
fi


#Produce statistics

rank=1
${exedir}/depstat_main ${TNAME} ${CNAME} ${FDTG} ${LDTG} ${g} ${rank} ${p}


#Create directory for output

fname="number_of_days.txt"
if [ -s ${fname} ]; then
read n < ${fname}
else
n=0
fi
rm -f ${fname}

if [ ${n} -lt 0 ]; then
exit
fi


indir=${wdir}/${TNAME}_${CNAME}_${n}days/data/
outdir=${wdir}/${TNAME}_${CNAME}_${n}days/figs/
mkdir -p $indir
mkdir -p $outdir

mv ${TNAME}_${CNAME}_*_om?_* $indir
mv ${TNAME}_*_om?_* $indir
mv ${CNAME}_*_om?_* $indir
mv ${TNAME}_*_bcor_* $indir
mv ${CNAME}_*_bcor_* $indir
mv ${TNAME}_${CNAME}_datacount_summary $indir

#--------------- Run python plot ------------------------------------

python3 plotdepstat.py ${CNAME} ${TNAME} ${indir} ${outdir}

exit
Loading