I have been trying to modify an existing "calc" algorithm using the instructions in the online help guide. The online help guide says the original "calc" algorithms should be in the etc/gfe/BASE/smartInit folder when the program is built. However, when my GFE was built there was no smartInit folder created. Furthermore, when I place my new "calc" file (called MyNAM12.py) in the etc/gfe/SITE/ folder (and add a reference to it in localConfig.py), I get an error from ifpServer saying:
IFPDaemon.C 120 EVENT: === Begin Processing. ===
GridParmMgr.C 1124 EVENT: New D2D Database: ABQ_GRID_D2D_NAM12_20190213_0600
RunInit.C 158 EVENT: Starting init for NAM12 20190213_0600
Init.py 1092 PROBLEM: Can't load module for MyNAM12
Traceback (most recent call last):
File "libs/pylib/ifp/init/Init.py", line 1089, in main
File "/usr/lib64/python3.6/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap="">", line 994, in _gcd_import
File "<frozen importlib._bootstrap="">", line 971, in _find_and_load
File "<frozen importlib._bootstrap="">", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'ifp.init.MyNAM12'</frozen></frozen></frozen>
The ifp.init.MyNAM12 seems to be trying to reference a folder from the source code, not the compiled program. I see no ifp.init directory path anywhere in the compiled program. How would one get the GFE to recognize this new MyNAM12 file?
Ah, yea. This may be troublesome at the moment. I've been moving alot of the gfe's python code into packages (the gfe used python before python even had packages :). So, all of the init code is not in a package called ifp.init.
Also, depending on exactly what you are trying to do, there may be an easier way to get grids into the ifpServer using one of the many web interfaces (such as XMLRPC). The init system was kinda a workaround for all the NCEP data that needed to be adjusted for units and to be relavent at the surface. If you have data that is already suitable (does not need alot of processing) then it can be injected more directly.