Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Fixes needed for flang #3176

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

- Fixed issue of some Baselibs builds appearing to support zstandard. This is not possible due to Baselibs building HDF5 and netCDF as static libraries
- Update to support llvm-flang

### Removed

Expand Down
7 changes: 4 additions & 3 deletions generic/AbstractComponent.F90
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module mapl_AbstractComponent
use pFlogger, only: t_Logger => Logger
implicit none
private

Expand Down Expand Up @@ -96,7 +97,7 @@ subroutine i_RunChild(this, name, clock, phase, unusable, rc)
end subroutine i_RunChild

subroutine i_SetLogger(this, logger)
use pfl_logger, only: t_Logger => Logger
import t_Logger
import AbstractComponent
implicit none
class(AbstractComponent), intent(inout) :: this
Expand All @@ -105,13 +106,13 @@ subroutine i_SetLogger(this, logger)
end subroutine i_SetLogger

function i_GetLogger(this) result(logger)
use pfl_logger, only: t_Logger => Logger
import t_Logger
import AbstractComponent
implicit none
class(t_Logger), pointer :: logger
class(AbstractComponent), intent(in) :: this
end function i_GetLogger

end interface

end module mapl_AbstractComponent
4 changes: 3 additions & 1 deletion generic/MAPL_Generic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -9805,8 +9805,10 @@ subroutine READIT(WHICH)
if (io_rank == 0) then
print *,'Using parallel IO for reading file: ',trim(DATAFILE)

#ifdef __NAG_COMPILER_RELEASE
#if defined( __NAG_COMPILER_RELEASE)
_FAIL('NAG does not provide ftell. Convert to stream I/O')
#elif defined(__flang__)
_FAIL('flang does not provide ftell. Convert to stream I/O')
#else
offset = _FTELL(UNIT)+4
#endif
Expand Down
1 change: 0 additions & 1 deletion gridcomps/History/Sampler/MAPL_EpochSwathMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ module MAPL_EpochSwathMod
use MAPL_TimeDataMod
use MAPL_VerticalDataMod
use MAPL_Constants
use pFIO
use MAPL_GriddedIOItemVectorMod
use MAPL_GriddedIOItemMod
use MAPL_ExceptionHandling
Expand Down
6 changes: 5 additions & 1 deletion include/unused_dummy.H
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@
#ifdef _UNUSED_DUMMY
# undef _UNUSED_DUMMY
#endif
#define _UNUSED_DUMMY(x) if (.false.) then; associate (q____ => x); end associate; endif
#if defined(__flang__)
# define _UNUSED_DUMMY(x) if (.false.) then; print*, shape(x); endif
#else
# define _UNUSED_DUMMY(x) if (.false.) then; associate (q____ => x); end associate; endif
#endif
9 changes: 9 additions & 0 deletions pfio/AbstractServer.F90
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,10 @@ subroutine set_status(this,status)

!$omp critical (counter_status)
this%status = status
! llvm-flang has an issue with omp flush of complex data structures
#if !defined(__flang__)
!$omp flush (this)
#endif
!$omp end critical (counter_status)
end subroutine set_status

Expand All @@ -217,7 +220,10 @@ subroutine update_status(this, rc)
!$omp critical (counter_status)
this%status = this%status -1
status = this%status
! llvm-flang has an issue with omp flush of complex data structures
#if !defined(__flang__)
!$omp flush (this)
#endif
!$omp end critical (counter_status)
if (status /= 0) then
_RETURN(_SUCCESS)
Expand Down Expand Up @@ -290,7 +296,10 @@ subroutine set_AllBacklogIsEmpty(this,status)

!$omp critical (backlog_status)
this%all_backlog_is_empty = status
! llvm-flang has an issue with omp flush of complex data structures
#if !defined(__flang__)
!$omp flush (this)
#endif
!$omp end critical (backlog_status)
end subroutine set_AllBacklogIsEmpty

Expand Down