Skip to content

Commit

Permalink
Initializing tracers to fix the FP issue for some tracers in debug mo… (
Browse files Browse the repository at this point in the history
NOAA-EMC#147)

* Initializing tracers to fix the FP issue for some tracers in debug mode triggered in remap_scalar

* remove duplicate code and fix lstatus on all grids depending on gfs_data and gfs_data.tile1

Co-authored-by: Joseph Mouallen <[email protected]>
  • Loading branch information
2 people authored and laurenchilutti committed Oct 6, 2021
1 parent f3197e7 commit c19cfd8
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions model/fv_regional_bc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -6758,21 +6758,17 @@ subroutine get_data_source(data_source_fv3gfs,regional)
! Use the fms call here so we can actually get the return code value.
! The term 'source' is specified by 'chgres_cube'
!
lstatus=.false.
allocate(pes(mpp_npes()))
call mpp_get_current_pelist(pes)
if (regional) then
if (open_file(Gfs_data , 'INPUT/gfs_data.nc', "read", pelist=pes)) then
lstatus = global_att_exists(Gfs_data, "source")
if(lstatus) call get_global_attribute(Gfs_data, "source", source)
call close_file(Gfs_data)
endif
else
if (open_file(Gfs_data , 'INPUT/gfs_data.tile1.nc', "read", pelist=pes)) then

if (open_file(Gfs_data , 'INPUT/gfs_data.nc', "read", pelist=pes) .or. &
open_file(Gfs_data , 'INPUT/gfs_data.tile1.nc', "read", pelist=pes)) then
lstatus = global_att_exists(Gfs_data, "source")
if(lstatus) call get_global_attribute(Gfs_data, "source", source)
call close_file(Gfs_data)
endif
endif

deallocate(pes)
if (.not. lstatus) then
if (mpp_pe() == 0) write(0,*) 'INPUT source not found ',lstatus,' set source=No Source Attribute'
Expand Down

0 comments on commit c19cfd8

Please sign in to comment.