This PR allows MAML to use CRMs that are not oriented East-West.
This PR also fixes an issue in the SP_ORIENT_RAND configuration wherein crm_angle was uninitialized prior to use and did not persist between CRM calls.
Behavior prior to this PR: The model would crash during the first few days when using use_MAML with CRMs oriented North-South (SP_DIR_NS). The hypothesis is that cam_out%[uv]bot were being populated with crm_[uv], which could set up unrealistic surface forcings depending on how it's handled by the surface models (e.g., taux could be calculated with v instead of u).
Solution: Use crm_angle to appropriately transform crm_[uv] back to the GCM frame of reference. This is done by adding crm_angle to pbuf so it can both persist between CRM calls (for SP_ORIENT_RAND) and also be used in the cam_export subroutine with MAML.
This appears to have addressed the MAML/North-South instability based on short-simulations (fingers crossed). Regardless, this fix should be incorporated because the old behavior was inconsistent.
[BFB] for ECP test suite (tested on Cori), but note these tests do not directly test this functionality.
This PR allows MAML to use CRMs that are not oriented East-West.
This PR also fixes an issue in the
SP_ORIENT_RAND
configuration whereincrm_angle
was uninitialized prior to use and did not persist between CRM calls.Behavior prior to this PR: The model would crash during the first few days when using
use_MAML
with CRMs oriented North-South (SP_DIR_NS
). The hypothesis is thatcam_out%[uv]bot
were being populated withcrm_[uv]
, which could set up unrealistic surface forcings depending on how it's handled by the surface models (e.g.,taux
could be calculated withv
instead ofu
).Solution: Use
crm_angle
to appropriately transformcrm_[uv]
back to the GCM frame of reference. This is done by addingcrm_angle
topbuf
so it can both persist between CRM calls (forSP_ORIENT_RAND
) and also be used in thecam_export
subroutine with MAML.This appears to have addressed the MAML/North-South instability based on short-simulations (fingers crossed). Regardless, this fix should be incorporated because the old behavior was inconsistent.
[BFB] for ECP test suite (tested on Cori), but note these tests do not directly test this functionality.