Skip to content

Commit

Permalink
Use mpp_error instead of write statements in model/fv_regional_bc.F90
Browse files Browse the repository at this point in the history
  • Loading branch information
DusanJovic-NOAA committed Feb 11, 2022
1 parent 7ec6a47 commit 9d1fabc
Showing 1 changed file with 8 additions and 25 deletions.
33 changes: 8 additions & 25 deletions model/fv_regional_bc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -383,18 +383,12 @@ subroutine setup_regional_BC(Atm &
file_name='INPUT/gfs_bndy.tile7.'//int_to_char//'_gsi.nc' !<-- The DA-updated BC file.
endif
!
if (is_master()) then
write(*,20011)trim(file_name)
20011 format(' regional_bc_data file_name=',a)
endif
!-----------------------------------------------------------------------
!*** Open the regional BC file.
!-----------------------------------------------------------------------
!
call check(nf90_open(file_name,nf90_nowrite,ncid)) !<-- Open the BC file; get the file ID.
if (is_master()) then
write(*,*)' opened BC file ',trim(file_name)
endif
call mpp_error(NOTE, 'Opened BC file: '//trim(file_name))
!
!-----------------------------------------------------------------------
!*** Check if the desired number of blending rows are present in
Expand Down Expand Up @@ -1075,7 +1069,7 @@ subroutine read_regional_lon_lat
!
call check(nf90_open(filename,nf90_nowrite,ncid_grid)) !<-- Open the grid data netcdf file; get the file ID.
!
call mpp_error(NOTE,' opened grid file '//trim(filename))
call mpp_error(NOTE, 'Opened grid file: '//trim(filename))
!
!-----------------------------------------------------------------------
!*** The longitude and latitude are on the super grid. We need only
Expand Down Expand Up @@ -1170,12 +1164,9 @@ subroutine read_regional_filtered_topo
!
filename='INPUT/'//trim(oro_data)

if (is_master()) then
write(*,23421)trim(filename)
23421 format(' topo filename=',a)
endif
!
call check(nf90_open(filename,nf90_nowrite,ncid_oro)) !<-- Open the netcdf file; get the file ID.
call mpp_error(NOTE, 'Opened topo file: '//trim(filename))
!
!-----------------------------------------------------------------------
!*** Read in the data including the extra outer row.
Expand Down Expand Up @@ -1661,19 +1652,13 @@ subroutine regional_bc_data(Atm,bc_hour &
file_name='INPUT/gfs_bndy.tile7.'//int_to_char//'_gsi.nc' !<-- The DA-updated BC file.
endif
!
if (is_master()) then
write(*,22211)trim(file_name)
22211 format(' regional_bc_data file_name=',a)
endif
!-----------------------------------------------------------------------
!*** Open the regional BC file.
!*** Find the # of layers (klev_in) in the BC input.
!-----------------------------------------------------------------------
!
call check(nf90_open(file_name,nf90_nowrite,ncid)) !<-- Open the BC file; get the file ID.
if (is_master()) then
write(*,*)' opened BC file ',trim(file_name)
endif
call mpp_error(NOTE, 'Opened BC file: '//trim(file_name))
!
call check(nf90_inq_dimid(ncid,'lev',dimid)) !<-- Get the vertical dimension's NetCDF ID.
call check(nf90_inquire_dimension(ncid,dimid,len=klev_in)) !<-- Get the vertical dimension's value (klev_in).
Expand Down Expand Up @@ -3305,7 +3290,9 @@ subroutine read_regional_bc_file(is_input,ie_input &
call check(status)
endif
if (status /= nf90_noerr) then
if (east_bc.and.is_master()) write(*,*)' WARNING: Tracer ',trim(var_name),' not in input file'
if (east_bc) then
call mpp_error(NOTE, 'Tracer '//trim(var_name)//' not in input file')
endif
array_4d(:,:,:,tlev)=0. !<-- Tracer not in input so set to zero in boundary.
!
blend_this_tracer(tlev)=.false. !<-- Tracer not in input so do not apply blending.
Expand Down Expand Up @@ -3877,7 +3864,6 @@ subroutine remap_scalar_nggps_regional_bc(Atm &
enddo
! call pmaxmn('PS_diff (mb)', wk, is, ie, js, je, 1, 0.01, Atm%gridstruct%area_64, Atm%domain)
deallocate (pe0,qn1,dp2,pe1,qp)
if (is_master()) write(*,*) 'done remap_scalar_nggps_regional_bc'
!---------------------------------------------------------------------

end subroutine remap_scalar_nggps_regional_bc
Expand Down Expand Up @@ -3997,8 +3983,6 @@ subroutine remap_dwinds_regional_bc(Atm &
deallocate(qn1_d)
deallocate(qn1_c)

if (is_master()) write(*,*) 'done remap_dwinds'

end subroutine remap_dwinds_regional_bc

!---------------------------------------------------------------------
Expand Down Expand Up @@ -6764,7 +6748,7 @@ subroutine get_data_source(data_source_fv3gfs,regional)
if (mpp_pe() == 0) write(0,*) 'INPUT source not found ',lstatus,' set source=No Source Attribute'
source='No Source Attribute'
endif
if (mpp_pe()==0) write(*,*) 'INPUT gfs_data source string=',source
call mpp_error(NOTE, 'INPUT gfs_data source string: '//trim(source))

! Logical flag for fv3gfs nemsio/netcdf/grib2 --------
if ( trim(source)=='FV3GFS GAUSSIAN NEMSIO FILE' .or. &
Expand All @@ -6774,7 +6758,6 @@ subroutine get_data_source(data_source_fv3gfs,regional)
else
data_source_fv3gfs = .FALSE.
endif
if (mpp_pe()==0) write(*,*) 'data_source_fv3gfs=',data_source_fv3gfs

end subroutine get_data_source

Expand Down

0 comments on commit 9d1fabc

Please sign in to comment.