Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allocation and initialization of fld_info array #587

Open
DusanJovic-NOAA opened this issue Oct 28, 2022 · 2 comments
Open

Allocation and initialization of fld_info array #587

DusanJovic-NOAA opened this issue Oct 28, 2022 · 2 comments
Labels

Comments

@DusanJovic-NOAA
Copy link
Contributor

Array fld_info is allocated to have the size of NRECOUT+100 elements, here:

allocate(fld_info(NRECOUT+100))

but only first nrecout elements are initialized.

      allocate(fld_info(NRECOUT+100))
      do i=1,nrecout
        fld_info(i)%ifld     = 0
        fld_info(i)%lvl      = 0
        fld_info(i)%lvl1     = 0
        fld_info(i)%lvl2     = 0
        fld_info(i)%ntrange  = 0
        fld_info(i)%tinvstat = 0
      enddo

Why are this 100 extra elements needed? If they are needed, then the loop that initializes fld_info must be extended to nrecout+100.

@WenMeng-NOAA
Copy link
Collaborator

@HuiyaChuang-NOAA Do you have any background information for the this inurement?

@HuiyaChuang-NOAA
Copy link
Collaborator

@HuiyaChuang-NOAA Do you have any background information for the this inurement?

This section was written by Lin Gan. I assumed he did that to avoid array out of bound?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants