You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been working on a fix for #1545 and testing via the MOM_CFC_cap.F90 and pseudo_salt_tracer.F90 modules. I'm in the process of bringing the February changes to main onto my branch, and making sure my branch can pass dimensional scaling tests. In doing so, I noticed a small discrepancy in how units are set when salt and pseudosalt are registered. Here is the register_tracer() call for salt:
The code mods below bring flux_scale, convergence_units, and convergence_scale into agreement between the two (but I am now noticing that I should also set flux_units):
diff --git a/src/tracer/pseudo_salt_tracer.F90 b/src/tracer/pseudo_salt_tracer.F90
index 579751952..cf3874697 100644
--- a/src/tracer/pseudo_salt_tracer.F90+++ b/src/tracer/pseudo_salt_tracer.F90@@ -74,6 +74,7 @@ function register_pseudo_salt_tracer(HI, GV, param_file, CS, tr_Reg, restart_CS)
real, pointer :: tr_ptr(:,:,:) => NULL()
logical :: register_pseudo_salt_tracer
integer :: isd, ied, jsd, jed, nz
+ real :: conv2salt ! A conversion factor for salt fluxes [m H-1 ~> 1] or [kg m-2 H-1 ~> 1]
isd = HI%isd ; ied = HI%ied ; jsd = HI%jsd ; jed = HI%jed ; nz = GV%ke
if (associated(CS)) then
@@ -95,9 +96,16 @@ function register_pseudo_salt_tracer(HI, GV, param_file, CS, tr_Reg, restart_CS)
tr_ptr => CS%ps(:,:,:)
call query_vardesc(CS%tr_desc, name=var_name, caller="register_pseudo_salt_tracer")
! Register the tracer for horizontal advection, diffusion, and restarts.
+ if (GV%Boussinesq) then+ conv2salt = GV%H_to_m ! Could change to GV%H_to_kg_m2 * 0.001?+ else+ conv2salt = GV%H_to_kg_m2+ endif
call register_tracer(tr_ptr, tr_Reg, param_file, HI, GV, name="pseudo_salt", &
longname="Pseudo salt passive tracer", units="psu", &
registry_diags=.true., restart_CS=restart_CS, &
+ flux_scale=conv2salt, convergence_units='kg m-2 s-1', &+ convergence_scale=0.001*GV%H_to_kg_m2, &
mandatory=.not.CS%pseudo_salt_may_reinit, Tr_out=CS%tr_ptr)
CS%tr_Reg => tr_Reg
I'm happy to include the above diffs (and the additional flux_units argument) in my branch or in a separate PR (either here or to dev/ncar) if this is indeed a bug rather than a feature. If there are edge-cases not accounted for in my fix, I can address those as well.
The text was updated successfully, but these errors were encountered:
The proposed changes look to me like a good idea. There is one minor simplification, though, that could be made, if we note that the variable GV%H_to_mks takes the two expressions in the proposed new variable conv2salt, which would let us avoid the need to have Boussinesq or non-Boussenesq options in this part of the code.
I've been working on a fix for #1545 and testing via the
MOM_CFC_cap.F90
andpseudo_salt_tracer.F90
modules. I'm in the process of bringing the February changes tomain
onto my branch, and making sure my branch can pass dimensional scaling tests. In doing so, I noticed a small discrepancy in how units are set when salt and pseudosalt are registered. Here is theregister_tracer()
call for salt:vs the same call for pseudosalt:
The code mods below bring
flux_scale
,convergence_units
, andconvergence_scale
into agreement between the two (but I am now noticing that I should also setflux_units
):I'm happy to include the above diffs (and the additional
flux_units
argument) in my branch or in a separate PR (either here or todev/ncar
) if this is indeed a bug rather than a feature. If there are edge-cases not accounted for in my fix, I can address those as well.The text was updated successfully, but these errors were encountered: