diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 416d3e07..e3f3a05b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -37,7 +37,6 @@ endif() # These utilities do not have CMake builds and are unlikely used or usable #add_subdirectory(Config) #add_subdirectory(GEN_BE_V2.0) -#add_subdirectory(global_angupdate) #add_subdirectory(GMI_BUFR_gen) #add_subdirectory(Misc) #add_subdirectory(MODIS_AOD) diff --git a/src/README b/src/README index 2c2f00f3..f1e4d4a3 100644 --- a/src/README +++ b/src/README @@ -27,10 +27,6 @@ Radiance_Utilities/IDL/Diag_Reader: Reads in radiance diag files directly into IDL structures. Good for more detailed investigation of radiances on an ob-by-ob basis. -Radiance_Utilities/diag2grads: - Reads radiance diag files for a given instrument and outputs a - GrADS binary data file and control file - Analysis_Utilities/GrADS: Scripts for displaying analysis fields in GrADS. Currently contains diffvarsloop.gs and diffvarsloop4.gs which display @@ -42,9 +38,6 @@ Radiance_bias_correction_Utilities: since the modified bias correction scheme requires changes to the satbias_in and satbias_angle files. -global_angupdate: - Updates the angle dependent part of the radiance bias correction - Radar_Monitor/radialwind: Identifies which radars do and do not have radial wind observations as well as radars that have missing data. diff --git a/src/Radiance_Utilities/diag2grads/Makefile b/src/Radiance_Utilities/diag2grads/Makefile deleted file mode 100755 index e6aa9482..00000000 --- a/src/Radiance_Utilities/diag2grads/Makefile +++ /dev/null @@ -1,209 +0,0 @@ -#============================================================================== -# -# Makefile for the program to create GrADS station data files -# -#============================================================================== - -#----------------------------------------------------------------------------- -# -- Define macros -- -#----------------------------------------------------------------------------- - -#------------ -# Include machine dependent compile & load options -#------------ -MAKE_CONF = Makefile.conf -include $(MAKE_CONF) - - -# ------------- -# This makefile -# ------------- - -MAKE_FILE = Makefile - - -# ---------------- -# Executable files -# ---------------- - -EXE_FILE = diag2grads - - -# ----------------- -# Install directory -# ----------------- - - INSTALL_DIR = ./ - - -# ----------------- -# Log file for make -# ----------------- - - LOG_FILE = log.make.$(EXE_FILE) - - -# --------------- -# Call child make -# --------------- - -"" : - @$(MAKE) -f $(MAKE_FILE) all # default make with optimizing options -# @$(MAKE) -f $(MAKE_FILE) debug # default make with debug options - - -# ------------ -# Make install -# ------------ - -install: - @echo - @echo '==== INSTALL =================================================' - @if [ -e $(INSTALL_DIR) ]; then \ - if [ ! -d $(INSTALL_DIR) ]; then \ - echo '### Fail to create installing directory ###' ;\ - echo '### Stop the installation ###' ;\ - exit ;\ - fi ;\ - else \ - echo " mkdir -p $(INSTALL_DIR)" ;\ - mkdir -p $(INSTALL_DIR) ;\ - fi - cp $(EXE_FILE) $(INSTALL_DIR) - @cd $(INSTALL_DIR) ; ls -l `pwd`/$(EXE_FILE) - - -# ---------- -# Make clean -# ---------- - -clean: - @echo - @echo '==== CLEAN ===================================================' - - rm -f $(EXE_FILE) *.o *.mod *.MOD *.lst loadmap.txt log.make.$(EXE_FILE) - - - -#----------------------------------------------------------------------------- -# -- Child make -- -#----------------------------------------------------------------------------- - -# ------------ -# Source files -# ------------ - -SRC_C = - -SRC_F90 = \ - kinds.F90 \ - utilities_time.f90 \ - read_diag.f90 \ - grads_hdr.f90 \ - write_station.f90 \ - diag2grads.f90 - -SRC = $(SRC_C) $(SRC_F) $(SRC_F90) - - -# ------------ -# Object files -# ------------ - -SRCSF90 = ${SRC_F90:.F90=.f90} - -OBJ_FILES = ${SRC_C:.c=.o} ${SRC_F:.f=.o} ${SRCSF90:.f90=.o} - - -# --------------- -# Dependency list -# --------------- - -diag2grads.o : diag2grads.f90 write_station.o grads_hdr.o read_diag.o utilities_time.o -grads_hdr.o : grads_hdr.f90 -kinds.o : kinds.F90 -read_diag.o : read_diag.f90 kinds.o -utilities_time.o : utilities_time.f90 -write_station.o : write_station.f90 read_diag.o grads_hdr.o - - - -# --------------------- -# Default compile rules -# --------------------- - -.SUFFIXES : .F90 .f90 .f .c .o - -.F90.o : - @echo - @echo '---> Compiling $<' - $(CF) $(FFLAGS) -c $< - -.f90.o : - @echo - @echo '---> Compiling $<' - $(CF) $(FFLAGS) -c $< - -.f.o : - @echo - @echo '---> Compiling $<' - $(CF) $(FFLAGFIX) -c $< - -.c.o : - @echo - @echo '---> Compiling $<' - $(CC) $(CFLAGS) -c $< - - -# ---- -# Link -# ---- - -$(EXE_FILE) : $(OBJ_FILES) - $(LD) $(LDFLAGS) -o $@ $(OBJ_FILES) $(LIBS) - - -# ------------------------ -# Call compiler and linker -# ------------------------ - -all : - @$(MAKE) -f $(MAKE_FILE) "COMP_MODE=$@" check_mode - @echo - @echo '==== COMPILE =================================================' - @$(MAKE) -f $(MAKE_FILE) \ - "FFLAGS=$(FFLAGS_N)" "FFLAGFIX=$(FFLAGFIX_N)" \ - "CFLAGS=$(CFLAGS_N)" \ - $(OBJ_FILES) - @echo - @echo '==== LINK ====================================================' - @$(MAKE) -f $(MAKE_FILE) \ - "LIBS=$(LIBS_N)" "LDFLAGS=$(LDFLAGS_N)" \ - $(EXE_FILE) - -debug : - @$(MAKE) -f $(MAKE_FILE) "COMP_MODE=$@" check_mode - @echo - @echo '==== COMPILE =================================================' - @$(MAKE) -f $(MAKE_FILE) \ - "FFLAGS=$(FFLAGS_D)" "FFLAGFIX=$(FFLAGFIX_D)" \ - "CFLAGS=$(CFLAGS_D)" \ - $(OBJ_FILES) - @echo - @echo '==== LINK ====================================================' - @$(MAKE) -f $(MAKE_FILE) \ - "LIBS=$(LIBS_D)" "LDFLAGS=$(LDFLAGS_D)" \ - $(EXE_FILE) - -check_mode : - @if [ -e $(LOG_FILE) ]; then \ - if [ '$(COMP_MODE)' != `head -n 1 $(LOG_FILE)` ]; then \ - echo ;\ - echo "### COMPILE MODE WAS CHANGED ###" ;\ - make clean ;\ - fi ;\ - else \ - echo ;\ - echo "### NO LOG FILE ###" ;\ - make clean ;\ - fi - @echo $(COMP_MODE) > $(LOG_FILE) diff --git a/src/Radiance_Utilities/diag2grads/Makefile.conf.AIX b/src/Radiance_Utilities/diag2grads/Makefile.conf.AIX deleted file mode 100644 index f6e5ba1d..00000000 --- a/src/Radiance_Utilities/diag2grads/Makefile.conf.AIX +++ /dev/null @@ -1,88 +0,0 @@ -# This config file contains the compile options for compilation -# of the GSI code on the NCEP IBM SP. All production builds -# on NCEP IBM SP are 64-bit - -# --------------------------- -# General targets/definitions -# --------------------------- - - AR = ar -X64 -v -q - -# ---------------------------- -# Fortran compiler and options -# ---------------------------- - - CF = xlf90 - FC = $(CF) - -#--- Normal mode options - - FFLAGS_F90 = -qsuffix=f=f90:cpp=F90 -WF,-D_REAL8_ -WF,-C -WF,-P -WF,-DNEWPRED=$(NEWPRED) - FFLAGS_FIX = -qfixed - - FFLAGS_COM_N = -NS32704 -qmaxmem=-1 -O2 -Q - - FFLAGS_N = $(FFLAGS_F90) $(FFLAGS_COM_N) $(INCLUDES) - FFLAGFIX_N = $(FFLAGS_FIX) $(FFLAGS_COM_N) $(INCLUDES) - - -#--- Debug mode options - FFLAGS_COM_D = -qmaxmem=-1 \ - -qdbg -qfullpath \ - -qlanglvl=90pure \ - -qsigtrap=xl__trcedump \ - -qcheck -qextchk -qwarn64 \ - -qflag=i:i \ - -qfloat=nans \ - -qflttrap=overflow:zero:invalid:enable \ - -qattr=full -qxref=full -qnolm \ -# -qhalt=w \ -# -qinitauto=7FF7FFFF \ -# -qlist -qflag=i:i \ - - FFLAGS_D = $(FFLAGS_F90) $(FFLAGS_COM_D) $(INCLUDES) - FFLAGFIX_D = $(FFLAGS_FIX) $(FFLAGS_COM_D) $(INCLUDES) - -#--- Compile options for each source file - - FFLAGS = $(FFLAGS_D) - FFLAGFIX = $(FFLAGFIX_D) - - -# ---------------------- -# C Compiler and options -# ---------------------- - - CC = /usr/vac/bin/cc - -#--- Normal mode options - - CFLAGS_N = -I ./ -O2 - -#--- Debug mode options - - CFLAGS_D = -I ./ -g - -#--- Compile options for each source - - CFLAGS = $(CFLAGS_D) - - -# ------------------ -# Linker and options -# ------------------ - - LD = $(CF) - -#--- Normal mode options - - LIBS_N = -lessl -lmass - - LDFLAGS_N = -bloadmap:loadmap.txt - -#--- Debug mode options - - LIBS_D = $(LIBS_N) -lhmd - - LDFLAGS_D = $(LDFLAGS_N) - diff --git a/src/Radiance_Utilities/diag2grads/Makefile.conf.wcoss b/src/Radiance_Utilities/diag2grads/Makefile.conf.wcoss deleted file mode 100755 index 0ce83de0..00000000 --- a/src/Radiance_Utilities/diag2grads/Makefile.conf.wcoss +++ /dev/null @@ -1,68 +0,0 @@ -# This config file contains the compile options for compilation -# of the GSI code on the NOAA HPCS. - -# --------------------------- -# General targets/definitions -# --------------------------- - - AR = ar -v - -# ---------------------------- -# Fortran compiler and options -# ---------------------------- - - CF = ifort - FC = $(CF) - -#--- Normal mode options - FFLAGS_F90 = -D_REAL8_ -DWRF - - FFLAGS_COM_N = -I -O3 -traceback -g -fp-model strict -convert big_endian - - FFLAGS_N = $(FFLAGS_F90) $(FFLAGS_COM_N) - FFLAGS_f = $(FFLAGS_COM_N) $(PROF) - FFLAGS = $(FFLAGS_N) $(PROF) - - -#--- Debug mode options - FFLAGS_COM_D = -O0 -xHOST -traceback -debug full -g -convert big_endian - - FFLAGS_D = $(FFLAGS_F90) $(FFLAGS_COM_D) - FFLAGS_NOSWAP_D = $(FFLAGS_F90) $(FFLAGS_COM_NOSWAP_D) - - - -# ---------------------- -# C Compiler and options -# ---------------------- - - CC = gcc - -#--- Normal mode options - - CFLAGS_N = -DLINUX -Dfunder -I ./ -O2 - -#--- Debug mode options - - CFLAGS_D = -DLINUX -Dfunder -I ./ -g - - -# ------------------ -# Linker and options -# ------------------ - - LD = $(CF) -mkl - -#--- Normal mode options - LIBS_N = - - LDFLAGS_N = - - LDFLAGS = $(LDFLAGS_N) - -#--- Debug mode options - - LIBS_D = $(LIBS_N) - - LDFLAGS_D = - diff --git a/src/Radiance_Utilities/diag2grads/Makefile.conf.zeus b/src/Radiance_Utilities/diag2grads/Makefile.conf.zeus deleted file mode 100755 index 0ce83de0..00000000 --- a/src/Radiance_Utilities/diag2grads/Makefile.conf.zeus +++ /dev/null @@ -1,68 +0,0 @@ -# This config file contains the compile options for compilation -# of the GSI code on the NOAA HPCS. - -# --------------------------- -# General targets/definitions -# --------------------------- - - AR = ar -v - -# ---------------------------- -# Fortran compiler and options -# ---------------------------- - - CF = ifort - FC = $(CF) - -#--- Normal mode options - FFLAGS_F90 = -D_REAL8_ -DWRF - - FFLAGS_COM_N = -I -O3 -traceback -g -fp-model strict -convert big_endian - - FFLAGS_N = $(FFLAGS_F90) $(FFLAGS_COM_N) - FFLAGS_f = $(FFLAGS_COM_N) $(PROF) - FFLAGS = $(FFLAGS_N) $(PROF) - - -#--- Debug mode options - FFLAGS_COM_D = -O0 -xHOST -traceback -debug full -g -convert big_endian - - FFLAGS_D = $(FFLAGS_F90) $(FFLAGS_COM_D) - FFLAGS_NOSWAP_D = $(FFLAGS_F90) $(FFLAGS_COM_NOSWAP_D) - - - -# ---------------------- -# C Compiler and options -# ---------------------- - - CC = gcc - -#--- Normal mode options - - CFLAGS_N = -DLINUX -Dfunder -I ./ -O2 - -#--- Debug mode options - - CFLAGS_D = -DLINUX -Dfunder -I ./ -g - - -# ------------------ -# Linker and options -# ------------------ - - LD = $(CF) -mkl - -#--- Normal mode options - LIBS_N = - - LDFLAGS_N = - - LDFLAGS = $(LDFLAGS_N) - -#--- Debug mode options - - LIBS_D = $(LIBS_N) - - LDFLAGS_D = - diff --git a/src/Radiance_Utilities/diag2grads/configure b/src/Radiance_Utilities/diag2grads/configure deleted file mode 100755 index efc913c5..00000000 --- a/src/Radiance_Utilities/diag2grads/configure +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/sh -# -# Creates configuration Makefile. Before attempting to make anything -# in this directory, enter -# -# ./configure -# -# !REVISION HISTORY -# -# 09oct97 da Silva Initial code. -# 19oct97 da Silva Simplified. -# 22oct97 Jing Guo Converted to libpsas.a environment -# - special configuration for CRAY -# - fool-prove configuration -# - additional information -# 23dec99 da Silva Modified error messages. -# -#..................................................................... - -c=`basename $0 .sh` - -type=${1:-"unknown"} -echo $type - - -# If type=clean, remove soft links and exit -# ----------------------------------------- -if [ "$type" = "clean" ]; then - if [ -r makefile ]; then - echo "$c: remove makefile" 1>&2 - rm makefile - fi - if [ -r Makefile.conf ]; then - echo "$c: remove Makefile.conf" 1>&2 - rm Makefile.conf - fi - exit -fi - - -# Set makeconf based on user input -# --------------------------------------- -makeconf="Makefile.conf.$type" - - -# Node specific configuration -# --------------------------------------- -if [ ! -r ${makeconf} ]; then - echo "$c: cannot find ${makeconf} in `pwd`" 1>&2 - makeconf="Makefile.conf.`uname -n | awk '{print $1}'`" -fi - -# Machine specific -# ---------------- -if [ ! -r ${makeconf} ]; then - echo "$c: cannot find ${makeconf} in `pwd`" 1>&2 - machine="`uname -m | awk '{print $1}'`" - machine=`echo $machine | tr "[a-z]" "[A-Z]"` - compiler=$F90 - makeconf="Makefile.conf.`uname -s | awk '{print $1}'`" - makeconf="${makeconf}.${machine}.${compiler}" -fi - -# Site specific configuration -# --------------------------- -if [ ! -r ${makeconf} ]; then - echo "$c: cannot find ${makeconf} in `pwd`" 1>&2 - makeconf="Makefile.conf.`uname -s | awk '{print $1}'`" -fi - -# if the OS is UNICOS, it does not follow the convention -# ------------------------------------------------------ -if [ ! -r ${makeconf} ]; then - echo "$c: cannot find ${makeconf} in `pwd`" 1>&2 - mech="`uname -m | awk '{print $1}'`" - if [ "${mech}" = CRAY ]; then - makeconf="Makefile.conf.UNICOS" - fi -fi - -# Create soft link for Makefile.conf -# ------------------------------------------------------ -if [ -r Makefile.conf ]; then - echo "$c: remove Makefile.conf" 1>&2 - rm Makefile.conf -fi -ln -s ${makeconf} Makefile.conf - -echo "$c: using ${makeconf} in `pwd`" 1>&2 - -#. diff --git a/src/Radiance_Utilities/diag2grads/diag2grads.f90 b/src/Radiance_Utilities/diag2grads/diag2grads.f90 deleted file mode 100755 index d8cd4704..00000000 --- a/src/Radiance_Utilities/diag2grads/diag2grads.f90 +++ /dev/null @@ -1,468 +0,0 @@ -!$$$ program documentation block -! . . . . -! program: diag2grad create GrADS files -! prgmmr: tahara org: np20 date: 2003-01-01 -! -! abstract: This program create a GrADS station data file and its -! control file a GSI radiance diagnostic file. -! -! program history log: -! 2010-12-22 treadon - add this doc block -! -! contains -! adjust_lon - adjust longitude to degrees west -! -! attributes: -! language: f90 -! machine: ibm RS/6000 SP -! -!$$$ - -program diag2grads - -! Include modules - use Utilities_Time - use read_diag - use grads_hdr - use write_station - - implicit none - - -! Declare and set parameters - integer,parameter :: ft_namelist = 1 ! (in) namelist - integer,parameter :: max_n_chan = 900 -! real(4),parameter :: Criterion_SolarZenAng = 96._8 ! 96 degrees is better - real(4),parameter :: Criterion_SolarZenAng = 90._8 - - -! Declare namelist with defaults - logical :: retrieval = .false. - - integer :: idsat = 14 ! HIRS14 - integer :: n_chan = 19 - - integer :: ft_diag_top = 10 ! diagnostic files - integer :: ft_diag_end = 10 - - integer :: datetime(5) = (/ 2000, 1, 1, 0, 0 /) - integer :: tint = 6 - - real(4) :: North = 90. ! Statistics area - real(4) :: South = -90. ! Statistics area - real(4) :: West = 0. ! Statistics area - real(4) :: East = 360. ! Statistics area - - integer :: qc = 0 ! 0:all 1:only qc pass -1:only rejected - integer :: solar = 0 ! 0:all 1:night 2:day - character(len=5) :: cqc(-1:1) = (/ 'ALL ', 'PASS ', 'RJCT ' /) - character(len=5) :: clandsea(0:2) = (/ 'ALL ', 'LAND ', 'SEA ' /) - character(len=5) :: csolar(0:2) = (/ 'ALL ', 'NIGHT', 'DAY ' /) - - character(len=GRADS_MAXLEN_COMMENT) :: comment = '' - character(len=GRADS_MAXLEN_FILENAME) :: filename = '' - character(len=GRADS_MAXLEN_FILENAME+4) :: dsetname = '' - - namelist / PARM / comment, ft_diag_top, ft_diag_end, filename, & - idsat, n_chan, datetime, tint, South, North, West, East, & - qc, solar, retrieval - - - -! Declare variables for reading / processing satellite data - type(diag_header_fix_list ) :: header_fix - type(diag_header_chan_list),allocatable :: header_chan(:) - type(diag_data_name_list ) :: data_name - type(diag_data_fix_list ) :: data_fix - type(diag_data_chan_list ),allocatable :: data_chan(:) - type(diag_data_extra_list ),allocatable :: data_extra(:,:) - - real(4),allocatable :: nuchan(:) - real(4),allocatable :: data_sfc(:) - real(4),allocatable :: data_lvl(:,:) - - character(len=GRADS_LEN_ID) :: id - - -! Other variables - character(8):: stid - integer :: ft_diag - - integer :: lsflag, iceflag, scan, mype - integer :: iflag, iexist, nelem_sfc,nelem_lvl - - integer :: ttlmin_file, ttlmin_assign, ttlmin_assign0 - integer :: time_work(5) - - integer :: iobs_total - integer :: i, k, n - integer :: npred_radiag, n_bcor - integer :: lunstn,lunctl - integer :: nlev,nflag,itime_terminator - - real(4):: rlat,rlon,rtim - - npred_radiag = 5 - lunstn = 21 - lunctl = 22 - - -! Read namelist - read(ft_namelist,PARM) - - - -! Adjust longitude - call adjust_lon( East ) - call adjust_lon( West ) - if( East == West )then - West = 0. - East = 360. - endif - - -! Print namelist - write(6,*)' ' - write(6,*)'*** NAMELIST ***************************************************' - write(6,*) 'Title : ', trim(comment) - write(6,*) 'FT # of diag files : ', ft_diag_top, ft_diag_end - write(6,*) 'GrADS data file name : ', trim(filename) - write(6,*) 'SAT ID : ', idsat - write(6,*) '# of channels : ', n_chan - write(6,*) 'Time of the 1st file : ', datetime - write(6,*) 'Interval of files(hr): ', tint - write(6,*) 'Area(S,N,W,E) : ', real( (/South, North, West, East/), 4 ) - write(6,*) '0:All 1:used -1:rjct -2:All w/o any qc : ', qc - write(6,*) '0:All 1:night 2:day : ', solar - - -! Check number of channels - if (n_chan > max_n_chan) then - write(6,*)'### ERROR: n_chan=',n_chan,' > max_n_chan=',max_n_chan - stop 99 - endif - -! Open file to GrADS station data file - dsetname = trim(filename) // '.dat' - open(lunstn,file=dsetname,form='unformatted') - write(6,*)'Open unit lunstn=',lunstn,' to GrADS station data file ',trim(dsetname) - - - -! Allocate channel list array - allocate( nuchan(n_chan) ) - - -! Set GrADS data id with sat id - write(id,'(i8)') idsat - - -! Compute total minutes for the first diagnostic file - call Convert_DateTime_TotalMin( ttlmin_assign0, datetime ) - - -! Big loop over diagnostic files - iobs_total = 0 - do ft_diag = ft_diag_top, ft_diag_end - itime_terminator=0 - -! Read header - call read_radiag_header( ft_diag, npred_radiag, retrieval, header_fix, header_chan, data_name, iflag ) - if (iflag/=0) then - write(6,*)'***ERROR*** problem reading header, iflag=',iflag - stop 99 - endif - - -! Check for satellite and sensor -! if( header_fix%isat /= idsat )cycle -! if( header_fix%isat /= mod(idsat,100) )cycle !### TEMPORAL ### - - -! Check number of channels - if( header_fix%nchan /= n_chan )then - write(6,*) '### ERROR: UNEXPECTED NUMBER OF CHANNELS IS READ' - write(6,*) 'THE NUMBER IS', header_fix%nchan - stop 99 - endif - -! Check time - time_work(1) = header_fix%idate / 1000000 - time_work(2) = mod( header_fix%idate, 1000000 ) / 10000 - time_work(3) = mod( header_fix%idate, 10000 ) / 100 - time_work(4) = mod( header_fix%idate, 100 ) - time_work(5) = 0 - call Convert_DateTime_TotalMin( ttlmin_file, time_work ) - - ttlmin_assign = ttlmin_assign0 + (ft_diag - ft_diag_top) * tint * 60 - - if( ttlmin_file /= ttlmin_assign )then - write(6,*) '### ERROR: TIMES ARE INCONSISTENT' - write(6,*) 'FILE :', header_fix%idate - write(6,*) 'ASSIGNED:', datetime, '+', (ft_diag - ft_diag_top) * tint, 'hours' - stop 99 - endif - - -! Extract channel list - do n=1, n_chan - nuchan(n) = real( header_chan(n)%nuchan, 4 ) - enddo - -! Set number of level (channel) and surface (fix) data - nelem_lvl=header_fix%idiag - nelem_sfc=ireal_radiag-2 - if (allocated(data_sfc)) deallocate(data_sfc) - allocate(data_sfc(nelem_sfc)) - write(6,*)'Allocate rank-1 data_sfc as nelem_sfc=',nelem_sfc - - if (allocated(data_lvl)) deallocate(data_lvl) - allocate(data_lvl(nelem_lvl,n_chan)) - write(6,*)'Allocate rank-2 data_lvl as nelem_lvl=',nelem_lvl,' by n_chan=',n_chan - - -! Print header - write(6,*)' ' - write(6,*) '*** HEADER OF DIAGNOSTIC FILE ***' - write(6,*) 'FIX PART:', header_fix - write(6,*) 'n_chan=',n_chan,' n_bcor=',n_bcor - do n=1, n_chan - write(6,*) 'CH', n, ':', header_chan(n) - enddo - - -! Loop over data in current diagnostic file - write(6,*)' ' - write(6,*) '*** DATA OF DIAGNOSTIC FILE ***' - - do - -! Read data record - call read_radiag_data( ft_diag, header_fix, retrieval, data_fix, data_chan, data_extra, iflag ) - if( iflag /= 0 )then - write(6,*)'***ERROR*** problem reading data iflag=',iflag,' iexist=',iexist - exit ! EOF or error - endif - - -! Check area - if( data_fix%lat > North .or. data_fix%lat < South )cycle - - call adjust_lon( data_fix%lon ) - - if( West < East )then - if( data_fix%lon < West .or. East < data_fix%lon )cycle - else if( West > East )then - if( East < data_fix%lon .and. data_fix%lon < West )cycle - endif - - -! Check solar - if( ( solar == 1 .and. data_fix%solzen_ang < Criterion_SolarZenAng ) .or. & - ( solar == 2 .and. data_fix%solzen_ang >= Criterion_SolarZenAng ) )then - cycle - endif - - -! Initialize surface data to missing - do i=1,nelem_sfc - data_sfc(i)=GRADS_MISSING - end do - -! Load surface data - rlat = data_fix%lat - rlon = data_fix%lon - rtim = 0. - data_sfc(1) = data_fix%zsges - data_sfc(2) = data_fix%obstime - data_sfc(3) = data_fix%senscn_pos - data_sfc(4) = data_fix%satzen_ang - data_sfc(5) = data_fix%satazm_ang - data_sfc(6) = data_fix%solzen_ang - data_sfc(7) = data_fix%solazm_ang - data_sfc(8) = data_fix%sungln_ang - data_sfc(9) = data_fix%water_frac - data_sfc(10) = data_fix%land_frac - data_sfc(11) = data_fix%ice_frac - data_sfc(12) = data_fix%snow_frac - data_sfc(13) = data_fix%water_temp - data_sfc(14) = data_fix%land_temp - data_sfc(15) = data_fix%ice_temp - data_sfc(16) = data_fix%snow_temp - data_sfc(17) = data_fix%soil_temp - data_sfc(18) = data_fix%soil_mois - data_sfc(19) = data_fix%land_type - data_sfc(20) = data_fix%veg_frac - data_sfc(21) = data_fix%snow_depth - data_sfc(22) = data_fix%sfc_wndspd - data_sfc(23) = data_fix%qcdiag1 - data_sfc(24) = data_fix%qcdiag2 - -! Initialize the channel (level) data - do n=1,n_chan - do i=1,nelem_lvl - data_lvl(i,n) = GRADS_MISSING - end do - end do - -! Loop over channels - iexist = 0 - do n = 1, n_chan - -! Check Tb - if( qc /= -2 .and. ( abs(data_chan(n)%omgnbc) > 200. .or. & - data_chan(n)%tbobs < 50. .or. data_chan(n)%tbobs > 500. ) )cycle - -! Check uss flag - if( ( qc == -1 .and. data_chan(n)%errinv >= 1.e-6 ) .or. & - ( qc == 1 .and. data_chan(n)%errinv < 1.e-6 ) )cycle - -! There is data to be written - iexist = 1 - -! Load arrays with level (channel) dependent data - data_lvl(1,n) = data_chan(n)%tbobs - data_lvl(2,n) = data_chan(n)%omgbc - data_lvl(3,n) = data_chan(n)%omgnbc - data_lvl(4,n) = data_chan(n)%errinv - data_lvl(5,n) = data_chan(n)%qcmark - data_lvl(6,n) = data_chan(n)%emiss - data_lvl(7,n) = data_chan(n)%tlap - if (header_fix%iversion < iversion_radiag) then - data_lvl( 8,n)=data_chan(n)%bifix(1) - data_lvl( 9,n)=data_chan(n)%bilap - data_lvl(10,n)=data_chan(n)%bilap2 - data_lvl(11,n)=data_chan(n)%bicons - data_lvl(12,n)=data_chan(n)%biang - data_lvl(13,n)=data_chan(n)%biclw - if (retrieval) data_lvl(13,n)=data_chan(n)%bisst - else - data_lvl(8,n) = data_chan(n)%bicons - data_lvl(9,n) = data_chan(n)%biang - data_lvl(10,n) = data_chan(n)%biclw - data_lvl(11,n) = data_chan(n)%bilap2 - data_lvl(12,n) = data_chan(n)%bilap - do i=1,header_fix%angord+1 - data_lvl(12+i,n) = data_chan(n)%bifix(i) - end do - data_lvl(12+header_fix%angord+2,n)=data_chan(n)%bisst - endif - -! End loop over channels - enddo - - -! Check if data should be written - if( iexist == 0 )cycle - - iobs_total = iobs_total + 1 - - -! Write station data - call write_station_data(lunstn,& - id, & ! id - rlat, & ! lat - rlon, & ! lon - rtim, & ! t - n_chan, & ! nlev(# of chan) - nelem_lvl, & - nelem_sfc, & - nuchan, & ! ch # assigned as hight - data_lvl, & - data_sfc ) - - -! Periodically print data - if( mod(iobs_total,2000) == 0 )then - write(6,*) 'DATA #:', iobs_total - write(6,*) 'FIX PART:', data_fix - do n=1, n_chan, n_chan/2 - write(6,*) 'CH SEQ #:', n, ':', data_lvl(:,n) - enddo - endif - - -! End loop over data records - enddo - - -! Write a record to indicate the end of time group - if (itime_terminator==0) then - write(6,*)'Write GrADS station data terminator for time ft_diag=',ft_diag - stid='time_end' - rlat=0.0 - rlon=0.0 - rtim=0.0 - nlev=0 - nflag=0 - write(lunstn) stid,rlat,rlon,rtim,nlev,nflag - itime_terminator=1 - endif - -! End loop over times - enddo - - -! Close GrADS station file - if (itime_terminator==0) then - write(6,*)'Write GrADS station data terminator' - stid='end' - rlat=0.0 - rlon=0.0 - rtim=0.0 - nlev=0 - nflag=0 - write(lunstn) stid,rlat,rlon,rtim,nlev,nflag - endif - write(6,*)'Close GrADS station data file attached to lunstn=',lunstn - close(lunstn) - - -! Create GrADS control file - dsetname = trim(filename) // '.ctl' - open(lunctl,file=dsetname,form='formatted') - write(6,*)'Open unit lunctl=',lunctl,' to GrADS control file ',dsetname - call write_station_ctl(lunctl,comment, & - filename, & - datetime, & - tint, & - ft_diag_end - ft_diag_top + 1, & - n_chan, & - nelem_lvl, & - nelem_sfc, & - data_name) - close(lunctl) - - - -! Check total number of data - if( iobs_total <= 0 )then - write(6,*) '### NO DATA ###' - stop - endif - - -! End of programk !--- end of program - write(6,*)' ' - write(6,*) '=== NORMAL END ===' - -contains - - !------------------------------------------------------------- - ! Adjust longitude between [0:360) - !------------------------------------------------------------- - - subroutine adjust_lon( lon ) - - real(4),intent(inout) :: lon - - if( lon < 0. )then - lon = lon + 360. - else if( lon >= 360. )then - lon = lon - 360. - endif - - end subroutine adjust_lon - - -end program diag2grads diff --git a/src/Radiance_Utilities/diag2grads/diag2grads.sh b/src/Radiance_Utilities/diag2grads/diag2grads.sh deleted file mode 100755 index 79f3cf65..00000000 --- a/src/Radiance_Utilities/diag2grads/diag2grads.sh +++ /dev/null @@ -1,385 +0,0 @@ -#!/bin/sh - - set -x - - SETOPT=-e -# SETOPT=-eax -# SETOPT=-evx -# SETOPT=-vx - - - set $SETOPT - -if [ -d /global ]; then - TOPDIR=/global # This would be the WCOSS - MACHINE=WCOSS -elif [ -d /scratch1/portfolios/NCEPDEV/da ]; then - TOPDIR=/scratch1/portfolios/NCEPDEV/da #This is zeus - MACHINE=ZEUS -else - echo CANNOT FIND A VALID TOP-LEVEL DIRECTORY - exit 1 -fi - -# Other Executables and scripts -if [ $MACHINE = WCOSS ]; then - export NDATE=/nwprod/util/exec/ndate -elif [ $MACHINE = ZEUS ]; then - export NDATE=/scratch1/portfolios/NCEPDEV/da/save/Michael.Lueken/nwprod/util/exec/ndate -else - echo "Unsupported machine $MACHINE (not sure how you got to here)" - exit 1 -fi - - -#--- Set directories -# HOME = directory containing diag2grads -# DIAG_DIR = input directory containing diagnostic file(s) -# GRADSDIR = output directory for GrADS station files - -HOME=$TOPDIR/save/$USER/svn/EXP-port-r20613/util/Radiance_Utilities/diag2grads -DIAG_DIR=/scratch2/portfolios/NCEPDEV/ptmp/$USER/tmp574_sigmap/globalprod.2012012212.zeus -GRADSDIR=/scratch2/portfolios/NCEPDEV/ptmp/$USER/map - - -#=== parameters ====================================================== - -#--- time - - TIME_TOP=2012012212 - TIME_INT=06 - TIME_NUM=1 - -#--- area - - NORTH=90. - SOUTH=-90. - WEST=0. - EAST=360. - -#--- flags - - QC=-2 # all w/o any qc -# QC=-1 # not used in analysis -# QC=0 # all w/ Tb gross error check -# QC=1 # used in analysis - - SOLAR=0 # all -# SOLAR=1 # night -# SOLAR=2 # day - - ITERATION=1 - -#--- case - -#CASE=pro ; COMMENT='PRODUCTION' ; DIAG_DIR=### -CASE=new ; COMMENT='TEST RUN' - - - -#--- innovation type - - OMF=ges # read observed - guess files -## OMF=02 # read observed - guess files -## OMF=anl # read observed - analysis files - - -#--- clean up working directory after the processing - - CLEAN=YES -# CLEAN=NO - -#--- totalview - - TOTALVIEW= -# TOTALVIEW=totalview - -#===================================================================== - - - -#--- dirs and files -WORK=${GRADSDIR}/WORK - -EXEFILE=$HOME/diag2grads - -#--- creat working directory and clean up - -mkdir -p $WORK -cd $WORK - -rm -f fort.* -rm -f satlist.txt -rm -f namelist.txt - -#--- satellite and sensor - -cat << EOF > satlist.txt -### Available satellites and sensors ### -[SAT] [SENSOR] [# CHAN] [prefix] [presat] -NOAA14 HIRS 19 hirs2 n14 -NOAA14 MSU 4 msu n14 -NOAA14 SSU 3 ssu n14 -NOAA15 HIRS 19 hirs3 n15 -NOAA15 AMSUA 15 amsua n15 -NOAA15 AMSUB 5 amsub n15 -NOAA15 AVHRR 3 avhrr n15 -NOAA16 HIRS 19 hirs3 n16 -NOAA16 AMSUA 15 amsua n16 -NOAA16 AMSUB 5 amsub n16 -NOAA16 AVHRR 3 avhrr n16 -NOAA17 HIRS 19 hirs3 n17 -NOAA17 AMSUA 15 amsua n17 -NOAA17 AMSUB 5 amsub n17 -NOAA17 AVHRR 3 avhrr n17 -NOAA18 HIRS 19 hirs4 n18 -NOAA18 AMSUA 15 amsua n18 -NOAA18 MHS 5 mhs n18 -NOAA18 AVHRR 3 avhrr n18 -NOAA19 HIRS 19 hirs4 n19 -NOAA19 AMSUA 15 amsua n19 -NOAA19 MHS 5 mhs n19 -NOAA19 AVHRR 3 avhrr n19 -METOPA HIRS 19 hirs4 metop-a -METOPA AMSUA 15 amsua metop-a -METOPA MHS 5 mhs metop-a -METOPA AVHRR 3 avhrr metop-a -METOPA IASI 616 iasi metop-a -GOES08 SNDR 18 gsndr g08 -GOES08 IMGR 4 imgr g08 -GOES10 SNDR 18 gsndr g10 -GOES10 IMGR 4 imgr g10 -GOES11 SNDR 18 gsndr g11 -GOES11 IMGR 4 imgr g11 -GOES12 SNDR 18 gsndr g12 -GOES12 IMGR 4 imgr g12 -GOES13 SNDR 18 gsndr g13 -GOES13 IMGR 4 imgr g13 -GOES14 SNDR 18 gsndr g14 -GOES14 IMGR 4 imgr g14 -GOES15 SNDR 18 gsndr g15 -GOES15 IMGR 4 imgr g15 -GOES10 SNDRD1 18 sndrd1 g10 -GOES10 SNDRD2 18 sndrd2 g10 -GOES10 SNDRD3 18 sndrd3 g10 -GOES10 SNDRD4 18 sndrd4 g10 -GOES11 SNDRD1 18 sndrd1 g11 -GOES11 SNDRD2 18 sndrd2 g11 -GOES11 SNDRD3 18 sndrd3 g11 -GOES11 SNDRD4 18 sndrd4 g11 -GOES12 SNDRD1 18 sndrd1 g12 -GOES12 SNDRD2 18 sndrd2 g12 -GOES12 SNDRD3 18 sndrd3 g12 -GOES12 SNDRD4 18 sndrd4 g12 -GOES13 SNDRD1 18 sndrd1 g13 -GOES13 SNDRD2 18 sndrd2 g13 -GOES13 SNDRD3 18 sndrd3 g13 -GOES13 SNDRD4 18 sndrd4 g13 -GOES14 SNDRD1 18 sndrd1 g14 -GOES14 SNDRD2 18 sndrd2 g14 -GOES14 SNDRD3 18 sndrd3 g14 -GOES14 SNDRD4 18 sndrd4 g14 -GOES15 SNDRD1 18 sndrd1 g15 -GOES15 SNDRD2 18 sndrd2 g15 -GOES15 SNDRD3 18 sndrd3 g15 -GOES15 SNDRD4 18 sndrd4 g15 -AQUA AIRS 281 airs aqua -AQUA AMSUA 15 amsua aqua -AQUA HSB 4 hsb aqua -AQUA AMSRE_LOW 12 amsre_low aqua -AQUA AMSRE_MID 12 amsre_mid aqua -AQUA AMSRE_HIG 12 amsre_hig aqua -DMSP13 SSMI 7 ssmi f13 -DMSP14 SSMI 7 ssmi f14 -DMSP15 SSMI 7 ssmi f15 -DMSP16 SSMIS_ENV 24 ssmis_env f16 -DMSP16 SSMIS_IMG 24 ssmis_img f16 -DMSP16 SSMIS_LAS 24 ssmis_las f16 -DMSP16 SSMIS_UAS 24 ssmis_uas f16 -DMSP17 SSMIS_ENV 24 ssmis_env f17 -DMSP17 SSMIS_IMG 24 ssmis_img f17 -DMSP17 SSMIS_LAS 24 ssmis_las f17 -DMSP17 SSMIS_UAS 24 ssmis_uas f17 -DMSP18 SSMIS_ENV 24 ssmis_env f18 -DMSP18 SSMIS_IMG 24 ssmis_img f18 -DMSP18 SSMIS_LAS 24 ssmis_las f18 -DMSP18 SSMIS_UAS 24 ssmis_uas f18 -DMSP19 SSMIS_ENV 24 ssmis_env f19 -DMSP19 SSMIS_IMG 24 ssmis_img f19 -DMSP19 SSMIS_LAS 24 ssmis_las f19 -DMSP19 SSMIS_UAS 24 ssmis_uas f19 -DMSP20 SSMIS_ENV 24 ssmis_env f20 -DMSP20 SSMIS_IMG 24 ssmis_img f20 -DMSP20 SSMIS_LAS 24 ssmis_las f20 -DMSP20 SSMIS_UAS 24 ssmis_uas f20 -EOF - -if [ ! "$1" ]; then - echo 'Usage > diag2grads.sh [ID]' - cat satlist.txt - exit -fi - - -# awk '$4 == '"$1"' { print $0 }' satlist.txt | tr -s ' ' ' ' > satsel1.txt -# awk '$5 == '"$2"' { print $0 }' satsel1.txt | tr -s ' ' ' ' > satsel.txt -grep " $1" satlist.txt | tr -s ' ' ' ' > satsel1.txt -grep " $2" satsel1.txt | tr -s ' ' ' ' > satsel.txt - -SATNAME=`cut -d' ' -f1 satsel.txt` -SENNAME=`cut -d' ' -f2 satsel.txt` -senname=`cut -d' ' -f4 satsel.txt` -satname=`cut -d' ' -f5 satsel.txt` -SENID=$1 -NCHAN=`cut -d' ' -f3 satsel.txt` - -if [ ! "$SATNAME" ]; then - echo "ERROR: Specified ID isn't found in the list" - cat satlist.txt - exit -fi - -SATSEN=${SATNAME}${SENNAME} - - -#--- print - -echo -echo '=== Create a GrADS station data file from SSI diagnostic files ===' -echo "--> $CASE" 1>&2 -echo "--> SAT/SEN : ${SATNAME}/${SENNAME}" - -#--- title, directories for diagnostic files - -TITLE="${SATNAME}/${SENNAME} (${COMMENT})" -ZIPDIR=$DIAG_DIR # directory of diagnostic files -DATDIR=$WORK # directory of unzipped diagnostic files - -#--- diagnostic files - -#-- org or new or 'prx' - -#--- set zip suffix -ZIP_SUFFIX=Z - -if [ $MACHINE = WCOSS ]; then - ZIP_SUFFIX=gz -elif [ $MACHINE = ZEUS ]; then - ZIP_SUFFIX=gz -fi - -if [ $CASE = 'org' -o $CASE = 'new' -o $CASE = 'prx' ]; then - set_DATFIL() { - set $SETOPT - ZIPFIL=${ZIPDIR}/diag_${senname}_${satname}_${OMF}.${TIME}.${ZIP_SUFFIX} - UNZIPFIL=${ZIPDIR}/diag_${senname}_${satname}_${OMF}.${TIME} - DATFIL=${DATDIR}/diag_${senname}_${satname}_${OMF}.${TIME} - } -fi - -echo " " -echo "look at variables below" -echo $ZIPFIL -echo $UNZIPFIL -echo $DATFIL -echo " " - -#-- pro ### under construction ### - -if [ $CASE = 'pro' ]; then - set_DATFIL() { - set $SETOPT - ZIPFIL=${ZIPDIR}/fnl.${DATE}/gdas1.t${ZTIME}z.radstat.${ZIP_SUFFIX} - DATFIL=${DATDIR}/radstat.$TIME - } -fi - -#--- diagnostic files - -FT_TOP=30 -FT_END=`expr $FT_TOP + $TIME_NUM - 1` - -FT=$FT_TOP -TIME=$TIME_TOP - -while test $FT -le $FT_END -do - DATE=`echo $TIME |cut -c1-8` - ZTIME=`echo $TIME |cut -c9-10` - set_DATFIL - echo ${UNZIPFIL} - ls -lt ${ZIPFIL} - if [ ! -e $ZIPFIL ]; then - echo ${ZIPFIL} - ls -lt ${ZIPFIL} - cp ${UNZIPFIL} ${DATFIL} - fi - echo ${UNZIPFIL} - if [ ! -e $DATFIL ]; then - echo "--> Unzip" ${ZIPFIL} 1>&2 - if [ ! -e ${DATFIL}.${ZIP_SUFFIX} ]; then - cp ${ZIPFIL} ${DATFIL}.${ZIP_SUFFIX} - fi - gzip -d ${DATFIL}.${ZIP_SUFFIX} - fi - echo ${UNZIPFIL} - ln -s ${DATFIL} fort.$FT - TIME_END=$TIME - FT=`expr $FT + 1` - TIME=`$NDATE $TIME_INT $TIME` -done - -ls -l fort.* 1>&2 - -echo "--> TIME :" $TIME_TOP $TIME_INT $TIME_NUM $TIME_END 1>&2 - -#--- retrieve ymdhm - -YEAR=`echo $TIME_TOP |cut -c1-4` -MON=`echo $TIME_TOP |cut -c5-6` -DAY=`echo $TIME_TOP |cut -c7-8` -HOUR=`echo $TIME_TOP |cut -c9-10` -MIN=00 - -#--- Create namelist input on the file. - -cat << EOF > namelist.txt - &PARM - comment = "${TITLE}", - ft_diag_top = $FT_TOP, ft_diag_end = $FT_END, - datetime = $YEAR, $MON, $DAY, $HOUR, $MIN, - tint = $TIME_INT, - filename = "${GRADSDIR}/${SATSEN}", - idsat = $ITERATION, - n_chan = $NCHAN, - North = $NORTH , South = $SOUTH , West = $WEST , East = $EAST , - qc = $QC, - solar = $SOLAR - / -EOF - -ln -s namelist.txt fort.1 - -#--- run - -$TOTALVIEW $EXEFILE - -#--- create a station map file - -stnmap -i ${GRADSDIR}/${SATSEN}.ctl > out.stnmap - -NDATA=`head -n 9 out.stnmap | head -n 9 | tail -n 1 | tr -s " " " " | cut -f9 -d" "` - -#--- results - -echo -echo '# of DATA :' $NDATA -echo 'GrADS FILES :' -ls -l ${GRADSDIR}/${SATSEN}.* - -#--- clean up - -if [ "$CLEAN" = "YES" ]; then - cd - rm -rf $WORK -fi diff --git a/src/Radiance_Utilities/diag2grads/grads_hdr.f90 b/src/Radiance_Utilities/diag2grads/grads_hdr.f90 deleted file mode 100755 index c3d9f5d1..00000000 --- a/src/Radiance_Utilities/diag2grads/grads_hdr.f90 +++ /dev/null @@ -1,29 +0,0 @@ -!***************************************************************************** -! Header file to write GrADS GPV and station data. It includes the interface -! of utility functions written by C language. -! -! Created by Y.Tahara Sep 2000 -!***************************************************************************** - - -module GrADS_Hdr - - implicit none - - !--- Parameters --- - - integer(4),parameter :: GRADS_MAXLEN_FILENAME = 250 - integer(4),parameter :: GRADS_LEN_ID = 8 - -!#define LEN_LEVELEM_NAME 10 -! integer(4),parameter :: GRADS_LEN_LEVELEMNAME = LEN_LEVELEM_NAME - integer(4),parameter :: GRADS_LEN_LEVELEMNAME = 10 - - integer(4),parameter :: GRADS_MAXLEN_COMMENT = 80 - integer(4),parameter :: GRADS_MAX_ELEMS = 100 - integer(4),parameter :: GRADS_MAX_LEVELS = 300 - - real(4),parameter :: GRADS_MISSING = -32768. - - -end module GrADS_Hdr diff --git a/src/Radiance_Utilities/diag2grads/kinds.F90 b/src/Radiance_Utilities/diag2grads/kinds.F90 deleted file mode 120000 index c3bcbd1a..00000000 --- a/src/Radiance_Utilities/diag2grads/kinds.F90 +++ /dev/null @@ -1 +0,0 @@ -../../../src/gsi/kinds.F90 \ No newline at end of file diff --git a/src/Radiance_Utilities/diag2grads/read_diag.f90 b/src/Radiance_Utilities/diag2grads/read_diag.f90 deleted file mode 120000 index ad0c48aa..00000000 --- a/src/Radiance_Utilities/diag2grads/read_diag.f90 +++ /dev/null @@ -1 +0,0 @@ -../../../src/gsi/read_diag.f90 \ No newline at end of file diff --git a/src/Radiance_Utilities/diag2grads/utilities_time.f90 b/src/Radiance_Utilities/diag2grads/utilities_time.f90 deleted file mode 100755 index 01490068..00000000 --- a/src/Radiance_Utilities/diag2grads/utilities_time.f90 +++ /dev/null @@ -1,260 +0,0 @@ -!***************************************************************************** -! Utilities for time -! -! Created by Y.Tahara Aug 2000 -!***************************************************************************** - - -module utilities_time - - implicit none - - private - public Retrieve_NearTime - public Create_TextTime - public Convert_DateTime_TotalMin - public Convert_TotalMin_DateTime - public Convert_TotalDay_Date - - interface Retrieve_NearTime - module procedure Retrieve_NearTime_TotalMin - module procedure Retrieve_NearTime_DateTime - end interface - - - contains - !======================================================================== - ! Create text of time for GrADS as [hh:mmZddmmmyyyy]. - !======================================================================== - subroutine Create_TextTime( ctime, datetime ) - - !--- Interface --- - character(len=15),intent(out) :: ctime - integer(4),intent(in) :: datetime(5) ! year,month,day,hour,min - - !--- Work --- - character(len=3),parameter :: cmonth(12) = & - (/ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', & - 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' /) - - !--- Create --- - write(ctime,'(I2.2,":",I2.2,"Z",I2.2,A,I4.4)') & - datetime(4), datetime(5), datetime(3), cmonth(datetime(2)), datetime(1) - - end subroutine Create_TextTime - - - - !======================================================================== - ! Retrieve time nearest to specified interval (<1day). - ! - ! Ex) Time interval 6hr. 2000/08/01 02:11 --> 2000/08/01 00:00 - ! 13:35 --> 12:00 - ! 22:35 --> 2000/08/02 00:00 - !======================================================================== - !--- Total min from 1801 ------------------------------------------------ - subroutine Retrieve_NearTime_TotalMin( totalmin, interval ) - - !--- Interface --- - integer(4),intent(inout) :: totalmin ! total minitues from 1801 - integer(4),intent(in) :: interval ! interval (min) - - !--- Retrieve --- - totalmin = int((totalmin + interval/2)/interval) * interval - - end subroutine Retrieve_NearTime_TotalMin - - - !--- Date/Time ---------------------------------------------------------- - subroutine Retrieve_NearTime_DateTime( datetime, interval ) - - !--- Interface --- - integer(4),intent(inout) :: datetime(5) ! year,month,day,hour,min - integer(4),intent(in) :: interval ! interval (min) - - !--- Work --- - integer(4) :: totalmin - - !--- Retrieve --- - call Convert_DateTime_TotalMin( totalmin, datetime ) - totalmin = int((totalmin + interval/2)/interval) * interval - call Convert_TotalMin_DateTime( datetime, totalmin ) - - end subroutine Retrieve_NearTime_DateTime - - - - !======================================================================== - ! Convert date/time to total minitues from 1801. - !======================================================================== - subroutine Convert_DateTime_TotalMin( totalmin, datetime ) - - !--- Interface --- - integer(4),intent(in) :: datetime(5) ! year,month,day,hour,min - integer(4),intent(out) :: totalmin ! total minites from 1801 - - !--- Parameter --- - integer(4),parameter :: min_day = 24*60, & - min_year = min_day * 365 - integer(4),parameter :: min_monthtop(12) = & - (/ 0, 44640, 84960, & - 129600, 172800, 217440, & - 260640, 305280, 349920, & - 393120, 437760, 480960 /) - - !--- Work --- - integer(4) :: year, mon, uru_flag - - - !--- Check Uruu --- - year = datetime(1) - if( (mod(year,4) == 0 .and. mod(year,100) /= 0) .or. mod(year,400) == 0 )then - uru_flag = 1 - else - uru_flag = 0 - endif - - !--- Convert --- - year = year - 1801 - totalmin = min_year * year & - + min_day * (year/4 - year/100 + (year+200)/400) - - mon = datetime(2) - if( mon > 2 )then - totalmin = totalmin + min_monthtop(mon) + uru_flag * min_day - else - totalmin = totalmin + min_monthtop(mon) - endif - - totalmin = totalmin + (datetime(3) - 1) * min_day & - + datetime(4) * 60 & - + datetime(5) - - end subroutine Convert_DateTime_TotalMin - - - - !======================================================================== - ! Convert total minitues from 1801 to date/time. - !======================================================================== - subroutine Convert_TotalMin_DateTime( datetime, totalmin ) - - !--- Interface --- - integer(4),intent(in) :: totalmin ! total minites from 1801 - integer(4),intent(out) :: datetime(5) ! year,month,day,hour,min - - !--- Parameter --- - integer(4),parameter :: min_day = 24*60, & - min_1year = min_day * 365, & - min_4year = min_1year * 4 + min_day, & - min_100year = min_4year * 25 - min_day, & - min_400year = min_100year * 4 + min_day - integer(4),parameter :: min_monthtop(12) = & - (/ 0, 44640, 84960, & - 129600, 172800, 217440, & - 260640, 305280, 349920, & - 393120, 437760, 480960 /) - - !--- Work --- - integer(4) :: ttl - integer(4) :: year, uru - integer(4) :: dmy - integer(4) :: i, j - - !--- Year --- - ttl = totalmin + min_100year*2 ! total min from 1601 - - dmy = ttl / min_400year - year = dmy * 400 + 1601 - ttl = ttl - dmy * min_400year - - dmy = ttl / min_100year - if( dmy > 3 ) dmy = 3 - year = year + dmy * 100 - ttl = ttl - dmy * min_100year - - dmy = ttl / min_4year - year = year + dmy * 4 - ttl = ttl - dmy * min_4year - - dmy = ttl / min_1year - if( dmy > 3 ) dmy = 3 - year = year + dmy - ttl = ttl - dmy * min_1year - - datetime(1) = year - - !--- Month --- - if( (mod(year,4) == 0 .and. mod(year,100) /= 0) .or. mod(year,400) == 0 )then - uru = min_day - else - uru = 0 - endif - - CheckMon: do j=1, 1 - do i=12, 3, -1 - dmy = ttl - min_monthtop(i) - uru - if( dmy >= 0 )then - datetime(2) = i - ttl = dmy - exit CheckMon - endif - enddo - - dmy = ttl - min_monthtop(2) - if( dmy >= 0 )then - datetime(2) = 2 - ttl = dmy - else - datetime(2) = 1 - endif - enddo CheckMon - - !--- Day --- - dmy = ttl / min_day - datetime(3) = dmy + 1 - ttl = ttl - dmy * min_day - - !--- Hour, Min --- - dmy = ttl / 60 - datetime(4) = dmy - datetime(5) = ttl - dmy * 60 - - end subroutine Convert_TotalMin_DateTime - - - - !======================================================================== - ! Convert total days from Jan.1 to date - !======================================================================== - subroutine Convert_TotalDay_Date( month, day, year, totalday ) - - !--- Interface --- - integer(4),intent(out) :: month, day ! month, day - integer(4),intent(in) :: year ! year - integer(4),intent(in) :: totalday ! total days from Jan.1 - - !--- Work --- - integer(4),save :: days_mon(12) = & - (/ 31,28,31,30,31,30, 31,31,30,31,30,31 /) - - !--- Uruu --- - if( (mod(year,4) == 0 .and. mod(year,100) /= 0) .or. mod(year,400) == 0 )then - days_mon(2) = 29 - else - days_mon(2) = 28 - endif - - !--- Convert --- - day = totalday - - do month=1, 12 - if( (day - days_mon(month)) < 1 ) & - exit - - day = day - days_mon(month) - enddo - - end subroutine Convert_TotalDay_Date - -end module utilities_time diff --git a/src/Radiance_Utilities/diag2grads/write_station.f90 b/src/Radiance_Utilities/diag2grads/write_station.f90 deleted file mode 100644 index cc7b3b00..00000000 --- a/src/Radiance_Utilities/diag2grads/write_station.f90 +++ /dev/null @@ -1,80 +0,0 @@ -module write_station - -contains - subroutine write_station_data(lunstn,stid,rlat,rlon,rtim,n_chan,nelem_lv,nelem_sf,nuchan,data_lv,data_sf) - implicit none - - character(8):: stid - integer:: lunstn,n_chan,nelem_lv,nelem_sf - real(4),dimension(n_chan):: nuchan - real(4):: rlat,rlon,rtim - real(4),dimension(nelem_sf):: data_sf - real(4),dimension(nelem_lv,n_chan):: data_lv - integer:: nflag,i,k - - nflag=1 - write(lunstn) stid,rlat,rlon,rtim,n_chan+1,nflag - write(lunstn) (data_sf(i),i=1,nelem_sf),& - (nuchan(k),(data_lv(i,k),i=1,nelem_lv),k=1,n_chan) - - return - end subroutine write_station_data - - - subroutine write_station_ctl(lunctl,comment,filename,datetime,tint,nt,n_chan,nelem_lvl,nelem_sfc,data_name) - use grads_hdr - use read_diag - implicit none - - integer :: lunctl - character(len=GRADS_MAXLEN_COMMENT) :: comment - character(len=GRADS_MAXLEN_FILENAME) :: filename - integer :: datetime(5) - integer :: tint, nt,i - integer :: n_chan,nelem_lvl,nelem_sfc - real(4):: nuchan(n_chan) - type(diag_data_name_list) :: data_name - character(len=GRADS_MAXLEN_FILENAME+4):: dsetname - character(len=3),dimension(12):: cmonth - character(len=15):: string - integer :: imissing - - data cmonth / "Jan", "Feb", "Mar", "Apr", "May", "Jun", & - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" / - - - dsetname=trim(filename) // '.dat' - if (dsetname(1:1) == '/') then - write(lunctl,'("dset ",a)') trim(dsetname) - else - write(lunctl,'("dset ^",a)') trim(dsetname) - endif - write(lunctl,'("dtype station")') - - dsetname=trim(filename) // '.map' - if (dsetname(1:1) == '/') then - write(lunctl,'("stnmap ",a)') trim(dsetname) - else - write(lunctl,'("stnmap ^",a)') trim(dsetname) - endif - - write(lunctl,'("options sequential big_endian template")') - imissing = grads_missing - write(lunctl,'("undef ",i6)') imissing - write(lunctl,'("title ",a)') trim(comment) - - write(string,'(i2.2,":",i2.2,"Z",i2.2,a3,i4.4)') datetime(4),datetime(5),datetime(3),cmonth(datetime(2)),datetime(1) - write(lunctl,'("tdef ",i3," linear ",a,1x,i2,"hr")') nt,string,tint - write(lunctl,'("vars ",i3)') nelem_sfc+nelem_lvl - do i=3,nelem_sfc+2 - write(lunctl,'(a,(" 0 99 "),a)') data_name%fix(i),data_name%fix(i) - end do - do i=1,nelem_lvl - write(lunctl,'(a,1x,i6,(" 99 "),a)') data_name%chn(i),n_chan,data_name%chn(i) - end do - - write(lunctl,'("endvars")') - - end subroutine write_station_ctl - -end module write_station diff --git a/src/global_angupdate/Convert_Satang.f90 b/src/global_angupdate/Convert_Satang.f90 deleted file mode 100644 index f0e73f71..00000000 --- a/src/global_angupdate/Convert_Satang.f90 +++ /dev/null @@ -1,94 +0,0 @@ -program convert_satang -!$$$ main program documentation block -! . . . . -! main program: Convert_Satang -! PRGMMR: Collard DATE: 2012-10-26 -! -! abstract: This program changes the format of the satang files -! to include the number of scan positions in the header and -! to change the number of scan positions. -! -! program history log: -! 10-26-12 collard initial code from global_angupdate - -! usage: -! input files: -! lnangl - scan angle dependent bias correction file -! -! output files: -! lnupdt - updated scan angle dependent bias correction file -! -! exit states: -! cond = 0 - successful run -! = 98 - inconsistent satellite/sensor identifiers -! = 99 - problem reading input satang file -! -! -! attributes: -! language: f90 -! -!$$$ - - implicit none - -! Declare local parameters - integer,parameter:: lnangl = 11 - integer,parameter:: lnupdt = 52 - - real,parameter:: zero = 0.0 - - -! Declare local variables - - character(20):: satsensor0 - - integer:: i, ios, shift_atms - integer:: nstep_in, nstep_out - integer :: ich, jchanum0 - - real:: tlap0 - real,allocatable,dimension(:):: c_ang0 - - -!************************************************************************ - - write(*,*) 'Enter number of scan positions for input file' - write(*,*) ' (-1 if specified in file)' - read(*,*) nstep_in - write(*,*) 'Enter number of scan positions for output file' - read(*,*) nstep_out - write(*,*) 'Enter one to shift ATMS' - read(*,*) shift_atms - - -! Read input satang file - open(lnangl,file='satbias_ang.in',form='formatted') - open(lnupdt,file='satbias_ang.out',form='formatted') - if (nstep_in <= 0) read(lnangl,'(6x,i8)') nstep_in - allocate(c_ang0(MAX(nstep_out,nstep_in))) - c_ang0(:)=zero - write(lnupdt,'("nscan=",i8)') nstep_out - ios=0 - do while (ios == 0) - read(lnangl,110,err=120,end=120,iostat=ios) ich,satsensor0,& - jchanum0,tlap0,c_ang0(1:nstep_in) - if (shift_atms == 1 .AND. Trim(satsensor0)=='atms_npp') then - c_ang0(4:93)=c_ang0(1:90) - c_ang0(1:3)=c_ang0(4) - c_ang0(94:96)=c_ang0(93) - end if - write(lnupdt,110) ich,satsensor0,& - jchanum0,tlap0,c_ang0(1:nstep_out) - end do -110 format(I5,1x,A20,1x,I5,e15.6/100(4x,10f7.3/)) - -120 continue - - close(lnangl) - close(lnupdt) - - -end program convert_satang - - - diff --git a/src/global_angupdate/JGDAS_ANGUPDATE b/src/global_angupdate/JGDAS_ANGUPDATE deleted file mode 100755 index c7dbc710..00000000 --- a/src/global_angupdate/JGDAS_ANGUPDATE +++ /dev/null @@ -1,296 +0,0 @@ -#!/bin/ksh -set -xa -# -# Specify whether the run is production or development -# -export RUN_ENVIR=${RUN_ENVIR:-prod} - -##################################################################################### -# Run config file to get input parameters -# This config file should define the following variables -# DATA_IN: Location of working directory, default to /tmpnwprd -# DEV_ECF: If the job is to be running using ECF, default to YES -# SENDDBN: Set to NO for developers, default to YES -# COM_IN: Directory for input files, default to /com/$NET/${envir} -# COM_OUT: Directory for output file, default to /com/$NET/${envir} -# gespath: Directory for the guess or restart files, default to /nwges/${envir} -##################################################################################### -if [ "$RUN_ENVIR" != prod ] ### For Developers, "group_name" is passed from the ECF script -then - . ${PARA_CONFIG:-/global/save/${LOGNAME}/test/angupdate/para_config} - export userid=$LOGNAME - export DATA_IN=${DATA_IN:-/ptmp/$LOGNAME} -fi - -############################################################### -# This block can be modified for different test environment -############################################################### -if [[ $RUN_ENVIR = prod && $envir != prod ]]; then - export SENDDBN=${SENDDBN:-NO} - export jlogfile=${jlogfile:-/com/logs/${envir}/jlogfile} -fi - -#################################### -# Specify NET and RUN Name and model -#################################### -export NET=gfs -export RUN=gdas1 -export RUNENS=enkf - -#################################### -# set up job name and environment -#################################### -export job=${job:-$RUN} -export envir=${envir:-prod} -export host=${host:-`hostname | cut -c1`} - -############################################### - -export PS4='$SECONDS + ' - -# #### 04/27/2010 ############################# -# SETUP GDAS ANGUPDATE PROCESSING VARIABLES -# ############################################# - -#################################### -# obtain unique process id (pid) and make temp directory -#################################### -export pid=$$ -export DATA_IN=${DATA_IN:-/tmpnwprd} - -export DATA=$DATA_IN/${job}.${pid} -mkdir $DATA -cd $DATA - -#################################### -# Determine Job Output Name on System -#################################### -export cyc=${cyc:-00} -export cycle=t${cyc}z -export outid="LL$job" -export jobid="${outid}.o${pid}" -export pgmout="OUTPUT.${pid}" -export pgmerr=errfile - -#################################### -# SENDECF - Flag Events on ECF -# SENDCOM - Copy Files From TMPDIR to $COMOUT -# SENDDBN - Issue DBNet Client Calls -# RERUN - Rerun fcst from beginning (default no) -# VERBOSE - Specify Verbose Output in exglobal_fcst.sh.ecf -#################################### -export SENDECF=YES -export SENDCOM=YES -export SAVEGES=YES -export SENDDBN=YES -export VERBOSE=YES - - -################################# -# Define the Log File directory -################################# -if [ $envir = "prod" ] -then - export jlogfile=${jlogfile:-/com/logs/jlogfiles/jlogfile.${job}.${pid}} -else - export jlogfile=${jlogfile:-/com/logs/${envir}/jlogfile} -fi - - -#################################### -# Specify Execution Areas -#################################### -export HOMEGLOBAL=${HOMEGLOBAL:-/nw${envir}} -export EXECGLOBAL=${EXECGLOBAL:-$HOMEGLOBAL/exec} -export FIXGLOBAL=${FIXGLOBAL:-$HOMEGLOBAL/fix} -export USHGLOBAL=${USHGLOBAL:-$HOMEGLOBAL/ush} -export SCRGLOBAL=${SCRGLOBAL:-$HOMEGLOBAL/scripts} -export UTILGLOBAL=${UTILGLOBAL:-$HOMEGLOBAL/util} -export PARMGLOBAL=${PARMGLOBAL:-$HOMEGLOBAL/parm} - -############################## -# Set up the UTILITIES -############################## -export utilscript=${utilscript:-$UTILGLOBAL/ush} -export utilexec=${utilexec:-$UTILGLOBAL/exec} -export NDATE=${NDATE:-$utilexec/ndate} - -############################## -# Run setup to initialize working directory and utility scripts -############################## -$utilscript/setup.sh - -export err_chk=${err_chk:-$utilscript/err_chk.sh} -export startmsg=${startmsg:-$utilscript/startmsg.sh} -export ERRSCRIPT=${ERRSCRIPT:-$err_chk} -export LOGSCRIPT=${LOGSCRIPT:-$startmsg} -export FILESTYLE=${FILESTYLE:-'C'} - -############################## -# Run setpdy and initialize PDY variables -############################## -$utilscript/setpdy.sh -. ./PDY - -############################################## -# Define COM directories -############################################## -export COM_IN=${COM_IN:-/com/${NET}/${envir}} -export COM_OUT=${COM_OUT:-/com/${NET}/${envir}} - -export COMIN=$COM_IN/gdas.${PDY} -export COMOUT=$COM_OUT/gdas.${PDY} -export GETGES_COM=${GETGES_COM:-/com} -export GETGES_NWG=${GETGES_NWG:-/nwges} - -mkdir -m 775 -p $COMOUT - -############################################## -# Define GES directories -############################################## -gespath=/nwges/${envir} -export GESdir=$gespath/gdas.${PDY} -mkdir -m 775 -p $GESdir - -#################################### -# Specify Special Vars -#################################### -# -export ANGUPDATEXEC=${ANGUPDATEXEC:-$EXECGLOBAL/global_angupdate} -export ANGUPDATESH=${ANGUPDATESH:-$SCRGLOBAL/exglobal_angupdate.sh.ecf} - -# -# Forecast Horizontal Resolution -# -export JCAP_ges=574 -# -# Forecast Vertical Resolution -# -export LEVS_ges=64 -# -# Analysis valid time -# -export CDATE=${PDY}${cyc} - -#################################### -# Fix Files -# -export SATANGL=${SATANGL:-${FIXGLOBAL}/global_satangbias.txt} - - -#################################### -# Input Fields -# -export PREINP=${RUN}.${cycle}. -export RADSTAT=${COMIN}/${PREINP}radstat - - -############################################################################ -# -# Output File Names -# -export SATANGO=$DATA/${RUN}.${cycle}.satang - - - -msg="HAS BEGUN on `hostname`" -./postmsg "$jlogfile" "$msg" - -#################################### -# Check if this is a restart -# -# Define Previous Guess File Names -#################################### -gesenvir=${envir} - -$utilscript/getges.sh -t sfcges -r ${JCAP_ges}${LEVS_ges} -v $PDY$cyc \ - -e $gesenvir bges -err1=$? - -$utilscript/getges.sh -t satang -r ${JCAP_ges}${LEVS_ges} -v $PDY$cyc \ - -e $gesenvir gsatang - -export SFCGES=$DATA/bges -export GSATANG=$DATA/gsatang - -if test "$err1" -eq '0' -then - msg="Angupdate Start/Guess Fields Found" - ./postmsg "$jlogfile" "$msg" - -else - msg="Angupdate Cannot Start/Guess Fields Not Available" - ./postmsg "$jlogfile" "$msg" - export pgm=$job - export err=911 - ./err_chk -fi - -############################ -# Make use of updated angle dependent bias file, if it exists. -if [[ -s $GSATANG ]]; then - export SATANGL=$GSATANG -fi - -# Make use of increment from GFS early cycle, if it exists -if [[ -s $GESFIL ]]; then - export GINCIN=$GESFIL -fi - - -############################ -# WCOSS envrionment settings -export MP_COREFILE_FORMAT=lite -export MP_EUIDEVELOP=min -export MP_EUIDEVICE=sn_all -export MP_EUILIB=us -export MP_MPILIB=mpich2 - -export MP_LABELIO=yes -export MP_SHARED_MEMORY=yes - -export machine=WCOSS -export APRUN='mpirun.lsf' - - -env - -############################################################# -# Execute the script -${ANGUPDATESH:-$SCRGLOBAL/exglobal_angupdate.sh.ecf} -############################################################# - -#export MP_PMDLOG=no -#poe rm -rf /tmp/mplog* - -########## -# NOTES: 1) SATANGO is used in the following analysis cycle -########## - -if test "$SAVEGES" = "YES" -then - cp $SATANGO $GESdir/${RUN}.${cycle}.satang -fi -if test "$SENDCOM" = "YES" -then - cp $SATANGO $COMOUT/${RUN}.${cycle}.satang -fi - -if test $SENDDBN = 'YES' -then - $DBNROOT/bin/dbn_alert MODEL GDAS1_MSC_satang $job $COMOUT/${RUN}.${cycle}.satang -fi - -cat $pgmout - - -msg="ENDED NORMALLY." -./postmsg "$jlogfile" "$msg" - -############################## -# Remove the Temporary working directory -############################## -cd $DATA_IN -if [ ${RM_TMPDIR:-YES} = YES ] ; then rm -rf $DATA ; fi - -date diff --git a/src/global_angupdate/Makefile b/src/global_angupdate/Makefile deleted file mode 100755 index d794b852..00000000 --- a/src/global_angupdate/Makefile +++ /dev/null @@ -1,309 +0,0 @@ -SHELL=/bin/sh - -#============================================================================== -# -# GSI Makefile -# -# -# 0) Export this makefile name to a variable 'MAKE_FILE' as -# export MAKE_FILE = makefile -# If this file is named neither 'makefile' nor 'Makefile' but -# 'makeairs' for instance, then call this makefile by typing -# 'make -f makeairs' instead of 'make'. -# -# 0a) Modify the include link to either use compile.config.ibm -# or compile.config.sgi for compilation on the ibm sp or sgi -# -# 1) To make a GSI executable file, type -# > make or > make all -# -# 2) To make a GSI executable file with debug options, type -# > make debug -# -# 3) To copy the GSI load module to installing directory, type -# > make install -# . Specify the directory to a variable 'INSTALL_DIR' below. -# -# 4) To crean up files created by make, type -# > make clean -# -# 5) To create a library, libgsi.a, in the lib directory, type -# > make library -# -# -# Created by Y.Tahara in May,2002 -# Edited by D.Kleist Oct. 2003 -#============================================================================== - -#----------------------------------------------------------------------------- -# -- Parent make (calls child make) -- -#----------------------------------------------------------------------------- - -# ----------------------------------------------------------- -# Default configuration, possibily redefined in Makefile.conf -# ----------------------------------------------------------- - -ARCH = `uname -s` -SED = sed -DASPERL = /usr/bin/perl -COREROOT = ../../.. -COREBIN = $(COREROOT)/bin -CORELIB = $(COREROOT)/lib -COREINC = $(COREROOT)/include -COREETC = $(COREROOT)/etc - - -# ------------- -# General Rules -# ------------- - -CP = /bin/cp -p -RM = /bin/rm -f -MKDIR = /bin/mkdir -p -AR = ar cq -PROTEX = protex -f # -l -ProTexMake = protex -S # -l -LATEX = pdflatex -DVIPS = dvips - -# Preprocessing -# ------------- -_DDEBUG = -_D = $(_DDEBUG) - -# --------- -# Libraries -# --------- -LIBmpeu = -L$(CORELIB) -lmpeu -LIBbfr = -L$(CORELIB) -lbfr -LIBw3 = -L$(CORELIB) -lw3 -LIBsp = -L$(CORELIB) -lsp -LIBbacio = -L$(CORELIB) -lbacio -LIBsfcio = -L$(CORELIB) -lsfcio -LIBsigio = -L$(CORELIB) -lsigio -LIBcrtm = -L$(CORELIB) -lcrtm_2.0.5 -LIBtransf = -L$(CORELIB) -ltransf -LIBhermes = -L$(CORELIB) -lhermes -LIBgfio = -L$(CORELIB) -lgfio - -# -------------------------- -# Default Baselibs Libraries -# -------------------------- -INChdf = -I$(BASEDIR)/$(ARCH)/include/hdf -LIBhdf = -L$(BASEDIR)/$(ARCH)/lib -lmfhdf -ldf -lhdfjpeg -lhdfz -lsz -LIBnetcdf = -L$(BASEDIR)/$(ARCH)/lib -lnetcdf -LIBwrf = -L$(BASEDIR)/$(ARCH)/lib -lwrflib -LIBwrfio_int = -L$(BASEDIR)/$(ARCH)/lib -lwrfio_int -LIBwrfio_netcdf = -L$(BASEDIR)/$(ARCH)/lib -lwrfio_nf - -# ------------------------ -# Default System Libraries -# ------------------------ -LIBmpi = -lmpi -LIBsys = - - -#------------ -# Include machine dependent compile & load options -#------------ - MAKE_CONF = Makefile.conf -include $(MAKE_CONF) - - -# ------------- -# This makefile -# ------------- - - MAKE_FILE = Makefile - - -# ----------- -# Load module -# ----------- - - EXE_FILE = global_angupdate - - -# -------------------- -# Installing directory -# -------------------- - - INSTALL_DIR = ../bin - - -# -------- -# Log file -# -------- - - LOG_FILE = log.make.$(EXE_FILE) - - -# --------------- -# Call child make -# --------------- - -"" : - @$(MAKE) -f $(MAKE_FILE) all - - -# ------------ -# Make install -# ------------ - -install: - @echo - @echo '==== INSTALL =================================================' - @if [ -e $(INSTALL_DIR) ]; then \ - if [ ! -d $(INSTALL_DIR) ]; then \ - echo '### Fail to create installing directory ###' ;\ - echo '### Stop the installation ###' ;\ - exit ;\ - fi ;\ - else \ - echo " mkdir -p $(INSTALL_DIR)" ;\ - mkdir -p $(INSTALL_DIR) ;\ - fi - cp $(EXE_FILE) $(INSTALL_DIR) - @cd $(INSTALL_DIR) ; ls -l `pwd`/$(EXE_FILE) - - -# ---------- -# Make clean -# ---------- - -clean: - @echo - @echo '==== CLEAN ===================================================' - - $(RM) $(EXE_FILE) *.o *.mod *.MOD *.lst *.a *.x - - $(RM) loadmap.txt log.make.$(EXE_FILE) - - $(MAKE) -f ${MAKE_FILE} doclean - - -#----------------------------------------------------------------------------- -# -- Child make -- -#----------------------------------------------------------------------------- - -# ------------ -# Source files -# ------------ - - SRCSF90C = main.F90 kinds.F90 read_diag.f90 determine_time_levels.f90 - - SRCSF77 = - - SRCSC = - - SRCS = $(SRCSF90C) $(SRCSF77) $(SRCSC) - - DOCSRCS = *.f90 *.F90 - -# ------------ -# Object files -# ------------ - - SRCSF90 = ${SRCSF90C:.F90=.f90} - - OBJS = ${SRCSF90:.f90=.o} ${SRCSF77:.f=.o} ${SRCSC:.c=.o} - - -# ----------------------- -# Default compiling rules -# ----------------------- - -.SUFFIXES : -.SUFFIXES : .F90 .f90 .f .c .o - -.F90.o : - @echo - @echo '---> Compiling $<' - $(CF) $(FFLAGS) $(_D) -c $< - -.f90.o : - @echo - @echo '---> Compiling $<' - $(CF) $(FFLAGS) -c $< - -.f.o : - @echo - @echo '---> Compiling $<' - $(CF) $(FFLAGS_f) -c $< - -.c.o : - @echo - @echo '---> Compiling $<' - $(CC) $(CFLAGS) -c $< - -# ------------ -# Dependencies -# ------------ - MAKE_DEPEND = Makefile.dependency -include $(MAKE_DEPEND) - -# ---- - -$(EXE_FILE) : $(OBJS) - $(LD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) - - -# ------------------------ -# Call compiler and linker -# ------------------------ - -all : - @$(MAKE) -f $(MAKE_FILE) "COMP_MODE=$@" check_mode - @echo - @echo '==== COMPILE =================================================' - @$(MAKE) -f $(MAKE_FILE) \ - "FFLAGS=$(FFLAGS_N)" \ - "CFLAGS=$(CFLAGS_N)" \ - $(OBJS) - @echo - @echo '==== LINK ====================================================' - @$(MAKE) -f $(MAKE_FILE) \ - "LIBS=$(LIBS_N)" "LDFLAGS=$(LDFLAGS_N)" \ - $(EXE_FILE) - -library : - @$(MAKE) -f $(MAKE_FILE) "COMP_MODE=$@" check_mode - @echo - @echo '==== COMPILE =================================================' - @$(MAKE) -f $(MAKE_FILE) \ - "FFLAGS=$(FFLAGS_N)" \ - "CFLAGS=$(CFLAGS_N)" \ - $(OBJS) - @echo - @echo '==== CREATING LIBRARY ========================================' - $(MAKE) lib - mv $(LIB) ../lib - -debug : - @$(MAKE) -f $(MAKE_FILE) "COMP_MODE=$@" check_mode - @echo - @echo '==== COMPILE =================================================' - @$(MAKE) -f $(MAKE_FILE) \ - "FFLAGS=$(FFLAGS_D)" \ - "CFLAGS=$(CFLAGS_D)" \ - $(OBJS) - @echo - @echo '==== LINK ====================================================' - @$(MAKE) -f $(MAKE_FILE) \ - "LIBS=$(LIBS_D)" "LDFLAGS=$(LDFLAGS_D)" \ - $(EXE_FILE) - -check_mode : - @if [ -e $(LOG_FILE) ]; then \ - if [ '$(COMP_MODE)' != `head -n 1 $(LOG_FILE)` ]; then \ - echo ;\ - echo "### COMPILE MODE WAS CHANGED ###" ;\ - $(MAKE) -f $(MAKE_FILE) clean ;\ - fi ;\ - else \ - echo ;\ - echo "### NO LOG FILE ###" ;\ - $(MAKE) -f $(MAKE_FILE) clean ;\ - fi - @echo $(COMP_MODE) > $(LOG_FILE) - -doclean: - - $(RM) *.tex *.dvi *.aux *.toc *.log *.ps *.pdf - diff --git a/src/global_angupdate/Makefile.conf.AIX b/src/global_angupdate/Makefile.conf.AIX deleted file mode 100644 index f16e3f56..00000000 --- a/src/global_angupdate/Makefile.conf.AIX +++ /dev/null @@ -1,111 +0,0 @@ -# This config file contains the compile options for compilation -# of the GSI code on the NCEP IBM SP. All production builds -# on NCEP IBM SP are 64-bit - -# ---------------------------------- -# Redefine variables for NCEP IBM SP -# ---------------------------------- -COREINC = /nwprod/lib/incmod -INCsfcio = $(COREINC)/sfcio_4 -INCsigio = $(COREINC)/sigio_4 -INCnemsio = $(COREINC)/nemsio -##INCcrtm = $(COREINC)/crtm_2.0.5 - -INCcrtm = /global/save/wx20ml/CRTM_REL-2.0.5/include -LIBcrtm = /global/save/wx20ml/CRTM_REL-2.0.5/lib/libCRTM.a - -WRFPATH=/nwprod/sorc/nam_nmm_real_fcst.fd -LIBwrfio_int = $(WRFPATH)/external/io_int/libwrfio_int.a -LIBwrfio_netcdf = $(WRFPATH)/external/io_netcdf/libwrfio_nf.a -INCnetcdf = /nwprod/lib/sorc/netcdf/netcdf-3.5.0/include -OBJwrf_frame_pk = $(WRFPATH)/frame/pack_utils.o -OBJwrf_sizeof_int = $(WRFPATH)/frame/module_machine.o -WRFLIB = $(LIBwrfio_int) $(LIBwrfio_netcdf) $(OBJwrf_frame_pk) $(OBJwrf_sizeof_int) - - -# Empty out definition of libs use by GMAO GSI building structure -LIBtransf = #-L$(CORELIB) -ltransf -LIBhermes = #-L$(CORELIB) -lhermes -LIBgfio = #-L$(CORELIB) -lgfio -INChdf = #-I$(BASEDIR)/$(ARCH)/include/hdf -LIBhdf = #-L$(BASEDIR)/$(ARCH)/lib -lmfhdf -ldf -lhdfjpeg -lhdfz -lsz - -# --------------------------- -# General targets/definitions -# --------------------------- - - AR = ar -X64 -v -q - -# ---------------------------- -# Fortran compiler and options -# ---------------------------- - - CF = ncepmpxlf95 - FC = $(CF) - -#--- Normal mode options - PROF= #-pg - OMP = -qsmp=noauto - - FFLAGS_F90 = -qfree=f90 -qsuffix=f=f90:cpp=F90 -WF,-Dibm_sp,-D_REAL8_ - - FFLAGS_COM_N = -I ./-qarch=auto -qmaxmem=-1 -q64 -O3 -qstrict - - FFLAGS_N = $(FFLAGS_F90) $(FFLAGS_COM_N) $(PROF) - - - -#--- Debug mode options - FFLAGS_COM_D = $(FFLAGS_COM_N) \ - -O0 -qdbg -qfullpath \ - -qsigtrap=xl__trcedump \ - -qinitauto=7FF7FFFF \ - -qflttrap=overflow:zero:enable \ - -qcheck \ - -qwarn64 \ - -qflag=i:i - - FFLAGS_D = $(FFLAGS_F90) $(FFLAGS_COM_D) - - - -# ---------------------- -# C Compiler and options -# ---------------------- - - CC = ncepcc - -#--- Normal mode options - - CFLAGS_N = -I ./ -O3 - -#--- Debug mode options - - CFLAGS_D = -I ./ -g - - -# ------------------ -# Linker and options -# ------------------ - - LD = $(CF) - -#--- Normal mode options - - LIBS_N = -L/nwprod/lib -lw3_4 - - LDFLAGS_N = -lessl_r -lmass -bloadmap:loadmap.txt \ - -bdatapsize:64K -bstackpsize:64K - - LDFLAGS = $(LDFLAGS_N) - -#--- Debug mode options - - LIBS_D = $(LIBS_N) -lhmd - - LDFLAGS_D = -lessl_r -lmass -bloadmap:loadmap.txt \ - -bdatapsize:64K -bstackpsize:64K - -#--- Empty out mpi library definition: embedded in compiler - - LIBmpi = diff --git a/src/global_angupdate/Makefile.conf.Linux b/src/global_angupdate/Makefile.conf.Linux deleted file mode 100755 index 6cb4e641..00000000 --- a/src/global_angupdate/Makefile.conf.Linux +++ /dev/null @@ -1,73 +0,0 @@ -# This config file contains the compile options for compilation -# of the GSI code on the NOAA HPCS. - -# ---------------------------------- -# Redefine variables for NOAA HPCS -# ---------------------------------- -COREINC = /home/mlueken/nwprod/incmod -CORELIB = /home/mlueken/nwprod/lib - - -# --------------------------- -# General targets/definitions -# --------------------------- - - AR = ar -v - -# ---------------------------- -# Fortran compiler and options -# ---------------------------- - - CF = mpif90 - FC = $(CF) - -#--- Normal mode options - PROF= #-pg - OMP = #-qsmp=noauto - - FFLAGS_F90 = -D_REAL8_ -fp-model strict -assume byterecl -g -traceback - FFLAGS_COM_N = -I ./ - FFLAGS_N = -O3 $(FFLAGS_F90) $(FFLAGS_COM_N) - -#--- Debug mode options - FFLAGS_COM_D = -I ./ -O0 -xHOST -traceback -assume byterecl -debug full -g - FFLAGS_D = $(FFLAGS_F90) $(FFLAGS_COM_D) - - -# ---------------------- -# C Compiler and options -# ---------------------- - - CC = gcc - -#--- Normal mode options - - CFLAGS_N = -DLINUX -Dfunder -I ./ -DFortranByte=char -DFortranInt=int -DFortranLlong='long long' -O3 $(PROF) - -#--- Debug mode options - - CFLAGS_D = -DLINUX -Dfunder -I ./ -DFortranByte=char -DFortranInt=int -DFortranLlong='long long' -g - - -# ------------------ -# Linker and options -# ------------------ - - LD = $(CF) - -#--- Normal mode options - LIBS_N = -L$(CORELIB) -lw3lib-1.9_d - - LDFLAGS_N = - - LDFLAGS = $(LDFLAGS_N) - -#--- Debug mode options - - LIBS_D = $(LIBS_N) - - LDFLAGS_D = - -#--- Empty out mpi library definition: embedded in compiler - - LIBmpi = diff --git a/src/global_angupdate/Makefile.conf.theia b/src/global_angupdate/Makefile.conf.theia deleted file mode 100755 index 81b0b363..00000000 --- a/src/global_angupdate/Makefile.conf.theia +++ /dev/null @@ -1,152 +0,0 @@ -# This config file contains the compile options for compilation -# of the GSI code on the NOAA HPCS. - -# ---------------------------------- -# Redefine variables for NOAA HPCS -# ---------------------------------- -# - -BACIO_VER = 2.0.1 -BUFR_VER = 10.2.5 -CRTM_VER = 2.2.1 -NEMSIO_VER = 2.2.1 -SFCIO_VER = 1.0.0 -SIGIO_VER = 2.0.1 -SP_VER = 2.0.2 -W3EMC_VER = 2.0.5 -W3NCO_VER = 2.0.6 - -CORELIB = /scratch3/NCEPDEV/nwprod/lib -CORECRTM = /scratch4/NCEPDEV/da/save/Michael.Lueken/nwprod/lib - -INCsfcio = $(CORELIB)/sfcio/v$(SFCIO_VER)/incmod/sfcio_v$(SFCIO_VER)_4 -INCsigio = $(CORELIB)/sigio/v$(SIGIO_VER)/incmod/sigio_v$(SIGIO_VER)_4 -INCnemsio= $(CORELIB)/nemsio/v$(NEMSIO_VER)/incmod/nemsio_v$(NEMSIO_VER) -INCw3 = $(CORELIB)/w3emc/v$(W3EMC_VER)/incmod/w3emc_v$(W3EMC_VER)_d -INCcrtm = $(CORECRTM)/crtm/$(CRTM_VER)/incmod/crtm_v$(CRTM_VER) - -BACIO_LIB4=$(CORELIB)/bacio/v$(BACIO_VER)/libbacio_v$(BACIO_VER)_4.a -BUFR_LIBd=$(CORELIB)/bufr/v$(BUFR_VER)/libbufr_v$(BUFR_VER)_d_64.a -CRTM_LIB=$(CORECRTM)/crtm/$(CRTM_VER)/libcrtm_v$(CRTM_VER).a -NEMSIO_LIB=$(CORELIB)/nemsio/v$(NEMSIO_VER)/libnemsio_v$(NEMSIO_VER).a -SFCIO_LIB=$(CORELIB)/sfcio/v$(SFCIO_VER)/libsfcio_v$(SFCIO_VER)_4.a -SIGIO_LIB=$(CORELIB)/sigio/v$(SIGIO_VER)/libsigio_v$(SIGIO_VER)_4.a -SP_LIBd=$(CORELIB)/sp/v$(SP_VER)/libsp_v$(SP_VER)_d.a -W3EMC_LIBd=$(CORELIB)/w3emc/v$(W3EMC_VER)/libw3emc_v$(W3EMC_VER)_d.a -W3NCO_LIBd=$(CORELIB)/w3nco/v$(W3NCO_VER)/libw3nco_v$(W3NCO_VER)_d.a - -WRFPATH = /scratch3/NCEPDEV/nceplibs/ext/WRF/3.7/WRFV3 -LIBwrfio_int = $(WRFPATH)/external/io_int/libwrfio_int.a -LIBwrfio_netcdf = $(WRFPATH)/external/io_netcdf/libwrfio_nf.a -OBJwrf_frame_pk = $(WRFPATH)/frame/pack_utils.o -OBJwrf_sizeof_int = $(WRFPATH)/frame/module_machine.o -WRFLIB = $(LIBwrfio_int) $(LIBwrfio_netcdf) $(OBJwrf_frame_pk) $(OBJwrf_sizeof_int) - -INCnetcdf = ${NETCDF}/include -LIBnetcdf = -L$(NETCDF)/lib -lnetcdf - -# Empty out definition of libs use by GMAO GSI building structure -LIBtransf = #-L$(CORELIB) -ltransf -LIBhermes = #-L$(CORELIB) -lhermes -LIBgfio = #-L$(CORELIB) -lgfio -INChdf = #-I$(BASEDIR)/$(ARCH)/include/hdf -LIBhdf = #-L$(BASEDIR)/$(ARCH)/lib -lmfhdf -ldf -lhdfjpeg -lhdfz -lsz - - -# --------------------------- -# General targets/definitions -# --------------------------- - - AR = ar -rv - -# ---------------------------- -# Fortran compiler and options -# ---------------------------- - - CF = mpif90 -f90=ifort - FC = $(CF) - -#--- Normal mode options - PROF= #-pg - OMP = #-qsmp=noauto - - FFLAGS_F90 = -D_REAL8_ -DWRF -openmp - - FFLAGS_COM_N = -I ./ -I $(INCcrtm) -I $(INCsfcio) -I $(INCsigio) -I $(INCnemsio) \ - -I $(INCnetcdf) -I $(INCw3) -O3 -traceback -convert big_endian -assume byterecl \ - -g -fp-model source - - FFLAGS_COM_N_NOSWAP = -I ./ -I $(INCcrtm) -I $(INCsfcio) -I $(INCsigio) \ - -I $(INCnemsio) -I $(INCnetcdf) -I $(INCw3) \ - -O3 -traceback -g -fp-model source \ - -convert big_endian -assume byterecl - - FFLAGS_N = $(FFLAGS_F90) $(FFLAGS_COM_N) $(PROF) - FFLAGS_NOSWAP_N = $(FFLAGS_F90) $(FFLAGS_COM_N_NOSWAP) $(PROF) - FFLAGS_f = $(FFLAGS_COM_N) $(PROF) - FFLAGS = $(FFLAGS_N) $(PROF) - - -#--- Debug mode options - FFLAGS_COM_D = -I ./ -I $(INCcrtm) -I $(INCsfcio) -I $(INCsigio) -I $(INCnemsio) \ - -I $(INCnetcdf) -I $(INCw3) \ - -O0 -fp-model strict -convert big_endian -assume byterecl \ - -implicitnone -g -traceback -debug \ - -ftrapuv -check all -fp-stack-check -fstack-protector -warn - FFLAGS_COM_NOSWAP_D = -I ./ -I $(INCcrtm) -I $(INCsfcio) -I $(INCsigio) \ - -I $(INCnemsio) -I $(INCnetcdf) -I $(INCw3) \ - -O0 -fp-model strict -convert big_endian -assume byterecl \ - -implicitnone -g -traceback -debug \ - -ftrapuv -check all -fp-stack-check -fstack-protector -warn - - FFLAGS_D = $(FFLAGS_F90) $(FFLAGS_COM_D) - FFLAGS_NOSWAP_D = $(FFLAGS_F90) $(FFLAGS_COM_NOSWAP_D) - - - -# ---------------------- -# C Compiler and options -# ---------------------- - - CC = gcc - -#--- Normal mode options - - CFLAGS_N = -DLINUX -Dfunder -I ./ -DFortranByte=char -DFortranInt=int -DFortranLlong='long long' -O3 $(PROF) - -#--- Debug mode options - - CFLAGS_D = -DLINUX -Dfunder -I ./ -DFortranByte=char -DFortranInt=int -DFortranLlong='long long' -g - - -# ------------------ -# Linker and options -# ------------------ - - LD = $(CF) -mkl -Wl,-Map,loadmap.txt - -#--- Normal mode options -# LIBS_N = -L$(CORELIB) -lsp_d -lnemsio -lbacio_4 -lsigio_4 \ -# -lsfcio_4 -lbufr_d_64 -lw3lib-2.0_d $(LIBcrtm) $(WRFLIB) $(LIBnetcdf) -# LIBS_N = -L$(CORELIB) -lsp_d -lnemsio -lbacio_4 -lsigio_4 \ -# -lsfcio -lbufr_d_64 -lw3nco_d -lw3emc_d -lcrtm_v2.1.3 $(WRFLIB) $(LIBnetcdf) - LIBS_N = $(SP_LIBd) $(NEMSIO_LIB) $(BACIO_LIB4) $(SIGIO_LIB) \ - $(SFCIO_LIB) $(BUFR_LIBd) $(W3NCO_LIBd) $(W3EMC_LIBd) \ - $(CRTM_LIB) $(WRFLIB) $(LIBnetcdf) -# -L../lib/GSD/gsdcloud4nmmb -lgsdcloud -# LIBS_N = $(LIBnemsio) -L$(CORELIB) -lsp_d -lsigio_4 \ -# -lsfcio_4 -lbufr_dc -lw3lib-2.0_d $(LIBcrtm) $(WRFLIB) $(LIBbacio) $(LIBnetcdf) - - LDFLAGS_N = - - LDFLAGS = $(LDFLAGS_N) - -#--- Debug mode options - - LIBS_D = $(LIBS_N) - - LDFLAGS_D = - -#--- Empty out mpi library definition: embedded in compiler - - LIBmpi = diff --git a/src/global_angupdate/Makefile.conf.wcoss b/src/global_angupdate/Makefile.conf.wcoss deleted file mode 100755 index e7b2b221..00000000 --- a/src/global_angupdate/Makefile.conf.wcoss +++ /dev/null @@ -1,76 +0,0 @@ -# This config file contains the compile options for compilation -# of the GSI code on the NOAA HPCS. - -# ---------------------------------- -# Redefine variables for NOAA HPCS -# ---------------------------------- -COREINC = /nwprod/lib/incmod -CORELIB = /nwprod/lib - - -# --------------------------- -# General targets/definitions -# --------------------------- - - AR = ar -v - -# ---------------------------- -# Fortran compiler and options -# ---------------------------- - - CF = mpfort - FC = $(CF) - -#--- Normal mode options - PROF= #-pg - OMP = #-openmp - - FFLAGS_F90 = -D_REAL8_ - FFLAGS_COM_N = -I ./ -O3 -fp-model strict -convert big_endian -assume byterecl \ - -implicitnone - FFLAGS_N = $(FFLAGS_F90) $(FFLAGS_COM_N) - -#--- Debug mode options - FFLAGS_COM_D = -I ./ -O0 -fp-model strict -convert big_endian -assume byterecl \ - -implicitnone -g -traceback -debug -check -warn - - FFLAGS_D = $(FFLAGS_F90) $(FFLAGS_COM_D) - - -# ---------------------- -# C Compiler and options -# ---------------------- - - CC = mpcc - -#--- Normal mode options - - CFLAGS_N = -DLINUX -Dfunder -I ./ -DFortranByte=char -DFortranInt=int -DFortranLlong='long long' -O3 - -#--- Debug mode options - - CFLAGS_D = -DLINUX -Dfunder -I ./ -DFortranByte=char -DFortranInt=int -DFortranLlong='long long' -g - - -# ------------------ -# Linker and options -# ------------------ - - LD = $(CF) - -#--- Normal mode options - LIBS_N = -L$(CORELIB) -lw3nco_4 - - LDFLAGS_N = -Wl,-Map,loadmap.txt - - LDFLAGS = $(LDFLAGS_N) - -#--- Debug mode options - - LIBS_D = $(LIBS_N) - - LDFLAGS_D = $(LDFLAGS_N) - -#--- Empty out mpi library definition: embedded in compiler - - LIBmpi = diff --git a/src/global_angupdate/Makefile.conf.zeus b/src/global_angupdate/Makefile.conf.zeus deleted file mode 100755 index 93ea9fcf..00000000 --- a/src/global_angupdate/Makefile.conf.zeus +++ /dev/null @@ -1,73 +0,0 @@ -# This config file contains the compile options for compilation -# of the GSI code on the NOAA HPCS. - -# ---------------------------------- -# Redefine variables for NOAA HPCS -# ---------------------------------- -COREINC = /scratch1/portfolios/NCEPDEV/da/save/Michael.Lueken/nwprod/incmod -CORELIB = /scratch1/portfolios/NCEPDEV/da/save/Michael.Lueken/nwprod/lib - - -# --------------------------- -# General targets/definitions -# --------------------------- - - AR = ar -v - -# ---------------------------- -# Fortran compiler and options -# ---------------------------- - - CF = ifort - FC = $(CF) - -#--- Normal mode options - PROF= #-pg - OMP = #-qsmp=noauto - - FFLAGS_F90 = -D_REAL8_ -fp-model strict -assume byterecl -g -traceback - FFLAGS_COM_N = -I ./ - FFLAGS_N = -O3 $(FFLAGS_F90) $(FFLAGS_COM_N) - -#--- Debug mode options - FFLAGS_COM_D = -I ./ -O0 -xHOST -traceback -assume byterecl -debug full -g - FFLAGS_D = $(FFLAGS_F90) $(FFLAGS_COM_D) - - -# ---------------------- -# C Compiler and options -# ---------------------- - - CC = gcc - -#--- Normal mode options - - CFLAGS_N = -DLINUX -Dfunder -I ./ -DFortranByte=char -DFortranInt=int -DFortranLlong='long long' -O3 $(PROF) - -#--- Debug mode options - - CFLAGS_D = -DLINUX -Dfunder -I ./ -DFortranByte=char -DFortranInt=int -DFortranLlong='long long' -g - - -# ------------------ -# Linker and options -# ------------------ - - LD = $(CF) -lmpi - -#--- Normal mode options - LIBS_N = -L$(CORELIB) -lw3lib-2.0_4 - - LDFLAGS_N = - - LDFLAGS = $(LDFLAGS_N) - -#--- Debug mode options - - LIBS_D = $(LIBS_N) - - LDFLAGS_D = - -#--- Empty out mpi library definition: embedded in compiler - - LIBmpi = diff --git a/src/global_angupdate/Makefile.dependency b/src/global_angupdate/Makefile.dependency deleted file mode 100644 index 8584f693..00000000 --- a/src/global_angupdate/Makefile.dependency +++ /dev/null @@ -1,4 +0,0 @@ -determine_time_levels.o : determine_time_levels.f90 -kinds.o : kinds.F90 -main.o : main.F90 read_diag.o -read_diag.o : read_diag.f90 kinds.o diff --git a/src/global_angupdate/configure b/src/global_angupdate/configure deleted file mode 100755 index efc913c5..00000000 --- a/src/global_angupdate/configure +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/sh -# -# Creates configuration Makefile. Before attempting to make anything -# in this directory, enter -# -# ./configure -# -# !REVISION HISTORY -# -# 09oct97 da Silva Initial code. -# 19oct97 da Silva Simplified. -# 22oct97 Jing Guo Converted to libpsas.a environment -# - special configuration for CRAY -# - fool-prove configuration -# - additional information -# 23dec99 da Silva Modified error messages. -# -#..................................................................... - -c=`basename $0 .sh` - -type=${1:-"unknown"} -echo $type - - -# If type=clean, remove soft links and exit -# ----------------------------------------- -if [ "$type" = "clean" ]; then - if [ -r makefile ]; then - echo "$c: remove makefile" 1>&2 - rm makefile - fi - if [ -r Makefile.conf ]; then - echo "$c: remove Makefile.conf" 1>&2 - rm Makefile.conf - fi - exit -fi - - -# Set makeconf based on user input -# --------------------------------------- -makeconf="Makefile.conf.$type" - - -# Node specific configuration -# --------------------------------------- -if [ ! -r ${makeconf} ]; then - echo "$c: cannot find ${makeconf} in `pwd`" 1>&2 - makeconf="Makefile.conf.`uname -n | awk '{print $1}'`" -fi - -# Machine specific -# ---------------- -if [ ! -r ${makeconf} ]; then - echo "$c: cannot find ${makeconf} in `pwd`" 1>&2 - machine="`uname -m | awk '{print $1}'`" - machine=`echo $machine | tr "[a-z]" "[A-Z]"` - compiler=$F90 - makeconf="Makefile.conf.`uname -s | awk '{print $1}'`" - makeconf="${makeconf}.${machine}.${compiler}" -fi - -# Site specific configuration -# --------------------------- -if [ ! -r ${makeconf} ]; then - echo "$c: cannot find ${makeconf} in `pwd`" 1>&2 - makeconf="Makefile.conf.`uname -s | awk '{print $1}'`" -fi - -# if the OS is UNICOS, it does not follow the convention -# ------------------------------------------------------ -if [ ! -r ${makeconf} ]; then - echo "$c: cannot find ${makeconf} in `pwd`" 1>&2 - mech="`uname -m | awk '{print $1}'`" - if [ "${mech}" = CRAY ]; then - makeconf="Makefile.conf.UNICOS" - fi -fi - -# Create soft link for Makefile.conf -# ------------------------------------------------------ -if [ -r Makefile.conf ]; then - echo "$c: remove Makefile.conf" 1>&2 - rm Makefile.conf -fi -ln -s ${makeconf} Makefile.conf - -echo "$c: using ${makeconf} in `pwd`" 1>&2 - -#. diff --git a/src/global_angupdate/determine_time_levels.f90 b/src/global_angupdate/determine_time_levels.f90 deleted file mode 100755 index 802f0a44..00000000 --- a/src/global_angupdate/determine_time_levels.f90 +++ /dev/null @@ -1,89 +0,0 @@ -subroutine determine_time_levels(iyy1,imm1,idd1,ihh1,& - iyy2,imm2,idd2,ihh2,dth,ntime,iyy,imm,idd,ihh,& - maxtim) -!$$$ subprogram documentation block -! . . . . -! subprogram: determine_time_levels deter time levls -! prgmmr: treadon org: np20 date: 2005-07-22 -! -! abstract: This routine counts the number of time levels -! between date1 and date2 when stepping by dth -! hours. -! -! program history log: -! 2005-07-22 treadon - original code -! -! input argument list: -! iyy1,imm1,idd1,ihh1 - starting year,month,day,hour -! iyy2,imm2,idd2,ihh2 - ending year,month,day,hour -! dth - time increment in hours -! -! output argument list: -! ntime - number of time levels between date1 and date2 -! iyy,imm,idd,ihh - array containing each time level -! -! attributes: -! language: f90 -! machine: ibm RS/6000 SP -! -!$$$ - implicit none - - real,parameter:: zero = 0.0 - - logical:: done - integer:: iyy1,imm1,idd1,ihh1,iyy2,imm2,idd2,ihh2 - integer:: ntime,maxtim - integer,dimension(maxtim):: iyy,imm,idd,ihh - integer,dimension(8):: ida,jda,lda - real:: dth - real,dimension(5):: fha - -!--------------------------------------------------------------------------- -! Load date/time arrays with starting and ending time levels - fha=zero - ida=0; lda=0 - fha(2)=dth - ida(1)=iyy1 - ida(2)=imm1 - ida(3)=idd1 - ida(4)=0 - ida(5)=ihh1 - jda=ida - - lda(1)=iyy2 - lda(2)=imm2 - lda(3)=idd2 - lda(4)=0 - lda(5)=ihh2 - -! Use w3 routine w3movdat to step from date1 to date2 -! at the interval of dth hours. Count the number of -! time levels between date1 and date2. - - ntime=0 - done=.false. - do while (.not.done) - ntime=ntime+1 - if (ntime>maxtim) then - write(6,*)'GLOBAL_ANGUPDATE: ***WARNING*** ntime=',ntime,' > ',maxtim - ntime=maxtim - endif - - if ( (jda(1)==lda(1)) .and. (jda(2)==lda(2)) .and. & - (jda(3)==lda(3)) .and. (jda(5)==lda(5)) ) then - done = .true. - endif - - iyy(ntime)=jda(1) - imm(ntime)=jda(2) - idd(ntime)=jda(3) - ihh(ntime)=jda(5) - - ida=jda - jda=0 - call w3movdat(fha,ida,jda) - - end do - return -end subroutine determine_time_levels diff --git a/src/global_angupdate/exglobal_angupdate.sh.ecf b/src/global_angupdate/exglobal_angupdate.sh.ecf deleted file mode 100755 index a4a238bd..00000000 --- a/src/global_angupdate/exglobal_angupdate.sh.ecf +++ /dev/null @@ -1,374 +0,0 @@ -#!/bin/ksh -################################################################################ -#### UNIX Script Documentation Block -# . . -# Script name: exglobal_angupdate.sh.sms -# Script description: Updates global_gsi angle dependent bias correction file -# -# Author: Russ Treadon Org: NP23 Date: 2010-04-26 -# -# Abstract: This script update the angle dependent bias correction file -# -# Script history log: -# 2010-04-28 Russ Treadon -# -# Input script positional parameters: -# 1 Input surface guess -# defaults to $SFCGES; required -# 2 Input guess angle dependent bias correction -# defaults to $GSATANG; required -# 3 Input radiance diagnostic file -# defaults to $RADSTAT; required -# 4 Output (updated) angle dependent bias correction -# defaults to $SATANGO, then to ${COMOUT}/${PREINP}satang -# -# Imported Shell Variables: -# SFCGES Input surface guess -# overridden by $1; required -# GSATANG Input guess angle dependent bias correction -# overridden by $2; required -# RADSTAT Output radiance assimilation statistics -# overridden by $3; required -# SATANGO Output updated angle dependent bias correction -# overridden by $4; defaults to ${COMIN}/${PREINP}${PREINP}satang -# FIXGLOBAL Directory for global fixed files -# defaults to /nwprod/fix -# EXECGLOBAL Directory for global executables -# defaults to /nwprod/exec -# USHGLOBAL Directory for global scripts -# defaults to /nwprod/ush -# DATA working directory -# (if nonexistent will be made, used and deleted) -# defaults to current working directory -# COMIN input directory -# defaults to current working directory -# COMOUT output directory -# (if nonexistent will be made) -# defaults to current working directory -# XC Suffix to add to executables -# defaults to none -# PREINP Prefix to add to input observation files -# defaults to none -# SUFINP Suffix to add to input observation files -# defaults to none -# NCP Copy command -# defaults to cp -# SFCHDR Command to read surface header -# defaults to ${EXECGLOBAL}/global_sfchdr$XC -# ANGUPDATEXEC Radiance angle dependent bias correction update executable -# defaults to ${EXECGLOBAL}/global_angupdate$XC -# SATANGL Input satellite angle bias file -# defaults to ${FIXGLOBAL}/global_satangbias.txt -# INISCRIPT Preprocessing script -# defaults to none -# LOGSCRIPT Log posting script -# defaults to none -# ERRSCRIPT Error processing script -# defaults to 'eval [[ $err = 0 ]]' -# ENDSCRIPT Postprocessing script -# defaults to none -# CDATE Current analysis date in yyyymmddhh format -# defaults to the value in the input surface file header -# NTHREADS_ANG Number of threads for ANGUPDATEXEC -# defaults to 1 -# NTHSTACK_ANG Size of stack per thread for ANGUPDATEXEC -# defaults to 64000000 -# FILESTYLE File management style flag -# ('C' to copy to/from $DATA, 'L' for symbolic links in $DATA, -# 'X' to use XLFUNIT or symbolic links where appropriate) -# defaults to 'X' -# PGMOUT Executable standard output -# defaults to $pgmout, then to '&1' -# PGMERR Executable standard error -# defaults to $pgmerr, then to '&1' -# pgmout Executable standard output default -# pgmerr Executable standard error default -# REDOUT standard output redirect ('1>' or '1>>') -# defaults to '1>', or to '1>>' to append if $PGMOUT is a file -# REDERR standard error redirect ('2>' or '2>>') -# defaults to '2>', or to '2>>' to append if $PGMERR is a file -# VERBOSE Verbose flag (YES or NO) -# defaults to NO -# -# Exported Shell Variables: -# PGM Current program name -# pgm -# ERR Last return code -# err -# -# Modules and files referenced: -# scripts : $INISCRIPT -# $LOGSCRIPT -# $ERRSCRIPT -# $ENDSCRIPT -# -# programs : $CYCLEXEC -# $GSIEXEC -# $ANGUPDATEXEC -# -# fixed data : $SATANGL -# -# input data : $GSATANG -# $RADSTAT -# -# output data: $SATANGO -# -# Remarks: -# -# Condition codes -# 0 - no problem encountered -# >0 - some problem encountered -# -# Control variable resolution priority -# 1 Command line argument. -# 2 Environment variable. -# 3 Inline default. -# -# Attributes: -# Language: POSIX shell -# Machine: IBM SP / Zeus / Gaea -# -################################################################################ -# Set environment. -export VERBOSE=${VERBOSE:-"NO"} -if [[ "$VERBOSE" = "YES" ]] -then - echo $(date) EXECUTING $0 $* >&2 - set -x -fi -export machine=${machine:-IBMP6} -export machine=$(echo $machine|tr '[a-z]' '[A-Z]') - -# Command line arguments. -export APRUN=${APRUN:-""} -export SFCGES=${1:-${SFCGES:?}} -export GSATANG=${2:-${GSATANG:?}} -export RADSTAT=${3:-${RADSTAT:?}} -export SATANGO=${4:-${SATANGO:?}} -# Directories. -export HOMEDIR=${HOMEDIR:-/nwprod} -export NWPROD=${NWPROD:-$HOMEDIR} -export FIXSUBDA=${FIXSUBDA:-fix/fix_am} -export FIXGLOBAL=${FIXGLOBAL:-$NWPROD/$FIXSUBDA} -export EXECGLOBAL=${EXECGLOBAL:-$NWPROD/exec} -export USHGLOBAL=${USHGLOBAL:-$NWPROD/ush} -export utilscript=${utilscript:-$NWPROD/util/ush} -export DATA=${DATA:-$(pwd)} -export COMIN=${COMIN:-$(pwd)} -export COMOUT=${COMOUT:-$(pwd)} -# Filenames. -export XC=${XC} -export PREINP=${PREINP} -export SUFINP=${SUFINP} -export SFCHDR=${SFCHDR:-${EXECGLOBAL}/global_sfchdr$XC} -export ANGUPDATEXEC=${ANGUPDATEXEC:-${EXECGLOBAL}/global_angupdate$XC} -export SATANGL=${SATANGL:-${FIXGLOBAL}/global_satangbias.txt} -export INISCRIPT=${INISCRIPT} -export ERRSCRIPT=${ERRSCRIPT:-'eval [[ $err = 0 ]]'} -export LOGSCRIPT=${LOGSCRIPT} -export ENDSCRIPT=${ENDSCRIPT} -# Other variables. -export CDATE=${CDATE:-$($SFCHDR $SFCGES VDATE||echo 0)} -export SETUPANG=${SETUPANG:-""} -export OBSINPUTANG=${OBSINPUTANG:-""} -export NTHREADS_ANG=${NTHREADS_ANG:-1} -export NTHSTACK_ANG=${NTHSTACK_ANG:-64000000} -export FILESTYLE=${FILESTYLE:-'X'} -export PGMOUT=${PGMOUT:-${pgmout:-'&1'}} -export PGMERR=${PGMERR:-${pgmerr:-'&2'}} -export NCP=${NCP:-cp} -if [ $machine = IBMP6 ] ; then - typeset -L1 l=$PGMOUT - [[ $l = '&' ]]&&a=''||a='>' - export REDOUT=${REDOUT:-'1>'$a} - typeset -L1 l=$PGMERR - [[ $l = '&' ]]&&a=''||a='>' - export REDERR=${REDERR:-'2>'$a} - COMPRESS=compress - UNCOMPRESS=uncompress -else - export REDOUT=${REDOUT:-'1>'} - export REDERR=${REDERR:-'2>'} - COMPRESS=${COMPRESS:-gzip} - UNCOMPRESS=${UNCOMPRESS:-gunzip} -fi - -################################################################################ -# Preprocessing -$INISCRIPT -pwd=$(pwd) -if [[ -d $DATA ]] -then - mkdata=NO -else - mkdir -p $DATA - mkdata=YES -fi -cd $DATA||exit 99 - - -################################################################################ -# Update angle dependent bias -if [ $machine = IBMP6 ] ; then - export XLSMPOPTS="parthds=$NTHREADS_ANG:stack=$NTHSTACK_ANG" -fi -export OMP_NUM_THREADS=$NTHREADS_ANG -export PGM='$APRUN $ANGUPDATEXEC' -export pgm=$PGM -$LOGSCRIPT - -iy=$(echo $CDATE|cut -c1-4) -im=$(echo $CDATE|cut -c5-6) -id=$(echo $CDATE|cut -c7-8) -ih=$(echo $CDATE|cut -c9-10) - -rm global_angupdate.namelist -rm satbias_angle satbias_ang.in radstat - - -if [[ $FILESTYLE = 'C' ]] -then - # Fixed fields - $NCP $SATANGL satbias_angle - - # Required guess fields - $NCP $GSATANG satbias_ang.in - $NCP $RADSTAT radstat - -else - # Fixed fields - ln -fs $SATANGL satbias_angle - - # Guess fields - ln -fs $GSATANG satbias_ang.in - ln -fs $RADSTAT radstat - - # Output file - ln -fs $SATANGO satbias_ang.out -fi - -# local input files assumed to already exist are -# ./satbias_ang.in -# radiance diagnostic files - -if [[ ! -s satbias_ang.in ]]; then - $NCP ./satbias_angle ./satbias_ang.in -fi - -# Extract sensor specific diagnostic files from radstat file -tar -xvf radstat -rm -f diag_*_anl.$CDATE.* - - -# List of sensor specific diagnostic files - listrad="hirs2_n14 msu_n14 sndr_g08 sndr_g11 sndr_g12 sndr_g13 sndr_g08_prep sndr_g11_prep sndr_g12_prep sndr_g13_prep sndrd1_g11 sndrd2_g11 sndrd3_g11 sndrd4_g11 sndrd1_g12 sndrd2_g12 sndrd3_g12 sndrd4_g12 sndrd1_g13 sndrd2_g13 sndrd3_g13 sndrd4_g13 sndrd1_g14 sndrd2_g14 sndrd3_g14 sndrd4_g14 sndrd1_g15 sndrd2_g15 sndrd3_g15 sndrd4_g15 hirs3_n15 hirs3_n16 hirs3_n17 amsua_n15 amsua_n16 amsua_n17 amsub_n15 amsub_n16 amsub_n17 hsb_aqua airs_aqua amsua_aqua imgr_g08 imgr_g11 imgr_g12 ssmi_f13 ssmi_f14 imgr_g14 imgr_g15 ssmi_f15 hirs4_n18 hirs4_metop-a amsua_n18 amsua_metop-a mhs_n18 mhs_metop-a amsre_low_aqua amsre_mid_aqua amsre_hig_aqua ssmis_las_f16 ssmis_uas_f16 ssmis_img_f16 ssmis_env_f16 ssmis_las_f17 ssmis_uas_f17 ssmis_img_f17 ssmis_env_f17 ssmis_las_f18 ssmis_uas_f18 ssmis_img_f18 ssmis_env_f18 ssmis_las_f19 ssmis_uas_f19 ssmis_img_f19 ssmis_env_f19 ssmis_las_f20 ssmis_uas_f20 ssmis_img_f20 ssmis_env_f20 iasi_metop-a hirs4_n19 amsua_n19 mhs_n19 seviri_m08 seviri_m09 seviri_m10 cris_npp atms_npp hirs4_metop-b amsua_metop-b mhs_metop-b iasi_metop-b" -for type in $listrad; do - if [[ -s diag_${type}_ges.$CDATE.Z || -s diag_${type}_ges.$CDATE.gz ]]; then - $UNCOMPRESS diag_${type}_ges.$CDATE - ln -fs diag_${type}_ges.$CDATE ./diag_${type}.$CDATE - fi -done - -# output file created by program is -# $SATANGO = ./satbias_ang.out - -# Create global_angupdate namelist -cat < global_angupdate.namelist - &SETUP - jpch=2680,nstep=90,nsize=20,wgtang=0.008333333,wgtlap=0.0, - iuseqc=1,dtmax=1.0, - iyy1=${iy},imm1=${im},idd1=${id},ihh1=${ih}, - iyy2=${iy},imm2=${im},idd2=${id},ihh2=${ih}, - dth=06,ndat=50, - $SETUPANG - / - &OBS_INPUT - dtype(01)='hirs3', dplat(01)='n17', dsis(01)='hirs3_n17', - dtype(02)='hirs4', dplat(02)='metop-a', dsis(02)='hirs4_metop-a', - dtype(03)='goes_img', dplat(03)='g11', dsis(03)='imgr_g11', - dtype(04)='goes_img', dplat(04)='g12', dsis(04)='imgr_g12', - dtype(05)='airs', dplat(05)='aqua', dsis(05)='airs281SUBSET_aqua', - dtype(06)='amsua', dplat(06)='n15', dsis(06)='amsua_n15', - dtype(07)='amsua', dplat(07)='n18', dsis(07)='amsua_n18', - dtype(08)='amsua', dplat(08)='metop-a', dsis(08)='amsua_metop-a', - dtype(09)='amsua', dplat(09)='aqua', dsis(09)='amsua_aqua', - dtype(10)='mhs', dplat(10)='n18', dsis(10)='mhs_n18', - dtype(11)='mhs', dplat(11)='metop-a', dsis(11)='mhs_metop-a', - dtype(12)='ssmi', dplat(12)='f15', dsis(12)='ssmi_f15', - dtype(13)='amsre_low', dplat(13)='aqua', dsis(13)='amsre_aqua', - dtype(14)='amsre_mid', dplat(14)='aqua', dsis(14)='amsre_aqua', - dtype(15)='amsre_hig', dplat(15)='aqua', dsis(15)='amsre_aqua', - dtype(16)='ssmis_las', dplat(16)='f16', dsis(16)='ssmis_f16', - dtype(17)='ssmis_uas', dplat(17)='f16', dsis(17)='ssmis_f16', - dtype(18)='ssmis_img', dplat(18)='f16', dsis(18)='ssmis_f16', - dtype(19)='ssmis_env', dplat(19)='f16', dsis(19)='ssmis_f16', - dtype(20)='sndrd1', dplat(20)='g12', dsis(20)='sndrD1_g12', - dtype(21)='sndrd2', dplat(21)='g12', dsis(21)='sndrD2_g12', - dtype(22)='sndrd3', dplat(22)='g12', dsis(22)='sndrD3_g12', - dtype(23)='sndrd4', dplat(23)='g12', dsis(23)='sndrD4_g12', - dtype(24)='sndrd1', dplat(24)='g11', dsis(24)='sndrD1_g11', - dtype(25)='sndrd2', dplat(25)='g11', dsis(25)='sndrD2_g11', - dtype(26)='sndrd3', dplat(26)='g11', dsis(26)='sndrD3_g11', - dtype(27)='sndrd4', dplat(27)='g11', dsis(27)='sndrD4_g11', - dtype(28)='sndrd1', dplat(28)='g13', dsis(28)='sndrD1_g13', - dtype(29)='sndrd2', dplat(29)='g13', dsis(29)='sndrD2_g13', - dtype(30)='sndrd3', dplat(30)='g13', dsis(30)='sndrD3_g13', - dtype(31)='sndrd4', dplat(31)='g13', dsis(31)='sndrD4_g13', - dtype(32)='iasi', dplat(32)='metop-a', dsis(32)='iasi616_metop-a', - dtype(33)='hirs4', dplat(33)='n19', dsis(33)='hirs4_n19', - dtype(34)='amsua', dplat(34)='n19', dsis(34)='amsua_n19', - dtype(35)='mhs', dplat(35)='n19', dsis(35)='mhs_n19', - dtype(36)='amsub', dplat(36)='n17', dsis(36)='amsub_n17', - dtype(37)='hirs4', dplat(37)='metop-b', dsis(37)='hirs4_metop-b', - dtype(38)='amsua', dplat(38)='metop-b', dsis(38)='amsua_metop-b', - dtype(39)='mhs', dplat(39)='metop-b', dsis(39)='mhs_metop-b', - dtype(40)='iasi', dplat(40)='metop-b', dsis(40)='iasi616_metop-b', - dtype(41)='atms', dplat(41)='npp', dsis(41)='atms_npp', - dtype(42)='cris', dplat(42)='npp', dsis(42)='cris_npp', - dtype(43)='sndrd1', dplat(43)='g14', dsis(43)='sndrD1_g14', - dtype(44)='sndrd2', dplat(44)='g14', dsis(44)='sndrD2_g14', - dtype(45)='sndrd3', dplat(45)='g14', dsis(45)='sndrD3_g14', - dtype(46)='sndrd4', dplat(46)='g14', dsis(46)='sndrD4_g14', - dtype(47)='sndrd1', dplat(47)='g15', dsis(47)='sndrD1_g15', - dtype(48)='sndrd2', dplat(48)='g15', dsis(48)='sndrD2_g15', - dtype(49)='sndrd3', dplat(49)='g15', dsis(49)='sndrD3_g15', - dtype(50)='sndrd4', dplat(50)='g15', dsis(50)='sndrD4_g15', - $OBSINPUTANG - / -EOF - -# Run global_angupdate program -eval $PGM < global_angupdate.namelist $REDOUT$PGMOUT $REDERR$PGMERR -rc=$? - -export ERR=$? -export err=$ERR -$ERRSCRIPT||exit 2 - -if [[ $FILESTYLE = 'C' ]] -then - # Output file - $NCP satbias_ang.out $SATANGO -fi - -################################################################################ - -#if test "$RUN" = 'gdas1' -#then - #if test "$SENDDBN" = 'YES' - #then - #$DBNROOT/bin/dbn_alert MODEL GDAS1_MSC_satang $job $SATANGO - #fi -#fi - -################################################################################ -# Postprocessing -cd $pwd -[[ $mkdata = YES ]]&&rmdir $DATA -$ENDSCRIPT -set +x -if [[ "$VERBOSE" = "YES" ]] -then - echo $(date) EXITING $0 with return code $err >&2 -fi -exit $err diff --git a/src/global_angupdate/kinds.F90 b/src/global_angupdate/kinds.F90 deleted file mode 120000 index aae97dd9..00000000 --- a/src/global_angupdate/kinds.F90 +++ /dev/null @@ -1 +0,0 @@ -../../src/gsi/kinds.F90 \ No newline at end of file diff --git a/src/global_angupdate/main.F90 b/src/global_angupdate/main.F90 deleted file mode 100755 index d7dab85a..00000000 --- a/src/global_angupdate/main.F90 +++ /dev/null @@ -1,696 +0,0 @@ -program main -!$$$ main program documentation block -! . . . . -! main program: GLOBAL_ANGUPATE -! PRGMMR: TREADON ORG: NP20 DATE: 2005-07-22 -! -! abstract: This program reads radiance diagnostic files, computes -! the scan angle dependent component of the bias, and then combines -! it as a weighted average with an input angle dependent file. -! -! program history log: -! 01-01-09 treadon initial code -! 02-01-12 treadon major rewrite to accomodate new diagnostic -! file format and use mpi -! 2005-07-22 treadon major rewrite to simplify and clean up -! 2006-03-02 treadon simplify code and rewrite i/o to handle -! ncep-gsi-2006_03 gsi release format -! 2012-11-08 acollard Allow number of scan positions to be specified in the -! satang file itself. -! -! usage: -! input files: -! lnangl - scan angle dependent bias correction file -! lndiag - radiance diagnostic file -! -! scratch files: -! lntemp - contain sample sum and sample size -! -! output files: -! lnupdt - updated scan angle dependent bias correction file -! -! subprograms called: -! determine_time_levels - determine number of time levels -! read_diag_data - read diagnostic file -! -! library: -! mpi, w3 -! -! exit states: -! cond = 0 - successful run -! = 98 - inconsistent satellite/sensor identifiers -! = 99 - problem reading input satang file -! -! -! attributes: -! language: f90 -! machine: ibm RS/6000 SP -! -!$$$ - use mpi - use read_diag - implicit none - -! Declare local parameters - integer,parameter:: lnangl = 11 - integer,parameter:: lnmlst = 12 - integer,parameter:: lndiag = 21 - integer,parameter:: lntemp = 51 - integer,parameter:: lnupdt = 52 - - integer,parameter:: maxtim = 1500 - integer,parameter:: maxchn = 3000 - integer,parameter:: maxdat = 100 - - real,parameter:: zero = 0.0 - real,parameter:: one = 1.0 - - -! Declare local variables - logical outask,lexist,done,update,restart,retrieval - - character(6) :: word - character(10):: obstype,platid - character(11):: dstring - character(20):: satsens,satsens_id - character(25):: fstring - character(15):: string - character(50):: diag_rad,dname,sname,fname - character(10),dimension(maxdat):: dtype,dplat - character(20),dimension(maxdat):: dsis - character(20),allocatable,dimension(:):: satsensor0,satsensor2,satsensor3 - - integer:: ix,ii,iii,ndat,ich,ndatppe - integer:: nstep = 90 ! Default value which may be over-written by namelist - ! and by the satang file itself - integer:: i,j,mype_out,nsize,n_chan - integer:: jpch,ierror,npe,mype,jj,ntime,it,ierror_code - integer:: iyy1,imm1,idd1,ihh1,iyy2,imm2,idd2,ihh2 - integer:: istatus,ispot,iuseqc - integer:: npred,ipchan - integer,dimension(maxchn):: io_chan - integer,dimension(maxtim):: iyy,imm,idd,ihh - integer,dimension(maxdat):: ipoint - integer,allocatable,dimension(:):: jchanum0,jchanum2,jchanum3 - - real:: wgtang,wgtlap,scan,dtmax,bias,tlap,x,y,dth,ratio,rsize,errinv - real,allocatable,dimension(:):: tsum,tlap0,tlap1,tlap2,tlap3,tcnt - real,allocatable,dimension(:,:):: csum,count,c_ang0,c_ang1,c_ang2,c_ang3 - - -! Declare types used for reading satellite data - type(diag_header_fix_list ) :: header_fix - type(diag_header_chan_list),allocatable :: header_chan(:) - type(diag_data_name_list ) :: data_name - type(diag_data_fix_list ) :: data_fix - type(diag_data_chan_list ),allocatable :: data_chan(:) - type(diag_data_extra_list ),allocatable :: data_extra(:,:) - - -! Declare namelists for user input - namelist /setup/ jpch,nstep,nsize,wgtang,wgtlap,iuseqc,dtmax,& - iyy1,imm1,idd1,ihh1,iyy2,imm2,idd2,ihh2,dth,ndat - - namelist /obs_input/ dtype,dplat,dsis - -!************************************************************************ -! MPI setup - call mpi_init(ierror) - call mpi_comm_size(mpi_comm_world,npe,ierror) - call mpi_comm_rank(mpi_comm_world,mype,ierror) - mype_out=npe-1 - - npred=7 ! number of bias correction predictors - retrieval=.false. ! .true. if bisst present - - outask=.false. - if (mype==mype_out) outask=.true. - if (outask) call w3tagb('GLOBAL_ANGUPDATE',1999,0232,0055,'NP23') - - -! Read and echo namelist input -#ifdef ibm_sp - read(5,setup) - read(5,obs_input) -#else - open(unit=lnmlst,file='global_angupdate.namelist') - read(lnmlst,setup) - read(lnmlst,obs_input) - close(lnmlst) -#endif - - rsize=zero - if (nsize>0) rsize=one/float(nsize) - if (outask) then - write(6,setup) - write(6,*)'nsize,rsize=',nsize,rsize - do i=1,ndat - write(6,*) i,dtype(i),dplat(i),dsis(i) - end do - endif - - -! Loop from start to end times to determine how many time levels - call determine_time_levels(iyy1,imm1,idd1,ihh1,& - iyy2,imm2,idd2,ihh2,dth,ntime,iyy,imm,idd,ihh,& - maxtim) - restart=.false. - if (ntime>1) restart=.true. - if (outask) then - write(6,*)' ' - write(6,*)'Start time: ',iyy1,imm1,idd1,ihh1 - write(6,*)'End time : ',iyy2,imm2,idd2,ihh2 - write(6,*)'Time incr : ',dth - write(6,*)'ntime = ',ntime - do it=1,ntime - write(6,*)'it,idate=',it,iyy(it),imm(it),idd(it),ihh(it) - end do - write(6,*)' ' - - if (ntime>1) then - write(6,*)' ' - write(6,*)'Since ntime=',ntime,' > 1, set restart=',restart,' --> ignore input satang' - write(6,*)' ' - endif - endif - - -! Allocate and initialize data arrays - allocate(tsum(jpch),tlap1(jpch),tcnt(jpch)) - -! Read input satang file - open(lnangl,file='satbias_ang.in',form='formatted') - read(lnangl,'(a6)') word - rewind(lnangl) - if (word == 'nscan=') read(lnangl,'(6x,i8)') nstep - - if (nstep <= 0 .OR. nstep > 1000) then - write(6,*)'GLOBAL_ANGUPDATE: nscan out of range: ',nstep - stop - endif - - allocate(csum(nstep,jpch),c_ang1(nstep,jpch)) - allocate(count(nstep,jpch)) - allocate(satsensor0(jpch),jchanum0(jpch),tlap0(jpch),c_ang0(nstep,jpch)) - allocate(satsensor2(jpch),jchanum2(jpch),tlap2(jpch),c_ang2(nstep,jpch)) - allocate(satsensor3(jpch),jchanum3(jpch),tlap3(jpch),c_ang3(nstep,jpch)) - - do j=1,jpch - tsum(j)=zero - tcnt(j)=zero - tlap0(j)=zero - tlap1(j)=zero - tlap2(j)=zero - tlap3(j)=zero - do i=1,nstep - csum(i,j)=zero - count(i,j)=zero - c_ang0(i,j)=zero - c_ang1(i,j)=zero - c_ang2(i,j)=zero - c_ang3(i,j)=zero - end do - end do - do j=1,jpch - read(lnangl,110,err=120,end=120) ich,satsensor0(j),& - jchanum0(j),tlap0(j),(c_ang0(i,j),i=1,nstep) - end do -110 format(I5,1x,A20,1x,I5,e15.6/100(4x,10f7.3/)) - -! If restart, zero tlap0 and c_ang0 - if (restart) then - do j=1,jpch - tlap0(j)=zero - end do - do j=1,jpch - do i=1,nstep - c_ang0(i,j)=zero - end do - end do - endif - - goto 130 - -120 continue - write(6,*)'***WARNING*** EOF or ERROR reading input satang file' - stop 99 - -130 continue - close(lnangl) - - -! Assign each satellite/sensor to a mpi task - ndatppe=0 - ix=0 - ipoint=0 - do i=1,ndat - if(ix >= npe )ix=ix-npe - if(ix == mype)then - ndatppe=ndatppe+1 - ipoint(ndatppe)=i - end if - ix=ix+1 - end do - - -! Loop over mpi tasks. Each task processes a given set of satellite/sensors - do ii=1,ndatppe - iii=ipoint(ii) - obstype=dtype(iii) - platid=dplat(iii) - satsens_id=dsis(iii) - - fstring = 'diag_' // trim(dtype(iii)) // '_' // trim(dplat(iii)) - - tsum=zero - tcnt=zero - tlap1=zero - tlap2=zero - csum=zero - count=zero - c_ang1=zero - c_ang2=zero - - update=.false. -! Loop over times - loopt: do it=1,ntime - -! Create diagnostic filename for it-th date/time - write(dstring,140) iyy(it),imm(it),idd(it),ihh(it) -140 format('.',i4.4,3i2.2) - diag_rad = trim(fstring) // trim(dstring) - -! See if diagnostic file exists - inquire(file=diag_rad,exist=lexist) - string = ' skipping file ' - if (lexist) string = ' processing ' - write(6,*)' Task ',mype,string,trim(diag_rad),' with exist=',lexist - if (.not.lexist) cycle loopt - -! Open file and read header - open(lndiag,file=diag_rad,form='unformatted',status='old',iostat=istatus) - if (istatus/=0) then - write(6,*)' Task ',mype,' problem opening file ',trim(diag_rad),' iostat=',istatus - close(lndiag) - cycle loopt - endif - - call read_radiag_header(lndiag,npred,retrieval,header_fix,header_chan,data_name,istatus) - if (istatus/=0) then - write(6,*)' Task ',mype,' problem reading header for file ',trim(diag_rad),' iostat=',istatus - close(lndiag) - cycle loopt - endif - -! Process file - update = .true. - satsens = header_fix%isis - n_chan = header_fix%nchan - ipchan = header_fix%ipchan - -! Check for consistency between specified and retrieved satellite id - if (satsens /= satsens_id) then - write(6,*)'***ERROR*** inconsistent satellite ids' - write(6,*)' diag_rad= ',trim(diag_rad) - write(6,*)' satsens,satsens_id=',satsens,satsens_id - ierror_code=99 - call mpi_abort(mpi_comm_world,ierror_code,ierror) - stop 98 - endif - -! Extract satinfo relative index - do j=1,n_chan - io_chan(j) = real( header_chan(j)%iochan, 4 ) - end do - -! Loop to read diagnostic file - istatus = 0 - loopd: do while (istatus == 0) - -! Read a record. If read flag, istatus does not equal zero, exit loopd - call read_radiag_data( lndiag, header_fix, retrieval, data_fix, data_chan, data_extra, istatus ) - if( istatus /= 0 ) exit loopd - -! Extract scan angle, lat, lon - scan = data_fix%senscn_pos - ispot = nint(scan) - -! Channel loop - loopc: do j = 1, n_chan - -! Check for reasonable obs-ges and observed Tb. -! If the o-g difference is too large (> 200 K, very genereous!) -! of the observation is too cold (<50 K) or too warm (>500 K), -! do not use this observation in computing the update to the -! angle dependent bias. - if( ( abs(data_chan(j)%omgnbc) > 200. .or. & - data_chan(j)%tbobs < 50. .or. & - data_chan(j)%tbobs > 500. ) ) then - cycle loopc - end if - -! If iuseqc flag is >0 (i.e., 1), check variance. If -! errinv= (1 /(obs error)) is small (small = less than 1.e-6) -! the observation did not pass quality control. In this -! case, do not use this observation in computing the update -! to the angle dependent bias - if ( (iuseqc>0) .and. (data_chan(j)%errinv<1.e-6) ) then - cycle loopc - end if - -! If iuseqc flag is <=0 (i.e., 0 or -1), ensure (o-g)dtmax ) then - cycle loopc - end if - -! Add values to running sums. - -! NOTE the modification for the goes imager radiance: For -! first 10 and last 30 scan position (nstep=90 so 60 to nstep is 30), -! accumulate sum over all positions in range 1-10, 60-step. This is -! done to increase the sample size for the statistics. - - x = data_chan(j)%tbobs - data_chan(j)%omgnbc ! simulated Tb (no bias correction) - y = data_chan(j)%tbobs ! observed Tb - errinv = data_chan(j)%errinv - if (iuseqc<=0) errinv=one - - jj = io_chan(j) - bias = (y - x) - c_ang0(ispot,jj) - tlap = data_chan(j)%tlap - tlap0(jj) - - if (obstype=='goesimg') then - if (ispot<=10) then - do i=1,10 - c_ang1(i,jj) = c_ang1(i,jj) + bias*errinv - csum(i,jj) = csum(i,jj) + errinv - count(i,jj) = count(i,jj) + one - end do - tlap1(jj) = tlap1(jj) + tlap*errinv - tsum(jj) = tsum(jj) + errinv - tcnt(jj) = tcnt(jj) + one - else if(ispot >=60) then - do i=60,nstep - c_ang1(i,jj) = c_ang1(i,jj) + bias*errinv - csum(i,jj) = csum(i,jj) + errinv - count(i,jj) = count(i,jj) + one - end do - tlap1(jj) = tlap1(jj) + tlap*errinv - tsum(jj) = tsum(jj) + errinv - tcnt(jj) = tcnt(jj) + one - endif - else - c_ang1(ispot,jj)= c_ang1(ispot,jj)+ bias*errinv - csum(ispot,jj) = csum(ispot,jj) + errinv - count(ispot,jj) = count(ispot,jj) + one - tlap1(jj) = tlap1(jj) + tlap*errinv - tsum(jj) = tsum(jj) + errinv - tcnt(jj) = tcnt(jj) + one - end if - - enddo loopc ! channel loop - -! End of loop over diagnostic file - enddo loopd - close(lndiag) - -! End of loop over time - end do loopt - -! If diagnostic file for at least one time was read, compute statistcs - if (update) then - -! Compute mean - do j = 1,n_chan - jj=io_chan(j) - - if(tcnt(jj) >= nsize) then - tlap2(jj) = tlap0(jj) + wgtlap*tlap1(jj)/tsum(jj) - elseif (tcnt(jj)>0) then - ratio = max(zero,min(tcnt(jj)*rsize,one)) - tlap2(jj) = tlap0(jj) + ratio*wgtlap*tlap1(jj)/tsum(jj) - else - tlap2(jj) = tlap0(jj) - endif - - do i=1,nstep - if(count(i,jj) >= nsize) then - c_ang2(i,jj)=c_ang0(i,jj) + wgtang*c_ang1(i,jj)/csum(i,jj) - elseif (count(i,jj)>0) then - ratio = max(zero,min(count(i,jj)*rsize,one)) - c_ang2(i,jj)=c_ang0(i,jj) + ratio*wgtang*c_ang1(i,jj)/csum(i,jj) - else - c_ang2(i,jj)=c_ang0(i,jj) - endif - - end do - end do - - -! Write updated angle bias and sample size to scratch files - dname = 'update_' // trim(obstype) // '_' // trim(platid) - open(lntemp,file=dname,form='formatted') - do j=1,n_chan - jj=io_chan(j) - write(lntemp,210) jj,satsensor0(jj),jchanum0(jj),& - tlap2(jj),(c_ang2(i,jj),i=1,nstep) -210 format(I5,1x,A20,1x,I5,e15.6/9(4x,10e13.6/)) - end do - close(lntemp) - -! Sample size scratch file only for additional information. - sname = 'sample_' // trim(obstype) // '_' // trim(platid) - open(lntemp,file=sname,form='formatted') - do j=1,n_chan - jj=io_chan(j) - write(lntemp,210) jj,satsensor0(jj),jchanum0(jj),& - tlap2(jj),(csum(i,jj),i=1,nstep) - end do - close(lntemp) - -! End of update block - endif - -! End of loop over satellite/sensor types - end do - - -! Wait for all mpi tasks to finish processing the -! satellite/sensors assigned to them. - - write(6,*)' Wait after satellite/sensor loop' - call mpi_barrier(mpi_comm_world,ierror) - - -! Let a single task combine the satellite/sensor specific -! update files together - if (outask) then - -! Initialize output arrays to intial satang values read in - write(6,*)' ' - write(6,*)' Initialize output arrays to input values' - tlap3=tlap0 - c_ang3=c_ang0 - satsensor3=satsensor0 - jchanum3=jchanum0 - -! Loop over the satellite/sensors. Read in each update -! scratch file and load into proper location in output -! arrays. Special logic is required for AMSRE and SSMIS -! due to their information being spread acorss different -! radiance diagnostic files. -! - do i=1,ndat - fname = 'update_' // trim(dtype(i)) // '_' // trim(dplat(i)) - inquire(file=fname,exist=lexist) - string = ' skipping ' - if (lexist) string = ' processing ' - write(6,*) string,' update file i=',i,' with fname=',trim(fname),' ',lexist - -! Process the scratch update file - if (lexist) then - - io_chan=0 - satsensor2=' ' - jchanum2=0 - tlap2=zero - c_ang2=zero - -! Read data from scratch file - open(lntemp,file=fname,form='formatted') - done=.false. - j=1 - do while (.not.done) - read(lntemp,210,end=160) io_chan(j),satsensor2(j),jchanum2(j),& - tlap2(j),(c_ang2(ii,j),ii=1,nstep) - j=j+1 - goto 170 -160 continue - done=.true. -170 continue - end do - n_chan=j-1 - close(lntemp) - -! Transfer to output arrays. Note special treatement for -! amsre and ssmis - if (index(dtype(i),'amsre_')==0 .and. index(dtype(i),'ssmis_')==0) then - do j=1,n_chan - jj=io_chan(j) - satsensor3(jj)=satsensor2(j) - jchanum3(jj) =jchanum2(j) - tlap3(jj) =tlap2(j) - do ii=1,nstep - c_ang3(ii,jj)=c_ang2(ii,j) - end do - end do - -! Special block for AMSRE. AMSRE simulated Tb are -! spilt into three groupings as shown below: -! amsre_low: channels 1-4 -! amsre_mid: channels 5-10 -! amsre_hig: channels 11-12 - - elseif (index(dtype(i),'amsre_')/=0) then - if (dtype(i)=='amsre_low') then - do j=1,4 - jj=io_chan(j) - satsensor3(jj)=satsensor2(j) - jchanum3(jj) =jchanum2(j) - tlap3(jj) =tlap2(j) - do ii=1,nstep - c_ang3(ii,jj)=c_ang2(ii,j) - end do - end do - elseif (dtype(i)=='amsre_mid') then - do j=5,10 - jj=io_chan(j) - satsensor3(jj)=satsensor2(j) - jchanum3(jj) =jchanum2(j) - tlap3(jj) =tlap2(j) - do ii=1,nstep - c_ang3(ii,jj)=c_ang2(ii,j) - end do - end do - elseif (dtype(i)=='amsre_hig') then - do j=11,12 - jj=io_chan(j) - satsensor3(jj)=satsensor2(j) - jchanum3(jj) =jchanum2(j) - tlap3(jj) =tlap2(j) - do ii=1,nstep - c_ang3(ii,jj)=c_ang2(ii,j) - end do - end do - endif - -! Special block for SSMIS. SSMIS simulated Tb are -! split into four groupings as shown below: -! ssmis_img: channels 8-11,17-18 -! ssmis_env: channels 12-16 -! ssmis_las: channels 1-7,24 -! ssmis_uas: channels 19-23 - - elseif (index(dtype(i),'ssmis_')/=0) then - if (dtype(i)=='ssmis_img') then - do j=8,11 - jj=io_chan(j) - satsensor3(jj)=satsensor2(j) - jchanum3(jj) =jchanum2(j) - tlap3(jj) =tlap2(j) - do ii=1,nstep - c_ang3(ii,jj)=c_ang2(ii,j) - end do - end do - do j=17,18 - jj=io_chan(j) - satsensor3(jj)=satsensor2(j) - jchanum3(jj) =jchanum2(j) - tlap3(jj) =tlap2(j) - do ii=1,nstep - c_ang3(ii,jj)=c_ang2(ii,j) - end do - end do - elseif (dtype(i)=='ssmis_env') then - do j=12,16 - jj=io_chan(j) - satsensor3(jj)=satsensor2(j) - jchanum3(jj) =jchanum2(j) - tlap3(jj) =tlap2(j) - do ii=1,nstep - c_ang3(ii,jj)=c_ang2(ii,j) - end do - end do - elseif (dtype(i)=='ssmis_las') then - do j=1,7 - jj=io_chan(j) - satsensor3(jj)=satsensor2(j) - jchanum3(jj) =jchanum2(j) - tlap3(jj) =tlap2(j) - do ii=1,nstep - c_ang3(ii,jj)=c_ang2(ii,j) - end do - end do - do j=24,24 - jj=io_chan(j) - satsensor3(jj)=satsensor2(j) - jchanum3(jj) =jchanum2(j) - tlap3(jj) =tlap2(j) - do ii=1,nstep - c_ang3(ii,jj)=c_ang2(ii,j) - end do - end do - elseif (dtype(i)=='ssmis_uas') then - do j=19,23 - jj=io_chan(j) - satsensor3(jj)=satsensor2(j) - jchanum3(jj) =jchanum2(j) - tlap3(jj) =tlap2(j) - do ii=1,nstep - c_ang3(ii,jj)=c_ang2(ii,j) - end do - end do - endif - -! End of transfer block - endif - -! End of lexist block - endif - -! End of loop over satellite/sensor data types - end do - - -! Write updated satang statistics to output file - open(lnupdt,file='satbias_ang.out',form='formatted') - if (word == 'nscan=') write(lnupdt,'("nscan=",i8)') nstep - do j=1,jpch - write(lnupdt,110) j,satsensor3(j),jchanum3(j),tlap3(j),(c_ang3(i,j),i=1,nstep) - end do - close(lnupdt) - -! End of block for ouput mpi task - endif - -! Deallocate data arrays - deallocate(tsum,tlap1,tcnt) - deallocate(csum,c_ang1) - deallocate(count) - deallocate(satsensor0,jchanum0,tlap0,c_ang0) - deallocate(satsensor2,jchanum2,tlap2,c_ang2) - deallocate(satsensor3,jchanum3,tlap3,c_ang3) - -! End of program - if (outask) call w3tage('GLOBAL_ANGUPDATE') - call mpi_finalize(ierror) - -end program main - - - diff --git a/src/global_angupdate/read_diag.f90 b/src/global_angupdate/read_diag.f90 deleted file mode 120000 index f771ffea..00000000 --- a/src/global_angupdate/read_diag.f90 +++ /dev/null @@ -1 +0,0 @@ -../../src/gsi/read_diag.f90 \ No newline at end of file