-
Notifications
You must be signed in to change notification settings - Fork 3
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
Remove GOTO statements from the Fortran code (bugzilla #310) #4
Comments
Better command for counting (?) for file in |
Clarification on the commands -- grep -ri 'go *to' . | grep -v -e '^c' -e '^!' | wc -l
The second command does a better job of searching only fortran codes and not finding 'go to' in comments |
|
Removing dead code reduces the number by 159:
|
RTOFS v2.5.0 gotos reduced from 1181 to 1172
|
From http://www2.spa.ncep.noaa.gov/bugzilla/show_bug.cgi?id=310
[NCO] 20150827
Please replace GOTO statements with more structured constants (if blocks, do loops, case blocks).
Current number of GOTO statements:
grep -ri 'go *to' /nwpara2/rtofs_glo.v1.1.0/sorc | grep -v -e '^c' -e '^!' | wc -l
62
[EMC] 20200804
Note that not any of the below GOTOs are either assigned or computed.
GOTOs have been reduced in EMC codes.
In both V1 and V2
rtofs_archv2netCDF.fd 35 35
rtofs_atmforcing_correct.fd 0 0
rtofs_atmforcing.fd 1 0
rtofs_getkpds.fd 0 0
rtofs_hycom2raw8.fd 1 1
rtofs_hycom_expr.fd 2 0
rtofs_nc2grb2.fd 0 0
rtofs_hycomiot (library) 0 0
rtofs_mpi_mods (library) 0 0
39 36
REMOVED in V2
rtofs_cice_stat.fd 0 n/a
rtofs_hycom_extract.fd 2 n/a
rtofs_hycom_range.fd 1 n/a
rtofs_restart2archv.fd 20 n/a
23 0
NEW to V2
rtofs_hycom_diff.fd n/a 3
*rtofs_ncoda_archv_inc.fd n/a 19
rtofs_raw2hycom.fd n/a 1
0 23
TOTAL for EMC codes 62 59
3rd party codes
**HYCOM 162 98
*NCODA n/a 330
OVERALL TOTAL 224 487
** Community HYCOM codes with improvements.
[NCO] 20201123
Please continue to improve "go to" usage at next upgrade.
There are 571 GO TOs in this para version, while there are 260 GO TOs in current production rtofs_glo.v1.3.0. Bugzilla ticket is updated.
Prod rtofs_glo.v1.3.0 260 -
rtofs_archv2netCDF.fd 35, rtofs_atmforcing_correct.fd 0,
rtofs_atmforcing.fd 1, rtofs_cice_stat.fd 0, rtofs_getkpds.fd 0,
rtofs_hycom2raw8.fd 1, rtofs_hycom_expr.fd 2, rtofs_hycom_extract.fd 2,
rtofs_hycom_range.fd 1, rtofs_nc2grb2.fd 0, rtofs_restart2archv.fd 20,
rtofs_code.v2.2.86F2p0i/sorc 198
Para rtofs_glo.v2.0.6 571 -
rtofs_code.fd 64, rtofs_hycom.fd 108, rtofs_ncoda.fd 399
The text was updated successfully, but these errors were encountered: