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

Updates for changes to oslo aero to bring in noresm2_3_develop changes #8

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
46 changes: 18 additions & 28 deletions control/camsrfexch.F90
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ module camsrfexch
active_Fall_flxdst1, active_Fall_flxvoc, active_Fall_flxfire, &
active_Faxa_nhx, active_Faxa_noy



implicit none
private

Expand All @@ -27,7 +25,7 @@ module camsrfexch
public atm2hub_deallocate
public hub2atm_deallocate
public cam_export
public cam_export_uv !+tht
public cam_export_uv

! Public data types
public cam_out_t ! Data from atmosphere
Expand All @@ -45,10 +43,8 @@ module camsrfexch
real(r8) :: topo(pcols) ! surface topographic height (m)
real(r8) :: ubot(pcols) ! bot level u wind
real(r8) :: vbot(pcols) ! bot level v wind
!+tht
real(r8) :: uold(pcols) ! prev. tstp bot level u wind
real(r8) :: vold(pcols) ! prev. tstp bot level v wind
!-tht
real(r8) :: qbot(pcols,pcnst) ! bot level specific humidity
real(r8) :: pbot(pcols) ! bot level pressure
real(r8) :: rho(pcols) ! bot level density
Expand Down Expand Up @@ -497,8 +493,6 @@ subroutine cam_export(state,cam_out,pbuf)
cam_out%thbot(i) = state%t(i,pver) * state%exner(i,pver)
cam_out%zbot(i) = state%zm(i,pver)
cam_out%topo(i) = state%phis(i) / gravit
! cam_out%ubot(i) = state%u(i,pver) !tht c'd out
! cam_out%vbot(i) = state%v(i,pver) !tht c'd out
cam_out%pbot(i) = state%pmid(i,pver)
cam_out%psl(i) = psl(i)
cam_out%rho(i) = cam_out%pbot(i)/(rair*cam_out%tbot(i))
Expand Down Expand Up @@ -577,7 +571,6 @@ subroutine cam_export(state,cam_out,pbuf)

end subroutine cam_export

!+tht
subroutine cam_export_uv(state,cam_out,pbuf)

! Transfer atmospheric fields into necessary surface data structures
Expand All @@ -599,17 +592,14 @@ subroutine cam_export_uv(state,cam_out,pbuf)
type(physics_buffer_desc), pointer :: pbuf(:)

! Local variables

integer :: i ! Longitude index
integer :: m ! constituent index
integer :: lchnk ! Chunk index
integer :: ncol
integer :: psl_idx
integer :: prec_dp_idx, snow_dp_idx, prec_sh_idx, snow_sh_idx
integer :: prec_sed_idx,snow_sed_idx,prec_pcw_idx,snow_pcw_idx

real(r8), pointer :: psl(:)

logical, save :: first_call=.true.
integer, save :: ncall
!-----------------------------------------------------------------------
Expand All @@ -621,24 +611,24 @@ subroutine cam_export_uv(state,cam_out,pbuf)
call pbuf_get_field(pbuf, psl_idx, psl)

if (first_call) then
ncall=1
!print*,'CAMSRFEXCH first call'
do i=1,ncol
cam_out%uold(i) = state%u(i,pver)
cam_out%vold(i) = state%v(i,pver)
cam_out%ubot(i) = state%u(i,pver)
cam_out%vbot(i) = state%v(i,pver)
end do
first_call=.false.
ncall=1
!print*,'CAMSRFEXCH first call'
do i=1,ncol
cam_out%uold(i) = state%u(i,pver)
cam_out%vold(i) = state%v(i,pver)
cam_out%ubot(i) = state%u(i,pver)
cam_out%vbot(i) = state%v(i,pver)
end do
first_call=.false.
else
ncall=ncall+1
!print*,'CAMSRFEXCH call number ',ncall
do i=1,ncol
cam_out%uold(i) = cam_out%ubot(i)
cam_out%vold(i) = cam_out%vbot(i)
cam_out%ubot(i) = state%u(i,pver)
cam_out%vbot(i) = state%v(i,pver)
end do
ncall=ncall+1
!print*,'CAMSRFEXCH call number ',ncall
do i=1,ncol
cam_out%uold(i) = cam_out%ubot(i)
cam_out%vold(i) = cam_out%vbot(i)
cam_out%ubot(i) = state%u(i,pver)
cam_out%vbot(i) = state%v(i,pver)
end do
endif

end subroutine cam_export_uv
Expand Down
696 changes: 347 additions & 349 deletions physics/cam_diagnostics.F90

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions physics/oslo_aero_microp.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
module oslo_aero_microp

! Module to replace the need for OSLO_AERO ifdef in NorESM physics

implicit none
public

contains

subroutine oslo_aero_microp_register()
end subroutine oslo_aero_microp_register

subroutine oslo_aero_microp_init()
end subroutine oslo_aero_microp_init

subroutine oslo_aero_microp_run (state, ptend_all, deltatin, pbuf)
use shr_kind_mod, only: r8=>shr_kind_r8
use physics_types, only: physics_state, physics_ptend
use physics_buffer, only: physics_buffer_desc

type(physics_state), intent(in) :: state
type(physics_ptend), intent(out) :: ptend_all
real(r8), intent(in) :: deltatin
type(physics_buffer_desc), pointer :: pbuf(:)
end subroutine oslo_aero_microp_run

end module oslo_aero_microp
19 changes: 19 additions & 0 deletions physics/oslo_aero_ocean.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module oslo_aero_ocean

