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
Conversation
@mjs2369 this is good stuff. |
@hkershaw-brown would you like me to go ahead and take this off draft then and move the outstanding issues (#352 and #595) to a later pull request? |
@mjs2369 no, no rush, no need to split the request, the fortran standards fixes can go in together as one pull request. |
…odule defined its own subroutines for COMMAND_ARGUMENT_COUNT() and GET_COMMAND_ARGUMENT() that called iargc and getarg. The only files that used this module were models/wrf/WRF_DART_utilities/add_pert_where_high_refl.f90 and DART/models/wrf/WRF_DART_utilities/grid_refl_obs.f90
…ARGUMENT_COUNT() and GET_COMMAND_ARGUMENT() in all possible locations in the code (models/wrf/WRF_DART_utilities/advance_cymdh.f90, observations/obs_converters/AVISO/convert_aviso.f90, and multiple files in observations/obs_converters/NCEP/prep_bufr/convert_bufr/) Removed declaration of the variable for iargc where unused in the code (models/wrf/WRF_BC/pert_wrf_bc.f90 and models/wrf/WRF_BC/update_wrf_bc.f90)
…he CH_NETRT array that are greater than or equal to 0 by using the count function
…nding_module (wrf) from real to integer types
@mjs2369 I'm rebasing this pull request on v11 |
feaeb90
to
40894e0
Compare
…and quikscat because they use specific configurations with the HDF and/or RTTOV libraries. Versions created for both the gfortran and ifort compilers; the templates that use gfortran make use of the -fallow-argument-mismatch flag to fix type mismatch errors in JPL code
… the necessary library flags, and point to the available mkmf.template files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Marlee,
Looking good. I've left some suggestions (mostly removing large compiler doc sections from mkmf.
My only main concern is the prepbuffr code. This is not dart code, and has been fragile in the past. So I don't recommend we change this code without having extensive tests (similar to the JPL module code). This code is not built with the dart build system (mkmf, quickbuild). There's these two scripts for building.
https://github.com/NCAR/DART/blob/main/observations/obs_converters/NCEP/prep_bufr/install.sh
https://github.com/NCAR/DART/blob/main/observations/obs_converters/NCEP/prep_bufr/convert_bufr/convert_bufr.csh
Additionally, there is this
"Note that observations/obs_converters/NCEP/prep_bufr/convert_bufr/grabbufr.f will not compile due to a separate issue."
So I'd say we treat the prepbur code separately to DART code, and not have prepbuffr
changes in this pull request.
i'd agree with this, as long as there's an open issue on updating and testing the prep_bufr code at some point. it's an important converter - it generates all the conventional obs used in the reanalysis and other atmospheric runs. |
…ntation in QuikSCAT.rst Co-authored-by: Helen Kershaw <20047007+hkershaw-brown@users.noreply.github.com>
Co-authored-by: Helen Kershaw <20047007+hkershaw-brown@users.noreply.github.com>
…the AIRS documentation will be cleaned/fixed in an upcoming pull request Co-authored-by: Helen Kershaw <20047007+hkershaw-brown@users.noreply.github.com>
Co-authored-by: Helen Kershaw <20047007+hkershaw-brown@users.noreply.github.com>
Co-authored-by: Helen Kershaw <20047007+hkershaw-brown@users.noreply.github.com>
…tent with other templates and usable with macports Co-authored-by: Helen Kershaw <20047007+hkershaw-brown@users.noreply.github.com>
I agree with this and @nancycollins comment. There is currently not an open issue on updating and testing the prep_bufr code, but I will make one and remove these changes from this PR. |
…in a separate issue for updating and testing the prep_bufr code
Co-authored-by: Helen Kershaw <20047007+hkershaw-brown@users.noreply.github.com>
Derecho: mpif90 failing for gfortran gcc/13.2.0
|
MITgcm failing for utilities::nc_check
This is failing on main, fixing it on this branch. |
Derecho h4fc error:
To work around this, not using h4fc and putting the linking flags in mkmf.template |
Hi Marlee, this looks great. |
Sounds good, keep me posted.
@hkershaw-brown I've never seen this before, did they do some updates to the gcc module while it was down last week? I tried to replicate this error, but I don't even have gcc/13.2.0 available in my modules. Just 12.2.0, which doesn't give this error. Would this hello code compile with 'use mpif08'? |
gcc/13 is the default for me when I log in.
Yeah you're correct it will need mpif08 to compile, but it doesn't even get to compiling. mpif90 -show was giving me Error: A PrgEnv-* modulefile must be loaded. I think CISL are working on it at the moment, since there's a slightly different error. hkershaw@derecho6:/glade/derecho/scratch/hkershaw/test_code/mpi$ mpif90 -show |
So weird, I don't have it.
|
guess it is cool kids only. |
Update from CISL, gcc 13 mpi fixed on Derecho ! |
CISL fixed the spack for intel, and gcc/12 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work Marlee, approved.
Description:
This PR fixes multiple compile time errors related to fortran standards. For more details on the individual bugs, see the issue pages listed below.
Description of changes:
#351
DART/models/wrf/experiments/Radar/IC/sounding_perturbation/pert_sounding_module.f90:
Changed the random seed variables (iseed1 and iseed2) from real to integer types
#594 / #601
#599
DART/models/wrf_hydro/noah_hydro_mod.f90:
Simplifies the implementation for summing the number of elements in the CH_NETRT array that are greater than or equal to 0 by using the count function
#352
Fixes issue
Fixes #351 #352 #594 #601 #599
Types of changes
Documentation changes needed?
Tests
#351
Compiled successfully with gfortran 12.1.0 (the error was replicated with this version of gfortran before changes were made)
Compiled and run with intel, fixing the value of the seeds and comparing with the output on main. Due to changing the seeds from reals to ints, the changes are not bitwise with a fixed seed. Previous experiments that used real types for the seeds will not produce the same output when using the same value fixed for the seeds as integers.
Two executions with integer types for the seeds produce identical output when fixing the value of the seed.
#594 / #601
Compiled all of the following with cce and gfortran with full debug flags.
models/wrf/WRF_DART_utilities/add_pert_where_high_refl - add_pert_where_high_refl was run and produced correct outputs
models/wrf/WRF_DART_utilities/advance_cymdh - Executed the program, which was bitwise identical with main
models/wrf/WRF_DART_utilities/grid_refl_obs
models/wrf/WRF_BC/update_wrf_bc and models/wrf/WRF_BC/pert_wrf_bc
models/wrf/WRF_BC/update_wrf_bc and models/wrf/WRF_BC/update_wrf_bc
observations/obs_converters/AVISO/convert_aviso.f90
observations/obs_converters/NCEP/prep_bufr/convert_bufr/arg_test.f and observations/obs_converters/NCEP/prep_bufr/convert_bufr/stat_test.f:
observations/obs_converters/NCEP/prep_bufr/convert_bufr/arg_test.f
Note that observations/obs_converters/NCEP/prep_bufr/convert_bufr/grabbufr.f will not compile due to a separate issue.
#595
Both Noah and wrf_hydro compile without error with cce and gfortran with full debug flags
A test case is needed in order to run either model
#352
All observation converters (with the exception of GSI2DART, see above) compiled successfully using new mkmf.template files for both gfortran and intel
Checklist for merging
Checklist for release
Testing Datasets
To execute a program that uses the noah_hydro_mod, a test case will need to be provided for for either Noah or wrf_hydro