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
Need to move and reorganize significant amount of code/logic from driver and consolidate in their own submodules. Some locations (based on current develop branch) where this is needed is as follows (with suggested module names):
@zmoon I think we have at least in part addressed this organization with latest changes, and with your move from orphaned subroutines to submodules. Do you agree we should close this issue?
drnimbusrain
changed the title
Reorganize code/logic from canopy driver to separate submodules
[Structure] Reorganize code/logic from canopy driver to separate submodules
Sep 6, 2023
@zmoon Any further insight into the notes we discussed briefly here, would be helpful before embarking on this and #32 and #21 issues to restructure code to with more streamlined/APIs, config types, modules, and CCPP interface/drivers. Thanks Zach! Just need some other comments or potential helpful code analogs to get a better start. Thanks!
Need to move and reorganize significant amount of code/logic from driver and consolidate in their own submodules. Some locations (based on current develop branch) where this is needed is as follows (with suggested module names):
Pull out all physical calculations to separate subroutines:
canopy_griddx_mod.F90: https://github.com/noaa-oar-arl/canopy-app/blob/develop/canopy_driver.F90#L189 (Also improve the dx calculation to be dependent on grid cell lat/lon using haversine formula for distance between two points).
canopy_foliage_mod.F90: https://github.com/noaa-oar-arl/canopy-app/blob/develop/canopy_driver.F90#L255
canopy_flameh_mod.F90: https://github.com/noaa-oar-arl/canopy-app/blob/develop/canopy_driver.F90#L288
Could also make a netcdf_io module based on NACC to read netcdf inputs: https://github.com/noaa-oar-arl/NACC/blob/master/parallel/src/netcdf_io_mod.f90
canopy_txt_io_mod.F90 (for inputting/reading text file data)
canopy_netcdf_io_mod.F90 (for inputting/reading netcdf file data)
After Issue Adding NetCDF Input/Output File Options #22 is completed, the output creation could be moved to txt and netcdf output modules:
canopy_outncf.F90: Based on NACC: https://github.com/noaa-oar-arl/NACC/blob/master/parallel/src/outncf.f90
canopy_outtxt.F90: https://github.com/noaa-oar-arl/canopy-app/blob/develop/canopy_driver.F90#L333
After Issue [Structure] Adding Config Types #21 is completed, anything else about choosing which things to calculate based on the config or calling computation routines could be consolidated into a subroutine to call on the inputs and config:
canopy_input_mod.F90: https://github.com/noaa-oar-arl/canopy-app/blob/develop/canopy_driver.F90#L278
@zmoon
@drnimbusrain
The text was updated successfully, but these errors were encountered: