diff --git a/datm/atm_comp_nuopc.F90 b/datm/atm_comp_nuopc.F90 index cfd25a782..174b5fd47 100644 --- a/datm/atm_comp_nuopc.F90 +++ b/datm/atm_comp_nuopc.F90 @@ -27,9 +27,8 @@ module cdeps_datm_comp use NUOPC_Model , only : NUOPC_ModelGet, setVM use shr_kind_mod , only : r8=>shr_kind_r8, i8=>shr_kind_i8, cl=>shr_kind_cl, cs=>shr_kind_cs use shr_const_mod , only : shr_const_cday - use shr_sys_mod , only : shr_sys_abort use shr_cal_mod , only : shr_cal_ymd2date - use shr_log_mod , only : shr_log_setLogUnit + use shr_log_mod , only : shr_log_setLogUnit, shr_log_error use dshr_methods_mod , only : dshr_state_diagnose, chkerr, memcheck use dshr_strdata_mod , only : shr_strdata_type, shr_strdata_init_from_config, shr_strdata_advance use dshr_strdata_mod , only : shr_strdata_get_stream_pointer, shr_strdata_setOrbs @@ -267,14 +266,16 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) open (newunit=nu,file=trim(nlfilename),status="old",action="read") call shr_nl_find_group_name(nu, 'datm_nml', status=ierr) if (ierr > 0) then - write(logunit,*) 'ERROR: reading input namelist, '//trim(nlfilename)//' iostat=',ierr - call shr_sys_abort(subName//': namelist read error '//trim(nlfilename)) + rc = ierr + call shr_log_error(subName//': namelist read error '//trim(nlfilename), rc=rc) + return end if read (nu,nml=datm_nml,iostat=ierr) close(nu) if (ierr > 0) then - write(logunit,*) 'ERROR: reading input namelist, '//trim(nlfilename)//' iostat=',ierr - call shr_sys_abort(subName//': namelist read error '//trim(nlfilename)) + rc = ierr + call shr_log_error(subName//': namelist read error '//trim(nlfilename), rc=rc) + return end if bcasttmp = 0 bcasttmp(1) = nx_global @@ -327,7 +328,8 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) else if (nextsw_cday_calc == 'cam6') then nextsw_cday_calc_cam7 = .false. else - call shr_sys_abort(' ERROR illegal datm nextsw_cday_calc = '//trim(nextsw_cday_calc)) + call shr_log_error(' ERROR illegal datm nextsw_cday_calc = '//trim(nextsw_cday_calc), rc=rc) + return end if ! write namelist input to standard out @@ -364,7 +366,8 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) trim(datamode) == 'ERA5' .or. & trim(datamode) == 'SIMPLE') then else - call shr_sys_abort(' ERROR illegal datm datamode = '//trim(datamode)) + call shr_log_error(' ERROR illegal datm datamode = '//trim(datamode), rc=rc) + return endif ! Advertise datm fields @@ -495,7 +498,8 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) if (isPresent .and. isSet) then read (cvalue,*) flds_scalar_index_nextsw_cday else - call shr_sys_abort(subname//'Need to set attribute ScalarFieldIdxNextSwCday') + call shr_log_error(subname//'Need to set attribute ScalarFieldIdxNextSwCday', rc=rc) + return endif nextsw_cday = getNextRadCDay(dayofYear, current_tod, stepno, idt, iradsw) @@ -656,7 +660,8 @@ subroutine datm_comp_run(gcomp, importState, exportState, target_ymd, target_tod call dshr_restart_read(restfilm, rpfile, logunit, my_task, mpicom, sdat, rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return case default - call shr_sys_abort(subName//'datamode '//trim(datamode)//' not recognized') + call shr_log_error(subName//'datamode '//trim(datamode)//' not recognized', rc=rc) + return end select end if @@ -727,7 +732,8 @@ subroutine datm_comp_run(gcomp, importState, exportState, target_ymd, target_tod my_task, sdat, rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return case default - call shr_sys_abort(subName//'datamode '//trim(datamode)//' not recognized') + call shr_log_error(subName//'datamode '//trim(datamode)//' not recognized', rc=rc) + return end select end if @@ -830,7 +836,8 @@ subroutine datm_init_dfields(rc) case('cpl_scalars') continue case default - call shr_sys_abort(subName//'field '//trim(lfieldnames(n))//' not recognized') + call shr_log_error(subName//'field '//trim(lfieldnames(n))//' not recognized', rc=rc) + return end select end if end do diff --git a/datm/datm_datamode_cfsr_mod.F90 b/datm/datm_datamode_cfsr_mod.F90 index ec1ab7a89..9f704425a 100644 --- a/datm/datm_datamode_cfsr_mod.F90 +++ b/datm/datm_datamode_cfsr_mod.F90 @@ -3,7 +3,6 @@ module datm_datamode_cfsr_mod use ESMF , only : ESMF_State, ESMF_SUCCESS, ESMF_LogWrite, ESMF_LOGMSG_INFO use NUOPC , only : NUOPC_Advertise use shr_kind_mod , only : r8=>shr_kind_r8, i8=>shr_kind_i8, cl=>shr_kind_cl, cs=>shr_kind_cs - use shr_sys_mod , only : shr_sys_abort use shr_precip_mod , only : shr_precip_partition_rain_snow_ramp use shr_const_mod , only : shr_const_tkfrz, shr_const_rhofw, shr_const_rdair use dshr_methods_mod , only : dshr_state_getfldptr, chkerr diff --git a/datm/datm_datamode_clmncep_mod.F90 b/datm/datm_datamode_clmncep_mod.F90 index 78b3bf4db..ccd75f4e3 100644 --- a/datm/datm_datamode_clmncep_mod.F90 +++ b/datm/datm_datamode_clmncep_mod.F90 @@ -4,7 +4,7 @@ module datm_datamode_clmncep_mod use ESMF , only : ESMF_STATEITEM_NOTFOUND, ESMF_LOGMSG_INFO, ESMF_StateGet, operator(/=) use NUOPC , only : NUOPC_Advertise use shr_kind_mod , only : r8=>shr_kind_r8, i8=>shr_kind_i8, cl=>shr_kind_cl, cs=>shr_kind_cs - use shr_sys_mod , only : shr_sys_abort + use shr_log_mod , only : shr_log_error use shr_precip_mod , only : shr_precip_partition_rain_snow_ramp use shr_const_mod , only : shr_const_spval, shr_const_tkfrz, shr_const_pi use shr_const_mod , only : shr_const_pstd, shr_const_stebol, shr_const_rdair @@ -319,7 +319,8 @@ subroutine datm_datamode_clmncep_init_pointers(importState, exportState, sdat, r ! error check if (.not. associated(strm_wind) .or. .not. associated(strm_tbot)) then - call shr_sys_abort(trim(subname)//' ERROR: wind and tbot must be in streams for CLMNCEP') + call shr_log_error(trim(subname)//' ERROR: wind and tbot must be in streams for CLMNCEP', rc=rc) + return endif ! determine anidrmax (see below for use) @@ -380,7 +381,8 @@ subroutine datm_datamode_clmncep_advance(mainproc, logunit, mpicom, rc) tbotmax = rtmp(2) if (mainproc) write(logunit,*) trim(subname),' tbotmax = ',tbotmax if(tbotmax <= 0) then - call shr_sys_abort(subname//'ERROR: bad value in tbotmax') + call shr_log_error(subname//'ERROR: bad value in tbotmax', rc=rc) + return endif ! determine anidrmax (see below for use) @@ -456,7 +458,8 @@ subroutine datm_datamode_clmncep_advance(mainproc, logunit, mpicom, rc) qsat = (0.622_r8 * e)/(pbot - 0.378_r8 * e) Sa_shum(n) = qsat else - call shr_sys_abort(subname//'ERROR: cannot compute shum') + call shr_log_error(subname//'ERROR: cannot compute shum', rc=rc) + return endif !--- density --- vp = (Sa_shum(n)*pbot) / (0.622_r8 + 0.378_r8 * Sa_shum(n)) @@ -493,7 +496,8 @@ subroutine datm_datamode_clmncep_advance(mainproc, logunit, mpicom, rc) swvdf = strm_swdn(n) * 0.50_r8 Faxa_swvdf(n) = (1._r8 - ratio_rvrf)*swvdf else - call shr_sys_abort(subName//'ERROR: cannot compute short-wave down') + call shr_log_error(subName//'ERROR: cannot compute short-wave down', rc=rc) + return endif !--- swnet: a diagnostic quantity --- @@ -517,7 +521,8 @@ subroutine datm_datamode_clmncep_advance(mainproc, logunit, mpicom, rc) Faxa_rainc(n) = strm_precn(n)*0.1_r8 Faxa_rainl(n) = strm_precn(n)*0.9_r8 else - call shr_sys_abort(subName//'ERROR: cannot compute rain and snow') + call shr_log_error(subName//'ERROR: cannot compute rain and snow', rc=rc) + return endif !--- split precip between rain & snow --- diff --git a/datm/datm_datamode_core2_mod.F90 b/datm/datm_datamode_core2_mod.F90 index 8b041f084..b874dcf98 100644 --- a/datm/datm_datamode_core2_mod.F90 +++ b/datm/datm_datamode_core2_mod.F90 @@ -17,7 +17,7 @@ module datm_datamode_core2_mod use pio , only : pio_closefile use NUOPC , only : NUOPC_Advertise use shr_kind_mod , only : r8=>shr_kind_r8, i8=>shr_kind_i8, cl=>shr_kind_cl, cs=>shr_kind_cs - use shr_sys_mod , only : shr_sys_abort + use shr_log_mod , only : shr_log_error use shr_cal_mod , only : shr_cal_date2julian use shr_const_mod , only : shr_const_tkfrz, shr_const_pi use dshr_strdata_mod , only : shr_strdata_get_stream_pointer, shr_strdata_type @@ -262,12 +262,14 @@ subroutine datm_datamode_core2_init_pointers(exportState, sdat, datamode, factor end if if (.not. associated(strm_prec) .or. .not. associated(strm_swdn)) then - call shr_sys_abort(trim(subname)//'ERROR: prec and swdn must be in streams for CORE2') + call shr_log_error(trim(subname)//'ERROR: prec and swdn must be in streams for CORE2', rc=rc) + return endif if (trim(datamode) == 'CORE2_IAF' ) then if (.not. associated(strm_tarcf)) then - call shr_sys_abort(trim(subname)//'tarcf must be in an input stream for CORE2_IAF') + call shr_log_error(trim(subname)//'tarcf must be in an input stream for CORE2_IAF', rc=rc) + return endif endif diff --git a/datm/datm_datamode_cplhist_mod.F90 b/datm/datm_datamode_cplhist_mod.F90 index ca53ed78d..c73b51efc 100644 --- a/datm/datm_datamode_cplhist_mod.F90 +++ b/datm/datm_datamode_cplhist_mod.F90 @@ -4,7 +4,6 @@ module datm_datamode_cplhist_mod use ESMF , only : ESMF_StateItem_Flag use NUOPC , only : NUOPC_Advertise use shr_kind_mod , only : r8=>shr_kind_r8, i8=>shr_kind_i8, cl=>shr_kind_cl, cs=>shr_kind_cs - use shr_sys_mod , only : shr_sys_abort use dshr_methods_mod , only : dshr_state_getfldptr, chkerr use dshr_strdata_mod , only : shr_strdata_type, shr_strdata_get_stream_pointer use dshr_strdata_mod , only : shr_strdata_type diff --git a/datm/datm_datamode_era5_mod.F90 b/datm/datm_datamode_era5_mod.F90 index 187c3b5d7..dad08baf9 100644 --- a/datm/datm_datamode_era5_mod.F90 +++ b/datm/datm_datamode_era5_mod.F90 @@ -3,7 +3,6 @@ module datm_datamode_era5_mod use ESMF , only : ESMF_State, ESMF_SUCCESS, ESMF_LogWrite, ESMF_LOGMSG_INFO use NUOPC , only : NUOPC_Advertise use shr_kind_mod , only : r8=>shr_kind_r8, i8=>shr_kind_i8, cl=>shr_kind_cl, cs=>shr_kind_cs - use shr_sys_mod , only : shr_sys_abort use shr_precip_mod , only : shr_precip_partition_rain_snow_ramp use shr_const_mod , only : shr_const_tkfrz, shr_const_rhofw, shr_const_rdair use dshr_methods_mod , only : dshr_state_getfldptr, chkerr diff --git a/datm/datm_datamode_gefs_mod.F90 b/datm/datm_datamode_gefs_mod.F90 index fb7a0b4dc..80d5716d8 100644 --- a/datm/datm_datamode_gefs_mod.F90 +++ b/datm/datm_datamode_gefs_mod.F90 @@ -3,7 +3,6 @@ module datm_datamode_gefs_mod use ESMF , only : ESMF_State, ESMF_SUCCESS, ESMF_LogWrite, ESMF_LOGMSG_INFO use NUOPC , only : NUOPC_Advertise use shr_kind_mod , only : r8=>shr_kind_r8, i8=>shr_kind_i8, cl=>shr_kind_cl, cs=>shr_kind_cs - use shr_sys_mod , only : shr_sys_abort use shr_precip_mod , only : shr_precip_partition_rain_snow_ramp use shr_const_mod , only : shr_const_tkfrz, shr_const_rhofw, shr_const_rdair use dshr_methods_mod , only : dshr_state_getfldptr, chkerr diff --git a/datm/datm_datamode_jra_mod.F90 b/datm/datm_datamode_jra_mod.F90 index 2e0e5ee67..6563bc3d8 100644 --- a/datm/datm_datamode_jra_mod.F90 +++ b/datm/datm_datamode_jra_mod.F90 @@ -5,7 +5,7 @@ module datm_datamode_jra_mod use ESMF , only : ESMF_StateItem_Flag, ESMF_STATEITEM_NOTFOUND, operator(/=) use NUOPC , only : NUOPC_Advertise use shr_kind_mod , only : r8=>shr_kind_r8, i8=>shr_kind_i8, cl=>shr_kind_cl, cs=>shr_kind_cs - use shr_sys_mod , only : shr_sys_abort + use shr_log_mod , only : shr_log_error use shr_cal_mod , only : shr_cal_date2julian use shr_const_mod , only : shr_const_tkfrz, shr_const_pi, shr_const_rdair use dshr_strdata_mod , only : shr_strdata_get_stream_pointer, shr_strdata_type @@ -226,7 +226,7 @@ subroutine datm_datamode_jra_init_pointers(exportState, sdat, rc) ! erro check if (.not. associated(strm_prec) .or. .not. associated(strm_swdn)) then - call shr_sys_abort(trim(subname)//'ERROR: prec and swdn must be in streams for CORE_IAF_JRA') + call shr_log_error(trim(subname)//'ERROR: prec and swdn must be in streams for CORE_IAF_JRA', rc=rc) endif end subroutine datm_datamode_jra_init_pointers diff --git a/datm/datm_datamode_simple_mod.F90 b/datm/datm_datamode_simple_mod.F90 index 454bceeac..ddd9e5a1c 100644 --- a/datm/datm_datamode_simple_mod.F90 +++ b/datm/datm_datamode_simple_mod.F90 @@ -25,7 +25,8 @@ module datm_datamode_simple_mod use dshr_methods_mod , only : dshr_state_getfldptr, dshr_fldbun_getfldptr, dshr_fldbun_regrid, chkerr use dshr_strdata_mod , only : shr_strdata_type use dshr_fldlist_mod , only : fldlist_type, dshr_fldlist_add - + use shr_log_mod , only : shr_log_error + implicit none private ! except @@ -117,7 +118,9 @@ subroutine datm_datamode_simple_advertise(exportState, fldsexport, flds_scalar_n read (nu,nml=const_forcing_nml,iostat=ierr) close(nu) if (ierr > 0) then - call shr_sys_abort(subName//': namelist read error '//trim(nlfilename)) + rc = ierr + call shr_log_error(subName//': namelist read error '//trim(nlfilename), rc=rc) + return end if bcasttmp = 0 diff --git a/dglc/dglc_datamode_noevolve_mod.F90 b/dglc/dglc_datamode_noevolve_mod.F90 index a7ed13592..608192a16 100644 --- a/dglc/dglc_datamode_noevolve_mod.F90 +++ b/dglc/dglc_datamode_noevolve_mod.F90 @@ -9,7 +9,7 @@ module dglc_datamode_noevolve_mod use ESMF , only : ESMF_VMGetCurrent, ESMF_VMBroadCast use NUOPC , only : NUOPC_Advertise, NUOPC_IsConnected use shr_kind_mod , only : r8=>shr_kind_r8, i8=>shr_kind_i8, cl=>shr_kind_cl, cs=>shr_kind_cs - use shr_sys_mod , only : shr_sys_abort + use shr_log_mod , only : shr_log_error use shr_const_mod , only : SHR_CONST_RHOICE, SHR_CONST_RHOSW, SHR_CONST_REARTH, SHR_CONST_TKFRZ use shr_const_mod , only : SHR_CONST_SPVAL use shr_cal_mod , only : shr_cal_datetod2string @@ -204,7 +204,8 @@ subroutine dglc_datamode_noevolve_init_pointers(NStateExp, NstateImp, rc) if (.not. NUOPC_IsConnected(NStateImp(ns), fieldName=field_in_tsrf)) then ! NOTE: the field is connected ONLY if the MED->GLC entry is in the nuopc.runconfig file ! This restriction occurs even if the field was advertised - call shr_sys_abort(trim(subname)//": MED->GLC must appear in run sequence") + call shr_log_error(trim(subname)//": MED->GLC must appear in run sequence", rc=rc) + return end if call dshr_state_getfldptr(NStateImp(ns), field_in_tsrf, fldptr1=Sl_tsrf(ns)%ptr, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return @@ -309,8 +310,8 @@ subroutine dglc_datamode_noevolve_advance(gcomp, pio_subsystem, io_type, io_form ! Create pioid and pio_iodesc at the module level inquire(file=trim(model_datafiles(ns)), exist=exists) if (.not.exists) then - write(6,'(a)')' ERROR: model input file '//trim(model_datafiles(ns))//' does not exist' - call shr_sys_abort() + call shr_log_error(' ERROR: model input file '//trim(model_datafiles(ns))//' does not exist', rc=rc) + return end if rcode = pio_openfile(pio_subsystem, pioid, io_type, trim(model_datafiles(ns)), pio_nowrite) call pio_seterrorhandling(pioid, PIO_BCAST_ERROR) diff --git a/dglc/glc_comp_nuopc.F90 b/dglc/glc_comp_nuopc.F90 index 39c6620fa..71b4583c0 100644 --- a/dglc/glc_comp_nuopc.F90 +++ b/dglc/glc_comp_nuopc.F90 @@ -28,9 +28,8 @@ module cdeps_dglc_comp use NUOPC_Model , only : model_label_Finalize => label_Finalize use NUOPC_Model , only : NUOPC_ModelGet, SetVM use shr_kind_mod , only : r8=>shr_kind_r8, i8=>shr_kind_i8, cl=>shr_kind_cl, cs=>shr_kind_cs - use shr_sys_mod , only : shr_sys_abort use shr_cal_mod , only : shr_cal_ymd2date - use shr_log_mod , only : shr_log_setLogUnit + use shr_log_mod , only : shr_log_setLogUnit, shr_log_error use shr_string_mod , only : shr_string_listGetNum, shr_string_listGetName #ifdef CESMCOUPLED use shr_pio_mod , only : shr_pio_getiosys, shr_pio_getiotype, shr_pio_getioformat @@ -225,8 +224,8 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) read (nu,nml=dglc_nml,iostat=ierr) close(nu) if (ierr > 0) then - write(logunit,'(a,i8)') 'ERROR: reading input namelist, '//trim(nlfilename)//' iostat=',ierr - call shr_sys_abort(subName//': namelist read error '//trim(nlfilename)) + call shr_log_error(subName//': namelist read error '//trim(nlfilename), rc=rc) + return end if ! Determine number of ice sheets @@ -284,7 +283,8 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) if ( trim(datamode) == 'noevolve') then ! read stream, no import data ! do nothing else - call shr_sys_abort(' ERROR illegal dglc datamode = '//trim(datamode)) + call shr_log_error(' ERROR illegal dglc datamode = '//trim(datamode), rc=rc) + return endif ! Allocate module variables @@ -362,7 +362,8 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) if (isPresent .and. isSet) then read(cvalue,*) restart_read else - call shr_sys_abort(subname//' ERROR: read restart flag must be present') + call shr_log_error(subname//' ERROR: read restart flag must be present', rc=rc) + return end if ! Get the time to interpolate the stream data to @@ -390,8 +391,8 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) if (my_task == main_task) then inquire(file=trim(model_meshfiles(ns)), exist=exists) if (.not.exists) then - write(logunit,'(a)')' ERROR: model_meshfile '//trim(model_meshfiles(ns))//' does not exist' - call shr_sys_abort(trim(subname)//' ERROR: model_meshfile '//trim(model_meshfiles(ns))//' does not exist') + call shr_log_error(trim(subname)//' ERROR: model_meshfile '//trim(model_meshfiles(ns))//' does not exist', rc=rc) + return end if endif diff --git a/dice/dice_datamode_ssmi_mod.F90 b/dice/dice_datamode_ssmi_mod.F90 index 79c4ac372..20976c236 100644 --- a/dice/dice_datamode_ssmi_mod.F90 +++ b/dice/dice_datamode_ssmi_mod.F90 @@ -5,7 +5,6 @@ module dice_datamode_ssmi_mod use ESMF , only : ESMF_ArrayCreate, ESMF_ArrayDestroy, ESMF_GridComp use NUOPC , only : NUOPC_Advertise use shr_kind_mod , only : r8=>shr_kind_r8, i8=>shr_kind_i8, cl=>shr_kind_cl, cs=>shr_kind_cs - use shr_sys_mod , only : shr_sys_abort use shr_const_mod , only : shr_const_pi, shr_const_spval, shr_const_tkfrz, shr_const_latice use shr_frz_mod , only : shr_frz_freezetemp use dshr_strdata_mod , only : shr_strdata_get_stream_pointer, shr_strdata_type diff --git a/dice/ice_comp_nuopc.F90 b/dice/ice_comp_nuopc.F90 index ad01ffdd0..fb204ed67 100644 --- a/dice/ice_comp_nuopc.F90 +++ b/dice/ice_comp_nuopc.F90 @@ -26,8 +26,7 @@ module cdeps_dice_comp use NUOPC_Model , only : NUOPC_ModelGet, SetVM use shr_kind_mod , only : r8=>shr_kind_r8, cxx=>shr_kind_cxx, cl=>shr_kind_cl, cs=>shr_kind_cs use shr_const_mod , only : shr_const_pi - use shr_log_mod , only : shr_log_setLogUnit - use shr_sys_mod , only : shr_sys_abort + use shr_log_mod , only : shr_log_setLogUnit, shr_log_error use shr_cal_mod , only : shr_cal_ymd2date, shr_cal_ymd2julian use dshr_mod , only : dshr_model_initphase, dshr_init, dshr_mesh_init, dshr_check_restart_alarm use dshr_mod , only : dshr_state_setscalar, dshr_set_runclock, dshr_log_clock_advance @@ -212,8 +211,9 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) read (nu,nml=dice_nml,iostat=ierr) close(nu) if (ierr > 0) then - write(logunit,*) 'ERROR: reading input namelist, '//trim(nlfilename)//' iostat=',ierr - call shr_sys_abort(subName//': namelist read error '//trim(nlfilename)) + rc = ierr + call shr_log_error(subName//': namelist read error '//trim(nlfilename), rc=rc) + return end if ! write namelist input to standard out @@ -268,7 +268,8 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) if ( trim(datamode) == 'ssmi' .or. trim(datamode) == 'ssmi_iaf') then if (my_task == main_task) write(logunit,*) ' dice datamode = ',trim(datamode) else - call shr_sys_abort(' ERROR illegal dice datamode = '//trim(datamode)) + call shr_log_error(' ERROR illegal dice datamode = '//trim(datamode), rc=rc) + return endif ! Advertise import and export fields diff --git a/dlnd/lnd_comp_nuopc.F90 b/dlnd/lnd_comp_nuopc.F90 index a40685bc7..3ad783862 100644 --- a/dlnd/lnd_comp_nuopc.F90 +++ b/dlnd/lnd_comp_nuopc.F90 @@ -23,9 +23,8 @@ module cdeps_dlnd_comp use NUOPC_Model , only : model_label_Finalize => label_Finalize use NUOPC_Model , only : NUOPC_ModelGet, SetVM use shr_kind_mod , only : r8=>shr_kind_r8, i8=>shr_kind_i8, cl=>shr_kind_cl, cs=>shr_kind_cs - use shr_sys_mod , only : shr_sys_abort use shr_cal_mod , only : shr_cal_ymd2date - use shr_log_mod , only : shr_log_setLogUnit + use shr_log_mod , only : shr_log_setLogUnit, shr_log_error use dshr_methods_mod , only : dshr_state_getfldptr, dshr_state_diagnose, chkerr, memcheck use dshr_strdata_mod , only : shr_strdata_type, shr_strdata_advance, shr_strdata_get_stream_domain use dshr_strdata_mod , only : shr_strdata_init_from_config @@ -204,8 +203,9 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) read (nu,nml=dlnd_nml,iostat=ierr) close(nu) if (ierr > 0) then - write(logunit,*) 'ERROR: reading input namelist, '//trim(nlfilename)//' iostat=',ierr - call shr_sys_abort(subName//': namelist read error '//trim(nlfilename)) + rc = ierr + call shr_log_error(subName//': namelist read error '//trim(nlfilename), rc=rc) + return end if bcasttmp = 0 bcasttmp(1) = nx_global @@ -248,7 +248,8 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) if (trim(datamode) == 'copyall') then if (my_task == main_task) write(logunit,*) 'dlnd datamode = ',trim(datamode) else - call shr_sys_abort(' ERROR illegal dlnd datamode = '//trim(datamode)) + call shr_log_error(' ERROR illegal dlnd datamode = '//trim(datamode), rc=rc) + return end if call NUOPC_CompAttributeGet(gcomp, name='glc_nec', value=cvalue, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return diff --git a/docn/docn_datamode_aquaplanet_mod.F90 b/docn/docn_datamode_aquaplanet_mod.F90 index e851e6d31..2ed8b7826 100644 --- a/docn/docn_datamode_aquaplanet_mod.F90 +++ b/docn/docn_datamode_aquaplanet_mod.F90 @@ -4,7 +4,7 @@ module docn_datamode_aquaplanet_mod use NUOPC , only : NUOPC_Advertise use shr_kind_mod , only : r8=>shr_kind_r8, i8=>shr_kind_i8, cl=>shr_kind_cl, cs=>shr_kind_cs use shr_const_mod , only : shr_const_TkFrz, shr_const_pi - use shr_sys_mod , only : shr_sys_abort + use shr_log_mod , only : shr_log_error use dshr_methods_mod , only : dshr_state_getfldptr, dshr_fldbun_getfldptr, chkerr use dshr_fldlist_mod , only : fldlist_type, dshr_fldlist_add @@ -167,7 +167,8 @@ subroutine docn_datamode_aquaplanet_advance(exportState, model_mesh, sst_option, ! Error checks if (sst_option < 1 .or. sst_option > 10) then - call shr_sys_abort ('docn_prescribed_sst: ERROR: sst_option must be between 1 and 10') + call shr_log_error ('docn_prescribed_sst: ERROR: sst_option must be between 1 and 10', rc=rc) + return end if ! Determine So_t in degrees C @@ -305,7 +306,7 @@ subroutine docn_datamode_aquaplanet_advance(exportState, model_mesh, sst_option, So_t(:) = So_t(:) + TkFrz else - call shr_sys_abort("ERROR: either sst_constant value or sst_option must be input") + call shr_log_error("ERROR: either sst_constant value or sst_option must be input", rc=rc) end if end subroutine docn_datamode_aquaplanet_advance diff --git a/docn/docn_datamode_copyall_mod.F90 b/docn/docn_datamode_copyall_mod.F90 index 1c447677d..a6628f56d 100644 --- a/docn/docn_datamode_copyall_mod.F90 +++ b/docn/docn_datamode_copyall_mod.F90 @@ -4,7 +4,6 @@ module docn_datamode_copyall_mod use NUOPC , only : NUOPC_Advertise use shr_kind_mod , only : r8=>shr_kind_r8, i8=>shr_kind_i8, cl=>shr_kind_cl, cs=>shr_kind_cs use shr_const_mod , only : shr_const_TkFrz, shr_const_pi, shr_const_ocn_ref_sal - use shr_sys_mod , only : shr_sys_abort use dshr_methods_mod , only : dshr_state_getfldptr, dshr_fldbun_getfldptr, chkerr use dshr_fldlist_mod , only : fldlist_type, dshr_fldlist_add use dshr_strdata_mod , only : shr_strdata_type diff --git a/docn/docn_datamode_cplhist_mod.F90 b/docn/docn_datamode_cplhist_mod.F90 index f913ad467..f22b9650c 100644 --- a/docn/docn_datamode_cplhist_mod.F90 +++ b/docn/docn_datamode_cplhist_mod.F90 @@ -4,7 +4,6 @@ module docn_datamode_cplhist_mod use NUOPC , only : NUOPC_Advertise use shr_kind_mod , only : r8=>shr_kind_r8, i8=>shr_kind_i8, cl=>shr_kind_cl, cs=>shr_kind_cs use shr_const_mod , only : shr_const_TkFrz, shr_const_pi, shr_const_ocn_ref_sal - use shr_sys_mod , only : shr_sys_abort use dshr_methods_mod , only : dshr_state_getfldptr, dshr_fldbun_getfldptr, chkerr use dshr_fldlist_mod , only : fldlist_type, dshr_fldlist_add use dshr_strdata_mod , only : shr_strdata_type diff --git a/docn/docn_datamode_iaf_mod.F90 b/docn/docn_datamode_iaf_mod.F90 index 7e56afd47..a4d0dc5ae 100644 --- a/docn/docn_datamode_iaf_mod.F90 +++ b/docn/docn_datamode_iaf_mod.F90 @@ -3,13 +3,11 @@ module docn_datamode_iaf_mod use ESMF , only : ESMF_SUCCESS, ESMF_LOGMSG_INFO, ESMF_LogWrite, ESMF_State use NUOPC , only : NUOPC_Advertise use shr_kind_mod , only : r8=>shr_kind_r8, i8=>shr_kind_i8, cl=>shr_kind_cl, cs=>shr_kind_cs - use shr_sys_mod , only : shr_sys_abort use shr_const_mod , only : shr_const_TkFrz, shr_const_pi, shr_const_ocn_ref_sal use dshr_strdata_mod , only : shr_strdata_get_stream_pointer, shr_strdata_type use dshr_methods_mod , only : dshr_state_getfldptr, dshr_fldbun_getfldptr, chkerr use dshr_strdata_mod , only : shr_strdata_type use dshr_fldlist_mod , only : fldlist_type, dshr_fldlist_add - use pio implicit none private ! except diff --git a/docn/docn_datamode_multilev_dom_mod.F90 b/docn/docn_datamode_multilev_dom_mod.F90 index c6413f018..e292b8ade 100644 --- a/docn/docn_datamode_multilev_dom_mod.F90 +++ b/docn/docn_datamode_multilev_dom_mod.F90 @@ -4,7 +4,7 @@ module docn_datamode_multilev_dom_mod use NUOPC , only : NUOPC_Advertise use shr_kind_mod , only : r8=>shr_kind_r8, i8=>shr_kind_i8, cl=>shr_kind_cl, cs=>shr_kind_cs use shr_const_mod , only : shr_const_TkFrz, shr_const_pi, shr_const_ocn_ref_sal, shr_const_spval - use shr_sys_mod , only : shr_sys_abort + use shr_log_mod , only : shr_log_error use dshr_methods_mod , only : dshr_state_getfldptr, dshr_fldbun_getfldptr, chkerr use dshr_fldlist_mod , only : fldlist_type, dshr_fldlist_add use dshr_strdata_mod , only : shr_strdata_get_stream_pointer, shr_strdata_type, shr_strdata_get_stream_count @@ -168,7 +168,8 @@ subroutine docn_datamode_multilev_dom_advance(sdat, logunit, mainproc, rc) if (nlev_stream > 1) exit end do if (nlev_stream == 0) then - call shr_sys_abort(trim(subname)//" could not find vertical levels greater than 0") + call shr_log_error(trim(subname)//" could not find vertical levels greater than 0", rc=rc) + return end if allocate(stream_vlevs(nlev_stream)) stream_vlevs(:) = sdat%pstrm(stream_index)%stream_vlevs(:) @@ -210,7 +211,8 @@ subroutine docn_datamode_multilev_dom_advance(sdat, logunit, mainproc, rc) end if end do if (.not. level_found) then - call shr_sys_abort(trim(subname)//" could not find level bounds for vertical interpolation") + call shr_log_error(trim(subname)//" could not find level bounds for vertical interpolation", rc=rc) + return end if end do diff --git a/docn/docn_datamode_multilev_mod.F90 b/docn/docn_datamode_multilev_mod.F90 index 11f9dc43f..c3949a702 100644 --- a/docn/docn_datamode_multilev_mod.F90 +++ b/docn/docn_datamode_multilev_mod.F90 @@ -3,7 +3,7 @@ module docn_datamode_multilev_mod use NUOPC , only : NUOPC_Advertise use shr_kind_mod , only : r8=>shr_kind_r8, i8=>shr_kind_i8, cl=>shr_kind_cl, cs=>shr_kind_cs use shr_const_mod , only : shr_const_TkFrz, shr_const_pi, shr_const_ocn_ref_sal, shr_const_spval - use shr_sys_mod , only : shr_sys_abort + use shr_log_mod , only : shr_log_error use dshr_methods_mod , only : dshr_state_getfldptr, dshr_fldbun_getfldptr, chkerr use dshr_fldlist_mod , only : fldlist_type, dshr_fldlist_add use dshr_strdata_mod , only : shr_strdata_get_stream_pointer, shr_strdata_type @@ -175,7 +175,8 @@ subroutine docn_datamode_multilev_advance(sdat, logunit, mainproc, rc) end if end do if (.not. level_found) then - call shr_sys_abort("ERROR: could not find level bounds for vertical interpolation") + call shr_log_error("ERROR: could not find level bounds for vertical interpolation", rc=rc) + return end if end do diff --git a/docn/docn_datamode_som_mod.F90 b/docn/docn_datamode_som_mod.F90 index 92e51c0f8..b3947d697 100644 --- a/docn/docn_datamode_som_mod.F90 +++ b/docn/docn_datamode_som_mod.F90 @@ -6,7 +6,6 @@ module docn_datamode_som_mod use ESMF , only : ESMF_LogWrite use NUOPC , only : NUOPC_Advertise use shr_kind_mod , only : r8=>shr_kind_r8, i8=>shr_kind_i8, cl=>shr_kind_cl, cs=>shr_kind_cs - use shr_sys_mod , only : shr_sys_abort use shr_const_mod , only : shr_const_cpsw, shr_const_rhosw, shr_const_TkFrz use shr_const_mod , only : shr_const_TkFrzSw, shr_const_latice, shr_const_ocn_ref_sal use shr_const_mod , only : shr_const_zsrflyr, shr_const_pi diff --git a/docn/ocn_comp_nuopc.F90 b/docn/ocn_comp_nuopc.F90 index bb0d3e78b..7a94cd0f4 100644 --- a/docn/ocn_comp_nuopc.F90 +++ b/docn/ocn_comp_nuopc.F90 @@ -24,9 +24,8 @@ module cdeps_docn_comp use NUOPC_Model , only : model_label_Finalize => label_Finalize use NUOPC_Model , only : NUOPC_ModelGet, SetVM use shr_kind_mod , only : r8=>shr_kind_r8, i8=>shr_kind_i8, cl=>shr_kind_cl, cs=>shr_kind_cs - use shr_sys_mod , only : shr_sys_abort use shr_cal_mod , only : shr_cal_ymd2date - use shr_log_mod , only : shr_log_setLogUnit + use shr_log_mod , only : shr_log_setLogUnit, shr_log_error use dshr_methods_mod , only : dshr_state_diagnose, chkerr, memcheck use dshr_strdata_mod , only : shr_strdata_type, shr_strdata_advance, shr_strdata_init_from_config use dshr_mod , only : dshr_model_initphase, dshr_init, dshr_mesh_init, dshr_restart_read @@ -232,7 +231,8 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) close(nu) if (ierr > 0) then write(logunit,F00) 'ERROR: reading input namelist, '//trim(nlfilename)//' iostat=',ierr - call shr_sys_abort(subName//': namelist read error '//trim(nlfilename)) + call shr_log_error(subName//': namelist read error '//trim(nlfilename), rc=rc) + return end if ! write namelist input to standard out @@ -308,7 +308,8 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) trim(datamode) == 'multilev_dom') then ! multilevel ocean input and sst export ! success do nothing else - call shr_sys_abort(' ERROR illegal docn datamode = '//trim(datamode)) + call shr_log_error(' ERROR illegal docn datamode = '//trim(datamode), rc=rc) + return endif ! Advertise docn fields @@ -653,7 +654,8 @@ subroutine docn_comp_run(gcomp, importState, exportState, clock, target_ymd, tar case('sst_aquap_analytic', 'sst_aquap_constant') ! Do nothing case default - call shr_sys_abort(subName//'datamode '//trim(datamode)//' not recognized') + call shr_log_error(subName//'datamode '//trim(datamode)//' not recognized', rc=rc) + return end select endif diff --git a/drof/rof_comp_nuopc.F90 b/drof/rof_comp_nuopc.F90 index 520057d90..739bc1490 100644 --- a/drof/rof_comp_nuopc.F90 +++ b/drof/rof_comp_nuopc.F90 @@ -25,9 +25,8 @@ module cdeps_drof_comp use NUOPC_Model , only : NUOPC_ModelGet, SetVM use shr_kind_mod , only : r8=>shr_kind_r8, i8=>shr_kind_i8, cl=>shr_kind_cl, cs=>shr_kind_cs use shr_const_mod , only : SHR_CONST_SPVAL - use shr_sys_mod , only : shr_sys_abort use shr_cal_mod , only : shr_cal_ymd2date - use shr_log_mod , only : shr_log_setLogUnit + use shr_log_mod , only : shr_log_setLogUnit, shr_log_error use dshr_methods_mod , only : dshr_state_getfldptr, dshr_state_diagnose, chkerr, memcheck use dshr_strdata_mod , only : shr_strdata_type, shr_strdata_advance, shr_strdata_get_stream_domain use dshr_strdata_mod , only : shr_strdata_init_from_config @@ -199,8 +198,9 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) read (nu,nml=drof_nml,iostat=ierr) close(nu) if (ierr > 0) then - write(logunit,*) 'ERROR: reading input namelist, '//trim(nlfilename)//' iostat=',ierr - call shr_sys_abort(subName//': namelist read error '//trim(nlfilename)) + rc = ierr + call shr_log_error(subName//': namelist read error '//trim(nlfilename), rc=rc) + return end if ! write namelist input to standard out @@ -242,7 +242,8 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) if (trim(datamode) == 'copyall') then if (mainproc) write(logunit,*) 'drof datamode = ',trim(datamode) else - call shr_sys_abort(' ERROR illegal drof datamode = '//trim(datamode)) + call shr_log_error(' ERROR illegal drof datamode = '//trim(datamode), rc=rc) + return end if call dshr_fldList_add(fldsExport, trim(flds_scalar_name)) diff --git a/dshr/dshr_dfield_mod.F90 b/dshr/dshr_dfield_mod.F90 index 2f3b33d69..bbd411572 100644 --- a/dshr/dshr_dfield_mod.F90 +++ b/dshr/dshr_dfield_mod.F90 @@ -3,7 +3,7 @@ module dshr_dfield_mod use ESMF , only : ESMF_State, ESMF_FieldBundle, ESMF_MAXSTR, ESMF_SUCCESS use ESMF , only : ESMF_FieldBundleGet, ESMF_ITEMORDER_ADDORDER, ESMF_Field, ESMF_FieldGet use shr_kind_mod , only : r8=>shr_kind_r8, cs=>shr_kind_cs, cl=>shr_kind_cl, cxx=>shr_kind_cxx - use shr_sys_mod , only : shr_sys_abort + use shr_log_mod , only : shr_log_error use dshr_strdata_mod , only : shr_strdata_type, shr_strdata_get_stream_count, shr_strdata_get_stream_fieldbundle use dshr_methods_mod , only : dshr_state_getfldptr, dshr_fldbun_getfieldn, dshr_field_getfldptr, dshr_fldbun_getFldPtr use dshr_methods_mod , only : chkerr @@ -77,7 +77,8 @@ subroutine dshr_dfield_add_1d(dfields, sdat, state_fld, strm_fld, state, logunit allocate(dfield_new, stat=status) if (status /= 0) then write(msgstr,*)'allocation error ',__LINE__,':',__FILE__ - call shr_sys_abort(msgstr) + call shr_log_error(msgstr, rc=rc) + return endif dfield_new%next => dfields dfields => dfield_new @@ -154,7 +155,8 @@ subroutine dshr_dfield_add_1d_stateptr(dfields, sdat, state_fld, strm_fld, state allocate(dfield_new, stat=status) if (status /= 0) then write(msgstr,*)'allocation error ',__LINE__,':',__FILE__ - call shr_sys_abort(msgstr) + call shr_log_error(msgstr, rc=rc) + return endif dfield_new%next => dfields dfields => dfield_new @@ -253,7 +255,8 @@ subroutine dshr_dfield_add_2d(dfields, sdat, state_fld, strm_flds, state, & endif if (status /= 0) then write(msgstr,*)'allocation error ',__LINE__,':',__FILE__ - call shr_sys_abort(msgstr) + call shr_log_error(msgstr, rc=rc) + return endif ! determine stream fldnames array @@ -261,12 +264,14 @@ subroutine dshr_dfield_add_2d(dfields, sdat, state_fld, strm_flds, state, & allocate(dfield_new%stream_indices(nflds), stat=status) if (status /= 0) then write(msgstr,*)'allocation error ',__LINE__,':',__FILE__ - call shr_sys_abort(msgstr) + call shr_log_error(msgstr, rc=rc) + return endif allocate(dfield_new%fldbun_indices(nflds), stat=status) if (status /= 0) then write(msgstr,*)'allocation error ',__LINE__,':',__FILE__ - call shr_sys_abort(msgstr) + call shr_log_error(msgstr, rc=rc) + return endif dfield_new%stream_indices(:) = 0 dfield_new%fldbun_indices(:) = 0 @@ -358,7 +363,8 @@ subroutine dshr_dfield_add_2d_stateptr(dfields, sdat, state_fld, strm_flds, stat endif if (status /= 0) then write(msgstr,*)'allocation error ',__LINE__,':',__FILE__ - call shr_sys_abort(msgstr) + call shr_log_error(msgstr, rc=rc) + return endif ! determine stream fldnames array @@ -367,12 +373,14 @@ subroutine dshr_dfield_add_2d_stateptr(dfields, sdat, state_fld, strm_flds, stat allocate(dfield_new%stream_indices(nflds), stat=status) if (status /= 0) then write(msgstr,*)'allocation error ',__LINE__,':',__FILE__ - call shr_sys_abort(msgstr) + call shr_log_error(msgstr, rc=rc) + return endif allocate(dfield_new%fldbun_indices(nflds), stat=status) if (status /= 0) then write(msgstr,*)'allocation error ',__LINE__,':',__FILE__ - call shr_sys_abort(msgstr) + call shr_log_error(msgstr, rc=rc) + return endif ! loop through the field names in strm_flds diff --git a/dshr/dshr_mod.F90 b/dshr/dshr_mod.F90 index 7073ea923..ba3d12bfc 100644 --- a/dshr/dshr_mod.F90 +++ b/dshr/dshr_mod.F90 @@ -32,8 +32,7 @@ module dshr_mod use ESMF , only : ESMF_Region_Flag, ESMF_REGION_TOTAL, ESMF_MAXSTR, ESMF_RC_NOT_VALID use ESMF , only : ESMF_UtilStringUpperCase use shr_kind_mod , only : r8=>shr_kind_r8, cs=>shr_kind_cs, cl=>shr_kind_cl, cx=>shr_kind_cx, cxx=>shr_kind_cxx, i8=>shr_kind_i8 - use shr_sys_mod , only : shr_sys_abort - use shr_log_mod , only : shr_log_setLogUnit + use shr_log_mod , only : shr_log_setLogUnit, shr_log_error use shr_cal_mod , only : shr_cal_noleap, shr_cal_gregorian, shr_cal_calendarname use shr_cal_mod , only : shr_cal_datetod2string, shr_cal_date2julian use shr_const_mod , only : shr_const_spval, shr_const_cday @@ -300,7 +299,8 @@ subroutine dshr_mesh_init(gcomp, sdat, nullstr, logunit, compname, model_nxg, mo if (isPresent .and. isSet) then read(cvalue,*) read_restart else - call shr_sys_abort(subname//' ERROR: read restart flag must be present') + call shr_log_error(subname//' ERROR: read restart flag must be present', rc=rc) + return end if ! obtain the single column lon and lat @@ -332,12 +332,14 @@ subroutine dshr_mesh_init(gcomp, sdat, nullstr, logunit, compname, model_nxg, mo inquire(file=trim(model_meshfile), exist=exists) if (.not.exists) then write(logunit, *)' ERROR: model_meshfile '//trim(model_meshfile)//' does not exist' - call shr_sys_abort(trim(subname)//' ERROR: model_meshfile '//trim(model_meshfile)//' does not exist') + call shr_log_error(trim(subname)//' ERROR: model_meshfile '//trim(model_meshfile)//' does not exist', rc=rc) + return end if inquire(file=trim(model_maskfile), exist=exists) if (.not.exists) then write(logunit, *)' ERROR: model_maskfile '//trim(model_maskfile)//' does not exist' - call shr_sys_abort(trim(subname)//' ERROR: model_maskfile '//trim(model_maskfile)//' does not exist') + call shr_log_error(trim(subname)//' ERROR: model_maskfile '//trim(model_maskfile)//' does not exist', rc=rc) + return end if endif @@ -438,7 +440,8 @@ subroutine dshr_mesh_create_scol(gcomp, compname, scol_lon, scol_lat, & if (ChkErr(rc,__LINE__,u_FILE_u)) return read(cvalue,*) model_frac(1) else - call shr_sys_abort('ERROR: currently component '//trim(compname)//' is not supported for single column') + call shr_log_error('ERROR: currently component '//trim(compname)//' is not supported for single column', rc=rc) + return end if ! Use center and come up with arbitrary area delta lon and lat = .1 degree @@ -683,10 +686,12 @@ subroutine dshr_alarm_init( clock, alarm, option, & case (optDate) if (.not. present(opt_ymd)) then - call shr_sys_abort(subname//trim(option)//' requires opt_ymd') + call shr_log_error(subname//trim(option)//' requires opt_ymd', rc=rc) + return end if if (lymd < 0 .or. ltod < 0) then - call shr_sys_abort(subname//trim(option)//'opt_ymd, opt_tod invalid') + call shr_log_error(subname//trim(option)//'opt_ymd, opt_tod invalid', rc=rc) + return end if call ESMF_TimeIntervalSet(AlarmInterval, yy=9999, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return @@ -696,13 +701,16 @@ subroutine dshr_alarm_init( clock, alarm, option, & case (optIfdays0) if (.not. present(opt_ymd)) then - call shr_sys_abort(subname//trim(option)//' requires opt_ymd') + call shr_log_error(subname//trim(option)//' requires opt_ymd', rc=rc) + return end if if (.not.present(opt_n)) then - call shr_sys_abort(subname//trim(option)//' requires opt_n') + call shr_log_error(subname//trim(option)//' requires opt_n', rc=rc) + return end if if (opt_n <= 0) then - call shr_sys_abort(subname//trim(option)//' invalid opt_n') + call shr_log_error(subname//trim(option)//' invalid opt_n', rc=rc) + return end if call ESMF_TimeIntervalSet(AlarmInterval, mm=1, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return @@ -712,10 +720,12 @@ subroutine dshr_alarm_init( clock, alarm, option, & case (optNSteps) if (.not.present(opt_n)) then - call shr_sys_abort(subname//trim(option)//' requires opt_n') + call shr_log_error(subname//trim(option)//' requires opt_n', rc=rc) + return end if if (opt_n <= 0) then - call shr_sys_abort(subname//trim(option)//' invalid opt_n') + call shr_log_error(subname//trim(option)//' invalid opt_n', rc=rc) + return end if call ESMF_ClockGet(clock, TimeStep=AlarmInterval, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return @@ -723,8 +733,14 @@ subroutine dshr_alarm_init( clock, alarm, option, & update_nextalarm = .true. case (optNStep) - if (.not.present(opt_n)) call shr_sys_abort(subname//trim(option)//' requires opt_n') - if (opt_n <= 0) call shr_sys_abort(subname//trim(option)//' invalid opt_n') + if (.not.present(opt_n)) then + call shr_log_error(subname//trim(option)//' requires opt_n',rc=rc) + return + endif + if (opt_n <= 0) then + call shr_log_error(subname//trim(option)//' invalid opt_n', rc=rc) + return + endif call ESMF_ClockGet(clock, TimeStep=AlarmInterval, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return AlarmInterval = AlarmInterval * opt_n @@ -732,10 +748,12 @@ subroutine dshr_alarm_init( clock, alarm, option, & case (optNSeconds) if (.not.present(opt_n)) then - call shr_sys_abort(subname//trim(option)//' requires opt_n') + call shr_log_error(subname//trim(option)//' requires opt_n', rc=rc) + return end if if (opt_n <= 0) then - call shr_sys_abort(subname//trim(option)//' invalid opt_n') + call shr_log_error(subname//trim(option)//' invalid opt_n', rc=rc) + return end if call ESMF_TimeIntervalSet(AlarmInterval, s=1, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return @@ -744,10 +762,12 @@ subroutine dshr_alarm_init( clock, alarm, option, & case (optNSecond) if (.not.present(opt_n)) then - call shr_sys_abort(subname//trim(option)//' requires opt_n') + call shr_log_error(subname//trim(option)//' requires opt_n', rc=rc) + return end if if (opt_n <= 0) then - call shr_sys_abort(subname//trim(option)//' invalid opt_n') + call shr_log_error(subname//trim(option)//' invalid opt_n', rc=rc) + return end if call ESMF_TimeIntervalSet(AlarmInterval, s=1, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return @@ -757,20 +777,24 @@ subroutine dshr_alarm_init( clock, alarm, option, & case (optNMinutes) call ESMF_TimeIntervalSet(AlarmInterval, s=60, rc=rc) if (.not.present(opt_n)) then - call shr_sys_abort(subname//trim(option)//' requires opt_n') + call shr_log_error(subname//trim(option)//' requires opt_n', rc=rc) + return end if if (opt_n <= 0) then - call shr_sys_abort(subname//trim(option)//' invalid opt_n') + call shr_log_error(subname//trim(option)//' invalid opt_n', rc=rc) + return end if AlarmInterval = AlarmInterval * opt_n update_nextalarm = .true. case (optNMinute) if (.not.present(opt_n)) then - call shr_sys_abort(subname//trim(option)//' requires opt_n') + call shr_log_error(subname//trim(option)//' requires opt_n', rc=rc) + return end if if (opt_n <= 0) then - call shr_sys_abort(subname//trim(option)//' invalid opt_n') + call shr_log_error(subname//trim(option)//' invalid opt_n', rc=rc) + return end if call ESMF_TimeIntervalSet(AlarmInterval, s=60, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return @@ -779,10 +803,12 @@ subroutine dshr_alarm_init( clock, alarm, option, & case (optNHours) if (.not.present(opt_n)) then - call shr_sys_abort(subname//trim(option)//' requires opt_n') + call shr_log_error(subname//trim(option)//' requires opt_n', rc=rc) + return end if if (opt_n <= 0) then - call shr_sys_abort(subname//trim(option)//' invalid opt_n') + call shr_log_error(subname//trim(option)//' invalid opt_n', rc=rc) + return end if call ESMF_TimeIntervalSet(AlarmInterval, s=3600, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return @@ -791,10 +817,12 @@ subroutine dshr_alarm_init( clock, alarm, option, & case (optNHour) if (.not.present(opt_n)) then - call shr_sys_abort(subname//trim(option)//' requires opt_n') + call shr_log_error(subname//trim(option)//' requires opt_n', rc=rc) + return end if if (opt_n <= 0) then - call shr_sys_abort(subname//trim(option)//' invalid opt_n') + call shr_log_error(subname//trim(option)//' invalid opt_n', rc=rc) + return end if call ESMF_TimeIntervalSet(AlarmInterval, s=3600, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return @@ -803,10 +831,12 @@ subroutine dshr_alarm_init( clock, alarm, option, & case (optNDays) if (.not.present(opt_n)) then - call shr_sys_abort(subname//trim(option)//' requires opt_n') + call shr_log_error(subname//trim(option)//' requires opt_n', rc=rc) + return end if if (opt_n <= 0) then - call shr_sys_abort(subname//trim(option)//' invalid opt_n') + call shr_log_error(subname//trim(option)//' invalid opt_n', rc=rc) + return end if call ESMF_TimeIntervalSet(AlarmInterval, d=1, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return @@ -815,10 +845,12 @@ subroutine dshr_alarm_init( clock, alarm, option, & case (optNDay) if (.not.present(opt_n)) then - call shr_sys_abort(subname//trim(option)//' requires opt_n') + call shr_log_error(subname//trim(option)//' requires opt_n', rc=rc) + return end if if (opt_n <= 0) then - call shr_sys_abort(subname//trim(option)//' invalid opt_n') + call shr_log_error(subname//trim(option)//' invalid opt_n', rc=rc) + return end if call ESMF_TimeIntervalSet(AlarmInterval, d=1, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return @@ -827,10 +859,12 @@ subroutine dshr_alarm_init( clock, alarm, option, & case (optNMonths) if (.not.present(opt_n)) then - call shr_sys_abort(subname//trim(option)//' requires opt_n') + call shr_log_error(subname//trim(option)//' requires opt_n', rc=rc) + return end if if (opt_n <= 0) then - call shr_sys_abort(subname//trim(option)//' invalid opt_n') + call shr_log_error(subname//trim(option)//' invalid opt_n', rc=rc) + return end if call ESMF_TimeIntervalSet(AlarmInterval, mm=1, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return @@ -839,10 +873,12 @@ subroutine dshr_alarm_init( clock, alarm, option, & case (optNMonth) if (.not.present(opt_n)) then - call shr_sys_abort(subname//trim(option)//' requires opt_n') + call shr_log_error(subname//trim(option)//' requires opt_n', rc=rc) + return end if if (opt_n <= 0) then - call shr_sys_abort(subname//trim(option)//' invalid opt_n') + call shr_log_error(subname//trim(option)//' invalid opt_n', rc=rc) + return end if call ESMF_TimeIntervalSet(AlarmInterval, mm=1, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return @@ -858,10 +894,12 @@ subroutine dshr_alarm_init( clock, alarm, option, & case (optNYears) if (.not.present(opt_n)) then - call shr_sys_abort(subname//trim(option)//' requires opt_n') + call shr_log_error(subname//trim(option)//' requires opt_n', rc=rc) + return end if if (opt_n <= 0) then - call shr_sys_abort(subname//trim(option)//' invalid opt_n') + call shr_log_error(subname//trim(option)//' invalid opt_n', rc=rc) + return end if call ESMF_TimeIntervalSet(AlarmInterval, yy=1, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return @@ -870,10 +908,12 @@ subroutine dshr_alarm_init( clock, alarm, option, & case (optNYear) if (.not.present(opt_n)) then - call shr_sys_abort(subname//trim(option)//' requires opt_n') + call shr_log_error(subname//trim(option)//' requires opt_n', rc=rc) + return end if if (opt_n <= 0) then - call shr_sys_abort(subname//trim(option)//' invalid opt_n') + call shr_log_error(subname//trim(option)//' invalid opt_n', rc=rc) + return end if call ESMF_TimeIntervalSet(AlarmInterval, yy=1, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return @@ -888,7 +928,8 @@ subroutine dshr_alarm_init( clock, alarm, option, & update_nextalarm = .true. case default - call shr_sys_abort(subname//'unknown option '//trim(option)) + call shr_log_error(subname//'unknown option '//trim(option), rc=rc) + return end select ! -------------------------------------------------------------------------------- @@ -935,7 +976,8 @@ subroutine dshr_time_init( Time, ymd, cal, tod, rc) rc = ESMF_SUCCESS if ( (ymd < 0) .or. (tod < 0) .or. (tod > SecPerDay) )then - call shr_sys_abort( subname//'ERROR yymmdd is a negative number or time-of-day out of bounds' ) + call shr_log_error( subname//'ERROR yymmdd is a negative number or time-of-day out of bounds', rc=rc ) + return end if tdate = abs(ymd) diff --git a/dwav/wav_comp_nuopc.F90 b/dwav/wav_comp_nuopc.F90 index 61150fedd..07e6dc50e 100644 --- a/dwav/wav_comp_nuopc.F90 +++ b/dwav/wav_comp_nuopc.F90 @@ -23,9 +23,8 @@ module cdeps_dwav_comp use NUOPC_Model , only : model_label_Finalize => label_Finalize use NUOPC_Model , only : NUOPC_ModelGet, SetVM use shr_kind_mod , only : r8=>shr_kind_r8, i8=>shr_kind_i8, cl=>shr_kind_cl, cs=>shr_kind_cs - use shr_sys_mod , only : shr_sys_abort use shr_cal_mod , only : shr_cal_ymd2date - use shr_log_mod , only : shr_log_setLogUnit + use shr_log_mod , only : shr_log_setLogUnit, shr_log_error use dshr_methods_mod , only : dshr_state_getfldptr, chkerr, memcheck, dshr_state_diagnose use dshr_strdata_mod , only : shr_strdata_type, shr_strdata_advance use dshr_strdata_mod , only : shr_strdata_init_from_config @@ -198,7 +197,8 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) close(nu) if (ierr > 0) then write(logunit,*) 'ERROR: reading input namelist, '//trim(nlfilename)//' iostat=',ierr - call shr_sys_abort(subName//': namelist read error '//trim(nlfilename)) + call shr_log_error(subName//': namelist read error '//trim(nlfilename), rc=rc) + return end if ! write namelist input to standard out @@ -240,7 +240,8 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) if (trim(datamode) == 'copyall') then if (my_task == main_task) write(logunit,*) 'dwav datamode = ',trim(datamode) else - call shr_sys_abort(' ERROR illegal dwav datamode = '//trim(datamode)) + call shr_log_error(' ERROR illegal dwav datamode = '//trim(datamode), rc=rc) + return end if call dwav_comp_advertise(importState, exportState, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return diff --git a/streams/dshr_strdata_mod.F90 b/streams/dshr_strdata_mod.F90 index c9ba174a2..894afbbb3 100644 --- a/streams/dshr_strdata_mod.F90 +++ b/streams/dshr_strdata_mod.F90 @@ -22,7 +22,7 @@ module dshr_strdata_mod use ESMF , only : ESMF_LOGMSG_INFO, ESMF_LogWrite use shr_kind_mod , only : r8=>shr_kind_r8, r4=>shr_kind_r4, i2=>shr_kind_I2 use shr_kind_mod , only : cs=>shr_kind_cs, cl=>shr_kind_cl, cxx=>shr_kind_cxx, cx=>shr_kind_cx - use shr_sys_mod , only : shr_sys_abort + use shr_log_mod , only : shr_log_error use shr_const_mod , only : shr_const_pi, shr_const_cDay, shr_const_spval use shr_cal_mod , only : shr_cal_calendarname, shr_cal_timeSet use shr_cal_mod , only : shr_cal_noleap, shr_cal_gregorian @@ -170,11 +170,14 @@ type(ESMF_FieldBundle) function shr_strdata_get_stream_fieldbundle(sdat, ns, nam else if (trim(name) .eq. 'model_ub') then shr_strdata_get_stream_fieldbundle = sdat%pstrm(ns)%fldbun_data(sdat%pstrm(ns)%stream_ub) else if (trim(name) .eq. 'stream_lb') then - call shr_sys_abort("should not be here") + call shr_log_error("should not be here", rc=rc) + return else if (trim(name) .eq. 'stream_ub') then - call shr_sys_abort("should not be here") + call shr_log_error("should not be here", rc=rc) + return else - call shr_sys_abort(trim(name)//' is not a recognized stream bundle name') + call shr_log_error(trim(name)//' is not a recognized stream bundle name', rc=rc) + return endif end function shr_strdata_get_stream_fieldbundle @@ -426,8 +429,8 @@ subroutine shr_strdata_init(sdat, model_clock, stream_name, rc) if (filename /= 'none' .and. mainproc) then inquire(file=trim(filename),exist=fileExists) if (.not. fileExists) then - write(sdat%stream(1)%logunit,'(a)') "ERROR: file does not exist: "//trim(fileName) - call shr_sys_abort(subName//"ERROR: file does not exist: "//trim(fileName)) + call shr_log_error(subName//"ERROR: file does not exist: "//trim(fileName)) + return end if endif ! @@ -599,7 +602,8 @@ subroutine shr_strdata_init(sdat, model_clock, stream_name, rc) else if (trim(sdat%stream(ns)%mapalgo) == 'none') then ! single point stream data, no action required. else - call shr_sys_abort('ERROR: map algo '//trim(sdat%stream(ns)%mapalgo)//' is not supported') + call shr_log_error('ERROR: map algo '//trim(sdat%stream(ns)%mapalgo)//' is not supported', rc=rc) + return end if end if @@ -616,17 +620,18 @@ subroutine shr_strdata_init(sdat, model_clock, stream_name, rc) ! check that for now u and v are only for single level fields if (stream_nlev > 1) then ! TODO: add support for u and v for multi level fields - call shr_sys_abort(subname//': vector fields are not currently supported for multi-level fields') + call shr_log_error(subname//': vector fields are not currently supported for multi-level fields', rc=rc) + return end if ! check that stream vector names are valid if (.not. shr_string_listIsValid(stream_vector_names)) then - write(sdat%stream(1)%logunit,*) trim(subname),' vec fldlist invalid m=',m,trim(stream_vector_names) - call shr_sys_abort(subname//': vec fldlist invalid:'//trim(stream_vector_names)) + call shr_log_error(subname//': vec fldlist invalid:'//trim(stream_vector_names), rc=rc) + return endif ! check that only 2 fields are contained for any vector pairing if (shr_string_listGetNum(stream_vector_names) /= 2) then - write(sdat%stream(1)%logunit,*) trim(subname),' vec fldlist ne 2 m=',m,trim(stream_vector_names) - call shr_sys_abort(subname//': vec fldlist ne 2:'//trim(stream_vector_names)) + call shr_log_error(subname//': vec fldlist ne 2:'//trim(stream_vector_names), rc=rc) + return endif ! create stream vector field sdat%pstrm(ns)%field_stream_vector = ESMF_FieldCreate(stream_mesh, & @@ -649,7 +654,8 @@ subroutine shr_strdata_init(sdat, model_clock, stream_name, rc) else if (esmf_caltype == ESMF_CALKIND_GREGORIAN) then sdat%model_calendar = trim(shr_cal_gregorian) else - call shr_sys_abort(subname//" ERROR bad ESMF calendar name "//trim(calendar)) + call shr_log_error(subname//" ERROR bad ESMF calendar name "//trim(calendar), rc=rc) + return end if ! print sdat output @@ -788,7 +794,8 @@ subroutine shr_strdata_get_stream_domain(sdat, stream_index, fldname, flddata, r flddata(:) = data_double(:) deallocate(data_double) else - call shr_sys_abort(subName//"ERROR: only real and double types are supported for stream domain read") + call shr_log_error(subName//"ERROR: only real and double types are supported for stream domain read", rc=rc) + return end if ! Free the memory associate with the iodesc and close the file @@ -969,7 +976,8 @@ subroutine shr_strdata_advance(sdat, ymd, tod, logunit, istr, timers, rc) ! TODO: need to put in capability to read all stream data at once case default write(logunit,F00) "ERROR: Unsupported readmode : ", trim(sdat%stream(ns)%readmode) - call shr_sys_abort(subName//"ERROR: Unsupported readmode: "//trim(sdat%stream(ns)%readmode)) + call shr_log_error(subName//"ERROR: Unsupported readmode: "//trim(sdat%stream(ns)%readmode), rc=rc) + return end select if (debug > 0 .and. sdat%mainproc) then @@ -996,7 +1004,7 @@ subroutine shr_strdata_advance(sdat, ymd, tod, logunit, istr, timers, rc) ! case (3), abort write(logunit,*) trim(subname),' ERROR: mismatch calendar ', & trim(sdat%model_calendar),':',trim(sdat%stream(ns)%calendar) - call shr_sys_abort(trim(subname)//' ERROR: mismatch calendar ') + call shr_log_error(trim(subname)//' ERROR: mismatch calendar ') endif else ! calendars are the same if(trim(sdat%model_calendar) == trim(shr_cal_gregorian)) then @@ -1053,7 +1061,8 @@ subroutine shr_strdata_advance(sdat, ymd, tod, logunit, istr, timers, rc) dtime, sdat%pstrm(ns)%dtmax, sdat%pstrm(ns)%dtmin, sdat%stream(ns)%dtlimit write(6,*) trim(subName),' ERROR: ymdLB, todLB, ymdUB, todUB = ', & sdat%pstrm(ns)%ymdLB, sdat%pstrm(ns)%todLB, sdat%pstrm(ns)%ymdUB, sdat%pstrm(ns)%todUB - call shr_sys_abort(trim(subName)//' ERROR dt limit for stream, see atm.log output') + call shr_log_error(trim(subName)//' ERROR dt limit for stream, see atm.log output', rc=rc) + return endif endif endif @@ -1511,8 +1520,8 @@ subroutine shr_strdata_readstrm(sdat, per_stream, stream, fldbun_data, & if (sdat%mainproc) then inquire(file=trim(fileName),exist=fileExists) if (.not. fileExists) then - write(sdat%stream(1)%logunit,F00) "ERROR: file does not exist: ", trim(fileName) - call shr_sys_abort(subName//"ERROR: file does not exist: "//trim(fileName)) + call shr_log_error(subName//"ERROR: file does not exist: "//trim(fileName), rc=rc) + return end if endif @@ -1557,7 +1566,8 @@ subroutine shr_strdata_readstrm(sdat, per_stream, stream, fldbun_data, & if (stream_nlev == 1) then allocate(dataptr1d(1)) else - call shr_sys_abort("ERROR: multi-level streams always require a stream mesh") + call shr_log_error("ERROR: multi-level streams always require a stream mesh", rc=rc) + return end if end if @@ -1617,11 +1627,15 @@ subroutine shr_strdata_readstrm(sdat, per_stream, stream, fldbun_data, & else if (pio_iovartype == PIO_SHORT) then rcode = pio_get_att(pioid, varid, "scale_factor", scale_factor) if(rcode /= PIO_NOERR) then - call shr_sys_abort('DATATYPE PIO_SHORT requires attributes scale_factor') + rc = rcode + call shr_log_error('DATATYPE PIO_SHORT requires attributes scale_factor', rc=rc) + return endif rcode = pio_get_att(pioid, varid, "add_offset", add_offset) if(rcode /= PIO_NOERR) then - call shr_sys_abort('DATATYPE PIO_SHORT requires attributes add_offset') + rc = rcode + call shr_log_error('DATATYPE PIO_SHORT requires attributes add_offset', rc=rc) + return endif rcode = pio_get_att(pioid, varid, "_FillValue", fillvalue_i2) endif @@ -1647,14 +1661,17 @@ subroutine shr_strdata_readstrm(sdat, per_stream, stream, fldbun_data, & rcode = pio_get_var(pioid, varid,start=(/1,1,1,nt/),count=(/1,1,1,1/), ival=data_real2d) end if if ( rcode /= PIO_NOERR ) then - call shr_sys_abort(' ERROR: reading in variable: '// trim(per_stream%fldlist_stream(nf))) + rc = rcode + call shr_log_error(' ERROR: reading in variable: '// trim(per_stream%fldlist_stream(nf)), rc=rc) + return end if if (handlefill) then ! Single point streams are not allowed to have missing values if (stream%mapalgo == 'none' .and. any(data_real2d == fillvalue_r4)) then write(errmsg,*) ' ERROR: _Fillvalue found in stream input variable: '// trim(per_stream%fldlist_stream(nf)) if(sdat%mainproc) write(sdat%stream(1)%logunit,*) trim(errmsg) - call shr_sys_abort(errmsg) + call shr_log_error(errmsg, rc=rc) + return endif do lev = 1,stream_nlev do n = 1,size(dataptr2d, dim=2) @@ -1679,14 +1696,17 @@ subroutine shr_strdata_readstrm(sdat, per_stream, stream, fldbun_data, & rcode = pio_get_var(pioid, varid,start=(/1,1,nt/),count=(/1,1,1/), ival=data_real1d) endif if ( rcode /= PIO_NOERR ) then - call shr_sys_abort(' ERROR: reading in variable: '// trim(per_stream%fldlist_stream(nf))) + rc = rcode + call shr_log_error(' ERROR: reading in variable: '// trim(per_stream%fldlist_stream(nf)), rc=rc) + return end if if (handlefill) then ! Single point streams are not allowed to have missing values if (stream%mapalgo == 'none' .and. any(data_real1d == fillvalue_r4)) then write(errmsg,*) ' ERROR: _Fillvalue found in stream input variable: '// trim(per_stream%fldlist_stream(nf)) if(sdat%mainproc) write(sdat%stream(1)%logunit,*) trim(errmsg) - call shr_sys_abort(errmsg) + call shr_log_error(errmsg, rc=rc) + return endif do n=1,size(dataptr1d) @@ -1712,14 +1732,16 @@ subroutine shr_strdata_readstrm(sdat, per_stream, stream, fldbun_data, & rcode = pio_get_var(pioid, varid,start=(/1,1,1,nt/), count=(/1,1,1,1/), ival=data_dbl2d) end if if ( rcode /= PIO_NOERR ) then - call shr_sys_abort(' ERROR: reading in 2d double variable: '// trim(per_stream%fldlist_stream(nf))) + rc = rcode + call shr_log_error(' ERROR: reading in 2d double variable: '// trim(per_stream%fldlist_stream(nf)), rc=rc) + return end if if (handlefill) then ! Single point streams are not allowed to have missing values if (stream%mapalgo == 'none' .and. any(data_dbl2d == fillvalue_r8)) then write(errmsg,*) ' ERROR: _Fillvalue found in stream input variable: '// trim(per_stream%fldlist_stream(nf)) - if(sdat%mainproc) write(sdat%stream(1)%logunit,*) trim(errmsg) - call shr_sys_abort(errmsg) + call shr_log_error(errmsg, rc=rc) + return endif do lev = 1,stream_nlev do n = 1,size(dataptr2d, dim=2) @@ -1744,14 +1766,16 @@ subroutine shr_strdata_readstrm(sdat, per_stream, stream, fldbun_data, & rcode = pio_get_var(pioid, varid,start=(/1,1,nt/), count=(/1,1,1/), ival=data_dbl1d) endif if ( rcode /= PIO_NOERR ) then - call shr_sys_abort(' ERROR: reading in variable: '// trim(per_stream%fldlist_stream(nf))) + rc = rcode + call shr_log_error(' ERROR: reading in variable: '// trim(per_stream%fldlist_stream(nf)), rc=rc) + return end if if (handlefill) then ! Single point streams are not allowed to have missing values if (stream%mapalgo == 'none' .and. any(data_dbl1d == fillvalue_r8)) then write(errmsg,*) ' ERROR: _Fillvalue found in stream input variable: '// trim(per_stream%fldlist_stream(nf)) - if(sdat%mainproc) write(sdat%stream(1)%logunit,*) trim(errmsg) - call shr_sys_abort(errmsg) + call shr_log_error(errmsg, rc=rc) + return endif do n = 1,size(dataptr1d) if (.not. shr_infnan_isnan(data_dbl1d(n)) .and. data_dbl1d(n) .ne. fillvalue_r8) then @@ -1778,7 +1802,9 @@ subroutine shr_strdata_readstrm(sdat, per_stream, stream, fldbun_data, & rcode = pio_get_var(pioid, varid,start=(/1,1,1,nt/), count=(/1,1,1,1/), ival=data_short2d) end if if ( rcode /= PIO_NOERR ) then - call shr_sys_abort(' ERROR: reading in 2d short variable: '// trim(per_stream%fldlist_stream(nf))) + rc = rcode + call shr_log_error(' ERROR: reading in 2d short variable: '// trim(per_stream%fldlist_stream(nf)), rc=rc) + return end if if (handlefill) then do lev = 1,stream_nlev @@ -1804,7 +1830,9 @@ subroutine shr_strdata_readstrm(sdat, per_stream, stream, fldbun_data, & rcode = pio_get_var(pioid, varid,start=(/1,1,nt/),count=(/1,1,1/), ival=data_short1d) endif if ( rcode /= PIO_NOERR ) then - call shr_sys_abort(' ERROR: reading in variable: '// trim(per_stream%fldlist_stream(nf))) + rc = rcode + call shr_log_error(' ERROR: reading in variable: '// trim(per_stream%fldlist_stream(nf)), rc=rc) + return end if if (handlefill) then do n=1,lsize @@ -1825,7 +1853,8 @@ subroutine shr_strdata_readstrm(sdat, per_stream, stream, fldbun_data, & ! ----------------------------- ! pio_iovartype is not supported ! ----------------------------- - call shr_sys_abort(subName//"ERROR: only double, real and short types are supported for stream read") + call shr_log_error(subName//"ERROR: only double, real and short types are supported for stream read", rc=rc) + return end if @@ -1881,7 +1910,8 @@ subroutine shr_strdata_readstrm(sdat, per_stream, stream, fldbun_data, & if (chkerr(rc,__LINE__,u_FILE_u)) return if (.not. ESMF_FieldIsCreated(per_stream%field_stream_vector)) then - call shr_sys_abort('ERROR: per_stream%field_stream_vector has not been created') + call shr_log_error('ERROR: per_stream%field_stream_vector has not been created', rc=rc) + return end if call ESMF_FieldRegrid(per_stream%field_stream_vector, field_vector_dst, per_stream%routehandle, & @@ -2052,12 +2082,14 @@ subroutine shr_strdata_set_stream_iodesc(sdat, per_stream, fldname, pioid, rc) per_stream%stream_pio_iodesc) else write(6,*)'ERROR: dimlens= ',dimlens - call shr_sys_abort(trim(subname)//' dimlens = 4 assumes a time dimension') + call shr_log_error(trim(subname)//' dimlens = 4 assumes a time dimension', rc=rc) + return end if else write(6,*)'ERROR: dimlens= ',dimlens - call shr_sys_abort(trim(subname)//' only ndims of 2 and 3 and 4 are currently supported') + call shr_log_error(trim(subname)//' only ndims of 2 and 3 and 4 are currently supported', rc=rc) + return end if ! deallocate memory