Allocatable character variables in Fortran

前端 未结 2 1334
一生所求
一生所求 2021-01-11 15:33

My code (stripped down to what I think is relevant for this question) is

PROGRAM test

IMPLICIT NONE

CHARACTER(len=37) input
CHARACTER(len=:), allocatable :         


        
2条回答
  •  甜味超标
    2021-01-11 16:29

    With Absoft Fortran, this compiles (haven't run with it yet):

    character,dimension(:),allocatable::Line_for_IO !Metcalf,Reid,Cohen p. 107, w/mods
    if(allocated(Line_for_IO)) deallocate(Line_for_IO)
    allocate(Line_for_IO(7*n+40))
    

提交回复
热议问题