Skip to content

Commit

Permalink
Merge pull request #172 from nmizukami/cesm-coupling
Browse files Browse the repository at this point in the history
pfafstetter code handling
  • Loading branch information
nmizukami authored Feb 10, 2021
2 parents 6845bd6 + 9cd7ed2 commit 2be8dec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions route/build/src/init_model_data.f90
Original file line number Diff line number Diff line change
Expand Up @@ -455,12 +455,14 @@ SUBROUTINE init_ntopo(nHRU_out, nRch_out,

! get the variable dimensions
! NOTE: need to update maxPfafLen to the exact character size for pfaf code in netCDF
call get_var_dims(trim(ancil_dir)//trim(fname_ntopOld), & ! input: file name
trim(meta_PFAF(ixPFAF%code)%varName), & ! input: pfaf code variable name in netcdf
ierr, cmessage, & ! output: error control
dlen=dummy) ! output optional: dimension length
if(ierr/=0)then; message=trim(message)//trim(cmessage); return; endif
maxPfafLen = dummy(1)
if (meta_PFAF(ixPFAF%code)%varFile) then
call get_var_dims(trim(ancil_dir)//trim(fname_ntopOld), & ! input: file name
trim(meta_PFAF(ixPFAF%code)%varName), & ! input: pfaf code variable name in netcdf
ierr, cmessage, & ! output: error control
dlen=dummy) ! output optional: dimension length
if(ierr/=0)then; message=trim(message)//trim(cmessage); return; endif
maxPfafLen = dummy(1)
end if

call getData(&
! input
Expand Down
2 changes: 1 addition & 1 deletion route/build/src/popMetadat.f90
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ subroutine popMetadat(err,message)
meta_NTOPO (ixNTOPO%goodBasin ) = var_info('goodBasin' , 'flag to define a good basin (1=true)' ,'-' ,ixDims%upSeg , .false.)

! PFAF CODE varName varDesc varUnit, varType, varFile
meta_PFAF (ixPFAF%code ) = var_info('code' , 'pfafstetter code' ,'-' ,ixDims%seg , .true.)
meta_PFAF (ixPFAF%code ) = var_info('code' , 'pfafstetter code' ,'-' ,ixDims%seg , .false.)

! ---------- populate segment fluxes/states metadata structures -----------------------------------------------------------------------------------------------------
! Reach Flux varName varDesc unit, varType, varDim, writeOut
Expand Down

0 comments on commit 2be8dec

Please sign in to comment.