Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fortran standards bug-fixes #619

Merged
merged 22 commits into from Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
461924c
Removed the f2kcli module and all uses of it in the DART code. This m…
mjs2369 Jan 3, 2024
f0d3337
Replaced the use of iargc and getarg with Fortran instrisics COMMAND_…
mjs2369 Jan 3, 2024
d92d5d9
Simplifies the implementation for summing the number of elements in t…
mjs2369 Jan 9, 2024
e813ef3
Changed the random seed variables (iseed1 and iseed2) in the pert_sou…
mjs2369 Jan 9, 2024
40894e0
Removing commented out code using iargc and additional lines commente…
mjs2369 Jan 10, 2024
69f6861
Merge branch 'main' into fortran_standards
mjs2369 Jan 30, 2024
5338f78
Creating specific mkmf.templates for the observation converters AIRS …
mjs2369 Jan 31, 2024
1e4549c
Updating the quikscat documentation to use Derecho paths, include all…
mjs2369 Feb 1, 2024
f5df498
Updating the AIRS documentation to point to the available mkmf.template
mjs2369 Feb 1, 2024
272c2cb
Remove / at the start of the paths to mkmf.template files from docume…
mjs2369 Feb 1, 2024
b44fd35
Adjust wording in documentation in QuikSCAT.rst
mjs2369 Feb 1, 2024
9b17845
Merge branch 'main' into fortran_standards
mjs2369 Feb 1, 2024
3e72e58
Removing changes to AIRS documentation from this PR; the entirety of …
mjs2369 Feb 1, 2024
e33bc8a
Remove large compiler doc sections from mkmf.template.quikscat.gfortran
mjs2369 Feb 1, 2024
a8d38e8
Remove large compiler doc sections from mkmf.template.AIRS.gfortran
mjs2369 Feb 1, 2024
37dce3f
Using /opt/local for NETCDF path mkmf.template.AIRS.gfortran , consis…
mjs2369 Feb 1, 2024
6e094e1
Removing the changes to NCEP/prep_bufr code, which will be addressed …
mjs2369 Feb 2, 2024
7561c0f
Removing length and ios from GET_COMMAND_ARGUMENT calls in convert_aviso
mjs2369 Feb 2, 2024
31cb30f
Remove svn line from mkmf.template.quikscat.intel
mjs2369 Feb 2, 2024
af51471
fix: MIT_gcm model_mod to use nc_check from netcdf_utilities_mod
hkershaw-brown Feb 12, 2024
f17fa3e
chore: AIRS and quikscat convert programs added to gitignore
hkershaw-brown Feb 13, 2024
dc12693
bump conf.py and changelog for release
hkershaw-brown Feb 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Expand Up @@ -158,6 +158,10 @@ ssec_satwnd
gts_to_dart
littler_tf_dart
rad_3dvar_to_dart
L1_AMSUA_to_netcdf
convert_airs_L2
convert_amsu_L1
convert_L2b

# Test programs built by developer_tests
rttov_test
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.rst
Expand Up @@ -22,6 +22,13 @@ individual files.

The changes are now listed with the most recent at the top.

**February 13 2024 :: Fortran Standards. Tag v11.0.3**

- Replace f2kcli with Fortran intrinsics for command line arguments.
- AIRS and quikscat mkmf.templates with appropriate HDF, HDFEOS, RTTOV library flags.
- Simplified noah_hydro_mod.f90 number of non-zero element counts.
- WRF pert_sounding_module random iseed now integer.

**February 1 2024 :: RTTOV13 cloud bug-fix. Tag v11.0.2**

- Initialize RTTOV13 profile cloud arrays to zero for profiles.
Expand Down
41 changes: 41 additions & 0 deletions build_templates/mkmf.template.AIRS.gfortran
@@ -0,0 +1,41 @@
# Template for AIRS observation converter with GNU gfortran on Linux or OSX
#
# 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 = gfortran
LD = h4fc

# MODIFY THE FOLLOWING VARIABLES FOR YOUR SYSTEM:
# If your NETCDF, HDFEOS, or RTTOV environment variables are not set,
# 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
HDFEOS = /glade/campaign/cisl/dares/libraries/hdf-eos_gfortran
RTTOV = /glade/campaign/cisl/dares/libraries/rttov123_gfortran

RTTOV_VERSION = 12

RTLIBS = -lrttov$(RTTOV_VERSION)_wrapper -lrttov$(RTTOV_VERSION)_mw_scatt -lrttov$(RTTOV_VERSION)_brdf_atlas \
-lrttov$(RTTOV_VERSION)_emis_atlas -lrttov$(RTTOV_VERSION)_other -lrttov$(RTTOV_VERSION)_parallel \
-lrttov$(RTTOV_VERSION)_coef_io -lrttov$(RTTOV_VERSION)_hdf -lrttov$(RTTOV_VERSION)_main

INCS = -I$(NETCDF)/include -I$(HDFEOS)/include -I$(RTTOV)/include -I$(RTTOV)/mod

LIBS = -L$(NETCDF)/lib -lnetcdff -lnetcdf \
-L$(HDFEOS)/lib -lhdfeos -lmfhdf -ldf -ljpeg -lz -lm -lsz \
-L$(RTTOV)/lib -lhdf5_hl_fortran -lhdf5_hl -lhdf5_fortran -lhdf5 $(RTLIBS)

FFLAGS = -O2 -ffree-line-length-none -fallow-argument-mismatch $(INCS)
LDFLAGS = $(FFLAGS) $(LIBS)

# Debug settings (preferably also use a RTTOV compiled with debug settings):
#
# FFLAGS = -g -Wuninitialized -Wunused -ffree-line-length-none -fbounds-check \
# -fbacktrace -ffpe-trap=invalid,zero,overflow -fallow-argument-mismatch $(INCS)

42 changes: 42 additions & 0 deletions build_templates/mkmf.template.AIRS.intel
@@ -0,0 +1,42 @@
# Template for AIRS observation converter with Intel Fortran Compiler on Linux or OSX
#
# 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 = h4fc
LD = h4fc

# MODIFY THE FOLLOWING VARIABLES FOR YOUR SYSTEM:
# If your NETCDF, HDFEOS, or RTTOV environment variables are not set,
# 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
HDFEOS = /glade/campaign/cisl/dares/libraries/hdf-eos_intel/
RTTOV = /glade/campaign/cisl/dares/libraries/rttov123_intel/

RTTOV_VERSION = 12

RTLIBS = -lrttov$(RTTOV_VERSION)_wrapper -lrttov$(RTTOV_VERSION)_mw_scatt -lrttov$(RTTOV_VERSION)_brdf_atlas \
-lrttov$(RTTOV_VERSION)_emis_atlas -lrttov$(RTTOV_VERSION)_other -lrttov$(RTTOV_VERSION)_parallel \
-lrttov$(RTTOV_VERSION)_coef_io -lrttov$(RTTOV_VERSION)_hdf -lrttov$(RTTOV_VERSION)_main

INCS = -I$(NETCDF)/include -I$(HDFEOS)/include -I$(RTTOV)/include -I$(RTTOV)/mod

LIBS = -L$(NETCDF)/lib -lnetcdff -lnetcdf \
-L$(HDFEOS)/lib -lhdfeos -lmfhdf -ldf -ljpeg -lz -lm -lsz -lGctp \
-L$(RTTOV)/lib -lhdf5_hl_fortran -lhdf5_hl -lhdf5_fortran -lhdf5 $(RTLIBS)

FFLAGS = -O2 -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)

# Optimized (BLAS, LAPACK) libraries are available from the Intel Math Kernel Libraries:
# -lmkl -lmkl_lapack -lguide -lpthread
31 changes: 31 additions & 0 deletions build_templates/mkmf.template.quikscat.gfortran
@@ -0,0 +1,31 @@
# Template for quikscat converter with GNU gfortran on Linux or Mac OSX
#
# 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 = gfortran
LD = h4fc

# 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 = -O2 -ffree-line-length-none -fallow-argument-mismatch $(INCS)
LDFLAGS = $(FFLAGS) $(LIBS)

# for development or debugging, use this instead:
# FFLAGS = -g -Wuninitialized -Wunused -ffree-line-length-none -fbounds-check \
# -fbacktrace -ffpe-trap=invalid,zero,overflow -fallow-argument-mismatch $(INCS)
37 changes: 37 additions & 0 deletions build_templates/mkmf.template.quikscat.intel
@@ -0,0 +1,37 @@
# Template for quikscat converter with Intel Fortran Compiler on Linux or OSX
#
# 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 = h4fc
LD = h4fc

# 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)

# 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.
2 changes: 1 addition & 1 deletion conf.py
Expand Up @@ -21,7 +21,7 @@
author = 'Data Assimilation Research Section'

# The full version, including alpha/beta/rc tags
release = '11.0.2'
release = '11.0.3'
root_doc = 'index'

# -- General configuration ---------------------------------------------------
Expand Down
4 changes: 3 additions & 1 deletion models/MITgcm_ocean/model_mod.f90
Expand Up @@ -22,11 +22,13 @@ module model_mod
convert_vertical_obs, convert_vertical_state

use utilities_mod, only : error_handler, E_ERR, E_WARN, E_MSG, &
logfileunit, get_unit, nc_check, do_output, to_upper, &
logfileunit, get_unit, do_output, to_upper, &
find_namelist_in_file, check_namelist_read, &
open_file, file_exist, find_textfile_dims, file_to_text, &
string_to_real, string_to_logical

use netcdf_utilities_mod, only : nc_check

use obs_kind_mod, only : QTY_TEMPERATURE, QTY_SALINITY, QTY_U_CURRENT_COMPONENT, &
QTY_V_CURRENT_COMPONENT, QTY_SEA_SURFACE_HEIGHT, &
QTY_NITRATE_CONCENTRATION, QTY_SURFACE_CHLOROPHYLL, &
Expand Down
2 changes: 0 additions & 2 deletions models/wrf/WRF_BC/pert_wrf_bc.f90
Expand Up @@ -61,8 +61,6 @@ program pert_wrf_bc

integer, dimension(4) :: dims

integer, external :: iargc

real(r8), allocatable, dimension(:,:) :: tend2d, scnd2d, frst2d

real(r8), allocatable, dimension(:,:,:) :: tend3d, scnd3d, frst3d, full3d, full3d_next
Expand Down
2 changes: 0 additions & 2 deletions models/wrf/WRF_BC/update_wrf_bc.f90
Expand Up @@ -60,8 +60,6 @@ program update_wrf_bc

integer, dimension(4) :: dims

integer, external :: iargc

real(r8), allocatable, dimension(:,:) :: tend2d, scnd2d, frst2d

real(r8), allocatable, dimension(:,:,:) :: tend3d, scnd3d, frst3d, full3d, full3d_mean
Expand Down
1 change: 0 additions & 1 deletion models/wrf/WRF_DART_utilities/add_pert_where_high_refl.f90
Expand Up @@ -34,7 +34,6 @@ PROGRAM add_pert_where_high_refl
use utilities_mod, only : error_handler, E_ERR, initialize_utilities, finalize_utilities
use random_seq_mod, only : random_gaussian, random_seq_type, init_random_seq
use netcdf
use f2kcli

implicit none

Expand Down
4 changes: 2 additions & 2 deletions models/wrf/WRF_DART_utilities/advance_cymdh.f90
Expand Up @@ -22,7 +22,7 @@ program advance_cymdh

character(len=10) :: ccyymmddhh

nargum=iargc()
nargum=COMMAND_ARGUMENT_COUNT()

if(nargum /= 2) then
write(unit=*, fmt='(a)') &
Expand All @@ -34,7 +34,7 @@ program advance_cymdh
do n=1,80
argum(i)(n:n)=' '
enddo
call getarg(i,argum(i))
call GET_COMMAND_ARGUMENT(i,argum(i))
enddo

ccyymmddhh = trim(argum(1))
Expand Down