Skip to content

Commit

Permalink
Update in response to code review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmielin committed Sep 12, 2024
1 parent d400fb2 commit d9a5686
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
8 changes: 3 additions & 5 deletions cam_diagnostics/tropopause_diagnostics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module tropopause_diagnostics
public :: tropopause_diagnostics_init
public :: tropopause_diagnostics_run

! Parameters consistent with tropopause_find - can they be imported?
integer, parameter :: NOTFOUND = -1

contains
Expand All @@ -29,7 +28,7 @@ subroutine tropopause_diagnostics_init(errmsg, errflg)

! Define the output fields.

! Primary (Lapse rate) + backup (climatology) method
! Primary (Lapse rate) + backup (climatology) method - will always find a tropopause
call history_add_field('TROP_P', 'tropopause_air_pressure', horiz_only, 'avg', 'Pa')
call history_add_field('TROP_T', 'tropopause_air_temperature', horiz_only, 'avg', 'K' )
call history_add_field('TROP_Z', 'tropopause_geopotential_height_wrt_surface', horiz_only, 'avg', 'm' )
Expand All @@ -53,7 +52,7 @@ subroutine tropopause_diagnostics_init(errmsg, errflg)
call history_add_field('TROPF_PD', 'probability_distribution_of_tropopause_vertical_layer_index_from_cold_point_method', 'lev', 'avg', 'probability')
call history_add_field('TROPF_FD', 'tropopause_found_from_cold_point_method', horiz_only, 'avg', 'probability')

! Climatology only - will never fail
! Climatology only - will always find a tropopause
call history_add_field('TROPC_P', 'tropopause_air_pressure_from_climatological_method', horiz_only, 'avg', 'Pa')
call history_add_field('TROPC_T', 'tropopause_air_temperature_from_climatological_method', horiz_only, 'avg', 'K' )
call history_add_field('TROPC_Z', 'tropopause_geopotential_height_wrt_surface_from_climatological_method', horiz_only, 'avg', 'm' )
Expand Down Expand Up @@ -215,6 +214,5 @@ subroutine tropopause_diagnostics_run(ncol, pver, &
call history_out_field('hstobie_linoz', hstobie_linoz)
call history_out_field('hstobie_tropop', hstobie_tropop)

return
end subroutine tropopause_diagnostics_run
end module tropopause_diagnostics
end module tropopause_diagnostics
2 changes: 1 addition & 1 deletion doc/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This PR fixes the following NCAR/atmospheric_physics Github issues:
- tropopause_find accepted "primary" and "backup" methods for finding the tropopause. All the methods known to be used in CAM are now calculated at the same time in the tropopause_find_run main driver routine; it calls the underlying logic as appropriate with and populates the appropriate standard name physics fields. Because the same physical quantities for tropopause level, height, pressure, temperature, etc. using different methods are used throughout the CAM physics and simultaneously output in the diagnostics, the same standard names with a suffix are used to differentiate between these quantities computed by different methods.
- Standard CCPP-ization procedures, metadata, explicit use of fields instead of physics state, only passing active :ncol fields, ...

A "shim" that will completely replicate existing behavior, bit-for-bit in current CAM, will be included in current CAM as tropopause.F90.
CAM interface code that will completely replicate existing behavior, bit-for-bit in current CAM, will be included in current CAM as tropopause.F90.

Code reviewed by:

Expand Down
12 changes: 4 additions & 8 deletions tropopause_find/tropopause_find.F90
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ module tropopause_find
! These parameters define an enumeration to be used to define the primary
! and backup algorithms to be used with the tropopause_find() method. The
! backup algorithm is meant to provide a solution when the primary algorithm
! fails. The algorithms that can't fail are: TROP_ALG_ANALYTIC, TROP_ALG_CLIMATE
! and TROP_ALG_STOBIE.
! fails. The algorithms that can't fail (i.e., always find a tropopause) are:
! TROP_ALG_ANALYTIC, TROP_ALG_CLIMATE, and TROP_ALG_STOBIE.
integer, parameter :: TROP_ALG_NONE = 1 ! Don't evaluate
integer, parameter :: TROP_ALG_ANALYTIC = 2 ! Analytic Expression
integer, parameter :: TROP_ALG_CLIMATE = 3 ! Climatology
Expand Down Expand Up @@ -128,7 +128,6 @@ subroutine tropopause_find_run(ncol, pver, fillvalue, lat, pint, pmid, t, zi, zm
real(kind_phys), intent(in) :: calday ! Day of year including fraction of day

! Climatological tropopause pressures (Pa), (pcols,ntimes=12).
! Remark: Not chunkized, subsetted to chunk for backwards compatibility with CAM
real(kind_phys), intent(in) :: tropp_p_loc(:,:)
real(kind_phys), intent(in) :: tropp_days(:) ! Day-of-year for climo data, 12

Expand Down Expand Up @@ -331,7 +330,7 @@ subroutine tropopause_find_run(ncol, pver, fillvalue, lat, pint, pmid, t, zi, zm

end subroutine tropopause_find_run

! Searches all the columns in the chunk and attempts to identify the tropopause.
! Searches all the columns and attempts to identify the tropopause.
! Two routines can be specifed, a primary routine which is tried first and a
! backup routine which will be tried only if the first routine fails. If the
! tropopause can not be identified by either routine, then a NOTFOUND is returned
Expand All @@ -357,7 +356,6 @@ subroutine tropopause_findWithBackup(ncol, pver, fillvalue, lat, pint, pmid, t,
real(kind_phys), intent(in) :: calday ! Day of year including fraction of day

! Climatological tropopause pressures (Pa), (pcols,ntimes=12).
! Remark: Not chunkized, subsetted to chunk for backwards compatibility with CAM
real(kind_phys), intent(in) :: tropp_p_loc(:,:)
real(kind_phys), intent(in) :: tropp_days(:) ! Day-of-year for climo data, 12

Expand Down Expand Up @@ -431,7 +429,6 @@ subroutine tropopause_findUsing(ncol, pver, lat, pint, pmid, t, zi, zm, phis, &
real(kind_phys), intent(in) :: calday ! Day of year including fraction of day

! Climatological tropopause pressures (Pa), (pcols,ntimes=12).
! Remark: Not chunkized, subsetted to chunk for backwards compatibility with CAM
real(kind_phys), intent(in) :: tropp_p_loc(:,:)
real(kind_phys), intent(in) :: tropp_days(:) ! Day-of-year for climo data, 12

Expand Down Expand Up @@ -572,7 +569,6 @@ subroutine tropopause_climate(ncol, pver, lat, pint, pmid, t, zi, zm, phis, &
real(kind_phys), intent(in) :: calday ! Day of year including fraction of day

! Climatological tropopause pressures (Pa), (pcols,ntimes=12).
! Remark: Not chunkized, subsetted to chunk for backwards compatibility with CAM
real(kind_phys), intent(in) :: tropp_p_loc(:,:)
real(kind_phys), intent(in) :: tropp_days(:) ! Day-of-year for climo data, 12

Expand Down Expand Up @@ -1251,7 +1247,7 @@ subroutine tropopause_cpp(ncol, pver, lat, pint, pmid, t, zi, zm, phis, &

end subroutine tropopause_cpp

! Searches all the columns in the chunk and attempts to identify the "chemical"
! Searches all the columns and attempts to identify the "chemical"
! tropopause. This is the lapse rate tropopause, backed up by the climatology
! if the lapse rate fails to find the tropopause at pressures higher than a certain
! threshold. This pressure threshold depends on latitude. Between 50S and 50N,
Expand Down

0 comments on commit d9a5686

Please sign in to comment.