# Declare variables anywhere

**URL:** <https://fortran-lang.discourse.group/t/declare-variables-anywhere/2179>\
**Category:** Help\
**Created:** [October 28, 2021, 4:34am UTC](https://fortran-lang.discourse.group/t/declare-variables-anywhere/2179 "2021-10-28T04:34:38Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![zoziha](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/zoziha/32/582_2.png) [@zoziha](https://fortran-lang.discourse.group/u/zoziha)\
**Post date:** [October 28, 2021, 8:02am UTC](https://fortran-lang.discourse.group/t/declare-variables-anywhere/2179/5 "2021-10-28T08:02:25Z")

</div>

I like to declare variables anywhere, and I don’t like to replace this function with `block`. Now many other programming languages support this paradigm, and some skilled fortranners don’t like surprises, I don’t think it’s necessary to be so rigid.

> [@\`block\` syntax and my confusion](https://fortran-lang.discourse.group/t/block-syntax-and-my-confusion/1121):
>
> In the Fortran2008 standard, the block grammar is introduced, which allows a special block to be constructed locally. What is the meaning of its existence? ```fortran label: blcok type :: variable command end block label ``` In some Fortran codes with poor experience, subroutines with more business may need to set many variables in the Fortran subroutines. This will cause “variable disasters”, difficult to read. And it may appear that the location where the variable is declared is far…

---

_[View the full topic](https://fortran-lang.discourse.group/t/declare-variables-anywhere/2179)._
