m2lines / CAM-ML

Community Atmosphere Model
0 stars 0 forks source link

Remove CAM-SAM inconcistencies in qsat #16

Open jatkinson1000 opened 1 week ago

jatkinson1000 commented 1 week ago

@paogorman comments:

Another issue to think about is the small inconsistencies between SAM and CAM qsat (note CAM qsat is set in wv_saturation.f90). If the timestep is large, this is not much of a problem. But for smaller timesteps (e.g. if we subcycle), we can run into a problem because our approach is to:

But in cloudy air this change will include an adjustment from CAM to SAM qsat, and this could be large when divided by a small timestep.

One option to deal with this problem is to call an extra conversion back from q to qv, qc, qi prior to the NN call.

Then the changes in qv, qc, qi can only result from the NN tendencies:

    ! Convert CAM Moistures and tabs to SAM q and t
    call CAM_var_conversion(qv_sam, qc_sam, qi_sam, q_sam, tabs_sam, t_sam)
    ! Extra conversion to make qv, qc, qi consistent with SAM saturation
    call SAM_var_conversion(t_sam, q_sam, tabs_sam, qv_sam, qc_sam, qi_sam)
jatkinson1000 commented 1 week ago

So the $\Delta$ should be calculated relative to the q_i,c,vthat results from a conversion back to 'CAM' variables just before the net is called, rather than those that are read in at the start of the scheme from the CAM state variable.

This way the tendencies will be 'consistent with SAM physics'. - i.e. a zero tendency from the net should result in zero tendency (or at least closer to) applied to the variables.