# Maximum number of continuation line \`&\`

**URL:** https://fortran-lang.discourse.group/t/maximum-number-of-continuation-line/10498
**Category:** Help
**Created:** [November 17, 2025, 8:53am UTC](https://fortran-lang.discourse.group/t/maximum-number-of-continuation-line/10498 "2025-11-17T08:53:30Z")
**Posts on this page:** 1
**Showing post:** 7

<div class="post-metadata">

### Author: ![FortranFan](https://avatars.discourse-cdn.com/v4/letter/f/96bed5/32.png) [@FortranFan](https://fortran-lang.discourse.group/u/FortranFan)
#### Post date: [November 17, 2025, 11:07pm UTC](https://fortran-lang.discourse.group/t/maximum-number-of-continuation-line/10498/7 "2025-11-17T23:07:16Z")

</div>

> [@davidpfister](#):
>
> Knowing this limit, is there a better way to create that database at compile time?

@davidpfister ,

I am dabbling with Fortran after a long, long time, actually I was pointed to your thread by a colleague at work who has to support one of a few remaining codebases in Fortran and who too was looking into compile-time computations and who reached out to me after noticing some old posts of mine (e.g., **[this](https://fortran-lang.discourse.group/t/thread-safe-initialization-of-shared-module-data-openmp/485/4)**). This colleague is adding some capabilities to the Fortran codebase in order to help it get consumed in cloud service requests, meaning concurrent execution.

Here’s the code example I suggested to this colleague who requested I also post here: the gist is a) use “named constant” facilities in Fortran as much as possible for “compile-time” data / database, etc. and b) avoid `DATA` statements, if possible, for you will find it’s not strictly compile-time computation and you are in effect applying the “static” (implied `SAVE` in Fortran parlance) attribute to the object that can prove pernicious in concurrent / parallel computing.

```Fortran
module kinds_m
   use ieee_arithmetic, only : ieee_selected_real_kind
   integer, parameter :: sp = ieee_selected_real_kind( p=6 )
   integer, parameter :: rp = sp
end module
 
module item_m
   use kinds_m, only : rp
   integer, parameter :: LENNAME = 8
   type :: item_t
      character(len=LENNAME) :: item_name
      real(kind=rp) :: val = 0.0_rp
   end type 
end module

program p

   use kinds_m, only : rp
   use item_m, only : item_t

   ! Compile time "database"
   integer, parameter :: n = 10000
   type(item_t), parameter :: db(*) = &
      [( item_t( item_name="item1", val=real(i, kind=rp)), integer :: i = 1, n )]

   print *, "item ", "1", ": ", db(1)
   print *, "item ", "2", ": ", db(2)
   print *, ".. "
   print *, "item ", n, ": ", db(n)

end program 

```

You can execute this with a modern Fortran compiler of your choice to get response as follows:

```auto
C:\Temp>ifx /free /standard-semantics p.f
Intel(R) Fortran Compiler for applications running on Intel(R) 64, Version 2023.0.0 Build 20221201
Copyright (C) 1985-2022 Intel Corporation. All rights reserved.

Microsoft (R) Incremental Linker Version 14.36.32548.0
Copyright (C) Microsoft Corporation. All rights reserved.

-out:p.exe
-subsystem:console
p.obj

C:\Temp>p.exe
 item 1: item1 1.000000
 item 2: item1 2.000000
 ..
 item 10000 : item1 10000.00

C:\Temp>

```

[Add CONSTEXPR procedures in Fortran · Issue #214 · j3-fortran/fortran\_proposals](https://github.com/j3-fortran/fortran_proposals/issues/214)  
Perhaps you will review this [**suggestion**](https://github.com/j3-fortran/fortran_proposals/issues/214) of mine to Fortran language workers re: `CONSTEXPR` attribute on suitable functions in Fortran but it is languishing. Such a facility may help you - some 40 to 50 years from now - with better setting up of “compile-time” database viz. not having to name each item as `item1` 😜 (.. item(‘item1’, 1.0\_rp), .. item(‘item1’, 2.0\_rp))

---

_[View the full topic](https://fortran-lang.discourse.group/t/maximum-number-of-continuation-line/10498)._