! Module to replace the need for OSLO_AERO ifdef in NorESM physics

implicit none
public

contains

subroutine oslo_aero_ocean_adv(state, pbuf2d)
use ppgrid, only : begchunk, endchunk
use physics_types, only : physics_state
use physics_buffer, only : physics_buffer_desc

type(physics_state), intent(in) :: state(begchunk:endchunk)
type(physics_buffer_desc), pointer :: pbuf2d(:,:)
end subroutine oslo_aero_ocean_adv

end module oslo_aero_ocean
11 changes: 11 additions & 0 deletions physics/oslo_aero_share.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module oslo_aero_share

! Module to replace the need for OSLO_AERO ifdef in NorESM physics

implicit none
public

integer :: nbmodes = 0
logical :: use_oslo_aero = .false.

end module oslo_aero_share
12 changes: 6 additions & 6 deletions physics/phys_control.F90
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ module phys_control
! Option for Harmonized Emissions Component (HEMCO)
logical, public, protected :: use_hemco = .false.

!tht: energy adjustment in dry mass adjustment
! energy adjustment in dry mass adjustment
logical, public, protected :: dme_energy_adjust = .false.

! CAM snapshot before/after file numbers and control
Expand Down Expand Up @@ -139,7 +139,7 @@ subroutine phys_ctl_readnl(nlfile)
history_cesm_forcing, history_scwaccm_forcing, history_chemspecies_srf, &
do_clubb_sgs, state_debug_checks, use_hetfrz_classnuc, use_gw_oro, use_gw_front, &
use_gw_front_igw, use_gw_convect_dp, use_gw_convect_sh, cld_macmic_num_steps, &
dme_energy_adjust, & !+tht
dme_energy_adjust, &
offline_driver, convproc_do_aer, cam_snapshot_before_num, cam_snapshot_after_num, &
cam_take_snapshot_before, cam_take_snapshot_after, cam_physics_mesh, use_hemco
!-----------------------------------------------------------------------------
Expand Down Expand Up @@ -197,7 +197,7 @@ subroutine phys_ctl_readnl(nlfile)
call mpi_bcast(use_gw_convect_dp, 1, mpi_logical, masterprocid, mpicom, ierr)
call mpi_bcast(use_gw_convect_sh, 1, mpi_logical, masterprocid, mpicom, ierr)
call mpi_bcast(cld_macmic_num_steps, 1, mpi_integer, masterprocid, mpicom, ierr)
call mpi_bcast(dme_energy_adjust, 1, mpi_logical, masterprocid, mpicom, ierr) !+tht
call mpi_bcast(dme_energy_adjust, 1, mpi_logical, masterprocid, mpicom, ierr)
call mpi_bcast(offline_driver, 1, mpi_logical, masterprocid, mpicom, ierr)
call mpi_bcast(convproc_do_aer, 1, mpi_logical, masterprocid, mpicom, ierr)
call mpi_bcast(cam_snapshot_before_num, 1, mpi_integer, masterprocid, mpicom, ierr)
Expand Down Expand Up @@ -320,7 +320,7 @@ subroutine phys_getopts(deep_scheme_out, shallow_scheme_out, eddy_scheme_out, mi
history_cesm_forcing_out, history_scwaccm_forcing_out, history_chemspecies_srf_out, &
cam_chempkg_out, prog_modal_aero_out, macrop_scheme_out, &
do_clubb_sgs_out, use_spcam_out, state_debug_checks_out, cld_macmic_num_steps_out, &
dme_energy_adjust_out, & !+tht
dme_energy_adjust_out, &
offline_driver_out, convproc_do_aer_out, cam_snapshot_before_num_out, cam_snapshot_after_num_out,&
cam_take_snapshot_before_out, cam_take_snapshot_after_out, physics_grid_out)
!-----------------------------------------------------------------------
Expand Down Expand Up @@ -363,7 +363,7 @@ subroutine phys_getopts(deep_scheme_out, shallow_scheme_out, eddy_scheme_out, mi
logical, intent(out), optional :: prog_modal_aero_out
logical, intent(out), optional :: state_debug_checks_out
integer, intent(out), optional :: cld_macmic_num_steps_out
logical, intent(out), optional :: dme_energy_adjust_out !+tht
logical, intent(out), optional :: dme_energy_adjust_out
logical, intent(out), optional :: offline_driver_out
logical, intent(out), optional :: convproc_do_aer_out
integer, intent(out), optional :: cam_snapshot_before_num_out
Expand Down Expand Up @@ -403,7 +403,7 @@ subroutine phys_getopts(deep_scheme_out, shallow_scheme_out, eddy_scheme_out, mi
if ( present(prog_modal_aero_out ) ) prog_modal_aero_out = prog_modal_aero
if ( present(state_debug_checks_out ) ) state_debug_checks_out = state_debug_checks
if ( present(cld_macmic_num_steps_out) ) cld_macmic_num_steps_out = cld_macmic_num_steps
if ( present(dme_energy_adjust_out ) ) dme_energy_adjust_out = dme_energy_adjust !+tht
if ( present(dme_energy_adjust_out ) ) dme_energy_adjust_out = dme_energy_adjust
if ( present(offline_driver_out ) ) offline_driver_out = offline_driver
if ( present(convproc_do_aer_out ) ) convproc_do_aer_out = convproc_do_aer
if ( present(cam_snapshot_before_num_out ) ) cam_snapshot_before_num_out = cam_snapshot_before_num
Expand Down
Loading