Ignore:
Timestamp:
Nov 30, 2022, 6:23:36 PM (2 years 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/phylmd/phyetat0_mod.F90

    r4358 r4359  
    714714!-----------------------------------------------------------------------------
    715715  INTEGER :: nsrf, i
    716   CHARACTER(LEN=maxlen), ALLOCATABLE :: nam(:)
    717   CHARACTER(LEN=maxlen) :: tname, des
     716  CHARACTER(LEN=maxlen) :: nam(SIZE(name)), tname, des
    718717  IF(SIZE(field,3)>99) CALL abort_physic("phyetat0", "Too much sub-cells", 1)
    719718  DO nsrf = 1, SIZE(field,3)
    720     nam = [(TRIM(name(i))//TRIM(int2str(nsrf,2)), i=1, SIZE(name))]
     719    DO i = 1, SIZE(name); nam(i) = TRIM(name(i))//TRIM(int2str(nsrf,2)); END DO
    721720    des = TRIM(descr)//" srf:"//int2str(nsrf,2)
    722721    lFound = phyetat0_get21(field(:,:,nsrf), nam, TRIM(des), default, tname)
Note: See TracChangeset for help on using the changeset viewer.