Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix area logic in SCM #544

Merged
merged 2 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading