Changeset 5353 for LMDZ6/trunk/libf/misc


Ignore:
Timestamp:
Nov 29, 2024, 3:15:38 PM (13 days ago)
Author:
yann meurdesoif
Message:

Nvidia compiler has some difficulties to compile correctly some complex array constructor.
This commit decompose it the several phases in order to achieve the compilation.
Please Lionel and David, have a look to this in order to validate.
Probably, in future, when compiler heuristic will be improved, this commit can be reversed.
YM

Location:
LMDZ6/trunk/libf/misc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/trunk/libf/misc/readTracFiles_mod.f90

    r5190 r5353  
    990990  CHARACTER(LEN=maxlen), ALLOCATABLE :: n0(:)
    991991  CHARACTER(LEN=maxlen) :: nm
     992  CHARACTER(LEN=maxlen) :: tmp2(nq)
     993
    992994  lerr = .FALSE.
    993995  IF(nam(1) == 'iq') THEN
    994     tmp = int2str([(iq, iq=1, nq)])
     996    tmp2 = int2str([(iq, iq=1, nq)])
     997    tmp = tmp2
    995998  ELSE
    996999    lerr = getKey(nam, tmp, dBase(idb)%trac(:)%keys, lDisp=lMandatory)
  • LMDZ6/trunk/libf/misc/strings_mod.f90

    r5268 r5353  
    813813  tmp = horzcat_s00(s0(nc), s1, s2, s3, s4, s5, s6, s7, s8, s9)
    814814  IF(nc == 1) out = tmp
    815   IF(nc /= 1) out = [s0(1:nc-1), tmp]
     815  IF(nc /= 1) THEN
     816!ym fix for nvidia compiler
     817!ym out = [s0(1:nc-1), tmp]
     818    out = s0(1:nc-1)
     819    out = [out , tmp]
     820  ENDIF
    816821END FUNCTION horzcat_s10
    817822!==============================================================================================================================
     
    845850  CHARACTER(LEN=*),           INTENT(IN) :: s0(:,:), s1(:)
    846851  CHARACTER(LEN=*), OPTIONAL, INTENT(IN) :: s2(:), s3(:), s4(:), s5(:), s6(:), s7(:), s8(:), s9(:)
    847   CHARACTER(LEN=maxlen), ALLOCATABLE :: out(:,:), tmp(:,:)
     852  CHARACTER(LEN=maxlen), ALLOCATABLE :: out(:,:), tmp(:,:), pk(:)
    848853  INTEGER :: nc
    849854  nc  = SIZE(s0, 2)
    850855  tmp = horzcat_s11(s0(:,nc), s1, s2, s3, s4, s5, s6, s7, s8, s9)
    851856  IF(nc == 1) out = tmp
    852   IF(nc /= 1) out = RESHAPE([PACK(s0(:,1:nc-1), .TRUE.), PACK(tmp, .TRUE.)], SHAPE=[SIZE(s0, 1), nc + SIZE(tmp, 2)-1])
     857!ym fix for nvidia compiler
     858!ym  IF(nc /= 1) out = RESHAPE([PACK(s0(:,1:nc-1), .TRUE.), PACK(tmp, .TRUE.)], SHAPE=[SIZE(s0, 1), nc + SIZE(tmp, 2)-1])
     859  IF(nc /= 1) THEN
     860    pk = PACK(s0(:,1:nc-1), .TRUE.)
     861    pk = [ pk, PACK(tmp, .TRUE.)]
     862    out = RESHAPE(pk, SHAPE=[SIZE(s0, 1), nc + SIZE(tmp, 2)-1])
     863  ENDIF
    853864END FUNCTION horzcat_s21
    854865!==============================================================================================================================
Note: See TracChangeset for help on using the changeset viewer.