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

Martin Losch Martin.Losch at awi.de
Wed Aug 11 12:42:29 EDT 2021


Hi Dan,

without knowing too much about this, there’s already at least one module file in pkg/ptracers/ptracers_dyn_state_mod.F 

So I am not sure if it is just “by luck” that it works for you too, because genmake/makedepend also looks for f90 modules, it seems.

Martin

> On 11. Aug 2021, at 11:47, Daniel Goldberg <dan.goldberg at ed.ac.uk> wrote:
> 
> 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
> 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.
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1665 bytes
Desc: not available
URL: <http://mailman.mitgcm.org/pipermail/mitgcm-support/attachments/20210811/34e981ef/attachment.p7s>


More information about the MITgcm-support mailing list