Skip to content

Commit

Permalink
make unit-tests happy
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdebolskiy committed Jul 23, 2024
1 parent dbf0099 commit 811659f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
9 changes: 7 additions & 2 deletions src/biogeophys/TemperatureType.F90
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,15 @@ subroutine Init(this, bounds, &
logical , intent(in) :: is_simple_buildtemp ! Simple building temp is being used
logical , intent(in) :: is_prog_buildtemp ! Prognostic building temp is being used
real(r8) , intent(in) :: exice_init_conc_col(bounds%begc:) ! initial coldstart excess ice concentration (from the stream file)
character(len=*) , intent(in) :: NLFilename ! Namelist filename
character(len=*) , intent(in), optional :: NLFilename ! Namelist filename


call this%ReadNL(NLFilename)
if ( present(NLFilename) ) then
call this%ReadNL(NLFilename)
else ! this is needed for testing
this%excess_ice_coldstart_depth = 0.5_r8
this%excess_ice_coldstart_temp = -5.0_r8
endif
call this%InitAllocate ( bounds )
call this%InitHistory ( bounds, is_simple_buildtemp, is_prog_buildtemp )
call this%InitCold ( bounds, &
Expand Down
6 changes: 5 additions & 1 deletion src/unit_test_shr/unittestDustEmisInputs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ subroutine setUp(this)

character(len=5) :: NLFilename = 'none'
real(r8), allocatable :: urb_em(:)
real(r8), allocatable :: exice_init_conc_col(:)
integer :: begl, endl, begc, endc
integer :: c
type(atm2lnd_params_type) :: atm2lnd_params
Expand Down Expand Up @@ -91,12 +92,15 @@ subroutine setUp(this)
call this%frictionvel_inst%InitForTesting(bounds)
allocate( urb_em(begl:endl) )
urb_em(begl:endl) = 0.99_r8 ! Arbitrary won't matter here
allocate( exice_init_conc_col(begc:endc) )
exice_init_conc_col(begc:endc) = 0.0_r8 ! zero, so it doesn't affect anything.
call this%temperature_inst%Init(bounds, &
em_roof_lun=urb_em(begl:endl), &
em_wall_lun=urb_em(begl:endl), &
em_improad_lun=urb_em(begl:endl), &
em_perroad_lun=urb_em(begl:endl), &
is_simple_buildtemp=.true., is_prog_buildtemp=.false.)
is_simple_buildtemp=.true., is_prog_buildtemp=.false., &
exice_init_conc_col = exice_init_conc_col(begc:endc))
deallocate( urb_em )
end subroutine setUp

Expand Down
6 changes: 3 additions & 3 deletions src/unit_test_shr/unittestWaterTypeFactory.F90
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ subroutine create_water_type(this, water_inst, &
end if

if (present(exice_init_conc_col)) then
SHR_ASSERT_ALL_FL((ubound(exice_init_conc_col,1) == bounds%enc), sourcefile, __LINE__)
SHR_ASSERT_ALL_FL((ubound(exice_init_conc_col,1) == bounds%endc), sourcefile, __LINE__)
endif

if (present(enable_consistency_checks)) then
Expand Down Expand Up @@ -177,9 +177,9 @@ subroutine create_water_type(this, water_inst, &
l_exice_coldstart_depth = 0.5_r8
endif
if (present(exice_init_conc_col)) then
l_exice_init_conc_col(:,:) = exice_init_conc_col
l_exice_init_conc_col(:) = exice_init_conc_col
else
l_exice_init_conc_col(:,:) = 0.01_r8
l_exice_init_conc_col(:) = 0.0_r8
endif

call water_inst%InitForTesting(bounds, params, &
Expand Down

0 comments on commit 811659f

Please sign in to comment.