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

cam6_4_037: Implementation of CCPP-ized tropopause_find with compatibility with current CAM #1135

Merged
merged 25 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
867b611
Add CAM snapshots for tropopause_output
jimmielin Aug 9, 2024
ed8b69c
Initial CCPP-ization of tropopause_find, implementation in CAM
jimmielin Aug 20, 2024
26f1e2a
Fixes for compile and use correct public interface
jimmielin Aug 20, 2024
62f48ea
Revert to old tropopause_init call for compatibility
jimmielin Aug 20, 2024
ee72d90
Merge branch 'cam_development' into hplin/tropopause_find
jimmielin Aug 22, 2024
781a36d
Fix naming conflict for tropopause_find
jimmielin Aug 23, 2024
65491fb
Remove tropopause_output snapshots as unnecessary
jimmielin Aug 23, 2024
d8dc33c
Update Git submodule for CCPP-ized tropopause_find
jimmielin Aug 23, 2024
563b0ac
Add ChangeLog updates
jimmielin Aug 26, 2024
a484888
Pass fillvalue into CCPP-ized tropopause_find routine instead of rede…
nusbaume Sep 6, 2024
7900f13
Remove shim terminology from tropopause_find
jimmielin Sep 12, 2024
83e3597
Updates to address code review comments
jimmielin Sep 13, 2024
5ceb4aa
Remove unnecessary empty line
jimmielin Sep 13, 2024
53a626d
Update submodule atmos_phys to latest fork in-review
jimmielin Sep 13, 2024
830f3a6
Update comments in response to code review
jimmielin Sep 18, 2024
3cec1e3
Update comments in response to code review
jimmielin Sep 19, 2024
c695dfe
Merge branch 'cam_development' into hplin/tropopause_find
jimmielin Sep 23, 2024
a794cb3
Update atmos_phys external to 391c114
jimmielin Sep 23, 2024
ebf9516
Fix missing ncol in CAM interface
jimmielin Sep 23, 2024
95e366b
Fix GEOS-Chem build with tropopause_find
jimmielin Sep 24, 2024
6ddd06e
Update atmos_phys external and add back OPTIONAL to findWithBackup
jimmielin Sep 24, 2024
f694221
Update atmospheric_physics external
jimmielin Sep 24, 2024
5b67f95
Update atmos_phys external to atmos_phys0_05_000
jimmielin Sep 30, 2024
b227070
Merge branch 'cam_development' into hplin/tropopause_find
jimmielin Sep 30, 2024
d21b2d0
Update ChangeLog with tests for tropopause_find CAM tag
jimmielin Oct 1, 2024
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 .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
[submodule "atmos_phys"]
path = src/atmos_phys
url = https://github.com/ESCOMP/atmospheric_physics
fxtag = atmos_phys0_04_001
fxtag = atmos_phys0_05_000
fxrequired = AlwaysRequired
fxDONOTUSEurl = https://github.com/ESCOMP/atmospheric_physics

Expand Down
1 change: 1 addition & 0 deletions bld/configure
Original file line number Diff line number Diff line change
Expand Up @@ -2332,6 +2332,7 @@ sub write_filepath
print $fh "$camsrcdir/src/physics/cam\n";

#Add the CCPP'ized subdirectories
print $fh "$camsrcdir/src/atmos_phys/tropopause_find\n";
print $fh "$camsrcdir/src/atmos_phys/zhang_mcfarlane\n";
print $fh "$camsrcdir/src/atmos_phys/dry_adiabatic_adjust\n";

Expand Down
81 changes: 81 additions & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,84 @@
Tag name: cam6_4_037
Originator(s): jimmielin
Date: Sep 30, 2024
One-line Summary: Implementation of CCPP-compliant tropopause_find
Github PR URL: https://github.com/ESCOMP/CAM/pull/1135

