Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

Error compiling prep_chem_src

fjpi

New member
Dear all,

I am receiving this error when compiling prep_chem_src 1.5 or 1.8 beta:

-----
cp -f ../../aux_src/brams/rams_grid.f90 rams_grid.f90
gfortran -c -Xpreprocessor -DRADM_WRF_FIM -O2 -fconvert=big-endian
-frecord-marker=4 -I../../aux_src/utils/include
-I/dragofs/sw/restricted/0.2/software/netCDF/4.8.1-gompi-2021b/include
-I/dragofs/sw/restricted/0.2/software/HDF5/1.12.1-gompi-2021b/include
rams_grid.f90
rams_grid.f90:45:13:

45 | ,grid_g(ifm)%glat (1,1) ,grid_g(ifm)%glon (1,1) &
| 1
Error: Element of assumed-shape or pointer array passed to array dummy
argument 'glat' at (1)
rams_grid.f90:52:13:

52 | ,grid_g(ifm)%dxu (1,1) ,grid_g(ifm)%dxv (1,1) &
| 1
Error: Element of assumed-shape or pointer array passed to array dummy
argument 'dxu' at (1)
rams_grid.f90:62:13:

62 | ,grid_g(ifm)%dxu (1,1) ,grid_g(ifm)%dxv (1,1) &
| 1
Error: Element of assumed-shape or pointer array passed to array dummy
argument 'dxu' at (1)
rams_grid.f90:74:13:

74 | ,grid_g(ifm)%glat(1,1) ,grid_g(ifm)%glon(1,1) &
| 1
Error: Element of assumed-shape or pointer array passed to array dummy
argument 'glat' at (1)
rams_grid.f90:88:10:

88 | ,grid_g(ifm)%topt (1,1) ,grid_g(ifm)%topu (1,1) &
| 1
Error: Element of assumed-shape or pointer array passed to array dummy
argument 'topt' at (1)
rams_grid.f90:93:10:

93 | ,grid_g(ifm)%topt(1,1) ,grid_g(ifm)%topu(1,1) &
| 1
Error: Element of assumed-shape or pointer array passed to array dummy
argument 'topt' at (1)
make: *** [depend_prepsrc.mk:144: rams_grid.o] Error 1

-----

I attach the configuration files of WRF and prep_chem_src in case you can see the problem that causes this error.

Thank you in advance.

Kind regards,
Javier
 
Dear all,

I am receiving this error when compiling prep_chem_src 1.5 or 1.8 beta:

-----
cp -f ../../aux_src/brams/rams_grid.f90 rams_grid.f90
gfortran -c -Xpreprocessor -DRADM_WRF_FIM -O2 -fconvert=big-endian
-frecord-marker=4 -I../../aux_src/utils/include
-I/dragofs/sw/restricted/0.2/software/netCDF/4.8.1-gompi-2021b/include
-I/dragofs/sw/restricted/0.2/software/HDF5/1.12.1-gompi-2021b/include
rams_grid.f90
rams_grid.f90:45:13:

45 | ,grid_g(ifm)%glat (1,1) ,grid_g(ifm)%glon (1,1) &
| 1
Error: Element of assumed-shape or pointer array passed to array dummy
argument 'glat' at (1)
rams_grid.f90:52:13:

52 | ,grid_g(ifm)%dxu (1,1) ,grid_g(ifm)%dxv (1,1) &
| 1
Error: Element of assumed-shape or pointer array passed to array dummy
argument 'dxu' at (1)
rams_grid.f90:62:13:

62 | ,grid_g(ifm)%dxu (1,1) ,grid_g(ifm)%dxv (1,1) &
| 1
Error: Element of assumed-shape or pointer array passed to array dummy
argument 'dxu' at (1)
rams_grid.f90:74:13:

74 | ,grid_g(ifm)%glat(1,1) ,grid_g(ifm)%glon(1,1) &
| 1
Error: Element of assumed-shape or pointer array passed to array dummy
argument 'glat' at (1)
rams_grid.f90:88:10:

88 | ,grid_g(ifm)%topt (1,1) ,grid_g(ifm)%topu (1,1) &
| 1
Error: Element of assumed-shape or pointer array passed to array dummy
argument 'topt' at (1)
rams_grid.f90:93:10:

93 | ,grid_g(ifm)%topt(1,1) ,grid_g(ifm)%topu(1,1) &
| 1
Error: Element of assumed-shape or pointer array passed to array dummy
argument 'topt' at (1)
make: *** [depend_prepsrc.mk:144: rams_grid.o] Error 1

-----

I attach the configuration files of WRF and prep_chem_src in case you can see the problem that causes this error.

Thank you in advance.

Kind regards,
Javier
The files didn't attach properly. Can you add the .txt to the end of the files and try again?
 
Thank you. Please find attached the files.
 

