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
#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
JosephMouallem and Joseph Mouallen authored Oct 6, 2021
1 parent 43e215b commit 6ce60a0
Show file tree
Hide file tree
Showing 2 changed files with 6 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 @@ -6748,21 +6748,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
1 change: 1 addition & 0 deletions tools/external_ic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -938,6 +938,7 @@ subroutine read_gfs_ic()

! prognostic tracers
do nt = 1, ntracers
q(:,:,:,nt) = -999.99
call get_tracer_names(MODEL_ATMOS, nt, tracer_name)
call register_restart_field(GFS_restart, trim(tracer_name), q(:,:,:,nt), dim_names_3d3, is_optional=.true.)
enddo
Expand Down

0 comments on commit 6ce60a0

Please sign in to comment.