NCAR / ccpp-framework

Common Community Physics Package (CCPP)
http://www.dtcenter.org/community-code/common-community-physics-package-ccpp/
Other
26 stars 64 forks source link

Debug checks output unreadable writes #590

Open gold2718 opened 2 months ago

gold2718 commented 2 months ago

Description

In the following code snipped (from the ccpp_temp_suite_cap.F90 generated from the capgen test). There are multiple writes to errmsg but only the last one has an effect.

Steps to Reproduce

Provide the tag or hash of the CCPP Framework used to reproduce the bug Have you make any modifications to the CCPP Framework code?

Please provide detailed steps for reproducing the issue.

  1. Check out the develop branch (I used af90b948b85b88649547b49d28ba98fd5cb8c4b1)
  2. From the ccpp root, run ./test/capgen_test/run_test --cleanup NEVER
  3. Look at ct_build/ccpp/ccpp_temp_suite_cap.F90

Output

         ! ##################################################################
         ! Begin debug tests
         ! ##################################################################

         ! Check size of array coeffs
         if (size(coeffs(:)) /= 1*(ncols-1+1)) then
            write(errmsg, '(a)')                                                                  &
                 'In group temp_suite_timestep_initial before setup_coeffs_timestep_init:'
            write(errmsg, '(2(a,i8))') 'for array coeffs, expected size ', 1*(ncols-1+1),         &
                 ' but got ', size(coeffs)
            errflg = 1
            return
         end if