Skip to content

Commit

Permalink
more clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards4b committed Jan 31, 2025
1 parent 0fabc2e commit a884335
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
7 changes: 4 additions & 3 deletions cesm/flux_atmocn/shr_flux_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ module shr_flux_mod
! !USES:

use shr_kind_mod, only : R8=>SHR_KIND_R8, IN=>SHR_KIND_IN ! shared kinds
use shr_const_mod ! shared constants
use shr_sys_mod ! shared system routines

use shr_const_mod, only : shr_const_zvir, shr_const_cpdair, shr_const_cpvir, shr_const_karman, shr_const_g ! shared constants
use shr_const_mod, only : shr_const_latvap, shr_const_latice, shr_const_stebol, shr_const_tkfrz, shr_const_pi, shr_const_spval
use shr_const_mod, only : shr_const_ocn_ref_sal, shr_const_zsrflyr, shr_const_rgas
use shr_sys_mod, only : shr_sys_abort ! shared system routines
implicit none

private ! default private
Expand Down
30 changes: 15 additions & 15 deletions cesm/nuopc_cap_share/shr_drydep_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ subroutine shr_drydep_readnl(NLFilename, drydep_nflds)
! Note that ierr /= 0, no namelist is present.
read(unitn, drydep_inparm, iostat=ierr)
if (ierr > 0) then
call shr_sys_abort( 'problem on read of drydep_inparm namelist in shr_drydep_readnl')
call shr_sys_abort( 'problem on read of drydep_inparm namelist in shr_drydep_readnl', rc=ierr)
end if
endif
close( unitn )
Expand Down Expand Up @@ -374,19 +374,19 @@ subroutine shr_drydep_init( )

if (localPet==0) then
rc = nf90_open(path=trim(dep_data_file), mode=nf90_nowrite, ncid=fileid)
if (rc/=nf90_noerr) call shr_sys_abort(subName//' ERROR: not able to open file: '//trim(dep_data_file))
if (rc/=nf90_noerr) call shr_sys_abort(subName//' ERROR: not able to open file: '//trim(dep_data_file), rc=rc)

rc = nf90_inq_dimid(fileid,'n_species_table',dimid)
if (rc/=nf90_noerr) call shr_sys_abort(subName//' ERROR: nf90_inq_dimid n_species_table')
if (rc/=nf90_noerr) call shr_sys_abort(subName//' ERROR: nf90_inq_dimid n_species_table', rc=rc)

rc = nf90_inquire_dimension(fileid,dimid,len=bint(1))
if (rc/=nf90_noerr) call shr_sys_abort(subName//' ERROR: nf90_inquire_dimension n_species_table')
if (rc/=nf90_noerr) call shr_sys_abort(subName//' ERROR: nf90_inquire_dimension n_species_table', rc=rc)

rc = nf90_inq_dimid(fileid,'NHen',dimid)
if (rc/=nf90_noerr) call shr_sys_abort(subName//' ERROR: nf90_inq_dimid NHen')
if (rc/=nf90_noerr) call shr_sys_abort(subName//' ERROR: nf90_inq_dimid NHen', rc=rc)

rc = nf90_inquire_dimension(fileid,dimid,len=bint(2))
if (rc/=nf90_noerr) call shr_sys_abort(subName//' ERROR: nf90_inquire_dimension nHen')
if (rc/=nf90_noerr) call shr_sys_abort(subName//' ERROR: nf90_inquire_dimension nHen', rc=rc)
endif
write(msg,*) subname//' bcast n_species_table', localPet, bint
call ESMF_LogWrite(msg, ESMF_LOGMSG_INFO)
Expand All @@ -404,27 +404,27 @@ subroutine shr_drydep_init( )
dptr => dheff(:,1)
if (localPet==0) then
rc = nf90_inq_varid(fileid,'mol_wghts',varid)
if (rc/=nf90_noerr) call shr_sys_abort(subName//' ERROR: nf90_inq_varid mol_wghts')
if (rc/=nf90_noerr) call shr_sys_abort(subName//' ERROR: nf90_inq_varid mol_wghts', rc=rc)
rc = nf90_get_var(fileid,varid,mol_wgts)
if (rc/=nf90_noerr) call shr_sys_abort(subName//' ERROR: nf90_get_var mol_wgts')
if (rc/=nf90_noerr) call shr_sys_abort(subName//' ERROR: nf90_get_var mol_wgts', rc=rc)

rc = nf90_inq_varid(fileid,'dfoxd',varid)
if (rc/=nf90_noerr) call shr_sys_abort(subName//' ERROR: nf90_inq_varid dfoxd')
if (rc/=nf90_noerr) call shr_sys_abort(subName//' ERROR: nf90_inq_varid dfoxd', rc=rc)
rc = nf90_get_var(fileid,varid,dfoxd)
if (rc/=nf90_noerr) call shr_sys_abort(subName//' ERROR: nf90_get_var dfoxd')
if (rc/=nf90_noerr) call shr_sys_abort(subName//' ERROR: nf90_get_var dfoxd', rc=rc)

rc = nf90_inq_varid(fileid,'species_name_table',varid)
if (rc/=nf90_noerr) call shr_sys_abort(subName//' ERROR: nf90_inq_varid species_name_table')
if (rc/=nf90_noerr) call shr_sys_abort(subName//' ERROR: nf90_inq_varid species_name_table', rc=rc)
rc = nf90_get_var(fileid,varid,species_name_table)
if (rc/=nf90_noerr) call shr_sys_abort(subName//' ERROR: nf90_get_var species_name_table')
if (rc/=nf90_noerr) call shr_sys_abort(subName//' ERROR: nf90_get_var species_name_table', rc=rc)

rc = nf90_inq_varid(fileid,'dheff',varid)
if (rc/=nf90_noerr) call shr_sys_abort(subName//' ERROR: nf90_inq_varid dheff')
if (rc/=nf90_noerr) call shr_sys_abort(subName//' ERROR: nf90_inq_varid dheff', rc=rc)
rc = nf90_get_var(fileid,varid,dheff)
if (rc/=nf90_noerr) call shr_sys_abort(subName//' ERROR: nf90_get_var dheff')
if (rc/=nf90_noerr) call shr_sys_abort(subName//' ERROR: nf90_get_var dheff', rc=rc)

rc = nf90_close(fileid)
if (rc/=nf90_noerr) call shr_sys_abort(subName//' ERROR: nf90_close')
if (rc/=nf90_noerr) call shr_sys_abort(subName//' ERROR: nf90_close', rc=rc)
end if
call ESMF_LogWrite(subname//' bcast mol_wgts', ESMF_LOGMSG_INFO)
call ESMF_VMBroadcast(vm, mol_wgts, n_species_table, 0, rc=rc )
Expand Down

0 comments on commit a884335

Please sign in to comment.