Ignore:
Timestamp:
Nov 30, 2022, 6:23:36 PM (22 months ago)
Author:
dcugnet
Message:

Fix for a gfortran specific byg. In the following expression:

nam = [(TRIM(name(i))TRIM(int2str(nsrf,2)), i=1, SIZE(name))]

where nam(:) is an ALLOCATABLE string, the gfortran compiled executable crashes, but should not:

"Fortran runtime error: Index '0' of dimension 1 of array 'name' below lower bound of 1"

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/trunk/libf/phylmdiso/phyetat0_mod.F90

    r4358 r4359  
    766766!-----------------------------------------------------------------------------
    767767  INTEGER :: nsrf, i
    768   CHARACTER(LEN=maxlen), ALLOCATABLE :: nam(:)
    769   CHARACTER(LEN=maxlen) :: tname, des
     768  CHARACTER(LEN=maxlen) :: nam(SIZE(name)), tname, des
    770769  IF(SIZE(field,3)>99) CALL abort_physic("phyetat0", "Too much sub-cells", 1)
    771770  DO nsrf = 1, SIZE(field,3)
    772     nam = [(TRIM(name(i))//TRIM(int2str(nsrf,2)), i=1, SIZE(name))]
     771    DO i = 1, SIZE(name); nam(i) = TRIM(name(i))//TRIM(int2str(nsrf,2)); END DO
    773772    des = TRIM(descr)//" srf:"//int2str(nsrf,2)
    774773    lFound = phyetat0_get21(field(:,:,nsrf), nam, TRIM(des), default, tname)
Note: See TracChangeset for help on using the changeset viewer.