[SOLVED] PREP-CHEM-SRC-1.5 compilation gfortran.wrf error

Posts related to the installation of WRF Chemistry

[SOLVED] PREP-CHEM-SRC-1.5 compilation gfortran.wrf error

Postby ahwrf » Sun Sep 27, 2015 3:43 pm

Dear friends,

After executing "make OPT=gfortran.wrf CHEM=RADM_WRF_FIM", these errors pop out:

Code: Select all
cp -f  ../../src/edgar_emissions.f90 edgar_emissions.f90
gfortran -c -Xpreprocessor -DRADM_WRF_FIM -O2 -fconvert=big-endian -frecord-marker=4 -I../../aux_src/utils/include -I/usr/include -I/usr/include  edgar_emissions.f90
edgar_emissions.f90:841.15:

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

      filename=trim(edgar_data_dir)//"/"//trim(PREFIX)//trim(setor(isetor))//tr
                                                             1
Error: Function 'setor' at (1) has no IMPLICIT type
edgar_emissions.f90:916.16:

        if(trim(setor(isetor)) .eq. 'AGRICULTURE' .and. trim(spc_name(ispc)) .n
                1
Error: Function 'setor' at (1) has no IMPLICIT type
edgar_emissions.f90:923.30:

                  print*,trim(setor(isetor)),"   ",trim(dsetname),i, " MAX ",ma
                              1
Error: Function 'setor' at (1) has no IMPLICIT type
edgar_emissions.f90:924.30:

                  print*,trim(setor(isetor)),"   ",trim(dsetname),i, " MIN ",mi
                              1
Error: Function 'setor' at (1) has no IMPLICIT type
make: *** [edgar_emissions.o] Error 1

It seems to be related to FORTRAN itself, rather than any environment variable, etc.

Any comments please?
Last edited by ahwrf on Thu Oct 15, 2015 12:58 pm, edited 1 time in total.
ahwrf
 
Posts: 14
Joined: Thu Dec 15, 2011 3:36 am
Location: Persia

Re: SOLVED

Postby ahwrf » Wed Sep 30, 2015 6:11 am

After investigating the issue for a while, I reached to this solution which is a modification of one of the FORTRAN source codes:

Go to the directory "src" and edit the source code "edgar_emissions.f90" with "vi" editor.

Consider these lines (form 840 to 845):

Code: Select all
840  character(len=20), dimension(NSETOR) :: setor=(/&
841         'AGRICULTURE',&
842         'ENERGY',&
843         'INDUSTRY',&
844         'RESIDENTIAL',&
845         'TRANSPORT'/)

Now please add spaces to the end of the names 'ENERGY', 'INDUSTRY', and 'TRANSPORT', until the length of all the names be the same as each other and equal to the length of 'AGRICULTURE' and 'RESIDENTIAL' (i.e. equal to 11 characters). the final modification must be like bellow:

Code: Select all
841         'AGRICULTURE',&
842         'ENERGY     ',&
843         'INDUSTRY   ',&
844         'RESIDENTIAL',&
845         'TRANSPORT  '/)

Now you can do the compilation process again. The problem will not encounter any more.

Good luck!

Amirhosein Nikfal
ahwrf
 
Posts: 14
Joined: Thu Dec 15, 2011 3:36 am
Location: Persia

Re: SOLVED

Postby seneyestani » Mon Oct 26, 2015 10:08 am

ahwrf wrote:After investigating the issue for a while, I reached to this solution which is a modification of one of the FORTRAN source codes:

Go to the directory "src" and edit the source code "edgar_emissions.f90" with "vi" editor.

Consider these lines (form 840 to 845):

Code: Select all
840  character(len=20), dimension(NSETOR) :: setor=(/&
841         'AGRICULTURE',&
842         'ENERGY',&
843         'INDUSTRY',&
844         'RESIDENTIAL',&
845         'TRANSPORT'/)

Now please add spaces to the end of the names 'ENERGY', 'INDUSTRY', and 'TRANSPORT', until the length of all the names be the same as each other and equal to the length of 'AGRICULTURE' and 'RESIDENTIAL' (i.e. equal to 11 characters). the final modification must be like bellow:

Code: Select all
841         'AGRICULTURE',&
842         'ENERGY     ',&
843         'INDUSTRY   ',&
844         'RESIDENTIAL',&
845         'TRANSPORT  '/)

Now you can do the compilation process again. The problem will not encounter any more.

Good luck!

Amirhosein Nikfal


Thank you very much for this useful tip.
seneyestani
 
Posts: 2
Joined: Mon Oct 26, 2015 5:28 am

Re: [SOLVED] PREP-CHEM-SRC-1.5 compilation gfortran.wrf erro

Postby iamattri » Mon Jun 03, 2019 4:26 am

i am facing problem in compiling prep chem- src-1.5

i used 'make OPT=gfortran.wrf CHEM=RADM_WRF_FIM'


and i am getting this error

cp -f ../../src/gocart_background.f90 gocart_background.f90
gfortran -c -Xpreprocessor -DRADM_WRF_FIM -O2 -fconvert=big-endian -frecord-marker=4 -I../../aux_src/utils/include -I/scratchin/grupos/catt-brams/shared/libs/gfortran/netcdf-4.1.3/include -I/scratchin/grupos/catt-brams/shared/libs/gfortran/hdf5-1.8.13-serial/include gocart_background.f90
f951: Warning: Nonexistent include directory ‘/scratchin/grupos/catt-brams/shared/libs/gfortran/netcdf-4.1.3/include’ [-Wmissing-include-dirs]
f951: Warning: Nonexistent include directory ‘/scratchin/grupos/catt-brams/shared/libs/gfortran/hdf5-1.8.13-serial/include’ [-Wmissing-include-dirs]
gocart_background.f90:132:4:

use netcdf
1
Fatal Error: Can't open module file ‘netcdf.mod’ for reading at (1): No such file or directory
compilation terminated.



can you please help me with this error.
iamattri
 
Posts: 7
Joined: Thu Mar 01, 2018 1:17 pm

Re: [SOLVED] PREP-CHEM-SRC-1.5 compilation gfortran.wrf erro

Postby ahwrf » Wed Jun 05, 2019 12:06 pm

The problem is mentioned in the error massage:
Can't open module file ‘netcdf.mod’ for reading

If you have installed netcdf by
Code: Select all
yum install netcdf
then go to the directory /usr and look for the missing file as below:
Code: Select all
cd /usr
find | grep netcdf.mod

Now if netcdf.mod has been found, link it to the appropriate directory:
Code: Select all
ln -s /directory_to_netcdf.mod /usr/include

If there was not found any netcdf.mod, you can install it by
Code: Select all
yum install *netcdf*
and looking for netcdf.mod.

Hope this helps,
Amirhossein
ahwrf
 
Posts: 14
Joined: Thu Dec 15, 2011 3:36 am
Location: Persia


Return to Installation

Who is online

Users browsing this forum: No registered users and 2 guests