ufs-community / UFS_UTILS

Utilities for the NCEP models.
Other
21 stars 104 forks source link

release/public-v1: syntax errors when compiled using debug flags (Intel) #69

Closed DusanJovic-NOAA closed 4 years ago

DusanJovic-NOAA commented 4 years ago

When I compile chgres_cube using debug compile flags (on Hera using Intel compiler), I get the following syntax errors:

/scratch2/NCEPDEV/fv3-cam/Dusan.Jovic/sufs/simple-ufs-aero/src/preproc/sorc/chgres_cube.fd/program_setup.f90(280): error #6631: A non-optional actual argument must be present when invoking a procedure with an explicit interface.   [RC]
     call error_handler("FOR GRIB2 DATA, PLEASE PROVIDE GRIB2_FILE_INPUT_GRID")  
----------^                                                                      
compilation aborted for /scratch2/NCEPDEV/fv3-cam/Dusan.Jovic/sufs/simple-ufs-aero/src/preproc/sorc/chgres_cube.fd/program_setup.f90 (code 1)

and

/scratch2/NCEPDEV/fv3-cam/Dusan.Jovic/sufs/simple-ufs-aero/src/preproc/sorc/chgres_cube.fd/input_data.F90(5532): error #6631: A non-optional actual argument must be present when invoking a procedure with an explic
it interface.   [RC]
    call error_handler("ERROR USING MISSING_VAR_METHOD. PLEASE SET VALUES IN" // &
---------^
/scratch2/NCEPDEV/fv3-cam/Dusan.Jovic/sufs/simple-ufs-aero/src/preproc/sorc/chgres_cube.fd/input_data.F90(5564): error #6631: A non-optional actual argument must be present when invoking a procedure with an explic
it interface.   [RC]
    call error_handler("reading soil levels. File must have 4 soil levels.")
---------^
compilation aborted for /scratch2/NCEPDEV/fv3-cam/Dusan.Jovic/sufs/simple-ufs-aero/src/preproc/sorc/chgres_cube.fd/input_data.F90 (code 1)
GeorgeGayno-NOAA commented 4 years ago

Dusan, thanks for catching this. The 'error_handler' routine could be better written. It could be placed in a module. And the return code could be an optional argument.

DusanJovic-NOAA commented 4 years ago

Is there an easy way of fixing this in the public release branch?

GeorgeGayno-NOAA commented 4 years ago

Is there an easy way of fixing this in the public release branch?

Pass in a non-zero return code as the second argument.

GeorgeGayno-NOAA commented 4 years ago

Dusan, what debug flags did you use?

DusanJovic-NOAA commented 4 years ago

See here:

Intel:

https://github.com/aerorahul/UFS_UTILS/blob/214204797a5e6c16c32dfb696c330a3a88af3c6c/sorc/chgres_cube.fd/CMakeLists.txt#L17

and GNU:

https://github.com/aerorahul/UFS_UTILS/blob/214204797a5e6c16c32dfb696c330a3a88af3c6c/sorc/chgres_cube.fd/CMakeLists.txt#L23

GeorgeGayno-NOAA commented 4 years ago

Will add this to 'develop' under this #33.

GeorgeGayno-NOAA commented 4 years ago

This fix was merged to 'develop' at 5b422ce.