Skip to content

Commit

Permalink
Merge pull request #544 from hertneky/fix_area
Browse files Browse the repository at this point in the history
Fix area logic in SCM
  • Loading branch information
scrasmussen authored Dec 12, 2024
2 parents 1b9f8d8 + 3babd21 commit b4bf28a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion scm/src/scm_input.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1882,6 +1882,7 @@ subroutine get_case_init_DEPHY(scm_state, scm_input)
scm_state%runtime = elapsed_sec*scm_state%runtime_mult
end if

scm_input%input_area = input_area(active_init_time)
scm_input%input_time = input_time
scm_input%input_pres_surf(1) = input_pres_surf(active_init_time) !perhaps input_pres_surf should only be equal to input_force_pres_surf?
scm_input%input_pres = input_pres(:,active_init_time)
Expand Down Expand Up @@ -2067,7 +2068,6 @@ subroutine get_case_init_DEPHY(scm_state, scm_input)

if (trim(input_surfaceForcingLSM) == "lsm") then
scm_input%input_ozone = input_ozone(:,active_init_time)
scm_input%input_area = input_area(active_init_time)

scm_input%input_stddev = input_stddev(active_init_time)
scm_input%input_convexity= input_convexity(active_init_time)
Expand Down
7 changes: 5 additions & 2 deletions scm/src/scm_setup.F90
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ subroutine set_state(scm_input, scm_reference, scm_state)
scm_state%lat(i) = scm_input%input_lat*deg_to_rad_const
end do


do i=1, scm_state%n_cols
if (scm_state%area(i) == 0) then
scm_state%area(i) = scm_input%input_area
end if
end do

!> - \todo When patching in a reference sounding, need to handle the case when the reference sounding is too short; patch_in_ref
!! checks for the case, but as of now, it just extrapolates where it needs to and returns an error code; error should be handled
Expand Down Expand Up @@ -160,7 +164,6 @@ subroutine set_state(scm_input, scm_reference, scm_state)
scm_state%state_T(i,:,1) = scm_input%input_temp(:)
scm_state%state_tracer(i,:,scm_state%water_vapor_index,1)=scm_input%input_qt
scm_state%state_tracer(i,:,scm_state%ozone_index,1)=scm_input%input_ozone
scm_state%area(i) = scm_input%input_area

if (scm_input%input_pres_i(1).GT. 0.0) then ! pressure are read in, overwrite values
scm_state%pres_i(i,:)=scm_input%input_pres_i
Expand Down

0 comments on commit b4bf28a

Please sign in to comment.