[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: 10
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: 10
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


Return to Installation

Who is online

Users browsing this forum: No registered users and 1 guest

cron