Attachments

  • include.mk.gfortran.wrf.txt
    2.9 KB · Views: 25
  • configure.wrf.txt
    21.2 KB · Views: 16
So the dummy error has to do with GCC version number not being newer than the program was written on. on the super computer can you run this command

Bash:
/usr/bin/gcc -dumpfullversion
 
Okay so with GCC version 10 and above, GCC removed some of the legacy code readers that were defaulted on in GCC 9 and below.

So to make GCC 10 and above systems to work with prep-chem you need to enable these flags again.
Sample of my PREP-CHEM-SRC-1.5 install script
Bash:
  export fallow_argument=-fallow-argument-mismatch
 
 
# Installation of PREP-CHEM-SRC-1.5

cd $HOME/WRFCHEM/WRF_CHEM_Tools/PREP-CHEM-SRC-1.5/bin/build

sed -i '47s|/scratchin/grupos/catt-brams/shared/libs/gfortran/netcdf-4.1.3|${DIR}/NETCDF|' include.mk.gfortran.wrf  #Changing NETDCF Location
sed -i '53s|/scratchin/grupos/catt-brams/shared/libs/gfortran/hdf5-1.8.13-serial|${DIR}/grib2|' include.mk.gfortran.wrf #Changing HDF5 Location
sed -i '55s|-L/scratchin/grupos/catt-brams/shared/libs/gfortran/zlib-1.2.8/lib|-L${DIR}/grib2/lib|' include.mk.gfortran.wrf #Changing zlib Location
sed -i '69s|-frecord-marker=4|-frecord-marker=4 ${fallow_argument}|' include.mk.gfortran.wrf #Changing adding fallow argument mismatch to fix dummy error

make OPT=gfortran.wrf CHEM=RADM_WRF_FIM AER=SIMPLE  # Compiling and making of PRE-CHEM-SRC-1.5
 
Okay so with GCC version 10 and above, GCC removed some of the legacy code readers that were defaulted on in GCC 9 and below.

So to make GCC 10 and above systems to work with prep-chem you need to enable these flags again.

Bash:
  export fallow_argument=-fallow-argument-mismatch
 
 
# Installation of PREP-CHEM-SRC-1.5

cd $HOME/WRFCHEM/WRF_CHEM_Tools/PREP-CHEM-SRC-1.5/bin/build

sed -i '47s|/scratchin/grupos/catt-brams/shared/libs/gfortran/netcdf-4.1.3|${DIR}/NETCDF|' include.mk.gfortran.wrf  #Changing NETDCF Location
sed -i '53s|/scratchin/grupos/catt-brams/shared/libs/gfortran/hdf5-1.8.13-serial|${DIR}/grib2|' include.mk.gfortran.wrf #Changing HDF5 Location
sed -i '55s|-L/scratchin/grupos/catt-brams/shared/libs/gfortran/zlib-1.2.8/lib|-L${DIR}/grib2/lib|' include.mk.gfortran.wrf #Changing zlib Location
sed -i '69s|-frecord-marker=4|-frecord-marker=4 ${fallow_argument}|' include.mk.gfortran.wrf #Changing adding fallow argument mismatch to fix dummy error

make OPT=gfortran.wrf CHEM=RADM_WRF_FIM AER=SIMPLE  # Compiling and making of PRE-CHEM-SRC-1.5
Hi,

thank you very much! The error is now fixed!

However, now I obtain another error. Maybe you know it:


6 | module constants_module
| 1
Error: Non-numeric character in statement label at (1)
constants_module.F:8:5:

8 | real, parameter :: PI = 3.141592653589793
| 1
Error: Non-numeric character in statement label at (1)
constants_module.F:9:5:

9 | real, parameter :: OMEGA_E = 7.292e-5 ! Angular rotation rate of the earth
| 1
Error: Non-numeric character in statement label at (1)
constants_module.F:11:5:

11 | real, parameter :: DEG_PER_RAD = 180./PI
| 1
Error: Non-numeric character in statement label at (1)
constants_module.F:12:5:

12 | real, parameter :: RAD_PER_DEG = PI/180.
| 1
Error: Non-numeric character in statement label at (1)
constants_module.F:16:5:

16 | real, parameter :: A_WGS84 = 6378137.
| 1
Error: Non-numeric character in statement label at (1)
constants_module.F:17:5:

17 | real, parameter :: B_WGS84 = 6356752.314
| 1
Error: Non-numeric character in statement label at (1)
constants_module.F:18:5:

18 | real, parameter :: RE_WGS84 = A_WGS84
| 1
Error: Non-numeric character in statement label at (1)
constants_module.F:19:5:

19 | real, parameter :: E_WGS84 = 0.081819192
| 1
Error: Non-numeric character in statement label at (1)
constants_module.F:21:5:

