Ignore:
Timestamp:
Jul 30, 2024, 3:19:21 PM (3 months ago)
Author:
abarral
Message:

Revert removal of COMMON in lmdz_comgeom.f90, lmdz_comgeom2.f90.
This common block is shared and unsafely casts 1D to 2D, and can't as easily be replaced.

Location:
LMDZ6/branches/Amaury_dev/libf/dyn3d_common
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/branches/Amaury_dev/libf/dyn3d_common/lmdz_comgeom.f90

    r5136 r5146  
    11! Replaces comgeom.h
     2
     3! AB 07/24: NOTE: THIS USES A LEGACY COMMON BLOCK SHARED WITH lmdz_comgeom2.f90 !
     4! This file defines a number of 1D arrays.
     5! The COMMON block is used to transparently (but using unsafe procedures) cast those as 2D arrays, without duplication.
     6! Therefore there's no trivial way to turn this into a module without COMMON.
     7! In the future we'd still like to get rid of this COMMON block.
    28
    39MODULE lmdz_comgeom
     
    1420  INCLUDE "dimensions.h"
    1521  INCLUDE "paramet.h"
    16   REAL cu(ip1jmp1), cv(ip1jm), unscu2(ip1jmp1), unscv2(ip1jm), &
     22
     23  COMMON/comgeom/                                                   &
     24          cu(ip1jmp1), cv(ip1jm), unscu2(ip1jmp1), unscv2(ip1jm), &
    1725          aire(ip1jmp1), airesurg(ip1jmp1), aireu(ip1jmp1), &
    1826          airev(ip1jm), unsaire(ip1jmp1), apoln, apols, &
     
    3139          aivscu2gam(ip1jm), aiuscv2gam(ip1jm), xprimu(iip1), xprimv(iip1)
    3240
     41  REAL                                                            &
     42          cu, cv, unscu2, unscv2, aire, airesurg, aireu, airev, unsaire, apoln, &
     43          apols, unsairez, airuscv2, airvscu2, aireij1, aireij2, aireij3, aireij4, &
     44          alpha1, alpha2, alpha3, alpha4, alpha1p2, alpha1p4, alpha2p3, alpha3p4, &
     45          fext, constang, rlatu, rlatv, rlonu, rlonv, cuvscvgam1, cuvscvgam2, &
     46          cvuscugam1, cvuscugam2, cvscuvgam, cuscvugam, unsapolnga1, unsapolnga2&
     47          , unsapolsga1, unsapolsga2, unsair_gam1, unsair_gam2, unsairz_gam, &
     48          aivscu2gam, aiuscv2gam, cuvsurcv, cvsurcuv, cvusurcu, cusurcvu, xprimu&
     49          , xprimv
     50
    3351END MODULE lmdz_comgeom
    3452
  • LMDZ6/branches/Amaury_dev/libf/dyn3d_common/lmdz_comgeom2.f90

    r5136 r5146  
    11! Replaces comgeom2.h
     2
     3! AB 07/24: NOTE: THIS USES A LEGACY COMMON BLOCK SHARED WITH lmdz_comgeom.f90 !
     4! See lmdz_comgeom.f90 comment.
    25
    36MODULE lmdz_comgeom2
     
    1518  INCLUDE "dimensions.h"
    1619  INCLUDE "paramet.h"
    17   REAL                                                   &
     20
     21  COMMON/comgeom/                                                   &
    1822          cu(iip1, jjp1), cv(iip1, jjm), unscu2(iip1, jjp1), unscv2(iip1, jjm), &
    1923          aire(iip1, jjp1), airesurg(iip1, jjp1), aireu(iip1, jjp1), &
     
    3438          , xprimu(iip1), xprimv(iip1)
    3539
     40  REAL                                                               &
     41          cu, cv, unscu2, unscv2, aire, airesurg, aireu, airev, apoln, apols, unsaire &
     42          , unsairez, airuscv2, airvscu2, aireij1, aireij2, aireij3, aireij4, &
     43          alpha1, alpha2, alpha3, alpha4, alpha1p2, alpha1p4, alpha2p3, alpha3p4, &
     44          fext, constang, rlatu, rlatv, rlonu, rlonv, cuvscvgam1, cuvscvgam2, &
     45          cvuscugam1, cvuscugam2, cvscuvgam, cuscvugam, unsapolnga1, &
     46          unsapolnga2, unsapolsga1, unsapolsga2, unsair_gam1, unsair_gam2, &
     47          unsairz_gam, aivscu2gam, aiuscv2gam, cuvsurcv, cvsurcuv, cvusurcu, &
     48          cusurcvu, xprimu, xprimv
     49
    3650END MODULE lmdz_comgeom2
Note: See TracChangeset for help on using the changeset viewer.