Welcome to the forums. Please post in English or French.

You are not logged in.

#1 2016-06-10 14:11:10

jstadler
Member
Registered: 2016-04-15
Posts: 15

[SOLVED] OGACA Migration

Dear Forum,


I am currently writing my masters thesis about topology optimization with Code_Aster. I tumbled upon the OGACA code from Frédéric Renou (http://www.code-aster.org/V2/spip.php?article314) and am trying to update the code to the current stable version. Since the original code was written in an older than 11.4 version, modified files are written in FORTRAN77. I managed to translate the files to FORTRAN90 in regards to the syntax, but there were further changes in some libraries, which now result in either a 'type mismatch' error or and 'implicit interface' error. I ran aslint on the op0062.F90 file to check for errors. These were as follows:

bibfor/op/op0062.F90:I8801: Person in charge: email@domain.com
bibfor/op/op0062.F90:E0101: Type mismatch at 183,37 for 'vect': 'INTEGER(8) to CHARACTER(1)'
bibfor/op/op0062.F90:E0101: Type mismatch at 189,41 for 'vect': 'INTEGER(8) to CHARACTER(1)'
bibfor/op/op0062.F90:C0308: Call with an implicit interface: 'u2mess'
bibfor/op/op0062.F90:E0101: Type mismatch at 230,43 for 'repi': 'CHARACTER(1) to INTEGER(8)'
bibfor/op/op0062.F90:E0103: Rank mismatch at 239,22 for 'lima': [VarName]
bibfor/op/op0062.F90:E0101: Type mismatch at 244,40 for 'vect': 'INTEGER(8) to CHARACTER(1)'
bibfor/op/op0062.F90:E0101: Type mismatch at 249,51 for 'repi': 'CHARACTER(1) to INTEGER(8)'
bibfor/op/op0062.F90:E0101: Type mismatch at 255,37 for 'vect': 'INTEGER(8) to REAL(8)'
bibfor/op/op0062.F90:E0101: Type mismatch at 259,34 for 'vect': 'INTEGER(8) to REAL(8)'
bibfor/op/op0062.F90:E0101: Type mismatch at 267,38 for 'vect': 'INTEGER(8) to CHARACTER(1)'
bibfor/op/op0062.F90:E0101: Type mismatch at 304,55 for 'dupcol': 'LOGICAL(8) to LOGICAL(1)'
bibfor/op/op0062.F90:E0101: Type mismatch at 305,55 for 'dupcol': 'LOGICAL(8) to LOGICAL(1)'
bibfor/op/op0062.F90:E0101: Type mismatch at 307,53 for 'dupcol': 'LOGICAL(8) to LOGICAL(1)'
bibfor/op/op0062.F90:E0101: Type mismatch at 310,61 for 'dupcol': 'LOGICAL(8) to LOGICAL(1)'
bibfor/op/op0062.F90:E0101: Type mismatch at 320,38 for 'vect': 'INTEGER(8) to CHARACTER(1)'
bibfor/op/op0062.F90:E0101: Type mismatch at 324,36 for 'vect': 'INTEGER(8) to REAL(8)'
bibfor/op/op0062.F90:C0308: Call with an implicit interface: 'u2mess'
bibfor/op/op0062.F90:C0308: Call with an implicit interface: 'u2mesk'
bibfor/op/op0062.F90:C0308: Call with an implicit interface: 'u2mesg'
bibfor/op/op0062.F90:E0101: Type mismatch at 385,54 for 'repi': 'CHARACTER(1) to INTEGER(8)'
bibfor/op/op0062.F90:E0101: Type mismatch at 399,52 for 'repi': 'CHARACTER(1) to INTEGER(8)'
bibfor/op/op0062.F90:I1508: Recommendation: 3 digits max. for labels at 405,1: 1000         CONTINUE
bibfor/op/op0062.F90:E0103: Rank mismatch at 411,27 for 'lima': [VarName]
bibfor/op/op0062.F90:E0101: Type mismatch at 440,51 for 'repi': 'CHARACTER(1) to INTEGER(8)'
bibfor/op/op0062.F90:I1508: Recommendation: 3 digits max. for labels at 446,1: 1500         CONTINUE
bibfor/op/op0062.F90:C0308: Call with an implicit interface: 'u2mess'
bibfor/op/op0062.F90:C0308: Call with an implicit interface: 'u2mess'
bibfor/op/op0062.F90:C0308: Call with an implicit interface: 'u2mesk'
bibfor/op/op0062.F90:C0308: Call with an implicit interface: 'u2mess'
bibfor/op/op0062.F90:C0308: Call with an implicit interface: 'u2mesk'
bibfor/op/op0062.F90:C0308: Call with an implicit interface: 'xprcfl'
bibfor/op/op0062.F90:C0308: Call with an implicit interface: 'u2mesr'
bibfor/op/op0062.F90:W9992: Warning at 610,23: Character length of actual argument shorter than of dummy argument 'cnxinv' (8/19) at (1)
bibfor/op/op0062.F90:W9992: Warning at 622,27: Character length of actual argument shorter than of dummy argument 'dcnxin' (8/19) at (1)
bibfor/op/op0062.F90:W9992: Warning at 654,35: Character length of actual argument shorter than of dummy argument 'cnxinv' (8/19) at (1)
bibfor/op/op0062.F90:W9992: Warning at 660,35: Character length of actual argument shorter than of dummy argument 'cnxinv' (8/19) at (1)
bibfor/op/op0062.F90:C0308: Call with an implicit interface: 'u2mesr'
bibfor/op/op0062.F90:W0413: Equality/inequality comparison for floating-point numbers at 717,8: only relevant after assignment
bibfor/op/op0062.F90:W0413: Equality/inequality comparison for floating-point numbers at 752,8: only relevant after assignment
bibfor/op/op0062.F90:W9992: Warning at 766,1: Nonconforming tab character at (1)
bibfor/op/op0062.F90:E9990: Error at 766,11: Syntax error in WRITE statement at (1)
bibfor/op/op0062.F90:C0308: Call with an implicit interface: 'xprls'
bibfor/op/op0062.F90:C0308: Call with an implicit interface: 'xprrei'
bibfor/op/op0062.F90:E0101: Type mismatch at 855,54 for 'repi': 'CHARACTER(1) to INTEGER(8)'
bibfor/op/op0062.F90:E0101: Type mismatch at 860,54 for 'repi': 'CHARACTER(1) to INTEGER(8)'
bibfor/op/op0062.F90:E0101: Type mismatch at 865,56 for 'repi': 'CHARACTER(1) to INTEGER(8)'
bibfor/op/op0062.F90:E0101: Type mismatch at 870,56 for 'repi': 'CHARACTER(1) to INTEGER(8)'
bibfor/op/op0062.F90:C0308: Call with an implicit interface: 'xprpls'
bibfor/op/op0062.F90:E0101: Type mismatch at 897,16 for 'noma': 'INTEGER(8) to CHARACTER(1)'
bibfor/op/op0062.F90:I1508: Recommendation: 3 digits max. for labels at 958,1: 2000     CONTINUE
bibfor/op/op0062.F90:W0304: Unused label at 1066,7: '906'
bibfor/op/op0062.F90:W0304: Unused label at 1067,7: '907'
bibfor/op/op0062.F90:C1309: Interface mismatch: interface definition 'OP0062.h' not found
bibfor/op/op0062.F90:C1511: Invalid character, unexpected tabulation '\t'
bibfor/op/op0062.F90:W1501: More than 500 lines: 566 lines
bibfor/op/op0062.F90:C1308: Missing interface file: CNCINV
bibfor/op/op0062.F90:C1308: Missing interface file: CNOCNS
bibfor/op/op0062.F90:C1308: Missing interface file: CNSCNO
bibfor/op/op0062.F90:C1308: Missing interface file: GETRES
bibfor/op/op0062.F90:C1308: Missing interface file: GETVID
bibfor/op/op0062.F90:C1308: Missing interface file: DISMOI
bibfor/op/op0062.F90:C1308: Missing interface file: GETVR8
bibfor/op/op0062.F90:C1308: Missing interface file: GETVTX
bibfor/op/op0062.F90:C1308: Missing interface file: INFDBG
bibfor/op/op0062.F90:C1308: Missing interface file: INFMAJ
bibfor/op/op0062.F90:C1308: Missing interface file: JEDEMA
bibfor/op/op0062.F90:C1308: Missing interface file: JEDETR
bibfor/op/op0062.F90:C1308: Missing interface file: JEDUPO
bibfor/op/op0062.F90:C1308: Missing interface file: JEEXIN
bibfor/op/op0062.F90:C1308: Missing interface file: JELIRA
bibfor/op/op0062.F90:C1308: Missing interface file: JEMARQ
bibfor/op/op0062.F90:C1308: Missing interface file: JEVEUO
bibfor/op/op0062.F90:C1308: Missing interface file: U2MESG
bibfor/op/op0062.F90:C1308: Missing interface file: U2MESK
bibfor/op/op0062.F90:C1308: Missing interface file: U2MESR
bibfor/op/op0062.F90:C1308: Missing interface file: U2MESS
bibfor/op/op0062.F90:C1308: Missing interface file: WKVECT
bibfor/op/op0062.F90:C1308: Missing interface file: XAJULS
bibfor/op/op0062.F90:C1308: Missing interface file: XBASLO
bibfor/op/op0062.F90:C1308: Missing interface file: XENRCH
bibfor/op/op0062.F90:C1308: Missing interface file: XPRCFL
bibfor/op/op0062.F90:C1308: Missing interface file: XPRDOM
bibfor/op/op0062.F90:C1308: Missing interface file: XPRINI
bibfor/op/op0062.F90:C1308: Missing interface file: XPRLS
bibfor/op/op0062.F90:C1308: Missing interface file: XPRMIL
bibfor/op/op0062.F90:C1308: Missing interface file: XPRPLS
bibfor/op/op0062.F90:C1308: Missing interface file: XPRREI
bibfor/op/op0062.F90:C1308: Missing interface file: XPRTOR
report summary:
ERROR   C0308:    15 Call with an implicit interface
ERROR   C1308:    33 Missing interface file
ERROR   C1309:     1 Interface mismatch
ERROR   C1511:     1 Invalid character, unexpected tabulation '\t'
ERROR   E0101:    22 Type mismatch
ERROR   E0103:     2 Rank mismatch
ERROR   E9990:     1 Error
INFO    I1508:     3 Recommendation: 3 digits max. for labels
INFO    I8801:     1 Person in charge
WARNING W0304:     2 Unused label
WARNING W0413:     2 Equality/inequality comparison for floating-point numbers
WARNING W1501:     1 More than 500 lines
WARNING W9992:     5 Warning
ERROR   summary: 75 errors, 10 warnings in 2 files/directories

Then I also tried to use the script in the conversion.py script in the directory devtools/lib/aslint/fortran/examples/ of the devtools repository. When i ran the script, i got following error:

python conversion.py --action=interface -j 4 op0062.F90  op0062.F90
ERROR   please check that the Intel compiler environment is properly set

Since I am not sure, if this is the right syntax, I decided to fix the errors from aslint by hand again. I downloaded an older version of Code_Aster, to compare the i.e. the getvid module of the old and the new version. The problem now is, that this module is not in the old version.

Is there a more convenient way, to migrate the old source code to the new one? Or how is the procedure to update code, which with one is not familiar?


All the best
Johannes

Last edited by jstadler (2016-07-06 13:23:37)


Johannes Stadler
Simscale GmbH
Product Development
www.simscale.com

Offline

#2 2016-06-11 17:51:06

mathieu.courtois
Administrator
From: France
Registered: 2007-11-21
Posts: 1,170

Re: [SOLVED] OGACA Migration

Hello,

I think that the best way is to fix each aslint error.
For example to fix:
bibfor/op/op0062.F90:C1308: Missing interface file: XPRTOR

Just insert:
#include "asterfort/xprtor.h"

for each subroutine called...

MC


Code_Aster release : last unstable on Ubuntu 16.04 64 bits - GNU Compilers

Please do not forget to tag your first post as *SOLVED* when it is!

Offline

#3 2016-06-15 17:17:20

jstadler
Member
Registered: 2016-04-15
Posts: 15

Re: [SOLVED] OGACA Migration

Hello Mathieu,


thanks for your answer. I just wondered, if there was an easier way to do that. I now included all subroutines  and changed the inputs for following subroutines as follows: (I am trying to be as general as possible)

GETVID (also for GETVTX, GET...):
    OLD (v10):
        call GETVID(' ', 'MODELE', 1, 1, 1,NOMO, IBID)
    NEW (v12.4):
        call GETVID(' ', 'MODELE', iocc=1,vect=NOMO, nbret=IBID)

DISMOI:
    OLD (v10):
        call DISMOI(ARRET,QUESTI,NOMOB,TYPECO,REPI,REPK,IERD)
    NEW (v12.4):
        call dismoi(questi, nomob, typeco, repi, repk,arret, ier)

JEDUPO:
    OLD (v10):
        call JEDUPO(FISPRE//'.GROUP_MA_ENRI', 'G', LISMAE, .FALSE.)
    NEW (v12.4):
        call JEDUPO(FISPRE//'.GROUP_MA_ENRI', 'G', LISMAE, .FALSE._1) #also consider changing all logicals to aster_logicals

XPRTOR:
    OLD (v10):
        CALL XPRTOR(METHOD,MODEL,NOMA,CNXINV,FISPRE,&
                                  FISS,VCN,GRLR,CNSLN,GRLN,&
                                  CNSLT,GRLT,TORE,RADTOR,RADIMP,&        
                                  CNSDIS,DISFR,CNSBL,NODCAL,ELECAL,&
                                  LIGGRD,VCNT,GRLRT)
    NEW (v12.4):
        call  xprtor(method, noma, cnxinv, fispre,&
                           fiss, vcn, grlr, cnsln, grln,&
                           cnslt, grlt, tore, radtor, radimp,&
                           cnsdis, disfr, cnsbl, nodcal, elecal,&
                           liggrd, vcnt, grlrt)

XPRPLS:
    OLD (v10):
        CALLXPRPLS(DNOMO,DCNSLN,DCNSLT,NOMO,NOMA,&
                                 CNSLN,CNSLT,GRLN,GRLT,CORRES,&
                                 NDIM,NDOMP,EDOMG)
    NEW (v12.4):
        ligr_noma ='&&OP00xx.LIGMAI'
        call x_tmp_ligr(noma, ligr_noma)
        call  xprpls(ligrel, dnoma, dcnsln, dcnslt, noma,&
                      cnsln, cnslt, grln, grlt, corres,&
                      ndim, ndomp, edomg)

I hope the changes I made are correct and perhaps these informations are of use for others. The procedure is quiet simple. One need to download the source code of the old CA version from bitbucket (https://bitbucket.org/code_aster/codeas … /branches/) and need to compare the old *.f  files with the new *.F90 files. Most subroutines are well commented.

It becomes more complex, when a subroutine is not available anymore. One of them is XPRCFL, which was used to calculate LCMIN. Is there another subroutine, which can be used for that.

For the moment I commented at the call of the XPRCFL subroutine and was abwas to successfully compile CA with the modified source files. I also was able to fix different errors, but then I encountered another problem. In a modified xprini subroutine the subroutine CALCUL is called with a non existent option 'XFEM_SMPLX_INIT':

CALL CALCUL('S','XFEM_SMPLX_INIT',LIGREL,1,LCHIN,LPAIN,2,&
     &                   LCHOUT,LPAOUT,'V','OUI')

It seems like this option was deleted from v11 to v12. Can someone tell me, if there is a fix for it?


All the best
Johannes

Last edited by jstadler (2016-06-24 11:16:05)


Johannes Stadler
Simscale GmbH
Product Development
www.simscale.com

Offline

#4 2016-07-06 13:18:43

jstadler
Member
Registered: 2016-04-15
Posts: 15

Re: [SOLVED] OGACA Migration

Hello Forum,

so I was able to migrate the source code to Code_Aster version 12.4 more or less.I found the file for Opertator 10 (PROPA_FISS), on which PROPA_CHLVL is actually based on. This helped me out a lot. If someone is interested in the files, I am happy to share them. But I am not sure about the functionality yet.

All the best
Johannes


Johannes Stadler
Simscale GmbH
Product Development
www.simscale.com

Offline

#5 2020-08-05 16:37:15

Nidish
Member
Registered: 2020-06-04
Posts: 21

Re: [SOLVED] OGACA Migration

Hello,

I would like to have a look at the files if possible.

Thank you,
Nidish

Offline