21 | real, parameter :: A_NAD83 = 6378137.
| 1
Error: Non-numeric character in statement label at (1)
constants_module.F:22:5:

22 | real, parameter :: RE_NAD83 = A_NAD83
| 1
Error: Non-numeric character in statement label at (1)
constants_module.F:23:5:

23 | real, parameter :: E_NAD83 = 0.0818187034
| 1
Error: Non-numeric character in statement label at (1)
constants_module.F:25:5:

25 | real, parameter :: EARTH_RADIUS_M = 6370000. ! same as MM5 system
| 1
Error: Non-numeric character in statement label at (1)
constants_module.F:26:5:

26 | real, parameter :: EARTH_CIRC_M = 2.*PI*EARTH_RADIUS_M
| 1
Error: Non-numeric character in statement label at (1)
constants_module.F:28:2:

28 | end module constants_module
| 1
Error: Non-numeric character in statement label at (1)
make: *** [depend_prepsrc.mk:5: constants_module.o] Error 1
 
Ok, I have now solved all the problems related with the Fortran version by adding 7 blank spaces at the start of the .F subroutines. However, Now I receive this error:

ar rs ramslib.a grid_dims.o io_params.o node_mod.o mem_grid.o rconstants.o rams_grid.o lllc_utils.o adap_init_prepchem.o gridset_prepchem.o rcio.o
cp -f ../../aux_src/wps/cio.c cio.c
gcc -c -O2 -DPC_LINUX1 -I../../aux_src/utils/include -I/dragofs/sw/foss/0.2/software/netCDF/4.8.1-gompi-2021b/include -I/dragofs/sw/foss/0.2/software/HDF5/1.12.1-gompi-2021b/include cio.c
rm -f cio.c
cp -f ../../aux_src/wps/constants_module.F constants_module.F
gfortran -c -Xpreprocessor -DRADM_WRF_FIM -O2 -fconvert=big-endian -frecord-marker=4 -fallow-argument-mismatch -I../../aux_src/utils/include -I/dragofs/sw/foss/0.2/software/netCDF/4.8.1-gompi-2021b/include -I/dragofs/sw/foss/0.2/software/HDF5/1.12.1-gompi-2021b/include constants_module.F
rm -f constants_module.F
cp -f ../../aux_src/wps/misc_definitions_module.F misc_definitions_module.F
gfortran -c -Xpreprocessor -DRADM_WRF_FIM -O2 -fconvert=big-endian -frecord-marker=4 -fallow-argument-mismatch -I../../aux_src/utils/include -I/dragofs/sw/foss/0.2/software/netCDF/4.8.1-gompi-2021b/include -I/dragofs/sw/foss/0.2/software/HDF5/1.12.1-gompi-2021b/include misc_definitions_module.F
rm -f misc_definitions_module.F
cp -f ../../aux_src/wps/parallel_module.F parallel_module.F
gfortran -c -Xpreprocessor -DRADM_WRF_FIM -O2 -fconvert=big-endian -frecord-marker=4 -fallow-argument-mismatch -I../../aux_src/utils/include -I/dragofs/sw/foss/0.2/software/netCDF/4.8.1-gompi-2021b/include -I/dragofs/sw/foss/0.2/software/HDF5/1.12.1-gompi-2021b/include parallel_module.F
parallel_module.F:9: Error: Can't open included file 'mpif.h'
make: *** [depend_prepsrc.mk:51: parallel_module.o] Error 1
 
Hi again,

I solved that problem by changing gfrotran to mpifort. Now I get this error:

cp -f ../../aux_src/wps/parallel_module.F parallel_module.F
mpifort -c -Xpreprocessor -DRADM_WRF_FIM -O2 -fconvert=big-endian -frecord-marker=4 -fallow-argument-mismatch -I../../aux_src/utils/include -I/dragofs/sw/foss/0.2/software/netCDF/4.8.1-gompi-2021b/include -I/dragofs/sw/foss/0.2/software/HDF5/1.12.1-gompi-2021b/include parallel_module.F
parallel_module.F:8:9:

8 | #ifdef _MPI
| 1
Error: Invalid character in name at (1)
parallel_module.F:10:9:

10 | #endif
| 1
 
Here I made a script that should install it properly. give this a try.

Remove the .txt extension
Thank you very much for the script. However, it seems like it is not compatible with my machine.

Do you think the following error could be related with my GCC and/or GCC version and that I could solve it by changing the syntax?:

8 | #ifdef _MPI
| 1
Error: Invalid character in name at (1)
parallel_module.F:10:9:
10 | #endif
| 1
 
Thank you very much for the script. However, it seems like it is not compatible with my machine.

Do you think the following error could be related with my GCC and/or GCC version and that I could solve it by changing the syntax?:

8 | #ifdef _MPI
| 1
Error: Invalid character in name at (1)
parallel_module.F:10:9:
10 | #endif
| 1
Thank you very much for the script. However, it seems like it is not compatible with my machine.
What happens when you try to run the script? Did you take the .txt extension off the end of it?

