ESCOMP / CAM-SIMA

Community Atmosphere Model - System for Integrated Modeling of the Atmosphere
4 stars 12 forks source link

Remove or rename runtime_opts.F90 #212

Open nusbaume opened 1 year ago

nusbaume commented 1 year ago

Issue Type

Code Clean-up

Issue Description

Currently in CAMDEN there is both a runtime_obj.F90 and runtime_opts.F90 module, with the runtime_opts.F90 containing now only the read_namelist subroutine.

I find it confusing to have two "runtime options" modules. Thus it seems like it would be cleaner if either read_namelist is added to runtime_obj and remove runtime_opts, or just rename runtime_opts to read_namelist.

Will this change answers?

No

Will you be implementing this yourself?

Any Software Engineer can do this

nusbaume commented 1 year ago

After bringing this up with the other AMP SEs it was decided to simply rename the runtime_opts.F90 file and module to read_namelist.F90, in order to avoid any confusion with the runtime_obj module.

mwaxmonsky commented 6 months ago

Is there a rule in Fortran where a module cannot have a member with the same name? I renamed the file and module runtime_opts to read_namelist but am getting the following errors when building:

Building atm with output to /scratch/cluster/mwaxmonsky/read_namelist_patch/bld/atm.bldlog.240510-074446
/home/mwaxmonsky/source/CAM-SIMA-mwaxmonsky/src/control/read_namelist.F90(16): error #6413: This global name is invalid in this context.   [READ_NAMELIST]

/home/mwaxmonsky/source/CAM-SIMA-mwaxmonsky/src/control/read_namelist.F90(22): error #6645: The name of the module procedure conflicts with a name in the encompassing scoping unit.   [READ_NAMELIST]

/home/mwaxmonsky/source/CAM-SIMA-mwaxmonsky/src/control/read_namelist.F90(16): error #6413: This global name is invalid in this context.   [READ_NAMELIST]

/home/mwaxmonsky/source/CAM-SIMA-mwaxmonsky/src/control/read_namelist.F90(22): error #6645: The name of the module procedure conflicts with a name in the encompassing scoping unit.   [READ_NAMELIST]
nusbaume commented 6 months ago

Ahh yeah, I think there is a rule, at least without additional keywords. To resolve it I would just rename the module/file name to read_namelist_mod.F90. Of course if that also doesn't work then let me know!