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

Information about overwriting LHFLX and QFLX

minminfu

Member
Hi, I was wondering if somebody familiar with the CESM physics packages could give me some quick pointers here. For experiments I am performing, I would like to over-ride the surface latent flux parameterization in CAM and replace them with my own values. I have managed to modify my physpkg.F90 to read in a file. I then overwrite the model computed heat fluxes in one of the first lines of TPHYSAC.

Two questions.
1. Is the start of TPHYSAC an appropriate place to overwrite? I am fairly sure surface fluxes are computed by the model in seq_flux_atmocn_mct. In ccsm_comp_mod.F90, this is called before atm_run_mct, which in turn calls tphysac, the "after coupler" physics component. Therefore I believe this is a good place to do the overwriting. But should I do it before or after flux_avg_run?

2. More importantly, what is the proper value to be overwriting? I've been over-writing both LHFLX as well as QFLX via cam_in%cflx(1,1) and cam_in%lhf just to be safe. Why are there two fields? Presumably they are just off by a factor of L?
 

nusbaume

Jesse Nusbaumer
CSEG and Liaisons
Staff member
Hello,

In response to your two questions:

1. If you are just interested in the surface fluxes of latent heat, then modifying the tphysac subroutine before “flux_avg_run” should be ok. If for some reason the flux averager is causing problems for you then you can always turn it off by setting the “srf_flux_avg” namelist variable to zero (if it is not already).

However, if you wanted to be absolutely sure that your modifications are occurring before any other CAM physics or dynamics processes, then you can also modify the cam_in%cflx and cam_in%lhf variables as soon as they are read into CAM via the “atm_import” subroutine in “cam/src/cpl/atm_import_export.F90”. This is where the quantities that are computed in the coupler and surface models (which includes the surface fluxes) are passed to the atmosphere.

2. I would recommend overwriting both the latent heat flux and evaporative flux so that they are consistent with each other, as otherwise you may be introducing a mass/energy error that could cause hard to debug problems elsewhere in the model (plus it may produce counter-intuitive differences in the climate). They should only be different by a factor of L, but “L” itself will depend on whether it is surface evaporation or sublimation (or dew/frost if it is the opposite sign), or a combination of the two. This is why there are two different fields.

You may be able to back out the correct "L", however, by dividing the original model latent heat flux by the evaporative flux, and of course if you are examining a region with no frozen surface water then you can likely just assume it is the latent heat of vaporization.

Anyways, I hope that helps, and have a great day!

Jesse
 

minminfu

Member
Hello,

In response to your two questions:

1. If you are just interested in the surface fluxes of latent heat, then modifying the tphysac subroutine before “flux_avg_run” should be ok. If for some reason the flux averager is causing problems for you then you can always turn it off by setting the “srf_flux_avg” namelist variable to zero (if it is not already).

However, if you wanted to be absolutely sure that your modifications are occurring before any other CAM physics or dynamics processes, then you can also modify the cam_in%cflx and cam_in%lhf variables as soon as they are read into CAM via the “atm_import” subroutine in “cam/src/cpl/atm_import_export.F90”. This is where the quantities that are computed in the coupler and surface models (which includes the surface fluxes) are passed to the atmosphere.

2. I would recommend overwriting both the latent heat flux and evaporative flux so that they are consistent with each other, as otherwise you may be introducing a mass/energy error that could cause hard to debug problems elsewhere in the model (plus it may produce counter-intuitive differences in the climate). They should only be different by a factor of L, but “L” itself will depend on whether it is surface evaporation or sublimation (or dew/frost if it is the opposite sign), or a combination of the two. This is why there are two different fields.

You may be able to back out the correct "L", however, by dividing the original model latent heat flux by the evaporative flux, and of course if you are examining a region with no frozen surface water then you can likely just assume it is the latent heat of vaporization.

Anyways, I hope that helps, and have a great day!

Jesse

Thank you, this was incredibly helpful! Best, Minmin
 
Top