Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capgen in SCM: Multiple instances of local_name in Group Cap #631

Merged
merged 7 commits into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/metavar.py
Original file line number Diff line number Diff line change
Expand Up @@ -1678,7 +1678,7 @@ def add_variable(self, newvar, run_env, exists_ok=False, gen_unique=False,
# end if
# end if
# Check if local_name exists in Group. If applicable, Create new
# variable with uniquie name. There are two instances when new names are
# variable with unique name. There are two instances when new names are
# created:
# - Same <local_name> used in different DDTs.
# - Different <standard_name> using the same <local_name> in a Group.
Expand Down
4 changes: 4 additions & 0 deletions test/var_compatibility_test/effr_diag.F90
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ subroutine effr_diag_run( effrr_in, scalar_var, errmsg, errflg)

call cmp_effr_diag(effrr_in, effrr_min, effrr_max)

if (scalar_var .ne. 380) then
errmsg = 'ERROR: effr_diag_run(): scalar_var should be 380'
errflg = 1
endif
end subroutine effr_diag_run

subroutine cmp_effr_diag(effr, effr_min, effr_max)
Expand Down
5 changes: 5 additions & 0 deletions test/var_compatibility_test/effr_post.F90
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ subroutine effr_post_run( effrr_inout, scalar_var, errmsg, errflg)
! Do some post-processing on effrr...
effrr_inout(:,:) = effrr_inout(:,:)*1._kind_phys

if (scalar_var .ne. 1013.0) then
errmsg = 'ERROR: effr_post_run(): scalar_var should be 1013.0'
errflg = 1
endif

end subroutine effr_post_run

end module effr_post
5 changes: 5 additions & 0 deletions test/var_compatibility_test/effr_pre.F90
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ subroutine effr_pre_run( effrr_inout, scalar_var, errmsg, errflg)
! Do some pre-processing on effrr...
effrr_inout(:,:) = effrr_inout(:,:)*1._kind_phys

if (scalar_var .ne. 273.15) then
errmsg = 'ERROR: effr_pre_run(): scalar_var should be 273.15'
errflg = 1
endif

end subroutine effr_pre_run

end module effr_pre
5 changes: 4 additions & 1 deletion test/var_compatibility_test/test_host_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ subroutine init_data()
call allocate_physics_state(ncols, pver, phys_state, has_graupel, has_ice)
phys_state%effrr = 1.0E-3 ! 1000 microns, in meter
phys_state%effrl = 1.0E-4 ! 100 microns, in meter
phys_state%scalar_var = 1.0 ! in m
phys_state%scalar_var = 1.0 ! in m
phys_state%scalar_varA = 273.15 ! in K
phys_state%scalar_varB = 1013.0 ! in mb
phys_state%scalar_varC = 380 ! in ppmv
effrs = 5.0E-4 ! 500 microns, in meter
if (has_graupel) then
phys_state%effrg = 2.5E-4 ! 250 microns, in meter
Expand Down