Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

Use external shortwave data in CESM2 coupler

Mikasa

sky
Member
In my experiment, I want to hold the solar radiation using external data. So I plan to use downloaded shortwave (solar radiation) data to overide the model calculation sw value in CESM2 coupler. I found the coupler sw calculation process in subroutine seq_flux_ocnalb_mct in the file /my_cesm_sandbox/cime/src/drivers/mct/main/seq_flux_mct.F90.
!--- flux_atmocn needs swdn & swup = swdn*(-albedo)
!--- swdn & albedos are time-aligned BEFORE albedos get updated below ---
do n=1,nloc_o
avsdr = xao_o%rAttr(index_xao_So_avsdr,n)
anidr = xao_o%rAttr(index_xao_So_anidr,n)
avsdf = xao_o%rAttr(index_xao_So_avsdf,n)
anidf = xao_o%rAttr(index_xao_So_anidf,n)
swupc = a2x_o%rAttr(index_a2x_Faxa_swndr,n)*(-anidr) &
& + a2x_o%rAttr(index_a2x_Faxa_swndf,n)*(-anidf) &
& + a2x_o%rAttr(index_a2x_Faxa_swvdr,n)*(-avsdr) &
& + a2x_o%rAttr(index_a2x_Faxa_swvdf,n)*(-avsdf)
swdnc = a2x_o%rAttr(index_a2x_Faxa_swndr,n) &
& + a2x_o%rAttr(index_a2x_Faxa_swndf,n) &
& + a2x_o%rAttr(index_a2x_Faxa_swvdr,n) &
& + a2x_o%rAttr(index_a2x_Faxa_swvdf,n)
if ( anidr == 1.0_r8 ) then ! dark side of earth
swupc = 0.0_r8
swdnc = 0.0_r8
end if
xao_o%rAttr(index_xao_Faox_swdn,n) = swdnc
xao_o%rAttr(index_xao_Faox_swup,n) = swupc
Should I change the right side of the last two lines of the code above to my downloaded data?
To realize my plan, is the code above the right place to modify?
 
Top