Skip to content

Commit

Permalink
Change name of the subroutine for the surface dataset compatibility c…
Browse files Browse the repository at this point in the history
…heck, fix version guessing inside it, fix spelling error, respond to rest of the review conversations
  • Loading branch information
ekluzek committed Sep 5, 2024
1 parent 703c291 commit 0fd3d41
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/main/clm_initializeMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ subroutine initialize1(dtime)
use clm_varcon , only: clm_varcon_init
use landunit_varcon , only: landunit_varcon_init
use clm_varctl , only: fsurdat, version
use surfrdMod , only: surfrd_get_num_patches, surfrd_get_nlevurb, surfrd_check_file
use surfrdMod , only: surfrd_get_num_patches, surfrd_get_nlevurb, surfrd_compat_check
use controlMod , only: control_init, control_print, NLFilename
use ncdio_pio , only: ncd_pio_init
use initGridCellsMod , only: initGridCells
Expand Down Expand Up @@ -100,7 +100,7 @@ subroutine initialize1(dtime)

call control_init(dtime)
call ncd_pio_init()
call surfrd_check_file(fsurdat)
call surfrd_compat_check(fsurdat)
call surfrd_get_num_patches(fsurdat, actual_maxsoil_patches, actual_numpft, actual_numcft)
call surfrd_get_nlevurb(fsurdat, actual_nlevurb)

Expand Down
14 changes: 7 additions & 7 deletions src/main/surfrdMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module surfrdMod
save
!
! !PUBLIC MEMBER FUNCTIONS:
public :: surfrd_check_file ! Check that this surface dataset is compatible
public :: surfrd_compat_check ! Check that this surface dataset is compatible
public :: surfrd_get_data ! Read surface dataset and determine subgrid weights
public :: surfrd_get_num_patches ! Read surface dataset to determine maxsoil_patches and numcft
public :: surfrd_get_nlevurb ! Read surface dataset to determine nlevurb
Expand All @@ -47,7 +47,7 @@ module surfrdMod
contains

!-----------------------------------------------------------------------
subroutine surfrd_check_file ( lfsurdat )
subroutine surfrd_compat_check ( lfsurdat )
!
! !DESCRIPTION:
! Check compatability for this surface dataset and abort with an error if it's not
Expand Down Expand Up @@ -77,11 +77,11 @@ subroutine surfrd_check_file ( lfsurdat )
if (exists) then
version = 5.2_r4
else
call check_var( ncid, 'PCT_CFT', exists)
call check_var( ncid, 'CONST_HARVEST_SH1', exists)
if (exists) then
version = 5.0_r4
else
call check_var( ncid, 'PCT_GLC_MEC_GIC', exists)
call check_var( ncid, 'GLACIER_REGION', exists)
if (exists) then
version = 4.5_r4
else
Expand All @@ -101,14 +101,14 @@ subroutine surfrd_check_file ( lfsurdat )
end if
if ( masterproc )then
write(iulog,*) 'Input surface dataset is: ', trim(lfsurdat)
write(iulog,'(3a)') 'This surface dataset is ', trim(description), ' and incompatable with this version of CTSM'
write(iulog,'(3a)') 'This surface dataset is ', trim(description), ' and incompatible with this version of CTSM'
write(iulog,'(a,f3.1,a,f3.1)') 'Dataset version = ', version, ' Version expected = ', expected_version
write(iulog,*) errMsg(sourcefile, __LINE__)
end if
call endrun(msg="ERROR: Incompatble surface dataset")
call endrun(msg="ERROR: Incompatible surface dataset")
end if

end subroutine surfrd_check_file
end subroutine surfrd_compat_check

!-----------------------------------------------------------------------
subroutine surfrd_get_data (begg, endg, ldomain, lfsurdat, actual_numcft)
Expand Down

0 comments on commit 0fd3d41

Please sign in to comment.