# Error: IF clause at (1) requires a scalar LOGICAL expression

**URL:** <https://fortran-lang.discourse.group/t/error-if-clause-at-1-requires-a-scalar-logical-expression/3537>\
**Category:** Help\
**Created:** [May 24, 2022, 12:38am UTC](https://fortran-lang.discourse.group/t/error-if-clause-at-1-requires-a-scalar-logical-expression/3537 "2022-05-24T00:38:09Z")\
**Posts on this page:** 1\
**Showing post:** 16

<div class="post-metadata">

**Author:** ![ivanpribec](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/ivanpribec/32/3290_2.png) [@ivanpribec](https://fortran-lang.discourse.group/u/ivanpribec)\
**Post date:** [May 25, 2022, 7:09pm UTC](https://fortran-lang.discourse.group/t/error-if-clause-at-1-requires-a-scalar-logical-expression/3537/16 "2022-05-25T19:09:01Z")

</div>

> [@giraffe](#):
>
> ` CHARACTER(*) :: CARD2(:)`

Have you changed this line during your refactoring? Is `CARD2` supposed to be an array of strings, or an array single characters?

A few answers in your other thread ([Error: Rank mismatch in argument 'std' at (1) (scalar and rank-1)](https://fortran-lang.discourse.group/t/error-rank-mismatch-in-argument-std-at-1-scalar-and-rank-1/3529)) have alluded to this, but without more information it’s difficult to know what you want to achieve, hence you continue wasting everyone’s time.

FWIW, if you just want to make a compilation error go away, do this

```fortran
       IF (CARD1(1:1).EQ.'K') THEN
         IF (ANY(CARD2(1:2).EQ.' '))THEN

```

It’s a minor change (five extra characters), and should make the program compile. Does it do what you want? Probably not…

---

_[View the full topic](https://fortran-lang.discourse.group/t/error-if-clause-at-1-requires-a-scalar-logical-expression/3537)._
