Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion physics/GWD/cires_ugwp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ subroutine cires_ugwp_init (me, master, nlunit, input_nml_file, logunit, &
if (do_ugwp .or. cdmbgwd(3) > 0.0) then
call cires_ugwpv0_mod_init (me, master, nlunit, input_nml_file, logunit, &
fn_nml2, lonr, latr, levs, ak, bk, con_p0, dtp, &
cdmbgwd(1:2), cgwf, pa_rf_in, tau_rf_in)
cdmbgwd(1:2), cgwf, pa_rf_in, tau_rf_in, &
errmsg, errflg)
if (errflg/=0) return
else
write(errmsg,'(*(a))') "Logic error: cires_ugwp_init called but do_ugwp is false and cdmbgwd(3) <= 0"
errflg = 1
Expand Down
18 changes: 14 additions & 4 deletions physics/GWD/cires_ugwp_module.F90
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ module cires_ugwpv0_module
!>This subroutine initializes CIRES UGWP
subroutine cires_ugwpv0_mod_init (me, master, nlunit, input_nml_file, logunit, &
fn_nml, lonr, latr, levs, ak, bk, pref, dtp, cdmvgwd, cgwf, &
pa_rf_in, tau_rf_in)
pa_rf_in, tau_rf_in, errmsg, errflg)

use ugwpv0_oro_init, only : init_oro_gws_v0
use ugwpv0_wmsdis_init, only : initsolv_wmsdis_v0, ilaunch
Expand All @@ -129,7 +129,11 @@ subroutine cires_ugwpv0_mod_init (me, master, nlunit, input_nml_file, logunit, &
real, intent (in) :: cdmvgwd(2), cgwf(2) ! "scaling" controls for "old" GFS-GW schemes
real, intent (in) :: pa_rf_in, tau_rf_in

character(len=*), intent(inout) :: errmsg
integer, intent(inout) :: errflg

integer :: ios
character(len=256) :: msg
logical :: exists
real :: dxsg
integer :: k
Expand All @@ -142,10 +146,16 @@ subroutine cires_ugwpv0_mod_init (me, master, nlunit, input_nml_file, logunit, &
inquire (file =trim (fn_nml) , exist = exists)

if (.not. exists) then
if (me == master) &
write (6, *) 'separate ugwp :: namelist file: ', trim (fn_nml), ' does not exist'
write(errmsg,*) 'separate ugwp :: namelist file: ', trim (fn_nml), ' does not exist'
errflg = 1
return
else
open (unit = nlunit, file = trim(fn_nml), action = 'read', status = 'old', iostat = ios)
open (unit = nlunit, file = trim(fn_nml), action = 'read', status = 'old', iostat = ios, iomsg = msg)
if (ios /= 0) then
write(errmsg,*) 'ERROR: cannot open namelist file ', trim(fn_nml), ' iostat=', ios, ' msg="' // trim(msg) // '"'
errflg = 1
return
endif
endif
rewind (nlunit)
read (nlunit, nml = cires_ugwp_nml)
Expand Down
4 changes: 3 additions & 1 deletion physics/GWD/unified_ugwp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ subroutine unified_ugwp_init (me, master, nlunit, input_nml_file, logunit, &
if (cdmbgwd(3) > 0.0) then
call cires_ugwpv0_mod_init(me, master, nlunit, input_nml_file, logunit, &
fn_nml2, lonr, latr, levs, ak, bk, con_p0, dtp, &
cdmbgwd(1:2), cgwf, pa_rf_in, tau_rf_in)
cdmbgwd(1:2), cgwf, pa_rf_in, tau_rf_in, &
errmsg, errflg)
if (errflg/=0) return
else
write(errmsg,'(*(a))') "Logic error: cires_ugwp_mod_init called but &
&do_ugwp_v0 or do_ugwp_v0_nst_only is true and cdmbgwd(3) <= 0"
Expand Down
6 changes: 6 additions & 0 deletions physics/SFC_Models/Land/Noahmp/lnd_iau_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ subroutine land_iau_mod_set_control(Land_IAU_Control,fn_nml,input_nml_file, me,
write(iosstr, '(I0)') ios
errmsg = 'lnd_iau_mod_set_control: I/O error code '//trim(iosstr)//' at land_iau namelist read'
errflg = 1
#ifndef INTERNAL_FILE_NML
close(nlunit)
#endif
return
end if

Expand All @@ -179,6 +182,9 @@ subroutine land_iau_mod_set_control(Land_IAU_Control,fn_nml,input_nml_file, me,
WRITE(6, * ) 'lnd_iau_mod_set_control: Warning! EoF ('//trim(iosstr)//') while reading land_iau namelist,' &
// ' likely because land_iau_nml was not found in input.nml. It will be set to default.'
endif
#ifndef INTERNAL_FILE_NML
close(nlunit)
#endif
endif

if (me == mpi_root) then
Expand Down