Skip to content

Commit

Permalink
Some renaming for clarity
Browse files Browse the repository at this point in the history
The modifications here are aimed to remove reference to "double calls" since
this PR enables up to 8 additional calls.  They are also aimed to make it clear
that these radiation calls do not affect the evolution of the simulation, and
that the diagnostics pertain to what we get when we scale CO2 (as opposed to
some other constituent of the atmosphere).
  • Loading branch information
spencerkclark committed Jun 26, 2024
1 parent 6d45d92 commit e0fe8ee
Show file tree
Hide file tree
Showing 4 changed files with 244 additions and 244 deletions.
70 changes: 35 additions & 35 deletions FV3GFS/FV3GFS_io.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3069,10 +3069,10 @@ subroutine register_diag_manager_controlled_diagnostics(Time, Sfcprop, IntDiag,
Diag_diag_manager_controlled(index)%data(nb)%var21 => IntDiag(nb)%column_moles_dry_air_per_square_meter
enddo

if (Model%do_radiation_double_call) then
do n = 1,Model%n_radiation_double_calls
if (Model%do_diagnostic_radiation_with_scaled_co2) then
do n = 1,Model%n_diagnostic_radiation_calls
write (radiation_call,'(I1)') n
write (scaling,'(F6.2)') Model%radiation_double_call_co2_scale_factors(n)
write (scaling,'(F6.2)') Model%diagnostic_radiation_call_co2_scale_factors(n)

index = index + 1
Diag_diag_manager_controlled(index)%axes = 0
Expand All @@ -3083,7 +3083,7 @@ subroutine register_diag_manager_controlled_diagnostics(Time, Sfcprop, IntDiag,
Diag_diag_manager_controlled(index)%coarse_graining_method = AREA_WEIGHTED
allocate (Diag_diag_manager_controlled(index)%data(nblks))
do nb = 1,nblks
Diag_diag_manager_controlled(index)%data(nb)%var2 => IntDiag(nb)%column_moles_co2_per_square_meter_radiation_double_call(n,:)
Diag_diag_manager_controlled(index)%data(nb)%var2 => IntDiag(nb)%column_moles_co2_per_square_meter_with_scaled_co2(n,:)
Diag_diag_manager_controlled(index)%data(nb)%var21 => IntDiag(nb)%column_moles_dry_air_per_square_meter
enddo
enddo
Expand Down Expand Up @@ -3519,14 +3519,14 @@ subroutine gfdl_diag_register(Time, Sfcprop, Gfs_diag, Model, Cldprop, Atm_block
Diag(idx)%data(nb)%var2 => Gfs_diag(nb)%fluxr(:,1)
enddo

if (Model%do_radiation_double_call) then
do n = 1,Model%n_radiation_double_calls
if (Model%do_diagnostic_radiation_with_scaled_co2) then
do n = 1,Model%n_diagnostic_radiation_calls
write (xtra,'(I1)') n
write (scaling,'(F6.2)') Model%radiation_double_call_co2_scale_factors(n)
write (scaling,'(F6.2)') Model%diagnostic_radiation_call_co2_scale_factors(n)

idx = idx + 1
Diag(idx)%axes = 2
Diag(idx)%name = 'DSWRFtoa_double_call_' // trim(xtra)
Diag(idx)%name = 'DSWRFtoa_with_scaled_co2_' // trim(xtra)
Diag(idx)%desc = 'top of atmos downward shortwave flux with ' // trim(adjustl(scaling)) // 'xCO2'
Diag(idx)%unit = 'W/m**2'
Diag(idx)%mod_name = 'gfs_phys'
Expand All @@ -3536,12 +3536,12 @@ subroutine gfdl_diag_register(Time, Sfcprop, Gfs_diag, Model, Cldprop, Atm_block
Diag(idx)%intpl_method = 'bilinear'
allocate (Diag(idx)%data(nblks))
do nb = 1,nblks
Diag(idx)%data(nb)%var2 => Gfs_diag(nb)%dswrftoa_double_call(n,:)
Diag(idx)%data(nb)%var2 => Gfs_diag(nb)%dswrftoa_with_scaled_co2(n,:)
enddo

idx = idx + 1
Diag(idx)%axes = 2
Diag(idx)%name = 'USWRFtoa_double_call_' // trim(xtra)
Diag(idx)%name = 'USWRFtoa_with_scaled_co2_' // trim(xtra)
Diag(idx)%desc = 'top of atmos upward shortwave flux with ' // trim(adjustl(scaling)) // 'xCO2'
Diag(idx)%unit = 'W/m**2'
Diag(idx)%mod_name = 'gfs_phys'
Expand All @@ -3551,12 +3551,12 @@ subroutine gfdl_diag_register(Time, Sfcprop, Gfs_diag, Model, Cldprop, Atm_block
Diag(idx)%intpl_method = 'bilinear'
allocate (Diag(idx)%data(nblks))
do nb = 1,nblks
Diag(idx)%data(nb)%var2 => Gfs_diag(nb)%uswrftoa_double_call(n,:)
Diag(idx)%data(nb)%var2 => Gfs_diag(nb)%uswrftoa_with_scaled_co2(n,:)
enddo

idx = idx + 1
Diag(idx)%axes = 2
Diag(idx)%name = 'ULWRFtoa_double_call_' // trim(xtra)
Diag(idx)%name = 'ULWRFtoa_with_scaled_co2_' // trim(xtra)
Diag(idx)%desc = 'top of atmos upward longwave flux with ' // trim(adjustl(scaling)) // 'xCO2'
Diag(idx)%unit = 'W/m**2'
Diag(idx)%mod_name = 'gfs_phys'
Expand All @@ -3566,7 +3566,7 @@ subroutine gfdl_diag_register(Time, Sfcprop, Gfs_diag, Model, Cldprop, Atm_block
Diag(idx)%intpl_method = 'bilinear'
allocate (Diag(idx)%data(nblks))
do nb = 1,nblks
Diag(idx)%data(nb)%var2 => Gfs_diag(nb)%ulwrftoa_double_call(n,:)
Diag(idx)%data(nb)%var2 => Gfs_diag(nb)%ulwrftoa_with_scaled_co2(n,:)
enddo
enddo
endif
Expand Down Expand Up @@ -4236,14 +4236,14 @@ subroutine gfdl_diag_register(Time, Sfcprop, Gfs_diag, Model, Cldprop, Atm_block
Diag(idx)%data(nb)%var2 => Gfs_diag(nb)%ulwsfc(:)
enddo

if (Model%do_radiation_double_call) then
do n = 1,Model%n_radiation_double_calls
if (Model%do_diagnostic_radiation_with_scaled_co2) then
do n = 1,Model%n_diagnostic_radiation_calls
write (xtra,'(I1)') n
write (scaling,'(F6.2)') Model%radiation_double_call_co2_scale_factors(n)
write (scaling,'(F6.2)') Model%diagnostic_radiation_call_co2_scale_factors(n)

idx = idx + 1
Diag(idx)%axes = 2
Diag(idx)%name = 'DSWRF_double_call_' // trim(xtra)
Diag(idx)%name = 'DSWRF_with_scaled_co2_' // trim(xtra)
Diag(idx)%desc = 'Interval-averaged zenith-angle-adjusted downward shortwave flux at the surface with ' // trim(adjustl(scaling)) // 'xCO2'
Diag(idx)%unit = 'w/m**2'
Diag(idx)%mod_name = 'gfs_phys'
Expand All @@ -4252,12 +4252,12 @@ subroutine gfdl_diag_register(Time, Sfcprop, Gfs_diag, Model, Cldprop, Atm_block
Diag(idx)%intpl_method = 'bilinear'
allocate (Diag(idx)%data(nblks))
do nb = 1,nblks
Diag(idx)%data(nb)%var2 => Gfs_diag(nb)%dswsfc_double_call(n,:)
Diag(idx)%data(nb)%var2 => Gfs_diag(nb)%dswsfc_with_scaled_co2(n,:)
enddo

idx = idx + 1
Diag(idx)%axes = 2
Diag(idx)%name = 'USWRF_double_call_' // trim(xtra)
Diag(idx)%name = 'USWRF_with_scaled_co2_' // trim(xtra)
Diag(idx)%desc = 'Interval-averaged zenith-angle-adjusted upward shortwave flux at the surface with ' // trim(adjustl(scaling)) // 'xCO2'
Diag(idx)%unit = 'w/m**2'
Diag(idx)%mod_name = 'gfs_phys'
Expand All @@ -4266,12 +4266,12 @@ subroutine gfdl_diag_register(Time, Sfcprop, Gfs_diag, Model, Cldprop, Atm_block
Diag(idx)%intpl_method = 'bilinear'
allocate (Diag(idx)%data(nblks))
do nb = 1,nblks
Diag(idx)%data(nb)%var2 => Gfs_diag(nb)%uswsfc_double_call(n,:)
Diag(idx)%data(nb)%var2 => Gfs_diag(nb)%uswsfc_with_scaled_co2(n,:)
enddo

idx = idx + 1
Diag(idx)%axes = 2
Diag(idx)%name = 'DLWRF_double_call_' // trim(xtra)
Diag(idx)%name = 'DLWRF_with_scaled_co2_' // trim(xtra)
Diag(idx)%desc = 'Interval-averaged surface-temperature-adjusted downward longwave flux at the surface with ' // trim(adjustl(scaling)) // 'xCO2'
Diag(idx)%unit = 'w/m**2'
Diag(idx)%mod_name = 'gfs_phys'
Expand All @@ -4280,12 +4280,12 @@ subroutine gfdl_diag_register(Time, Sfcprop, Gfs_diag, Model, Cldprop, Atm_block
Diag(idx)%intpl_method = 'bilinear'
allocate (Diag(idx)%data(nblks))
do nb = 1,nblks
Diag(idx)%data(nb)%var2 => Gfs_diag(nb)%dlwsfc_double_call(n,:)
Diag(idx)%data(nb)%var2 => Gfs_diag(nb)%dlwsfc_with_scaled_co2(n,:)
enddo

idx = idx + 1
Diag(idx)%axes = 2
Diag(idx)%name = 'ULWRF_double_call_' // trim(xtra)
Diag(idx)%name = 'ULWRF_with_scaled_co2_' // trim(xtra)
Diag(idx)%desc = 'Interval-averaged surface-temperature-adjusted upward longwave flux at the surface with ' // trim(adjustl(scaling)) // 'xCO2'
Diag(idx)%unit = 'w/m**2'
Diag(idx)%mod_name = 'gfs_phys'
Expand All @@ -4294,7 +4294,7 @@ subroutine gfdl_diag_register(Time, Sfcprop, Gfs_diag, Model, Cldprop, Atm_block
Diag(idx)%intpl_method = 'bilinear'
allocate (Diag(idx)%data(nblks))
do nb = 1,nblks
Diag(idx)%data(nb)%var2 => Gfs_diag(nb)%ulwsfc_double_call(n,:)
Diag(idx)%data(nb)%var2 => Gfs_diag(nb)%ulwsfc_with_scaled_co2(n,:)
enddo
enddo
endif
Expand Down Expand Up @@ -5102,57 +5102,57 @@ subroutine gfdl_diag_register(Time, Sfcprop, Gfs_diag, Model, Cldprop, Atm_block
enddo
endif

if (Model%do_radiation_double_call) then
do n = 1,Model%n_radiation_double_calls
if (Model%do_diagnostic_radiation_with_scaled_co2) then
do n = 1,Model%n_diagnostic_radiation_calls
write (xtra,'(I1)') n
write (scaling,'(F6.2)') Model%radiation_double_call_co2_scale_factors(n)
write (scaling,'(F6.2)') Model%diagnostic_radiation_call_co2_scale_factors(n)

idx = idx + 1
Diag(idx)%axes = 2
Diag(idx)%name = 'DLWRFI_double_call_' // trim(xtra)
Diag(idx)%name = 'DLWRFI_with_scaled_co2_' // trim(xtra)
Diag(idx)%desc = 'Instantaneous surface-temperature-adjusted downward longwave flux at the surface with ' // trim(adjustl(scaling)) // 'xCO2'
Diag(idx)%unit = 'w/m**2'
Diag(idx)%mod_name = 'gfs_phys'
Diag(idx)%intpl_method = 'bilinear'
allocate (Diag(idx)%data(nblks))
do nb = 1,nblks
Diag(idx)%data(nb)%var2 => Gfs_diag(nb)%dlwsfci_double_call(n,:)
Diag(idx)%data(nb)%var2 => Gfs_diag(nb)%dlwsfci_with_scaled_co2(n,:)
enddo

idx = idx + 1
Diag(idx)%axes = 2
Diag(idx)%name = 'ULWRFI_double_call_' // trim(xtra)
Diag(idx)%name = 'ULWRFI_with_scaled_co2_' // trim(xtra)
Diag(idx)%desc = 'Instantaneous surface-temperature-adjusted upward longwave flux at the surface with ' // trim(adjustl(scaling)) // 'xCO2'
Diag(idx)%unit = 'w/m**2'
Diag(idx)%mod_name = 'gfs_phys'
Diag(idx)%intpl_method = 'bilinear'
allocate (Diag(idx)%data(nblks))
do nb = 1,nblks
Diag(idx)%data(nb)%var2 => Gfs_diag(nb)%ulwsfci_double_call(n,:)
Diag(idx)%data(nb)%var2 => Gfs_diag(nb)%ulwsfci_with_scaled_co2(n,:)
enddo

idx = idx + 1
Diag(idx)%axes = 2
Diag(idx)%name = 'DSWRFI_double_call_' // trim(xtra)
Diag(idx)%name = 'DSWRFI_with_scaled_co2_' // trim(xtra)
Diag(idx)%desc = 'Instantaneous zenith-angle-adjusted downward shortwave flux at the surface with ' // trim(adjustl(scaling)) // 'xCO2'
Diag(idx)%unit = 'w/m**2'
Diag(idx)%mod_name = 'gfs_phys'
Diag(idx)%intpl_method = 'bilinear'
allocate (Diag(idx)%data(nblks))
do nb = 1,nblks
Diag(idx)%data(nb)%var2 => Gfs_diag(nb)%dswsfci_double_call(n,:)
Diag(idx)%data(nb)%var2 => Gfs_diag(nb)%dswsfci_with_scaled_co2(n,:)
enddo

idx = idx + 1
Diag(idx)%axes = 2
Diag(idx)%name = 'USWRFI_double_call_' // trim(xtra)
Diag(idx)%name = 'USWRFI_with_scaled_co2_' // trim(xtra)
Diag(idx)%desc = 'Instantaneous zenith-angle-adjusted upward shortwave flux at the surface ' // trim(adjustl(scaling)) // 'xCO2'
Diag(idx)%unit = 'w/m**2'
Diag(idx)%mod_name = 'gfs_phys'
Diag(idx)%intpl_method = 'bilinear'
allocate (Diag(idx)%data(nblks))
do nb = 1,nblks
Diag(idx)%data(nb)%var2 => Gfs_diag(nb)%uswsfci_double_call(n,:)
Diag(idx)%data(nb)%var2 => Gfs_diag(nb)%uswsfci_with_scaled_co2(n,:)
enddo
enddo
endif
Expand Down
52 changes: 26 additions & 26 deletions GFS_layer/GFS_physics_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -884,8 +884,8 @@ subroutine GFS_physics_driver &
adjnirbmd, adjnirdfd, adjvisbmd, adjvisdfd &
)

if (Model%do_radiation_double_call) then
call compute_radiation_double_call_diagnostics( &
if (Model%do_diagnostic_radiation_with_scaled_co2) then
call compute_diagnostics_with_scaled_co2( &
Model, Statein, Sfcprop, Coupling, Grid, Radtend, ix, im, &
levs, Diag &
)
Expand Down Expand Up @@ -4234,7 +4234,7 @@ subroutine compute_updated_delp_following_dynamics_definition(pressure_on_interf
delp = initial_mass_of_dry_air_plus_vapor * dry_air_plus_hydrometeor_mass_fraction_after_physics
end subroutine compute_updated_delp_following_dynamics_definition

subroutine compute_radiation_double_call_diagnostics(Model, Statein, Sfcprop, Coupling, Grid, Radtend, ix, im, levs, Diag)
subroutine compute_diagnostics_with_scaled_co2(Model, Statein, Sfcprop, Coupling, Grid, Radtend, ix, im, levs, Diag)
type(GFS_control_type), intent(in) :: Model
type(GFS_statein_type), intent(in) :: Statein
type(GFS_sfcprop_type), intent(in) :: Sfcprop
Expand All @@ -4252,38 +4252,38 @@ subroutine compute_radiation_double_call_diagnostics(Model, Statein, Sfcprop, Co
adjsfculw, adjnirbmu, adjnirdfu, adjvisbmu, adjvisdfu, adjnirbmd, &
adjnirdfd, adjvisbmd, adjvisdfd, xmu, xcosz

do n = 1, Model%n_radiation_double_calls
call dcyc2t3 &
do n = 1, Model%n_diagnostic_radiation_calls
call dcyc2t3 &
! --- inputs:
( Model%solhr, Model%slag, Model%sdec, Model%cdec, Grid%sinlat, &
Grid%coslat, Grid%xlon, Radtend%coszen, Sfcprop%tsfc, &
Statein%tgrs(1,1), Radtend%tsflw, Radtend%semis, &
Coupling%sfcdsw_double_call(n,:), Coupling%sfcnsw_double_call(n,:), Coupling%sfcdlw_double_call(n,:), &
Radtend%htrsw_double_call(n,:,:), Radtend%swhc_double_call(n,:,:), Radtend%htrlw_double_call(n,:,:), Radtend%lwhc_double_call(n,:,:), &
Coupling%nirbmui_double_call(n,:), Coupling%nirdfui_double_call(n,:), Coupling%visbmui_double_call(n,:), &
Coupling%visdfui_double_call(n,:), Coupling%nirbmdi_double_call(n,:), Coupling%nirdfdi_double_call(n,:), &
Coupling%visbmdi_double_call(n,:), Coupling%visdfdi_double_call(n,:), ix, im, levs, &
Model%daily_mean, &
( Model%solhr, Model%slag, Model%sdec, Model%cdec, Grid%sinlat, &
Grid%coslat, Grid%xlon, Radtend%coszen, Sfcprop%tsfc, &
Statein%tgrs(1,1), Radtend%tsflw, Radtend%semis, &
Coupling%sfcdsw_with_scaled_co2(n,:), Coupling%sfcnsw_with_scaled_co2(n,:), Coupling%sfcdlw_with_scaled_co2(n,:), &
Radtend%htrsw_with_scaled_co2(n,:,:), Radtend%swhc_with_scaled_co2(n,:,:), Radtend%htrlw_with_scaled_co2(n,:,:), Radtend%lwhc_with_scaled_co2(n,:,:), &
Coupling%nirbmui_with_scaled_co2(n,:), Coupling%nirdfui_with_scaled_co2(n,:), Coupling%visbmui_with_scaled_co2(n,:), &
Coupling%visdfui_with_scaled_co2(n,:), Coupling%nirbmdi_with_scaled_co2(n,:), Coupling%nirdfdi_with_scaled_co2(n,:), &
Coupling%visbmdi_with_scaled_co2(n,:), Coupling%visdfdi_with_scaled_co2(n,:), ix, im, levs, &
Model%daily_mean, &
! --- input/output:
dtdt, dtdtc, &
dtdt, dtdtc, &
! --- outputs:
adjsfcdsw, adjsfcnsw, adjsfcdlw, adjsfculw, xmu, xcosz, adjnirbmu, adjnirdfu, adjvisbmu, adjvisdfu, adjnirbmd, adjnirdfd, adjvisbmd, &
adjvisdfd &
adjsfcdsw, adjsfcnsw, adjsfcdlw, adjsfculw, xmu, xcosz, adjnirbmu, adjnirdfu, adjvisbmu, adjvisdfu, adjnirbmd, adjnirdfd, adjvisbmd, &
adjvisdfd &
)

Diag%dlwsfc_double_call(n,:) = Diag%dlwsfc_double_call(n,:) + adjsfcdlw * Model%dtf
Diag%ulwsfc_double_call(n,:) = Diag%ulwsfc_double_call(n,:) + adjsfculw * Model%dtf
Diag%dlwsfc_with_scaled_co2(n,:) = Diag%dlwsfc_with_scaled_co2(n,:) + adjsfcdlw * Model%dtf
Diag%ulwsfc_with_scaled_co2(n,:) = Diag%ulwsfc_with_scaled_co2(n,:) + adjsfculw * Model%dtf

Diag%dlwsfci_double_call(n,:) = adjsfcdlw
Diag%ulwsfci_double_call(n,:) = adjsfculw
Diag%uswsfci_double_call(n,:) = adjsfcdsw - adjsfcnsw
Diag%dswsfci_double_call(n,:) = adjsfcdsw
Diag%dlwsfci_with_scaled_co2(n,:) = adjsfcdlw
Diag%ulwsfci_with_scaled_co2(n,:) = adjsfculw
Diag%uswsfci_with_scaled_co2(n,:) = adjsfcdsw - adjsfcnsw
Diag%dswsfci_with_scaled_co2(n,:) = adjsfcdsw

Diag%uswsfc_double_call(n,:) = Diag%uswsfc_double_call(n,:) + (adjsfcdsw - adjsfcnsw) * Model%dtf
Diag%dswsfc_double_call(n,:) = Diag%dswsfc_double_call(n,:) + adjsfcdsw * Model%dtf
Diag%uswsfc_with_scaled_co2(n,:) = Diag%uswsfc_with_scaled_co2(n,:) + (adjsfcdsw - adjsfcnsw) * Model%dtf
Diag%dswsfc_with_scaled_co2(n,:) = Diag%dswsfc_with_scaled_co2(n,:) + adjsfcdsw * Model%dtf
enddo

end subroutine compute_radiation_double_call_diagnostics
end subroutine compute_diagnostics_with_scaled_co2
!> @}

end module module_physics_driver
Loading

0 comments on commit e0fe8ee

Please sign in to comment.