diff --git a/CHANGELOG.rst b/CHANGELOG.rst index bf819884e3..3e9cedfdcf 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -22,6 +22,19 @@ individual files. The changes are now listed with the most recent at the top. +**December 13 2023 :: Developer tests and bug fixes. Tag v10.10.0** + +- new developer tests to run all builds for all compilers on NSF NCAR machine + Derecho. +- removed redundant nc_check routine from utilities_mod in favor of + netcdf_utilities_mod::nc_check +- Improved default thinning options for AIRS L2 converter. + +bug-fixes: + +- AIRS L2 converter message prints correct number of obs. +- MOM6 model_mod .eqv. used for logical comparison to conform to Fortran standard. + **December 1 2023 :: Bringing DART documentation in accordance with NSF Policy. Tag v10.9.2** - doc-fixes: diff --git a/assimilation_code/modules/utilities/utilities_mod.f90 b/assimilation_code/modules/utilities/utilities_mod.f90 index 6c21119fdd..cbe78ca498 100644 --- a/assimilation_code/modules/utilities/utilities_mod.f90 +++ b/assimilation_code/modules/utilities/utilities_mod.f90 @@ -38,7 +38,6 @@ module utilities_mod error_handler, & to_upper, & squeeze_out_blanks, & - nc_check, & ! remove this; moved to netcdf_utils next_file, & ! deprecate this logfileunit, & nmlfileunit, & @@ -1321,39 +1320,6 @@ subroutine set_tasknum (tasknum) end subroutine set_tasknum -!----------------------------------------------------------------------- - -!>@todo FIXME: remove this once all other code is calling -!>this from the netcdf_utilities_mod instead. - -subroutine nc_check(istatus, subr_name, context) - -use netcdf - -integer, intent (in) :: istatus -character(len=*), intent(in) :: subr_name -character(len=*), intent(in), optional :: context - -! if no error, nothing to do here. we are done. -if(istatus == nf90_noerr) return - - -! something wrong. construct an error string and call the handler. - -! context is optional, but is very useful if specified. -! if context + error code > 512, the assignment will truncate. -if (present(context) ) then - msgstring1 = trim(context) // ': ' // trim(nf90_strerror(istatus)) -else - msgstring1 = nf90_strerror(istatus) -endif - -! this does not return -call error_handler(E_ERR, 'nc_check', msgstring1, source, text2=subr_name) - -end subroutine nc_check - - !----------------------------------------------------------------------- !> convert a string to upper case *in place* diff --git a/assimilation_code/programs/compute_error/compute_error.f90 b/assimilation_code/programs/compute_error/compute_error.f90 index f4f1d326a0..9fe5fa69df 100644 --- a/assimilation_code/programs/compute_error/compute_error.f90 +++ b/assimilation_code/programs/compute_error/compute_error.f90 @@ -27,10 +27,10 @@ program compute_error use utilities_mod, only : initialize_utilities, & error_handler, nmlfileunit, E_MSG, E_ERR, & - find_namelist_in_file, nc_check, & + find_namelist_in_file, & check_namelist_read, finalize_utilities, & do_nml_file, do_nml_term - +use netcdf_utilities_mod, only : nc_check use netcdf implicit none diff --git a/build_templates/mkmf.template.ifx.linux b/build_templates/mkmf.template.ifx.linux new file mode 100644 index 0000000000..dcf1db83fa --- /dev/null +++ b/build_templates/mkmf.template.ifx.linux @@ -0,0 +1,25 @@ +# DART software - Copyright UCAR. This open source software is provided +# by UCAR, "as is", without charge, subject to all terms of use at +# http://www.image.ucar.edu/DAReS/DART/DART_download +# + +MPIFC = mpif90 +MPILD = mpif90 +FC = ifx +LD = ifx + +# If your NETCDF environment variable is not set correctly, +# uncomment the following line and set value to where lib and include +# are found for the netcdf files that match this compiler. +# +# NETCDF = /opt/local + +INCS = -I$(NETCDF)/include +LIBS = -L$(NETCDF)/lib -lnetcdff -lnetcdf +FFLAGS = -O -assume buffered_io $(INCS) +LDFLAGS = $(FFLAGS) $(LIBS) + +# for development or debugging, use this instead: +# FFLAGS = -g -C -check noarg_temp_created -fpe0 \ +# -fp-model precise -ftrapuv -traceback \ +# -warn declarations,uncalled,unused $(INCS) diff --git a/conf.py b/conf.py index 29904ab3a6..d006de6a22 100644 --- a/conf.py +++ b/conf.py @@ -21,7 +21,7 @@ author = 'Data Assimilation Research Section' # The full version, including alpha/beta/rc tags -release = '10.9.2' +release = '10.10.0' root_doc = 'index' # -- General configuration --------------------------------------------------- diff --git a/developer_tests/build_everything/README b/developer_tests/build_everything/README index ae347cdea8..b832b9d5bb 100644 --- a/developer_tests/build_everything/README +++ b/developer_tests/build_everything/README @@ -1,5 +1,10 @@ Run all quickbuilds.sh in the DART Repo at once -Run with a fresh checkout of DART -Edit mkmf.template.compile_all to match the compiler you want to run with -Recommend running on Cheyenne with submit_me.sh as run_all_quickbuilds.sh uses a lot of threads +Usage: ./submit_jobs.sh + +To run on a specific branch in DART: + + ./submit_jobs.sh branch_name + +Find failed builds in logfile, e.g.: +grep -a FAILED build-everything-nvhpc.o2633030 diff --git a/developer_tests/build_everything/all_quickbuilds b/developer_tests/build_everything/all_quickbuilds deleted file mode 100644 index d12f57b5f3..0000000000 --- a/developer_tests/build_everything/all_quickbuilds +++ /dev/null @@ -1,65 +0,0 @@ -models/null_model/work/ -models/POP/work/ -models/lorenz_63/work/ -models/9var/work/ -models/gitm/work/ -models/simple_advection/work/ -models/lorenz_96/work/ -models/ikeda/work/ -models/ROMS/work/ -models/lorenz_84/work/ -models/cam-fv/work/ -models/mpas_atm/work/ -models/forced_lorenz_96/work/ -models/wrf/work/ -models/cice/work/ -models/cm1/work/ -models/lorenz_04/work/ -models/bgrid_solo/work/ -models/noah/work/ -models/wrf_hydro/work/ -models/lorenz_96_2scale/work/ -observations/obs_converters/GOES/work/ -observations/obs_converters/tec/work/ -observations/obs_converters/GRACE/work/ -observations/obs_converters/CNOFS/work/ -observations/obs_converters/GPSPW/work/ -observations/obs_converters/SSEC/work/ -observations/obs_converters/text_GITM/work/ -observations/obs_converters/GTSPP/work/ -observations/obs_converters/gps/work/ -observations/obs_converters/GSI2DART/work/ -observations/obs_converters/SABER/work/ -observations/obs_converters/SIF/work/ -observations/obs_converters/WOD/work/ -observations/obs_converters/tpw/work/ -observations/obs_converters/ROMS/work/ -observations/obs_converters/COSMOS/work/ -observations/obs_converters/var/work/ -observations/obs_converters/tropical_cyclone/work/ -observations/obs_converters/CONAGUA/work/ -observations/obs_converters/Ameriflux/work/ -observations/obs_converters/CHAMP/work/ -observations/obs_converters/cice/work/ -observations/obs_converters/GMI/work/ -observations/obs_converters/DWL/work/ -observations/obs_converters/MIDAS/work/ -observations/obs_converters/USGS/work/ -observations/obs_converters/SST/work/ -observations/obs_converters/MPD/work/ -observations/obs_converters/even_sphere/work/ -observations/obs_converters/MODIS/work/ -observations/obs_converters/NCEP/prep_bufr/work/ -observations/obs_converters/NCEP/ascii_to_obs/work/ -observations/obs_converters/NCEP/netcdf/work/ -observations/obs_converters/gnd_gps_vtec/work/ -observations/obs_converters/SSUSI/work/ -observations/obs_converters/ok_mesonet/work/ -observations/obs_converters/snow/work/ -observations/obs_converters/text/work/ -observations/obs_converters/AURA/work/ -observations/obs_converters/radar/work/ -observations/obs_converters/MADIS/work/ -observations/obs_converters/quikscat/work/ -observations/obs_converters/AIRS/work/ -observations/obs_converters/AVISO/work/ diff --git a/developer_tests/build_everything/mkmf.template.compile_all b/developer_tests/build_everything/mkmf.template.compile_all deleted file mode 100644 index a9e13ff504..0000000000 --- a/developer_tests/build_everything/mkmf.template.compile_all +++ /dev/null @@ -1,158 +0,0 @@ -# Template for Intel Fortran Compiler on Linux clusters and workstations. -# -# DART software - Copyright UCAR. This open source software is provided -# by UCAR, "as is", without charge, subject to all terms of use at -# http://www.image.ucar.edu/DAReS/DART/DART_download -# -# DART $Id$ - -# typical use with mkmf -# mkmf -t mkmf.template.xxxx ... -# -# FFLAGS useful for DEBUGGING. NOTE: The intel compiler can provide a lot more -# information if you LEAVE the object and module files intact. -# Do not remove the *.o and *.mod files when debugging code. -# -# -g include debugging information. these are all synonyms. -# -debug full -# -debug all -# -O0 setting -g will make this the default (no optimization). -# it is possible to set -g and then explicitly set -O2 if -# the behavior being debugged depends on optimization changes. -# -ftrapuv traps if a local variable is used before being set -# -C enables all runtime checks. -C and -check all are synonyms. -# -check all -# -check enables/disables more specific runtime checks. -# keywords: [arg_temp_created,bounds,overflow,format,pointers,uninit] -# -warn the level of warning messages issued. -# keywords: [alignments, argument_checking, declarations, -# errors, fileopt, general, ignore_loc, -# stderrors, truncated_source, uncalled, -# uninitialized, unused, usage, all] -# -fp-stack-check catches conditions where the FP stack is not correct. -# Typically this is when a real function is called as if it were a -# subroutine, OR a subroutine is called as if it were a function (return -# values left of FP stack OR too much data is taken off the FP stack) -# -vec-reportN controls how much diagnostic output is printed about -# loops vectorized by the compiler. N = 0 is silent, -# N can have values up to 5. -# -traceback tells the compiler to generate extra information in the -# object file to provide source file traceback information -# when a severe error occurs at run time -# -# FFLAGS useful for bitwise reproducibility and accuracy control -# (these will slow down performance to various degrees) -# -fp-model precise control how floating point roundoff is done so it is -# reproducible from run to run. in simple tests this -# flag alone was enough to create bitwise reproducible -# code but slowed execution significantly. -# -ftz 'flush to zero' underflows result in zero. set by default if -# any -O other than -O0 set, or if -fpe0 or -fpe1 set. -# -fpeN controls floating point exception handling. -fpe0 rounds underflow -# to zero and traps on any other exception type. -# -pc80 set internal FPU precision to 64 bit significand -# (default is -pc64 with 53 internal bits) -# -# FFLAGS useful for production -# -O2 default. optimize without too much unrepeatable numerical games -# -O3 more aggressive optimizations. check numerical differences -# before using this indiscriminately. -# -O1 if you get compile-time errors about out of memory or unable to -# complete compilation because of complexity, try lowering the -# optimization level on the offending source files. -# -ipo enable optimizations between routines in separate source files -# -heap-arrays 10 allocate large arrays from the heap instead of putting them -# on the stack. the number is the limit in KB for when arrays -# move from the stack to the heap. this can help if you get stack -# overflow errors and cannot increase the stack size more. -# allocating from the stack is faster, but it's usually a smaller -# size than the heap. -# -x, -m, -ax, -mcode, -march all these flags tell the compiler to generate -# processor-specific or vector instructions. either 'man ifort' or -# ifort --help to see what the current list of options are and -# which have priority over the others. -# (for those running on yellowstone, -axavx will enable the advanced -# vector instructions available on the sandy bridge processors.) -# -assume buffered_io allows the runtime library to buffer up individual -# writes before calling the operating system. in particular, we -# write our observation sequence files as a series of many individual -# calls to the write() routine. when debugging you do not want to -# buffer so you can see the last output before the program dies. -# for production, however, you want to batch up writes into larger -# blocks before stopping to do i/o to disk. an alternative at -# runtime is to set FORT_BUFFERED to 'true' in your environment. -# (e.g. csh family: setenv FORT_BUFFERED true or -# ksh family: export FORT_BUFFERED=true). -# -# FFLAGS possibly useful, not normally used by DART -# -fpp run Fortran preprocessor on source files prior to compilation -# -free interpret source as free-format, regardless of file extension -# -r8 specify default real size. note that for DART we use explicit -# types on all our real values so this will not change anything -# inside DART. see DART/common/types_mod.f90 if you must run -# with single precision reals. -# -convert big_endian useful if you're on the wrong architecture. -# however this controls both reading and writing so you can't -# use it as a conversion mechanism unless you write files out -# in ascii format. applies to all unformatted fortran i/o. -# -assume byterecl ... more 'industry-standard' direct-access behavior -# controls what units the RECL (record length) specifier returns. -# -# Runtime environment variables that influence the compiler behavior: -# -# Make output lines for fortran write statements longer without wrapping: -# setenv FORT_FMT_RECL 512 (or any length) -# -# -# IF YOU HAVE MORE CURRENT COMPILER INFORMATION, PLEASE SHARE IT WITH US. - -MPIFC = mpif90 -MPILD = mpif90 -FC = ifort -LD = ifort - -# DISCUSSION ABOUT NETCDF. DART works with both V3 and V4 flavors of netCDF. -# Some V4 installations also require the HDF5 libraries. Some don't. -# Some netCDF installations require both -lnetcdff and -lnetcdf, some only -# require -lnetcdf. The permutations make it difficult to cover the possible -# installations. Here are some candidates, you might just have to resort to -# trial and error: -# LIBS = -L$(NETCDF)/lib -lnetcdf -# LIBS = -L$(NETCDF)/lib -lnetcdff -lnetcdf -# LIBS = -L$(NETCDF)/lib -lnetcdf -lcurl -lhdf5_hl -lhdf5 -lz -lm -# LIBS = -L$(NETCDF)/lib -lnetcdff -lnetcdf -lcurl -lhdf5_hl -lhdf5 -lz -lm -# -# If you get an error "ld: library not found for -lnetcdff" (note 2 f's), -# remove it from the LIBS line. The same is true for any library. If 'ld' -# does not complain - it worked. - -# If your NETCDF environment variable is not set correctly, -# uncomment the following line and set value to where lib and include -# are found for the netcdf files that match this compiler. -# -# NETCDF = /opt/local - -INCS = -I$(NETCDF)/include -LIBS = -L$(NETCDF)/lib -lnetcdff -lnetcdf -FFLAGS = -O -assume buffered_io $(INCS) -LDFLAGS = $(FFLAGS) $(LIBS) - -# for development or debugging, use this instead: -# FFLAGS = -g -C -check noarg_temp_created -fpe0 \ -# -fp-model precise -ftrapuv -traceback \ -# -warn declarations,uncalled,unused $(INCS) -# -# for speed on yellowstone (verify against a run with with -O and -fp-model precise -# that the numerical differences aren't too large to be acceptable): -# FFLAGS = -O3 -axavx -ipo -vec-report0 $(INCS) -# -# Some optimized (BLAS, LAPACK) libraries may be available with: -# LIBS = -L$(NETCDF)/lib -lnetcdff -lnetcdf -lmkl -lmkl_lapack -lguide -lpthread -# -# If you get this error: libimf.so: warning: warning: feupdateenv is not implemented -# try adding: -limf -lm to your LIBS line. - -# -# $URL$ -# $Revision$ -# $Date$ diff --git a/developer_tests/build_everything/run_all_quickbuilds.sh b/developer_tests/build_everything/run_all_quickbuilds.sh index aebb5be936..e3472115a8 100755 --- a/developer_tests/build_everything/run_all_quickbuilds.sh +++ b/developer_tests/build_everything/run_all_quickbuilds.sh @@ -4,77 +4,140 @@ # by UCAR, "as is", without charge, subject to all terms of use at # http://www.image.ucar.edu/DAReS/DART/DART_download -# options to set -# 1. DART directory -# 2. compiler - -export DART=$(git rev-parse --show-toplevel) -FC=intel +# Usage: run_all_quickbuilds.sh compiler [gcc intel nvhpc cce] +if [ $# -eq 0 ]; then + echo "ERROR: expecting at least one argument" + exit 1 +fi -if [[ ! -d $DART ]] ; then - echo "No DART directory: " $DART - exit 1 -fi +compiler=$1 +branch=${2:-main} # checkout branch if given, or use main -if [[ -z $PBS_ENVIRONMENT ]]; then - echo "ERROR: Run this in a batch job" +# Check if the script is running in a batch job or interactive session +if [[ -z $PBS_ENVIRONMENT ]]; then + echo "ERROR: You must run this in a batch job" echo " qsub submit_me.sh" echo " or an interactive session" exit 2 fi -cp mkmf.template.compile_all $DART/build_templates/mkmf.template -cd $DART +# Specify the mkmf template for each compiler +if [[ $compiler == "ifort" ]]; then + mkmf_template="mkmf.template.intel.linux" +elif [[ $compiler == "ifx" ]]; then + mkmf_template="mkmf.template.ifx.linux" +elif [[ $compiler == "gcc" ]]; then + mkmf_template="mkmf.template.gfortran" +elif [[ $compiler == "cce" ]]; then + mkmf_template="mkmf.template.cce" +elif [[ $compiler == "nvhpc" ]]; then + mkmf_template="mkmf.template.nvhpc" +else + echo "$compiler is not a valid argument" + exit 3 +fi + -# run fixsystem -# running this once at the beginning otherwise all make commands will -# try and alter the mpi_*_utilities_mod.f90 simultaneously -cd assimilation_code/modules/utilities; ./fixsystem $FC -cd - +test_dir="/glade/derecho/scratch/$USER/build_everything/$compiler" +if [[ -d $test_dir ]]; then + echo "Directory exists: $test_dir" + exit 4 +fi +mkdir -p $test_dir +cd $test_dir +git clone 'https://github.com/NCAR/DART.git' +cd DART +export DART=$(git rev-parse --show-toplevel) +git checkout $branch +if [[ $? -ne 0 ]]; then + echo "unknown branch" + exit 5 +fi + +# mkmf for chosen compiler +case $compiler in + ifx ) module load intel-oneapi ;; + ifort ) module load intel-classic ;; + * ) module load $compiler ;; +esac + +cp build_templates/$mkmf_template build_templates/mkmf.template + +# Run fixsystem to avoid all make commands from altering mpi_*_utilities_mod.f90 simultaneously +cd assimilation_code/modules/utilities +case $compiler in + ifort ) ./fixsystem ifort ;; + gcc ) ./fixsystem gfortran ;; + cce ) ./fixsystem ftn ;; + nvhpc ) ./fixsystem nvfortran ;; + ifx ) ./fixsystem ifx ;; +esac +cd - -# build preprocess once +# Build preprocess once pp_dir=$DART/assimilation_code/programs/preprocess cd $pp_dir $DART/build_templates/mkmf -x -p $pp_dir/preprocess \ -a $DART $pp_dir/path_names_preprocess cd - -# local versions of obs_def_mod.f90 and obs_kind_mod.f90 -find . -name input.nml -exec sed -i -e "/^[[:space:]]*#/! s|.*output_obs_def_mod_file.*|output_obs_def_mod_file = './obs_def_mod.f90'|g" \ +# Modify input.nml files to use local versions of obs_def_mod.f90 and obs_kind_mod.f90 +find . -name input.nml -exec sed -i -e "/^[[:space:]]*#/! s|.*output_obs_def_mod_file.*|output_obs_def_mod_file = './obs_def_mod.f90'|g" \ -e "/^[[:space:]]*#/! s|.*output_obs_qty_mod_file.*|output_obs_qty_mod_file = './obs_kind_mod.f90'|g" \ - -e "/^[[:space:]]*#/! s|.*output_obs_kind_mod_file.*|output_obs_qty_mod_file = './obs_kind_mod.f90'|g" {} \; + -e "/^[[:space:]]*#/! s|.*output_obs_kind_mod_file.*|output_obs_qty_mod_file = './obs_kind_mod.f90'|g" {} \; +# Store the current directory and initialize arrays to hold process IDs, directories, and status codes my_dir=$(pwd) pids=() dirs=() status=() -while read f; do +# Find all quickbuild.sh executable files and remove './' and 'quickbuild.sh' +files_to_process=( $(find $DART -executable -type f -name quickbuild.sh | sed -E 's#(\./|quickbuild\.sh)##g') ) -cd $f; ./quickbuild.sh & -pids+=( "$!" ) -dirs+=( "$f" ) -cd $my_dir +# Iterate over each file to and run quickbuild.sh +for f in "${files_to_process[@]}"; do -done < $DART/developer_tests/build_everything/all_quickbuilds + if [[ $f == *"template"* ]]; then + continue # template model not for compiling + fi + if [[ $compiler == "gcc" ]]; then + case "$f" in + *obs_converters* ) cd $f; ./quickbuild.sh & ;; + * ) cd $f; ./quickbuild.sh mpif08 & ;; + esac + else + cd $f; ./quickbuild.sh & + fi + + # Record the PID and directory of the each process then cd back to starting directory + pids+=( "$!" ) + dirs+=( "$f" ) + cd $my_dir +done + +# Wait for all background processes to finish and record their exit statuses for pid in ${pids[@]}; do - #echo "${pid}" wait ${pid} status+=( "$?" ) done -# looping through the status arr to check exit code for each +# Check the status of each build process and log results i=0 for st in ${status[@]}; do - if [[ ${st} -ne 0 ]]; then - echo "RESULT: $i ${dirs[$i]} failed" - OVERALL_EXIT=1 - else - echo "RESULT: $i ${dirs[$i]} finished" - fi - ((i+=1)) + # Display failed vs. passed processes + if [[ ${st} -ne 0 ]]; then + echo "$compiler RESULT: $i ${dirs[$i]} FAILED" + else + echo "$compiler RESULT: $i ${dirs[$i]} PASSED" + fi + ((i+=1)) done +module -t list +echo "branch : " $(git branch --show-current) + +mv $test_dir $test_dir.$(date +"%FT%H%M") diff --git a/developer_tests/build_everything/submit_jobs.sh b/developer_tests/build_everything/submit_jobs.sh new file mode 100755 index 0000000000..b54135dc9b --- /dev/null +++ b/developer_tests/build_everything/submit_jobs.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +declare -a arr=("gcc" "ifort" "ifx" "cce" "nvhpc") + +for compiler in "${arr[@]}"; do + +outfile=build_with_$compiler.sh + +cat < $outfile +#!/bin/bash +#PBS -A P86850054 +#PBS -N build-everything-$compiler +#PBS -j oe +#PBS -k eod +#PBS -q main +#PBS -l walltime=00:20:00 +#PBS -l select=1:ncpus=128:mpiprocs=128 + +export TMPDIR=/tmp/ + +time ./run_all_quickbuilds.sh $compiler $1 + +EOF + +qsub $outfile + +done diff --git a/developer_tests/build_everything/submit_me.sh b/developer_tests/build_everything/submit_me.sh deleted file mode 100644 index 01e68816e4..0000000000 --- a/developer_tests/build_everything/submit_me.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -#PBS -A P86850054 -#PBS -N compile -#PBS -j oe -#PBS -k eod -#PBS -q regular -#PBS -l walltime=00:20:00 -#PBS -l select=1:ncpus=36 - -export TMPDIR=/glade/scratch/$USER/temp -mkdir -p $TMPDIR - -time ./run_all_quickbuilds.sh diff --git a/models/MOM6/model_mod.f90 b/models/MOM6/model_mod.f90 index bd46ea88de..f03283b7b3 100644 --- a/models/MOM6/model_mod.f90 +++ b/models/MOM6/model_mod.f90 @@ -327,7 +327,7 @@ subroutine model_interpolate(state_handle, ens_size, location, qty, expected_obs enddo FIND_LAYER -if (any(found == .false.)) then +if (any(found .eqv. .false.)) then istatus(:) = OBS_TOO_DEEP return endif diff --git a/models/NCOMMAS/model_mod.f90 b/models/NCOMMAS/model_mod.f90 index a7204391d5..f64d9e66cd 100644 --- a/models/NCOMMAS/model_mod.f90 +++ b/models/NCOMMAS/model_mod.f90 @@ -30,7 +30,7 @@ module model_mod use utilities_mod, only : register_module, error_handler, & E_ERR, E_WARN, E_MSG, logfileunit, get_unit, & - nc_check, do_output, to_upper, & + do_output, to_upper, & find_namelist_in_file, check_namelist_read, & open_file, file_exist, find_textfile_dims, & file_to_text @@ -44,6 +44,8 @@ module model_mod use random_seq_mod, only: random_seq_type, init_random_seq, random_gaussian +use netcdf_utilities_mod, only : nc_check + use typesizes use netcdf diff --git a/models/am2/model_mod.f90 b/models/am2/model_mod.f90 index 24261936a8..8a05928550 100644 --- a/models/am2/model_mod.f90 +++ b/models/am2/model_mod.f90 @@ -21,7 +21,7 @@ module model_mod use time_manager_mod, only : time_type, set_time, print_time, set_calendar_type, GREGORIAN use utilities_mod, only : open_file, close_file, find_namelist_in_file, check_namelist_read, & register_module, error_handler, file_exist, E_ERR, E_WARN, E_MSG, & - nmlfileunit, do_output, nc_check, do_nml_file, do_nml_term, logfileunit + nmlfileunit, do_output, do_nml_file, do_nml_term, logfileunit use mpi_utilities_mod, only : my_task_id, task_count use location_mod, only : location_type, get_close_maxdist_init, & get_close_obs_init, get_close_obs, set_location, & @@ -33,7 +33,7 @@ module model_mod get_index_for_type_of_obs, get_quantity_for_type_of_obs ! We'll need to add a kind_cloud_fraction to correspond to AM2 prog var use location_mod, only: VERTISSURFACE, VERTISLEVEL - + use netcdf_utilities_mod, only : nc_check implicit none private diff --git a/models/forced_barot/obs/obs_mod.f90 b/models/forced_barot/obs/obs_mod.f90 index 223068eec5..c31bdcf40a 100644 --- a/models/forced_barot/obs/obs_mod.f90 +++ b/models/forced_barot/obs/obs_mod.f90 @@ -17,7 +17,7 @@ module obs_mod use utilities_mod, only : file_exist, open_file, close_file, & register_module, error_handler, E_ERR, E_MSG, & nmlfileunit, find_namelist_in_file, & - check_namelist_read, nc_check, do_output + check_namelist_read, do_output implicit none private diff --git a/models/mpas_atm/mpas_dart_obs_preprocess.f90 b/models/mpas_atm/mpas_dart_obs_preprocess.f90 index 1bb8991b7f..68315475a0 100644 --- a/models/mpas_atm/mpas_dart_obs_preprocess.f90 +++ b/models/mpas_atm/mpas_dart_obs_preprocess.f90 @@ -32,7 +32,7 @@ program mpas_dart_obs_preprocess use types_mod, only : r8, missing_r8, earth_radius, RAD2DEG, DEG2RAD, i8 use utilities_mod, only : error_handler, E_MSG, find_namelist_in_file, & - check_namelist_read, nc_check, initialize_utilities, & + check_namelist_read, initialize_utilities, & finalize_utilities use time_manager_mod, only : time_type, operator(>=), operator(<), operator(>), operator(<=), & increment_time, decrement_time, operator(-), operator(+), & @@ -74,7 +74,6 @@ program mpas_dart_obs_preprocess cell_ok_to_interpolate, is_global_grid, & get_bdy_mask, get_cell_center_coords use ensemble_manager_mod, only : ensemble_type, init_ensemble_manager, end_ensemble_manager - use netcdf implicit none diff --git a/models/mpas_atm/update_bc.f90 b/models/mpas_atm/update_bc.f90 index 63c41d0f6a..1fad8858e9 100644 --- a/models/mpas_atm/update_bc.f90 +++ b/models/mpas_atm/update_bc.f90 @@ -23,7 +23,7 @@ program update_bc use types_mod, only : r8 use utilities_mod, only : initialize_utilities, finalize_utilities, & find_namelist_in_file, check_namelist_read, & - logfileunit, open_file, close_file, nc_check, & + logfileunit, open_file, close_file, & get_next_filename, E_ERR, error_handler use time_manager_mod, only : time_type, print_time, print_date, operator(-), & get_time, get_date, operator(/=) @@ -37,7 +37,7 @@ program update_bc use netcdf_utilities_mod, only : nc_open_file_readonly, & nc_open_file_readwrite, & - nc_get_dimension_size, & ! Ha + nc_get_dimension_size, & nc_close_file use netcdf diff --git a/models/mpas_ocn/model_mod_check.f90 b/models/mpas_ocn/model_mod_check.f90 index c55c814a19..ef6151d3a5 100644 --- a/models/mpas_ocn/model_mod_check.f90 +++ b/models/mpas_ocn/model_mod_check.f90 @@ -11,7 +11,7 @@ program model_mod_check !---------------------------------------------------------------------- use types_mod, only : r8, digits12, metadatalength, MISSING_R8, rad2deg -use utilities_mod, only : initialize_utilities, finalize_utilities, nc_check, & +use utilities_mod, only : initialize_utilities, finalize_utilities, & open_file, close_file, find_namelist_in_file, & check_namelist_read, nmlfileunit, do_nml_file, do_nml_term, & E_MSG, E_ERR, error_handler, get_unit @@ -44,7 +44,7 @@ program model_mod_check get_model_analysis_filename, analysis_file_to_statevector, & statevector_to_analysis_file, get_analysis_time, & write_model_time, get_grid_dims - +use netcdf_utilities_mod, only : nc_check use netcdf use typesizes diff --git a/models/pe2lyr/model_mod.f90 b/models/pe2lyr/model_mod.f90 index e2ff881cc8..a59b128d72 100644 --- a/models/pe2lyr/model_mod.f90 +++ b/models/pe2lyr/model_mod.f90 @@ -14,7 +14,7 @@ module model_mod use types_mod, only : r8, MISSING_R8 use time_manager_mod, only : time_type, set_time -use utilities_mod, only : file_exist, open_file, close_file, nc_check, & +use utilities_mod, only : file_exist, open_file, close_file, & register_module, error_handler, E_ERR, E_MSG use random_seq_mod, only : random_seq_type, init_random_seq, random_gaussian use location_mod, only : location_type, get_location, set_location, get_dist, & @@ -23,7 +23,7 @@ module model_mod use obs_kind_mod, only : QTY_U_WIND_COMPONENT, QTY_V_WIND_COMPONENT, & QTY_GEOPOTENTIAL_HEIGHT - +use netcdf_utilities_mod, only : nc_check use pe2lyr_mod, only : modelvars, modelvars_init, rk4 use spharmt_mod, only : sphere, getvrtdiv, spharm, spharmt_init, getuv diff --git a/models/rose/model_mod.f90 b/models/rose/model_mod.f90 index 0ade22ad83..9b108f96c5 100644 --- a/models/rose/model_mod.f90 +++ b/models/rose/model_mod.f90 @@ -25,10 +25,11 @@ module model_mod use utilities_mod, only : file_exist, open_file, close_file, & error_handler, E_ERR, E_MSG, E_WARN, nmlfileunit, & do_output, find_namelist_in_file, check_namelist_read, & - do_nml_file, do_nml_term, nc_check + do_nml_file, do_nml_term use random_seq_mod, only : random_seq_type, init_random_seq, random_gaussian use obs_kind_mod, only : QTY_U_WIND_COMPONENT, QTY_V_WIND_COMPONENT,& QTY_TEMPERATURE +use netcdf_utilities_mod, only : nc_check use typesizes use netcdf diff --git a/models/wrf_hydro/create_identity_streamflow_obs.f90 b/models/wrf_hydro/create_identity_streamflow_obs.f90 index edee0c5735..f39141eddb 100644 --- a/models/wrf_hydro/create_identity_streamflow_obs.f90 +++ b/models/wrf_hydro/create_identity_streamflow_obs.f90 @@ -18,7 +18,7 @@ program create_identity_streamflow_obs use location_mod, only : VERTISHEIGHT, location_type, get_location -use utilities_mod, only : nc_check, nmlfileunit, do_nml_file, do_nml_term, & +use utilities_mod, only : nmlfileunit, do_nml_file, do_nml_term, & initialize_utilities, finalize_utilities, & find_namelist_in_file, check_namelist_read, & error_handler, E_ERR, E_MSG, & @@ -47,7 +47,7 @@ program create_identity_streamflow_obs get_number_of_links use sort_mod, only : index_sort - +use netcdf_utilities_mod, only : nc_check use netcdf implicit none diff --git a/observations/forward_operators/obs_def_GRACE_mod.f90 b/observations/forward_operators/obs_def_GRACE_mod.f90 index 6cdee992cb..042bb9b421 100644 --- a/observations/forward_operators/obs_def_GRACE_mod.f90 +++ b/observations/forward_operators/obs_def_GRACE_mod.f90 @@ -66,13 +66,12 @@ module obs_def_GRACE_mod use utilities_mod, only : register_module, E_ERR, E_MSG, error_handler, & check_namelist_read, find_namelist_in_file, & nmlfileunit, do_output, do_nml_file, do_nml_term, & - nc_check, file_exist, is_longitude_between + file_exist, is_longitude_between use assim_model_mod, only : interpolate use ensemble_manager_mod, only : ensemble_type use obs_def_utilities_mod, only : track_status - use typesizes use netcdf diff --git a/observations/obs_converters/AIRS/airs_obs_mod.f90 b/observations/obs_converters/AIRS/airs_obs_mod.f90 index f40f1e0bc1..aca52d2b38 100644 --- a/observations/obs_converters/AIRS/airs_obs_mod.f90 +++ b/observations/obs_converters/AIRS/airs_obs_mod.f90 @@ -316,7 +316,7 @@ subroutine make_obs_sequence ( seq, granule, lon1, lon2, lat1, lat2, & enddo rowloop ! Print a little summary -write(msgstring,*) 'obs used = ', obs_num +write(msgstring,*) 'obs used = ', obs_num - 1 call error_handler(E_MSG, ' ', msgstring) call print_obs_seq_summary(seq) diff --git a/observations/obs_converters/AIRS/work/input.nml b/observations/obs_converters/AIRS/work/input.nml index c933666e95..83303ae5e9 100644 --- a/observations/obs_converters/AIRS/work/input.nml +++ b/observations/obs_converters/AIRS/work/input.nml @@ -18,17 +18,17 @@ ! l2_files = '../data/AIRS.2017.01.01.110.L2.RetStd_IR.v6.0.31.1.G19058124823.hdf' &convert_airs_L2_nml - l2_files = '' - l2_file_list = 'l2_files_to_process' + l2_files = 'AIRS.2017.01.01.110.L2.RetStd_IR.v6.0.31.1.G19058124823.hdf' + l2_file_list = '' outputfile = 'obs_seq.test' min_MMR_threshold = 1.0e-30 top_pressure_level = 0.0001 - along_track_thin = 1 - cross_track_thin = 1 + along_track_thin = 0 + cross_track_thin = 0 lon1 = 0.0 lon2 = 360.0 - lat1 = -60.0 - lat2 = 60.0 + lat1 = -90.0 + lat2 = 90.0 / diff --git a/observations/obs_converters/USGS/convert_streamflow.f90 b/observations/obs_converters/USGS/convert_streamflow.f90 index f6de317363..86e2edb31c 100644 --- a/observations/obs_converters/USGS/convert_streamflow.f90 +++ b/observations/obs_converters/USGS/convert_streamflow.f90 @@ -17,7 +17,7 @@ program convert_streamflow use location_mod, only : VERTISHEIGHT -use utilities_mod, only : nc_check, initialize_utilities, finalize_utilities, & +use utilities_mod, only : initialize_utilities, finalize_utilities, & nmlfileunit, do_nml_file, do_nml_term, & find_namelist_in_file, check_namelist_read, & error_handler, E_ERR, E_MSG, find_textfile_dims, & @@ -39,7 +39,7 @@ program convert_streamflow use obs_utilities_mod, only : getvar_real, getvar_int, get_or_fill_QC, add_obs_to_seq, & create_3d_obs, getvar_int, getdimlen, set_missing_name - +use netcdf_utilities_mod, only : nc_check use netcdf implicit none diff --git a/observations/obs_converters/utilities/obs_seq_utilities_mod.f90 b/observations/obs_converters/utilities/obs_seq_utilities_mod.f90 index 476dae517e..d6276a9845 100644 --- a/observations/obs_converters/utilities/obs_seq_utilities_mod.f90 +++ b/observations/obs_converters/utilities/obs_seq_utilities_mod.f90 @@ -11,7 +11,7 @@ module obs_seq_utilities_mod use types_mod, only : r8, MISSING_R8, MISSING_I -use utilities_mod, only : nc_check, E_MSG, E_ERR, error_handler +use utilities_mod, only : E_MSG, E_ERR, error_handler use obs_def_mod, only : obs_def_type, set_obs_def_time, set_obs_def_kind, & set_obs_def_error_variance, set_obs_def_location, & get_obs_def_time, get_obs_def_location, & @@ -46,7 +46,6 @@ module obs_seq_utilities_mod destroy_obs, destroy_obs_sequence, & get_num_key_range, get_obs_key - use netcdf implicit none