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

CAM 3.1 Relaxation

jshaman

New Member
I am interested in adding a relaxation term to CAM3.1 in order to
restore the temperature in selected areas/altitudes to a specified
field. I don't want to shut off all the physics and simply use
the 'phys_idealized.F90' subroutine, so I've made a number of changes
within the standard physics package.

I've put the actual relaxation scheme into the 'physics_update'
subroutine as a restoring of dry static energy, i.e.

grlx=(srelax(i,k)-state%s(i,k))/3600/4
state%s(i,k) = state%s(i,k) + ptend%s(i,k)*dt + dt*grlx
tend%dtdt(i,k) = tend%dtdt(i,k) + ptend%s(i,k)/cpair

where 'srelax' is the dry static energy to which I would like the
model state to be relaxed.

The scheme doesn't work...

I have three specific questions which I hope one of you experts can
perhaps help with:

1) Do I need to add the restoring term to both the dry static energy
state and the temperature tendency ('tend%dtdt'), or just the dry
static energy state? And what exactly is the temperature tendency
calculated for?

2) Are there other fields that need to be relaxed to as well in order to
constrain the temperature to a desired specified field? (e.g. surface
geopotential?)

3) is the relaxation of dry static energy the correct way of
constraining the temperature field?

Many thanks,
Jeff
 

rneale

Rich Neale
CAM Project Scientist
Staff member
physics_update basically updates the physics state and tendencies after each parameterization has generated it's
own set of tendencies. So if you embed the code you showed in the physics_update routine it will be relaxing
back to your predefined temperature structure many time in a time step rather than just the once.
May advice would be at the end of the physics timestep (in tphysbc.F90) after radiation just calculate
the tendencies in temperature that result from the relaxation, then pass that to physics_update so that
the dry static energy state and temperature tendencies are update in the same way as always. So just treat
it like a mini-parameterization, which is what it is.

The bit of code would look like

call physics_ptend_init (ptend) ! Initialize parameterization tendency structure
ptend%name = 'temp_relax' ! Tag a name to the physics update you aer doing
ptend%ls = .TRUE. ! Say you want to update s state and tend at next physics_update call
ptend%s(:ncol,:) =(srelax(i,k)-state%s(i,k))/ztodt ! Relaxation tendencies
call physics_update (state, tend, ptend, ztodt) ! Add this to the cumulative tendencies (tend) and update state.
 
Top