Skip to content

Make count 4 in ESMF_VMBroadcast(vm, bcasttmp, 4, main_task, rc=rc) - #452

Merged
billsacks merged 5 commits into
ESCOMP:mainfrom
NickSzapiro-NOAA:fix_bcasttmp
Oct 8, 2026
Merged

billsacks merged 5 commits into
ESCOMP:mainfrom
NickSzapiro-NOAA:fix_bcasttmp

Conversation

@NickSzapiro-NOAA

Copy link
Copy Markdown
Contributor

Description of changes

Data components repeat code to read namelist and distribute like:

integer           :: bcasttmp(4)
...
if (mainproc) then
       nlfilename = "drof_in"//trim(inst_suffix)
       open (newunit=nu,file=trim(nlfilename),status="old",action="read")
       call shr_nl_find_group_name(nu, 'drof_nml', status=ierr)
       read (nu,nml=drof_nml,iostat=ierr)
       close(nu)
       
       bcasttmp = 0
       bcasttmp(1) = nx_global
       bcasttmp(2) = ny_global
       if (skip_restart_read) bcasttmp(3) = 1
       if (export_all) bcasttmp(4) = 1
end if
...
   call ESMF_VMBroadcast(vm, bcasttmp, 4, main_task, rc=rc)
    if (ChkErr(rc,__LINE__,u_FILE_u)) return

    nx_global = bcasttmp(1)
    ny_global = bcasttmp(2)
    skip_restart_read = (bcasttmp(3) == 1)
    export_all = (bcasttmp(4) == 1)

It is like this in EMC/CDEPS but not ESCOMP for a few datamodes. I'm not sure what happened.

Specific notes

Contributors other than yourself, if any:

CDEPS Issues Fixed (include github issue #): #451

Are there dependencies on other component PRs (if so list):

Are changes expected to change answers (bfb, different to roundoff, more substantial):

Any User Interface Changes (namelist or namelist defaults changes):

Testing performed (e.g. aux_cdeps, CESM prealpha, etc):

Hashes used for testing:

@billsacks billsacks left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this fix! It looks like export_all isn't used in CESM / NorESM, which I guess is why this hasn't caused problems, but I absolutely agree that this should be fixed.

Is it okay if I push two other similar changes to this branch (or you could do it yourself)?:

(1) In wav_comp_nuopc, the count in ESMF_VMBroadcast of bcasttmp should be 4, not 3 (similar to your other changes here).

(2) In glc_comp_nuopc, the count in ESMF_VMBroadcast of bcasttmp should be 2, not 3.

@NickSzapiro-NOAA

Copy link
Copy Markdown
Contributor Author

Thanks @billsacks . Sure, please feel free to push these changes

@billsacks

Copy link
Copy Markdown
Member

@NickSzapiro-NOAA - for some reason I'm not being allowed to push to your branch (usually I can push to branches of open PRs; I'm not sure what's going wrong this time). Rather than trying to figure it out, I have opened a PR into your branch - if you're happy, can you please accept it? Then I can merge this PR.

NickSzapiro-NOAA#19

@billsacks
billsacks merged commit 0c433c8 into ESCOMP:main Oct 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants