[MITgcm-support] using a module instead of a common block?

Daniel Goldberg dan.goldberg at ed.ac.uk
Wed Aug 11 05:47:07 EDT 2021


Hello All

I have been using the STREAMICE package with wrappers to the PETSc library for some time now and the functionality requires global scope for some petsc objects; i have discovered that from petsc 3.8.x on, declarations in common blocks are no longer supported, and one is required to use a code module instead.

i have created a code module file (streamice_petsc_mod.F) and referenced via a "use" statement in pkg/streamice/streamice_cg_solve_petsc.F. This compiles, and works! -- but i was curious and it seems that, by luck, the module file is complied before the code file that references it. I think this is because streamice_petsc_mod.F is in a separate code folder. I have tested and if the compilation is in the reverse order, there is a compilation error.

Is there any way to ensure that in the genmake2-generated makefile, any module file of interest is compiled first, or before other files of interest? Would it involve adding functionality to genmake2?

Many thanks
Dan

--
--- PLEASE NOTE THAT I AM CURRENTLY WORKING FROM HOME AS A MEASURE OF SOCIAL DISTANCING DURING THE COVID-19 PANDEMIC ---

Daniel Goldberg, PhD
Reader in Glaciology
School of Geosciences, University of Edinburgh
Geography Building, Drummond Street, Edinburgh EH8 9XP


em: dan.goldberg at ed.ac.uk<mailto:dan.goldberg at ed.ac.uk>
web: https://www.geos.ed.ac.uk/homes/dgoldber
The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. Is e buidheann carthannais a th’ ann an Oilthigh Dhùn Èideann, clàraichte an Alba, àireamh clàraidh SC005336.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.mitgcm.org/pipermail/mitgcm-support/attachments/20210811/6eb3f359/attachment.html>


More information about the MITgcm-support mailing list