Purpose of changes (include the issue number and title text for each relevant GitHub issue):
- CCPP-ization of tropopause_find: https://github.com/ESCOMP/CAM/issues/1121

Describe any changes made to build system: N/A

Describe any changes made to the namelist: N/A

List any changes to the defaults for the boundary datasets: N/A

Describe any substantial timing or memory changes: N/A

Code reviewed by: nusbaume, cacraigucar

List all files eliminated: N/A

List all files added and what they do: N/A

List all existing files that have been modified, and describe the changes:

Update atmos_phys external for tropopause_find (tag atmos_phys0_05_000):
M .gitmodules
M bld/configure
M src/atmos_phys

CAM interface code for compatibility with CCPP-ized tropopause_find while retaining all existing functionality b4b:
M src/physics/cam/tropopause.F90

Updates to subroutine calls for CCPP-ization, including only passing in active columns:
M src/chemistry/geoschem/chemistry.F90
M src/chemistry/mozart/chemistry.F90
M src/chemistry/utils/modal_aero_wateruptake.F90
M src/chemistry/utils/prescribed_strataero.F90
M src/chemistry/utils/prescribed_volcaero.F90
M src/physics/cam/aer_rad_props.F90
M src/physics/cam/aerosol_optics_cam.F90
M src/physics/cam/clubb_intr.F90
M src/physics/cam/micro_pumas_cam.F90
M src/physics/cam/nucleate_ice_cam.F90
M src/physics/cam/physpkg.F90
M src/physics/cam/radiation_data.F90
M src/physics/cam/rk_stratiform.F90
M src/physics/cam7/micro_pumas_cam.F90
M src/physics/cam7/physpkg.F90
M src/physics/camrt/radiation.F90
M src/physics/carma/models/meteor_impact/carma_model_mod.F90
M src/physics/carma/models/tholin/carma_model_mod.F90
M src/physics/rrtmg/radiation.F90
M src/physics/rrtmgp/radiation.F90


If there were any failures reported from running test_driver.sh on any test
platform, and checkin with these failures has been OK'd by the gatekeeper,
then copy the lines from the td.*.status files for the failed tests to the
appropriate machine below. All failed tests must be justified.

derecho/intel/aux_cam:

ERP_Ln9.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s (Overall: FAIL)
- pre-existing failure due to HEMCO not having reproducible results issues #1018 and #856
note: the SMS test for FCSD_HCO may fail b4b occasionally and was resubmitted for this tag.

SMS_D_Ln9_P1280x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.derecho_intel.cam-outfrq9s (Overall: PEND)
- pre-existing failures -- need fix in CLM external

derecho/nvhpc/aux_cam: ALL PASS

izumi/nag/aux_cam:

DAE.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL)
- pre-existing failure - issue #670

izumi/gnu/aux_cam: ALL PASS

Summarize any changes to answers: bit-for-bit

===============================================================

Tag name: cam6_4_036
Expand Down
4 changes: 2 additions & 2 deletions src/chemistry/geoschem/chemistry.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1823,7 +1823,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o )
use short_lived_species, only : get_short_lived_species_gc, set_short_lived_species_gc
use spmd_utils, only : masterproc
use time_manager, only : Get_Curr_Calday, Get_Curr_Date ! For computing SZA
use tropopause, only : Tropopause_findChemTrop, Tropopause_Find
use tropopause, only : Tropopause_findChemTrop
use wv_saturation, only : QSat
#if defined( MODAL_AERO )
use aero_model, only : aero_model_gasaerexch ! Aqueous chemistry and aerosol growth
Expand Down Expand Up @@ -2588,7 +2588,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o )
ENDDO

