-
Notifications
You must be signed in to change notification settings - Fork 701
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
Temporary fix for gfortran/10 compiler complaints #1251
Conversation
changed the version check using a test program
Jenkins status is all PASS
|
BTW: this bug is affecting also the compilation of WRFDA, the FCBASEOPTS_NO_G variable seems to not be used in the setup of the makefile. all_wrfvar :
$(MAKE) MODULE_DIRS="$(DA_WRFVAR_MODULES)" ext
$(MAKE) MODULE_DIRS="$(DA_WRFVAR_MODULES)" toolsdir
if [ $(CRTM) -ne 0 ] ; then \
(cd var/external/crtm_2.3.0; $(MAKE) $(J)) ; \
fi
if [ $(BUFR) ] ; then \
(cd var/external/bufr; \
$(MAKE) $(J) FC="$(SFC)" CC="$(SCC)" CPP="$(CPP)" CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" FFLAGS="$(FCOPTIM) $(FORMAT_FIXED)" RANLIB="$(RANLIB)" AR="$(AR)" ARFLAGS="$(ARFLAGS)" ) ; \
fi |
@liujake @jjguerrette @yriveiro |
- moved GFORTRAN_VERSION_CHECK program generation inside conditional - remove the temporary files after check
@davegill Build completed successfully. ========================================================================== ---> Executables successfully built <--- -rwxrwxr-x 1 syalavarthi syalavarthi 36969912 Jul 31 08:15 main/ndown.exe ========================================================================== [08:15] [syalavarthi@sparrow WRF]$ uname -a ` |
@syalavarthi @yriveiro Yago, |
@syalavarthi |
@wrf-model/da |
@davegill I work for Marvell Semiconductor. |
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.
I have added changes to fix build issues with WRFDA system by introducing new configure variable "FCCOMPAT"
With these new changes, I could build WRF / WRFPLUS / 3DVAR / 4DVAR
[00:01] [syalavarthi@sparrow WRF]$./configure wrfda && ./compile all_wrfvar && ls var/build/*.exe
var/build/da_advance_time.exe var/build/da_tune_obs_hollingsworth1.exe var/build/gen_be_addmean.exe var/build/gen_be_diags.exe var/build/gen_be_hist.exe var/build/gen_be_stage2_1dvar.exe var/build/gen_mbe_stage2.exe
var/build/da_bias_airmass.exe var/build/da_tune_obs_hollingsworth2.exe var/build/gen_be_cov2d.exe var/build/gen_be_diags_read.exe var/build/gen_be_stage0_gsi.exe var/build/gen_be_stage2_gsi.exe
var/build/da_bias_scan.exe var/build/da_update_bc.exe var/build/gen_be_cov2d3d_contrib.exe var/build/gen_be_ensmean.exe var/build/gen_be_stage0_wrf.exe var/build/gen_be_stage2a.exe
var/build/da_bias_sele.exe var/build/da_update_bc_ad.exe var/build/gen_be_cov3d.exe var/build/gen_be_ensrf.exe var/build/gen_be_stage1.exe var/build/gen_be_stage3.exe
var/build/da_bias_verif.exe var/build/da_verif_grid.exe var/build/gen_be_cov3d2d_contrib.exe var/build/gen_be_ep1.exe var/build/gen_be_stage1_1dvar.exe var/build/gen_be_stage4_global.exe
var/build/da_rad_diags.exe var/build/da_verif_obs.exe var/build/gen_be_cov3d3d_bin3d_contrib.exe var/build/gen_be_ep2.exe var/build/gen_be_stage1_gsi.exe var/build/gen_be_stage4_regional.exe
var/build/da_tune_obs_desroziers.exe var/build/da_wrfvar.exe var/build/gen_be_cov3d3d_contrib.exe var/build/gen_be_etkf.exe var/build/gen_be_stage2.exe var/build/gen_be_vertloc.exe
[00:10] [syalavarthi@sparrow WRF]$
[06:40] [syalavarthi@sparrow WRFPLUS]$./configure wrfplus && ./compile wrfplus && ls main/*.exe
main/wrfplus.exe
[07:16] [syalavarthi@sparrow WRF]$./configure 4dvar && ./compile all_wrfvar && ls var/build/*.exe
var/build/da_advance_time.exe var/build/da_tune_obs_hollingsworth1.exe var/build/gen_be_addmean.exe var/build/gen_be_diags.exe var/build/gen_be_hist.exe var/build/gen_be_stage2_1dvar.exe var/build/gen_mbe_stage2.exe
var/build/da_bias_airmass.exe var/build/da_tune_obs_hollingsworth2.exe var/build/gen_be_cov2d.exe var/build/gen_be_diags_read.exe var/build/gen_be_stage0_gsi.exe var/build/gen_be_stage2_gsi.exe
var/build/da_bias_scan.exe var/build/da_update_bc.exe var/build/gen_be_cov2d3d_contrib.exe var/build/gen_be_ensmean.exe var/build/gen_be_stage0_wrf.exe var/build/gen_be_stage2a.exe
var/build/da_bias_sele.exe var/build/da_update_bc_ad.exe var/build/gen_be_cov3d.exe var/build/gen_be_ensrf.exe var/build/gen_be_stage1.exe var/build/gen_be_stage3.exe
var/build/da_bias_verif.exe var/build/da_verif_grid.exe var/build/gen_be_cov3d2d_contrib.exe var/build/gen_be_ep1.exe var/build/gen_be_stage1_1dvar.exe var/build/gen_be_stage4_global.exe
var/build/da_rad_diags.exe var/build/da_verif_obs.exe var/build/gen_be_cov3d3d_bin3d_contrib.exe var/build/gen_be_ep2.exe var/build/gen_be_stage1_gsi.exe var/build/gen_be_stage4_regional.exe
var/build/da_tune_obs_desroziers.exe var/build/da_wrfvar.exe var/build/gen_be_cov3d3d_contrib.exe var/build/gen_be_etkf.exe var/build/gen_be_stage2.exe var/build/gen_be_vertloc.exe
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.
Approved
@syalavarthi |
Thank you |
…#1251) TYPE: bug fix KEYWORDS: gfortran/10 SOURCE: Srikanth Yalavarthi (Marvell Semiconductor) DESCRIPTION OF CHANGES: Problem: Due to argument inconsistencies, the WRF code will not compile with gfortran/10. Here are some examples of incorrect Fortran argument usages: ``` Error: Rank mismatch between actual argument at (1) and actual argument at (2) (rank-1 and scalar) wrf_io.f:7605:71: 7605 | ,i1,i2,j1,j2,k1,k2 ) | 1 ``` ``` Error: Type mismatch in argument ‘field’ at (1); passed INTEGER(4) to REAL(8) wrf_io.f:7744:49: 2538 | stat = NF_GET_ATT_INT (DH%NCID,NF_GLOBAL,Element,Buffer) | 2 ...... 7744 | stat = NF_GET_ATT_INT(NCID,VarID,'FieldType',FType) | 1 ``` ``` Error: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-3) field_routines.f:158:52: 110 | stat = NF_GET_VARA_INT(NCID,VarID,VStart,VCount,Data) | 2 ...... 158 | stat = NF_GET_VARA_INT(NCID,VarID,VStart,VCount,Buffer) | 1 ``` ``` Error: Rank mismatch in argument ‘fileindex’ at (1) (scalar and rank-1) io_grib1.f90:685:27: 685 | CALL gr1_fill_eta_levels(fileinfo(DataHandle)%fileindex(:), FileFd(DataHandle), & | 1 ``` ``` Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(4)/REAL(4)). module_internal_header_util.f:1592:39: 1592 | DataHandle, Data, Count, code ) | 1 ...... 1654 | DataHandle, Data, Count, code ) | 2 ``` ``` Error: Rank mismatch between actual argument at (1) and actual argument at (2) (rank-1 and scalar) module_io_int_read.f:129:39: 129 | call mpi_file_read_at(ifd, offset, tmp, 1, & | 1 ...... 573 | call mpi_file_read_at(ifd, offset, tmp, num, & | 2 ``` ``` Error: Type mismatch between actual argument at (1) and actual argument at (2) (REAL(8)/COMPLEX(8)). zmfm1b.f90:74:38: 72 | call zmf3kb ( lot, ido, l1, na, c, jump, inc, ch, 1, lot, wa(iw) ) | 2 73 | else if ( nbr == 4 ) then 74 | call zmf3kb ( lot, ido, l1, na, ch, 1, lot, c, jump, inc, wa(iw) ) | 1 ``` The errors in the WRF infrastructure code can be eventually updated. However, the code from the FFTPACK library will be left AS-IS. We are going to initially address all of the problems in a temporary fashion. Temporary solution: A compiler flag was added for the gfortran compiler to allow mismatched arguments, which enables the WRF system to build. The new flag is only for versions of gfortran 10 and later. This change was introduced in the configure script, which modifies all gfortran stanzas. Permanent fix: A complete fix requires changes in the Fortran sources for BOZ declarations and to fix mismatches in subroutine arguments. ISSUE: Fixes wrf-model#1250 LIST OF MODIFIED FILES: M Makefile M arch/configure.defaults M configure TESTS CONDUCTED: 1. Successfully built the master branch with GCC-10 on RPi4 Ubuntu-20.04 machine 2. Logic tested, where only GNU 10 and above are impacted. 3. Other compilers are not affected. 4. Jenkins testing is OK. 5. The DA variants have been tested also: I could build WRF / WRFPLUS / 3DVAR / 4DVAR ``` [00:01] [syalavarthi@sparrow WRF]$./configure wrfda && ./compile all_wrfvar && ls var/build/*.exe var/build/da_advance_time.exe var/build/da_tune_obs_hollingsworth1.exe var/build/gen_be_addmean.exe var/build/gen_be_diags.exe var/build/gen_be_hist.exe var/build/gen_be_stage2_1dvar.exe var/build/gen_mbe_stage2.exe var/build/da_bias_airmass.exe var/build/da_tune_obs_hollingsworth2.exe var/build/gen_be_cov2d.exe var/build/gen_be_diags_read.exe var/build/gen_be_stage0_gsi.exe var/build/gen_be_stage2_gsi.exe var/build/da_bias_scan.exe var/build/da_update_bc.exe var/build/gen_be_cov2d3d_contrib.exe var/build/gen_be_ensmean.exe var/build/gen_be_stage0_wrf.exe var/build/gen_be_stage2a.exe var/build/da_bias_sele.exe var/build/da_update_bc_ad.exe var/build/gen_be_cov3d.exe var/build/gen_be_ensrf.exe var/build/gen_be_stage1.exe var/build/gen_be_stage3.exe var/build/da_bias_verif.exe var/build/da_verif_grid.exe var/build/gen_be_cov3d2d_contrib.exe var/build/gen_be_ep1.exe var/build/gen_be_stage1_1dvar.exe var/build/gen_be_stage4_global.exe var/build/da_rad_diags.exe var/build/da_verif_obs.exe var/build/gen_be_cov3d3d_bin3d_contrib.exe var/build/gen_be_ep2.exe var/build/gen_be_stage1_gsi.exe var/build/gen_be_stage4_regional.exe var/build/da_tune_obs_desroziers.exe var/build/da_wrfvar.exe var/build/gen_be_cov3d3d_contrib.exe var/build/gen_be_etkf.exe var/build/gen_be_stage2.exe var/build/gen_be_vertloc.exe [00:10] [syalavarthi@sparrow WRF]$ [06:40] [syalavarthi@sparrow WRFPLUS]$./configure wrfplus && ./compile wrfplus && ls main/*.exe main/wrfplus.exe [07:16] [syalavarthi@sparrow WRF]$./configure 4dvar && ./compile all_wrfvar && ls var/build/*.exe var/build/da_advance_time.exe var/build/da_tune_obs_hollingsworth1.exe var/build/gen_be_addmean.exe var/build/gen_be_diags.exe var/build/gen_be_hist.exe var/build/gen_be_stage2_1dvar.exe var/build/gen_mbe_stage2.exe var/build/da_bias_airmass.exe var/build/da_tune_obs_hollingsworth2.exe var/build/gen_be_cov2d.exe var/build/gen_be_diags_read.exe var/build/gen_be_stage0_gsi.exe var/build/gen_be_stage2_gsi.exe var/build/da_bias_scan.exe var/build/da_update_bc.exe var/build/gen_be_cov2d3d_contrib.exe var/build/gen_be_ensmean.exe var/build/gen_be_stage0_wrf.exe var/build/gen_be_stage2a.exe var/build/da_bias_sele.exe var/build/da_update_bc_ad.exe var/build/gen_be_cov3d.exe var/build/gen_be_ensrf.exe var/build/gen_be_stage1.exe var/build/gen_be_stage3.exe var/build/da_bias_verif.exe var/build/da_verif_grid.exe var/build/gen_be_cov3d2d_contrib.exe var/build/gen_be_ep1.exe var/build/gen_be_stage1_1dvar.exe var/build/gen_be_stage4_global.exe var/build/da_rad_diags.exe var/build/da_verif_obs.exe var/build/gen_be_cov3d3d_bin3d_contrib.exe var/build/gen_be_ep2.exe var/build/gen_be_stage1_gsi.exe var/build/gen_be_stage4_regional.exe var/build/da_tune_obs_desroziers.exe var/build/da_wrfvar.exe var/build/gen_be_cov3d3d_contrib.exe var/build/gen_be_etkf.exe var/build/gen_be_stage2.exe var/build/gen_be_vertloc.exe ``` RELEASE NOTE: Due to subroutine and function argument inconsistencies, the WRF code will not compile with gfortran/10. The fix introduces a new compiler flag for all gfortran stanzas (`-fallow-argument-mismatch -fallow-invalid-boz`).
Temporary fix for gfortran/10 compiler argument mismatches (wrf-model#1251)
In order to patch GCC arguments when using GCC-10+ a line `^FCCOMPAT` is necessary in `configure.wrf`. This patch is an extension to wrf-model#1251.
TYPE: bug-fix KEYWORDS: GCC SOURCE: Stephen Sachs (AWS) DESCRIPTION OF CHANGES: Problem: GCC-10 onwards compilation fails on ARM because of missing macro, FCCOMPAT. Solution: In order to patch GCC arguments when using GCC-10+ a line FCCOMPAT is necessary in configure.wrf. This patch is an extension to #1251.
…#1251) TYPE: bug fix KEYWORDS: gfortran/10 SOURCE: Srikanth Yalavarthi (Marvell Semiconductor) DESCRIPTION OF CHANGES: Problem: Due to argument inconsistencies, the WRF code will not compile with gfortran/10. Here are some examples of incorrect Fortran argument usages: ``` Error: Rank mismatch between actual argument at (1) and actual argument at (2) (rank-1 and scalar) wrf_io.f:7605:71: 7605 | ,i1,i2,j1,j2,k1,k2 ) | 1 ``` ``` Error: Type mismatch in argument ‘field’ at (1); passed INTEGER(4) to REAL(8) wrf_io.f:7744:49: 2538 | stat = NF_GET_ATT_INT (DH%NCID,NF_GLOBAL,Element,Buffer) | 2 ...... 7744 | stat = NF_GET_ATT_INT(NCID,VarID,'FieldType',FType) | 1 ``` ``` Error: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-3) field_routines.f:158:52: 110 | stat = NF_GET_VARA_INT(NCID,VarID,VStart,VCount,Data) | 2 ...... 158 | stat = NF_GET_VARA_INT(NCID,VarID,VStart,VCount,Buffer) | 1 ``` ``` Error: Rank mismatch in argument ‘fileindex’ at (1) (scalar and rank-1) io_grib1.f90:685:27: 685 | CALL gr1_fill_eta_levels(fileinfo(DataHandle)%fileindex(:), FileFd(DataHandle), & | 1 ``` ``` Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(4)/REAL(4)). module_internal_header_util.f:1592:39: 1592 | DataHandle, Data, Count, code ) | 1 ...... 1654 | DataHandle, Data, Count, code ) | 2 ``` ``` Error: Rank mismatch between actual argument at (1) and actual argument at (2) (rank-1 and scalar) module_io_int_read.f:129:39: 129 | call mpi_file_read_at(ifd, offset, tmp, 1, & | 1 ...... 573 | call mpi_file_read_at(ifd, offset, tmp, num, & | 2 ``` ``` Error: Type mismatch between actual argument at (1) and actual argument at (2) (REAL(8)/COMPLEX(8)). zmfm1b.f90:74:38: 72 | call zmf3kb ( lot, ido, l1, na, c, jump, inc, ch, 1, lot, wa(iw) ) | 2 73 | else if ( nbr == 4 ) then 74 | call zmf3kb ( lot, ido, l1, na, ch, 1, lot, c, jump, inc, wa(iw) ) | 1 ``` The errors in the WRF infrastructure code can be eventually updated. However, the code from the FFTPACK library will be left AS-IS. We are going to initially address all of the problems in a temporary fashion. Temporary solution: A compiler flag was added for the gfortran compiler to allow mismatched arguments, which enables the WRF system to build. The new flag is only for versions of gfortran 10 and later. This change was introduced in the configure script, which modifies all gfortran stanzas. Permanent fix: A complete fix requires changes in the Fortran sources for BOZ declarations and to fix mismatches in subroutine arguments. ISSUE: Fixes wrf-model#1250 LIST OF MODIFIED FILES: M Makefile M arch/configure.defaults M configure TESTS CONDUCTED: 1. Successfully built the master branch with GCC-10 on RPi4 Ubuntu-20.04 machine 2. Logic tested, where only GNU 10 and above are impacted. 3. Other compilers are not affected. 4. Jenkins testing is OK. 5. The DA variants have been tested also: I could build WRF / WRFPLUS / 3DVAR / 4DVAR ``` [00:01] [syalavarthi@sparrow WRF]$./configure wrfda && ./compile all_wrfvar && ls var/build/*.exe var/build/da_advance_time.exe var/build/da_tune_obs_hollingsworth1.exe var/build/gen_be_addmean.exe var/build/gen_be_diags.exe var/build/gen_be_hist.exe var/build/gen_be_stage2_1dvar.exe var/build/gen_mbe_stage2.exe var/build/da_bias_airmass.exe var/build/da_tune_obs_hollingsworth2.exe var/build/gen_be_cov2d.exe var/build/gen_be_diags_read.exe var/build/gen_be_stage0_gsi.exe var/build/gen_be_stage2_gsi.exe var/build/da_bias_scan.exe var/build/da_update_bc.exe var/build/gen_be_cov2d3d_contrib.exe var/build/gen_be_ensmean.exe var/build/gen_be_stage0_wrf.exe var/build/gen_be_stage2a.exe var/build/da_bias_sele.exe var/build/da_update_bc_ad.exe var/build/gen_be_cov3d.exe var/build/gen_be_ensrf.exe var/build/gen_be_stage1.exe var/build/gen_be_stage3.exe var/build/da_bias_verif.exe var/build/da_verif_grid.exe var/build/gen_be_cov3d2d_contrib.exe var/build/gen_be_ep1.exe var/build/gen_be_stage1_1dvar.exe var/build/gen_be_stage4_global.exe var/build/da_rad_diags.exe var/build/da_verif_obs.exe var/build/gen_be_cov3d3d_bin3d_contrib.exe var/build/gen_be_ep2.exe var/build/gen_be_stage1_gsi.exe var/build/gen_be_stage4_regional.exe var/build/da_tune_obs_desroziers.exe var/build/da_wrfvar.exe var/build/gen_be_cov3d3d_contrib.exe var/build/gen_be_etkf.exe var/build/gen_be_stage2.exe var/build/gen_be_vertloc.exe [00:10] [syalavarthi@sparrow WRF]$ [06:40] [syalavarthi@sparrow WRFPLUS]$./configure wrfplus && ./compile wrfplus && ls main/*.exe main/wrfplus.exe [07:16] [syalavarthi@sparrow WRF]$./configure 4dvar && ./compile all_wrfvar && ls var/build/*.exe var/build/da_advance_time.exe var/build/da_tune_obs_hollingsworth1.exe var/build/gen_be_addmean.exe var/build/gen_be_diags.exe var/build/gen_be_hist.exe var/build/gen_be_stage2_1dvar.exe var/build/gen_mbe_stage2.exe var/build/da_bias_airmass.exe var/build/da_tune_obs_hollingsworth2.exe var/build/gen_be_cov2d.exe var/build/gen_be_diags_read.exe var/build/gen_be_stage0_gsi.exe var/build/gen_be_stage2_gsi.exe var/build/da_bias_scan.exe var/build/da_update_bc.exe var/build/gen_be_cov2d3d_contrib.exe var/build/gen_be_ensmean.exe var/build/gen_be_stage0_wrf.exe var/build/gen_be_stage2a.exe var/build/da_bias_sele.exe var/build/da_update_bc_ad.exe var/build/gen_be_cov3d.exe var/build/gen_be_ensrf.exe var/build/gen_be_stage1.exe var/build/gen_be_stage3.exe var/build/da_bias_verif.exe var/build/da_verif_grid.exe var/build/gen_be_cov3d2d_contrib.exe var/build/gen_be_ep1.exe var/build/gen_be_stage1_1dvar.exe var/build/gen_be_stage4_global.exe var/build/da_rad_diags.exe var/build/da_verif_obs.exe var/build/gen_be_cov3d3d_bin3d_contrib.exe var/build/gen_be_ep2.exe var/build/gen_be_stage1_gsi.exe var/build/gen_be_stage4_regional.exe var/build/da_tune_obs_desroziers.exe var/build/da_wrfvar.exe var/build/gen_be_cov3d3d_contrib.exe var/build/gen_be_etkf.exe var/build/gen_be_stage2.exe var/build/gen_be_vertloc.exe ``` RELEASE NOTE: Due to subroutine and function argument inconsistencies, the WRF code will not compile with gfortran/10. The fix introduces a new compiler flag for all gfortran stanzas (`-fallow-argument-mismatch -fallow-invalid-boz`).
TYPE: bug-fix KEYWORDS: GCC SOURCE: Stephen Sachs (AWS) DESCRIPTION OF CHANGES: Problem: GCC-10 onwards compilation fails on ARM because of missing macro, FCCOMPAT. Solution: In order to patch GCC arguments when using GCC-10+ a line FCCOMPAT is necessary in configure.wrf. This patch is an extension to wrf-model#1251.
TYPE: bug fix
KEYWORDS: gfortran/10
SOURCE: Srikanth Yalavarthi (Marvell Semiconductor)
DESCRIPTION OF CHANGES:
Problem:
Due to argument inconsistencies, the WRF code will not compile with gfortran/10.
Here are some examples of incorrect Fortran argument usages:
The errors in the WRF infrastructure code can be eventually updated. However, the code from the FFTPACK library
will be left AS-IS. We are going to initially address all of the problems in a temporary fashion.
Temporary solution:
A compiler flag was added for the gfortran compiler to allow mismatched arguments, which enables the WRF system
to build. The new flag is only for versions of gfortran 10 and later. This change was introduced in the configure script,
which modifies all gfortran stanzas.
Permanent fix:
A complete fix requires changes in the Fortran sources for BOZ declarations and to fix mismatches in subroutine
arguments.
ISSUE:
Fixes #1250
LIST OF MODIFIED FILES:
M Makefile
M arch/configure.defaults
M configure
TESTS CONDUCTED:
RELEASE NOTE: Due to subroutine and function argument inconsistencies, the WRF code will not compile with gfortran/10. The fix introduces a new compiler flag for all gfortran stanzas (
-fallow-argument-mismatch -fallow-invalid-boz
).