> ./configure with choice :3. Linux x86_64, gfortran (dmpar)
>dbuser@nxqh120:~/WRFv4.7/WPS-4.6.0$ gcc --version
gcc (GCC) 14.2.1 20250110 (Red Hat 14.2.1-7)
>dbuser@nxqh120:~/WRFv4.7/WPS-4.6.0$ gfortran --version
GNU Fortran (GCC) 14.2.1 20250110 (Red Hat 14.2.1-7)
>dbuser@nxqh120:~/WRFv4.7/WPS-4.6.0$ rpm -qi openmpi
Name : openmpi
Epoch : 2
Version : 5.0.2
Release : 5.el10
Architecture: x86_64
bug:
normal compiled metgrid.exe runs well BUT will produce ZERO time and NO VARIABLE in the met_em.d0?*.nc . see the attached files.
>ncdump -h met_em.d01.2025-01-01_00\:00\:00.nc |less
netcdf met_em.d01.2025-01-01_00\:00\:00 {
dimensions:
Time = UNLIMITED ; // (0 currently)
DateStrLen = 19 ;
variables:
char Times(Time, DateStrLen) ;
// global attributes:
:TITLE = "OUTPUT FROM METGRID V4.6.0" ;
my solution:
1,
>dbuser@nxqh120:~/WRFv4.7/WPS-4.6.0$ touch ./metgrid/src/output_module.F
2,
edit my configure.wps file and remove both '-O' of F77 compile&link FLAGS, as:
# new:
FFLAGS = $(FORMAT_FREE) -fconvert=big-endian -frecord-marker=4
F77FLAGS = $(FORMAT_FIXED) -fconvert=big-endian -frecord-marker=4
# old:
#FFLAGS = $(FORMAT_FREE) -O -fconvert=big-endian -frecord-marker=4
#F77FLAGS = $(FORMAT_FIXED) -O -fconvert=big-endian -frecord-marker=4
3,
re-compile metgrid.exe: >./compile
,this version of metgrid.exe generate normal met_em.nc files.
deeper dig:
in ./metgrid/src/output_module.F --> subroutine write_field ,
```
1128 ! Now a write call is only done if each processor writes its own file, or if we are the IO_NODE
1129 if (my_proc_id == IO_NODE .or. do_tiled_output) then
1130 comm_1 = 1
1131 comm_2 = 1
1132 domain_desc = 0
1133
1134 do i=1,NUM_FIELDS
```
line 1134, the NUM_FIELDS will always be set to 0 if I use '-O' option when compile (I add an print clause here, without -O, NUM_FIELDS=93, with -O option, NUM_FIELDS=0), and as it never be explictly initialized in this subroutine, maybe the gfortran/gcc optim it as 0.
Infact , I don't know if this is a bug, or the gfortran's bug.
good day!
>dbuser@nxqh120:~/WRFv4.7/WPS-4.6.0$ gcc --version
gcc (GCC) 14.2.1 20250110 (Red Hat 14.2.1-7)
>dbuser@nxqh120:~/WRFv4.7/WPS-4.6.0$ gfortran --version
GNU Fortran (GCC) 14.2.1 20250110 (Red Hat 14.2.1-7)
>dbuser@nxqh120:~/WRFv4.7/WPS-4.6.0$ rpm -qi openmpi
Name : openmpi
Epoch : 2
Version : 5.0.2
Release : 5.el10
Architecture: x86_64
bug:
normal compiled metgrid.exe runs well BUT will produce ZERO time and NO VARIABLE in the met_em.d0?*.nc . see the attached files.
>ncdump -h met_em.d01.2025-01-01_00\:00\:00.nc |less
netcdf met_em.d01.2025-01-01_00\:00\:00 {
dimensions:
Time = UNLIMITED ; // (0 currently)
DateStrLen = 19 ;
variables:
char Times(Time, DateStrLen) ;
// global attributes:
:TITLE = "OUTPUT FROM METGRID V4.6.0" ;
my solution:
1,
>dbuser@nxqh120:~/WRFv4.7/WPS-4.6.0$ touch ./metgrid/src/output_module.F
2,
edit my configure.wps file and remove both '-O' of F77 compile&link FLAGS, as:
# new:
FFLAGS = $(FORMAT_FREE) -fconvert=big-endian -frecord-marker=4
F77FLAGS = $(FORMAT_FIXED) -fconvert=big-endian -frecord-marker=4
# old:
#FFLAGS = $(FORMAT_FREE) -O -fconvert=big-endian -frecord-marker=4
#F77FLAGS = $(FORMAT_FIXED) -O -fconvert=big-endian -frecord-marker=4
3,
re-compile metgrid.exe: >./compile
,this version of metgrid.exe generate normal met_em.nc files.
deeper dig:
in ./metgrid/src/output_module.F --> subroutine write_field ,
```
1128 ! Now a write call is only done if each processor writes its own file, or if we are the IO_NODE
1129 if (my_proc_id == IO_NODE .or. do_tiled_output) then
1130 comm_1 = 1
1131 comm_2 = 1
1132 domain_desc = 0
1133
1134 do i=1,NUM_FIELDS
```
line 1134, the NUM_FIELDS will always be set to 0 if I use '-O' option when compile (I add an print clause here, without -O, NUM_FIELDS=93, with -O option, NUM_FIELDS=0), and as it never be explictly initialized in this subroutine, maybe the gfortran/gcc optim it as 0.
Infact , I don't know if this is a bug, or the gfortran's bug.
good day!