! Retrieve tropopause level
Trop_Lev = 0.0e+0_r8
Trop_Lev = 0
CALL Tropopause_FindChemTrop(state, Trop_Lev)
! Back out the pressure
Trop_P = 1000.0e+0_r8
Expand Down
10 changes: 7 additions & 3 deletions src/chemistry/mozart/chemistry.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1142,7 +1142,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dt, pbuf, fh2o)
use mo_gas_phase_chemdr, only : gas_phase_chemdr
use camsrfexch, only : cam_in_t, cam_out_t
use perf_mod, only : t_startf, t_stopf
use tropopause, only : tropopause_findChemTrop, tropopause_find
use tropopause, only : tropopause_findChemTrop, tropopause_find_cam
use mo_drydep, only : drydep_update
use mo_neu_wetdep, only : neu_wetdep_tend
use aerodep_flx, only : aerodep_flx_prescribed
Expand Down Expand Up @@ -1220,11 +1220,15 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dt, pbuf, fh2o)
!-----------------------------------------------------------------------
! get tropopause level
!-----------------------------------------------------------------------
!REMOVECAM - no longer need this when CAM is retired and pcols no longer exists
tropLev(:) = 0
tropLevChem(:) = 0
!REMOVECAM_END
if (.not.chem_use_chemtrop) then
call tropopause_find(state,tropLev)
call tropopause_find_cam(state,tropLev)
tropLevChem=tropLev
else
call tropopause_find(state,tropLev)
call tropopause_find_cam(state,tropLev)
call tropopause_findChemTrop(state, tropLevChem)
endif

Expand Down
7 changes: 5 additions & 2 deletions src/chemistry/utils/modal_aero_wateruptake.F90
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ subroutine modal_aero_wateruptake_dr(state, pbuf, list_idx_in, dgnumdry_m, dgnum

use time_manager, only: is_first_step
use cam_history, only: outfld, fieldname_len
use tropopause, only: tropopause_find, TROP_ALG_HYBSTOB, TROP_ALG_CLIMATE
use tropopause, only: tropopause_find_cam, TROP_ALG_HYBSTOB, TROP_ALG_CLIMATE
! Arguments
type(physics_state), target, intent(in) :: state ! Physics state variables
type(physics_buffer_desc), pointer :: pbuf(:) ! physics buffer
Expand Down Expand Up @@ -318,7 +318,10 @@ subroutine modal_aero_wateruptake_dr(state, pbuf, list_idx_in, dgnumdry_m, dgnum

if (modal_strat_sulfate) then
! get tropopause level
call tropopause_find(state, tropLev, primary=TROP_ALG_HYBSTOB, backup=TROP_ALG_CLIMATE)
!REMOVECAM - no longer need this when CAM is retired and pcols no longer exists
tropLev(:) = 0
!REMOVECAM_END
call tropopause_find_cam(state, tropLev, primary=TROP_ALG_HYBSTOB, backup=TROP_ALG_CLIMATE)
endif

h2ommr => state%q(:,:,1)
Expand Down
3 changes: 3 additions & 0 deletions src/chemistry/utils/prescribed_strataero.F90
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,9 @@ subroutine prescribed_strataero_adv( state, pbuf2d)
area(:ncol,:) = area_fact*area(:ncol,:)

! this definition of tropopause is consistent with what is used in chemistry
!REMOVECAM - no longer need this when CAM is retired and pcols no longer exists
tropLev = 0
!REMOVECAM_END
call tropopause_findChemTrop(state(c), tropLev)

do i = 1,ncol
Expand Down
7 changes: 5 additions & 2 deletions src/chemistry/utils/prescribed_volcaero.F90
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ subroutine prescribed_volcaero_adv( state, pbuf2d)
use cam_history, only : outfld
use physconst, only : mwdry ! molecular weight dry air ~ kg/kmole
use physconst, only : boltz, gravit ! J/K/molecule
use tropopause, only : tropopause_find, TROP_ALG_TWMO, TROP_ALG_CLIMATE
use tropopause, only : tropopause_find_cam

use physics_buffer, only : physics_buffer_desc, pbuf_get_field, pbuf_get_chunk

Expand Down Expand Up @@ -260,7 +260,10 @@ subroutine prescribed_volcaero_adv( state, pbuf2d)
call pbuf_get_field(pbuf_chnk, fields(1)%pbuf_ndx, data)
data(:ncol,:) = to_mmr(:ncol,:) * data(:ncol,:) ! mmr

call tropopause_find(state(c), tropLev, primary=TROP_ALG_TWMO, backup=TROP_ALG_CLIMATE)
!REMOVECAM - no longer need this when CAM is retired and pcols no longer exists
tropLev(:) = 0
!REMOVECAM_END
call tropopause_find_cam(state(c), tropLev)
do i = 1,ncol
do k = 1,pver
! set to zero below tropopause
Expand Down
7 changes: 5 additions & 2 deletions src/physics/cam/aer_rad_props.F90
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ subroutine aer_rad_props_sw(list_idx, state, pbuf, nnite, idxnite, &
! Return bulk layer tau, omega, g, f for all spectral intervals.

use physics_buffer, only : physics_buffer_desc
use tropopause, only : tropopause_find
use tropopause, only : tropopause_find_cam
! Arguments
integer, intent(in) :: list_idx ! index of the climate or a diagnostic list
type(physics_state), intent(in), target :: state
Expand Down Expand Up @@ -229,7 +229,10 @@ subroutine aer_rad_props_sw(list_idx, state, pbuf, nnite, idxnite, &
tau_w_f(1:ncol,:,:) = 0._r8
end if

call tropopause_find(state, troplev)
!REMOVECAM - no longer need this when CAM is retired and pcols no longer exists
troplev = 0
!REMOVECAM_END
call tropopause_find_cam(state, troplev)

! Contributions from bulk aerosols.
do iaerosol = 1, numaerosols
Expand Down
7 changes: 5 additions & 2 deletions src/physics/cam/aerosol_optics_cam.F90
Original file line number Diff line number Diff line change
Expand Up @@ -639,11 +639,14 @@ subroutine aerosol_optics_cam_sw(list_idx, state, pbuf, nnite, idxnite, tauxar,

nullify(aero_optics)

call tropopause_findChemTrop(state, troplev)

lchnk = state%lchnk
ncol = state%ncol

!REMOVECAM - no longer need this when CAM is retired and pcols no longer exists
troplev(:) = 0
!REMOVECAM_END
call tropopause_findChemTrop(state, troplev)

mass(:ncol,:) = state%pdeldry(:ncol,:)*rga
air_density(:ncol,:) = state%pmid(:ncol,:)/(rair*state%t(:ncol,:))

Expand Down
3 changes: 3 additions & 0 deletions src/physics/cam/clubb_intr.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2959,6 +2959,9 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &

call physics_ptend_init(ptend_loc,state%psetcols, 'clubb', ls=.true., lu=.true., lv=.true., lq=lq)

!REMOVECAM - no longer need this when CAM is retired and pcols no longer exists
troplev(:) = 0
!REMOVECAM_END
call tropopause_findChemTrop(state, troplev)

! Initialize EDMF outputs
Expand Down
9 changes: 7 additions & 2 deletions src/physics/cam/micro_pumas_cam.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1388,7 +1388,7 @@ subroutine micro_pumas_cam_tend(state, ptend, dtime, pbuf)

use physics_buffer, only: pbuf_col_type_index
use subcol, only: subcol_field_avg
use tropopause, only: tropopause_find, TROP_ALG_CPP, TROP_ALG_NONE, NOTFOUND
use tropopause, only: tropopause_find_cam, TROP_ALG_CPP, TROP_ALG_NONE, NOTFOUND
use wv_saturation, only: qsat
use infnan, only: nan, assignment(=)

Expand Down Expand Up @@ -2164,7 +2164,12 @@ subroutine micro_pumas_cam_tend(state, ptend, dtime, pbuf)
cp_dt(:ncol) = 0._r8
cp_dz(:ncol) = 0._r8

call tropopause_find(state_loc, troplev, primary=TROP_ALG_CPP, backup=TROP_ALG_NONE, &
!REMOVECAM - no longer need this when CAM is retired and pcols no longer exists
troplev(:) = 0
cp_z(:) = 0._r8
cp_t(:) = 0._r8
!REMOVECAM_END
call tropopause_find_cam(state_loc, troplev, primary=TROP_ALG_CPP, backup=TROP_ALG_NONE, &
tropZ=cp_z, tropT=cp_t)

do i = 1, ncol
Expand Down
3 changes: 3 additions & 0 deletions src/physics/cam/nucleate_ice_cam.F90
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,9 @@ subroutine nucleate_ice_cam_calc( &
! Use the same criteria that is used in chemistry and in CLUBB (for cloud fraction)
! to determine whether to use tropospheric or stratospheric settings. Include the
! tropopause level so that the cold point tropopause will use the stratospheric values.
!REMOVECAM - no longer need this when CAM is retired and pcols no longer exists
troplev(:) = 0
!REMOVECAM_END
call tropopause_findChemTrop(state, troplev)

if ((nucleate_ice_subgrid .eq. -1._r8) .or. (nucleate_ice_subgrid_strat .eq. -1._r8)) then
Expand Down
8 changes: 6 additions & 2 deletions src/physics/cam/radiation_data.F90
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ subroutine rad_data_read(indata, phys_state, pbuf2d, cam_in, recno )
use camsrfexch, only: cam_in_t
use physics_buffer, only: pbuf_get_field, pbuf_old_tim_idx
use constituents, only: cnst_get_ind
use tropopause, only: tropopause_find, TROP_ALG_HYBSTOB, TROP_ALG_CLIMATE
use tropopause, only: tropopause_find_cam, TROP_ALG_HYBSTOB, TROP_ALG_CLIMATE

implicit none

Expand Down Expand Up @@ -984,7 +984,11 @@ subroutine rad_data_read(indata, phys_state, pbuf2d, cam_in, recno )
call pbuf_get_field(pbuf, qrsin_idx, qrsin)
call pbuf_get_field(pbuf, qrlin_idx, qrlin)

call tropopause_find(phys_state(c), troplev, tropP=tropp(:), primary=TROP_ALG_CLIMATE, &
!REMOVECAM - no longer need this when CAM is retired and pcols no longer exists
troplev(:) = 0
tropp(:) = 0._r8
!REMOVECAM_END
call tropopause_find_cam(phys_state(c), troplev, tropP=tropp, primary=TROP_ALG_CLIMATE, &
backup=TROP_ALG_CLIMATE)

qrsin(:,:) = qrs_ptrs(c)%array(:,:)
Expand Down
7 changes: 5 additions & 2 deletions src/physics/cam/rk_stratiform.F90
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ subroutine rk_stratiform_tend( &
use cldwat, only: pcond
use pkg_cldoptics, only: cldefr
use phys_control, only: cam_physpkg_is
use tropopause, only: tropopause_find, TROP_ALG_TWMO, TROP_ALG_CLIMATE
use tropopause, only: tropopause_find_cam
use phys_grid, only: get_rlat_all_p
use physconst, only: pi

Expand Down Expand Up @@ -626,7 +626,10 @@ subroutine rk_stratiform_tend( &
end if

if ( do_psrhmin ) then
call tropopause_find(state, troplev, primary=TROP_ALG_TWMO, backup=TROP_ALG_CLIMATE)
!REMOVECAM - no longer need this when CAM is retired and pcols no longer exists
troplev(:) = 0
!REMOVECAM_END
call tropopause_find_cam(state, troplev)
call get_rlat_all_p(lchnk,ncol,rlat)
dlat(:ncol) = rlat(:ncol)*rad2deg
endif
Expand Down
Loading
Loading