Give this a try. Remove and delete the WRFCHEM folder where it was created. Then run this command.

Bash:
./PREP-CHEM-SRC-1.5.sh |& tee prepchem.log

That will give a log output of all the errors and hopefully give me an idea of what it is doing.
 
What happens when you try to run the script? Did you take the .txt extension off the end of it?

Give this a try. Remove and delete the WRFCHEM folder where it was created. Then run this command.

Bash:
./PREP-CHEM-SRC-1.5.sh |& tee prepchem.log

That will give a log output of all the errors and hopefully give me an idea of what it is doing.
For some reason, I do not have enough permissions to run the script (Permission denied)...
 
Hi again. I have solved the issue (I introduced an error in the code).

Now I get this error related with NetCDF:

-2021b/include -I/dragofs/sw/foss/0.2/software/HDF5/1.12.1-gompi-2021b/include gocart_background.f90
gocart_background.f90:132:5:

132 | use netcdf
| 1
Fatal Error: Cannot open module file 'netcdf.mod' for reading at (1): No such file or directory
compilation terminated.
 
Hi again. I have solved the issue (I introduced an error in the code).

Now I get this error related with NetCDF:

-2021b/include -I/dragofs/sw/foss/0.2/software/HDF5/1.12.1-gompi-2021b/include gocart_background.f90
gocart_background.f90:132:5:

132 | use netcdf
| 1
Fatal Error: Cannot open module file 'netcdf.mod' for reading at (1): No such file or directory
compilation terminated.
When running the script or when trying to use it?

How did you solve the error
 
When running the script or when trying to use it?

How did you solve the error
Hi again.

Even when we cannot run your script directly, we have followed it try to solve the problems. I made two changes:

1) Change from prep_chem 1.8 beta to 1.5. This solved a lot of problems related with subrouitnes .F
2) Change the path to the netCDF compiler. I was setting:

Code:
NETCDF=/dragofs/sw/foss/0.2/software/netCDF/4.8.1-gompi-2021b
NETCDF_INC=-I$(NETCDF)/include
NETCDF_LIBS=-L/dragofs/sw/foss/0.2/software/netCDF-Fortran/4.5.3-gompi-2021b/lib64 -lnetcdff -lnetcdf[

Now I use netCDF-Fortran everywhere:

Code:
NETCDF=/dragofs/sw/foss/0.2/software/netCDF-Fortran/4.5.3-gompi-2021b
NETCDF_INC=-I$(NETCDF)/include
NETCDF_LIBS=-L/dragofs/sw/foss/0.2/software/netCDF-Fortran/4.5.3-gompi-2021b/lib64 -lnetcdff -lnetcdf

In addition, I was using mpifort. Now I use gfortran.

After introducing all these changes in order to try following your script, I get this error message:

Code:
/include -I/dragofs/sw/foss/0.2/software/netCDF-Fortran/4.5.3-gompi-2021b/include -I/dragofs/sw/foss/0.2/software/HDF5/1.12.1-gompi-2021b/include  edgar_emissions.f90
edgar_emissions.f90:841:15:

  841 |         'AGRICULTURE',&
      |                      1
Error: Different CHARACTER lengths (11/6) in array constructor at (1)
edgar_emissions.f90:894:61:

  894 |       filename=trim(edgar_data_dir)//"/"//trim(PREFIX)//trim(setor(isetor))//trim(suffix)
      |                                                             1
Error: Function 'setor' at (1) has no IMPLICIT type
edgar_emissions.f90:916:16:

  916 |                if(trim(setor(isetor)) .eq. 'AGRICULTURE' .and. trim(spc_name(ispc)) .ne. 'NH3') cycle
      |                       1
Error: Function 'setor' at (1) has no IMPLICIT type
edgar_emissions.f90:923:30:

  923 |                   print*,trim(setor(isetor)),"   ",trim(dsetname),i, " MAX ",maxval(src_dummy(:,:,i))
      |                              1
Error: Function 'setor' at (1) has no IMPLICIT type
edgar_emissions.f90:924:30:

  924 |                   print*,trim(setor(isetor)),"   ",trim(dsetname),i, " MIN ",minval(src_dummy(:,:,i))
      |                              1
Error: Function 'setor' at (1) has no IMPLICIT type

Is this maybe another problem related with GCC or GFORTRAN versions?
 
Hi again,

the code is already compiled! I solves the previous problem by adding blank spaces to the names in the list so that all of them have the same length.

Then, a problem appeared during the compilation of "convert_bioge_to_RACM_REAC.f90". I read in another forum that the line use_chem has to be commented. I did it, and the code has now compiled.

Thank you for your help. I would not have been able to compile the code without your support!
 
Top