gfxgfx
 
Please login or register.

Login with username, password and session length
 
gfx gfx
gfx
1568 Posts in 518 Topics by 754 Members - Latest Member: irekzawadzki December 03, 2021, 08:12:17 AM
*
gfx* Home | Help | Search | Login | Register | gfx
gfx
Absoft User Forum  |  Support  |  General  |  Problems compiling an f90 file with a contains statement.
gfx
gfxgfx
 

Author Topic: Problems compiling an f90 file with a contains statement.  (Read 231 times)

smauget

  • Newbie
  • *
  • Posts: 1
Problems compiling an f90 file with a contains statement.
« on: September 21, 2021, 01:02:47 PM »
I'm trying to compile and install the latest version of the DSSAT Cropping System Model on macOS Mojave (10.14.6) using cmake and Absoft18.0 f90, but seem to have run into a problem with compiling one f90 file.

cmake seems to successfully generate a makefile:

-- The Fortran compiler identification is Absoft
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: /Applications/Absoft18.0/bin/f90 - skipped
-- Checking whether /Applications/Absoft18.0/bin/f90 supports Fortran 90
-- Checking whether /Applications/Absoft18.0/bin/f90 supports Fortran 90 - yes
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
-- MAJOR: 4 MINOR: 7 MODEL: 5 BUILD: 42 COMMIT:
-- BRANCH:
-- COMMIT:
-- Flags
   FFLAGS       -openmp -w -m64 -YMOD_ONLY -p/opt/imsl/fnl700/macab115e64/include -cpp
   RELEASE      -O3 -DNDEBUG -O3 -unroll
   DEBUG        -g -O0
   LINKER       
-- Build Info
   BUILD TYPE   DEBUG
   VERSION      4.7.5.42
   I. PREFIX    /usr/local
   Executable   dscsm047
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/smauget1/DSSAT47/build

The resulting makefile successfully compiles 9 object files.....

[  0%] Building Fortran object CMakeFiles/dscsm047.dir/Utilities/CSMVersion.for.o
[  0%] Building Fortran object CMakeFiles/dscsm047.dir/Utilities/OSDefsLINUX.for.o
[  0%] Building Fortran object CMakeFiles/dscsm047.dir/Utilities/ModuleDefs.for.o
[  0%] Building Fortran object CMakeFiles/dscsm047.dir/InputModule/OPHEAD.for.o
[  0%] Building Fortran object CMakeFiles/dscsm047.dir/Management/FertType_mod.for.o
[  0%] Building Fortran object CMakeFiles/dscsm047.dir/Plant/ALOHA-Pineapple/Aloha_mod.f90.o
[  1%] Building Fortran object CMakeFiles/dscsm047.dir/Plant/CANEGRO-Sugarcane/SC_CNG_mods.for.o
[  1%] Building Fortran object CMakeFiles/dscsm047.dir/Plant/CERES-SharedFiles/SLigCeres.for.o
[  1%] Building Fortran object CMakeFiles/dscsm047.dir/Plant/CSYCA-Cassava/YCA_Albedo_Check_m.f90.o

But reports an error on line 50 of the 10th file...

Absoft ERROR 25: YCA_CONTROL_ENVIRONMENT: /Users/smauget1/DSSAT47/Plant/CSYCA-Cassava/YCA_Control_Environment.f90: 50, 5
  This statement is not allowed in a derived type definition.

Line 50 in YCA_Control_Environment.f90 (attached) is a contains statement. The compiler then continues to report additional errors   and maxes out at 100 reports. The f90 syntax in  YCA_Control_Environment.f90 (interfaces, contains etc.) is a little advanced for me,  so I can't tell whether a) the syntax in this file is wrong, or b) there is something missing in my FFLAGS that would allow me to compile this particular file.

Any ideas? Any help is appreciated.



forumadmin

  • Administrator
  • Sr. Member
  • *****
  • Posts: 321
Re: Problems compiling an f90 file with a contains statement.
« Reply #1 on: September 21, 2021, 04:46:11 PM »
The YCA_Control_Environment.f90 file you submitted contains Fortran 2003 CLASS declarations, which are not supported by the Absoft compiler. The Absoft compiler is a full Fortran 95 compiler with selected features from Fortran 2003 and a few features from Fortran 2008. It is not a full Fortran 2003 compiler and will not be able to build the DSSAT Cropping System Model.

Absoft User Forum  |  Support  |  General  |  Problems compiling an f90 file with a contains statement.
 

gfxgfx
gfx gfx
Powered by MySQL Powered by PHP Valid XHTML 1.0! Valid CSS!