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

fix WRFDA stand-alone da_rad_diags.exe build with GNU Fortran 11 #1605

Merged
merged 1 commit into from
Dec 18, 2021

Conversation

jamiebresch
Copy link
Contributor

@jamiebresch jamiebresch commented Dec 17, 2021

TYPE: bug fix

KEYWORDS: WRFDA, da_rad_diags.exe, gfortran-11

SOURCE: Jamie Bresch (NCAR)

DESCRIPTION OF CHANGES:
Problem:
On MacOS with GNU Fortran (Homebrew GCC 11.1.0_1) 11.1.0, the stand-alone utility da_rad_diags.exe does not build.
The error messages:

gfortran -c -O2 -ftree-vectorize -funroll-loops -w -ffree-form -ffree-line-length-none -fconvert=big-endian -frecord-marker=4 -fallow-argument-mismatch -fallow-invalid-boz  -fdefault-real-8 -I/usr/local/include da_rad_diags.f
da_rad_diags.f:1804:28:

 1804 |    namelist /record1/ nproc, instid, file_prefix, start_date, end_date, cycle_period
      |                            1
Error: Symbol 'nproc' in namelist 'record1' at (1) must be declared before the namelist is declared.
da_rad_diags.f:1804:36:

 1804 |    namelist /record1/ nproc, instid, file_prefix, start_date, end_date, cycle_period
      |                                    1
Error: Symbol 'instid' in namelist 'record1' at (1) must be declared before the namelist is declared.
da_rad_diags.f:1804:49:

 1804 |    namelist /record1/ nproc, instid, file_prefix, start_date, end_date, cycle_period
      |                                                 1
Error: Symbol 'file_prefix' in namelist 'record1' at (1) must be declared before the namelist is declared.
da_rad_diags.f:1804:61:

 1804 |    namelist /record1/ nproc, instid, file_prefix, start_date, end_date, cycle_period
      |                                                             1
Error: Symbol 'start_date' in namelist 'record1' at (1) must be declared before the namelist is declared.
da_rad_diags.f:1804:71:

 1804 |    namelist /record1/ nproc, instid, file_prefix, start_date, end_date, cycle_period
      |                                                                       1
Error: Symbol 'end_date' in namelist 'record1' at (1) must be declared before the namelist is declared.
da_rad_diags.f:1804:84:

 1804 |    namelist /record1/ nproc, instid, file_prefix, start_date, end_date, cycle_period
      |                                                                                    1
Error: Symbol 'cycle_period' in namelist 'record1' at (1) must be declared before the namelist is declared.
make[1]: [da_rad_diags.o] Error 1 (ignored)

Solution:
Move the namelist statement after variable declarations, then the code builds.

LIST OF MODIFIED FILES:
M var/da/da_monitor/da_rad_diags.f90

TESTS CONDUCTED:

  1. da_rad_diags.exe is generated after the fix.

RELEASE NOTE: N/A (it is probably not worth mentioning)

@jamiebresch jamiebresch merged commit fd2118b into wrf-model:develop Dec 18, 2021
@jamiebresch jamiebresch deleted the gcc11 branch December 18, 2021 00:31
vlakshmanan-scala pushed a commit to scala-computing/WRF that referenced this pull request Apr 4, 2024
…-model#1605)

TYPE: bug fix

KEYWORDS: WRFDA, da_rad_diags.exe, gfortran-11

SOURCE: Jamie Bresch (NCAR)

DESCRIPTION OF CHANGES:
Problem:
On MacOS with GNU Fortran (Homebrew GCC 11.1.0_1) 11.1.0, the stand-alone utility da_rad_diags.exe does not build.
The error messages:
```
gfortran -c -O2 -ftree-vectorize -funroll-loops -w -ffree-form -ffree-line-length-none -fconvert=big-endian -frecord-marker=4 -fallow-argument-mismatch -fallow-invalid-boz  -fdefault-real-8 -I/usr/local/include da_rad_diags.f
da_rad_diags.f:1804:28:

 1804 |    namelist /record1/ nproc, instid, file_prefix, start_date, end_date, cycle_period
      |                            1
Error: Symbol 'nproc' in namelist 'record1' at (1) must be declared before the namelist is declared.
da_rad_diags.f:1804:36:

 1804 |    namelist /record1/ nproc, instid, file_prefix, start_date, end_date, cycle_period
      |                                    1
Error: Symbol 'instid' in namelist 'record1' at (1) must be declared before the namelist is declared.
da_rad_diags.f:1804:49:

 1804 |    namelist /record1/ nproc, instid, file_prefix, start_date, end_date, cycle_period
      |                                                 1
Error: Symbol 'file_prefix' in namelist 'record1' at (1) must be declared before the namelist is declared.
da_rad_diags.f:1804:61:

 1804 |    namelist /record1/ nproc, instid, file_prefix, start_date, end_date, cycle_period
      |                                                             1
Error: Symbol 'start_date' in namelist 'record1' at (1) must be declared before the namelist is declared.
da_rad_diags.f:1804:71:

 1804 |    namelist /record1/ nproc, instid, file_prefix, start_date, end_date, cycle_period
      |                                                                       1
Error: Symbol 'end_date' in namelist 'record1' at (1) must be declared before the namelist is declared.
da_rad_diags.f:1804:84:

 1804 |    namelist /record1/ nproc, instid, file_prefix, start_date, end_date, cycle_period
      |                                                                                    1
Error: Symbol 'cycle_period' in namelist 'record1' at (1) must be declared before the namelist is declared.
make[1]: [da_rad_diags.o] Error 1 (ignored)
```

Solution:
Move the namelist statement after variable declarations, then the code builds.

LIST OF MODIFIED FILES:
M       var/da/da_monitor/da_rad_diags.f90

TESTS CONDUCTED:
1. da_rad_diags.exe is generated after the fix.

RELEASE NOTE: N/A (it is probably not worth mentioning)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants