Skip to content

Commit

Permalink
Merge pull request #35 from mvertens/feature/new_aerocom_namelist
Browse files Browse the repository at this point in the history
remove AEROCOM as a cpp variable - and introduce a new namelist to turn it on

- add a new file oslo_aero_diagnostics.F90 that activates oslo_aero (and aercom namelists) and is called from cam_diagnostics.F90. This makes it much easier to modularize where the oslo-aero diagnostics fields are defined.

- verified that running SMS_Ln9.ne30pg3_ne30pg3_mtn14.NF1850.derecho_intel.cam-outfrq9s with use_aerocom=.false. have bfb the same history files
- verified that running SMS_Ln9.ne30pg3_ne30pg3_mtn14.NF1850.derecho_intel.cam-outfrq9s with use_aerocom=.true. added the aerocom variables.
- A question about the new aerocom output appears in
Diagnostic changes with AEROCOM noresm_simulations (NorESMhub/noresm3_dev_simulations#33)

NOTE: this PR must also be accompanied my PRs to https://github.com/NorESMhub/CAM and to https://github.com/NorESMhub/CAM-Nor-physics
  • Loading branch information
gold2718 authored Aug 28, 2024
2 parents ba624de + 986424b commit 87f76b3
Show file tree
Hide file tree
Showing 6 changed files with 3,469 additions and 73 deletions.
10 changes: 5 additions & 5 deletions src/aero_model.F90
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ module aero_model
use oslo_aero_share, only: lifeCycleNumberMedianRadius, rhopart, lifeCycleSigma
use oslo_aero_share, only: l_so4_a2, l_bc_n, l_bc_ax
use oslo_aero_share, only: MODE_IDX_BC_NUC, MODE_IDX_BC_EXT_AC
use oslo_aero_control, only: oslo_aero_ctl_readnl
use oslo_aero_control, only: oslo_aero_ctl_readnl, use_aerocom
use oslo_aero_depos, only: oslo_aero_depos_init
use oslo_aero_depos, only: oslo_aero_depos_dry, oslo_aero_depos_wet, oslo_aero_wetdep_init
use oslo_aero_coag, only: initializeCoagulation, coagtend, clcoag
Expand Down Expand Up @@ -153,10 +153,10 @@ subroutine aero_model_init( pbuf2d )
call init_interp_constants() ! table initialization constants
call initopt() ! table initialization
call initlogn() ! table initialization
#ifdef AEROCOM
call initdry() ! table initialization
call initaeropt() ! table initialization
#endif
if (use_aerocom) then
call initdry() ! table initialization
call initaeropt() ! table initialization
end if
call initializeCondensation()
call oslo_aero_ocean_init()
call oslo_aero_depos_init(pbuf2d)
Expand Down
13 changes: 10 additions & 3 deletions src/oslo_aero_control.F90
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ module oslo_aero_control
integer, parameter :: unset_int = huge(1)
integer, parameter, public :: dir_string_length=256

! Namelist variables:
real(r8) :: volc_fraction_coarse = 0.0_r8 !Fraction of volcanic aerosols in coarse mode
! Public Namelist variables:
logical, public, protected :: use_aerocom = .false. ! If true, turn on aerocom output

! Private Namelist variables:
real(r8) :: volc_fraction_coarse = 0.0_r8 !Fraction of volcanic aerosols in coarse mode
character(len=dir_string_length) :: aerotab_table_dir = unset_str

! DMS/Ocean namelist variables
Expand Down Expand Up @@ -53,7 +56,8 @@ subroutine oslo_aero_ctl_readnl(nlfile)

namelist /oslo_ctl_nl/ volc_fraction_coarse, aerotab_table_dir, dms_source, &
dms_source_type, opom_source, opom_source_type, &
ocean_filename, ocean_filepath, dms_cycle_year, opom_cycle_year
ocean_filename, ocean_filepath, dms_cycle_year, opom_cycle_year, &
use_aerocom
!-----------------------------------------------------------------------------

if (masterproc) then
Expand All @@ -69,6 +73,9 @@ subroutine oslo_aero_ctl_readnl(nlfile)
end if

! Broadcast namelist variables
call mpi_bcast(use_aerocom, 1 , mpi_logical, mstrid, mpicom, ierr)
if (ierr /= mpi_success) call endrun(subname//" mpi_bcast: volc_fraction_coarse")

call mpi_bcast(volc_fraction_coarse, 1 , mpi_real8, mstrid, mpicom, ierr)
if (ierr /= mpi_success) call endrun(subname//" mpi_bcast: volc_fraction_coarse")
call mpi_bcast(aerotab_table_dir, len(aerotab_table_dir) , mpi_character, mstrid, mpicom, ierr)
Expand Down
Loading

0 comments on commit 87f76b3

Please sign in to comment.